| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 */ | 43 */ |
| 44 this.numOfCandidate = numOfCanddiate; | 44 this.numOfCandidate = numOfCanddiate; |
| 45 | 45 |
| 46 /** @protected {function(string, !Array.<!Object>)} */ | 46 /** @protected {function(string, !Array.<!Object>)} */ |
| 47 this.callback = callback; | 47 this.callback = callback; |
| 48 }; | 48 }; |
| 49 var DataSource = i18n.input.chrome.DataSource; | 49 var DataSource = i18n.input.chrome.DataSource; |
| 50 goog.inherits(DataSource, EventTarget); | 50 goog.inherits(DataSource, EventTarget); |
| 51 | 51 |
| 52 | 52 |
| 53 /** |
| 54 * The event type. |
| 55 * |
| 56 * @enum {string} |
| 57 */ |
| 58 DataSource.EventType = { |
| 59 CANDIDATES_BACK: goog.events.getUniqueId('cb'), |
| 60 READY: goog.events.getUniqueId('r') |
| 61 }; |
| 62 |
| 63 |
| 53 /** @type {boolean} */ | 64 /** @type {boolean} */ |
| 54 DataSource.prototype.ready = false; | 65 DataSource.prototype.ready = false; |
| 55 | 66 |
| 56 | 67 |
| 57 /** | 68 /** |
| 58 * The correction level. | 69 * The correction level. |
| 59 * | 70 * |
| 60 * @protected {number} | 71 * @protected {number} |
| 61 */ | 72 */ |
| 62 DataSource.prototype.correctionLevel = 0; | 73 DataSource.prototype.correctionLevel = 0; |
| 63 | 74 |
| 64 | 75 |
| 65 /** | 76 /** |
| 77 * Whether user dict is enabled. |
| 78 * |
| 79 * @protected {boolean} |
| 80 */ |
| 81 DataSource.prototype.enableUserDict = false; |
| 82 |
| 83 |
| 84 /** |
| 66 * The language code. | 85 * The language code. |
| 67 * | 86 * |
| 68 * @type {string} | 87 * @type {string} |
| 69 * @protected | 88 * @protected |
| 70 */ | 89 */ |
| 71 DataSource.prototype.language; | 90 DataSource.prototype.language; |
| 72 | 91 |
| 73 | 92 |
| 74 /** | 93 /** |
| 75 * Sets the langauge code. | 94 * Sets the langauge code. |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 * Gets the input tool code. | 128 * Gets the input tool code. |
| 110 * | 129 * |
| 111 * @return {string} . | 130 * @return {string} . |
| 112 */ | 131 */ |
| 113 DataSource.prototype.getInputToolCode = function() { | 132 DataSource.prototype.getInputToolCode = function() { |
| 114 return this.language + '-t-i0-und'; | 133 return this.language + '-t-i0-und'; |
| 115 }; | 134 }; |
| 116 | 135 |
| 117 | 136 |
| 118 /** | 137 /** |
| 138 * Sends completion request for a word. |
| 139 * |
| 140 * @param {string} word The word. |
| 141 * @param {string} context The context. |
| 142 */ |
| 143 DataSource.prototype.sendCompletionRequestForWord = goog.functions.NULL; |
| 144 |
| 145 |
| 146 /** |
| 119 * Sends completion request. | 147 * Sends completion request. |
| 120 * | 148 * |
| 121 * @param {string} query The query . | 149 * @param {string} query The query . |
| 122 * @param {string} context The context . | 150 * @param {string} context The context . |
| 123 * @param {!Object=} opt_spatialData . | 151 * @param {!Object=} opt_spatialData . |
| 124 */ | 152 */ |
| 125 DataSource.prototype.sendCompletionRequest = goog.functions.NULL; | 153 DataSource.prototype.sendCompletionRequest = goog.functions.NULL; |
| 126 | 154 |
| 127 | 155 |
| 128 /** | 156 /** |
| 129 * Enables/disables user dictionary. | 157 * Enables/disables user dictionary. |
| 130 * | 158 * |
| 131 * @param {boolean} enabled | 159 * @param {boolean} enabled |
| 132 */ | 160 */ |
| 133 DataSource.prototype.setUserDictEnabled = function(enabled) { | 161 DataSource.prototype.setEnableUserDict = function(enabled) { |
| 134 this.userDictEnabled = enabled; | 162 this.enableUserDict = enabled; |
| 135 }; | 163 }; |
| 136 | 164 |
| 137 | 165 |
| 138 /** | 166 /** |
| 139 * Sends prediciton request. | 167 * Sends prediciton request. |
| 140 * | 168 * |
| 141 * @param {string} context The context. | 169 * @param {string} context The context. |
| 142 */ | 170 */ |
| 143 DataSource.prototype.sendPredictionRequest = goog.functions.NULL; | 171 DataSource.prototype.sendPredictionRequest = goog.functions.NULL; |
| 144 | 172 |
| 145 | 173 |
| 146 /** | 174 /** |
| 147 * Sets the correction level. | 175 * Sets the correction level. |
| 148 * | 176 * |
| 149 * @param {number} level . | 177 * @param {number} level . |
| 150 */ | 178 */ |
| 151 DataSource.prototype.setCorrectionLevel = function(level) { | 179 DataSource.prototype.setCorrectionLevel = function(level) { |
| 152 this.correctionLevel = level; | 180 this.correctionLevel = level; |
| 153 }; | 181 }; |
| 154 | 182 |
| 155 | 183 |
| 156 /** | 184 /** |
| 185 * Commits text to the data source. |
| 186 * |
| 187 * @param {string} text The text to commit. |
| 188 */ |
| 189 DataSource.prototype.commitText = goog.functions.NULL; |
| 190 |
| 191 |
| 192 /** |
| 157 * Clears the data source. | 193 * Clears the data source. |
| 158 */ | 194 */ |
| 159 DataSource.prototype.clear = goog.functions.NULL; | 195 DataSource.prototype.clear = goog.functions.NULL; |
| 160 | 196 |
| 161 | 197 |
| 162 /** | |
| 163 * The event type. | |
| 164 * | |
| 165 * @enum {string} | |
| 166 */ | |
| 167 DataSource.EventType = { | |
| 168 CANDIDATES_BACK: goog.events.getUniqueId('cb'), | |
| 169 READY: goog.events.getUniqueId('r') | |
| 170 }; | |
| 171 | |
| 172 | 198 |
| 173 /** | 199 /** |
| 174 * The candidates is fetched back. | 200 * The candidates is fetched back. |
| 175 * | 201 * |
| 176 * @param {string} source The source. | 202 * @param {string} source The source. |
| 177 * @param {!Array.<!Object>} candidates The candidates. | 203 * @param {!Array.<!Object>} candidates The candidates. |
| 178 * @constructor | 204 * @constructor |
| 179 * @extends {Event} | 205 * @extends {Event} |
| 180 */ | 206 */ |
| 181 DataSource.CandidatesBackEvent = function(source, candidates) { | 207 DataSource.CandidatesBackEvent = function(source, candidates) { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 192 /** | 218 /** |
| 193 * The candidate list. | 219 * The candidate list. |
| 194 * | 220 * |
| 195 * @type {!Array.<!Object>} | 221 * @type {!Array.<!Object>} |
| 196 */ | 222 */ |
| 197 this.candidates = candidates; | 223 this.candidates = candidates; |
| 198 }; | 224 }; |
| 199 goog.inherits(DataSource.CandidatesBackEvent, Event); | 225 goog.inherits(DataSource.CandidatesBackEvent, Event); |
| 200 | 226 |
| 201 }); // goog.scope | 227 }); // goog.scope |
| OLD | NEW |