objc2_app_kit/generated/
NSLevelIndicatorCell.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 NSLevelIndicatorStyle(pub NSUInteger);
15impl NSLevelIndicatorStyle {
16 #[doc(alias = "NSLevelIndicatorStyleRelevancy")]
17 pub const Relevancy: Self = Self(0);
18 #[doc(alias = "NSLevelIndicatorStyleContinuousCapacity")]
19 pub const ContinuousCapacity: Self = Self(1);
20 #[doc(alias = "NSLevelIndicatorStyleDiscreteCapacity")]
21 pub const DiscreteCapacity: Self = Self(2);
22 #[doc(alias = "NSLevelIndicatorStyleRating")]
23 pub const Rating: Self = Self(3);
24}
25
26unsafe impl Encode for NSLevelIndicatorStyle {
27 const ENCODING: Encoding = NSUInteger::ENCODING;
28}
29
30unsafe impl RefEncode for NSLevelIndicatorStyle {
31 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
32}
33
34extern_class!(
35 #[unsafe(super(NSActionCell, NSCell, NSObject))]
37 #[derive(Debug, PartialEq, Eq, Hash)]
38 #[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
39 pub struct NSLevelIndicatorCell;
40);
41
42#[cfg(all(
43 feature = "NSAccessibilityProtocols",
44 feature = "NSActionCell",
45 feature = "NSCell"
46))]
47unsafe impl NSAccessibility for NSLevelIndicatorCell {}
48
49#[cfg(all(
50 feature = "NSAccessibilityProtocols",
51 feature = "NSActionCell",
52 feature = "NSCell"
53))]
54unsafe impl NSAccessibilityElementProtocol for NSLevelIndicatorCell {}
55
56#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
57unsafe impl NSCoding for NSLevelIndicatorCell {}
58
59#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
60unsafe impl NSCopying for NSLevelIndicatorCell {}
61
62#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
63unsafe impl CopyingHelper for NSLevelIndicatorCell {
64 type Result = Self;
65}
66
67#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
68unsafe impl NSObjectProtocol for NSLevelIndicatorCell {}
69
70#[cfg(all(
71 feature = "NSActionCell",
72 feature = "NSCell",
73 feature = "NSUserInterfaceItemIdentification"
74))]
75unsafe impl NSUserInterfaceItemIdentification for NSLevelIndicatorCell {}
76
77#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
78impl NSLevelIndicatorCell {
79 extern_methods!(
80 #[unsafe(method(initWithLevelIndicatorStyle:))]
81 #[unsafe(method_family = init)]
82 pub unsafe fn initWithLevelIndicatorStyle(
83 this: Allocated<Self>,
84 level_indicator_style: NSLevelIndicatorStyle,
85 ) -> Retained<Self>;
86
87 #[unsafe(method(levelIndicatorStyle))]
88 #[unsafe(method_family = none)]
89 pub unsafe fn levelIndicatorStyle(&self) -> NSLevelIndicatorStyle;
90
91 #[unsafe(method(setLevelIndicatorStyle:))]
93 #[unsafe(method_family = none)]
94 pub unsafe fn setLevelIndicatorStyle(&self, level_indicator_style: NSLevelIndicatorStyle);
95
96 #[unsafe(method(minValue))]
97 #[unsafe(method_family = none)]
98 pub unsafe fn minValue(&self) -> c_double;
99
100 #[unsafe(method(setMinValue:))]
102 #[unsafe(method_family = none)]
103 pub unsafe fn setMinValue(&self, min_value: c_double);
104
105 #[unsafe(method(maxValue))]
106 #[unsafe(method_family = none)]
107 pub unsafe fn maxValue(&self) -> c_double;
108
109 #[unsafe(method(setMaxValue:))]
111 #[unsafe(method_family = none)]
112 pub unsafe fn setMaxValue(&self, max_value: c_double);
113
114 #[unsafe(method(warningValue))]
115 #[unsafe(method_family = none)]
116 pub unsafe fn warningValue(&self) -> c_double;
117
118 #[unsafe(method(setWarningValue:))]
120 #[unsafe(method_family = none)]
121 pub unsafe fn setWarningValue(&self, warning_value: c_double);
122
123 #[unsafe(method(criticalValue))]
124 #[unsafe(method_family = none)]
125 pub unsafe fn criticalValue(&self) -> c_double;
126
127 #[unsafe(method(setCriticalValue:))]
129 #[unsafe(method_family = none)]
130 pub unsafe fn setCriticalValue(&self, critical_value: c_double);
131
132 #[cfg(feature = "NSSliderCell")]
133 #[unsafe(method(tickMarkPosition))]
134 #[unsafe(method_family = none)]
135 pub unsafe fn tickMarkPosition(&self) -> NSTickMarkPosition;
136
137 #[cfg(feature = "NSSliderCell")]
138 #[unsafe(method(setTickMarkPosition:))]
140 #[unsafe(method_family = none)]
141 pub unsafe fn setTickMarkPosition(&self, tick_mark_position: NSTickMarkPosition);
142
143 #[unsafe(method(numberOfTickMarks))]
144 #[unsafe(method_family = none)]
145 pub unsafe fn numberOfTickMarks(&self) -> NSInteger;
146
147 #[unsafe(method(setNumberOfTickMarks:))]
149 #[unsafe(method_family = none)]
150 pub unsafe fn setNumberOfTickMarks(&self, number_of_tick_marks: NSInteger);
151
152 #[unsafe(method(numberOfMajorTickMarks))]
153 #[unsafe(method_family = none)]
154 pub unsafe fn numberOfMajorTickMarks(&self) -> NSInteger;
155
156 #[unsafe(method(setNumberOfMajorTickMarks:))]
158 #[unsafe(method_family = none)]
159 pub unsafe fn setNumberOfMajorTickMarks(&self, number_of_major_tick_marks: NSInteger);
160
161 #[unsafe(method(rectOfTickMarkAtIndex:))]
162 #[unsafe(method_family = none)]
163 pub unsafe fn rectOfTickMarkAtIndex(&self, index: NSInteger) -> NSRect;
164
165 #[unsafe(method(tickMarkValueAtIndex:))]
166 #[unsafe(method_family = none)]
167 pub unsafe fn tickMarkValueAtIndex(&self, index: NSInteger) -> c_double;
168 );
169}
170
171#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
173impl NSLevelIndicatorCell {
174 extern_methods!(
175 #[unsafe(method(init))]
176 #[unsafe(method_family = init)]
177 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
178
179 #[unsafe(method(initTextCell:))]
180 #[unsafe(method_family = init)]
181 pub unsafe fn initTextCell(this: Allocated<Self>, string: &NSString) -> Retained<Self>;
182
183 #[cfg(feature = "NSImage")]
184 #[unsafe(method(initImageCell:))]
185 #[unsafe(method_family = init)]
186 pub unsafe fn initImageCell(
187 this: Allocated<Self>,
188 image: Option<&NSImage>,
189 ) -> Retained<Self>;
190
191 #[unsafe(method(initWithCoder:))]
192 #[unsafe(method_family = init)]
193 pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
194 );
195}
196
197#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
199impl NSLevelIndicatorCell {
200 extern_methods!(
201 #[unsafe(method(new))]
202 #[unsafe(method_family = new)]
203 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
204 );
205}
206
207pub static NSRelevancyLevelIndicatorStyle: NSLevelIndicatorStyle =
209 NSLevelIndicatorStyle(NSLevelIndicatorStyle::Relevancy.0);
210
211pub static NSContinuousCapacityLevelIndicatorStyle: NSLevelIndicatorStyle =
213 NSLevelIndicatorStyle(NSLevelIndicatorStyle::ContinuousCapacity.0);
214
215pub static NSDiscreteCapacityLevelIndicatorStyle: NSLevelIndicatorStyle =
217 NSLevelIndicatorStyle(NSLevelIndicatorStyle::DiscreteCapacity.0);
218
219pub static NSRatingLevelIndicatorStyle: NSLevelIndicatorStyle =
221 NSLevelIndicatorStyle(NSLevelIndicatorStyle::Rating.0);