objc2_app_kit/generated/
NSTextCheckingController.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
10extern_class!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstextcheckingcontroller?language=objc)
12    #[unsafe(super(NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    pub struct NSTextCheckingController;
15);
16
17extern_conformance!(
18    unsafe impl NSObjectProtocol for NSTextCheckingController {}
19);
20
21impl NSTextCheckingController {
22    extern_methods!(
23        #[cfg(all(feature = "NSTextCheckingClient", feature = "NSTextInputClient"))]
24        #[unsafe(method(initWithClient:))]
25        #[unsafe(method_family = init)]
26        pub fn initWithClient(
27            this: Allocated<Self>,
28            client: &ProtocolObject<dyn NSTextCheckingClient>,
29        ) -> Retained<Self>;
30
31        #[unsafe(method(init))]
32        #[unsafe(method_family = init)]
33        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
34
35        #[cfg(all(feature = "NSTextCheckingClient", feature = "NSTextInputClient"))]
36        #[unsafe(method(client))]
37        #[unsafe(method_family = none)]
38        pub fn client(&self) -> Retained<ProtocolObject<dyn NSTextCheckingClient>>;
39
40        #[unsafe(method(invalidate))]
41        #[unsafe(method_family = none)]
42        pub fn invalidate(&self);
43
44        #[unsafe(method(didChangeTextInRange:))]
45        #[unsafe(method_family = none)]
46        pub fn didChangeTextInRange(&self, range: NSRange);
47
48        #[unsafe(method(insertedTextInRange:))]
49        #[unsafe(method_family = none)]
50        pub fn insertedTextInRange(&self, range: NSRange);
51
52        #[unsafe(method(didChangeSelectedRange))]
53        #[unsafe(method_family = none)]
54        pub fn didChangeSelectedRange(&self);
55
56        #[unsafe(method(considerTextCheckingForRange:))]
57        #[unsafe(method_family = none)]
58        pub fn considerTextCheckingForRange(&self, range: NSRange);
59
60        #[cfg(feature = "NSSpellChecker")]
61        /// # Safety
62        ///
63        /// `options` generic should be of the correct type.
64        #[unsafe(method(checkTextInRange:types:options:))]
65        #[unsafe(method_family = none)]
66        pub unsafe fn checkTextInRange_types_options(
67            &self,
68            range: NSRange,
69            checking_types: NSTextCheckingTypes,
70            options: &NSDictionary<NSTextCheckingOptionKey, AnyObject>,
71        );
72
73        /// # Safety
74        ///
75        /// `sender` should be of the correct type.
76        #[unsafe(method(checkTextInSelection:))]
77        #[unsafe(method_family = none)]
78        pub unsafe fn checkTextInSelection(&self, sender: Option<&AnyObject>);
79
80        /// # Safety
81        ///
82        /// `sender` should be of the correct type.
83        #[unsafe(method(checkTextInDocument:))]
84        #[unsafe(method_family = none)]
85        pub unsafe fn checkTextInDocument(&self, sender: Option<&AnyObject>);
86
87        /// # Safety
88        ///
89        /// `sender` should be of the correct type.
90        #[unsafe(method(orderFrontSubstitutionsPanel:))]
91        #[unsafe(method_family = none)]
92        pub unsafe fn orderFrontSubstitutionsPanel(&self, sender: Option<&AnyObject>);
93
94        /// # Safety
95        ///
96        /// `sender` should be of the correct type.
97        #[unsafe(method(checkSpelling:))]
98        #[unsafe(method_family = none)]
99        pub unsafe fn checkSpelling(&self, sender: Option<&AnyObject>);
100
101        /// # Safety
102        ///
103        /// `sender` should be of the correct type.
104        #[unsafe(method(showGuessPanel:))]
105        #[unsafe(method_family = none)]
106        pub unsafe fn showGuessPanel(&self, sender: Option<&AnyObject>);
107
108        /// # Safety
109        ///
110        /// `sender` should be of the correct type.
111        #[unsafe(method(changeSpelling:))]
112        #[unsafe(method_family = none)]
113        pub unsafe fn changeSpelling(&self, sender: Option<&AnyObject>);
114
115        /// # Safety
116        ///
117        /// `sender` should be of the correct type.
118        #[unsafe(method(ignoreSpelling:))]
119        #[unsafe(method_family = none)]
120        pub unsafe fn ignoreSpelling(&self, sender: Option<&AnyObject>);
121
122        #[unsafe(method(updateCandidates))]
123        #[unsafe(method_family = none)]
124        pub fn updateCandidates(&self);
125
126        #[unsafe(method(validAnnotations))]
127        #[unsafe(method_family = none)]
128        pub fn validAnnotations(&self) -> Retained<NSArray<NSAttributedStringKey>>;
129
130        #[cfg(feature = "NSMenu")]
131        /// # Safety
132        ///
133        /// `effective_range` must be a valid pointer.
134        #[unsafe(method(menuAtIndex:clickedOnSelection:effectiveRange:))]
135        #[unsafe(method_family = none)]
136        pub unsafe fn menuAtIndex_clickedOnSelection_effectiveRange(
137            &self,
138            location: NSUInteger,
139            clicked_on_selection: bool,
140            effective_range: NSRangePointer,
141            mtm: MainThreadMarker,
142        ) -> Option<Retained<NSMenu>>;
143
144        #[unsafe(method(spellCheckerDocumentTag))]
145        #[unsafe(method_family = none)]
146        pub fn spellCheckerDocumentTag(&self) -> NSInteger;
147
148        /// Setter for [`spellCheckerDocumentTag`][Self::spellCheckerDocumentTag].
149        #[unsafe(method(setSpellCheckerDocumentTag:))]
150        #[unsafe(method_family = none)]
151        pub fn setSpellCheckerDocumentTag(&self, spell_checker_document_tag: NSInteger);
152    );
153}
154
155/// Methods declared on superclass `NSObject`.
156impl NSTextCheckingController {
157    extern_methods!(
158        #[unsafe(method(new))]
159        #[unsafe(method_family = new)]
160        pub unsafe fn new() -> Retained<Self>;
161    );
162}