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
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
use objc2_app_kit::*;
use objc2_foundation::*;
use crate::*;
/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitemtagopenlinkinnewwindow?language=objc)
#[deprecated]
pub const WebMenuItemTagOpenLinkInNewWindow: c_uint = 1;
/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitemtagdownloadlinktodisk?language=objc)
#[deprecated]
pub const WebMenuItemTagDownloadLinkToDisk: c_uint = 2;
/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitemtagcopylinktoclipboard?language=objc)
#[deprecated]
pub const WebMenuItemTagCopyLinkToClipboard: c_uint = 3;
/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitemtagopenimageinnewwindow?language=objc)
#[deprecated]
pub const WebMenuItemTagOpenImageInNewWindow: c_uint = 4;
/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitemtagdownloadimagetodisk?language=objc)
#[deprecated]
pub const WebMenuItemTagDownloadImageToDisk: c_uint = 5;
/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitemtagcopyimagetoclipboard?language=objc)
#[deprecated]
pub const WebMenuItemTagCopyImageToClipboard: c_uint = 6;
/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitemtagopenframeinnewwindow?language=objc)
#[deprecated]
pub const WebMenuItemTagOpenFrameInNewWindow: c_uint = 7;
/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitemtagcopy?language=objc)
#[deprecated]
pub const WebMenuItemTagCopy: c_uint = 8;
/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitemtaggoback?language=objc)
#[deprecated]
pub const WebMenuItemTagGoBack: c_uint = 9;
/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitemtaggoforward?language=objc)
#[deprecated]
pub const WebMenuItemTagGoForward: c_uint = 10;
/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitemtagstop?language=objc)
#[deprecated]
pub const WebMenuItemTagStop: c_uint = 11;
/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitemtagreload?language=objc)
#[deprecated]
pub const WebMenuItemTagReload: c_uint = 12;
/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitemtagcut?language=objc)
#[deprecated]
pub const WebMenuItemTagCut: c_uint = 13;
/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitemtagpaste?language=objc)
#[deprecated]
pub const WebMenuItemTagPaste: c_uint = 14;
/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitemtagspellingguess?language=objc)
#[deprecated]
pub const WebMenuItemTagSpellingGuess: c_uint = 15;
/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitemtagnoguessesfound?language=objc)
#[deprecated]
pub const WebMenuItemTagNoGuessesFound: c_uint = 16;
/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitemtagignorespelling?language=objc)
#[deprecated]
pub const WebMenuItemTagIgnoreSpelling: c_uint = 17;
/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitemtaglearnspelling?language=objc)
#[deprecated]
pub const WebMenuItemTagLearnSpelling: c_uint = 18;
/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitemtagother?language=objc)
#[deprecated]
pub const WebMenuItemTagOther: c_uint = 19;
/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitemtagsearchinspotlight?language=objc)
#[deprecated]
pub const WebMenuItemTagSearchInSpotlight: c_uint = 20;
/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitemtagsearchweb?language=objc)
#[deprecated]
pub const WebMenuItemTagSearchWeb: c_uint = 21;
/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitemtaglookupindictionary?language=objc)
#[deprecated]
pub const WebMenuItemTagLookUpInDictionary: c_uint = 22;
/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitemtagopenwithdefaultapplication?language=objc)
#[deprecated]
pub const WebMenuItemTagOpenWithDefaultApplication: c_uint = 23;
/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitempdfactualsize?language=objc)
#[deprecated]
pub const WebMenuItemPDFActualSize: c_uint = 24;
/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitempdfzoomin?language=objc)
#[deprecated]
pub const WebMenuItemPDFZoomIn: c_uint = 25;
/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitempdfzoomout?language=objc)
#[deprecated]
pub const WebMenuItemPDFZoomOut: c_uint = 26;
/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitempdfautosize?language=objc)
#[deprecated]
pub const WebMenuItemPDFAutoSize: c_uint = 27;
/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitempdfsinglepage?language=objc)
#[deprecated]
pub const WebMenuItemPDFSinglePage: c_uint = 28;
/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitempdffacingpages?language=objc)
#[deprecated]
pub const WebMenuItemPDFFacingPages: c_uint = 29;
/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitempdfcontinuous?language=objc)
#[deprecated]
pub const WebMenuItemPDFContinuous: c_uint = 30;
/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitempdfnextpage?language=objc)
#[deprecated]
pub const WebMenuItemPDFNextPage: c_uint = 31;
/// [Apple's documentation](https://developer.apple.com/documentation/webkit/webmenuitempdfpreviouspage?language=objc)
#[deprecated]
pub const WebMenuItemPDFPreviousPage: c_uint = 32;
/// Actions that the destination of a drag can perform.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/webkit/webdragdestinationaction?language=objc)
// NS_OPTIONS
#[deprecated]
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct WebDragDestinationAction(pub NSUInteger);
bitflags::bitflags! {
impl WebDragDestinationAction: NSUInteger {
#[doc(alias = "WebDragDestinationActionNone")]
#[deprecated]
const None = 0;
#[doc(alias = "WebDragDestinationActionDHTML")]
#[deprecated]
const DHTML = 1;
#[doc(alias = "WebDragDestinationActionEdit")]
#[deprecated]
const Edit = 2;
#[doc(alias = "WebDragDestinationActionLoad")]
#[deprecated]
const Load = 4;
#[doc(alias = "WebDragDestinationActionAny")]
#[deprecated]
const Any = c_uint::MAX as _;
}
}
unsafe impl Encode for WebDragDestinationAction {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for WebDragDestinationAction {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
/// Actions that the source of a drag can perform.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/webkit/webdragsourceaction?language=objc)
// NS_OPTIONS
#[deprecated]
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct WebDragSourceAction(pub NSUInteger);
bitflags::bitflags! {
impl WebDragSourceAction: NSUInteger {
#[doc(alias = "WebDragSourceActionNone")]
#[deprecated]
const None = 0;
#[doc(alias = "WebDragSourceActionDHTML")]
#[deprecated]
const DHTML = 1;
#[doc(alias = "WebDragSourceActionImage")]
#[deprecated]
const Image = 2;
#[doc(alias = "WebDragSourceActionLink")]
#[deprecated]
const Link = 4;
#[doc(alias = "WebDragSourceActionSelection")]
#[deprecated]
const Selection = 8;
#[doc(alias = "WebDragSourceActionAny")]
#[deprecated]
const Any = c_uint::MAX as _;
}
}
unsafe impl Encode for WebDragSourceAction {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for WebDragSourceAction {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_protocol!(
/// This protocol is used to call back with the results of
/// the file open panel requested by runOpenPanelForFileButtonWithResultListener:
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/webkit/webopenpanelresultlistener?language=objc)
#[deprecated]
pub unsafe trait WebOpenPanelResultListener: NSObjectProtocol {
/// Call this method to return a filename from the file open panel.
///
/// Parameter `fileName`: the path of the selected file
#[deprecated]
#[unsafe(method(chooseFilename:))]
#[unsafe(method_family = none)]
unsafe fn chooseFilename(&self, file_name: Option<&NSString>);
/// Call this method to return an array of filenames from the file open panel.
///
/// Parameter `fileNames`: an array of paths of selected files
#[unsafe(method(chooseFilenames:))]
#[unsafe(method_family = none)]
unsafe fn chooseFilenames(&self, file_names: Option<&NSArray>);
/// Call this method to indicate that the file open panel was cancelled.
#[deprecated]
#[unsafe(method(cancel))]
#[unsafe(method_family = none)]
unsafe fn cancel(&self);
}
);
extern_protocol!(
/// A class that implements WebUIDelegate provides
/// window-related methods that may be used by Javascript, plugins and
/// other aspects of web pages. These methods are used to open new
/// windows and control aspects of existing windows.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/webkit/webuidelegate?language=objc)
#[deprecated]
pub unsafe trait WebUIDelegate: NSObjectProtocol {
#[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
/// Create a new window and begin to load the specified request.
///
/// The newly created window is hidden, and the window operations delegate on the
/// new WebViews will get a webViewShow: call.
///
/// Parameter `sender`: The WebView sending the delegate method.
///
/// Parameter `request`: The request to load.
///
/// Returns: The WebView for the new window.
#[deprecated]
#[optional]
#[unsafe(method(webView:createWebViewWithRequest:))]
#[unsafe(method_family = none)]
unsafe fn webView_createWebViewWithRequest(
&self,
sender: Option<&WebView>,
request: Option<&NSURLRequest>,
mtm: MainThreadMarker,
) -> Option<Retained<WebView>>;
#[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
/// Parameter `sender`: The WebView sending the delegate method.
///
/// Show the window that contains the top level view of the WebView,
/// ordering it frontmost.
///
/// This will only be called just after createWindowWithRequest:
/// is used to create a new window.
#[deprecated]
#[optional]
#[unsafe(method(webViewShow:))]
#[unsafe(method_family = none)]
unsafe fn webViewShow(&self, sender: Option<&WebView>);
#[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
/// Create a new window and begin to load the specified request.
///
/// The newly created window is hidden, and the window operations delegate on the
/// new WebViews will get a webViewShow: call.
///
/// Parameter `sender`: The WebView sending the delegate method.
///
/// Parameter `request`: The request to load.
///
/// Returns: The WebView for the new window.
#[deprecated]
#[optional]
#[unsafe(method(webView:createWebViewModalDialogWithRequest:))]
#[unsafe(method_family = none)]
unsafe fn webView_createWebViewModalDialogWithRequest(
&self,
sender: Option<&WebView>,
request: Option<&NSURLRequest>,
mtm: MainThreadMarker,
) -> Option<Retained<WebView>>;
#[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
/// Parameter `sender`: The WebView sending the delegate method.
///
/// Show the window that contains the top level view of the WebView,
/// ordering it frontmost. The window should be run modal in the application.
///
/// This will only be called just after createWebViewModalDialogWithRequest:
/// is used to create a new window.
#[deprecated]
#[optional]
#[unsafe(method(webViewRunModal:))]
#[unsafe(method_family = none)]
unsafe fn webViewRunModal(&self, sender: Option<&WebView>);
#[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
/// Close the current window.
///
/// Parameter `sender`: The WebView sending the delegate method.
///
/// Clients showing multiple views in one window may
/// choose to close only the one corresponding to this
/// WebView. Other clients may choose to ignore this method
/// entirely.
#[deprecated]
#[optional]
#[unsafe(method(webViewClose:))]
#[unsafe(method_family = none)]
unsafe fn webViewClose(&self, sender: Option<&WebView>);
#[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
/// Focus the current window (i.e. makeKeyAndOrderFront:).
///
/// Parameter `sender`: The WebView sending the delegate method.
///
/// Clients showing multiple views in one window may want to
/// also do something to focus the one corresponding to this WebView.
#[deprecated]
#[optional]
#[unsafe(method(webViewFocus:))]
#[unsafe(method_family = none)]
unsafe fn webViewFocus(&self, sender: Option<&WebView>);
#[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
/// Unfocus the current window.
///
/// Parameter `sender`: The WebView sending the delegate method.
///
/// Clients showing multiple views in one window may want to
/// also do something to unfocus the one corresponding to this WebView.
#[deprecated]
#[optional]
#[unsafe(method(webViewUnfocus:))]
#[unsafe(method_family = none)]
unsafe fn webViewUnfocus(&self, sender: Option<&WebView>);
#[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
/// Get the first responder for this window.
///
/// Parameter `sender`: The WebView sending the delegate method.
///
/// This method should return the focused control in the
/// WebView's view, if any. If the view is out of the window
/// hierarchy, this might return something than calling firstResponder
/// on the real NSWindow would. It's OK to return either nil or the
/// real first responder if some control not in the window has focus.
#[deprecated]
#[optional]
#[unsafe(method(webViewFirstResponder:))]
#[unsafe(method_family = none)]
unsafe fn webViewFirstResponder(
&self,
sender: Option<&WebView>,
mtm: MainThreadMarker,
) -> Option<Retained<NSResponder>>;
#[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
/// Set the first responder for this window.
///
/// Parameter `sender`: The WebView sending the delegate method.
///
/// Parameter `responder`: The responder to make first (will always be a view)
///
/// responder will always be a view that is in the view
/// subhierarchy of the top-level web view for this WebView. If the
/// WebView's top level view is currently out of the view
/// hierarchy, it may be desirable to save the first responder
/// elsewhere, or possibly ignore this call.
#[deprecated]
#[optional]
#[unsafe(method(webView:makeFirstResponder:))]
#[unsafe(method_family = none)]
unsafe fn webView_makeFirstResponder(
&self,
sender: Option<&WebView>,
responder: Option<&NSResponder>,
);
#[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
/// Set the window's status display, if any, to the specified string.
///
/// Parameter `sender`: The WebView sending the delegate method.
///
/// Parameter `text`: The status text to set
#[deprecated]
#[optional]
#[unsafe(method(webView:setStatusText:))]
#[unsafe(method_family = none)]
unsafe fn webView_setStatusText(&self, sender: Option<&WebView>, text: Option<&NSString>);
#[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
/// Get the currently displayed status text.
///
/// Parameter `sender`: The WebView sending the delegate method.
///
/// Returns: The status text
#[deprecated]
#[optional]
#[unsafe(method(webViewStatusText:))]
#[unsafe(method_family = none)]
unsafe fn webViewStatusText(&self, sender: Option<&WebView>) -> Option<Retained<NSString>>;
#[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
/// Determine whether the window's toolbars are currently visible
///
/// Parameter `sender`: The WebView sending the delegate method.
///
/// This method should return YES if the window has any
/// toolbars that are currently on, besides the status bar. If the app
/// has more than one toolbar per window, for example a regular
/// command toolbar and a favorites bar, it should return YES from
/// this method if at least one is on.
///
/// Returns: YES if at least one toolbar is visible, otherwise NO.
#[deprecated]
#[optional]
#[unsafe(method(webViewAreToolbarsVisible:))]
#[unsafe(method_family = none)]
unsafe fn webViewAreToolbarsVisible(&self, sender: Option<&WebView>) -> bool;
#[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
/// Parameter `sender`: The WebView sending the delegate method.
///
/// Set whether the window's toolbars are currently visible.
///
/// Parameter `visible`: New value for toolbar visibility
///
/// Setting this to YES should turn on all toolbars
/// (except for a possible status bar). Setting it to NO should turn
/// off all toolbars (with the same exception).
#[deprecated]
#[optional]
#[unsafe(method(webView:setToolbarsVisible:))]
#[unsafe(method_family = none)]
unsafe fn webView_setToolbarsVisible(&self, sender: Option<&WebView>, visible: bool);
#[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
/// Determine whether the status bar is visible.
///
/// Parameter `sender`: The WebView sending the delegate method.
///
/// Returns: YES if the status bar is visible, otherwise NO.
#[deprecated]
#[optional]
#[unsafe(method(webViewIsStatusBarVisible:))]
#[unsafe(method_family = none)]
unsafe fn webViewIsStatusBarVisible(&self, sender: Option<&WebView>) -> bool;
#[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
/// Set whether the status bar is currently visible.
///
/// Parameter `visible`: The new visibility value
///
/// Setting this to YES should show the status bar,
/// setting it to NO should hide it.
#[deprecated]
#[optional]
#[unsafe(method(webView:setStatusBarVisible:))]
#[unsafe(method_family = none)]
unsafe fn webView_setStatusBarVisible(&self, sender: Option<&WebView>, visible: bool);
#[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
/// Determine whether the window is resizable or not.
///
/// Parameter `sender`: The WebView sending the delegate method.
///
/// Returns: YES if resizable, NO if not.
///
/// If there are multiple views in the same window, they
/// have have their own separate resize controls and this may need to
/// be handled specially.
#[deprecated]
#[optional]
#[unsafe(method(webViewIsResizable:))]
#[unsafe(method_family = none)]
unsafe fn webViewIsResizable(&self, sender: Option<&WebView>) -> bool;
#[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
/// Set the window to resizable or not
///
/// Parameter `sender`: The WebView sending the delegate method.
///
/// Parameter `resizable`: YES if the window should be made resizable, NO if not.
///
/// If there are multiple views in the same window, they
/// have have their own separate resize controls and this may need to
/// be handled specially.
#[deprecated]
#[optional]
#[unsafe(method(webView:setResizable:))]
#[unsafe(method_family = none)]
unsafe fn webView_setResizable(&self, sender: Option<&WebView>, resizable: bool);
#[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
/// Set the window's frame rect
///
/// Parameter `sender`: The WebView sending the delegate method.
///
/// Parameter `frame`: The new window frame size
///
/// Even though a caller could set the frame directly using the NSWindow,
/// this method is provided so implementors of this protocol can do special
/// things on programmatic move/resize, like avoiding autosaving of the size.
#[deprecated]
#[optional]
#[unsafe(method(webView:setFrame:))]
#[unsafe(method_family = none)]
unsafe fn webView_setFrame(&self, sender: Option<&WebView>, frame: NSRect);
#[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
/// Parameter `sender`: The WebView sending the delegate method.
///
/// Return the window's frame rect
#[deprecated]
#[optional]
#[unsafe(method(webViewFrame:))]
#[unsafe(method_family = none)]
unsafe fn webViewFrame(&self, sender: Option<&WebView>) -> NSRect;
#[cfg(all(feature = "WebFrame", feature = "WebView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
/// Display a JavaScript alert panel.
///
/// Parameter `sender`: The WebView sending the delegate method.
///
/// Parameter `message`: The message to display.
///
/// Parameter `frame`: The WebFrame whose JavaScript initiated this call.
///
/// Clients should visually indicate that this panel comes
/// from JavaScript initiated by the specified frame. The panel should have
/// a single OK button.
#[deprecated]
#[optional]
#[unsafe(method(webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:))]
#[unsafe(method_family = none)]
unsafe fn webView_runJavaScriptAlertPanelWithMessage_initiatedByFrame(
&self,
sender: Option<&WebView>,
message: Option<&NSString>,
frame: Option<&WebFrame>,
);
#[cfg(all(feature = "WebFrame", feature = "WebView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
/// Display a JavaScript confirm panel.
///
/// Parameter `sender`: The WebView sending the delegate method.
///
/// Parameter `message`: The message to display.
///
/// Parameter `frame`: The WebFrame whose JavaScript initiated this call.
///
/// Returns: YES if the user hit OK, NO if the user chose Cancel.
///
/// Clients should visually indicate that this panel comes
/// from JavaScript initiated by the specified frame. The panel should have
/// two buttons, e.g. "OK" and "Cancel".
#[deprecated]
#[optional]
#[unsafe(method(webView:runJavaScriptConfirmPanelWithMessage:initiatedByFrame:))]
#[unsafe(method_family = none)]
unsafe fn webView_runJavaScriptConfirmPanelWithMessage_initiatedByFrame(
&self,
sender: Option<&WebView>,
message: Option<&NSString>,
frame: Option<&WebFrame>,
) -> bool;
#[cfg(all(feature = "WebFrame", feature = "WebView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
/// Display a JavaScript text input panel.
///
/// Parameter `sender`: The WebView sending the delegate method.
///
/// Parameter `prompt`: The message to display.
///
/// Parameter `defaultText`: The initial text for the text entry area.
///
/// Parameter `frame`: The WebFrame whose JavaScript initiated this call.
///
/// Returns: The typed text if the user hit OK, otherwise nil.
///
/// Clients should visually indicate that this panel comes
/// from JavaScript initiated by the specified frame. The panel should have
/// two buttons, e.g. "OK" and "Cancel", and an area to type text.
#[deprecated]
#[optional]
#[unsafe(method(webView:runJavaScriptTextInputPanelWithPrompt:defaultText:initiatedByFrame:))]
#[unsafe(method_family = none)]
unsafe fn webView_runJavaScriptTextInputPanelWithPrompt_defaultText_initiatedByFrame(
&self,
sender: Option<&WebView>,
prompt: Option<&NSString>,
default_text: Option<&NSString>,
frame: Option<&WebFrame>,
) -> Option<Retained<NSString>>;
#[cfg(all(feature = "WebFrame", feature = "WebView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
/// Display a confirm panel by an "before unload" event handler.
///
/// Parameter `sender`: The WebView sending the delegate method.
///
/// Parameter `message`: The message to display.
///
/// Parameter `frame`: The WebFrame whose JavaScript initiated this call.
///
/// Returns: YES if the user hit OK, NO if the user chose Cancel.
///
/// Clients should include a message in addition to the one
/// supplied by the web page that indicates. The panel should have
/// two buttons, e.g. "OK" and "Cancel".
#[deprecated]
#[optional]
#[unsafe(method(webView:runBeforeUnloadConfirmPanelWithMessage:initiatedByFrame:))]
#[unsafe(method_family = none)]
unsafe fn webView_runBeforeUnloadConfirmPanelWithMessage_initiatedByFrame(
&self,
sender: Option<&WebView>,
message: Option<&NSString>,
frame: Option<&WebFrame>,
) -> bool;
#[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
/// Display a file open panel for a file input control.
///
/// Parameter `sender`: The WebView sending the delegate method.
///
/// Parameter `resultListener`: The object to call back with the results.
///
/// This method is passed a callback object instead of giving a return
/// value so that it can be handled with a sheet.
#[deprecated]
#[optional]
#[unsafe(method(webView:runOpenPanelForFileButtonWithResultListener:))]
#[unsafe(method_family = none)]
unsafe fn webView_runOpenPanelForFileButtonWithResultListener(
&self,
sender: Option<&WebView>,
result_listener: Option<&ProtocolObject<dyn WebOpenPanelResultListener>>,
);
#[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
/// Display a file open panel for a file input control that may allow multiple files to be selected.
///
/// Parameter `sender`: The WebView sending the delegate method.
///
/// Parameter `resultListener`: The object to call back with the results.
///
/// Parameter `allowMultipleFiles`: YES if the open panel should allow myltiple files to be selected, NO if not.
///
/// This method is passed a callback object instead of giving a return
/// value so that it can be handled with a sheet.
#[optional]
#[unsafe(method(webView:runOpenPanelForFileButtonWithResultListener:allowMultipleFiles:))]
#[unsafe(method_family = none)]
unsafe fn webView_runOpenPanelForFileButtonWithResultListener_allowMultipleFiles(
&self,
sender: Option<&WebView>,
result_listener: Option<&ProtocolObject<dyn WebOpenPanelResultListener>>,
allow_multiple_files: bool,
);
#[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
/// Update the window's feedback for mousing over links to reflect a new item the mouse is over
/// or new modifier flags.
///
/// Parameter `sender`: The WebView sending the delegate method.
///
/// Parameter `elementInformation`: Dictionary that describes the element that the mouse is over, or nil.
///
/// Parameter `modifierFlags`: The modifier flags as in NSEvent.
#[deprecated]
#[optional]
#[unsafe(method(webView:mouseDidMoveOverElement:modifierFlags:))]
#[unsafe(method_family = none)]
unsafe fn webView_mouseDidMoveOverElement_modifierFlags(
&self,
sender: Option<&WebView>,
element_information: Option<&NSDictionary>,
modifier_flags: NSUInteger,
);
#[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
/// Returns the menu items to display in an element's contextual menu.
///
/// Parameter `sender`: The WebView sending the delegate method.
///
/// Parameter `element`: A dictionary representation of the clicked element.
///
/// Parameter `defaultMenuItems`: An array of default NSMenuItems to include in all contextual menus.
///
/// Returns: An array of NSMenuItems to include in the contextual menu.
#[deprecated]
#[optional]
#[unsafe(method(webView:contextMenuItemsForElement:defaultMenuItems:))]
#[unsafe(method_family = none)]
unsafe fn webView_contextMenuItemsForElement_defaultMenuItems(
&self,
sender: Option<&WebView>,
element: Option<&NSDictionary>,
default_menu_items: Option<&NSArray>,
) -> Option<Retained<NSArray>>;
#[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
/// Controls UI validation
///
/// Parameter `webView`: The WebView sending the delegate method
///
/// Parameter `item`: The user interface item being validated
///
/// Parameter `defaultValidation`: Whether or not the WebView thinks the item is valid
///
/// This method allows the UI delegate to control WebView's validation of user interface items.
/// See WebView.h to see the methods to that WebView can currently validate. See NSUserInterfaceValidations and
/// NSValidatedUserInterfaceItem for information about UI validation.
#[deprecated]
#[optional]
#[unsafe(method(webView:validateUserInterfaceItem:defaultValidation:))]
#[unsafe(method_family = none)]
unsafe fn webView_validateUserInterfaceItem_defaultValidation(
&self,
web_view: Option<&WebView>,
item: Option<&ProtocolObject<dyn NSValidatedUserInterfaceItem>>,
default_validation: bool,
) -> bool;
#[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
/// Controls actions
///
/// Parameter `webView`: The WebView sending the delegate method
///
/// Parameter `action`: The action being sent
///
/// Parameter `sender`: The sender of the action
///
/// This method allows the UI delegate to control WebView's behavior when an action is being sent.
/// For example, if the action is copy:, the delegate can return YES to allow WebView to perform its default
/// copy behavior or return NO and perform copy: in some other way. See WebView.h to see the actions that
/// WebView can perform.
#[deprecated]
#[optional]
#[unsafe(method(webView:shouldPerformAction:fromSender:))]
#[unsafe(method_family = none)]
unsafe fn webView_shouldPerformAction_fromSender(
&self,
web_view: Option<&WebView>,
action: Option<Sel>,
sender: Option<&AnyObject>,
) -> bool;
#[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
/// Controls behavior when dragging to a WebView
///
/// Parameter `webView`: The WebView sending the delegate method
///
/// Parameter `draggingInfo`: The dragging info of the drag
///
/// This method is called periodically as something is dragged over a WebView. The UI delegate can return a mask
/// indicating which drag destination actions can occur, WebDragDestinationActionAny to allow any kind of action or
/// WebDragDestinationActionNone to not accept the drag.
#[deprecated]
#[optional]
#[unsafe(method(webView:dragDestinationActionMaskForDraggingInfo:))]
#[unsafe(method_family = none)]
unsafe fn webView_dragDestinationActionMaskForDraggingInfo(
&self,
web_view: Option<&WebView>,
dragging_info: Option<&ProtocolObject<dyn NSDraggingInfo>>,
) -> NSUInteger;
#[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
/// Informs that WebView will perform a drag destination action
///
/// Parameter `webView`: The WebView sending the delegate method
///
/// Parameter `action`: The drag destination action
///
/// Parameter `draggingInfo`: The dragging info of the drag
///
/// This method is called after the last call to webView:dragDestinationActionMaskForDraggingInfo: after something is dropped on a WebView.
/// This method informs the UI delegate of the drag destination action that WebView will perform.
#[deprecated]
#[optional]
#[unsafe(method(webView:willPerformDragDestinationAction:forDraggingInfo:))]
#[unsafe(method_family = none)]
unsafe fn webView_willPerformDragDestinationAction_forDraggingInfo(
&self,
web_view: Option<&WebView>,
action: WebDragDestinationAction,
dragging_info: Option<&ProtocolObject<dyn NSDraggingInfo>>,
);
#[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
/// Controls behavior when dragging from a WebView
///
/// Parameter `webView`: The WebView sending the delegate method
///
/// Parameter `point`: The point where the drag started in the coordinates of the WebView
///
/// This method is called after the user has begun a drag from a WebView. The UI delegate can return a mask indicating
/// which drag source actions can occur, WebDragSourceActionAny to allow any kind of action or WebDragSourceActionNone to not begin a drag.
#[deprecated]
#[optional]
#[unsafe(method(webView:dragSourceActionMaskForPoint:))]
#[unsafe(method_family = none)]
unsafe fn webView_dragSourceActionMaskForPoint(
&self,
web_view: Option<&WebView>,
point: NSPoint,
) -> NSUInteger;
#[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
/// Informs that a drag a has begun from a WebView
///
/// Parameter `webView`: The WebView sending the delegate method
///
/// Parameter `action`: The drag source action
///
/// Parameter `point`: The point where the drag started in the coordinates of the WebView
///
/// Parameter `pasteboard`: The drag pasteboard
///
/// This method is called after webView:dragSourceActionMaskForPoint: is called after the user has begun a drag from a WebView.
/// This method informs the UI delegate of the drag source action that will be performed and gives the delegate an opportunity to modify
/// the contents of the dragging pasteboard.
#[deprecated]
#[optional]
#[unsafe(method(webView:willPerformDragSourceAction:fromPoint:withPasteboard:))]
#[unsafe(method_family = none)]
unsafe fn webView_willPerformDragSourceAction_fromPoint_withPasteboard(
&self,
web_view: Option<&WebView>,
action: WebDragSourceAction,
point: NSPoint,
pasteboard: Option<&NSPasteboard>,
);
#[cfg(all(
feature = "WebFrameView",
feature = "WebView",
feature = "objc2-app-kit"
))]
#[cfg(target_os = "macos")]
/// Informs that a WebFrameView needs to be printed
///
/// Parameter `sender`: The WebView sending the delegate method
///
/// Parameter `frameView`: The WebFrameView needing to be printed
///
/// This method is called when a script or user requests the page to be printed.
/// In this method the delegate can prepare the WebFrameView to be printed. Some content that WebKit
/// displays can be printed directly by the WebFrameView, other content will need to be handled by
/// the delegate. To determine if the WebFrameView can handle printing the delegate should check
/// WebFrameView's documentViewShouldHandlePrint, if YES then the delegate can call printDocumentView
/// on the WebFrameView. Otherwise the delegate will need to request a NSPrintOperation from
/// the WebFrameView's printOperationWithPrintInfo to handle the printing.
#[deprecated]
#[optional]
#[unsafe(method(webView:printFrameView:))]
#[unsafe(method_family = none)]
unsafe fn webView_printFrameView(
&self,
sender: Option<&WebView>,
frame_view: Option<&WebFrameView>,
);
#[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
/// Parameter `sender`: The WebView sending the delegate method
///
/// Reserve a height for the printed page header.
///
/// Returns: The height to reserve for the printed page header, return 0.0 to not reserve any space for a header.
///
/// The height returned will be used to calculate the rect passed to webView:drawHeaderInRect:.
#[deprecated]
#[optional]
#[unsafe(method(webViewHeaderHeight:))]
#[unsafe(method_family = none)]
unsafe fn webViewHeaderHeight(&self, sender: Option<&WebView>) -> c_float;
#[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
/// Parameter `sender`: The WebView sending the delegate method
///
/// Reserve a height for the printed page footer.
///
/// Returns: The height to reserve for the printed page footer, return 0.0 to not reserve any space for a footer.
///
/// The height returned will be used to calculate the rect passed to webView:drawFooterInRect:.
#[deprecated]
#[optional]
#[unsafe(method(webViewFooterHeight:))]
#[unsafe(method_family = none)]
unsafe fn webViewFooterHeight(&self, sender: Option<&WebView>) -> c_float;
#[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
/// Parameter `sender`: The WebView sending the delegate method
///
/// Parameter `rect`: The NSRect reserved for the header of the page
///
/// The delegate should draw a header for the sender in the supplied rect.
#[deprecated]
#[optional]
#[unsafe(method(webView:drawHeaderInRect:))]
#[unsafe(method_family = none)]
unsafe fn webView_drawHeaderInRect(&self, sender: Option<&WebView>, rect: NSRect);
#[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
/// Parameter `sender`: The WebView sending the delegate method
///
/// Parameter `rect`: The NSRect reserved for the footer of the page
///
/// The delegate should draw a footer for the sender in the supplied rect.
#[deprecated]
#[optional]
#[unsafe(method(webView:drawFooterInRect:))]
#[unsafe(method_family = none)]
unsafe fn webView_drawFooterInRect(&self, sender: Option<&WebView>, rect: NSRect);
#[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
#[deprecated]
#[optional]
#[unsafe(method(webView:runJavaScriptAlertPanelWithMessage:))]
#[unsafe(method_family = none)]
unsafe fn webView_runJavaScriptAlertPanelWithMessage(
&self,
sender: Option<&WebView>,
message: Option<&NSString>,
);
#[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
#[deprecated]
#[optional]
#[unsafe(method(webView:runJavaScriptConfirmPanelWithMessage:))]
#[unsafe(method_family = none)]
unsafe fn webView_runJavaScriptConfirmPanelWithMessage(
&self,
sender: Option<&WebView>,
message: Option<&NSString>,
) -> bool;
#[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
#[deprecated]
#[optional]
#[unsafe(method(webView:runJavaScriptTextInputPanelWithPrompt:defaultText:))]
#[unsafe(method_family = none)]
unsafe fn webView_runJavaScriptTextInputPanelWithPrompt_defaultText(
&self,
sender: Option<&WebView>,
prompt: Option<&NSString>,
default_text: Option<&NSString>,
) -> Option<Retained<NSString>>;
#[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
#[deprecated]
#[optional]
#[unsafe(method(webView:setContentRect:))]
#[unsafe(method_family = none)]
unsafe fn webView_setContentRect(&self, sender: Option<&WebView>, frame: NSRect);
#[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
#[deprecated]
#[optional]
#[unsafe(method(webViewContentRect:))]
#[unsafe(method_family = none)]
unsafe fn webViewContentRect(&self, sender: Option<&WebView>) -> NSRect;
}
);