objc2_app_kit/generated/
NSFormCell.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::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12extern_class!(
13    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsformcell?language=objc)
14    #[unsafe(super(NSActionCell, NSCell, NSObject))]
15    #[derive(Debug, PartialEq, Eq, Hash)]
16    #[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
17    pub struct NSFormCell;
18);
19
20#[cfg(all(
21    feature = "NSAccessibilityProtocols",
22    feature = "NSActionCell",
23    feature = "NSCell"
24))]
25extern_conformance!(
26    unsafe impl NSAccessibility for NSFormCell {}
27);
28
29#[cfg(all(
30    feature = "NSAccessibilityProtocols",
31    feature = "NSActionCell",
32    feature = "NSCell"
33))]
34extern_conformance!(
35    unsafe impl NSAccessibilityElementProtocol for NSFormCell {}
36);
37
38#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
39extern_conformance!(
40    unsafe impl NSCoding for NSFormCell {}
41);
42
43#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
44extern_conformance!(
45    unsafe impl NSCopying for NSFormCell {}
46);
47
48#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
49unsafe impl CopyingHelper for NSFormCell {
50    type Result = Self;
51}
52
53#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
54extern_conformance!(
55    unsafe impl NSObjectProtocol for NSFormCell {}
56);
57
58#[cfg(all(
59    feature = "NSActionCell",
60    feature = "NSCell",
61    feature = "NSUserInterfaceItemIdentification"
62))]
63extern_conformance!(
64    unsafe impl NSUserInterfaceItemIdentification for NSFormCell {}
65);
66
67#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
68impl NSFormCell {
69    extern_methods!(
70        #[unsafe(method(initTextCell:))]
71        #[unsafe(method_family = init)]
72        pub fn initTextCell(this: Allocated<Self>, string: Option<&NSString>) -> Retained<Self>;
73
74        /// # Safety
75        ///
76        /// `coder` possibly has further requirements.
77        #[unsafe(method(initWithCoder:))]
78        #[unsafe(method_family = init)]
79        pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
80
81        #[cfg(feature = "NSImage")]
82        #[unsafe(method(initImageCell:))]
83        #[unsafe(method_family = init)]
84        pub unsafe fn initImageCell(
85            this: Allocated<Self>,
86            image: Option<&NSImage>,
87        ) -> Retained<Self>;
88
89        #[cfg(feature = "objc2-core-foundation")]
90        #[unsafe(method(titleWidth:))]
91        #[unsafe(method_family = none)]
92        pub fn titleWidth_(&self, size: NSSize) -> CGFloat;
93
94        #[cfg(feature = "objc2-core-foundation")]
95        #[unsafe(method(titleWidth))]
96        #[unsafe(method_family = none)]
97        pub fn titleWidth(&self) -> CGFloat;
98
99        #[cfg(feature = "objc2-core-foundation")]
100        /// Setter for [`titleWidth`][Self::titleWidth].
101        #[unsafe(method(setTitleWidth:))]
102        #[unsafe(method_family = none)]
103        pub fn setTitleWidth(&self, title_width: CGFloat);
104
105        #[unsafe(method(title))]
106        #[unsafe(method_family = none)]
107        pub fn title(&self) -> Retained<NSString>;
108
109        /// Setter for [`title`][Self::title].
110        ///
111        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
112        #[unsafe(method(setTitle:))]
113        #[unsafe(method_family = none)]
114        pub fn setTitle(&self, title: &NSString);
115
116        #[cfg(feature = "NSFont")]
117        #[unsafe(method(titleFont))]
118        #[unsafe(method_family = none)]
119        pub fn titleFont(&self) -> Retained<NSFont>;
120
121        #[cfg(feature = "NSFont")]
122        /// Setter for [`titleFont`][Self::titleFont].
123        #[unsafe(method(setTitleFont:))]
124        #[unsafe(method_family = none)]
125        pub fn setTitleFont(&self, title_font: &NSFont);
126
127        #[unsafe(method(isOpaque))]
128        #[unsafe(method_family = none)]
129        pub fn isOpaque(&self) -> bool;
130
131        #[unsafe(method(placeholderString))]
132        #[unsafe(method_family = none)]
133        pub fn placeholderString(&self) -> Option<Retained<NSString>>;
134
135        /// Setter for [`placeholderString`][Self::placeholderString].
136        ///
137        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
138        #[unsafe(method(setPlaceholderString:))]
139        #[unsafe(method_family = none)]
140        pub fn setPlaceholderString(&self, placeholder_string: Option<&NSString>);
141
142        #[unsafe(method(placeholderAttributedString))]
143        #[unsafe(method_family = none)]
144        pub fn placeholderAttributedString(&self) -> Option<Retained<NSAttributedString>>;
145
146        /// Setter for [`placeholderAttributedString`][Self::placeholderAttributedString].
147        ///
148        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
149        #[unsafe(method(setPlaceholderAttributedString:))]
150        #[unsafe(method_family = none)]
151        pub fn setPlaceholderAttributedString(
152            &self,
153            placeholder_attributed_string: Option<&NSAttributedString>,
154        );
155
156        #[cfg(feature = "NSText")]
157        #[unsafe(method(titleAlignment))]
158        #[unsafe(method_family = none)]
159        pub fn titleAlignment(&self) -> NSTextAlignment;
160
161        #[cfg(feature = "NSText")]
162        /// Setter for [`titleAlignment`][Self::titleAlignment].
163        #[unsafe(method(setTitleAlignment:))]
164        #[unsafe(method_family = none)]
165        pub fn setTitleAlignment(&self, title_alignment: NSTextAlignment);
166
167        #[cfg(feature = "NSText")]
168        #[unsafe(method(titleBaseWritingDirection))]
169        #[unsafe(method_family = none)]
170        pub fn titleBaseWritingDirection(&self) -> NSWritingDirection;
171
172        #[cfg(feature = "NSText")]
173        /// Setter for [`titleBaseWritingDirection`][Self::titleBaseWritingDirection].
174        #[unsafe(method(setTitleBaseWritingDirection:))]
175        #[unsafe(method_family = none)]
176        pub fn setTitleBaseWritingDirection(
177            &self,
178            title_base_writing_direction: NSWritingDirection,
179        );
180
181        #[cfg(feature = "objc2-core-foundation")]
182        #[unsafe(method(preferredTextFieldWidth))]
183        #[unsafe(method_family = none)]
184        pub fn preferredTextFieldWidth(&self) -> CGFloat;
185
186        #[cfg(feature = "objc2-core-foundation")]
187        /// Setter for [`preferredTextFieldWidth`][Self::preferredTextFieldWidth].
188        #[unsafe(method(setPreferredTextFieldWidth:))]
189        #[unsafe(method_family = none)]
190        pub fn setPreferredTextFieldWidth(&self, preferred_text_field_width: CGFloat);
191    );
192}
193
194/// Methods declared on superclass `NSCell`.
195#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
196impl NSFormCell {
197    extern_methods!(
198        #[unsafe(method(init))]
199        #[unsafe(method_family = init)]
200        pub fn init(this: Allocated<Self>) -> Retained<Self>;
201    );
202}
203
204/// Methods declared on superclass `NSObject`.
205#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
206impl NSFormCell {
207    extern_methods!(
208        #[unsafe(method(new))]
209        #[unsafe(method_family = new)]
210        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
211    );
212}
213
214/// NSKeyboardUI.
215#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
216impl NSFormCell {
217    extern_methods!(
218        /// # Safety
219        ///
220        /// `string_with_ampersand` might not allow `None`.
221        #[deprecated]
222        #[unsafe(method(setTitleWithMnemonic:))]
223        #[unsafe(method_family = none)]
224        pub unsafe fn setTitleWithMnemonic(&self, string_with_ampersand: Option<&NSString>);
225    );
226}
227
228/// NSFormCellAttributedStringMethods.
229#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
230impl NSFormCell {
231    extern_methods!(
232        #[unsafe(method(attributedTitle))]
233        #[unsafe(method_family = none)]
234        pub fn attributedTitle(&self) -> Retained<NSAttributedString>;
235
236        /// Setter for [`attributedTitle`][Self::attributedTitle].
237        ///
238        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
239        #[unsafe(method(setAttributedTitle:))]
240        #[unsafe(method_family = none)]
241        pub fn setAttributedTitle(&self, attributed_title: &NSAttributedString);
242    );
243}