WebAPI/KeboardIME: Difference between revisions

Jump to navigation Jump to search
Line 53: Line 53:
     // User moves the cursor, changes the selection, or alters the composing text length
     // User moves the cursor, changes the selection, or alters the composing text length
     attribute Function onselectionchange;
     attribute Function onselectionchange;
    // Listener to get noftified when the content of the current input field has
    // changed.
    attribute nsIDOMEventListener ontextchange;
   
   
     // Send a keyevent to the input field that is currently attached. It exists in the current interface
     // Send a keyevent to the input field that is currently attached. It exists in the current interface
     void sendKey(in long keyCode, in long charCode, in long modifiers);
     void sendKey(in long keyCode, in long charCode, in long modifiers);
   
   
     // Insert the given text at the cursor position. Replace the selected text if any and clear the composing text.
    /*
     void commitText(in DOMString text);
     * Replace text around the beginning of the current selection range of the
    * editable text and clear the composing text.
     *
    * @param text The string to be replaced with.
    * @param beforeLength The number of characters to be deleted before the
    * beginning of the current selection range. Defaults to 0.
    * @param afterLength The number of characters to be deleted after the
    * beginning of the current selection range. Defaults to 0.
    */
    void replaceSurroundingText(in DOMString text, [optional] in long beforeLength,
                                [optional] in long afterLength);
   
   
     // Set the text value of the current input field.  
     // Set the text value of the current input field.  
     void setText(in DOMString text);
     void setText(in DOMString text);
   
   
     // Get the text value of the current input field asynchronously.
     /*
      * Get a substring of the text content of the current input field.
      * @param start The start index of the substring.
      * @param end The end index of the substring. The character at the end index
      * is not included.
      */
     void getText(in long start, in long end, in Function callback);
     void getText(in long start, in long end, in Function callback);
   
   
     // Length of the content
     // Length of the content
     readonly attribute long textLength;
     readonly attribute long textLength;
    // Delete text around the cursor
    void deleteSurroundingText(in long beforeLength, in long afterLength);
   
   
     // Set the composing text before the current cursor position.
     // Set the composing text before the current cursor position.
Line 80: Line 96:
     readonly attribute long selectionEnd;
     readonly attribute long selectionEnd;
   
   
     // Set the selection range of the the editable text.
     /*
    // Note that the start position should be less or equal to the end position.
      * Set the selection range of the the editable text.
    // To move the cursor, set the start and end position to the same value.
      *
    void setSelectionRange(in long start, in long end);
      * @param start The beginning of the selected text.
      * @param end The end of the selected text.
    // Clear the focus of the current input field and hide the keyboard.
      *
    void removeFocus();
      * Note that the start position should be less or equal to the end position.
      * To move the cursor, set the start and end position to the same value.
    // Focus the next text field.
      */
    void advanceFocus();
      void setSelectionRange(in long start, in long end);
    // Focus the previous text field.
    void rewindFocus();
   
   
    // This read only attribute is true if user can advance the focus to the next
      // Clear the focus of the current input field and hide the keyboard.
    // text field.
      void removeFocus();
    readonly attribute boolean canAdvanceFocus;
   
   
    // This readonly attribute is true if user can rewind the focus back to the
      // Focus the next text field.
    // previous text field.
      void advanceFocus();
    readonly attribute boolean canRewindFocus;
   
   
    // The input mode string.
      // Focus the previous text field.
    // https://bugzilla.mozilla.org/show_bug.cgi?id=796544
      void rewindFocus();
    // It can be one of the following values:
    // "none"
    // "verbatim"  - no capitalization, no word suggestions
    // "latin"          - word suggestions but no capitalization
    // "latin-prose" - word suggestions and capitalization at the start of sentences
    // "latin-name" - word suggestions and capitalize each word
    readonly attribute DOMString inputMode;
   
   
    // The type of the input field, including text, number, password, url, tel and email.
      // This read only attribute is true if user can advance the focus to the next
    readonly attribute DOMString inputType;
      // text field.
      readonly attribute boolean canAdvanceFocus;
   
   
    // Get the return key type, which determines the title of the key displayed in the keyboard and action
      // This readonly attribute is true if user can rewind the focus back to the
    // performed when it is  pressed. The value could be "done", "next", "go", "search" and "send".
      // previous text field.
    // If the value is "next", when pressing the enter key, the focus should be move to the next input field.
      readonly attribute boolean canRewindFocus;
    readonly attribute DOMString returnKeyType;
   
   
     // Get the customized label for the return key.
      // The input mode string.
    readonly attribute DOMString returnKeyLabel;
      // https://bugzilla.mozilla.org/show_bug.cgi?id=796544
      // It can be one of the following values:
      // "none"
      // "verbatim"    - no capitalization, no word suggestions
      // "latin"      - word suggestions but no capitalization
      // "latin-prose" - word suggestions and capitalization at the start of sentences
      // "latin-name"  - word suggestions and capitalize each word
      // "digits"     - digits(0-9) only.
      readonly attribute DOMString inputMode;
 
      // The type of the input field, including text, number, password, url, tel and email.
      readonly attribute DOMString inputType;
 
      // Get the return key name, which determines the title of the key displayed in the keyboard and action
      // performed when it is  pressed. The value could be "done", "next", "go", "search", "send" or other
      // customized label for the return key.
      // If the value is "next", when pressing the enter key, the focus should be move to the next input field.
      readonly attribute DOMString returnKey;
  };
  };


Confirmed users
58

edits

Navigation menu