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 unsafe fn view(&self) -> Retained<NSView>;
35
36 #[cfg(all(feature = "NSResponder", feature = "NSView"))]
37 #[unsafe(method(setView:))]
39 #[unsafe(method_family = none)]
40 pub unsafe fn setView(&self, view: &NSView);
41
42 #[cfg(all(feature = "NSResponder", feature = "NSViewController"))]
43 #[unsafe(method(viewController))]
44 #[unsafe(method_family = none)]
45 pub unsafe 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 unsafe fn setViewController(&self, view_controller: Option<&NSViewController>);
52
53 #[unsafe(method(customizationLabel))]
54 #[unsafe(method_family = none)]
55 pub unsafe fn customizationLabel(&self) -> Retained<NSString>;
56
57 #[unsafe(method(setCustomizationLabel:))]
59 #[unsafe(method_family = none)]
60 pub unsafe fn setCustomizationLabel(&self, customization_label: Option<&NSString>);
61 );
62}
63
64#[cfg(feature = "NSTouchBarItem")]
66impl NSCustomTouchBarItem {
67 extern_methods!(
68 #[unsafe(method(initWithIdentifier:))]
69 #[unsafe(method_family = init)]
70 pub unsafe fn initWithIdentifier(
71 this: Allocated<Self>,
72 identifier: &NSTouchBarItemIdentifier,
73 ) -> Retained<Self>;
74
75 #[unsafe(method(initWithCoder:))]
76 #[unsafe(method_family = init)]
77 pub unsafe fn initWithCoder(
78 this: Allocated<Self>,
79 coder: &NSCoder,
80 ) -> Option<Retained<Self>>;
81
82 #[unsafe(method(init))]
83 #[unsafe(method_family = init)]
84 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
85 );
86}
87
88#[cfg(feature = "NSTouchBarItem")]
90impl NSCustomTouchBarItem {
91 extern_methods!(
92 #[unsafe(method(new))]
93 #[unsafe(method_family = new)]
94 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
95 );
96}