1use 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 #[deprecated]
16 pub static WebElementDOMNodeKey: Option<&'static NSString>;
17}
18
19extern "C" {
20 #[deprecated]
22 pub static WebElementFrameKey: Option<&'static NSString>;
23}
24
25extern "C" {
26 #[deprecated]
28 pub static WebElementImageAltStringKey: Option<&'static NSString>;
29}
30
31extern "C" {
32 #[deprecated]
34 pub static WebElementImageKey: Option<&'static NSString>;
35}
36
37extern "C" {
38 #[deprecated]
40 pub static WebElementImageRectKey: Option<&'static NSString>;
41}
42
43extern "C" {
44 #[deprecated]
46 pub static WebElementImageURLKey: Option<&'static NSString>;
47}
48
49extern "C" {
50 #[deprecated]
52 pub static WebElementIsSelectedKey: Option<&'static NSString>;
53}
54
55extern "C" {
56 #[deprecated]
58 pub static WebElementLinkURLKey: Option<&'static NSString>;
59}
60
61extern "C" {
62 #[deprecated]
64 pub static WebElementLinkTargetFrameKey: Option<&'static NSString>;
65}
66
67extern "C" {
68 #[deprecated]
70 pub static WebElementLinkTitleKey: Option<&'static NSString>;
71}
72
73extern "C" {
74 #[deprecated]
76 pub static WebElementLinkLabelKey: Option<&'static NSString>;
77}
78
79extern "C" {
80 #[deprecated]
82 pub static WebViewProgressStartedNotification: Option<&'static NSString>;
83}
84
85extern "C" {
86 #[deprecated]
88 pub static WebViewProgressEstimateChangedNotification: Option<&'static NSString>;
89}
90
91extern "C" {
92 #[deprecated]
94 pub static WebViewProgressFinishedNotification: Option<&'static NSString>;
95}
96
97extern_class!(
98 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[deprecated = "No longer supported; please adopt WKWebView."]
301 #[unsafe(method(close))]
302 #[unsafe(method_family = none)]
303 pub unsafe fn close(&self);
304
305 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[deprecated = "No longer supported; please adopt WKWebView."]
880 #[unsafe(method(removeDragCaret))]
881 #[unsafe(method_family = none)]
882 pub unsafe fn removeDragCaret(&self);
883
884 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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#[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 #[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#[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#[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#[deprecated = "No longer supported; please adopt WKWebView."]
997#[cfg(feature = "objc2-app-kit")]
998#[cfg(target_os = "macos")]
999impl WebView {
1000 extern_methods!(
1001 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[deprecated]
1125 pub static WebViewDidBeginEditingNotification: Option<&'static NSString>;
1126}
1127
1128extern "C" {
1129 #[deprecated]
1131 pub static WebViewDidChangeNotification: Option<&'static NSString>;
1132}
1133
1134extern "C" {
1135 #[deprecated]
1137 pub static WebViewDidEndEditingNotification: Option<&'static NSString>;
1138}
1139
1140extern "C" {
1141 #[deprecated]
1143 pub static WebViewDidChangeTypingStyleNotification: Option<&'static NSString>;
1144}
1145
1146extern "C" {
1147 #[deprecated]
1149 pub static WebViewDidChangeSelectionNotification: Option<&'static NSString>;
1150}
1151
1152#[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 #[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#[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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#[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 #[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 #[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 #[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 #[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 #[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#[deprecated = "No longer supported; please adopt WKWebView."]
1415#[cfg(feature = "objc2-app-kit")]
1416#[cfg(target_os = "macos")]
1417impl WebView {
1418 extern_methods!(
1419 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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}