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