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")]
19unsafe impl NSCoding for NSCustomTouchBarItem {}
20
21#[cfg(feature = "NSTouchBarItem")]
22unsafe impl NSObjectProtocol for NSCustomTouchBarItem {}
23
24#[cfg(feature = "NSTouchBarItem")]
25impl NSCustomTouchBarItem {
26 extern_methods!(
27 #[cfg(all(feature = "NSResponder", feature = "NSView"))]
28 #[unsafe(method(view))]
29 #[unsafe(method_family = none)]
30 pub unsafe fn view(&self) -> Retained<NSView>;
31
32 #[cfg(all(feature = "NSResponder", feature = "NSView"))]
33 #[unsafe(method(setView:))]
35 #[unsafe(method_family = none)]
36 pub unsafe fn setView(&self, view: &NSView);
37
38 #[cfg(all(feature = "NSResponder", feature = "NSViewController"))]
39 #[unsafe(method(viewController))]
40 #[unsafe(method_family = none)]
41 pub unsafe fn viewController(&self) -> Option<Retained<NSViewController>>;
42
43 #[cfg(all(feature = "NSResponder", feature = "NSViewController"))]
44 #[unsafe(method(setViewController:))]
46 #[unsafe(method_family = none)]
47 pub unsafe fn setViewController(&self, view_controller: Option<&NSViewController>);
48
49 #[unsafe(method(customizationLabel))]
50 #[unsafe(method_family = none)]
51 pub unsafe fn customizationLabel(&self) -> Retained<NSString>;
52
53 #[unsafe(method(setCustomizationLabel:))]
55 #[unsafe(method_family = none)]
56 pub unsafe fn setCustomizationLabel(&self, customization_label: Option<&NSString>);
57 );
58}
59
60#[cfg(feature = "NSTouchBarItem")]
62impl NSCustomTouchBarItem {
63 extern_methods!(
64 #[unsafe(method(initWithIdentifier:))]
65 #[unsafe(method_family = init)]
66 pub unsafe fn initWithIdentifier(
67 this: Allocated<Self>,
68 identifier: &NSTouchBarItemIdentifier,
69 ) -> Retained<Self>;
70
71 #[unsafe(method(initWithCoder:))]
72 #[unsafe(method_family = init)]
73 pub unsafe fn initWithCoder(
74 this: Allocated<Self>,
75 coder: &NSCoder,
76 ) -> Option<Retained<Self>>;
77
78 #[unsafe(method(init))]
79 #[unsafe(method_family = init)]
80 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
81 );
82}
83
84#[cfg(feature = "NSTouchBarItem")]
86impl NSCustomTouchBarItem {
87 extern_methods!(
88 #[unsafe(method(new))]
89 #[unsafe(method_family = new)]
90 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
91 );
92}