| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 [ | 5 [ |
| 6 { | 6 { |
| 7 "namespace": "input.ime", | 7 "namespace": "input.ime", |
| 8 "description": "Use the <code>chrome.input.ime</code> API to implement a cus
tom IME for Chrome OS. This allows your extension to handle keystrokes, set the
composition, and manage the candidate window.", | 8 "description": "Use the <code>chrome.input.ime</code> API to implement a cus
tom IME for Chrome OS. This allows your extension to handle keystrokes, set the
composition, and manage the candidate window.", |
| 9 "types": [ | 9 "types": [ |
| 10 { | 10 { |
| 11 "id": "KeyboardEventType", |
| 12 "type": "string", |
| 13 "enum": ["keyup", "keydown"] |
| 14 }, |
| 15 { |
| 11 "id": "KeyboardEvent", | 16 "id": "KeyboardEvent", |
| 12 "type": "object", | 17 "type": "object", |
| 13 "description": "See http://www.w3.org/TR/DOM-Level-3-Events/#events-Keyb
oardEvent", | 18 "description": "See http://www.w3.org/TR/DOM-Level-3-Events/#events-Keyb
oardEvent", |
| 14 "properties": { | 19 "properties": { |
| 15 "type": {"type": "string", "description": "One of keyup or keydown.",
"enum": ["keyup", "keydown"]}, | 20 "type": {"$ref": "KeyboardEventType", "description": "One of keyup or
keydown."}, |
| 16 "requestId": {"type": "string", "description": "The ID of the request.
"}, | 21 "requestId": {"type": "string", "description": "The ID of the request.
"}, |
| 17 "extensionId": {"type": "string", "optional": true, "description": "Th
e extension ID of the sender of this keyevent."}, | 22 "extensionId": {"type": "string", "optional": true, "description": "Th
e extension ID of the sender of this keyevent."}, |
| 18 "key": {"type": "string", "description": "Value of the key being press
ed"}, | 23 "key": {"type": "string", "description": "Value of the key being press
ed"}, |
| 19 "code": {"type": "string", "description": "Value of the physical key b
eing pressed. The value is not affected by current keyboard layout or modifier s
tate."}, | 24 "code": {"type": "string", "description": "Value of the physical key b
eing pressed. The value is not affected by current keyboard layout or modifier s
tate."}, |
| 20 "keyCode": {"type": "integer", "optional": true, "description": "The d
eprecated HTML keyCode, which is system- and implementation-dependent numerical
code signifying the unmodified identifier associated with the key pressed."}, | 25 "keyCode": {"type": "integer", "optional": true, "description": "The d
eprecated HTML keyCode, which is system- and implementation-dependent numerical
code signifying the unmodified identifier associated with the key pressed."}, |
| 21 "altKey": {"type": "boolean", "optional": true, "description": "Whethe
r or not the ALT key is pressed."}, | 26 "altKey": {"type": "boolean", "optional": true, "description": "Whethe
r or not the ALT key is pressed."}, |
| 22 "ctrlKey": {"type": "boolean", "optional": true, "description": "Wheth
er or not the CTRL key is pressed."}, | 27 "ctrlKey": {"type": "boolean", "optional": true, "description": "Wheth
er or not the CTRL key is pressed."}, |
| 23 "shiftKey": {"type": "boolean", "optional": true, "description": "Whet
her or not the SHIFT key is pressed."}, | 28 "shiftKey": {"type": "boolean", "optional": true, "description": "Whet
her or not the SHIFT key is pressed."}, |
| 24 "capsLock": {"type": "boolean", "optional": true, "description": "Whet
her or not the CAPS_LOCK is enabled."} | 29 "capsLock": {"type": "boolean", "optional": true, "description": "Whet
her or not the CAPS_LOCK is enabled."} |
| 25 } | 30 } |
| 26 }, | 31 }, |
| 27 { | 32 { |
| 33 "id": "InputContextType", |
| 34 "type": "string", |
| 35 "description": "Type of value this text field edits, (Text, Number, URL,
etc)", |
| 36 "enum": ["text", "search", "tel", "url", "email", "number", "password"] |
| 37 }, |
| 38 { |
| 28 "id": "InputContext", | 39 "id": "InputContext", |
| 29 "type": "object", | 40 "type": "object", |
| 30 "description": "Describes an input Context", | 41 "description": "Describes an input Context", |
| 31 "properties": { | 42 "properties": { |
| 32 "contextID": {"type": "integer", "description": "This is used to speci
fy targets of text field operations. This ID becomes invalid as soon as onBlur
is called."}, | 43 "contextID": {"type": "integer", "description": "This is used to speci
fy targets of text field operations. This ID becomes invalid as soon as onBlur
is called."}, |
| 33 "type": {"type": "string", "description": "Type of value this text fie
ld edits, (Text, Number, URL, etc)", "enum": ["text", "search", "tel", "url", "e
mail", "number", "password"]}, | 44 "type": {"$ref": "InputContextType", "description": "Type of value thi
s text field edits, (Text, Number, URL, etc)"}, |
| 34 "autoCorrect": {"type": "boolean", "description": "Whether the text fi
eld wants auto-correct."}, | 45 "autoCorrect": {"type": "boolean", "description": "Whether the text fi
eld wants auto-correct."}, |
| 35 "autoComplete": {"type": "boolean", "description": "Whether the text f
ield wants auto-complete."}, | 46 "autoComplete": {"type": "boolean", "description": "Whether the text f
ield wants auto-complete."}, |
| 36 "spellCheck": {"type": "boolean", "description": "Whether the text fie
ld wants spell-check."} | 47 "spellCheck": {"type": "boolean", "description": "Whether the text fie
ld wants spell-check."} |
| 37 } | 48 } |
| 38 }, | 49 }, |
| 39 { | 50 { |
| 51 "id": "MenuItemStyle", |
| 52 "type": "string", |
| 53 "description": "The type of menu item. Radio buttons between separators
are considered grouped.", |
| 54 "enum": ["check", "radio", "separator"] |
| 55 }, |
| 56 { |
| 40 "id": "MenuItem", | 57 "id": "MenuItem", |
| 41 "type": "object", | 58 "type": "object", |
| 42 "description": "A menu item used by an input method to interact with the
user from the language menu.", | 59 "description": "A menu item used by an input method to interact with the
user from the language menu.", |
| 43 "properties": { | 60 "properties": { |
| 44 "id": {"type": "string", "description": "String that will be passed to
callbacks referencing this MenuItem."}, | 61 "id": {"type": "string", "description": "String that will be passed to
callbacks referencing this MenuItem."}, |
| 45 "label": {"type": "string", "optional": true, "description": "Text dis
played in the menu for this item."}, | 62 "label": {"type": "string", "optional": true, "description": "Text dis
played in the menu for this item."}, |
| 46 "style": { | 63 "style": { |
| 47 "type": "string", | 64 "$ref": "MenuItemStyle", |
| 48 "optional": true, | 65 "optional": true, |
| 49 "description": "Enum representing if this item is: check, radio, or
a separator. Radio buttons between separators are considered grouped.", | 66 "description": "The type of menu item." |
| 50 "enum": ["check", "radio", "separator"] | |
| 51 }, | 67 }, |
| 52 "visible": {"type": "boolean", "optional": true, "description": "Indic
ates this item is visible."}, | 68 "visible": {"type": "boolean", "optional": true, "description": "Indic
ates this item is visible."}, |
| 53 "checked": {"type": "boolean", "optional": true, "description": "Indic
ates this item should be drawn with a check."}, | 69 "checked": {"type": "boolean", "optional": true, "description": "Indic
ates this item should be drawn with a check."}, |
| 54 "enabled": {"type": "boolean", "optional": true, "description": "Indic
ates this item is enabled."} | 70 "enabled": {"type": "boolean", "optional": true, "description": "Indic
ates this item is enabled."} |
| 55 } | 71 } |
| 72 }, |
| 73 { |
| 74 "id": "UnderlineStyle", |
| 75 "type": "string", |
| 76 "description": "The type of the underline to modify this segment.", |
| 77 "enum": ["underline", "doubleUnderline", "noUnderline"] |
| 78 }, |
| 79 { |
| 80 "id": "WindowPosition", |
| 81 "type": "string", |
| 82 "description": "Where to display the candidate window. If set to 'cursor
', the window follows the cursor. If set to 'composition', the window is locked
to the beginning of the composition.", |
| 83 "enum": ["cursor", "composition"] |
| 84 }, |
| 85 { |
| 86 "id": "ScreenType", |
| 87 "type": "string", |
| 88 "enum": ["normal", "login", "lock", "secondary-login"], |
| 89 "description": "The screen type under which the IME is activated." |
| 90 }, |
| 91 { |
| 92 "id": "CallbackStyle", |
| 93 "type": "string", |
| 94 "enum": ["async"] |
| 95 }, |
| 96 { |
| 97 "id": "MouseButton", |
| 98 "type": "string", |
| 99 "description": "Which mouse buttons was clicked.", |
| 100 "enum": ["left", "middle", "right"] |
| 56 } | 101 } |
| 57 ], | 102 ], |
| 58 "functions": [ | 103 "functions": [ |
| 59 { | 104 { |
| 60 "name": "setComposition", | 105 "name": "setComposition", |
| 61 "type": "function", | 106 "type": "function", |
| 62 "description": "Set the current composition. If this extension does not
own the active IME, this fails.", | 107 "description": "Set the current composition. If this extension does not
own the active IME, this fails.", |
| 63 "parameters": [ | 108 "parameters": [ |
| 64 { | 109 { |
| 65 "name": "parameters", | 110 "name": "parameters", |
| (...skipping 30 matching lines...) Expand all Loading... |
| 96 "properties": { | 141 "properties": { |
| 97 "start": { | 142 "start": { |
| 98 "description": "Index of the character to start this segme
nt at", | 143 "description": "Index of the character to start this segme
nt at", |
| 99 "type": "integer" | 144 "type": "integer" |
| 100 }, | 145 }, |
| 101 "end": { | 146 "end": { |
| 102 "description": "Index of the character to end this segment
after.", | 147 "description": "Index of the character to end this segment
after.", |
| 103 "type": "integer" | 148 "type": "integer" |
| 104 }, | 149 }, |
| 105 "style": { | 150 "style": { |
| 106 "description": "The type of the underline to modify this s
egment.", | 151 "$ref": "UnderlineStyle", |
| 107 "enum": ["underline", "doubleUnderline", "noUnderline"], | 152 "description": "The type of the underline to modify this s
egment." |
| 108 "type": "string" | |
| 109 } | 153 } |
| 110 } | 154 } |
| 111 } | 155 } |
| 112 } | 156 } |
| 113 } | 157 } |
| 114 }, | 158 }, |
| 115 { | 159 { |
| 116 "type": "function", | 160 "type": "function", |
| 117 "name": "callback", | 161 "name": "callback", |
| 118 "optional": true, | 162 "optional": true, |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 "type": "string", | 309 "type": "string", |
| 266 "optional": true, | 310 "optional": true, |
| 267 "description": "Text that is shown at the bottom of the cand
idate window." | 311 "description": "Text that is shown at the bottom of the cand
idate window." |
| 268 }, | 312 }, |
| 269 "auxiliaryTextVisible": { | 313 "auxiliaryTextVisible": { |
| 270 "type": "boolean", | 314 "type": "boolean", |
| 271 "optional": true, | 315 "optional": true, |
| 272 "description": "True to display the auxiliary text, false to
hide it." | 316 "description": "True to display the auxiliary text, false to
hide it." |
| 273 }, | 317 }, |
| 274 "windowPosition": { | 318 "windowPosition": { |
| 275 "type": "string", | 319 "$ref": "WindowPosition", |
| 276 "description": "Where to display the candidate window. If se
t to 'cursor', the window follows the cursor. If set to 'composition', the windo
w is locked to the beginning of the composition.", | 320 "description": "Where to display the candidate window.", |
| 277 "enum": ["cursor", "composition"], | |
| 278 "optional": true | 321 "optional": true |
| 279 } | 322 } |
| 280 } | 323 } |
| 281 } | 324 } |
| 282 } | 325 } |
| 283 }, | 326 }, |
| 284 { | 327 { |
| 285 "type": "function", | 328 "type": "function", |
| 286 "name": "callback", | 329 "name": "callback", |
| 287 "optional": true, | 330 "optional": true, |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 "name": "onActivate", | 537 "name": "onActivate", |
| 495 "type": "function", | 538 "type": "function", |
| 496 "description": "This event is sent when an IME is activated. It signals
that the IME will be receiving onKeyPress events.", | 539 "description": "This event is sent when an IME is activated. It signals
that the IME will be receiving onKeyPress events.", |
| 497 "parameters": [ | 540 "parameters": [ |
| 498 { | 541 { |
| 499 "type": "string", | 542 "type": "string", |
| 500 "name": "engineID", | 543 "name": "engineID", |
| 501 "description": "ID of the engine receiving the event" | 544 "description": "ID of the engine receiving the event" |
| 502 }, | 545 }, |
| 503 { | 546 { |
| 504 "type": "string", | |
| 505 "name": "screen", | 547 "name": "screen", |
| 506 "enum": ["normal", "login", "lock", "secondary-login"], | 548 "$ref": "ScreenType", |
| 507 "description": "The screen type under which the IME is activated." | 549 "description": "The screen type under which the IME is activated." |
| 508 } | 550 } |
| 509 ] | 551 ] |
| 510 }, | 552 }, |
| 511 { | 553 { |
| 512 "name": "onDeactivated", | 554 "name": "onDeactivated", |
| 513 "type": "function", | 555 "type": "function", |
| 514 "description": "This event is sent when an IME is deactivated. It signal
s that the IME will no longer be receiving onKeyPress events.", | 556 "description": "This event is sent when an IME is deactivated. It signal
s that the IME will no longer be receiving onKeyPress events.", |
| 515 "parameters": [ | 557 "parameters": [ |
| 516 { | 558 { |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 578 "description": "Data on the key event" | 620 "description": "Data on the key event" |
| 579 } | 621 } |
| 580 ], | 622 ], |
| 581 "extraParameters": [ | 623 "extraParameters": [ |
| 582 { | 624 { |
| 583 "type": "array", | 625 "type": "array", |
| 584 "optional": true, | 626 "optional": true, |
| 585 "name": "extraInfoSpec", | 627 "name": "extraInfoSpec", |
| 586 "description": "Array of extra information that specifies how the ca
llback is invoked.", | 628 "description": "Array of extra information that specifies how the ca
llback is invoked.", |
| 587 "items": { | 629 "items": { |
| 588 "type": "string", | 630 "$ref": "CallbackStyle" |
| 589 "enum": ["async"] | |
| 590 } | 631 } |
| 591 } | 632 } |
| 592 ], | 633 ], |
| 593 "returns": { | 634 "returns": { |
| 594 "type": "boolean", | 635 "type": "boolean", |
| 595 "description": "True if the keystroke was handled, false if not. This
function should always return a value if |async| is not specified.", | 636 "description": "True if the keystroke was handled, false if not. This
function should always return a value if |async| is not specified.", |
| 596 "optional": true | 637 "optional": true |
| 597 } | 638 } |
| 598 }, | 639 }, |
| 599 { | 640 { |
| 600 "name": "onCandidateClicked", | 641 "name": "onCandidateClicked", |
| 601 "type": "function", | 642 "type": "function", |
| 602 "description": "This event is sent if this extension owns the active IME
.", | 643 "description": "This event is sent if this extension owns the active IME
.", |
| 603 "parameters": [ | 644 "parameters": [ |
| 604 { | 645 { |
| 605 "type": "string", | 646 "type": "string", |
| 606 "name": "engineID", | 647 "name": "engineID", |
| 607 "description": "ID of the engine receiving the event" | 648 "description": "ID of the engine receiving the event" |
| 608 }, | 649 }, |
| 609 { | 650 { |
| 610 "type": "integer", | 651 "type": "integer", |
| 611 "name": "candidateID", | 652 "name": "candidateID", |
| 612 "description": "ID of the candidate that was clicked." | 653 "description": "ID of the candidate that was clicked." |
| 613 }, | 654 }, |
| 614 { | 655 { |
| 615 "type": "string", | |
| 616 "name": "button", | 656 "name": "button", |
| 617 "description": "Which mouse buttons was clicked.", | 657 "$ref": "MouseButton", |
| 618 "enum": ["left", "middle", "right"] | 658 "description": "Which mouse buttons was clicked." |
| 619 } | 659 } |
| 620 ] | 660 ] |
| 621 }, | 661 }, |
| 622 { | 662 { |
| 623 "name": "onMenuItemActivated", | 663 "name": "onMenuItemActivated", |
| 624 "type": "function", | 664 "type": "function", |
| 625 "description": "Called when the user selects a menu item", | 665 "description": "Called when the user selects a menu item", |
| 626 "parameters": [ | 666 "parameters": [ |
| 627 { | 667 { |
| 628 "type": "string", | 668 "type": "string", |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 675 { | 715 { |
| 676 "type": "string", | 716 "type": "string", |
| 677 "name": "engineID", | 717 "name": "engineID", |
| 678 "description": "ID of the engine receiving the event" | 718 "description": "ID of the engine receiving the event" |
| 679 } | 719 } |
| 680 ] | 720 ] |
| 681 } | 721 } |
| 682 ] | 722 ] |
| 683 } | 723 } |
| 684 ] | 724 ] |
| OLD | NEW |