TestsSlovenian.java revision 1912609a9e336d4043e506bccf6f3bff9d835baf
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
17package com.android.inputmethod.keyboard.layout.tests;
18
19import android.test.suitebuilder.annotation.SmallTest;
20
21import com.android.inputmethod.keyboard.layout.LayoutBase;
22import com.android.inputmethod.keyboard.layout.LayoutBase.EuroLayoutCustomizer;
23import com.android.inputmethod.keyboard.layout.Qwerty;
24import com.android.inputmethod.keyboard.layout.Symbols;
25import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
26import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
27
28import java.util.Locale;
29
30/**
31 * sl: Slovenian/qwerty
32 */
33@SmallTest
34public final class TestsSlovenian extends LayoutTestsBase {
35    private static final Locale LOCALE = new Locale("sl");
36    private static final LayoutBase LAYOUT = new Qwerty(new SlovenianCustomizer(LOCALE));
37
38    @Override
39    LayoutBase getLayout() { return LAYOUT; }
40
41    private static class SlovenianCustomizer extends EuroLayoutCustomizer {
42        public SlovenianCustomizer(final Locale locale) { super(locale); }
43
44        @Override
45        public ExpectedKey[] getDoubleQuoteMoreKeys() { return Symbols.DOUBLE_QUOTES_R9L; }
46
47        @Override
48        public ExpectedKey[] getSingleQuoteMoreKeys() { return Symbols.SINGLE_QUOTES_R9L; }
49
50        @Override
51        public ExpectedKey[] getDoubleAngleQuoteKeys() { return Symbols.DOUBLE_ANGLE_QUOTES_RL; }
52
53        @Override
54        public ExpectedKey[] getSingleAngleQuoteKeys() { return Symbols.SINGLE_ANGLE_QUOTES_RL; }
55
56        @Override
57        public ExpectedKeyboardBuilder setAccentedLetters(final ExpectedKeyboardBuilder builder) {
58            return builder
59                    // U+0161: "š" LATIN SMALL LETTER S WITH CARON
60                    .setMoreKeysOf("s", "\u0161")
61                    // U+0111: "đ" LATIN SMALL LETTER D WITH STROKE
62                    .setMoreKeysOf("d", "\u0111")
63                    // U+017E: "ž" LATIN SMALL LETTER Z WITH CARON
64                    .setMoreKeysOf("z", "\u017E")
65                    // U+010D: "č" LATIN SMALL LETTER C WITH CARON
66                    // U+0107: "ć" LATIN SMALL LETTER C WITH ACUTE
67                    .setMoreKeysOf("c", "\u010D", "\u0107");
68        }
69    }
70}
71