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
39unsafe impl NSCoding for NSTabViewItem {}
40
41unsafe impl NSObjectProtocol for NSTabViewItem {}
42
43impl NSTabViewItem {
44 extern_methods!(
45 #[cfg(all(feature = "NSResponder", feature = "NSViewController"))]
46 #[unsafe(method(tabViewItemWithViewController:))]
51 #[unsafe(method_family = none)]
52 pub unsafe fn tabViewItemWithViewController(
53 view_controller: &NSViewController,
54 ) -> Retained<Self>;
55
56 #[unsafe(method(initWithIdentifier:))]
57 #[unsafe(method_family = init)]
58 pub unsafe fn initWithIdentifier(
59 this: Allocated<Self>,
60 identifier: Option<&AnyObject>,
61 ) -> Retained<Self>;
62
63 #[unsafe(method(identifier))]
64 #[unsafe(method_family = none)]
65 pub unsafe fn identifier(&self) -> Option<Retained<AnyObject>>;
66
67 #[unsafe(method(setIdentifier:))]
69 #[unsafe(method_family = none)]
70 pub unsafe fn setIdentifier(&self, identifier: Option<&AnyObject>);
71
72 #[cfg(feature = "NSColor")]
73 #[unsafe(method(color))]
74 #[unsafe(method_family = none)]
75 pub unsafe fn color(&self) -> Retained<NSColor>;
76
77 #[cfg(feature = "NSColor")]
78 #[unsafe(method(setColor:))]
80 #[unsafe(method_family = none)]
81 pub unsafe fn setColor(&self, color: &NSColor);
82
83 #[unsafe(method(label))]
84 #[unsafe(method_family = none)]
85 pub unsafe fn label(&self) -> Retained<NSString>;
86
87 #[unsafe(method(setLabel:))]
89 #[unsafe(method_family = none)]
90 pub unsafe fn setLabel(&self, label: &NSString);
91
92 #[cfg(feature = "NSImage")]
93 #[unsafe(method(image))]
95 #[unsafe(method_family = none)]
96 pub unsafe fn image(&self) -> Option<Retained<NSImage>>;
97
98 #[cfg(feature = "NSImage")]
99 #[unsafe(method(setImage:))]
101 #[unsafe(method_family = none)]
102 pub unsafe fn setImage(&self, image: Option<&NSImage>);
103
104 #[cfg(all(feature = "NSResponder", feature = "NSView"))]
105 #[unsafe(method(view))]
106 #[unsafe(method_family = none)]
107 pub unsafe fn view(&self, mtm: MainThreadMarker) -> Option<Retained<NSView>>;
108
109 #[cfg(all(feature = "NSResponder", feature = "NSView"))]
110 #[unsafe(method(setView:))]
112 #[unsafe(method_family = none)]
113 pub unsafe fn setView(&self, view: Option<&NSView>);
114
115 #[cfg(all(feature = "NSResponder", feature = "NSViewController"))]
116 #[unsafe(method(viewController))]
128 #[unsafe(method_family = none)]
129 pub unsafe fn viewController(
130 &self,
131 mtm: MainThreadMarker,
132 ) -> Option<Retained<NSViewController>>;
133
134 #[cfg(all(feature = "NSResponder", feature = "NSViewController"))]
135 #[unsafe(method(setViewController:))]
137 #[unsafe(method_family = none)]
138 pub unsafe fn setViewController(&self, view_controller: Option<&NSViewController>);
139
140 #[unsafe(method(tabState))]
141 #[unsafe(method_family = none)]
142 pub unsafe fn tabState(&self) -> NSTabState;
143
144 #[cfg(all(feature = "NSResponder", feature = "NSTabView", feature = "NSView"))]
145 #[unsafe(method(tabView))]
146 #[unsafe(method_family = none)]
147 pub unsafe fn tabView(&self, mtm: MainThreadMarker) -> Option<Retained<NSTabView>>;
148
149 #[cfg(all(feature = "NSResponder", feature = "NSView"))]
150 #[unsafe(method(initialFirstResponder))]
151 #[unsafe(method_family = none)]
152 pub unsafe fn initialFirstResponder(
153 &self,
154 mtm: MainThreadMarker,
155 ) -> Option<Retained<NSView>>;
156
157 #[cfg(all(feature = "NSResponder", feature = "NSView"))]
158 #[unsafe(method(setInitialFirstResponder:))]
161 #[unsafe(method_family = none)]
162 pub unsafe fn setInitialFirstResponder(&self, initial_first_responder: Option<&NSView>);
163
164 #[unsafe(method(toolTip))]
165 #[unsafe(method_family = none)]
166 pub unsafe fn toolTip(&self) -> Option<Retained<NSString>>;
167
168 #[unsafe(method(setToolTip:))]
170 #[unsafe(method_family = none)]
171 pub unsafe fn setToolTip(&self, tool_tip: Option<&NSString>);
172
173 #[unsafe(method(drawLabel:inRect:))]
174 #[unsafe(method_family = none)]
175 pub unsafe fn drawLabel_inRect(&self, should_truncate_label: bool, label_rect: NSRect);
176
177 #[unsafe(method(sizeOfLabel:))]
178 #[unsafe(method_family = none)]
179 pub unsafe fn sizeOfLabel(&self, compute_min: bool) -> NSSize;
180 );
181}
182
183impl NSTabViewItem {
185 extern_methods!(
186 #[unsafe(method(init))]
187 #[unsafe(method_family = init)]
188 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
189
190 #[unsafe(method(new))]
191 #[unsafe(method_family = new)]
192 pub unsafe fn new() -> Retained<Self>;
193 );
194}