use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_protocol!(
pub unsafe trait NSTextInput {
#[deprecated]
#[unsafe(method(insertText:))]
#[unsafe(method_family = none)]
unsafe fn insertText(&self, string: Option<&AnyObject>);
#[deprecated]
#[unsafe(method(doCommandBySelector:))]
#[unsafe(method_family = none)]
unsafe fn doCommandBySelector(&self, selector: Option<Sel>);
#[deprecated]
#[unsafe(method(setMarkedText:selectedRange:))]
#[unsafe(method_family = none)]
unsafe fn setMarkedText_selectedRange(
&self,
string: Option<&AnyObject>,
sel_range: NSRange,
);
#[deprecated]
#[unsafe(method(unmarkText))]
#[unsafe(method_family = none)]
fn unmarkText(&self);
#[deprecated]
#[unsafe(method(hasMarkedText))]
#[unsafe(method_family = none)]
fn hasMarkedText(&self) -> bool;
#[deprecated]
#[unsafe(method(conversationIdentifier))]
#[unsafe(method_family = none)]
fn conversationIdentifier(&self) -> NSInteger;
#[deprecated]
#[unsafe(method(attributedSubstringFromRange:))]
#[unsafe(method_family = none)]
fn attributedSubstringFromRange(
&self,
range: NSRange,
) -> Option<Retained<NSAttributedString>>;
#[deprecated]
#[unsafe(method(markedRange))]
#[unsafe(method_family = none)]
fn markedRange(&self) -> NSRange;
#[deprecated]
#[unsafe(method(selectedRange))]
#[unsafe(method_family = none)]
fn selectedRange(&self) -> NSRange;
#[deprecated]
#[unsafe(method(firstRectForCharacterRange:))]
#[unsafe(method_family = none)]
fn firstRectForCharacterRange(&self, range: NSRange) -> NSRect;
#[deprecated]
#[unsafe(method(characterIndexForPoint:))]
#[unsafe(method_family = none)]
fn characterIndexForPoint(&self, point: NSPoint) -> NSUInteger;
#[deprecated]
#[unsafe(method(validAttributesForMarkedText))]
#[unsafe(method_family = none)]
fn validAttributesForMarkedText(&self) -> Option<Retained<NSArray>>;
}
);
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[deprecated = "Use NSTextInputContext instead"]
pub struct NSInputManager;
);
extern_conformance!(
unsafe impl NSObjectProtocol for NSInputManager {}
);
extern_conformance!(
unsafe impl NSTextInput for NSInputManager {}
);
impl NSInputManager {
extern_methods!(
#[deprecated]
#[unsafe(method(currentInputManager))]
#[unsafe(method_family = none)]
pub fn currentInputManager() -> Option<Retained<NSInputManager>>;
#[deprecated]
#[unsafe(method(cycleToNextInputLanguage:))]
#[unsafe(method_family = none)]
pub unsafe fn cycleToNextInputLanguage(sender: Option<&AnyObject>);
#[deprecated]
#[unsafe(method(cycleToNextInputServerInLanguage:))]
#[unsafe(method_family = none)]
pub unsafe fn cycleToNextInputServerInLanguage(sender: Option<&AnyObject>);
#[deprecated]
#[unsafe(method(initWithName:host:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithName_host(
this: Allocated<Self>,
input_server_name: Option<&NSString>,
host_name: Option<&NSString>,
) -> Option<Retained<NSInputManager>>;
#[deprecated]
#[unsafe(method(localizedInputManagerName))]
#[unsafe(method_family = none)]
pub fn localizedInputManagerName(&self) -> Option<Retained<NSString>>;
#[deprecated]
#[unsafe(method(markedTextAbandoned:))]
#[unsafe(method_family = none)]
pub unsafe fn markedTextAbandoned(&self, cli: Option<&AnyObject>);
#[deprecated]
#[unsafe(method(markedTextSelectionChanged:client:))]
#[unsafe(method_family = none)]
pub unsafe fn markedTextSelectionChanged_client(
&self,
new_sel: NSRange,
cli: Option<&AnyObject>,
);
#[deprecated]
#[unsafe(method(wantsToInterpretAllKeystrokes))]
#[unsafe(method_family = none)]
pub fn wantsToInterpretAllKeystrokes(&self) -> bool;
#[deprecated]
#[unsafe(method(language))]
#[unsafe(method_family = none)]
pub fn language(&self) -> Option<Retained<NSString>>;
#[cfg(feature = "NSImage")]
#[deprecated]
#[unsafe(method(image))]
#[unsafe(method_family = none)]
pub fn image(&self) -> Option<Retained<NSImage>>;
#[cfg(feature = "NSInputServer")]
#[deprecated]
#[unsafe(method(server))]
#[unsafe(method_family = none)]
pub fn server(&self) -> Option<Retained<NSInputServer>>;
#[deprecated]
#[unsafe(method(wantsToHandleMouseEvents))]
#[unsafe(method_family = none)]
pub fn wantsToHandleMouseEvents(&self) -> bool;
#[cfg(feature = "NSEvent")]
#[deprecated]
#[unsafe(method(handleMouseEvent:))]
#[unsafe(method_family = none)]
pub unsafe fn handleMouseEvent(&self, mouse_event: Option<&NSEvent>) -> bool;
#[deprecated]
#[unsafe(method(wantsToDelayTextChangeNotifications))]
#[unsafe(method_family = none)]
pub fn wantsToDelayTextChangeNotifications(&self) -> bool;
);
}
impl NSInputManager {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new() -> Retained<Self>;
);
}
impl DefaultRetained for NSInputManager {
#[inline]
fn default_retained() -> Retained<Self> {
Self::new()
}
}