objc2_ui_kit/generated/
UITraitListEnvironment.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5
6use crate::*;
7
8/// Specifies a list appearance that encompasses both UICollectionView
9/// &
10/// UITableView lists.
11///
12/// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uilistenvironment?language=objc)
13// NS_ENUM
14#[repr(transparent)]
15#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
16pub struct UIListEnvironment(pub NSInteger);
17impl UIListEnvironment {
18    /// Indicates the absence of any information about whether or not the trait collection is from a view in a list environment.
19    #[doc(alias = "UIListEnvironmentUnspecified")]
20    pub const Unspecified: Self = Self(0);
21    /// There is no containing list.
22    #[doc(alias = "UIListEnvironmentNone")]
23    pub const None: Self = Self(1);
24    /// Contained within a plain-style list.
25    #[doc(alias = "UIListEnvironmentPlain")]
26    pub const Plain: Self = Self(2);
27    /// Contained within a grouped-style list.
28    #[doc(alias = "UIListEnvironmentGrouped")]
29    pub const Grouped: Self = Self(3);
30    /// Contained within a inset-grouped-style list.
31    #[doc(alias = "UIListEnvironmentInsetGrouped")]
32    pub const InsetGrouped: Self = Self(4);
33    /// Contained within a sidebar-style list.
34    #[doc(alias = "UIListEnvironmentSidebar")]
35    pub const Sidebar: Self = Self(5);
36    /// Contained within a sidebar-plain-style list.
37    #[doc(alias = "UIListEnvironmentSidebarPlain")]
38    pub const SidebarPlain: Self = Self(6);
39}
40
41unsafe impl Encode for UIListEnvironment {
42    const ENCODING: Encoding = NSInteger::ENCODING;
43}
44
45unsafe impl RefEncode for UIListEnvironment {
46    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
47}
48
49extern_class!(
50    /// A trait that specifies the UIListEnvironment, if any, that a view is in. It is set on views inside UITableViews and list sections in UICollectionViews.
51    /// Defaults to UIListEnvironmentUnspecified.
52    ///
53    /// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uitraitlistenvironment?language=objc)
54    #[unsafe(super(NSObject))]
55    #[thread_kind = MainThreadOnly]
56    #[derive(Debug, PartialEq, Eq, Hash)]
57    pub struct UITraitListEnvironment;
58);
59
60extern_conformance!(
61    unsafe impl NSObjectProtocol for UITraitListEnvironment {}
62);
63
64#[cfg(feature = "UITrait")]
65extern_conformance!(
66    unsafe impl UINSIntegerTraitDefinition for UITraitListEnvironment {}
67);
68
69#[cfg(feature = "UITrait")]
70extern_conformance!(
71    unsafe impl UITraitDefinition for UITraitListEnvironment {}
72);
73
74impl UITraitListEnvironment {
75    extern_methods!();
76}
77
78/// Methods declared on superclass `NSObject`.
79impl UITraitListEnvironment {
80    extern_methods!(
81        #[unsafe(method(init))]
82        #[unsafe(method_family = init)]
83        pub fn init(this: Allocated<Self>) -> Retained<Self>;
84
85        #[unsafe(method(new))]
86        #[unsafe(method_family = new)]
87        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
88    );
89}