| OLD | NEW |
| 1 // Copyright 2014 The ChromeOS IME Authors. All Rights Reserved. | 1 // Copyright 2014 The ChromeOS IME Authors. All Rights Reserved. |
| 2 // limitations under the License. | 2 // limitations under the License. |
| 3 // See the License for the specific language governing permissions and | 3 // See the License for the specific language governing permissions and |
| 4 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 4 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 5 // distributed under the License is distributed on an "AS-IS" BASIS, | 5 // distributed under the License is distributed on an "AS-IS" BASIS, |
| 6 // Unless required by applicable law or agreed to in writing, software | 6 // Unless required by applicable law or agreed to in writing, software |
| 7 // | 7 // |
| 8 // http://www.apache.org/licenses/LICENSE-2.0 | 8 // http://www.apache.org/licenses/LICENSE-2.0 |
| 9 // | 9 // |
| 10 // You may obtain a copy of the License at | 10 // You may obtain a copy of the License at |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 var Event = goog.events.Event; | 23 var Event = goog.events.Event; |
| 24 var EventTarget = goog.events.EventTarget; | 24 var EventTarget = goog.events.EventTarget; |
| 25 | 25 |
| 26 | 26 |
| 27 | 27 |
| 28 /** | 28 /** |
| 29 * The data source. | 29 * The data source. |
| 30 * | 30 * |
| 31 * @param {number} numOfCanddiate The number of canddiate to fetch. | 31 * @param {number} numOfCanddiate The number of canddiate to fetch. |
| 32 * @param {function(string, !Array.<!Object>)} candidatesCallback . | 32 * @param {function(string, !Array.<!Object>)} candidatesCallback . |
| 33 * @param {function(!Array.<string>)} gestureCallback . | 33 * @param {function(!Object)} gestureCallback . |
| 34 * @constructor | 34 * @constructor |
| 35 * @extends {EventTarget} | 35 * @extends {EventTarget} |
| 36 */ | 36 */ |
| 37 i18n.input.chrome.DataSource = function(numOfCanddiate, candidatesCallback, | 37 i18n.input.chrome.DataSource = function(numOfCanddiate, candidatesCallback, |
| 38 gestureCallback) { | 38 gestureCallback) { |
| 39 goog.base(this); | 39 goog.base(this); |
| 40 | 40 |
| 41 /** | 41 /** |
| 42 * The number of candidates to fetch. | 42 * The number of candidates to fetch. |
| 43 * | 43 * |
| 44 * @type {number} | 44 * @type {number} |
| 45 */ | 45 */ |
| 46 this.numOfCandidate = numOfCanddiate; | 46 this.numOfCandidate = numOfCanddiate; |
| 47 | 47 |
| 48 /** @protected {function(string, !Array.<!Object>)} */ | 48 /** @protected {function(string, !Array.<!Object>)} */ |
| 49 this.candidatesCallback = candidatesCallback; | 49 this.candidatesCallback = candidatesCallback; |
| 50 | 50 |
| 51 /** @protected {function(!Array.<string>)} */ | 51 /** @protected {function(!Object)} */ |
| 52 this.gestureCallback = gestureCallback; | 52 this.gestureCallback = gestureCallback; |
| 53 }; | 53 }; |
| 54 var DataSource = i18n.input.chrome.DataSource; | 54 var DataSource = i18n.input.chrome.DataSource; |
| 55 goog.inherits(DataSource, EventTarget); | 55 goog.inherits(DataSource, EventTarget); |
| 56 | 56 |
| 57 | 57 |
| 58 /** | 58 /** |
| 59 * The event type. | 59 * The event type. |
| 60 * | 60 * |
| 61 * @enum {string} | 61 * @enum {string} |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 * | 227 * |
| 228 * @type {!Array.<!Object>} | 228 * @type {!Array.<!Object>} |
| 229 */ | 229 */ |
| 230 this.candidates = candidates; | 230 this.candidates = candidates; |
| 231 }; | 231 }; |
| 232 goog.inherits(DataSource.CandidatesBackEvent, Event); | 232 goog.inherits(DataSource.CandidatesBackEvent, Event); |
| 233 | 233 |
| 234 | 234 |
| 235 | 235 |
| 236 /** | 236 /** |
| 237 * The gesture results are fetched back. | 237 * The gesture response is fetched back. |
| 238 * | 238 * |
| 239 * @param {!Array.<!string>} results The gesture results. | 239 * @param {!{results: !Array<string>, commit: boolean}} response The response |
| 240 * from the gesture decoder. |
| 240 * @constructor | 241 * @constructor |
| 241 * @extends {Event} | 242 * @extends {Event} |
| 242 */ | 243 */ |
| 243 DataSource.GesturesBackEvent = function(results) { | 244 DataSource.GesturesBackEvent = function(response) { |
| 244 DataSource.GesturesBackEvent.base( | 245 DataSource.GesturesBackEvent.base( |
| 245 this, 'constructor', DataSource.EventType.GESTURES_BACK); | 246 this, 'constructor', DataSource.EventType.GESTURES_BACK); |
| 246 | 247 |
| 247 /** | 248 /** |
| 248 * The gesture results list. | 249 * The gesture response. |
| 249 * | 250 * |
| 250 * @type {!Array.<!string>} | 251 * @type {!{results: !Array<string>, commit: boolean}} |
| 251 */ | 252 */ |
| 252 this.results = results; | 253 this.response = response; |
| 253 }; | 254 }; |
| 254 goog.inherits(DataSource.GesturesBackEvent, Event); | 255 goog.inherits(DataSource.GesturesBackEvent, Event); |
| 255 | 256 |
| 256 }); // goog.scope | 257 }); // goog.scope |
| OLD | NEW |