icrate/generated/AppKit/
NSForm.rs1use crate::common::*;
4use crate::AppKit::*;
5use crate::CoreData::*;
6use crate::Foundation::*;
7
8extern_class!(
9 #[derive(Debug, PartialEq, Eq, Hash)]
10 #[cfg(feature = "AppKit_NSForm")]
11 #[deprecated = "Use NSTextField directly instead, and consider NSStackView for layout assistance"]
12 pub struct NSForm;
13
14 #[cfg(feature = "AppKit_NSForm")]
15 unsafe impl ClassType for NSForm {
16 #[inherits(NSControl, NSView, NSResponder, NSObject)]
17 type Super = NSMatrix;
18 type Mutability = MainThreadOnly;
19 }
20);
21
22#[cfg(feature = "AppKit_NSForm")]
23unsafe impl NSAccessibility for NSForm {}
24
25#[cfg(feature = "AppKit_NSForm")]
26unsafe impl NSAccessibilityElementProtocol for NSForm {}
27
28#[cfg(feature = "AppKit_NSForm")]
29unsafe impl NSAnimatablePropertyContainer for NSForm {}
30
31#[cfg(feature = "AppKit_NSForm")]
32unsafe impl NSAppearanceCustomization for NSForm {}
33
34#[cfg(feature = "AppKit_NSForm")]
35unsafe impl NSCoding for NSForm {}
36
37#[cfg(feature = "AppKit_NSForm")]
38unsafe impl NSDraggingDestination for NSForm {}
39
40#[cfg(feature = "AppKit_NSForm")]
41unsafe impl NSObjectProtocol for NSForm {}
42
43#[cfg(feature = "AppKit_NSForm")]
44unsafe impl NSUserInterfaceItemIdentification for NSForm {}
45
46#[cfg(feature = "AppKit_NSForm")]
47unsafe impl NSUserInterfaceValidations for NSForm {}
48
49#[cfg(feature = "AppKit_NSForm")]
50unsafe impl NSViewToolTipOwner for NSForm {}
51
52extern_methods!(
53 #[cfg(feature = "AppKit_NSForm")]
54 unsafe impl NSForm {
55 #[method(indexOfSelectedItem)]
56 pub unsafe fn indexOfSelectedItem(&self) -> NSInteger;
57
58 #[method(setEntryWidth:)]
59 pub unsafe fn setEntryWidth(&self, width: CGFloat);
60
61 #[method(setInterlineSpacing:)]
62 pub unsafe fn setInterlineSpacing(&self, spacing: CGFloat);
63
64 #[method(setBordered:)]
65 pub unsafe fn setBordered(&self, flag: bool);
66
67 #[method(setBezeled:)]
68 pub unsafe fn setBezeled(&self, flag: bool);
69
70 #[method(setTitleAlignment:)]
71 pub unsafe fn setTitleAlignment(&self, mode: NSTextAlignment);
72
73 #[method(setTextAlignment:)]
74 pub unsafe fn setTextAlignment(&self, mode: NSTextAlignment);
75
76 #[cfg(feature = "AppKit_NSFont")]
77 #[method(setTitleFont:)]
78 pub unsafe fn setTitleFont(&self, font_obj: &NSFont);
79
80 #[cfg(feature = "AppKit_NSFont")]
81 #[method(setTextFont:)]
82 pub unsafe fn setTextFont(&self, font_obj: &NSFont);
83
84 #[method_id(@__retain_semantics Other cellAtIndex:)]
85 pub unsafe fn cellAtIndex(&self, index: NSInteger) -> Option<Id<AnyObject>>;
86
87 #[method(drawCellAtIndex:)]
88 pub unsafe fn drawCellAtIndex(&self, index: NSInteger);
89
90 #[cfg(all(feature = "AppKit_NSFormCell", feature = "Foundation_NSString"))]
91 #[method_id(@__retain_semantics Other addEntry:)]
92 pub unsafe fn addEntry(&self, title: &NSString) -> Id<NSFormCell>;
93
94 #[cfg(all(feature = "AppKit_NSFormCell", feature = "Foundation_NSString"))]
95 #[method_id(@__retain_semantics Other insertEntry:atIndex:)]
96 pub unsafe fn insertEntry_atIndex(
97 &self,
98 title: &NSString,
99 index: NSInteger,
100 ) -> Option<Id<NSFormCell>>;
101
102 #[method(removeEntryAtIndex:)]
103 pub unsafe fn removeEntryAtIndex(&self, index: NSInteger);
104
105 #[method(indexOfCellWithTag:)]
106 pub unsafe fn indexOfCellWithTag(&self, tag: NSInteger) -> NSInteger;
107
108 #[method(selectTextAtIndex:)]
109 pub unsafe fn selectTextAtIndex(&self, index: NSInteger);
110
111 #[method(setFrameSize:)]
112 pub unsafe fn setFrameSize(&self, new_size: NSSize);
113
114 #[method(setTitleBaseWritingDirection:)]
115 pub unsafe fn setTitleBaseWritingDirection(&self, writing_direction: NSWritingDirection);
116
117 #[method(setTextBaseWritingDirection:)]
118 pub unsafe fn setTextBaseWritingDirection(&self, writing_direction: NSWritingDirection);
119
120 #[method(setPreferredTextFieldWidth:)]
121 pub unsafe fn setPreferredTextFieldWidth(&self, preferred_width: CGFloat);
122
123 #[method(preferredTextFieldWidth)]
124 pub unsafe fn preferredTextFieldWidth(&self) -> CGFloat;
125 }
126);
127
128extern_methods!(
129 #[cfg(feature = "AppKit_NSForm")]
131 unsafe impl NSForm {
132 #[method_id(@__retain_semantics Init initWithFrame:)]
133 pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Id<Self>;
134
135 #[cfg(feature = "AppKit_NSCell")]
136 #[method_id(@__retain_semantics Init initWithFrame:mode:prototype:numberOfRows:numberOfColumns:)]
137 pub unsafe fn initWithFrame_mode_prototype_numberOfRows_numberOfColumns(
138 this: Allocated<Self>,
139 frame_rect: NSRect,
140 mode: NSMatrixMode,
141 cell: &NSCell,
142 rows_high: NSInteger,
143 cols_wide: NSInteger,
144 ) -> Id<Self>;
145
146 #[method_id(@__retain_semantics Init initWithFrame:mode:cellClass:numberOfRows:numberOfColumns:)]
147 pub unsafe fn initWithFrame_mode_cellClass_numberOfRows_numberOfColumns(
148 this: Allocated<Self>,
149 frame_rect: NSRect,
150 mode: NSMatrixMode,
151 factory_id: Option<&AnyClass>,
152 rows_high: NSInteger,
153 cols_wide: NSInteger,
154 ) -> Id<Self>;
155 }
156);
157
158extern_methods!(
159 #[cfg(feature = "AppKit_NSForm")]
161 unsafe impl NSForm {
162 #[cfg(feature = "Foundation_NSCoder")]
163 #[method_id(@__retain_semantics Init initWithCoder:)]
164 pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Option<Id<Self>>;
165 }
166);
167
168extern_methods!(
169 #[cfg(feature = "AppKit_NSForm")]
171 unsafe impl NSForm {
172 #[method_id(@__retain_semantics Init init)]
173 pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;
174 }
175);
176
177extern_methods!(
178 #[cfg(feature = "AppKit_NSForm")]
180 unsafe impl NSForm {
181 #[method_id(@__retain_semantics New new)]
182 pub unsafe fn new(mtm: MainThreadMarker) -> Id<Self>;
183 }
184);