Home | History | Annotate | Download | only in customizer
      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.SerbianQwertz;
     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 class SerbianLatinCustomizer extends LayoutCustomizer {
     26     public SerbianLatinCustomizer(final Locale locale) { super(locale); }
     27 
     28     @Override
     29     public ExpectedKey[] getRightShiftKeys(final boolean isPhone) {
     30         return isPhone ? EMPTY_KEYS : EXCLAMATION_AND_QUESTION_MARKS;
     31     }
     32 
     33     protected void setSerbianKeys(final ExpectedKeyboardBuilder builder) {
     34         builder
     35                 // U+0161: "" LATIN SMALL LETTER S WITH CARON
     36                 .replaceKeyOfLabel(SerbianQwertz.ROW1_11, "\u0161")
     37                 // U+010D: "" LATIN SMALL LETTER C WITH CARON
     38                 .replaceKeyOfLabel(SerbianQwertz.ROW2_10, "\u010D")
     39                 // U+0107: "" LATIN SMALL LETTER C WITH ACUTE
     40                 .replaceKeyOfLabel(SerbianQwertz.ROW2_11, "\u0107")
     41                 // U+0111: "" LATIN SMALL LETTER D WITH STROKE
     42                 .replaceKeyOfLabel(SerbianQwertz.ROW3_8, "\u0111")
     43                 // U+017E: "" LATIN SMALL LETTER Z WITH CARON
     44                 .replaceKeyOfLabel(SerbianQwertz.ROW3_9, "\u017E");
     45     }
     46 
     47     @SuppressWarnings("unused")
     48     protected void setMoreKeysOfS(final ExpectedKeyboardBuilder builder) {
     49         // Serbian QWERTZ has a dedicated "" key.
     50     }
     51 
     52     @SuppressWarnings("unused")
     53     protected void setMoreKeysOfC(final ExpectedKeyboardBuilder builder) {
     54         // Serbian QWERTZ has a dedicated "" and "" keys.
     55     }
     56 
     57     @SuppressWarnings("unused")
     58     protected void setMoreKeysOfD(final ExpectedKeyboardBuilder builder) {
     59         // Serbian QWERTZ has a dedicated "" key.
     60     }
     61 
     62     @SuppressWarnings("unused")
     63     protected void setMoreKeysOfZ(final ExpectedKeyboardBuilder builder) {
     64         // Serbian QWERTZ has a dedicated "" key.
     65     }
     66 
     67     @Override
     68     public ExpectedKeyboardBuilder setAccentedLetters(final ExpectedKeyboardBuilder builder) {
     69         setSerbianKeys(builder);
     70         setMoreKeysOfS(builder);
     71         setMoreKeysOfC(builder);
     72         setMoreKeysOfD(builder);
     73         setMoreKeysOfZ(builder);
     74         return builder
     75                 // U+00E8: "" LATIN SMALL LETTER E WITH GRAVE
     76                 .setMoreKeysOf("e", "\u00E8")
     77                 // U+00EC: "" LATIN SMALL LETTER I WITH GRAVE
     78                 .setMoreKeysOf("i", "\u00EC");
     79     }
     80 }
     81