Optional
aInstancePtr: objectA run time mechanism for interface discovery.
NS_OK if the interface is supported by the associated instance, NS_NOINTERFACE if it is not.
aInstancePtr must not be null.
[in] A requested interface IID
[out] A pointer to an interface pointer to receive the result.
When Gecko notifies IME of something or requests something to IME, this is called.
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; }
Reference to the nsITextInputProcessor service which is the original receiver of the request or notification.
Stores type of notifications and additional information.
Generated using TypeDoc
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.