1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_protocol!(
    pub unsafe trait NSTextInput {
        #[deprecated]
        #[method(insertText:)]
        unsafe fn insertText(&self, string: Option<&AnyObject>);

        #[deprecated]
        #[method(doCommandBySelector:)]
        unsafe fn doCommandBySelector(&self, selector: Option<Sel>);

        #[deprecated]
        #[method(setMarkedText:selectedRange:)]
        unsafe fn setMarkedText_selectedRange(
            &self,
            string: Option<&AnyObject>,
            sel_range: NSRange,
        );

        #[deprecated]
        #[method(unmarkText)]
        unsafe fn unmarkText(&self);

        #[deprecated]
        #[method(hasMarkedText)]
        unsafe fn hasMarkedText(&self) -> bool;

        #[deprecated]
        #[method(conversationIdentifier)]
        unsafe fn conversationIdentifier(&self) -> NSInteger;

        #[deprecated]
        #[method_id(@__retain_semantics Other attributedSubstringFromRange:)]
        unsafe fn attributedSubstringFromRange(
            &self,
            range: NSRange,
        ) -> Option<Id<NSAttributedString>>;

        #[deprecated]
        #[method(markedRange)]
        unsafe fn markedRange(&self) -> NSRange;

        #[deprecated]
        #[method(selectedRange)]
        unsafe fn selectedRange(&self) -> NSRange;

        #[deprecated]
        #[method(firstRectForCharacterRange:)]
        unsafe fn firstRectForCharacterRange(&self, range: NSRange) -> NSRect;

        #[deprecated]
        #[method(characterIndexForPoint:)]
        unsafe fn characterIndexForPoint(&self, point: NSPoint) -> NSUInteger;

        #[deprecated]
        #[method_id(@__retain_semantics Other validAttributesForMarkedText)]
        unsafe fn validAttributesForMarkedText(&self) -> Option<Id<NSArray>>;
    }

    unsafe impl ProtocolType for dyn NSTextInput {}
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[deprecated = "Use NSTextInputContext instead"]
    pub struct NSInputManager;

    unsafe impl ClassType for NSInputManager {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

unsafe impl NSObjectProtocol for NSInputManager {}

unsafe impl NSTextInput for NSInputManager {}

extern_methods!(
    unsafe impl NSInputManager {
        #[deprecated]
        #[method_id(@__retain_semantics Other currentInputManager)]
        pub unsafe fn currentInputManager() -> Option<Id<NSInputManager>>;

        #[deprecated]
        #[method(cycleToNextInputLanguage:)]
        pub unsafe fn cycleToNextInputLanguage(sender: Option<&AnyObject>);

        #[deprecated]
        #[method(cycleToNextInputServerInLanguage:)]
        pub unsafe fn cycleToNextInputServerInLanguage(sender: Option<&AnyObject>);

        #[deprecated]
        #[method_id(@__retain_semantics Init initWithName:host:)]
        pub unsafe fn initWithName_host(
            this: Allocated<Self>,
            input_server_name: Option<&NSString>,
            host_name: Option<&NSString>,
        ) -> Option<Id<NSInputManager>>;

        #[deprecated]
        #[method_id(@__retain_semantics Other localizedInputManagerName)]
        pub unsafe fn localizedInputManagerName(&self) -> Option<Id<NSString>>;

        #[deprecated]
        #[method(markedTextAbandoned:)]
        pub unsafe fn markedTextAbandoned(&self, cli: Option<&AnyObject>);

        #[deprecated]
        #[method(markedTextSelectionChanged:client:)]
        pub unsafe fn markedTextSelectionChanged_client(
            &self,
            new_sel: NSRange,
            cli: Option<&AnyObject>,
        );

        #[deprecated]
        #[method(wantsToInterpretAllKeystrokes)]
        pub unsafe fn wantsToInterpretAllKeystrokes(&self) -> bool;

        #[deprecated]
        #[method_id(@__retain_semantics Other language)]
        pub unsafe fn language(&self) -> Option<Id<NSString>>;

        #[cfg(feature = "NSImage")]
        #[deprecated]
        #[method_id(@__retain_semantics Other image)]
        pub unsafe fn image(&self) -> Option<Id<NSImage>>;

        #[cfg(feature = "NSInputServer")]
        #[deprecated]
        #[method_id(@__retain_semantics Other server)]
        pub unsafe fn server(&self) -> Option<Id<NSInputServer>>;

        #[deprecated]
        #[method(wantsToHandleMouseEvents)]
        pub unsafe fn wantsToHandleMouseEvents(&self) -> bool;

        #[cfg(feature = "NSEvent")]
        #[deprecated]
        #[method(handleMouseEvent:)]
        pub unsafe fn handleMouseEvent(&self, mouse_event: Option<&NSEvent>) -> bool;

        #[deprecated]
        #[method(wantsToDelayTextChangeNotifications)]
        pub unsafe fn wantsToDelayTextChangeNotifications(&self) -> bool;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    unsafe impl NSInputManager {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Id<Self>;
    }
);