LEFT | RIGHT |
1 // | 1 // |
2 // GTMWindowSheetController.h | 2 // GTMWindowSheetController.h |
3 // | 3 // |
4 // Copyright 2009 Google Inc. | 4 // Copyright 2009 Google Inc. |
5 // | 5 // |
6 // Licensed under the Apache License, Version 2.0 (the "License"); you may not | 6 // Licensed under the Apache License, Version 2.0 (the "License"); you may not |
7 // use this file except in compliance with the License. You may obtain a copy | 7 // use this file except in compliance with the License. You may obtain a copy |
8 // of the License at | 8 // of the License at |
9 // | 9 // |
10 // http://www.apache.org/licenses/LICENSE-2.0 | 10 // http://www.apache.org/licenses/LICENSE-2.0 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 modalForView:(NSView*)view | 98 modalForView:(NSView*)view |
99 modalDelegate:(id)modalDelegate | 99 modalDelegate:(id)modalDelegate |
100 didEndSelector:(SEL)didEndSelector | 100 didEndSelector:(SEL)didEndSelector |
101 contextInfo:(void *)contextInfo; | 101 contextInfo:(void *)contextInfo; |
102 | 102 |
103 // Starts a view modal session for a sheet, with the ability to specify a | 103 // Starts a view modal session for a sheet, with the ability to specify a |
104 // selector for |view| to give the frame. Otherwise identical to | 104 // selector for |view| to give the frame. Otherwise identical to |
105 // -beginSheet:modalForView:modalDelegate:didEndSelector:contextInfo: (above). | 105 // -beginSheet:modalForView:modalDelegate:didEndSelector:contextInfo: (above). |
106 // | 106 // |
107 // Args: | 107 // Args: |
108 // sheet: The window object representing the sheet you want to | 108 // sheet: The window object representing the sheet you want to |
109 // display. | 109 // display. |
110 // view: The view object to which you want to attach the sheet. | 110 // view: The view object to which you want to attach the sheet. |
111 // frameSelector: The method to call on the view object to obtain the | 111 // frameSelector: The method to call on the view object to obtain the |
112 // rectangle over which the sheet will be modal. This method | 112 // rectangle over which the sheet will be modal; defaults to |
113 // must return an NSRect in the view's superview's | 113 // -frame if nil. This method must return an NSRect in the |
114 // coordinates (and take no arguments). | 114 // view's superview's coordinates (and take no arguments). |
115 // modalDelegate: The delegate object that defines your didEndSelector | 115 // positionSelector: If non-nil, the method to call on the view object to |
116 // method. | 116 // position the sheet. This method must have the following |
117 // didEndSelector: The method on the modalDelegate that will be called when | 117 // signature: |
118 // the sheet’s modal session has ended. This method must be | 118 // -(NSRect)positionSheet:(NSWindow *)sheet |
119 // defined on the object in the modalDelegate parameter and | 119 // usingRect:(NSRect)defaultSheetRect; |
120 // have the following signature: | 120 // (similar to -window:willPositionSheet:usingRect:), where |
121 // - (void)sheetDidEnd:(NSWindow *)sheet | 121 // defaultSheetRect is in the coordinates relative to the |
122 // returnCode:(NSInteger)returnCode | 122 // frame given by the frameSelector. |
123 // contextInfo:(void *)contextInfo; | 123 // modalDelegate: The delegate object that defines your didEndSelector |
124 // contextInfo: A pointer to the context info you want passed to the | 124 // method. |
125 // didEndSelector method when the sheet’s modal session ends. | 125 // didEndSelector: The method on the modalDelegate that will be called when |
| 126 // the sheet’s modal session has ended. This method must be |
| 127 // defined on the object in the modalDelegate parameter and |
| 128 // have the following signature: |
| 129 // - (void)sheetDidEnd:(NSWindow *)sheet |
| 130 // returnCode:(NSInteger)returnCode |
| 131 // contextInfo:(void *)contextInfo; |
| 132 // contextInfo: A pointer to the context info you want passed to the |
| 133 // didEndSelector method when the sheet’s modal session |
| 134 // ends. |
126 // | 135 // |
127 - (void)beginSheet:(NSWindow*)sheet | 136 - (void)beginSheet:(NSWindow*)sheet |
128 modalForView:(NSView*)view | 137 modalForView:(NSView*)view |
129 frameSelector:(SEL)frameSelector | 138 frameSelector:(SEL)frameSelector |
| 139 positionSelector:(SEL)positionSelector |
130 modalDelegate:(id)modalDelegate | 140 modalDelegate:(id)modalDelegate |
131 didEndSelector:(SEL)didEndSelector | 141 didEndSelector:(SEL)didEndSelector |
132 contextInfo:(void *)contextInfo; | 142 contextInfo:(void *)contextInfo; |
133 | 143 |
134 // Starts a view modal session for a system sheet. Just about any AppKit class | 144 // Starts a view modal session for a system sheet. Just about any AppKit class |
135 // that has an instance method named something like -beginSheetModalForWindow... | 145 // that has an instance method named something like -beginSheetModalForWindow... |
136 // will work with this method. | 146 // will work with this method. |
137 // | 147 // |
138 // Args: | 148 // Args: |
139 // systemSheet: The object that will show a sheet when triggered | 149 // systemSheet: The object that will show a sheet when triggered |
140 // appropriately. | 150 // appropriately. |
141 // view: The view object to which you want to attach the sheet. | 151 // view: The view object to which you want to attach the sheet. |
142 // modalDelegate: The delegate object that defines your didEndSelector | 152 // modalDelegate: The delegate object that defines your didEndSelector |
143 // method. | 153 // method. |
144 // params: The parameters of the -beginSheetModalForWindow... selector. | 154 // params: The parameters of the -beginSheetModalForWindow... selector. |
145 // For the parameter named "window", insert [NSNull null] into | 155 // For the parameter named "window", insert [NSNull null] into |
146 // the array instead. | 156 // the array instead. |
147 // | 157 // |
148 - (void)beginSystemSheet:(id)systemSheet | 158 - (void)beginSystemSheet:(id)systemSheet |
149 modalForView:(NSView*)view | 159 modalForView:(NSView*)view |
150 withParameters:(NSArray*)params; | 160 withParameters:(NSArray*)params; |
151 | 161 |
152 // Starts a view modal session for a system sheet, with the ability to specify a | 162 // Starts a view modal session for a system sheet, with the ability to specify a |
153 // selector for |view| to give the frame. Otherwise identical to | 163 // selector for |view| to give the frame. Otherwise identical to |
154 // -beginSystemSheet:modalForView:withParameters: (above). | 164 // -beginSystemSheet:modalForView:withParameters: (above). |
155 // | 165 // |
156 // Args: | 166 // Args: |
157 // systemSheet: The object that will show a sheet when triggered | 167 // systemSheet: The object that will show a sheet when triggered |
158 // appropriately. | 168 // appropriately. |
159 // view: The view object to which you want to attach the sheet. | 169 // view: The view object to which you want to attach the sheet. |
160 // frameSelector: The method to call on the view object to obtain the | 170 // frameSelector: The method to call on the view object to obtain the |
161 // rectangle over which the sheet will be modal. This method | 171 // rectangle over which the sheet will be modal; defaults to |
162 // must return an NSRect in the view's superview's | 172 // -frame if nil. This method must return an NSRect in the |
163 // coordinates (and take no arguments). | 173 // view's superview's coordinates (and take no arguments). |
164 // modalDelegate: The delegate object that defines your didEndSelector | 174 // positionSelector: If non-nil, the method to call on the view object to |
165 // method. | 175 // position the sheet. This method must have the following |
166 // params: The parameters of the -beginSheetModalForWindow... selector. | 176 // signature: |
167 // For the parameter named "window", insert [NSNull null] into | 177 // -(NSRect)positionSheet:(NSWindow *)sheet |
168 // the array instead. | 178 // usingRect:(NSRect)defaultSheetRect; |
| 179 // (similar to -window:willPositionSheet:usingRect:), where |
| 180 // defaultSheetRect is in the coordinates relative to the |
| 181 // frame given by the frameSelector. |
| 182 // modalDelegate: The delegate object that defines your didEndSelector |
| 183 // method. |
| 184 // params: The parameters of the -beginSheetModalForWindow... |
| 185 // selector. For the parameter named "window", insert |
| 186 // [NSNull null] into the array instead. |
169 // | 187 // |
170 - (void)beginSystemSheet:(id)systemSheet | 188 - (void)beginSystemSheet:(id)systemSheet |
171 modalForView:(NSView*)view | 189 modalForView:(NSView*)view |
172 frameSelector:(SEL)frameSelector | 190 frameSelector:(SEL)frameSelector |
| 191 positionSelector:(SEL)positionSelector |
173 withParameters:(NSArray*)params; | 192 withParameters:(NSArray*)params; |
174 | 193 |
175 // Returns a BOOL value indicating whether the specified view has a sheet | 194 // Returns a BOOL value indicating whether the specified view has a sheet |
176 // attached to it (hidden or not). | 195 // attached to it (hidden or not). |
177 // | 196 // |
178 // Args: | 197 // Args: |
179 // view: The view object to which a sheet might be attached. | 198 // view: The view object to which a sheet might be attached. |
180 // | 199 // |
181 // Returns: | 200 // Returns: |
182 // Whether or not a sheet is indeed attached to that view. | 201 // Whether or not a sheet is indeed attached to that view. |
183 // | 202 // |
184 - (BOOL)isSheetAttachedToView:(NSView*)view; | 203 - (BOOL)isSheetAttachedToView:(NSView*)view; |
185 | 204 |
186 // Returns a list of views that have sheets attached (hidden or not). | 205 // Returns a list of views that have sheets attached (hidden or not). |
187 // | 206 // |
188 // Returns: | 207 // Returns: |
189 // An array of views that have sheets. | 208 // An array of views that have sheets. |
190 // | 209 // |
191 - (NSArray*)viewsWithAttachedSheets; | 210 - (NSArray*)viewsWithAttachedSheets; |
192 | 211 |
193 // Sets the specified view as active. The sheet (if there is one) for the active | 212 // Sets the specified view as active. The sheet (if there is one) for the active |
194 // view is shown; sheets for all other views are hidden. | 213 // view is shown; sheets for all other views are hidden. |
195 // | 214 // |
196 // Args: | 215 // Args: |
197 // view: The view object to which a sheet is attached. | 216 // view: The view object to which a sheet is attached. |
198 // | 217 // |
199 - (void)setActiveView:(NSView*)view; | 218 - (void)setActiveView:(NSView*)view; |
200 @end | 219 @end |
LEFT | RIGHT |