objc2_app_kit/generated/
NSGroupTouchBarItem.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::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12extern_class!(
13    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsgrouptouchbaritem?language=objc)
14    #[unsafe(super(NSTouchBarItem, NSObject))]
15    #[derive(Debug, PartialEq, Eq, Hash)]
16    #[cfg(feature = "NSTouchBarItem")]
17    pub struct NSGroupTouchBarItem;
18);
19
20#[cfg(feature = "NSTouchBarItem")]
21extern_conformance!(
22    unsafe impl NSCoding for NSGroupTouchBarItem {}
23);
24
25#[cfg(feature = "NSTouchBarItem")]
26extern_conformance!(
27    unsafe impl NSObjectProtocol for NSGroupTouchBarItem {}
28);
29
30#[cfg(feature = "NSTouchBarItem")]
31impl NSGroupTouchBarItem {
32    extern_methods!(
33        #[unsafe(method(groupItemWithIdentifier:items:))]
34        #[unsafe(method_family = none)]
35        pub fn groupItemWithIdentifier_items(
36            identifier: &NSTouchBarItemIdentifier,
37            items: &NSArray<NSTouchBarItem>,
38            mtm: MainThreadMarker,
39        ) -> Retained<Self>;
40
41        #[cfg(feature = "NSUserInterfaceCompression")]
42        #[unsafe(method(groupItemWithIdentifier:items:allowedCompressionOptions:))]
43        #[unsafe(method_family = none)]
44        pub fn groupItemWithIdentifier_items_allowedCompressionOptions(
45            identifier: &NSTouchBarItemIdentifier,
46            items: &NSArray<NSTouchBarItem>,
47            allowed_compression_options: &NSUserInterfaceCompressionOptions,
48            mtm: MainThreadMarker,
49        ) -> Retained<Self>;
50
51        #[unsafe(method(alertStyleGroupItemWithIdentifier:))]
52        #[unsafe(method_family = none)]
53        pub fn alertStyleGroupItemWithIdentifier(
54            identifier: &NSTouchBarItemIdentifier,
55            mtm: MainThreadMarker,
56        ) -> Retained<Self>;
57
58        #[cfg(feature = "NSTouchBar")]
59        #[unsafe(method(groupTouchBar))]
60        #[unsafe(method_family = none)]
61        pub fn groupTouchBar(&self) -> Retained<NSTouchBar>;
62
63        #[cfg(feature = "NSTouchBar")]
64        /// Setter for [`groupTouchBar`][Self::groupTouchBar].
65        #[unsafe(method(setGroupTouchBar:))]
66        #[unsafe(method_family = none)]
67        pub fn setGroupTouchBar(&self, group_touch_bar: &NSTouchBar);
68
69        #[unsafe(method(customizationLabel))]
70        #[unsafe(method_family = none)]
71        pub fn customizationLabel(&self) -> Retained<NSString>;
72
73        /// Setter for [`customizationLabel`][Self::customizationLabel].
74        ///
75        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
76        #[unsafe(method(setCustomizationLabel:))]
77        #[unsafe(method_family = none)]
78        pub fn setCustomizationLabel(&self, customization_label: Option<&NSString>);
79
80        #[cfg(feature = "NSUserInterfaceLayout")]
81        #[unsafe(method(groupUserInterfaceLayoutDirection))]
82        #[unsafe(method_family = none)]
83        pub fn groupUserInterfaceLayoutDirection(&self) -> NSUserInterfaceLayoutDirection;
84
85        #[cfg(feature = "NSUserInterfaceLayout")]
86        /// Setter for [`groupUserInterfaceLayoutDirection`][Self::groupUserInterfaceLayoutDirection].
87        #[unsafe(method(setGroupUserInterfaceLayoutDirection:))]
88        #[unsafe(method_family = none)]
89        pub fn setGroupUserInterfaceLayoutDirection(
90            &self,
91            group_user_interface_layout_direction: NSUserInterfaceLayoutDirection,
92        );
93
94        #[unsafe(method(prefersEqualWidths))]
95        #[unsafe(method_family = none)]
96        pub fn prefersEqualWidths(&self) -> bool;
97
98        /// Setter for [`prefersEqualWidths`][Self::prefersEqualWidths].
99        #[unsafe(method(setPrefersEqualWidths:))]
100        #[unsafe(method_family = none)]
101        pub fn setPrefersEqualWidths(&self, prefers_equal_widths: bool);
102
103        #[cfg(feature = "objc2-core-foundation")]
104        #[unsafe(method(preferredItemWidth))]
105        #[unsafe(method_family = none)]
106        pub fn preferredItemWidth(&self) -> CGFloat;
107
108        #[cfg(feature = "objc2-core-foundation")]
109        /// Setter for [`preferredItemWidth`][Self::preferredItemWidth].
110        #[unsafe(method(setPreferredItemWidth:))]
111        #[unsafe(method_family = none)]
112        pub fn setPreferredItemWidth(&self, preferred_item_width: CGFloat);
113
114        #[cfg(feature = "NSUserInterfaceCompression")]
115        #[unsafe(method(effectiveCompressionOptions))]
116        #[unsafe(method_family = none)]
117        pub fn effectiveCompressionOptions(&self) -> Retained<NSUserInterfaceCompressionOptions>;
118
119        #[cfg(feature = "NSUserInterfaceCompression")]
120        #[unsafe(method(prioritizedCompressionOptions))]
121        #[unsafe(method_family = none)]
122        pub fn prioritizedCompressionOptions(
123            &self,
124        ) -> Retained<NSArray<NSUserInterfaceCompressionOptions>>;
125
126        #[cfg(feature = "NSUserInterfaceCompression")]
127        /// Setter for [`prioritizedCompressionOptions`][Self::prioritizedCompressionOptions].
128        ///
129        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
130        #[unsafe(method(setPrioritizedCompressionOptions:))]
131        #[unsafe(method_family = none)]
132        pub fn setPrioritizedCompressionOptions(
133            &self,
134            prioritized_compression_options: &NSArray<NSUserInterfaceCompressionOptions>,
135        );
136    );
137}
138
139/// Methods declared on superclass `NSTouchBarItem`.
140#[cfg(feature = "NSTouchBarItem")]
141impl NSGroupTouchBarItem {
142    extern_methods!(
143        #[unsafe(method(initWithIdentifier:))]
144        #[unsafe(method_family = init)]
145        pub fn initWithIdentifier(
146            this: Allocated<Self>,
147            identifier: &NSTouchBarItemIdentifier,
148        ) -> Retained<Self>;
149
150        /// # Safety
151        ///
152        /// `coder` possibly has further requirements.
153        #[unsafe(method(initWithCoder:))]
154        #[unsafe(method_family = init)]
155        pub unsafe fn initWithCoder(
156            this: Allocated<Self>,
157            coder: &NSCoder,
158        ) -> Option<Retained<Self>>;
159
160        #[unsafe(method(init))]
161        #[unsafe(method_family = init)]
162        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
163    );
164}
165
166/// Methods declared on superclass `NSObject`.
167#[cfg(feature = "NSTouchBarItem")]
168impl NSGroupTouchBarItem {
169    extern_methods!(
170        #[unsafe(method(new))]
171        #[unsafe(method_family = new)]
172        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
173    );
174}