use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_protocol!(
pub unsafe trait NSInputServiceProvider {
#[deprecated]
#[unsafe(method(insertText:client:))]
#[unsafe(method_family = none)]
unsafe fn insertText_client(&self, string: Option<&AnyObject>, sender: Option<&AnyObject>);
#[deprecated]
#[unsafe(method(doCommandBySelector:client:))]
#[unsafe(method_family = none)]
unsafe fn doCommandBySelector_client(
&self,
selector: Option<Sel>,
sender: Option<&AnyObject>,
);
#[deprecated]
#[unsafe(method(markedTextAbandoned:))]
#[unsafe(method_family = none)]
unsafe fn markedTextAbandoned(&self, sender: Option<&AnyObject>);
#[deprecated]
#[unsafe(method(markedTextSelectionChanged:client:))]
#[unsafe(method_family = none)]
unsafe fn markedTextSelectionChanged_client(
&self,
new_sel: NSRange,
sender: Option<&AnyObject>,
);
#[deprecated]
#[unsafe(method(terminate:))]
#[unsafe(method_family = none)]
unsafe fn terminate(&self, sender: Option<&AnyObject>);
#[deprecated]
#[unsafe(method(canBeDisabled))]
#[unsafe(method_family = none)]
fn canBeDisabled(&self) -> bool;
#[deprecated]
#[unsafe(method(wantsToInterpretAllKeystrokes))]
#[unsafe(method_family = none)]
fn wantsToInterpretAllKeystrokes(&self) -> bool;
#[deprecated]
#[unsafe(method(wantsToHandleMouseEvents))]
#[unsafe(method_family = none)]
fn wantsToHandleMouseEvents(&self) -> bool;
#[deprecated]
#[unsafe(method(wantsToDelayTextChangeNotifications))]
#[unsafe(method_family = none)]
fn wantsToDelayTextChangeNotifications(&self) -> bool;
#[deprecated]
#[unsafe(method(inputClientBecomeActive:))]
#[unsafe(method_family = none)]
unsafe fn inputClientBecomeActive(&self, sender: Option<&AnyObject>);
#[deprecated]
#[unsafe(method(inputClientResignActive:))]
#[unsafe(method_family = none)]
unsafe fn inputClientResignActive(&self, sender: Option<&AnyObject>);
#[deprecated]
#[unsafe(method(inputClientEnabled:))]
#[unsafe(method_family = none)]
unsafe fn inputClientEnabled(&self, sender: Option<&AnyObject>);
#[deprecated]
#[unsafe(method(inputClientDisabled:))]
#[unsafe(method_family = none)]
unsafe fn inputClientDisabled(&self, sender: Option<&AnyObject>);
#[deprecated]
#[unsafe(method(activeConversationWillChange:fromOldConversation:))]
#[unsafe(method_family = none)]
unsafe fn activeConversationWillChange_fromOldConversation(
&self,
sender: Option<&AnyObject>,
old_conversation: NSInteger,
);
#[deprecated]
#[unsafe(method(activeConversationChanged:toNewConversation:))]
#[unsafe(method_family = none)]
unsafe fn activeConversationChanged_toNewConversation(
&self,
sender: Option<&AnyObject>,
new_conversation: NSInteger,
);
}
);
extern_protocol!(
pub unsafe trait NSInputServerMouseTracker {
#[deprecated]
#[unsafe(method(mouseDownOnCharacterIndex:atCoordinate:withModifier:client:))]
#[unsafe(method_family = none)]
unsafe fn mouseDownOnCharacterIndex_atCoordinate_withModifier_client(
&self,
index: NSUInteger,
point: NSPoint,
flags: NSUInteger,
sender: Option<&AnyObject>,
) -> bool;
#[deprecated]
#[unsafe(method(mouseDraggedOnCharacterIndex:atCoordinate:withModifier:client:))]
#[unsafe(method_family = none)]
unsafe fn mouseDraggedOnCharacterIndex_atCoordinate_withModifier_client(
&self,
index: NSUInteger,
point: NSPoint,
flags: NSUInteger,
sender: Option<&AnyObject>,
) -> bool;
#[deprecated]
#[unsafe(method(mouseUpOnCharacterIndex:atCoordinate:withModifier:client:))]
#[unsafe(method_family = none)]
unsafe fn mouseUpOnCharacterIndex_atCoordinate_withModifier_client(
&self,
index: NSUInteger,
point: NSPoint,
flags: NSUInteger,
sender: Option<&AnyObject>,
);
}
);
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[deprecated]
pub struct NSInputServer;
);
extern_conformance!(
unsafe impl NSInputServerMouseTracker for NSInputServer {}
);
extern_conformance!(
unsafe impl NSInputServiceProvider for NSInputServer {}
);
extern_conformance!(
unsafe impl NSObjectProtocol for NSInputServer {}
);
impl NSInputServer {
extern_methods!(
#[deprecated]
#[unsafe(method(initWithDelegate:name:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithDelegate_name(
this: Allocated<Self>,
delegate: Option<&AnyObject>,
name: Option<&NSString>,
) -> Retained<Self>;
);
}
impl NSInputServer {
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 NSInputServer {
#[inline]
fn default_retained() -> Retained<Self> {
Self::new()
}
}