- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / common / extensions / api / virtual_keyboard_private.json
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.
4
5 [
6   {
7     "namespace": "virtualKeyboardPrivate",
8     "compiler_options": {
9       "implemented_in": "chrome/browser/extensions/api/input/input.h"
10     },
11     "platforms": ["chromeos"],
12     "description": "none",
13     "types": [
14       {
15         "id": "VirtualKeyboardEvent",
16         "type": "object",
17         "properties": {
18           "type": {"type": "string", "description": "One of keyup or keydown.", "enum": ["keyup", "keydown"]},
19           "charValue": {"type": "integer", "description": "Unicode value of the key."},
20           "keyCode": {"type": "integer", "description": "Virtual key code, which is independent of the keyboard layout or modifier state."},
21           "modifiers": {"type": "integer", "optional": true, "description": "Flag for modifiers that are active. None = 0, Shift = 2, Control = 4, Alt = 8."}
22         }
23       }
24     ],
25     "functions": [
26       {
27         "name": "insertText",
28         "type": "function",
29         "description": "Inserts text into the currently focused text field.",
30         "parameters": [
31           { "name": "text",
32             "type": "string",
33             "description": "The text that will be inserted."
34           },
35           { "type": "function",
36             "name": "callback",
37             "optional": true,
38             "description": "Called when the insertion is completed.",
39             "parameters": []
40           }
41         ]
42       },
43       {
44         "name": "moveCursor",
45         "type": "function",
46         "description": "Move cursor on the current focused textfield by swipe.",
47         "parameters": [
48           { "name": "swipe_direction",
49             "type": "integer",
50             "discription": "The direction of the cursor movement."
51           },
52           { "name": "modifier_flags",
53             "type": "integer",
54             "description": "Bitmask representing the state of the system modifier keys."
55           },
56           { "type": "function",
57             "name": "callback",
58             "optional": true,
59             "decription": "called when the swipe movement is completed.",
60             "parameters": []
61           }
62         ]
63       },
64       {
65         "name": "sendKeyEvent",
66         "type": "function",
67         "description": "Sends a fabricated key event to the focused input field.",
68         "parameters": [
69           { "name": "keyEvent",
70             "$ref": "VirtualKeyboardEvent",
71             "description": ""
72           },
73           { "name": "callback",
74             "type": "function",
75             "optional": true,
76             "description": "Called after processing the event.",
77             "parameters": []
78           }
79         ]
80       },
81       {
82         "name": "hideKeyboard",
83         "type": "function",
84         "description": "Hides the virtual keyboard.",
85         "parameters": [
86           { "type": "function",
87             "name": "callback",
88             "optional": true,
89             "description": "Called when the keyboard is hidden.",
90             "parameters": []
91           }
92         ]
93       },
94       {
95         "name": "keyboardLoaded",
96         "type": "function",
97         "description": "Inform the system that the keyboard has loaded.",
98         "parameters": [
99           { "type": "function",
100             "name": "callback",
101             "optional": true,
102             "description": "Called when load acknowledgement is complete.",
103             "parameters": []
104           }
105         ]
106       }
107     ],
108     "events": [
109       {
110         "name": "onTextInputBoxFocused",
111         "type": "function",
112         "description": "This event is sent when focus enters a text input box.",
113         "parameters": [
114           {
115             "type": "object",
116             "name": "context",
117             "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.",
118             "properties": {
119               "type": {
120                 "type": "string",
121                 "description": "The value of type attribute of the focused text input box.",
122                 "enum": ["text", "number", "password", "date", "url", "tel", "email"]
123               }
124             }
125           }
126         ]
127       }
128     ]
129   }
130 ]