virtual_keyboard_private.js 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. // Copyright 2020 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. // This file was generated by:
  5. // tools/json_schema_compiler/compiler.py.
  6. // NOTE: The format of types has changed. 'FooType' is now
  7. // 'chrome.virtualKeyboardPrivate.FooType'.
  8. // Please run the closure compiler before committing changes.
  9. // See https://chromium.googlesource.com/chromium/src/+/master/docs/closure_compilation.md
  10. /** @fileoverview Externs generated from namespace: virtualKeyboardPrivate */
  11. /** @const */
  12. chrome.virtualKeyboardPrivate = {};
  13. /**
  14. * @enum {string}
  15. */
  16. chrome.virtualKeyboardPrivate.VirtualKeyboardEventType = {
  17. KEYUP: 'keyup',
  18. KEYDOWN: 'keydown',
  19. };
  20. /**
  21. * @typedef {{
  22. * type: !chrome.virtualKeyboardPrivate.VirtualKeyboardEventType,
  23. * charValue: number,
  24. * keyCode: number,
  25. * keyName: string,
  26. * modifiers: (number|undefined)
  27. * }}
  28. */
  29. chrome.virtualKeyboardPrivate.VirtualKeyboardEvent;
  30. /**
  31. * @enum {string}
  32. */
  33. chrome.virtualKeyboardPrivate.KeyboardMode = {
  34. FULL_WIDTH: 'FULL_WIDTH',
  35. FLOATING: 'FLOATING',
  36. };
  37. /**
  38. * @enum {string}
  39. */
  40. chrome.virtualKeyboardPrivate.KeyboardState = {
  41. ENABLED: 'ENABLED',
  42. DISABLED: 'DISABLED',
  43. AUTO: 'AUTO',
  44. };
  45. /**
  46. * @typedef {{
  47. * left: number,
  48. * top: number,
  49. * width: number,
  50. * height: number
  51. * }}
  52. */
  53. chrome.virtualKeyboardPrivate.Bounds;
  54. /**
  55. * @typedef {{
  56. * layout: string,
  57. * hotrodmode: boolean,
  58. * a11ymode: boolean,
  59. * features: !Array<string>
  60. * }}
  61. */
  62. chrome.virtualKeyboardPrivate.KeyboardConfig;
  63. /**
  64. * @typedef {{
  65. * mode: !chrome.virtualKeyboardPrivate.KeyboardMode,
  66. * bounds: !chrome.virtualKeyboardPrivate.Bounds
  67. * }}
  68. */
  69. chrome.virtualKeyboardPrivate.ContainerBehaviorOptions;
  70. /**
  71. * Inserts text into the currently focused text field.
  72. * @param {string} text The text that will be inserted.
  73. * @param {function(): void=} callback Called when the insertion is completed.
  74. */
  75. chrome.virtualKeyboardPrivate.insertText = function(text, callback) {};
  76. /**
  77. * Sends a fabricated key event to the focused input field.
  78. * @param {!chrome.virtualKeyboardPrivate.VirtualKeyboardEvent} keyEvent
  79. * @param {function(): void=} callback Called after processing the event.
  80. */
  81. chrome.virtualKeyboardPrivate.sendKeyEvent = function(keyEvent, callback) {};
  82. /**
  83. * Hides the virtual keyboard.
  84. * @param {function(): void=} callback Called when the keyboard is hidden.
  85. */
  86. chrome.virtualKeyboardPrivate.hideKeyboard = function(callback) {};
  87. /**
  88. * Sets the state of the hotrod virtual keyboard. This API should only be used
  89. * by hotrod.
  90. * @param {boolean} enable
  91. */
  92. chrome.virtualKeyboardPrivate.setHotrodKeyboard = function(enable) {};
  93. /**
  94. * Sets the lock state of the virtual keyboard. A locked keyboard remains
  95. * visible even after a text area loses input focus.
  96. * @param {boolean} lock
  97. */
  98. chrome.virtualKeyboardPrivate.lockKeyboard = function(lock) {};
  99. /**
  100. * Inform the system that the keyboard has loaded.
  101. * @param {function(): void=} callback Called when load acknowledgement is
  102. * complete.
  103. */
  104. chrome.virtualKeyboardPrivate.keyboardLoaded = function(callback) {};
  105. /**
  106. * Gets the virtual keyboard configuration.
  107. * @param {function(!chrome.virtualKeyboardPrivate.KeyboardConfig): void}
  108. * callback Called when querying virtual keyboard configuration is complete.
  109. */
  110. chrome.virtualKeyboardPrivate.getKeyboardConfig = function(callback) {};
  111. /**
  112. * Opens chrome://settings/languages page.
  113. */
  114. chrome.virtualKeyboardPrivate.openSettings = function() {};
  115. /**
  116. * Sets the virtual keyboard container behavior
  117. * @param {!chrome.virtualKeyboardPrivate.ContainerBehaviorOptions} options
  118. * Optional parameters for new container behavior.
  119. * @param {function(boolean): void=} callback Called when container mode is
  120. * ready to change, or if the operation failed.
  121. */
  122. chrome.virtualKeyboardPrivate.setContainerBehavior = function(options, callback) {};
  123. /**
  124. * Sets the virtual keyboard draggable area bounds.
  125. * @param {!chrome.virtualKeyboardPrivate.Bounds} bounds The value of draggable
  126. * rect area of floating keyboard.
  127. */
  128. chrome.virtualKeyboardPrivate.setDraggableArea = function(bounds) {};
  129. /**
  130. * Requests the virtual keyboard to change state.
  131. * @param {!chrome.virtualKeyboardPrivate.KeyboardState} state The value of the
  132. * virtual keyboard state to change to.
  133. */
  134. chrome.virtualKeyboardPrivate.setKeyboardState = function(state) {};
  135. /**
  136. * Sets the areas on the screen that are blocked by the virtual keyboard.
  137. * @param {!Array<!chrome.virtualKeyboardPrivate.Bounds>} boundsList List of
  138. * rectangles representing regions occluded by the keyboard.
  139. */
  140. chrome.virtualKeyboardPrivate.setOccludedBounds = function(boundsList) {};
  141. /**
  142. * Sets the areas on the keyboard window where events are handled. Any event
  143. * outside of these areas are passed on to the window behind it.
  144. * @param {!Array<!chrome.virtualKeyboardPrivate.Bounds>} boundsList List of
  145. * rectangles representing regions where events targeting the keyboard
  146. * should be handled.
  147. */
  148. chrome.virtualKeyboardPrivate.setHitTestBounds = function(boundsList) {};
  149. /**
  150. * Sets the area of the keyboard window that should not move off screen. Any
  151. * area outside of this can be moved off the user's screen.
  152. * @param {!chrome.virtualKeyboardPrivate.Bounds} bounds The bounds of the area
  153. * inside the keyboard window, relative to the window origin, that should
  154. * not be moved off screen. Any area outside of this bounds can be moved off
  155. * screen.
  156. */
  157. chrome.virtualKeyboardPrivate.setAreaToRemainOnScreen = function(bounds) {};
  158. /**
  159. * Sets the bounds of the keyboard window in screen coordinates.
  160. * @param {!chrome.virtualKeyboardPrivate.Bounds} bounds A rectangle defining
  161. * the new bounds of the window in screen coordinates.
  162. */
  163. chrome.virtualKeyboardPrivate.setWindowBoundsInScreen = function(bounds) {};
  164. /**
  165. * This event is sent when virtual keyboard bounds changed and overscroll/resize
  166. * is enabled.
  167. * @type {!ChromeEvent}
  168. */
  169. chrome.virtualKeyboardPrivate.onBoundsChanged;
  170. /**
  171. * Fired when the virtual keyboard window has been closed. For example, this can
  172. * happen when turning off on-screen keyboard or exiting tablet mode.
  173. * @type {!ChromeEvent}
  174. */
  175. chrome.virtualKeyboardPrivate.onKeyboardClosed;
  176. /**
  177. * Fired when a configuration for virtual keyboard IME has changed, e.g. auto
  178. * complete disabled.
  179. * @type {!ChromeEvent}
  180. */
  181. chrome.virtualKeyboardPrivate.onKeyboardConfigChanged;