objc2_web_kit/generated/
WebUIDelegate.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use objc2::__framework_prelude::*;
5#[cfg(feature = "objc2-app-kit")]
6#[cfg(target_os = "macos")]
7use objc2_app_kit::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitemtagopenlinkinnewwindow?language=objc)
13#[deprecated]
14pub const WebMenuItemTagOpenLinkInNewWindow: c_uint = 1;
15/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitemtagdownloadlinktodisk?language=objc)
16#[deprecated]
17pub const WebMenuItemTagDownloadLinkToDisk: c_uint = 2;
18/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitemtagcopylinktoclipboard?language=objc)
19#[deprecated]
20pub const WebMenuItemTagCopyLinkToClipboard: c_uint = 3;
21/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitemtagopenimageinnewwindow?language=objc)
22#[deprecated]
23pub const WebMenuItemTagOpenImageInNewWindow: c_uint = 4;
24/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitemtagdownloadimagetodisk?language=objc)
25#[deprecated]
26pub const WebMenuItemTagDownloadImageToDisk: c_uint = 5;
27/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitemtagcopyimagetoclipboard?language=objc)
28#[deprecated]
29pub const WebMenuItemTagCopyImageToClipboard: c_uint = 6;
30/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitemtagopenframeinnewwindow?language=objc)
31#[deprecated]
32pub const WebMenuItemTagOpenFrameInNewWindow: c_uint = 7;
33/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitemtagcopy?language=objc)
34#[deprecated]
35pub const WebMenuItemTagCopy: c_uint = 8;
36/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitemtaggoback?language=objc)
37#[deprecated]
38pub const WebMenuItemTagGoBack: c_uint = 9;
39/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitemtaggoforward?language=objc)
40#[deprecated]
41pub const WebMenuItemTagGoForward: c_uint = 10;
42/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitemtagstop?language=objc)
43#[deprecated]
44pub const WebMenuItemTagStop: c_uint = 11;
45/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitemtagreload?language=objc)
46#[deprecated]
47pub const WebMenuItemTagReload: c_uint = 12;
48/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitemtagcut?language=objc)
49#[deprecated]
50pub const WebMenuItemTagCut: c_uint = 13;
51/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitemtagpaste?language=objc)
52#[deprecated]
53pub const WebMenuItemTagPaste: c_uint = 14;
54/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitemtagspellingguess?language=objc)
55#[deprecated]
56pub const WebMenuItemTagSpellingGuess: c_uint = 15;
57/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitemtagnoguessesfound?language=objc)
58#[deprecated]
59pub const WebMenuItemTagNoGuessesFound: c_uint = 16;
60/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitemtagignorespelling?language=objc)
61#[deprecated]
62pub const WebMenuItemTagIgnoreSpelling: c_uint = 17;
63/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitemtaglearnspelling?language=objc)
64#[deprecated]
65pub const WebMenuItemTagLearnSpelling: c_uint = 18;
66/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitemtagother?language=objc)
67#[deprecated]
68pub const WebMenuItemTagOther: c_uint = 19;
69/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitemtagsearchinspotlight?language=objc)
70#[deprecated]
71pub const WebMenuItemTagSearchInSpotlight: c_uint = 20;
72/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitemtagsearchweb?language=objc)
73#[deprecated]
74pub const WebMenuItemTagSearchWeb: c_uint = 21;
75/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitemtaglookupindictionary?language=objc)
76#[deprecated]
77pub const WebMenuItemTagLookUpInDictionary: c_uint = 22;
78/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitemtagopenwithdefaultapplication?language=objc)
79#[deprecated]
80pub const WebMenuItemTagOpenWithDefaultApplication: c_uint = 23;
81/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitempdfactualsize?language=objc)
82#[deprecated]
83pub const WebMenuItemPDFActualSize: c_uint = 24;
84/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitempdfzoomin?language=objc)
85#[deprecated]
86pub const WebMenuItemPDFZoomIn: c_uint = 25;
87/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitempdfzoomout?language=objc)
88#[deprecated]
89pub const WebMenuItemPDFZoomOut: c_uint = 26;
90/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitempdfautosize?language=objc)
91#[deprecated]
92pub const WebMenuItemPDFAutoSize: c_uint = 27;
93/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitempdfsinglepage?language=objc)
94#[deprecated]
95pub const WebMenuItemPDFSinglePage: c_uint = 28;
96/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitempdffacingpages?language=objc)
97#[deprecated]
98pub const WebMenuItemPDFFacingPages: c_uint = 29;
99/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitempdfcontinuous?language=objc)
100#[deprecated]
101pub const WebMenuItemPDFContinuous: c_uint = 30;
102/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitempdfnextpage?language=objc)
103#[deprecated]
104pub const WebMenuItemPDFNextPage: c_uint = 31;
105/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitempdfpreviouspage?language=objc)
106#[deprecated]
107pub const WebMenuItemPDFPreviousPage: c_uint = 32;
108
109/// Actions that the destination of a drag can perform.
110///
111/// See also [Apple's documentation](https://developer.apple.com/documentation/webkit/webdragdestinationaction?language=objc)
112// NS_OPTIONS
113#[deprecated]
114#[repr(transparent)]
115#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
116pub struct WebDragDestinationAction(pub NSUInteger);
117bitflags::bitflags! {
118    impl WebDragDestinationAction: NSUInteger {
119#[deprecated]
120        #[doc(alias = "WebDragDestinationActionNone")]
121        const None = 0;
122#[deprecated]
123        #[doc(alias = "WebDragDestinationActionDHTML")]
124        const DHTML = 1;
125#[deprecated]
126        #[doc(alias = "WebDragDestinationActionEdit")]
127        const Edit = 2;
128#[deprecated]
129        #[doc(alias = "WebDragDestinationActionLoad")]
130        const Load = 4;
131#[deprecated]
132        #[doc(alias = "WebDragDestinationActionAny")]
133        const Any = c_uint::MAX as _;
134    }
135}
136
137unsafe impl Encode for WebDragDestinationAction {
138    const ENCODING: Encoding = NSUInteger::ENCODING;
139}
140
141unsafe impl RefEncode for WebDragDestinationAction {
142    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
143}
144
145/// Actions that the source of a drag can perform.
146///
147/// See also [Apple's documentation](https://developer.apple.com/documentation/webkit/webdragsourceaction?language=objc)
148// NS_OPTIONS
149#[deprecated]
150#[repr(transparent)]
151#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
152pub struct WebDragSourceAction(pub NSUInteger);
153bitflags::bitflags! {
154    impl WebDragSourceAction: NSUInteger {
155#[deprecated]
156        #[doc(alias = "WebDragSourceActionNone")]
157        const None = 0;
158#[deprecated]
159        #[doc(alias = "WebDragSourceActionDHTML")]
160        const DHTML = 1;
161#[deprecated]
162        #[doc(alias = "WebDragSourceActionImage")]
163        const Image = 2;
164#[deprecated]
165        #[doc(alias = "WebDragSourceActionLink")]
166        const Link = 4;
167#[deprecated]
168        #[doc(alias = "WebDragSourceActionSelection")]
169        const Selection = 8;
170#[deprecated]
171        #[doc(alias = "WebDragSourceActionAny")]
172        const Any = c_uint::MAX as _;
173    }
174}
175
176unsafe impl Encode for WebDragSourceAction {
177    const ENCODING: Encoding = NSUInteger::ENCODING;
178}
179
180unsafe impl RefEncode for WebDragSourceAction {
181    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
182}
183
184extern_protocol!(
185    /// This protocol is used to call back with the results of
186    /// the file open panel requested by runOpenPanelForFileButtonWithResultListener:
187    ///
188    /// See also [Apple's documentation](https://developer.apple.com/documentation/webkit/webopenpanelresultlistener?language=objc)
189    #[deprecated]
190    pub unsafe trait WebOpenPanelResultListener: NSObjectProtocol {
191        /// Call this method to return a filename from the file open panel.
192        ///
193        /// Parameter `fileName`: the path of the selected file
194        #[deprecated]
195        #[unsafe(method(chooseFilename:))]
196        #[unsafe(method_family = none)]
197        unsafe fn chooseFilename(&self, file_name: Option<&NSString>);
198
199        /// Call this method to return an array of filenames from the file open panel.
200        ///
201        /// Parameter `fileNames`: an array of paths of selected files
202        #[unsafe(method(chooseFilenames:))]
203        #[unsafe(method_family = none)]
204        unsafe fn chooseFilenames(&self, file_names: Option<&NSArray>);
205
206        /// Call this method to indicate that the file open panel was cancelled.
207        #[deprecated]
208        #[unsafe(method(cancel))]
209        #[unsafe(method_family = none)]
210        unsafe fn cancel(&self);
211    }
212);
213
214extern_protocol!(
215    /// A class that implements WebUIDelegate provides
216    /// window-related methods that may be used by Javascript, plugins and
217    /// other aspects of web pages. These methods are used to open new
218    /// windows and control aspects of existing windows.
219    ///
220    /// See also [Apple's documentation](https://developer.apple.com/documentation/webkit/webuidelegate?language=objc)
221    #[deprecated]
222    pub unsafe trait WebUIDelegate: NSObjectProtocol {
223        #[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
224        #[cfg(target_os = "macos")]
225        /// Create a new window and begin to load the specified request.
226        ///
227        /// The newly created window is hidden, and the window operations delegate on the
228        /// new WebViews will get a webViewShow: call.
229        ///
230        /// Parameter `sender`: The WebView sending the delegate method.
231        ///
232        /// Parameter `request`: The request to load.
233        ///
234        /// Returns: The WebView for the new window.
235        #[deprecated]
236        #[optional]
237        #[unsafe(method(webView:createWebViewWithRequest:))]
238        #[unsafe(method_family = none)]
239        unsafe fn webView_createWebViewWithRequest(
240            &self,
241            sender: Option<&WebView>,
242            request: Option<&NSURLRequest>,
243            mtm: MainThreadMarker,
244        ) -> Option<Retained<WebView>>;
245
246        #[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
247        #[cfg(target_os = "macos")]
248        /// Parameter `sender`: The WebView sending the delegate method.
249        ///
250        /// Show the window that contains the top level view of the WebView,
251        /// ordering it frontmost.
252        ///
253        /// This will only be called just after createWindowWithRequest:
254        /// is used to create a new window.
255        #[deprecated]
256        #[optional]
257        #[unsafe(method(webViewShow:))]
258        #[unsafe(method_family = none)]
259        unsafe fn webViewShow(&self, sender: Option<&WebView>);
260
261        #[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
262        #[cfg(target_os = "macos")]
263        /// Create a new window and begin to load the specified request.
264        ///
265        /// The newly created window is hidden, and the window operations delegate on the
266        /// new WebViews will get a webViewShow: call.
267        ///
268        /// Parameter `sender`: The WebView sending the delegate method.
269        ///
270        /// Parameter `request`: The request to load.
271        ///
272        /// Returns: The WebView for the new window.
273        #[deprecated]
274        #[optional]
275        #[unsafe(method(webView:createWebViewModalDialogWithRequest:))]
276        #[unsafe(method_family = none)]
277        unsafe fn webView_createWebViewModalDialogWithRequest(
278            &self,
279            sender: Option<&WebView>,
280            request: Option<&NSURLRequest>,
281            mtm: MainThreadMarker,
282        ) -> Option<Retained<WebView>>;
283
284        #[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
285        #[cfg(target_os = "macos")]
286        /// Parameter `sender`: The WebView sending the delegate method.
287        ///
288        /// Show the window that contains the top level view of the WebView,
289        /// ordering it frontmost. The window should be run modal in the application.
290        ///
291        /// This will only be called just after createWebViewModalDialogWithRequest:
292        /// is used to create a new window.
293        #[deprecated]
294        #[optional]
295        #[unsafe(method(webViewRunModal:))]
296        #[unsafe(method_family = none)]
297        unsafe fn webViewRunModal(&self, sender: Option<&WebView>);
298
299        #[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
300        #[cfg(target_os = "macos")]
301        /// Close the current window.
302        ///
303        /// Parameter `sender`: The WebView sending the delegate method.
304        ///
305        /// Clients showing multiple views in one window may
306        /// choose to close only the one corresponding to this
307        /// WebView. Other clients may choose to ignore this method
308        /// entirely.
309        #[deprecated]
310        #[optional]
311        #[unsafe(method(webViewClose:))]
312        #[unsafe(method_family = none)]
313        unsafe fn webViewClose(&self, sender: Option<&WebView>);
314
315        #[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
316        #[cfg(target_os = "macos")]
317        /// Focus the current window (i.e. makeKeyAndOrderFront:).
318        ///
319        /// Parameter `sender`: The WebView sending the delegate method.
320        ///
321        /// Clients showing multiple views in one window may want to
322        /// also do something to focus the one corresponding to this WebView.
323        #[deprecated]
324        #[optional]
325        #[unsafe(method(webViewFocus:))]
326        #[unsafe(method_family = none)]
327        unsafe fn webViewFocus(&self, sender: Option<&WebView>);
328
329        #[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
330        #[cfg(target_os = "macos")]
331        /// Unfocus the current window.
332        ///
333        /// Parameter `sender`: The WebView sending the delegate method.
334        ///
335        /// Clients showing multiple views in one window may want to
336        /// also do something to unfocus the one corresponding to this WebView.
337        #[deprecated]
338        #[optional]
339        #[unsafe(method(webViewUnfocus:))]
340        #[unsafe(method_family = none)]
341        unsafe fn webViewUnfocus(&self, sender: Option<&WebView>);
342
343        #[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
344        #[cfg(target_os = "macos")]
345        /// Get the first responder for this window.
346        ///
347        /// Parameter `sender`: The WebView sending the delegate method.
348        ///
349        /// This method should return the focused control in the
350        /// WebView's view, if any. If the view is out of the window
351        /// hierarchy, this might return something than calling firstResponder
352        /// on the real NSWindow would. It's OK to return either nil or the
353        /// real first responder if some control not in the window has focus.
354        #[deprecated]
355        #[optional]
356        #[unsafe(method(webViewFirstResponder:))]
357        #[unsafe(method_family = none)]
358        unsafe fn webViewFirstResponder(
359            &self,
360            sender: Option<&WebView>,
361            mtm: MainThreadMarker,
362        ) -> Option<Retained<NSResponder>>;
363
364        #[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
365        #[cfg(target_os = "macos")]
366        /// Set the first responder for this window.
367        ///
368        /// Parameter `sender`: The WebView sending the delegate method.
369        ///
370        /// Parameter `responder`: The responder to make first (will always be a view)
371        ///
372        /// responder will always be a view that is in the view
373        /// subhierarchy of the top-level web view for this WebView. If the
374        /// WebView's top level view is currently out of the view
375        /// hierarchy, it may be desirable to save the first responder
376        /// elsewhere, or possibly ignore this call.
377        #[deprecated]
378        #[optional]
379        #[unsafe(method(webView:makeFirstResponder:))]
380        #[unsafe(method_family = none)]
381        unsafe fn webView_makeFirstResponder(
382            &self,
383            sender: Option<&WebView>,
384            responder: Option<&NSResponder>,
385        );
386
387        #[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
388        #[cfg(target_os = "macos")]
389        /// Set the window's status display, if any, to the specified string.
390        ///
391        /// Parameter `sender`: The WebView sending the delegate method.
392        ///
393        /// Parameter `text`: The status text to set
394        #[deprecated]
395        #[optional]
396        #[unsafe(method(webView:setStatusText:))]
397        #[unsafe(method_family = none)]
398        unsafe fn webView_setStatusText(&self, sender: Option<&WebView>, text: Option<&NSString>);
399
400        #[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
401        #[cfg(target_os = "macos")]
402        /// Get the currently displayed status text.
403        ///
404        /// Parameter `sender`: The WebView sending the delegate method.
405        ///
406        /// Returns: The status text
407        #[deprecated]
408        #[optional]
409        #[unsafe(method(webViewStatusText:))]
410        #[unsafe(method_family = none)]
411        unsafe fn webViewStatusText(&self, sender: Option<&WebView>) -> Option<Retained<NSString>>;
412
413        #[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
414        #[cfg(target_os = "macos")]
415        /// Determine whether the window's toolbars are currently visible
416        ///
417        /// Parameter `sender`: The WebView sending the delegate method.
418        ///
419        /// This method should return YES if the window has any
420        /// toolbars that are currently on, besides the status bar. If the app
421        /// has more than one toolbar per window, for example a regular
422        /// command toolbar and a favorites bar, it should return YES from
423        /// this method if at least one is on.
424        ///
425        /// Returns: YES if at least one toolbar is visible, otherwise NO.
426        #[deprecated]
427        #[optional]
428        #[unsafe(method(webViewAreToolbarsVisible:))]
429        #[unsafe(method_family = none)]
430        unsafe fn webViewAreToolbarsVisible(&self, sender: Option<&WebView>) -> bool;
431
432        #[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
433        #[cfg(target_os = "macos")]
434        /// Parameter `sender`: The WebView sending the delegate method.
435        ///
436        /// Set whether the window's toolbars are currently visible.
437        ///
438        /// Parameter `visible`: New value for toolbar visibility
439        ///
440        /// Setting this to YES should turn on all toolbars
441        /// (except for a possible status bar). Setting it to NO should turn
442        /// off all toolbars (with the same exception).
443        #[deprecated]
444        #[optional]
445        #[unsafe(method(webView:setToolbarsVisible:))]
446        #[unsafe(method_family = none)]
447        unsafe fn webView_setToolbarsVisible(&self, sender: Option<&WebView>, visible: bool);
448
449        #[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
450        #[cfg(target_os = "macos")]
451        /// Determine whether the status bar is visible.
452        ///
453        /// Parameter `sender`: The WebView sending the delegate method.
454        ///
455        /// Returns: YES if the status bar is visible, otherwise NO.
456        #[deprecated]
457        #[optional]
458        #[unsafe(method(webViewIsStatusBarVisible:))]
459        #[unsafe(method_family = none)]
460        unsafe fn webViewIsStatusBarVisible(&self, sender: Option<&WebView>) -> bool;
461
462        #[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
463        #[cfg(target_os = "macos")]
464        /// Set whether the status bar is currently visible.
465        ///
466        /// Parameter `visible`: The new visibility value
467        ///
468        /// Setting this to YES should show the status bar,
469        /// setting it to NO should hide it.
470        #[deprecated]
471        #[optional]
472        #[unsafe(method(webView:setStatusBarVisible:))]
473        #[unsafe(method_family = none)]
474        unsafe fn webView_setStatusBarVisible(&self, sender: Option<&WebView>, visible: bool);
475
476        #[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
477        #[cfg(target_os = "macos")]
478        /// Determine whether the window is resizable or not.
479        ///
480        /// Parameter `sender`: The WebView sending the delegate method.
481        ///
482        /// Returns: YES if resizable, NO if not.
483        ///
484        /// If there are multiple views in the same window, they
485        /// have have their own separate resize controls and this may need to
486        /// be handled specially.
487        #[deprecated]
488        #[optional]
489        #[unsafe(method(webViewIsResizable:))]
490        #[unsafe(method_family = none)]
491        unsafe fn webViewIsResizable(&self, sender: Option<&WebView>) -> bool;
492
493        #[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
494        #[cfg(target_os = "macos")]
495        /// Set the window to resizable or not
496        ///
497        /// Parameter `sender`: The WebView sending the delegate method.
498        ///
499        /// Parameter `resizable`: YES if the window should be made resizable, NO if not.
500        ///
501        /// If there are multiple views in the same window, they
502        /// have have their own separate resize controls and this may need to
503        /// be handled specially.
504        #[deprecated]
505        #[optional]
506        #[unsafe(method(webView:setResizable:))]
507        #[unsafe(method_family = none)]
508        unsafe fn webView_setResizable(&self, sender: Option<&WebView>, resizable: bool);
509
510        #[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
511        #[cfg(target_os = "macos")]
512        /// Set the window's frame rect
513        ///
514        /// Parameter `sender`: The WebView sending the delegate method.
515        ///
516        /// Parameter `frame`: The new window frame size
517        ///
518        /// Even though a caller could set the frame directly using the NSWindow,
519        /// this method is provided so implementors of this protocol can do special
520        /// things on programmatic move/resize, like avoiding autosaving of the size.
521        #[deprecated]
522        #[optional]
523        #[unsafe(method(webView:setFrame:))]
524        #[unsafe(method_family = none)]
525        unsafe fn webView_setFrame(&self, sender: Option<&WebView>, frame: NSRect);
526
527        #[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
528        #[cfg(target_os = "macos")]
529        /// Parameter `sender`: The WebView sending the delegate method.
530        ///
531        /// Return the window's frame rect
532        #[deprecated]
533        #[optional]
534        #[unsafe(method(webViewFrame:))]
535        #[unsafe(method_family = none)]
536        unsafe fn webViewFrame(&self, sender: Option<&WebView>) -> NSRect;
537
538        #[cfg(all(feature = "WebFrame", feature = "WebView", feature = "objc2-app-kit"))]
539        #[cfg(target_os = "macos")]
540        /// Display a JavaScript alert panel.
541        ///
542        /// Parameter `sender`: The WebView sending the delegate method.
543        ///
544        /// Parameter `message`: The message to display.
545        ///
546        /// Parameter `frame`: The WebFrame whose JavaScript initiated this call.
547        ///
548        /// Clients should visually indicate that this panel comes
549        /// from JavaScript initiated by the specified frame. The panel should have
550        /// a single OK button.
551        #[deprecated]
552        #[optional]
553        #[unsafe(method(webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:))]
554        #[unsafe(method_family = none)]
555        unsafe fn webView_runJavaScriptAlertPanelWithMessage_initiatedByFrame(
556            &self,
557            sender: Option<&WebView>,
558            message: Option<&NSString>,
559            frame: Option<&WebFrame>,
560        );
561
562        #[cfg(all(feature = "WebFrame", feature = "WebView", feature = "objc2-app-kit"))]
563        #[cfg(target_os = "macos")]
564        /// Display a JavaScript confirm panel.
565        ///
566        /// Parameter `sender`: The WebView sending the delegate method.
567        ///
568        /// Parameter `message`: The message to display.
569        ///
570        /// Parameter `frame`: The WebFrame whose JavaScript initiated this call.
571        ///
572        /// Returns: YES if the user hit OK, NO if the user chose Cancel.
573        ///
574        /// Clients should visually indicate that this panel comes
575        /// from JavaScript initiated by the specified frame. The panel should have
576        /// two buttons, e.g. "OK" and "Cancel".
577        #[deprecated]
578        #[optional]
579        #[unsafe(method(webView:runJavaScriptConfirmPanelWithMessage:initiatedByFrame:))]
580        #[unsafe(method_family = none)]
581        unsafe fn webView_runJavaScriptConfirmPanelWithMessage_initiatedByFrame(
582            &self,
583            sender: Option<&WebView>,
584            message: Option<&NSString>,
585            frame: Option<&WebFrame>,
586        ) -> bool;
587
588        #[cfg(all(feature = "WebFrame", feature = "WebView", feature = "objc2-app-kit"))]
589        #[cfg(target_os = "macos")]
590        /// Display a JavaScript text input panel.
591        ///
592        /// Parameter `sender`: The WebView sending the delegate method.
593        ///
594        /// Parameter `prompt`: The message to display.
595        ///
596        /// Parameter `defaultText`: The initial text for the text entry area.
597        ///
598        /// Parameter `frame`: The WebFrame whose JavaScript initiated this call.
599        ///
600        /// Returns: The typed text if the user hit OK, otherwise nil.
601        ///
602        /// Clients should visually indicate that this panel comes
603        /// from JavaScript initiated by the specified frame. The panel should have
604        /// two buttons, e.g. "OK" and "Cancel", and an area to type text.
605        #[deprecated]
606        #[optional]
607        #[unsafe(method(webView:runJavaScriptTextInputPanelWithPrompt:defaultText:initiatedByFrame:))]
608        #[unsafe(method_family = none)]
609        unsafe fn webView_runJavaScriptTextInputPanelWithPrompt_defaultText_initiatedByFrame(
610            &self,
611            sender: Option<&WebView>,
612            prompt: Option<&NSString>,
613            default_text: Option<&NSString>,
614            frame: Option<&WebFrame>,
615        ) -> Option<Retained<NSString>>;
616
617        #[cfg(all(feature = "WebFrame", feature = "WebView", feature = "objc2-app-kit"))]
618        #[cfg(target_os = "macos")]
619        /// Display a confirm panel by an "before unload" event handler.
620        ///
621        /// Parameter `sender`: The WebView sending the delegate method.
622        ///
623        /// Parameter `message`: The message to display.
624        ///
625        /// Parameter `frame`: The WebFrame whose JavaScript initiated this call.
626        ///
627        /// Returns: YES if the user hit OK, NO if the user chose Cancel.
628        ///
629        /// Clients should include a message in addition to the one
630        /// supplied by the web page that indicates. The panel should have
631        /// two buttons, e.g. "OK" and "Cancel".
632        #[deprecated]
633        #[optional]
634        #[unsafe(method(webView:runBeforeUnloadConfirmPanelWithMessage:initiatedByFrame:))]
635        #[unsafe(method_family = none)]
636        unsafe fn webView_runBeforeUnloadConfirmPanelWithMessage_initiatedByFrame(
637            &self,
638            sender: Option<&WebView>,
639            message: Option<&NSString>,
640            frame: Option<&WebFrame>,
641        ) -> bool;
642
643        #[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
644        #[cfg(target_os = "macos")]
645        /// Display a file open panel for a file input control.
646        ///
647        /// Parameter `sender`: The WebView sending the delegate method.
648        ///
649        /// Parameter `resultListener`: The object to call back with the results.
650        ///
651        /// This method is passed a callback object instead of giving a return
652        /// value so that it can be handled with a sheet.
653        #[deprecated]
654        #[optional]
655        #[unsafe(method(webView:runOpenPanelForFileButtonWithResultListener:))]
656        #[unsafe(method_family = none)]
657        unsafe fn webView_runOpenPanelForFileButtonWithResultListener(
658            &self,
659            sender: Option<&WebView>,
660            result_listener: Option<&ProtocolObject<dyn WebOpenPanelResultListener>>,
661        );
662
663        #[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
664        #[cfg(target_os = "macos")]
665        /// Display a file open panel for a file input control that may allow multiple files to be selected.
666        ///
667        /// Parameter `sender`: The WebView sending the delegate method.
668        ///
669        /// Parameter `resultListener`: The object to call back with the results.
670        ///
671        /// Parameter `allowMultipleFiles`: YES if the open panel should allow myltiple files to be selected, NO if not.
672        ///
673        /// This method is passed a callback object instead of giving a return
674        /// value so that it can be handled with a sheet.
675        #[optional]
676        #[unsafe(method(webView:runOpenPanelForFileButtonWithResultListener:allowMultipleFiles:))]
677        #[unsafe(method_family = none)]
678        unsafe fn webView_runOpenPanelForFileButtonWithResultListener_allowMultipleFiles(
679            &self,
680            sender: Option<&WebView>,
681            result_listener: Option<&ProtocolObject<dyn WebOpenPanelResultListener>>,
682            allow_multiple_files: bool,
683        );
684
685        #[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
686        #[cfg(target_os = "macos")]
687        /// Update the window's feedback for mousing over links to reflect a new item the mouse is over
688        /// or new modifier flags.
689        ///
690        /// Parameter `sender`: The WebView sending the delegate method.
691        ///
692        /// Parameter `elementInformation`: Dictionary that describes the element that the mouse is over, or nil.
693        ///
694        /// Parameter `modifierFlags`: The modifier flags as in NSEvent.
695        #[deprecated]
696        #[optional]
697        #[unsafe(method(webView:mouseDidMoveOverElement:modifierFlags:))]
698        #[unsafe(method_family = none)]
699        unsafe fn webView_mouseDidMoveOverElement_modifierFlags(
700            &self,
701            sender: Option<&WebView>,
702            element_information: Option<&NSDictionary>,
703            modifier_flags: NSUInteger,
704        );
705
706        #[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
707        #[cfg(target_os = "macos")]
708        /// Returns the menu items to display in an element's contextual menu.
709        ///
710        /// Parameter `sender`: The WebView sending the delegate method.
711        ///
712        /// Parameter `element`: A dictionary representation of the clicked element.
713        ///
714        /// Parameter `defaultMenuItems`: An array of default NSMenuItems to include in all contextual menus.
715        ///
716        /// Returns: An array of NSMenuItems to include in the contextual menu.
717        #[deprecated]
718        #[optional]
719        #[unsafe(method(webView:contextMenuItemsForElement:defaultMenuItems:))]
720        #[unsafe(method_family = none)]
721        unsafe fn webView_contextMenuItemsForElement_defaultMenuItems(
722            &self,
723            sender: Option<&WebView>,
724            element: Option<&NSDictionary>,
725            default_menu_items: Option<&NSArray>,
726        ) -> Option<Retained<NSArray>>;
727
728        #[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
729        #[cfg(target_os = "macos")]
730        /// Controls UI validation
731        ///
732        /// Parameter `webView`: The WebView sending the delegate method
733        ///
734        /// Parameter `item`: The user interface item being validated
735        ///
736        /// Parameter `defaultValidation`: Whether or not the WebView thinks the item is valid
737        ///
738        /// This method allows the UI delegate to control WebView's validation of user interface items.
739        /// See WebView.h to see the methods to that WebView can currently validate. See NSUserInterfaceValidations and
740        /// NSValidatedUserInterfaceItem for information about UI validation.
741        #[deprecated]
742        #[optional]
743        #[unsafe(method(webView:validateUserInterfaceItem:defaultValidation:))]
744        #[unsafe(method_family = none)]
745        unsafe fn webView_validateUserInterfaceItem_defaultValidation(
746            &self,
747            web_view: Option<&WebView>,
748            item: Option<&ProtocolObject<dyn NSValidatedUserInterfaceItem>>,
749            default_validation: bool,
750        ) -> bool;
751
752        #[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
753        #[cfg(target_os = "macos")]
754        /// Controls actions
755        ///
756        /// Parameter `webView`: The WebView sending the delegate method
757        ///
758        /// Parameter `action`: The action being sent
759        ///
760        /// Parameter `sender`: The sender of the action
761        ///
762        /// This method allows the UI delegate to control WebView's behavior when an action is being sent.
763        /// For example, if the action is copy:, the delegate can return YES to allow WebView to perform its default
764        /// copy behavior or return NO and perform copy: in some other way. See WebView.h to see the actions that
765        /// WebView can perform.
766        #[deprecated]
767        #[optional]
768        #[unsafe(method(webView:shouldPerformAction:fromSender:))]
769        #[unsafe(method_family = none)]
770        unsafe fn webView_shouldPerformAction_fromSender(
771            &self,
772            web_view: Option<&WebView>,
773            action: Option<Sel>,
774            sender: Option<&AnyObject>,
775        ) -> bool;
776
777        #[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
778        #[cfg(target_os = "macos")]
779        /// Controls behavior when dragging to a WebView
780        ///
781        /// Parameter `webView`: The WebView sending the delegate method
782        ///
783        /// Parameter `draggingInfo`: The dragging info of the drag
784        ///
785        /// This method is called periodically as something is dragged over a WebView. The UI delegate can return a mask
786        /// indicating which drag destination actions can occur, WebDragDestinationActionAny to allow any kind of action or
787        /// WebDragDestinationActionNone to not accept the drag.
788        #[deprecated]
789        #[optional]
790        #[unsafe(method(webView:dragDestinationActionMaskForDraggingInfo:))]
791        #[unsafe(method_family = none)]
792        unsafe fn webView_dragDestinationActionMaskForDraggingInfo(
793            &self,
794            web_view: Option<&WebView>,
795            dragging_info: Option<&ProtocolObject<dyn NSDraggingInfo>>,
796        ) -> NSUInteger;
797
798        #[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
799        #[cfg(target_os = "macos")]
800        /// Informs that WebView will perform a drag destination action
801        ///
802        /// Parameter `webView`: The WebView sending the delegate method
803        ///
804        /// Parameter `action`: The drag destination action
805        ///
806        /// Parameter `draggingInfo`: The dragging info of the drag
807        ///
808        /// This method is called after the last call to webView:dragDestinationActionMaskForDraggingInfo: after something is dropped on a WebView.
809        /// This method informs the UI delegate of the drag destination action that WebView will perform.
810        #[deprecated]
811        #[optional]
812        #[unsafe(method(webView:willPerformDragDestinationAction:forDraggingInfo:))]
813        #[unsafe(method_family = none)]
814        unsafe fn webView_willPerformDragDestinationAction_forDraggingInfo(
815            &self,
816            web_view: Option<&WebView>,
817            action: WebDragDestinationAction,
818            dragging_info: Option<&ProtocolObject<dyn NSDraggingInfo>>,
819        );
820
821        #[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
822        #[cfg(target_os = "macos")]
823        /// Controls behavior when dragging from a WebView
824        ///
825        /// Parameter `webView`: The WebView sending the delegate method
826        ///
827        /// Parameter `point`: The point where the drag started in the coordinates of the WebView
828        ///
829        /// This method is called after the user has begun a drag from a WebView. The UI delegate can return a mask indicating
830        /// which drag source actions can occur, WebDragSourceActionAny to allow any kind of action or WebDragSourceActionNone to not begin a drag.
831        #[deprecated]
832        #[optional]
833        #[unsafe(method(webView:dragSourceActionMaskForPoint:))]
834        #[unsafe(method_family = none)]
835        unsafe fn webView_dragSourceActionMaskForPoint(
836            &self,
837            web_view: Option<&WebView>,
838            point: NSPoint,
839        ) -> NSUInteger;
840
841        #[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
842        #[cfg(target_os = "macos")]
843        /// Informs that a drag a has begun from a WebView
844        ///
845        /// Parameter `webView`: The WebView sending the delegate method
846        ///
847        /// Parameter `action`: The drag source action
848        ///
849        /// Parameter `point`: The point where the drag started in the coordinates of the WebView
850        ///
851        /// Parameter `pasteboard`: The drag pasteboard
852        ///
853        /// This method is called after webView:dragSourceActionMaskForPoint: is called after the user has begun a drag from a WebView.
854        /// This method informs the UI delegate of the drag source action that will be performed and gives the delegate an opportunity to modify
855        /// the contents of the dragging pasteboard.
856        #[deprecated]
857        #[optional]
858        #[unsafe(method(webView:willPerformDragSourceAction:fromPoint:withPasteboard:))]
859        #[unsafe(method_family = none)]
860        unsafe fn webView_willPerformDragSourceAction_fromPoint_withPasteboard(
861            &self,
862            web_view: Option<&WebView>,
863            action: WebDragSourceAction,
864            point: NSPoint,
865            pasteboard: Option<&NSPasteboard>,
866        );
867
868        #[cfg(all(
869            feature = "WebFrameView",
870            feature = "WebView",
871            feature = "objc2-app-kit"
872        ))]
873        #[cfg(target_os = "macos")]
874        /// Informs that a WebFrameView needs to be printed
875        ///
876        /// Parameter `sender`: The WebView sending the delegate method
877        ///
878        /// Parameter `frameView`: The WebFrameView needing to be printed
879        ///
880        /// This method is called when a script or user requests the page to be printed.
881        /// In this method the delegate can prepare the WebFrameView to be printed. Some content that WebKit
882        /// displays can be printed directly by the WebFrameView, other content will need to be handled by
883        /// the delegate. To determine if the WebFrameView can handle printing the delegate should check
884        /// WebFrameView's documentViewShouldHandlePrint, if YES then the delegate can call printDocumentView
885        /// on the WebFrameView. Otherwise the delegate will need to request a NSPrintOperation from
886        /// the WebFrameView's printOperationWithPrintInfo to handle the printing.
887        #[deprecated]
888        #[optional]
889        #[unsafe(method(webView:printFrameView:))]
890        #[unsafe(method_family = none)]
891        unsafe fn webView_printFrameView(
892            &self,
893            sender: Option<&WebView>,
894            frame_view: Option<&WebFrameView>,
895        );
896
897        #[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
898        #[cfg(target_os = "macos")]
899        /// Parameter `sender`: The WebView sending the delegate method
900        ///
901        /// Reserve a height for the printed page header.
902        ///
903        /// Returns: The height to reserve for the printed page header, return 0.0 to not reserve any space for a header.
904        ///
905        /// The height returned will be used to calculate the rect passed to webView:drawHeaderInRect:.
906        #[deprecated]
907        #[optional]
908        #[unsafe(method(webViewHeaderHeight:))]
909        #[unsafe(method_family = none)]
910        unsafe fn webViewHeaderHeight(&self, sender: Option<&WebView>) -> c_float;
911
912        #[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
913        #[cfg(target_os = "macos")]
914        /// Parameter `sender`: The WebView sending the delegate method
915        ///
916        /// Reserve a height for the printed page footer.
917        ///
918        /// Returns: The height to reserve for the printed page footer, return 0.0 to not reserve any space for a footer.
919        ///
920        /// The height returned will be used to calculate the rect passed to webView:drawFooterInRect:.
921        #[deprecated]
922        #[optional]
923        #[unsafe(method(webViewFooterHeight:))]
924        #[unsafe(method_family = none)]
925        unsafe fn webViewFooterHeight(&self, sender: Option<&WebView>) -> c_float;
926
927        #[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
928        #[cfg(target_os = "macos")]
929        /// Parameter `sender`: The WebView sending the delegate method
930        ///
931        /// Parameter `rect`: The NSRect reserved for the header of the page
932        ///
933        /// The delegate should draw a header for the sender in the supplied rect.
934        #[deprecated]
935        #[optional]
936        #[unsafe(method(webView:drawHeaderInRect:))]
937        #[unsafe(method_family = none)]
938        unsafe fn webView_drawHeaderInRect(&self, sender: Option<&WebView>, rect: NSRect);
939
940        #[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
941        #[cfg(target_os = "macos")]
942        /// Parameter `sender`: The WebView sending the delegate method
943        ///
944        /// Parameter `rect`: The NSRect reserved for the footer of the page
945        ///
946        /// The delegate should draw a footer for the sender in the supplied rect.
947        #[deprecated]
948        #[optional]
949        #[unsafe(method(webView:drawFooterInRect:))]
950        #[unsafe(method_family = none)]
951        unsafe fn webView_drawFooterInRect(&self, sender: Option<&WebView>, rect: NSRect);
952
953        #[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
954        #[cfg(target_os = "macos")]
955        #[deprecated]
956        #[optional]
957        #[unsafe(method(webView:runJavaScriptAlertPanelWithMessage:))]
958        #[unsafe(method_family = none)]
959        unsafe fn webView_runJavaScriptAlertPanelWithMessage(
960            &self,
961            sender: Option<&WebView>,
962            message: Option<&NSString>,
963        );
964
965        #[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
966        #[cfg(target_os = "macos")]
967        #[deprecated]
968        #[optional]
969        #[unsafe(method(webView:runJavaScriptConfirmPanelWithMessage:))]
970        #[unsafe(method_family = none)]
971        unsafe fn webView_runJavaScriptConfirmPanelWithMessage(
972            &self,
973            sender: Option<&WebView>,
974            message: Option<&NSString>,
975        ) -> bool;
976
977        #[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
978        #[cfg(target_os = "macos")]
979        #[deprecated]
980        #[optional]
981        #[unsafe(method(webView:runJavaScriptTextInputPanelWithPrompt:defaultText:))]
982        #[unsafe(method_family = none)]
983        unsafe fn webView_runJavaScriptTextInputPanelWithPrompt_defaultText(
984            &self,
985            sender: Option<&WebView>,
986            prompt: Option<&NSString>,
987            default_text: Option<&NSString>,
988        ) -> Option<Retained<NSString>>;
989
990        #[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
991        #[cfg(target_os = "macos")]
992        #[deprecated]
993        #[optional]
994        #[unsafe(method(webView:setContentRect:))]
995        #[unsafe(method_family = none)]
996        unsafe fn webView_setContentRect(&self, sender: Option<&WebView>, frame: NSRect);
997
998        #[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
999        #[cfg(target_os = "macos")]
1000        #[deprecated]
1001        #[optional]
1002        #[unsafe(method(webViewContentRect:))]
1003        #[unsafe(method_family = none)]
1004        unsafe fn webViewContentRect(&self, sender: Option<&WebView>) -> NSRect;
1005    }
1006);