objc2_ui_kit/generated/
UITabSidebarItem.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
10extern_class!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitabsidebaritem?language=objc)
12    #[unsafe(super(NSObject))]
13    #[thread_kind = MainThreadOnly]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    pub struct UITabSidebarItem;
16);
17
18extern_conformance!(
19    unsafe impl NSCopying for UITabSidebarItem {}
20);
21
22unsafe impl CopyingHelper for UITabSidebarItem {
23    type Result = Self;
24}
25
26extern_conformance!(
27    unsafe impl NSObjectProtocol for UITabSidebarItem {}
28);
29
30impl UITabSidebarItem {
31    extern_methods!(
32        #[cfg(feature = "UITab")]
33        /// The tab that the receiver represents. Only one of `tab` or `action` will be valid for an item.
34        #[unsafe(method(tab))]
35        #[unsafe(method_family = none)]
36        pub fn tab(&self) -> Option<Retained<UITab>>;
37
38        #[cfg(all(feature = "UIAction", feature = "UIMenuElement"))]
39        /// The action that the receiver represents. Only one of `tab` or `action` will be valid for an item.
40        #[unsafe(method(action))]
41        #[unsafe(method_family = none)]
42        pub fn action(&self) -> Option<Retained<UIAction>>;
43
44        #[cfg(all(
45            feature = "UICellConfigurationState",
46            feature = "UIViewConfigurationState"
47        ))]
48        /// The current configuration state of the sidebar item.
49        #[unsafe(method(configurationState))]
50        #[unsafe(method_family = none)]
51        pub fn configurationState(&self) -> Retained<UICellConfigurationState>;
52
53        #[cfg(feature = "UIContentConfiguration")]
54        /// The content configuration to use when displaying this item.
55        #[unsafe(method(contentConfiguration))]
56        #[unsafe(method_family = none)]
57        pub fn contentConfiguration(&self) -> Retained<ProtocolObject<dyn UIContentConfiguration>>;
58
59        #[cfg(feature = "UIContentConfiguration")]
60        /// Setter for [`contentConfiguration`][Self::contentConfiguration].
61        ///
62        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
63        #[unsafe(method(setContentConfiguration:))]
64        #[unsafe(method_family = none)]
65        pub fn setContentConfiguration(
66            &self,
67            content_configuration: &ProtocolObject<dyn UIContentConfiguration>,
68        );
69
70        #[cfg(feature = "UIBackgroundConfiguration")]
71        /// The background configuration to use when displaying this item.
72        #[unsafe(method(backgroundConfiguration))]
73        #[unsafe(method_family = none)]
74        pub fn backgroundConfiguration(&self) -> Retained<UIBackgroundConfiguration>;
75
76        #[cfg(feature = "UIBackgroundConfiguration")]
77        /// Setter for [`backgroundConfiguration`][Self::backgroundConfiguration].
78        ///
79        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
80        #[unsafe(method(setBackgroundConfiguration:))]
81        #[unsafe(method_family = none)]
82        pub fn setBackgroundConfiguration(
83            &self,
84            background_configuration: &UIBackgroundConfiguration,
85        );
86
87        #[cfg(feature = "UICellAccessory")]
88        /// Cell accessories to use when displaying this item. Some accessories may not be shown if it conflicts with system default accessories.
89        #[unsafe(method(accessories))]
90        #[unsafe(method_family = none)]
91        pub fn accessories(&self) -> Retained<NSArray<UICellAccessory>>;
92
93        #[cfg(feature = "UICellAccessory")]
94        /// Setter for [`accessories`][Self::accessories].
95        ///
96        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
97        #[unsafe(method(setAccessories:))]
98        #[unsafe(method_family = none)]
99        pub fn setAccessories(&self, accessories: &NSArray<UICellAccessory>);
100
101        #[cfg(feature = "UIListContentConfiguration")]
102        /// Returns the default content configuration for this item and the configuration state.
103        #[unsafe(method(defaultContentConfiguration))]
104        #[unsafe(method_family = none)]
105        pub fn defaultContentConfiguration(&self) -> Retained<UIListContentConfiguration>;
106
107        #[cfg(feature = "UIBackgroundConfiguration")]
108        /// Returns the default background configuration for this item and the configuration state.
109        #[unsafe(method(defaultBackgroundConfiguration))]
110        #[unsafe(method_family = none)]
111        pub fn defaultBackgroundConfiguration(&self) -> Retained<UIBackgroundConfiguration>;
112
113        /// Creates a sidebar item from the specified request. The sidebar item will be preconfigured with the appropriate defaults for its content.
114        #[unsafe(method(itemFromRequest:))]
115        #[unsafe(method_family = none)]
116        pub fn itemFromRequest(request: &UITabSidebarItemRequest) -> Retained<Self>;
117
118        #[unsafe(method(init))]
119        #[unsafe(method_family = init)]
120        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
121
122        #[unsafe(method(new))]
123        #[unsafe(method_family = new)]
124        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
125    );
126}
127
128extern_class!(
129    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitabsidebaritemrequest?language=objc)
130    #[unsafe(super(NSObject))]
131    #[thread_kind = MainThreadOnly]
132    #[derive(Debug, PartialEq, Eq, Hash)]
133    pub struct UITabSidebarItemRequest;
134);
135
136extern_conformance!(
137    unsafe impl NSObjectProtocol for UITabSidebarItemRequest {}
138);
139
140impl UITabSidebarItemRequest {
141    extern_methods!(
142        #[cfg(feature = "UITab")]
143        /// The tab that the receiver represents. Only one of `tab` or `action` will be valid for an item.
144        #[unsafe(method(tab))]
145        #[unsafe(method_family = none)]
146        pub fn tab(&self) -> Option<Retained<UITab>>;
147
148        #[cfg(all(feature = "UIAction", feature = "UIMenuElement"))]
149        /// The action that the receiver represents. Only one of `tab` or `action` will be valid for an item.
150        #[unsafe(method(action))]
151        #[unsafe(method_family = none)]
152        pub fn action(&self) -> Option<Retained<UIAction>>;
153
154        #[unsafe(method(init))]
155        #[unsafe(method_family = init)]
156        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
157
158        #[unsafe(method(new))]
159        #[unsafe(method_family = new)]
160        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
161    );
162}