objc2_av_foundation/generated/AVCaptureSlider.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 /// An `AVCaptureControl` for selecting a value from a bounded range of values.
12 ///
13 ///
14 /// `AVCaptureSlider` is ideal when your control only needs a single float value. Controls may be added to an `AVCaptureSession` using `-[AVCaptureSession addControl:]`.
15 ///
16 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avcaptureslider?language=objc)
17 #[unsafe(super(AVCaptureControl, NSObject))]
18 #[derive(Debug, PartialEq, Eq, Hash)]
19 #[cfg(feature = "AVCaptureControl")]
20 pub struct AVCaptureSlider;
21);
22
23#[cfg(feature = "AVCaptureControl")]
24unsafe impl NSObjectProtocol for AVCaptureSlider {}
25
26#[cfg(feature = "AVCaptureControl")]
27impl AVCaptureSlider {
28 extern_methods!(
29 /// Initializes an `AVCaptureSlider` as a continuous slider between `minValue` and `maxValue`.
30 ///
31 ///
32 /// Parameter `localizedTitle`: A localized string that describes the slider's `action`.
33 ///
34 /// Parameter `symbolName`: The name of a symbol to represent the slider.
35 ///
36 /// Parameter `minValue`: The minimum value the slider can have. `minValue` must be less than `maxValue`, otherwise an `NSInvalidArgumentException` is thrown.
37 ///
38 /// Parameter `maxValue`: The maximum value the slider can have. `maxValue` must be greater than `minValue`, otherwise an `NSInvalidArgumentException` is thrown.
39 ///
40 /// Returns: An `AVCaptureSlider` instance as a continuous slider between `minValue` and `maxValue`.
41 ///
42 ///
43 /// Continuous sliders are used when any value in the range `minValue...maxValue` is supported.
44 #[unsafe(method(initWithLocalizedTitle:symbolName:minValue:maxValue:))]
45 #[unsafe(method_family = init)]
46 pub unsafe fn initWithLocalizedTitle_symbolName_minValue_maxValue(
47 this: Allocated<Self>,
48 localized_title: &NSString,
49 symbol_name: &NSString,
50 min_value: c_float,
51 max_value: c_float,
52 ) -> Retained<Self>;
53
54 /// Initializes an `AVCaptureSlider` as a discrete slider where the valid values are between `minValue` and `maxValue` with `step` distance between each value.
55 ///
56 ///
57 /// Parameter `localizedTitle`: A localized string that describes the slider's `action`.
58 ///
59 /// Parameter `symbolName`: The name of a symbol to represent the slider.
60 ///
61 /// Parameter `minValue`: The minimum value the slider can have. `minValue` must be less than `maxValue`, otherwise an `NSInvalidArgumentException` is thrown.
62 ///
63 /// Parameter `maxValue`: The maximum value the slider can have. `maxValue` must be greater than `minValue`, otherwise an `NSInvalidArgumentException` is thrown.
64 ///
65 /// Parameter `step`: The distance between each valid value. `step` must be greater than 0, otherwise an `NSInvalidArgumentException` is thrown.
66 ///
67 /// Returns: An `AVCaptureSlider` instance as a discrete slider where the valid values are between `minValue` and `maxValue` with `step` distance between each value.
68 ///
69 ///
70 /// Discrete sliders are used when only specific values are valid.
71 #[unsafe(method(initWithLocalizedTitle:symbolName:minValue:maxValue:step:))]
72 #[unsafe(method_family = init)]
73 pub unsafe fn initWithLocalizedTitle_symbolName_minValue_maxValue_step(
74 this: Allocated<Self>,
75 localized_title: &NSString,
76 symbol_name: &NSString,
77 min_value: c_float,
78 max_value: c_float,
79 step: c_float,
80 ) -> Retained<Self>;
81
82 /// Initializes an `AVCaptureSlider` as a discrete slider where `values` contains the valid values.
83 ///
84 ///
85 /// Parameter `localizedTitle`: A localized string that describes the slider's `action`.
86 ///
87 /// Parameter `symbolName`: The name of a symbol to represent the slider.
88 ///
89 /// Parameter `values`: The only values the slider can have.
90 ///
91 /// Returns: An `AVCaptureSlider` instance as a discrete slider where `values` contains the valid values.
92 ///
93 ///
94 /// Discrete sliders are used when only specific values are valid.
95 #[unsafe(method(initWithLocalizedTitle:symbolName:values:))]
96 #[unsafe(method_family = init)]
97 pub unsafe fn initWithLocalizedTitle_symbolName_values(
98 this: Allocated<Self>,
99 localized_title: &NSString,
100 symbol_name: &NSString,
101 values: &NSArray<NSNumber>,
102 ) -> Retained<Self>;
103
104 /// The current value of the slider.
105 ///
106 ///
107 /// Because the camera system may be independent from the main thread or `
108 /// MainThreadOnly`, `value` must be changed on `actionQueue` – the queue provided to `setActionQueue:action:`. The default value is the slider's minimum value. A value may only be set if it is within the slider's minimum and maximum values, otherwise an `NSInvalidArgumentException` is thrown.
109 #[unsafe(method(value))]
110 #[unsafe(method_family = none)]
111 pub unsafe fn value(&self) -> c_float;
112
113 /// Setter for [`value`][Self::value].
114 #[unsafe(method(setValue:))]
115 #[unsafe(method_family = none)]
116 pub unsafe fn setValue(&self, value: c_float);
117
118 /// A localized string defining the presentation of the slider's value.
119 ///
120 ///
121 /// To modify the presentation of the slider's value, set `localizedValueFormat` to a format string to display the slider's value with any annotation.
122 ///
123 /// The format string may only contain `%
124 /// @
125 /// ` and no other placeholders like `%d`, `%s`, etc. Invalid format strings will result in the value's default presentation.
126 ///
127 /// Examples of valid format strings are:
128 /// - `%
129 /// %
130 /// %` for "40%"
131 /// - `%
132 /// @
133 /// fps` for "60 fps"
134 /// - `+ %
135 /// @
136 /// ` for "+ 20"
137 #[unsafe(method(localizedValueFormat))]
138 #[unsafe(method_family = none)]
139 pub unsafe fn localizedValueFormat(&self) -> Option<Retained<NSString>>;
140
141 /// Setter for [`localizedValueFormat`][Self::localizedValueFormat].
142 #[unsafe(method(setLocalizedValueFormat:))]
143 #[unsafe(method_family = none)]
144 pub unsafe fn setLocalizedValueFormat(&self, localized_value_format: Option<&NSString>);
145
146 /// Values in this array may receive unique visual representations or behaviors.
147 #[unsafe(method(prominentValues))]
148 #[unsafe(method_family = none)]
149 pub unsafe fn prominentValues(&self) -> Retained<NSArray<NSNumber>>;
150
151 /// Setter for [`prominentValues`][Self::prominentValues].
152 #[unsafe(method(setProminentValues:))]
153 #[unsafe(method_family = none)]
154 pub unsafe fn setProminentValues(&self, prominent_values: &NSArray<NSNumber>);
155
156 /// A localized string that describes the slider's `action`.
157 #[unsafe(method(localizedTitle))]
158 #[unsafe(method_family = none)]
159 pub unsafe fn localizedTitle(&self) -> Retained<NSString>;
160
161 /// The name of a symbol to represent the slider.
162 #[unsafe(method(symbolName))]
163 #[unsafe(method_family = none)]
164 pub unsafe fn symbolName(&self) -> Retained<NSString>;
165
166 /// A string that identifies the slider.
167 #[unsafe(method(accessibilityIdentifier))]
168 #[unsafe(method_family = none)]
169 pub unsafe fn accessibilityIdentifier(&self) -> Option<Retained<NSString>>;
170
171 /// Setter for [`accessibilityIdentifier`][Self::accessibilityIdentifier].
172 #[unsafe(method(setAccessibilityIdentifier:))]
173 #[unsafe(method_family = none)]
174 pub unsafe fn setAccessibilityIdentifier(
175 &self,
176 accessibility_identifier: Option<&NSString>,
177 );
178 );
179}
180
181/// Methods declared on superclass `AVCaptureControl`.
182#[cfg(feature = "AVCaptureControl")]
183impl AVCaptureSlider {
184 extern_methods!(
185 #[unsafe(method(init))]
186 #[unsafe(method_family = init)]
187 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
188
189 #[unsafe(method(new))]
190 #[unsafe(method_family = new)]
191 pub unsafe fn new() -> Retained<Self>;
192 );
193}