objc2_ui_kit/generated/
UIToolbarAppearance.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/uitoolbarappearance?language=objc)
12    #[unsafe(super(UIBarAppearance, NSObject))]
13    #[thread_kind = MainThreadOnly]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    #[cfg(feature = "UIBarAppearance")]
16    pub struct UIToolbarAppearance;
17);
18
19#[cfg(feature = "UIBarAppearance")]
20unsafe impl NSCoding for UIToolbarAppearance {}
21
22#[cfg(feature = "UIBarAppearance")]
23unsafe impl NSCopying for UIToolbarAppearance {}
24
25#[cfg(feature = "UIBarAppearance")]
26unsafe impl CopyingHelper for UIToolbarAppearance {
27    type Result = Self;
28}
29
30#[cfg(feature = "UIBarAppearance")]
31unsafe impl NSObjectProtocol for UIToolbarAppearance {}
32
33#[cfg(feature = "UIBarAppearance")]
34unsafe impl NSSecureCoding for UIToolbarAppearance {}
35
36#[cfg(feature = "UIBarAppearance")]
37impl UIToolbarAppearance {
38    extern_methods!(
39        #[cfg(feature = "UIBarButtonItemAppearance")]
40        /// The appearance for plain-style bar button items
41        #[unsafe(method(buttonAppearance))]
42        #[unsafe(method_family = none)]
43        pub unsafe fn buttonAppearance(&self) -> Retained<UIBarButtonItemAppearance>;
44
45        #[cfg(feature = "UIBarButtonItemAppearance")]
46        /// Setter for [`buttonAppearance`][Self::buttonAppearance].
47        #[unsafe(method(setButtonAppearance:))]
48        #[unsafe(method_family = none)]
49        pub unsafe fn setButtonAppearance(&self, button_appearance: &UIBarButtonItemAppearance);
50
51        #[cfg(feature = "UIBarButtonItemAppearance")]
52        /// The appearance for done-style bar button items
53        #[unsafe(method(doneButtonAppearance))]
54        #[unsafe(method_family = none)]
55        pub unsafe fn doneButtonAppearance(&self) -> Retained<UIBarButtonItemAppearance>;
56
57        #[cfg(feature = "UIBarButtonItemAppearance")]
58        /// Setter for [`doneButtonAppearance`][Self::doneButtonAppearance].
59        #[unsafe(method(setDoneButtonAppearance:))]
60        #[unsafe(method_family = none)]
61        pub unsafe fn setDoneButtonAppearance(
62            &self,
63            done_button_appearance: &UIBarButtonItemAppearance,
64        );
65    );
66}
67
68/// Methods declared on superclass `UIBarAppearance`.
69#[cfg(feature = "UIBarAppearance")]
70impl UIToolbarAppearance {
71    extern_methods!(
72        /// Constructs a new bar appearance, configured with default values and targeting the device idiom.
73        #[unsafe(method(init))]
74        #[unsafe(method_family = init)]
75        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
76
77        #[cfg(feature = "UIDevice")]
78        /// 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.
79        #[unsafe(method(initWithIdiom:))]
80        #[unsafe(method_family = init)]
81        pub unsafe fn initWithIdiom(
82            this: Allocated<Self>,
83            idiom: UIUserInterfaceIdiom,
84        ) -> Retained<Self>;
85
86        /// 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.
87        #[unsafe(method(initWithBarAppearance:))]
88        #[unsafe(method_family = init)]
89        pub unsafe fn initWithBarAppearance(
90            this: Allocated<Self>,
91            bar_appearance: &UIBarAppearance,
92        ) -> Retained<Self>;
93
94        #[unsafe(method(initWithCoder:))]
95        #[unsafe(method_family = init)]
96        pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
97    );
98}
99
100/// Methods declared on superclass `NSObject`.
101#[cfg(feature = "UIBarAppearance")]
102impl UIToolbarAppearance {
103    extern_methods!(
104        #[unsafe(method(new))]
105        #[unsafe(method_family = new)]
106        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
107    );
108}