icrate/generated/AppKit/
NSFontPanel.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use crate::common::*;
4use crate::AppKit::*;
5use crate::CoreData::*;
6use crate::Foundation::*;
7
8ns_options!(
9    #[underlying(NSUInteger)]
10    pub enum NSFontPanelModeMask {
11        NSFontPanelModeMaskFace = 1 << 0,
12        NSFontPanelModeMaskSize = 1 << 1,
13        NSFontPanelModeMaskCollection = 1 << 2,
14        NSFontPanelModeMaskUnderlineEffect = 1 << 8,
15        NSFontPanelModeMaskStrikethroughEffect = 1 << 9,
16        NSFontPanelModeMaskTextColorEffect = 1 << 10,
17        NSFontPanelModeMaskDocumentColorEffect = 1 << 11,
18        NSFontPanelModeMaskShadowEffect = 1 << 12,
19        NSFontPanelModeMaskAllEffects = 0xFFF00,
20        NSFontPanelModesMaskStandardModes = 0xFFFF,
21        NSFontPanelModesMaskAllModes = 0xFFFFFFFF,
22    }
23);
24
25extern_protocol!(
26    pub unsafe trait NSFontChanging: NSObjectProtocol + IsMainThreadOnly {
27        #[cfg(feature = "AppKit_NSFontManager")]
28        #[optional]
29        #[method(changeFont:)]
30        unsafe fn changeFont(&self, sender: Option<&NSFontManager>);
31
32        #[cfg(feature = "AppKit_NSFontPanel")]
33        #[optional]
34        #[method(validModesForFontPanel:)]
35        unsafe fn validModesForFontPanel(&self, font_panel: &NSFontPanel) -> NSFontPanelModeMask;
36    }
37
38    unsafe impl ProtocolType for dyn NSFontChanging {}
39);
40
41extern_class!(
42    #[derive(Debug, PartialEq, Eq, Hash)]
43    #[cfg(feature = "AppKit_NSFontPanel")]
44    pub struct NSFontPanel;
45
46    #[cfg(feature = "AppKit_NSFontPanel")]
47    unsafe impl ClassType for NSFontPanel {
48        #[inherits(NSWindow, NSResponder, NSObject)]
49        type Super = NSPanel;
50        type Mutability = MainThreadOnly;
51    }
52);
53
54#[cfg(feature = "AppKit_NSFontPanel")]
55unsafe impl NSAccessibility for NSFontPanel {}
56
57#[cfg(feature = "AppKit_NSFontPanel")]
58unsafe impl NSAccessibilityElementProtocol for NSFontPanel {}
59
60#[cfg(feature = "AppKit_NSFontPanel")]
61unsafe impl NSAnimatablePropertyContainer for NSFontPanel {}
62
63#[cfg(feature = "AppKit_NSFontPanel")]
64unsafe impl NSAppearanceCustomization for NSFontPanel {}
65
66#[cfg(feature = "AppKit_NSFontPanel")]
67unsafe impl NSCoding for NSFontPanel {}
68
69#[cfg(feature = "AppKit_NSFontPanel")]
70unsafe impl NSMenuItemValidation for NSFontPanel {}
71
72#[cfg(feature = "AppKit_NSFontPanel")]
73unsafe impl NSObjectProtocol for NSFontPanel {}
74
75#[cfg(feature = "AppKit_NSFontPanel")]
76unsafe impl NSUserInterfaceItemIdentification for NSFontPanel {}
77
78#[cfg(feature = "AppKit_NSFontPanel")]
79unsafe impl NSUserInterfaceValidations for NSFontPanel {}
80
81extern_methods!(
82    #[cfg(feature = "AppKit_NSFontPanel")]
83    unsafe impl NSFontPanel {
84        #[method_id(@__retain_semantics Other sharedFontPanel)]
85        pub unsafe fn sharedFontPanel(mtm: MainThreadMarker) -> Id<NSFontPanel>;
86
87        #[method(sharedFontPanelExists)]
88        pub unsafe fn sharedFontPanelExists(mtm: MainThreadMarker) -> bool;
89
90        #[cfg(feature = "AppKit_NSView")]
91        #[method_id(@__retain_semantics Other accessoryView)]
92        pub unsafe fn accessoryView(&self) -> Option<Id<NSView>>;
93
94        #[cfg(feature = "AppKit_NSView")]
95        #[method(setAccessoryView:)]
96        pub unsafe fn setAccessoryView(&self, accessory_view: Option<&NSView>);
97
98        #[cfg(feature = "AppKit_NSFont")]
99        #[method(setPanelFont:isMultiple:)]
100        pub unsafe fn setPanelFont_isMultiple(&self, font_obj: &NSFont, flag: bool);
101
102        #[cfg(feature = "AppKit_NSFont")]
103        #[method_id(@__retain_semantics Other panelConvertFont:)]
104        pub unsafe fn panelConvertFont(&self, font_obj: &NSFont) -> Id<NSFont>;
105
106        #[method(worksWhenModal)]
107        pub unsafe fn worksWhenModal(&self) -> bool;
108
109        #[method(setWorksWhenModal:)]
110        pub unsafe fn setWorksWhenModal(&self, works_when_modal: bool);
111
112        #[method(isEnabled)]
113        pub unsafe fn isEnabled(&self) -> bool;
114
115        #[method(setEnabled:)]
116        pub unsafe fn setEnabled(&self, enabled: bool);
117
118        #[method(reloadDefaultFontFamilies)]
119        pub unsafe fn reloadDefaultFontFamilies(&self);
120    }
121);
122
123extern_methods!(
124    /// Methods declared on superclass `NSWindow`
125    #[cfg(feature = "AppKit_NSFontPanel")]
126    unsafe impl NSFontPanel {
127        #[method_id(@__retain_semantics Init initWithContentRect:styleMask:backing:defer:)]
128        pub unsafe fn initWithContentRect_styleMask_backing_defer(
129            this: Allocated<Self>,
130            content_rect: NSRect,
131            style: NSWindowStyleMask,
132            backing_store_type: NSBackingStoreType,
133            flag: bool,
134        ) -> Id<Self>;
135
136        #[cfg(feature = "AppKit_NSScreen")]
137        #[method_id(@__retain_semantics Init initWithContentRect:styleMask:backing:defer:screen:)]
138        pub unsafe fn initWithContentRect_styleMask_backing_defer_screen(
139            this: Allocated<Self>,
140            content_rect: NSRect,
141            style: NSWindowStyleMask,
142            backing_store_type: NSBackingStoreType,
143            flag: bool,
144            screen: Option<&NSScreen>,
145        ) -> Id<Self>;
146
147        #[cfg(feature = "Foundation_NSCoder")]
148        #[method_id(@__retain_semantics Init initWithCoder:)]
149        pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Id<Self>;
150
151        #[cfg(feature = "AppKit_NSViewController")]
152        #[method_id(@__retain_semantics Other windowWithContentViewController:)]
153        pub unsafe fn windowWithContentViewController(
154            content_view_controller: &NSViewController,
155        ) -> Id<Self>;
156    }
157);
158
159extern_methods!(
160    /// Methods declared on superclass `NSResponder`
161    #[cfg(feature = "AppKit_NSFontPanel")]
162    unsafe impl NSFontPanel {
163        #[method_id(@__retain_semantics Init init)]
164        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;
165    }
166);
167
168extern_methods!(
169    /// Methods declared on superclass `NSObject`
170    #[cfg(feature = "AppKit_NSFontPanel")]
171    unsafe impl NSFontPanel {
172        #[method_id(@__retain_semantics New new)]
173        pub unsafe fn new(mtm: MainThreadMarker) -> Id<Self>;
174    }
175);
176
177extern_enum!(
178    #[underlying(c_uint)]
179    pub enum __anonymous__ {
180        NSFontPanelFaceModeMask = 1 << 0,
181        NSFontPanelSizeModeMask = 1 << 1,
182        NSFontPanelCollectionModeMask = 1 << 2,
183        NSFontPanelUnderlineEffectModeMask = 1 << 8,
184        NSFontPanelStrikethroughEffectModeMask = 1 << 9,
185        NSFontPanelTextColorEffectModeMask = 1 << 10,
186        NSFontPanelDocumentColorEffectModeMask = 1 << 11,
187        NSFontPanelShadowEffectModeMask = 1 << 12,
188        NSFontPanelAllEffectsModeMask = 0xFFF00,
189        NSFontPanelStandardModesMask = 0xFFFF,
190        NSFontPanelAllModesMask = 0xFFFFFFFF,
191    }
192);
193
194extern_enum!(
195    #[underlying(c_uint)]
196    #[deprecated]
197    pub enum __anonymous__ {
198        NSFPPreviewButton = 131,
199        NSFPRevertButton = 130,
200        NSFPSetButton = 132,
201        NSFPPreviewField = 128,
202        NSFPSizeField = 129,
203        NSFPSizeTitle = 133,
204        NSFPCurrentField = 134,
205    }
206);