Struct xpcom::interfaces::nsITextInputProcessorCallback
[−]
[src]
#[repr(C)]pub struct nsITextInputProcessorCallback { /* fields omitted */ }
interface nsITextInputProcessorCallback : nsISupports
/**
* nsITextInputProcessorCallback is a callback interface for JS to implement
* IME. IME implemented by JS can implement onNotify() function and must send
* it to nsITextInputProcessor at initializing. Then, onNotify() will be
* called with nsITextInputProcessorNotification instance.
* The reason why onNotify() uses string simply is that if we will support
* other notifications such as text changes and selection changes, we need to
* notify IME of some other information. Then, only changing
* nsITextInputProcessorNotification interface is better for compatibility.
*/
Methods
impl nsITextInputProcessorCallback
[src]
pub fn coerce<T: nsITextInputProcessorCallbackCoerce>(&self) -> &T
[src]
Cast this nsITextInputProcessorCallback
to one of its base interfaces.
impl nsITextInputProcessorCallback
[src]
pub unsafe fn OnNotify(
&self,
aTextInputProcessor: *const nsITextInputProcessor,
aNotification: *const nsITextInputProcessorNotification,
_retval: *mut bool
) -> nsresult
[src]
&self,
aTextInputProcessor: *const nsITextInputProcessor,
aNotification: *const nsITextInputProcessorNotification,
_retval: *mut bool
) -> nsresult
/**
* When Gecko notifies IME of something or requests something to IME,
* this is called.
*
* @param aTextInputProcessor Reference to the nsITextInputProcessor service
* which is the original receiver of the request
* or notification.
* @param aNotification Stores type of notifications and additional
* information.
* @return Return true if it succeeded or does nothing.
* Otherwise, return false.
*
* Example #1 The simplest implementation of nsITextInputProcessorCallback is:
*
* function simpleCallback(aTIP, aNotification)
* {
* try {
* switch (aNotification.type) {
* case "request-to-commit":
* aTIP.commitComposition();
* break;
* case "request-to-cancel":
* aTIP.cancelComposition();
* break;
* }
* } catch (e) {
* return false;
* }
* return true;
* }
*
* var TIP = Components.classes["@mozilla.org/text-input-processor;1"].
* createInstance(Components.interfaces.nsITextInputProcessor);
* if (!TIP.init(window, simpleCallback)) {
* return;
* }
*/
boolean onNotify (in nsITextInputProcessor aTextInputProcessor, in nsITextInputProcessorNotification aNotification);
Methods from Deref<Target = nsISupports>
pub fn coerce<T: nsISupportsCoerce>(&self) -> &T
[src]
Cast this nsISupports
to one of its base interfaces.
pub unsafe fn QueryInterface(
&self,
uuid: &nsIID,
result: *mut *mut c_void
) -> nsresult
[src]
&self,
uuid: &nsIID,
result: *mut *mut c_void
) -> nsresult
void QueryInterface (in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result);
pub unsafe fn AddRef(&self) -> nsrefcnt
[src]
[noscript,notxpcom] nsrefcnt AddRef ();
pub unsafe fn Release(&self) -> nsrefcnt
[src]
[noscript,notxpcom] nsrefcnt Release ();
Trait Implementations
impl XpCom for nsITextInputProcessorCallback
[src]
const IID: nsIID
IID: nsIID = nsID(601223746, 44469, 18161, [135, 102, 144, 209, 191, 3, 131, 223])
fn query_interface<T: XpCom>(&self) -> Option<RefPtr<T>>
[src]
Perform a QueryInterface call on this object, attempting to dynamically cast it to the requested interface type. Returns Some(RefPtr) if the cast succeeded, and None otherwise. Read more
impl RefCounted for nsITextInputProcessorCallback
[src]
unsafe fn addref(&self)
[src]
Increment the reference count.
unsafe fn release(&self)
[src]
Decrement the reference count, potentially freeing backing memory.
impl Deref for nsITextInputProcessorCallback
[src]
type Target = nsISupports
The resulting type after dereferencing.
fn deref(&self) -> &nsISupports
[src]
Dereferences the value.