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 pub static WebElementDOMNodeKey: Option<&'static NSString>;
16}
17
18extern "C" {
19 pub static WebElementFrameKey: Option<&'static NSString>;
21}
22
23extern "C" {
24 pub static WebElementImageAltStringKey: Option<&'static NSString>;
26}
27
28extern "C" {
29 pub static WebElementImageKey: Option<&'static NSString>;
31}
32
33extern "C" {
34 pub static WebElementImageRectKey: Option<&'static NSString>;
36}
37
38extern "C" {
39 pub static WebElementImageURLKey: Option<&'static NSString>;
41}
42
43extern "C" {
44 pub static WebElementIsSelectedKey: Option<&'static NSString>;
46}
47
48extern "C" {
49 pub static WebElementLinkURLKey: Option<&'static NSString>;
51}
52
53extern "C" {
54 pub static WebElementLinkTargetFrameKey: Option<&'static NSString>;
56}
57
58extern "C" {
59 pub static WebElementLinkTitleKey: Option<&'static NSString>;
61}
62
63extern "C" {
64 pub static WebElementLinkLabelKey: Option<&'static NSString>;
66}
67
68extern "C" {
69 pub static WebViewProgressStartedNotification: Option<&'static NSString>;
71}
72
73extern "C" {
74 pub static WebViewProgressEstimateChangedNotification: Option<&'static NSString>;
76}
77
78extern "C" {
79 pub static WebViewProgressFinishedNotification: Option<&'static NSString>;
81}
82
83extern_class!(
84 #[unsafe(super(NSView, NSResponder, NSObject))]
86 #[derive(Debug, PartialEq, Eq, Hash)]
87 #[cfg(feature = "objc2-app-kit")]
88 #[cfg(target_os = "macos")]
89 #[deprecated = "No longer supported; please adopt WKWebView."]
90 pub struct WebView;
91);
92
93#[cfg(feature = "objc2-app-kit")]
94#[cfg(target_os = "macos")]
95extern_conformance!(
96 unsafe impl NSAccessibility for WebView {}
97);
98
99#[cfg(feature = "objc2-app-kit")]
100#[cfg(target_os = "macos")]
101extern_conformance!(
102 unsafe impl NSAccessibilityElementProtocol for WebView {}
103);
104
105#[cfg(feature = "objc2-app-kit")]
106#[cfg(target_os = "macos")]
107extern_conformance!(
108 unsafe impl NSAnimatablePropertyContainer for WebView {}
109);
110
111#[cfg(feature = "objc2-app-kit")]
112#[cfg(target_os = "macos")]
113extern_conformance!(
114 unsafe impl NSAppearanceCustomization for WebView {}
115);
116
117#[cfg(feature = "objc2-app-kit")]
118#[cfg(target_os = "macos")]
119extern_conformance!(
120 unsafe impl NSCoding for WebView {}
121);
122
123#[cfg(feature = "objc2-app-kit")]
124#[cfg(target_os = "macos")]
125extern_conformance!(
126 unsafe impl NSDraggingDestination for WebView {}
127);
128
129#[cfg(feature = "objc2-app-kit")]
130#[cfg(target_os = "macos")]
131extern_conformance!(
132 unsafe impl NSObjectProtocol for WebView {}
133);
134
135#[cfg(feature = "objc2-app-kit")]
136#[cfg(target_os = "macos")]
137extern_conformance!(
138 unsafe impl NSUserInterfaceItemIdentification for WebView {}
139);
140
141#[cfg(feature = "objc2-app-kit")]
142#[cfg(target_os = "macos")]
143impl WebView {
144 extern_methods!(
145 #[deprecated = "No longer supported; please adopt WKWebView."]
151 #[unsafe(method(canShowMIMEType:))]
152 #[unsafe(method_family = none)]
153 pub unsafe fn canShowMIMEType(mime_type: Option<&NSString>, mtm: MainThreadMarker) -> bool;
154
155 #[deprecated = "No longer supported; please adopt WKWebView."]
161 #[unsafe(method(canShowMIMETypeAsHTML:))]
162 #[unsafe(method_family = none)]
163 pub unsafe fn canShowMIMETypeAsHTML(
164 mime_type: Option<&NSString>,
165 mtm: MainThreadMarker,
166 ) -> bool;
167
168 #[deprecated = "No longer supported; please adopt WKWebView."]
171 #[unsafe(method(MIMETypesShownAsHTML))]
172 #[unsafe(method_family = none)]
173 pub unsafe fn MIMETypesShownAsHTML(mtm: MainThreadMarker) -> Option<Retained<NSArray>>;
174
175 #[deprecated = "No longer supported; please adopt WKWebView."]
180 #[unsafe(method(setMIMETypesShownAsHTML:))]
181 #[unsafe(method_family = none)]
182 pub unsafe fn setMIMETypesShownAsHTML(mime_types: Option<&NSArray>, mtm: MainThreadMarker);
183
184 #[deprecated = "No longer supported; please adopt WKWebView."]
193 #[unsafe(method(URLFromPasteboard:))]
194 #[unsafe(method_family = none)]
195 pub unsafe fn URLFromPasteboard(
196 pasteboard: Option<&NSPasteboard>,
197 mtm: MainThreadMarker,
198 ) -> Option<Retained<NSURL>>;
199
200 #[deprecated = "No longer supported; please adopt WKWebView."]
209 #[unsafe(method(URLTitleFromPasteboard:))]
210 #[unsafe(method_family = none)]
211 pub unsafe fn URLTitleFromPasteboard(
212 pasteboard: Option<&NSPasteboard>,
213 mtm: MainThreadMarker,
214 ) -> Option<Retained<NSString>>;
215
216 #[deprecated = "No longer supported; please adopt WKWebView."]
220 #[unsafe(method(registerURLSchemeAsLocal:))]
221 #[unsafe(method_family = none)]
222 pub unsafe fn registerURLSchemeAsLocal(scheme: Option<&NSString>, mtm: MainThreadMarker);
223
224 #[deprecated = "No longer supported; please adopt WKWebView."]
239 #[unsafe(method(initWithFrame:frameName:groupName:))]
240 #[unsafe(method_family = init)]
241 pub unsafe fn initWithFrame_frameName_groupName(
242 this: Allocated<Self>,
243 frame: NSRect,
244 frame_name: Option<&NSString>,
245 group_name: Option<&NSString>,
246 ) -> Option<Retained<Self>>;
247
248 #[deprecated = "No longer supported; please adopt WKWebView."]
257 #[unsafe(method(close))]
258 #[unsafe(method_family = none)]
259 pub unsafe fn close(&self);
260
261 #[deprecated = "No longer supported; please adopt WKWebView."]
265 #[unsafe(method(shouldCloseWithWindow))]
266 #[unsafe(method_family = none)]
267 pub unsafe fn shouldCloseWithWindow(&self) -> bool;
268
269 #[deprecated = "No longer supported; please adopt WKWebView."]
271 #[unsafe(method(setShouldCloseWithWindow:))]
272 #[unsafe(method_family = none)]
273 pub unsafe fn setShouldCloseWithWindow(&self, should_close_with_window: bool);
274
275 #[cfg(feature = "WebUIDelegate")]
276 #[deprecated = "No longer supported; please adopt WKWebView."]
278 #[unsafe(method(UIDelegate))]
279 #[unsafe(method_family = none)]
280 pub unsafe fn UIDelegate(&self) -> Option<Retained<ProtocolObject<dyn WebUIDelegate>>>;
281
282 #[cfg(feature = "WebUIDelegate")]
283 #[deprecated = "No longer supported; please adopt WKWebView."]
285 #[unsafe(method(setUIDelegate:))]
286 #[unsafe(method_family = none)]
287 pub unsafe fn setUIDelegate(&self, ui_delegate: Option<&ProtocolObject<dyn WebUIDelegate>>);
288
289 #[cfg(feature = "WebResourceLoadDelegate")]
290 #[deprecated = "No longer supported; please adopt WKWebView."]
292 #[unsafe(method(resourceLoadDelegate))]
293 #[unsafe(method_family = none)]
294 pub unsafe fn resourceLoadDelegate(
295 &self,
296 ) -> Option<Retained<ProtocolObject<dyn WebResourceLoadDelegate>>>;
297
298 #[cfg(feature = "WebResourceLoadDelegate")]
299 #[deprecated = "No longer supported; please adopt WKWebView."]
301 #[unsafe(method(setResourceLoadDelegate:))]
302 #[unsafe(method_family = none)]
303 pub unsafe fn setResourceLoadDelegate(
304 &self,
305 resource_load_delegate: Option<&ProtocolObject<dyn WebResourceLoadDelegate>>,
306 );
307
308 #[cfg(feature = "WebDownload")]
309 #[deprecated = "No longer supported; please adopt WKWebView."]
311 #[unsafe(method(downloadDelegate))]
312 #[unsafe(method_family = none)]
313 pub unsafe fn downloadDelegate(
314 &self,
315 ) -> Option<Retained<ProtocolObject<dyn WebDownloadDelegate>>>;
316
317 #[cfg(feature = "WebDownload")]
318 #[deprecated = "No longer supported; please adopt WKWebView."]
320 #[unsafe(method(setDownloadDelegate:))]
321 #[unsafe(method_family = none)]
322 pub unsafe fn setDownloadDelegate(
323 &self,
324 download_delegate: Option<&ProtocolObject<dyn WebDownloadDelegate>>,
325 );
326
327 #[cfg(feature = "WebFrameLoadDelegate")]
328 #[deprecated = "No longer supported; please adopt WKWebView."]
330 #[unsafe(method(frameLoadDelegate))]
331 #[unsafe(method_family = none)]
332 pub unsafe fn frameLoadDelegate(
333 &self,
334 ) -> Option<Retained<ProtocolObject<dyn WebFrameLoadDelegate>>>;
335
336 #[cfg(feature = "WebFrameLoadDelegate")]
337 #[deprecated = "No longer supported; please adopt WKWebView."]
339 #[unsafe(method(setFrameLoadDelegate:))]
340 #[unsafe(method_family = none)]
341 pub unsafe fn setFrameLoadDelegate(
342 &self,
343 frame_load_delegate: Option<&ProtocolObject<dyn WebFrameLoadDelegate>>,
344 );
345
346 #[cfg(feature = "WebPolicyDelegate")]
347 #[deprecated = "No longer supported; please adopt WKWebView."]
349 #[unsafe(method(policyDelegate))]
350 #[unsafe(method_family = none)]
351 pub unsafe fn policyDelegate(
352 &self,
353 ) -> Option<Retained<ProtocolObject<dyn WebPolicyDelegate>>>;
354
355 #[cfg(feature = "WebPolicyDelegate")]
356 #[deprecated = "No longer supported; please adopt WKWebView."]
358 #[unsafe(method(setPolicyDelegate:))]
359 #[unsafe(method_family = none)]
360 pub unsafe fn setPolicyDelegate(
361 &self,
362 policy_delegate: Option<&ProtocolObject<dyn WebPolicyDelegate>>,
363 );
364
365 #[cfg(feature = "WebFrame")]
366 #[deprecated = "No longer supported; please adopt WKWebView."]
370 #[unsafe(method(mainFrame))]
371 #[unsafe(method_family = none)]
372 pub unsafe fn mainFrame(&self) -> Option<Retained<WebFrame>>;
373
374 #[cfg(feature = "WebFrame")]
375 #[deprecated = "No longer supported; please adopt WKWebView."]
380 #[unsafe(method(selectedFrame))]
381 #[unsafe(method_family = none)]
382 pub unsafe fn selectedFrame(&self) -> Option<Retained<WebFrame>>;
383
384 #[cfg(feature = "WebBackForwardList")]
385 #[deprecated = "No longer supported; please adopt WKWebView."]
387 #[unsafe(method(backForwardList))]
388 #[unsafe(method_family = none)]
389 pub unsafe fn backForwardList(&self) -> Option<Retained<WebBackForwardList>>;
390
391 #[deprecated = "No longer supported; please adopt WKWebView."]
395 #[unsafe(method(setMaintainsBackForwardList:))]
396 #[unsafe(method_family = none)]
397 pub unsafe fn setMaintainsBackForwardList(&self, flag: bool);
398
399 #[deprecated = "No longer supported; please adopt WKWebView."]
403 #[unsafe(method(goBack))]
404 #[unsafe(method_family = none)]
405 pub unsafe fn goBack(&self) -> bool;
406
407 #[deprecated = "No longer supported; please adopt WKWebView."]
411 #[unsafe(method(goForward))]
412 #[unsafe(method_family = none)]
413 pub unsafe fn goForward(&self) -> bool;
414
415 #[cfg(feature = "WebHistoryItem")]
416 #[deprecated = "No longer supported; please adopt WKWebView."]
420 #[unsafe(method(goToBackForwardItem:))]
421 #[unsafe(method_family = none)]
422 pub unsafe fn goToBackForwardItem(&self, item: Option<&WebHistoryItem>) -> bool;
423
424 #[deprecated = "No longer supported; please adopt WKWebView."]
426 #[unsafe(method(textSizeMultiplier))]
427 #[unsafe(method_family = none)]
428 pub unsafe fn textSizeMultiplier(&self) -> c_float;
429
430 #[deprecated = "No longer supported; please adopt WKWebView."]
432 #[unsafe(method(setTextSizeMultiplier:))]
433 #[unsafe(method_family = none)]
434 pub unsafe fn setTextSizeMultiplier(&self, text_size_multiplier: c_float);
435
436 #[deprecated = "No longer supported; please adopt WKWebView."]
438 #[unsafe(method(applicationNameForUserAgent))]
439 #[unsafe(method_family = none)]
440 pub unsafe fn applicationNameForUserAgent(&self) -> Retained<NSString>;
441
442 #[deprecated = "No longer supported; please adopt WKWebView."]
444 #[unsafe(method(setApplicationNameForUserAgent:))]
445 #[unsafe(method_family = none)]
446 pub unsafe fn setApplicationNameForUserAgent(
447 &self,
448 application_name_for_user_agent: Option<&NSString>,
449 );
450
451 #[deprecated = "No longer supported; please adopt WKWebView."]
458 #[unsafe(method(customUserAgent))]
459 #[unsafe(method_family = none)]
460 pub unsafe fn customUserAgent(&self) -> Retained<NSString>;
461
462 #[deprecated = "No longer supported; please adopt WKWebView."]
464 #[unsafe(method(setCustomUserAgent:))]
465 #[unsafe(method_family = none)]
466 pub unsafe fn setCustomUserAgent(&self, custom_user_agent: Option<&NSString>);
467
468 #[deprecated = "No longer supported; please adopt WKWebView."]
474 #[unsafe(method(userAgentForURL:))]
475 #[unsafe(method_family = none)]
476 pub unsafe fn userAgentForURL(&self, url: Option<&NSURL>) -> Option<Retained<NSString>>;
477
478 #[deprecated = "No longer supported; please adopt WKWebView."]
480 #[unsafe(method(supportsTextEncoding))]
481 #[unsafe(method_family = none)]
482 pub unsafe fn supportsTextEncoding(&self) -> bool;
483
484 #[deprecated = "No longer supported; please adopt WKWebView."]
493 #[unsafe(method(customTextEncodingName))]
494 #[unsafe(method_family = none)]
495 pub unsafe fn customTextEncodingName(&self) -> Retained<NSString>;
496
497 #[deprecated = "No longer supported; please adopt WKWebView."]
499 #[unsafe(method(setCustomTextEncodingName:))]
500 #[unsafe(method_family = none)]
501 pub unsafe fn setCustomTextEncodingName(
502 &self,
503 custom_text_encoding_name: Option<&NSString>,
504 );
505
506 #[deprecated = "No longer supported; please adopt WKWebView."]
511 #[unsafe(method(mediaStyle))]
512 #[unsafe(method_family = none)]
513 pub unsafe fn mediaStyle(&self) -> Retained<NSString>;
514
515 #[deprecated = "No longer supported; please adopt WKWebView."]
517 #[unsafe(method(setMediaStyle:))]
518 #[unsafe(method_family = none)]
519 pub unsafe fn setMediaStyle(&self, media_style: Option<&NSString>);
520
521 #[deprecated = "No longer supported; please adopt WKWebView."]
525 #[unsafe(method(stringByEvaluatingJavaScriptFromString:))]
526 #[unsafe(method_family = none)]
527 pub unsafe fn stringByEvaluatingJavaScriptFromString(
528 &self,
529 script: Option<&NSString>,
530 ) -> Option<Retained<NSString>>;
531
532 #[cfg(feature = "WebScriptObject")]
533 #[deprecated = "No longer supported; please adopt WKWebView."]
536 #[unsafe(method(windowScriptObject))]
537 #[unsafe(method_family = none)]
538 pub unsafe fn windowScriptObject(&self) -> Option<Retained<WebScriptObject>>;
539
540 #[cfg(feature = "WebPreferences")]
541 #[deprecated = "No longer supported; please adopt WKWebView."]
546 #[unsafe(method(preferences))]
547 #[unsafe(method_family = none)]
548 pub unsafe fn preferences(&self) -> Option<Retained<WebPreferences>>;
549
550 #[cfg(feature = "WebPreferences")]
551 #[deprecated = "No longer supported; please adopt WKWebView."]
553 #[unsafe(method(setPreferences:))]
554 #[unsafe(method_family = none)]
555 pub unsafe fn setPreferences(&self, preferences: Option<&WebPreferences>);
556
557 #[deprecated = "No longer supported; please adopt WKWebView."]
561 #[unsafe(method(preferencesIdentifier))]
562 #[unsafe(method_family = none)]
563 pub unsafe fn preferencesIdentifier(&self) -> Retained<NSString>;
564
565 #[deprecated = "No longer supported; please adopt WKWebView."]
567 #[unsafe(method(setPreferencesIdentifier:))]
568 #[unsafe(method_family = none)]
569 pub unsafe fn setPreferencesIdentifier(&self, preferences_identifier: Option<&NSString>);
570
571 #[deprecated = "No longer supported; please adopt WKWebView."]
577 #[unsafe(method(hostWindow))]
578 #[unsafe(method_family = none)]
579 pub unsafe fn hostWindow(&self) -> Option<Retained<NSWindow>>;
580
581 #[deprecated = "No longer supported; please adopt WKWebView."]
583 #[unsafe(method(setHostWindow:))]
584 #[unsafe(method_family = none)]
585 pub unsafe fn setHostWindow(&self, host_window: Option<&NSWindow>);
586
587 #[deprecated = "No longer supported; please adopt WKWebView."]
598 #[unsafe(method(searchFor:direction:caseSensitive:wrap:))]
599 #[unsafe(method_family = none)]
600 pub unsafe fn searchFor_direction_caseSensitive_wrap(
601 &self,
602 string: Option<&NSString>,
603 forward: bool,
604 case_flag: bool,
605 wrap_flag: bool,
606 ) -> bool;
607
608 #[deprecated = "No longer supported; please adopt WKWebView."]
620 #[unsafe(method(registerViewClass:representationClass:forMIMEType:))]
621 #[unsafe(method_family = none)]
622 pub unsafe fn registerViewClass_representationClass_forMIMEType(
623 view_class: Option<&AnyClass>,
624 representation_class: Option<&AnyClass>,
625 mime_type: Option<&NSString>,
626 mtm: MainThreadMarker,
627 );
628
629 #[deprecated = "No longer supported; please adopt WKWebView."]
633 #[unsafe(method(groupName))]
634 #[unsafe(method_family = none)]
635 pub unsafe fn groupName(&self) -> Retained<NSString>;
636
637 #[deprecated = "No longer supported; please adopt WKWebView."]
639 #[unsafe(method(setGroupName:))]
640 #[unsafe(method_family = none)]
641 pub unsafe fn setGroupName(&self, group_name: Option<&NSString>);
642
643 #[deprecated = "No longer supported; please adopt WKWebView."]
651 #[unsafe(method(estimatedProgress))]
652 #[unsafe(method_family = none)]
653 pub unsafe fn estimatedProgress(&self) -> c_double;
654
655 #[deprecated = "No longer supported; please adopt WKWebView."]
657 #[unsafe(method(isLoading))]
658 #[unsafe(method_family = none)]
659 pub unsafe fn isLoading(&self) -> bool;
660
661 #[deprecated = "No longer supported; please adopt WKWebView."]
665 #[unsafe(method(elementAtPoint:))]
666 #[unsafe(method_family = none)]
667 pub unsafe fn elementAtPoint(&self, point: NSPoint) -> Option<Retained<NSDictionary>>;
668
669 #[deprecated = "No longer supported; please adopt WKWebView."]
671 #[unsafe(method(pasteboardTypesForSelection))]
672 #[unsafe(method_family = none)]
673 pub unsafe fn pasteboardTypesForSelection(&self) -> Retained<NSArray>;
674
675 #[deprecated = "No longer supported; please adopt WKWebView."]
681 #[unsafe(method(writeSelectionWithPasteboardTypes:toPasteboard:))]
682 #[unsafe(method_family = none)]
683 pub unsafe fn writeSelectionWithPasteboardTypes_toPasteboard(
684 &self,
685 types: Option<&NSArray>,
686 pasteboard: Option<&NSPasteboard>,
687 );
688
689 #[deprecated = "No longer supported; please adopt WKWebView."]
693 #[unsafe(method(pasteboardTypesForElement:))]
694 #[unsafe(method_family = none)]
695 pub unsafe fn pasteboardTypesForElement(
696 &self,
697 element: Option<&NSDictionary>,
698 ) -> Option<Retained<NSArray>>;
699
700 #[deprecated = "No longer supported; please adopt WKWebView."]
708 #[unsafe(method(writeElement:withPasteboardTypes:toPasteboard:))]
709 #[unsafe(method_family = none)]
710 pub unsafe fn writeElement_withPasteboardTypes_toPasteboard(
711 &self,
712 element: Option<&NSDictionary>,
713 types: Option<&NSArray>,
714 pasteboard: Option<&NSPasteboard>,
715 );
716
717 #[deprecated = "No longer supported; please adopt WKWebView."]
722 #[unsafe(method(moveDragCaretToPoint:))]
723 #[unsafe(method_family = none)]
724 pub unsafe fn moveDragCaretToPoint(&self, point: NSPoint);
725
726 #[deprecated = "No longer supported; please adopt WKWebView."]
728 #[unsafe(method(removeDragCaret))]
729 #[unsafe(method_family = none)]
730 pub unsafe fn removeDragCaret(&self);
731
732 #[deprecated = "No longer supported; please adopt WKWebView."]
734 #[unsafe(method(drawsBackground))]
735 #[unsafe(method_family = none)]
736 pub unsafe fn drawsBackground(&self) -> bool;
737
738 #[deprecated = "No longer supported; please adopt WKWebView."]
740 #[unsafe(method(setDrawsBackground:))]
741 #[unsafe(method_family = none)]
742 pub unsafe fn setDrawsBackground(&self, draws_background: bool);
743
744 #[deprecated = "No longer supported; please adopt WKWebView."]
750 #[unsafe(method(shouldUpdateWhileOffscreen))]
751 #[unsafe(method_family = none)]
752 pub unsafe fn shouldUpdateWhileOffscreen(&self) -> bool;
753
754 #[deprecated = "No longer supported; please adopt WKWebView."]
756 #[unsafe(method(setShouldUpdateWhileOffscreen:))]
757 #[unsafe(method_family = none)]
758 pub unsafe fn setShouldUpdateWhileOffscreen(&self, should_update_while_offscreen: bool);
759
760 #[deprecated = "No longer supported; please adopt WKWebView."]
762 #[unsafe(method(mainFrameURL))]
763 #[unsafe(method_family = none)]
764 pub unsafe fn mainFrameURL(&self) -> Retained<NSString>;
765
766 #[deprecated = "No longer supported; please adopt WKWebView."]
768 #[unsafe(method(setMainFrameURL:))]
769 #[unsafe(method_family = none)]
770 pub unsafe fn setMainFrameURL(&self, main_frame_url: Option<&NSString>);
771
772 #[cfg(all(
773 feature = "DOMDocument",
774 feature = "DOMNode",
775 feature = "DOMObject",
776 feature = "WebScriptObject"
777 ))]
778 #[deprecated = "No longer supported; please adopt WKWebView."]
780 #[unsafe(method(mainFrameDocument))]
781 #[unsafe(method_family = none)]
782 pub unsafe fn mainFrameDocument(&self) -> Option<Retained<DOMDocument>>;
783
784 #[deprecated = "No longer supported; please adopt WKWebView."]
786 #[unsafe(method(mainFrameTitle))]
787 #[unsafe(method_family = none)]
788 pub unsafe fn mainFrameTitle(&self) -> Retained<NSString>;
789
790 #[deprecated = "No longer supported; please adopt WKWebView."]
792 #[unsafe(method(mainFrameIcon))]
793 #[unsafe(method_family = none)]
794 pub unsafe fn mainFrameIcon(&self) -> Option<Retained<NSImage>>;
795 );
796}
797
798#[cfg(feature = "objc2-app-kit")]
800#[cfg(target_os = "macos")]
801impl WebView {
802 extern_methods!(
803 #[unsafe(method(initWithFrame:))]
804 #[unsafe(method_family = init)]
805 pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
806
807 #[unsafe(method(initWithCoder:))]
808 #[unsafe(method_family = init)]
809 pub unsafe fn initWithCoder(
810 this: Allocated<Self>,
811 coder: &NSCoder,
812 ) -> Option<Retained<Self>>;
813 );
814}
815
816#[cfg(feature = "objc2-app-kit")]
818#[cfg(target_os = "macos")]
819impl WebView {
820 extern_methods!(
821 #[unsafe(method(init))]
822 #[unsafe(method_family = init)]
823 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
824 );
825}
826
827#[cfg(feature = "objc2-app-kit")]
829#[cfg(target_os = "macos")]
830impl WebView {
831 extern_methods!(
832 #[unsafe(method(new))]
833 #[unsafe(method_family = new)]
834 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
835 );
836}
837
838#[cfg(feature = "objc2-app-kit")]
840#[cfg(target_os = "macos")]
841impl WebView {
842 extern_methods!(
843 #[deprecated = "No longer supported; please adopt WKWebView."]
844 #[unsafe(method(takeStringURLFrom:))]
845 #[unsafe(method_family = none)]
846 pub unsafe fn takeStringURLFrom(&self, sender: Option<&AnyObject>);
847
848 #[deprecated = "No longer supported; please adopt WKWebView."]
849 #[unsafe(method(stopLoading:))]
850 #[unsafe(method_family = none)]
851 pub unsafe fn stopLoading(&self, sender: Option<&AnyObject>);
852
853 #[deprecated = "No longer supported; please adopt WKWebView."]
854 #[unsafe(method(reload:))]
855 #[unsafe(method_family = none)]
856 pub unsafe fn reload(&self, sender: Option<&AnyObject>);
857
858 #[deprecated = "No longer supported; please adopt WKWebView."]
859 #[unsafe(method(reloadFromOrigin:))]
860 #[unsafe(method_family = none)]
861 pub unsafe fn reloadFromOrigin(&self, sender: Option<&AnyObject>);
862
863 #[deprecated = "No longer supported; please adopt WKWebView."]
864 #[unsafe(method(canGoBack))]
865 #[unsafe(method_family = none)]
866 pub unsafe fn canGoBack(&self) -> bool;
867
868 #[deprecated = "No longer supported; please adopt WKWebView."]
869 #[unsafe(method(goBack:))]
870 #[unsafe(method_family = none)]
871 pub unsafe fn goBack_(&self, sender: Option<&AnyObject>);
872
873 #[deprecated = "No longer supported; please adopt WKWebView."]
874 #[unsafe(method(canGoForward))]
875 #[unsafe(method_family = none)]
876 pub unsafe fn canGoForward(&self) -> bool;
877
878 #[deprecated = "No longer supported; please adopt WKWebView."]
879 #[unsafe(method(goForward:))]
880 #[unsafe(method_family = none)]
881 pub unsafe fn goForward_(&self, sender: Option<&AnyObject>);
882
883 #[deprecated = "No longer supported; please adopt WKWebView."]
884 #[unsafe(method(canMakeTextLarger))]
885 #[unsafe(method_family = none)]
886 pub unsafe fn canMakeTextLarger(&self) -> bool;
887
888 #[deprecated = "No longer supported; please adopt WKWebView."]
889 #[unsafe(method(makeTextLarger:))]
890 #[unsafe(method_family = none)]
891 pub unsafe fn makeTextLarger(&self, sender: Option<&AnyObject>);
892
893 #[deprecated = "No longer supported; please adopt WKWebView."]
894 #[unsafe(method(canMakeTextSmaller))]
895 #[unsafe(method_family = none)]
896 pub unsafe fn canMakeTextSmaller(&self) -> bool;
897
898 #[deprecated = "No longer supported; please adopt WKWebView."]
899 #[unsafe(method(makeTextSmaller:))]
900 #[unsafe(method_family = none)]
901 pub unsafe fn makeTextSmaller(&self, sender: Option<&AnyObject>);
902
903 #[deprecated = "No longer supported; please adopt WKWebView."]
904 #[unsafe(method(canMakeTextStandardSize))]
905 #[unsafe(method_family = none)]
906 pub unsafe fn canMakeTextStandardSize(&self) -> bool;
907
908 #[deprecated = "No longer supported; please adopt WKWebView."]
909 #[unsafe(method(makeTextStandardSize:))]
910 #[unsafe(method_family = none)]
911 pub unsafe fn makeTextStandardSize(&self, sender: Option<&AnyObject>);
912
913 #[deprecated = "No longer supported; please adopt WKWebView."]
914 #[unsafe(method(toggleContinuousSpellChecking:))]
915 #[unsafe(method_family = none)]
916 pub unsafe fn toggleContinuousSpellChecking(&self, sender: Option<&AnyObject>);
917
918 #[deprecated = "No longer supported; please adopt WKWebView."]
919 #[unsafe(method(toggleSmartInsertDelete:))]
920 #[unsafe(method_family = none)]
921 pub unsafe fn toggleSmartInsertDelete(&self, sender: Option<&AnyObject>);
922 );
923}
924
925#[cfg(feature = "objc2-app-kit")]
926#[cfg(target_os = "macos")]
927extern_conformance!(
928 unsafe impl NSUserInterfaceValidations for WebView {}
929);
930
931extern "C" {
932 pub static WebViewDidBeginEditingNotification: Option<&'static NSString>;
934}
935
936extern "C" {
937 pub static WebViewDidChangeNotification: Option<&'static NSString>;
939}
940
941extern "C" {
942 pub static WebViewDidEndEditingNotification: Option<&'static NSString>;
944}
945
946extern "C" {
947 pub static WebViewDidChangeTypingStyleNotification: Option<&'static NSString>;
949}
950
951extern "C" {
952 pub static WebViewDidChangeSelectionNotification: Option<&'static NSString>;
954}
955
956#[cfg(feature = "objc2-app-kit")]
958#[cfg(target_os = "macos")]
959impl WebView {
960 extern_methods!(
961 #[cfg(all(
962 feature = "DOMCSSStyleDeclaration",
963 feature = "DOMElement",
964 feature = "DOMNode",
965 feature = "DOMObject",
966 feature = "WebScriptObject"
967 ))]
968 #[deprecated = "No longer supported; please adopt WKWebView."]
969 #[unsafe(method(computedStyleForElement:pseudoElement:))]
970 #[unsafe(method_family = none)]
971 pub unsafe fn computedStyleForElement_pseudoElement(
972 &self,
973 element: Option<&DOMElement>,
974 pseudo_element: Option<&NSString>,
975 ) -> Option<Retained<DOMCSSStyleDeclaration>>;
976 );
977}
978
979#[cfg(feature = "objc2-app-kit")]
981#[cfg(target_os = "macos")]
982impl WebView {
983 extern_methods!(
984 #[cfg(all(
985 feature = "DOMObject",
986 feature = "DOMRange",
987 feature = "WebScriptObject"
988 ))]
989 #[deprecated = "No longer supported; please adopt WKWebView."]
990 #[unsafe(method(editableDOMRangeForPoint:))]
991 #[unsafe(method_family = none)]
992 pub unsafe fn editableDOMRangeForPoint(&self, point: NSPoint)
993 -> Option<Retained<DOMRange>>;
994
995 #[cfg(all(
996 feature = "DOMObject",
997 feature = "DOMRange",
998 feature = "WebScriptObject"
999 ))]
1000 #[deprecated = "No longer supported; please adopt WKWebView."]
1001 #[unsafe(method(setSelectedDOMRange:affinity:))]
1002 #[unsafe(method_family = none)]
1003 pub unsafe fn setSelectedDOMRange_affinity(
1004 &self,
1005 range: Option<&DOMRange>,
1006 selection_affinity: NSSelectionAffinity,
1007 );
1008
1009 #[cfg(all(
1010 feature = "DOMObject",
1011 feature = "DOMRange",
1012 feature = "WebScriptObject"
1013 ))]
1014 #[deprecated = "No longer supported; please adopt WKWebView."]
1015 #[unsafe(method(selectedDOMRange))]
1016 #[unsafe(method_family = none)]
1017 pub unsafe fn selectedDOMRange(&self) -> Option<Retained<DOMRange>>;
1018
1019 #[deprecated = "No longer supported; please adopt WKWebView."]
1020 #[unsafe(method(selectionAffinity))]
1021 #[unsafe(method_family = none)]
1022 pub unsafe fn selectionAffinity(&self) -> NSSelectionAffinity;
1023
1024 #[deprecated = "No longer supported; please adopt WKWebView."]
1025 #[unsafe(method(maintainsInactiveSelection))]
1026 #[unsafe(method_family = none)]
1027 pub unsafe fn maintainsInactiveSelection(&self) -> bool;
1028
1029 #[deprecated = "No longer supported; please adopt WKWebView."]
1030 #[unsafe(method(isEditable))]
1031 #[unsafe(method_family = none)]
1032 pub unsafe fn isEditable(&self) -> bool;
1033
1034 #[deprecated = "No longer supported; please adopt WKWebView."]
1036 #[unsafe(method(setEditable:))]
1037 #[unsafe(method_family = none)]
1038 pub unsafe fn setEditable(&self, editable: bool);
1039
1040 #[cfg(all(
1041 feature = "DOMCSSStyleDeclaration",
1042 feature = "DOMObject",
1043 feature = "WebScriptObject"
1044 ))]
1045 #[deprecated = "No longer supported; please adopt WKWebView."]
1046 #[unsafe(method(typingStyle))]
1047 #[unsafe(method_family = none)]
1048 pub unsafe fn typingStyle(&self) -> Option<Retained<DOMCSSStyleDeclaration>>;
1049
1050 #[cfg(all(
1051 feature = "DOMCSSStyleDeclaration",
1052 feature = "DOMObject",
1053 feature = "WebScriptObject"
1054 ))]
1055 #[deprecated = "No longer supported; please adopt WKWebView."]
1057 #[unsafe(method(setTypingStyle:))]
1058 #[unsafe(method_family = none)]
1059 pub unsafe fn setTypingStyle(&self, typing_style: Option<&DOMCSSStyleDeclaration>);
1060
1061 #[deprecated = "No longer supported; please adopt WKWebView."]
1062 #[unsafe(method(smartInsertDeleteEnabled))]
1063 #[unsafe(method_family = none)]
1064 pub unsafe fn smartInsertDeleteEnabled(&self) -> bool;
1065
1066 #[deprecated = "No longer supported; please adopt WKWebView."]
1068 #[unsafe(method(setSmartInsertDeleteEnabled:))]
1069 #[unsafe(method_family = none)]
1070 pub unsafe fn setSmartInsertDeleteEnabled(&self, smart_insert_delete_enabled: bool);
1071
1072 #[deprecated = "No longer supported; please adopt WKWebView."]
1073 #[unsafe(method(isContinuousSpellCheckingEnabled))]
1074 #[unsafe(method_family = none)]
1075 pub unsafe fn isContinuousSpellCheckingEnabled(&self) -> bool;
1076
1077 #[deprecated = "No longer supported; please adopt WKWebView."]
1079 #[unsafe(method(setContinuousSpellCheckingEnabled:))]
1080 #[unsafe(method_family = none)]
1081 pub unsafe fn setContinuousSpellCheckingEnabled(
1082 &self,
1083 continuous_spell_checking_enabled: bool,
1084 );
1085
1086 #[deprecated = "No longer supported; please adopt WKWebView."]
1087 #[unsafe(method(spellCheckerDocumentTag))]
1088 #[unsafe(method_family = none)]
1089 pub unsafe fn spellCheckerDocumentTag(&self) -> NSInteger;
1090
1091 #[deprecated = "No longer supported; please adopt WKWebView."]
1092 #[unsafe(method(undoManager))]
1093 #[unsafe(method_family = none)]
1094 pub unsafe fn undoManager(&self) -> Option<Retained<NSUndoManager>>;
1095
1096 #[cfg(feature = "WebEditingDelegate")]
1097 #[deprecated = "No longer supported; please adopt WKWebView."]
1098 #[unsafe(method(editingDelegate))]
1099 #[unsafe(method_family = none)]
1100 pub unsafe fn editingDelegate(
1101 &self,
1102 ) -> Option<Retained<ProtocolObject<dyn WebEditingDelegate>>>;
1103
1104 #[cfg(feature = "WebEditingDelegate")]
1105 #[deprecated = "No longer supported; please adopt WKWebView."]
1107 #[unsafe(method(setEditingDelegate:))]
1108 #[unsafe(method_family = none)]
1109 pub unsafe fn setEditingDelegate(
1110 &self,
1111 editing_delegate: Option<&ProtocolObject<dyn WebEditingDelegate>>,
1112 );
1113
1114 #[cfg(all(
1115 feature = "DOMCSSStyleDeclaration",
1116 feature = "DOMObject",
1117 feature = "WebScriptObject"
1118 ))]
1119 #[deprecated = "No longer supported; please adopt WKWebView."]
1120 #[unsafe(method(styleDeclarationWithText:))]
1121 #[unsafe(method_family = none)]
1122 pub unsafe fn styleDeclarationWithText(
1123 &self,
1124 text: Option<&NSString>,
1125 ) -> Option<Retained<DOMCSSStyleDeclaration>>;
1126 );
1127}
1128
1129#[cfg(feature = "objc2-app-kit")]
1131#[cfg(target_os = "macos")]
1132impl WebView {
1133 extern_methods!(
1134 #[cfg(all(
1135 feature = "DOMNode",
1136 feature = "DOMObject",
1137 feature = "WebScriptObject"
1138 ))]
1139 #[deprecated = "No longer supported; please adopt WKWebView."]
1140 #[unsafe(method(replaceSelectionWithNode:))]
1141 #[unsafe(method_family = none)]
1142 pub unsafe fn replaceSelectionWithNode(&self, node: Option<&DOMNode>);
1143
1144 #[deprecated = "No longer supported; please adopt WKWebView."]
1145 #[unsafe(method(replaceSelectionWithText:))]
1146 #[unsafe(method_family = none)]
1147 pub unsafe fn replaceSelectionWithText(&self, text: Option<&NSString>);
1148
1149 #[deprecated = "No longer supported; please adopt WKWebView."]
1150 #[unsafe(method(replaceSelectionWithMarkupString:))]
1151 #[unsafe(method_family = none)]
1152 pub unsafe fn replaceSelectionWithMarkupString(&self, markup_string: Option<&NSString>);
1153
1154 #[cfg(feature = "WebArchive")]
1155 #[deprecated = "No longer supported; please adopt WKWebView."]
1156 #[unsafe(method(replaceSelectionWithArchive:))]
1157 #[unsafe(method_family = none)]
1158 pub unsafe fn replaceSelectionWithArchive(&self, archive: Option<&WebArchive>);
1159
1160 #[deprecated = "No longer supported; please adopt WKWebView."]
1161 #[unsafe(method(deleteSelection))]
1162 #[unsafe(method_family = none)]
1163 pub unsafe fn deleteSelection(&self);
1164
1165 #[cfg(all(
1166 feature = "DOMCSSStyleDeclaration",
1167 feature = "DOMObject",
1168 feature = "WebScriptObject"
1169 ))]
1170 #[deprecated = "No longer supported; please adopt WKWebView."]
1171 #[unsafe(method(applyStyle:))]
1172 #[unsafe(method_family = none)]
1173 pub unsafe fn applyStyle(&self, style: Option<&DOMCSSStyleDeclaration>);
1174 );
1175}
1176
1177#[cfg(feature = "objc2-app-kit")]
1179#[cfg(target_os = "macos")]
1180impl WebView {
1181 extern_methods!(
1182 #[deprecated = "No longer supported; please adopt WKWebView."]
1183 #[unsafe(method(copy:))]
1184 #[unsafe(method_family = none)]
1185 pub unsafe fn copy(&self, sender: Option<&AnyObject>);
1186
1187 #[deprecated = "No longer supported; please adopt WKWebView."]
1188 #[unsafe(method(cut:))]
1189 #[unsafe(method_family = none)]
1190 pub unsafe fn cut(&self, sender: Option<&AnyObject>);
1191
1192 #[deprecated = "No longer supported; please adopt WKWebView."]
1193 #[unsafe(method(paste:))]
1194 #[unsafe(method_family = none)]
1195 pub unsafe fn paste(&self, sender: Option<&AnyObject>);
1196
1197 #[deprecated = "No longer supported; please adopt WKWebView."]
1198 #[unsafe(method(copyFont:))]
1199 #[unsafe(method_family = none)]
1200 pub unsafe fn copyFont(&self, sender: Option<&AnyObject>);
1201
1202 #[deprecated = "No longer supported; please adopt WKWebView."]
1203 #[unsafe(method(pasteFont:))]
1204 #[unsafe(method_family = none)]
1205 pub unsafe fn pasteFont(&self, sender: Option<&AnyObject>);
1206
1207 #[deprecated = "No longer supported; please adopt WKWebView."]
1208 #[unsafe(method(delete:))]
1209 #[unsafe(method_family = none)]
1210 pub unsafe fn delete(&self, sender: Option<&AnyObject>);
1211
1212 #[deprecated = "No longer supported; please adopt WKWebView."]
1213 #[unsafe(method(pasteAsPlainText:))]
1214 #[unsafe(method_family = none)]
1215 pub unsafe fn pasteAsPlainText(&self, sender: Option<&AnyObject>);
1216
1217 #[deprecated = "No longer supported; please adopt WKWebView."]
1218 #[unsafe(method(pasteAsRichText:))]
1219 #[unsafe(method_family = none)]
1220 pub unsafe fn pasteAsRichText(&self, sender: Option<&AnyObject>);
1221
1222 #[deprecated = "No longer supported; please adopt WKWebView."]
1223 #[unsafe(method(changeFont:))]
1224 #[unsafe(method_family = none)]
1225 pub unsafe fn changeFont(&self, sender: Option<&AnyObject>);
1226
1227 #[deprecated = "No longer supported; please adopt WKWebView."]
1228 #[unsafe(method(changeAttributes:))]
1229 #[unsafe(method_family = none)]
1230 pub unsafe fn changeAttributes(&self, sender: Option<&AnyObject>);
1231
1232 #[deprecated = "No longer supported; please adopt WKWebView."]
1233 #[unsafe(method(changeDocumentBackgroundColor:))]
1234 #[unsafe(method_family = none)]
1235 pub unsafe fn changeDocumentBackgroundColor(&self, sender: Option<&AnyObject>);
1236
1237 #[deprecated = "No longer supported; please adopt WKWebView."]
1238 #[unsafe(method(changeColor:))]
1239 #[unsafe(method_family = none)]
1240 pub unsafe fn changeColor(&self, sender: Option<&AnyObject>);
1241
1242 #[deprecated = "No longer supported; please adopt WKWebView."]
1243 #[unsafe(method(alignCenter:))]
1244 #[unsafe(method_family = none)]
1245 pub unsafe fn alignCenter(&self, sender: Option<&AnyObject>);
1246
1247 #[deprecated = "No longer supported; please adopt WKWebView."]
1248 #[unsafe(method(alignJustified:))]
1249 #[unsafe(method_family = none)]
1250 pub unsafe fn alignJustified(&self, sender: Option<&AnyObject>);
1251
1252 #[deprecated = "No longer supported; please adopt WKWebView."]
1253 #[unsafe(method(alignLeft:))]
1254 #[unsafe(method_family = none)]
1255 pub unsafe fn alignLeft(&self, sender: Option<&AnyObject>);
1256
1257 #[deprecated = "No longer supported; please adopt WKWebView."]
1258 #[unsafe(method(alignRight:))]
1259 #[unsafe(method_family = none)]
1260 pub unsafe fn alignRight(&self, sender: Option<&AnyObject>);
1261
1262 #[deprecated = "No longer supported; please adopt WKWebView."]
1263 #[unsafe(method(checkSpelling:))]
1264 #[unsafe(method_family = none)]
1265 pub unsafe fn checkSpelling(&self, sender: Option<&AnyObject>);
1266
1267 #[deprecated = "No longer supported; please adopt WKWebView."]
1268 #[unsafe(method(showGuessPanel:))]
1269 #[unsafe(method_family = none)]
1270 pub unsafe fn showGuessPanel(&self, sender: Option<&AnyObject>);
1271
1272 #[deprecated = "No longer supported; please adopt WKWebView."]
1273 #[unsafe(method(performFindPanelAction:))]
1274 #[unsafe(method_family = none)]
1275 pub unsafe fn performFindPanelAction(&self, sender: Option<&AnyObject>);
1276
1277 #[deprecated = "No longer supported; please adopt WKWebView."]
1278 #[unsafe(method(startSpeaking:))]
1279 #[unsafe(method_family = none)]
1280 pub unsafe fn startSpeaking(&self, sender: Option<&AnyObject>);
1281
1282 #[deprecated = "No longer supported; please adopt WKWebView."]
1283 #[unsafe(method(stopSpeaking:))]
1284 #[unsafe(method_family = none)]
1285 pub unsafe fn stopSpeaking(&self, sender: Option<&AnyObject>);
1286
1287 #[deprecated = "No longer supported; please adopt WKWebView."]
1288 #[unsafe(method(moveToBeginningOfSentence:))]
1289 #[unsafe(method_family = none)]
1290 pub unsafe fn moveToBeginningOfSentence(&self, sender: Option<&AnyObject>);
1291
1292 #[deprecated = "No longer supported; please adopt WKWebView."]
1293 #[unsafe(method(moveToBeginningOfSentenceAndModifySelection:))]
1294 #[unsafe(method_family = none)]
1295 pub unsafe fn moveToBeginningOfSentenceAndModifySelection(
1296 &self,
1297 sender: Option<&AnyObject>,
1298 );
1299
1300 #[deprecated = "No longer supported; please adopt WKWebView."]
1301 #[unsafe(method(moveToEndOfSentence:))]
1302 #[unsafe(method_family = none)]
1303 pub unsafe fn moveToEndOfSentence(&self, sender: Option<&AnyObject>);
1304
1305 #[deprecated = "No longer supported; please adopt WKWebView."]
1306 #[unsafe(method(moveToEndOfSentenceAndModifySelection:))]
1307 #[unsafe(method_family = none)]
1308 pub unsafe fn moveToEndOfSentenceAndModifySelection(&self, sender: Option<&AnyObject>);
1309
1310 #[deprecated = "No longer supported; please adopt WKWebView."]
1311 #[unsafe(method(selectSentence:))]
1312 #[unsafe(method_family = none)]
1313 pub unsafe fn selectSentence(&self, sender: Option<&AnyObject>);
1314
1315 #[deprecated = "No longer supported; please adopt WKWebView."]
1316 #[unsafe(method(overWrite:))]
1317 #[unsafe(method_family = none)]
1318 pub unsafe fn overWrite(&self, sender: Option<&AnyObject>);
1319 );
1320}