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