objc2_web_kit/generated/
WKNavigationAction.rs1use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5#[cfg(feature = "objc2-app-kit")]
6#[cfg(target_os = "macos")]
7use objc2_app_kit::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12#[repr(transparent)]
17#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
18pub struct WKNavigationType(pub NSInteger);
19impl WKNavigationType {
20 #[doc(alias = "WKNavigationTypeLinkActivated")]
21 pub const LinkActivated: Self = Self(0);
22 #[doc(alias = "WKNavigationTypeFormSubmitted")]
23 pub const FormSubmitted: Self = Self(1);
24 #[doc(alias = "WKNavigationTypeBackForward")]
25 pub const BackForward: Self = Self(2);
26 #[doc(alias = "WKNavigationTypeReload")]
27 pub const Reload: Self = Self(3);
28 #[doc(alias = "WKNavigationTypeFormResubmitted")]
29 pub const FormResubmitted: Self = Self(4);
30 #[doc(alias = "WKNavigationTypeOther")]
31 pub const Other: Self = Self(-1);
32}
33
34unsafe impl Encode for WKNavigationType {
35 const ENCODING: Encoding = NSInteger::ENCODING;
36}
37
38unsafe impl RefEncode for WKNavigationType {
39 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
40}
41
42extern_class!(
43 #[unsafe(super(NSObject))]
47 #[thread_kind = MainThreadOnly]
48 #[derive(Debug, PartialEq, Eq, Hash)]
49 pub struct WKNavigationAction;
50);
51
52unsafe impl NSObjectProtocol for WKNavigationAction {}
53
54impl WKNavigationAction {
55 extern_methods!(
56 #[cfg(feature = "WKFrameInfo")]
57 #[unsafe(method(targetFrame))]
59 #[unsafe(method_family = none)]
60 pub unsafe fn targetFrame(&self) -> Option<Retained<WKFrameInfo>>;
61
62 #[unsafe(method(navigationType))]
66 #[unsafe(method_family = none)]
67 pub unsafe fn navigationType(&self) -> WKNavigationType;
68
69 #[unsafe(method(request))]
71 #[unsafe(method_family = none)]
72 pub unsafe fn request(&self) -> Retained<NSURLRequest>;
73
74 #[unsafe(method(shouldPerformDownload))]
76 #[unsafe(method_family = none)]
77 pub unsafe fn shouldPerformDownload(&self) -> bool;
78
79 #[cfg(feature = "objc2-app-kit")]
80 #[cfg(target_os = "macos")]
81 #[unsafe(method(modifierFlags))]
83 #[unsafe(method_family = none)]
84 pub unsafe fn modifierFlags(&self) -> NSEventModifierFlags;
85
86 #[unsafe(method(buttonNumber))]
88 #[unsafe(method_family = none)]
89 pub unsafe fn buttonNumber(&self) -> NSInteger;
90 );
91}
92
93impl WKNavigationAction {
95 extern_methods!(
96 #[unsafe(method(init))]
97 #[unsafe(method_family = init)]
98 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
99
100 #[unsafe(method(new))]
101 #[unsafe(method_family = new)]
102 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
103 );
104}