objc2_app_kit/generated/
NSPopoverTouchBarItem.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/appkit/nspopovertouchbaritem?language=objc)
12    #[unsafe(super(NSTouchBarItem, NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    #[cfg(feature = "NSTouchBarItem")]
15    pub struct NSPopoverTouchBarItem;
16);
17
18#[cfg(feature = "NSTouchBarItem")]
19extern_conformance!(
20    unsafe impl NSCoding for NSPopoverTouchBarItem {}
21);
22
23#[cfg(feature = "NSTouchBarItem")]
24extern_conformance!(
25    unsafe impl NSObjectProtocol for NSPopoverTouchBarItem {}
26);
27
28#[cfg(feature = "NSTouchBarItem")]
29impl NSPopoverTouchBarItem {
30    extern_methods!(
31        #[cfg(feature = "NSTouchBar")]
32        #[unsafe(method(popoverTouchBar))]
33        #[unsafe(method_family = none)]
34        pub fn popoverTouchBar(&self) -> Retained<NSTouchBar>;
35
36        #[cfg(feature = "NSTouchBar")]
37        /// Setter for [`popoverTouchBar`][Self::popoverTouchBar].
38        #[unsafe(method(setPopoverTouchBar:))]
39        #[unsafe(method_family = none)]
40        pub fn setPopoverTouchBar(&self, popover_touch_bar: &NSTouchBar);
41
42        #[unsafe(method(customizationLabel))]
43        #[unsafe(method_family = none)]
44        pub fn customizationLabel(&self) -> Retained<NSString>;
45
46        /// Setter for [`customizationLabel`][Self::customizationLabel].
47        ///
48        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
49        #[unsafe(method(setCustomizationLabel:))]
50        #[unsafe(method_family = none)]
51        pub fn setCustomizationLabel(&self, customization_label: Option<&NSString>);
52
53        #[cfg(all(feature = "NSResponder", feature = "NSView"))]
54        #[unsafe(method(collapsedRepresentation))]
55        #[unsafe(method_family = none)]
56        pub fn collapsedRepresentation(&self) -> Retained<NSView>;
57
58        #[cfg(all(feature = "NSResponder", feature = "NSView"))]
59        /// Setter for [`collapsedRepresentation`][Self::collapsedRepresentation].
60        #[unsafe(method(setCollapsedRepresentation:))]
61        #[unsafe(method_family = none)]
62        pub fn setCollapsedRepresentation(&self, collapsed_representation: &NSView);
63
64        #[cfg(feature = "NSImage")]
65        #[unsafe(method(collapsedRepresentationImage))]
66        #[unsafe(method_family = none)]
67        pub fn collapsedRepresentationImage(&self) -> Option<Retained<NSImage>>;
68
69        #[cfg(feature = "NSImage")]
70        /// Setter for [`collapsedRepresentationImage`][Self::collapsedRepresentationImage].
71        #[unsafe(method(setCollapsedRepresentationImage:))]
72        #[unsafe(method_family = none)]
73        pub fn setCollapsedRepresentationImage(
74            &self,
75            collapsed_representation_image: Option<&NSImage>,
76        );
77
78        #[unsafe(method(collapsedRepresentationLabel))]
79        #[unsafe(method_family = none)]
80        pub fn collapsedRepresentationLabel(&self) -> Retained<NSString>;
81
82        /// Setter for [`collapsedRepresentationLabel`][Self::collapsedRepresentationLabel].
83        #[unsafe(method(setCollapsedRepresentationLabel:))]
84        #[unsafe(method_family = none)]
85        pub fn setCollapsedRepresentationLabel(&self, collapsed_representation_label: &NSString);
86
87        #[cfg(feature = "NSTouchBar")]
88        #[unsafe(method(pressAndHoldTouchBar))]
89        #[unsafe(method_family = none)]
90        pub fn pressAndHoldTouchBar(&self) -> Option<Retained<NSTouchBar>>;
91
92        #[cfg(feature = "NSTouchBar")]
93        /// Setter for [`pressAndHoldTouchBar`][Self::pressAndHoldTouchBar].
94        #[unsafe(method(setPressAndHoldTouchBar:))]
95        #[unsafe(method_family = none)]
96        pub fn setPressAndHoldTouchBar(&self, press_and_hold_touch_bar: Option<&NSTouchBar>);
97
98        #[unsafe(method(showsCloseButton))]
99        #[unsafe(method_family = none)]
100        pub fn showsCloseButton(&self) -> bool;
101
102        /// Setter for [`showsCloseButton`][Self::showsCloseButton].
103        #[unsafe(method(setShowsCloseButton:))]
104        #[unsafe(method_family = none)]
105        pub fn setShowsCloseButton(&self, shows_close_button: bool);
106
107        /// # Safety
108        ///
109        /// `sender` should be of the correct type.
110        #[unsafe(method(showPopover:))]
111        #[unsafe(method_family = none)]
112        pub unsafe fn showPopover(&self, sender: Option<&AnyObject>);
113
114        /// # Safety
115        ///
116        /// `sender` should be of the correct type.
117        #[unsafe(method(dismissPopover:))]
118        #[unsafe(method_family = none)]
119        pub unsafe fn dismissPopover(&self, sender: Option<&AnyObject>);
120
121        #[cfg(feature = "NSGestureRecognizer")]
122        #[unsafe(method(makeStandardActivatePopoverGestureRecognizer))]
123        #[unsafe(method_family = none)]
124        pub fn makeStandardActivatePopoverGestureRecognizer(&self)
125            -> Retained<NSGestureRecognizer>;
126    );
127}
128
129/// Methods declared on superclass `NSTouchBarItem`.
130#[cfg(feature = "NSTouchBarItem")]
131impl NSPopoverTouchBarItem {
132    extern_methods!(
133        #[unsafe(method(initWithIdentifier:))]
134        #[unsafe(method_family = init)]
135        pub fn initWithIdentifier(
136            this: Allocated<Self>,
137            identifier: &NSTouchBarItemIdentifier,
138        ) -> Retained<Self>;
139
140        /// # Safety
141        ///
142        /// `coder` possibly has further requirements.
143        #[unsafe(method(initWithCoder:))]
144        #[unsafe(method_family = init)]
145        pub unsafe fn initWithCoder(
146            this: Allocated<Self>,
147            coder: &NSCoder,
148        ) -> Option<Retained<Self>>;
149
150        #[unsafe(method(init))]
151        #[unsafe(method_family = init)]
152        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
153    );
154}
155
156/// Methods declared on superclass `NSObject`.
157#[cfg(feature = "NSTouchBarItem")]
158impl NSPopoverTouchBarItem {
159    extern_methods!(
160        #[unsafe(method(new))]
161        #[unsafe(method_family = new)]
162        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
163    );
164}