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.layouts.RowsOfCompact');
15 goog.provide('i18n.input.chrome.inputview.layouts.RowsOfCompactAzerty');
16 goog.provide('i18n.input.chrome.inputview.layouts.RowsOfCompactNordic');
17 goog.provide('i18n.input.chrome.inputview.layouts.RowsOfCompactZhuyin');
19 goog.require('i18n.input.chrome.inputview.layouts.util');
23 * Creates the top three rows for compact qwerty keyboard.
25 * @return {!Array.<!Object>} The rows.
27 i18n.input.chrome.inputview.layouts.RowsOfCompact.create = function() {
34 var keySequenceOf10 = i18n.input.chrome.inputview.layouts.util.
35 createKeySequence(baseKeySpec, 10);
36 var backspaceKey = i18n.input.chrome.inputview.layouts.util.createKey({
39 var row1 = i18n.input.chrome.inputview.layouts.util.createLinearLayout({
41 'children': [keySequenceOf10, backspaceKey]
46 var leftKeyWithPadding = i18n.input.chrome.inputview.layouts.util.createKey({
49 var keySequenceOf8 = i18n.input.chrome.inputview.layouts.util.
50 createKeySequence(baseKeySpec, 8);
51 var enterKey = i18n.input.chrome.inputview.layouts.util.createKey({
54 var row2 = i18n.input.chrome.inputview.layouts.util.createLinearLayout({
56 'children': [leftKeyWithPadding, keySequenceOf8, enterKey]
60 var shiftLeftKey = i18n.input.chrome.inputview.layouts.util.createKey({
63 var keySequenceOf9 = i18n.input.chrome.inputview.layouts.util.
64 createKeySequence(baseKeySpec, 9);
65 var shiftRightKey = i18n.input.chrome.inputview.layouts.util.createKey({
68 var row3 = i18n.input.chrome.inputview.layouts.util.createLinearLayout({
70 'children': [shiftLeftKey, keySequenceOf9, shiftRightKey]
73 return [row1, row2, row3];
77 * Creates the top three rows for compact azerty keyboard.
79 * @return {!Array.<!Object>} The rows.
81 i18n.input.chrome.inputview.layouts.RowsOfCompactAzerty.create = function() {
88 var keySequenceOf10 = i18n.input.chrome.inputview.layouts.util.
89 createKeySequence(baseKeySpec, 10);
90 var backspaceKey = i18n.input.chrome.inputview.layouts.util.createKey({
93 var row1 = i18n.input.chrome.inputview.layouts.util.createLinearLayout({
95 'children': [keySequenceOf10, backspaceKey]
99 keySequenceOf10 = i18n.input.chrome.inputview.layouts.util.
100 createKeySequence(baseKeySpec, 10);
101 var enterKey = i18n.input.chrome.inputview.layouts.util.createKey({
104 var row2 = i18n.input.chrome.inputview.layouts.util.createLinearLayout({
106 'children': [keySequenceOf10, enterKey]
110 var shiftLeftKey = i18n.input.chrome.inputview.layouts.util.createKey({
113 var keySequenceOf9 = i18n.input.chrome.inputview.layouts.util.
114 createKeySequence(baseKeySpec, 9);
115 var shiftRightKey = i18n.input.chrome.inputview.layouts.util.createKey({
118 var row3 = i18n.input.chrome.inputview.layouts.util.createLinearLayout({
120 'children': [shiftLeftKey, keySequenceOf9, shiftRightKey]
123 return [row1, row2, row3];
127 * Creates the top three rows for compact nordic keyboard.
129 * @return {!Array.<!Object>} The rows.
131 i18n.input.chrome.inputview.layouts.RowsOfCompactNordic.create = function() {
138 var keySequenceOf11 = i18n.input.chrome.inputview.layouts.util.
139 createKeySequence(baseKeySpec, 11);
140 var backspaceKey = i18n.input.chrome.inputview.layouts.util.createKey({
143 var row1 = i18n.input.chrome.inputview.layouts.util.createLinearLayout({
145 'children': [keySequenceOf11, backspaceKey]
149 keySequenceOf11 = i18n.input.chrome.inputview.layouts.util.
150 createKeySequence(baseKeySpec, 11);
151 var enterKey = i18n.input.chrome.inputview.layouts.util.createKey({
154 var row2 = i18n.input.chrome.inputview.layouts.util.createLinearLayout({
156 'children': [keySequenceOf11, enterKey]
160 var shiftLeftKey = i18n.input.chrome.inputview.layouts.util.createKey({
163 var leftKeyWithPadding = i18n.input.chrome.inputview.layouts.util.createKey({
166 var keySequenceOf7 = i18n.input.chrome.inputview.layouts.util.
167 createKeySequence(baseKeySpec, 7);
168 var rightKeyWithPadding = i18n.input.chrome.inputview.layouts.util.createKey({
171 var shiftRightKey = i18n.input.chrome.inputview.layouts.util.createKey({
174 var row3 = i18n.input.chrome.inputview.layouts.util.createLinearLayout({
176 'children': [shiftLeftKey, leftKeyWithPadding, keySequenceOf7,
177 rightKeyWithPadding, shiftRightKey]
179 return [row1, row2, row3];
184 * Creates the top rows of compact zhuyin.
186 * @return {!Array.<!Object>} The rows.
188 i18n.input.chrome.inputview.layouts.RowsOfCompactZhuyin.create = function() {
190 'widthInWeight': 1.01,
195 var keysOfRow1 = i18n.input.chrome.inputview.layouts.util.
196 createKeySequence(baseKeySpec, 10);
197 var row1 = i18n.input.chrome.inputview.layouts.util.createLinearLayout({
199 'children': [keysOfRow1]
203 var keysOfRow2 = i18n.input.chrome.inputview.layouts.util.
204 createKeySequence(baseKeySpec, 10);
205 var row2 = i18n.input.chrome.inputview.layouts.util.createLinearLayout({
207 'children': [keysOfRow2]
211 var keysOfRow3 = i18n.input.chrome.inputview.layouts.util.
212 createKeySequence(baseKeySpec, 10);
213 var row3 = i18n.input.chrome.inputview.layouts.util.createLinearLayout({
215 'children': [keysOfRow3]
219 var keysOfRow4 = i18n.input.chrome.inputview.layouts.util.
220 createKeySequence(baseKeySpec, 10);
221 var row4 = i18n.input.chrome.inputview.layouts.util.createLinearLayout({
223 'children': [keysOfRow4]
227 i18n.input.chrome.inputview.layouts.util.createVerticalLayout({
229 'children': [row1, row2, row3, row4]
233 'widthInWeight': 1.1,
237 i18n.input.chrome.inputview.layouts.util.createKey(sideKeySpec);
239 i18n.input.chrome.inputview.layouts.util.createKey(sideKeySpec);
241 i18n.input.chrome.inputview.layouts.util.createKey(sideKeySpec);
243 var sideKeys = i18n.input.chrome.inputview.layouts.util.createVerticalLayout({
245 'children': [backspaceKey, enterKey, shiftKey]
248 var topRows = i18n.input.chrome.inputview.layouts.util.createLinearLayout({
250 'children': [topFourRows, sideKeys]