objc2_intents/generated/
INRelevantShortcut.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10#[repr(transparent)]
17#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
18pub struct INRelevantShortcutRole(pub NSInteger);
19impl INRelevantShortcutRole {
20 #[doc(alias = "INRelevantShortcutRoleAction")]
22 pub const Action: Self = Self(0);
23 #[doc(alias = "INRelevantShortcutRoleInformation")]
25 pub const Information: Self = Self(1);
26}
27
28unsafe impl Encode for INRelevantShortcutRole {
29 const ENCODING: Encoding = NSInteger::ENCODING;
30}
31
32unsafe impl RefEncode for INRelevantShortcutRole {
33 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
34}
35
36extern_class!(
37 #[unsafe(super(NSObject))]
43 #[derive(Debug, PartialEq, Eq, Hash)]
44 pub struct INRelevantShortcut;
45);
46
47extern_conformance!(
48 unsafe impl NSCoding for INRelevantShortcut {}
49);
50
51extern_conformance!(
52 unsafe impl NSCopying for INRelevantShortcut {}
53);
54
55unsafe impl CopyingHelper for INRelevantShortcut {
56 type Result = Self;
57}
58
59extern_conformance!(
60 unsafe impl NSObjectProtocol for INRelevantShortcut {}
61);
62
63extern_conformance!(
64 unsafe impl NSSecureCoding for INRelevantShortcut {}
65);
66
67impl INRelevantShortcut {
68 extern_methods!(
69 #[cfg(feature = "INRelevanceProvider")]
70 #[unsafe(method(relevanceProviders))]
76 #[unsafe(method_family = none)]
77 pub unsafe fn relevanceProviders(&self) -> Retained<NSArray<INRelevanceProvider>>;
78
79 #[cfg(feature = "INRelevanceProvider")]
80 #[unsafe(method(setRelevanceProviders:))]
84 #[unsafe(method_family = none)]
85 pub unsafe fn setRelevanceProviders(
86 &self,
87 relevance_providers: &NSArray<INRelevanceProvider>,
88 );
89
90 #[cfg(feature = "INDefaultCardTemplate")]
91 #[unsafe(method(watchTemplate))]
98 #[unsafe(method_family = none)]
99 pub unsafe fn watchTemplate(&self) -> Option<Retained<INDefaultCardTemplate>>;
100
101 #[cfg(feature = "INDefaultCardTemplate")]
102 #[unsafe(method(setWatchTemplate:))]
106 #[unsafe(method_family = none)]
107 pub unsafe fn setWatchTemplate(&self, watch_template: Option<&INDefaultCardTemplate>);
108
109 #[unsafe(method(widgetKind))]
113 #[unsafe(method_family = none)]
114 pub unsafe fn widgetKind(&self) -> Option<Retained<NSString>>;
115
116 #[unsafe(method(setWidgetKind:))]
120 #[unsafe(method_family = none)]
121 pub unsafe fn setWidgetKind(&self, widget_kind: Option<&NSString>);
122
123 #[unsafe(method(shortcutRole))]
129 #[unsafe(method_family = none)]
130 pub unsafe fn shortcutRole(&self) -> INRelevantShortcutRole;
131
132 #[unsafe(method(setShortcutRole:))]
134 #[unsafe(method_family = none)]
135 pub unsafe fn setShortcutRole(&self, shortcut_role: INRelevantShortcutRole);
136
137 #[cfg(feature = "INShortcut")]
138 #[unsafe(method(shortcut))]
142 #[unsafe(method_family = none)]
143 pub unsafe fn shortcut(&self) -> Retained<INShortcut>;
144
145 #[cfg(feature = "INShortcut")]
146 #[unsafe(method(initWithShortcut:))]
148 #[unsafe(method_family = init)]
149 pub unsafe fn initWithShortcut(
150 this: Allocated<Self>,
151 shortcut: &INShortcut,
152 ) -> Retained<Self>;
153 );
154}
155
156impl INRelevantShortcut {
158 extern_methods!(
159 #[unsafe(method(init))]
160 #[unsafe(method_family = init)]
161 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
162
163 #[unsafe(method(new))]
164 #[unsafe(method_family = new)]
165 pub unsafe fn new() -> Retained<Self>;
166 );
167}