aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/Constants.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/src/com/android/inputmethod/latin/Constants.java')
-rw-r--r--java/src/com/android/inputmethod/latin/Constants.java67
1 files changed, 41 insertions, 26 deletions
diff --git a/java/src/com/android/inputmethod/latin/Constants.java b/java/src/com/android/inputmethod/latin/Constants.java
index 64c14d32f..c4f96016c 100644
--- a/java/src/com/android/inputmethod/latin/Constants.java
+++ b/java/src/com/android/inputmethod/latin/Constants.java
@@ -76,6 +76,11 @@ public final class Constants {
public static final String ASCII_CAPABLE = "AsciiCapable";
/**
+ * The subtype extra value used to indicate that the subtype keyboard layout is capable
+ * for typing EMOJI characters.
+ */
+ public static final String EMOJI_CAPABLE = "EmojiCapable";
+ /**
* The subtype extra value used to indicate that the subtype require network connection
* to work.
*/
@@ -126,15 +131,6 @@ public final class Constants {
}
}
- public static final class Dictionary {
- // Must be equal to MAX_WORD_LENGTH in native/jni/src/defines.h
- public static final int MAX_WORD_LENGTH = 48;
-
- private Dictionary() {
- // This utility class is no publicly instantiable.
- }
- }
-
public static final int NOT_A_CODE = -1;
public static final int NOT_A_COORDINATE = -1;
@@ -142,6 +138,13 @@ public final class Constants {
public static final int SPELL_CHECKER_COORDINATE = -3;
public static final int EXTERNAL_KEYBOARD_COORDINATE = -4;
+ // A hint on how many characters to cache from the TextView. A good value of this is given by
+ // how many characters we need to be able to almost always find the caps mode.
+ public static final int EDITOR_CONTENTS_CACHE_SIZE = 1024;
+
+ // Must be equal to MAX_WORD_LENGTH in native/jni/src/defines.h
+ public static final int DICTIONARY_MAX_WORD_LENGTH = 48;
+
public static boolean isValidCoordinate(final int coordinate) {
// Detect {@link NOT_A_COORDINATE}, {@link SUGGESTION_STRIP_COORDINATE},
// and {@link SPELL_CHECKER_COORDINATE}.
@@ -149,12 +152,20 @@ public final class Constants {
}
/**
+ * Custom request code used in
+ * {@link com.android.inputmethod.keyboard.KeyboardActionListener#onCustomRequest(int)}.
+ */
+ // The code to show input method picker.
+ public static final int CUSTOM_CODE_SHOW_INPUT_METHOD_PICKER = 1;
+
+ /**
* Some common keys code. Must be positive.
*/
public static final int CODE_ENTER = '\n';
public static final int CODE_TAB = '\t';
public static final int CODE_SPACE = ' ';
public static final int CODE_PERIOD = '.';
+ public static final int CODE_ARMENIAN_PERIOD = 0x0589;
public static final int CODE_DASH = '-';
public static final int CODE_SINGLE_QUOTE = '\'';
public static final int CODE_DOUBLE_QUOTE = '"';
@@ -162,9 +173,7 @@ public final class Constants {
public static final int CODE_EXCLAMATION_MARK = '!';
public static final int CODE_SLASH = '/';
public static final int CODE_COMMERCIAL_AT = '@';
- // TODO: Check how this should work for right-to-left languages. It seems to stand
- // that for rtl languages, a closing parenthesis is a left parenthesis. Is this
- // managed by the font? Or is it a different char?
+ public static final int CODE_PLUS = '+';
public static final int CODE_CLOSING_PARENTHESIS = ')';
public static final int CODE_CLOSING_SQUARE_BRACKET = ']';
public static final int CODE_CLOSING_CURLY_BRACKET = '}';
@@ -172,22 +181,23 @@ public final class Constants {
/**
* Special keys code. Must be negative.
- * These should be aligned with KeyboardCodesSet.ID_TO_NAME[],
- * KeyboardCodesSet.DEFAULT[] and KeyboardCodesSet.RTL[]
+ * These should be aligned with {@link KeyboardCodesSet#ID_TO_NAME},
+ * {@link KeyboardCodesSet#DEFAULT}, and {@link KeyboardCodesSet#RTL}.
*/
public static final int CODE_SHIFT = -1;
- public static final int CODE_SWITCH_ALPHA_SYMBOL = -2;
- public static final int CODE_OUTPUT_TEXT = -3;
- public static final int CODE_DELETE = -4;
- public static final int CODE_SETTINGS = -5;
- public static final int CODE_SHORTCUT = -6;
- public static final int CODE_ACTION_NEXT = -7;
- public static final int CODE_ACTION_PREVIOUS = -8;
- public static final int CODE_LANGUAGE_SWITCH = -9;
- public static final int CODE_RESEARCH = -10;
- public static final int CODE_SHIFT_ENTER = -11;
+ public static final int CODE_CAPSLOCK = -2;
+ public static final int CODE_SWITCH_ALPHA_SYMBOL = -3;
+ public static final int CODE_OUTPUT_TEXT = -4;
+ public static final int CODE_DELETE = -5;
+ public static final int CODE_SETTINGS = -6;
+ public static final int CODE_SHORTCUT = -7;
+ public static final int CODE_ACTION_NEXT = -8;
+ public static final int CODE_ACTION_PREVIOUS = -9;
+ public static final int CODE_LANGUAGE_SWITCH = -10;
+ public static final int CODE_EMOJI = -11;
+ public static final int CODE_SHIFT_ENTER = -12;
// Code value representing the code is not specified.
- public static final int CODE_UNSPECIFIED = -12;
+ public static final int CODE_UNSPECIFIED = -13;
public static boolean isLetterCode(final int code) {
return code >= CODE_SPACE;
@@ -196,6 +206,7 @@ public final class Constants {
public static String printableCode(final int code) {
switch (code) {
case CODE_SHIFT: return "shift";
+ case CODE_CAPSLOCK: return "capslock";
case CODE_SWITCH_ALPHA_SYMBOL: return "symbol";
case CODE_OUTPUT_TEXT: return "text";
case CODE_DELETE: return "delete";
@@ -204,10 +215,11 @@ public final class Constants {
case CODE_ACTION_NEXT: return "actionNext";
case CODE_ACTION_PREVIOUS: return "actionPrevious";
case CODE_LANGUAGE_SWITCH: return "languageSwitch";
+ case CODE_EMOJI: return "emoji";
+ case CODE_SHIFT_ENTER: return "shiftEnter";
case CODE_UNSPECIFIED: return "unspec";
case CODE_TAB: return "tab";
case CODE_ENTER: return "enter";
- case CODE_RESEARCH: return "research";
default:
if (code < CODE_SPACE) return String.format("'\\u%02x'", code);
if (code < 0x100) return String.format("'%c'", code);
@@ -215,7 +227,10 @@ public final class Constants {
}
}
+ public static final int MAX_INT_BIT_COUNT = 32;
+
private Constants() {
// This utility class is not publicly instantiable.
}
+
}