Upstream version 11.40.271.0
[platform/framework/web/crosswalk.git] / src / third_party / google_input_tools / src / chrome / os / inputview / layouts / rowsofjp.js
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
7 //
8 //      http://www.apache.org/licenses/LICENSE-2.0
9 //
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");
13 //
14 goog.provide('i18n.input.chrome.inputview.layouts.RowsOfJP');
15
16 goog.require('i18n.input.chrome.inputview.layouts.util');
17
18
19
20 goog.scope(function() {
21 var util = i18n.input.chrome.inputview.layouts.util;
22
23
24 /**
25  * Creates the top four rows for Japanese keyboard.
26  *
27  * @return {!Array.<!Object>} The rows.
28  */
29 i18n.input.chrome.inputview.layouts.RowsOfJP.create = function() {
30   var baseKeySpec = {
31     'widthInWeight': 1,
32     'heightInWeight': 1
33   };
34
35   // Row1
36   var keySequenceOf15 = util.createKeySequence(baseKeySpec, 15);
37   var row1 = util.createLinearLayout({
38     'id': 'row1',
39     'children': [keySequenceOf15]
40   });
41
42
43   // Row2 and row3
44
45   // First linear layout at the left of the enter.
46   var tabKey = i18n.input.chrome.inputview.layouts.util.createKey({
47     'widthInWeight': 1.5
48   });
49   var keySequenceOf11 = i18n.input.chrome.inputview.layouts.util.
50       createKeySequence(baseKeySpec, 11);
51   var slashKey = i18n.input.chrome.inputview.layouts.util.createKey({
52     'widthInWeight': 1.25
53   });
54   var row2 = i18n.input.chrome.inputview.layouts.util.createLinearLayout({
55     'id': 'row2',
56     'children': [tabKey, keySequenceOf11, slashKey]
57   });
58
59   // Second linear layout at the right of the enter.
60   var capslockKey = i18n.input.chrome.inputview.layouts.util.createKey({
61     'widthInWeight': 1.75
62   });
63   var keySequenceOf12 = i18n.input.chrome.inputview.layouts.util.
64       createKeySequence(baseKeySpec, 12);
65   var row3 = i18n.input.chrome.inputview.layouts.util.createLinearLayout({
66     'id': 'row3',
67     'children': [capslockKey, keySequenceOf12]
68   });
69
70   // Vertical layout contains the two rows at the left of the enter.
71   var vLayout = i18n.input.chrome.inputview.layouts.util.createVerticalLayout({
72     'id': 'row2-3-left',
73     'children': [row2, row3]
74   });
75
76   // Vertical layout contains enter key.
77   var enterKey = i18n.input.chrome.inputview.layouts.util.createKey({
78     'widthInWeight': 1.25,
79     'heightInWeight': 2
80   });
81   var enterLayout = i18n.input.chrome.inputview.layouts.util.
82       createVerticalLayout({
83         'id': 'row2-3-right',
84         'children': [enterKey]
85       });
86
87   // Linear layout contains the two vertical layout.
88   var row2and3 = i18n.input.chrome.inputview.layouts.util.createLinearLayout({
89     'id': 'row2-3',
90     'children': [vLayout, enterLayout]
91   });
92
93   // Row4
94   var shiftLeft = i18n.input.chrome.inputview.layouts.util.createKey({
95     'widthInWeight': 2.25
96   });
97   keySequenceOf11 = i18n.input.chrome.inputview.layouts.util.createKeySequence(
98       baseKeySpec, 11);
99   var shiftRight = i18n.input.chrome.inputview.layouts.util.createKey({
100     'widthInWeight': 1.75
101   });
102   var row4 = i18n.input.chrome.inputview.layouts.util.createLinearLayout({
103     'id': 'row4',
104     'children': [shiftLeft, keySequenceOf11, shiftRight]
105   });
106
107   return [row1, row2and3, row4];
108 };
109 });  // goog.scope