objc2_app_kit/generated/
NSSwitch.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/nsswitch?language=objc)
12    #[unsafe(super(NSControl, NSView, NSResponder, NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    #[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
15    pub struct NSSwitch;
16);
17
18#[cfg(all(
19    feature = "NSAccessibilityProtocols",
20    feature = "NSControl",
21    feature = "NSResponder",
22    feature = "NSView"
23))]
24unsafe impl NSAccessibility for NSSwitch {}
25
26#[cfg(all(
27    feature = "NSAccessibilityProtocols",
28    feature = "NSControl",
29    feature = "NSResponder",
30    feature = "NSView"
31))]
32unsafe impl NSAccessibilityButton for NSSwitch {}
33
34#[cfg(all(
35    feature = "NSAccessibilityProtocols",
36    feature = "NSControl",
37    feature = "NSResponder",
38    feature = "NSView"
39))]
40unsafe impl NSAccessibilityElementProtocol for NSSwitch {}
41
42#[cfg(all(
43    feature = "NSAccessibilityProtocols",
44    feature = "NSControl",
45    feature = "NSResponder",
46    feature = "NSView"
47))]
48unsafe impl NSAccessibilitySwitch for NSSwitch {}
49
50#[cfg(all(
51    feature = "NSAnimation",
52    feature = "NSControl",
53    feature = "NSResponder",
54    feature = "NSView"
55))]
56unsafe impl NSAnimatablePropertyContainer for NSSwitch {}
57
58#[cfg(all(
59    feature = "NSAppearance",
60    feature = "NSControl",
61    feature = "NSResponder",
62    feature = "NSView"
63))]
64unsafe impl NSAppearanceCustomization for NSSwitch {}
65
66#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
67unsafe impl NSCoding for NSSwitch {}
68
69#[cfg(all(
70    feature = "NSControl",
71    feature = "NSDragging",
72    feature = "NSResponder",
73    feature = "NSView"
74))]
75unsafe impl NSDraggingDestination for NSSwitch {}
76
77#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
78unsafe impl NSObjectProtocol for NSSwitch {}
79
80#[cfg(all(
81    feature = "NSControl",
82    feature = "NSResponder",
83    feature = "NSUserInterfaceItemIdentification",
84    feature = "NSView"
85))]
86unsafe impl NSUserInterfaceItemIdentification for NSSwitch {}
87
88#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
89impl NSSwitch {
90    extern_methods!(
91        #[cfg(feature = "NSCell")]
92        #[unsafe(method(state))]
93        #[unsafe(method_family = none)]
94        pub unsafe fn state(&self) -> NSControlStateValue;
95
96        #[cfg(feature = "NSCell")]
97        /// Setter for [`state`][Self::state].
98        #[unsafe(method(setState:))]
99        #[unsafe(method_family = none)]
100        pub unsafe fn setState(&self, state: NSControlStateValue);
101    );
102}
103
104/// Methods declared on superclass `NSControl`.
105#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
106impl NSSwitch {
107    extern_methods!(
108        #[unsafe(method(initWithFrame:))]
109        #[unsafe(method_family = init)]
110        pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
111
112        #[unsafe(method(initWithCoder:))]
113        #[unsafe(method_family = init)]
114        pub unsafe fn initWithCoder(
115            this: Allocated<Self>,
116            coder: &NSCoder,
117        ) -> Option<Retained<Self>>;
118    );
119}
120
121/// Methods declared on superclass `NSResponder`.
122#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
123impl NSSwitch {
124    extern_methods!(
125        #[unsafe(method(init))]
126        #[unsafe(method_family = init)]
127        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
128    );
129}
130
131/// Methods declared on superclass `NSObject`.
132#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
133impl NSSwitch {
134    extern_methods!(
135        #[unsafe(method(new))]
136        #[unsafe(method_family = new)]
137        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
138    );
139}