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
56unsafe impl NSCoding for UIListSeparatorConfiguration {}
57
58unsafe impl NSCopying for UIListSeparatorConfiguration {}
59
60unsafe impl CopyingHelper for UIListSeparatorConfiguration {
61    type Result = Self;
62}
63
64unsafe impl NSObjectProtocol for UIListSeparatorConfiguration {}
65
66unsafe impl NSSecureCoding for UIListSeparatorConfiguration {}
67
68impl UIListSeparatorConfiguration {
69    extern_methods!(
70        #[unsafe(method(init))]
71        #[unsafe(method_family = init)]
72        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
73
74        #[unsafe(method(new))]
75        #[unsafe(method_family = new)]
76        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
77
78        #[cfg(feature = "UICollectionLayoutList")]
79        /// Initializes a list separator configuration with the appropriate defaults for the passed in list appearance.
80        ///
81        /// Parameter `listAppearance`: The appearance of the list consuming this separator configuration
82        #[unsafe(method(initWithListAppearance:))]
83        #[unsafe(method_family = init)]
84        pub unsafe fn initWithListAppearance(
85            this: Allocated<Self>,
86            list_appearance: UICollectionLayoutListAppearance,
87        ) -> Retained<Self>;
88
89        /// The visibility of the top separator for the item that this configuration is applied to.
90        #[unsafe(method(topSeparatorVisibility))]
91        #[unsafe(method_family = none)]
92        pub unsafe fn topSeparatorVisibility(&self) -> UIListSeparatorVisibility;
93
94        /// Setter for [`topSeparatorVisibility`][Self::topSeparatorVisibility].
95        #[unsafe(method(setTopSeparatorVisibility:))]
96        #[unsafe(method_family = none)]
97        pub unsafe fn setTopSeparatorVisibility(
98            &self,
99            top_separator_visibility: UIListSeparatorVisibility,
100        );
101
102        /// The visibility of the bottom separator for the item that this configuration is applied to.
103        #[unsafe(method(bottomSeparatorVisibility))]
104        #[unsafe(method_family = none)]
105        pub unsafe fn bottomSeparatorVisibility(&self) -> UIListSeparatorVisibility;
106
107        /// Setter for [`bottomSeparatorVisibility`][Self::bottomSeparatorVisibility].
108        #[unsafe(method(setBottomSeparatorVisibility:))]
109        #[unsafe(method_family = none)]
110        pub unsafe fn setBottomSeparatorVisibility(
111            &self,
112            bottom_separator_visibility: UIListSeparatorVisibility,
113        );
114
115        #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
116        /// Insets to apply to the top separator of the item that this configuration is applied to. Defaults to UIListSeparatorAutomaticInsets.
117        #[unsafe(method(topSeparatorInsets))]
118        #[unsafe(method_family = none)]
119        pub unsafe fn topSeparatorInsets(&self) -> NSDirectionalEdgeInsets;
120
121        #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
122        /// Setter for [`topSeparatorInsets`][Self::topSeparatorInsets].
123        #[unsafe(method(setTopSeparatorInsets:))]
124        #[unsafe(method_family = none)]
125        pub unsafe fn setTopSeparatorInsets(&self, top_separator_insets: NSDirectionalEdgeInsets);
126
127        #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
128        /// Insets to apply to the bottom separator of the item that this configuration is applied to. Defaults to UIListSeparatorAutomaticInsets.
129        #[unsafe(method(bottomSeparatorInsets))]
130        #[unsafe(method_family = none)]
131        pub unsafe fn bottomSeparatorInsets(&self) -> NSDirectionalEdgeInsets;
132
133        #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
134        /// Setter for [`bottomSeparatorInsets`][Self::bottomSeparatorInsets].
135        #[unsafe(method(setBottomSeparatorInsets:))]
136        #[unsafe(method_family = none)]
137        pub unsafe fn setBottomSeparatorInsets(
138            &self,
139            bottom_separator_insets: NSDirectionalEdgeInsets,
140        );
141
142        #[cfg(feature = "UIColor")]
143        /// The color to use for the separators for the item this configuration is applied to.
144        #[unsafe(method(color))]
145        #[unsafe(method_family = none)]
146        pub unsafe fn color(&self) -> Retained<UIColor>;
147
148        #[cfg(feature = "UIColor")]
149        /// Setter for [`color`][Self::color].
150        #[unsafe(method(setColor:))]
151        #[unsafe(method_family = none)]
152        pub unsafe fn setColor(&self, color: &UIColor);
153
154        #[cfg(feature = "UIColor")]
155        /// The color to use for the separators for the item this configuration is applied to, when the item is in a multiple selection group.
156        #[unsafe(method(multipleSelectionColor))]
157        #[unsafe(method_family = none)]
158        pub unsafe fn multipleSelectionColor(&self) -> Retained<UIColor>;
159
160        #[cfg(feature = "UIColor")]
161        /// Setter for [`multipleSelectionColor`][Self::multipleSelectionColor].
162        #[unsafe(method(setMultipleSelectionColor:))]
163        #[unsafe(method_family = none)]
164        pub unsafe fn setMultipleSelectionColor(&self, multiple_selection_color: &UIColor);
165
166        #[cfg(feature = "UIVisualEffect")]
167        /// The visual effect to use for the separators of the item this configuration is applied to.
168        #[unsafe(method(visualEffect))]
169        #[unsafe(method_family = none)]
170        pub unsafe fn visualEffect(&self) -> Option<Retained<UIVisualEffect>>;
171
172        #[cfg(feature = "UIVisualEffect")]
173        /// Setter for [`visualEffect`][Self::visualEffect].
174        #[unsafe(method(setVisualEffect:))]
175        #[unsafe(method_family = none)]
176        pub unsafe fn setVisualEffect(&self, visual_effect: Option<&UIVisualEffect>);
177    );
178}