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.expected.ExpectedKey; 20 import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder; 21 22 import java.util.Locale; 23 24 public class FrenchCustomizer extends LayoutCustomizer { 25 public FrenchCustomizer(final Locale locale) { super(locale); } 26 27 @Override 28 public ExpectedKeyboardBuilder setAccentedLetters(final ExpectedKeyboardBuilder builder) { 29 return builder 30 // U+00E0: "" LATIN SMALL LETTER A WITH GRAVE 31 // U+00E2: "" LATIN SMALL LETTER A WITH CIRCUMFLEX 32 // U+00E6: "" LATIN SMALL LETTER AE 33 // U+00E1: "" LATIN SMALL LETTER A WITH ACUTE 34 // U+00E4: "" LATIN SMALL LETTER A WITH DIAERESIS 35 // U+00E3: "" LATIN SMALL LETTER A WITH TILDE 36 // U+00E5: "" LATIN SMALL LETTER A WITH RING ABOVE 37 // U+0101: "" LATIN SMALL LETTER A WITH MACRON 38 // U+00AA: "" FEMININE ORDINAL INDICATOR 39 .setAdditionalMoreKeysPositionOf("a", 3) 40 .setMoreKeysOf("a", 41 "\u00E0", "\u00E2", "\u00E6", "\u00E1", "\u00E4", "\u00E3", "\u00E5", 42 "\u0101", "\u00AA") 43 // U+00E9: "" LATIN SMALL LETTER E WITH ACUTE 44 // U+00E8: "" LATIN SMALL LETTER E WITH GRAVE 45 // U+00EA: "" LATIN SMALL LETTER E WITH CIRCUMFLEX 46 // U+00EB: "" LATIN SMALL LETTER E WITH DIAERESIS 47 // U+0119: "" LATIN SMALL LETTER E WITH OGONEK 48 // U+0117: "" LATIN SMALL LETTER E WITH DOT ABOVE 49 // U+0113: "" LATIN SMALL LETTER E WITH MACRON 50 .setAdditionalMoreKeysPositionOf("e", 5) 51 .setMoreKeysOf("e", 52 "\u00E9", "\u00E8", "\u00EA", "\u00EB", "\u0119", "\u0117", "\u0113") 53 // U+00FF: "" LATIN SMALL LETTER Y WITH DIAERESIS 54 .setMoreKeysOf("y", "\u00FF") 55 // U+00F9: "" LATIN SMALL LETTER U WITH GRAVE 56 // U+00FB: "" LATIN SMALL LETTER U WITH CIRCUMFLEX 57 // U+00FC: "" LATIN SMALL LETTER U WITH DIAERESIS 58 // U+00FA: "" LATIN SMALL LETTER U WITH ACUTE 59 // U+016B: "" LATIN SMALL LETTER U WITH MACRON 60 .setAdditionalMoreKeysPositionOf("u", 3) 61 .setMoreKeysOf("u", "\u00F9", "\u00FB", "\u00FC", "\u00FA", "\u016B") 62 // U+00EE: "" LATIN SMALL LETTER I WITH CIRCUMFLEX 63 // U+00EF: "" LATIN SMALL LETTER I WITH DIAERESIS 64 // U+00EC: "" LATIN SMALL LETTER I WITH GRAVE 65 // U+00ED: "" LATIN SMALL LETTER I WITH ACUTE 66 // U+012F: "" LATIN SMALL LETTER I WITH OGONEK 67 // U+012B: "" LATIN SMALL LETTER I WITH MACRON 68 .setAdditionalMoreKeysPositionOf("i", 2) 69 .setMoreKeysOf("i", "\u00EE", "\u00EF", "\u00EC", "\u00ED", "\u012F", "\u012B") 70 // U+00F4: "" LATIN SMALL LETTER O WITH CIRCUMFLEX 71 // U+0153: "" LATIN SMALL LIGATURE OE 72 // U+00F6: "" LATIN SMALL LETTER O WITH DIAERESIS 73 // U+00F2: "" LATIN SMALL LETTER O WITH GRAVE 74 // U+00F3: "" LATIN SMALL LETTER O WITH ACUTE 75 // U+00F5: "" LATIN SMALL LETTER O WITH TILDE 76 // U+00F8: "" LATIN SMALL LETTER O WITH STROKE 77 // U+014D: "" LATIN SMALL LETTER O WITH MACRON 78 // U+00BA: "" MASCULINE ORDINAL INDICATOR 79 .setAdditionalMoreKeysPositionOf("o", 3) 80 .setMoreKeysOf("o", 81 "\u00F4", "\u0153", "\u00F6", "\u00F2", "\u00F3", "\u00F5", "\u00F8", 82 "\u014D", "\u00BA") 83 // U+00E7: "" LATIN SMALL LETTER C WITH CEDILLA 84 // U+0107: "" LATIN SMALL LETTER C WITH ACUTE 85 // U+010D: "" LATIN SMALL LETTER C WITH CARON 86 .setMoreKeysOf("c", "\u00E7", "\u0107", "\u010D") 87 .setAdditionalMoreKeysPositionOf("c", 2); 88 } 89 90 public static final class FrenchEuroCustomizer extends FrenchCustomizer { 91 private final EuroCustomizer mEuroCustomizer; 92 93 public FrenchEuroCustomizer(final Locale locale) { 94 super(locale); 95 mEuroCustomizer = new EuroCustomizer(locale); 96 } 97 98 @Override 99 public final ExpectedKey getCurrencyKey() { return mEuroCustomizer.getCurrencyKey(); } 100 101 @Override 102 public final ExpectedKey[] getOtherCurrencyKeys() { 103 return mEuroCustomizer.getOtherCurrencyKeys(); 104 } 105 } 106 } 107