objc2_ui_kit/generated/
UITableViewCell.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::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9#[cfg(feature = "objc2-quartz-core")]
10#[cfg(not(target_os = "watchos"))]
11use objc2_quartz_core::*;
12
13use crate::*;
14
15/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitableviewcellstyle?language=objc)
16// NS_ENUM
17#[repr(transparent)]
18#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
19pub struct UITableViewCellStyle(pub NSInteger);
20impl UITableViewCellStyle {
21    #[doc(alias = "UITableViewCellStyleDefault")]
22    pub const Default: Self = Self(0);
23    #[doc(alias = "UITableViewCellStyleValue1")]
24    pub const Value1: Self = Self(1);
25    #[doc(alias = "UITableViewCellStyleValue2")]
26    pub const Value2: Self = Self(2);
27    #[doc(alias = "UITableViewCellStyleSubtitle")]
28    pub const Subtitle: Self = Self(3);
29}
30
31unsafe impl Encode for UITableViewCellStyle {
32    const ENCODING: Encoding = NSInteger::ENCODING;
33}
34
35unsafe impl RefEncode for UITableViewCellStyle {
36    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
37}
38
39/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitableviewcellseparatorstyle?language=objc)
40// NS_ENUM
41#[repr(transparent)]
42#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
43pub struct UITableViewCellSeparatorStyle(pub NSInteger);
44impl UITableViewCellSeparatorStyle {
45    #[doc(alias = "UITableViewCellSeparatorStyleNone")]
46    pub const None: Self = Self(0);
47    #[doc(alias = "UITableViewCellSeparatorStyleSingleLine")]
48    pub const SingleLine: Self = Self(1);
49    #[doc(alias = "UITableViewCellSeparatorStyleSingleLineEtched")]
50    #[deprecated = "Use UITableViewCellSeparatorStyleSingleLine for a single line separator."]
51    pub const SingleLineEtched: Self = Self(2);
52}
53
54unsafe impl Encode for UITableViewCellSeparatorStyle {
55    const ENCODING: Encoding = NSInteger::ENCODING;
56}
57
58unsafe impl RefEncode for UITableViewCellSeparatorStyle {
59    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
60}
61
62/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitableviewcellselectionstyle?language=objc)
63// NS_ENUM
64#[repr(transparent)]
65#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
66pub struct UITableViewCellSelectionStyle(pub NSInteger);
67impl UITableViewCellSelectionStyle {
68    #[doc(alias = "UITableViewCellSelectionStyleNone")]
69    pub const None: Self = Self(0);
70    #[doc(alias = "UITableViewCellSelectionStyleBlue")]
71    pub const Blue: Self = Self(1);
72    #[doc(alias = "UITableViewCellSelectionStyleGray")]
73    pub const Gray: Self = Self(2);
74    #[doc(alias = "UITableViewCellSelectionStyleDefault")]
75    pub const Default: Self = Self(3);
76}
77
78unsafe impl Encode for UITableViewCellSelectionStyle {
79    const ENCODING: Encoding = NSInteger::ENCODING;
80}
81
82unsafe impl RefEncode for UITableViewCellSelectionStyle {
83    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
84}
85
86/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitableviewcellfocusstyle?language=objc)
87// NS_ENUM
88#[repr(transparent)]
89#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
90pub struct UITableViewCellFocusStyle(pub NSInteger);
91impl UITableViewCellFocusStyle {
92    #[doc(alias = "UITableViewCellFocusStyleDefault")]
93    pub const Default: Self = Self(0);
94    #[doc(alias = "UITableViewCellFocusStyleCustom")]
95    pub const Custom: Self = Self(1);
96}
97
98unsafe impl Encode for UITableViewCellFocusStyle {
99    const ENCODING: Encoding = NSInteger::ENCODING;
100}
101
102unsafe impl RefEncode for UITableViewCellFocusStyle {
103    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
104}
105
106/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitableviewcelleditingstyle?language=objc)
107// NS_ENUM
108#[repr(transparent)]
109#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
110pub struct UITableViewCellEditingStyle(pub NSInteger);
111impl UITableViewCellEditingStyle {
112    #[doc(alias = "UITableViewCellEditingStyleNone")]
113    pub const None: Self = Self(0);
114    #[doc(alias = "UITableViewCellEditingStyleDelete")]
115    pub const Delete: Self = Self(1);
116    #[doc(alias = "UITableViewCellEditingStyleInsert")]
117    pub const Insert: Self = Self(2);
118}
119
120unsafe impl Encode for UITableViewCellEditingStyle {
121    const ENCODING: Encoding = NSInteger::ENCODING;
122}
123
124unsafe impl RefEncode for UITableViewCellEditingStyle {
125    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
126}
127
128/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitableviewcellaccessorytype?language=objc)
129// NS_ENUM
130#[repr(transparent)]
131#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
132pub struct UITableViewCellAccessoryType(pub NSInteger);
133impl UITableViewCellAccessoryType {
134    #[doc(alias = "UITableViewCellAccessoryNone")]
135    pub const None: Self = Self(0);
136    #[doc(alias = "UITableViewCellAccessoryDisclosureIndicator")]
137    pub const DisclosureIndicator: Self = Self(1);
138    #[doc(alias = "UITableViewCellAccessoryDetailDisclosureButton")]
139    pub const DetailDisclosureButton: Self = Self(2);
140    #[doc(alias = "UITableViewCellAccessoryCheckmark")]
141    pub const Checkmark: Self = Self(3);
142    #[doc(alias = "UITableViewCellAccessoryDetailButton")]
143    pub const DetailButton: Self = Self(4);
144}
145
146unsafe impl Encode for UITableViewCellAccessoryType {
147    const ENCODING: Encoding = NSInteger::ENCODING;
148}
149
150unsafe impl RefEncode for UITableViewCellAccessoryType {
151    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
152}
153
154/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitableviewcellstatemask?language=objc)
155// NS_OPTIONS
156#[repr(transparent)]
157#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
158pub struct UITableViewCellStateMask(pub NSUInteger);
159bitflags::bitflags! {
160    impl UITableViewCellStateMask: NSUInteger {
161        #[doc(alias = "UITableViewCellStateDefaultMask")]
162        const DefaultMask = 0;
163        #[doc(alias = "UITableViewCellStateShowingEditControlMask")]
164        const ShowingEditControlMask = 1<<0;
165        #[doc(alias = "UITableViewCellStateShowingDeleteConfirmationMask")]
166        const ShowingDeleteConfirmationMask = 1<<1;
167    }
168}
169
170unsafe impl Encode for UITableViewCellStateMask {
171    const ENCODING: Encoding = NSUInteger::ENCODING;
172}
173
174unsafe impl RefEncode for UITableViewCellStateMask {
175    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
176}
177
178/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitableviewcelldragstate?language=objc)
179// NS_ENUM
180#[repr(transparent)]
181#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
182pub struct UITableViewCellDragState(pub NSInteger);
183impl UITableViewCellDragState {
184    #[doc(alias = "UITableViewCellDragStateNone")]
185    pub const None: Self = Self(0);
186    #[doc(alias = "UITableViewCellDragStateLifting")]
187    pub const Lifting: Self = Self(1);
188    #[doc(alias = "UITableViewCellDragStateDragging")]
189    pub const Dragging: Self = Self(2);
190}
191
192unsafe impl Encode for UITableViewCellDragState {
193    const ENCODING: Encoding = NSInteger::ENCODING;
194}
195
196unsafe impl RefEncode for UITableViewCellDragState {
197    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
198}
199
200/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitableviewcellconfigurationupdatehandler?language=objc)
201#[cfg(all(
202    feature = "UICellConfigurationState",
203    feature = "UIResponder",
204    feature = "UIView",
205    feature = "UIViewConfigurationState",
206    feature = "block2"
207))]
208pub type UITableViewCellConfigurationUpdateHandler =
209    *mut block2::DynBlock<dyn Fn(NonNull<UITableViewCell>, NonNull<UICellConfigurationState>)>;
210
211extern_class!(
212    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitableviewcell?language=objc)
213    #[unsafe(super(UIView, UIResponder, NSObject))]
214    #[thread_kind = MainThreadOnly]
215    #[derive(Debug, PartialEq, Eq, Hash)]
216    #[cfg(all(feature = "UIResponder", feature = "UIView"))]
217    pub struct UITableViewCell;
218);
219
220#[cfg(all(
221    feature = "UIResponder",
222    feature = "UIView",
223    feature = "objc2-quartz-core"
224))]
225#[cfg(not(target_os = "watchos"))]
226extern_conformance!(
227    unsafe impl CALayerDelegate for UITableViewCell {}
228);
229
230#[cfg(all(feature = "UIResponder", feature = "UIView"))]
231extern_conformance!(
232    unsafe impl NSCoding for UITableViewCell {}
233);
234
235#[cfg(all(feature = "UIResponder", feature = "UIView"))]
236extern_conformance!(
237    unsafe impl NSObjectProtocol for UITableViewCell {}
238);
239
240#[cfg(all(feature = "UIAppearance", feature = "UIResponder", feature = "UIView"))]
241extern_conformance!(
242    unsafe impl UIAppearance for UITableViewCell {}
243);
244
245#[cfg(all(feature = "UIAppearance", feature = "UIResponder", feature = "UIView"))]
246extern_conformance!(
247    unsafe impl UIAppearanceContainer for UITableViewCell {}
248);
249
250#[cfg(all(feature = "UIResponder", feature = "UIView"))]
251extern_conformance!(
252    unsafe impl UICoordinateSpace for UITableViewCell {}
253);
254
255#[cfg(all(
256    feature = "UIDynamicBehavior",
257    feature = "UIResponder",
258    feature = "UIView"
259))]
260extern_conformance!(
261    unsafe impl UIDynamicItem for UITableViewCell {}
262);
263
264#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
265extern_conformance!(
266    unsafe impl UIFocusEnvironment for UITableViewCell {}
267);
268
269#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
270extern_conformance!(
271    unsafe impl UIFocusItem for UITableViewCell {}
272);
273
274#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
275extern_conformance!(
276    unsafe impl UIFocusItemContainer for UITableViewCell {}
277);
278
279#[cfg(all(
280    feature = "UIGestureRecognizer",
281    feature = "UIResponder",
282    feature = "UIView"
283))]
284extern_conformance!(
285    unsafe impl UIGestureRecognizerDelegate for UITableViewCell {}
286);
287
288#[cfg(all(feature = "UIResponder", feature = "UIView"))]
289extern_conformance!(
290    unsafe impl UIResponderStandardEditActions for UITableViewCell {}
291);
292
293#[cfg(all(
294    feature = "UIResponder",
295    feature = "UITraitCollection",
296    feature = "UIView"
297))]
298extern_conformance!(
299    unsafe impl UITraitEnvironment for UITableViewCell {}
300);
301
302#[cfg(all(feature = "UIResponder", feature = "UIView"))]
303impl UITableViewCell {
304    extern_methods!(
305        #[unsafe(method(initWithStyle:reuseIdentifier:))]
306        #[unsafe(method_family = init)]
307        pub fn initWithStyle_reuseIdentifier(
308            this: Allocated<Self>,
309            style: UITableViewCellStyle,
310            reuse_identifier: Option<&NSString>,
311        ) -> Retained<Self>;
312
313        /// # Safety
314        ///
315        /// `coder` possibly has further requirements.
316        #[unsafe(method(initWithCoder:))]
317        #[unsafe(method_family = init)]
318        pub unsafe fn initWithCoder(
319            this: Allocated<Self>,
320            coder: &NSCoder,
321        ) -> Option<Retained<Self>>;
322
323        #[cfg(all(
324            feature = "UICellConfigurationState",
325            feature = "UIViewConfigurationState"
326        ))]
327        /// Returns the current configuration state for the cell.
328        /// To add your own custom state(s), override the getter and call super to obtain an instance with the
329        /// system properties set, then set your own custom states as desired.
330        #[unsafe(method(configurationState))]
331        #[unsafe(method_family = none)]
332        pub fn configurationState(&self) -> Retained<UICellConfigurationState>;
333
334        /// Requests the cell update its configuration for its current state. This method is called automatically
335        /// when the cell's `configurationState` may have changed, as well as in other circumstances where an
336        /// update may be required. Multiple requests may be coalesced into a single update at the appropriate time.
337        #[unsafe(method(setNeedsUpdateConfiguration))]
338        #[unsafe(method_family = none)]
339        pub fn setNeedsUpdateConfiguration(&self);
340
341        #[cfg(all(
342            feature = "UICellConfigurationState",
343            feature = "UIViewConfigurationState"
344        ))]
345        /// Subclasses should override this method and update the cell's configuration using the state provided.
346        /// This method should not be called directly, use `setNeedsUpdateConfiguration` to request an update.
347        #[unsafe(method(updateConfigurationUsingState:))]
348        #[unsafe(method_family = none)]
349        pub fn updateConfigurationUsingState(&self, state: &UICellConfigurationState);
350
351        #[cfg(all(
352            feature = "UICellConfigurationState",
353            feature = "UIViewConfigurationState",
354            feature = "block2"
355        ))]
356        /// Optional block-based alternative to overriding `-updateConfigurationUsingState:` in a subclass. This handler
357        /// is called after `-updateConfigurationUsingState:`. Setting a new handler triggers `setNeedsUpdateConfiguration`.
358        ///
359        /// # Safety
360        ///
361        /// - The returned block's argument 1 must be a valid pointer.
362        /// - The returned block's argument 2 must be a valid pointer.
363        #[unsafe(method(configurationUpdateHandler))]
364        #[unsafe(method_family = none)]
365        pub unsafe fn configurationUpdateHandler(
366            &self,
367        ) -> UITableViewCellConfigurationUpdateHandler;
368
369        #[cfg(all(
370            feature = "UICellConfigurationState",
371            feature = "UIViewConfigurationState",
372            feature = "block2"
373        ))]
374        /// Setter for [`configurationUpdateHandler`][Self::configurationUpdateHandler].
375        ///
376        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
377        ///
378        /// # Safety
379        ///
380        /// `configuration_update_handler` must be a valid pointer or null.
381        #[unsafe(method(setConfigurationUpdateHandler:))]
382        #[unsafe(method_family = none)]
383        pub unsafe fn setConfigurationUpdateHandler(
384            &self,
385            configuration_update_handler: UITableViewCellConfigurationUpdateHandler,
386        );
387
388        #[cfg(feature = "UIListContentConfiguration")]
389        /// Returns a default list content configuration for the cell's style.
390        #[unsafe(method(defaultContentConfiguration))]
391        #[unsafe(method_family = none)]
392        pub fn defaultContentConfiguration(&self) -> Retained<UIListContentConfiguration>;
393
394        #[cfg(feature = "UIContentConfiguration")]
395        /// Setting a content configuration replaces the existing contentView of the cell with a new content view instance from the configuration,
396        /// or directly applies the configuration to the existing content view if the configuration is compatible with the existing content view type.
397        /// The default value is nil. After a configuration has been set, setting this property to nil will replace the current content view with a new content view.
398        #[unsafe(method(contentConfiguration))]
399        #[unsafe(method_family = none)]
400        pub fn contentConfiguration(
401            &self,
402        ) -> Option<Retained<ProtocolObject<dyn UIContentConfiguration>>>;
403
404        #[cfg(feature = "UIContentConfiguration")]
405        /// Setter for [`contentConfiguration`][Self::contentConfiguration].
406        ///
407        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
408        #[unsafe(method(setContentConfiguration:))]
409        #[unsafe(method_family = none)]
410        pub fn setContentConfiguration(
411            &self,
412            content_configuration: Option<&ProtocolObject<dyn UIContentConfiguration>>,
413        );
414
415        /// When YES, the cell will automatically call -updatedConfigurationForState: on its `contentConfiguration` when the cell's
416        /// configuration state changes, and apply the updated configuration back to the cell. The default value is YES.
417        #[unsafe(method(automaticallyUpdatesContentConfiguration))]
418        #[unsafe(method_family = none)]
419        pub fn automaticallyUpdatesContentConfiguration(&self) -> bool;
420
421        /// Setter for [`automaticallyUpdatesContentConfiguration`][Self::automaticallyUpdatesContentConfiguration].
422        #[unsafe(method(setAutomaticallyUpdatesContentConfiguration:))]
423        #[unsafe(method_family = none)]
424        pub fn setAutomaticallyUpdatesContentConfiguration(
425            &self,
426            automatically_updates_content_configuration: bool,
427        );
428
429        #[unsafe(method(contentView))]
430        #[unsafe(method_family = none)]
431        pub fn contentView(&self) -> Retained<UIView>;
432
433        #[cfg(feature = "UIImageView")]
434        #[deprecated = "Use UIListContentConfiguration instead, this property will be deprecated in a future release."]
435        #[unsafe(method(imageView))]
436        #[unsafe(method_family = none)]
437        pub fn imageView(&self) -> Option<Retained<UIImageView>>;
438
439        #[cfg(feature = "UILabel")]
440        #[deprecated = "Use UIListContentConfiguration instead, this property will be deprecated in a future release."]
441        #[unsafe(method(textLabel))]
442        #[unsafe(method_family = none)]
443        pub fn textLabel(&self) -> Option<Retained<UILabel>>;
444
445        #[cfg(feature = "UILabel")]
446        #[deprecated = "Use UIListContentConfiguration instead, this property will be deprecated in a future release."]
447        #[unsafe(method(detailTextLabel))]
448        #[unsafe(method_family = none)]
449        pub fn detailTextLabel(&self) -> Option<Retained<UILabel>>;
450
451        #[cfg(feature = "UIBackgroundConfiguration")]
452        /// Returns a default background configuration for the cell's style.
453        /// This background configuration represents the default appearance that the cell will use.
454        #[unsafe(method(defaultBackgroundConfiguration))]
455        #[unsafe(method_family = none)]
456        pub fn defaultBackgroundConfiguration(&self) -> Retained<UIBackgroundConfiguration>;
457
458        #[cfg(feature = "UIBackgroundConfiguration")]
459        /// Setting a background configuration supersedes the cell's backgroundView, selectedBackgroundView, and multipleSelectionBackgroundView. The default value is nil.
460        #[unsafe(method(backgroundConfiguration))]
461        #[unsafe(method_family = none)]
462        pub fn backgroundConfiguration(&self) -> Option<Retained<UIBackgroundConfiguration>>;
463
464        #[cfg(feature = "UIBackgroundConfiguration")]
465        /// Setter for [`backgroundConfiguration`][Self::backgroundConfiguration].
466        ///
467        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
468        #[unsafe(method(setBackgroundConfiguration:))]
469        #[unsafe(method_family = none)]
470        pub fn setBackgroundConfiguration(
471            &self,
472            background_configuration: Option<&UIBackgroundConfiguration>,
473        );
474
475        /// When YES, the cell will automatically call -updatedConfigurationForState: on its `backgroundConfiguration` when the cell's
476        /// configuration state changes, and apply the updated configuration back to the cell. The default value is YES.
477        #[unsafe(method(automaticallyUpdatesBackgroundConfiguration))]
478        #[unsafe(method_family = none)]
479        pub fn automaticallyUpdatesBackgroundConfiguration(&self) -> bool;
480
481        /// Setter for [`automaticallyUpdatesBackgroundConfiguration`][Self::automaticallyUpdatesBackgroundConfiguration].
482        #[unsafe(method(setAutomaticallyUpdatesBackgroundConfiguration:))]
483        #[unsafe(method_family = none)]
484        pub fn setAutomaticallyUpdatesBackgroundConfiguration(
485            &self,
486            automatically_updates_background_configuration: bool,
487        );
488
489        #[unsafe(method(backgroundView))]
490        #[unsafe(method_family = none)]
491        pub fn backgroundView(&self) -> Option<Retained<UIView>>;
492
493        /// Setter for [`backgroundView`][Self::backgroundView].
494        #[unsafe(method(setBackgroundView:))]
495        #[unsafe(method_family = none)]
496        pub fn setBackgroundView(&self, background_view: Option<&UIView>);
497
498        #[unsafe(method(selectedBackgroundView))]
499        #[unsafe(method_family = none)]
500        pub fn selectedBackgroundView(&self) -> Option<Retained<UIView>>;
501
502        /// Setter for [`selectedBackgroundView`][Self::selectedBackgroundView].
503        #[unsafe(method(setSelectedBackgroundView:))]
504        #[unsafe(method_family = none)]
505        pub fn setSelectedBackgroundView(&self, selected_background_view: Option<&UIView>);
506
507        #[unsafe(method(multipleSelectionBackgroundView))]
508        #[unsafe(method_family = none)]
509        pub fn multipleSelectionBackgroundView(&self) -> Option<Retained<UIView>>;
510
511        /// Setter for [`multipleSelectionBackgroundView`][Self::multipleSelectionBackgroundView].
512        #[unsafe(method(setMultipleSelectionBackgroundView:))]
513        #[unsafe(method_family = none)]
514        pub fn setMultipleSelectionBackgroundView(
515            &self,
516            multiple_selection_background_view: Option<&UIView>,
517        );
518
519        #[unsafe(method(reuseIdentifier))]
520        #[unsafe(method_family = none)]
521        pub fn reuseIdentifier(&self) -> Option<Retained<NSString>>;
522
523        #[unsafe(method(prepareForReuse))]
524        #[unsafe(method_family = none)]
525        pub fn prepareForReuse(&self);
526
527        #[unsafe(method(selectionStyle))]
528        #[unsafe(method_family = none)]
529        pub fn selectionStyle(&self) -> UITableViewCellSelectionStyle;
530
531        /// Setter for [`selectionStyle`][Self::selectionStyle].
532        #[unsafe(method(setSelectionStyle:))]
533        #[unsafe(method_family = none)]
534        pub fn setSelectionStyle(&self, selection_style: UITableViewCellSelectionStyle);
535
536        #[unsafe(method(isSelected))]
537        #[unsafe(method_family = none)]
538        pub fn isSelected(&self) -> bool;
539
540        /// Setter for [`isSelected`][Self::isSelected].
541        #[unsafe(method(setSelected:))]
542        #[unsafe(method_family = none)]
543        pub fn setSelected(&self, selected: bool);
544
545        #[unsafe(method(isHighlighted))]
546        #[unsafe(method_family = none)]
547        pub fn isHighlighted(&self) -> bool;
548
549        /// Setter for [`isHighlighted`][Self::isHighlighted].
550        #[unsafe(method(setHighlighted:))]
551        #[unsafe(method_family = none)]
552        pub fn setHighlighted(&self, highlighted: bool);
553
554        #[unsafe(method(setSelected:animated:))]
555        #[unsafe(method_family = none)]
556        pub fn setSelected_animated(&self, selected: bool, animated: bool);
557
558        #[unsafe(method(setHighlighted:animated:))]
559        #[unsafe(method_family = none)]
560        pub fn setHighlighted_animated(&self, highlighted: bool, animated: bool);
561
562        #[unsafe(method(editingStyle))]
563        #[unsafe(method_family = none)]
564        pub fn editingStyle(&self) -> UITableViewCellEditingStyle;
565
566        #[unsafe(method(showsReorderControl))]
567        #[unsafe(method_family = none)]
568        pub fn showsReorderControl(&self) -> bool;
569
570        /// Setter for [`showsReorderControl`][Self::showsReorderControl].
571        #[unsafe(method(setShowsReorderControl:))]
572        #[unsafe(method_family = none)]
573        pub fn setShowsReorderControl(&self, shows_reorder_control: bool);
574
575        #[unsafe(method(shouldIndentWhileEditing))]
576        #[unsafe(method_family = none)]
577        pub fn shouldIndentWhileEditing(&self) -> bool;
578
579        /// Setter for [`shouldIndentWhileEditing`][Self::shouldIndentWhileEditing].
580        #[unsafe(method(setShouldIndentWhileEditing:))]
581        #[unsafe(method_family = none)]
582        pub fn setShouldIndentWhileEditing(&self, should_indent_while_editing: bool);
583
584        #[unsafe(method(accessoryType))]
585        #[unsafe(method_family = none)]
586        pub fn accessoryType(&self) -> UITableViewCellAccessoryType;
587
588        /// Setter for [`accessoryType`][Self::accessoryType].
589        #[unsafe(method(setAccessoryType:))]
590        #[unsafe(method_family = none)]
591        pub fn setAccessoryType(&self, accessory_type: UITableViewCellAccessoryType);
592
593        #[unsafe(method(accessoryView))]
594        #[unsafe(method_family = none)]
595        pub fn accessoryView(&self) -> Option<Retained<UIView>>;
596
597        /// Setter for [`accessoryView`][Self::accessoryView].
598        #[unsafe(method(setAccessoryView:))]
599        #[unsafe(method_family = none)]
600        pub fn setAccessoryView(&self, accessory_view: Option<&UIView>);
601
602        #[unsafe(method(editingAccessoryType))]
603        #[unsafe(method_family = none)]
604        pub fn editingAccessoryType(&self) -> UITableViewCellAccessoryType;
605
606        /// Setter for [`editingAccessoryType`][Self::editingAccessoryType].
607        #[unsafe(method(setEditingAccessoryType:))]
608        #[unsafe(method_family = none)]
609        pub fn setEditingAccessoryType(&self, editing_accessory_type: UITableViewCellAccessoryType);
610
611        #[unsafe(method(editingAccessoryView))]
612        #[unsafe(method_family = none)]
613        pub fn editingAccessoryView(&self) -> Option<Retained<UIView>>;
614
615        /// Setter for [`editingAccessoryView`][Self::editingAccessoryView].
616        #[unsafe(method(setEditingAccessoryView:))]
617        #[unsafe(method_family = none)]
618        pub fn setEditingAccessoryView(&self, editing_accessory_view: Option<&UIView>);
619
620        #[unsafe(method(indentationLevel))]
621        #[unsafe(method_family = none)]
622        pub fn indentationLevel(&self) -> NSInteger;
623
624        /// Setter for [`indentationLevel`][Self::indentationLevel].
625        #[unsafe(method(setIndentationLevel:))]
626        #[unsafe(method_family = none)]
627        pub fn setIndentationLevel(&self, indentation_level: NSInteger);
628
629        #[cfg(feature = "objc2-core-foundation")]
630        #[unsafe(method(indentationWidth))]
631        #[unsafe(method_family = none)]
632        pub fn indentationWidth(&self) -> CGFloat;
633
634        #[cfg(feature = "objc2-core-foundation")]
635        /// Setter for [`indentationWidth`][Self::indentationWidth].
636        #[unsafe(method(setIndentationWidth:))]
637        #[unsafe(method_family = none)]
638        pub fn setIndentationWidth(&self, indentation_width: CGFloat);
639
640        #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
641        #[unsafe(method(separatorInset))]
642        #[unsafe(method_family = none)]
643        pub fn separatorInset(&self) -> UIEdgeInsets;
644
645        #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
646        /// Setter for [`separatorInset`][Self::separatorInset].
647        #[unsafe(method(setSeparatorInset:))]
648        #[unsafe(method_family = none)]
649        pub fn setSeparatorInset(&self, separator_inset: UIEdgeInsets);
650
651        #[unsafe(method(isEditing))]
652        #[unsafe(method_family = none)]
653        pub fn isEditing(&self) -> bool;
654
655        /// Setter for [`isEditing`][Self::isEditing].
656        #[unsafe(method(setEditing:))]
657        #[unsafe(method_family = none)]
658        pub fn setEditing(&self, editing: bool);
659
660        #[unsafe(method(setEditing:animated:))]
661        #[unsafe(method_family = none)]
662        pub fn setEditing_animated(&self, editing: bool, animated: bool);
663
664        #[unsafe(method(showingDeleteConfirmation))]
665        #[unsafe(method_family = none)]
666        pub fn showingDeleteConfirmation(&self) -> bool;
667
668        #[unsafe(method(focusStyle))]
669        #[unsafe(method_family = none)]
670        pub fn focusStyle(&self) -> UITableViewCellFocusStyle;
671
672        /// Setter for [`focusStyle`][Self::focusStyle].
673        #[unsafe(method(setFocusStyle:))]
674        #[unsafe(method_family = none)]
675        pub fn setFocusStyle(&self, focus_style: UITableViewCellFocusStyle);
676
677        #[unsafe(method(willTransitionToState:))]
678        #[unsafe(method_family = none)]
679        pub fn willTransitionToState(&self, state: UITableViewCellStateMask);
680
681        #[unsafe(method(didTransitionToState:))]
682        #[unsafe(method_family = none)]
683        pub fn didTransitionToState(&self, state: UITableViewCellStateMask);
684
685        #[unsafe(method(dragStateDidChange:))]
686        #[unsafe(method_family = none)]
687        pub fn dragStateDidChange(&self, drag_state: UITableViewCellDragState);
688
689        #[unsafe(method(userInteractionEnabledWhileDragging))]
690        #[unsafe(method_family = none)]
691        pub fn userInteractionEnabledWhileDragging(&self) -> bool;
692
693        /// Setter for [`userInteractionEnabledWhileDragging`][Self::userInteractionEnabledWhileDragging].
694        #[unsafe(method(setUserInteractionEnabledWhileDragging:))]
695        #[unsafe(method_family = none)]
696        pub fn setUserInteractionEnabledWhileDragging(
697            &self,
698            user_interaction_enabled_while_dragging: bool,
699        );
700    );
701}
702
703/// Methods declared on superclass `UIView`.
704#[cfg(all(feature = "UIResponder", feature = "UIView"))]
705impl UITableViewCell {
706    extern_methods!(
707        #[cfg(feature = "objc2-core-foundation")]
708        #[unsafe(method(initWithFrame:))]
709        #[unsafe(method_family = init)]
710        pub fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;
711
712        #[unsafe(method(init))]
713        #[unsafe(method_family = init)]
714        pub fn init(this: Allocated<Self>) -> Retained<Self>;
715    );
716}
717
718/// Methods declared on superclass `NSObject`.
719#[cfg(all(feature = "UIResponder", feature = "UIView"))]
720impl UITableViewCell {
721    extern_methods!(
722        #[unsafe(method(new))]
723        #[unsafe(method_family = new)]
724        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
725    );
726}
727
728/// UIDeprecated.
729#[cfg(all(feature = "UIResponder", feature = "UIView"))]
730impl UITableViewCell {
731    extern_methods!(
732        #[cfg(feature = "objc2-core-foundation")]
733        #[deprecated]
734        #[unsafe(method(initWithFrame:reuseIdentifier:))]
735        #[unsafe(method_family = init)]
736        pub fn initWithFrame_reuseIdentifier(
737            this: Allocated<Self>,
738            frame: CGRect,
739            reuse_identifier: Option<&NSString>,
740        ) -> Retained<Self>;
741
742        #[deprecated]
743        #[unsafe(method(text))]
744        #[unsafe(method_family = none)]
745        pub fn text(&self) -> Option<Retained<NSString>>;
746
747        /// Setter for [`text`][Self::text].
748        ///
749        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
750        #[deprecated]
751        #[unsafe(method(setText:))]
752        #[unsafe(method_family = none)]
753        pub fn setText(&self, text: Option<&NSString>);
754
755        #[cfg(feature = "UIFont")]
756        #[deprecated]
757        #[unsafe(method(font))]
758        #[unsafe(method_family = none)]
759        pub fn font(&self) -> Option<Retained<UIFont>>;
760
761        #[cfg(feature = "UIFont")]
762        /// Setter for [`font`][Self::font].
763        #[deprecated]
764        #[unsafe(method(setFont:))]
765        #[unsafe(method_family = none)]
766        pub fn setFont(&self, font: Option<&UIFont>);
767
768        #[cfg(feature = "NSText")]
769        #[deprecated]
770        #[unsafe(method(textAlignment))]
771        #[unsafe(method_family = none)]
772        pub fn textAlignment(&self) -> NSTextAlignment;
773
774        #[cfg(feature = "NSText")]
775        /// Setter for [`textAlignment`][Self::textAlignment].
776        #[deprecated]
777        #[unsafe(method(setTextAlignment:))]
778        #[unsafe(method_family = none)]
779        pub fn setTextAlignment(&self, text_alignment: NSTextAlignment);
780
781        #[cfg(feature = "NSParagraphStyle")]
782        #[deprecated]
783        #[unsafe(method(lineBreakMode))]
784        #[unsafe(method_family = none)]
785        pub fn lineBreakMode(&self) -> NSLineBreakMode;
786
787        #[cfg(feature = "NSParagraphStyle")]
788        /// Setter for [`lineBreakMode`][Self::lineBreakMode].
789        #[deprecated]
790        #[unsafe(method(setLineBreakMode:))]
791        #[unsafe(method_family = none)]
792        pub fn setLineBreakMode(&self, line_break_mode: NSLineBreakMode);
793
794        #[cfg(feature = "UIColor")]
795        #[deprecated]
796        #[unsafe(method(textColor))]
797        #[unsafe(method_family = none)]
798        pub fn textColor(&self) -> Option<Retained<UIColor>>;
799
800        #[cfg(feature = "UIColor")]
801        /// Setter for [`textColor`][Self::textColor].
802        #[deprecated]
803        #[unsafe(method(setTextColor:))]
804        #[unsafe(method_family = none)]
805        pub fn setTextColor(&self, text_color: Option<&UIColor>);
806
807        #[cfg(feature = "UIColor")]
808        #[deprecated]
809        #[unsafe(method(selectedTextColor))]
810        #[unsafe(method_family = none)]
811        pub fn selectedTextColor(&self) -> Option<Retained<UIColor>>;
812
813        #[cfg(feature = "UIColor")]
814        /// Setter for [`selectedTextColor`][Self::selectedTextColor].
815        #[deprecated]
816        #[unsafe(method(setSelectedTextColor:))]
817        #[unsafe(method_family = none)]
818        pub fn setSelectedTextColor(&self, selected_text_color: Option<&UIColor>);
819
820        #[cfg(feature = "UIImage")]
821        #[deprecated]
822        #[unsafe(method(image))]
823        #[unsafe(method_family = none)]
824        pub fn image(&self) -> Option<Retained<UIImage>>;
825
826        #[cfg(feature = "UIImage")]
827        /// Setter for [`image`][Self::image].
828        #[deprecated]
829        #[unsafe(method(setImage:))]
830        #[unsafe(method_family = none)]
831        pub fn setImage(&self, image: Option<&UIImage>);
832
833        #[cfg(feature = "UIImage")]
834        #[deprecated]
835        #[unsafe(method(selectedImage))]
836        #[unsafe(method_family = none)]
837        pub fn selectedImage(&self) -> Option<Retained<UIImage>>;
838
839        #[cfg(feature = "UIImage")]
840        /// Setter for [`selectedImage`][Self::selectedImage].
841        #[deprecated]
842        #[unsafe(method(setSelectedImage:))]
843        #[unsafe(method_family = none)]
844        pub fn setSelectedImage(&self, selected_image: Option<&UIImage>);
845
846        #[deprecated]
847        #[unsafe(method(hidesAccessoryWhenEditing))]
848        #[unsafe(method_family = none)]
849        pub fn hidesAccessoryWhenEditing(&self) -> bool;
850
851        /// Setter for [`hidesAccessoryWhenEditing`][Self::hidesAccessoryWhenEditing].
852        #[deprecated]
853        #[unsafe(method(setHidesAccessoryWhenEditing:))]
854        #[unsafe(method_family = none)]
855        pub fn setHidesAccessoryWhenEditing(&self, hides_accessory_when_editing: bool);
856
857        /// # Safety
858        ///
859        /// This is not retained internally, you must ensure the object is still alive.
860        #[deprecated]
861        #[unsafe(method(target))]
862        #[unsafe(method_family = none)]
863        pub unsafe fn target(&self) -> Option<Retained<AnyObject>>;
864
865        /// Setter for [`target`][Self::target].
866        ///
867        /// # Safety
868        ///
869        /// - `target` should be of the correct type.
870        /// - This is unretained, you must ensure the object is kept alive while in use.
871        #[deprecated]
872        #[unsafe(method(setTarget:))]
873        #[unsafe(method_family = none)]
874        pub unsafe fn setTarget(&self, target: Option<&AnyObject>);
875
876        #[deprecated]
877        #[unsafe(method(editAction))]
878        #[unsafe(method_family = none)]
879        pub fn editAction(&self) -> Option<Sel>;
880
881        /// Setter for [`editAction`][Self::editAction].
882        ///
883        /// # Safety
884        ///
885        /// `edit_action` must be a valid selector.
886        #[deprecated]
887        #[unsafe(method(setEditAction:))]
888        #[unsafe(method_family = none)]
889        pub unsafe fn setEditAction(&self, edit_action: Option<Sel>);
890
891        #[deprecated]
892        #[unsafe(method(accessoryAction))]
893        #[unsafe(method_family = none)]
894        pub fn accessoryAction(&self) -> Option<Sel>;
895
896        /// Setter for [`accessoryAction`][Self::accessoryAction].
897        ///
898        /// # Safety
899        ///
900        /// `accessory_action` must be a valid selector.
901        #[deprecated]
902        #[unsafe(method(setAccessoryAction:))]
903        #[unsafe(method_family = none)]
904        pub unsafe fn setAccessoryAction(&self, accessory_action: Option<Sel>);
905    );
906}