summaryrefslogtreecommitdiffstats
path: root/chromium/chrome/common/extensions/api/input_ime.json
blob: ee095025ee9d81db368fe14b66857ffd43182134 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

[
  {
    "namespace": "input.ime",
    "description": "Use the <code>chrome.input.ime</code> API to implement a custom IME for Chrome OS. This allows your extension to handle keystrokes, set the composition, and manage the candidate window.",
    "types": [
      {
        "id": "KeyboardEventType",
        "type": "string",
        "enum": ["keyup", "keydown"]
      },
      {
        "id": "KeyboardEvent",
        "type": "object",
        "description": "See http://www.w3.org/TR/DOM-Level-3-Events/#events-KeyboardEvent",
        "properties": {
          "type": {"$ref": "KeyboardEventType", "description": "One of keyup or keydown."},
          "requestId": {"type": "string", "optional": true, "description": "(Deprecated) The ID of the request. Use the <code>requestId</code> param from the <code>onKeyEvent</code> event instead."},
          "extensionId": {"type": "string", "optional": true, "description": "The extension ID of the sender of this keyevent."},
          "key": {"type": "string", "description": "Value of the key being pressed"},
          "code": {"type": "string", "description": "Value of the physical key being pressed. The value is not affected by current keyboard layout or modifier state."},
          "keyCode": {"type": "integer", "optional": true, "description": "The deprecated HTML keyCode, which is system- and implementation-dependent numerical code signifying the unmodified identifier associated with the key pressed."},
          "altKey": {"type": "boolean", "optional": true, "description": "Whether or not the ALT key is pressed."},
          "altgrKey": {"type": "boolean", "optional": true, "description": "Whether or not the ALTGR key is pressed."},
          "ctrlKey": {"type": "boolean", "optional": true, "description": "Whether or not the CTRL key is pressed."},
          "shiftKey": {"type": "boolean", "optional": true, "description": "Whether or not the SHIFT key is pressed."},
          "capsLock": {"type": "boolean", "optional": true, "description": "Whether or not the CAPS_LOCK is enabled."}
        }
      },
      {
        "id": "InputContextType",
        "type": "string",
        "description": "Type of value this text field edits, (Text, Number, URL, etc)",
        "enum": ["text", "search", "tel", "url", "email", "number", "password"]
      },
      {
        "id": "AutoCapitalizeType",
        "type": "string",
        "description": "The auto-capitalize type of the text field.",
        "enum": ["characters", "words", "sentences"]
      },
      {
        "id": "InputContext",
        "type": "object",
        "description": "Describes an input Context",
        "properties": {
          "contextID": {"type": "integer", "description": "This is used to specify targets of text field operations.  This ID becomes invalid as soon as onBlur is called."},
          "type": {"$ref": "InputContextType", "description": "Type of value this text field edits, (Text, Number, URL, etc)"},
          "autoCorrect": {"type": "boolean", "description": "Whether the text field wants auto-correct."},
          "autoComplete": {"type": "boolean", "description": "Whether the text field wants auto-complete."},
          "autoCapitalize": {"$ref": "AutoCapitalizeType", "description": "The auto-capitalize type of the text field."},
          "spellCheck": {"type": "boolean", "description": "Whether the text field wants spell-check."},
          "shouldDoLearning": {"type": "boolean", "description": "Whether text entered into the text field should be used to improve typing suggestions for the user."}
        }
      },
      {
        "id": "MenuItemStyle",
        "type": "string",
        "description": "The type of menu item. Radio buttons between separators are considered grouped.",
        "enum": ["check", "radio", "separator"]
      },
      {
        "id": "MenuItem",
        "type": "object",
        "description": "A menu item used by an input method to interact with the user from the language menu.",
        "properties": {
          "id": {"type": "string", "description": "String that will be passed to callbacks referencing this MenuItem."},
          "label": {"type": "string", "optional": true, "description": "Text displayed in the menu for this item."},
          "style": {
            "$ref": "MenuItemStyle",
            "optional": true,
            "description": "The type of menu item."
          },
          "visible": {"type": "boolean", "optional": true, "description": "Indicates this item is visible."},
          "checked": {"type": "boolean", "optional": true, "description": "Indicates this item should be drawn with a check."},
          "enabled": {"type": "boolean", "optional": true, "description": "Indicates this item is enabled."}
        }
      },
      {
        "id": "UnderlineStyle",
        "type": "string",
        "description": "The type of the underline to modify this segment.",
        "enum": ["underline", "doubleUnderline", "noUnderline"]
      },
      {
        "id": "WindowPosition",
        "type": "string",
        "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.",
        "enum": ["cursor", "composition"]
      },
      {
        "id": "ScreenType",
        "type": "string",
        "enum": ["normal", "login", "lock", "secondary-login"],
        "description": "The screen type under which the IME is activated."
      },
      {
        "id": "MouseButton",
        "type": "string",
        "description": "Which mouse buttons was clicked.",
        "enum": ["left", "middle", "right"]
      },
      {
        "id": "WindowType",
        "type": "string",
        "description": "The IME window types.",
        "platforms": ["win", "linux"],
        "enum": ["normal", "followCursor"]
      },
      {
        "id": "Bounds",
        "type": "object",
        "description": "Describes the screen coordinates of a rect.",
        "platforms": ["win", "linux"],
        "properties": {
          "left": {"type": "integer", "description": "The left of the bounds."},
          "top": {"type": "integer", "description": "The top of the bounds."},
          "width": {"type": "integer", "description": "The width of the bounds." },
          "height": {"type": "integer", "description": "The height of the bounds ."}
        }
      },
      {
        "id": "CreateWindowOptions",
        "type": "object",
        "description": "The options to create an IME window",
        "platforms": ["win", "linux"],
        "properties": {
          "windowType": {"$ref": "WindowType"},
          "url": {"type": "string", "optional": true},
          "bounds": {"$ref": "Bounds", "optional": true}
        }
      }
    ],
    "functions": [
      {
        "name": "setComposition",
        "type": "function",
        "description": "Set the current composition. If this extension does not own the active IME, this fails.",
        "platforms": ["chromeos", "win", "linux"],
        "parameters": [
          {
            "name": "parameters",
            "type": "object",
            "properties": {
              "contextID": {
                "description": "ID of the context where the composition text will be set",
                "type": "integer"
              },
              "text": {
                "description": "Text to set",
                "type": "string"
              },
              "selectionStart": {
                "description": "Position in the text that the selection starts at.",
                "optional": true,
                "type": "integer"
              },
              "selectionEnd": {
                "description": "Position in the text that the selection ends at.",
                "optional": true,
                "type": "integer"
              },
              "cursor": {
                "description": "Position in the text of the cursor.",
                "type": "integer"
              },
              "segments": {
                "description": "List of segments and their associated types.",
                "type": "array",
                "optional": true,
                "items": {
                  "type": "object",
                  "properties": {
                    "start": {
                      "description": "Index of the character to start this segment at",
                      "type": "integer"
                    },
                    "end": {
                      "description": "Index of the character to end this segment after.",
                      "type": "integer"
                    },
                    "style": {
                      "$ref": "UnderlineStyle",
                      "description": "The type of the underline to modify this segment."
                    }
                  }
                }
              }
            }
          },
          {
            "type": "function",
            "name": "callback",
            "optional": true,
            "description": "Called when the operation completes with a boolean indicating if the text was accepted or not. On failure, chrome.runtime.lastError is set.",
            "parameters": [
              {
                "name": "success",
                "type": "boolean"
              }
            ]
          }
        ]
      },
      {
        "name": "clearComposition",
        "type": "function",
        "description": "Clear the current composition. If this extension does not own the active IME, this fails.",
        "platforms": ["chromeos"],
        "parameters": [
          {
            "name": "parameters",
            "type": "object",
            "properties": {
              "contextID": {
                "description": "ID of the context where the composition will be cleared",
                "type": "integer"
              }
            }
          },
          {
            "type": "function",
            "name": "callback",
            "optional": true,
            "description": "Called when the operation completes with a boolean indicating if the text was accepted or not. On failure, chrome.runtime.lastError is set.",
            "parameters": [
              {
                "name": "success",
                "type": "boolean"
              }
            ]
          }
        ]
      },
      {
        "name": "commitText",
        "type": "function",
        "description": "Commits the provided text to the current input.",
        "platforms": ["chromeos", "win", "linux"],
        "parameters": [
          {
            "name": "parameters",
            "type": "object",
            "properties": {
              "contextID": {
                "description": "ID of the context where the text will be committed",
                "type": "integer"
              },
              "text": {
                "description": "The text to commit",
                "type": "string"
              }
            }
          },
          {
            "type": "function",
            "name": "callback",
            "optional": true,
            "description": "Called when the operation completes with a boolean indicating if the text was accepted or not. On failure, chrome.runtime.lastError is set.",
            "parameters": [
              {
                "name": "success",
                "type": "boolean"
              }
            ]
          }
        ]
      },
      {
        "name": "sendKeyEvents",
        "type": "function",
        "description": "Sends the key events.  This function is expected to be used by virtual keyboards.  When key(s) on a virtual keyboard is pressed by a user, this function is used to propagate that event to the system.",
        "platforms": ["chromeos", "win", "linux"],
        "parameters": [
          {
            "name": "parameters",
            "type": "object",
            "properties": {
              "contextID": {
                "description": "ID of the context where the key events will be sent, or zero to send key events to non-input field.",
                "type": "integer"
              },
              "keyData": {
                "type": "array",
                "description": "Data on the key event.",
                "items": {
                  "$ref": "KeyboardEvent"
                }
              }
            }
          },
          {
            "type": "function",
            "name": "callback",
            "optional": true,
            "description": "Called when the operation completes.",
            "parameters": []
          }
        ]
      },
      {
        "name": "hideInputView",
        "type": "function",
        "description": "Hides the input view window, which is popped up automatically by system. If the input view window is already hidden, this function will do nothing.",
        "platforms": ["chromeos"],
        "parameters": []
      },
      {
        "name": "setCandidateWindowProperties",
        "type": "function",
        "description": "Sets the properties of the candidate window. This fails if the extension doesn't own the active IME",
        "platforms": ["chromeos"],
        "parameters": [
          {
            "name": "parameters",
            "type": "object",
            "properties": {
              "engineID": {
                "description": "ID of the engine to set properties on.",
                "type": "string"
              },
              "properties": {
                "type": "object",
                "properties": {
                  "visible": {
                    "type": "boolean",
                    "optional": true,
                    "description": "True to show the Candidate window, false to hide it."
                  },
                  "cursorVisible": {
                    "type": "boolean",
                    "optional": true,
                    "description": "True to show the cursor, false to hide it."
                  },
                  "vertical": {
                    "type": "boolean",
                    "optional": true,
                    "description": "True if the candidate window should be rendered vertical, false to make it horizontal."
                  },
                  "pageSize": {
                    "type": "integer",
                    "optional": true,
                    "description": "The number of candidates to display per page."
                  },
                  "auxiliaryText": {
                    "type": "string",
                    "optional": true,
                    "description": "Text that is shown at the bottom of the candidate window."
                  },
                  "auxiliaryTextVisible": {
                    "type": "boolean",
                    "optional": true,
                    "description": "True to display the auxiliary text, false to hide it."
                  },
                  "windowPosition": {
                    "$ref": "WindowPosition",
                    "description": "Where to display the candidate window.",
                    "optional": true
                  }
                }
              }
            }
          },
          {
            "type": "function",
            "name": "callback",
            "optional": true,
            "description": "Called when the operation completes.",
            "parameters": [
              {
                "name": "success",
                "type": "boolean"
              }
            ]
          }
        ]
      },
      {
        "name": "setCandidates",
        "type": "function",
        "description": "Sets the current candidate list. This fails if this extension doesn't own the active IME",
        "platforms": ["chromeos"],
        "parameters": [
          {
            "name": "parameters",
            "type": "object",
            "properties": {
              "contextID": {
                "description": "ID of the context that owns the candidate window.",
                "type": "integer"
              },
              "candidates": {
                "description": "List of candidates to show in the candidate window",
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "candidate": {"type": "string", "description": "The candidate"},
                    "id": {"type": "integer", "description": "The candidate's id"},
                    "parentId": {"type": "integer", "optional": true, "description": "The id to add these candidates under"},
                    "label": {"type": "string", "optional": true, "description": "Short string displayed to next to the candidate, often the shortcut key or index"},
                    "annotation": {"type": "string", "optional": true, "description": "Additional text describing the candidate"},
                    "usage": {
                      "type": "object",
                      "optional": true,
                      "description": "The usage or detail description of word.",
                      "properties": {
                        "title": { "type": "string", "description": "The title string of details description."},
                        "body": { "type": "string", "description": "The body string of detail description."}
                      }
                    }
                  }
                }
              }
            }
          },
          {
            "type": "function",
            "name": "callback",
            "optional": true,
            "description": "Called when the operation completes.",
            "parameters": [
              {
                "name": "success",
                "type": "boolean"
              }
            ]
          }
        ]
      },
      {
        "name": "setCursorPosition",
        "type": "function",
        "description": "Set the position of the cursor in the candidate window. This is a no-op if this extension does not own the active IME.",
        "platforms": ["chromeos"],
        "parameters": [
          {
            "name": "parameters",
            "type": "object",
            "properties": {
              "contextID": {
                "description": "ID of the context that owns the candidate window.",
                "type": "integer"
              },
              "candidateID": {
                "description": "ID of the candidate to select.",
                "type": "integer"
              }
            }
          },
          {
            "type": "function",
            "name": "callback",
            "optional": true,
            "description": "Called when the operation completes",
            "parameters": [
              {
                "name": "success",
                "type": "boolean"
              }
            ]
          }
        ]
      },
      {
        "name": "setMenuItems",
        "type": "function",
        "description": "Adds the provided menu items to the language menu when this IME is active.",
        "platforms": ["chromeos"],
        "parameters": [
          {
            "name": "parameters",
            "type": "object",
            "properties": {
              "engineID": {
                "description": "ID of the engine to use",
                "type": "string"
              },
              "items": {
                "description": "MenuItems to add. They will be added in the order they exist in the array.",
                "type": "array",
                "items": {
                  "$ref": "MenuItem"
                }
              }
            }
          },
          {
            "type": "function",
            "name": "callback",
            "optional": true,
            "description": "",
            "parameters": []
          }
        ]
      },
      {
        "name": "updateMenuItems",
        "type": "function",
        "description": "Updates the state of the MenuItems specified",
        "platforms": ["chromeos"],
        "parameters": [
          {
            "name": "parameters",
            "type": "object",
            "properties": {
              "engineID": {
                "description": "ID of the engine to use",
                "type": "string"
              },
              "items": {
                "description": "Array of MenuItems to update",
                "type": "array",
                "items": {
                  "$ref": "MenuItem"
                }
              }
            }
          },
          {
            "type": "function",
            "name": "callback",
            "optional": true,
            "description": "Called when the operation completes",
            "parameters": []
          }
        ]
      },
      {
        "name": "deleteSurroundingText",
        "type": "function",
        "description": "Deletes the text around the caret.",
        "platforms": ["chromeos"],
        "parameters": [
          {
            "name": "parameters",
            "type": "object",
            "properties": {
              "engineID": {
                "type": "string",
                "description": "ID of the engine receiving the event."
              },
              "contextID": {
                "type": "integer",
                "description": "ID of the context where the surrounding text will be deleted."
              },
              "offset": {
                "type": "integer",
                "description": "The offset from the caret position where deletion will start. This value can be negative."
              },
              "length": {
                "type": "integer",
                "description": "The number of characters to be deleted",
                "minimum": 0
              }
            }
          },
          {
            "type": "function",
            "name": "callback",
            "optional": true,
            "description": "Called when the operation completes.",
            "parameters": []
          }
        ]
      },
      {
        "name": "keyEventHandled",
        "type": "function",
        "description": "Indicates that the key event received by onKeyEvent is handled.  This should only be called if the onKeyEvent listener is asynchronous.",
        "platforms": ["chromeos", "win", "linux"],
        "parameters": [
          {"type": "string", "name": "requestId", "description": "Request id of the event that was handled.  This should come from keyEvent.requestId"},
          {"type": "boolean", "name": "response", "description": "True if the keystroke was handled, false if not"}
        ]
      },
      {
        "name": "createWindow",
        "type": "function",
        "description": "Creates IME window.",
        "platforms": ["win", "linux"],
        "parameters": [
          {
            "$ref": "CreateWindowOptions",
            "name": "options",
            "description": "The options of the newly created IME window."
          },
          {
            "type": "function",
            "name": "callback",
            "description": "Called when the operation completes.",
            "parameters": [
              {
                "name": "windowObject",
                "type": "object",
                "isInstanceOf": "Window",
                "description": "The JavaScript 'window' object of the newly created IME window. It contains the additional 'id' property for the parameters of the other functions like showWindow/hideWindow."
              }
            ]
           }
         ]
      },
      {
        "name": "showWindow",
        "type": "function",
        "description": "Shows the IME window. This makes the hidden window visible.",
        "platforms": ["win", "linux"],
        "parameters": [
          {
            "type": "integer",
            "name": "windowId",
            "description": "The ID of the IME window."
          },
          {
            "type": "function",
            "name": "callback",
            "optional": true,
            "description": "Called when the operation completes.",
            "parameters": []
           }
         ]
      },
      {
        "name": "hideWindow",
        "type": "function",
        "description": "Hides the IME window. This doesn't close the window. Instead, it makes the window invisible. The extension can cache the window and show/hide it for better performance.",
        "platforms": ["win", "linux"],
        "parameters": [
          {
            "type": "integer",
            "name": "windowId",
            "description": "The ID of the IME window."
          },
          {
            "type": "function",
            "name": "callback",
            "optional": true,
            "description": "Called when the operation completes.",
            "parameters": []
           }
         ]
      },
      {
        "name": "activate",
        "type": "function",
        "description": "Activates the IME extension so that it can receive events.",
        "platforms": ["win", "linux"],
        "parameters": [
          {
            "type": "function",
            "name": "callback",
            "optional": true,
            "description": "Called when the operation completes.",
            "parameters": []
          }
        ]
      },
      {
        "name": "deactivate",
        "type": "function",
        "description": "Deactivates the IME extension so that it cannot receive events.",
        "platforms": ["win", "linux"],
        "parameters": [
          {
            "type": "function",
            "name": "callback",
            "optional": true,
            "description": "Called when the operation completes.",
            "parameters": []
          }
        ]
      }
    ],
    "events": [
      {
        "name": "onActivate",
        "type": "function",
        "description": "This event is sent when an IME is activated. It signals that the IME will be receiving onKeyPress events.",
        "platforms": ["chromeos", "win", "linux"],
        "parameters": [
          {
            "type": "string",
            "name": "engineID",
            "description": "ID of the engine receiving the event"
          },
          {
            "name": "screen",
            "$ref": "ScreenType",
            "description": "The screen type under which the IME is activated."
          }
        ]
      },
      {
        "name": "onDeactivated",
        "type": "function",
        "description": "This event is sent when an IME is deactivated. It signals that the IME will no longer be receiving onKeyPress events.",
        "platforms": ["chromeos", "win", "linux"],
        "parameters": [
          {
            "type": "string",
            "name": "engineID",
            "description": "ID of the engine receiving the event"
          }
        ]
      },
      {
        "name": "onFocus",
        "type": "function",
        "description": "This event is sent when focus enters a text box. It is sent to all extensions that are listening to this event, and enabled by the user.",
        "platforms": ["chromeos", "win", "linux"],
        "parameters": [
          {
            "$ref": "InputContext",
            "name": "context",
            "description": "Describes the text field that has acquired focus."
          }
        ]
      },
      {
        "name": "onBlur",
        "type": "function",
        "description": "This event is sent when focus leaves a text box. It is sent to all extensions that are listening to this event, and enabled by the user.",
        "platforms": ["chromeos", "win", "linux"],
        "parameters": [
          {
            "type": "integer",
            "name": "contextID",
            "description": "The ID of the text field that has lost focus. The ID is invalid after this call"
          }
        ]
      },
      {
        "name": "onInputContextUpdate",
        "type": "function",
        "description": "This event is sent when the properties of the current InputContext change, such as the the type. It is sent to all extensions that are listening to this event, and enabled by the user.",
        "platforms": ["chromeos"],
        "parameters": [
          {
            "$ref": "InputContext",
            "name": "context",
            "description": "An InputContext object describing the text field that has changed."
          }
        ]
      },
      {
        "name": "onKeyEvent",
        "type": "function",
        "description": "Fired when a key event is sent from the operating system. The event will be sent to the extension if this extension owns the active IME. The listener function should return true if the event was handled false if it was not.  If the event will be evaluated asynchronously, this function must return undefined and the IME must later call keyEventHandled() with the result.",
        "platforms": ["chromeos", "win", "linux"],
        "options": {
          "supportsFilters": false,
          "supportsListeners": true,
          "supportsRules": false,
          "maxListeners": 1
        },
        "parameters": [
          {
            "type": "string",
            "name": "engineID",
            "description": "ID of the engine receiving the event"
          },
          {
            "$ref": "KeyboardEvent",
            "name": "keyData",
            "description": "Data on the key event"
          },
          {
            "type": "string",
            "name": "requestId",
            "description": "ID of the request. If the event listener returns undefined, then <code>keyEventHandled</code> must be called later with this <code>requestId</code>."
          }
        ],
        "returns": {
          "type": "boolean",
          "description": "True if the keystroke was handled, false if not. Or returns undefined if the extension decides to call keyEventHandled explicitly.",
          "optional": true
        }
      },
      {
        "name": "onCandidateClicked",
        "type": "function",
        "description": "This event is sent if this extension owns the active IME.",
        "platforms": ["chromeos"],
        "parameters": [
          {
            "type": "string",
            "name": "engineID",
            "description": "ID of the engine receiving the event"
          },
          {
            "type": "integer",
            "name": "candidateID",
            "description": "ID of the candidate that was clicked."
          },
          {
            "name": "button",
            "$ref": "MouseButton",
            "description": "Which mouse buttons was clicked."
          }
        ]
      },
      {
        "name": "onMenuItemActivated",
        "type": "function",
        "description": "Called when the user selects a menu item",
        "platforms": ["chromeos"],
        "parameters": [
          {
            "type": "string",
            "name": "engineID",
            "description": "ID of the engine receiving the event"
          },
          {
            "type": "string",
            "name": "name",
            "description": "Name of the MenuItem which was activated"
          }
        ]
      },
      {
        "name": "onSurroundingTextChanged",
        "type": "function",
        "description": "Called when the editable string around caret is changed or when the caret position is moved. The text length is limited to 100 characters for each back and forth direction.",
        "platforms": ["chromeos"],
        "parameters": [
          {
            "type": "string",
            "name": "engineID",
            "description": "ID of the engine receiving the event"
          },
          {
            "type": "object",
            "name": "surroundingInfo",
            "description": "The surrounding information.",
            "properties": {
              "text": {
                "type": "string",
                "description": "The text around the cursor. This is only a subset of all text in the input field."
              },
              "focus": {
                "type": "integer",
                "description": "The ending position of the selection. This value indicates caret position if there is no selection."
              },
              "anchor": {
                "type": "integer",
                "description": "The beginning position of the selection. This value indicates caret position if there is no selection."
              },
              "offset": {
                "type": "integer",
                "description": "The offset position of <code>text</code>. Since <code>text</code> only includes a subset of text around the cursor, offset indicates the absolute position of the first character of <code>text</code>."
              }
            }
          }
        ]
      },
      {
        "name": "onReset",
        "type": "function",
        "description": "This event is sent when chrome terminates ongoing text input session.",
        "platforms": ["chromeos", "win", "linux"],
        "parameters": [
          {
            "type": "string",
            "name": "engineID",
            "description": "ID of the engine receiving the event"
          }
        ]
      },
      {
        "name": "onCompositionBoundsChanged",
        "type": "function",
        "description": "Triggered when the bounds of the IME composition text or cursor are changed. The IME composition text is the instance of text produced in the input method editor.",
        "platforms": ["win", "linux"],
        "parameters": [
          {
            "type": "array",
            "name": "boundsList",
            "description": "List of bounds information for each character on IME composition text. If there's no composition text in the editor, this array contains the bound information of the cursor.",
            "items": { "$ref": "Bounds" }
          }
        ]
      }
    ]
  }
]