Index: chrome/common/extensions/api/braille_private.idl |
diff --git a/chrome/common/extensions/api/braille_private.idl b/chrome/common/extensions/api/braille_private.idl |
new file mode 100644 |
index 0000000000000000000000000000000000000000..55b2ec98de1041e6eb5db091700da2f26f7bb643 |
--- /dev/null |
+++ b/chrome/common/extensions/api/braille_private.idl |
@@ -0,0 +1,60 @@ |
+// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
David Tseng
2013/09/05 19:21:22
nit: 2013
|
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+// Braille display access private API. |
+namespace braillePrivate { |
+ // Braille display keyboard command. |
+ enum KeyCommand { |
+ line_up, |
+ line_down, |
+ pan_left, |
+ pan_right, |
+ top, |
+ bottom, |
+ routing, |
+ dots, |
+ standard_key |
+ }; |
+ |
+ // A keyboard event. |
+ dictionary KeyEvent { |
+ KeyCommand command; |
+ // 0-based display position for commands that involve a routing key. |
+ long? displayPosition; |
+ // Braille dot keys that were pressed, stored in the low-order bits. |
+ // Dot 1 is stored in bit 0, dot2 in bit 1, etc. |
+ long? brailleDots; |
+ DOMString? standardKeyName; |
+ boolean? spaceKey; |
+ boolean? altKey; |
+ boolean? shiftKey; |
+ boolean? ctrlKey; |
+ }; |
+ |
+ // The current braille display state. |
+ dictionary DisplayState { |
+ // Whether a braille display is currently available. |
+ boolean available; |
+ // Number of braille cells on the currently connected display. |
+ long? textCells; |
+ }; |
+ |
+ callback DisplayStateCallback = void(DisplayState result); |
+ |
+ interface Functions { |
+ // Gets the current display state. |
+ static void getDisplayState(DisplayStateCallback callback); |
+ // TODO: Temporary for testing without translation library. |
+ static void writeText(DOMString text, long cursor); |
+ // Write the given dot patterns to the display. The buffer should contain |
+ // the same number of entries as the current display contains. If not, |
+ // the output will be clipped or filled with blank cells to the right. |
+ static void writeDots(ArrayBuffer cells); |
+ }; |
+ |
+ interface Events { |
+ static void onDisplayStateChanged(DisplayState state); |
+ static void onKeyEvent(KeyEvent event); |
+ }; |
+}; |