use crate::common::*;
use crate::AppKit::*;
use crate::CoreData::*;
use crate::Foundation::*;
extern_protocol!(
pub struct NSTextInput;
unsafe impl ProtocolType for NSTextInput {
#[method(insertText:)]
pub unsafe fn insertText(&self, string: Option<&Object>);
#[method(doCommandBySelector:)]
pub unsafe fn doCommandBySelector(&self, selector: Option<Sel>);
#[method(setMarkedText:selectedRange:)]
pub unsafe fn setMarkedText_selectedRange(
&self,
string: Option<&Object>,
selRange: NSRange,
);
#[method(unmarkText)]
pub unsafe fn unmarkText(&self);
#[method(hasMarkedText)]
pub unsafe fn hasMarkedText(&self) -> bool;
#[method(conversationIdentifier)]
pub unsafe fn conversationIdentifier(&self) -> NSInteger;
#[method_id(@__retain_semantics Other attributedSubstringFromRange:)]
pub unsafe fn attributedSubstringFromRange(
&self,
range: NSRange,
) -> Option<Id<NSAttributedString, Shared>>;
#[method(markedRange)]
pub unsafe fn markedRange(&self) -> NSRange;
#[method(selectedRange)]
pub unsafe fn selectedRange(&self) -> NSRange;
#[method(firstRectForCharacterRange:)]
pub unsafe fn firstRectForCharacterRange(&self, range: NSRange) -> NSRect;
#[method(characterIndexForPoint:)]
pub unsafe fn characterIndexForPoint(&self, point: NSPoint) -> NSUInteger;
#[method_id(@__retain_semantics Other validAttributesForMarkedText)]
pub unsafe fn validAttributesForMarkedText(&self) -> Option<Id<NSArray, Shared>>;
}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSInputManager;
unsafe impl ClassType for NSInputManager {
type Super = NSObject;
}
);
extern_methods!(
unsafe impl NSInputManager {
#[method_id(@__retain_semantics Other currentInputManager)]
pub unsafe fn currentInputManager() -> Option<Id<NSInputManager, Shared>>;
#[method(cycleToNextInputLanguage:)]
pub unsafe fn cycleToNextInputLanguage(sender: Option<&Object>);
#[method(cycleToNextInputServerInLanguage:)]
pub unsafe fn cycleToNextInputServerInLanguage(sender: Option<&Object>);
#[method_id(@__retain_semantics Init initWithName:host:)]
pub unsafe fn initWithName_host(
this: Option<Allocated<Self>>,
inputServerName: Option<&NSString>,
hostName: Option<&NSString>,
) -> Option<Id<NSInputManager, Shared>>;
#[method_id(@__retain_semantics Other localizedInputManagerName)]
pub unsafe fn localizedInputManagerName(&self) -> Option<Id<NSString, Shared>>;
#[method(markedTextAbandoned:)]
pub unsafe fn markedTextAbandoned(&self, cli: Option<&Object>);
#[method(markedTextSelectionChanged:client:)]
pub unsafe fn markedTextSelectionChanged_client(
&self,
newSel: NSRange,
cli: Option<&Object>,
);
#[method(wantsToInterpretAllKeystrokes)]
pub unsafe fn wantsToInterpretAllKeystrokes(&self) -> bool;
#[method_id(@__retain_semantics Other language)]
pub unsafe fn language(&self) -> Option<Id<NSString, Shared>>;
#[method_id(@__retain_semantics Other image)]
pub unsafe fn image(&self) -> Option<Id<NSImage, Shared>>;
#[method_id(@__retain_semantics Other server)]
pub unsafe fn server(&self) -> Option<Id<NSInputServer, Shared>>;
#[method(wantsToHandleMouseEvents)]
pub unsafe fn wantsToHandleMouseEvents(&self) -> bool;
#[method(handleMouseEvent:)]
pub unsafe fn handleMouseEvent(&self, mouseEvent: Option<&NSEvent>) -> bool;
#[method(wantsToDelayTextChangeNotifications)]
pub unsafe fn wantsToDelayTextChangeNotifications(&self) -> bool;
}
);