blob: 8773a1532a3d9f709c1e2a44bb36de23b855ff51 (
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
44
45
46
47
48
49
50
51
52
53
54
55
56
|
package com.android.dialer.dialpad;
import java.util.ArrayList;
/**
* 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);
/*
* Allow the SmartDialMaps to convert the characters if needed.
*/
public String transliterateName(String index);
/*
* Allow the SmartDialMaps to provide their own character to dialpad matching if needed.
*/
public boolean matchesCombination(SmartDialNameMatcher smartDialNameMatcher, String displayName, String query,
ArrayList<SmartDialMatchPosition> matchList);
}
|