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]

[src]

Cast this nsITextInputProcessorCallback to one of its base interfaces.

impl nsITextInputProcessorCallback
[src]

[src]

/**
   * 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>

[src]

Cast this nsISupports to one of its base interfaces.

[src]

void QueryInterface (in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result);

[src]

[noscript,notxpcom] nsrefcnt AddRef ();

[src]

[noscript,notxpcom] nsrefcnt Release ();

Trait Implementations

impl XpCom for nsITextInputProcessorCallback
[src]

IID: nsIID = nsID(601223746, 44469, 18161, [135, 102, 144, 209, 191, 3, 131, 223])

[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]

[src]

Increment the reference count.

[src]

Decrement the reference count, potentially freeing backing memory.

impl Deref for nsITextInputProcessorCallback
[src]

The resulting type after dereferencing.

[src]

Dereferences the value.