objc2_ui_kit/generated/
UIBarItem.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/uibaritem?language=objc)
12    #[unsafe(super(NSObject))]
13    #[thread_kind = MainThreadOnly]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    pub struct UIBarItem;
16);
17
18extern_conformance!(
19    unsafe impl NSCoding for UIBarItem {}
20);
21
22extern_conformance!(
23    unsafe impl NSObjectProtocol for UIBarItem {}
24);
25
26#[cfg(feature = "UIAppearance")]
27extern_conformance!(
28    unsafe impl UIAppearance for UIBarItem {}
29);
30
31impl UIBarItem {
32    extern_methods!(
33        #[unsafe(method(init))]
34        #[unsafe(method_family = init)]
35        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
36
37        #[unsafe(method(initWithCoder:))]
38        #[unsafe(method_family = init)]
39        pub unsafe fn initWithCoder(
40            this: Allocated<Self>,
41            coder: &NSCoder,
42        ) -> Option<Retained<Self>>;
43
44        #[unsafe(method(isEnabled))]
45        #[unsafe(method_family = none)]
46        pub unsafe fn isEnabled(&self) -> bool;
47
48        /// Setter for [`isEnabled`][Self::isEnabled].
49        #[unsafe(method(setEnabled:))]
50        #[unsafe(method_family = none)]
51        pub unsafe fn setEnabled(&self, enabled: bool);
52
53        #[unsafe(method(title))]
54        #[unsafe(method_family = none)]
55        pub unsafe fn title(&self) -> Option<Retained<NSString>>;
56
57        /// Setter for [`title`][Self::title].
58        #[unsafe(method(setTitle:))]
59        #[unsafe(method_family = none)]
60        pub unsafe fn setTitle(&self, title: Option<&NSString>);
61
62        #[cfg(feature = "UIImage")]
63        #[unsafe(method(image))]
64        #[unsafe(method_family = none)]
65        pub unsafe fn image(&self) -> Option<Retained<UIImage>>;
66
67        #[cfg(feature = "UIImage")]
68        /// Setter for [`image`][Self::image].
69        #[unsafe(method(setImage:))]
70        #[unsafe(method_family = none)]
71        pub unsafe fn setImage(&self, image: Option<&UIImage>);
72
73        #[cfg(feature = "UIImage")]
74        #[unsafe(method(landscapeImagePhone))]
75        #[unsafe(method_family = none)]
76        pub unsafe fn landscapeImagePhone(&self) -> Option<Retained<UIImage>>;
77
78        #[cfg(feature = "UIImage")]
79        /// Setter for [`landscapeImagePhone`][Self::landscapeImagePhone].
80        #[unsafe(method(setLandscapeImagePhone:))]
81        #[unsafe(method_family = none)]
82        pub unsafe fn setLandscapeImagePhone(&self, landscape_image_phone: Option<&UIImage>);
83
84        #[cfg(feature = "UIImage")]
85        #[unsafe(method(largeContentSizeImage))]
86        #[unsafe(method_family = none)]
87        pub unsafe fn largeContentSizeImage(&self) -> Option<Retained<UIImage>>;
88
89        #[cfg(feature = "UIImage")]
90        /// Setter for [`largeContentSizeImage`][Self::largeContentSizeImage].
91        #[unsafe(method(setLargeContentSizeImage:))]
92        #[unsafe(method_family = none)]
93        pub unsafe fn setLargeContentSizeImage(&self, large_content_size_image: Option<&UIImage>);
94
95        #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
96        #[unsafe(method(imageInsets))]
97        #[unsafe(method_family = none)]
98        pub unsafe fn imageInsets(&self) -> UIEdgeInsets;
99
100        #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
101        /// Setter for [`imageInsets`][Self::imageInsets].
102        #[unsafe(method(setImageInsets:))]
103        #[unsafe(method_family = none)]
104        pub unsafe fn setImageInsets(&self, image_insets: UIEdgeInsets);
105
106        #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
107        #[unsafe(method(landscapeImagePhoneInsets))]
108        #[unsafe(method_family = none)]
109        pub unsafe fn landscapeImagePhoneInsets(&self) -> UIEdgeInsets;
110
111        #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
112        /// Setter for [`landscapeImagePhoneInsets`][Self::landscapeImagePhoneInsets].
113        #[unsafe(method(setLandscapeImagePhoneInsets:))]
114        #[unsafe(method_family = none)]
115        pub unsafe fn setLandscapeImagePhoneInsets(
116            &self,
117            landscape_image_phone_insets: UIEdgeInsets,
118        );
119
120        #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
121        #[unsafe(method(largeContentSizeImageInsets))]
122        #[unsafe(method_family = none)]
123        pub unsafe fn largeContentSizeImageInsets(&self) -> UIEdgeInsets;
124
125        #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
126        /// Setter for [`largeContentSizeImageInsets`][Self::largeContentSizeImageInsets].
127        #[unsafe(method(setLargeContentSizeImageInsets:))]
128        #[unsafe(method_family = none)]
129        pub unsafe fn setLargeContentSizeImageInsets(
130            &self,
131            large_content_size_image_insets: UIEdgeInsets,
132        );
133
134        #[unsafe(method(tag))]
135        #[unsafe(method_family = none)]
136        pub unsafe fn tag(&self) -> NSInteger;
137
138        /// Setter for [`tag`][Self::tag].
139        #[unsafe(method(setTag:))]
140        #[unsafe(method_family = none)]
141        pub unsafe fn setTag(&self, tag: NSInteger);
142
143        #[cfg(feature = "UIControl")]
144        #[unsafe(method(setTitleTextAttributes:forState:))]
145        #[unsafe(method_family = none)]
146        pub unsafe fn setTitleTextAttributes_forState(
147            &self,
148            attributes: Option<&NSDictionary<NSAttributedStringKey, AnyObject>>,
149            state: UIControlState,
150        );
151
152        #[cfg(feature = "UIControl")]
153        #[unsafe(method(titleTextAttributesForState:))]
154        #[unsafe(method_family = none)]
155        pub unsafe fn titleTextAttributesForState(
156            &self,
157            state: UIControlState,
158        ) -> Option<Retained<NSDictionary<NSAttributedStringKey, AnyObject>>>;
159    );
160}
161
162/// Methods declared on superclass `NSObject`.
163impl UIBarItem {
164    extern_methods!(
165        #[unsafe(method(new))]
166        #[unsafe(method_family = new)]
167        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
168    );
169}