objc2_app_kit/generated/
NSTabViewItem.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10#[repr(transparent)]
13#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
14pub struct NSTabState(pub NSUInteger);
15impl NSTabState {
16 #[doc(alias = "NSSelectedTab")]
17 pub const SelectedTab: Self = Self(0);
18 #[doc(alias = "NSBackgroundTab")]
19 pub const BackgroundTab: Self = Self(1);
20 #[doc(alias = "NSPressedTab")]
21 pub const PressedTab: Self = Self(2);
22}
23
24unsafe impl Encode for NSTabState {
25 const ENCODING: Encoding = NSUInteger::ENCODING;
26}
27
28unsafe impl RefEncode for NSTabState {
29 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
30}
31
32extern_class!(
33 #[unsafe(super(NSObject))]
35 #[derive(Debug, PartialEq, Eq, Hash)]
36 pub struct NSTabViewItem;
37);
38
39extern_conformance!(
40 unsafe impl NSCoding for NSTabViewItem {}
41);
42
43extern_conformance!(
44 unsafe impl NSObjectProtocol for NSTabViewItem {}
45);
46
47impl NSTabViewItem {
48 extern_methods!(
49 #[cfg(all(feature = "NSResponder", feature = "NSViewController"))]
50 #[unsafe(method(tabViewItemWithViewController:))]
55 #[unsafe(method_family = none)]
56 pub unsafe fn tabViewItemWithViewController(
57 view_controller: &NSViewController,
58 ) -> Retained<Self>;
59
60 #[unsafe(method(initWithIdentifier:))]
61 #[unsafe(method_family = init)]
62 pub unsafe fn initWithIdentifier(
63 this: Allocated<Self>,
64 identifier: Option<&AnyObject>,
65 ) -> Retained<Self>;
66
67 #[unsafe(method(identifier))]
68 #[unsafe(method_family = none)]
69 pub unsafe fn identifier(&self) -> Option<Retained<AnyObject>>;
70
71 #[unsafe(method(setIdentifier:))]
73 #[unsafe(method_family = none)]
74 pub unsafe fn setIdentifier(&self, identifier: Option<&AnyObject>);
75
76 #[cfg(feature = "NSColor")]
77 #[unsafe(method(color))]
78 #[unsafe(method_family = none)]
79 pub unsafe fn color(&self) -> Retained<NSColor>;
80
81 #[cfg(feature = "NSColor")]
82 #[unsafe(method(setColor:))]
84 #[unsafe(method_family = none)]
85 pub unsafe fn setColor(&self, color: &NSColor);
86
87 #[unsafe(method(label))]
88 #[unsafe(method_family = none)]
89 pub unsafe fn label(&self) -> Retained<NSString>;
90
91 #[unsafe(method(setLabel:))]
93 #[unsafe(method_family = none)]
94 pub unsafe fn setLabel(&self, label: &NSString);
95
96 #[cfg(feature = "NSImage")]
97 #[unsafe(method(image))]
99 #[unsafe(method_family = none)]
100 pub unsafe fn image(&self) -> Option<Retained<NSImage>>;
101
102 #[cfg(feature = "NSImage")]
103 #[unsafe(method(setImage:))]
105 #[unsafe(method_family = none)]
106 pub unsafe fn setImage(&self, image: Option<&NSImage>);
107
108 #[cfg(all(feature = "NSResponder", feature = "NSView"))]
109 #[unsafe(method(view))]
110 #[unsafe(method_family = none)]
111 pub unsafe fn view(&self, mtm: MainThreadMarker) -> Option<Retained<NSView>>;
112
113 #[cfg(all(feature = "NSResponder", feature = "NSView"))]
114 #[unsafe(method(setView:))]
116 #[unsafe(method_family = none)]
117 pub unsafe fn setView(&self, view: Option<&NSView>);
118
119 #[cfg(all(feature = "NSResponder", feature = "NSViewController"))]
120 #[unsafe(method(viewController))]
132 #[unsafe(method_family = none)]
133 pub unsafe fn viewController(
134 &self,
135 mtm: MainThreadMarker,
136 ) -> Option<Retained<NSViewController>>;
137
138 #[cfg(all(feature = "NSResponder", feature = "NSViewController"))]
139 #[unsafe(method(setViewController:))]
141 #[unsafe(method_family = none)]
142 pub unsafe fn setViewController(&self, view_controller: Option<&NSViewController>);
143
144 #[unsafe(method(tabState))]
145 #[unsafe(method_family = none)]
146 pub unsafe fn tabState(&self) -> NSTabState;
147
148 #[cfg(all(feature = "NSResponder", feature = "NSTabView", feature = "NSView"))]
149 #[unsafe(method(tabView))]
150 #[unsafe(method_family = none)]
151 pub unsafe fn tabView(&self, mtm: MainThreadMarker) -> Option<Retained<NSTabView>>;
152
153 #[cfg(all(feature = "NSResponder", feature = "NSView"))]
154 #[unsafe(method(initialFirstResponder))]
155 #[unsafe(method_family = none)]
156 pub unsafe fn initialFirstResponder(
157 &self,
158 mtm: MainThreadMarker,
159 ) -> Option<Retained<NSView>>;
160
161 #[cfg(all(feature = "NSResponder", feature = "NSView"))]
162 #[unsafe(method(setInitialFirstResponder:))]
165 #[unsafe(method_family = none)]
166 pub unsafe fn setInitialFirstResponder(&self, initial_first_responder: Option<&NSView>);
167
168 #[unsafe(method(toolTip))]
169 #[unsafe(method_family = none)]
170 pub unsafe fn toolTip(&self) -> Option<Retained<NSString>>;
171
172 #[unsafe(method(setToolTip:))]
174 #[unsafe(method_family = none)]
175 pub unsafe fn setToolTip(&self, tool_tip: Option<&NSString>);
176
177 #[unsafe(method(drawLabel:inRect:))]
178 #[unsafe(method_family = none)]
179 pub unsafe fn drawLabel_inRect(&self, should_truncate_label: bool, label_rect: NSRect);
180
181 #[unsafe(method(sizeOfLabel:))]
182 #[unsafe(method_family = none)]
183 pub unsafe fn sizeOfLabel(&self, compute_min: bool) -> NSSize;
184 );
185}
186
187impl NSTabViewItem {
189 extern_methods!(
190 #[unsafe(method(init))]
191 #[unsafe(method_family = init)]
192 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
193
194 #[unsafe(method(new))]
195 #[unsafe(method_family = new)]
196 pub unsafe fn new() -> Retained<Self>;
197 );
198}