1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12#[repr(transparent)]
15#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
16pub struct UICellAccessoryDisplayedState(pub NSInteger);
17impl UICellAccessoryDisplayedState {
18 #[doc(alias = "UICellAccessoryDisplayedAlways")]
20 pub const Always: Self = Self(0);
21 #[doc(alias = "UICellAccessoryDisplayedWhenEditing")]
23 pub const WhenEditing: Self = Self(1);
24 #[doc(alias = "UICellAccessoryDisplayedWhenNotEditing")]
26 pub const WhenNotEditing: Self = Self(2);
27}
28
29unsafe impl Encode for UICellAccessoryDisplayedState {
30 const ENCODING: Encoding = NSInteger::ENCODING;
31}
32
33unsafe impl RefEncode for UICellAccessoryDisplayedState {
34 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
35}
36
37extern "C" {
38 #[cfg(feature = "objc2-core-foundation")]
43 pub static UICellAccessoryStandardDimension: CGFloat;
44}
45
46extern_class!(
47 #[unsafe(super(NSObject))]
51 #[thread_kind = MainThreadOnly]
52 #[derive(Debug, PartialEq, Eq, Hash)]
53 pub struct UICellAccessory;
54);
55
56extern_conformance!(
57 unsafe impl NSCoding for UICellAccessory {}
58);
59
60extern_conformance!(
61 unsafe impl NSCopying for UICellAccessory {}
62);
63
64unsafe impl CopyingHelper for UICellAccessory {
65 type Result = Self;
66}
67
68extern_conformance!(
69 unsafe impl NSObjectProtocol for UICellAccessory {}
70);
71
72extern_conformance!(
73 unsafe impl NSSecureCoding for UICellAccessory {}
74);
75
76impl UICellAccessory {
77 extern_methods!(
78 #[unsafe(method(displayedState))]
80 #[unsafe(method_family = none)]
81 pub fn displayedState(&self) -> UICellAccessoryDisplayedState;
82
83 #[unsafe(method(setDisplayedState:))]
85 #[unsafe(method_family = none)]
86 pub fn setDisplayedState(&self, displayed_state: UICellAccessoryDisplayedState);
87
88 #[unsafe(method(isHidden))]
91 #[unsafe(method_family = none)]
92 pub fn isHidden(&self) -> bool;
93
94 #[unsafe(method(setHidden:))]
96 #[unsafe(method_family = none)]
97 pub fn setHidden(&self, hidden: bool);
98
99 #[cfg(feature = "objc2-core-foundation")]
100 #[unsafe(method(reservedLayoutWidth))]
105 #[unsafe(method_family = none)]
106 pub fn reservedLayoutWidth(&self) -> CGFloat;
107
108 #[cfg(feature = "objc2-core-foundation")]
109 #[unsafe(method(setReservedLayoutWidth:))]
111 #[unsafe(method_family = none)]
112 pub fn setReservedLayoutWidth(&self, reserved_layout_width: CGFloat);
113
114 #[cfg(feature = "UIColor")]
115 #[unsafe(method(tintColor))]
117 #[unsafe(method_family = none)]
118 pub fn tintColor(&self) -> Option<Retained<UIColor>>;
119
120 #[cfg(feature = "UIColor")]
121 #[unsafe(method(setTintColor:))]
123 #[unsafe(method_family = none)]
124 pub fn setTintColor(&self, tint_color: Option<&UIColor>);
125
126 #[unsafe(method(initWithCoder:))]
130 #[unsafe(method_family = init)]
131 pub unsafe fn initWithCoder(
132 this: Allocated<Self>,
133 coder: &NSCoder,
134 ) -> Option<Retained<Self>>;
135
136 #[unsafe(method(init))]
137 #[unsafe(method_family = init)]
138 pub fn init(this: Allocated<Self>) -> Retained<Self>;
139 );
140}
141
142impl UICellAccessory {
144 extern_methods!(
145 #[unsafe(method(new))]
146 #[unsafe(method_family = new)]
147 pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
148 );
149}
150
151extern_class!(
152 #[unsafe(super(UICellAccessory, NSObject))]
156 #[thread_kind = MainThreadOnly]
157 #[derive(Debug, PartialEq, Eq, Hash)]
158 pub struct UICellAccessoryDisclosureIndicator;
159);
160
161extern_conformance!(
162 unsafe impl NSCoding for UICellAccessoryDisclosureIndicator {}
163);
164
165extern_conformance!(
166 unsafe impl NSCopying for UICellAccessoryDisclosureIndicator {}
167);
168
169unsafe impl CopyingHelper for UICellAccessoryDisclosureIndicator {
170 type Result = Self;
171}
172
173extern_conformance!(
174 unsafe impl NSObjectProtocol for UICellAccessoryDisclosureIndicator {}
175);
176
177extern_conformance!(
178 unsafe impl NSSecureCoding for UICellAccessoryDisclosureIndicator {}
179);
180
181impl UICellAccessoryDisclosureIndicator {
182 extern_methods!();
183}
184
185impl UICellAccessoryDisclosureIndicator {
187 extern_methods!(
188 #[unsafe(method(initWithCoder:))]
192 #[unsafe(method_family = init)]
193 pub unsafe fn initWithCoder(
194 this: Allocated<Self>,
195 coder: &NSCoder,
196 ) -> Option<Retained<Self>>;
197
198 #[unsafe(method(init))]
199 #[unsafe(method_family = init)]
200 pub fn init(this: Allocated<Self>) -> Retained<Self>;
201 );
202}
203
204impl UICellAccessoryDisclosureIndicator {
206 extern_methods!(
207 #[unsafe(method(new))]
208 #[unsafe(method_family = new)]
209 pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
210 );
211}
212
213extern_class!(
214 #[unsafe(super(UICellAccessory, NSObject))]
218 #[thread_kind = MainThreadOnly]
219 #[derive(Debug, PartialEq, Eq, Hash)]
220 pub struct UICellAccessoryDetail;
221);
222
223extern_conformance!(
224 unsafe impl NSCoding for UICellAccessoryDetail {}
225);
226
227extern_conformance!(
228 unsafe impl NSCopying for UICellAccessoryDetail {}
229);
230
231unsafe impl CopyingHelper for UICellAccessoryDetail {
232 type Result = Self;
233}
234
235extern_conformance!(
236 unsafe impl NSObjectProtocol for UICellAccessoryDetail {}
237);
238
239extern_conformance!(
240 unsafe impl NSSecureCoding for UICellAccessoryDetail {}
241);
242
243impl UICellAccessoryDetail {
244 extern_methods!(
245 #[cfg(feature = "block2")]
246 #[unsafe(method(actionHandler))]
248 #[unsafe(method_family = none)]
249 pub fn actionHandler(&self) -> *mut block2::DynBlock<dyn Fn()>;
250
251 #[cfg(feature = "block2")]
252 #[unsafe(method(setActionHandler:))]
256 #[unsafe(method_family = none)]
257 pub fn setActionHandler(&self, action_handler: Option<&block2::DynBlock<dyn Fn()>>);
258 );
259}
260
261impl UICellAccessoryDetail {
263 extern_methods!(
264 #[unsafe(method(initWithCoder:))]
268 #[unsafe(method_family = init)]
269 pub unsafe fn initWithCoder(
270 this: Allocated<Self>,
271 coder: &NSCoder,
272 ) -> Option<Retained<Self>>;
273
274 #[unsafe(method(init))]
275 #[unsafe(method_family = init)]
276 pub fn init(this: Allocated<Self>) -> Retained<Self>;
277 );
278}
279
280impl UICellAccessoryDetail {
282 extern_methods!(
283 #[unsafe(method(new))]
284 #[unsafe(method_family = new)]
285 pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
286 );
287}
288
289extern_class!(
290 #[unsafe(super(UICellAccessory, NSObject))]
294 #[thread_kind = MainThreadOnly]
295 #[derive(Debug, PartialEq, Eq, Hash)]
296 pub struct UICellAccessoryCheckmark;
297);
298
299extern_conformance!(
300 unsafe impl NSCoding for UICellAccessoryCheckmark {}
301);
302
303extern_conformance!(
304 unsafe impl NSCopying for UICellAccessoryCheckmark {}
305);
306
307unsafe impl CopyingHelper for UICellAccessoryCheckmark {
308 type Result = Self;
309}
310
311extern_conformance!(
312 unsafe impl NSObjectProtocol for UICellAccessoryCheckmark {}
313);
314
315extern_conformance!(
316 unsafe impl NSSecureCoding for UICellAccessoryCheckmark {}
317);
318
319impl UICellAccessoryCheckmark {
320 extern_methods!();
321}
322
323impl UICellAccessoryCheckmark {
325 extern_methods!(
326 #[unsafe(method(initWithCoder:))]
330 #[unsafe(method_family = init)]
331 pub unsafe fn initWithCoder(
332 this: Allocated<Self>,
333 coder: &NSCoder,
334 ) -> Option<Retained<Self>>;
335
336 #[unsafe(method(init))]
337 #[unsafe(method_family = init)]
338 pub fn init(this: Allocated<Self>) -> Retained<Self>;
339 );
340}
341
342impl UICellAccessoryCheckmark {
344 extern_methods!(
345 #[unsafe(method(new))]
346 #[unsafe(method_family = new)]
347 pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
348 );
349}
350
351extern_class!(
352 #[unsafe(super(UICellAccessory, NSObject))]
356 #[thread_kind = MainThreadOnly]
357 #[derive(Debug, PartialEq, Eq, Hash)]
358 pub struct UICellAccessoryDelete;
359);
360
361extern_conformance!(
362 unsafe impl NSCoding for UICellAccessoryDelete {}
363);
364
365extern_conformance!(
366 unsafe impl NSCopying for UICellAccessoryDelete {}
367);
368
369unsafe impl CopyingHelper for UICellAccessoryDelete {
370 type Result = Self;
371}
372
373extern_conformance!(
374 unsafe impl NSObjectProtocol for UICellAccessoryDelete {}
375);
376
377extern_conformance!(
378 unsafe impl NSSecureCoding for UICellAccessoryDelete {}
379);
380
381impl UICellAccessoryDelete {
382 extern_methods!(
383 #[cfg(feature = "UIColor")]
384 #[unsafe(method(backgroundColor))]
386 #[unsafe(method_family = none)]
387 pub fn backgroundColor(&self) -> Option<Retained<UIColor>>;
388
389 #[cfg(feature = "UIColor")]
390 #[unsafe(method(setBackgroundColor:))]
392 #[unsafe(method_family = none)]
393 pub fn setBackgroundColor(&self, background_color: Option<&UIColor>);
394
395 #[cfg(feature = "block2")]
396 #[unsafe(method(actionHandler))]
398 #[unsafe(method_family = none)]
399 pub fn actionHandler(&self) -> *mut block2::DynBlock<dyn Fn()>;
400
401 #[cfg(feature = "block2")]
402 #[unsafe(method(setActionHandler:))]
406 #[unsafe(method_family = none)]
407 pub fn setActionHandler(&self, action_handler: Option<&block2::DynBlock<dyn Fn()>>);
408 );
409}
410
411impl UICellAccessoryDelete {
413 extern_methods!(
414 #[unsafe(method(initWithCoder:))]
418 #[unsafe(method_family = init)]
419 pub unsafe fn initWithCoder(
420 this: Allocated<Self>,
421 coder: &NSCoder,
422 ) -> Option<Retained<Self>>;
423
424 #[unsafe(method(init))]
425 #[unsafe(method_family = init)]
426 pub fn init(this: Allocated<Self>) -> Retained<Self>;
427 );
428}
429
430impl UICellAccessoryDelete {
432 extern_methods!(
433 #[unsafe(method(new))]
434 #[unsafe(method_family = new)]
435 pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
436 );
437}
438
439extern_class!(
440 #[unsafe(super(UICellAccessory, NSObject))]
444 #[thread_kind = MainThreadOnly]
445 #[derive(Debug, PartialEq, Eq, Hash)]
446 pub struct UICellAccessoryInsert;
447);
448
449extern_conformance!(
450 unsafe impl NSCoding for UICellAccessoryInsert {}
451);
452
453extern_conformance!(
454 unsafe impl NSCopying for UICellAccessoryInsert {}
455);
456
457unsafe impl CopyingHelper for UICellAccessoryInsert {
458 type Result = Self;
459}
460
461extern_conformance!(
462 unsafe impl NSObjectProtocol for UICellAccessoryInsert {}
463);
464
465extern_conformance!(
466 unsafe impl NSSecureCoding for UICellAccessoryInsert {}
467);
468
469impl UICellAccessoryInsert {
470 extern_methods!(
471 #[cfg(feature = "UIColor")]
472 #[unsafe(method(backgroundColor))]
474 #[unsafe(method_family = none)]
475 pub fn backgroundColor(&self) -> Option<Retained<UIColor>>;
476
477 #[cfg(feature = "UIColor")]
478 #[unsafe(method(setBackgroundColor:))]
480 #[unsafe(method_family = none)]
481 pub fn setBackgroundColor(&self, background_color: Option<&UIColor>);
482
483 #[cfg(feature = "block2")]
484 #[unsafe(method(actionHandler))]
486 #[unsafe(method_family = none)]
487 pub fn actionHandler(&self) -> *mut block2::DynBlock<dyn Fn()>;
488
489 #[cfg(feature = "block2")]
490 #[unsafe(method(setActionHandler:))]
494 #[unsafe(method_family = none)]
495 pub fn setActionHandler(&self, action_handler: Option<&block2::DynBlock<dyn Fn()>>);
496 );
497}
498
499impl UICellAccessoryInsert {
501 extern_methods!(
502 #[unsafe(method(initWithCoder:))]
506 #[unsafe(method_family = init)]
507 pub unsafe fn initWithCoder(
508 this: Allocated<Self>,
509 coder: &NSCoder,
510 ) -> Option<Retained<Self>>;
511
512 #[unsafe(method(init))]
513 #[unsafe(method_family = init)]
514 pub fn init(this: Allocated<Self>) -> Retained<Self>;
515 );
516}
517
518impl UICellAccessoryInsert {
520 extern_methods!(
521 #[unsafe(method(new))]
522 #[unsafe(method_family = new)]
523 pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
524 );
525}
526
527extern_class!(
528 #[unsafe(super(UICellAccessory, NSObject))]
533 #[thread_kind = MainThreadOnly]
534 #[derive(Debug, PartialEq, Eq, Hash)]
535 pub struct UICellAccessoryReorder;
536);
537
538extern_conformance!(
539 unsafe impl NSCoding for UICellAccessoryReorder {}
540);
541
542extern_conformance!(
543 unsafe impl NSCopying for UICellAccessoryReorder {}
544);
545
546unsafe impl CopyingHelper for UICellAccessoryReorder {
547 type Result = Self;
548}
549
550extern_conformance!(
551 unsafe impl NSObjectProtocol for UICellAccessoryReorder {}
552);
553
554extern_conformance!(
555 unsafe impl NSSecureCoding for UICellAccessoryReorder {}
556);
557
558impl UICellAccessoryReorder {
559 extern_methods!(
560 #[unsafe(method(showsVerticalSeparator))]
562 #[unsafe(method_family = none)]
563 pub fn showsVerticalSeparator(&self) -> bool;
564
565 #[unsafe(method(setShowsVerticalSeparator:))]
567 #[unsafe(method_family = none)]
568 pub fn setShowsVerticalSeparator(&self, shows_vertical_separator: bool);
569 );
570}
571
572impl UICellAccessoryReorder {
574 extern_methods!(
575 #[unsafe(method(initWithCoder:))]
579 #[unsafe(method_family = init)]
580 pub unsafe fn initWithCoder(
581 this: Allocated<Self>,
582 coder: &NSCoder,
583 ) -> Option<Retained<Self>>;
584
585 #[unsafe(method(init))]
586 #[unsafe(method_family = init)]
587 pub fn init(this: Allocated<Self>) -> Retained<Self>;
588 );
589}
590
591impl UICellAccessoryReorder {
593 extern_methods!(
594 #[unsafe(method(new))]
595 #[unsafe(method_family = new)]
596 pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
597 );
598}
599
600extern_class!(
601 #[unsafe(super(UICellAccessory, NSObject))]
606 #[thread_kind = MainThreadOnly]
607 #[derive(Debug, PartialEq, Eq, Hash)]
608 pub struct UICellAccessoryMultiselect;
609);
610
611extern_conformance!(
612 unsafe impl NSCoding for UICellAccessoryMultiselect {}
613);
614
615extern_conformance!(
616 unsafe impl NSCopying for UICellAccessoryMultiselect {}
617);
618
619unsafe impl CopyingHelper for UICellAccessoryMultiselect {
620 type Result = Self;
621}
622
623extern_conformance!(
624 unsafe impl NSObjectProtocol for UICellAccessoryMultiselect {}
625);
626
627extern_conformance!(
628 unsafe impl NSSecureCoding for UICellAccessoryMultiselect {}
629);
630
631impl UICellAccessoryMultiselect {
632 extern_methods!(
633 #[cfg(feature = "UIColor")]
634 #[unsafe(method(backgroundColor))]
636 #[unsafe(method_family = none)]
637 pub fn backgroundColor(&self) -> Option<Retained<UIColor>>;
638
639 #[cfg(feature = "UIColor")]
640 #[unsafe(method(setBackgroundColor:))]
642 #[unsafe(method_family = none)]
643 pub fn setBackgroundColor(&self, background_color: Option<&UIColor>);
644 );
645}
646
647impl UICellAccessoryMultiselect {
649 extern_methods!(
650 #[unsafe(method(initWithCoder:))]
654 #[unsafe(method_family = init)]
655 pub unsafe fn initWithCoder(
656 this: Allocated<Self>,
657 coder: &NSCoder,
658 ) -> Option<Retained<Self>>;
659
660 #[unsafe(method(init))]
661 #[unsafe(method_family = init)]
662 pub fn init(this: Allocated<Self>) -> Retained<Self>;
663 );
664}
665
666impl UICellAccessoryMultiselect {
668 extern_methods!(
669 #[unsafe(method(new))]
670 #[unsafe(method_family = new)]
671 pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
672 );
673}
674
675#[repr(transparent)]
678#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
679pub struct UICellAccessoryOutlineDisclosureStyle(pub NSInteger);
680impl UICellAccessoryOutlineDisclosureStyle {
681 #[doc(alias = "UICellAccessoryOutlineDisclosureStyleAutomatic")]
683 pub const Automatic: Self = Self(0);
684 #[doc(alias = "UICellAccessoryOutlineDisclosureStyleHeader")]
687 pub const Header: Self = Self(1);
688 #[doc(alias = "UICellAccessoryOutlineDisclosureStyleCell")]
691 pub const Cell: Self = Self(2);
692}
693
694unsafe impl Encode for UICellAccessoryOutlineDisclosureStyle {
695 const ENCODING: Encoding = NSInteger::ENCODING;
696}
697
698unsafe impl RefEncode for UICellAccessoryOutlineDisclosureStyle {
699 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
700}
701
702extern_class!(
703 #[unsafe(super(UICellAccessory, NSObject))]
707 #[thread_kind = MainThreadOnly]
708 #[derive(Debug, PartialEq, Eq, Hash)]
709 pub struct UICellAccessoryOutlineDisclosure;
710);
711
712extern_conformance!(
713 unsafe impl NSCoding for UICellAccessoryOutlineDisclosure {}
714);
715
716extern_conformance!(
717 unsafe impl NSCopying for UICellAccessoryOutlineDisclosure {}
718);
719
720unsafe impl CopyingHelper for UICellAccessoryOutlineDisclosure {
721 type Result = Self;
722}
723
724extern_conformance!(
725 unsafe impl NSObjectProtocol for UICellAccessoryOutlineDisclosure {}
726);
727
728extern_conformance!(
729 unsafe impl NSSecureCoding for UICellAccessoryOutlineDisclosure {}
730);
731
732impl UICellAccessoryOutlineDisclosure {
733 extern_methods!(
734 #[unsafe(method(style))]
736 #[unsafe(method_family = none)]
737 pub fn style(&self) -> UICellAccessoryOutlineDisclosureStyle;
738
739 #[unsafe(method(setStyle:))]
741 #[unsafe(method_family = none)]
742 pub fn setStyle(&self, style: UICellAccessoryOutlineDisclosureStyle);
743
744 #[cfg(feature = "block2")]
745 #[unsafe(method(actionHandler))]
748 #[unsafe(method_family = none)]
749 pub fn actionHandler(&self) -> *mut block2::DynBlock<dyn Fn()>;
750
751 #[cfg(feature = "block2")]
752 #[unsafe(method(setActionHandler:))]
756 #[unsafe(method_family = none)]
757 pub fn setActionHandler(&self, action_handler: Option<&block2::DynBlock<dyn Fn()>>);
758 );
759}
760
761impl UICellAccessoryOutlineDisclosure {
763 extern_methods!(
764 #[unsafe(method(initWithCoder:))]
768 #[unsafe(method_family = init)]
769 pub unsafe fn initWithCoder(
770 this: Allocated<Self>,
771 coder: &NSCoder,
772 ) -> Option<Retained<Self>>;
773
774 #[unsafe(method(init))]
775 #[unsafe(method_family = init)]
776 pub fn init(this: Allocated<Self>) -> Retained<Self>;
777 );
778}
779
780impl UICellAccessoryOutlineDisclosure {
782 extern_methods!(
783 #[unsafe(method(new))]
784 #[unsafe(method_family = new)]
785 pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
786 );
787}
788
789extern_class!(
790 #[unsafe(super(UICellAccessory, NSObject))]
794 #[thread_kind = MainThreadOnly]
795 #[derive(Debug, PartialEq, Eq, Hash)]
796 pub struct UICellAccessoryPopUpMenu;
797);
798
799extern_conformance!(
800 unsafe impl NSCoding for UICellAccessoryPopUpMenu {}
801);
802
803extern_conformance!(
804 unsafe impl NSCopying for UICellAccessoryPopUpMenu {}
805);
806
807unsafe impl CopyingHelper for UICellAccessoryPopUpMenu {
808 type Result = Self;
809}
810
811extern_conformance!(
812 unsafe impl NSObjectProtocol for UICellAccessoryPopUpMenu {}
813);
814
815extern_conformance!(
816 unsafe impl NSSecureCoding for UICellAccessoryPopUpMenu {}
817);
818
819impl UICellAccessoryPopUpMenu {
820 extern_methods!(
821 #[cfg(all(feature = "UIMenu", feature = "UIMenuElement"))]
822 #[unsafe(method(initWithMenu:))]
824 #[unsafe(method_family = init)]
825 pub fn initWithMenu(this: Allocated<Self>, menu: &UIMenu) -> Retained<Self>;
826
827 #[cfg(all(feature = "UIMenu", feature = "UIMenuElement"))]
828 #[unsafe(method(menu))]
829 #[unsafe(method_family = none)]
830 pub fn menu(&self) -> Retained<UIMenu>;
831
832 #[cfg(all(feature = "UIMenu", feature = "UIMenuElement", feature = "block2"))]
833 #[unsafe(method(selectedElementDidChangeHandler))]
839 #[unsafe(method_family = none)]
840 pub unsafe fn selectedElementDidChangeHandler(
841 &self,
842 ) -> *mut block2::DynBlock<dyn Fn(NonNull<UIMenu>)>;
843
844 #[cfg(all(feature = "UIMenu", feature = "UIMenuElement", feature = "block2"))]
845 #[unsafe(method(setSelectedElementDidChangeHandler:))]
849 #[unsafe(method_family = none)]
850 pub fn setSelectedElementDidChangeHandler(
851 &self,
852 selected_element_did_change_handler: Option<&block2::DynBlock<dyn Fn(NonNull<UIMenu>)>>,
853 );
854
855 #[unsafe(method(initWithCoder:))]
859 #[unsafe(method_family = init)]
860 pub unsafe fn initWithCoder(
861 this: Allocated<Self>,
862 coder: &NSCoder,
863 ) -> Option<Retained<Self>>;
864
865 #[unsafe(method(init))]
866 #[unsafe(method_family = init)]
867 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
868
869 #[unsafe(method(new))]
870 #[unsafe(method_family = new)]
871 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
872 );
873}
874
875extern_class!(
876 #[unsafe(super(UICellAccessory, NSObject))]
880 #[thread_kind = MainThreadOnly]
881 #[derive(Debug, PartialEq, Eq, Hash)]
882 pub struct UICellAccessoryLabel;
883);
884
885extern_conformance!(
886 unsafe impl NSCoding for UICellAccessoryLabel {}
887);
888
889extern_conformance!(
890 unsafe impl NSCopying for UICellAccessoryLabel {}
891);
892
893unsafe impl CopyingHelper for UICellAccessoryLabel {
894 type Result = Self;
895}
896
897extern_conformance!(
898 unsafe impl NSObjectProtocol for UICellAccessoryLabel {}
899);
900
901extern_conformance!(
902 unsafe impl NSSecureCoding for UICellAccessoryLabel {}
903);
904
905impl UICellAccessoryLabel {
906 extern_methods!(
907 #[unsafe(method(initWithText:))]
909 #[unsafe(method_family = init)]
910 pub fn initWithText(this: Allocated<Self>, text: &NSString) -> Retained<Self>;
911
912 #[unsafe(method(text))]
913 #[unsafe(method_family = none)]
914 pub fn text(&self) -> Retained<NSString>;
915
916 #[cfg(feature = "UIFont")]
917 #[unsafe(method(font))]
919 #[unsafe(method_family = none)]
920 pub fn font(&self) -> Retained<UIFont>;
921
922 #[cfg(feature = "UIFont")]
923 #[unsafe(method(setFont:))]
925 #[unsafe(method_family = none)]
926 pub fn setFont(&self, font: &UIFont);
927
928 #[unsafe(method(adjustsFontForContentSizeCategory))]
930 #[unsafe(method_family = none)]
931 pub fn adjustsFontForContentSizeCategory(&self) -> bool;
932
933 #[unsafe(method(setAdjustsFontForContentSizeCategory:))]
935 #[unsafe(method_family = none)]
936 pub fn setAdjustsFontForContentSizeCategory(
937 &self,
938 adjusts_font_for_content_size_category: bool,
939 );
940
941 #[unsafe(method(initWithCoder:))]
945 #[unsafe(method_family = init)]
946 pub unsafe fn initWithCoder(
947 this: Allocated<Self>,
948 coder: &NSCoder,
949 ) -> Option<Retained<Self>>;
950
951 #[unsafe(method(init))]
952 #[unsafe(method_family = init)]
953 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
954
955 #[unsafe(method(new))]
956 #[unsafe(method_family = new)]
957 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
958 );
959}
960
961#[repr(transparent)]
964#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
965pub struct UICellAccessoryPlacement(pub NSInteger);
966impl UICellAccessoryPlacement {
967 #[doc(alias = "UICellAccessoryPlacementLeading")]
969 pub const Leading: Self = Self(0);
970 #[doc(alias = "UICellAccessoryPlacementTrailing")]
972 pub const Trailing: Self = Self(1);
973}
974
975unsafe impl Encode for UICellAccessoryPlacement {
976 const ENCODING: Encoding = NSInteger::ENCODING;
977}
978
979unsafe impl RefEncode for UICellAccessoryPlacement {
980 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
981}
982
983#[cfg(feature = "block2")]
987pub type UICellAccessoryPosition =
988 *mut block2::DynBlock<dyn Fn(NonNull<NSArray<UICellAccessory>>) -> NSUInteger>;
989
990impl UICellAccessory {
991 #[doc(alias = "UICellAccessoryPositionBeforeAccessoryOfClass")]
998 #[cfg(feature = "block2")]
999 #[inline]
1000 pub unsafe fn position_before_accessory_of_class(
1001 accessory_class: &AnyClass,
1002 ) -> UICellAccessoryPosition {
1003 extern "C-unwind" {
1004 fn UICellAccessoryPositionBeforeAccessoryOfClass(
1005 accessory_class: &AnyClass,
1006 ) -> UICellAccessoryPosition;
1007 }
1008 unsafe { UICellAccessoryPositionBeforeAccessoryOfClass(accessory_class) }
1009 }
1010
1011 #[doc(alias = "UICellAccessoryPositionAfterAccessoryOfClass")]
1018 #[cfg(feature = "block2")]
1019 #[inline]
1020 pub unsafe fn position_after_accessory_of_class(
1021 accessory_class: &AnyClass,
1022 ) -> UICellAccessoryPosition {
1023 extern "C-unwind" {
1024 fn UICellAccessoryPositionAfterAccessoryOfClass(
1025 accessory_class: &AnyClass,
1026 ) -> UICellAccessoryPosition;
1027 }
1028 unsafe { UICellAccessoryPositionAfterAccessoryOfClass(accessory_class) }
1029 }
1030}
1031
1032extern_class!(
1033 #[unsafe(super(UICellAccessory, NSObject))]
1037 #[thread_kind = MainThreadOnly]
1038 #[derive(Debug, PartialEq, Eq, Hash)]
1039 pub struct UICellAccessoryCustomView;
1040);
1041
1042extern_conformance!(
1043 unsafe impl NSCoding for UICellAccessoryCustomView {}
1044);
1045
1046extern_conformance!(
1047 unsafe impl NSCopying for UICellAccessoryCustomView {}
1048);
1049
1050unsafe impl CopyingHelper for UICellAccessoryCustomView {
1051 type Result = Self;
1052}
1053
1054extern_conformance!(
1055 unsafe impl NSObjectProtocol for UICellAccessoryCustomView {}
1056);
1057
1058extern_conformance!(
1059 unsafe impl NSSecureCoding for UICellAccessoryCustomView {}
1060);
1061
1062impl UICellAccessoryCustomView {
1063 extern_methods!(
1064 #[cfg(all(feature = "UIResponder", feature = "UIView"))]
1065 #[unsafe(method(initWithCustomView:placement:))]
1068 #[unsafe(method_family = init)]
1069 pub fn initWithCustomView_placement(
1070 this: Allocated<Self>,
1071 custom_view: &UIView,
1072 placement: UICellAccessoryPlacement,
1073 ) -> Retained<Self>;
1074
1075 #[cfg(all(feature = "UIResponder", feature = "UIView"))]
1076 #[unsafe(method(customView))]
1077 #[unsafe(method_family = none)]
1078 pub fn customView(&self) -> Retained<UIView>;
1079
1080 #[unsafe(method(placement))]
1081 #[unsafe(method_family = none)]
1082 pub fn placement(&self) -> UICellAccessoryPlacement;
1083
1084 #[unsafe(method(maintainsFixedSize))]
1086 #[unsafe(method_family = none)]
1087 pub fn maintainsFixedSize(&self) -> bool;
1088
1089 #[unsafe(method(setMaintainsFixedSize:))]
1091 #[unsafe(method_family = none)]
1092 pub fn setMaintainsFixedSize(&self, maintains_fixed_size: bool);
1093
1094 #[cfg(feature = "block2")]
1095 #[unsafe(method(position))]
1102 #[unsafe(method_family = none)]
1103 pub unsafe fn position(&self) -> UICellAccessoryPosition;
1104
1105 #[cfg(feature = "block2")]
1106 #[unsafe(method(setPosition:))]
1114 #[unsafe(method_family = none)]
1115 pub unsafe fn setPosition(&self, position: UICellAccessoryPosition);
1116
1117 #[unsafe(method(initWithCoder:))]
1121 #[unsafe(method_family = init)]
1122 pub unsafe fn initWithCoder(
1123 this: Allocated<Self>,
1124 coder: &NSCoder,
1125 ) -> Option<Retained<Self>>;
1126
1127 #[unsafe(method(init))]
1128 #[unsafe(method_family = init)]
1129 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1130
1131 #[unsafe(method(new))]
1132 #[unsafe(method_family = new)]
1133 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
1134 );
1135}
1136
1137extern "C-unwind" {
1138 #[cfg(feature = "block2")]
1139 #[deprecated = "renamed to `UICellAccessory::position_before_accessory_of_class`"]
1140 pub fn UICellAccessoryPositionBeforeAccessoryOfClass(
1141 accessory_class: &AnyClass,
1142 ) -> UICellAccessoryPosition;
1143}
1144
1145extern "C-unwind" {
1146 #[cfg(feature = "block2")]
1147 #[deprecated = "renamed to `UICellAccessory::position_after_accessory_of_class`"]
1148 pub fn UICellAccessoryPositionAfterAccessoryOfClass(
1149 accessory_class: &AnyClass,
1150 ) -> UICellAccessoryPosition;
1151}