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.LayoutCustomizer;
     20 import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
     21 import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
     22 
     23 /**
     24  * The Bengali keyboard.
     25  */
     26 public final class Bengali extends LayoutBase {
     27     private static final String LAYOUT_NAME = "bengali";
     28 
     29     public Bengali(final LayoutCustomizer customizer) {
     30         super(customizer, Symbols.class, SymbolsShifted.class);
     31     }
     32 
     33     @Override
     34     public String getName() { return LAYOUT_NAME; }
     35 
     36     @Override
     37     ExpectedKey[][] getCommonAlphabetLayout(boolean isPhone) { return ALPHABET_COMMON; }
     38 
     39     @Override
     40     ExpectedKey[][] getCommonAlphabetShiftLayout(boolean isPhone, final int elementId) {
     41         return null;
     42     }
     43 
     44     private static final ExpectedKey[][] ALPHABET_COMMON = new ExpectedKeyboardBuilder()
     45             .setKeysOfRow(1,
     46                     // U+0994: "" BENGALI LETTER AU
     47                     // U+09CC: "" BENGALI VOWEL SIGN AU
     48                     // U+09E7: "" BENGALI DIGIT ONE
     49                     key("\u0994", joinMoreKeys("\u09CC", "\u09E7", "1")),
     50                     // U+0990: "" BENGALI LETTER AI
     51                     // U+09C8: "" BENGALI VOWEL SIGN AI
     52                     // U+09E8: "" BENGALI DIGIT TWO
     53                     key("\u0990", joinMoreKeys("\u09C8", "\u09E8", "2")),
     54                     // U+0986: "" BENGALI LETTER AA
     55                     // U+09BE: "" BENGALI VOWEL SIGN AA
     56                     // U+09E9: "" BENGALI DIGIT THREE
     57                     key("\u0986", joinMoreKeys("\u09BE", "\u09E9", "3")),
     58                     // U+0988: "" BENGALI LETTER II
     59                     // U+09C0: "" BENGALI VOWEL SIGN II
     60                     // U+09EA: "" BENGALI DIGIT FOUR
     61                     key("\u0988", joinMoreKeys("\u09C0", "\u09EA", "4")),
     62                     // U+098A: "" BENGALI LETTER UU
     63                     // U+09C2: "" BENGALI VOWEL SIGN UU
     64                     // U+09EB: "" BENGALI DIGIT FIVE
     65                     key("\u098A", joinMoreKeys("\u09C2", "\u09EB", "5")),
     66                     // U+09AC: "" BENGALI LETTER BA
     67                     // U+09AD: "" BENGALI LETTER BHA
     68                     // U+09EC: "" BENGALI DIGIT SIX
     69                     key("\u09AC", joinMoreKeys("\u09AD", "\u09EC", "6")),
     70                     // U+09B9: "" BENGALI LETTER HA
     71                     // U+09ED: "" BENGALI DIGIT SEVEN
     72                     key("\u09B9", joinMoreKeys("\u09ED", "7")),
     73                     // U+0997: "" BENGALI LETTER GA
     74                     // U+0998: "" BENGALI LETTER GHA
     75                     // U+09EE: "" BENGALI DIGIT EIGHT
     76                     key("\u0997", joinMoreKeys("\u0998", "\u09EE", "8")),
     77                     // U+09A6: "" BENGALI LETTER DA
     78                     // U+09A7: "" BENGALI LETTER DHA
     79                     // U+09EF: "" BENGALI DIGIT NINE
     80                     key("\u09A6", joinMoreKeys("\u09A7", "\u09EF", "9")),
     81                     // U+099C: "" BENGALI LETTER JA
     82                     // U+099D: "" BENGALI LETTER JHA
     83                     // U+099C/U+09CD/U+099E:
     84                     //     "" BENGALI LETTER JA/BENGALI SIGN VIRAMA/BENGALI LETTER NYA
     85                     // U+09E6: "" BENGALI DIGIT ZERO
     86                     key("\u099C", joinMoreKeys("\u099D", "\u099C\u09CD\u099E", "\u09E6", "0")),
     87                     // U+09A1: "" BENGALI LETTER DDA
     88                     // U+09A1/U+09BC: "" BENGALI LETTER DDA/BENGALI SIGN NUKTA
     89                     key("\u09A1", moreKey("\u09A1\u09BC")))
     90             .setKeysOfRow(2,
     91                     // U+0993: "" BENGALI LETTER O
     92                     // U+09CB: "" BENGALI VOWEL SIGN O
     93                     key("\u0993", moreKey("\u09CB")),
     94                     // U+098F: "" BENGALI LETTER E
     95                     // U+09C7: "" BENGALI VOWEL SIGN E
     96                     key("\u098F", moreKey("\u09C7")),
     97                     // U+0985: "" BENGALI LETTER A
     98                     // U+09CD: "" BENGALI SIGN VIRAMA
     99                     key("\u0985", moreKey("\u09CD")),
    100                     // U+0987: "" BENGALI LETTER I
    101                     // U+09BF: "" BENGALI VOWEL SIGN I
    102                     key("\u0987", moreKey("\u09BF")),
    103                     // U+0989: "" BENGALI LETTER U
    104                     // U+09C1: "" BENGALI VOWEL SIGN U
    105                     key("\u0989", moreKey("\u09C1")),
    106                     // U+09AA: "" BENGALI LETTER PA
    107                     // U+09AB: "" BENGALI LETTER PHA
    108                     key("\u09AA", moreKey("\u09AB")),
    109                     // U+09B0: "" BENGALI LETTER RA
    110                     // U+09C3: "" BENGALI VOWEL SIGN VOCALIC R
    111                     // U+098B: "" BENGALI LETTER VOCALIC R
    112                     // U+09A4/U+09CD/U+09B0:
    113                     //     "" BENGALI LETTER TA/BENGALI SIGN VIRAMA/BENGALI LETTER RA
    114                     key("\u09B0", joinMoreKeys("\u09C3", "\u098B", "\u09A4\u09CD\u09B0")),
    115                     // U+0995: "" BENGALI LETTER KA
    116                     // U+0996: "" BENGALI LETTER KHA
    117                     key("\u0995", moreKey("\u0996")),
    118                     // U+09A4: "" BENGALI LETTER TA
    119                     // U+09CE: "" BENGALI LETTER KHANDA TA
    120                     // U+09A5: "" BENGALI LETTER THA
    121                     // U+09A4/U+09CD/U+09A4:
    122                     //     "" BENGALI LETTER TA/BENGALI SIGN VIRAMA/BENGALI LETTER TA
    123                     key("\u09A4", joinMoreKeys("\u09CE", "\u09A5", "\u09A4\u09CD\u09A4")),
    124                     // U+099A: "" BENGALI LETTER CA
    125                     // U+099B: "" BENGALI LETTER CHA
    126                     key("\u099A", moreKey("\u099B")),
    127                     // U+099F: "" BENGALI LETTER TTA
    128                     // U+09A0: "" BENGALI LETTER TTHA
    129                     key("\u099F", moreKey("\u09A0")))
    130             .setKeysOfRow(3,
    131                     // U+0981: "" BENGALI SIGN CANDRABINDU
    132                     // U+0983: "" BENGALI SIGN VISARGA
    133                     // U+0982: "" BENGALI SIGN ANUSVARA
    134                     key("\u0981", joinMoreKeys("\u0983", "\u0982")),
    135                     // U+09A2: "" BENGALI LETTER DDHA
    136                     // U+09A2/U+09BC: "" BENGALI LETTER DDHA/BENGALI SIGN NUKTA
    137                     key("\u09A2", moreKey("\u09A2\u09BC")),
    138                     // U+09AE: "" BENGALI LETTER MA
    139                     "\u09AE",
    140                     // U+09A8: "" BENGALI LETTER NA
    141                     // U+09A3: "" BENGALI LETTER NNA
    142                     key("\u09A8", moreKey("\u09A3")),
    143                     // U+099E: "" BENGALI LETTER NYA
    144                     // U+0999: "" BENGALI LETTER NGA
    145                     // U+099E/U+09CD/U+099C:
    146                     //     "" BENGALI LETTER NYA/BENGALI SIGN VIRAMA/BENGALI LETTER JA
    147                     key("\u099E", joinMoreKeys("\u0999", "\u099E\u09CD\u099C")),
    148                     // U+09B2: "" BENGALI LETTER LA
    149                     "\u09B2",
    150                     // U+09B7: "" BENGALI LETTER SSA
    151                     // U+0995/U+09CD/U+09B7:
    152                     //     "" BENGALI LETTER KA/BENGALI SIGN VIRAMA/BENGALI LETTER SSA
    153                     key("\u09B7", moreKey("\u0995\u09CD\u09B7")),
    154                     // U+09B8: "" BENGALI LETTER SA
    155                     // U+09B6: "" BENGALI LETTER SHA
    156                     key("\u09B8", moreKey("\u09B6")),
    157                     // U+09DF: "" BENGALI LETTER YYA
    158                     // U+09AF: "" BENGALI LETTER YA
    159                     key("\u09DF", moreKey("\u09AF")),
    160                     // U+0964: "" DEVANAGARI DANDA
    161                     // U+0965: "" DEVANAGARI DOUBLE DANDA
    162                     key("\u0964", moreKey("\u0965")))
    163             .build();
    164 }
    165