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::*;
9#[cfg(feature = "objc2-core-foundation")]
10use objc2_core_foundation::*;
11use objc2_foundation::*;
12#[cfg(feature = "objc2-security")]
13use objc2_security::*;
14
15use crate::*;
16
17#[repr(transparent)]
20#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
21pub struct WKMediaPlaybackState(pub NSInteger);
22impl WKMediaPlaybackState {
23 #[doc(alias = "WKMediaPlaybackStateNone")]
24 pub const None: Self = Self(0);
25 #[doc(alias = "WKMediaPlaybackStatePlaying")]
26 pub const Playing: Self = Self(1);
27 #[doc(alias = "WKMediaPlaybackStatePaused")]
28 pub const Paused: Self = Self(2);
29 #[doc(alias = "WKMediaPlaybackStateSuspended")]
30 pub const Suspended: Self = Self(3);
31}
32
33unsafe impl Encode for WKMediaPlaybackState {
34 const ENCODING: Encoding = NSInteger::ENCODING;
35}
36
37unsafe impl RefEncode for WKMediaPlaybackState {
38 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
39}
40
41#[repr(transparent)]
44#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
45pub struct WKMediaCaptureState(pub NSInteger);
46impl WKMediaCaptureState {
47 #[doc(alias = "WKMediaCaptureStateNone")]
48 pub const None: Self = Self(0);
49 #[doc(alias = "WKMediaCaptureStateActive")]
50 pub const Active: Self = Self(1);
51 #[doc(alias = "WKMediaCaptureStateMuted")]
52 pub const Muted: Self = Self(2);
53}
54
55unsafe impl Encode for WKMediaCaptureState {
56 const ENCODING: Encoding = NSInteger::ENCODING;
57}
58
59unsafe impl RefEncode for WKMediaCaptureState {
60 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
61}
62
63#[repr(transparent)]
66#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
67pub struct WKFullscreenState(pub NSInteger);
68impl WKFullscreenState {
69 #[doc(alias = "WKFullscreenStateNotInFullscreen")]
70 pub const NotInFullscreen: Self = Self(0);
71 #[doc(alias = "WKFullscreenStateEnteringFullscreen")]
72 pub const EnteringFullscreen: Self = Self(1);
73 #[doc(alias = "WKFullscreenStateInFullscreen")]
74 pub const InFullscreen: Self = Self(2);
75 #[doc(alias = "WKFullscreenStateExitingFullscreen")]
76 pub const ExitingFullscreen: Self = Self(3);
77}
78
79unsafe impl Encode for WKFullscreenState {
80 const ENCODING: Encoding = NSInteger::ENCODING;
81}
82
83unsafe impl RefEncode for WKFullscreenState {
84 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
85}
86
87extern_class!(
88 #[unsafe(super(NSView, NSResponder, NSObject))]
90 #[thread_kind = MainThreadOnly]
91 #[derive(Debug, PartialEq, Eq, Hash)]
92 #[cfg(feature = "objc2-app-kit")]
93 #[cfg(target_os = "macos")]
94 pub struct WKWebView;
95);
96
97#[cfg(feature = "objc2-app-kit")]
98#[cfg(target_os = "macos")]
99extern_conformance!(
100 unsafe impl NSAccessibility for WKWebView {}
101);
102
103#[cfg(feature = "objc2-app-kit")]
104#[cfg(target_os = "macos")]
105extern_conformance!(
106 unsafe impl NSAccessibilityElementProtocol for WKWebView {}
107);
108
109#[cfg(feature = "objc2-app-kit")]
110#[cfg(target_os = "macos")]
111extern_conformance!(
112 unsafe impl NSAnimatablePropertyContainer for WKWebView {}
113);
114
115#[cfg(feature = "objc2-app-kit")]
116#[cfg(target_os = "macos")]
117extern_conformance!(
118 unsafe impl NSAppearanceCustomization for WKWebView {}
119);
120
121#[cfg(feature = "objc2-app-kit")]
122#[cfg(target_os = "macos")]
123extern_conformance!(
124 unsafe impl NSCoding for WKWebView {}
125);
126
127#[cfg(feature = "objc2-app-kit")]
128#[cfg(target_os = "macos")]
129extern_conformance!(
130 unsafe impl NSDraggingDestination for WKWebView {}
131);
132
133#[cfg(feature = "objc2-app-kit")]
134#[cfg(target_os = "macos")]
135extern_conformance!(
136 unsafe impl NSObjectProtocol for WKWebView {}
137);
138
139#[cfg(feature = "objc2-app-kit")]
140#[cfg(target_os = "macos")]
141extern_conformance!(
142 unsafe impl NSUserInterfaceItemIdentification for WKWebView {}
143);
144
145#[cfg(feature = "objc2-app-kit")]
146#[cfg(target_os = "macos")]
147impl WKWebView {
148 extern_methods!(
149 #[cfg(feature = "WKWebViewConfiguration")]
150 #[unsafe(method(configuration))]
153 #[unsafe(method_family = none)]
154 pub unsafe fn configuration(&self) -> Retained<WKWebViewConfiguration>;
155
156 #[cfg(feature = "WKNavigationDelegate")]
157 #[unsafe(method(navigationDelegate))]
159 #[unsafe(method_family = none)]
160 pub unsafe fn navigationDelegate(
161 &self,
162 ) -> Option<Retained<ProtocolObject<dyn WKNavigationDelegate>>>;
163
164 #[cfg(feature = "WKNavigationDelegate")]
165 #[unsafe(method(setNavigationDelegate:))]
168 #[unsafe(method_family = none)]
169 pub unsafe fn setNavigationDelegate(
170 &self,
171 navigation_delegate: Option<&ProtocolObject<dyn WKNavigationDelegate>>,
172 );
173
174 #[cfg(feature = "WKUIDelegate")]
175 #[unsafe(method(UIDelegate))]
177 #[unsafe(method_family = none)]
178 pub unsafe fn UIDelegate(&self) -> Option<Retained<ProtocolObject<dyn WKUIDelegate>>>;
179
180 #[cfg(feature = "WKUIDelegate")]
181 #[unsafe(method(setUIDelegate:))]
184 #[unsafe(method_family = none)]
185 pub unsafe fn setUIDelegate(&self, ui_delegate: Option<&ProtocolObject<dyn WKUIDelegate>>);
186
187 #[cfg(feature = "WKBackForwardList")]
188 #[unsafe(method(backForwardList))]
190 #[unsafe(method_family = none)]
191 pub unsafe fn backForwardList(&self) -> Retained<WKBackForwardList>;
192
193 #[cfg(all(feature = "WKWebViewConfiguration", feature = "objc2-core-foundation"))]
194 #[unsafe(method(initWithFrame:configuration:))]
215 #[unsafe(method_family = init)]
216 pub unsafe fn initWithFrame_configuration(
217 this: Allocated<Self>,
218 frame: CGRect,
219 configuration: &WKWebViewConfiguration,
220 ) -> Retained<Self>;
221
222 #[unsafe(method(initWithCoder:))]
223 #[unsafe(method_family = init)]
224 pub unsafe fn initWithCoder(
225 this: Allocated<Self>,
226 coder: &NSCoder,
227 ) -> Option<Retained<Self>>;
228
229 #[cfg(feature = "WKNavigation")]
230 #[unsafe(method(loadRequest:))]
236 #[unsafe(method_family = none)]
237 pub unsafe fn loadRequest(&self, request: &NSURLRequest) -> Option<Retained<WKNavigation>>;
238
239 #[cfg(feature = "WKNavigation")]
240 #[unsafe(method(loadFileURL:allowingReadAccessToURL:))]
251 #[unsafe(method_family = none)]
252 pub unsafe fn loadFileURL_allowingReadAccessToURL(
253 &self,
254 url: &NSURL,
255 read_access_url: &NSURL,
256 ) -> Option<Retained<WKNavigation>>;
257
258 #[cfg(feature = "WKNavigation")]
259 #[unsafe(method(loadHTMLString:baseURL:))]
267 #[unsafe(method_family = none)]
268 pub unsafe fn loadHTMLString_baseURL(
269 &self,
270 string: &NSString,
271 base_url: Option<&NSURL>,
272 ) -> Option<Retained<WKNavigation>>;
273
274 #[cfg(feature = "WKNavigation")]
275 #[unsafe(method(loadData:MIMEType:characterEncodingName:baseURL:))]
287 #[unsafe(method_family = none)]
288 pub unsafe fn loadData_MIMEType_characterEncodingName_baseURL(
289 &self,
290 data: &NSData,
291 mime_type: &NSString,
292 character_encoding_name: &NSString,
293 base_url: &NSURL,
294 ) -> Option<Retained<WKNavigation>>;
295
296 #[cfg(all(feature = "WKBackForwardListItem", feature = "WKNavigation"))]
297 #[unsafe(method(goToBackForwardListItem:))]
308 #[unsafe(method_family = none)]
309 pub unsafe fn goToBackForwardListItem(
310 &self,
311 item: &WKBackForwardListItem,
312 ) -> Option<Retained<WKNavigation>>;
313
314 #[unsafe(method(title))]
324 #[unsafe(method_family = none)]
325 pub unsafe fn title(&self) -> Option<Retained<NSString>>;
326
327 #[unsafe(method(URL))]
339 #[unsafe(method_family = none)]
340 pub unsafe fn URL(&self) -> Option<Retained<NSURL>>;
341
342 #[unsafe(method(isLoading))]
353 #[unsafe(method_family = none)]
354 pub unsafe fn isLoading(&self) -> bool;
355
356 #[unsafe(method(estimatedProgress))]
370 #[unsafe(method_family = none)]
371 pub unsafe fn estimatedProgress(&self) -> c_double;
372
373 #[unsafe(method(hasOnlySecureContent))]
384 #[unsafe(method_family = none)]
385 pub unsafe fn hasOnlySecureContent(&self) -> bool;
386
387 #[cfg(feature = "objc2-security")]
388 #[unsafe(method(serverTrust))]
398 #[unsafe(method_family = none)]
399 pub unsafe fn serverTrust(&self) -> Option<Retained<SecTrust>>;
400
401 #[unsafe(method(canGoBack))]
414 #[unsafe(method_family = none)]
415 pub unsafe fn canGoBack(&self) -> bool;
416
417 #[unsafe(method(canGoForward))]
430 #[unsafe(method_family = none)]
431 pub unsafe fn canGoForward(&self) -> bool;
432
433 #[cfg(feature = "WKNavigation")]
434 #[unsafe(method(goBack))]
439 #[unsafe(method_family = none)]
440 pub unsafe fn goBack(&self) -> Option<Retained<WKNavigation>>;
441
442 #[cfg(feature = "WKNavigation")]
443 #[unsafe(method(goForward))]
448 #[unsafe(method_family = none)]
449 pub unsafe fn goForward(&self) -> Option<Retained<WKNavigation>>;
450
451 #[cfg(feature = "WKNavigation")]
452 #[unsafe(method(reload))]
456 #[unsafe(method_family = none)]
457 pub unsafe fn reload(&self) -> Option<Retained<WKNavigation>>;
458
459 #[cfg(feature = "WKNavigation")]
460 #[unsafe(method(reloadFromOrigin))]
465 #[unsafe(method_family = none)]
466 pub unsafe fn reloadFromOrigin(&self) -> Option<Retained<WKNavigation>>;
467
468 #[unsafe(method(stopLoading))]
470 #[unsafe(method_family = none)]
471 pub unsafe fn stopLoading(&self);
472
473 #[cfg(feature = "block2")]
474 #[unsafe(method(evaluateJavaScript:completionHandler:))]
475 #[unsafe(method_family = none)]
476 pub unsafe fn evaluateJavaScript_completionHandler(
477 &self,
478 java_script_string: &NSString,
479 completion_handler: Option<&block2::DynBlock<dyn Fn(*mut AnyObject, *mut NSError)>>,
480 );
481
482 #[cfg(all(
483 feature = "WKContentWorld",
484 feature = "WKFrameInfo",
485 feature = "block2"
486 ))]
487 #[unsafe(method(evaluateJavaScript:inFrame:inContentWorld:completionHandler:))]
488 #[unsafe(method_family = none)]
489 pub unsafe fn evaluateJavaScript_inFrame_inContentWorld_completionHandler(
490 &self,
491 java_script_string: &NSString,
492 frame: Option<&WKFrameInfo>,
493 content_world: &WKContentWorld,
494 completion_handler: Option<&block2::DynBlock<dyn Fn(*mut AnyObject, *mut NSError)>>,
495 );
496
497 #[cfg(all(
498 feature = "WKContentWorld",
499 feature = "WKFrameInfo",
500 feature = "block2"
501 ))]
502 #[unsafe(method(callAsyncJavaScript:arguments:inFrame:inContentWorld:completionHandler:))]
503 #[unsafe(method_family = none)]
504 pub unsafe fn callAsyncJavaScript_arguments_inFrame_inContentWorld_completionHandler(
505 &self,
506 function_body: &NSString,
507 arguments: Option<&NSDictionary<NSString, AnyObject>>,
508 frame: Option<&WKFrameInfo>,
509 content_world: &WKContentWorld,
510 completion_handler: Option<&block2::DynBlock<dyn Fn(*mut AnyObject, *mut NSError)>>,
511 );
512
513 #[cfg(feature = "block2")]
514 #[unsafe(method(closeAllMediaPresentationsWithCompletionHandler:))]
518 #[unsafe(method_family = none)]
519 pub unsafe fn closeAllMediaPresentationsWithCompletionHandler(
520 &self,
521 completion_handler: Option<&block2::DynBlock<dyn Fn()>>,
522 );
523
524 #[deprecated]
525 #[unsafe(method(closeAllMediaPresentations))]
526 #[unsafe(method_family = none)]
527 pub unsafe fn closeAllMediaPresentations(&self);
528
529 #[cfg(feature = "block2")]
530 #[unsafe(method(pauseAllMediaPlaybackWithCompletionHandler:))]
534 #[unsafe(method_family = none)]
535 pub unsafe fn pauseAllMediaPlaybackWithCompletionHandler(
536 &self,
537 completion_handler: Option<&block2::DynBlock<dyn Fn()>>,
538 );
539
540 #[cfg(feature = "block2")]
541 #[deprecated]
542 #[unsafe(method(pauseAllMediaPlayback:))]
543 #[unsafe(method_family = none)]
544 pub unsafe fn pauseAllMediaPlayback(
545 &self,
546 completion_handler: Option<&block2::DynBlock<dyn Fn()>>,
547 );
548
549 #[cfg(feature = "block2")]
550 #[unsafe(method(setAllMediaPlaybackSuspended:completionHandler:))]
556 #[unsafe(method_family = none)]
557 pub unsafe fn setAllMediaPlaybackSuspended_completionHandler(
558 &self,
559 suspended: bool,
560 completion_handler: Option<&block2::DynBlock<dyn Fn()>>,
561 );
562
563 #[cfg(feature = "block2")]
564 #[deprecated]
565 #[unsafe(method(resumeAllMediaPlayback:))]
566 #[unsafe(method_family = none)]
567 pub unsafe fn resumeAllMediaPlayback(
568 &self,
569 completion_handler: Option<&block2::DynBlock<dyn Fn()>>,
570 );
571
572 #[cfg(feature = "block2")]
573 #[deprecated]
574 #[unsafe(method(suspendAllMediaPlayback:))]
575 #[unsafe(method_family = none)]
576 pub unsafe fn suspendAllMediaPlayback(
577 &self,
578 completion_handler: Option<&block2::DynBlock<dyn Fn()>>,
579 );
580
581 #[cfg(feature = "block2")]
582 #[unsafe(method(requestMediaPlaybackStateWithCompletionHandler:))]
591 #[unsafe(method_family = none)]
592 pub unsafe fn requestMediaPlaybackStateWithCompletionHandler(
593 &self,
594 completion_handler: &block2::DynBlock<dyn Fn(WKMediaPlaybackState)>,
595 );
596
597 #[cfg(feature = "block2")]
598 #[deprecated]
599 #[unsafe(method(requestMediaPlaybackState:))]
600 #[unsafe(method_family = none)]
601 pub unsafe fn requestMediaPlaybackState(
602 &self,
603 completion_handler: &block2::DynBlock<dyn Fn(WKMediaPlaybackState)>,
604 );
605
606 #[unsafe(method(cameraCaptureState))]
616 #[unsafe(method_family = none)]
617 pub unsafe fn cameraCaptureState(&self) -> WKMediaCaptureState;
618
619 #[unsafe(method(microphoneCaptureState))]
629 #[unsafe(method_family = none)]
630 pub unsafe fn microphoneCaptureState(&self) -> WKMediaCaptureState;
631
632 #[cfg(feature = "block2")]
633 #[unsafe(method(setCameraCaptureState:completionHandler:))]
643 #[unsafe(method_family = none)]
644 pub unsafe fn setCameraCaptureState_completionHandler(
645 &self,
646 state: WKMediaCaptureState,
647 completion_handler: Option<&block2::DynBlock<dyn Fn()>>,
648 );
649
650 #[cfg(feature = "block2")]
651 #[unsafe(method(setMicrophoneCaptureState:completionHandler:))]
661 #[unsafe(method_family = none)]
662 pub unsafe fn setMicrophoneCaptureState_completionHandler(
663 &self,
664 state: WKMediaCaptureState,
665 completion_handler: Option<&block2::DynBlock<dyn Fn()>>,
666 );
667
668 #[cfg(all(feature = "WKSnapshotConfiguration", feature = "block2"))]
669 #[unsafe(method(takeSnapshotWithConfiguration:completionHandler:))]
670 #[unsafe(method_family = none)]
671 pub unsafe fn takeSnapshotWithConfiguration_completionHandler(
672 &self,
673 snapshot_configuration: Option<&WKSnapshotConfiguration>,
674 completion_handler: &block2::DynBlock<dyn Fn(*mut NSImage, *mut NSError)>,
675 );
676
677 #[cfg(all(feature = "WKPDFConfiguration", feature = "block2"))]
678 #[unsafe(method(createPDFWithConfiguration:completionHandler:))]
689 #[unsafe(method_family = none)]
690 pub unsafe fn createPDFWithConfiguration_completionHandler(
691 &self,
692 pdf_configuration: Option<&WKPDFConfiguration>,
693 completion_handler: &block2::DynBlock<dyn Fn(*mut NSData, *mut NSError)>,
694 );
695
696 #[cfg(feature = "block2")]
697 #[unsafe(method(createWebArchiveDataWithCompletionHandler:))]
698 #[unsafe(method_family = none)]
699 pub unsafe fn createWebArchiveDataWithCompletionHandler(
700 &self,
701 completion_handler: &block2::DynBlock<dyn Fn(*mut NSData, *mut NSError)>,
702 );
703
704 #[unsafe(method(allowsBackForwardNavigationGestures))]
709 #[unsafe(method_family = none)]
710 pub unsafe fn allowsBackForwardNavigationGestures(&self) -> bool;
711
712 #[unsafe(method(setAllowsBackForwardNavigationGestures:))]
714 #[unsafe(method_family = none)]
715 pub unsafe fn setAllowsBackForwardNavigationGestures(
716 &self,
717 allows_back_forward_navigation_gestures: bool,
718 );
719
720 #[unsafe(method(customUserAgent))]
722 #[unsafe(method_family = none)]
723 pub unsafe fn customUserAgent(&self) -> Option<Retained<NSString>>;
724
725 #[unsafe(method(setCustomUserAgent:))]
727 #[unsafe(method_family = none)]
728 pub unsafe fn setCustomUserAgent(&self, custom_user_agent: Option<&NSString>);
729
730 #[unsafe(method(allowsLinkPreview))]
735 #[unsafe(method_family = none)]
736 pub unsafe fn allowsLinkPreview(&self) -> bool;
737
738 #[unsafe(method(setAllowsLinkPreview:))]
740 #[unsafe(method_family = none)]
741 pub unsafe fn setAllowsLinkPreview(&self, allows_link_preview: bool);
742
743 #[unsafe(method(allowsMagnification))]
744 #[unsafe(method_family = none)]
745 pub unsafe fn allowsMagnification(&self) -> bool;
746
747 #[unsafe(method(setAllowsMagnification:))]
749 #[unsafe(method_family = none)]
750 pub unsafe fn setAllowsMagnification(&self, allows_magnification: bool);
751
752 #[cfg(feature = "objc2-core-foundation")]
753 #[unsafe(method(magnification))]
754 #[unsafe(method_family = none)]
755 pub unsafe fn magnification(&self) -> CGFloat;
756
757 #[cfg(feature = "objc2-core-foundation")]
758 #[unsafe(method(setMagnification:))]
760 #[unsafe(method_family = none)]
761 pub unsafe fn setMagnification(&self, magnification: CGFloat);
762
763 #[cfg(feature = "objc2-core-foundation")]
764 #[unsafe(method(setMagnification:centeredAtPoint:))]
765 #[unsafe(method_family = none)]
766 pub unsafe fn setMagnification_centeredAtPoint(
767 &self,
768 magnification: CGFloat,
769 point: CGPoint,
770 );
771
772 #[cfg(feature = "objc2-core-foundation")]
773 #[unsafe(method(pageZoom))]
774 #[unsafe(method_family = none)]
775 pub unsafe fn pageZoom(&self) -> CGFloat;
776
777 #[cfg(feature = "objc2-core-foundation")]
778 #[unsafe(method(setPageZoom:))]
780 #[unsafe(method_family = none)]
781 pub unsafe fn setPageZoom(&self, page_zoom: CGFloat);
782
783 #[cfg(all(
784 feature = "WKFindConfiguration",
785 feature = "WKFindResult",
786 feature = "block2"
787 ))]
788 #[unsafe(method(findString:withConfiguration:completionHandler:))]
789 #[unsafe(method_family = none)]
790 pub unsafe fn findString_withConfiguration_completionHandler(
791 &self,
792 string: &NSString,
793 configuration: Option<&WKFindConfiguration>,
794 completion_handler: &block2::DynBlock<dyn Fn(NonNull<WKFindResult>)>,
795 );
796
797 #[unsafe(method(handlesURLScheme:))]
798 #[unsafe(method_family = none)]
799 pub unsafe fn handlesURLScheme(url_scheme: &NSString, mtm: MainThreadMarker) -> bool;
800
801 #[cfg(all(feature = "WKDownload", feature = "block2"))]
802 #[unsafe(method(startDownloadUsingRequest:completionHandler:))]
803 #[unsafe(method_family = none)]
804 pub unsafe fn startDownloadUsingRequest_completionHandler(
805 &self,
806 request: &NSURLRequest,
807 completion_handler: &block2::DynBlock<dyn Fn(NonNull<WKDownload>)>,
808 );
809
810 #[cfg(all(feature = "WKDownload", feature = "block2"))]
811 #[unsafe(method(resumeDownloadFromResumeData:completionHandler:))]
812 #[unsafe(method_family = none)]
813 pub unsafe fn resumeDownloadFromResumeData_completionHandler(
814 &self,
815 resume_data: &NSData,
816 completion_handler: &block2::DynBlock<dyn Fn(NonNull<WKDownload>)>,
817 );
818
819 #[unsafe(method(mediaType))]
820 #[unsafe(method_family = none)]
821 pub unsafe fn mediaType(&self) -> Option<Retained<NSString>>;
822
823 #[unsafe(method(setMediaType:))]
825 #[unsafe(method_family = none)]
826 pub unsafe fn setMediaType(&self, media_type: Option<&NSString>);
827
828 #[unsafe(method(interactionState))]
829 #[unsafe(method_family = none)]
830 pub unsafe fn interactionState(&self) -> Option<Retained<AnyObject>>;
831
832 #[unsafe(method(setInteractionState:))]
834 #[unsafe(method_family = none)]
835 pub unsafe fn setInteractionState(&self, interaction_state: Option<&AnyObject>);
836
837 #[cfg(feature = "WKNavigation")]
838 #[unsafe(method(loadSimulatedRequest:response:responseData:))]
852 #[unsafe(method_family = none)]
853 pub unsafe fn loadSimulatedRequest_response_responseData(
854 &self,
855 request: &NSURLRequest,
856 response: &NSURLResponse,
857 data: &NSData,
858 ) -> Retained<WKNavigation>;
859
860 #[cfg(feature = "WKNavigation")]
861 #[deprecated]
862 #[unsafe(method(loadSimulatedRequest:withResponse:responseData:))]
863 #[unsafe(method_family = none)]
864 pub unsafe fn loadSimulatedRequest_withResponse_responseData(
865 &self,
866 request: &NSURLRequest,
867 response: &NSURLResponse,
868 data: &NSData,
869 ) -> Retained<WKNavigation>;
870
871 #[cfg(feature = "WKNavigation")]
872 #[unsafe(method(loadFileRequest:allowingReadAccessToURL:))]
884 #[unsafe(method_family = none)]
885 pub unsafe fn loadFileRequest_allowingReadAccessToURL(
886 &self,
887 request: &NSURLRequest,
888 read_access_url: &NSURL,
889 ) -> Retained<WKNavigation>;
890
891 #[cfg(feature = "WKNavigation")]
892 #[unsafe(method(loadSimulatedRequest:responseHTMLString:))]
904 #[unsafe(method_family = none)]
905 pub unsafe fn loadSimulatedRequest_responseHTMLString(
906 &self,
907 request: &NSURLRequest,
908 string: &NSString,
909 ) -> Retained<WKNavigation>;
910
911 #[cfg(feature = "WKNavigation")]
912 #[deprecated]
913 #[unsafe(method(loadSimulatedRequest:withResponseHTMLString:))]
914 #[unsafe(method_family = none)]
915 pub unsafe fn loadSimulatedRequest_withResponseHTMLString(
916 &self,
917 request: &NSURLRequest,
918 string: &NSString,
919 ) -> Retained<WKNavigation>;
920
921 #[unsafe(method(printOperationWithPrintInfo:))]
922 #[unsafe(method_family = none)]
923 pub unsafe fn printOperationWithPrintInfo(
924 &self,
925 print_info: &NSPrintInfo,
926 ) -> Retained<NSPrintOperation>;
927
928 #[unsafe(method(themeColor))]
929 #[unsafe(method_family = none)]
930 pub unsafe fn themeColor(&self) -> Option<Retained<NSColor>>;
931
932 #[unsafe(method(underPageBackgroundColor))]
933 #[unsafe(method_family = none)]
934 pub unsafe fn underPageBackgroundColor(&self) -> Retained<NSColor>;
935
936 #[unsafe(method(setUnderPageBackgroundColor:))]
938 #[unsafe(method_family = none)]
939 pub unsafe fn setUnderPageBackgroundColor(
940 &self,
941 under_page_background_color: Option<&NSColor>,
942 );
943
944 #[unsafe(method(fullscreenState))]
958 #[unsafe(method_family = none)]
959 pub unsafe fn fullscreenState(&self) -> WKFullscreenState;
960
961 #[unsafe(method(minimumViewportInset))]
962 #[unsafe(method_family = none)]
963 pub unsafe fn minimumViewportInset(&self) -> NSEdgeInsets;
964
965 #[unsafe(method(maximumViewportInset))]
966 #[unsafe(method_family = none)]
967 pub unsafe fn maximumViewportInset(&self) -> NSEdgeInsets;
968
969 #[unsafe(method(setMinimumViewportInset:maximumViewportInset:))]
970 #[unsafe(method_family = none)]
971 pub unsafe fn setMinimumViewportInset_maximumViewportInset(
972 &self,
973 minimum_viewport_inset: NSEdgeInsets,
974 maximum_viewport_inset: NSEdgeInsets,
975 );
976
977 #[unsafe(method(isInspectable))]
987 #[unsafe(method_family = none)]
988 pub unsafe fn isInspectable(&self) -> bool;
989
990 #[unsafe(method(setInspectable:))]
992 #[unsafe(method_family = none)]
993 pub unsafe fn setInspectable(&self, inspectable: bool);
994
995 #[unsafe(method(isWritingToolsActive))]
1004 #[unsafe(method_family = none)]
1005 pub unsafe fn isWritingToolsActive(&self) -> bool;
1006 );
1007}
1008
1009#[cfg(feature = "objc2-app-kit")]
1011#[cfg(target_os = "macos")]
1012impl WKWebView {
1013 extern_methods!(
1014 #[unsafe(method(initWithFrame:))]
1015 #[unsafe(method_family = init)]
1016 pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
1017 );
1018}
1019
1020#[cfg(feature = "objc2-app-kit")]
1022#[cfg(target_os = "macos")]
1023impl WKWebView {
1024 extern_methods!(
1025 #[unsafe(method(init))]
1026 #[unsafe(method_family = init)]
1027 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1028 );
1029}
1030
1031#[cfg(feature = "objc2-app-kit")]
1033#[cfg(target_os = "macos")]
1034impl WKWebView {
1035 extern_methods!(
1036 #[unsafe(method(new))]
1037 #[unsafe(method_family = new)]
1038 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
1039 );
1040}
1041
1042#[cfg(feature = "objc2-app-kit")]
1044#[cfg(target_os = "macos")]
1045impl WKWebView {
1046 extern_methods!(
1047 #[unsafe(method(goBack:))]
1052 #[unsafe(method_family = none)]
1053 pub unsafe fn goBack_(&self, sender: Option<&AnyObject>);
1054
1055 #[unsafe(method(goForward:))]
1060 #[unsafe(method_family = none)]
1061 pub unsafe fn goForward_(&self, sender: Option<&AnyObject>);
1062
1063 #[unsafe(method(reload:))]
1067 #[unsafe(method_family = none)]
1068 pub unsafe fn reload_(&self, sender: Option<&AnyObject>);
1069
1070 #[unsafe(method(reloadFromOrigin:))]
1075 #[unsafe(method_family = none)]
1076 pub unsafe fn reloadFromOrigin_(&self, sender: Option<&AnyObject>);
1077
1078 #[unsafe(method(stopLoading:))]
1083 #[unsafe(method_family = none)]
1084 pub unsafe fn stopLoading_(&self, sender: Option<&AnyObject>);
1085 );
1086}
1087
1088#[cfg(feature = "objc2-app-kit")]
1089#[cfg(target_os = "macos")]
1090extern_conformance!(
1091 unsafe impl NSUserInterfaceValidations for WKWebView {}
1092);
1093
1094#[cfg(feature = "objc2-app-kit")]
1096#[cfg(target_os = "macos")]
1097impl WKWebView {
1098 extern_methods!();
1099}
1100
1101#[cfg(feature = "objc2-app-kit")]
1102#[cfg(target_os = "macos")]
1103extern_conformance!(
1104 unsafe impl NSTextFinderClient for WKWebView {}
1105);
1106
1107#[cfg(feature = "objc2-app-kit")]
1109#[cfg(target_os = "macos")]
1110impl WKWebView {
1111 extern_methods!(
1112 #[deprecated]
1113 #[unsafe(method(certificateChain))]
1114 #[unsafe(method_family = none)]
1115 pub unsafe fn certificateChain(&self) -> Retained<NSArray>;
1116 );
1117}