objc2_app_kit/generated/
NSSegmentedCell.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12extern_class!(
13    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nssegmentedcell?language=objc)
14    #[unsafe(super(NSActionCell, NSCell, NSObject))]
15    #[derive(Debug, PartialEq, Eq, Hash)]
16    #[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
17    pub struct NSSegmentedCell;
18);
19
20#[cfg(all(
21    feature = "NSAccessibilityProtocols",
22    feature = "NSActionCell",
23    feature = "NSCell"
24))]
25extern_conformance!(
26    unsafe impl NSAccessibility for NSSegmentedCell {}
27);
28
29#[cfg(all(
30    feature = "NSAccessibilityProtocols",
31    feature = "NSActionCell",
32    feature = "NSCell"
33))]
34extern_conformance!(
35    unsafe impl NSAccessibilityElementProtocol for NSSegmentedCell {}
36);
37
38#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
39extern_conformance!(
40    unsafe impl NSCoding for NSSegmentedCell {}
41);
42
43#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
44extern_conformance!(
45    unsafe impl NSCopying for NSSegmentedCell {}
46);
47
48#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
49unsafe impl CopyingHelper for NSSegmentedCell {
50    type Result = Self;
51}
52
53#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
54extern_conformance!(
55    unsafe impl NSObjectProtocol for NSSegmentedCell {}
56);
57
58#[cfg(all(
59    feature = "NSActionCell",
60    feature = "NSCell",
61    feature = "NSUserInterfaceItemIdentification"
62))]
63extern_conformance!(
64    unsafe impl NSUserInterfaceItemIdentification for NSSegmentedCell {}
65);
66
67#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
68impl NSSegmentedCell {
69    extern_methods!(
70        #[unsafe(method(segmentCount))]
71        #[unsafe(method_family = none)]
72        pub unsafe fn segmentCount(&self) -> NSInteger;
73
74        /// Setter for [`segmentCount`][Self::segmentCount].
75        #[unsafe(method(setSegmentCount:))]
76        #[unsafe(method_family = none)]
77        pub unsafe fn setSegmentCount(&self, segment_count: NSInteger);
78
79        #[unsafe(method(selectedSegment))]
80        #[unsafe(method_family = none)]
81        pub unsafe fn selectedSegment(&self) -> NSInteger;
82
83        /// Setter for [`selectedSegment`][Self::selectedSegment].
84        #[unsafe(method(setSelectedSegment:))]
85        #[unsafe(method_family = none)]
86        pub unsafe fn setSelectedSegment(&self, selected_segment: NSInteger);
87
88        #[unsafe(method(selectSegmentWithTag:))]
89        #[unsafe(method_family = none)]
90        pub unsafe fn selectSegmentWithTag(&self, tag: NSInteger) -> bool;
91
92        #[unsafe(method(makeNextSegmentKey))]
93        #[unsafe(method_family = none)]
94        pub unsafe fn makeNextSegmentKey(&self);
95
96        #[unsafe(method(makePreviousSegmentKey))]
97        #[unsafe(method_family = none)]
98        pub unsafe fn makePreviousSegmentKey(&self);
99
100        #[cfg(feature = "NSSegmentedControl")]
101        #[unsafe(method(trackingMode))]
102        #[unsafe(method_family = none)]
103        pub unsafe fn trackingMode(&self) -> NSSegmentSwitchTracking;
104
105        #[cfg(feature = "NSSegmentedControl")]
106        /// Setter for [`trackingMode`][Self::trackingMode].
107        #[unsafe(method(setTrackingMode:))]
108        #[unsafe(method_family = none)]
109        pub unsafe fn setTrackingMode(&self, tracking_mode: NSSegmentSwitchTracking);
110
111        #[cfg(feature = "objc2-core-foundation")]
112        #[unsafe(method(setWidth:forSegment:))]
113        #[unsafe(method_family = none)]
114        pub unsafe fn setWidth_forSegment(&self, width: CGFloat, segment: NSInteger);
115
116        #[cfg(feature = "objc2-core-foundation")]
117        #[unsafe(method(widthForSegment:))]
118        #[unsafe(method_family = none)]
119        pub unsafe fn widthForSegment(&self, segment: NSInteger) -> CGFloat;
120
121        #[cfg(feature = "NSImage")]
122        #[unsafe(method(setImage:forSegment:))]
123        #[unsafe(method_family = none)]
124        pub unsafe fn setImage_forSegment(&self, image: Option<&NSImage>, segment: NSInteger);
125
126        #[cfg(feature = "NSImage")]
127        #[unsafe(method(imageForSegment:))]
128        #[unsafe(method_family = none)]
129        pub unsafe fn imageForSegment(&self, segment: NSInteger) -> Option<Retained<NSImage>>;
130
131        #[unsafe(method(setImageScaling:forSegment:))]
132        #[unsafe(method_family = none)]
133        pub unsafe fn setImageScaling_forSegment(
134            &self,
135            scaling: NSImageScaling,
136            segment: NSInteger,
137        );
138
139        #[unsafe(method(imageScalingForSegment:))]
140        #[unsafe(method_family = none)]
141        pub unsafe fn imageScalingForSegment(&self, segment: NSInteger) -> NSImageScaling;
142
143        #[unsafe(method(setLabel:forSegment:))]
144        #[unsafe(method_family = none)]
145        pub unsafe fn setLabel_forSegment(&self, label: &NSString, segment: NSInteger);
146
147        #[unsafe(method(labelForSegment:))]
148        #[unsafe(method_family = none)]
149        pub unsafe fn labelForSegment(&self, segment: NSInteger) -> Option<Retained<NSString>>;
150
151        #[unsafe(method(setSelected:forSegment:))]
152        #[unsafe(method_family = none)]
153        pub unsafe fn setSelected_forSegment(&self, selected: bool, segment: NSInteger);
154
155        #[unsafe(method(isSelectedForSegment:))]
156        #[unsafe(method_family = none)]
157        pub unsafe fn isSelectedForSegment(&self, segment: NSInteger) -> bool;
158
159        #[unsafe(method(setEnabled:forSegment:))]
160        #[unsafe(method_family = none)]
161        pub unsafe fn setEnabled_forSegment(&self, enabled: bool, segment: NSInteger);
162
163        #[unsafe(method(isEnabledForSegment:))]
164        #[unsafe(method_family = none)]
165        pub unsafe fn isEnabledForSegment(&self, segment: NSInteger) -> bool;
166
167        #[cfg(feature = "NSMenu")]
168        #[unsafe(method(setMenu:forSegment:))]
169        #[unsafe(method_family = none)]
170        pub unsafe fn setMenu_forSegment(&self, menu: Option<&NSMenu>, segment: NSInteger);
171
172        #[cfg(feature = "NSMenu")]
173        #[unsafe(method(menuForSegment:))]
174        #[unsafe(method_family = none)]
175        pub unsafe fn menuForSegment(&self, segment: NSInteger) -> Option<Retained<NSMenu>>;
176
177        #[unsafe(method(setToolTip:forSegment:))]
178        #[unsafe(method_family = none)]
179        pub unsafe fn setToolTip_forSegment(&self, tool_tip: Option<&NSString>, segment: NSInteger);
180
181        #[unsafe(method(toolTipForSegment:))]
182        #[unsafe(method_family = none)]
183        pub unsafe fn toolTipForSegment(&self, segment: NSInteger) -> Option<Retained<NSString>>;
184
185        #[unsafe(method(setTag:forSegment:))]
186        #[unsafe(method_family = none)]
187        pub unsafe fn setTag_forSegment(&self, tag: NSInteger, segment: NSInteger);
188
189        #[unsafe(method(tagForSegment:))]
190        #[unsafe(method_family = none)]
191        pub unsafe fn tagForSegment(&self, segment: NSInteger) -> NSInteger;
192
193        #[cfg(feature = "NSSegmentedControl")]
194        #[unsafe(method(segmentStyle))]
195        #[unsafe(method_family = none)]
196        pub unsafe fn segmentStyle(&self) -> NSSegmentStyle;
197
198        #[cfg(feature = "NSSegmentedControl")]
199        /// Setter for [`segmentStyle`][Self::segmentStyle].
200        #[unsafe(method(setSegmentStyle:))]
201        #[unsafe(method_family = none)]
202        pub unsafe fn setSegmentStyle(&self, segment_style: NSSegmentStyle);
203
204        #[cfg(all(feature = "NSResponder", feature = "NSView"))]
205        #[unsafe(method(drawSegment:inFrame:withView:))]
206        #[unsafe(method_family = none)]
207        pub unsafe fn drawSegment_inFrame_withView(
208            &self,
209            segment: NSInteger,
210            frame: NSRect,
211            control_view: &NSView,
212        );
213    );
214}
215
216/// Methods declared on superclass `NSCell`.
217#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
218impl NSSegmentedCell {
219    extern_methods!(
220        #[unsafe(method(init))]
221        #[unsafe(method_family = init)]
222        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
223
224        #[unsafe(method(initTextCell:))]
225        #[unsafe(method_family = init)]
226        pub unsafe fn initTextCell(this: Allocated<Self>, string: &NSString) -> Retained<Self>;
227
228        #[cfg(feature = "NSImage")]
229        #[unsafe(method(initImageCell:))]
230        #[unsafe(method_family = init)]
231        pub unsafe fn initImageCell(
232            this: Allocated<Self>,
233            image: Option<&NSImage>,
234        ) -> Retained<Self>;
235
236        #[unsafe(method(initWithCoder:))]
237        #[unsafe(method_family = init)]
238        pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
239    );
240}
241
242/// Methods declared on superclass `NSObject`.
243#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
244impl NSSegmentedCell {
245    extern_methods!(
246        #[unsafe(method(new))]
247        #[unsafe(method_family = new)]
248        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
249    );
250}
251
252/// NSSegmentBackgroundStyle.
253#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
254impl NSSegmentedCell {
255    extern_methods!(
256        #[unsafe(method(interiorBackgroundStyleForSegment:))]
257        #[unsafe(method_family = none)]
258        pub unsafe fn interiorBackgroundStyleForSegment(
259            &self,
260            segment: NSInteger,
261        ) -> NSBackgroundStyle;
262    );
263}