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");
14 goog.provide('i18n.input.chrome.inputview.ReadyState');
18 goog.scope(function() {
23 * The system ready state which mainains a state bit map.
24 * Inputview controller uses this to determine whether the system is ready to
29 i18n.input.chrome.inputview.ReadyState = function() {
31 var ReadyState = i18n.input.chrome.inputview.ReadyState;
41 KEYBOARD_CONFIG_READY: 0x10,
43 LAYOUT_CONFIG_READY: 0x1000,
44 M17N_LAYOUT_READY: 0x10000
49 * The internal ready state bit map.
53 ReadyState.prototype.state_ = 0;
57 * Gets whether the system is ready.
59 * @return {boolean} Whether the system is ready.
61 ReadyState.prototype.isAllReady = function() {
62 return !!(this.state_ & (
63 ReadyState.State.IME_LIST_READY |
64 ReadyState.State.KEYBOARD_CONFIG_READY |
65 ReadyState.State.LAYOUT_READY |
66 ReadyState.State.LAYOUT_CONFIG_READY |
67 ReadyState.State.M17N_LAYOUT_READY));
72 * Gets whether a specific state type is ready.
74 * @param {ReadyState.State} state .
75 * @return {boolean} Whether is ready.
77 ReadyState.prototype.isReady = function(state) {
78 return !!(this.state_ & state);
83 * Sets state ready for the given state type.
85 * @param {ReadyState.State} state .
87 ReadyState.prototype.markStateReady = function(state) {