Supervised user whitelists: Cleanup
[chromium-blink-merge.git] / extensions / common / api / virtual_keyboard_private.json
blobd79e76a5984e1a4f6191b7928321823ce30c4a29
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
6   {
7     "namespace": "virtualKeyboardPrivate",
8     "compiler_options": {
9       "implemented_in": "extensions/browser/api/virtual_keyboard_private/virtual_keyboard_private_api.h"
10     },
11     "platforms": ["chromeos"],
12     "description": "none",
13     "types": [
14       {
15         "id": "VirtualKeyboardEventType",
16         "type": "string",
17         "description": "One of keyup or keydown.",
18         "enum": ["keyup", "keydown"]
19       },
20       {
21         "id": "VirtualKeyboardEvent",
22         "type": "object",
23         "properties": {
24           "type": {"$ref": "VirtualKeyboardEventType"},
25           "charValue": {"type": "integer", "description": "Unicode value of the key."},
26           "keyCode": {"type": "integer", "description": "Virtual key code, which is independent of the keyboard layout or modifier state."},
27           "keyName": {"type": "string", "description": "Name of the key, which is independent of modifier state."},
28           "modifiers": {"type": "integer", "optional": true, "description": "Flag for modifiers that are active. None = 0, Shift = 2, Control = 4, Alt = 8."}
29         }
30       },
31       {
32         "id": "KeyboardMode",
33         "type": "string",
34         "enum": [ "FULL_WIDTH", "FLOATING" ],
35         "description": "The value of the virtual keyboard mode to set to."
36       },
37       {
38         "id": "OnTextInputBoxFocusedType",
39         "type": "string",
40         "description": "The value of type attribute of the focused text input box.",
41         "enum": ["text", "number", "password", "date", "url", "tel", "email"]
42        }
43     ],
44     "functions": [
45       {
46         "name": "insertText",
47         "type": "function",
48         "description": "Inserts text into the currently focused text field.",
49         "parameters": [
50           { "name": "text",
51             "type": "string",
52             "description": "The text that will be inserted."
53           },
54           { "type": "function",
55             "name": "callback",
56             "optional": true,
57             "description": "Called when the insertion is completed.",
58             "parameters": []
59           }
60         ]
61       },
62       {
63         "name": "moveCursor",
64         "type": "function",
65         "description": "Move cursor on the current focused textfield by swipe.",
66         "parameters": [
67           { "name": "swipe_direction",
68             "type": "integer",
69             "discription": "The direction of the cursor movement."
70           },
71           { "name": "modifier_flags",
72             "type": "integer",
73             "description": "Bitmask representing the state of the system modifier keys."
74           },
75           { "type": "function",
76             "name": "callback",
77             "optional": true,
78             "decription": "called when the swipe movement is completed.",
79             "parameters": []
80           }
81         ]
82       },
83       {
84         "name": "sendKeyEvent",
85         "type": "function",
86         "description": "Sends a fabricated key event to the focused input field.",
87         "parameters": [
88           { "name": "keyEvent",
89             "$ref": "VirtualKeyboardEvent",
90             "description": ""
91           },
92           { "name": "callback",
93             "type": "function",
94             "optional": true,
95             "description": "Called after processing the event.",
96             "parameters": []
97           }
98         ]
99       },
100       {
101         "name": "hideKeyboard",
102         "type": "function",
103         "description": "Hides the virtual keyboard.",
104         "parameters": [
105           { "type": "function",
106             "name": "callback",
107             "optional": true,
108             "description": "Called when the keyboard is hidden.",
109             "parameters": []
110           }
111         ]
112       },
113       {
114         "name": "lockKeyboard",
115         "type": "function",
116         "description": "Sets the lock state of the virtual keyboard. A locked keyboard remains visible even after a text area loses input focus.",
117         "parameters": [
118           {
119             "type": "boolean",
120             "name": "lock"
121           }
122         ]
123       },
124       {
125         "name": "keyboardLoaded",
126         "type": "function",
127         "description": "Inform the system that the keyboard has loaded.",
128         "parameters": [
129           { "type": "function",
130             "name": "callback",
131             "optional": true,
132             "description": "Called when load acknowledgement is complete.",
133             "parameters": []
134           }
135         ]
136       },
137       {
138         "name": "getKeyboardConfig",
139         "type": "function",
140         "description": "Gets the virtual keyboard configuration.",
141         "parameters": [
142           {
143             "type": "function",
144             "name": "callback",
145             "optional": true,
146             "description": "Called when querying virtual keyboard configuration is complete.",
147             "parameters": [
148               {
149                 "type": "object",
150                 "name": "config",
151                 "properties": {
152                   "layout": {
153                     "type": "string",
154                     "minLength": 1,
155                     "description": "Virtual keyboard layout string."
156                   },
157                   "a11ymode": {
158                     "type": "boolean",
159                     "description": "True if accessibility virtual keyboard is enabled."
160                   },
161                   "experimental": {
162                     "type": "boolean",
163                     "description": "True if experimental features are enabled."
164                   },
165                   "features": {
166                     "type": "array",
167                     "items": { "type": "string" },
168                     "description": "List of experimental feature flags."
169                   }
170                 }
171               }
172             ]
173           }
174         ]
175       },
176       {
177         "name": "openSettings",
178         "type": "function",
179         "description": "Opens chrome://settings/languages page.",
180         "parameters": [
181         ]
182       },
183       {
184         "name": "setMode",
185         "type": "function",
186         "description": "Sets the virtual keyboard mode.",
187         "parameters": [
188           {
189             "$ref": "KeyboardMode",
190             "name": "mode",
191             "description": "The value of the virtual keyboard mode to set to."
192           }
193         ]
194       }
196     ],
197     "events": [
198       {
199         "name": "onTextInputBoxFocused",
200         "type": "function",
201         "description": "This event is sent when focus enters a text input box.",
202         "parameters": [
203           {
204             "type": "object",
205             "name": "context",
206             "description": "Describes the text input box that has acquired focus. Note only the type of text input box is passed. This API is intended to be used by non-ime virtual keyboard only. Normal ime virtual keyboard should use chrome.input.ime.onFocus to get the more detailed InputContext.",
207             "properties": {
208               "type": {
209                 "$ref": "OnTextInputBoxFocusedType",
210                 "description": "The value of type attribute of the focused text input box."
211               }
212             }
213           }
214         ]
215       }
216     ]
217   }