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.EastSlavicCustomizer; 20 import com.android.inputmethod.keyboard.layout.customizer.LayoutCustomizer; 21 import com.android.inputmethod.keyboard.layout.expected.ExpectedKey; 22 import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder; 23 24 import java.util.Locale; 25 26 public final class Bulgarian extends LayoutBase { 27 private static final String LAYOUT_NAME = "bulgarian"; 28 Bulgarian(final Locale locale)29 public Bulgarian(final Locale locale) { 30 super(new BulgarianCustomizer(locale), Symbols.class, SymbolsShifted.class); 31 } 32 33 @Override getName()34 public String getName() { return LAYOUT_NAME; } 35 36 private static class BulgarianCustomizer extends LayoutCustomizer { 37 private final EastSlavicCustomizer mEastSlavicCustomizer; 38 BulgarianCustomizer(final Locale locale)39 BulgarianCustomizer(final Locale locale) { 40 super(locale); 41 mEastSlavicCustomizer = new EastSlavicCustomizer(locale); 42 } 43 44 @Override getAlphabetKey()45 public ExpectedKey getAlphabetKey() { 46 return mEastSlavicCustomizer.getAlphabetKey(); 47 } 48 49 @Override getDoubleQuoteMoreKeys()50 public ExpectedKey[] getDoubleQuoteMoreKeys() { return Symbols.DOUBLE_QUOTES_R9L; } 51 } 52 53 @Override getCommonAlphabetLayout(final boolean isPhone)54 ExpectedKey[][] getCommonAlphabetLayout(final boolean isPhone) { return ALPHABET_COMMON; } 55 56 private static final ExpectedKey[][] ALPHABET_COMMON = new ExpectedKeyboardBuilder() 57 .setKeysOfRow(1, 58 // U+044F: "я" CYRILLIC SMALL LETTER YA 59 key("\u044F", moreKey("1")), 60 // U+0432: "в" CYRILLIC SMALL LETTER VE 61 key("\u0432", moreKey("2")), 62 // U+0435: "е" CYRILLIC SMALL LETTER IE 63 key("\u0435", moreKey("3")), 64 // U+0440: "р" CYRILLIC SMALL LETTER ER 65 key("\u0440", moreKey("4")), 66 // U+0442: "т" CYRILLIC SMALL LETTER TE 67 key("\u0442", moreKey("5")), 68 // U+044A: "ъ" CYRILLIC SMALL LETTER HARD SIGN 69 key("\u044A", moreKey("6")), 70 // U+0443: "у" CYRILLIC SMALL LETTER U 71 key("\u0443", moreKey("7")), 72 // U+0438: "и" CYRILLIC SMALL LETTER I 73 // U+045D: "ѝ" CYRILLIC SMALL LETTER I WITH GRAVE 74 key("\u0438", joinMoreKeys("8", "\u045D")), 75 // U+043E: "о" CYRILLIC SMALL LETTER O 76 key("\u043E", moreKey("9")), 77 // U+043F: "п" CYRILLIC SMALL LETTER PE 78 key("\u043F", moreKey("0")), 79 // U+0447: "ч" CYRILLIC SMALL LETTER CHE 80 "\u0447") 81 .setKeysOfRow(2, 82 // U+0430: "а" CYRILLIC SMALL LETTER A 83 // U+0441: "с" CYRILLIC SMALL LETTER ES 84 // U+0434: "д" CYRILLIC SMALL LETTER DE 85 // U+0444: "ф" CYRILLIC SMALL LETTER EF 86 // U+0433: "г" CYRILLIC SMALL LETTER GHE 87 // U+0445: "х" CYRILLIC SMALL LETTER HA 88 // U+0439: "й" CYRILLIC SMALL LETTER SHORT I 89 // U+043A: "к" CYRILLIC SMALL LETTER KA 90 // U+043B: "л" CYRILLIC SMALL LETTER EL 91 // U+0448: "ш" CYRILLIC SMALL LETTER SHA 92 // U+0449: "щ" CYRILLIC SMALL LETTER SHCHA 93 "\u0430", "\u0441", "\u0434", "\u0444", "\u0433", "\u0445", "\u0439", "\u043A", 94 "\u043B", "\u0448", "\u0449") 95 .setKeysOfRow(3, 96 // U+0437: "з" CYRILLIC SMALL LETTER ZE 97 // U+044C: "ь" CYRILLIC SMALL LETTER SOFT SIGN 98 // U+0446: "ц" CYRILLIC SMALL LETTER TSE 99 // U+0436: "ж" CYRILLIC SMALL LETTER ZHE 100 // U+0431: "б" CYRILLIC SMALL LETTER BE 101 // U+043D: "н" CYRILLIC SMALL LETTER EN 102 // U+043C: "м" CYRILLIC SMALL LETTER EM 103 // U+044E: "ю" CYRILLIC SMALL LETTER YU 104 "\u0437", "\u044C", "\u0446", "\u0436", "\u0431", "\u043D", "\u043C", "\u044E") 105 .build(); 106 } 107