objc2_ui_kit/generated/
UIListSeparatorConfiguration.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
10/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uilistseparatorvisibility?language=objc)
11// NS_ENUM
12#[repr(transparent)]
13#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
14pub struct UIListSeparatorVisibility(pub NSInteger);
15impl UIListSeparatorVisibility {
16    /// UICollectionView list sections will resolve this to an appropriate value.
17    #[doc(alias = "UIListSeparatorVisibilityAutomatic")]
18    pub const Automatic: Self = Self(0);
19    /// UICollectionView list sections will resolve this to an appropriate value.
20    #[doc(alias = "UIListSeparatorVisibilityVisible")]
21    pub const Visible: Self = Self(1);
22    /// UICollectionView list sections will resolve this to an appropriate value.
23    #[doc(alias = "UIListSeparatorVisibilityHidden")]
24    pub const Hidden: Self = Self(2);
25}
26
27unsafe impl Encode for UIListSeparatorVisibility {
28    const ENCODING: Encoding = NSInteger::ENCODING;
29}
30
31unsafe impl RefEncode for UIListSeparatorVisibility {
32    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
33}
34
35extern "C" {
36    /// Use the values from the edges in this constant to indicate to the consumer of a UIListSeparatorConfiguration that the value for that
37    /// edge should be replaced with an appropriate inset.
38    ///
39    /// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uilistseparatorautomaticinsets?language=objc)
40    #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
41    pub static UIListSeparatorAutomaticInsets: NSDirectionalEdgeInsets;
42}
43
44extern_class!(
45    /// This configuration allows for fine grained control of separator appearance in a UICollectionView List section.
46    ///
47    /// See: UICollectionLayoutListConfiguration.separatorConfiguration
48    ///
49    /// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uilistseparatorconfiguration?language=objc)
50    #[unsafe(super(NSObject))]
51    #[thread_kind = MainThreadOnly]
52    #[derive(Debug, PartialEq, Eq, Hash)]
53    pub struct UIListSeparatorConfiguration;
54);
55
56extern_conformance!(
57    unsafe impl NSCoding for UIListSeparatorConfiguration {}
58);
59
60extern_conformance!(
61    unsafe impl NSCopying for UIListSeparatorConfiguration {}
62);
63
64unsafe impl CopyingHelper for UIListSeparatorConfiguration {
65    type Result = Self;
66}
67
68extern_conformance!(
69    unsafe impl NSObjectProtocol for UIListSeparatorConfiguration {}
70);
71
72extern_conformance!(
73    unsafe impl NSSecureCoding for UIListSeparatorConfiguration {}
74);
75
76impl UIListSeparatorConfiguration {
77    extern_methods!(
78        #[unsafe(method(init))]
79        #[unsafe(method_family = init)]
80        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
81
82        #[unsafe(method(new))]
83        #[unsafe(method_family = new)]
84        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
85
86        #[cfg(feature = "UICollectionLayoutList")]
87        /// Initializes a list separator configuration with the appropriate defaults for the passed in list appearance.
88        ///
89        /// Parameter `listAppearance`: The appearance of the list consuming this separator configuration
90        #[unsafe(method(initWithListAppearance:))]
91        #[unsafe(method_family = init)]
92        pub fn initWithListAppearance(
93            this: Allocated<Self>,
94            list_appearance: UICollectionLayoutListAppearance,
95        ) -> Retained<Self>;
96
97        /// The visibility of the top separator for the item that this configuration is applied to.
98        #[unsafe(method(topSeparatorVisibility))]
99        #[unsafe(method_family = none)]
100        pub fn topSeparatorVisibility(&self) -> UIListSeparatorVisibility;
101
102        /// Setter for [`topSeparatorVisibility`][Self::topSeparatorVisibility].
103        #[unsafe(method(setTopSeparatorVisibility:))]
104        #[unsafe(method_family = none)]
105        pub fn setTopSeparatorVisibility(
106            &self,
107            top_separator_visibility: UIListSeparatorVisibility,
108        );
109
110        /// The visibility of the bottom separator for the item that this configuration is applied to.
111        #[unsafe(method(bottomSeparatorVisibility))]
112        #[unsafe(method_family = none)]
113        pub fn bottomSeparatorVisibility(&self) -> UIListSeparatorVisibility;
114
115        /// Setter for [`bottomSeparatorVisibility`][Self::bottomSeparatorVisibility].
116        #[unsafe(method(setBottomSeparatorVisibility:))]
117        #[unsafe(method_family = none)]
118        pub fn setBottomSeparatorVisibility(
119            &self,
120            bottom_separator_visibility: UIListSeparatorVisibility,
121        );
122
123        #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
124        /// Insets to apply to the top separator of the item that this configuration is applied to. Defaults to UIListSeparatorAutomaticInsets.
125        #[unsafe(method(topSeparatorInsets))]
126        #[unsafe(method_family = none)]
127        pub fn topSeparatorInsets(&self) -> NSDirectionalEdgeInsets;
128
129        #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
130        /// Setter for [`topSeparatorInsets`][Self::topSeparatorInsets].
131        #[unsafe(method(setTopSeparatorInsets:))]
132        #[unsafe(method_family = none)]
133        pub fn setTopSeparatorInsets(&self, top_separator_insets: NSDirectionalEdgeInsets);
134
135        #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
136        /// Insets to apply to the bottom separator of the item that this configuration is applied to. Defaults to UIListSeparatorAutomaticInsets.
137        #[unsafe(method(bottomSeparatorInsets))]
138        #[unsafe(method_family = none)]
139        pub fn bottomSeparatorInsets(&self) -> NSDirectionalEdgeInsets;
140
141        #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
142        /// Setter for [`bottomSeparatorInsets`][Self::bottomSeparatorInsets].
143        #[unsafe(method(setBottomSeparatorInsets:))]
144        #[unsafe(method_family = none)]
145        pub fn setBottomSeparatorInsets(&self, bottom_separator_insets: NSDirectionalEdgeInsets);
146
147        #[cfg(feature = "UIColor")]
148        /// The color to use for the separators for the item this configuration is applied to.
149        #[unsafe(method(color))]
150        #[unsafe(method_family = none)]
151        pub fn color(&self) -> Retained<UIColor>;
152
153        #[cfg(feature = "UIColor")]
154        /// Setter for [`color`][Self::color].
155        #[unsafe(method(setColor:))]
156        #[unsafe(method_family = none)]
157        pub fn setColor(&self, color: &UIColor);
158
159        #[cfg(feature = "UIColor")]
160        /// The color to use for the separators for the item this configuration is applied to, when the item is in a multiple selection group.
161        #[unsafe(method(multipleSelectionColor))]
162        #[unsafe(method_family = none)]
163        pub fn multipleSelectionColor(&self) -> Retained<UIColor>;
164
165        #[cfg(feature = "UIColor")]
166        /// Setter for [`multipleSelectionColor`][Self::multipleSelectionColor].
167        #[unsafe(method(setMultipleSelectionColor:))]
168        #[unsafe(method_family = none)]
169        pub fn setMultipleSelectionColor(&self, multiple_selection_color: &UIColor);
170
171        #[cfg(feature = "UIVisualEffect")]
172        /// The visual effect to use for the separators of the item this configuration is applied to.
173        #[unsafe(method(visualEffect))]
174        #[unsafe(method_family = none)]
175        pub fn visualEffect(&self) -> Option<Retained<UIVisualEffect>>;
176
177        #[cfg(feature = "UIVisualEffect")]
178        /// Setter for [`visualEffect`][Self::visualEffect].
179        ///
180        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
181        #[unsafe(method(setVisualEffect:))]
182        #[unsafe(method_family = none)]
183        pub fn setVisualEffect(&self, visual_effect: Option<&UIVisualEffect>);
184    );
185}