#import <WebUIDelegate.h>
◆ webView:contextMenuItemsForElement:defaultMenuItems:()
webView:contextMenuItemsForElement:defaultMenuItems: Returns the menu items to display in an element's contextual menu.
- Parameters
-
sender | The WebView sending the delegate method. |
element | A dictionary representation of the clicked element. |
defaultMenuItems | An array of default NSMenuItems to include in all contextual menus. |
- Returns
- An array of NSMenuItems to include in the contextual menu.
◆ webView:createWebViewModalDialogWithRequest:()
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
-
sender | The WebView sending the delegate method. |
request | The request to load. |
- Returns
- The WebView for the new window.
◆ webView:createWebViewWithRequest:()
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
-
sender | The WebView sending the delegate method. |
request | The 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
-
webView | The WebView sending the delegate method |
draggingInfo | The 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
-
webView | The WebView sending the delegate method |
point | The 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:()
webView:drawFooterInRect:
- Parameters
-
sender | The WebView sending the delegate method |
rect | The NSRect reserved for the footer of the page The delegate should draw a footer for the sender in the supplied rect. |
◆ webView:drawHeaderInRect:()
webView:drawHeaderInRect:
- Parameters
-
sender | The WebView sending the delegate method |
rect | The NSRect reserved for the header of the page The delegate should draw a header for the sender in the supplied rect. |
◆ webView:makeFirstResponder:()
webView:makeFirstResponder: Set the first responder for this window.
- Parameters
-
sender | The WebView sending the delegate method. |
responder | The 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
-
sender | The WebView sending the delegate method. |
elementInformation | Dictionary that describes the element that the mouse is over, or nil. |
modifierFlags | The modifier flags as in NSEvent. |
◆ webView:printFrameView:()
webView:printFrameView: Informs that a WebFrameView needs to be printed
- Parameters
-
sender | The WebView sending the delegate method |
frameView | The 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
-
sender | The WebView sending the delegate method. |
message | The message to display. |
frame | The 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
-
sender | The WebView sending the delegate method. |
message | The message to display. |
frame | The 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
-
sender | The WebView sending the delegate method. |
message | The message to display. |
frame | The 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:()
webView:runJavaScriptTextInputPanelWithPrompt:defaultText:initiatedByFrame: Display a JavaScript text input panel.
- Parameters
-
sender | The WebView sending the delegate method. |
prompt | The message to display. |
defaultText | The initial text for the text entry area. |
frame | The 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:()
webView:runOpenPanelForFileButtonWithResultListener: Display a file open panel for a file input control.
- Parameters
-
sender | The WebView sending the delegate method. |
resultListener | The 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:()
webView:runOpenPanelForFileButtonWithResultListener:allowMultipleFiles Display a file open panel for a file input control that may allow multiple files to be selected.
- Parameters
-
sender | The WebView sending the delegate method. |
resultListener | The object to call back with the results. |
allowMultipleFiles | YES 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:()
webView:setFrame: Set the window's frame rect
- Parameters
-
sender | The WebView sending the delegate method. |
frame | The 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
-
sender | The WebView sending the delegate method. |
resizable | YES 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
-
visible | The new visibility value Setting this to YES should show the status bar, setting it to NO should hide it. |
◆ webView:setStatusText:()
webView:setStatusText: Set the window's status display, if any, to the specified string.
- Parameters
-
sender | The WebView sending the delegate method. |
text | The status text to set |
◆ webView:setToolbarsVisible:()
- (void WebUIDelegate) webView: |
|
(WebView *) |
sender |
setToolbarsVisible: |
|
(BOOL) |
visible |
|
|
| |
|
optional |
webView:setToolbarsVisible:
- Parameters
-
sender | The WebView sending the delegate method. Set whether the window's toolbars are currently visible. |
visible | New 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
-
webView | The WebView sending the delegate method |
action | The action being sent |
sender | The 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
-
webView | The WebView sending the delegate method |
item | The 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:()
webView:willPerformDragDestinationAction:forDraggingInfo: Informs that WebView will perform a drag destination action
- Parameters
-
webView | The WebView sending the delegate method |
action | The drag destination action |
draggingInfo | The 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:()
webView:willPerformDragSourceAction:fromPoint:withPasteboard: Informs that a drag a has begun from a WebView
- Parameters
-
webView | The WebView sending the delegate method |
action | The drag source action |
point | The point where the drag started in the coordinates of the WebView |
pasteboard | The 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
-
sender | The 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
-
sender | The 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:()
webViewFirstResponder: Get the first responder for this window.
- Parameters
-
sender | The 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
-
sender | The 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
-
sender | The 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:()
webViewFrame:
- Parameters
-
sender | The WebView sending the delegate method. Return the window's frame rect |
◆ webViewHeaderHeight:()
- (float WebUIDelegate) webViewHeaderHeight: |
|
(WebView *) |
sender |
|
|
optional |
webViewHeaderHeight:
- Parameters
-
sender | The 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
-
- 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
-
- Returns
- YES if the status bar is visible, otherwise NO.
◆ webViewRunModal:()
- (void WebUIDelegate) webViewRunModal: |
|
(WebView *) |
sender |
|
|
optional |
webViewRunModal:
- Parameters
-
sender | The 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:()
webViewShow:
- Parameters
-
sender | The 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:()
webViewStatusText: Get the currently displayed status text.
- Parameters
-
- Returns
- The status text
◆ webViewUnfocus:()
- (void WebUIDelegate) webViewUnfocus: |
|
(WebView *) |
sender |
|
|
optional |
webViewUnfocus: Unfocus the current window.
- Parameters
-
sender | The 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: