objc2_app_kit/generated/
NSFontPanel.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10#[repr(transparent)]
13#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
14pub struct NSFontPanelModeMask(pub NSUInteger);
15bitflags::bitflags! {
16 impl NSFontPanelModeMask: NSUInteger {
17 #[doc(alias = "NSFontPanelModeMaskFace")]
18 const ModeMaskFace = 1<<0;
19 #[doc(alias = "NSFontPanelModeMaskSize")]
20 const ModeMaskSize = 1<<1;
21 #[doc(alias = "NSFontPanelModeMaskCollection")]
22 const ModeMaskCollection = 1<<2;
23 #[doc(alias = "NSFontPanelModeMaskUnderlineEffect")]
24 const ModeMaskUnderlineEffect = 1<<8;
25 #[doc(alias = "NSFontPanelModeMaskStrikethroughEffect")]
26 const ModeMaskStrikethroughEffect = 1<<9;
27 #[doc(alias = "NSFontPanelModeMaskTextColorEffect")]
28 const ModeMaskTextColorEffect = 1<<10;
29 #[doc(alias = "NSFontPanelModeMaskDocumentColorEffect")]
30 const ModeMaskDocumentColorEffect = 1<<11;
31 #[doc(alias = "NSFontPanelModeMaskShadowEffect")]
32 const ModeMaskShadowEffect = 1<<12;
33 #[doc(alias = "NSFontPanelModeMaskAllEffects")]
34 const ModeMaskAllEffects = 0xFFF00;
35 #[doc(alias = "NSFontPanelModesMaskStandardModes")]
36 const ModesMaskStandardModes = 0xFFFF;
37 #[doc(alias = "NSFontPanelModesMaskAllModes")]
38 const ModesMaskAllModes = 0xFFFFFFFF;
39 }
40}
41
42unsafe impl Encode for NSFontPanelModeMask {
43 const ENCODING: Encoding = NSUInteger::ENCODING;
44}
45
46unsafe impl RefEncode for NSFontPanelModeMask {
47 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
48}
49
50extern_protocol!(
51 pub unsafe trait NSFontChanging: NSObjectProtocol + MainThreadOnly {
53 #[cfg(feature = "NSFontManager")]
54 #[optional]
55 #[unsafe(method(changeFont:))]
56 #[unsafe(method_family = none)]
57 unsafe fn changeFont(&self, sender: Option<&NSFontManager>);
58
59 #[cfg(all(feature = "NSPanel", feature = "NSResponder", feature = "NSWindow"))]
60 #[optional]
61 #[unsafe(method(validModesForFontPanel:))]
62 #[unsafe(method_family = none)]
63 unsafe fn validModesForFontPanel(&self, font_panel: &NSFontPanel) -> NSFontPanelModeMask;
64 }
65);
66
67extern_class!(
68 #[unsafe(super(NSPanel, NSWindow, NSResponder, NSObject))]
70 #[derive(Debug, PartialEq, Eq, Hash)]
71 #[cfg(all(feature = "NSPanel", feature = "NSResponder", feature = "NSWindow"))]
72 pub struct NSFontPanel;
73);
74
75#[cfg(all(
76 feature = "NSAccessibilityProtocols",
77 feature = "NSPanel",
78 feature = "NSResponder",
79 feature = "NSWindow"
80))]
81unsafe impl NSAccessibility for NSFontPanel {}
82
83#[cfg(all(
84 feature = "NSAccessibilityProtocols",
85 feature = "NSPanel",
86 feature = "NSResponder",
87 feature = "NSWindow"
88))]
89unsafe impl NSAccessibilityElementProtocol for NSFontPanel {}
90
91#[cfg(all(
92 feature = "NSAnimation",
93 feature = "NSPanel",
94 feature = "NSResponder",
95 feature = "NSWindow"
96))]
97unsafe impl NSAnimatablePropertyContainer for NSFontPanel {}
98
99#[cfg(all(
100 feature = "NSAppearance",
101 feature = "NSPanel",
102 feature = "NSResponder",
103 feature = "NSWindow"
104))]
105unsafe impl NSAppearanceCustomization for NSFontPanel {}
106
107#[cfg(all(feature = "NSPanel", feature = "NSResponder", feature = "NSWindow"))]
108unsafe impl NSCoding for NSFontPanel {}
109
110#[cfg(all(
111 feature = "NSMenu",
112 feature = "NSPanel",
113 feature = "NSResponder",
114 feature = "NSWindow"
115))]
116unsafe impl NSMenuItemValidation for NSFontPanel {}
117
118#[cfg(all(feature = "NSPanel", feature = "NSResponder", feature = "NSWindow"))]
119unsafe impl NSObjectProtocol for NSFontPanel {}
120
121#[cfg(all(
122 feature = "NSPanel",
123 feature = "NSResponder",
124 feature = "NSUserInterfaceItemIdentification",
125 feature = "NSWindow"
126))]
127unsafe impl NSUserInterfaceItemIdentification for NSFontPanel {}
128
129#[cfg(all(
130 feature = "NSPanel",
131 feature = "NSResponder",
132 feature = "NSUserInterfaceValidation",
133 feature = "NSWindow"
134))]
135unsafe impl NSUserInterfaceValidations for NSFontPanel {}
136
137#[cfg(all(feature = "NSPanel", feature = "NSResponder", feature = "NSWindow"))]
138impl NSFontPanel {
139 extern_methods!(
140 #[unsafe(method(sharedFontPanel))]
141 #[unsafe(method_family = none)]
142 pub unsafe fn sharedFontPanel(mtm: MainThreadMarker) -> Retained<NSFontPanel>;
143
144 #[unsafe(method(sharedFontPanelExists))]
145 #[unsafe(method_family = none)]
146 pub unsafe fn sharedFontPanelExists(mtm: MainThreadMarker) -> bool;
147
148 #[cfg(feature = "NSView")]
149 #[unsafe(method(accessoryView))]
150 #[unsafe(method_family = none)]
151 pub unsafe fn accessoryView(&self) -> Option<Retained<NSView>>;
152
153 #[cfg(feature = "NSView")]
154 #[unsafe(method(setAccessoryView:))]
156 #[unsafe(method_family = none)]
157 pub unsafe fn setAccessoryView(&self, accessory_view: Option<&NSView>);
158
159 #[cfg(feature = "NSFont")]
160 #[unsafe(method(setPanelFont:isMultiple:))]
161 #[unsafe(method_family = none)]
162 pub unsafe fn setPanelFont_isMultiple(&self, font_obj: &NSFont, flag: bool);
163
164 #[cfg(feature = "NSFont")]
165 #[unsafe(method(panelConvertFont:))]
166 #[unsafe(method_family = none)]
167 pub unsafe fn panelConvertFont(&self, font_obj: &NSFont) -> Retained<NSFont>;
168
169 #[unsafe(method(worksWhenModal))]
170 #[unsafe(method_family = none)]
171 pub unsafe fn worksWhenModal(&self) -> bool;
172
173 #[unsafe(method(setWorksWhenModal:))]
175 #[unsafe(method_family = none)]
176 pub unsafe fn setWorksWhenModal(&self, works_when_modal: bool);
177
178 #[unsafe(method(isEnabled))]
179 #[unsafe(method_family = none)]
180 pub unsafe fn isEnabled(&self) -> bool;
181
182 #[unsafe(method(setEnabled:))]
184 #[unsafe(method_family = none)]
185 pub unsafe fn setEnabled(&self, enabled: bool);
186
187 #[unsafe(method(reloadDefaultFontFamilies))]
188 #[unsafe(method_family = none)]
189 pub unsafe fn reloadDefaultFontFamilies(&self);
190 );
191}
192
193#[cfg(all(feature = "NSPanel", feature = "NSResponder", feature = "NSWindow"))]
195impl NSFontPanel {
196 extern_methods!(
197 #[cfg(feature = "NSGraphics")]
198 #[unsafe(method(initWithContentRect:styleMask:backing:defer:))]
199 #[unsafe(method_family = init)]
200 pub unsafe fn initWithContentRect_styleMask_backing_defer(
201 this: Allocated<Self>,
202 content_rect: NSRect,
203 style: NSWindowStyleMask,
204 backing_store_type: NSBackingStoreType,
205 flag: bool,
206 ) -> Retained<Self>;
207
208 #[cfg(all(feature = "NSGraphics", feature = "NSScreen"))]
209 #[unsafe(method(initWithContentRect:styleMask:backing:defer:screen:))]
210 #[unsafe(method_family = init)]
211 pub unsafe fn initWithContentRect_styleMask_backing_defer_screen(
212 this: Allocated<Self>,
213 content_rect: NSRect,
214 style: NSWindowStyleMask,
215 backing_store_type: NSBackingStoreType,
216 flag: bool,
217 screen: Option<&NSScreen>,
218 ) -> Retained<Self>;
219
220 #[unsafe(method(initWithCoder:))]
221 #[unsafe(method_family = init)]
222 pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
223
224 #[cfg(feature = "NSViewController")]
225 #[unsafe(method(windowWithContentViewController:))]
227 #[unsafe(method_family = none)]
228 pub unsafe fn windowWithContentViewController(
229 content_view_controller: &NSViewController,
230 ) -> Retained<Self>;
231 );
232}
233
234#[cfg(all(feature = "NSPanel", feature = "NSResponder", feature = "NSWindow"))]
236impl NSFontPanel {
237 extern_methods!(
238 #[unsafe(method(init))]
239 #[unsafe(method_family = init)]
240 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
241 );
242}
243
244#[cfg(all(feature = "NSPanel", feature = "NSResponder", feature = "NSWindow"))]
246impl NSFontPanel {
247 extern_methods!(
248 #[unsafe(method(new))]
249 #[unsafe(method_family = new)]
250 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
251 );
252}
253
254pub const NSFontPanelFaceModeMask: c_uint = 1 << 0;
256pub const NSFontPanelSizeModeMask: c_uint = 1 << 1;
258pub const NSFontPanelCollectionModeMask: c_uint = 1 << 2;
260pub const NSFontPanelUnderlineEffectModeMask: c_uint = 1 << 8;
262pub const NSFontPanelStrikethroughEffectModeMask: c_uint = 1 << 9;
264pub const NSFontPanelTextColorEffectModeMask: c_uint = 1 << 10;
266pub const NSFontPanelDocumentColorEffectModeMask: c_uint = 1 << 11;
268pub const NSFontPanelShadowEffectModeMask: c_uint = 1 << 12;
270pub const NSFontPanelAllEffectsModeMask: c_uint = 0xFFF00;
272pub const NSFontPanelStandardModesMask: c_uint = 0xFFFF;
274pub const NSFontPanelAllModesMask: c_uint = 0xFFFFFFFF;
276
277pub const NSFPPreviewButton: c_uint = 131;
279pub const NSFPRevertButton: c_uint = 130;
281pub const NSFPSetButton: c_uint = 132;
283pub const NSFPPreviewField: c_uint = 128;
285pub const NSFPSizeField: c_uint = 129;
287pub const NSFPSizeTitle: c_uint = 133;
289pub const NSFPCurrentField: c_uint = 134;