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")]
99unsafe impl NSAccessibility for WKWebView {}
100
101#[cfg(feature = "objc2-app-kit")]
102#[cfg(target_os = "macos")]
103unsafe impl NSAccessibilityElementProtocol for WKWebView {}
104
105#[cfg(feature = "objc2-app-kit")]
106#[cfg(target_os = "macos")]
107unsafe impl NSAnimatablePropertyContainer for WKWebView {}
108
109#[cfg(feature = "objc2-app-kit")]
110#[cfg(target_os = "macos")]
111unsafe impl NSAppearanceCustomization for WKWebView {}
112
113#[cfg(feature = "objc2-app-kit")]
114#[cfg(target_os = "macos")]
115unsafe impl NSCoding for WKWebView {}
116
117#[cfg(feature = "objc2-app-kit")]
118#[cfg(target_os = "macos")]
119unsafe impl NSDraggingDestination for WKWebView {}
120
121#[cfg(feature = "objc2-app-kit")]
122#[cfg(target_os = "macos")]
123unsafe impl NSObjectProtocol for WKWebView {}
124
125#[cfg(feature = "objc2-app-kit")]
126#[cfg(target_os = "macos")]
127unsafe impl NSUserInterfaceItemIdentification for WKWebView {}
128
129#[cfg(feature = "objc2-app-kit")]
130#[cfg(target_os = "macos")]
131impl WKWebView {
132 extern_methods!(
133 #[cfg(feature = "WKWebViewConfiguration")]
134 #[unsafe(method(configuration))]
137 #[unsafe(method_family = none)]
138 pub unsafe fn configuration(&self) -> Retained<WKWebViewConfiguration>;
139
140 #[cfg(feature = "WKNavigationDelegate")]
141 #[unsafe(method(navigationDelegate))]
143 #[unsafe(method_family = none)]
144 pub unsafe fn navigationDelegate(
145 &self,
146 ) -> Option<Retained<ProtocolObject<dyn WKNavigationDelegate>>>;
147
148 #[cfg(feature = "WKNavigationDelegate")]
149 #[unsafe(method(setNavigationDelegate:))]
152 #[unsafe(method_family = none)]
153 pub unsafe fn setNavigationDelegate(
154 &self,
155 navigation_delegate: Option<&ProtocolObject<dyn WKNavigationDelegate>>,
156 );
157
158 #[cfg(feature = "WKUIDelegate")]
159 #[unsafe(method(UIDelegate))]
161 #[unsafe(method_family = none)]
162 pub unsafe fn UIDelegate(&self) -> Option<Retained<ProtocolObject<dyn WKUIDelegate>>>;
163
164 #[cfg(feature = "WKUIDelegate")]
165 #[unsafe(method(setUIDelegate:))]
168 #[unsafe(method_family = none)]
169 pub unsafe fn setUIDelegate(&self, ui_delegate: Option<&ProtocolObject<dyn WKUIDelegate>>);
170
171 #[cfg(feature = "WKBackForwardList")]
172 #[unsafe(method(backForwardList))]
174 #[unsafe(method_family = none)]
175 pub unsafe fn backForwardList(&self) -> Retained<WKBackForwardList>;
176
177 #[cfg(all(feature = "WKWebViewConfiguration", feature = "objc2-core-foundation"))]
178 #[unsafe(method(initWithFrame:configuration:))]
199 #[unsafe(method_family = init)]
200 pub unsafe fn initWithFrame_configuration(
201 this: Allocated<Self>,
202 frame: CGRect,
203 configuration: &WKWebViewConfiguration,
204 ) -> Retained<Self>;
205
206 #[unsafe(method(initWithCoder:))]
207 #[unsafe(method_family = init)]
208 pub unsafe fn initWithCoder(
209 this: Allocated<Self>,
210 coder: &NSCoder,
211 ) -> Option<Retained<Self>>;
212
213 #[cfg(feature = "WKNavigation")]
214 #[unsafe(method(loadRequest:))]
220 #[unsafe(method_family = none)]
221 pub unsafe fn loadRequest(&self, request: &NSURLRequest) -> Option<Retained<WKNavigation>>;
222
223 #[cfg(feature = "WKNavigation")]
224 #[unsafe(method(loadFileURL:allowingReadAccessToURL:))]
235 #[unsafe(method_family = none)]
236 pub unsafe fn loadFileURL_allowingReadAccessToURL(
237 &self,
238 url: &NSURL,
239 read_access_url: &NSURL,
240 ) -> Option<Retained<WKNavigation>>;
241
242 #[cfg(feature = "WKNavigation")]
243 #[unsafe(method(loadHTMLString:baseURL:))]
251 #[unsafe(method_family = none)]
252 pub unsafe fn loadHTMLString_baseURL(
253 &self,
254 string: &NSString,
255 base_url: Option<&NSURL>,
256 ) -> Option<Retained<WKNavigation>>;
257
258 #[cfg(feature = "WKNavigation")]
259 #[unsafe(method(loadData:MIMEType:characterEncodingName:baseURL:))]
271 #[unsafe(method_family = none)]
272 pub unsafe fn loadData_MIMEType_characterEncodingName_baseURL(
273 &self,
274 data: &NSData,
275 mime_type: &NSString,
276 character_encoding_name: &NSString,
277 base_url: &NSURL,
278 ) -> Option<Retained<WKNavigation>>;
279
280 #[cfg(all(feature = "WKBackForwardListItem", feature = "WKNavigation"))]
281 #[unsafe(method(goToBackForwardListItem:))]
292 #[unsafe(method_family = none)]
293 pub unsafe fn goToBackForwardListItem(
294 &self,
295 item: &WKBackForwardListItem,
296 ) -> Option<Retained<WKNavigation>>;
297
298 #[unsafe(method(title))]
308 #[unsafe(method_family = none)]
309 pub unsafe fn title(&self) -> Option<Retained<NSString>>;
310
311 #[unsafe(method(URL))]
323 #[unsafe(method_family = none)]
324 pub unsafe fn URL(&self) -> Option<Retained<NSURL>>;
325
326 #[unsafe(method(isLoading))]
337 #[unsafe(method_family = none)]
338 pub unsafe fn isLoading(&self) -> bool;
339
340 #[unsafe(method(estimatedProgress))]
354 #[unsafe(method_family = none)]
355 pub unsafe fn estimatedProgress(&self) -> c_double;
356
357 #[unsafe(method(hasOnlySecureContent))]
368 #[unsafe(method_family = none)]
369 pub unsafe fn hasOnlySecureContent(&self) -> bool;
370
371 #[cfg(feature = "objc2-security")]
372 #[unsafe(method(serverTrust))]
382 #[unsafe(method_family = none)]
383 pub unsafe fn serverTrust(&self) -> Option<Retained<SecTrust>>;
384
385 #[unsafe(method(canGoBack))]
398 #[unsafe(method_family = none)]
399 pub unsafe fn canGoBack(&self) -> bool;
400
401 #[unsafe(method(canGoForward))]
414 #[unsafe(method_family = none)]
415 pub unsafe fn canGoForward(&self) -> bool;
416
417 #[cfg(feature = "WKNavigation")]
418 #[unsafe(method(goBack))]
423 #[unsafe(method_family = none)]
424 pub unsafe fn goBack(&self) -> Option<Retained<WKNavigation>>;
425
426 #[cfg(feature = "WKNavigation")]
427 #[unsafe(method(goForward))]
432 #[unsafe(method_family = none)]
433 pub unsafe fn goForward(&self) -> Option<Retained<WKNavigation>>;
434
435 #[cfg(feature = "WKNavigation")]
436 #[unsafe(method(reload))]
440 #[unsafe(method_family = none)]
441 pub unsafe fn reload(&self) -> Option<Retained<WKNavigation>>;
442
443 #[cfg(feature = "WKNavigation")]
444 #[unsafe(method(reloadFromOrigin))]
449 #[unsafe(method_family = none)]
450 pub unsafe fn reloadFromOrigin(&self) -> Option<Retained<WKNavigation>>;
451
452 #[unsafe(method(stopLoading))]
454 #[unsafe(method_family = none)]
455 pub unsafe fn stopLoading(&self);
456
457 #[cfg(feature = "block2")]
458 #[unsafe(method(evaluateJavaScript:completionHandler:))]
459 #[unsafe(method_family = none)]
460 pub unsafe fn evaluateJavaScript_completionHandler(
461 &self,
462 java_script_string: &NSString,
463 completion_handler: Option<&block2::Block<dyn Fn(*mut AnyObject, *mut NSError)>>,
464 );
465
466 #[cfg(all(
467 feature = "WKContentWorld",
468 feature = "WKFrameInfo",
469 feature = "block2"
470 ))]
471 #[unsafe(method(evaluateJavaScript:inFrame:inContentWorld:completionHandler:))]
472 #[unsafe(method_family = none)]
473 pub unsafe fn evaluateJavaScript_inFrame_inContentWorld_completionHandler(
474 &self,
475 java_script_string: &NSString,
476 frame: Option<&WKFrameInfo>,
477 content_world: &WKContentWorld,
478 completion_handler: Option<&block2::Block<dyn Fn(*mut AnyObject, *mut NSError)>>,
479 );
480
481 #[cfg(all(
482 feature = "WKContentWorld",
483 feature = "WKFrameInfo",
484 feature = "block2"
485 ))]
486 #[unsafe(method(callAsyncJavaScript:arguments:inFrame:inContentWorld:completionHandler:))]
487 #[unsafe(method_family = none)]
488 pub unsafe fn callAsyncJavaScript_arguments_inFrame_inContentWorld_completionHandler(
489 &self,
490 function_body: &NSString,
491 arguments: Option<&NSDictionary<NSString, AnyObject>>,
492 frame: Option<&WKFrameInfo>,
493 content_world: &WKContentWorld,
494 completion_handler: Option<&block2::Block<dyn Fn(*mut AnyObject, *mut NSError)>>,
495 );
496
497 #[cfg(feature = "block2")]
498 #[unsafe(method(closeAllMediaPresentationsWithCompletionHandler:))]
502 #[unsafe(method_family = none)]
503 pub unsafe fn closeAllMediaPresentationsWithCompletionHandler(
504 &self,
505 completion_handler: Option<&block2::Block<dyn Fn()>>,
506 );
507
508 #[deprecated]
509 #[unsafe(method(closeAllMediaPresentations))]
510 #[unsafe(method_family = none)]
511 pub unsafe fn closeAllMediaPresentations(&self);
512
513 #[cfg(feature = "block2")]
514 #[unsafe(method(pauseAllMediaPlaybackWithCompletionHandler:))]
518 #[unsafe(method_family = none)]
519 pub unsafe fn pauseAllMediaPlaybackWithCompletionHandler(
520 &self,
521 completion_handler: Option<&block2::Block<dyn Fn()>>,
522 );
523
524 #[cfg(feature = "block2")]
525 #[deprecated]
526 #[unsafe(method(pauseAllMediaPlayback:))]
527 #[unsafe(method_family = none)]
528 pub unsafe fn pauseAllMediaPlayback(
529 &self,
530 completion_handler: Option<&block2::Block<dyn Fn()>>,
531 );
532
533 #[cfg(feature = "block2")]
534 #[unsafe(method(setAllMediaPlaybackSuspended:completionHandler:))]
540 #[unsafe(method_family = none)]
541 pub unsafe fn setAllMediaPlaybackSuspended_completionHandler(
542 &self,
543 suspended: bool,
544 completion_handler: Option<&block2::Block<dyn Fn()>>,
545 );
546
547 #[cfg(feature = "block2")]
548 #[deprecated]
549 #[unsafe(method(resumeAllMediaPlayback:))]
550 #[unsafe(method_family = none)]
551 pub unsafe fn resumeAllMediaPlayback(
552 &self,
553 completion_handler: Option<&block2::Block<dyn Fn()>>,
554 );
555
556 #[cfg(feature = "block2")]
557 #[deprecated]
558 #[unsafe(method(suspendAllMediaPlayback:))]
559 #[unsafe(method_family = none)]
560 pub unsafe fn suspendAllMediaPlayback(
561 &self,
562 completion_handler: Option<&block2::Block<dyn Fn()>>,
563 );
564
565 #[cfg(feature = "block2")]
566 #[unsafe(method(requestMediaPlaybackStateWithCompletionHandler:))]
575 #[unsafe(method_family = none)]
576 pub unsafe fn requestMediaPlaybackStateWithCompletionHandler(
577 &self,
578 completion_handler: &block2::Block<dyn Fn(WKMediaPlaybackState)>,
579 );
580
581 #[cfg(feature = "block2")]
582 #[deprecated]
583 #[unsafe(method(requestMediaPlaybackState:))]
584 #[unsafe(method_family = none)]
585 pub unsafe fn requestMediaPlaybackState(
586 &self,
587 completion_handler: &block2::Block<dyn Fn(WKMediaPlaybackState)>,
588 );
589
590 #[unsafe(method(cameraCaptureState))]
600 #[unsafe(method_family = none)]
601 pub unsafe fn cameraCaptureState(&self) -> WKMediaCaptureState;
602
603 #[unsafe(method(microphoneCaptureState))]
613 #[unsafe(method_family = none)]
614 pub unsafe fn microphoneCaptureState(&self) -> WKMediaCaptureState;
615
616 #[cfg(feature = "block2")]
617 #[unsafe(method(setCameraCaptureState:completionHandler:))]
627 #[unsafe(method_family = none)]
628 pub unsafe fn setCameraCaptureState_completionHandler(
629 &self,
630 state: WKMediaCaptureState,
631 completion_handler: Option<&block2::Block<dyn Fn()>>,
632 );
633
634 #[cfg(feature = "block2")]
635 #[unsafe(method(setMicrophoneCaptureState:completionHandler:))]
645 #[unsafe(method_family = none)]
646 pub unsafe fn setMicrophoneCaptureState_completionHandler(
647 &self,
648 state: WKMediaCaptureState,
649 completion_handler: Option<&block2::Block<dyn Fn()>>,
650 );
651
652 #[cfg(all(feature = "WKSnapshotConfiguration", feature = "block2"))]
653 #[unsafe(method(takeSnapshotWithConfiguration:completionHandler:))]
654 #[unsafe(method_family = none)]
655 pub unsafe fn takeSnapshotWithConfiguration_completionHandler(
656 &self,
657 snapshot_configuration: Option<&WKSnapshotConfiguration>,
658 completion_handler: &block2::Block<dyn Fn(*mut NSImage, *mut NSError)>,
659 );
660
661 #[cfg(all(feature = "WKPDFConfiguration", feature = "block2"))]
662 #[unsafe(method(createPDFWithConfiguration:completionHandler:))]
673 #[unsafe(method_family = none)]
674 pub unsafe fn createPDFWithConfiguration_completionHandler(
675 &self,
676 pdf_configuration: Option<&WKPDFConfiguration>,
677 completion_handler: &block2::Block<dyn Fn(*mut NSData, *mut NSError)>,
678 );
679
680 #[cfg(feature = "block2")]
681 #[unsafe(method(createWebArchiveDataWithCompletionHandler:))]
682 #[unsafe(method_family = none)]
683 pub unsafe fn createWebArchiveDataWithCompletionHandler(
684 &self,
685 completion_handler: &block2::Block<dyn Fn(NonNull<NSData>, NonNull<NSError>)>,
686 );
687
688 #[unsafe(method(allowsBackForwardNavigationGestures))]
693 #[unsafe(method_family = none)]
694 pub unsafe fn allowsBackForwardNavigationGestures(&self) -> bool;
695
696 #[unsafe(method(setAllowsBackForwardNavigationGestures:))]
698 #[unsafe(method_family = none)]
699 pub unsafe fn setAllowsBackForwardNavigationGestures(
700 &self,
701 allows_back_forward_navigation_gestures: bool,
702 );
703
704 #[unsafe(method(customUserAgent))]
706 #[unsafe(method_family = none)]
707 pub unsafe fn customUserAgent(&self) -> Option<Retained<NSString>>;
708
709 #[unsafe(method(setCustomUserAgent:))]
711 #[unsafe(method_family = none)]
712 pub unsafe fn setCustomUserAgent(&self, custom_user_agent: Option<&NSString>);
713
714 #[unsafe(method(allowsLinkPreview))]
719 #[unsafe(method_family = none)]
720 pub unsafe fn allowsLinkPreview(&self) -> bool;
721
722 #[unsafe(method(setAllowsLinkPreview:))]
724 #[unsafe(method_family = none)]
725 pub unsafe fn setAllowsLinkPreview(&self, allows_link_preview: bool);
726
727 #[unsafe(method(allowsMagnification))]
728 #[unsafe(method_family = none)]
729 pub unsafe fn allowsMagnification(&self) -> bool;
730
731 #[unsafe(method(setAllowsMagnification:))]
733 #[unsafe(method_family = none)]
734 pub unsafe fn setAllowsMagnification(&self, allows_magnification: bool);
735
736 #[cfg(feature = "objc2-core-foundation")]
737 #[unsafe(method(magnification))]
738 #[unsafe(method_family = none)]
739 pub unsafe fn magnification(&self) -> CGFloat;
740
741 #[cfg(feature = "objc2-core-foundation")]
742 #[unsafe(method(setMagnification:))]
744 #[unsafe(method_family = none)]
745 pub unsafe fn setMagnification(&self, magnification: CGFloat);
746
747 #[cfg(feature = "objc2-core-foundation")]
748 #[unsafe(method(setMagnification:centeredAtPoint:))]
749 #[unsafe(method_family = none)]
750 pub unsafe fn setMagnification_centeredAtPoint(
751 &self,
752 magnification: CGFloat,
753 point: CGPoint,
754 );
755
756 #[cfg(feature = "objc2-core-foundation")]
757 #[unsafe(method(pageZoom))]
758 #[unsafe(method_family = none)]
759 pub unsafe fn pageZoom(&self) -> CGFloat;
760
761 #[cfg(feature = "objc2-core-foundation")]
762 #[unsafe(method(setPageZoom:))]
764 #[unsafe(method_family = none)]
765 pub unsafe fn setPageZoom(&self, page_zoom: CGFloat);
766
767 #[cfg(all(
768 feature = "WKFindConfiguration",
769 feature = "WKFindResult",
770 feature = "block2"
771 ))]
772 #[unsafe(method(findString:withConfiguration:completionHandler:))]
773 #[unsafe(method_family = none)]
774 pub unsafe fn findString_withConfiguration_completionHandler(
775 &self,
776 string: &NSString,
777 configuration: Option<&WKFindConfiguration>,
778 completion_handler: &block2::Block<dyn Fn(NonNull<WKFindResult>)>,
779 );
780
781 #[unsafe(method(handlesURLScheme:))]
782 #[unsafe(method_family = none)]
783 pub unsafe fn handlesURLScheme(url_scheme: &NSString, mtm: MainThreadMarker) -> bool;
784
785 #[cfg(all(feature = "WKDownload", feature = "block2"))]
786 #[unsafe(method(startDownloadUsingRequest:completionHandler:))]
787 #[unsafe(method_family = none)]
788 pub unsafe fn startDownloadUsingRequest_completionHandler(
789 &self,
790 request: &NSURLRequest,
791 completion_handler: &block2::Block<dyn Fn(NonNull<WKDownload>)>,
792 );
793
794 #[cfg(all(feature = "WKDownload", feature = "block2"))]
795 #[unsafe(method(resumeDownloadFromResumeData:completionHandler:))]
796 #[unsafe(method_family = none)]
797 pub unsafe fn resumeDownloadFromResumeData_completionHandler(
798 &self,
799 resume_data: &NSData,
800 completion_handler: &block2::Block<dyn Fn(NonNull<WKDownload>)>,
801 );
802
803 #[unsafe(method(mediaType))]
804 #[unsafe(method_family = none)]
805 pub unsafe fn mediaType(&self) -> Option<Retained<NSString>>;
806
807 #[unsafe(method(setMediaType:))]
809 #[unsafe(method_family = none)]
810 pub unsafe fn setMediaType(&self, media_type: Option<&NSString>);
811
812 #[unsafe(method(interactionState))]
813 #[unsafe(method_family = none)]
814 pub unsafe fn interactionState(&self) -> Option<Retained<AnyObject>>;
815
816 #[unsafe(method(setInteractionState:))]
818 #[unsafe(method_family = none)]
819 pub unsafe fn setInteractionState(&self, interaction_state: Option<&AnyObject>);
820
821 #[cfg(feature = "WKNavigation")]
822 #[unsafe(method(loadSimulatedRequest:response:responseData:))]
836 #[unsafe(method_family = none)]
837 pub unsafe fn loadSimulatedRequest_response_responseData(
838 &self,
839 request: &NSURLRequest,
840 response: &NSURLResponse,
841 data: &NSData,
842 ) -> Retained<WKNavigation>;
843
844 #[cfg(feature = "WKNavigation")]
845 #[deprecated]
846 #[unsafe(method(loadSimulatedRequest:withResponse:responseData:))]
847 #[unsafe(method_family = none)]
848 pub unsafe fn loadSimulatedRequest_withResponse_responseData(
849 &self,
850 request: &NSURLRequest,
851 response: &NSURLResponse,
852 data: &NSData,
853 ) -> Retained<WKNavigation>;
854
855 #[cfg(feature = "WKNavigation")]
856 #[unsafe(method(loadFileRequest:allowingReadAccessToURL:))]
868 #[unsafe(method_family = none)]
869 pub unsafe fn loadFileRequest_allowingReadAccessToURL(
870 &self,
871 request: &NSURLRequest,
872 read_access_url: &NSURL,
873 ) -> Retained<WKNavigation>;
874
875 #[cfg(feature = "WKNavigation")]
876 #[unsafe(method(loadSimulatedRequest:responseHTMLString:))]
888 #[unsafe(method_family = none)]
889 pub unsafe fn loadSimulatedRequest_responseHTMLString(
890 &self,
891 request: &NSURLRequest,
892 string: &NSString,
893 ) -> Retained<WKNavigation>;
894
895 #[cfg(feature = "WKNavigation")]
896 #[deprecated]
897 #[unsafe(method(loadSimulatedRequest:withResponseHTMLString:))]
898 #[unsafe(method_family = none)]
899 pub unsafe fn loadSimulatedRequest_withResponseHTMLString(
900 &self,
901 request: &NSURLRequest,
902 string: &NSString,
903 ) -> Retained<WKNavigation>;
904
905 #[unsafe(method(printOperationWithPrintInfo:))]
906 #[unsafe(method_family = none)]
907 pub unsafe fn printOperationWithPrintInfo(
908 &self,
909 print_info: &NSPrintInfo,
910 ) -> Retained<NSPrintOperation>;
911
912 #[unsafe(method(themeColor))]
913 #[unsafe(method_family = none)]
914 pub unsafe fn themeColor(&self) -> Option<Retained<NSColor>>;
915
916 #[unsafe(method(underPageBackgroundColor))]
917 #[unsafe(method_family = none)]
918 pub unsafe fn underPageBackgroundColor(&self) -> Retained<NSColor>;
919
920 #[unsafe(method(setUnderPageBackgroundColor:))]
922 #[unsafe(method_family = none)]
923 pub unsafe fn setUnderPageBackgroundColor(
924 &self,
925 under_page_background_color: Option<&NSColor>,
926 );
927
928 #[unsafe(method(fullscreenState))]
942 #[unsafe(method_family = none)]
943 pub unsafe fn fullscreenState(&self) -> WKFullscreenState;
944
945 #[unsafe(method(minimumViewportInset))]
946 #[unsafe(method_family = none)]
947 pub unsafe fn minimumViewportInset(&self) -> NSEdgeInsets;
948
949 #[unsafe(method(maximumViewportInset))]
950 #[unsafe(method_family = none)]
951 pub unsafe fn maximumViewportInset(&self) -> NSEdgeInsets;
952
953 #[unsafe(method(setMinimumViewportInset:maximumViewportInset:))]
954 #[unsafe(method_family = none)]
955 pub unsafe fn setMinimumViewportInset_maximumViewportInset(
956 &self,
957 minimum_viewport_inset: NSEdgeInsets,
958 maximum_viewport_inset: NSEdgeInsets,
959 );
960
961 #[unsafe(method(isInspectable))]
971 #[unsafe(method_family = none)]
972 pub unsafe fn isInspectable(&self) -> bool;
973
974 #[unsafe(method(setInspectable:))]
976 #[unsafe(method_family = none)]
977 pub unsafe fn setInspectable(&self, inspectable: bool);
978
979 #[unsafe(method(isWritingToolsActive))]
988 #[unsafe(method_family = none)]
989 pub unsafe fn isWritingToolsActive(&self) -> bool;
990 );
991}
992
993#[cfg(feature = "objc2-app-kit")]
995#[cfg(target_os = "macos")]
996impl WKWebView {
997 extern_methods!(
998 #[unsafe(method(initWithFrame:))]
999 #[unsafe(method_family = init)]
1000 pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
1001 );
1002}
1003
1004#[cfg(feature = "objc2-app-kit")]
1006#[cfg(target_os = "macos")]
1007impl WKWebView {
1008 extern_methods!(
1009 #[unsafe(method(init))]
1010 #[unsafe(method_family = init)]
1011 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1012 );
1013}
1014
1015#[cfg(feature = "objc2-app-kit")]
1017#[cfg(target_os = "macos")]
1018impl WKWebView {
1019 extern_methods!(
1020 #[unsafe(method(new))]
1021 #[unsafe(method_family = new)]
1022 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
1023 );
1024}
1025
1026#[cfg(feature = "objc2-app-kit")]
1028#[cfg(target_os = "macos")]
1029impl WKWebView {
1030 extern_methods!(
1031 #[unsafe(method(goBack:))]
1036 #[unsafe(method_family = none)]
1037 pub unsafe fn goBack_(&self, sender: Option<&AnyObject>);
1038
1039 #[unsafe(method(goForward:))]
1044 #[unsafe(method_family = none)]
1045 pub unsafe fn goForward_(&self, sender: Option<&AnyObject>);
1046
1047 #[unsafe(method(reload:))]
1051 #[unsafe(method_family = none)]
1052 pub unsafe fn reload_(&self, sender: Option<&AnyObject>);
1053
1054 #[unsafe(method(reloadFromOrigin:))]
1059 #[unsafe(method_family = none)]
1060 pub unsafe fn reloadFromOrigin_(&self, sender: Option<&AnyObject>);
1061
1062 #[unsafe(method(stopLoading:))]
1067 #[unsafe(method_family = none)]
1068 pub unsafe fn stopLoading_(&self, sender: Option<&AnyObject>);
1069 );
1070}
1071
1072#[cfg(feature = "objc2-app-kit")]
1073#[cfg(target_os = "macos")]
1074unsafe impl NSUserInterfaceValidations for WKWebView {}
1075
1076#[cfg(feature = "objc2-app-kit")]
1078#[cfg(target_os = "macos")]
1079impl WKWebView {
1080 extern_methods!();
1081}
1082
1083#[cfg(feature = "objc2-app-kit")]
1084#[cfg(target_os = "macos")]
1085unsafe impl NSTextFinderClient for WKWebView {}
1086
1087#[cfg(feature = "objc2-app-kit")]
1089#[cfg(target_os = "macos")]
1090impl WKWebView {
1091 extern_methods!(
1092 #[deprecated]
1093 #[unsafe(method(certificateChain))]
1094 #[unsafe(method_family = none)]
1095 pub unsafe fn certificateChain(&self) -> Retained<NSArray>;
1096 );
1097}