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
52extern_conformance!(
53 unsafe impl NSObjectProtocol for WKNavigationAction {}
54);
55
56impl WKNavigationAction {
57 extern_methods!(
58 #[cfg(feature = "WKFrameInfo")]
59 #[unsafe(method(sourceFrame))]
61 #[unsafe(method_family = none)]
62 pub unsafe fn sourceFrame(&self) -> Option<Retained<WKFrameInfo>>;
63
64 #[cfg(feature = "WKFrameInfo")]
65 #[unsafe(method(targetFrame))]
67 #[unsafe(method_family = none)]
68 pub unsafe fn targetFrame(&self) -> Option<Retained<WKFrameInfo>>;
69
70 #[unsafe(method(navigationType))]
74 #[unsafe(method_family = none)]
75 pub unsafe fn navigationType(&self) -> WKNavigationType;
76
77 #[unsafe(method(request))]
79 #[unsafe(method_family = none)]
80 pub unsafe fn request(&self) -> Retained<NSURLRequest>;
81
82 #[unsafe(method(shouldPerformDownload))]
84 #[unsafe(method_family = none)]
85 pub unsafe fn shouldPerformDownload(&self) -> bool;
86
87 #[unsafe(method(isContentRuleListRedirect))]
89 #[unsafe(method_family = none)]
90 pub unsafe fn isContentRuleListRedirect(&self) -> bool;
91
92 #[cfg(feature = "objc2-app-kit")]
93 #[cfg(target_os = "macos")]
94 #[unsafe(method(modifierFlags))]
96 #[unsafe(method_family = none)]
97 pub unsafe fn modifierFlags(&self) -> NSEventModifierFlags;
98
99 #[unsafe(method(buttonNumber))]
101 #[unsafe(method_family = none)]
102 pub unsafe fn buttonNumber(&self) -> NSInteger;
103 );
104}
105
106impl WKNavigationAction {
108 extern_methods!(
109 #[unsafe(method(init))]
110 #[unsafe(method_family = init)]
111 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
112
113 #[unsafe(method(new))]
114 #[unsafe(method_family = new)]
115 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
116 );
117}