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 unsafe 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 unsafe fn setPopoverTouchBar(&self, popover_touch_bar: &NSTouchBar);
41
42        #[unsafe(method(customizationLabel))]
43        #[unsafe(method_family = none)]
44        pub unsafe fn customizationLabel(&self) -> Retained<NSString>;
45
46        /// Setter for [`customizationLabel`][Self::customizationLabel].
47        #[unsafe(method(setCustomizationLabel:))]
48        #[unsafe(method_family = none)]
49        pub unsafe fn setCustomizationLabel(&self, customization_label: Option<&NSString>);
50
51        #[cfg(all(feature = "NSResponder", feature = "NSView"))]
52        #[unsafe(method(collapsedRepresentation))]
53        #[unsafe(method_family = none)]
54        pub unsafe fn collapsedRepresentation(&self) -> Retained<NSView>;
55
56        #[cfg(all(feature = "NSResponder", feature = "NSView"))]
57        /// Setter for [`collapsedRepresentation`][Self::collapsedRepresentation].
58        #[unsafe(method(setCollapsedRepresentation:))]
59        #[unsafe(method_family = none)]
60        pub unsafe fn setCollapsedRepresentation(&self, collapsed_representation: &NSView);
61
62        #[cfg(feature = "NSImage")]
63        #[unsafe(method(collapsedRepresentationImage))]
64        #[unsafe(method_family = none)]
65        pub unsafe fn collapsedRepresentationImage(&self) -> Option<Retained<NSImage>>;
66
67        #[cfg(feature = "NSImage")]
68        /// Setter for [`collapsedRepresentationImage`][Self::collapsedRepresentationImage].
69        #[unsafe(method(setCollapsedRepresentationImage:))]
70        #[unsafe(method_family = none)]
71        pub unsafe fn setCollapsedRepresentationImage(
72            &self,
73            collapsed_representation_image: Option<&NSImage>,
74        );
75
76        #[unsafe(method(collapsedRepresentationLabel))]
77        #[unsafe(method_family = none)]
78        pub unsafe fn collapsedRepresentationLabel(&self) -> Retained<NSString>;
79
80        /// Setter for [`collapsedRepresentationLabel`][Self::collapsedRepresentationLabel].
81        #[unsafe(method(setCollapsedRepresentationLabel:))]
82        #[unsafe(method_family = none)]
83        pub unsafe fn setCollapsedRepresentationLabel(
84            &self,
85            collapsed_representation_label: &NSString,
86        );
87
88        #[cfg(feature = "NSTouchBar")]
89        #[unsafe(method(pressAndHoldTouchBar))]
90        #[unsafe(method_family = none)]
91        pub unsafe fn pressAndHoldTouchBar(&self) -> Option<Retained<NSTouchBar>>;
92
93        #[cfg(feature = "NSTouchBar")]
94        /// Setter for [`pressAndHoldTouchBar`][Self::pressAndHoldTouchBar].
95        #[unsafe(method(setPressAndHoldTouchBar:))]
96        #[unsafe(method_family = none)]
97        pub unsafe fn setPressAndHoldTouchBar(&self, press_and_hold_touch_bar: Option<&NSTouchBar>);
98
99        #[unsafe(method(showsCloseButton))]
100        #[unsafe(method_family = none)]
101        pub unsafe fn showsCloseButton(&self) -> bool;
102
103        /// Setter for [`showsCloseButton`][Self::showsCloseButton].
104        #[unsafe(method(setShowsCloseButton:))]
105        #[unsafe(method_family = none)]
106        pub unsafe fn setShowsCloseButton(&self, shows_close_button: bool);
107
108        #[unsafe(method(showPopover:))]
109        #[unsafe(method_family = none)]
110        pub unsafe fn showPopover(&self, sender: Option<&AnyObject>);
111
112        #[unsafe(method(dismissPopover:))]
113        #[unsafe(method_family = none)]
114        pub unsafe fn dismissPopover(&self, sender: Option<&AnyObject>);
115
116        #[cfg(feature = "NSGestureRecognizer")]
117        #[unsafe(method(makeStandardActivatePopoverGestureRecognizer))]
118        #[unsafe(method_family = none)]
119        pub unsafe fn makeStandardActivatePopoverGestureRecognizer(
120            &self,
121        ) -> Retained<NSGestureRecognizer>;
122    );
123}
124
125/// Methods declared on superclass `NSTouchBarItem`.
126#[cfg(feature = "NSTouchBarItem")]
127impl NSPopoverTouchBarItem {
128    extern_methods!(
129        #[unsafe(method(initWithIdentifier:))]
130        #[unsafe(method_family = init)]
131        pub unsafe fn initWithIdentifier(
132            this: Allocated<Self>,
133            identifier: &NSTouchBarItemIdentifier,
134        ) -> Retained<Self>;
135
136        #[unsafe(method(initWithCoder:))]
137        #[unsafe(method_family = init)]
138        pub unsafe fn initWithCoder(
139            this: Allocated<Self>,
140            coder: &NSCoder,
141        ) -> Option<Retained<Self>>;
142
143        #[unsafe(method(init))]
144        #[unsafe(method_family = init)]
145        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
146    );
147}
148
149/// Methods declared on superclass `NSObject`.
150#[cfg(feature = "NSTouchBarItem")]
151impl NSPopoverTouchBarItem {
152    extern_methods!(
153        #[unsafe(method(new))]
154        #[unsafe(method_family = new)]
155        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
156    );
157}