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 { ... }
}
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§
Sourceunsafe fn activateServer(&self, sender: Option<&AnyObject>)
unsafe fn activateServer(&self, sender: Option<&AnyObject>)
Activates the input method.
Sourceunsafe fn deactivateServer(&self, sender: Option<&AnyObject>)
unsafe fn deactivateServer(&self, sender: Option<&AnyObject>)
Deactivate the input method.
Sourceunsafe fn valueForTag_client(
&self,
tag: c_long,
sender: Option<&AnyObject>,
) -> Option<Retained<AnyObject>>
unsafe fn valueForTag_client( &self, tag: c_long, sender: Option<&AnyObject>, ) -> Option<Retained<AnyObject>>
Return a object value whose key is tag. The returned object should be autoreleased.
Sourceunsafe fn setValue_forTag_client(
&self,
value: Option<&AnyObject>,
tag: c_long,
sender: Option<&AnyObject>,
)
unsafe fn setValue_forTag_client( &self, value: Option<&AnyObject>, tag: c_long, sender: Option<&AnyObject>, )
Set the tagged value to the object specified by value.
Sourceunsafe fn modes(
&self,
sender: Option<&AnyObject>,
) -> Option<Retained<NSDictionary>>
unsafe fn modes( &self, sender: Option<&AnyObject>, ) -> Option<Retained<NSDictionary>>
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.
Sourceunsafe fn recognizedEvents(&self, sender: Option<&AnyObject>) -> NSUInteger
unsafe fn recognizedEvents(&self, sender: Option<&AnyObject>) -> NSUInteger
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.
Sourceunsafe fn showPreferences(&self, sender: Option<&AnyObject>)
unsafe fn showPreferences(&self, sender: Option<&AnyObject>)
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.