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