objc2_app_kit/generated/
NSSwitch.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11 #[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))]
24extern_conformance!(
25 unsafe impl NSAccessibility for NSSwitch {}
26);
27
28#[cfg(all(
29 feature = "NSAccessibilityProtocols",
30 feature = "NSControl",
31 feature = "NSResponder",
32 feature = "NSView"
33))]
34extern_conformance!(
35 unsafe impl NSAccessibilityButton for NSSwitch {}
36);
37
38#[cfg(all(
39 feature = "NSAccessibilityProtocols",
40 feature = "NSControl",
41 feature = "NSResponder",
42 feature = "NSView"
43))]
44extern_conformance!(
45 unsafe impl NSAccessibilityElementProtocol for NSSwitch {}
46);
47
48#[cfg(all(
49 feature = "NSAccessibilityProtocols",
50 feature = "NSControl",
51 feature = "NSResponder",
52 feature = "NSView"
53))]
54extern_conformance!(
55 unsafe impl NSAccessibilitySwitch for NSSwitch {}
56);
57
58#[cfg(all(
59 feature = "NSAnimation",
60 feature = "NSControl",
61 feature = "NSResponder",
62 feature = "NSView"
63))]
64extern_conformance!(
65 unsafe impl NSAnimatablePropertyContainer for NSSwitch {}
66);
67
68#[cfg(all(
69 feature = "NSAppearance",
70 feature = "NSControl",
71 feature = "NSResponder",
72 feature = "NSView"
73))]
74extern_conformance!(
75 unsafe impl NSAppearanceCustomization for NSSwitch {}
76);
77
78#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
79extern_conformance!(
80 unsafe impl NSCoding for NSSwitch {}
81);
82
83#[cfg(all(
84 feature = "NSControl",
85 feature = "NSDragging",
86 feature = "NSResponder",
87 feature = "NSView"
88))]
89extern_conformance!(
90 unsafe impl NSDraggingDestination for NSSwitch {}
91);
92
93#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
94extern_conformance!(
95 unsafe impl NSObjectProtocol for NSSwitch {}
96);
97
98#[cfg(all(
99 feature = "NSControl",
100 feature = "NSResponder",
101 feature = "NSUserInterfaceItemIdentification",
102 feature = "NSView"
103))]
104extern_conformance!(
105 unsafe impl NSUserInterfaceItemIdentification for NSSwitch {}
106);
107
108#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
109impl NSSwitch {
110 extern_methods!(
111 #[cfg(feature = "NSCell")]
112 #[unsafe(method(state))]
113 #[unsafe(method_family = none)]
114 pub fn state(&self) -> NSControlStateValue;
115
116 #[cfg(feature = "NSCell")]
117 #[unsafe(method(setState:))]
119 #[unsafe(method_family = none)]
120 pub fn setState(&self, state: NSControlStateValue);
121 );
122}
123
124#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
126impl NSSwitch {
127 extern_methods!(
128 #[unsafe(method(initWithFrame:))]
129 #[unsafe(method_family = init)]
130 pub fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
131
132 #[unsafe(method(initWithCoder:))]
136 #[unsafe(method_family = init)]
137 pub unsafe fn initWithCoder(
138 this: Allocated<Self>,
139 coder: &NSCoder,
140 ) -> Option<Retained<Self>>;
141 );
142}
143
144#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
146impl NSSwitch {
147 extern_methods!(
148 #[unsafe(method(init))]
149 #[unsafe(method_family = init)]
150 pub fn init(this: Allocated<Self>) -> Retained<Self>;
151 );
152}
153
154#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
156impl NSSwitch {
157 extern_methods!(
158 #[unsafe(method(new))]
159 #[unsafe(method_family = new)]
160 pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
161 );
162}