objc2-web-kit 0.3.1

Bindings to the WebKit framework
Documentation
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
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
use objc2_app_kit::*;
use objc2_foundation::*;

use crate::*;

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/webelementdomnodekey?language=objc)
    pub static WebElementDOMNodeKey: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/webelementframekey?language=objc)
    pub static WebElementFrameKey: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/webelementimagealtstringkey?language=objc)
    pub static WebElementImageAltStringKey: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/webelementimagekey?language=objc)
    pub static WebElementImageKey: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/webelementimagerectkey?language=objc)
    pub static WebElementImageRectKey: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/webelementimageurlkey?language=objc)
    pub static WebElementImageURLKey: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/webelementisselectedkey?language=objc)
    pub static WebElementIsSelectedKey: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/webelementlinkurlkey?language=objc)
    pub static WebElementLinkURLKey: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/webelementlinktargetframekey?language=objc)
    pub static WebElementLinkTargetFrameKey: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/webelementlinktitlekey?language=objc)
    pub static WebElementLinkTitleKey: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/webelementlinklabelkey?language=objc)
    pub static WebElementLinkLabelKey: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/webviewprogressstartednotification?language=objc)
    pub static WebViewProgressStartedNotification: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/webviewprogressestimatechangednotification?language=objc)
    pub static WebViewProgressEstimateChangedNotification: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/webviewprogressfinishednotification?language=objc)
    pub static WebViewProgressFinishedNotification: Option<&'static NSString>;
}

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/webview?language=objc)
    #[unsafe(super(NSView, NSResponder, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "objc2-app-kit")]
    #[cfg(target_os = "macos")]
    #[deprecated = "No longer supported; please adopt WKWebView."]
    pub struct WebView;
);

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

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

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

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

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

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

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

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

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl WebView {
    extern_methods!(
        /// Checks if the WebKit can show content of a certain MIME type.
        ///
        /// Parameter `MIMEType`: The MIME type to check.
        ///
        /// Returns: YES if the WebKit can show content with MIMEtype.
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(canShowMIMEType:))]
        #[unsafe(method_family = none)]
        pub unsafe fn canShowMIMEType(mime_type: Option<&NSString>, mtm: MainThreadMarker) -> bool;

        /// Checks if the MIME type is a type that the WebKit will interpret as HTML.
        ///
        /// Parameter `MIMEType`: The MIME type to check.
        ///
        /// Returns: YES if the MIMEtype in an HTML type.
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(canShowMIMETypeAsHTML:))]
        #[unsafe(method_family = none)]
        pub unsafe fn canShowMIMETypeAsHTML(
            mime_type: Option<&NSString>,
            mtm: MainThreadMarker,
        ) -> bool;

        /// Returns: Returns an array of NSStrings that describe the MIME types
        /// WebKit will attempt to render as HTML.
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(MIMETypesShownAsHTML))]
        #[unsafe(method_family = none)]
        pub unsafe fn MIMETypesShownAsHTML(mtm: MainThreadMarker) -> Option<Retained<NSArray>>;

        /// Sets the array of NSString MIME types that WebKit will
        /// attempt to render as HTML.  Typically you will retrieve the built-in
        /// array using MIMETypesShownAsHTML and add additional MIME types to that
        /// array.
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(setMIMETypesShownAsHTML:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setMIMETypesShownAsHTML(mime_types: Option<&NSArray>, mtm: MainThreadMarker);

        /// Returns a URL from a pasteboard
        ///
        /// Parameter `pasteboard`: The pasteboard with a URL
        ///
        /// Returns: A URL if the pasteboard has one. Nil if it does not.
        ///
        /// This method differs than NSURL's URLFromPasteboard method in that it tries multiple pasteboard types
        /// including NSURLPboardType to find a URL on the pasteboard.
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(URLFromPasteboard:))]
        #[unsafe(method_family = none)]
        pub unsafe fn URLFromPasteboard(
            pasteboard: Option<&NSPasteboard>,
            mtm: MainThreadMarker,
        ) -> Option<Retained<NSURL>>;

        /// Returns a URL title from a pasteboard
        ///
        /// Parameter `pasteboard`: The pasteboard with a URL title
        ///
        /// Returns: A URL title if the pasteboard has one. Nil if it does not.
        ///
        /// This method returns a title that refers a URL on the pasteboard. An example of this is the link label
        /// which is the text inside the anchor tag.
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(URLTitleFromPasteboard:))]
        #[unsafe(method_family = none)]
        pub unsafe fn URLTitleFromPasteboard(
            pasteboard: Option<&NSPasteboard>,
            mtm: MainThreadMarker,
        ) -> Option<Retained<NSString>>;

        /// Adds the scheme to the list of schemes to be treated as local.
        ///
        /// Parameter `scheme`: The scheme to register
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(registerURLSchemeAsLocal:))]
        #[unsafe(method_family = none)]
        pub unsafe fn registerURLSchemeAsLocal(scheme: Option<&NSString>, mtm: MainThreadMarker);

        /// The designated initializer for WebView.
        ///
        /// Initialize a WebView with the supplied parameters. This method will
        /// create a main WebFrame with the view. Passing a top level frame name is useful if you
        /// handle a targetted frame navigation that would normally open a window in some other
        /// way that still ends up creating a new WebView.
        ///
        /// Parameter `frame`: The frame used to create the view.
        ///
        /// Parameter `frameName`: The name to use for the top level frame. May be nil.
        ///
        /// Parameter `groupName`: The name of the webView set to which this webView will be added.  May be nil.
        ///
        /// Returns: Returns an initialized WebView.
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(initWithFrame:frameName:groupName:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithFrame_frameName_groupName(
            this: Allocated<Self>,
            frame: NSRect,
            frame_name: Option<&NSString>,
            group_name: Option<&NSString>,
        ) -> Option<Retained<Self>>;

        /// Closes the receiver, unloading its web page and canceling any pending loads.
        /// Once the receiver has closed, it will no longer respond to requests or fire delegate methods.
        /// (However, the -close method itself may fire delegate methods.)
        ///
        /// A garbage collected application is required to call close when the receiver is no longer needed.
        /// The close method will be called automatically when the window or hostWindow closes and shouldCloseWithWindow returns YES.
        /// A non-garbage collected application can still call close, providing a convenient way to prevent receiver
        /// from doing any more loading and firing any future delegate methods.
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(close))]
        #[unsafe(method_family = none)]
        pub unsafe fn close(&self);

        /// Whether the receiver closes when either it's window or hostWindow closes.
        ///
        /// Defaults to YES in garbage collected applications, otherwise NO to maintain backwards compatibility.
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(shouldCloseWithWindow))]
        #[unsafe(method_family = none)]
        pub unsafe fn shouldCloseWithWindow(&self) -> bool;

        /// Setter for [`shouldCloseWithWindow`][Self::shouldCloseWithWindow].
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(setShouldCloseWithWindow:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setShouldCloseWithWindow(&self, should_close_with_window: bool);

        #[cfg(feature = "WebUIDelegate")]
        /// The WebView's WebUIDelegate.
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(UIDelegate))]
        #[unsafe(method_family = none)]
        pub unsafe fn UIDelegate(&self) -> Option<Retained<ProtocolObject<dyn WebUIDelegate>>>;

        #[cfg(feature = "WebUIDelegate")]
        /// Setter for [`UIDelegate`][Self::UIDelegate].
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(setUIDelegate:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setUIDelegate(&self, ui_delegate: Option<&ProtocolObject<dyn WebUIDelegate>>);

        #[cfg(feature = "WebResourceLoadDelegate")]
        /// The WebView's WebResourceLoadDelegate.
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(resourceLoadDelegate))]
        #[unsafe(method_family = none)]
        pub unsafe fn resourceLoadDelegate(
            &self,
        ) -> Option<Retained<ProtocolObject<dyn WebResourceLoadDelegate>>>;

        #[cfg(feature = "WebResourceLoadDelegate")]
        /// Setter for [`resourceLoadDelegate`][Self::resourceLoadDelegate].
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(setResourceLoadDelegate:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setResourceLoadDelegate(
            &self,
            resource_load_delegate: Option<&ProtocolObject<dyn WebResourceLoadDelegate>>,
        );

        #[cfg(feature = "WebDownload")]
        /// The WebView's WebDownloadDelegate.
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(downloadDelegate))]
        #[unsafe(method_family = none)]
        pub unsafe fn downloadDelegate(
            &self,
        ) -> Option<Retained<ProtocolObject<dyn WebDownloadDelegate>>>;

        #[cfg(feature = "WebDownload")]
        /// Setter for [`downloadDelegate`][Self::downloadDelegate].
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(setDownloadDelegate:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setDownloadDelegate(
            &self,
            download_delegate: Option<&ProtocolObject<dyn WebDownloadDelegate>>,
        );

        #[cfg(feature = "WebFrameLoadDelegate")]
        /// The WebView's WebFrameLoadDelegate delegate.
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(frameLoadDelegate))]
        #[unsafe(method_family = none)]
        pub unsafe fn frameLoadDelegate(
            &self,
        ) -> Option<Retained<ProtocolObject<dyn WebFrameLoadDelegate>>>;

        #[cfg(feature = "WebFrameLoadDelegate")]
        /// Setter for [`frameLoadDelegate`][Self::frameLoadDelegate].
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(setFrameLoadDelegate:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setFrameLoadDelegate(
            &self,
            frame_load_delegate: Option<&ProtocolObject<dyn WebFrameLoadDelegate>>,
        );

        #[cfg(feature = "WebPolicyDelegate")]
        /// The WebView's WebPolicyDelegate.
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(policyDelegate))]
        #[unsafe(method_family = none)]
        pub unsafe fn policyDelegate(
            &self,
        ) -> Option<Retained<ProtocolObject<dyn WebPolicyDelegate>>>;

        #[cfg(feature = "WebPolicyDelegate")]
        /// Setter for [`policyDelegate`][Self::policyDelegate].
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(setPolicyDelegate:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setPolicyDelegate(
            &self,
            policy_delegate: Option<&ProtocolObject<dyn WebPolicyDelegate>>,
        );

        #[cfg(feature = "WebFrame")]
        /// The top level frame.
        ///
        /// Note that even documents that are not framesets will have a mainFrame.
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(mainFrame))]
        #[unsafe(method_family = none)]
        pub unsafe fn mainFrame(&self) -> Option<Retained<WebFrame>>;

        #[cfg(feature = "WebFrame")]
        /// The frame that has the active selection.
        ///
        /// Returns the frame that contains the first responder, if any. Otherwise returns the
        /// frame that contains a non-zero-length selection, if any. Returns nil if no frame meets these criteria.
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(selectedFrame))]
        #[unsafe(method_family = none)]
        pub unsafe fn selectedFrame(&self) -> Option<Retained<WebFrame>>;

        #[cfg(feature = "WebBackForwardList")]
        /// The backforward list for this WebView.
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(backForwardList))]
        #[unsafe(method_family = none)]
        pub unsafe fn backForwardList(&self) -> Option<Retained<WebBackForwardList>>;

        /// Enable or disable the use of a backforward list for this webView.
        ///
        /// Parameter `flag`: Turns use of the back forward list on or off
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(setMaintainsBackForwardList:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setMaintainsBackForwardList(&self, flag: bool);

        /// Go back to the previous URL in the backforward list.
        ///
        /// Returns: YES if able to go back in the backforward list, NO otherwise.
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(goBack))]
        #[unsafe(method_family = none)]
        pub unsafe fn goBack(&self) -> bool;

        /// Go forward to the next URL in the backforward list.
        ///
        /// Returns: YES if able to go forward in the backforward list, NO otherwise.
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(goForward))]
        #[unsafe(method_family = none)]
        pub unsafe fn goForward(&self) -> bool;

        #[cfg(feature = "WebHistoryItem")]
        /// Go back or forward to an item in the backforward list.
        ///
        /// Returns: YES if able to go to the item, NO otherwise.
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(goToBackForwardItem:))]
        #[unsafe(method_family = none)]
        pub unsafe fn goToBackForwardItem(&self, item: Option<&WebHistoryItem>) -> bool;

        /// The text size multipler.
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(textSizeMultiplier))]
        #[unsafe(method_family = none)]
        pub unsafe fn textSizeMultiplier(&self) -> c_float;

        /// Setter for [`textSizeMultiplier`][Self::textSizeMultiplier].
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(setTextSizeMultiplier:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setTextSizeMultiplier(&self, text_size_multiplier: c_float);

        /// The name of the application as used in the user-agent string.
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(applicationNameForUserAgent))]
        #[unsafe(method_family = none)]
        pub unsafe fn applicationNameForUserAgent(&self) -> Retained<NSString>;

        /// Setter for [`applicationNameForUserAgent`][Self::applicationNameForUserAgent].
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(setApplicationNameForUserAgent:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setApplicationNameForUserAgent(
            &self,
            application_name_for_user_agent: Option<&NSString>,
        );

        /// The custom user-agent string or nil if no custom user-agent string has been set.
        ///
        /// Setting this means that the webView should use this user-agent string
        /// instead of constructing a user-agent string for each URL. Setting it to nil
        /// causes the webView to construct the user-agent string for each URL
        /// for best results rendering web pages
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(customUserAgent))]
        #[unsafe(method_family = none)]
        pub unsafe fn customUserAgent(&self) -> Retained<NSString>;

        /// Setter for [`customUserAgent`][Self::customUserAgent].
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(setCustomUserAgent:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setCustomUserAgent(&self, custom_user_agent: Option<&NSString>);

        /// Get the appropriate user-agent string for a particular URL.
        ///
        /// Parameter `URL`: The URL.
        ///
        /// Returns: The user-agent string for the supplied URL.
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(userAgentForURL:))]
        #[unsafe(method_family = none)]
        pub unsafe fn userAgentForURL(&self, url: Option<&NSURL>) -> Option<Retained<NSString>>;

        /// If the document view of the current web page can support different text encodings.
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(supportsTextEncoding))]
        #[unsafe(method_family = none)]
        pub unsafe fn supportsTextEncoding(&self) -> bool;

        /// The custom text encoding name or nil if no custom text encoding name has been set.
        ///
        /// Make the page display with a different text encoding; stops any load in progress.
        /// The text encoding passed in overrides the normal text encoding smarts including
        /// what's specified in a web page's header or HTTP response.
        /// The text encoding automatically goes back to the default when the top level frame
        /// changes to a new location.
        /// Setting the text encoding name to nil makes the webView use default encoding rules.
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(customTextEncodingName))]
        #[unsafe(method_family = none)]
        pub unsafe fn customTextEncodingName(&self) -> Retained<NSString>;

        /// Setter for [`customTextEncodingName`][Self::customTextEncodingName].
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(setCustomTextEncodingName:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setCustomTextEncodingName(
            &self,
            custom_text_encoding_name: Option<&NSString>,
        );

        /// The media style for the WebView.
        ///
        /// The mediaStyle will override the normal value
        /// of the CSS media property. Setting the value to nil will restore the normal value. The value will be nil unless explicitly set.
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(mediaStyle))]
        #[unsafe(method_family = none)]
        pub unsafe fn mediaStyle(&self) -> Retained<NSString>;

        /// Setter for [`mediaStyle`][Self::mediaStyle].
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(setMediaStyle:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setMediaStyle(&self, media_style: Option<&NSString>);

        /// Parameter `script`: The text of the JavaScript.
        ///
        /// Returns: The result of the script, converted to a string, or nil for failure.
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(stringByEvaluatingJavaScriptFromString:))]
        #[unsafe(method_family = none)]
        pub unsafe fn stringByEvaluatingJavaScriptFromString(
            &self,
            script: Option<&NSString>,
        ) -> Option<Retained<NSString>>;

        #[cfg(feature = "WebScriptObject")]
        /// A WebScriptObject that represents the
        /// window object from the script environment.
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(windowScriptObject))]
        #[unsafe(method_family = none)]
        pub unsafe fn windowScriptObject(&self) -> Option<Retained<WebScriptObject>>;

        #[cfg(feature = "WebPreferences")]
        /// The preferences used by this WebView.
        ///
        /// This method will return [WebPreferences standardPreferences] if no
        /// other instance of WebPreferences has been set.
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(preferences))]
        #[unsafe(method_family = none)]
        pub unsafe fn preferences(&self) -> Option<Retained<WebPreferences>>;

        #[cfg(feature = "WebPreferences")]
        /// Setter for [`preferences`][Self::preferences].
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(setPreferences:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setPreferences(&self, preferences: Option<&WebPreferences>);

        /// The WebPreferences key prefix.
        ///
        /// If the WebPreferences for this WebView are stored in the user defaults database, this string will be used as a key prefix.
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(preferencesIdentifier))]
        #[unsafe(method_family = none)]
        pub unsafe fn preferencesIdentifier(&self) -> Retained<NSString>;

        /// Setter for [`preferencesIdentifier`][Self::preferencesIdentifier].
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(setPreferencesIdentifier:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setPreferencesIdentifier(&self, preferences_identifier: Option<&NSString>);

        /// The host window for the web view.
        ///
        /// Parts of WebKit (such as plug-ins and JavaScript) depend on a window to function
        /// properly. Set a host window so these parts continue to function even when the web view is
        /// not in an actual window.
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(hostWindow))]
        #[unsafe(method_family = none)]
        pub unsafe fn hostWindow(&self) -> Option<Retained<NSWindow>>;

        /// Setter for [`hostWindow`][Self::hostWindow].
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(setHostWindow:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setHostWindow(&self, host_window: Option<&NSWindow>);

        /// Searches a document view for a string and highlights the string if it is found.
        /// Starts the search from the current selection.  Will search across all frames.
        ///
        /// Parameter `string`: The string to search for.
        ///
        /// Parameter `forward`: YES to search forward, NO to seach backwards.
        ///
        /// Parameter `caseFlag`: YES to for case-sensitive search, NO for case-insensitive search.
        ///
        /// Returns: YES if found, NO if not found.
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(searchFor:direction:caseSensitive:wrap:))]
        #[unsafe(method_family = none)]
        pub unsafe fn searchFor_direction_caseSensitive_wrap(
            &self,
            string: Option<&NSString>,
            forward: bool,
            case_flag: bool,
            wrap_flag: bool,
        ) -> bool;

        /// Register classes that implement WebDocumentView and WebDocumentRepresentation respectively.
        /// A document class may register for a primary MIME type by excluding
        /// a subtype, i.e. "video/" will match the document class with
        /// all video types.  More specific matching takes precedence
        /// over general matching.
        ///
        /// Parameter `viewClass`: The WebDocumentView class to use to render data for a given MIME type.
        ///
        /// Parameter `representationClass`: The WebDocumentRepresentation class to use to represent data of the given MIME type.
        ///
        /// Parameter `MIMEType`: The MIME type to represent with an object of the given class.
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(registerViewClass:representationClass:forMIMEType:))]
        #[unsafe(method_family = none)]
        pub unsafe fn registerViewClass_representationClass_forMIMEType(
            view_class: Option<&AnyClass>,
            representation_class: Option<&AnyClass>,
            mime_type: Option<&NSString>,
            mtm: MainThreadMarker,
        );

        /// The group name for this WebView.
        ///
        /// JavaScript may access named frames within the same group.
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(groupName))]
        #[unsafe(method_family = none)]
        pub unsafe fn groupName(&self) -> Retained<NSString>;

        /// Setter for [`groupName`][Self::groupName].
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(setGroupName:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setGroupName(&self, group_name: Option<&NSString>);

        /// An estimate of the percent complete for a document load.  This
        /// value will range from 0 to 1.0 and, once a load completes, will remain at 1.0
        /// until a new load starts, at which point it will be reset to 0.  The value is an
        /// estimate based on the total number of bytes expected to be received
        /// for a document, including all it's possible subresources.  For more accurate progress
        /// indication it is recommended that you implement a WebFrameLoadDelegate and a
        /// WebResourceLoadDelegate.
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(estimatedProgress))]
        #[unsafe(method_family = none)]
        pub unsafe fn estimatedProgress(&self) -> c_double;

        /// Whether there are any pending loads in this WebView.
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(isLoading))]
        #[unsafe(method_family = none)]
        pub unsafe fn isLoading(&self) -> bool;

        /// Parameter `point`: A point in the coordinates of the WebView
        ///
        /// Returns: An element dictionary describing the point
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(elementAtPoint:))]
        #[unsafe(method_family = none)]
        pub unsafe fn elementAtPoint(&self, point: NSPoint) -> Option<Retained<NSDictionary>>;

        /// The pasteboard types that the WebView can use for the current selection
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(pasteboardTypesForSelection))]
        #[unsafe(method_family = none)]
        pub unsafe fn pasteboardTypesForSelection(&self) -> Retained<NSArray>;

        /// Writes the current selection to the pasteboard
        ///
        /// Parameter `types`: The types that WebView will write to the pasteboard
        ///
        /// Parameter `pasteboard`: The pasteboard to write to
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(writeSelectionWithPasteboardTypes:toPasteboard:))]
        #[unsafe(method_family = none)]
        pub unsafe fn writeSelectionWithPasteboardTypes_toPasteboard(
            &self,
            types: Option<&NSArray>,
            pasteboard: Option<&NSPasteboard>,
        );

        /// Returns the pasteboard types that WebView can use for an element
        ///
        /// Parameter `element`: The element
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(pasteboardTypesForElement:))]
        #[unsafe(method_family = none)]
        pub unsafe fn pasteboardTypesForElement(
            &self,
            element: Option<&NSDictionary>,
        ) -> Option<Retained<NSArray>>;

        /// Writes an element to the pasteboard
        ///
        /// Parameter `element`: The element to write to the pasteboard
        ///
        /// Parameter `types`: The types that WebView will write to the pasteboard
        ///
        /// Parameter `pasteboard`: The pasteboard to write to
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(writeElement:withPasteboardTypes:toPasteboard:))]
        #[unsafe(method_family = none)]
        pub unsafe fn writeElement_withPasteboardTypes_toPasteboard(
            &self,
            element: Option<&NSDictionary>,
            types: Option<&NSArray>,
            pasteboard: Option<&NSPasteboard>,
        );

        /// Parameter `point`: A point in the coordinates of the WebView
        ///
        /// This method moves the caret that shows where something being dragged will be dropped. It may cause the WebView to scroll
        /// to make the new position of the drag caret visible.
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(moveDragCaretToPoint:))]
        #[unsafe(method_family = none)]
        pub unsafe fn moveDragCaretToPoint(&self, point: NSPoint);

        /// Removes the drag caret from the WebView
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(removeDragCaret))]
        #[unsafe(method_family = none)]
        pub unsafe fn removeDragCaret(&self);

        /// Whether the receiver draws a default white background when the loaded page has no background specified.
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(drawsBackground))]
        #[unsafe(method_family = none)]
        pub unsafe fn drawsBackground(&self) -> bool;

        /// Setter for [`drawsBackground`][Self::drawsBackground].
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(setDrawsBackground:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setDrawsBackground(&self, draws_background: bool);

        /// Whether the WebView is always updated even when it is not in a window that is currently visible.
        ///
        /// If set to NO, then whenever the web view is not in a visible window, updates to the web page will not necessarily be rendered in the view.
        /// However, when the window is made visible, the view will be updated automatically. Not updating while hidden can improve performance. If set to is YES,
        /// hidden web views are always updated. This is the default.
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(shouldUpdateWhileOffscreen))]
        #[unsafe(method_family = none)]
        pub unsafe fn shouldUpdateWhileOffscreen(&self) -> bool;

        /// Setter for [`shouldUpdateWhileOffscreen`][Self::shouldUpdateWhileOffscreen].
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(setShouldUpdateWhileOffscreen:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setShouldUpdateWhileOffscreen(&self, should_update_while_offscreen: bool);

        /// The main frame's current URL.
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(mainFrameURL))]
        #[unsafe(method_family = none)]
        pub unsafe fn mainFrameURL(&self) -> Retained<NSString>;

        /// Setter for [`mainFrameURL`][Self::mainFrameURL].
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(setMainFrameURL:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setMainFrameURL(&self, main_frame_url: Option<&NSString>);

        #[cfg(all(
            feature = "DOMDocument",
            feature = "DOMNode",
            feature = "DOMObject",
            feature = "WebScriptObject"
        ))]
        /// The main frame's DOMDocument.
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(mainFrameDocument))]
        #[unsafe(method_family = none)]
        pub unsafe fn mainFrameDocument(&self) -> Option<Retained<DOMDocument>>;

        /// The main frame's title if any, otherwise an empty string.
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(mainFrameTitle))]
        #[unsafe(method_family = none)]
        pub unsafe fn mainFrameTitle(&self) -> Retained<NSString>;

        /// The site icon for the current page loaded in the mainFrame, or nil.
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(mainFrameIcon))]
        #[unsafe(method_family = none)]
        pub unsafe fn mainFrameIcon(&self) -> Option<Retained<NSImage>>;
    );
}

/// Methods declared on superclass `NSView`.
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl WebView {
    extern_methods!(
        #[unsafe(method(initWithFrame:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;

        #[unsafe(method(initWithCoder:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithCoder(
            this: Allocated<Self>,
            coder: &NSCoder,
        ) -> Option<Retained<Self>>;
    );
}

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

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

/// WebIBActions.
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl WebView {
    extern_methods!(
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(takeStringURLFrom:))]
        #[unsafe(method_family = none)]
        pub unsafe fn takeStringURLFrom(&self, sender: Option<&AnyObject>);

        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(stopLoading:))]
        #[unsafe(method_family = none)]
        pub unsafe fn stopLoading(&self, sender: Option<&AnyObject>);

        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(reload:))]
        #[unsafe(method_family = none)]
        pub unsafe fn reload(&self, sender: Option<&AnyObject>);

        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(reloadFromOrigin:))]
        #[unsafe(method_family = none)]
        pub unsafe fn reloadFromOrigin(&self, sender: Option<&AnyObject>);

        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(canGoBack))]
        #[unsafe(method_family = none)]
        pub unsafe fn canGoBack(&self) -> bool;

        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(goBack:))]
        #[unsafe(method_family = none)]
        pub unsafe fn goBack_(&self, sender: Option<&AnyObject>);

        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(canGoForward))]
        #[unsafe(method_family = none)]
        pub unsafe fn canGoForward(&self) -> bool;

        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(goForward:))]
        #[unsafe(method_family = none)]
        pub unsafe fn goForward_(&self, sender: Option<&AnyObject>);

        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(canMakeTextLarger))]
        #[unsafe(method_family = none)]
        pub unsafe fn canMakeTextLarger(&self) -> bool;

        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(makeTextLarger:))]
        #[unsafe(method_family = none)]
        pub unsafe fn makeTextLarger(&self, sender: Option<&AnyObject>);

        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(canMakeTextSmaller))]
        #[unsafe(method_family = none)]
        pub unsafe fn canMakeTextSmaller(&self) -> bool;

        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(makeTextSmaller:))]
        #[unsafe(method_family = none)]
        pub unsafe fn makeTextSmaller(&self, sender: Option<&AnyObject>);

        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(canMakeTextStandardSize))]
        #[unsafe(method_family = none)]
        pub unsafe fn canMakeTextStandardSize(&self) -> bool;

        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(makeTextStandardSize:))]
        #[unsafe(method_family = none)]
        pub unsafe fn makeTextStandardSize(&self, sender: Option<&AnyObject>);

        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(toggleContinuousSpellChecking:))]
        #[unsafe(method_family = none)]
        pub unsafe fn toggleContinuousSpellChecking(&self, sender: Option<&AnyObject>);

        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(toggleSmartInsertDelete:))]
        #[unsafe(method_family = none)]
        pub unsafe fn toggleSmartInsertDelete(&self, sender: Option<&AnyObject>);
    );
}

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

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/webviewdidbegineditingnotification?language=objc)
    pub static WebViewDidBeginEditingNotification: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/webviewdidchangenotification?language=objc)
    pub static WebViewDidChangeNotification: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/webviewdidendeditingnotification?language=objc)
    pub static WebViewDidEndEditingNotification: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/webviewdidchangetypingstylenotification?language=objc)
    pub static WebViewDidChangeTypingStyleNotification: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/webviewdidchangeselectionnotification?language=objc)
    pub static WebViewDidChangeSelectionNotification: Option<&'static NSString>;
}

/// WebViewCSS.
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl WebView {
    extern_methods!(
        #[cfg(all(
            feature = "DOMCSSStyleDeclaration",
            feature = "DOMElement",
            feature = "DOMNode",
            feature = "DOMObject",
            feature = "WebScriptObject"
        ))]
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(computedStyleForElement:pseudoElement:))]
        #[unsafe(method_family = none)]
        pub unsafe fn computedStyleForElement_pseudoElement(
            &self,
            element: Option<&DOMElement>,
            pseudo_element: Option<&NSString>,
        ) -> Option<Retained<DOMCSSStyleDeclaration>>;
    );
}

/// WebViewEditing.
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl WebView {
    extern_methods!(
        #[cfg(all(
            feature = "DOMObject",
            feature = "DOMRange",
            feature = "WebScriptObject"
        ))]
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(editableDOMRangeForPoint:))]
        #[unsafe(method_family = none)]
        pub unsafe fn editableDOMRangeForPoint(&self, point: NSPoint)
            -> Option<Retained<DOMRange>>;

        #[cfg(all(
            feature = "DOMObject",
            feature = "DOMRange",
            feature = "WebScriptObject"
        ))]
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(setSelectedDOMRange:affinity:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setSelectedDOMRange_affinity(
            &self,
            range: Option<&DOMRange>,
            selection_affinity: NSSelectionAffinity,
        );

        #[cfg(all(
            feature = "DOMObject",
            feature = "DOMRange",
            feature = "WebScriptObject"
        ))]
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(selectedDOMRange))]
        #[unsafe(method_family = none)]
        pub unsafe fn selectedDOMRange(&self) -> Option<Retained<DOMRange>>;

        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(selectionAffinity))]
        #[unsafe(method_family = none)]
        pub unsafe fn selectionAffinity(&self) -> NSSelectionAffinity;

        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(maintainsInactiveSelection))]
        #[unsafe(method_family = none)]
        pub unsafe fn maintainsInactiveSelection(&self) -> bool;

        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(isEditable))]
        #[unsafe(method_family = none)]
        pub unsafe fn isEditable(&self) -> bool;

        /// Setter for [`isEditable`][Self::isEditable].
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(setEditable:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setEditable(&self, editable: bool);

        #[cfg(all(
            feature = "DOMCSSStyleDeclaration",
            feature = "DOMObject",
            feature = "WebScriptObject"
        ))]
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(typingStyle))]
        #[unsafe(method_family = none)]
        pub unsafe fn typingStyle(&self) -> Option<Retained<DOMCSSStyleDeclaration>>;

        #[cfg(all(
            feature = "DOMCSSStyleDeclaration",
            feature = "DOMObject",
            feature = "WebScriptObject"
        ))]
        /// Setter for [`typingStyle`][Self::typingStyle].
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(setTypingStyle:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setTypingStyle(&self, typing_style: Option<&DOMCSSStyleDeclaration>);

        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(smartInsertDeleteEnabled))]
        #[unsafe(method_family = none)]
        pub unsafe fn smartInsertDeleteEnabled(&self) -> bool;

        /// Setter for [`smartInsertDeleteEnabled`][Self::smartInsertDeleteEnabled].
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(setSmartInsertDeleteEnabled:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setSmartInsertDeleteEnabled(&self, smart_insert_delete_enabled: bool);

        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(isContinuousSpellCheckingEnabled))]
        #[unsafe(method_family = none)]
        pub unsafe fn isContinuousSpellCheckingEnabled(&self) -> bool;

        /// Setter for [`isContinuousSpellCheckingEnabled`][Self::isContinuousSpellCheckingEnabled].
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(setContinuousSpellCheckingEnabled:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setContinuousSpellCheckingEnabled(
            &self,
            continuous_spell_checking_enabled: bool,
        );

        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(spellCheckerDocumentTag))]
        #[unsafe(method_family = none)]
        pub unsafe fn spellCheckerDocumentTag(&self) -> NSInteger;

        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(undoManager))]
        #[unsafe(method_family = none)]
        pub unsafe fn undoManager(&self) -> Option<Retained<NSUndoManager>>;

        #[cfg(feature = "WebEditingDelegate")]
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(editingDelegate))]
        #[unsafe(method_family = none)]
        pub unsafe fn editingDelegate(
            &self,
        ) -> Option<Retained<ProtocolObject<dyn WebEditingDelegate>>>;

        #[cfg(feature = "WebEditingDelegate")]
        /// Setter for [`editingDelegate`][Self::editingDelegate].
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(setEditingDelegate:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setEditingDelegate(
            &self,
            editing_delegate: Option<&ProtocolObject<dyn WebEditingDelegate>>,
        );

        #[cfg(all(
            feature = "DOMCSSStyleDeclaration",
            feature = "DOMObject",
            feature = "WebScriptObject"
        ))]
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(styleDeclarationWithText:))]
        #[unsafe(method_family = none)]
        pub unsafe fn styleDeclarationWithText(
            &self,
            text: Option<&NSString>,
        ) -> Option<Retained<DOMCSSStyleDeclaration>>;
    );
}

/// WebViewUndoableEditing.
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl WebView {
    extern_methods!(
        #[cfg(all(
            feature = "DOMNode",
            feature = "DOMObject",
            feature = "WebScriptObject"
        ))]
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(replaceSelectionWithNode:))]
        #[unsafe(method_family = none)]
        pub unsafe fn replaceSelectionWithNode(&self, node: Option<&DOMNode>);

        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(replaceSelectionWithText:))]
        #[unsafe(method_family = none)]
        pub unsafe fn replaceSelectionWithText(&self, text: Option<&NSString>);

        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(replaceSelectionWithMarkupString:))]
        #[unsafe(method_family = none)]
        pub unsafe fn replaceSelectionWithMarkupString(&self, markup_string: Option<&NSString>);

        #[cfg(feature = "WebArchive")]
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(replaceSelectionWithArchive:))]
        #[unsafe(method_family = none)]
        pub unsafe fn replaceSelectionWithArchive(&self, archive: Option<&WebArchive>);

        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(deleteSelection))]
        #[unsafe(method_family = none)]
        pub unsafe fn deleteSelection(&self);

        #[cfg(all(
            feature = "DOMCSSStyleDeclaration",
            feature = "DOMObject",
            feature = "WebScriptObject"
        ))]
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(applyStyle:))]
        #[unsafe(method_family = none)]
        pub unsafe fn applyStyle(&self, style: Option<&DOMCSSStyleDeclaration>);
    );
}

/// WebViewEditingActions.
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl WebView {
    extern_methods!(
        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(copy:))]
        #[unsafe(method_family = none)]
        pub unsafe fn copy(&self, sender: Option<&AnyObject>);

        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(cut:))]
        #[unsafe(method_family = none)]
        pub unsafe fn cut(&self, sender: Option<&AnyObject>);

        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(paste:))]
        #[unsafe(method_family = none)]
        pub unsafe fn paste(&self, sender: Option<&AnyObject>);

        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(copyFont:))]
        #[unsafe(method_family = none)]
        pub unsafe fn copyFont(&self, sender: Option<&AnyObject>);

        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(pasteFont:))]
        #[unsafe(method_family = none)]
        pub unsafe fn pasteFont(&self, sender: Option<&AnyObject>);

        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(delete:))]
        #[unsafe(method_family = none)]
        pub unsafe fn delete(&self, sender: Option<&AnyObject>);

        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(pasteAsPlainText:))]
        #[unsafe(method_family = none)]
        pub unsafe fn pasteAsPlainText(&self, sender: Option<&AnyObject>);

        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(pasteAsRichText:))]
        #[unsafe(method_family = none)]
        pub unsafe fn pasteAsRichText(&self, sender: Option<&AnyObject>);

        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(changeFont:))]
        #[unsafe(method_family = none)]
        pub unsafe fn changeFont(&self, sender: Option<&AnyObject>);

        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(changeAttributes:))]
        #[unsafe(method_family = none)]
        pub unsafe fn changeAttributes(&self, sender: Option<&AnyObject>);

        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(changeDocumentBackgroundColor:))]
        #[unsafe(method_family = none)]
        pub unsafe fn changeDocumentBackgroundColor(&self, sender: Option<&AnyObject>);

        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(changeColor:))]
        #[unsafe(method_family = none)]
        pub unsafe fn changeColor(&self, sender: Option<&AnyObject>);

        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(alignCenter:))]
        #[unsafe(method_family = none)]
        pub unsafe fn alignCenter(&self, sender: Option<&AnyObject>);

        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(alignJustified:))]
        #[unsafe(method_family = none)]
        pub unsafe fn alignJustified(&self, sender: Option<&AnyObject>);

        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(alignLeft:))]
        #[unsafe(method_family = none)]
        pub unsafe fn alignLeft(&self, sender: Option<&AnyObject>);

        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(alignRight:))]
        #[unsafe(method_family = none)]
        pub unsafe fn alignRight(&self, sender: Option<&AnyObject>);

        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(checkSpelling:))]
        #[unsafe(method_family = none)]
        pub unsafe fn checkSpelling(&self, sender: Option<&AnyObject>);

        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(showGuessPanel:))]
        #[unsafe(method_family = none)]
        pub unsafe fn showGuessPanel(&self, sender: Option<&AnyObject>);

        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(performFindPanelAction:))]
        #[unsafe(method_family = none)]
        pub unsafe fn performFindPanelAction(&self, sender: Option<&AnyObject>);

        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(startSpeaking:))]
        #[unsafe(method_family = none)]
        pub unsafe fn startSpeaking(&self, sender: Option<&AnyObject>);

        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(stopSpeaking:))]
        #[unsafe(method_family = none)]
        pub unsafe fn stopSpeaking(&self, sender: Option<&AnyObject>);

        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(moveToBeginningOfSentence:))]
        #[unsafe(method_family = none)]
        pub unsafe fn moveToBeginningOfSentence(&self, sender: Option<&AnyObject>);

        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(moveToBeginningOfSentenceAndModifySelection:))]
        #[unsafe(method_family = none)]
        pub unsafe fn moveToBeginningOfSentenceAndModifySelection(
            &self,
            sender: Option<&AnyObject>,
        );

        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(moveToEndOfSentence:))]
        #[unsafe(method_family = none)]
        pub unsafe fn moveToEndOfSentence(&self, sender: Option<&AnyObject>);

        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(moveToEndOfSentenceAndModifySelection:))]
        #[unsafe(method_family = none)]
        pub unsafe fn moveToEndOfSentenceAndModifySelection(&self, sender: Option<&AnyObject>);

        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(selectSentence:))]
        #[unsafe(method_family = none)]
        pub unsafe fn selectSentence(&self, sender: Option<&AnyObject>);

        #[deprecated = "No longer supported; please adopt WKWebView."]
        #[unsafe(method(overWrite:))]
        #[unsafe(method_family = none)]
        pub unsafe fn overWrite(&self, sender: Option<&AnyObject>);
    );
}