1 /*
2  * Copyright (C) 2014 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.android.inputmethod.keyboard.layout;
18 
19 import com.android.inputmethod.keyboard.layout.customizer.LayoutCustomizer;
20 import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
21 import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
22 
23 public final class SouthSlavic extends LayoutBase {
24     private static final String LAYOUT_NAME = "south_slavic";
25 
SouthSlavic(final LayoutCustomizer customizer)26     public SouthSlavic(final LayoutCustomizer customizer) {
27         super(customizer, Symbols.class, SymbolsShifted.class);
28     }
29 
30     @Override
getName()31     public String getName() { return LAYOUT_NAME; }
32 
33     @Override
getCommonAlphabetLayout(final boolean isPhone)34     ExpectedKey[][] getCommonAlphabetLayout(final boolean isPhone) { return ALPHABET_COMMON; }
35 
36     public static final String ROW1_6 = "ROW1_6";
37     public static final String ROW2_11 = "ROW2_11";
38     public static final String ROW3_1 = "ROW3_1";
39     public static final String ROW3_8 = "ROW3_8";
40 
41     private static final ExpectedKey[][] ALPHABET_COMMON = new ExpectedKeyboardBuilder()
42             .setKeysOfRow(1,
43                     // U+0459: "љ" CYRILLIC SMALL LETTER LJE
44                     key("\u0459", additionalMoreKey("1")),
45                     // U+045A: "њ" CYRILLIC SMALL LETTER NJE
46                     key("\u045A", additionalMoreKey("2")),
47                     // U+0435: "е" CYRILLIC SMALL LETTER IE
48                     key("\u0435", additionalMoreKey("3")),
49                     // U+0440: "р" CYRILLIC SMALL LETTER ER
50                     key("\u0440", additionalMoreKey("4")),
51                     // U+0442: "т" CYRILLIC SMALL LETTER TE
52                     key("\u0442", additionalMoreKey("5")),
53                     key(ROW1_6, additionalMoreKey("6")),
54                     // U+0443: "у" CYRILLIC SMALL LETTER U
55                     key("\u0443", additionalMoreKey("7")),
56                     // U+0438: "и" CYRILLIC SMALL LETTER I
57                     key("\u0438", additionalMoreKey("8")),
58                     // U+043E: "о" CYRILLIC SMALL LETTER O
59                     key("\u043E", additionalMoreKey("9")),
60                     // U+043F: "п" CYRILLIC SMALL LETTER PE
61                     key("\u043F", additionalMoreKey("0")),
62                     // U+0448: "ш" CYRILLIC SMALL LETTER SHA
63                     "\u0448")
64             .setKeysOfRow(2,
65                     // U+0430: "а" CYRILLIC SMALL LETTER A
66                     // U+0441: "с" CYRILLIC SMALL LETTER ES
67                     // U+0434: "д" CYRILLIC SMALL LETTER DE
68                     // U+0444: "ф" CYRILLIC SMALL LETTER EF
69                     // U+0433: "г" CYRILLIC SMALL LETTER GHE
70                     // U+0445: "х" CYRILLIC SMALL LETTER HA
71                     // U+0458: "ј" CYRILLIC SMALL LETTER JE
72                     // U+043A: "к" CYRILLIC SMALL LETTER KA
73                     // U+043B: "л" CYRILLIC SMALL LETTER EL
74                     // U+0447: "ч" CYRILLIC SMALL LETTER CHE
75                     "\u0430", "\u0441", "\u0434", "\u0444", "\u0433", "\u0445", "\u0458", "\u043A",
76                     "\u043B", "\u0447", ROW2_11)
77             .setKeysOfRow(3,
78                     // U+045F: "џ" CYRILLIC SMALL LETTER DZHE
79                     // U+0446: "ц" CYRILLIC SMALL LETTER TSE
80                     // U+0432: "в" CYRILLIC SMALL LETTER VE
81                     // U+0431: "б" CYRILLIC SMALL LETTER BE
82                     // U+043D: "н" CYRILLIC SMALL LETTER EN
83                     // U+043C: "м" CYRILLIC SMALL LETTER EM
84                     // U+0436: "ж" CYRILLIC SMALL LETTER ZHE
85                     ROW3_1, "\u045F", "\u0446", "\u0432", "\u0431", "\u043D", "\u043C", ROW3_8,
86                     "\u0436")
87             .build();
88 }
89