b9e9c96056fbbe0a5332c80e7f414e3d86177f29
[platform/framework/web/crosswalk.git] / src / ui / keyboard / resources / constants.js
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 /**
6  * Aspect ratio of keyboard.
7  * @type {number}
8  */
9 var ASPECT_RATIO = 4.5;
10
11 var RowAlignment = {
12   STRETCH: "stretch",
13   LEFT: "left",
14   RIGHT: "right",
15   CENTER: "center"
16 }
17
18 /**
19  * Ratio of key height and font size.
20  * @type {number}
21  */
22 var FONT_SIZE_RATIO = 3;
23
24 /**
25  * The number of rows in each keyset.
26  * @type {number}
27  */
28 // TODO(bshe): The number of rows should equal to the number of kb-row elements
29 // in kb-keyset. Remove this variable once figure out how to calculate the
30 // number from keysets.
31 var ROW_LENGTH = 4;
32
33 /**
34  * The enumeration of swipe directions.
35  * @const
36  * @type {Enum}
37  */
38 var SWIPE_DIRECTION = {
39   RIGHT: 0x1,
40   LEFT: 0x2,
41   UP: 0x4,
42   DOWN: 0x8
43 };
44
45 /**
46  * The default weight of a key in the X direction.
47  * @type {number}
48  */
49 var DEFAULT_KEY_WEIGHT_X = 100;
50
51 /**
52  * The default weight of a key in the Y direction.
53  * @type {number}
54  */
55 var DEFAULT_KEY_WEIGHT_Y = 60;
56
57 /**
58  * The top padding on each key.
59  * @type {number}
60  */
61 // TODO(rsadam): Remove this variable once figure out how to calculate this
62 // number before the key is rendered.
63 var KEY_PADDING_TOP = 2;