Trait IMKStateSetting

Source
pub unsafe trait IMKStateSetting {
    // Provided methods
    unsafe fn activateServer(&self, sender: Option<&AnyObject>)
       where Self: Sized + Message { ... }
    unsafe fn deactivateServer(&self, sender: Option<&AnyObject>)
       where Self: Sized + Message { ... }
    unsafe fn valueForTag_client(
        &self,
        tag: c_long,
        sender: Option<&AnyObject>,
    ) -> Option<Retained<AnyObject>>
       where Self: Sized + Message { ... }
    unsafe fn setValue_forTag_client(
        &self,
        value: Option<&AnyObject>,
        tag: c_long,
        sender: Option<&AnyObject>,
    )
       where Self: Sized + Message { ... }
    unsafe fn modes(
        &self,
        sender: Option<&AnyObject>,
    ) -> Option<Retained<NSDictionary>>
       where Self: Sized + Message { ... }
    unsafe fn recognizedEvents(&self, sender: Option<&AnyObject>) -> NSUInteger
       where Self: Sized + Message { ... }
    unsafe fn showPreferences(&self, sender: Option<&AnyObject>)
       where Self: Sized + Message { ... }
}
Available on crate feature IMKInputController only.
Expand description

This protocol sets or accesses values that indicate the state of an input method.

See also Apple’s documentation

Provided Methods§

Source

unsafe fn activateServer(&self, sender: Option<&AnyObject>)
where Self: Sized + Message,

Activates the input method.

Source

unsafe fn deactivateServer(&self, sender: Option<&AnyObject>)
where Self: Sized + Message,

Deactivate the input method.

Source

unsafe fn valueForTag_client( &self, tag: c_long, sender: Option<&AnyObject>, ) -> Option<Retained<AnyObject>>
where Self: Sized + Message,

Return a object value whose key is tag. The returned object should be autoreleased.

Source

unsafe fn setValue_forTag_client( &self, value: Option<&AnyObject>, tag: c_long, sender: Option<&AnyObject>, )
where Self: Sized + Message,

Set the tagged value to the object specified by value.

Source

unsafe fn modes( &self, sender: Option<&AnyObject>, ) -> Option<Retained<NSDictionary>>
where Self: Sized + Message,

This is called to obtain the input method’s modes dictionary.

Typically this is called to to build the text input menu. By calling the input method rather than reading the modes from the info.plist the input method can dynamically modify he modes supported. The returned NSDictionary should be an autoreleased object.

Source

unsafe fn recognizedEvents(&self, sender: Option<&AnyObject>) -> NSUInteger
where Self: Sized + Message,

Returns an unsigned integer containing a union of event masks (see NSEvent.h)

A client will check with an input method to see if an event is supported by calling the method. The default implementation returns NSKeyDownMask. If your input method only handles key downs the InputMethodKit provides default mouse handling. The default mousedown handling behavior is as follows: if there is an active composition area and the user clicks in the text but outside of the composition area the InputMethodKit will send your input method a commitComposition: message. Note that this will only happen for input methods that return just NSKeyDownMask (i.e. the default value) as the result of recognizedEvents.

Source

unsafe fn showPreferences(&self, sender: Option<&AnyObject>)
where Self: Sized + Message,

Looks for a nib file containing a windowController class and a preferences utility. If found the panel is displayed.

To use this method include a menu item whose action is showPreferences: in your input method’s menu. If that is done the method will be called automatically when a user selects the item in the Text Input Menu. The default implementation looks for a nib file called preferences.nib. If found a windowController class is allocated and the nib is loaded. You can provide a custom windowController class by naming the class in your input methods info.plist file. To do that provide a string value that names the custom class with a key of InputMethodServerPreferencesWindowControllerClass.

Trait Implementations§

Source§

impl ProtocolType for dyn IMKStateSetting

Source§

const NAME: &'static str = "IMKStateSetting"

The name of the Objective-C protocol that this type represents. Read more
Source§

fn protocol() -> Option<&'static AnyProtocol>

Get a reference to the Objective-C protocol object that this type represents. Read more
Source§

impl<T> ImplementedBy<T> for dyn IMKStateSetting

Implementations on Foreign Types§

Source§

impl<T> IMKStateSetting for ProtocolObject<T>
where T: ?Sized + IMKStateSetting,

Implementors§