pub unsafe trait WebUIDelegate: NSObjectProtocol {
Show 43 methods
// Provided methods
unsafe fn webView_createWebViewWithRequest(
&self,
sender: Option<&WebView>,
request: Option<&NSURLRequest>,
mtm: MainThreadMarker,
) -> Option<Retained<WebView>>
where Self: Sized + Message { ... }
unsafe fn webViewShow(&self, sender: Option<&WebView>)
where Self: Sized + Message { ... }
unsafe fn webView_createWebViewModalDialogWithRequest(
&self,
sender: Option<&WebView>,
request: Option<&NSURLRequest>,
mtm: MainThreadMarker,
) -> Option<Retained<WebView>>
where Self: Sized + Message { ... }
unsafe fn webViewRunModal(&self, sender: Option<&WebView>)
where Self: Sized + Message { ... }
unsafe fn webViewClose(&self, sender: Option<&WebView>)
where Self: Sized + Message { ... }
unsafe fn webViewFocus(&self, sender: Option<&WebView>)
where Self: Sized + Message { ... }
unsafe fn webViewUnfocus(&self, sender: Option<&WebView>)
where Self: Sized + Message { ... }
unsafe fn webViewFirstResponder(
&self,
sender: Option<&WebView>,
mtm: MainThreadMarker,
) -> Option<Retained<NSResponder>>
where Self: Sized + Message { ... }
unsafe fn webView_makeFirstResponder(
&self,
sender: Option<&WebView>,
responder: Option<&NSResponder>,
)
where Self: Sized + Message { ... }
unsafe fn webView_setStatusText(
&self,
sender: Option<&WebView>,
text: Option<&NSString>,
)
where Self: Sized + Message { ... }
unsafe fn webViewStatusText(
&self,
sender: Option<&WebView>,
) -> Option<Retained<NSString>>
where Self: Sized + Message { ... }
unsafe fn webViewAreToolbarsVisible(&self, sender: Option<&WebView>) -> bool
where Self: Sized + Message { ... }
unsafe fn webView_setToolbarsVisible(
&self,
sender: Option<&WebView>,
visible: bool,
)
where Self: Sized + Message { ... }
unsafe fn webViewIsStatusBarVisible(&self, sender: Option<&WebView>) -> bool
where Self: Sized + Message { ... }
unsafe fn webView_setStatusBarVisible(
&self,
sender: Option<&WebView>,
visible: bool,
)
where Self: Sized + Message { ... }
unsafe fn webViewIsResizable(&self, sender: Option<&WebView>) -> bool
where Self: Sized + Message { ... }
unsafe fn webView_setResizable(
&self,
sender: Option<&WebView>,
resizable: bool,
)
where Self: Sized + Message { ... }
unsafe fn webView_setFrame(&self, sender: Option<&WebView>, frame: NSRect)
where Self: Sized + Message { ... }
unsafe fn webViewFrame(&self, sender: Option<&WebView>) -> NSRect
where Self: Sized + Message { ... }
unsafe fn webView_runJavaScriptAlertPanelWithMessage_initiatedByFrame(
&self,
sender: Option<&WebView>,
message: Option<&NSString>,
frame: Option<&WebFrame>,
)
where Self: Sized + Message { ... }
unsafe fn webView_runJavaScriptConfirmPanelWithMessage_initiatedByFrame(
&self,
sender: Option<&WebView>,
message: Option<&NSString>,
frame: Option<&WebFrame>,
) -> bool
where Self: Sized + Message { ... }
unsafe fn webView_runJavaScriptTextInputPanelWithPrompt_defaultText_initiatedByFrame(
&self,
sender: Option<&WebView>,
prompt: Option<&NSString>,
default_text: Option<&NSString>,
frame: Option<&WebFrame>,
) -> Option<Retained<NSString>>
where Self: Sized + Message { ... }
unsafe fn webView_runBeforeUnloadConfirmPanelWithMessage_initiatedByFrame(
&self,
sender: Option<&WebView>,
message: Option<&NSString>,
frame: Option<&WebFrame>,
) -> bool
where Self: Sized + Message { ... }
unsafe fn webView_runOpenPanelForFileButtonWithResultListener(
&self,
sender: Option<&WebView>,
result_listener: Option<&ProtocolObject<dyn WebOpenPanelResultListener>>,
)
where Self: Sized + Message { ... }
unsafe fn webView_runOpenPanelForFileButtonWithResultListener_allowMultipleFiles(
&self,
sender: Option<&WebView>,
result_listener: Option<&ProtocolObject<dyn WebOpenPanelResultListener>>,
allow_multiple_files: bool,
)
where Self: Sized + Message { ... }
unsafe fn webView_mouseDidMoveOverElement_modifierFlags(
&self,
sender: Option<&WebView>,
element_information: Option<&NSDictionary>,
modifier_flags: NSUInteger,
)
where Self: Sized + Message { ... }
unsafe fn webView_contextMenuItemsForElement_defaultMenuItems(
&self,
sender: Option<&WebView>,
element: Option<&NSDictionary>,
default_menu_items: Option<&NSArray>,
) -> Option<Retained<NSArray>>
where Self: Sized + Message { ... }
unsafe fn webView_validateUserInterfaceItem_defaultValidation(
&self,
web_view: Option<&WebView>,
item: Option<&ProtocolObject<dyn NSValidatedUserInterfaceItem>>,
default_validation: bool,
) -> bool
where Self: Sized + Message { ... }
unsafe fn webView_shouldPerformAction_fromSender(
&self,
web_view: Option<&WebView>,
action: Option<Sel>,
sender: Option<&AnyObject>,
) -> bool
where Self: Sized + Message { ... }
unsafe fn webView_dragDestinationActionMaskForDraggingInfo(
&self,
web_view: Option<&WebView>,
dragging_info: Option<&ProtocolObject<dyn NSDraggingInfo>>,
) -> NSUInteger
where Self: Sized + Message { ... }
unsafe fn webView_willPerformDragDestinationAction_forDraggingInfo(
&self,
web_view: Option<&WebView>,
action: WebDragDestinationAction,
dragging_info: Option<&ProtocolObject<dyn NSDraggingInfo>>,
)
where Self: Sized + Message { ... }
unsafe fn webView_dragSourceActionMaskForPoint(
&self,
web_view: Option<&WebView>,
point: NSPoint,
) -> NSUInteger
where Self: Sized + Message { ... }
unsafe fn webView_willPerformDragSourceAction_fromPoint_withPasteboard(
&self,
web_view: Option<&WebView>,
action: WebDragSourceAction,
point: NSPoint,
pasteboard: Option<&NSPasteboard>,
)
where Self: Sized + Message { ... }
unsafe fn webView_printFrameView(
&self,
sender: Option<&WebView>,
frame_view: Option<&WebFrameView>,
)
where Self: Sized + Message { ... }
unsafe fn webViewHeaderHeight(&self, sender: Option<&WebView>) -> c_float
where Self: Sized + Message { ... }
unsafe fn webViewFooterHeight(&self, sender: Option<&WebView>) -> c_float
where Self: Sized + Message { ... }
unsafe fn webView_drawHeaderInRect(
&self,
sender: Option<&WebView>,
rect: NSRect,
)
where Self: Sized + Message { ... }
unsafe fn webView_drawFooterInRect(
&self,
sender: Option<&WebView>,
rect: NSRect,
)
where Self: Sized + Message { ... }
unsafe fn webView_runJavaScriptAlertPanelWithMessage(
&self,
sender: Option<&WebView>,
message: Option<&NSString>,
)
where Self: Sized + Message { ... }
unsafe fn webView_runJavaScriptConfirmPanelWithMessage(
&self,
sender: Option<&WebView>,
message: Option<&NSString>,
) -> bool
where Self: Sized + Message { ... }
unsafe fn webView_runJavaScriptTextInputPanelWithPrompt_defaultText(
&self,
sender: Option<&WebView>,
prompt: Option<&NSString>,
default_text: Option<&NSString>,
) -> Option<Retained<NSString>>
where Self: Sized + Message { ... }
unsafe fn webView_setContentRect(
&self,
sender: Option<&WebView>,
frame: NSRect,
)
where Self: Sized + Message { ... }
unsafe fn webViewContentRect(&self, sender: Option<&WebView>) -> NSRect
where Self: Sized + Message { ... }
}
WebUIDelegate
only.Expand description
A class that implements WebUIDelegate provides window-related methods that may be used by Javascript, plugins and other aspects of web pages. These methods are used to open new windows and control aspects of existing windows.
See also Apple’s documentation
Provided Methods§
Sourceunsafe fn webView_createWebViewWithRequest(
&self,
sender: Option<&WebView>,
request: Option<&NSURLRequest>,
mtm: MainThreadMarker,
) -> Option<Retained<WebView>>
đź‘ŽDeprecatedAvailable on crate feature WebView
and crate feature objc2-app-kit
and macOS only.
unsafe fn webView_createWebViewWithRequest( &self, sender: Option<&WebView>, request: Option<&NSURLRequest>, mtm: MainThreadMarker, ) -> Option<Retained<WebView>>
WebView
and crate feature objc2-app-kit
and macOS only.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.
Parameter sender
: The WebView sending the delegate method.
Parameter request
: The request to load.
Returns: The WebView for the new window.
Sourceunsafe fn webViewShow(&self, sender: Option<&WebView>)
đź‘ŽDeprecatedAvailable on crate feature WebView
and crate feature objc2-app-kit
and macOS only.
unsafe fn webViewShow(&self, sender: Option<&WebView>)
WebView
and crate feature objc2-app-kit
and macOS only.Parameter 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.
Sourceunsafe fn webView_createWebViewModalDialogWithRequest(
&self,
sender: Option<&WebView>,
request: Option<&NSURLRequest>,
mtm: MainThreadMarker,
) -> Option<Retained<WebView>>
đź‘ŽDeprecatedAvailable on crate feature WebView
and crate feature objc2-app-kit
and macOS only.
unsafe fn webView_createWebViewModalDialogWithRequest( &self, sender: Option<&WebView>, request: Option<&NSURLRequest>, mtm: MainThreadMarker, ) -> Option<Retained<WebView>>
WebView
and crate feature objc2-app-kit
and macOS only.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.
Parameter sender
: The WebView sending the delegate method.
Parameter request
: The request to load.
Returns: The WebView for the new window.
Sourceunsafe fn webViewRunModal(&self, sender: Option<&WebView>)
đź‘ŽDeprecatedAvailable on crate feature WebView
and crate feature objc2-app-kit
and macOS only.
unsafe fn webViewRunModal(&self, sender: Option<&WebView>)
WebView
and crate feature objc2-app-kit
and macOS only.Parameter 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.
Sourceunsafe fn webViewClose(&self, sender: Option<&WebView>)
đź‘ŽDeprecatedAvailable on crate feature WebView
and crate feature objc2-app-kit
and macOS only.
unsafe fn webViewClose(&self, sender: Option<&WebView>)
WebView
and crate feature objc2-app-kit
and macOS only.Close the current window.
Parameter 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.
Sourceunsafe fn webViewFocus(&self, sender: Option<&WebView>)
đź‘ŽDeprecatedAvailable on crate feature WebView
and crate feature objc2-app-kit
and macOS only.
unsafe fn webViewFocus(&self, sender: Option<&WebView>)
WebView
and crate feature objc2-app-kit
and macOS only.Focus the current window (i.e. makeKeyAndOrderFront:).
Parameter 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.
Sourceunsafe fn webViewUnfocus(&self, sender: Option<&WebView>)
đź‘ŽDeprecatedAvailable on crate feature WebView
and crate feature objc2-app-kit
and macOS only.
unsafe fn webViewUnfocus(&self, sender: Option<&WebView>)
WebView
and crate feature objc2-app-kit
and macOS only.Unfocus the current window.
Parameter 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.
Sourceunsafe fn webViewFirstResponder(
&self,
sender: Option<&WebView>,
mtm: MainThreadMarker,
) -> Option<Retained<NSResponder>>
đź‘ŽDeprecatedAvailable on crate feature WebView
and crate feature objc2-app-kit
and macOS only.
unsafe fn webViewFirstResponder( &self, sender: Option<&WebView>, mtm: MainThreadMarker, ) -> Option<Retained<NSResponder>>
WebView
and crate feature objc2-app-kit
and macOS only.Get the first responder for this window.
Parameter 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.
Sourceunsafe fn webView_makeFirstResponder(
&self,
sender: Option<&WebView>,
responder: Option<&NSResponder>,
)
đź‘ŽDeprecatedAvailable on crate feature WebView
and crate feature objc2-app-kit
and macOS only.
unsafe fn webView_makeFirstResponder( &self, sender: Option<&WebView>, responder: Option<&NSResponder>, )
WebView
and crate feature objc2-app-kit
and macOS only.Set the first responder for this window.
Parameter sender
: The WebView sending the delegate method.
Parameter 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.
Sourceunsafe fn webView_setStatusText(
&self,
sender: Option<&WebView>,
text: Option<&NSString>,
)
đź‘ŽDeprecatedAvailable on crate feature WebView
and crate feature objc2-app-kit
and macOS only.
unsafe fn webView_setStatusText( &self, sender: Option<&WebView>, text: Option<&NSString>, )
WebView
and crate feature objc2-app-kit
and macOS only.Set the window’s status display, if any, to the specified string.
Parameter sender
: The WebView sending the delegate method.
Parameter text
: The status text to set
Sourceunsafe fn webViewStatusText(
&self,
sender: Option<&WebView>,
) -> Option<Retained<NSString>>
đź‘ŽDeprecatedAvailable on crate feature WebView
and crate feature objc2-app-kit
and macOS only.
unsafe fn webViewStatusText( &self, sender: Option<&WebView>, ) -> Option<Retained<NSString>>
WebView
and crate feature objc2-app-kit
and macOS only.Get the currently displayed status text.
Parameter sender
: The WebView sending the delegate method.
Returns: The status text
Sourceunsafe fn webViewAreToolbarsVisible(&self, sender: Option<&WebView>) -> bool
đź‘ŽDeprecatedAvailable on crate feature WebView
and crate feature objc2-app-kit
and macOS only.
unsafe fn webViewAreToolbarsVisible(&self, sender: Option<&WebView>) -> bool
WebView
and crate feature objc2-app-kit
and macOS only.Determine whether the window’s toolbars are currently visible
Parameter 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.
Sourceunsafe fn webView_setToolbarsVisible(
&self,
sender: Option<&WebView>,
visible: bool,
)
đź‘ŽDeprecatedAvailable on crate feature WebView
and crate feature objc2-app-kit
and macOS only.
unsafe fn webView_setToolbarsVisible( &self, sender: Option<&WebView>, visible: bool, )
WebView
and crate feature objc2-app-kit
and macOS only.Parameter sender
: The WebView sending the delegate method.
Set whether the window’s toolbars are currently visible.
Parameter 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).
Sourceunsafe fn webViewIsStatusBarVisible(&self, sender: Option<&WebView>) -> bool
đź‘ŽDeprecatedAvailable on crate feature WebView
and crate feature objc2-app-kit
and macOS only.
unsafe fn webViewIsStatusBarVisible(&self, sender: Option<&WebView>) -> bool
WebView
and crate feature objc2-app-kit
and macOS only.Determine whether the status bar is visible.
Parameter sender
: The WebView sending the delegate method.
Returns: YES if the status bar is visible, otherwise NO.
Sourceunsafe fn webView_setStatusBarVisible(
&self,
sender: Option<&WebView>,
visible: bool,
)
đź‘ŽDeprecatedAvailable on crate feature WebView
and crate feature objc2-app-kit
and macOS only.
unsafe fn webView_setStatusBarVisible( &self, sender: Option<&WebView>, visible: bool, )
WebView
and crate feature objc2-app-kit
and macOS only.Set whether the status bar is currently visible.
Parameter visible
: The new visibility value
Setting this to YES should show the status bar, setting it to NO should hide it.
Sourceunsafe fn webViewIsResizable(&self, sender: Option<&WebView>) -> bool
đź‘ŽDeprecatedAvailable on crate feature WebView
and crate feature objc2-app-kit
and macOS only.
unsafe fn webViewIsResizable(&self, sender: Option<&WebView>) -> bool
WebView
and crate feature objc2-app-kit
and macOS only.Determine whether the window is resizable or not.
Parameter sender
: The 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.
Sourceunsafe fn webView_setResizable(&self, sender: Option<&WebView>, resizable: bool)
đź‘ŽDeprecatedAvailable on crate feature WebView
and crate feature objc2-app-kit
and macOS only.
unsafe fn webView_setResizable(&self, sender: Option<&WebView>, resizable: bool)
WebView
and crate feature objc2-app-kit
and macOS only.Set the window to resizable or not
Parameter sender
: The WebView sending the delegate method.
Parameter 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.
Sourceunsafe fn webView_setFrame(&self, sender: Option<&WebView>, frame: NSRect)
đź‘ŽDeprecatedAvailable on crate feature WebView
and crate feature objc2-app-kit
and macOS only.
unsafe fn webView_setFrame(&self, sender: Option<&WebView>, frame: NSRect)
WebView
and crate feature objc2-app-kit
and macOS only.Set the window’s frame rect
Parameter sender
: The WebView sending the delegate method.
Parameter 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.
Sourceunsafe fn webViewFrame(&self, sender: Option<&WebView>) -> NSRect
đź‘ŽDeprecatedAvailable on crate feature WebView
and crate feature objc2-app-kit
and macOS only.
unsafe fn webViewFrame(&self, sender: Option<&WebView>) -> NSRect
WebView
and crate feature objc2-app-kit
and macOS only.Parameter sender
: The WebView sending the delegate method.
Return the window’s frame rect
Sourceunsafe fn webView_runJavaScriptAlertPanelWithMessage_initiatedByFrame(
&self,
sender: Option<&WebView>,
message: Option<&NSString>,
frame: Option<&WebFrame>,
)
đź‘ŽDeprecatedAvailable on crate feature WebFrame
and crate feature WebView
and crate feature objc2-app-kit
and macOS only.
unsafe fn webView_runJavaScriptAlertPanelWithMessage_initiatedByFrame( &self, sender: Option<&WebView>, message: Option<&NSString>, frame: Option<&WebFrame>, )
WebFrame
and crate feature WebView
and crate feature objc2-app-kit
and macOS only.Display a JavaScript alert panel.
Parameter sender
: The WebView sending the delegate method.
Parameter message
: The message to display.
Parameter 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.
Sourceunsafe fn webView_runJavaScriptConfirmPanelWithMessage_initiatedByFrame(
&self,
sender: Option<&WebView>,
message: Option<&NSString>,
frame: Option<&WebFrame>,
) -> bool
đź‘ŽDeprecatedAvailable on crate feature WebFrame
and crate feature WebView
and crate feature objc2-app-kit
and macOS only.
unsafe fn webView_runJavaScriptConfirmPanelWithMessage_initiatedByFrame( &self, sender: Option<&WebView>, message: Option<&NSString>, frame: Option<&WebFrame>, ) -> bool
WebFrame
and crate feature WebView
and crate feature objc2-app-kit
and macOS only.Display a JavaScript confirm panel.
Parameter sender
: The WebView sending the delegate method.
Parameter message
: The message to display.
Parameter 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”.
Sourceunsafe fn webView_runJavaScriptTextInputPanelWithPrompt_defaultText_initiatedByFrame(
&self,
sender: Option<&WebView>,
prompt: Option<&NSString>,
default_text: Option<&NSString>,
frame: Option<&WebFrame>,
) -> Option<Retained<NSString>>
đź‘ŽDeprecatedAvailable on crate feature WebFrame
and crate feature WebView
and crate feature objc2-app-kit
and macOS only.
unsafe fn webView_runJavaScriptTextInputPanelWithPrompt_defaultText_initiatedByFrame( &self, sender: Option<&WebView>, prompt: Option<&NSString>, default_text: Option<&NSString>, frame: Option<&WebFrame>, ) -> Option<Retained<NSString>>
WebFrame
and crate feature WebView
and crate feature objc2-app-kit
and macOS only.Display a JavaScript text input panel.
Parameter sender
: The WebView sending the delegate method.
Parameter prompt
: The message to display.
Parameter defaultText
: The initial text for the text entry area.
Parameter 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.
Sourceunsafe fn webView_runBeforeUnloadConfirmPanelWithMessage_initiatedByFrame(
&self,
sender: Option<&WebView>,
message: Option<&NSString>,
frame: Option<&WebFrame>,
) -> bool
đź‘ŽDeprecatedAvailable on crate feature WebFrame
and crate feature WebView
and crate feature objc2-app-kit
and macOS only.
unsafe fn webView_runBeforeUnloadConfirmPanelWithMessage_initiatedByFrame( &self, sender: Option<&WebView>, message: Option<&NSString>, frame: Option<&WebFrame>, ) -> bool
WebFrame
and crate feature WebView
and crate feature objc2-app-kit
and macOS only.Display a confirm panel by an “before unload” event handler.
Parameter sender
: The WebView sending the delegate method.
Parameter message
: The message to display.
Parameter 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”.
Sourceunsafe fn webView_runOpenPanelForFileButtonWithResultListener(
&self,
sender: Option<&WebView>,
result_listener: Option<&ProtocolObject<dyn WebOpenPanelResultListener>>,
)
đź‘ŽDeprecatedAvailable on crate feature WebView
and crate feature objc2-app-kit
and macOS only.
unsafe fn webView_runOpenPanelForFileButtonWithResultListener( &self, sender: Option<&WebView>, result_listener: Option<&ProtocolObject<dyn WebOpenPanelResultListener>>, )
WebView
and crate feature objc2-app-kit
and macOS only.Display a file open panel for a file input control.
Parameter sender
: The WebView sending the delegate method.
Parameter 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.
Sourceunsafe fn webView_runOpenPanelForFileButtonWithResultListener_allowMultipleFiles(
&self,
sender: Option<&WebView>,
result_listener: Option<&ProtocolObject<dyn WebOpenPanelResultListener>>,
allow_multiple_files: bool,
)
đź‘ŽDeprecatedAvailable on crate feature WebView
and crate feature objc2-app-kit
and macOS only.
unsafe fn webView_runOpenPanelForFileButtonWithResultListener_allowMultipleFiles( &self, sender: Option<&WebView>, result_listener: Option<&ProtocolObject<dyn WebOpenPanelResultListener>>, allow_multiple_files: bool, )
WebView
and crate feature objc2-app-kit
and macOS only.Display a file open panel for a file input control that may allow multiple files to be selected.
Parameter sender
: The WebView sending the delegate method.
Parameter resultListener
: The object to call back with the results.
Parameter 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.
Sourceunsafe fn webView_mouseDidMoveOverElement_modifierFlags(
&self,
sender: Option<&WebView>,
element_information: Option<&NSDictionary>,
modifier_flags: NSUInteger,
)
đź‘ŽDeprecatedAvailable on crate feature WebView
and crate feature objc2-app-kit
and macOS only.
unsafe fn webView_mouseDidMoveOverElement_modifierFlags( &self, sender: Option<&WebView>, element_information: Option<&NSDictionary>, modifier_flags: NSUInteger, )
WebView
and crate feature objc2-app-kit
and macOS only.Update the window’s feedback for mousing over links to reflect a new item the mouse is over or new modifier flags.
Parameter sender
: The WebView sending the delegate method.
Parameter elementInformation
: Dictionary that describes the element that the mouse is over, or nil.
Parameter modifierFlags
: The modifier flags as in NSEvent.
Sourceunsafe fn webView_contextMenuItemsForElement_defaultMenuItems(
&self,
sender: Option<&WebView>,
element: Option<&NSDictionary>,
default_menu_items: Option<&NSArray>,
) -> Option<Retained<NSArray>>
đź‘ŽDeprecatedAvailable on crate feature WebView
and crate feature objc2-app-kit
and macOS only.
unsafe fn webView_contextMenuItemsForElement_defaultMenuItems( &self, sender: Option<&WebView>, element: Option<&NSDictionary>, default_menu_items: Option<&NSArray>, ) -> Option<Retained<NSArray>>
WebView
and crate feature objc2-app-kit
and macOS only.Returns the menu items to display in an element’s contextual menu.
Parameter sender
: The WebView sending the delegate method.
Parameter element
: A dictionary representation of the clicked element.
Parameter defaultMenuItems
: An array of default NSMenuItems to include in all contextual menus.
Returns: An array of NSMenuItems to include in the contextual menu.
Sourceunsafe fn webView_validateUserInterfaceItem_defaultValidation(
&self,
web_view: Option<&WebView>,
item: Option<&ProtocolObject<dyn NSValidatedUserInterfaceItem>>,
default_validation: bool,
) -> bool
đź‘ŽDeprecatedAvailable on crate feature WebView
and crate feature objc2-app-kit
and macOS only.
unsafe fn webView_validateUserInterfaceItem_defaultValidation( &self, web_view: Option<&WebView>, item: Option<&ProtocolObject<dyn NSValidatedUserInterfaceItem>>, default_validation: bool, ) -> bool
WebView
and crate feature objc2-app-kit
and macOS only.Controls UI validation
Parameter webView
: The WebView sending the delegate method
Parameter item
: The user interface item being validated
Parameter 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.
Sourceunsafe fn webView_shouldPerformAction_fromSender(
&self,
web_view: Option<&WebView>,
action: Option<Sel>,
sender: Option<&AnyObject>,
) -> bool
đź‘ŽDeprecatedAvailable on crate feature WebView
and crate feature objc2-app-kit
and macOS only.
unsafe fn webView_shouldPerformAction_fromSender( &self, web_view: Option<&WebView>, action: Option<Sel>, sender: Option<&AnyObject>, ) -> bool
WebView
and crate feature objc2-app-kit
and macOS only.Controls actions
Parameter webView
: The WebView sending the delegate method
Parameter action
: The action being sent
Parameter 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.
Sourceunsafe fn webView_dragDestinationActionMaskForDraggingInfo(
&self,
web_view: Option<&WebView>,
dragging_info: Option<&ProtocolObject<dyn NSDraggingInfo>>,
) -> NSUInteger
đź‘ŽDeprecatedAvailable on crate feature WebView
and crate feature objc2-app-kit
and macOS only.
unsafe fn webView_dragDestinationActionMaskForDraggingInfo( &self, web_view: Option<&WebView>, dragging_info: Option<&ProtocolObject<dyn NSDraggingInfo>>, ) -> NSUInteger
WebView
and crate feature objc2-app-kit
and macOS only.Controls behavior when dragging to a WebView
Parameter webView
: The WebView sending the delegate method
Parameter 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.
Sourceunsafe fn webView_willPerformDragDestinationAction_forDraggingInfo(
&self,
web_view: Option<&WebView>,
action: WebDragDestinationAction,
dragging_info: Option<&ProtocolObject<dyn NSDraggingInfo>>,
)
đź‘ŽDeprecatedAvailable on crate feature WebView
and crate feature objc2-app-kit
and macOS only.
unsafe fn webView_willPerformDragDestinationAction_forDraggingInfo( &self, web_view: Option<&WebView>, action: WebDragDestinationAction, dragging_info: Option<&ProtocolObject<dyn NSDraggingInfo>>, )
WebView
and crate feature objc2-app-kit
and macOS only.Informs that WebView will perform a drag destination action
Parameter webView
: The WebView sending the delegate method
Parameter action
: The drag destination action
Parameter 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.
Sourceunsafe fn webView_dragSourceActionMaskForPoint(
&self,
web_view: Option<&WebView>,
point: NSPoint,
) -> NSUInteger
đź‘ŽDeprecatedAvailable on crate feature WebView
and crate feature objc2-app-kit
and macOS only.
unsafe fn webView_dragSourceActionMaskForPoint( &self, web_view: Option<&WebView>, point: NSPoint, ) -> NSUInteger
WebView
and crate feature objc2-app-kit
and macOS only.Controls behavior when dragging from a WebView
Parameter webView
: The WebView sending the delegate method
Parameter 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.
Sourceunsafe fn webView_willPerformDragSourceAction_fromPoint_withPasteboard(
&self,
web_view: Option<&WebView>,
action: WebDragSourceAction,
point: NSPoint,
pasteboard: Option<&NSPasteboard>,
)
đź‘ŽDeprecatedAvailable on crate feature WebView
and crate feature objc2-app-kit
and macOS only.
unsafe fn webView_willPerformDragSourceAction_fromPoint_withPasteboard( &self, web_view: Option<&WebView>, action: WebDragSourceAction, point: NSPoint, pasteboard: Option<&NSPasteboard>, )
WebView
and crate feature objc2-app-kit
and macOS only.Informs that a drag a has begun from a WebView
Parameter webView
: The WebView sending the delegate method
Parameter action
: The drag source action
Parameter point
: The point where the drag started in the coordinates of the WebView
Parameter 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.
Sourceunsafe fn webView_printFrameView(
&self,
sender: Option<&WebView>,
frame_view: Option<&WebFrameView>,
)
đź‘ŽDeprecatedAvailable on crate feature WebFrameView
and crate feature WebView
and crate feature objc2-app-kit
and macOS only.
unsafe fn webView_printFrameView( &self, sender: Option<&WebView>, frame_view: Option<&WebFrameView>, )
WebFrameView
and crate feature WebView
and crate feature objc2-app-kit
and macOS only.Informs that a WebFrameView needs to be printed
Parameter sender
: The WebView sending the delegate method
Parameter 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.
Sourceunsafe fn webViewHeaderHeight(&self, sender: Option<&WebView>) -> c_float
đź‘ŽDeprecatedAvailable on crate feature WebView
and crate feature objc2-app-kit
and macOS only.
unsafe fn webViewHeaderHeight(&self, sender: Option<&WebView>) -> c_float
WebView
and crate feature objc2-app-kit
and macOS only.Parameter 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:.
đź‘ŽDeprecatedAvailable on crate feature WebView
and crate feature objc2-app-kit
and macOS only.
WebView
and crate feature objc2-app-kit
and macOS only.Parameter 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:.
Sourceunsafe fn webView_drawHeaderInRect(
&self,
sender: Option<&WebView>,
rect: NSRect,
)
đź‘ŽDeprecatedAvailable on crate feature WebView
and crate feature objc2-app-kit
and macOS only.
unsafe fn webView_drawHeaderInRect( &self, sender: Option<&WebView>, rect: NSRect, )
WebView
and crate feature objc2-app-kit
and macOS only.Parameter sender
: The WebView sending the delegate method
Parameter rect
: The NSRect reserved for the header of the page
The delegate should draw a header for the sender in the supplied rect.
đź‘ŽDeprecatedAvailable on crate feature WebView
and crate feature objc2-app-kit
and macOS only.
WebView
and crate feature objc2-app-kit
and macOS only.Parameter sender
: The WebView sending the delegate method
Parameter rect
: The NSRect reserved for the footer of the page
The delegate should draw a footer for the sender in the supplied rect.
unsafe fn webView_runJavaScriptAlertPanelWithMessage( &self, sender: Option<&WebView>, message: Option<&NSString>, )
WebView
and crate feature objc2-app-kit
and macOS only.unsafe fn webView_runJavaScriptConfirmPanelWithMessage( &self, sender: Option<&WebView>, message: Option<&NSString>, ) -> bool
WebView
and crate feature objc2-app-kit
and macOS only.unsafe fn webView_runJavaScriptTextInputPanelWithPrompt_defaultText( &self, sender: Option<&WebView>, prompt: Option<&NSString>, default_text: Option<&NSString>, ) -> Option<Retained<NSString>>
WebView
and crate feature objc2-app-kit
and macOS only.unsafe fn webView_setContentRect(&self, sender: Option<&WebView>, frame: NSRect)
WebView
and crate feature objc2-app-kit
and macOS only.unsafe fn webViewContentRect(&self, sender: Option<&WebView>) -> NSRect
WebView
and crate feature objc2-app-kit
and macOS only.