OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * Interface for controllers to interact with main SwitchAccess class. | 6 * Interface for controllers to interact with main SwitchAccess class. |
7 * | 7 * |
8 * @interface | 8 * @interface |
9 */ | 9 */ |
10 function SwitchAccessInterface() { | 10 function SwitchAccessInterface() {} |
11 /** | |
12 * @type {SwitchAccessPrefs} | |
13 */ | |
14 this.switchAccessPrefs = null; | |
15 } | |
16 | 11 |
17 SwitchAccessInterface.prototype = { | 12 SwitchAccessInterface.prototype = { |
| 13 /** |
| 14 * Move to the next/previous interesting node. If |doNext| is true, move to |
| 15 * the next node. Otherwise, move to the previous node. |
| 16 * |
| 17 * @param {boolean} doNext |
| 18 */ |
18 moveToNode: function(doNext) {}, | 19 moveToNode: function(doNext) {}, |
19 | 20 |
| 21 /** |
| 22 * Perform the default action on the current node. |
| 23 */ |
20 selectCurrentNode: function() {}, | 24 selectCurrentNode: function() {}, |
21 | 25 |
| 26 /** |
| 27 * Open the options page in a new tab. |
| 28 */ |
22 showOptionsPage: function() {}, | 29 showOptionsPage: function() {}, |
23 | 30 |
| 31 /** |
| 32 * Return a list of the names of all user commands. |
| 33 * |
| 34 * @return {!Array<string>} |
| 35 */ |
| 36 getCommands: function() {}, |
| 37 |
| 38 /** |
| 39 * Return the default key code for a command. |
| 40 * |
| 41 * @param {string} command |
| 42 * @return {number} |
| 43 */ |
| 44 getDefaultKeyCodeFor: function(command) {}, |
| 45 |
| 46 /** |
| 47 * Run the function binding for the specified command. |
| 48 * |
| 49 * @param {string} command |
| 50 */ |
| 51 runCommand: function(command) {}, |
| 52 |
| 53 /** |
| 54 * Perform actions as the result of actions by the user. Currently, restarts |
| 55 * auto-scan if it is enabled. |
| 56 */ |
24 performedUserAction: function() {}, | 57 performedUserAction: function() {}, |
25 | 58 |
| 59 /** |
| 60 * Set the value of the preference |key| to |value| in chrome.storage.sync. |
| 61 * this.prefs_ is not set until handleStorageChange_. |
| 62 * |
| 63 * @param {string} key |
| 64 * @param {boolean|string|number} value |
| 65 */ |
| 66 setPref: function(key, value) {}, |
| 67 |
| 68 /** |
| 69 * Get the value of type 'boolean' of the preference |key|. Will throw a type |
| 70 * error if the value of |key| is not 'boolean'. |
| 71 * |
| 72 * @param {string} key |
| 73 * @return {boolean} |
| 74 */ |
| 75 getBooleanPref: function(key) {}, |
| 76 |
| 77 /** |
| 78 * Get the value of type 'number' of the preference |key|. Will throw a type |
| 79 * error if the value of |key| is not 'number'. |
| 80 * |
| 81 * @param {string} key |
| 82 * @return {number} |
| 83 */ |
| 84 getNumberPref: function(key) {}, |
| 85 |
| 86 /** |
| 87 * Get the value of type 'string' of the preference |key|. Will throw a type |
| 88 * error if the value of |key| is not 'string'. |
| 89 * |
| 90 * @param {string} key |
| 91 * @return {string} |
| 92 */ |
| 93 getStringPref: function(key) {}, |
| 94 |
| 95 /** |
| 96 * Returns true if |keyCode| is already used to run a command from the |
| 97 * keyboard. |
| 98 * |
| 99 * @param {number} keyCode |
| 100 * @return {boolean} |
| 101 */ |
| 102 keyCodeIsUsed: function(keyCode) {}, |
| 103 |
| 104 /** |
| 105 * Move to the next sibling of the current node if it has one. |
| 106 */ |
26 debugMoveToNext: function() {}, | 107 debugMoveToNext: function() {}, |
27 | 108 |
| 109 /** |
| 110 * Move to the previous sibling of the current node if it has one. |
| 111 */ |
28 debugMoveToPrevious: function() {}, | 112 debugMoveToPrevious: function() {}, |
29 | 113 |
| 114 /** |
| 115 * Move to the first child of the current node if it has one. |
| 116 */ |
30 debugMoveToFirstChild: function() {}, | 117 debugMoveToFirstChild: function() {}, |
31 | 118 |
| 119 /** |
| 120 * Move to the parent of the current node if it has one. |
| 121 */ |
32 debugMoveToParent: function() {} | 122 debugMoveToParent: function() {} |
33 }; | 123 }; |
OLD | NEW |