Talk:WebAPI/KeboardIME: Difference between revisions
Jump to navigation
Jump to search
(+ proposed API) |
|||
| Line 8: | Line 8: | ||
interface nsIDOMInputMethod: nsIDOMEventTarget { | interface nsIDOMInputMethod: nsIDOMEventTarget { | ||
// | // Input Method Manager contain a few global methods expose to apps | ||
readonly attribute nsIDOMInputMethodManager mgmt; | readonly attribute nsIDOMInputMethodManager mgmt; | ||
| Line 15: | Line 15: | ||
attribute nsIDOMInputContext|null inputcontext; | attribute nsIDOMInputContext|null inputcontext; | ||
// Fired when the | // Fired when the input context changes, include changes from and to null. | ||
attribute nsIDOMEventListener oninputcontextchange; | attribute nsIDOMEventListener oninputcontextchange; | ||
}; | }; | ||
| Line 24: | Line 24: | ||
// Show the list of IMEs available | // Show the list of IMEs available | ||
void | void showList(); | ||
}; | }; | ||
Revision as of 08:25, 17 July 2013
Proposed API (July 17 WIP)
mozInputMethod API to Keyboard Apps
partial interface Navigator {
readonly attribute nsIDOMInputMethod mozInputMethod;
};
interface nsIDOMInputMethod: nsIDOMEventTarget {
// Input Method Manager contain a few global methods expose to apps
readonly attribute nsIDOMInputMethodManager mgmt;
// An "input context" is mapped to a text field that the app is allow to mutate.
// this attribute should be null when there is no text field currently focused.
attribute nsIDOMInputContext|null inputcontext;
// Fired when the input context changes, include changes from and to null.
attribute nsIDOMEventListener oninputcontextchange;
};
interface nsIDOMInputMethodManager {
// Switch away from the current IME
void next();
// Show the list of IMEs available
void showList();
};
interface nsIDOMInputContext {
// an "input context" gets void when the app is no longer allowed to interact with the text field,
// e.g., the text field is no longer exists, the app is being switched to background, etc.
// All the properties and methods necessary to work with a specific text field should be here.
....
}
mozChromeEvents to System apps
Here are some signals necessary to Keyboard Manager in System app in order for it to do minimal interaction with keyboard app and text field.
inputcontextchange: should also expose the nsIDOMInputContext object hereinputmethodnextinputmethodshowlist
mozbrowser API extension
setInputMethodActive(boolean): Depend on what we want, we might not want to re-usesetVisible()to block/unblock a background/foreground keyboard app to interact with the text fields.