Home | History | Annotate | Download | only in layout
      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.expected.ExpectedKey;
     21 import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
     22 
     23 import java.util.Locale;
     24 
     25 public final class Mongolian extends LayoutBase {
     26     private static final String LAYOUT_NAME = "mongolian";
     27 
     28     public Mongolian(final Locale locale) {
     29         super(new MongolianCustomizer(locale), Symbols.class, SymbolsShifted.class);
     30     }
     31 
     32     @Override
     33     public String getName() { return LAYOUT_NAME; }
     34 
     35     private static class MongolianCustomizer extends EastSlavicCustomizer {
     36         MongolianCustomizer(final Locale locale) { super(locale); }
     37 
     38         @Override
     39         public ExpectedKey getCurrencyKey() { return CURRENCY_TUGRIK; }
     40 
     41         @Override
     42         public ExpectedKey[] getOtherCurrencyKeys() {
     43             return SymbolsShifted.CURRENCIES_OTHER_GENERIC;
     44         }
     45 
     46         // U+20AE: "" TUGRIK SIGN
     47         private static final ExpectedKey CURRENCY_TUGRIK = key("\u20AE",
     48                 Symbols.CURRENCY_GENERIC_MORE_KEYS);
     49     }
     50 
     51     @Override
     52     ExpectedKey[][] getCommonAlphabetLayout(final boolean isPhone) { return ALPHABET_COMMON; }
     53 
     54     private static final ExpectedKey[][] ALPHABET_COMMON = new ExpectedKeyboardBuilder()
     55             .setKeysOfRow(1,
     56                     // U+0444: "" CYRILLIC SMALL LETTER EF
     57                     key("\u0444", moreKey("1")),
     58                     // U+0446: "" CYRILLIC SMALL LETTER TSE
     59                     key("\u0446", moreKey("2")),
     60                     // U+0443: "" CYRILLIC SMALL LETTER U
     61                     key("\u0443", moreKey("3")),
     62                     // U+0436: "" CYRILLIC SMALL LETTER ZHE
     63                     key("\u0436", moreKey("4")),
     64                     // U+044D: "" CYRILLIC SMALL LETTER E
     65                     key("\u044D", moreKey("5")),
     66                     // U+043D: "" CYRILLIC SMALL LETTER EN
     67                     key("\u043D", moreKey("6")),
     68                     // U+0433: "" CYRILLIC SMALL LETTER GHE
     69                     key("\u0433", moreKey("7")),
     70                     // U+0448: "" CYRILLIC SMALL LETTER SHA
     71                     // U+0449: "" CYRILLIC SMALL LETTER SHCHA
     72                     key("\u0448", joinMoreKeys("8", "\u0449")),
     73                     // U+04AF: "" CYRILLIC SMALL LETTER STRAIGHT U
     74                     key("\u04AF", moreKey("9")),
     75                     // U+0437: "" CYRILLIC SMALL LETTER ZE
     76                     key("\u0437", moreKey("0")),
     77                     // U+043A: "" CYRILLIC SMALL LETTER KA
     78                     "\u043A")
     79             .setKeysOfRow(2,
     80                     // U+0439: "" CYRILLIC SMALL LETTER SHORT I
     81                     // U+044B: "" CYRILLIC SMALL LETTER YERU
     82                     // U+0431: "" CYRILLIC SMALL LETTER BE
     83                     // U+04E9: "" CYRILLIC SMALL LETTER BARRED O
     84                     // U+0430: "" CYRILLIC SMALL LETTER A
     85                     // U+0445: "" CYRILLIC SMALL LETTER HA
     86                     // U+0440: "" CYRILLIC SMALL LETTER ER
     87                     // U+043E: "" CYRILLIC SMALL LETTER O
     88                     // U+043B: "" CYRILLIC SMALL LETTER EL
     89                     // U+0434: "" CYRILLIC SMALL LETTER DE
     90                     // U+043F: "" CYRILLIC SMALL LETTER PE
     91                     "\u0439", "\u044B", "\u0431", "\u04E9", "\u0430", "\u0445", "\u0440", "\u043E",
     92                     "\u043B", "\u0434", "\u043F")
     93             .setKeysOfRow(3,
     94                     // U+044F: "" CYRILLIC SMALL LETTER YA
     95                     // U+0447: "" CYRILLIC SMALL LETTER CHE
     96                     "\u044F", "\u0447",
     97                     // U+0451: "" CYRILLIC SMALL LETTER IO
     98                     // U+0435: "" CYRILLIC SMALL LETTER IE
     99                     key("\u0451", moreKey("\u0435")),
    100                     // U+0441: "" CYRILLIC SMALL LETTER ES
    101                     // U+043C: "" CYRILLIC SMALL LETTER EM
    102                     // U+0438: "" CYRILLIC SMALL LETTER I
    103                     // U+0442: "" CYRILLIC SMALL LETTER TE
    104                     "\u0441", "\u043C", "\u0438", "\u0442",
    105                     // U+044C: "" CYRILLIC SMALL LETTER SOFT SIGN
    106                     // U+044A: "" CYRILLIC SMALL LETTER HARD SIGN
    107                     key("\u044C", moreKey("\u044A")),
    108                     // U+0432: "" CYRILLIC SMALL LETTER VE
    109                     // U+044E: "" CYRILLIC SMALL LETTER YU
    110                     key("\u0432", moreKey("\u044E")))
    111             .build();
    112 }
    113