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))]
40extern_conformance!(
41    unsafe impl NSAccessibility for NSSearchFieldCell {}
42);
43
44#[cfg(all(
45    feature = "NSAccessibilityProtocols",
46    feature = "NSActionCell",
47    feature = "NSCell",
48    feature = "NSTextFieldCell"
49))]
50extern_conformance!(
51    unsafe impl NSAccessibilityElementProtocol for NSSearchFieldCell {}
52);
53
54#[cfg(all(
55    feature = "NSActionCell",
56    feature = "NSCell",
57    feature = "NSTextFieldCell"
58))]
59extern_conformance!(
60    unsafe impl NSCoding for NSSearchFieldCell {}
61);
62
63#[cfg(all(
64    feature = "NSActionCell",
65    feature = "NSCell",
66    feature = "NSTextFieldCell"
67))]
68extern_conformance!(
69    unsafe impl NSCopying for NSSearchFieldCell {}
70);
71
72#[cfg(all(
73    feature = "NSActionCell",
74    feature = "NSCell",
75    feature = "NSTextFieldCell"
76))]
77unsafe impl CopyingHelper for NSSearchFieldCell {
78    type Result = Self;
79}
80
81#[cfg(all(
82    feature = "NSActionCell",
83    feature = "NSCell",
84    feature = "NSTextFieldCell"
85))]
86extern_conformance!(
87    unsafe impl NSObjectProtocol for NSSearchFieldCell {}
88);
89
90#[cfg(all(
91    feature = "NSActionCell",
92    feature = "NSCell",
93    feature = "NSTextFieldCell",
94    feature = "NSUserInterfaceItemIdentification"
95))]
96extern_conformance!(
97    unsafe impl NSUserInterfaceItemIdentification for NSSearchFieldCell {}
98);
99
100#[cfg(all(
101    feature = "NSActionCell",
102    feature = "NSCell",
103    feature = "NSTextFieldCell"
104))]
105impl NSSearchFieldCell {
106    extern_methods!(
107        #[unsafe(method(initTextCell:))]
108        #[unsafe(method_family = init)]
109        pub unsafe fn initTextCell(this: Allocated<Self>, string: &NSString) -> Retained<Self>;
110
111        #[unsafe(method(initWithCoder:))]
112        #[unsafe(method_family = init)]
113        pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
114
115        #[cfg(feature = "NSImage")]
116        #[unsafe(method(initImageCell:))]
117        #[unsafe(method_family = init)]
118        pub unsafe fn initImageCell(
119            this: Allocated<Self>,
120            image: Option<&NSImage>,
121        ) -> Retained<Self>;
122
123        #[cfg(feature = "NSButtonCell")]
124        #[unsafe(method(searchButtonCell))]
125        #[unsafe(method_family = none)]
126        pub unsafe fn searchButtonCell(&self) -> Option<Retained<NSButtonCell>>;
127
128        #[cfg(feature = "NSButtonCell")]
129        /// Setter for [`searchButtonCell`][Self::searchButtonCell].
130        #[unsafe(method(setSearchButtonCell:))]
131        #[unsafe(method_family = none)]
132        pub unsafe fn setSearchButtonCell(&self, search_button_cell: Option<&NSButtonCell>);
133
134        #[cfg(feature = "NSButtonCell")]
135        #[unsafe(method(cancelButtonCell))]
136        #[unsafe(method_family = none)]
137        pub unsafe fn cancelButtonCell(&self) -> Option<Retained<NSButtonCell>>;
138
139        #[cfg(feature = "NSButtonCell")]
140        /// Setter for [`cancelButtonCell`][Self::cancelButtonCell].
141        #[unsafe(method(setCancelButtonCell:))]
142        #[unsafe(method_family = none)]
143        pub unsafe fn setCancelButtonCell(&self, cancel_button_cell: Option<&NSButtonCell>);
144
145        #[unsafe(method(resetSearchButtonCell))]
146        #[unsafe(method_family = none)]
147        pub unsafe fn resetSearchButtonCell(&self);
148
149        #[unsafe(method(resetCancelButtonCell))]
150        #[unsafe(method_family = none)]
151        pub unsafe fn resetCancelButtonCell(&self);
152
153        #[unsafe(method(searchTextRectForBounds:))]
154        #[unsafe(method_family = none)]
155        pub unsafe fn searchTextRectForBounds(&self, rect: NSRect) -> NSRect;
156
157        #[unsafe(method(searchButtonRectForBounds:))]
158        #[unsafe(method_family = none)]
159        pub unsafe fn searchButtonRectForBounds(&self, rect: NSRect) -> NSRect;
160
161        #[unsafe(method(cancelButtonRectForBounds:))]
162        #[unsafe(method_family = none)]
163        pub unsafe fn cancelButtonRectForBounds(&self, rect: NSRect) -> NSRect;
164
165        #[cfg(feature = "NSMenu")]
166        #[unsafe(method(searchMenuTemplate))]
167        #[unsafe(method_family = none)]
168        pub unsafe fn searchMenuTemplate(&self) -> Option<Retained<NSMenu>>;
169
170        #[cfg(feature = "NSMenu")]
171        /// Setter for [`searchMenuTemplate`][Self::searchMenuTemplate].
172        #[unsafe(method(setSearchMenuTemplate:))]
173        #[unsafe(method_family = none)]
174        pub unsafe fn setSearchMenuTemplate(&self, search_menu_template: Option<&NSMenu>);
175
176        #[unsafe(method(sendsWholeSearchString))]
177        #[unsafe(method_family = none)]
178        pub unsafe fn sendsWholeSearchString(&self) -> bool;
179
180        /// Setter for [`sendsWholeSearchString`][Self::sendsWholeSearchString].
181        #[unsafe(method(setSendsWholeSearchString:))]
182        #[unsafe(method_family = none)]
183        pub unsafe fn setSendsWholeSearchString(&self, sends_whole_search_string: bool);
184
185        #[unsafe(method(maximumRecents))]
186        #[unsafe(method_family = none)]
187        pub unsafe fn maximumRecents(&self) -> NSInteger;
188
189        /// Setter for [`maximumRecents`][Self::maximumRecents].
190        #[unsafe(method(setMaximumRecents:))]
191        #[unsafe(method_family = none)]
192        pub unsafe fn setMaximumRecents(&self, maximum_recents: NSInteger);
193
194        #[unsafe(method(recentSearches))]
195        #[unsafe(method_family = none)]
196        pub unsafe fn recentSearches(&self) -> Retained<NSArray<NSString>>;
197
198        /// Setter for [`recentSearches`][Self::recentSearches].
199        #[unsafe(method(setRecentSearches:))]
200        #[unsafe(method_family = none)]
201        pub unsafe fn setRecentSearches(&self, recent_searches: Option<&NSArray<NSString>>);
202
203        #[cfg(feature = "NSSearchField")]
204        #[unsafe(method(recentsAutosaveName))]
205        #[unsafe(method_family = none)]
206        pub unsafe fn recentsAutosaveName(
207            &self,
208        ) -> Option<Retained<NSSearchFieldRecentsAutosaveName>>;
209
210        #[cfg(feature = "NSSearchField")]
211        /// Setter for [`recentsAutosaveName`][Self::recentsAutosaveName].
212        #[unsafe(method(setRecentsAutosaveName:))]
213        #[unsafe(method_family = none)]
214        pub unsafe fn setRecentsAutosaveName(
215            &self,
216            recents_autosave_name: Option<&NSSearchFieldRecentsAutosaveName>,
217        );
218
219        #[unsafe(method(sendsSearchStringImmediately))]
220        #[unsafe(method_family = none)]
221        pub unsafe fn sendsSearchStringImmediately(&self) -> bool;
222
223        /// Setter for [`sendsSearchStringImmediately`][Self::sendsSearchStringImmediately].
224        #[unsafe(method(setSendsSearchStringImmediately:))]
225        #[unsafe(method_family = none)]
226        pub unsafe fn setSendsSearchStringImmediately(&self, sends_search_string_immediately: bool);
227    );
228}
229
230/// Methods declared on superclass `NSCell`.
231#[cfg(all(
232    feature = "NSActionCell",
233    feature = "NSCell",
234    feature = "NSTextFieldCell"
235))]
236impl NSSearchFieldCell {
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/// Methods declared on superclass `NSObject`.
245#[cfg(all(
246    feature = "NSActionCell",
247    feature = "NSCell",
248    feature = "NSTextFieldCell"
249))]
250impl NSSearchFieldCell {
251    extern_methods!(
252        #[unsafe(method(new))]
253        #[unsafe(method_family = new)]
254        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
255    );
256}