objc2_app_kit/generated/
NSSearchFieldCell.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::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nssearchfieldrecentstitlemenuitemtag?language=objc)
11pub static NSSearchFieldRecentsTitleMenuItemTag: NSInteger = 1000;
12
13/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nssearchfieldrecentsmenuitemtag?language=objc)
14pub static NSSearchFieldRecentsMenuItemTag: NSInteger = 1001;
15
16/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nssearchfieldclearrecentsmenuitemtag?language=objc)
17pub static NSSearchFieldClearRecentsMenuItemTag: NSInteger = 1002;
18
19/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nssearchfieldnorecentsmenuitemtag?language=objc)
20pub static NSSearchFieldNoRecentsMenuItemTag: NSInteger = 1003;
21
22extern_class!(
23    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nssearchfieldcell?language=objc)
24    #[unsafe(super(NSTextFieldCell, NSActionCell, NSCell, NSObject))]
25    #[derive(Debug, PartialEq, Eq, Hash)]
26    #[cfg(all(
27        feature = "NSActionCell",
28        feature = "NSCell",
29        feature = "NSTextFieldCell"
30    ))]
31    pub struct NSSearchFieldCell;
32);
33
34#[cfg(all(
35    feature = "NSAccessibilityProtocols",
36    feature = "NSActionCell",
37    feature = "NSCell",
38    feature = "NSTextFieldCell"
39))]
40unsafe impl NSAccessibility for NSSearchFieldCell {}
41
42#[cfg(all(
43    feature = "NSAccessibilityProtocols",
44    feature = "NSActionCell",
45    feature = "NSCell",
46    feature = "NSTextFieldCell"
47))]
48unsafe impl NSAccessibilityElementProtocol for NSSearchFieldCell {}
49
50#[cfg(all(
51    feature = "NSActionCell",
52    feature = "NSCell",
53    feature = "NSTextFieldCell"
54))]
55unsafe impl NSCoding for NSSearchFieldCell {}
56
57#[cfg(all(
58    feature = "NSActionCell",
59    feature = "NSCell",
60    feature = "NSTextFieldCell"
61))]
62unsafe impl NSCopying for NSSearchFieldCell {}
63
64#[cfg(all(
65    feature = "NSActionCell",
66    feature = "NSCell",
67    feature = "NSTextFieldCell"
68))]
69unsafe impl CopyingHelper for NSSearchFieldCell {
70    type Result = Self;
71}
72
73#[cfg(all(
74    feature = "NSActionCell",
75    feature = "NSCell",
76    feature = "NSTextFieldCell"
77))]
78unsafe impl NSObjectProtocol for NSSearchFieldCell {}
79
80#[cfg(all(
81    feature = "NSActionCell",
82    feature = "NSCell",
83    feature = "NSTextFieldCell",
84    feature = "NSUserInterfaceItemIdentification"
85))]
86unsafe impl NSUserInterfaceItemIdentification for NSSearchFieldCell {}
87
88#[cfg(all(
89    feature = "NSActionCell",
90    feature = "NSCell",
91    feature = "NSTextFieldCell"
92))]
93impl NSSearchFieldCell {
94    extern_methods!(
95        #[unsafe(method(initTextCell:))]
96        #[unsafe(method_family = init)]
97        pub unsafe fn initTextCell(this: Allocated<Self>, string: &NSString) -> Retained<Self>;
98
99        #[unsafe(method(initWithCoder:))]
100        #[unsafe(method_family = init)]
101        pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
102
103        #[cfg(feature = "NSImage")]
104        #[unsafe(method(initImageCell:))]
105        #[unsafe(method_family = init)]
106        pub unsafe fn initImageCell(
107            this: Allocated<Self>,
108            image: Option<&NSImage>,
109        ) -> Retained<Self>;
110
111        #[cfg(feature = "NSButtonCell")]
112        #[unsafe(method(searchButtonCell))]
113        #[unsafe(method_family = none)]
114        pub unsafe fn searchButtonCell(&self) -> Option<Retained<NSButtonCell>>;
115
116        #[cfg(feature = "NSButtonCell")]
117        /// Setter for [`searchButtonCell`][Self::searchButtonCell].
118        #[unsafe(method(setSearchButtonCell:))]
119        #[unsafe(method_family = none)]
120        pub unsafe fn setSearchButtonCell(&self, search_button_cell: Option<&NSButtonCell>);
121
122        #[cfg(feature = "NSButtonCell")]
123        #[unsafe(method(cancelButtonCell))]
124        #[unsafe(method_family = none)]
125        pub unsafe fn cancelButtonCell(&self) -> Option<Retained<NSButtonCell>>;
126
127        #[cfg(feature = "NSButtonCell")]
128        /// Setter for [`cancelButtonCell`][Self::cancelButtonCell].
129        #[unsafe(method(setCancelButtonCell:))]
130        #[unsafe(method_family = none)]
131        pub unsafe fn setCancelButtonCell(&self, cancel_button_cell: Option<&NSButtonCell>);
132
133        #[unsafe(method(resetSearchButtonCell))]
134        #[unsafe(method_family = none)]
135        pub unsafe fn resetSearchButtonCell(&self);
136
137        #[unsafe(method(resetCancelButtonCell))]
138        #[unsafe(method_family = none)]
139        pub unsafe fn resetCancelButtonCell(&self);
140
141        #[unsafe(method(searchTextRectForBounds:))]
142        #[unsafe(method_family = none)]
143        pub unsafe fn searchTextRectForBounds(&self, rect: NSRect) -> NSRect;
144
145        #[unsafe(method(searchButtonRectForBounds:))]
146        #[unsafe(method_family = none)]
147        pub unsafe fn searchButtonRectForBounds(&self, rect: NSRect) -> NSRect;
148
149        #[unsafe(method(cancelButtonRectForBounds:))]
150        #[unsafe(method_family = none)]
151        pub unsafe fn cancelButtonRectForBounds(&self, rect: NSRect) -> NSRect;
152
153        #[cfg(feature = "NSMenu")]
154        #[unsafe(method(searchMenuTemplate))]
155        #[unsafe(method_family = none)]
156        pub unsafe fn searchMenuTemplate(&self) -> Option<Retained<NSMenu>>;
157
158        #[cfg(feature = "NSMenu")]
159        /// Setter for [`searchMenuTemplate`][Self::searchMenuTemplate].
160        #[unsafe(method(setSearchMenuTemplate:))]
161        #[unsafe(method_family = none)]
162        pub unsafe fn setSearchMenuTemplate(&self, search_menu_template: Option<&NSMenu>);
163
164        #[unsafe(method(sendsWholeSearchString))]
165        #[unsafe(method_family = none)]
166        pub unsafe fn sendsWholeSearchString(&self) -> bool;
167
168        /// Setter for [`sendsWholeSearchString`][Self::sendsWholeSearchString].
169        #[unsafe(method(setSendsWholeSearchString:))]
170        #[unsafe(method_family = none)]
171        pub unsafe fn setSendsWholeSearchString(&self, sends_whole_search_string: bool);
172
173        #[unsafe(method(maximumRecents))]
174        #[unsafe(method_family = none)]
175        pub unsafe fn maximumRecents(&self) -> NSInteger;
176
177        /// Setter for [`maximumRecents`][Self::maximumRecents].
178        #[unsafe(method(setMaximumRecents:))]
179        #[unsafe(method_family = none)]
180        pub unsafe fn setMaximumRecents(&self, maximum_recents: NSInteger);
181
182        #[unsafe(method(recentSearches))]
183        #[unsafe(method_family = none)]
184        pub unsafe fn recentSearches(&self) -> Retained<NSArray<NSString>>;
185
186        /// Setter for [`recentSearches`][Self::recentSearches].
187        #[unsafe(method(setRecentSearches:))]
188        #[unsafe(method_family = none)]
189        pub unsafe fn setRecentSearches(&self, recent_searches: Option<&NSArray<NSString>>);
190
191        #[cfg(feature = "NSSearchField")]
192        #[unsafe(method(recentsAutosaveName))]
193        #[unsafe(method_family = none)]
194        pub unsafe fn recentsAutosaveName(
195            &self,
196        ) -> Option<Retained<NSSearchFieldRecentsAutosaveName>>;
197
198        #[cfg(feature = "NSSearchField")]
199        /// Setter for [`recentsAutosaveName`][Self::recentsAutosaveName].
200        #[unsafe(method(setRecentsAutosaveName:))]
201        #[unsafe(method_family = none)]
202        pub unsafe fn setRecentsAutosaveName(
203            &self,
204            recents_autosave_name: Option<&NSSearchFieldRecentsAutosaveName>,
205        );
206
207        #[unsafe(method(sendsSearchStringImmediately))]
208        #[unsafe(method_family = none)]
209        pub unsafe fn sendsSearchStringImmediately(&self) -> bool;
210
211        /// Setter for [`sendsSearchStringImmediately`][Self::sendsSearchStringImmediately].
212        #[unsafe(method(setSendsSearchStringImmediately:))]
213        #[unsafe(method_family = none)]
214        pub unsafe fn setSendsSearchStringImmediately(&self, sends_search_string_immediately: bool);
215    );
216}
217
218/// Methods declared on superclass `NSCell`.
219#[cfg(all(
220    feature = "NSActionCell",
221    feature = "NSCell",
222    feature = "NSTextFieldCell"
223))]
224impl NSSearchFieldCell {
225    extern_methods!(
226        #[unsafe(method(init))]
227        #[unsafe(method_family = init)]
228        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
229    );
230}
231
232/// Methods declared on superclass `NSObject`.
233#[cfg(all(
234    feature = "NSActionCell",
235    feature = "NSCell",
236    feature = "NSTextFieldCell"
237))]
238impl NSSearchFieldCell {
239    extern_methods!(
240        #[unsafe(method(new))]
241        #[unsafe(method_family = new)]
242        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
243    );
244}