OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 * @fileoverview An interface for an ordered collection of walkers, called a | 6 * @fileoverview An interface for an ordered collection of walkers, called a |
7 * shifter. | 7 * shifter. |
8 */ | 8 */ |
9 | 9 |
10 | 10 |
(...skipping 16 matching lines...) Expand all Loading... |
27 * Moves to the next selection in the DOM, performing any walker shifts as | 27 * Moves to the next selection in the DOM, performing any walker shifts as |
28 * necessary. | 28 * necessary. |
29 * @param {!cvox.CursorSelection} sel The selection to go next from. | 29 * @param {!cvox.CursorSelection} sel The selection to go next from. |
30 * @return {cvox.CursorSelection} The resulting selection. | 30 * @return {cvox.CursorSelection} The resulting selection. |
31 */ | 31 */ |
32 cvox.AbstractShifter.prototype.next = goog.abstractMethod; | 32 cvox.AbstractShifter.prototype.next = goog.abstractMethod; |
33 | 33 |
34 | 34 |
35 /** | 35 /** |
36 * Gets the first (or last) selection for this shifter's current granularity. | 36 * Gets the first (or last) selection for this shifter's current granularity. |
| 37 * @param {?} sel |
37 * @param {{reversed: (undefined|boolean)}=} kwargs Extra arguments. | 38 * @param {{reversed: (undefined|boolean)}=} kwargs Extra arguments. |
38 * reversed: If true, syncs to the end and returns a reversed selection. | 39 * reversed: If true, syncs to the end and returns a reversed selection. |
39 * False by default. | 40 * False by default. |
40 * @return {!cvox.CursorSelection} The valid selection. | 41 * @return {!cvox.CursorSelection} The valid selection. |
41 */ | 42 */ |
42 cvox.AbstractShifter.prototype.begin = function(sel, kwargs) { | 43 cvox.AbstractShifter.prototype.begin = function(sel, kwargs) { |
43 return this.currentWalker_.begin(kwargs); | 44 return this.currentWalker_.begin(kwargs); |
44 }; | 45 }; |
45 | 46 |
46 | 47 |
47 /** | 48 /** |
48 * Syncs to this shifter. | 49 * Syncs to this shifter. |
49 * @param {!cvox.CursorSelection} sel The selection to sync, if any. | 50 * @param {!cvox.CursorSelection} sel The selection to sync, if any. |
50 * @return {cvox.CursorSelection} The selection. | 51 * @return {cvox.CursorSelection} The selection. |
51 */ | 52 */ |
52 cvox.AbstractShifter.prototype.sync = goog.abstractMethod; | 53 cvox.AbstractShifter.prototype.sync = goog.abstractMethod; |
53 | 54 |
54 | 55 |
55 /** | 56 /** |
56 * Name of this shifter. | 57 * Name of this shifter. |
57 * @return {string} The shifter's name. | 58 * @return {string} The shifter's name. |
58 */ | 59 */ |
59 cvox.AbstractShifter.prototype.getName = goog.abstractMethod; | 60 cvox.AbstractShifter.prototype.getName = goog.abstractMethod; |
60 | 61 |
61 | 62 |
62 /** | 63 /** |
63 * Gets the current description. | 64 * Gets the current description. |
64 * @param {!cvox.CursorSelection} prevSel The previous selection, for context. | 65 * @param {!cvox.CursorSelection} prevSel The previous selection, for context. |
65 * @param {!cvox.CursorSelection} sel The current selection. | 66 * @param {!cvox.CursorSelection} sel The current selection. |
66 * @return {Array.<cvox.NavDescription>} The description array. | 67 * @return {Array<cvox.NavDescription>} The description array. |
67 */ | 68 */ |
68 cvox.AbstractShifter.prototype.getDescription = goog.abstractMethod; | 69 cvox.AbstractShifter.prototype.getDescription = goog.abstractMethod; |
69 | 70 |
70 | 71 |
71 /** | 72 /** |
72 * Gets the current braille. | 73 * Gets the current braille. |
73 * @param {!cvox.CursorSelection} prevSel The previous selection, for context. | 74 * @param {!cvox.CursorSelection} prevSel The previous selection, for context. |
74 * @param {!cvox.CursorSelection} sel The current selection. | 75 * @param {!cvox.CursorSelection} sel The current selection. |
75 * @return {!cvox.NavBraille} The braille description. | 76 * @return {!cvox.NavBraille} The braille description. |
76 */ | 77 */ |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 }; | 157 }; |
157 | 158 |
158 | 159 |
159 /** | 160 /** |
160 * Factory method to create an instance of this shifter. | 161 * Factory method to create an instance of this shifter. |
161 * @param {!cvox.CursorSelection} sel The initial selection. | 162 * @param {!cvox.CursorSelection} sel The initial selection. |
162 * @return {cvox.AbstractShifter} The shifter or null if given a selection not | 163 * @return {cvox.AbstractShifter} The shifter or null if given a selection not |
163 * within the shifter's domain. | 164 * within the shifter's domain. |
164 */ | 165 */ |
165 cvox.AbstractShifter.create = goog.abstractMethod; | 166 cvox.AbstractShifter.create = goog.abstractMethod; |
OLD | NEW |