1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
use objc2_app_kit::*;
use objc2_foundation::*;

use crate::*;

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct WKMediaPlaybackState(pub NSInteger);
impl WKMediaPlaybackState {
    #[doc(alias = "WKMediaPlaybackStateNone")]
    pub const None: Self = Self(0);
    #[doc(alias = "WKMediaPlaybackStatePlaying")]
    pub const Playing: Self = Self(1);
    #[doc(alias = "WKMediaPlaybackStatePaused")]
    pub const Paused: Self = Self(2);
    #[doc(alias = "WKMediaPlaybackStateSuspended")]
    pub const Suspended: Self = Self(3);
}

unsafe impl Encode for WKMediaPlaybackState {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for WKMediaPlaybackState {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct WKMediaCaptureState(pub NSInteger);
impl WKMediaCaptureState {
    #[doc(alias = "WKMediaCaptureStateNone")]
    pub const None: Self = Self(0);
    #[doc(alias = "WKMediaCaptureStateActive")]
    pub const Active: Self = Self(1);
    #[doc(alias = "WKMediaCaptureStateMuted")]
    pub const Muted: Self = Self(2);
}

unsafe impl Encode for WKMediaCaptureState {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for WKMediaCaptureState {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct WKFullscreenState(pub NSInteger);
impl WKFullscreenState {
    #[doc(alias = "WKFullscreenStateNotInFullscreen")]
    pub const NotInFullscreen: Self = Self(0);
    #[doc(alias = "WKFullscreenStateEnteringFullscreen")]
    pub const EnteringFullscreen: Self = Self(1);
    #[doc(alias = "WKFullscreenStateInFullscreen")]
    pub const InFullscreen: Self = Self(2);
    #[doc(alias = "WKFullscreenStateExitingFullscreen")]
    pub const ExitingFullscreen: Self = Self(3);
}

unsafe impl Encode for WKFullscreenState {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for WKFullscreenState {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "objc2-app-kit")]
    #[cfg(target_os = "macos")]
    pub struct WKWebView;

    #[cfg(feature = "objc2-app-kit")]
    #[cfg(target_os = "macos")]
    unsafe impl ClassType for WKWebView {
        #[inherits(NSResponder, NSObject)]
        type Super = NSView;
        type Mutability = MainThreadOnly;
    }
);

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
unsafe impl NSAccessibility for WKWebView {}

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
unsafe impl NSAccessibilityElementProtocol for WKWebView {}

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
unsafe impl NSAnimatablePropertyContainer for WKWebView {}

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
unsafe impl NSAppearanceCustomization for WKWebView {}

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
unsafe impl NSCoding for WKWebView {}

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
unsafe impl NSDraggingDestination for WKWebView {}

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
unsafe impl NSObjectProtocol for WKWebView {}

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
unsafe impl NSUserInterfaceItemIdentification for WKWebView {}

extern_methods!(
    #[cfg(feature = "objc2-app-kit")]
    #[cfg(target_os = "macos")]
    unsafe impl WKWebView {
        #[cfg(feature = "WKWebViewConfiguration")]
        #[method_id(@__retain_semantics Other configuration)]
        pub unsafe fn configuration(&self) -> Retained<WKWebViewConfiguration>;

        #[cfg(feature = "WKNavigationDelegate")]
        #[method_id(@__retain_semantics Other navigationDelegate)]
        pub unsafe fn navigationDelegate(
            &self,
        ) -> Option<Retained<ProtocolObject<dyn WKNavigationDelegate>>>;

        #[cfg(feature = "WKNavigationDelegate")]
        #[method(setNavigationDelegate:)]
        pub unsafe fn setNavigationDelegate(
            &self,
            navigation_delegate: Option<&ProtocolObject<dyn WKNavigationDelegate>>,
        );

        #[cfg(feature = "WKUIDelegate")]
        #[method_id(@__retain_semantics Other UIDelegate)]
        pub unsafe fn UIDelegate(&self) -> Option<Retained<ProtocolObject<dyn WKUIDelegate>>>;

        #[cfg(feature = "WKUIDelegate")]
        #[method(setUIDelegate:)]
        pub unsafe fn setUIDelegate(&self, ui_delegate: Option<&ProtocolObject<dyn WKUIDelegate>>);

        #[cfg(feature = "WKBackForwardList")]
        #[method_id(@__retain_semantics Other backForwardList)]
        pub unsafe fn backForwardList(&self) -> Retained<WKBackForwardList>;

        #[cfg(feature = "WKWebViewConfiguration")]
        #[method_id(@__retain_semantics Init initWithFrame:configuration:)]
        pub unsafe fn initWithFrame_configuration(
            this: Allocated<Self>,
            frame: CGRect,
            configuration: &WKWebViewConfiguration,
        ) -> Retained<Self>;

        #[method_id(@__retain_semantics Init initWithCoder:)]
        pub unsafe fn initWithCoder(
            this: Allocated<Self>,
            coder: &NSCoder,
        ) -> Option<Retained<Self>>;

        #[cfg(feature = "WKNavigation")]
        #[method_id(@__retain_semantics Other loadRequest:)]
        pub unsafe fn loadRequest(&self, request: &NSURLRequest) -> Option<Retained<WKNavigation>>;

        #[cfg(feature = "WKNavigation")]
        #[method_id(@__retain_semantics Other loadFileURL:allowingReadAccessToURL:)]
        pub unsafe fn loadFileURL_allowingReadAccessToURL(
            &self,
            url: &NSURL,
            read_access_url: &NSURL,
        ) -> Option<Retained<WKNavigation>>;

        #[cfg(feature = "WKNavigation")]
        #[method_id(@__retain_semantics Other loadHTMLString:baseURL:)]
        pub unsafe fn loadHTMLString_baseURL(
            &self,
            string: &NSString,
            base_url: Option<&NSURL>,
        ) -> Option<Retained<WKNavigation>>;

        #[cfg(feature = "WKNavigation")]
        #[method_id(@__retain_semantics Other loadData:MIMEType:characterEncodingName:baseURL:)]
        pub unsafe fn loadData_MIMEType_characterEncodingName_baseURL(
            &self,
            data: &NSData,
            mime_type: &NSString,
            character_encoding_name: &NSString,
            base_url: &NSURL,
        ) -> Option<Retained<WKNavigation>>;

        #[cfg(all(feature = "WKBackForwardListItem", feature = "WKNavigation"))]
        #[method_id(@__retain_semantics Other goToBackForwardListItem:)]
        pub unsafe fn goToBackForwardListItem(
            &self,
            item: &WKBackForwardListItem,
        ) -> Option<Retained<WKNavigation>>;

        #[method_id(@__retain_semantics Other title)]
        pub unsafe fn title(&self) -> Option<Retained<NSString>>;

        #[method_id(@__retain_semantics Other URL)]
        pub unsafe fn URL(&self) -> Option<Retained<NSURL>>;

        #[method(isLoading)]
        pub unsafe fn isLoading(&self) -> bool;

        #[method(estimatedProgress)]
        pub unsafe fn estimatedProgress(&self) -> c_double;

        #[method(hasOnlySecureContent)]
        pub unsafe fn hasOnlySecureContent(&self) -> bool;

        #[method(canGoBack)]
        pub unsafe fn canGoBack(&self) -> bool;

        #[method(canGoForward)]
        pub unsafe fn canGoForward(&self) -> bool;

        #[cfg(feature = "WKNavigation")]
        #[method_id(@__retain_semantics Other goBack)]
        pub unsafe fn goBack(&self) -> Option<Retained<WKNavigation>>;

        #[cfg(feature = "WKNavigation")]
        #[method_id(@__retain_semantics Other goForward)]
        pub unsafe fn goForward(&self) -> Option<Retained<WKNavigation>>;

        #[cfg(feature = "WKNavigation")]
        #[method_id(@__retain_semantics Other reload)]
        pub unsafe fn reload(&self) -> Option<Retained<WKNavigation>>;

        #[cfg(feature = "WKNavigation")]
        #[method_id(@__retain_semantics Other reloadFromOrigin)]
        pub unsafe fn reloadFromOrigin(&self) -> Option<Retained<WKNavigation>>;

        #[method(stopLoading)]
        pub unsafe fn stopLoading(&self);

        #[cfg(feature = "block2")]
        #[method(evaluateJavaScript:completionHandler:)]
        pub unsafe fn evaluateJavaScript_completionHandler(
            &self,
            java_script_string: &NSString,
            completion_handler: Option<&block2::Block<dyn Fn(*mut AnyObject, *mut NSError)>>,
        );

        #[cfg(all(
            feature = "WKContentWorld",
            feature = "WKFrameInfo",
            feature = "block2"
        ))]
        #[method(evaluateJavaScript:inFrame:inContentWorld:completionHandler:)]
        pub unsafe fn evaluateJavaScript_inFrame_inContentWorld_completionHandler(
            &self,
            java_script_string: &NSString,
            frame: Option<&WKFrameInfo>,
            content_world: &WKContentWorld,
            completion_handler: Option<&block2::Block<dyn Fn(*mut AnyObject, *mut NSError)>>,
        );

        #[cfg(all(
            feature = "WKContentWorld",
            feature = "WKFrameInfo",
            feature = "block2"
        ))]
        #[method(callAsyncJavaScript:arguments:inFrame:inContentWorld:completionHandler:)]
        pub unsafe fn callAsyncJavaScript_arguments_inFrame_inContentWorld_completionHandler(
            &self,
            function_body: &NSString,
            arguments: Option<&NSDictionary<NSString, AnyObject>>,
            frame: Option<&WKFrameInfo>,
            content_world: &WKContentWorld,
            completion_handler: Option<&block2::Block<dyn Fn(*mut AnyObject, *mut NSError)>>,
        );

        #[cfg(feature = "block2")]
        #[method(closeAllMediaPresentationsWithCompletionHandler:)]
        pub unsafe fn closeAllMediaPresentationsWithCompletionHandler(
            &self,
            completion_handler: Option<&block2::Block<dyn Fn()>>,
        );

        #[deprecated]
        #[method(closeAllMediaPresentations)]
        pub unsafe fn closeAllMediaPresentations(&self);

        #[cfg(feature = "block2")]
        #[method(pauseAllMediaPlaybackWithCompletionHandler:)]
        pub unsafe fn pauseAllMediaPlaybackWithCompletionHandler(
            &self,
            completion_handler: Option<&block2::Block<dyn Fn()>>,
        );

        #[cfg(feature = "block2")]
        #[deprecated]
        #[method(pauseAllMediaPlayback:)]
        pub unsafe fn pauseAllMediaPlayback(
            &self,
            completion_handler: Option<&block2::Block<dyn Fn()>>,
        );

        #[cfg(feature = "block2")]
        #[method(setAllMediaPlaybackSuspended:completionHandler:)]
        pub unsafe fn setAllMediaPlaybackSuspended_completionHandler(
            &self,
            suspended: bool,
            completion_handler: Option<&block2::Block<dyn Fn()>>,
        );

        #[cfg(feature = "block2")]
        #[deprecated]
        #[method(resumeAllMediaPlayback:)]
        pub unsafe fn resumeAllMediaPlayback(
            &self,
            completion_handler: Option<&block2::Block<dyn Fn()>>,
        );

        #[cfg(feature = "block2")]
        #[deprecated]
        #[method(suspendAllMediaPlayback:)]
        pub unsafe fn suspendAllMediaPlayback(
            &self,
            completion_handler: Option<&block2::Block<dyn Fn()>>,
        );

        #[cfg(feature = "block2")]
        #[method(requestMediaPlaybackStateWithCompletionHandler:)]
        pub unsafe fn requestMediaPlaybackStateWithCompletionHandler(
            &self,
            completion_handler: &block2::Block<dyn Fn(WKMediaPlaybackState)>,
        );

        #[cfg(feature = "block2")]
        #[deprecated]
        #[method(requestMediaPlaybackState:)]
        pub unsafe fn requestMediaPlaybackState(
            &self,
            completion_handler: &block2::Block<dyn Fn(WKMediaPlaybackState)>,
        );

        #[method(cameraCaptureState)]
        pub unsafe fn cameraCaptureState(&self) -> WKMediaCaptureState;

        #[method(microphoneCaptureState)]
        pub unsafe fn microphoneCaptureState(&self) -> WKMediaCaptureState;

        #[cfg(feature = "block2")]
        #[method(setCameraCaptureState:completionHandler:)]
        pub unsafe fn setCameraCaptureState_completionHandler(
            &self,
            state: WKMediaCaptureState,
            completion_handler: Option<&block2::Block<dyn Fn()>>,
        );

        #[cfg(feature = "block2")]
        #[method(setMicrophoneCaptureState:completionHandler:)]
        pub unsafe fn setMicrophoneCaptureState_completionHandler(
            &self,
            state: WKMediaCaptureState,
            completion_handler: Option<&block2::Block<dyn Fn()>>,
        );

        #[cfg(all(feature = "WKSnapshotConfiguration", feature = "block2"))]
        #[method(takeSnapshotWithConfiguration:completionHandler:)]
        pub unsafe fn takeSnapshotWithConfiguration_completionHandler(
            &self,
            snapshot_configuration: Option<&WKSnapshotConfiguration>,
            completion_handler: &block2::Block<dyn Fn(*mut NSImage, *mut NSError)>,
        );

        #[cfg(all(feature = "WKPDFConfiguration", feature = "block2"))]
        #[method(createPDFWithConfiguration:completionHandler:)]
        pub unsafe fn createPDFWithConfiguration_completionHandler(
            &self,
            pdf_configuration: Option<&WKPDFConfiguration>,
            completion_handler: &block2::Block<dyn Fn(*mut NSData, *mut NSError)>,
        );

        #[cfg(feature = "block2")]
        #[method(createWebArchiveDataWithCompletionHandler:)]
        pub unsafe fn createWebArchiveDataWithCompletionHandler(
            &self,
            completion_handler: &block2::Block<dyn Fn(NonNull<NSData>, NonNull<NSError>)>,
        );

        #[method(allowsBackForwardNavigationGestures)]
        pub unsafe fn allowsBackForwardNavigationGestures(&self) -> bool;

        #[method(setAllowsBackForwardNavigationGestures:)]
        pub unsafe fn setAllowsBackForwardNavigationGestures(
            &self,
            allows_back_forward_navigation_gestures: bool,
        );

        #[method_id(@__retain_semantics Other customUserAgent)]
        pub unsafe fn customUserAgent(&self) -> Option<Retained<NSString>>;

        #[method(setCustomUserAgent:)]
        pub unsafe fn setCustomUserAgent(&self, custom_user_agent: Option<&NSString>);

        #[method(allowsLinkPreview)]
        pub unsafe fn allowsLinkPreview(&self) -> bool;

        #[method(setAllowsLinkPreview:)]
        pub unsafe fn setAllowsLinkPreview(&self, allows_link_preview: bool);

        #[method(allowsMagnification)]
        pub unsafe fn allowsMagnification(&self) -> bool;

        #[method(setAllowsMagnification:)]
        pub unsafe fn setAllowsMagnification(&self, allows_magnification: bool);

        #[method(magnification)]
        pub unsafe fn magnification(&self) -> CGFloat;

        #[method(setMagnification:)]
        pub unsafe fn setMagnification(&self, magnification: CGFloat);

        #[method(setMagnification:centeredAtPoint:)]
        pub unsafe fn setMagnification_centeredAtPoint(
            &self,
            magnification: CGFloat,
            point: CGPoint,
        );

        #[method(pageZoom)]
        pub unsafe fn pageZoom(&self) -> CGFloat;

        #[method(setPageZoom:)]
        pub unsafe fn setPageZoom(&self, page_zoom: CGFloat);

        #[cfg(all(
            feature = "WKFindConfiguration",
            feature = "WKFindResult",
            feature = "block2"
        ))]
        #[method(findString:withConfiguration:completionHandler:)]
        pub unsafe fn findString_withConfiguration_completionHandler(
            &self,
            string: &NSString,
            configuration: Option<&WKFindConfiguration>,
            completion_handler: &block2::Block<dyn Fn(NonNull<WKFindResult>)>,
        );

        #[method(handlesURLScheme:)]
        pub unsafe fn handlesURLScheme(url_scheme: &NSString, mtm: MainThreadMarker) -> bool;

        #[cfg(all(feature = "WKDownload", feature = "block2"))]
        #[method(startDownloadUsingRequest:completionHandler:)]
        pub unsafe fn startDownloadUsingRequest_completionHandler(
            &self,
            request: &NSURLRequest,
            completion_handler: &block2::Block<dyn Fn(NonNull<WKDownload>)>,
        );

        #[cfg(all(feature = "WKDownload", feature = "block2"))]
        #[method(resumeDownloadFromResumeData:completionHandler:)]
        pub unsafe fn resumeDownloadFromResumeData_completionHandler(
            &self,
            resume_data: &NSData,
            completion_handler: &block2::Block<dyn Fn(NonNull<WKDownload>)>,
        );

        #[method_id(@__retain_semantics Other mediaType)]
        pub unsafe fn mediaType(&self) -> Option<Retained<NSString>>;

        #[method(setMediaType:)]
        pub unsafe fn setMediaType(&self, media_type: Option<&NSString>);

        #[method_id(@__retain_semantics Other interactionState)]
        pub unsafe fn interactionState(&self) -> Option<Retained<AnyObject>>;

        #[method(setInteractionState:)]
        pub unsafe fn setInteractionState(&self, interaction_state: Option<&AnyObject>);

        #[cfg(feature = "WKNavigation")]
        #[method_id(@__retain_semantics Other loadSimulatedRequest:response:responseData:)]
        pub unsafe fn loadSimulatedRequest_response_responseData(
            &self,
            request: &NSURLRequest,
            response: &NSURLResponse,
            data: &NSData,
        ) -> Retained<WKNavigation>;

        #[cfg(feature = "WKNavigation")]
        #[deprecated]
        #[method_id(@__retain_semantics Other loadSimulatedRequest:withResponse:responseData:)]
        pub unsafe fn loadSimulatedRequest_withResponse_responseData(
            &self,
            request: &NSURLRequest,
            response: &NSURLResponse,
            data: &NSData,
        ) -> Retained<WKNavigation>;

        #[cfg(feature = "WKNavigation")]
        #[method_id(@__retain_semantics Other loadFileRequest:allowingReadAccessToURL:)]
        pub unsafe fn loadFileRequest_allowingReadAccessToURL(
            &self,
            request: &NSURLRequest,
            read_access_url: &NSURL,
        ) -> Retained<WKNavigation>;

        #[cfg(feature = "WKNavigation")]
        #[method_id(@__retain_semantics Other loadSimulatedRequest:responseHTMLString:)]
        pub unsafe fn loadSimulatedRequest_responseHTMLString(
            &self,
            request: &NSURLRequest,
            string: &NSString,
        ) -> Retained<WKNavigation>;

        #[cfg(feature = "WKNavigation")]
        #[deprecated]
        #[method_id(@__retain_semantics Other loadSimulatedRequest:withResponseHTMLString:)]
        pub unsafe fn loadSimulatedRequest_withResponseHTMLString(
            &self,
            request: &NSURLRequest,
            string: &NSString,
        ) -> Retained<WKNavigation>;

        #[method_id(@__retain_semantics Other printOperationWithPrintInfo:)]
        pub unsafe fn printOperationWithPrintInfo(
            &self,
            print_info: &NSPrintInfo,
        ) -> Retained<NSPrintOperation>;

        #[method_id(@__retain_semantics Other themeColor)]
        pub unsafe fn themeColor(&self) -> Option<Retained<NSColor>>;

        #[method_id(@__retain_semantics Other underPageBackgroundColor)]
        pub unsafe fn underPageBackgroundColor(&self) -> Retained<NSColor>;

        #[method(setUnderPageBackgroundColor:)]
        pub unsafe fn setUnderPageBackgroundColor(
            &self,
            under_page_background_color: Option<&NSColor>,
        );

        #[method(fullscreenState)]
        pub unsafe fn fullscreenState(&self) -> WKFullscreenState;

        #[method(minimumViewportInset)]
        pub unsafe fn minimumViewportInset(&self) -> NSEdgeInsets;

        #[method(maximumViewportInset)]
        pub unsafe fn maximumViewportInset(&self) -> NSEdgeInsets;

        #[method(setMinimumViewportInset:maximumViewportInset:)]
        pub unsafe fn setMinimumViewportInset_maximumViewportInset(
            &self,
            minimum_viewport_inset: NSEdgeInsets,
            maximum_viewport_inset: NSEdgeInsets,
        );

        #[method(isInspectable)]
        pub unsafe fn isInspectable(&self) -> bool;

        #[method(setInspectable:)]
        pub unsafe fn setInspectable(&self, inspectable: bool);
    }
);

extern_methods!(
    /// Methods declared on superclass `NSView`
    #[cfg(feature = "objc2-app-kit")]
    #[cfg(target_os = "macos")]
    unsafe impl WKWebView {
        #[method_id(@__retain_semantics Init initWithFrame:)]
        pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSResponder`
    #[cfg(feature = "objc2-app-kit")]
    #[cfg(target_os = "macos")]
    unsafe impl WKWebView {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(feature = "objc2-app-kit")]
    #[cfg(target_os = "macos")]
    unsafe impl WKWebView {
        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
    }
);

extern_methods!(
    /// WKIBActions
    #[cfg(feature = "objc2-app-kit")]
    #[cfg(target_os = "macos")]
    unsafe impl WKWebView {
        #[method(goBack:)]
        pub unsafe fn goBack_(&self, sender: Option<&AnyObject>);

        #[method(goForward:)]
        pub unsafe fn goForward_(&self, sender: Option<&AnyObject>);

        #[method(reload:)]
        pub unsafe fn reload_(&self, sender: Option<&AnyObject>);

        #[method(reloadFromOrigin:)]
        pub unsafe fn reloadFromOrigin_(&self, sender: Option<&AnyObject>);

        #[method(stopLoading:)]
        pub unsafe fn stopLoading_(&self, sender: Option<&AnyObject>);
    }
);

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
unsafe impl NSUserInterfaceValidations for WKWebView {}

extern_methods!(
    /// WKNSTextFinderClient
    #[cfg(feature = "objc2-app-kit")]
    #[cfg(target_os = "macos")]
    unsafe impl WKWebView {}
);

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
unsafe impl NSTextFinderClient for WKWebView {}

extern_methods!(
    /// WKDeprecated
    #[cfg(feature = "objc2-app-kit")]
    #[cfg(target_os = "macos")]
    unsafe impl WKWebView {
        #[deprecated]
        #[method_id(@__retain_semantics Other certificateChain)]
        pub unsafe fn certificateChain(&self) -> Retained<NSArray>;
    }
);