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.layout.Nordic; 20 import com.android.inputmethod.keyboard.layout.Symbols; 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 class DanishCustomizer extends EuroCustomizer { 27 public DanishCustomizer(final Locale locale) { super(locale); } 28 29 @Override 30 public ExpectedKey[] getDoubleQuoteMoreKeys() { return Symbols.DOUBLE_QUOTES_R9L; } 31 32 @Override 33 public ExpectedKey[] getSingleQuoteMoreKeys() { return Symbols.SINGLE_QUOTES_R9L; } 34 35 @Override 36 public ExpectedKey[] getDoubleAngleQuoteKeys() { return Symbols.DOUBLE_ANGLE_QUOTES_RL; } 37 38 @Override 39 public ExpectedKey[] getSingleAngleQuoteKeys() { return Symbols.SINGLE_ANGLE_QUOTES_RL; } 40 41 protected void setNordicKeys(final ExpectedKeyboardBuilder builder) { 42 builder 43 // U+00E5: "" LATIN SMALL LETTER A WITH RING ABOVE 44 .replaceKeyOfLabel(Nordic.ROW1_11, "\u00E5") 45 // U+00E6: "" LATIN SMALL LETTER AE 46 // U+00E4: "" LATIN SMALL LETTER A WITH DIAERESIS 47 .replaceKeyOfLabel(Nordic.ROW2_10, "\u00E6") 48 .setMoreKeysOf("\u00E6", "\u00E4") 49 // U+00F8: "" LATIN SMALL LETTER O WITH STROKE 50 // U+00F6: "" LATIN SMALL LETTER O WITH DIAERESIS 51 .replaceKeyOfLabel(Nordic.ROW2_11, "\u00F8") 52 .setMoreKeysOf("\u00F8", "\u00F6"); 53 } 54 55 protected void setMoreKeysOfA(final ExpectedKeyboardBuilder builder) { 56 builder 57 // U+00E1: "" LATIN SMALL LETTER A WITH ACUTE 58 // U+00E4: "" LATIN SMALL LETTER A WITH DIAERESIS 59 // U+00E0: "" LATIN SMALL LETTER A WITH GRAVE 60 // U+00E2: "" LATIN SMALL LETTER A WITH CIRCUMFLEX 61 // U+00E3: "" LATIN SMALL LETTER A WITH TILDE 62 // U+0101: "" LATIN SMALL LETTER A WITH MACRON 63 .setMoreKeysOf("a", "\u00E1", "\u00E4", "\u00E0", "\u00E2", "\u00E3", "\u0101"); 64 } 65 66 protected void setMoreKeysOfO(final ExpectedKeyboardBuilder builder) { 67 builder 68 // U+00F6: "" LATIN SMALL LETTER O WITH DIAERESIS 69 // U+00F3: "" LATIN SMALL LETTER O WITH ACUTE 70 // U+00F4: "" LATIN SMALL LETTER O WITH CIRCUMFLEX 71 // U+00F2: "" LATIN SMALL LETTER O WITH GRAVE 72 // U+00F5: "" LATIN SMALL LETTER O WITH TILDE 73 // U+0153: "" LATIN SMALL LIGATURE OE 74 // U+014D: "" LATIN SMALL LETTER O WITH MACRON 75 .setMoreKeysOf("o", "\u00F6", "\u00F3", "\u00F4", "\u00F2", "\u00F5", "\u0153", 76 "\u014D"); 77 } 78 79 @Override 80 public ExpectedKeyboardBuilder setAccentedLetters(final ExpectedKeyboardBuilder builder) { 81 setNordicKeys(builder); 82 setMoreKeysOfA(builder); 83 setMoreKeysOfO(builder); 84 return builder 85 // U+00E9: "" LATIN SMALL LETTER E WITH ACUTE 86 // U+00EB: "" LATIN SMALL LETTER E WITH DIAERESIS 87 .setMoreKeysOf("e", "\u00E9", "\u00EB") 88 // U+00FD: "" LATIN SMALL LETTER Y WITH ACUTE 89 // U+00FF: "" LATIN SMALL LETTER Y WITH DIAERESIS 90 .setMoreKeysOf("y", "\u00FD", "\u00FF") 91 // U+00FA: "" LATIN SMALL LETTER U WITH ACUTE 92 // U+00FC: "" LATIN SMALL LETTER U WITH DIAERESIS 93 // U+00FB: "" LATIN SMALL LETTER U WITH CIRCUMFLEX 94 // U+00F9: "" LATIN SMALL LETTER U WITH GRAVE 95 // U+016B: "" LATIN SMALL LETTER U WITH MACRON 96 .setMoreKeysOf("u", "\u00FA", "\u00FC", "\u00FB", "\u00F9", "\u016B") 97 // U+00ED: "" LATIN SMALL LETTER I WITH ACUTE 98 // U+00EF: "" LATIN SMALL LETTER I WITH DIAERESIS 99 .setMoreKeysOf("i", "\u00ED", "\u00EF") 100 // U+00DF: "" LATIN SMALL LETTER SHARP S 101 // U+015B: "" LATIN SMALL LETTER S WITH ACUTE 102 // U+0161: "" LATIN SMALL LETTER S WITH CARON 103 .setMoreKeysOf("s", "\u00DF", "\u015B", "\u0161") 104 // U+00F0: "" LATIN SMALL LETTER ETH 105 .setMoreKeysOf("d", "\u00F0") 106 // U+0142: "" LATIN SMALL LETTER L WITH STROKE 107 .setMoreKeysOf("l", "\u0142") 108 // U+00F1: "" LATIN SMALL LETTER N WITH TILDE 109 // U+0144: "" LATIN SMALL LETTER N WITH ACUTE 110 .setMoreKeysOf("n", "\u00F1", "\u0144"); 111 } 112 } 113