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.customizer; 18 19 import com.android.inputmethod.keyboard.KeyboardId; 20 import com.android.inputmethod.keyboard.layout.Nordic; 21 import com.android.inputmethod.keyboard.layout.Symbols; 22 import com.android.inputmethod.keyboard.layout.expected.ExpectedKey; 23 import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder; 24 25 import java.util.Locale; 26 27 public class EstonianEECustomizer extends EuroCustomizer { 28 public EstonianEECustomizer(final Locale locale) { super(locale); } 29 30 @Override 31 public ExpectedKey[] getDoubleQuoteMoreKeys() { return Symbols.DOUBLE_QUOTES_R9L; } 32 33 @Override 34 public ExpectedKey[] getSingleQuoteMoreKeys() { return Symbols.SINGLE_QUOTES_R9L; } 35 36 protected void setNordicKeys(final ExpectedKeyboardBuilder builder) { 37 builder 38 // U+00FC: "" LATIN SMALL LETTER U WITH DIAERESIS 39 .replaceKeyOfLabel(Nordic.ROW1_11, "\u00FC") 40 // U+00F6: "" LATIN SMALL LETTER O WITH DIAERESIS 41 // U+00F5: "" LATIN SMALL LETTER O WITH TILDE 42 .replaceKeyOfLabel(Nordic.ROW2_10, "\u00F6") 43 .setMoreKeysOf("\u00F6", "\u00F5") 44 // U+00E4: "" LATIN SMALL LETTER A WITH DIAERESIS 45 .replaceKeyOfLabel(Nordic.ROW2_11, "\u00E4"); 46 } 47 48 protected void setMoreKeysOfA(final ExpectedKeyboardBuilder builder) { 49 builder 50 // U+0101: "" LATIN SMALL LETTER A WITH MACRON 51 // U+00E0: "" LATIN SMALL LETTER A WITH GRAVE 52 // U+00E1: "" LATIN SMALL LETTER A WITH ACUTE 53 // U+00E2: "" LATIN SMALL LETTER A WITH CIRCUMFLEX 54 // U+00E3: "" LATIN SMALL LETTER A WITH TILDE 55 // U+00E5: "" LATIN SMALL LETTER A WITH RING ABOVE 56 // U+00E6: "" LATIN SMALL LETTER AE 57 // U+0105: "" LATIN SMALL LETTER A WITH OGONEK 58 .setMoreKeysOf("a", "\u0101", "\u00E0", "\u00E1", "\u00E2", "\u00E3", "\u00E5", 59 "\u00E6", "\u0105"); 60 } 61 62 protected void setMoreKeysOfI(final ExpectedKeyboardBuilder builder, final int elementId) { 63 // U+012B: "" LATIN SMALL LETTER I WITH MACRON 64 // U+00EC: "" LATIN SMALL LETTER I WITH GRAVE 65 // U+012F: "" LATIN SMALL LETTER I WITH OGONEK 66 // U+00ED: "" LATIN SMALL LETTER I WITH ACUTE 67 // U+00EE: "" LATIN SMALL LETTER I WITH CIRCUMFLEX 68 // U+00EF: "" LATIN SMALL LETTER I WITH DIAERESIS 69 // U+0131: "" LATIN SMALL LETTER DOTLESS I 70 if (elementId == KeyboardId.ELEMENT_ALPHABET) { 71 builder.setMoreKeysOf("i", 72 "\u012B", "\u00EC", "\u012F", "\u00ED", "\u00EE", "\u00EF", "\u0131"); 73 } else { 74 // The upper-case letter of "" in Estonian locale is "I". It should be omitted 75 // from the more keys of "I". 76 builder.setMoreKeysOf("i", 77 "\u012B", "\u00EC", "\u012F", "\u00ED", "\u00EE", "\u00EF"); 78 } 79 } 80 81 protected void setMoreKeysOfO(final ExpectedKeyboardBuilder builder) { 82 builder 83 // U+00F5: "" LATIN SMALL LETTER O WITH TILDE 84 // U+00F2: "" LATIN SMALL LETTER O WITH GRAVE 85 // U+00F3: "" LATIN SMALL LETTER O WITH ACUTE 86 // U+00F4: "" LATIN SMALL LETTER O WITH CIRCUMFLEX 87 // U+0153: "" LATIN SMALL LIGATURE OE 88 // U+0151: "" LATIN SMALL LETTER O WITH DOUBLE ACUTE 89 // U+00F8: "" LATIN SMALL LETTER O WITH STROKE 90 .setMoreKeysOf("o", "\u00F5", "\u00F2", "\u00F3", "\u00F4", "\u0153", "\u0151", 91 "\u00F8"); 92 } 93 94 protected void setMoreKeysOfU(final ExpectedKeyboardBuilder builder) { 95 builder 96 // U+016B: "" LATIN SMALL LETTER U WITH MACRON 97 // U+0173: "" LATIN SMALL LETTER U WITH OGONEK 98 // U+00F9: "" LATIN SMALL LETTER U WITH GRAVE 99 // U+00FA: "" LATIN SMALL LETTER U WITH ACUTE 100 // U+00FB: "" LATIN SMALL LETTER U WITH CIRCUMFLEX 101 // U+016F: "" LATIN SMALL LETTER U WITH RING ABOVE 102 // U+0171: "" LATIN SMALL LETTER U WITH DOUBLE ACUTE 103 .setMoreKeysOf("u", "\u016B", "\u0173", "\u00F9", "\u00FA", "\u00FB", "\u016F", 104 "\u0171"); 105 } 106 107 @Override 108 public ExpectedKeyboardBuilder setAccentedLetters(final ExpectedKeyboardBuilder builder, 109 final int elementId) { 110 setNordicKeys(builder); 111 setMoreKeysOfA(builder); 112 setMoreKeysOfI(builder, elementId); 113 setMoreKeysOfO(builder); 114 setMoreKeysOfU(builder); 115 return builder 116 // U+0113: "" LATIN SMALL LETTER E WITH MACRON 117 // U+00E8: "" LATIN SMALL LETTER E WITH GRAVE 118 // U+0117: "" LATIN SMALL LETTER E WITH DOT ABOVE 119 // U+00E9: "" LATIN SMALL LETTER E WITH ACUTE 120 // U+00EA: "" LATIN SMALL LETTER E WITH CIRCUMFLEX 121 // U+00EB: "" LATIN SMALL LETTER E WITH DIAERESIS 122 // U+0119: "" LATIN SMALL LETTER E WITH OGONEK 123 // U+011B: "" LATIN SMALL LETTER E WITH CARON 124 .setMoreKeysOf("e", 125 "\u0113", "\u00E8", "\u0117", "\u00E9", "\u00EA", "\u00EB", "\u0119", 126 "\u011B") 127 // U+0157: "" LATIN SMALL LETTER R WITH CEDILLA 128 // U+0159: "" LATIN SMALL LETTER R WITH CARON 129 // U+0155: "" LATIN SMALL LETTER R WITH ACUTE 130 .setMoreKeysOf("r", "\u0157", "\u0159", "\u0155") 131 // U+0163: "" LATIN SMALL LETTER T WITH CEDILLA 132 // U+0165: "" LATIN SMALL LETTER T WITH CARON 133 .setMoreKeysOf("t", "\u0163", "\u0165") 134 // U+00FD: "" LATIN SMALL LETTER Y WITH ACUTE 135 // U+00FF: "" LATIN SMALL LETTER Y WITH DIAERESIS 136 .setMoreKeysOf("y", "\u00FD", "\u00FF") 137 // U+0161: "" LATIN SMALL LETTER S WITH CARON 138 // U+00DF: "" LATIN SMALL LETTER SHARP S 139 // U+015B: "" LATIN SMALL LETTER S WITH ACUTE 140 // U+015F: "" LATIN SMALL LETTER S WITH CEDILLA 141 .setMoreKeysOf("s", "\u0161", "\u00DF", "\u015B", "\u015F") 142 // U+010F: "" LATIN SMALL LETTER D WITH CARON 143 .setMoreKeysOf("d", "\u010F") 144 // U+0123: "" LATIN SMALL LETTER G WITH CEDILLA 145 // U+011F: "" LATIN SMALL LETTER G WITH BREVE 146 .setMoreKeysOf("g", "\u0123", "\u011F") 147 // U+0137: "" LATIN SMALL LETTER K WITH CEDILLA 148 .setMoreKeysOf("k", "\u0137") 149 // U+013C: "" LATIN SMALL LETTER L WITH CEDILLA 150 // U+0142: "" LATIN SMALL LETTER L WITH STROKE 151 // U+013A: "" LATIN SMALL LETTER L WITH ACUTE 152 // U+013E: "" LATIN SMALL LETTER L WITH CARON 153 .setMoreKeysOf("l", "\u013C", "\u0142", "\u013A", "\u013E") 154 // U+017E: "" LATIN SMALL LETTER Z WITH CARON 155 // U+017C: "" LATIN SMALL LETTER Z WITH DOT ABOVE 156 // U+017A: "" LATIN SMALL LETTER Z WITH ACUTE 157 .setMoreKeysOf("z", "\u017E", "\u017C", "\u017A") 158 // U+010D: "" LATIN SMALL LETTER C WITH CARON 159 // U+00E7: "" LATIN SMALL LETTER C WITH CEDILLA 160 // U+0107: "" LATIN SMALL LETTER C WITH ACUTE 161 .setMoreKeysOf("c", "\u010D", "\u00E7", "\u0107") 162 // U+0146: "" LATIN SMALL LETTER N WITH CEDILLA 163 // U+00F1: "" LATIN SMALL LETTER N WITH TILDE 164 // U+0144: "" LATIN SMALL LETTER N WITH ACUTE 165 .setMoreKeysOf("n", "\u0146", "\u00F1", "\u0144"); 166 } 167 } 168