Talk:WebAPI/KeboardIME: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(+ proposed API)
 
(Erratum)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Erratum ==
When it is said:
"[Line 9-30] a "entry_points" field specifies supported layouts."
Maybe it's not "entry_points", maybe it is referring to the "inputs" field.
== Proposed API (July 17 WIP) ==
== Proposed API (July 17 WIP) ==


Line 8: Line 14:


  interface nsIDOMInputMethod: nsIDOMEventTarget {
  interface nsIDOMInputMethod: nsIDOMEventTarget {
     // IMManager contain a few global methods expose to apps
     // Input Method Manager contain a few global methods expose to apps
     readonly attribute nsIDOMInputMethodManager mgmt;
     readonly attribute nsIDOMInputMethodManager mgmt;
   
   
Line 15: Line 21:
     attribute nsIDOMInputContext|null inputcontext;
     attribute nsIDOMInputContext|null inputcontext;
   
   
     // Fired when the inputcontext changes, include changes from and to null.
     // Fired when the input context changes, include changes from and to null.
     attribute nsIDOMEventListener oninputcontextchange;
     attribute nsIDOMEventListener oninputcontextchange;
  };
  };


  interface nsIDOMInputMethodManager {
  interface nsIDOMInputMethodManager {
     // Switch away from the current IME
     // Ask the OS to switch away from the current active Keyboard app.
    // OS should ignore this request if we are currently not the active one.
     void next();
     void next();
   
   
     // Show the list of IMEs available
     // Ask the OS to show a list of available IMEs for users to switch from.
     void: showList();
    // OS should ignore this request if we are currently not the active one.
     void showAll();
  };
  };


Line 39: Line 47:
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.
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.


* <code>inputcontextchange</code>: should also expose the nsIDOMInputContext object here
* <code>inputmethod-contextchange</code>: should also expose the nsIDOMInputContext object here
* <code>inputmethodnext</code>
* <code>inputmethod-next</code>
* <code>inputmethodshowlist</code>
* <code>inputmethod-showall</code>


=== mozbrowser API extension ===
=== mozbrowser API extension ===


* <code>setInputMethodActive(boolean)</code>: Depend on what we want, we might not want to re-use <code>setVisible()</code> to block/unblock a background/foreground keyboard app to interact with the text fields.
* <code>setInputMethodActive(boolean)</code>: Depend on what we want, we might not want to re-use <code>setVisible()</code> to block/unblock a background/foreground keyboard app to interact with the text fields.

Latest revision as of 14:36, 23 January 2014

Erratum

When it is said: "[Line 9-30] a "entry_points" field specifies supported layouts."

Maybe it's not "entry_points", maybe it is referring to the "inputs" field.

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 {
   // Ask the OS to switch away from the current active Keyboard app.
   // OS should ignore this request if we are currently not the active one.
   void next();

   // Ask the OS to show a list of available IMEs for users to switch from.
   // OS should ignore this request if we are currently not the active one.
   void showAll();
};
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.

  • inputmethod-contextchange: should also expose the nsIDOMInputContext object here
  • inputmethod-next
  • inputmethod-showall

mozbrowser API extension

  • setInputMethodActive(boolean): Depend on what we want, we might not want to re-use setVisible() to block/unblock a background/foreground keyboard app to interact with the text fields.