objc2_ui_kit/generated/
UISliderTrackConfiguration.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/uikit/uislidertick?language=objc)
12    #[unsafe(super(NSObject))]
13    #[thread_kind = MainThreadOnly]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    pub struct UISliderTick;
16);
17
18extern_conformance!(
19    unsafe impl NSCoding for UISliderTick {}
20);
21
22extern_conformance!(
23    unsafe impl NSCopying for UISliderTick {}
24);
25
26unsafe impl CopyingHelper for UISliderTick {
27    type Result = Self;
28}
29
30extern_conformance!(
31    unsafe impl NSObjectProtocol for UISliderTick {}
32);
33
34impl UISliderTick {
35    extern_methods!(
36        #[unsafe(method(position))]
37        #[unsafe(method_family = none)]
38        pub fn position(&self) -> c_float;
39
40        #[unsafe(method(title))]
41        #[unsafe(method_family = none)]
42        pub fn title(&self) -> Option<Retained<NSString>>;
43
44        /// Setter for [`title`][Self::title].
45        ///
46        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
47        #[unsafe(method(setTitle:))]
48        #[unsafe(method_family = none)]
49        pub fn setTitle(&self, title: Option<&NSString>);
50
51        #[cfg(feature = "UIImage")]
52        #[unsafe(method(image))]
53        #[unsafe(method_family = none)]
54        pub fn image(&self) -> Option<Retained<UIImage>>;
55
56        #[cfg(feature = "UIImage")]
57        /// Setter for [`image`][Self::image].
58        ///
59        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
60        #[unsafe(method(setImage:))]
61        #[unsafe(method_family = none)]
62        pub fn setImage(&self, image: Option<&UIImage>);
63
64        #[cfg(feature = "UIImage")]
65        #[unsafe(method(tickWithPosition:title:image:))]
66        #[unsafe(method_family = none)]
67        pub fn tickWithPosition_title_image(
68            position: c_float,
69            title: Option<&NSString>,
70            image: Option<&UIImage>,
71            mtm: MainThreadMarker,
72        ) -> Retained<Self>;
73
74        #[unsafe(method(new))]
75        #[unsafe(method_family = new)]
76        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
77
78        #[unsafe(method(init))]
79        #[unsafe(method_family = init)]
80        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
81    );
82}
83
84extern_class!(
85    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uislidertrackconfiguration?language=objc)
86    #[unsafe(super(NSObject))]
87    #[thread_kind = MainThreadOnly]
88    #[derive(Debug, PartialEq, Eq, Hash)]
89    pub struct UISliderTrackConfiguration;
90);
91
92extern_conformance!(
93    unsafe impl NSCoding for UISliderTrackConfiguration {}
94);
95
96extern_conformance!(
97    unsafe impl NSCopying for UISliderTrackConfiguration {}
98);
99
100unsafe impl CopyingHelper for UISliderTrackConfiguration {
101    type Result = Self;
102}
103
104extern_conformance!(
105    unsafe impl NSObjectProtocol for UISliderTrackConfiguration {}
106);
107
108impl UISliderTrackConfiguration {
109    extern_methods!(
110        #[unsafe(method(allowsTickValuesOnly))]
111        #[unsafe(method_family = none)]
112        pub fn allowsTickValuesOnly(&self) -> bool;
113
114        /// Setter for [`allowsTickValuesOnly`][Self::allowsTickValuesOnly].
115        #[unsafe(method(setAllowsTickValuesOnly:))]
116        #[unsafe(method_family = none)]
117        pub fn setAllowsTickValuesOnly(&self, allows_tick_values_only: bool);
118
119        #[unsafe(method(neutralValue))]
120        #[unsafe(method_family = none)]
121        pub fn neutralValue(&self) -> c_float;
122
123        /// Setter for [`neutralValue`][Self::neutralValue].
124        #[unsafe(method(setNeutralValue:))]
125        #[unsafe(method_family = none)]
126        pub fn setNeutralValue(&self, neutral_value: c_float);
127
128        #[unsafe(method(minimumEnabledValue))]
129        #[unsafe(method_family = none)]
130        pub fn minimumEnabledValue(&self) -> c_float;
131
132        /// Setter for [`minimumEnabledValue`][Self::minimumEnabledValue].
133        #[unsafe(method(setMinimumEnabledValue:))]
134        #[unsafe(method_family = none)]
135        pub fn setMinimumEnabledValue(&self, minimum_enabled_value: c_float);
136
137        #[unsafe(method(maximumEnabledValue))]
138        #[unsafe(method_family = none)]
139        pub fn maximumEnabledValue(&self) -> c_float;
140
141        /// Setter for [`maximumEnabledValue`][Self::maximumEnabledValue].
142        #[unsafe(method(setMaximumEnabledValue:))]
143        #[unsafe(method_family = none)]
144        pub fn setMaximumEnabledValue(&self, maximum_enabled_value: c_float);
145
146        #[unsafe(method(ticks))]
147        #[unsafe(method_family = none)]
148        pub fn ticks(&self) -> Retained<NSArray<UISliderTick>>;
149
150        #[unsafe(method(configurationWithTicks:))]
151        #[unsafe(method_family = none)]
152        pub fn configurationWithTicks(
153            ticks: &NSArray<UISliderTick>,
154            mtm: MainThreadMarker,
155        ) -> Retained<Self>;
156
157        #[unsafe(method(configurationWithNumberOfTicks:))]
158        #[unsafe(method_family = none)]
159        pub fn configurationWithNumberOfTicks(
160            ticks: NSInteger,
161            mtm: MainThreadMarker,
162        ) -> Retained<Self>;
163
164        #[unsafe(method(new))]
165        #[unsafe(method_family = new)]
166        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
167
168        #[unsafe(method(init))]
169        #[unsafe(method_family = init)]
170        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
171    );
172}