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
87#[repr(transparent)]
90#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
91pub struct WKWebViewDataType(pub NSUInteger);
92bitflags::bitflags! {
93 impl WKWebViewDataType: NSUInteger {
94 #[doc(alias = "WKWebViewDataTypeSessionStorage")]
95 const SessionStorage = 1<<0;
96 }
97}
98
99unsafe impl Encode for WKWebViewDataType {
100 const ENCODING: Encoding = NSUInteger::ENCODING;
101}
102
103unsafe impl RefEncode for WKWebViewDataType {
104 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
105}
106
107extern_class!(
108 #[unsafe(super(NSView, NSResponder, NSObject))]
110 #[thread_kind = MainThreadOnly]
111 #[derive(Debug, PartialEq, Eq, Hash)]
112 #[cfg(feature = "objc2-app-kit")]
113 #[cfg(target_os = "macos")]
114 pub struct WKWebView;
115);
116
117#[cfg(feature = "objc2-app-kit")]
118#[cfg(target_os = "macos")]
119extern_conformance!(
120 unsafe impl NSAccessibility for WKWebView {}
121);
122
123#[cfg(feature = "objc2-app-kit")]
124#[cfg(target_os = "macos")]
125extern_conformance!(
126 unsafe impl NSAccessibilityElementProtocol for WKWebView {}
127);
128
129#[cfg(feature = "objc2-app-kit")]
130#[cfg(target_os = "macos")]
131extern_conformance!(
132 unsafe impl NSAnimatablePropertyContainer for WKWebView {}
133);
134
135#[cfg(feature = "objc2-app-kit")]
136#[cfg(target_os = "macos")]
137extern_conformance!(
138 unsafe impl NSAppearanceCustomization for WKWebView {}
139);
140
141#[cfg(feature = "objc2-app-kit")]
142#[cfg(target_os = "macos")]
143extern_conformance!(
144 unsafe impl NSCoding for WKWebView {}
145);
146
147#[cfg(feature = "objc2-app-kit")]
148#[cfg(target_os = "macos")]
149extern_conformance!(
150 unsafe impl NSDraggingDestination for WKWebView {}
151);
152
153#[cfg(feature = "objc2-app-kit")]
154#[cfg(target_os = "macos")]
155extern_conformance!(
156 unsafe impl NSObjectProtocol for WKWebView {}
157);
158
159#[cfg(feature = "objc2-app-kit")]
160#[cfg(target_os = "macos")]
161extern_conformance!(
162 unsafe impl NSUserInterfaceItemIdentification for WKWebView {}
163);
164
165#[cfg(feature = "objc2-app-kit")]
166#[cfg(target_os = "macos")]
167impl WKWebView {
168 extern_methods!(
169 #[cfg(feature = "WKWebViewConfiguration")]
170 #[unsafe(method(configuration))]
173 #[unsafe(method_family = none)]
174 pub unsafe fn configuration(&self) -> Retained<WKWebViewConfiguration>;
175
176 #[cfg(feature = "WKNavigationDelegate")]
177 #[unsafe(method(navigationDelegate))]
179 #[unsafe(method_family = none)]
180 pub unsafe fn navigationDelegate(
181 &self,
182 ) -> Option<Retained<ProtocolObject<dyn WKNavigationDelegate>>>;
183
184 #[cfg(feature = "WKNavigationDelegate")]
185 #[unsafe(method(setNavigationDelegate:))]
189 #[unsafe(method_family = none)]
190 pub unsafe fn setNavigationDelegate(
191 &self,
192 navigation_delegate: Option<&ProtocolObject<dyn WKNavigationDelegate>>,
193 );
194
195 #[cfg(feature = "WKUIDelegate")]
196 #[unsafe(method(UIDelegate))]
198 #[unsafe(method_family = none)]
199 pub unsafe fn UIDelegate(&self) -> Option<Retained<ProtocolObject<dyn WKUIDelegate>>>;
200
201 #[cfg(feature = "WKUIDelegate")]
202 #[unsafe(method(setUIDelegate:))]
206 #[unsafe(method_family = none)]
207 pub unsafe fn setUIDelegate(&self, ui_delegate: Option<&ProtocolObject<dyn WKUIDelegate>>);
208
209 #[cfg(feature = "WKBackForwardList")]
210 #[unsafe(method(backForwardList))]
212 #[unsafe(method_family = none)]
213 pub unsafe fn backForwardList(&self) -> Retained<WKBackForwardList>;
214
215 #[cfg(all(feature = "WKWebViewConfiguration", feature = "objc2-core-foundation"))]
216 #[unsafe(method(initWithFrame:configuration:))]
237 #[unsafe(method_family = init)]
238 pub unsafe fn initWithFrame_configuration(
239 this: Allocated<Self>,
240 frame: CGRect,
241 configuration: &WKWebViewConfiguration,
242 ) -> Retained<Self>;
243
244 #[unsafe(method(initWithCoder:))]
248 #[unsafe(method_family = init)]
249 pub unsafe fn initWithCoder(
250 this: Allocated<Self>,
251 coder: &NSCoder,
252 ) -> Option<Retained<Self>>;
253
254 #[cfg(feature = "WKNavigation")]
255 #[unsafe(method(loadRequest:))]
261 #[unsafe(method_family = none)]
262 pub unsafe fn loadRequest(&self, request: &NSURLRequest) -> Option<Retained<WKNavigation>>;
263
264 #[cfg(feature = "WKNavigation")]
265 #[unsafe(method(loadFileURL:allowingReadAccessToURL:))]
276 #[unsafe(method_family = none)]
277 pub unsafe fn loadFileURL_allowingReadAccessToURL(
278 &self,
279 url: &NSURL,
280 read_access_url: &NSURL,
281 ) -> Option<Retained<WKNavigation>>;
282
283 #[cfg(feature = "WKNavigation")]
284 #[unsafe(method(loadHTMLString:baseURL:))]
292 #[unsafe(method_family = none)]
293 pub unsafe fn loadHTMLString_baseURL(
294 &self,
295 string: &NSString,
296 base_url: Option<&NSURL>,
297 ) -> Option<Retained<WKNavigation>>;
298
299 #[cfg(feature = "WKNavigation")]
300 #[unsafe(method(loadData:MIMEType:characterEncodingName:baseURL:))]
312 #[unsafe(method_family = none)]
313 pub unsafe fn loadData_MIMEType_characterEncodingName_baseURL(
314 &self,
315 data: &NSData,
316 mime_type: &NSString,
317 character_encoding_name: &NSString,
318 base_url: &NSURL,
319 ) -> Option<Retained<WKNavigation>>;
320
321 #[cfg(all(feature = "WKBackForwardListItem", feature = "WKNavigation"))]
322 #[unsafe(method(goToBackForwardListItem:))]
333 #[unsafe(method_family = none)]
334 pub unsafe fn goToBackForwardListItem(
335 &self,
336 item: &WKBackForwardListItem,
337 ) -> Option<Retained<WKNavigation>>;
338
339 #[unsafe(method(title))]
349 #[unsafe(method_family = none)]
350 pub unsafe fn title(&self) -> Option<Retained<NSString>>;
351
352 #[unsafe(method(URL))]
364 #[unsafe(method_family = none)]
365 pub unsafe fn URL(&self) -> Option<Retained<NSURL>>;
366
367 #[unsafe(method(isLoading))]
378 #[unsafe(method_family = none)]
379 pub unsafe fn isLoading(&self) -> bool;
380
381 #[unsafe(method(estimatedProgress))]
395 #[unsafe(method_family = none)]
396 pub unsafe fn estimatedProgress(&self) -> c_double;
397
398 #[unsafe(method(hasOnlySecureContent))]
409 #[unsafe(method_family = none)]
410 pub unsafe fn hasOnlySecureContent(&self) -> bool;
411
412 #[cfg(feature = "objc2-security")]
413 #[unsafe(method(serverTrust))]
423 #[unsafe(method_family = none)]
424 pub unsafe fn serverTrust(&self) -> Option<Retained<SecTrust>>;
425
426 #[unsafe(method(canGoBack))]
439 #[unsafe(method_family = none)]
440 pub unsafe fn canGoBack(&self) -> bool;
441
442 #[unsafe(method(canGoForward))]
455 #[unsafe(method_family = none)]
456 pub unsafe fn canGoForward(&self) -> bool;
457
458 #[cfg(feature = "WKNavigation")]
459 #[unsafe(method(goBack))]
464 #[unsafe(method_family = none)]
465 pub unsafe fn goBack(&self) -> Option<Retained<WKNavigation>>;
466
467 #[cfg(feature = "WKNavigation")]
468 #[unsafe(method(goForward))]
473 #[unsafe(method_family = none)]
474 pub unsafe fn goForward(&self) -> Option<Retained<WKNavigation>>;
475
476 #[cfg(feature = "WKNavigation")]
477 #[unsafe(method(reload))]
481 #[unsafe(method_family = none)]
482 pub unsafe fn reload(&self) -> Option<Retained<WKNavigation>>;
483
484 #[cfg(feature = "WKNavigation")]
485 #[unsafe(method(reloadFromOrigin))]
490 #[unsafe(method_family = none)]
491 pub unsafe fn reloadFromOrigin(&self) -> Option<Retained<WKNavigation>>;
492
493 #[unsafe(method(stopLoading))]
495 #[unsafe(method_family = none)]
496 pub unsafe fn stopLoading(&self);
497
498 #[cfg(feature = "block2")]
499 #[unsafe(method(evaluateJavaScript:completionHandler:))]
500 #[unsafe(method_family = none)]
501 pub unsafe fn evaluateJavaScript_completionHandler(
502 &self,
503 java_script_string: &NSString,
504 completion_handler: Option<&block2::DynBlock<dyn Fn(*mut AnyObject, *mut NSError)>>,
505 );
506
507 #[cfg(all(
508 feature = "WKContentWorld",
509 feature = "WKFrameInfo",
510 feature = "block2"
511 ))]
512 #[unsafe(method(evaluateJavaScript:inFrame:inContentWorld:completionHandler:))]
513 #[unsafe(method_family = none)]
514 pub unsafe fn evaluateJavaScript_inFrame_inContentWorld_completionHandler(
515 &self,
516 java_script_string: &NSString,
517 frame: Option<&WKFrameInfo>,
518 content_world: &WKContentWorld,
519 completion_handler: Option<&block2::DynBlock<dyn Fn(*mut AnyObject, *mut NSError)>>,
520 );
521
522 #[cfg(all(
523 feature = "WKContentWorld",
524 feature = "WKFrameInfo",
525 feature = "block2"
526 ))]
527 #[unsafe(method(callAsyncJavaScript:arguments:inFrame:inContentWorld:completionHandler:))]
531 #[unsafe(method_family = none)]
532 pub unsafe fn callAsyncJavaScript_arguments_inFrame_inContentWorld_completionHandler(
533 &self,
534 function_body: &NSString,
535 arguments: Option<&NSDictionary<NSString, AnyObject>>,
536 frame: Option<&WKFrameInfo>,
537 content_world: &WKContentWorld,
538 completion_handler: Option<&block2::DynBlock<dyn Fn(*mut AnyObject, *mut NSError)>>,
539 );
540
541 #[cfg(feature = "block2")]
542 #[unsafe(method(closeAllMediaPresentationsWithCompletionHandler:))]
546 #[unsafe(method_family = none)]
547 pub unsafe fn closeAllMediaPresentationsWithCompletionHandler(
548 &self,
549 completion_handler: Option<&block2::DynBlock<dyn Fn()>>,
550 );
551
552 #[deprecated]
553 #[unsafe(method(closeAllMediaPresentations))]
554 #[unsafe(method_family = none)]
555 pub unsafe fn closeAllMediaPresentations(&self);
556
557 #[cfg(feature = "block2")]
558 #[unsafe(method(pauseAllMediaPlaybackWithCompletionHandler:))]
562 #[unsafe(method_family = none)]
563 pub unsafe fn pauseAllMediaPlaybackWithCompletionHandler(
564 &self,
565 completion_handler: Option<&block2::DynBlock<dyn Fn()>>,
566 );
567
568 #[cfg(feature = "block2")]
569 #[deprecated]
570 #[unsafe(method(pauseAllMediaPlayback:))]
571 #[unsafe(method_family = none)]
572 pub unsafe fn pauseAllMediaPlayback(
573 &self,
574 completion_handler: Option<&block2::DynBlock<dyn Fn()>>,
575 );
576
577 #[cfg(feature = "block2")]
578 #[unsafe(method(setAllMediaPlaybackSuspended:completionHandler:))]
584 #[unsafe(method_family = none)]
585 pub unsafe fn setAllMediaPlaybackSuspended_completionHandler(
586 &self,
587 suspended: bool,
588 completion_handler: Option<&block2::DynBlock<dyn Fn()>>,
589 );
590
591 #[cfg(feature = "block2")]
592 #[deprecated]
593 #[unsafe(method(resumeAllMediaPlayback:))]
594 #[unsafe(method_family = none)]
595 pub unsafe fn resumeAllMediaPlayback(
596 &self,
597 completion_handler: Option<&block2::DynBlock<dyn Fn()>>,
598 );
599
600 #[cfg(feature = "block2")]
601 #[deprecated]
602 #[unsafe(method(suspendAllMediaPlayback:))]
603 #[unsafe(method_family = none)]
604 pub unsafe fn suspendAllMediaPlayback(
605 &self,
606 completion_handler: Option<&block2::DynBlock<dyn Fn()>>,
607 );
608
609 #[cfg(feature = "block2")]
610 #[unsafe(method(requestMediaPlaybackStateWithCompletionHandler:))]
619 #[unsafe(method_family = none)]
620 pub unsafe fn requestMediaPlaybackStateWithCompletionHandler(
621 &self,
622 completion_handler: &block2::DynBlock<dyn Fn(WKMediaPlaybackState)>,
623 );
624
625 #[cfg(feature = "block2")]
626 #[deprecated]
627 #[unsafe(method(requestMediaPlaybackState:))]
628 #[unsafe(method_family = none)]
629 pub unsafe fn requestMediaPlaybackState(
630 &self,
631 completion_handler: &block2::DynBlock<dyn Fn(WKMediaPlaybackState)>,
632 );
633
634 #[unsafe(method(cameraCaptureState))]
644 #[unsafe(method_family = none)]
645 pub unsafe fn cameraCaptureState(&self) -> WKMediaCaptureState;
646
647 #[unsafe(method(microphoneCaptureState))]
657 #[unsafe(method_family = none)]
658 pub unsafe fn microphoneCaptureState(&self) -> WKMediaCaptureState;
659
660 #[cfg(feature = "block2")]
661 #[unsafe(method(setCameraCaptureState:completionHandler:))]
671 #[unsafe(method_family = none)]
672 pub unsafe fn setCameraCaptureState_completionHandler(
673 &self,
674 state: WKMediaCaptureState,
675 completion_handler: Option<&block2::DynBlock<dyn Fn()>>,
676 );
677
678 #[cfg(feature = "block2")]
679 #[unsafe(method(setMicrophoneCaptureState:completionHandler:))]
689 #[unsafe(method_family = none)]
690 pub unsafe fn setMicrophoneCaptureState_completionHandler(
691 &self,
692 state: WKMediaCaptureState,
693 completion_handler: Option<&block2::DynBlock<dyn Fn()>>,
694 );
695
696 #[cfg(all(feature = "WKSnapshotConfiguration", feature = "block2"))]
697 #[unsafe(method(takeSnapshotWithConfiguration:completionHandler:))]
698 #[unsafe(method_family = none)]
699 pub unsafe fn takeSnapshotWithConfiguration_completionHandler(
700 &self,
701 snapshot_configuration: Option<&WKSnapshotConfiguration>,
702 completion_handler: &block2::DynBlock<dyn Fn(*mut NSImage, *mut NSError)>,
703 );
704
705 #[cfg(all(feature = "WKPDFConfiguration", feature = "block2"))]
706 #[unsafe(method(createPDFWithConfiguration:completionHandler:))]
717 #[unsafe(method_family = none)]
718 pub unsafe fn createPDFWithConfiguration_completionHandler(
719 &self,
720 pdf_configuration: Option<&WKPDFConfiguration>,
721 completion_handler: &block2::DynBlock<dyn Fn(*mut NSData, *mut NSError)>,
722 );
723
724 #[cfg(feature = "block2")]
725 #[unsafe(method(createWebArchiveDataWithCompletionHandler:))]
726 #[unsafe(method_family = none)]
727 pub unsafe fn createWebArchiveDataWithCompletionHandler(
728 &self,
729 completion_handler: &block2::DynBlock<dyn Fn(*mut NSData, *mut NSError)>,
730 );
731
732 #[unsafe(method(allowsBackForwardNavigationGestures))]
737 #[unsafe(method_family = none)]
738 pub unsafe fn allowsBackForwardNavigationGestures(&self) -> bool;
739
740 #[unsafe(method(setAllowsBackForwardNavigationGestures:))]
742 #[unsafe(method_family = none)]
743 pub unsafe fn setAllowsBackForwardNavigationGestures(
744 &self,
745 allows_back_forward_navigation_gestures: bool,
746 );
747
748 #[unsafe(method(customUserAgent))]
750 #[unsafe(method_family = none)]
751 pub unsafe fn customUserAgent(&self) -> Option<Retained<NSString>>;
752
753 #[unsafe(method(setCustomUserAgent:))]
757 #[unsafe(method_family = none)]
758 pub unsafe fn setCustomUserAgent(&self, custom_user_agent: Option<&NSString>);
759
760 #[unsafe(method(allowsLinkPreview))]
765 #[unsafe(method_family = none)]
766 pub unsafe fn allowsLinkPreview(&self) -> bool;
767
768 #[unsafe(method(setAllowsLinkPreview:))]
770 #[unsafe(method_family = none)]
771 pub unsafe fn setAllowsLinkPreview(&self, allows_link_preview: bool);
772
773 #[unsafe(method(allowsMagnification))]
774 #[unsafe(method_family = none)]
775 pub unsafe fn allowsMagnification(&self) -> bool;
776
777 #[unsafe(method(setAllowsMagnification:))]
779 #[unsafe(method_family = none)]
780 pub unsafe fn setAllowsMagnification(&self, allows_magnification: bool);
781
782 #[cfg(feature = "objc2-core-foundation")]
783 #[unsafe(method(magnification))]
784 #[unsafe(method_family = none)]
785 pub unsafe fn magnification(&self) -> CGFloat;
786
787 #[cfg(feature = "objc2-core-foundation")]
788 #[unsafe(method(setMagnification:))]
790 #[unsafe(method_family = none)]
791 pub unsafe fn setMagnification(&self, magnification: CGFloat);
792
793 #[cfg(feature = "objc2-core-foundation")]
794 #[unsafe(method(setMagnification:centeredAtPoint:))]
795 #[unsafe(method_family = none)]
796 pub unsafe fn setMagnification_centeredAtPoint(
797 &self,
798 magnification: CGFloat,
799 point: CGPoint,
800 );
801
802 #[cfg(feature = "objc2-core-foundation")]
803 #[unsafe(method(pageZoom))]
804 #[unsafe(method_family = none)]
805 pub unsafe fn pageZoom(&self) -> CGFloat;
806
807 #[cfg(feature = "objc2-core-foundation")]
808 #[unsafe(method(setPageZoom:))]
810 #[unsafe(method_family = none)]
811 pub unsafe fn setPageZoom(&self, page_zoom: CGFloat);
812
813 #[cfg(all(
814 feature = "WKFindConfiguration",
815 feature = "WKFindResult",
816 feature = "block2"
817 ))]
818 #[unsafe(method(findString:withConfiguration:completionHandler:))]
819 #[unsafe(method_family = none)]
820 pub unsafe fn findString_withConfiguration_completionHandler(
821 &self,
822 string: &NSString,
823 configuration: Option<&WKFindConfiguration>,
824 completion_handler: &block2::DynBlock<dyn Fn(NonNull<WKFindResult>)>,
825 );
826
827 #[unsafe(method(handlesURLScheme:))]
828 #[unsafe(method_family = none)]
829 pub unsafe fn handlesURLScheme(url_scheme: &NSString, mtm: MainThreadMarker) -> bool;
830
831 #[cfg(all(feature = "WKDownload", feature = "block2"))]
832 #[unsafe(method(startDownloadUsingRequest:completionHandler:))]
833 #[unsafe(method_family = none)]
834 pub unsafe fn startDownloadUsingRequest_completionHandler(
835 &self,
836 request: &NSURLRequest,
837 completion_handler: &block2::DynBlock<dyn Fn(NonNull<WKDownload>)>,
838 );
839
840 #[cfg(all(feature = "WKDownload", feature = "block2"))]
841 #[unsafe(method(resumeDownloadFromResumeData:completionHandler:))]
842 #[unsafe(method_family = none)]
843 pub unsafe fn resumeDownloadFromResumeData_completionHandler(
844 &self,
845 resume_data: &NSData,
846 completion_handler: &block2::DynBlock<dyn Fn(NonNull<WKDownload>)>,
847 );
848
849 #[unsafe(method(mediaType))]
850 #[unsafe(method_family = none)]
851 pub unsafe fn mediaType(&self) -> Option<Retained<NSString>>;
852
853 #[unsafe(method(setMediaType:))]
857 #[unsafe(method_family = none)]
858 pub unsafe fn setMediaType(&self, media_type: Option<&NSString>);
859
860 #[unsafe(method(interactionState))]
861 #[unsafe(method_family = none)]
862 pub unsafe fn interactionState(&self) -> Option<Retained<AnyObject>>;
863
864 #[unsafe(method(setInteractionState:))]
872 #[unsafe(method_family = none)]
873 pub unsafe fn setInteractionState(&self, interaction_state: Option<&AnyObject>);
874
875 #[unsafe(method(isBlockedByScreenTime))]
877 #[unsafe(method_family = none)]
878 pub unsafe fn isBlockedByScreenTime(&self) -> bool;
879
880 #[cfg(feature = "WKNavigation")]
881 #[unsafe(method(loadSimulatedRequest:response:responseData:))]
895 #[unsafe(method_family = none)]
896 pub unsafe fn loadSimulatedRequest_response_responseData(
897 &self,
898 request: &NSURLRequest,
899 response: &NSURLResponse,
900 data: &NSData,
901 ) -> Retained<WKNavigation>;
902
903 #[cfg(feature = "WKNavigation")]
904 #[deprecated]
905 #[unsafe(method(loadSimulatedRequest:withResponse:responseData:))]
906 #[unsafe(method_family = none)]
907 pub unsafe fn loadSimulatedRequest_withResponse_responseData(
908 &self,
909 request: &NSURLRequest,
910 response: &NSURLResponse,
911 data: &NSData,
912 ) -> Retained<WKNavigation>;
913
914 #[cfg(feature = "WKNavigation")]
915 #[unsafe(method(loadFileRequest:allowingReadAccessToURL:))]
927 #[unsafe(method_family = none)]
928 pub unsafe fn loadFileRequest_allowingReadAccessToURL(
929 &self,
930 request: &NSURLRequest,
931 read_access_url: &NSURL,
932 ) -> Retained<WKNavigation>;
933
934 #[cfg(feature = "WKNavigation")]
935 #[unsafe(method(loadSimulatedRequest:responseHTMLString:))]
947 #[unsafe(method_family = none)]
948 pub unsafe fn loadSimulatedRequest_responseHTMLString(
949 &self,
950 request: &NSURLRequest,
951 string: &NSString,
952 ) -> Retained<WKNavigation>;
953
954 #[cfg(feature = "WKNavigation")]
955 #[deprecated]
956 #[unsafe(method(loadSimulatedRequest:withResponseHTMLString:))]
957 #[unsafe(method_family = none)]
958 pub unsafe fn loadSimulatedRequest_withResponseHTMLString(
959 &self,
960 request: &NSURLRequest,
961 string: &NSString,
962 ) -> Retained<WKNavigation>;
963
964 #[unsafe(method(printOperationWithPrintInfo:))]
965 #[unsafe(method_family = none)]
966 pub unsafe fn printOperationWithPrintInfo(
967 &self,
968 print_info: &NSPrintInfo,
969 ) -> Retained<NSPrintOperation>;
970
971 #[unsafe(method(themeColor))]
972 #[unsafe(method_family = none)]
973 pub unsafe fn themeColor(&self) -> Option<Retained<NSColor>>;
974
975 #[unsafe(method(underPageBackgroundColor))]
976 #[unsafe(method_family = none)]
977 pub unsafe fn underPageBackgroundColor(&self) -> Retained<NSColor>;
978
979 #[unsafe(method(setUnderPageBackgroundColor:))]
983 #[unsafe(method_family = none)]
984 pub unsafe fn setUnderPageBackgroundColor(
985 &self,
986 under_page_background_color: Option<&NSColor>,
987 );
988
989 #[unsafe(method(fullscreenState))]
1003 #[unsafe(method_family = none)]
1004 pub unsafe fn fullscreenState(&self) -> WKFullscreenState;
1005
1006 #[unsafe(method(minimumViewportInset))]
1007 #[unsafe(method_family = none)]
1008 pub unsafe fn minimumViewportInset(&self) -> NSEdgeInsets;
1009
1010 #[unsafe(method(maximumViewportInset))]
1011 #[unsafe(method_family = none)]
1012 pub unsafe fn maximumViewportInset(&self) -> NSEdgeInsets;
1013
1014 #[unsafe(method(setMinimumViewportInset:maximumViewportInset:))]
1015 #[unsafe(method_family = none)]
1016 pub unsafe fn setMinimumViewportInset_maximumViewportInset(
1017 &self,
1018 minimum_viewport_inset: NSEdgeInsets,
1019 maximum_viewport_inset: NSEdgeInsets,
1020 );
1021
1022 #[unsafe(method(isInspectable))]
1032 #[unsafe(method_family = none)]
1033 pub unsafe fn isInspectable(&self) -> bool;
1034
1035 #[unsafe(method(setInspectable:))]
1037 #[unsafe(method_family = none)]
1038 pub unsafe fn setInspectable(&self, inspectable: bool);
1039
1040 #[unsafe(method(isWritingToolsActive))]
1049 #[unsafe(method_family = none)]
1050 pub unsafe fn isWritingToolsActive(&self) -> bool;
1051
1052 #[cfg(feature = "block2")]
1053 #[unsafe(method(fetchDataOfTypes:completionHandler:))]
1054 #[unsafe(method_family = none)]
1055 pub unsafe fn fetchDataOfTypes_completionHandler(
1056 &self,
1057 data_types: WKWebViewDataType,
1058 completion_handler: &block2::DynBlock<dyn Fn(*mut NSData, *mut NSError)>,
1059 );
1060
1061 #[cfg(feature = "block2")]
1062 #[unsafe(method(restoreData:completionHandler:))]
1063 #[unsafe(method_family = none)]
1064 pub unsafe fn restoreData_completionHandler(
1065 &self,
1066 data: &NSData,
1067 completion_handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
1068 );
1069
1070 #[unsafe(method(obscuredContentInsets))]
1071 #[unsafe(method_family = none)]
1072 pub unsafe fn obscuredContentInsets(&self) -> NSEdgeInsets;
1073
1074 #[unsafe(method(setObscuredContentInsets:))]
1076 #[unsafe(method_family = none)]
1077 pub unsafe fn setObscuredContentInsets(&self, obscured_content_insets: NSEdgeInsets);
1078 );
1079}
1080
1081#[cfg(feature = "objc2-app-kit")]
1083#[cfg(target_os = "macos")]
1084impl WKWebView {
1085 extern_methods!(
1086 #[unsafe(method(initWithFrame:))]
1087 #[unsafe(method_family = init)]
1088 pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
1089 );
1090}
1091
1092#[cfg(feature = "objc2-app-kit")]
1094#[cfg(target_os = "macos")]
1095impl WKWebView {
1096 extern_methods!(
1097 #[unsafe(method(init))]
1098 #[unsafe(method_family = init)]
1099 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1100 );
1101}
1102
1103#[cfg(feature = "objc2-app-kit")]
1105#[cfg(target_os = "macos")]
1106impl WKWebView {
1107 extern_methods!(
1108 #[unsafe(method(new))]
1109 #[unsafe(method_family = new)]
1110 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
1111 );
1112}
1113
1114#[cfg(feature = "objc2-app-kit")]
1116#[cfg(target_os = "macos")]
1117impl WKWebView {
1118 extern_methods!(
1119 #[unsafe(method(goBack:))]
1128 #[unsafe(method_family = none)]
1129 pub unsafe fn goBack_(&self, sender: Option<&AnyObject>);
1130
1131 #[unsafe(method(goForward:))]
1140 #[unsafe(method_family = none)]
1141 pub unsafe fn goForward_(&self, sender: Option<&AnyObject>);
1142
1143 #[unsafe(method(reload:))]
1151 #[unsafe(method_family = none)]
1152 pub unsafe fn reload_(&self, sender: Option<&AnyObject>);
1153
1154 #[unsafe(method(reloadFromOrigin:))]
1163 #[unsafe(method_family = none)]
1164 pub unsafe fn reloadFromOrigin_(&self, sender: Option<&AnyObject>);
1165
1166 #[unsafe(method(stopLoading:))]
1175 #[unsafe(method_family = none)]
1176 pub unsafe fn stopLoading_(&self, sender: Option<&AnyObject>);
1177 );
1178}
1179
1180#[cfg(feature = "objc2-app-kit")]
1181#[cfg(target_os = "macos")]
1182extern_conformance!(
1183 unsafe impl NSUserInterfaceValidations for WKWebView {}
1184);
1185
1186#[cfg(feature = "objc2-app-kit")]
1188#[cfg(target_os = "macos")]
1189impl WKWebView {
1190 extern_methods!();
1191}
1192
1193#[cfg(feature = "objc2-app-kit")]
1194#[cfg(target_os = "macos")]
1195extern_conformance!(
1196 unsafe impl NSTextFinderClient for WKWebView {}
1197);
1198
1199#[cfg(feature = "objc2-app-kit")]
1201#[cfg(target_os = "macos")]
1202impl WKWebView {
1203 extern_methods!(
1204 #[deprecated]
1205 #[unsafe(method(certificateChain))]
1206 #[unsafe(method_family = none)]
1207 pub unsafe fn certificateChain(&self) -> Retained<NSArray>;
1208 );
1209}