objc2_ui_kit/generated/
UINavigationBarAppearance.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/uinavigationbarappearance?language=objc)
12    #[unsafe(super(UIBarAppearance, NSObject))]
13    #[thread_kind = MainThreadOnly]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    #[cfg(feature = "UIBarAppearance")]
16    pub struct UINavigationBarAppearance;
17);
18
19#[cfg(feature = "UIBarAppearance")]
20extern_conformance!(
21    unsafe impl NSCoding for UINavigationBarAppearance {}
22);
23
24#[cfg(feature = "UIBarAppearance")]
25extern_conformance!(
26    unsafe impl NSCopying for UINavigationBarAppearance {}
27);
28
29#[cfg(feature = "UIBarAppearance")]
30unsafe impl CopyingHelper for UINavigationBarAppearance {
31    type Result = Self;
32}
33
34#[cfg(feature = "UIBarAppearance")]
35extern_conformance!(
36    unsafe impl NSObjectProtocol for UINavigationBarAppearance {}
37);
38
39#[cfg(feature = "UIBarAppearance")]
40extern_conformance!(
41    unsafe impl NSSecureCoding for UINavigationBarAppearance {}
42);
43
44#[cfg(feature = "UIBarAppearance")]
45impl UINavigationBarAppearance {
46    extern_methods!(
47        /// Inline Title text attributes. If the font or color are unspecified, appropriate defaults are supplied.
48        #[unsafe(method(titleTextAttributes))]
49        #[unsafe(method_family = none)]
50        pub unsafe fn titleTextAttributes(
51            &self,
52        ) -> Retained<NSDictionary<NSAttributedStringKey, AnyObject>>;
53
54        /// Setter for [`titleTextAttributes`][Self::titleTextAttributes].
55        #[unsafe(method(setTitleTextAttributes:))]
56        #[unsafe(method_family = none)]
57        pub unsafe fn setTitleTextAttributes(
58            &self,
59            title_text_attributes: &NSDictionary<NSAttributedStringKey, AnyObject>,
60        );
61
62        #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
63        /// An additional adjustment to the inline title's position.
64        #[unsafe(method(titlePositionAdjustment))]
65        #[unsafe(method_family = none)]
66        pub unsafe fn titlePositionAdjustment(&self) -> UIOffset;
67
68        #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
69        /// Setter for [`titlePositionAdjustment`][Self::titlePositionAdjustment].
70        #[unsafe(method(setTitlePositionAdjustment:))]
71        #[unsafe(method_family = none)]
72        pub unsafe fn setTitlePositionAdjustment(&self, title_position_adjustment: UIOffset);
73
74        /// Large Title text attributes. If the font or color are unspecified, appropriate defaults are supplied.
75        #[unsafe(method(largeTitleTextAttributes))]
76        #[unsafe(method_family = none)]
77        pub unsafe fn largeTitleTextAttributes(
78            &self,
79        ) -> Retained<NSDictionary<NSAttributedStringKey, AnyObject>>;
80
81        /// Setter for [`largeTitleTextAttributes`][Self::largeTitleTextAttributes].
82        #[unsafe(method(setLargeTitleTextAttributes:))]
83        #[unsafe(method_family = none)]
84        pub unsafe fn setLargeTitleTextAttributes(
85            &self,
86            large_title_text_attributes: &NSDictionary<NSAttributedStringKey, AnyObject>,
87        );
88
89        #[cfg(feature = "UIBarButtonItemAppearance")]
90        /// The appearance for plain-style bar button items
91        #[unsafe(method(buttonAppearance))]
92        #[unsafe(method_family = none)]
93        pub unsafe fn buttonAppearance(&self) -> Retained<UIBarButtonItemAppearance>;
94
95        #[cfg(feature = "UIBarButtonItemAppearance")]
96        /// Setter for [`buttonAppearance`][Self::buttonAppearance].
97        #[unsafe(method(setButtonAppearance:))]
98        #[unsafe(method_family = none)]
99        pub unsafe fn setButtonAppearance(&self, button_appearance: &UIBarButtonItemAppearance);
100
101        #[cfg(feature = "UIBarButtonItemAppearance")]
102        /// The appearance for done-style bar button items
103        #[unsafe(method(doneButtonAppearance))]
104        #[unsafe(method_family = none)]
105        pub unsafe fn doneButtonAppearance(&self) -> Retained<UIBarButtonItemAppearance>;
106
107        #[cfg(feature = "UIBarButtonItemAppearance")]
108        /// Setter for [`doneButtonAppearance`][Self::doneButtonAppearance].
109        #[unsafe(method(setDoneButtonAppearance:))]
110        #[unsafe(method_family = none)]
111        pub unsafe fn setDoneButtonAppearance(
112            &self,
113            done_button_appearance: &UIBarButtonItemAppearance,
114        );
115
116        #[cfg(feature = "UIBarButtonItemAppearance")]
117        /// The appearance for back buttons. Defaults are drawn from buttonAppearance when appropriate.
118        #[unsafe(method(backButtonAppearance))]
119        #[unsafe(method_family = none)]
120        pub unsafe fn backButtonAppearance(&self) -> Retained<UIBarButtonItemAppearance>;
121
122        #[cfg(feature = "UIBarButtonItemAppearance")]
123        /// Setter for [`backButtonAppearance`][Self::backButtonAppearance].
124        #[unsafe(method(setBackButtonAppearance:))]
125        #[unsafe(method_family = none)]
126        pub unsafe fn setBackButtonAppearance(
127            &self,
128            back_button_appearance: &UIBarButtonItemAppearance,
129        );
130
131        #[cfg(feature = "UIImage")]
132        /// The image shown on the leading edge of the back button.
133        #[unsafe(method(backIndicatorImage))]
134        #[unsafe(method_family = none)]
135        pub unsafe fn backIndicatorImage(&self) -> Retained<UIImage>;
136
137        #[cfg(feature = "UIImage")]
138        /// This image is used to mask content flowing underneath the backIndicatorImage during push
139        /// &
140        /// pop transitions
141        #[unsafe(method(backIndicatorTransitionMaskImage))]
142        #[unsafe(method_family = none)]
143        pub unsafe fn backIndicatorTransitionMaskImage(&self) -> Retained<UIImage>;
144
145        #[cfg(feature = "UIImage")]
146        /// Set the backIndicatorImage
147        /// &
148        /// backIndicatorTransitionMaskImage images. If either image is nil, then both images will be reset to their default.
149        #[unsafe(method(setBackIndicatorImage:transitionMaskImage:))]
150        #[unsafe(method_family = none)]
151        pub unsafe fn setBackIndicatorImage_transitionMaskImage(
152            &self,
153            back_indicator_image: Option<&UIImage>,
154            back_indicator_transition_mask_image: Option<&UIImage>,
155        );
156    );
157}
158
159/// Methods declared on superclass `UIBarAppearance`.
160#[cfg(feature = "UIBarAppearance")]
161impl UINavigationBarAppearance {
162    extern_methods!(
163        /// Constructs a new bar appearance, configured with default values and targeting the device idiom.
164        #[unsafe(method(init))]
165        #[unsafe(method_family = init)]
166        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
167
168        #[cfg(feature = "UIDevice")]
169        /// Constructs a new bar appearance, targeting the passed-in idiom as a hint. Not all platforms support all available idioms. See the idiom property to determine the resolved idiom.
170        #[unsafe(method(initWithIdiom:))]
171        #[unsafe(method_family = init)]
172        pub unsafe fn initWithIdiom(
173            this: Allocated<Self>,
174            idiom: UIUserInterfaceIdiom,
175        ) -> Retained<Self>;
176
177        /// Constructs a new bar appearance, copying all relevant properties from the given appearance object. This initializer is useful for migrating configuration between UIBarAppearance subclasses. For example, you can initialize a UINavigationBarAppearance with a UIToolbarAppearance instance, and shared attributes will be identical between the two.
178        #[unsafe(method(initWithBarAppearance:))]
179        #[unsafe(method_family = init)]
180        pub unsafe fn initWithBarAppearance(
181            this: Allocated<Self>,
182            bar_appearance: &UIBarAppearance,
183        ) -> Retained<Self>;
184
185        #[unsafe(method(initWithCoder:))]
186        #[unsafe(method_family = init)]
187        pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
188    );
189}
190
191/// Methods declared on superclass `NSObject`.
192#[cfg(feature = "UIBarAppearance")]
193impl UINavigationBarAppearance {
194    extern_methods!(
195        #[unsafe(method(new))]
196        #[unsafe(method_family = new)]
197        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
198    );
199}