summaryrefslogtreecommitdiff
path: root/src/com/android/dialer/dialpad/SmartDialMap.java
blob: b51891a8cd43f184abccb74220c5599629ae369f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package com.android.dialer.dialpad;

/**
 * Note: These methods currently take characters as arguments. For future planned language support,
 * they will need to be changed to use codepoints instead of characters.
 *
 * http://docs.oracle.com/javase/6/docs/api/java/lang/String.html#codePointAt(int)
 *
 * If/when this change is made, LatinSmartDialMap(which operates on chars) will continue to work
 * by simply casting from a codepoint to a character.
 */
public interface SmartDialMap {
    /*
     * Returns true if the provided character can be mapped to a key on the dialpad
     */
    public boolean isValidDialpadCharacter(char ch);

    /*
     * Returns true if the provided character is a letter, and can be mapped to a key on the dialpad
     */
    public boolean isValidDialpadAlphabeticChar(char ch);

    /*
     * Returns true if the provided character is a digit, and can be mapped to a key on the dialpad
     */
    public boolean isValidDialpadNumericChar(char ch);

    /*
     * Get the index of the key on the dialpad which the character corresponds to
     */
    public byte getDialpadIndex(char ch);

    /*
     * Get the actual numeric character on the dialpad which the character corresponds to
     */
    public char getDialpadNumericCharacter(char ch);

    /*
     * Converts uppercase characters to lower case ones, and on a best effort basis, strips accents
     * from accented characters.
     */
    public char normalizeCharacter(char ch);
}