objc2_ui_kit/generated/
UICellConfigurationState.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/uicellconfigurationdragstate?language=objc)
11// NS_ENUM
12#[repr(transparent)]
13#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
14pub struct UICellConfigurationDragState(pub NSInteger);
15impl UICellConfigurationDragState {
16    /// The cell is not associated with a drag session.
17    #[doc(alias = "UICellConfigurationDragStateNone")]
18    pub const None: Self = Self(0);
19    /// The cell is being lifted, before has joined a drag session.
20    #[doc(alias = "UICellConfigurationDragStateLifting")]
21    pub const Lifting: Self = Self(1);
22    /// The cell is part of an active drag session.
23    #[doc(alias = "UICellConfigurationDragStateDragging")]
24    pub const Dragging: Self = Self(2);
25}
26
27unsafe impl Encode for UICellConfigurationDragState {
28    const ENCODING: Encoding = NSInteger::ENCODING;
29}
30
31unsafe impl RefEncode for UICellConfigurationDragState {
32    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
33}
34
35/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uicellconfigurationdropstate?language=objc)
36// NS_ENUM
37#[repr(transparent)]
38#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
39pub struct UICellConfigurationDropState(pub NSInteger);
40impl UICellConfigurationDropState {
41    /// The cell is not associated with a drag session.
42    #[doc(alias = "UICellConfigurationDropStateNone")]
43    pub const None: Self = Self(0);
44    /// A drag session is active and may perform a drop in the cell's container, but the cell itself
45    /// is not the drop target.
46    #[doc(alias = "UICellConfigurationDropStateNotTargeted")]
47    pub const NotTargeted: Self = Self(1);
48    /// The cell is the drop target for a drag session.
49    #[doc(alias = "UICellConfigurationDropStateTargeted")]
50    pub const Targeted: Self = Self(2);
51}
52
53unsafe impl Encode for UICellConfigurationDropState {
54    const ENCODING: Encoding = NSInteger::ENCODING;
55}
56
57unsafe impl RefEncode for UICellConfigurationDropState {
58    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
59}
60
61extern_class!(
62    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uicellconfigurationstate?language=objc)
63    #[unsafe(super(UIViewConfigurationState, NSObject))]
64    #[thread_kind = MainThreadOnly]
65    #[derive(Debug, PartialEq, Eq, Hash)]
66    #[cfg(feature = "UIViewConfigurationState")]
67    pub struct UICellConfigurationState;
68);
69
70#[cfg(feature = "UIViewConfigurationState")]
71extern_conformance!(
72    unsafe impl NSCoding for UICellConfigurationState {}
73);
74
75#[cfg(feature = "UIViewConfigurationState")]
76extern_conformance!(
77    unsafe impl NSCopying for UICellConfigurationState {}
78);
79
80#[cfg(feature = "UIViewConfigurationState")]
81unsafe impl CopyingHelper for UICellConfigurationState {
82    type Result = Self;
83}
84
85#[cfg(feature = "UIViewConfigurationState")]
86extern_conformance!(
87    unsafe impl NSObjectProtocol for UICellConfigurationState {}
88);
89
90#[cfg(feature = "UIViewConfigurationState")]
91extern_conformance!(
92    unsafe impl NSSecureCoding for UICellConfigurationState {}
93);
94
95#[cfg(all(feature = "UIConfigurationState", feature = "UIViewConfigurationState"))]
96extern_conformance!(
97    unsafe impl UIConfigurationState for UICellConfigurationState {}
98);
99
100#[cfg(feature = "UIViewConfigurationState")]
101impl UICellConfigurationState {
102    extern_methods!(
103        #[unsafe(method(isEditing))]
104        #[unsafe(method_family = none)]
105        pub unsafe fn isEditing(&self) -> bool;
106
107        /// Setter for [`isEditing`][Self::isEditing].
108        #[unsafe(method(setEditing:))]
109        #[unsafe(method_family = none)]
110        pub unsafe fn setEditing(&self, editing: bool);
111
112        #[unsafe(method(isExpanded))]
113        #[unsafe(method_family = none)]
114        pub unsafe fn isExpanded(&self) -> bool;
115
116        /// Setter for [`isExpanded`][Self::isExpanded].
117        #[unsafe(method(setExpanded:))]
118        #[unsafe(method_family = none)]
119        pub unsafe fn setExpanded(&self, expanded: bool);
120
121        #[unsafe(method(isSwiped))]
122        #[unsafe(method_family = none)]
123        pub unsafe fn isSwiped(&self) -> bool;
124
125        /// Setter for [`isSwiped`][Self::isSwiped].
126        #[unsafe(method(setSwiped:))]
127        #[unsafe(method_family = none)]
128        pub unsafe fn setSwiped(&self, swiped: bool);
129
130        #[unsafe(method(isReordering))]
131        #[unsafe(method_family = none)]
132        pub unsafe fn isReordering(&self) -> bool;
133
134        /// Setter for [`isReordering`][Self::isReordering].
135        #[unsafe(method(setReordering:))]
136        #[unsafe(method_family = none)]
137        pub unsafe fn setReordering(&self, reordering: bool);
138
139        #[unsafe(method(cellDragState))]
140        #[unsafe(method_family = none)]
141        pub unsafe fn cellDragState(&self) -> UICellConfigurationDragState;
142
143        /// Setter for [`cellDragState`][Self::cellDragState].
144        #[unsafe(method(setCellDragState:))]
145        #[unsafe(method_family = none)]
146        pub unsafe fn setCellDragState(&self, cell_drag_state: UICellConfigurationDragState);
147
148        #[unsafe(method(cellDropState))]
149        #[unsafe(method_family = none)]
150        pub unsafe fn cellDropState(&self) -> UICellConfigurationDropState;
151
152        /// Setter for [`cellDropState`][Self::cellDropState].
153        #[unsafe(method(setCellDropState:))]
154        #[unsafe(method_family = none)]
155        pub unsafe fn setCellDropState(&self, cell_drop_state: UICellConfigurationDropState);
156    );
157}
158
159/// Methods declared on superclass `UIViewConfigurationState`.
160#[cfg(feature = "UIViewConfigurationState")]
161impl UICellConfigurationState {
162    extern_methods!(
163        #[cfg(feature = "UITraitCollection")]
164        /// Returns a new instance with the specified trait collection.
165        #[unsafe(method(initWithTraitCollection:))]
166        #[unsafe(method_family = init)]
167        pub unsafe fn initWithTraitCollection(
168            this: Allocated<Self>,
169            trait_collection: &UITraitCollection,
170        ) -> Retained<Self>;
171
172        #[unsafe(method(initWithCoder:))]
173        #[unsafe(method_family = init)]
174        pub unsafe fn initWithCoder(
175            this: Allocated<Self>,
176            coder: &NSCoder,
177        ) -> Option<Retained<Self>>;
178
179        #[unsafe(method(init))]
180        #[unsafe(method_family = init)]
181        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
182
183        #[unsafe(method(new))]
184        #[unsafe(method_family = new)]
185        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
186    );
187}