webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
Instance Methods | List of all members
<WebUIDelegate > Protocol Reference

#import <WebUIDelegate.h>

Inheritance diagram for <WebUIDelegate >:

Instance Methods

(WebView *) - webView:createWebViewWithRequest:
 
(void- webViewShow:
 
(WebView *) - webView:createWebViewModalDialogWithRequest:
 
(void- webViewRunModal:
 
(void- webViewClose:
 
(void- webViewFocus:
 
(void- webViewUnfocus:
 
(NSResponder *) - webViewFirstResponder:
 
(void- webView:makeFirstResponder:
 
(void- webView:setStatusText:
 
(NSString *) - webViewStatusText:
 
(BOOL- webViewAreToolbarsVisible:
 
(void- webView:setToolbarsVisible:
 
(BOOL- webViewIsStatusBarVisible:
 
(void- webView:setStatusBarVisible:
 
(BOOL- webViewIsResizable:
 
(void- webView:setResizable:
 
(void- webView:setFrame:
 
(NSRect- webViewFrame:
 
(void- webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:
 
(BOOL- webView:runJavaScriptConfirmPanelWithMessage:initiatedByFrame:
 
(NSString *) - webView:runJavaScriptTextInputPanelWithPrompt:defaultText:initiatedByFrame:
 
(BOOL- webView:runBeforeUnloadConfirmPanelWithMessage:initiatedByFrame:
 
(void- webView:runOpenPanelForFileButtonWithResultListener:
 
(void- webView:runOpenPanelForFileButtonWithResultListener:allowMultipleFiles:
 
(void- webView:mouseDidMoveOverElement:modifierFlags:
 
(NSArray *) - webView:contextMenuItemsForElement:defaultMenuItems:
 
(BOOL- webView:validateUserInterfaceItem:defaultValidation:
 
(BOOL- webView:shouldPerformAction:fromSender:
 
(NSUInteger) - webView:dragDestinationActionMaskForDraggingInfo:
 
(void- webView:willPerformDragDestinationAction:forDraggingInfo:
 
(NSUInteger) - webView:dragSourceActionMaskForPoint:
 
(void- webView:willPerformDragSourceAction:fromPoint:withPasteboard:
 
(void- webView:printFrameView:
 
(float) - webViewHeaderHeight:
 
(float) - webViewFooterHeight:
 
(void- webView:drawHeaderInRect:
 
(void- webView:drawFooterInRect:
 
(void- webView:runJavaScriptAlertPanelWithMessage:
 
(BOOL- webView:runJavaScriptConfirmPanelWithMessage:
 
(NSString *) - webView:runJavaScriptTextInputPanelWithPrompt:defaultText:
 
(void- webView:setContentRect:
 
(NSRect- webViewContentRect:
 

Method Documentation

◆ webView:contextMenuItemsForElement:defaultMenuItems:()

- (NSArray * WebUIDelegate) webView: (WebView *)  sender
contextMenuItemsForElement: (NSDictionary *)  element
defaultMenuItems: (NSArray *)  defaultMenuItems 
optional

webView:contextMenuItemsForElement:defaultMenuItems: Returns the menu items to display in an element's contextual menu.

Parameters
senderThe WebView sending the delegate method.
elementA dictionary representation of the clicked element.
defaultMenuItemsAn array of default NSMenuItems to include in all contextual menus.
Returns
An array of NSMenuItems to include in the contextual menu.

◆ webView:createWebViewModalDialogWithRequest:()

- (WebView * WebUIDelegate) webView: (WebView *)  sender
createWebViewModalDialogWithRequest: (NSURLRequest *)  request 
optional

webView:createWebViewModalDialogWithRequest: Create a new window and begin to load the specified request. The newly created window is hidden, and the window operations delegate on the new WebViews will get a webViewShow: call.

Parameters
senderThe WebView sending the delegate method.
requestThe request to load.
Returns
The WebView for the new window.

◆ webView:createWebViewWithRequest:()

- (WebView * WebUIDelegate) webView: (WebView *)  sender
createWebViewWithRequest: (NSURLRequest *)  request 
optional

webView:createWebViewWithRequest: Create a new window and begin to load the specified request. The newly created window is hidden, and the window operations delegate on the new WebViews will get a webViewShow: call.

Parameters
senderThe WebView sending the delegate method.
requestThe request to load.
Returns
The WebView for the new window.

◆ webView:dragDestinationActionMaskForDraggingInfo:()

- (NSUInteger WebUIDelegate) webView: (WebView *)  webView
dragDestinationActionMaskForDraggingInfo: (id< NSDraggingInfo >)  draggingInfo 
optional

webView:dragDestinationActionMaskForDraggingInfo: Controls behavior when dragging to a WebView

Parameters
webViewThe WebView sending the delegate method
draggingInfoThe dragging info of the drag This method is called periodically as something is dragged over a WebView. The UI delegate can return a mask indicating which drag destination actions can occur, WebDragDestinationActionAny to allow any kind of action or WebDragDestinationActionNone to not accept the drag.

◆ webView:dragSourceActionMaskForPoint:()

- (NSUInteger WebUIDelegate) webView: (WebView *)  webView
dragSourceActionMaskForPoint: (NSPoint point 
optional

webView:dragSourceActionMaskForPoint: Controls behavior when dragging from a WebView

Parameters
webViewThe WebView sending the delegate method
pointThe point where the drag started in the coordinates of the WebView This method is called after the user has begun a drag from a WebView. The UI delegate can return a mask indicating which drag source actions can occur, WebDragSourceActionAny to allow any kind of action or WebDragSourceActionNone to not begin a drag.

◆ webView:drawFooterInRect:()

- (void WebUIDelegate) webView: (WebView *)  sender
drawFooterInRect: (NSRect rect 
optional

webView:drawFooterInRect:

Parameters
senderThe WebView sending the delegate method
rectThe NSRect reserved for the footer of the page The delegate should draw a footer for the sender in the supplied rect.

◆ webView:drawHeaderInRect:()

- (void WebUIDelegate) webView: (WebView *)  sender
drawHeaderInRect: (NSRect rect 
optional

webView:drawHeaderInRect:

Parameters
senderThe WebView sending the delegate method
rectThe NSRect reserved for the header of the page The delegate should draw a header for the sender in the supplied rect.

◆ webView:makeFirstResponder:()

- (void WebUIDelegate) webView: (WebView *)  sender
makeFirstResponder: (NSResponder *)  responder 
optional

webView:makeFirstResponder: Set the first responder for this window.

Parameters
senderThe WebView sending the delegate method.
responderThe responder to make first (will always be a view) responder will always be a view that is in the view subhierarchy of the top-level web view for this WebView. If the WebView's top level view is currently out of the view hierarchy, it may be desirable to save the first responder elsewhere, or possibly ignore this call.

◆ webView:mouseDidMoveOverElement:modifierFlags:()

- (void WebUIDelegate) webView: (WebView *)  sender
mouseDidMoveOverElement: (NSDictionary *)  elementInformation
modifierFlags: (NSUInteger)  modifierFlags 
optional

webView:mouseDidMoveOverElement:modifierFlags: Update the window's feedback for mousing over links to reflect a new item the mouse is over or new modifier flags.

Parameters
senderThe WebView sending the delegate method.
elementInformationDictionary that describes the element that the mouse is over, or nil.
modifierFlagsThe modifier flags as in NSEvent.

◆ webView:printFrameView:()

- (void WebUIDelegate) webView: (WebView *)  sender
printFrameView: (WebFrameView *)  frameView 
optional

webView:printFrameView: Informs that a WebFrameView needs to be printed

Parameters
senderThe WebView sending the delegate method
frameViewThe WebFrameView needing to be printed This method is called when a script or user requests the page to be printed. In this method the delegate can prepare the WebFrameView to be printed. Some content that WebKit displays can be printed directly by the WebFrameView, other content will need to be handled by the delegate. To determine if the WebFrameView can handle printing the delegate should check WebFrameView's documentViewShouldHandlePrint, if YES then the delegate can call printDocumentView on the WebFrameView. Otherwise the delegate will need to request a NSPrintOperation from the WebFrameView's printOperationWithPrintInfo to handle the printing.

◆ webView:runBeforeUnloadConfirmPanelWithMessage:initiatedByFrame:()

- (BOOL WebUIDelegate) webView: (WebView *)  sender
runBeforeUnloadConfirmPanelWithMessage: (NSString *)  message
initiatedByFrame: (WebFrame *)  frame 
optional

webView:runBeforeUnloadConfirmPanelWithMessage:initiatedByFrame: Display a confirm panel by an "before unload" event handler.

Parameters
senderThe WebView sending the delegate method.
messageThe message to display.
frameThe WebFrame whose JavaScript initiated this call.
Returns
YES if the user hit OK, NO if the user chose Cancel. Clients should include a message in addition to the one supplied by the web page that indicates. The panel should have two buttons, e.g. "OK" and "Cancel".

◆ webView:runJavaScriptAlertPanelWithMessage:()

- (void WebUIDelegate) webView: (WebView *)  sender
runJavaScriptAlertPanelWithMessage: (10_3) 
(10_5)  WEBKIT_DEPRECATED_MAC 
optional

◆ webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:()

- (void WebUIDelegate) webView: (WebView *)  sender
runJavaScriptAlertPanelWithMessage: (NSString *)  message
initiatedByFrame: (WebFrame *)  frame 
optional

webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame: Display a JavaScript alert panel.

Parameters
senderThe WebView sending the delegate method.
messageThe message to display.
frameThe WebFrame whose JavaScript initiated this call. Clients should visually indicate that this panel comes from JavaScript initiated by the specified frame. The panel should have a single OK button.

◆ webView:runJavaScriptConfirmPanelWithMessage:()

- (BOOL WebUIDelegate) webView: (WebView *)  sender
runJavaScriptConfirmPanelWithMessage: (10_3) 
(10_5)  WEBKIT_DEPRECATED_MAC 
optional

◆ webView:runJavaScriptConfirmPanelWithMessage:initiatedByFrame:()

- (BOOL WebUIDelegate) webView: (WebView *)  sender
runJavaScriptConfirmPanelWithMessage: (NSString *)  message
initiatedByFrame: (WebFrame *)  frame 
optional

webView:runJavaScriptConfirmPanelWithMessage:initiatedByFrame: Display a JavaScript confirm panel.

Parameters
senderThe WebView sending the delegate method.
messageThe message to display.
frameThe WebFrame whose JavaScript initiated this call.
Returns
YES if the user hit OK, NO if the user chose Cancel. Clients should visually indicate that this panel comes from JavaScript initiated by the specified frame. The panel should have two buttons, e.g. "OK" and "Cancel".

◆ webView:runJavaScriptTextInputPanelWithPrompt:defaultText:()

- (NSString * WebUIDelegate) webView: (WebView *)  sender
runJavaScriptTextInputPanelWithPrompt: (NSString *)  prompt
defaultText: (10_3) 
(10_5)  WEBKIT_DEPRECATED_MAC 
optional

◆ webView:runJavaScriptTextInputPanelWithPrompt:defaultText:initiatedByFrame:()

- (NSString * WebUIDelegate) webView: (WebView *)  sender
runJavaScriptTextInputPanelWithPrompt: (NSString *)  prompt
defaultText: (NSString *)  defaultText
initiatedByFrame: (WebFrame *)  frame 
optional

webView:runJavaScriptTextInputPanelWithPrompt:defaultText:initiatedByFrame: Display a JavaScript text input panel.

Parameters
senderThe WebView sending the delegate method.
promptThe message to display.
defaultTextThe initial text for the text entry area.
frameThe WebFrame whose JavaScript initiated this call.
Returns
The typed text if the user hit OK, otherwise nil. Clients should visually indicate that this panel comes from JavaScript initiated by the specified frame. The panel should have two buttons, e.g. "OK" and "Cancel", and an area to type text.

◆ webView:runOpenPanelForFileButtonWithResultListener:()

- (void WebUIDelegate) webView: (WebView *)  sender
runOpenPanelForFileButtonWithResultListener: (id< WebOpenPanelResultListener >)  resultListener 
optional

webView:runOpenPanelForFileButtonWithResultListener: Display a file open panel for a file input control.

Parameters
senderThe WebView sending the delegate method.
resultListenerThe object to call back with the results. This method is passed a callback object instead of giving a return value so that it can be handled with a sheet.

◆ webView:runOpenPanelForFileButtonWithResultListener:allowMultipleFiles:()

- (void WebUIDelegate) webView: (WebView *)  sender
runOpenPanelForFileButtonWithResultListener: (id< WebOpenPanelResultListener >)  resultListener
allowMultipleFiles: (10_6)  WEBKIT_AVAILABLE_MAC 
optional

webView:runOpenPanelForFileButtonWithResultListener:allowMultipleFiles Display a file open panel for a file input control that may allow multiple files to be selected.

Parameters
senderThe WebView sending the delegate method.
resultListenerThe object to call back with the results.
allowMultipleFilesYES if the open panel should allow myltiple files to be selected, NO if not. This method is passed a callback object instead of giving a return value so that it can be handled with a sheet.

◆ webView:setContentRect:()

- (void WebUIDelegate) webView: (WebView *)  sender
setContentRect: (10_3) 
(10_5)  WEBKIT_DEPRECATED_MAC 
optional

◆ webView:setFrame:()

- (void WebUIDelegate) webView: (WebView *)  sender
setFrame: (NSRect frame 
optional

webView:setFrame: Set the window's frame rect

Parameters
senderThe WebView sending the delegate method.
frameThe new window frame size Even though a caller could set the frame directly using the NSWindow, this method is provided so implementors of this protocol can do special things on programmatic move/resize, like avoiding autosaving of the size.

◆ webView:setResizable:()

- (void WebUIDelegate) webView: (WebView *)  sender
setResizable: (BOOL resizable 
optional

webView:setResizable: Set the window to resizable or not

Parameters
senderThe WebView sending the delegate method.
resizableYES if the window should be made resizable, NO if not. If there are multiple views in the same window, they have have their own separate resize controls and this may need to be handled specially.

◆ webView:setStatusBarVisible:()

- (void WebUIDelegate) webView: (WebView *)  sender
setStatusBarVisible: (BOOL visible 
optional

webView:setStatusBarVisible: Set whether the status bar is currently visible.

Parameters
visibleThe new visibility value Setting this to YES should show the status bar, setting it to NO should hide it.

◆ webView:setStatusText:()

- (void WebUIDelegate) webView: (WebView *)  sender
setStatusText: (NSString *)  text 
optional

webView:setStatusText: Set the window's status display, if any, to the specified string.

Parameters
senderThe WebView sending the delegate method.
textThe status text to set

◆ webView:setToolbarsVisible:()

- (void WebUIDelegate) webView: (WebView *)  sender
setToolbarsVisible: (BOOL visible 
optional

webView:setToolbarsVisible:

Parameters
senderThe WebView sending the delegate method. Set whether the window's toolbars are currently visible.
visibleNew value for toolbar visibility Setting this to YES should turn on all toolbars (except for a possible status bar). Setting it to NO should turn off all toolbars (with the same exception).

◆ webView:shouldPerformAction:fromSender:()

- (BOOL WebUIDelegate) webView: (WebView *)  webView
shouldPerformAction: (SEL)  action
fromSender: (id sender 
optional

webView:shouldPerformAction:fromSender: Controls actions

Parameters
webViewThe WebView sending the delegate method
actionThe action being sent
senderThe sender of the action This method allows the UI delegate to control WebView's behavior when an action is being sent. For example, if the action is copy:, the delegate can return YES to allow WebView to perform its default copy behavior or return NO and perform copy: in some other way. See WebView.h to see the actions that WebView can perform.

◆ webView:validateUserInterfaceItem:defaultValidation:()

- (BOOL WebUIDelegate) webView: (WebView *)  webView
validateUserInterfaceItem: (id< NSValidatedUserInterfaceItem >)  item
defaultValidation: (BOOL defaultValidation 
optional

webView:validateUserInterfaceItem:defaultValidation: Controls UI validation

Parameters
webViewThe WebView sending the delegate method
itemThe user interface item being validated defaultValidation Whether or not the WebView thinks the item is valid This method allows the UI delegate to control WebView's validation of user interface items. See WebView.h to see the methods to that WebView can currently validate. See NSUserInterfaceValidations and NSValidatedUserInterfaceItem for information about UI validation.

◆ webView:willPerformDragDestinationAction:forDraggingInfo:()

- (void WebUIDelegate) webView: (WebView *)  webView
willPerformDragDestinationAction: (WebDragDestinationAction action
forDraggingInfo: (id< NSDraggingInfo >)  draggingInfo 
optional

webView:willPerformDragDestinationAction:forDraggingInfo: Informs that WebView will perform a drag destination action

Parameters
webViewThe WebView sending the delegate method
actionThe drag destination action
draggingInfoThe dragging info of the drag This method is called after the last call to webView:dragDestinationActionMaskForDraggingInfo: after something is dropped on a WebView. This method informs the UI delegate of the drag destination action that WebView will perform.

◆ webView:willPerformDragSourceAction:fromPoint:withPasteboard:()

- (void WebUIDelegate) webView: (WebView *)  webView
willPerformDragSourceAction: (WebDragSourceAction action
fromPoint: (NSPoint point
withPasteboard: (NSPasteboard *)  pasteboard 
optional

webView:willPerformDragSourceAction:fromPoint:withPasteboard: Informs that a drag a has begun from a WebView

Parameters
webViewThe WebView sending the delegate method
actionThe drag source action
pointThe point where the drag started in the coordinates of the WebView
pasteboardThe drag pasteboard This method is called after webView:dragSourceActionMaskForPoint: is called after the user has begun a drag from a WebView. This method informs the UI delegate of the drag source action that will be performed and gives the delegate an opportunity to modify the contents of the dragging pasteboard.

◆ webViewAreToolbarsVisible:()

- (BOOL WebUIDelegate) webViewAreToolbarsVisible: (WebView *)  sender
optional

webViewAreToolbarsVisible: Determine whether the window's toolbars are currently visible

Parameters
senderThe WebView sending the delegate method. This method should return YES if the window has any toolbars that are currently on, besides the status bar. If the app has more than one toolbar per window, for example a regular command toolbar and a favorites bar, it should return YES from this method if at least one is on.
Returns
YES if at least one toolbar is visible, otherwise NO.

◆ webViewClose:()

- (void WebUIDelegate) webViewClose: (WebView *)  sender
optional

webViewClose: Close the current window.

Parameters
senderThe WebView sending the delegate method. Clients showing multiple views in one window may choose to close only the one corresponding to this WebView. Other clients may choose to ignore this method entirely.

◆ webViewContentRect:()

- (NSRect WebUIDelegate) webViewContentRect: (10_3) 
(10_5)  WEBKIT_DEPRECATED_MAC 
optional

◆ webViewFirstResponder:()

- (NSResponder * WebUIDelegate) webViewFirstResponder: (WebView *)  sender
optional

webViewFirstResponder: Get the first responder for this window.

Parameters
senderThe WebView sending the delegate method. This method should return the focused control in the WebView's view, if any. If the view is out of the window hierarchy, this might return something than calling firstResponder on the real NSWindow would. It's OK to return either nil or the real first responder if some control not in the window has focus.

◆ webViewFocus:()

- (void WebUIDelegate) webViewFocus: (WebView *)  sender
optional

webViewFocus: Focus the current window (i.e. makeKeyAndOrderFront:).

Parameters
senderThe WebView sending the delegate method. Clients showing multiple views in one window may want to also do something to focus the one corresponding to this WebView.

◆ webViewFooterHeight:()

- (float WebUIDelegate) webViewFooterHeight: (WebView *)  sender
optional

webViewFooterHeight:

Parameters
senderThe WebView sending the delegate method Reserve a height for the printed page footer.
Returns
The height to reserve for the printed page footer, return 0.0 to not reserve any space for a footer. The height returned will be used to calculate the rect passed to webView:drawFooterInRect:.

◆ webViewFrame:()

- (NSRect WebUIDelegate) webViewFrame: (WebView *)  sender
optional

webViewFrame:

Parameters
senderThe WebView sending the delegate method. Return the window's frame rect

◆ webViewHeaderHeight:()

- (float WebUIDelegate) webViewHeaderHeight: (WebView *)  sender
optional

webViewHeaderHeight:

Parameters
senderThe WebView sending the delegate method Reserve a height for the printed page header.
Returns
The height to reserve for the printed page header, return 0.0 to not reserve any space for a header. The height returned will be used to calculate the rect passed to webView:drawHeaderInRect:.

◆ webViewIsResizable:()

- (BOOL WebUIDelegate) webViewIsResizable: (WebView *)  sender
optional

webViewIsResizable: Determine whether the window is resizable or not.

Parameters
senderThe WebView sending the delegate method.
Returns
YES if resizable, NO if not. If there are multiple views in the same window, they have have their own separate resize controls and this may need to be handled specially.

◆ webViewIsStatusBarVisible:()

- (BOOL WebUIDelegate) webViewIsStatusBarVisible: (WebView *)  sender
optional

webViewIsStatusBarVisible: Determine whether the status bar is visible.

Parameters
senderThe WebView sending the delegate method.
Returns
YES if the status bar is visible, otherwise NO.

◆ webViewRunModal:()

- (void WebUIDelegate) webViewRunModal: (WebView *)  sender
optional

webViewRunModal:

Parameters
senderThe WebView sending the delegate method. Show the window that contains the top level view of the WebView, ordering it frontmost. The window should be run modal in the application. This will only be called just after createWebViewModalDialogWithRequest: is used to create a new window.

◆ webViewShow:()

- (void WebUIDelegate) webViewShow: (WebView *)  sender
optional

webViewShow:

Parameters
senderThe WebView sending the delegate method. Show the window that contains the top level view of the WebView, ordering it frontmost. This will only be called just after createWindowWithRequest: is used to create a new window.

◆ webViewStatusText:()

- (NSString * WebUIDelegate) webViewStatusText: (WebView *)  sender
optional

webViewStatusText: Get the currently displayed status text.

Parameters
senderThe WebView sending the delegate method.
Returns
The status text

◆ webViewUnfocus:()

- (void WebUIDelegate) webViewUnfocus: (WebView *)  sender
optional

webViewUnfocus: Unfocus the current window.

Parameters
senderThe WebView sending the delegate method. Clients showing multiple views in one window may want to also do something to unfocus the one corresponding to this WebView.

The documentation for this protocol was generated from the following file: