objc2_app_kit/generated/
NSTextField.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/nstextfield?language=objc)
14    #[unsafe(super(NSControl, NSView, NSResponder, NSObject))]
15    #[derive(Debug, PartialEq, Eq, Hash)]
16    #[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
17    pub struct NSTextField;
18);
19
20#[cfg(all(
21    feature = "NSAccessibilityProtocols",
22    feature = "NSControl",
23    feature = "NSResponder",
24    feature = "NSView"
25))]
26extern_conformance!(
27    unsafe impl NSAccessibility for NSTextField {}
28);
29
30#[cfg(all(
31    feature = "NSAccessibilityProtocols",
32    feature = "NSControl",
33    feature = "NSResponder",
34    feature = "NSView"
35))]
36extern_conformance!(
37    unsafe impl NSAccessibilityElementProtocol for NSTextField {}
38);
39
40#[cfg(all(
41    feature = "NSAccessibilityProtocols",
42    feature = "NSControl",
43    feature = "NSResponder",
44    feature = "NSView"
45))]
46extern_conformance!(
47    unsafe impl NSAccessibilityNavigableStaticText for NSTextField {}
48);
49
50#[cfg(all(
51    feature = "NSAccessibilityProtocols",
52    feature = "NSControl",
53    feature = "NSResponder",
54    feature = "NSView"
55))]
56extern_conformance!(
57    unsafe impl NSAccessibilityStaticText for NSTextField {}
58);
59
60#[cfg(all(
61    feature = "NSAnimation",
62    feature = "NSControl",
63    feature = "NSResponder",
64    feature = "NSView"
65))]
66extern_conformance!(
67    unsafe impl NSAnimatablePropertyContainer for NSTextField {}
68);
69
70#[cfg(all(
71    feature = "NSAppearance",
72    feature = "NSControl",
73    feature = "NSResponder",
74    feature = "NSView"
75))]
76extern_conformance!(
77    unsafe impl NSAppearanceCustomization for NSTextField {}
78);
79
80#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
81extern_conformance!(
82    unsafe impl NSCoding for NSTextField {}
83);
84
85#[cfg(all(
86    feature = "NSControl",
87    feature = "NSDragging",
88    feature = "NSResponder",
89    feature = "NSView"
90))]
91extern_conformance!(
92    unsafe impl NSDraggingDestination for NSTextField {}
93);
94
95#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
96extern_conformance!(
97    unsafe impl NSObjectProtocol for NSTextField {}
98);
99
100#[cfg(all(
101    feature = "NSControl",
102    feature = "NSResponder",
103    feature = "NSTextContent",
104    feature = "NSView"
105))]
106extern_conformance!(
107    unsafe impl NSTextContent for NSTextField {}
108);
109
110#[cfg(all(
111    feature = "NSControl",
112    feature = "NSResponder",
113    feature = "NSUserInterfaceItemIdentification",
114    feature = "NSView"
115))]
116extern_conformance!(
117    unsafe impl NSUserInterfaceItemIdentification for NSTextField {}
118);
119
120#[cfg(all(
121    feature = "NSControl",
122    feature = "NSResponder",
123    feature = "NSUserInterfaceValidation",
124    feature = "NSView"
125))]
126extern_conformance!(
127    unsafe impl NSUserInterfaceValidations for NSTextField {}
128);
129
130#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
131impl NSTextField {
132    extern_methods!(
133        #[unsafe(method(placeholderString))]
134        #[unsafe(method_family = none)]
135        pub fn placeholderString(&self) -> Option<Retained<NSString>>;
136
137        /// Setter for [`placeholderString`][Self::placeholderString].
138        ///
139        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
140        #[unsafe(method(setPlaceholderString:))]
141        #[unsafe(method_family = none)]
142        pub fn setPlaceholderString(&self, placeholder_string: Option<&NSString>);
143
144        #[unsafe(method(placeholderAttributedString))]
145        #[unsafe(method_family = none)]
146        pub fn placeholderAttributedString(&self) -> Option<Retained<NSAttributedString>>;
147
148        /// Setter for [`placeholderAttributedString`][Self::placeholderAttributedString].
149        ///
150        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
151        #[unsafe(method(setPlaceholderAttributedString:))]
152        #[unsafe(method_family = none)]
153        pub fn setPlaceholderAttributedString(
154            &self,
155            placeholder_attributed_string: Option<&NSAttributedString>,
156        );
157
158        #[cfg(feature = "NSColor")]
159        #[unsafe(method(backgroundColor))]
160        #[unsafe(method_family = none)]
161        pub fn backgroundColor(&self) -> Option<Retained<NSColor>>;
162
163        #[cfg(feature = "NSColor")]
164        /// Setter for [`backgroundColor`][Self::backgroundColor].
165        ///
166        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
167        #[unsafe(method(setBackgroundColor:))]
168        #[unsafe(method_family = none)]
169        pub fn setBackgroundColor(&self, background_color: Option<&NSColor>);
170
171        #[unsafe(method(drawsBackground))]
172        #[unsafe(method_family = none)]
173        pub fn drawsBackground(&self) -> bool;
174
175        /// Setter for [`drawsBackground`][Self::drawsBackground].
176        #[unsafe(method(setDrawsBackground:))]
177        #[unsafe(method_family = none)]
178        pub fn setDrawsBackground(&self, draws_background: bool);
179
180        #[cfg(feature = "NSColor")]
181        #[unsafe(method(textColor))]
182        #[unsafe(method_family = none)]
183        pub fn textColor(&self) -> Option<Retained<NSColor>>;
184
185        #[cfg(feature = "NSColor")]
186        /// Setter for [`textColor`][Self::textColor].
187        ///
188        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
189        #[unsafe(method(setTextColor:))]
190        #[unsafe(method_family = none)]
191        pub fn setTextColor(&self, text_color: Option<&NSColor>);
192
193        #[unsafe(method(isBordered))]
194        #[unsafe(method_family = none)]
195        pub fn isBordered(&self) -> bool;
196
197        /// Setter for [`isBordered`][Self::isBordered].
198        #[unsafe(method(setBordered:))]
199        #[unsafe(method_family = none)]
200        pub fn setBordered(&self, bordered: bool);
201
202        #[unsafe(method(isBezeled))]
203        #[unsafe(method_family = none)]
204        pub fn isBezeled(&self) -> bool;
205
206        /// Setter for [`isBezeled`][Self::isBezeled].
207        #[unsafe(method(setBezeled:))]
208        #[unsafe(method_family = none)]
209        pub fn setBezeled(&self, bezeled: bool);
210
211        #[unsafe(method(isEditable))]
212        #[unsafe(method_family = none)]
213        pub fn isEditable(&self) -> bool;
214
215        /// Setter for [`isEditable`][Self::isEditable].
216        #[unsafe(method(setEditable:))]
217        #[unsafe(method_family = none)]
218        pub fn setEditable(&self, editable: bool);
219
220        #[unsafe(method(isSelectable))]
221        #[unsafe(method_family = none)]
222        pub fn isSelectable(&self) -> bool;
223
224        /// Setter for [`isSelectable`][Self::isSelectable].
225        #[unsafe(method(setSelectable:))]
226        #[unsafe(method_family = none)]
227        pub fn setSelectable(&self, selectable: bool);
228
229        /// # Safety
230        ///
231        /// `sender` should be of the correct type.
232        #[unsafe(method(selectText:))]
233        #[unsafe(method_family = none)]
234        pub unsafe fn selectText(&self, sender: Option<&AnyObject>);
235
236        #[unsafe(method(delegate))]
237        #[unsafe(method_family = none)]
238        pub fn delegate(&self) -> Option<Retained<ProtocolObject<dyn NSTextFieldDelegate>>>;
239
240        /// Setter for [`delegate`][Self::delegate].
241        ///
242        /// This is a [weak property][objc2::topics::weak_property].
243        #[unsafe(method(setDelegate:))]
244        #[unsafe(method_family = none)]
245        pub unsafe fn setDelegate(
246            &self,
247            delegate: Option<&ProtocolObject<dyn NSTextFieldDelegate>>,
248        );
249
250        #[cfg(feature = "NSText")]
251        #[unsafe(method(textShouldBeginEditing:))]
252        #[unsafe(method_family = none)]
253        pub fn textShouldBeginEditing(&self, text_object: &NSText) -> bool;
254
255        #[cfg(feature = "NSText")]
256        #[unsafe(method(textShouldEndEditing:))]
257        #[unsafe(method_family = none)]
258        pub fn textShouldEndEditing(&self, text_object: &NSText) -> bool;
259
260        #[unsafe(method(textDidBeginEditing:))]
261        #[unsafe(method_family = none)]
262        pub fn textDidBeginEditing(&self, notification: &NSNotification);
263
264        #[unsafe(method(textDidEndEditing:))]
265        #[unsafe(method_family = none)]
266        pub fn textDidEndEditing(&self, notification: &NSNotification);
267
268        #[unsafe(method(textDidChange:))]
269        #[unsafe(method_family = none)]
270        pub fn textDidChange(&self, notification: &NSNotification);
271
272        #[unsafe(method(acceptsFirstResponder))]
273        #[unsafe(method_family = none)]
274        pub fn acceptsFirstResponder(&self) -> bool;
275
276        #[cfg(feature = "NSTextFieldCell")]
277        #[unsafe(method(bezelStyle))]
278        #[unsafe(method_family = none)]
279        pub fn bezelStyle(&self) -> NSTextFieldBezelStyle;
280
281        #[cfg(feature = "NSTextFieldCell")]
282        /// Setter for [`bezelStyle`][Self::bezelStyle].
283        #[unsafe(method(setBezelStyle:))]
284        #[unsafe(method_family = none)]
285        pub fn setBezelStyle(&self, bezel_style: NSTextFieldBezelStyle);
286
287        #[cfg(feature = "objc2-core-foundation")]
288        #[unsafe(method(preferredMaxLayoutWidth))]
289        #[unsafe(method_family = none)]
290        pub fn preferredMaxLayoutWidth(&self) -> CGFloat;
291
292        #[cfg(feature = "objc2-core-foundation")]
293        /// Setter for [`preferredMaxLayoutWidth`][Self::preferredMaxLayoutWidth].
294        #[unsafe(method(setPreferredMaxLayoutWidth:))]
295        #[unsafe(method_family = none)]
296        pub fn setPreferredMaxLayoutWidth(&self, preferred_max_layout_width: CGFloat);
297
298        #[unsafe(method(maximumNumberOfLines))]
299        #[unsafe(method_family = none)]
300        pub fn maximumNumberOfLines(&self) -> NSInteger;
301
302        /// Setter for [`maximumNumberOfLines`][Self::maximumNumberOfLines].
303        #[unsafe(method(setMaximumNumberOfLines:))]
304        #[unsafe(method_family = none)]
305        pub fn setMaximumNumberOfLines(&self, maximum_number_of_lines: NSInteger);
306
307        #[unsafe(method(allowsDefaultTighteningForTruncation))]
308        #[unsafe(method_family = none)]
309        pub fn allowsDefaultTighteningForTruncation(&self) -> bool;
310
311        /// Setter for [`allowsDefaultTighteningForTruncation`][Self::allowsDefaultTighteningForTruncation].
312        #[unsafe(method(setAllowsDefaultTighteningForTruncation:))]
313        #[unsafe(method_family = none)]
314        pub fn setAllowsDefaultTighteningForTruncation(
315            &self,
316            allows_default_tightening_for_truncation: bool,
317        );
318
319        #[cfg(feature = "NSParagraphStyle")]
320        #[unsafe(method(lineBreakStrategy))]
321        #[unsafe(method_family = none)]
322        pub fn lineBreakStrategy(&self) -> NSLineBreakStrategy;
323
324        #[cfg(feature = "NSParagraphStyle")]
325        /// Setter for [`lineBreakStrategy`][Self::lineBreakStrategy].
326        #[unsafe(method(setLineBreakStrategy:))]
327        #[unsafe(method_family = none)]
328        pub fn setLineBreakStrategy(&self, line_break_strategy: NSLineBreakStrategy);
329
330        #[unsafe(method(allowsWritingTools))]
331        #[unsafe(method_family = none)]
332        pub fn allowsWritingTools(&self) -> bool;
333
334        /// Setter for [`allowsWritingTools`][Self::allowsWritingTools].
335        #[unsafe(method(setAllowsWritingTools:))]
336        #[unsafe(method_family = none)]
337        pub fn setAllowsWritingTools(&self, allows_writing_tools: bool);
338
339        #[unsafe(method(allowsWritingToolsAffordance))]
340        #[unsafe(method_family = none)]
341        pub fn allowsWritingToolsAffordance(&self) -> bool;
342
343        /// Setter for [`allowsWritingToolsAffordance`][Self::allowsWritingToolsAffordance].
344        #[unsafe(method(setAllowsWritingToolsAffordance:))]
345        #[unsafe(method_family = none)]
346        pub fn setAllowsWritingToolsAffordance(&self, allows_writing_tools_affordance: bool);
347
348        #[unsafe(method(placeholderStrings))]
349        #[unsafe(method_family = none)]
350        pub fn placeholderStrings(&self) -> Retained<NSArray<NSString>>;
351
352        /// Setter for [`placeholderStrings`][Self::placeholderStrings].
353        ///
354        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
355        #[unsafe(method(setPlaceholderStrings:))]
356        #[unsafe(method_family = none)]
357        pub fn setPlaceholderStrings(&self, placeholder_strings: &NSArray<NSString>);
358
359        #[unsafe(method(placeholderAttributedStrings))]
360        #[unsafe(method_family = none)]
361        pub fn placeholderAttributedStrings(&self) -> Retained<NSArray<NSAttributedString>>;
362
363        /// Setter for [`placeholderAttributedStrings`][Self::placeholderAttributedStrings].
364        ///
365        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
366        #[unsafe(method(setPlaceholderAttributedStrings:))]
367        #[unsafe(method_family = none)]
368        pub fn setPlaceholderAttributedStrings(
369            &self,
370            placeholder_attributed_strings: &NSArray<NSAttributedString>,
371        );
372
373        /// Specifies the behavior for resolving ``NSTextAlignment.natural`` to the visual alignment.
374        ///
375        /// When set to ``true``, the resolved visual alignment is determined by the resolved base writing direction; otherwise, it is using the user’s preferred language.
376        /// The default value is ``false``.
377        #[unsafe(method(resolvesNaturalAlignmentWithBaseWritingDirection))]
378        #[unsafe(method_family = none)]
379        pub fn resolvesNaturalAlignmentWithBaseWritingDirection(&self) -> bool;
380
381        /// Setter for [`resolvesNaturalAlignmentWithBaseWritingDirection`][Self::resolvesNaturalAlignmentWithBaseWritingDirection].
382        #[unsafe(method(setResolvesNaturalAlignmentWithBaseWritingDirection:))]
383        #[unsafe(method_family = none)]
384        pub fn setResolvesNaturalAlignmentWithBaseWritingDirection(
385            &self,
386            resolves_natural_alignment_with_base_writing_direction: bool,
387        );
388    );
389}
390
391/// Methods declared on superclass `NSControl`.
392#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
393impl NSTextField {
394    extern_methods!(
395        #[unsafe(method(initWithFrame:))]
396        #[unsafe(method_family = init)]
397        pub fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
398
399        /// # Safety
400        ///
401        /// `coder` possibly has further requirements.
402        #[unsafe(method(initWithCoder:))]
403        #[unsafe(method_family = init)]
404        pub unsafe fn initWithCoder(
405            this: Allocated<Self>,
406            coder: &NSCoder,
407        ) -> Option<Retained<Self>>;
408    );
409}
410
411/// Methods declared on superclass `NSResponder`.
412#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
413impl NSTextField {
414    extern_methods!(
415        #[unsafe(method(init))]
416        #[unsafe(method_family = init)]
417        pub fn init(this: Allocated<Self>) -> Retained<Self>;
418    );
419}
420
421/// Methods declared on superclass `NSObject`.
422#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
423impl NSTextField {
424    extern_methods!(
425        #[unsafe(method(new))]
426        #[unsafe(method_family = new)]
427        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
428    );
429}
430
431/// NSTouchBar.
432#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
433impl NSTextField {
434    extern_methods!(
435        #[unsafe(method(isAutomaticTextCompletionEnabled))]
436        #[unsafe(method_family = none)]
437        pub fn isAutomaticTextCompletionEnabled(&self) -> bool;
438
439        /// Setter for [`isAutomaticTextCompletionEnabled`][Self::isAutomaticTextCompletionEnabled].
440        #[unsafe(method(setAutomaticTextCompletionEnabled:))]
441        #[unsafe(method_family = none)]
442        pub fn setAutomaticTextCompletionEnabled(&self, automatic_text_completion_enabled: bool);
443
444        #[unsafe(method(allowsCharacterPickerTouchBarItem))]
445        #[unsafe(method_family = none)]
446        pub fn allowsCharacterPickerTouchBarItem(&self) -> bool;
447
448        /// Setter for [`allowsCharacterPickerTouchBarItem`][Self::allowsCharacterPickerTouchBarItem].
449        #[unsafe(method(setAllowsCharacterPickerTouchBarItem:))]
450        #[unsafe(method_family = none)]
451        pub fn setAllowsCharacterPickerTouchBarItem(
452            &self,
453            allows_character_picker_touch_bar_item: bool,
454        );
455    );
456}
457
458/// NSTextFieldConvenience.
459#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
460impl NSTextField {
461    extern_methods!(
462        /// Creates a non-wrapping, non-editable, non-selectable text field that displays text in the default system font.
463        ///
464        /// Parameter `stringValue`: The title text to display in the field.
465        ///
466        /// Returns: An initialized text field object.
467        #[unsafe(method(labelWithString:))]
468        #[unsafe(method_family = none)]
469        pub fn labelWithString(string_value: &NSString, mtm: MainThreadMarker) -> Retained<Self>;
470
471        /// Creates a wrapping, non-editable, selectable text field that displays text in the default system font.
472        ///
473        /// Parameter `stringValue`: The title text to display in the field.
474        ///
475        /// Returns: An initialized text field object.
476        #[unsafe(method(wrappingLabelWithString:))]
477        #[unsafe(method_family = none)]
478        pub fn wrappingLabelWithString(
479            string_value: &NSString,
480            mtm: MainThreadMarker,
481        ) -> Retained<Self>;
482
483        /// Creates a non-editable, non-selectable text field that displays attributed text.
484        /// The line break mode of this field is determined by the attributed string's NSParagraphStyle attribute.
485        ///
486        /// Parameter `attributedStringValue`: The attributed string to display in the field.
487        ///
488        /// Returns: An initialized text field object.
489        #[unsafe(method(labelWithAttributedString:))]
490        #[unsafe(method_family = none)]
491        pub fn labelWithAttributedString(
492            attributed_string_value: &NSAttributedString,
493            mtm: MainThreadMarker,
494        ) -> Retained<Self>;
495
496        /// Creates a non-wrapping editable text field.
497        ///
498        /// Parameter `stringValue`: The initial contents of the text field, or empty string for an initially empty text field.
499        ///
500        /// Returns: An initialized text field object.
501        #[unsafe(method(textFieldWithString:))]
502        #[unsafe(method_family = none)]
503        pub fn textFieldWithString(
504            string_value: &NSString,
505            mtm: MainThreadMarker,
506        ) -> Retained<Self>;
507    );
508}
509
510/// NSTextFieldAttributedStringMethods.
511#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
512impl NSTextField {
513    extern_methods!(
514        #[unsafe(method(allowsEditingTextAttributes))]
515        #[unsafe(method_family = none)]
516        pub fn allowsEditingTextAttributes(&self) -> bool;
517
518        /// Setter for [`allowsEditingTextAttributes`][Self::allowsEditingTextAttributes].
519        #[unsafe(method(setAllowsEditingTextAttributes:))]
520        #[unsafe(method_family = none)]
521        pub fn setAllowsEditingTextAttributes(&self, allows_editing_text_attributes: bool);
522
523        #[unsafe(method(importsGraphics))]
524        #[unsafe(method_family = none)]
525        pub fn importsGraphics(&self) -> bool;
526
527        /// Setter for [`importsGraphics`][Self::importsGraphics].
528        #[unsafe(method(setImportsGraphics:))]
529        #[unsafe(method_family = none)]
530        pub fn setImportsGraphics(&self, imports_graphics: bool);
531    );
532}
533
534extern_protocol!(
535    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstextfielddelegate?language=objc)
536    #[cfg(feature = "NSControl")]
537    pub unsafe trait NSTextFieldDelegate:
538        NSControlTextEditingDelegate + MainThreadOnly
539    {
540        #[cfg(all(
541            feature = "NSResponder",
542            feature = "NSText",
543            feature = "NSTextView",
544            feature = "NSView"
545        ))]
546        /// Provides a customized list of candidates to the text view’s `candidateListTouchBarItem`. Invoked from `-updateCandidates`. `NSTextView` uses the candidates returned from this method and suppress its built-in candidate generation. Returning `nil` from this delegate method allows `NSTextView` to query candidates from `NSSpellChecker`.
547        /// - Returns: An array of objects that represent the elements of a selection.
548        #[optional]
549        #[unsafe(method(textField:textView:candidatesForSelectedRange:))]
550        #[unsafe(method_family = none)]
551        fn textField_textView_candidatesForSelectedRange(
552            &self,
553            text_field: &NSTextField,
554            text_view: &NSTextView,
555            selected_range: NSRange,
556        ) -> Option<Retained<NSArray>>;
557
558        #[cfg(all(
559            feature = "NSResponder",
560            feature = "NSText",
561            feature = "NSTextView",
562            feature = "NSView"
563        ))]
564        /// Allows customizing the candidate list queried from `NSSpellChecker`.
565        /// - Returns: An array of text objects to include in a text selection.
566        #[optional]
567        #[unsafe(method(textField:textView:candidates:forSelectedRange:))]
568        #[unsafe(method_family = none)]
569        fn textField_textView_candidates_forSelectedRange(
570            &self,
571            text_field: &NSTextField,
572            text_view: &NSTextView,
573            candidates: &NSArray<NSTextCheckingResult>,
574            selected_range: NSRange,
575        ) -> Retained<NSArray<NSTextCheckingResult>>;
576
577        #[cfg(all(
578            feature = "NSResponder",
579            feature = "NSText",
580            feature = "NSTextView",
581            feature = "NSView"
582        ))]
583        /// Notifies the delegate that the user selected the candidate at index in `-[NSCandidateListTouchBarItem candidates]` for the text view’s `candidateListTouchBarItem`. Returns a Boolean value that indicates whether to select the text object at the index.
584        /// - Parameters:
585        /// - textField: The text field that sent the message.
586        /// - textView: The text view that sent the message.
587        /// - index: The index that represents the start of the candidate text to evaluate, or `NSNotFound` if no candidate is to be selected.
588        /// - Returns: `YES` if the framework selects the text. `YES` allows `textView` to insert the candidate into the text storage if it’s `NSString`, `NSAttributedString`, or `NSTextCheckingResult`.
589        #[optional]
590        #[unsafe(method(textField:textView:shouldSelectCandidateAtIndex:))]
591        #[unsafe(method_family = none)]
592        fn textField_textView_shouldSelectCandidateAtIndex(
593            &self,
594            text_field: &NSTextField,
595            text_view: &NSTextView,
596            index: NSUInteger,
597        ) -> bool;
598    }
599);
600
601/// NSDeprecated.
602#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
603impl NSTextField {
604    extern_methods!(
605        /// # Safety
606        ///
607        /// `string_with_ampersand` might not allow `None`.
608        #[deprecated = "Use `-setTitle:` instead"]
609        #[unsafe(method(setTitleWithMnemonic:))]
610        #[unsafe(method_family = none)]
611        pub unsafe fn setTitleWithMnemonic(&self, string_with_ampersand: Option<&NSString>);
612    );
613}