objc2_app_kit/generated/
NSCustomTouchBarItem.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11 #[unsafe(super(NSTouchBarItem, NSObject))]
13 #[derive(Debug, PartialEq, Eq, Hash)]
14 #[cfg(feature = "NSTouchBarItem")]
15 pub struct NSCustomTouchBarItem;
16);
17
18#[cfg(feature = "NSTouchBarItem")]
19extern_conformance!(
20 unsafe impl NSCoding for NSCustomTouchBarItem {}
21);
22
23#[cfg(feature = "NSTouchBarItem")]
24extern_conformance!(
25 unsafe impl NSObjectProtocol for NSCustomTouchBarItem {}
26);
27
28#[cfg(feature = "NSTouchBarItem")]
29impl NSCustomTouchBarItem {
30 extern_methods!(
31 #[cfg(all(feature = "NSResponder", feature = "NSView"))]
32 #[unsafe(method(view))]
33 #[unsafe(method_family = none)]
34 pub fn view(&self) -> Retained<NSView>;
35
36 #[cfg(all(feature = "NSResponder", feature = "NSView"))]
37 #[unsafe(method(setView:))]
39 #[unsafe(method_family = none)]
40 pub fn setView(&self, view: &NSView);
41
42 #[cfg(all(feature = "NSResponder", feature = "NSViewController"))]
43 #[unsafe(method(viewController))]
44 #[unsafe(method_family = none)]
45 pub fn viewController(&self) -> Option<Retained<NSViewController>>;
46
47 #[cfg(all(feature = "NSResponder", feature = "NSViewController"))]
48 #[unsafe(method(setViewController:))]
50 #[unsafe(method_family = none)]
51 pub fn setViewController(&self, view_controller: Option<&NSViewController>);
52
53 #[unsafe(method(customizationLabel))]
54 #[unsafe(method_family = none)]
55 pub fn customizationLabel(&self) -> Retained<NSString>;
56
57 #[unsafe(method(setCustomizationLabel:))]
61 #[unsafe(method_family = none)]
62 pub fn setCustomizationLabel(&self, customization_label: Option<&NSString>);
63 );
64}
65
66#[cfg(feature = "NSTouchBarItem")]
68impl NSCustomTouchBarItem {
69 extern_methods!(
70 #[unsafe(method(initWithIdentifier:))]
71 #[unsafe(method_family = init)]
72 pub fn initWithIdentifier(
73 this: Allocated<Self>,
74 identifier: &NSTouchBarItemIdentifier,
75 ) -> Retained<Self>;
76
77 #[unsafe(method(initWithCoder:))]
81 #[unsafe(method_family = init)]
82 pub unsafe fn initWithCoder(
83 this: Allocated<Self>,
84 coder: &NSCoder,
85 ) -> Option<Retained<Self>>;
86
87 #[unsafe(method(init))]
88 #[unsafe(method_family = init)]
89 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
90 );
91}
92
93#[cfg(feature = "NSTouchBarItem")]
95impl NSCustomTouchBarItem {
96 extern_methods!(
97 #[unsafe(method(new))]
98 #[unsafe(method_family = new)]
99 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
100 );
101}