objc2_web_kit/generated/
WebView.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-app-kit")]
7#[cfg(target_os = "macos")]
8use objc2_app_kit::*;
9use objc2_foundation::*;
10
11use crate::*;
12
13extern "C" {
14    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/webelementdomnodekey?language=objc)
15    #[deprecated]
16    pub static WebElementDOMNodeKey: Option<&'static NSString>;
17}
18
19extern "C" {
20    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/webelementframekey?language=objc)
21    #[deprecated]
22    pub static WebElementFrameKey: Option<&'static NSString>;
23}
24
25extern "C" {
26    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/webelementimagealtstringkey?language=objc)
27    #[deprecated]
28    pub static WebElementImageAltStringKey: Option<&'static NSString>;
29}
30
31extern "C" {
32    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/webelementimagekey?language=objc)
33    #[deprecated]
34    pub static WebElementImageKey: Option<&'static NSString>;
35}
36
37extern "C" {
38    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/webelementimagerectkey?language=objc)
39    #[deprecated]
40    pub static WebElementImageRectKey: Option<&'static NSString>;
41}
42
43extern "C" {
44    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/webelementimageurlkey?language=objc)
45    #[deprecated]
46    pub static WebElementImageURLKey: Option<&'static NSString>;
47}
48
49extern "C" {
50    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/webelementisselectedkey?language=objc)
51    #[deprecated]
52    pub static WebElementIsSelectedKey: Option<&'static NSString>;
53}
54
55extern "C" {
56    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/webelementlinkurlkey?language=objc)
57    #[deprecated]
58    pub static WebElementLinkURLKey: Option<&'static NSString>;
59}
60
61extern "C" {
62    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/webelementlinktargetframekey?language=objc)
63    #[deprecated]
64    pub static WebElementLinkTargetFrameKey: Option<&'static NSString>;
65}
66
67extern "C" {
68    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/webelementlinktitlekey?language=objc)
69    #[deprecated]
70    pub static WebElementLinkTitleKey: Option<&'static NSString>;
71}
72
73extern "C" {
74    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/webelementlinklabelkey?language=objc)
75    #[deprecated]
76    pub static WebElementLinkLabelKey: Option<&'static NSString>;
77}
78
79extern "C" {
80    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/webviewprogressstartednotification?language=objc)
81    #[deprecated]
82    pub static WebViewProgressStartedNotification: Option<&'static NSString>;
83}
84
85extern "C" {
86    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/webviewprogressestimatechangednotification?language=objc)
87    #[deprecated]
88    pub static WebViewProgressEstimateChangedNotification: Option<&'static NSString>;
89}
90
91extern "C" {
92    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/webviewprogressfinishednotification?language=objc)
93    #[deprecated]
94    pub static WebViewProgressFinishedNotification: Option<&'static NSString>;
95}
96
97extern_class!(
98    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/webview?language=objc)
99    #[unsafe(super(NSView, NSResponder, NSObject))]
100    #[derive(Debug, PartialEq, Eq, Hash)]
101    #[cfg(feature = "objc2-app-kit")]
102    #[cfg(target_os = "macos")]
103    #[deprecated = "No longer supported; please adopt WKWebView."]
104    pub struct WebView;
105);
106
107#[cfg(feature = "objc2-app-kit")]
108#[cfg(target_os = "macos")]
109extern_conformance!(
110    unsafe impl NSAccessibility for WebView {}
111);
112
113#[cfg(feature = "objc2-app-kit")]
114#[cfg(target_os = "macos")]
115extern_conformance!(
116    unsafe impl NSAccessibilityElementProtocol for WebView {}
117);
118
119#[cfg(feature = "objc2-app-kit")]
120#[cfg(target_os = "macos")]
121extern_conformance!(
122    unsafe impl NSAnimatablePropertyContainer for WebView {}
123);
124
125#[cfg(feature = "objc2-app-kit")]
126#[cfg(target_os = "macos")]
127extern_conformance!(
128    unsafe impl NSAppearanceCustomization for WebView {}
129);
130
131#[cfg(feature = "objc2-app-kit")]
132#[cfg(target_os = "macos")]
133extern_conformance!(
134    unsafe impl NSCoding for WebView {}
135);
136
137#[cfg(feature = "objc2-app-kit")]
138#[cfg(target_os = "macos")]
139extern_conformance!(
140    unsafe impl NSDraggingDestination for WebView {}
141);
142
143#[cfg(feature = "objc2-app-kit")]
144#[cfg(target_os = "macos")]
145extern_conformance!(
146    unsafe impl NSObjectProtocol for WebView {}
147);
148
149#[cfg(feature = "objc2-app-kit")]
150#[cfg(target_os = "macos")]
151extern_conformance!(
152    unsafe impl NSUserInterfaceItemIdentification for WebView {}
153);
154
155#[cfg(feature = "objc2-app-kit")]
156#[cfg(target_os = "macos")]
157impl WebView {
158    extern_methods!(
159        /// Checks if the WebKit can show content of a certain MIME type.
160        ///
161        /// Parameter `MIMEType`: The MIME type to check.
162        ///
163        /// Returns: YES if the WebKit can show content with MIMEtype.
164        ///
165        /// # Safety
166        ///
167        /// `mime_type` might not allow `None`.
168        #[deprecated = "No longer supported; please adopt WKWebView."]
169        #[unsafe(method(canShowMIMEType:))]
170        #[unsafe(method_family = none)]
171        pub unsafe fn canShowMIMEType(mime_type: Option<&NSString>, mtm: MainThreadMarker) -> bool;
172
173        /// Checks if the MIME type is a type that the WebKit will interpret as HTML.
174        ///
175        /// Parameter `MIMEType`: The MIME type to check.
176        ///
177        /// Returns: YES if the MIMEtype in an HTML type.
178        ///
179        /// # Safety
180        ///
181        /// `mime_type` might not allow `None`.
182        #[deprecated = "No longer supported; please adopt WKWebView."]
183        #[unsafe(method(canShowMIMETypeAsHTML:))]
184        #[unsafe(method_family = none)]
185        pub unsafe fn canShowMIMETypeAsHTML(
186            mime_type: Option<&NSString>,
187            mtm: MainThreadMarker,
188        ) -> bool;
189
190        /// Returns: Returns an array of NSStrings that describe the MIME types
191        /// WebKit will attempt to render as HTML.
192        #[deprecated = "No longer supported; please adopt WKWebView."]
193        #[unsafe(method(MIMETypesShownAsHTML))]
194        #[unsafe(method_family = none)]
195        pub unsafe fn MIMETypesShownAsHTML(mtm: MainThreadMarker) -> Option<Retained<NSArray>>;
196
197        /// Sets the array of NSString MIME types that WebKit will
198        /// attempt to render as HTML.  Typically you will retrieve the built-in
199        /// array using MIMETypesShownAsHTML and add additional MIME types to that
200        /// array.
201        ///
202        /// # Safety
203        ///
204        /// - `mime_types` generic should be of the correct type.
205        /// - `mime_types` might not allow `None`.
206        #[deprecated = "No longer supported; please adopt WKWebView."]
207        #[unsafe(method(setMIMETypesShownAsHTML:))]
208        #[unsafe(method_family = none)]
209        pub unsafe fn setMIMETypesShownAsHTML(mime_types: Option<&NSArray>, mtm: MainThreadMarker);
210
211        /// Returns a URL from a pasteboard
212        ///
213        /// Parameter `pasteboard`: The pasteboard with a URL
214        ///
215        /// Returns: A URL if the pasteboard has one. Nil if it does not.
216        ///
217        /// This method differs than NSURL's URLFromPasteboard method in that it tries multiple pasteboard types
218        /// including NSURLPboardType to find a URL on the pasteboard.
219        ///
220        /// # Safety
221        ///
222        /// `pasteboard` might not allow `None`.
223        #[deprecated = "No longer supported; please adopt WKWebView."]
224        #[unsafe(method(URLFromPasteboard:))]
225        #[unsafe(method_family = none)]
226        pub unsafe fn URLFromPasteboard(
227            pasteboard: Option<&NSPasteboard>,
228            mtm: MainThreadMarker,
229        ) -> Option<Retained<NSURL>>;
230
231        /// Returns a URL title from a pasteboard
232        ///
233        /// Parameter `pasteboard`: The pasteboard with a URL title
234        ///
235        /// Returns: A URL title if the pasteboard has one. Nil if it does not.
236        ///
237        /// This method returns a title that refers a URL on the pasteboard. An example of this is the link label
238        /// which is the text inside the anchor tag.
239        ///
240        /// # Safety
241        ///
242        /// `pasteboard` might not allow `None`.
243        #[deprecated = "No longer supported; please adopt WKWebView."]
244        #[unsafe(method(URLTitleFromPasteboard:))]
245        #[unsafe(method_family = none)]
246        pub unsafe fn URLTitleFromPasteboard(
247            pasteboard: Option<&NSPasteboard>,
248            mtm: MainThreadMarker,
249        ) -> Option<Retained<NSString>>;
250
251        /// Adds the scheme to the list of schemes to be treated as local.
252        ///
253        /// Parameter `scheme`: The scheme to register
254        ///
255        /// # Safety
256        ///
257        /// `scheme` might not allow `None`.
258        #[deprecated = "No longer supported; please adopt WKWebView."]
259        #[unsafe(method(registerURLSchemeAsLocal:))]
260        #[unsafe(method_family = none)]
261        pub unsafe fn registerURLSchemeAsLocal(scheme: Option<&NSString>, mtm: MainThreadMarker);
262
263        /// The designated initializer for WebView.
264        ///
265        /// Initialize a WebView with the supplied parameters. This method will
266        /// create a main WebFrame with the view. Passing a top level frame name is useful if you
267        /// handle a targetted frame navigation that would normally open a window in some other
268        /// way that still ends up creating a new WebView.
269        ///
270        /// Parameter `frame`: The frame used to create the view.
271        ///
272        /// Parameter `frameName`: The name to use for the top level frame. May be nil.
273        ///
274        /// Parameter `groupName`: The name of the webView set to which this webView will be added.  May be nil.
275        ///
276        /// Returns: Returns an initialized WebView.
277        ///
278        /// # Safety
279        ///
280        /// - `frame_name` might not allow `None`.
281        /// - `group_name` might not allow `None`.
282        #[deprecated = "No longer supported; please adopt WKWebView."]
283        #[unsafe(method(initWithFrame:frameName:groupName:))]
284        #[unsafe(method_family = init)]
285        pub unsafe fn initWithFrame_frameName_groupName(
286            this: Allocated<Self>,
287            frame: NSRect,
288            frame_name: Option<&NSString>,
289            group_name: Option<&NSString>,
290        ) -> Option<Retained<Self>>;
291
292        /// Closes the receiver, unloading its web page and canceling any pending loads.
293        /// Once the receiver has closed, it will no longer respond to requests or fire delegate methods.
294        /// (However, the -close method itself may fire delegate methods.)
295        ///
296        /// A garbage collected application is required to call close when the receiver is no longer needed.
297        /// The close method will be called automatically when the window or hostWindow closes and shouldCloseWithWindow returns YES.
298        /// A non-garbage collected application can still call close, providing a convenient way to prevent receiver
299        /// from doing any more loading and firing any future delegate methods.
300        #[deprecated = "No longer supported; please adopt WKWebView."]
301        #[unsafe(method(close))]
302        #[unsafe(method_family = none)]
303        pub unsafe fn close(&self);
304
305        /// Whether the receiver closes when either it's window or hostWindow closes.
306        ///
307        /// Defaults to YES in garbage collected applications, otherwise NO to maintain backwards compatibility.
308        #[deprecated = "No longer supported; please adopt WKWebView."]
309        #[unsafe(method(shouldCloseWithWindow))]
310        #[unsafe(method_family = none)]
311        pub unsafe fn shouldCloseWithWindow(&self) -> bool;
312
313        /// Setter for [`shouldCloseWithWindow`][Self::shouldCloseWithWindow].
314        #[deprecated = "No longer supported; please adopt WKWebView."]
315        #[unsafe(method(setShouldCloseWithWindow:))]
316        #[unsafe(method_family = none)]
317        pub unsafe fn setShouldCloseWithWindow(&self, should_close_with_window: bool);
318
319        #[cfg(feature = "WebUIDelegate")]
320        /// The WebView's WebUIDelegate.
321        ///
322        /// # Safety
323        ///
324        /// This is not retained internally, you must ensure the object is still alive.
325        #[deprecated = "No longer supported; please adopt WKWebView."]
326        #[unsafe(method(UIDelegate))]
327        #[unsafe(method_family = none)]
328        pub unsafe fn UIDelegate(&self) -> Option<Retained<ProtocolObject<dyn WebUIDelegate>>>;
329
330        #[cfg(feature = "WebUIDelegate")]
331        /// Setter for [`UIDelegate`][Self::UIDelegate].
332        ///
333        /// # Safety
334        ///
335        /// - `ui_delegate` might not allow `None`.
336        /// - This is unretained, you must ensure the object is kept alive while in use.
337        #[deprecated = "No longer supported; please adopt WKWebView."]
338        #[unsafe(method(setUIDelegate:))]
339        #[unsafe(method_family = none)]
340        pub unsafe fn setUIDelegate(&self, ui_delegate: Option<&ProtocolObject<dyn WebUIDelegate>>);
341
342        #[cfg(feature = "WebResourceLoadDelegate")]
343        /// The WebView's WebResourceLoadDelegate.
344        ///
345        /// # Safety
346        ///
347        /// This is not retained internally, you must ensure the object is still alive.
348        #[deprecated = "No longer supported; please adopt WKWebView."]
349        #[unsafe(method(resourceLoadDelegate))]
350        #[unsafe(method_family = none)]
351        pub unsafe fn resourceLoadDelegate(
352            &self,
353        ) -> Option<Retained<ProtocolObject<dyn WebResourceLoadDelegate>>>;
354
355        #[cfg(feature = "WebResourceLoadDelegate")]
356        /// Setter for [`resourceLoadDelegate`][Self::resourceLoadDelegate].
357        ///
358        /// # Safety
359        ///
360        /// - `resource_load_delegate` might not allow `None`.
361        /// - This is unretained, you must ensure the object is kept alive while in use.
362        #[deprecated = "No longer supported; please adopt WKWebView."]
363        #[unsafe(method(setResourceLoadDelegate:))]
364        #[unsafe(method_family = none)]
365        pub unsafe fn setResourceLoadDelegate(
366            &self,
367            resource_load_delegate: Option<&ProtocolObject<dyn WebResourceLoadDelegate>>,
368        );
369
370        #[cfg(feature = "WebDownload")]
371        /// The WebView's WebDownloadDelegate.
372        ///
373        /// # Safety
374        ///
375        /// This is not retained internally, you must ensure the object is still alive.
376        #[deprecated = "No longer supported; please adopt WKWebView."]
377        #[unsafe(method(downloadDelegate))]
378        #[unsafe(method_family = none)]
379        pub unsafe fn downloadDelegate(
380            &self,
381        ) -> Option<Retained<ProtocolObject<dyn WebDownloadDelegate>>>;
382
383        #[cfg(feature = "WebDownload")]
384        /// Setter for [`downloadDelegate`][Self::downloadDelegate].
385        ///
386        /// # Safety
387        ///
388        /// - `download_delegate` might not allow `None`.
389        /// - This is unretained, you must ensure the object is kept alive while in use.
390        #[deprecated = "No longer supported; please adopt WKWebView."]
391        #[unsafe(method(setDownloadDelegate:))]
392        #[unsafe(method_family = none)]
393        pub unsafe fn setDownloadDelegate(
394            &self,
395            download_delegate: Option<&ProtocolObject<dyn WebDownloadDelegate>>,
396        );
397
398        #[cfg(feature = "WebFrameLoadDelegate")]
399        /// The WebView's WebFrameLoadDelegate delegate.
400        ///
401        /// # Safety
402        ///
403        /// This is not retained internally, you must ensure the object is still alive.
404        #[deprecated = "No longer supported; please adopt WKWebView."]
405        #[unsafe(method(frameLoadDelegate))]
406        #[unsafe(method_family = none)]
407        pub unsafe fn frameLoadDelegate(
408            &self,
409        ) -> Option<Retained<ProtocolObject<dyn WebFrameLoadDelegate>>>;
410
411        #[cfg(feature = "WebFrameLoadDelegate")]
412        /// Setter for [`frameLoadDelegate`][Self::frameLoadDelegate].
413        ///
414        /// # Safety
415        ///
416        /// - `frame_load_delegate` might not allow `None`.
417        /// - This is unretained, you must ensure the object is kept alive while in use.
418        #[deprecated = "No longer supported; please adopt WKWebView."]
419        #[unsafe(method(setFrameLoadDelegate:))]
420        #[unsafe(method_family = none)]
421        pub unsafe fn setFrameLoadDelegate(
422            &self,
423            frame_load_delegate: Option<&ProtocolObject<dyn WebFrameLoadDelegate>>,
424        );
425
426        #[cfg(feature = "WebPolicyDelegate")]
427        /// The WebView's WebPolicyDelegate.
428        ///
429        /// # Safety
430        ///
431        /// This is not retained internally, you must ensure the object is still alive.
432        #[deprecated = "No longer supported; please adopt WKWebView."]
433        #[unsafe(method(policyDelegate))]
434        #[unsafe(method_family = none)]
435        pub unsafe fn policyDelegate(
436            &self,
437        ) -> Option<Retained<ProtocolObject<dyn WebPolicyDelegate>>>;
438
439        #[cfg(feature = "WebPolicyDelegate")]
440        /// Setter for [`policyDelegate`][Self::policyDelegate].
441        ///
442        /// # Safety
443        ///
444        /// - `policy_delegate` might not allow `None`.
445        /// - This is unretained, you must ensure the object is kept alive while in use.
446        #[deprecated = "No longer supported; please adopt WKWebView."]
447        #[unsafe(method(setPolicyDelegate:))]
448        #[unsafe(method_family = none)]
449        pub unsafe fn setPolicyDelegate(
450            &self,
451            policy_delegate: Option<&ProtocolObject<dyn WebPolicyDelegate>>,
452        );
453
454        #[cfg(feature = "WebFrame")]
455        /// The top level frame.
456        ///
457        /// Note that even documents that are not framesets will have a mainFrame.
458        #[deprecated = "No longer supported; please adopt WKWebView."]
459        #[unsafe(method(mainFrame))]
460        #[unsafe(method_family = none)]
461        pub unsafe fn mainFrame(&self) -> Option<Retained<WebFrame>>;
462
463        #[cfg(feature = "WebFrame")]
464        /// The frame that has the active selection.
465        ///
466        /// Returns the frame that contains the first responder, if any. Otherwise returns the
467        /// frame that contains a non-zero-length selection, if any. Returns nil if no frame meets these criteria.
468        #[deprecated = "No longer supported; please adopt WKWebView."]
469        #[unsafe(method(selectedFrame))]
470        #[unsafe(method_family = none)]
471        pub unsafe fn selectedFrame(&self) -> Option<Retained<WebFrame>>;
472
473        #[cfg(feature = "WebBackForwardList")]
474        /// The backforward list for this WebView.
475        #[deprecated = "No longer supported; please adopt WKWebView."]
476        #[unsafe(method(backForwardList))]
477        #[unsafe(method_family = none)]
478        pub unsafe fn backForwardList(&self) -> Option<Retained<WebBackForwardList>>;
479
480        /// Enable or disable the use of a backforward list for this webView.
481        ///
482        /// Parameter `flag`: Turns use of the back forward list on or off
483        #[deprecated = "No longer supported; please adopt WKWebView."]
484        #[unsafe(method(setMaintainsBackForwardList:))]
485        #[unsafe(method_family = none)]
486        pub unsafe fn setMaintainsBackForwardList(&self, flag: bool);
487
488        /// Go back to the previous URL in the backforward list.
489        ///
490        /// Returns: YES if able to go back in the backforward list, NO otherwise.
491        #[deprecated = "No longer supported; please adopt WKWebView."]
492        #[unsafe(method(goBack))]
493        #[unsafe(method_family = none)]
494        pub unsafe fn goBack(&self) -> bool;
495
496        /// Go forward to the next URL in the backforward list.
497        ///
498        /// Returns: YES if able to go forward in the backforward list, NO otherwise.
499        #[deprecated = "No longer supported; please adopt WKWebView."]
500        #[unsafe(method(goForward))]
501        #[unsafe(method_family = none)]
502        pub unsafe fn goForward(&self) -> bool;
503
504        #[cfg(feature = "WebHistoryItem")]
505        /// Go back or forward to an item in the backforward list.
506        ///
507        /// Returns: YES if able to go to the item, NO otherwise.
508        ///
509        /// # Safety
510        ///
511        /// `item` might not allow `None`.
512        #[deprecated = "No longer supported; please adopt WKWebView."]
513        #[unsafe(method(goToBackForwardItem:))]
514        #[unsafe(method_family = none)]
515        pub unsafe fn goToBackForwardItem(&self, item: Option<&WebHistoryItem>) -> bool;
516
517        /// The text size multipler.
518        #[deprecated = "No longer supported; please adopt WKWebView."]
519        #[unsafe(method(textSizeMultiplier))]
520        #[unsafe(method_family = none)]
521        pub unsafe fn textSizeMultiplier(&self) -> c_float;
522
523        /// Setter for [`textSizeMultiplier`][Self::textSizeMultiplier].
524        #[deprecated = "No longer supported; please adopt WKWebView."]
525        #[unsafe(method(setTextSizeMultiplier:))]
526        #[unsafe(method_family = none)]
527        pub unsafe fn setTextSizeMultiplier(&self, text_size_multiplier: c_float);
528
529        /// The name of the application as used in the user-agent string.
530        #[deprecated = "No longer supported; please adopt WKWebView."]
531        #[unsafe(method(applicationNameForUserAgent))]
532        #[unsafe(method_family = none)]
533        pub unsafe fn applicationNameForUserAgent(&self) -> Retained<NSString>;
534
535        /// Setter for [`applicationNameForUserAgent`][Self::applicationNameForUserAgent].
536        ///
537        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
538        #[deprecated = "No longer supported; please adopt WKWebView."]
539        #[unsafe(method(setApplicationNameForUserAgent:))]
540        #[unsafe(method_family = none)]
541        pub unsafe fn setApplicationNameForUserAgent(
542            &self,
543            application_name_for_user_agent: Option<&NSString>,
544        );
545
546        /// The custom user-agent string or nil if no custom user-agent string has been set.
547        ///
548        /// Setting this means that the webView should use this user-agent string
549        /// instead of constructing a user-agent string for each URL. Setting it to nil
550        /// causes the webView to construct the user-agent string for each URL
551        /// for best results rendering web pages
552        #[deprecated = "No longer supported; please adopt WKWebView."]
553        #[unsafe(method(customUserAgent))]
554        #[unsafe(method_family = none)]
555        pub unsafe fn customUserAgent(&self) -> Retained<NSString>;
556
557        /// Setter for [`customUserAgent`][Self::customUserAgent].
558        ///
559        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
560        #[deprecated = "No longer supported; please adopt WKWebView."]
561        #[unsafe(method(setCustomUserAgent:))]
562        #[unsafe(method_family = none)]
563        pub unsafe fn setCustomUserAgent(&self, custom_user_agent: Option<&NSString>);
564
565        /// Get the appropriate user-agent string for a particular URL.
566        ///
567        /// Parameter `URL`: The URL.
568        ///
569        /// Returns: The user-agent string for the supplied URL.
570        ///
571        /// # Safety
572        ///
573        /// `url` might not allow `None`.
574        #[deprecated = "No longer supported; please adopt WKWebView."]
575        #[unsafe(method(userAgentForURL:))]
576        #[unsafe(method_family = none)]
577        pub unsafe fn userAgentForURL(&self, url: Option<&NSURL>) -> Option<Retained<NSString>>;
578
579        /// If the document view of the current web page can support different text encodings.
580        #[deprecated = "No longer supported; please adopt WKWebView."]
581        #[unsafe(method(supportsTextEncoding))]
582        #[unsafe(method_family = none)]
583        pub unsafe fn supportsTextEncoding(&self) -> bool;
584
585        /// The custom text encoding name or nil if no custom text encoding name has been set.
586        ///
587        /// Make the page display with a different text encoding; stops any load in progress.
588        /// The text encoding passed in overrides the normal text encoding smarts including
589        /// what's specified in a web page's header or HTTP response.
590        /// The text encoding automatically goes back to the default when the top level frame
591        /// changes to a new location.
592        /// Setting the text encoding name to nil makes the webView use default encoding rules.
593        #[deprecated = "No longer supported; please adopt WKWebView."]
594        #[unsafe(method(customTextEncodingName))]
595        #[unsafe(method_family = none)]
596        pub unsafe fn customTextEncodingName(&self) -> Retained<NSString>;
597
598        /// Setter for [`customTextEncodingName`][Self::customTextEncodingName].
599        ///
600        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
601        #[deprecated = "No longer supported; please adopt WKWebView."]
602        #[unsafe(method(setCustomTextEncodingName:))]
603        #[unsafe(method_family = none)]
604        pub unsafe fn setCustomTextEncodingName(
605            &self,
606            custom_text_encoding_name: Option<&NSString>,
607        );
608
609        /// The media style for the WebView.
610        ///
611        /// The mediaStyle will override the normal value
612        /// of the CSS media property. Setting the value to nil will restore the normal value. The value will be nil unless explicitly set.
613        #[deprecated = "No longer supported; please adopt WKWebView."]
614        #[unsafe(method(mediaStyle))]
615        #[unsafe(method_family = none)]
616        pub unsafe fn mediaStyle(&self) -> Retained<NSString>;
617
618        /// Setter for [`mediaStyle`][Self::mediaStyle].
619        ///
620        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
621        #[deprecated = "No longer supported; please adopt WKWebView."]
622        #[unsafe(method(setMediaStyle:))]
623        #[unsafe(method_family = none)]
624        pub unsafe fn setMediaStyle(&self, media_style: Option<&NSString>);
625
626        /// Parameter `script`: The text of the JavaScript.
627        ///
628        /// Returns: The result of the script, converted to a string, or nil for failure.
629        ///
630        /// # Safety
631        ///
632        /// `script` might not allow `None`.
633        #[deprecated = "No longer supported; please adopt WKWebView."]
634        #[unsafe(method(stringByEvaluatingJavaScriptFromString:))]
635        #[unsafe(method_family = none)]
636        pub unsafe fn stringByEvaluatingJavaScriptFromString(
637            &self,
638            script: Option<&NSString>,
639        ) -> Option<Retained<NSString>>;
640
641        #[cfg(feature = "WebScriptObject")]
642        /// A WebScriptObject that represents the
643        /// window object from the script environment.
644        #[deprecated = "No longer supported; please adopt WKWebView."]
645        #[unsafe(method(windowScriptObject))]
646        #[unsafe(method_family = none)]
647        pub unsafe fn windowScriptObject(&self) -> Option<Retained<WebScriptObject>>;
648
649        #[cfg(feature = "WebPreferences")]
650        /// The preferences used by this WebView.
651        ///
652        /// This method will return [WebPreferences standardPreferences] if no
653        /// other instance of WebPreferences has been set.
654        #[deprecated = "No longer supported; please adopt WKWebView."]
655        #[unsafe(method(preferences))]
656        #[unsafe(method_family = none)]
657        pub unsafe fn preferences(&self) -> Option<Retained<WebPreferences>>;
658
659        #[cfg(feature = "WebPreferences")]
660        /// Setter for [`preferences`][Self::preferences].
661        ///
662        /// # Safety
663        ///
664        /// `preferences` might not allow `None`.
665        #[deprecated = "No longer supported; please adopt WKWebView."]
666        #[unsafe(method(setPreferences:))]
667        #[unsafe(method_family = none)]
668        pub unsafe fn setPreferences(&self, preferences: Option<&WebPreferences>);
669
670        /// The WebPreferences key prefix.
671        ///
672        /// If the WebPreferences for this WebView are stored in the user defaults database, this string will be used as a key prefix.
673        #[deprecated = "No longer supported; please adopt WKWebView."]
674        #[unsafe(method(preferencesIdentifier))]
675        #[unsafe(method_family = none)]
676        pub unsafe fn preferencesIdentifier(&self) -> Retained<NSString>;
677
678        /// Setter for [`preferencesIdentifier`][Self::preferencesIdentifier].
679        ///
680        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
681        #[deprecated = "No longer supported; please adopt WKWebView."]
682        #[unsafe(method(setPreferencesIdentifier:))]
683        #[unsafe(method_family = none)]
684        pub unsafe fn setPreferencesIdentifier(&self, preferences_identifier: Option<&NSString>);
685
686        /// The host window for the web view.
687        ///
688        /// Parts of WebKit (such as plug-ins and JavaScript) depend on a window to function
689        /// properly. Set a host window so these parts continue to function even when the web view is
690        /// not in an actual window.
691        #[deprecated = "No longer supported; please adopt WKWebView."]
692        #[unsafe(method(hostWindow))]
693        #[unsafe(method_family = none)]
694        pub unsafe fn hostWindow(&self) -> Option<Retained<NSWindow>>;
695
696        /// Setter for [`hostWindow`][Self::hostWindow].
697        ///
698        /// # Safety
699        ///
700        /// `host_window` might not allow `None`.
701        #[deprecated = "No longer supported; please adopt WKWebView."]
702        #[unsafe(method(setHostWindow:))]
703        #[unsafe(method_family = none)]
704        pub unsafe fn setHostWindow(&self, host_window: Option<&NSWindow>);
705
706        /// Searches a document view for a string and highlights the string if it is found.
707        /// Starts the search from the current selection.  Will search across all frames.
708        ///
709        /// Parameter `string`: The string to search for.
710        ///
711        /// Parameter `forward`: YES to search forward, NO to seach backwards.
712        ///
713        /// Parameter `caseFlag`: YES to for case-sensitive search, NO for case-insensitive search.
714        ///
715        /// Returns: YES if found, NO if not found.
716        ///
717        /// # Safety
718        ///
719        /// `string` might not allow `None`.
720        #[deprecated = "No longer supported; please adopt WKWebView."]
721        #[unsafe(method(searchFor:direction:caseSensitive:wrap:))]
722        #[unsafe(method_family = none)]
723        pub unsafe fn searchFor_direction_caseSensitive_wrap(
724            &self,
725            string: Option<&NSString>,
726            forward: bool,
727            case_flag: bool,
728            wrap_flag: bool,
729        ) -> bool;
730
731        /// Register classes that implement WebDocumentView and WebDocumentRepresentation respectively.
732        /// A document class may register for a primary MIME type by excluding
733        /// a subtype, i.e. "video/" will match the document class with
734        /// all video types.  More specific matching takes precedence
735        /// over general matching.
736        ///
737        /// Parameter `viewClass`: The WebDocumentView class to use to render data for a given MIME type.
738        ///
739        /// Parameter `representationClass`: The WebDocumentRepresentation class to use to represent data of the given MIME type.
740        ///
741        /// Parameter `MIMEType`: The MIME type to represent with an object of the given class.
742        ///
743        /// # Safety
744        ///
745        /// - `view_class` probably has further requirements.
746        /// - `view_class` might not allow `None`.
747        /// - `representation_class` probably has further requirements.
748        /// - `representation_class` might not allow `None`.
749        /// - `mime_type` might not allow `None`.
750        #[deprecated = "No longer supported; please adopt WKWebView."]
751        #[unsafe(method(registerViewClass:representationClass:forMIMEType:))]
752        #[unsafe(method_family = none)]
753        pub unsafe fn registerViewClass_representationClass_forMIMEType(
754            view_class: Option<&AnyClass>,
755            representation_class: Option<&AnyClass>,
756            mime_type: Option<&NSString>,
757            mtm: MainThreadMarker,
758        );
759
760        /// The group name for this WebView.
761        ///
762        /// JavaScript may access named frames within the same group.
763        #[deprecated = "No longer supported; please adopt WKWebView."]
764        #[unsafe(method(groupName))]
765        #[unsafe(method_family = none)]
766        pub unsafe fn groupName(&self) -> Retained<NSString>;
767
768        /// Setter for [`groupName`][Self::groupName].
769        ///
770        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
771        #[deprecated = "No longer supported; please adopt WKWebView."]
772        #[unsafe(method(setGroupName:))]
773        #[unsafe(method_family = none)]
774        pub unsafe fn setGroupName(&self, group_name: Option<&NSString>);
775
776        /// An estimate of the percent complete for a document load.  This
777        /// value will range from 0 to 1.0 and, once a load completes, will remain at 1.0
778        /// until a new load starts, at which point it will be reset to 0.  The value is an
779        /// estimate based on the total number of bytes expected to be received
780        /// for a document, including all it's possible subresources.  For more accurate progress
781        /// indication it is recommended that you implement a WebFrameLoadDelegate and a
782        /// WebResourceLoadDelegate.
783        #[deprecated = "No longer supported; please adopt WKWebView."]
784        #[unsafe(method(estimatedProgress))]
785        #[unsafe(method_family = none)]
786        pub unsafe fn estimatedProgress(&self) -> c_double;
787
788        /// Whether there are any pending loads in this WebView.
789        #[deprecated = "No longer supported; please adopt WKWebView."]
790        #[unsafe(method(isLoading))]
791        #[unsafe(method_family = none)]
792        pub unsafe fn isLoading(&self) -> bool;
793
794        /// Parameter `point`: A point in the coordinates of the WebView
795        ///
796        /// Returns: An element dictionary describing the point
797        #[deprecated = "No longer supported; please adopt WKWebView."]
798        #[unsafe(method(elementAtPoint:))]
799        #[unsafe(method_family = none)]
800        pub unsafe fn elementAtPoint(&self, point: NSPoint) -> Option<Retained<NSDictionary>>;
801
802        /// The pasteboard types that the WebView can use for the current selection
803        #[deprecated = "No longer supported; please adopt WKWebView."]
804        #[unsafe(method(pasteboardTypesForSelection))]
805        #[unsafe(method_family = none)]
806        pub unsafe fn pasteboardTypesForSelection(&self) -> Retained<NSArray>;
807
808        /// Writes the current selection to the pasteboard
809        ///
810        /// Parameter `types`: The types that WebView will write to the pasteboard
811        ///
812        /// Parameter `pasteboard`: The pasteboard to write to
813        ///
814        /// # Safety
815        ///
816        /// - `types` generic should be of the correct type.
817        /// - `types` might not allow `None`.
818        /// - `pasteboard` might not allow `None`.
819        #[deprecated = "No longer supported; please adopt WKWebView."]
820        #[unsafe(method(writeSelectionWithPasteboardTypes:toPasteboard:))]
821        #[unsafe(method_family = none)]
822        pub unsafe fn writeSelectionWithPasteboardTypes_toPasteboard(
823            &self,
824            types: Option<&NSArray>,
825            pasteboard: Option<&NSPasteboard>,
826        );
827
828        /// Returns the pasteboard types that WebView can use for an element
829        ///
830        /// Parameter `element`: The element
831        ///
832        /// # Safety
833        ///
834        /// - `element` generic should be of the correct type.
835        /// - `element` might not allow `None`.
836        #[deprecated = "No longer supported; please adopt WKWebView."]
837        #[unsafe(method(pasteboardTypesForElement:))]
838        #[unsafe(method_family = none)]
839        pub unsafe fn pasteboardTypesForElement(
840            &self,
841            element: Option<&NSDictionary>,
842        ) -> Option<Retained<NSArray>>;
843
844        /// Writes an element to the pasteboard
845        ///
846        /// Parameter `element`: The element to write to the pasteboard
847        ///
848        /// Parameter `types`: The types that WebView will write to the pasteboard
849        ///
850        /// Parameter `pasteboard`: The pasteboard to write to
851        ///
852        /// # Safety
853        ///
854        /// - `element` generic should be of the correct type.
855        /// - `element` might not allow `None`.
856        /// - `types` generic should be of the correct type.
857        /// - `types` might not allow `None`.
858        /// - `pasteboard` might not allow `None`.
859        #[deprecated = "No longer supported; please adopt WKWebView."]
860        #[unsafe(method(writeElement:withPasteboardTypes:toPasteboard:))]
861        #[unsafe(method_family = none)]
862        pub unsafe fn writeElement_withPasteboardTypes_toPasteboard(
863            &self,
864            element: Option<&NSDictionary>,
865            types: Option<&NSArray>,
866            pasteboard: Option<&NSPasteboard>,
867        );
868
869        /// Parameter `point`: A point in the coordinates of the WebView
870        ///
871        /// This method moves the caret that shows where something being dragged will be dropped. It may cause the WebView to scroll
872        /// to make the new position of the drag caret visible.
873        #[deprecated = "No longer supported; please adopt WKWebView."]
874        #[unsafe(method(moveDragCaretToPoint:))]
875        #[unsafe(method_family = none)]
876        pub unsafe fn moveDragCaretToPoint(&self, point: NSPoint);
877
878        /// Removes the drag caret from the WebView
879        #[deprecated = "No longer supported; please adopt WKWebView."]
880        #[unsafe(method(removeDragCaret))]
881        #[unsafe(method_family = none)]
882        pub unsafe fn removeDragCaret(&self);
883
884        /// Whether the receiver draws a default white background when the loaded page has no background specified.
885        #[deprecated = "No longer supported; please adopt WKWebView."]
886        #[unsafe(method(drawsBackground))]
887        #[unsafe(method_family = none)]
888        pub unsafe fn drawsBackground(&self) -> bool;
889
890        /// Setter for [`drawsBackground`][Self::drawsBackground].
891        #[deprecated = "No longer supported; please adopt WKWebView."]
892        #[unsafe(method(setDrawsBackground:))]
893        #[unsafe(method_family = none)]
894        pub unsafe fn setDrawsBackground(&self, draws_background: bool);
895
896        /// Whether the WebView is always updated even when it is not in a window that is currently visible.
897        ///
898        /// If set to NO, then whenever the web view is not in a visible window, updates to the web page will not necessarily be rendered in the view.
899        /// However, when the window is made visible, the view will be updated automatically. Not updating while hidden can improve performance. If set to is YES,
900        /// hidden web views are always updated. This is the default.
901        #[deprecated = "No longer supported; please adopt WKWebView."]
902        #[unsafe(method(shouldUpdateWhileOffscreen))]
903        #[unsafe(method_family = none)]
904        pub unsafe fn shouldUpdateWhileOffscreen(&self) -> bool;
905
906        /// Setter for [`shouldUpdateWhileOffscreen`][Self::shouldUpdateWhileOffscreen].
907        #[deprecated = "No longer supported; please adopt WKWebView."]
908        #[unsafe(method(setShouldUpdateWhileOffscreen:))]
909        #[unsafe(method_family = none)]
910        pub unsafe fn setShouldUpdateWhileOffscreen(&self, should_update_while_offscreen: bool);
911
912        /// The main frame's current URL.
913        #[deprecated = "No longer supported; please adopt WKWebView."]
914        #[unsafe(method(mainFrameURL))]
915        #[unsafe(method_family = none)]
916        pub unsafe fn mainFrameURL(&self) -> Retained<NSString>;
917
918        /// Setter for [`mainFrameURL`][Self::mainFrameURL].
919        ///
920        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
921        #[deprecated = "No longer supported; please adopt WKWebView."]
922        #[unsafe(method(setMainFrameURL:))]
923        #[unsafe(method_family = none)]
924        pub unsafe fn setMainFrameURL(&self, main_frame_url: Option<&NSString>);
925
926        #[cfg(all(
927            feature = "DOMDocument",
928            feature = "DOMNode",
929            feature = "DOMObject",
930            feature = "WebScriptObject"
931        ))]
932        /// The main frame's DOMDocument.
933        #[deprecated = "No longer supported; please adopt WKWebView."]
934        #[unsafe(method(mainFrameDocument))]
935        #[unsafe(method_family = none)]
936        pub unsafe fn mainFrameDocument(&self) -> Option<Retained<DOMDocument>>;
937
938        /// The main frame's title if any, otherwise an empty string.
939        #[deprecated = "No longer supported; please adopt WKWebView."]
940        #[unsafe(method(mainFrameTitle))]
941        #[unsafe(method_family = none)]
942        pub unsafe fn mainFrameTitle(&self) -> Retained<NSString>;
943
944        /// The site icon for the current page loaded in the mainFrame, or nil.
945        #[deprecated = "No longer supported; please adopt WKWebView."]
946        #[unsafe(method(mainFrameIcon))]
947        #[unsafe(method_family = none)]
948        pub unsafe fn mainFrameIcon(&self) -> Option<Retained<NSImage>>;
949    );
950}
951
952/// Methods declared on superclass `NSView`.
953#[cfg(feature = "objc2-app-kit")]
954#[cfg(target_os = "macos")]
955impl WebView {
956    extern_methods!(
957        #[unsafe(method(initWithFrame:))]
958        #[unsafe(method_family = init)]
959        pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
960
961        /// # Safety
962        ///
963        /// `coder` possibly has further requirements.
964        #[unsafe(method(initWithCoder:))]
965        #[unsafe(method_family = init)]
966        pub unsafe fn initWithCoder(
967            this: Allocated<Self>,
968            coder: &NSCoder,
969        ) -> Option<Retained<Self>>;
970    );
971}
972
973/// Methods declared on superclass `NSResponder`.
974#[cfg(feature = "objc2-app-kit")]
975#[cfg(target_os = "macos")]
976impl WebView {
977    extern_methods!(
978        #[unsafe(method(init))]
979        #[unsafe(method_family = init)]
980        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
981    );
982}
983
984/// Methods declared on superclass `NSObject`.
985#[cfg(feature = "objc2-app-kit")]
986#[cfg(target_os = "macos")]
987impl WebView {
988    extern_methods!(
989        #[unsafe(method(new))]
990        #[unsafe(method_family = new)]
991        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
992    );
993}
994
995/// WebIBActions.
996#[deprecated = "No longer supported; please adopt WKWebView."]
997#[cfg(feature = "objc2-app-kit")]
998#[cfg(target_os = "macos")]
999impl WebView {
1000    extern_methods!(
1001        /// # Safety
1002        ///
1003        /// `sender` should be of the correct type.
1004        #[deprecated = "No longer supported; please adopt WKWebView."]
1005        #[unsafe(method(takeStringURLFrom:))]
1006        #[unsafe(method_family = none)]
1007        pub unsafe fn takeStringURLFrom(&self, sender: Option<&AnyObject>);
1008
1009        /// # Safety
1010        ///
1011        /// `sender` should be of the correct type.
1012        #[deprecated = "No longer supported; please adopt WKWebView."]
1013        #[unsafe(method(stopLoading:))]
1014        #[unsafe(method_family = none)]
1015        pub unsafe fn stopLoading(&self, sender: Option<&AnyObject>);
1016
1017        /// # Safety
1018        ///
1019        /// `sender` should be of the correct type.
1020        #[deprecated = "No longer supported; please adopt WKWebView."]
1021        #[unsafe(method(reload:))]
1022        #[unsafe(method_family = none)]
1023        pub unsafe fn reload(&self, sender: Option<&AnyObject>);
1024
1025        /// # Safety
1026        ///
1027        /// `sender` should be of the correct type.
1028        #[deprecated = "No longer supported; please adopt WKWebView."]
1029        #[unsafe(method(reloadFromOrigin:))]
1030        #[unsafe(method_family = none)]
1031        pub unsafe fn reloadFromOrigin(&self, sender: Option<&AnyObject>);
1032
1033        #[deprecated = "No longer supported; please adopt WKWebView."]
1034        #[unsafe(method(canGoBack))]
1035        #[unsafe(method_family = none)]
1036        pub unsafe fn canGoBack(&self) -> bool;
1037
1038        /// # Safety
1039        ///
1040        /// `sender` should be of the correct type.
1041        #[deprecated = "No longer supported; please adopt WKWebView."]
1042        #[unsafe(method(goBack:))]
1043        #[unsafe(method_family = none)]
1044        pub unsafe fn goBack_(&self, sender: Option<&AnyObject>);
1045
1046        #[deprecated = "No longer supported; please adopt WKWebView."]
1047        #[unsafe(method(canGoForward))]
1048        #[unsafe(method_family = none)]
1049        pub unsafe fn canGoForward(&self) -> bool;
1050
1051        /// # Safety
1052        ///
1053        /// `sender` should be of the correct type.
1054        #[deprecated = "No longer supported; please adopt WKWebView."]
1055        #[unsafe(method(goForward:))]
1056        #[unsafe(method_family = none)]
1057        pub unsafe fn goForward_(&self, sender: Option<&AnyObject>);
1058
1059        #[deprecated = "No longer supported; please adopt WKWebView."]
1060        #[unsafe(method(canMakeTextLarger))]
1061        #[unsafe(method_family = none)]
1062        pub unsafe fn canMakeTextLarger(&self) -> bool;
1063
1064        /// # Safety
1065        ///
1066        /// `sender` should be of the correct type.
1067        #[deprecated = "No longer supported; please adopt WKWebView."]
1068        #[unsafe(method(makeTextLarger:))]
1069        #[unsafe(method_family = none)]
1070        pub unsafe fn makeTextLarger(&self, sender: Option<&AnyObject>);
1071
1072        #[deprecated = "No longer supported; please adopt WKWebView."]
1073        #[unsafe(method(canMakeTextSmaller))]
1074        #[unsafe(method_family = none)]
1075        pub unsafe fn canMakeTextSmaller(&self) -> bool;
1076
1077        /// # Safety
1078        ///
1079        /// `sender` should be of the correct type.
1080        #[deprecated = "No longer supported; please adopt WKWebView."]
1081        #[unsafe(method(makeTextSmaller:))]
1082        #[unsafe(method_family = none)]
1083        pub unsafe fn makeTextSmaller(&self, sender: Option<&AnyObject>);
1084
1085        #[deprecated = "No longer supported; please adopt WKWebView."]
1086        #[unsafe(method(canMakeTextStandardSize))]
1087        #[unsafe(method_family = none)]
1088        pub unsafe fn canMakeTextStandardSize(&self) -> bool;
1089
1090        /// # Safety
1091        ///
1092        /// `sender` should be of the correct type.
1093        #[deprecated = "No longer supported; please adopt WKWebView."]
1094        #[unsafe(method(makeTextStandardSize:))]
1095        #[unsafe(method_family = none)]
1096        pub unsafe fn makeTextStandardSize(&self, sender: Option<&AnyObject>);
1097
1098        /// # Safety
1099        ///
1100        /// `sender` should be of the correct type.
1101        #[deprecated = "No longer supported; please adopt WKWebView."]
1102        #[unsafe(method(toggleContinuousSpellChecking:))]
1103        #[unsafe(method_family = none)]
1104        pub unsafe fn toggleContinuousSpellChecking(&self, sender: Option<&AnyObject>);
1105
1106        /// # Safety
1107        ///
1108        /// `sender` should be of the correct type.
1109        #[deprecated = "No longer supported; please adopt WKWebView."]
1110        #[unsafe(method(toggleSmartInsertDelete:))]
1111        #[unsafe(method_family = none)]
1112        pub unsafe fn toggleSmartInsertDelete(&self, sender: Option<&AnyObject>);
1113    );
1114}
1115
1116#[cfg(feature = "objc2-app-kit")]
1117#[cfg(target_os = "macos")]
1118extern_conformance!(
1119    unsafe impl NSUserInterfaceValidations for WebView {}
1120);
1121
1122extern "C" {
1123    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/webviewdidbegineditingnotification?language=objc)
1124    #[deprecated]
1125    pub static WebViewDidBeginEditingNotification: Option<&'static NSString>;
1126}
1127
1128extern "C" {
1129    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/webviewdidchangenotification?language=objc)
1130    #[deprecated]
1131    pub static WebViewDidChangeNotification: Option<&'static NSString>;
1132}
1133
1134extern "C" {
1135    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/webviewdidendeditingnotification?language=objc)
1136    #[deprecated]
1137    pub static WebViewDidEndEditingNotification: Option<&'static NSString>;
1138}
1139
1140extern "C" {
1141    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/webviewdidchangetypingstylenotification?language=objc)
1142    #[deprecated]
1143    pub static WebViewDidChangeTypingStyleNotification: Option<&'static NSString>;
1144}
1145
1146extern "C" {
1147    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/webviewdidchangeselectionnotification?language=objc)
1148    #[deprecated]
1149    pub static WebViewDidChangeSelectionNotification: Option<&'static NSString>;
1150}
1151
1152/// WebViewCSS.
1153#[deprecated = "No longer supported; please adopt WKWebView."]
1154#[cfg(feature = "objc2-app-kit")]
1155#[cfg(target_os = "macos")]
1156impl WebView {
1157    extern_methods!(
1158        #[cfg(all(
1159            feature = "DOMCSSStyleDeclaration",
1160            feature = "DOMElement",
1161            feature = "DOMNode",
1162            feature = "DOMObject",
1163            feature = "WebScriptObject"
1164        ))]
1165        /// # Safety
1166        ///
1167        /// - `element` might not allow `None`.
1168        /// - `pseudo_element` might not allow `None`.
1169        #[deprecated = "No longer supported; please adopt WKWebView."]
1170        #[unsafe(method(computedStyleForElement:pseudoElement:))]
1171        #[unsafe(method_family = none)]
1172        pub unsafe fn computedStyleForElement_pseudoElement(
1173            &self,
1174            element: Option<&DOMElement>,
1175            pseudo_element: Option<&NSString>,
1176        ) -> Option<Retained<DOMCSSStyleDeclaration>>;
1177    );
1178}
1179
1180/// WebViewEditing.
1181#[deprecated = "No longer supported; please adopt WKWebView."]
1182#[cfg(feature = "objc2-app-kit")]
1183#[cfg(target_os = "macos")]
1184impl WebView {
1185    extern_methods!(
1186        #[cfg(all(
1187            feature = "DOMObject",
1188            feature = "DOMRange",
1189            feature = "WebScriptObject"
1190        ))]
1191        #[deprecated = "No longer supported; please adopt WKWebView."]
1192        #[unsafe(method(editableDOMRangeForPoint:))]
1193        #[unsafe(method_family = none)]
1194        pub unsafe fn editableDOMRangeForPoint(&self, point: NSPoint)
1195            -> Option<Retained<DOMRange>>;
1196
1197        #[cfg(all(
1198            feature = "DOMObject",
1199            feature = "DOMRange",
1200            feature = "WebScriptObject"
1201        ))]
1202        /// # Safety
1203        ///
1204        /// `range` might not allow `None`.
1205        #[deprecated = "No longer supported; please adopt WKWebView."]
1206        #[unsafe(method(setSelectedDOMRange:affinity:))]
1207        #[unsafe(method_family = none)]
1208        pub unsafe fn setSelectedDOMRange_affinity(
1209            &self,
1210            range: Option<&DOMRange>,
1211            selection_affinity: NSSelectionAffinity,
1212        );
1213
1214        #[cfg(all(
1215            feature = "DOMObject",
1216            feature = "DOMRange",
1217            feature = "WebScriptObject"
1218        ))]
1219        #[deprecated = "No longer supported; please adopt WKWebView."]
1220        #[unsafe(method(selectedDOMRange))]
1221        #[unsafe(method_family = none)]
1222        pub unsafe fn selectedDOMRange(&self) -> Option<Retained<DOMRange>>;
1223
1224        #[deprecated = "No longer supported; please adopt WKWebView."]
1225        #[unsafe(method(selectionAffinity))]
1226        #[unsafe(method_family = none)]
1227        pub unsafe fn selectionAffinity(&self) -> NSSelectionAffinity;
1228
1229        #[deprecated = "No longer supported; please adopt WKWebView."]
1230        #[unsafe(method(maintainsInactiveSelection))]
1231        #[unsafe(method_family = none)]
1232        pub unsafe fn maintainsInactiveSelection(&self) -> bool;
1233
1234        #[deprecated = "No longer supported; please adopt WKWebView."]
1235        #[unsafe(method(isEditable))]
1236        #[unsafe(method_family = none)]
1237        pub unsafe fn isEditable(&self) -> bool;
1238
1239        /// Setter for [`isEditable`][Self::isEditable].
1240        #[deprecated = "No longer supported; please adopt WKWebView."]
1241        #[unsafe(method(setEditable:))]
1242        #[unsafe(method_family = none)]
1243        pub unsafe fn setEditable(&self, editable: bool);
1244
1245        #[cfg(all(
1246            feature = "DOMCSSStyleDeclaration",
1247            feature = "DOMObject",
1248            feature = "WebScriptObject"
1249        ))]
1250        #[deprecated = "No longer supported; please adopt WKWebView."]
1251        #[unsafe(method(typingStyle))]
1252        #[unsafe(method_family = none)]
1253        pub unsafe fn typingStyle(&self) -> Option<Retained<DOMCSSStyleDeclaration>>;
1254
1255        #[cfg(all(
1256            feature = "DOMCSSStyleDeclaration",
1257            feature = "DOMObject",
1258            feature = "WebScriptObject"
1259        ))]
1260        /// Setter for [`typingStyle`][Self::typingStyle].
1261        ///
1262        /// # Safety
1263        ///
1264        /// `typing_style` might not allow `None`.
1265        #[deprecated = "No longer supported; please adopt WKWebView."]
1266        #[unsafe(method(setTypingStyle:))]
1267        #[unsafe(method_family = none)]
1268        pub unsafe fn setTypingStyle(&self, typing_style: Option<&DOMCSSStyleDeclaration>);
1269
1270        #[deprecated = "No longer supported; please adopt WKWebView."]
1271        #[unsafe(method(smartInsertDeleteEnabled))]
1272        #[unsafe(method_family = none)]
1273        pub unsafe fn smartInsertDeleteEnabled(&self) -> bool;
1274
1275        /// Setter for [`smartInsertDeleteEnabled`][Self::smartInsertDeleteEnabled].
1276        #[deprecated = "No longer supported; please adopt WKWebView."]
1277        #[unsafe(method(setSmartInsertDeleteEnabled:))]
1278        #[unsafe(method_family = none)]
1279        pub unsafe fn setSmartInsertDeleteEnabled(&self, smart_insert_delete_enabled: bool);
1280
1281        #[deprecated = "No longer supported; please adopt WKWebView."]
1282        #[unsafe(method(isContinuousSpellCheckingEnabled))]
1283        #[unsafe(method_family = none)]
1284        pub unsafe fn isContinuousSpellCheckingEnabled(&self) -> bool;
1285
1286        /// Setter for [`isContinuousSpellCheckingEnabled`][Self::isContinuousSpellCheckingEnabled].
1287        #[deprecated = "No longer supported; please adopt WKWebView."]
1288        #[unsafe(method(setContinuousSpellCheckingEnabled:))]
1289        #[unsafe(method_family = none)]
1290        pub unsafe fn setContinuousSpellCheckingEnabled(
1291            &self,
1292            continuous_spell_checking_enabled: bool,
1293        );
1294
1295        #[deprecated = "No longer supported; please adopt WKWebView."]
1296        #[unsafe(method(spellCheckerDocumentTag))]
1297        #[unsafe(method_family = none)]
1298        pub unsafe fn spellCheckerDocumentTag(&self) -> NSInteger;
1299
1300        #[deprecated = "No longer supported; please adopt WKWebView."]
1301        #[unsafe(method(undoManager))]
1302        #[unsafe(method_family = none)]
1303        pub unsafe fn undoManager(&self) -> Option<Retained<NSUndoManager>>;
1304
1305        #[cfg(feature = "WebEditingDelegate")]
1306        /// # Safety
1307        ///
1308        /// This is not retained internally, you must ensure the object is still alive.
1309        #[deprecated = "No longer supported; please adopt WKWebView."]
1310        #[unsafe(method(editingDelegate))]
1311        #[unsafe(method_family = none)]
1312        pub unsafe fn editingDelegate(
1313            &self,
1314        ) -> Option<Retained<ProtocolObject<dyn WebEditingDelegate>>>;
1315
1316        #[cfg(feature = "WebEditingDelegate")]
1317        /// Setter for [`editingDelegate`][Self::editingDelegate].
1318        ///
1319        /// # Safety
1320        ///
1321        /// - `editing_delegate` might not allow `None`.
1322        /// - This is unretained, you must ensure the object is kept alive while in use.
1323        #[deprecated = "No longer supported; please adopt WKWebView."]
1324        #[unsafe(method(setEditingDelegate:))]
1325        #[unsafe(method_family = none)]
1326        pub unsafe fn setEditingDelegate(
1327            &self,
1328            editing_delegate: Option<&ProtocolObject<dyn WebEditingDelegate>>,
1329        );
1330
1331        #[cfg(all(
1332            feature = "DOMCSSStyleDeclaration",
1333            feature = "DOMObject",
1334            feature = "WebScriptObject"
1335        ))]
1336        /// # Safety
1337        ///
1338        /// `text` might not allow `None`.
1339        #[deprecated = "No longer supported; please adopt WKWebView."]
1340        #[unsafe(method(styleDeclarationWithText:))]
1341        #[unsafe(method_family = none)]
1342        pub unsafe fn styleDeclarationWithText(
1343            &self,
1344            text: Option<&NSString>,
1345        ) -> Option<Retained<DOMCSSStyleDeclaration>>;
1346    );
1347}
1348
1349/// WebViewUndoableEditing.
1350#[deprecated = "No longer supported; please adopt WKWebView."]
1351#[cfg(feature = "objc2-app-kit")]
1352#[cfg(target_os = "macos")]
1353impl WebView {
1354    extern_methods!(
1355        #[cfg(all(
1356            feature = "DOMNode",
1357            feature = "DOMObject",
1358            feature = "WebScriptObject"
1359        ))]
1360        /// # Safety
1361        ///
1362        /// `node` might not allow `None`.
1363        #[deprecated = "No longer supported; please adopt WKWebView."]
1364        #[unsafe(method(replaceSelectionWithNode:))]
1365        #[unsafe(method_family = none)]
1366        pub unsafe fn replaceSelectionWithNode(&self, node: Option<&DOMNode>);
1367
1368        /// # Safety
1369        ///
1370        /// `text` might not allow `None`.
1371        #[deprecated = "No longer supported; please adopt WKWebView."]
1372        #[unsafe(method(replaceSelectionWithText:))]
1373        #[unsafe(method_family = none)]
1374        pub unsafe fn replaceSelectionWithText(&self, text: Option<&NSString>);
1375
1376        /// # Safety
1377        ///
1378        /// `markup_string` might not allow `None`.
1379        #[deprecated = "No longer supported; please adopt WKWebView."]
1380        #[unsafe(method(replaceSelectionWithMarkupString:))]
1381        #[unsafe(method_family = none)]
1382        pub unsafe fn replaceSelectionWithMarkupString(&self, markup_string: Option<&NSString>);
1383
1384        #[cfg(feature = "WebArchive")]
1385        /// # Safety
1386        ///
1387        /// `archive` might not allow `None`.
1388        #[deprecated = "No longer supported; please adopt WKWebView."]
1389        #[unsafe(method(replaceSelectionWithArchive:))]
1390        #[unsafe(method_family = none)]
1391        pub unsafe fn replaceSelectionWithArchive(&self, archive: Option<&WebArchive>);
1392
1393        #[deprecated = "No longer supported; please adopt WKWebView."]
1394        #[unsafe(method(deleteSelection))]
1395        #[unsafe(method_family = none)]
1396        pub unsafe fn deleteSelection(&self);
1397
1398        #[cfg(all(
1399            feature = "DOMCSSStyleDeclaration",
1400            feature = "DOMObject",
1401            feature = "WebScriptObject"
1402        ))]
1403        /// # Safety
1404        ///
1405        /// `style` might not allow `None`.
1406        #[deprecated = "No longer supported; please adopt WKWebView."]
1407        #[unsafe(method(applyStyle:))]
1408        #[unsafe(method_family = none)]
1409        pub unsafe fn applyStyle(&self, style: Option<&DOMCSSStyleDeclaration>);
1410    );
1411}
1412
1413/// WebViewEditingActions.
1414#[deprecated = "No longer supported; please adopt WKWebView."]
1415#[cfg(feature = "objc2-app-kit")]
1416#[cfg(target_os = "macos")]
1417impl WebView {
1418    extern_methods!(
1419        /// # Safety
1420        ///
1421        /// `sender` should be of the correct type.
1422        #[deprecated = "No longer supported; please adopt WKWebView."]
1423        #[unsafe(method(copy:))]
1424        #[unsafe(method_family = none)]
1425        pub unsafe fn copy(&self, sender: Option<&AnyObject>);
1426
1427        /// # Safety
1428        ///
1429        /// `sender` should be of the correct type.
1430        #[deprecated = "No longer supported; please adopt WKWebView."]
1431        #[unsafe(method(cut:))]
1432        #[unsafe(method_family = none)]
1433        pub unsafe fn cut(&self, sender: Option<&AnyObject>);
1434
1435        /// # Safety
1436        ///
1437        /// `sender` should be of the correct type.
1438        #[deprecated = "No longer supported; please adopt WKWebView."]
1439        #[unsafe(method(paste:))]
1440        #[unsafe(method_family = none)]
1441        pub unsafe fn paste(&self, sender: Option<&AnyObject>);
1442
1443        /// # Safety
1444        ///
1445        /// `sender` should be of the correct type.
1446        #[deprecated = "No longer supported; please adopt WKWebView."]
1447        #[unsafe(method(copyFont:))]
1448        #[unsafe(method_family = none)]
1449        pub unsafe fn copyFont(&self, sender: Option<&AnyObject>);
1450
1451        /// # Safety
1452        ///
1453        /// `sender` should be of the correct type.
1454        #[deprecated = "No longer supported; please adopt WKWebView."]
1455        #[unsafe(method(pasteFont:))]
1456        #[unsafe(method_family = none)]
1457        pub unsafe fn pasteFont(&self, sender: Option<&AnyObject>);
1458
1459        /// # Safety
1460        ///
1461        /// `sender` should be of the correct type.
1462        #[deprecated = "No longer supported; please adopt WKWebView."]
1463        #[unsafe(method(delete:))]
1464        #[unsafe(method_family = none)]
1465        pub unsafe fn delete(&self, sender: Option<&AnyObject>);
1466
1467        /// # Safety
1468        ///
1469        /// `sender` should be of the correct type.
1470        #[deprecated = "No longer supported; please adopt WKWebView."]
1471        #[unsafe(method(pasteAsPlainText:))]
1472        #[unsafe(method_family = none)]
1473        pub unsafe fn pasteAsPlainText(&self, sender: Option<&AnyObject>);
1474
1475        /// # Safety
1476        ///
1477        /// `sender` should be of the correct type.
1478        #[deprecated = "No longer supported; please adopt WKWebView."]
1479        #[unsafe(method(pasteAsRichText:))]
1480        #[unsafe(method_family = none)]
1481        pub unsafe fn pasteAsRichText(&self, sender: Option<&AnyObject>);
1482
1483        /// # Safety
1484        ///
1485        /// `sender` should be of the correct type.
1486        #[deprecated = "No longer supported; please adopt WKWebView."]
1487        #[unsafe(method(changeFont:))]
1488        #[unsafe(method_family = none)]
1489        pub unsafe fn changeFont(&self, sender: Option<&AnyObject>);
1490
1491        /// # Safety
1492        ///
1493        /// `sender` should be of the correct type.
1494        #[deprecated = "No longer supported; please adopt WKWebView."]
1495        #[unsafe(method(changeAttributes:))]
1496        #[unsafe(method_family = none)]
1497        pub unsafe fn changeAttributes(&self, sender: Option<&AnyObject>);
1498
1499        /// # Safety
1500        ///
1501        /// `sender` should be of the correct type.
1502        #[deprecated = "No longer supported; please adopt WKWebView."]
1503        #[unsafe(method(changeDocumentBackgroundColor:))]
1504        #[unsafe(method_family = none)]
1505        pub unsafe fn changeDocumentBackgroundColor(&self, sender: Option<&AnyObject>);
1506
1507        /// # Safety
1508        ///
1509        /// `sender` should be of the correct type.
1510        #[deprecated = "No longer supported; please adopt WKWebView."]
1511        #[unsafe(method(changeColor:))]
1512        #[unsafe(method_family = none)]
1513        pub unsafe fn changeColor(&self, sender: Option<&AnyObject>);
1514
1515        /// # Safety
1516        ///
1517        /// `sender` should be of the correct type.
1518        #[deprecated = "No longer supported; please adopt WKWebView."]
1519        #[unsafe(method(alignCenter:))]
1520        #[unsafe(method_family = none)]
1521        pub unsafe fn alignCenter(&self, sender: Option<&AnyObject>);
1522
1523        /// # Safety
1524        ///
1525        /// `sender` should be of the correct type.
1526        #[deprecated = "No longer supported; please adopt WKWebView."]
1527        #[unsafe(method(alignJustified:))]
1528        #[unsafe(method_family = none)]
1529        pub unsafe fn alignJustified(&self, sender: Option<&AnyObject>);
1530
1531        /// # Safety
1532        ///
1533        /// `sender` should be of the correct type.
1534        #[deprecated = "No longer supported; please adopt WKWebView."]
1535        #[unsafe(method(alignLeft:))]
1536        #[unsafe(method_family = none)]
1537        pub unsafe fn alignLeft(&self, sender: Option<&AnyObject>);
1538
1539        /// # Safety
1540        ///
1541        /// `sender` should be of the correct type.
1542        #[deprecated = "No longer supported; please adopt WKWebView."]
1543        #[unsafe(method(alignRight:))]
1544        #[unsafe(method_family = none)]
1545        pub unsafe fn alignRight(&self, sender: Option<&AnyObject>);
1546
1547        /// # Safety
1548        ///
1549        /// `sender` should be of the correct type.
1550        #[deprecated = "No longer supported; please adopt WKWebView."]
1551        #[unsafe(method(checkSpelling:))]
1552        #[unsafe(method_family = none)]
1553        pub unsafe fn checkSpelling(&self, sender: Option<&AnyObject>);
1554
1555        /// # Safety
1556        ///
1557        /// `sender` should be of the correct type.
1558        #[deprecated = "No longer supported; please adopt WKWebView."]
1559        #[unsafe(method(showGuessPanel:))]
1560        #[unsafe(method_family = none)]
1561        pub unsafe fn showGuessPanel(&self, sender: Option<&AnyObject>);
1562
1563        /// # Safety
1564        ///
1565        /// `sender` should be of the correct type.
1566        #[deprecated = "No longer supported; please adopt WKWebView."]
1567        #[unsafe(method(performFindPanelAction:))]
1568        #[unsafe(method_family = none)]
1569        pub unsafe fn performFindPanelAction(&self, sender: Option<&AnyObject>);
1570
1571        /// # Safety
1572        ///
1573        /// `sender` should be of the correct type.
1574        #[deprecated = "No longer supported; please adopt WKWebView."]
1575        #[unsafe(method(startSpeaking:))]
1576        #[unsafe(method_family = none)]
1577        pub unsafe fn startSpeaking(&self, sender: Option<&AnyObject>);
1578
1579        /// # Safety
1580        ///
1581        /// `sender` should be of the correct type.
1582        #[deprecated = "No longer supported; please adopt WKWebView."]
1583        #[unsafe(method(stopSpeaking:))]
1584        #[unsafe(method_family = none)]
1585        pub unsafe fn stopSpeaking(&self, sender: Option<&AnyObject>);
1586
1587        /// # Safety
1588        ///
1589        /// `sender` should be of the correct type.
1590        #[deprecated = "No longer supported; please adopt WKWebView."]
1591        #[unsafe(method(moveToBeginningOfSentence:))]
1592        #[unsafe(method_family = none)]
1593        pub unsafe fn moveToBeginningOfSentence(&self, sender: Option<&AnyObject>);
1594
1595        /// # Safety
1596        ///
1597        /// `sender` should be of the correct type.
1598        #[deprecated = "No longer supported; please adopt WKWebView."]
1599        #[unsafe(method(moveToBeginningOfSentenceAndModifySelection:))]
1600        #[unsafe(method_family = none)]
1601        pub unsafe fn moveToBeginningOfSentenceAndModifySelection(
1602            &self,
1603            sender: Option<&AnyObject>,
1604        );
1605
1606        /// # Safety
1607        ///
1608        /// `sender` should be of the correct type.
1609        #[deprecated = "No longer supported; please adopt WKWebView."]
1610        #[unsafe(method(moveToEndOfSentence:))]
1611        #[unsafe(method_family = none)]
1612        pub unsafe fn moveToEndOfSentence(&self, sender: Option<&AnyObject>);
1613
1614        /// # Safety
1615        ///
1616        /// `sender` should be of the correct type.
1617        #[deprecated = "No longer supported; please adopt WKWebView."]
1618        #[unsafe(method(moveToEndOfSentenceAndModifySelection:))]
1619        #[unsafe(method_family = none)]
1620        pub unsafe fn moveToEndOfSentenceAndModifySelection(&self, sender: Option<&AnyObject>);
1621
1622        /// # Safety
1623        ///
1624        /// `sender` should be of the correct type.
1625        #[deprecated = "No longer supported; please adopt WKWebView."]
1626        #[unsafe(method(selectSentence:))]
1627        #[unsafe(method_family = none)]
1628        pub unsafe fn selectSentence(&self, sender: Option<&AnyObject>);
1629
1630        /// # Safety
1631        ///
1632        /// `sender` should be of the correct type.
1633        #[deprecated = "No longer supported; please adopt WKWebView."]
1634        #[unsafe(method(overWrite:))]
1635        #[unsafe(method_family = none)]
1636        pub unsafe fn overWrite(&self, sender: Option<&AnyObject>);
1637    );
1638}