objc2_app_kit/generated/
NSStepperTouchBarItem.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::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nssteppertouchbaritem?language=objc)
12    #[unsafe(super(NSTouchBarItem, NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    #[cfg(feature = "NSTouchBarItem")]
15    pub struct NSStepperTouchBarItem;
16);
17
18#[cfg(feature = "NSTouchBarItem")]
19extern_conformance!(
20    unsafe impl NSCoding for NSStepperTouchBarItem {}
21);
22
23#[cfg(feature = "NSTouchBarItem")]
24extern_conformance!(
25    unsafe impl NSObjectProtocol for NSStepperTouchBarItem {}
26);
27
28#[cfg(feature = "NSTouchBarItem")]
29impl NSStepperTouchBarItem {
30    extern_methods!(
31        /// Creates an `NSStepperTouchBarItem` with a `formatter` to display the stepper's value as text
32        ///
33        ///
34        /// Parameter `formatter`: A formatter used to display a textual representation of the stepper's value
35        #[unsafe(method(stepperTouchBarItemWithIdentifier:formatter:))]
36        #[unsafe(method_family = none)]
37        pub unsafe fn stepperTouchBarItemWithIdentifier_formatter(
38            identifier: &NSTouchBarItemIdentifier,
39            formatter: &NSFormatter,
40            mtm: MainThreadMarker,
41        ) -> Retained<Self>;
42
43        #[cfg(feature = "block2")]
44        /// Creates an `NSStepperTouchBarItem` using the result of `drawingHandler` to display the stepper's value as an image
45        ///
46        ///
47        /// Parameter `drawingHandler`: A block that draws a graphical representation of the stepper's value in the specified rectangle. The coordinates of this rectangle are specified in points.
48        #[unsafe(method(stepperTouchBarItemWithIdentifier:drawingHandler:))]
49        #[unsafe(method_family = none)]
50        pub unsafe fn stepperTouchBarItemWithIdentifier_drawingHandler(
51            identifier: &NSTouchBarItemIdentifier,
52            drawing_handler: &block2::DynBlock<dyn Fn(NSRect, c_double)>,
53            mtm: MainThreadMarker,
54        ) -> Retained<Self>;
55
56        /// The stepper's maximum value. The default is 59.0.
57        #[unsafe(method(maxValue))]
58        #[unsafe(method_family = none)]
59        pub unsafe fn maxValue(&self) -> c_double;
60
61        /// Setter for [`maxValue`][Self::maxValue].
62        #[unsafe(method(setMaxValue:))]
63        #[unsafe(method_family = none)]
64        pub unsafe fn setMaxValue(&self, max_value: c_double);
65
66        /// The stepper's minimum value. The default is 0.0.
67        #[unsafe(method(minValue))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn minValue(&self) -> c_double;
70
71        /// Setter for [`minValue`][Self::minValue].
72        #[unsafe(method(setMinValue:))]
73        #[unsafe(method_family = none)]
74        pub unsafe fn setMinValue(&self, min_value: c_double);
75
76        /// The stepper's increment value. The default is 1.0.
77        #[unsafe(method(increment))]
78        #[unsafe(method_family = none)]
79        pub unsafe fn increment(&self) -> c_double;
80
81        /// Setter for [`increment`][Self::increment].
82        #[unsafe(method(setIncrement:))]
83        #[unsafe(method_family = none)]
84        pub unsafe fn setIncrement(&self, increment: c_double);
85
86        /// The current value of the stepper.
87        #[unsafe(method(value))]
88        #[unsafe(method_family = none)]
89        pub unsafe fn value(&self) -> c_double;
90
91        /// Setter for [`value`][Self::value].
92        #[unsafe(method(setValue:))]
93        #[unsafe(method_family = none)]
94        pub unsafe fn setValue(&self, value: c_double);
95
96        /// The target object that receives action messages from the stepper.
97        #[unsafe(method(target))]
98        #[unsafe(method_family = none)]
99        pub unsafe fn target(&self) -> Option<Retained<AnyObject>>;
100
101        /// This is a [weak property][objc2::topics::weak_property].
102        /// Setter for [`target`][Self::target].
103        #[unsafe(method(setTarget:))]
104        #[unsafe(method_family = none)]
105        pub unsafe fn setTarget(&self, target: Option<&AnyObject>);
106
107        /// The action-message selector associated with the stepper.
108        #[unsafe(method(action))]
109        #[unsafe(method_family = none)]
110        pub unsafe fn action(&self) -> Option<Sel>;
111
112        /// Setter for [`action`][Self::action].
113        #[unsafe(method(setAction:))]
114        #[unsafe(method_family = none)]
115        pub unsafe fn setAction(&self, action: Option<Sel>);
116
117        /// The localized string labelling this item during user customization. The default value is empty string.
118        #[unsafe(method(customizationLabel))]
119        #[unsafe(method_family = none)]
120        pub unsafe fn customizationLabel(&self) -> Retained<NSString>;
121
122        /// Setter for [`customizationLabel`][Self::customizationLabel].
123        #[unsafe(method(setCustomizationLabel:))]
124        #[unsafe(method_family = none)]
125        pub unsafe fn setCustomizationLabel(&self, customization_label: Option<&NSString>);
126    );
127}
128
129/// Methods declared on superclass `NSTouchBarItem`.
130#[cfg(feature = "NSTouchBarItem")]
131impl NSStepperTouchBarItem {
132    extern_methods!(
133        #[unsafe(method(initWithIdentifier:))]
134        #[unsafe(method_family = init)]
135        pub unsafe fn initWithIdentifier(
136            this: Allocated<Self>,
137            identifier: &NSTouchBarItemIdentifier,
138        ) -> Retained<Self>;
139
140        #[unsafe(method(initWithCoder:))]
141        #[unsafe(method_family = init)]
142        pub unsafe fn initWithCoder(
143            this: Allocated<Self>,
144            coder: &NSCoder,
145        ) -> Option<Retained<Self>>;
146
147        #[unsafe(method(init))]
148        #[unsafe(method_family = init)]
149        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
150    );
151}
152
153/// Methods declared on superclass `NSObject`.
154#[cfg(feature = "NSTouchBarItem")]
155impl NSStepperTouchBarItem {
156    extern_methods!(
157        #[unsafe(method(new))]
158        #[unsafe(method_family = new)]
159        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
160    );
161}