initial import
[vuplus_webkit] / Source / WebKit / mac / WebView / WebUIDelegate.h
1 /*
2  * Copyright (C) 2003, 2004, 2005, 2006 Apple Computer, Inc.  All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  *
8  * 1.  Redistributions of source code must retain the above copyright
9  *     notice, this list of conditions and the following disclaimer. 
10  * 2.  Redistributions in binary form must reproduce the above copyright
11  *     notice, this list of conditions and the following disclaimer in the
12  *     documentation and/or other materials provided with the distribution. 
13  * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
14  *     its contributors may be used to endorse or promote products derived
15  *     from this software without specific prior written permission. 
16  *
17  * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
18  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20  * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
21  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  */
28
29 #import <Cocoa/Cocoa.h>
30 #import <Foundation/NSURLRequest.h>
31 #import <JavaScriptCore/WebKitAvailability.h>
32
33 /*!
34     @enum WebMenuItemTag
35     @discussion Each menu item in the default menu items array passed in
36     contextMenuItemsForElement:defaultMenuItems: has its tag set to one of the WebMenuItemTags.
37     When iterating through the default menu items array, use the tag to differentiate between them.
38 */
39
40 enum {
41     WebMenuItemTagOpenLinkInNewWindow=1,
42     WebMenuItemTagDownloadLinkToDisk,
43     WebMenuItemTagCopyLinkToClipboard,
44     WebMenuItemTagOpenImageInNewWindow,
45     WebMenuItemTagDownloadImageToDisk,
46     WebMenuItemTagCopyImageToClipboard,
47     WebMenuItemTagOpenFrameInNewWindow,
48     WebMenuItemTagCopy,
49     WebMenuItemTagGoBack,
50     WebMenuItemTagGoForward,
51     WebMenuItemTagStop,
52     WebMenuItemTagReload,
53     WebMenuItemTagCut,
54     WebMenuItemTagPaste,
55     WebMenuItemTagSpellingGuess,
56     WebMenuItemTagNoGuessesFound,
57     WebMenuItemTagIgnoreSpelling,
58     WebMenuItemTagLearnSpelling,
59     WebMenuItemTagOther,
60     WebMenuItemTagSearchInSpotlight,
61     WebMenuItemTagSearchWeb,
62     WebMenuItemTagLookUpInDictionary,
63     WebMenuItemTagOpenWithDefaultApplication,
64     WebMenuItemPDFActualSize,
65     WebMenuItemPDFZoomIn,
66     WebMenuItemPDFZoomOut,
67     WebMenuItemPDFAutoSize,
68     WebMenuItemPDFSinglePage,
69     WebMenuItemPDFFacingPages,
70     WebMenuItemPDFContinuous,
71     WebMenuItemPDFNextPage,
72     WebMenuItemPDFPreviousPage,
73 };
74
75 /*!
76     @enum WebDragDestinationAction
77     @abstract Actions that the destination of a drag can perform.
78     @constant WebDragDestinationActionNone No action
79     @constant WebDragDestinationActionDHTML Allows DHTML (such as JavaScript) to handle the drag
80     @constant WebDragDestinationActionEdit Allows editable documents to be edited from the drag
81     @constant WebDragDestinationActionLoad Allows a location change from the drag
82     @constant WebDragDestinationActionAny Allows any of the above to occur
83 */
84 typedef enum {
85     WebDragDestinationActionNone    = 0,
86     WebDragDestinationActionDHTML   = 1,
87     WebDragDestinationActionEdit    = 2,
88     WebDragDestinationActionLoad    = 4,
89     WebDragDestinationActionAny     = UINT_MAX
90 } WebDragDestinationAction;
91
92 /*!
93     @enum WebDragSourceAction
94     @abstract Actions that the source of a drag can perform.
95     @constant WebDragSourceActionNone No action
96     @constant WebDragSourceActionDHTML Allows DHTML (such as JavaScript) to start a drag
97     @constant WebDragSourceActionImage Allows an image drag to occur
98     @constant WebDragSourceActionLink Allows a link drag to occur
99     @constant WebDragSourceActionSelection Allows a selection drag to occur
100     @constant WebDragSourceActionAny Allows any of the above to occur
101 */
102 typedef enum {
103     WebDragSourceActionNone         = 0,
104     WebDragSourceActionDHTML        = 1,
105     WebDragSourceActionImage        = 2,
106     WebDragSourceActionLink         = 4,
107     WebDragSourceActionSelection    = 8,
108     WebDragSourceActionAny          = UINT_MAX
109 } WebDragSourceAction;
110
111 /*!
112     @protocol WebOpenPanelResultListener
113     @discussion This protocol is used to call back with the results of
114     the file open panel requested by runOpenPanelForFileButtonWithResultListener:
115 */
116 @protocol WebOpenPanelResultListener <NSObject>
117
118 /*!
119     @method chooseFilename:
120     @abstract Call this method to return a filename from the file open panel.
121     @param fileName
122 */
123 - (void)chooseFilename:(NSString *)fileName;
124
125 /*!
126     @method chooseFilenames:
127     @abstract Call this method to return an array of filenames from the file open panel.
128     @param fileNames
129 */
130 - (void)chooseFilenames:(NSArray *)fileNames WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_IN_WEBKIT_VERSION_4_0);
131
132 /*!
133     @method cancel
134     @abstract Call this method to indicate that the file open panel was cancelled.
135 */
136 - (void)cancel;
137
138 @end
139
140 @class WebView;
141
142 /*!
143     @category WebUIDelegate
144     @discussion A class that implements WebUIDelegate provides
145     window-related methods that may be used by Javascript, plugins and
146     other aspects of web pages. These methods are used to open new
147     windows and control aspects of existing windows.
148 */
149 @interface NSObject (WebUIDelegate)
150
151 /*!
152     @method webView:createWebViewWithRequest:
153     @abstract Create a new window and begin to load the specified request.
154     @discussion The newly created window is hidden, and the window operations delegate on the
155     new WebViews will get a webViewShow: call.
156     @param sender The WebView sending the delegate method.
157     @param request The request to load.
158     @result The WebView for the new window.
159 */
160 - (WebView *)webView:(WebView *)sender createWebViewWithRequest:(NSURLRequest *)request;
161
162 /*!
163     @method webViewShow:
164     @param sender The WebView sending the delegate method.
165     @abstract Show the window that contains the top level view of the WebView,
166     ordering it frontmost.
167     @discussion This will only be called just after createWindowWithRequest:
168     is used to create a new window.
169 */
170 - (void)webViewShow:(WebView *)sender;
171
172 /*!
173     @method webView:createWebViewModalDialogWithRequest:
174     @abstract Create a new window and begin to load the specified request.
175     @discussion The newly created window is hidden, and the window operations delegate on the
176     new WebViews will get a webViewShow: call.
177     @param sender The WebView sending the delegate method.
178     @param request The request to load.
179     @result The WebView for the new window.
180 */
181 - (WebView *)webView:(WebView *)sender createWebViewModalDialogWithRequest:(NSURLRequest *)request;
182
183 /*!
184     @method webViewRunModal:
185     @param sender The WebView sending the delegate method.
186     @abstract Show the window that contains the top level view of the WebView,
187     ordering it frontmost. The window should be run modal in the application.
188     @discussion This will only be called just after createWebViewModalDialogWithRequest:
189     is used to create a new window.
190 */
191 - (void)webViewRunModal:(WebView *)sender;
192
193 /*!
194     @method webViewClose:
195     @abstract Close the current window. 
196     @param sender The WebView sending the delegate method.
197     @discussion Clients showing multiple views in one window may
198     choose to close only the one corresponding to this
199     WebView. Other clients may choose to ignore this method
200     entirely.
201 */
202 - (void)webViewClose:(WebView *)sender;
203
204 /*!
205     @method webViewFocus:
206     @abstract Focus the current window (i.e. makeKeyAndOrderFront:).
207     @param The WebView sending the delegate method.
208     @discussion Clients showing multiple views in one window may want to
209     also do something to focus the one corresponding to this WebView.
210 */
211 - (void)webViewFocus:(WebView *)sender;
212
213 /*!
214     @method webViewUnfocus:
215     @abstract Unfocus the current window.
216     @param sender The WebView sending the delegate method.
217     @discussion Clients showing multiple views in one window may want to
218     also do something to unfocus the one corresponding to this WebView.
219 */
220 - (void)webViewUnfocus:(WebView *)sender;
221
222 /*!
223     @method webViewFirstResponder:
224     @abstract Get the first responder for this window.
225     @param sender The WebView sending the delegate method.
226     @discussion This method should return the focused control in the
227     WebView's view, if any. If the view is out of the window
228     hierarchy, this might return something than calling firstResponder
229     on the real NSWindow would. It's OK to return either nil or the
230     real first responder if some control not in the window has focus.
231 */
232 - (NSResponder *)webViewFirstResponder:(WebView *)sender;
233
234 /*!
235     @method webView:makeFirstResponder:
236     @abstract Set the first responder for this window.
237     @param sender The WebView sending the delegate method.
238     @param responder The responder to make first (will always be a view)
239     @discussion responder will always be a view that is in the view
240     subhierarchy of the top-level web view for this WebView. If the
241     WebView's top level view is currently out of the view
242     hierarchy, it may be desirable to save the first responder
243     elsewhere, or possibly ignore this call.
244 */
245 - (void)webView:(WebView *)sender makeFirstResponder:(NSResponder *)responder;
246
247 /*!
248     @method webView:setStatusText:
249     @abstract Set the window's status display, if any, to the specified string.
250     @param sender The WebView sending the delegate method.
251     @param text The status text to set
252 */
253 - (void)webView:(WebView *)sender setStatusText:(NSString *)text;
254
255 /*!
256     @method webViewStatusText:
257     @abstract Get the currently displayed status text.
258     @param sender The WebView sending the delegate method.
259     @result The status text
260 */
261 - (NSString *)webViewStatusText:(WebView *)sender;
262
263 /*!
264     @method webViewAreToolbarsVisible:
265     @abstract Determine whether the window's toolbars are currently visible
266     @param sender The WebView sending the delegate method.
267     @discussion This method should return YES if the window has any
268     toolbars that are currently on, besides the status bar. If the app
269     has more than one toolbar per window, for example a regular
270     command toolbar and a favorites bar, it should return YES from
271     this method if at least one is on.
272     @result YES if at least one toolbar is visible, otherwise NO.
273 */
274 - (BOOL)webViewAreToolbarsVisible:(WebView *)sender;
275
276 /*!
277     @method webView:setToolbarsVisible:
278     @param sender The WebView sending the delegate method.
279     @abstract Set whether the window's toolbars are currently visible.
280     @param visible New value for toolbar visibility
281     @discussion Setting this to YES should turn on all toolbars
282     (except for a possible status bar). Setting it to NO should turn
283     off all toolbars (with the same exception).
284 */
285 - (void)webView:(WebView *)sender setToolbarsVisible:(BOOL)visible;
286
287 /*!
288     @method webViewIsStatusBarVisible:
289     @abstract Determine whether the status bar is visible.
290     @param sender The WebView sending the delegate method.
291     @result YES if the status bar is visible, otherwise NO.
292 */
293 - (BOOL)webViewIsStatusBarVisible:(WebView *)sender;
294
295 /*!
296     @method webView:setStatusBarVisible:
297     @abstract Set whether the status bar is currently visible.
298     @param visible The new visibility value
299     @discussion Setting this to YES should show the status bar,
300     setting it to NO should hide it.
301 */
302 - (void)webView:(WebView *)sender setStatusBarVisible:(BOOL)visible;
303
304 /*!
305     @method webViewIsResizable:
306     @abstract Determine whether the window is resizable or not.
307     @param sender The WebView sending the delegate method.
308     @result YES if resizable, NO if not.
309     @discussion If there are multiple views in the same window, they
310     have have their own separate resize controls and this may need to
311     be handled specially.
312 */
313 - (BOOL)webViewIsResizable:(WebView *)sender;
314
315 /*!
316     @method webView:setResizable:
317     @abstract Set the window to resizable or not
318     @param sender The WebView sending the delegate method.
319     @param resizable YES if the window should be made resizable, NO if not.
320     @discussion If there are multiple views in the same window, they
321     have have their own separate resize controls and this may need to
322     be handled specially.
323 */
324 - (void)webView:(WebView *)sender setResizable:(BOOL)resizable;
325
326 /*!
327     @method webView:setFrame:
328     @abstract Set the window's frame rect
329     @param sender The WebView sending the delegate method.
330     @param frame The new window frame size
331     @discussion Even though a caller could set the frame directly using the NSWindow,
332     this method is provided so implementors of this protocol can do special
333     things on programmatic move/resize, like avoiding autosaving of the size.
334 */
335 - (void)webView:(WebView *)sender setFrame:(NSRect)frame;
336
337 /*!
338     @method webViewFrame:
339     @param sender The WebView sending the delegate method.
340     @abstract REturn the window's frame rect
341     @discussion 
342 */
343 - (NSRect)webViewFrame:(WebView *)sender;
344
345 /*!
346     @method webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:
347     @abstract Display a JavaScript alert panel.
348     @param sender The WebView sending the delegate method.
349     @param message The message to display.
350     @param frame The WebFrame whose JavaScript initiated this call.
351     @discussion Clients should visually indicate that this panel comes
352     from JavaScript initiated by the specified frame. The panel should have 
353     a single OK button.
354 */
355 - (void)webView:(WebView *)sender runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame;
356
357 /*!
358     @method webView:runJavaScriptConfirmPanelWithMessage:initiatedByFrame:
359     @abstract Display a JavaScript confirm panel.
360     @param sender The WebView sending the delegate method.
361     @param message The message to display.
362     @param frame The WebFrame whose JavaScript initiated this call.
363     @result YES if the user hit OK, NO if the user chose Cancel.
364     @discussion Clients should visually indicate that this panel comes
365     from JavaScript initiated by the specified frame. The panel should have 
366     two buttons, e.g. "OK" and "Cancel".
367 */
368 - (BOOL)webView:(WebView *)sender runJavaScriptConfirmPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame;
369
370 /*!
371     @method webView:runJavaScriptTextInputPanelWithPrompt:defaultText:initiatedByFrame:
372     @abstract Display a JavaScript text input panel.
373     @param sender The WebView sending the delegate method.
374     @param message The message to display.
375     @param defaultText The initial text for the text entry area.
376     @param frame The WebFrame whose JavaScript initiated this call.
377     @result The typed text if the user hit OK, otherwise nil.
378     @discussion Clients should visually indicate that this panel comes
379     from JavaScript initiated by the specified frame. The panel should have 
380     two buttons, e.g. "OK" and "Cancel", and an area to type text.
381 */
382 - (NSString *)webView:(WebView *)sender runJavaScriptTextInputPanelWithPrompt:(NSString *)prompt defaultText:(NSString *)defaultText initiatedByFrame:(WebFrame *)frame;
383
384 /*!
385     @method webView:runBeforeUnloadConfirmPanelWithMessage:initiatedByFrame:
386     @abstract Display a confirm panel by an "before unload" event handler.
387     @param sender The WebView sending the delegate method.
388     @param message The message to display.
389     @param frame The WebFrame whose JavaScript initiated this call.
390     @result YES if the user hit OK, NO if the user chose Cancel.
391     @discussion Clients should include a message in addition to the one
392     supplied by the web page that indicates. The panel should have 
393     two buttons, e.g. "OK" and "Cancel".
394 */
395 - (BOOL)webView:(WebView *)sender runBeforeUnloadConfirmPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame;
396
397 /*!
398     @method webView:runOpenPanelForFileButtonWithResultListener:
399     @abstract Display a file open panel for a file input control.
400     @param sender The WebView sending the delegate method.
401     @param resultListener The object to call back with the results.
402     @discussion This method is passed a callback object instead of giving a return
403     value so that it can be handled with a sheet.
404 */
405 - (void)webView:(WebView *)sender runOpenPanelForFileButtonWithResultListener:(id<WebOpenPanelResultListener>)resultListener;
406
407 /*!
408     @method webView:runOpenPanelForFileButtonWithResultListener:allowMultipleFiles
409     @abstract Display a file open panel for a file input control that may allow multiple files to be selected.
410     @param sender The WebView sending the delegate method.
411     @param resultListener The object to call back with the results.
412     @param allowMultipleFiles YES if the open panel should allow myltiple files to be selected, NO if not.
413     @discussion This method is passed a callback object instead of giving a return
414     value so that it can be handled with a sheet.
415 */
416 - (void)webView:(WebView *)sender runOpenPanelForFileButtonWithResultListener:(id<WebOpenPanelResultListener>)resultListener allowMultipleFiles:(BOOL)allowMultipleFiles WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_IN_WEBKIT_VERSION_4_0);
417
418 /*!
419     @method webView:mouseDidMoveOverElement:modifierFlags:
420     @abstract Update the window's feedback for mousing over links to reflect a new item the mouse is over
421     or new modifier flags.
422     @param sender The WebView sending the delegate method.
423     @param elementInformation Dictionary that describes the element that the mouse is over, or nil.
424     @param modifierFlags The modifier flags as in NSEvent.
425 */
426 - (void)webView:(WebView *)sender mouseDidMoveOverElement:(NSDictionary *)elementInformation modifierFlags:(NSUInteger)modifierFlags;
427
428 /*!
429     @method webView:contextMenuItemsForElement:defaultMenuItems:
430     @abstract Returns the menu items to display in an element's contextual menu.
431     @param sender The WebView sending the delegate method.
432     @param element A dictionary representation of the clicked element.
433     @param defaultMenuItems An array of default NSMenuItems to include in all contextual menus.
434     @result An array of NSMenuItems to include in the contextual menu.
435 */
436 - (NSArray *)webView:(WebView *)sender contextMenuItemsForElement:(NSDictionary *)element defaultMenuItems:(NSArray *)defaultMenuItems;
437
438 /*!
439     @method webView:validateUserInterfaceItem:defaultValidation:
440     @abstract Controls UI validation
441     @param webView The WebView sending the delegate method
442     @param item The user interface item being validated
443     @pararm defaultValidation Whether or not the WebView thinks the item is valid
444     @discussion This method allows the UI delegate to control WebView's validation of user interface items.
445     See WebView.h to see the methods to that WebView can currently validate. See NSUserInterfaceValidations and
446     NSValidatedUserInterfaceItem for information about UI validation.
447 */
448 - (BOOL)webView:(WebView *)webView validateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)item defaultValidation:(BOOL)defaultValidation;
449
450 /*!
451     @method webView:shouldPerformAction:fromSender:
452     @abstract Controls actions
453     @param webView The WebView sending the delegate method
454     @param action The action being sent
455     @param sender The sender of the action
456     @discussion This method allows the UI delegate to control WebView's behavior when an action is being sent.
457     For example, if the action is copy:, the delegate can return YES to allow WebView to perform its default
458     copy behavior or return NO and perform copy: in some other way. See WebView.h to see the actions that
459     WebView can perform.
460 */
461 - (BOOL)webView:(WebView *)webView shouldPerformAction:(SEL)action fromSender:(id)sender;
462
463 /*!
464     @method webView:dragDestinationActionMaskForDraggingInfo:
465     @abstract Controls behavior when dragging to a WebView
466     @param webView The WebView sending the delegate method
467     @param draggingInfo The dragging info of the drag
468     @discussion This method is called periodically as something is dragged over a WebView. The UI delegate can return a mask
469     indicating which drag destination actions can occur, WebDragDestinationActionAny to allow any kind of action or
470     WebDragDestinationActionNone to not accept the drag.
471 */
472 - (NSUInteger)webView:(WebView *)webView dragDestinationActionMaskForDraggingInfo:(id <NSDraggingInfo>)draggingInfo;
473
474 /*!
475     @method webView:willPerformDragDestinationAction:forDraggingInfo:
476     @abstract Informs that WebView will perform a drag destination action
477     @param webView The WebView sending the delegate method
478     @param action The drag destination action
479     @param draggingInfo The dragging info of the drag
480     @discussion This method is called after the last call to webView:dragDestinationActionMaskForDraggingInfo: after something is dropped on a WebView.
481     This method informs the UI delegate of the drag destination action that WebView will perform.
482 */
483 - (void)webView:(WebView *)webView willPerformDragDestinationAction:(WebDragDestinationAction)action forDraggingInfo:(id <NSDraggingInfo>)draggingInfo;
484
485 /*!
486     @method webView:dragSourceActionMaskForPoint:
487     @abstract Controls behavior when dragging from a WebView
488     @param webView The WebView sending the delegate method
489     @param point The point where the drag started in the coordinates of the WebView
490     @discussion This method is called after the user has begun a drag from a WebView. The UI delegate can return a mask indicating
491     which drag source actions can occur, WebDragSourceActionAny to allow any kind of action or WebDragSourceActionNone to not begin a drag.
492 */
493 - (NSUInteger)webView:(WebView *)webView dragSourceActionMaskForPoint:(NSPoint)point;
494
495 /*!
496     @method webView:willPerformDragSourceAction:fromPoint:withPasteboard:
497     @abstract Informs that a drag a has begun from a WebView
498     @param webView The WebView sending the delegate method
499     @param action The drag source action
500     @param point The point where the drag started in the coordinates of the WebView
501     @param pasteboard The drag pasteboard
502     @discussion This method is called after webView:dragSourceActionMaskForPoint: is called after the user has begun a drag from a WebView.
503     This method informs the UI delegate of the drag source action that will be performed and gives the delegate an opportunity to modify
504     the contents of the dragging pasteboard.
505 */
506 - (void)webView:(WebView *)webView willPerformDragSourceAction:(WebDragSourceAction)action fromPoint:(NSPoint)point withPasteboard:(NSPasteboard *)pasteboard;
507
508 /*!
509     @method webView:printFrameView:
510     @abstract Informs that a WebFrameView needs to be printed
511     @param webView The WebView sending the delegate method
512     @param frameView The WebFrameView needing to be printed
513     @discussion This method is called when a script or user requests the page to be printed.
514     In this method the delegate can prepare the WebFrameView to be printed. Some content that WebKit
515     displays can be printed directly by the WebFrameView, other content will need to be handled by
516     the delegate. To determine if the WebFrameView can handle printing the delegate should check
517     WebFrameView's documentViewShouldHandlePrint, if YES then the delegate can call printDocumentView
518     on the WebFrameView. Otherwise the delegate will need to request a NSPrintOperation from
519     the WebFrameView's printOperationWithPrintInfo to handle the printing.
520 */
521 - (void)webView:(WebView *)sender printFrameView:(WebFrameView *)frameView;
522
523 /*!
524     @method webViewHeaderHeight:
525     @param webView The WebView sending the delegate method
526     @abstract Reserve a height for the printed page header.
527     @result The height to reserve for the printed page header, return 0.0 to not reserve any space for a header.
528     @discussion The height returned will be used to calculate the rect passed to webView:drawHeaderInRect:.
529 */
530 - (float)webViewHeaderHeight:(WebView *)sender;
531
532 /*!
533     @method webViewFooterHeight:
534     @param webView The WebView sending the delegate method
535     @abstract Reserve a height for the printed page footer.
536     @result The height to reserve for the printed page footer, return 0.0 to not reserve any space for a footer.
537     @discussion The height returned will be used to calculate the rect passed to webView:drawFooterInRect:.
538 */
539 - (float)webViewFooterHeight:(WebView *)sender;
540
541 /*!
542     @method webView:drawHeaderInRect:
543     @param webView The WebView sending the delegate method
544     @param rect The NSRect reserved for the header of the page
545     @abstract The delegate should draw a header for the sender in the supplied rect.
546 */
547 - (void)webView:(WebView *)sender drawHeaderInRect:(NSRect)rect;
548
549 /*!
550     @method webView:drawFooterInRect:
551     @param webView The WebView sending the delegate method
552     @param rect The NSRect reserved for the footer of the page
553     @abstract The delegate should draw a footer for the sender in the supplied rect.
554 */
555 - (void)webView:(WebView *)sender drawFooterInRect:(NSRect)rect;
556
557 // The following delegate methods are deprecated in favor of the ones above that specify
558 // the WebFrame whose JavaScript initiated this call.
559 - (void)webView:(WebView *)sender runJavaScriptAlertPanelWithMessage:(NSString *)message WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_0);
560 - (BOOL)webView:(WebView *)sender runJavaScriptConfirmPanelWithMessage:(NSString *)message WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_0);
561 - (NSString *)webView:(WebView *)sender runJavaScriptTextInputPanelWithPrompt:(NSString *)prompt defaultText:(NSString *)defaultText WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_0);
562
563 // The following delegate methods are deprecated. Content rect calculations are now done automatically.
564 - (void)webView:(WebView *)sender setContentRect:(NSRect)frame WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_0);
565 - (NSRect)webViewContentRect:(WebView *)sender WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_0);
566
567 @end