1 // Copyright 2014 The ChromeOS IME Authors. All Rights Reserved.
2 // limitations under the License.
3 // See the License for the specific language governing permissions and
4 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5 // distributed under the License is distributed on an "AS-IS" BASIS,
6 // Unless required by applicable law or agreed to in writing, software
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // You may obtain a copy of the License at
11 // you may not use this file except in compliance with the License.
12 // Licensed under the Apache License, Version 2.0 (the "License");
16 * @fileoverview Handwriting event type.
17 * @author wuyingbing@google.com (Yingbing Wu)
21 goog.provide('i18n.input.hwt.CandidateSelectEvent');
22 goog.provide('i18n.input.hwt.CommitEvent');
23 goog.provide('i18n.input.hwt.EventType');
25 goog.require('goog.events');
26 goog.require('goog.events.Event');
30 * Handwriting event type to expose to external.
34 i18n.input.hwt.EventType = {
35 BACKSPACE: goog.events.getUniqueId('b'),
36 CANDIDATE_SELECT: goog.events.getUniqueId('cs'),
37 COMMIT: goog.events.getUniqueId('c'),
38 COMMIT_START: goog.events.getUniqueId('hcs'),
39 COMMIT_END: goog.events.getUniqueId('hce'),
40 RECOGNITION_READY: goog.events.getUniqueId('rr'),
41 ENTER: goog.events.getUniqueId('e'),
42 HANDWRITING_CLOSED: goog.events.getUniqueId('hc'),
43 MOUSEUP: goog.events.getUniqueId('m'),
44 SPACE: goog.events.getUniqueId('s')
50 * Candidate select event.
52 * @param {string} candidate The candidate.
54 * @extends {goog.events.Event}
56 i18n.input.hwt.CandidateSelectEvent = function(candidate) {
57 goog.base(this, i18n.input.hwt.EventType.CANDIDATE_SELECT);
64 this.candidate = candidate;
66 goog.inherits(i18n.input.hwt.CandidateSelectEvent, goog.events.Event);
73 * @param {string} text The text to commit.
74 * @param {number=} opt_back The number of characters to be deleted.
76 * @extends {goog.events.Event}
78 i18n.input.hwt.CommitEvent = function(text, opt_back) {
79 goog.base(this, i18n.input.hwt.EventType.COMMIT);
89 * The number of characters to be deleted.
93 this.back = opt_back || 0;
95 goog.inherits(i18n.input.hwt.CommitEvent, goog.events.Event);