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")]
71unsafe impl NSCoding for UICellConfigurationState {}
72
73#[cfg(feature = "UIViewConfigurationState")]
74unsafe impl NSCopying for UICellConfigurationState {}
75
76#[cfg(feature = "UIViewConfigurationState")]
77unsafe impl CopyingHelper for UICellConfigurationState {
78    type Result = Self;
79}
80
81#[cfg(feature = "UIViewConfigurationState")]
82unsafe impl NSObjectProtocol for UICellConfigurationState {}
83
84#[cfg(feature = "UIViewConfigurationState")]
85unsafe impl NSSecureCoding for UICellConfigurationState {}
86
87#[cfg(all(feature = "UIConfigurationState", feature = "UIViewConfigurationState"))]
88unsafe impl UIConfigurationState for UICellConfigurationState {}
89
90#[cfg(feature = "UIViewConfigurationState")]
91impl UICellConfigurationState {
92    extern_methods!(
93        #[unsafe(method(isEditing))]
94        #[unsafe(method_family = none)]
95        pub unsafe fn isEditing(&self) -> bool;
96
97        /// Setter for [`isEditing`][Self::isEditing].
98        #[unsafe(method(setEditing:))]
99        #[unsafe(method_family = none)]
100        pub unsafe fn setEditing(&self, editing: bool);
101
102        #[unsafe(method(isExpanded))]
103        #[unsafe(method_family = none)]
104        pub unsafe fn isExpanded(&self) -> bool;
105
106        /// Setter for [`isExpanded`][Self::isExpanded].
107        #[unsafe(method(setExpanded:))]
108        #[unsafe(method_family = none)]
109        pub unsafe fn setExpanded(&self, expanded: bool);
110
111        #[unsafe(method(isSwiped))]
112        #[unsafe(method_family = none)]
113        pub unsafe fn isSwiped(&self) -> bool;
114
115        /// Setter for [`isSwiped`][Self::isSwiped].
116        #[unsafe(method(setSwiped:))]
117        #[unsafe(method_family = none)]
118        pub unsafe fn setSwiped(&self, swiped: bool);
119
120        #[unsafe(method(isReordering))]
121        #[unsafe(method_family = none)]
122        pub unsafe fn isReordering(&self) -> bool;
123
124        /// Setter for [`isReordering`][Self::isReordering].
125        #[unsafe(method(setReordering:))]
126        #[unsafe(method_family = none)]
127        pub unsafe fn setReordering(&self, reordering: bool);
128
129        #[unsafe(method(cellDragState))]
130        #[unsafe(method_family = none)]
131        pub unsafe fn cellDragState(&self) -> UICellConfigurationDragState;
132
133        /// Setter for [`cellDragState`][Self::cellDragState].
134        #[unsafe(method(setCellDragState:))]
135        #[unsafe(method_family = none)]
136        pub unsafe fn setCellDragState(&self, cell_drag_state: UICellConfigurationDragState);
137
138        #[unsafe(method(cellDropState))]
139        #[unsafe(method_family = none)]
140        pub unsafe fn cellDropState(&self) -> UICellConfigurationDropState;
141
142        /// Setter for [`cellDropState`][Self::cellDropState].
143        #[unsafe(method(setCellDropState:))]
144        #[unsafe(method_family = none)]
145        pub unsafe fn setCellDropState(&self, cell_drop_state: UICellConfigurationDropState);
146    );
147}
148
149/// Methods declared on superclass `UIViewConfigurationState`.
150#[cfg(feature = "UIViewConfigurationState")]
151impl UICellConfigurationState {
152    extern_methods!(
153        #[cfg(feature = "UITraitCollection")]
154        /// Returns a new instance with the specified trait collection.
155        #[unsafe(method(initWithTraitCollection:))]
156        #[unsafe(method_family = init)]
157        pub unsafe fn initWithTraitCollection(
158            this: Allocated<Self>,
159            trait_collection: &UITraitCollection,
160        ) -> Retained<Self>;
161
162        #[unsafe(method(initWithCoder:))]
163        #[unsafe(method_family = init)]
164        pub unsafe fn initWithCoder(
165            this: Allocated<Self>,
166            coder: &NSCoder,
167        ) -> Option<Retained<Self>>;
168
169        #[unsafe(method(init))]
170        #[unsafe(method_family = init)]
171        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
172
173        #[unsafe(method(new))]
174        #[unsafe(method_family = new)]
175        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
176    );
177}