summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkboskin <kboskin>2021-02-15 21:46:22 +0200
committerkboskin <kboskin>2021-02-15 21:46:22 +0200
commitb8d87df1c8f1cb8c245b2d62d837ad26fd1f9478 (patch)
tree97f3c25f2b4618313ec0659d010aa620a28e5a48
parent40766fd31dc9805c423eb0184eab130e3a521f9c (diff)
downloadsdl_android-b8d87df1c8f1cb8c245b2d62d837ad26fd1f9478.tar.gz
[0238]
- Fix PR formatting comments
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/screen/choiceset/BaseChoiceSetManager.java3
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/screen/choiceset/KeyboardListener.java2
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/screen/choiceset/PresentChoiceSetOperation.java2
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/screen/choiceset/PresentKeyboardOperation.java2
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/KeyboardCapabilities.java10
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/KeyboardProperties.java641
6 files changed, 295 insertions, 365 deletions
diff --git a/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/BaseChoiceSetManager.java b/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/BaseChoiceSetManager.java
index 690ed1222..ae372edcc 100644
--- a/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/BaseChoiceSetManager.java
+++ b/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/BaseChoiceSetManager.java
@@ -66,7 +66,6 @@ import com.smartdevicelink.proxy.rpc.listeners.OnRPCNotificationListener;
import com.smartdevicelink.util.DebugTool;
import java.lang.ref.WeakReference;
-import java.security.Key;
import java.util.HashSet;
import java.util.List;
@@ -113,7 +112,6 @@ abstract class BaseChoiceSetManager extends BaseSubManager {
// capabilities
currentSystemContext = SystemContext.SYSCTXT_MAIN;
currentHMILevel = HMILevel.HMI_NONE;
- // TODO remove, move to addListener
keyboardConfiguration = defaultKeyboardConfiguration();
addListeners();
@@ -465,6 +463,7 @@ abstract class BaseChoiceSetManager extends BaseSubManager {
properties.setKeypressMode((keyboardConfiguration.getKeypressMode() == null ? KeypressMode.RESEND_CURRENT_ENTRY : keyboardConfiguration.getKeypressMode()));
properties.setLimitedCharacterList(keyboardConfiguration.getLimitedCharacterList());
properties.setAutoCompleteText(keyboardConfiguration.getAutoCompleteText());
+ properties.setAutoCompleteList(keyboardConfiguration.getAutoCompleteList());
properties.setMaskInputCharacters(keyboardConfiguration.getMaskInputCharacters());
this.keyboardConfiguration = properties;
}
diff --git a/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/KeyboardListener.java b/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/KeyboardListener.java
index ad53645e0..619f2c2f2 100644
--- a/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/KeyboardListener.java
+++ b/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/KeyboardListener.java
@@ -85,5 +85,5 @@ public interface KeyboardListener {
*/
void onKeyboardDidSendEvent(KeyboardEvent event, String currentInputText);
- void onKeyboardInputMaskHasChanged(KeyboardEvent event);
+ void onKeyboardDidUpdateInputMask(KeyboardEvent event);
} \ No newline at end of file
diff --git a/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/PresentChoiceSetOperation.java b/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/PresentChoiceSetOperation.java
index 7547a956d..b5d3945d1 100644
--- a/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/PresentChoiceSetOperation.java
+++ b/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/PresentChoiceSetOperation.java
@@ -360,7 +360,7 @@ class PresentChoiceSetOperation extends Task {
// Notify of abort / Cancellation
keyboardListener.onKeyboardDidAbortWithReason(onKeyboard.getEvent());
} else if (onKeyboard.getEvent().equals(KeyboardEvent.INPUT_KEY_MASK_ENABLED) || onKeyboard.getEvent().equals(KeyboardEvent.INPUT_KEY_MASK_DISABLED)) {
- keyboardListener.onKeyboardInputMaskHasChanged(onKeyboard.getEvent());
+ keyboardListener.onKeyboardDidUpdateInputMask(onKeyboard.getEvent());
}
}
};
diff --git a/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/PresentKeyboardOperation.java b/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/PresentKeyboardOperation.java
index 954d1eb2a..2b13cf8ac 100644
--- a/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/PresentKeyboardOperation.java
+++ b/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/PresentKeyboardOperation.java
@@ -306,7 +306,7 @@ class PresentKeyboardOperation extends Task {
// Notify of abort / Cancellation
keyboardListener.onKeyboardDidAbortWithReason(onKeyboard.getEvent());
} else if (onKeyboard.getEvent().equals(KeyboardEvent.INPUT_KEY_MASK_ENABLED) || onKeyboard.getEvent().equals(KeyboardEvent.INPUT_KEY_MASK_DISABLED)) {
- keyboardListener.onKeyboardInputMaskHasChanged(onKeyboard.getEvent());
+ keyboardListener.onKeyboardDidUpdateInputMask(onKeyboard.getEvent());
}
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/KeyboardCapabilities.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/KeyboardCapabilities.java
index aefa55ac3..bc2fb4301 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/KeyboardCapabilities.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/KeyboardCapabilities.java
@@ -55,9 +55,7 @@ import java.util.List;
* <td>Availability of capability to mask input characters using keyboard. True: Available,False: Not Available</td>
* <td>N</td>
* <td></td>
- * <td>
- * @since SmartDeviceLink 7.1.0
- * </td>
+ * <td></td>
* </tr>
* <tr>
* <td>supportedKeyboards</td>
@@ -71,9 +69,7 @@ import java.util.List;
* @since SmartDeviceLink 7.1.0
*/
public class KeyboardCapabilities extends RPCStruct {
- /**
- * @since SmartDeviceLink 7.1.0
- */
+
public static final String KEY_MASK_INPUT_CHARACTERS_SUPPORTED = "maskInputCharactersSupported";
public static final String KEY_SUPPORTED_KEYBOARDS = "supportedKeyboards";
@@ -96,7 +92,6 @@ public class KeyboardCapabilities extends RPCStruct {
*
* @param maskInputCharactersSupported Availability of capability to mask input characters using keyboard. True: Available,
* False: Not Available
- * @since SmartDeviceLink 7.1.0
*/
public KeyboardCapabilities setMaskInputCharactersSupported(Boolean maskInputCharactersSupported) {
setValue(KEY_MASK_INPUT_CHARACTERS_SUPPORTED, maskInputCharactersSupported);
@@ -108,7 +103,6 @@ public class KeyboardCapabilities extends RPCStruct {
*
* @return Boolean Availability of capability to mask input characters using keyboard. True: Available,
* False: Not Available
- * @since SmartDeviceLink 7.1.0
*/
public Boolean getMaskInputCharactersSupported() {
return getBoolean(KEY_MASK_INPUT_CHARACTERS_SUPPORTED);
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/KeyboardProperties.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/KeyboardProperties.java
index dad74f0bc..22b59bcf2 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/KeyboardProperties.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/KeyboardProperties.java
@@ -1,352 +1,289 @@
-/*
- * Copyright (c) 2017 - 2021, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium Inc. nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-package com.smartdevicelink.proxy.rpc;
-
-import com.smartdevicelink.proxy.RPCStruct;
-import com.smartdevicelink.proxy.rpc.enums.KeyboardInputMask;
-import com.smartdevicelink.proxy.rpc.enums.KeyboardLayout;
-import com.smartdevicelink.proxy.rpc.enums.KeypressMode;
-import com.smartdevicelink.proxy.rpc.enums.Language;
-
-import java.util.Hashtable;
-import java.util.List;
-
-/**
- * Configuration of on-screen keyboard (if available).
- *
- * <p><b>Parameter List</b></p>
- *
- * <table border="1" rules="all">
- * <tr>
- * <th>Param Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>Required</th>
- * <th>Notes</th>
- * <th>Version Available</th>
- * </tr>
- * <tr>
- * <td>language</td>
- * <td>Language</td>
- * <td>The keyboard language.</td>
- * <td>N</td>
- * <td></td>
- * <td></td>
- * </tr>
- * <tr>
- * <td>keyboardLayout</td>
- * <td>KeyboardLayout</td>
- * <td>Desired keyboard layout.</td>
- * <td>N</td>
- * <td></td>
- * <td></td>
- * </tr>
- * <tr>
- * <td>keypressMode</td>
- * <td>KeypressMode</td>
- * <td>Desired keypress mode. If omitted, this value will be set to RESEND_CURRENT_ENTRY.</td>
- * <td>N</td>
- * <td></td>
- * <td></td>
- * </tr>
- * <tr>
- * <td>limitedCharacterList</td>
- * <td>List<String></td>
- * <td>Array of keyboard characters to enable.All omitted characters will be greyed out(disabled) on the keyboard.If omitted, the entire keyboard will be enabled.</td>
- * <td>N</td>
- * <td>{"string_max_length": 1, "string_min_length": 1, "array_max_size": 100, "array_min_size": 1}</td>
- * <td></td>
- * </tr>
- * <tr>
- * <td>autoCompleteText</td>
- * <td>String</td>
- * <td>Deprecated, use autoCompleteList instead.</td>
- * <td>N</td>
- * <td>{"string_max_length": 1000, "string_min_length": 1}</td>
- * <td>
- * @since SmartDeviceLink 3.0.0
- * @deprecated in SmartDeviceLink 6.0.0
- * </td>
- * </tr>
- * <tr>
- * <td>autoCompleteList</td>
- * <td>List<String></td>
- * <td>Allows an app to pre-populate the text field with a list of suggested or completed entriesas the user types. If empty, the auto-complete list will be removed from the screen.</td>
- * <td>N</td>
- * <td>{"string_max_length": 1000, "string_min_length": 1, "array_max_size": 100, "array_min_size": 0}</td>
- * <td>
- * @since SmartDeviceLink 6.0.0
- * </td>
- * </tr>
- * <tr>
- * <td>maskInputCharacters</td>
- * <td>KeyboardInputMask</td>
- * <td>Allows an app to mask entered characters on HMI</td>
- * <td>N</td>
- * <td></td>
- * <td>
- * @since SmartDeviceLink 7.1.0
- * </td>
- * </tr>
- * <tr>
- * <td>customKeys</td>
- * <td>List<String></td>
- * <td>Array of special characters to show in customizable keys. If omitted, keyboard will showdefault special characters</td>
- * <td>N</td>
- * <td>{"string_max_length": 1, "string_min_length": 1, "array_max_size": 10, "array_min_size": 1}</td>
- * <td>
- * @since SmartDeviceLink 7.1.0
- * </td>
- * </tr>
- * </table>
- *
- * @since SmartDeviceLink 3.0.0
- */
-public class KeyboardProperties extends RPCStruct {
- public static final String KEY_LANGUAGE = "language";
- public static final String KEY_KEYBOARD_LAYOUT = "keyboardLayout";
- public static final String KEY_KEYPRESS_MODE = "keypressMode";
- public static final String KEY_LIMITED_CHARACTER_LIST = "limitedCharacterList";
- /**
- * @since SmartDeviceLink 3.0.0
- * @deprecated in SmartDeviceLink 6.0.0
- */
- @Deprecated
- public static final String KEY_AUTO_COMPLETE_TEXT = "autoCompleteText";
- /**
- * @since SmartDeviceLink 6.0.0
- */
- public static final String KEY_AUTO_COMPLETE_LIST = "autoCompleteList";
- /**
- * @since SmartDeviceLink 7.1.0
- */
- public static final String KEY_MASK_INPUT_CHARACTERS = "maskInputCharacters";
- /**
- * @since SmartDeviceLink 7.1.0
- */
- public static final String KEY_CUSTOM_KEYS = "customKeys";
-
- /**
- * Constructs a new KeyboardProperties object
- */
- public KeyboardProperties() { }
-
- /**
- * Constructs a new KeyboardProperties object indicated by the Hashtable parameter
- *
- * @param hash The Hashtable to use
- */
- public KeyboardProperties(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Sets the language.
- *
- * @param language The keyboard language.
- */
- public KeyboardProperties setLanguage(Language language) {
- setValue(KEY_LANGUAGE, language);
- return this;
- }
-
- /**
- * Gets the language.
- *
- * @return Language The keyboard language.
- */
- public Language getLanguage() {
- return (Language) getObject(Language.class, KEY_LANGUAGE);
- }
-
- /**
- * Sets the keyboardLayout.
- *
- * @param keyboardLayout Desired keyboard layout.
- */
- public KeyboardProperties setKeyboardLayout(KeyboardLayout keyboardLayout) {
- setValue(KEY_KEYBOARD_LAYOUT, keyboardLayout);
- return this;
- }
-
- /**
- * Gets the keyboardLayout.
- *
- * @return KeyboardLayout Desired keyboard layout.
- */
- public KeyboardLayout getKeyboardLayout() {
- return (KeyboardLayout) getObject(KeyboardLayout.class, KEY_KEYBOARD_LAYOUT);
- }
-
- /**
- * Sets the keypressMode.
- *
- * @param keypressMode Desired keypress mode. If omitted, this value will be set to RESEND_CURRENT_ENTRY.
- */
- public KeyboardProperties setKeypressMode(KeypressMode keypressMode) {
- setValue(KEY_KEYPRESS_MODE, keypressMode);
- return this;
- }
-
- /**
- * Gets the keypressMode.
- *
- * @return KeypressMode Desired keypress mode. If omitted, this value will be set to RESEND_CURRENT_ENTRY.
- */
- public KeypressMode getKeypressMode() {
- return (KeypressMode) getObject(KeypressMode.class, KEY_KEYPRESS_MODE);
- }
-
- /**
- * Sets the limitedCharacterList.
- *
- * @param limitedCharacterList Array of keyboard characters to enable.All omitted characters will be greyed out
- * (disabled) on the keyboard.If omitted, the entire keyboard will be enabled.
- * {"string_max_length": 1, "string_min_length": 1, "array_max_size": 100, "array_min_size": 1}
- */
- public KeyboardProperties setLimitedCharacterList(List<String> limitedCharacterList) {
- setValue(KEY_LIMITED_CHARACTER_LIST, limitedCharacterList);
- return this;
- }
-
- /**
- * Gets the limitedCharacterList.
- *
- * @return List<String> Array of keyboard characters to enable.All omitted characters will be greyed out
- * (disabled) on the keyboard.If omitted, the entire keyboard will be enabled.
- * {"string_max_length": 1, "string_min_length": 1, "array_max_size": 100, "array_min_size": 1}
- */
- @SuppressWarnings("unchecked")
- public List<String> getLimitedCharacterList() {
- return (List<String>) getObject(String.class, KEY_LIMITED_CHARACTER_LIST);
- }
-
- /**
- * Sets the autoCompleteText.
- *
- * @param autoCompleteText Deprecated, use autoCompleteList instead.
- * {"string_max_length": 1000, "string_min_length": 1}
- * @since SmartDeviceLink 3.0.0
- * @deprecated in SmartDeviceLink 6.0.0
- */
- @Deprecated
- public KeyboardProperties setAutoCompleteText(String autoCompleteText) {
- setValue(KEY_AUTO_COMPLETE_TEXT, autoCompleteText);
- return this;
- }
-
- /**
- * Gets the autoCompleteText.
- *
- * @return String Deprecated, use autoCompleteList instead.
- * {"string_max_length": 1000, "string_min_length": 1}
- * @since SmartDeviceLink 3.0.0
- * @deprecated in SmartDeviceLink 6.0.0
- */
- @Deprecated
- public String getAutoCompleteText() {
- return getString(KEY_AUTO_COMPLETE_TEXT);
- }
-
- /**
- * Sets the autoCompleteList.
- *
- * @param autoCompleteList Allows an app to pre-populate the text field with a list of suggested or completed entries
- * as the user types. If empty, the auto-complete list will be removed from the screen.
- * {"string_max_length": 1000, "string_min_length": 1, "array_max_size": 100, "array_min_size": 0}
- * @since SmartDeviceLink 6.0.0
- */
- public KeyboardProperties setAutoCompleteList(List<String> autoCompleteList) {
- setValue(KEY_AUTO_COMPLETE_LIST, autoCompleteList);
- return this;
- }
-
- /**
- * Gets the autoCompleteList.
- *
- * @return List<String> Allows an app to pre-populate the text field with a list of suggested or completed entries
- * as the user types. If empty, the auto-complete list will be removed from the screen.
- * {"string_max_length": 1000, "string_min_length": 1, "array_max_size": 100, "array_min_size": 0}
- * @since SmartDeviceLink 6.0.0
- */
- @SuppressWarnings("unchecked")
- public List<String> getAutoCompleteList() {
- return (List<String>) getObject(String.class, KEY_AUTO_COMPLETE_LIST);
- }
-
- /**
- * Sets the maskInputCharacters.
- *
- * @param maskInputCharacters Allows an app to mask entered characters on HMI
- * @since SmartDeviceLink 7.1.0
- */
- public KeyboardProperties setMaskInputCharacters(KeyboardInputMask maskInputCharacters) {
- setValue(KEY_MASK_INPUT_CHARACTERS, maskInputCharacters);
- return this;
- }
-
- /**
- * Gets the maskInputCharacters.
- *
- * @return KeyboardInputMask Allows an app to mask entered characters on HMI
- * @since SmartDeviceLink 7.1.0
- */
- public KeyboardInputMask getMaskInputCharacters() {
- return (KeyboardInputMask) getObject(KeyboardInputMask.class, KEY_MASK_INPUT_CHARACTERS);
- }
-
- /**
- * Sets the customKeys.
- *
- * @param customKeys Array of special characters to show in customizable keys. If omitted, keyboard will show
- * default special characters
- * {"string_max_length": 1, "string_min_length": 1, "array_max_size": 10, "array_min_size": 1}
- * @since SmartDeviceLink 7.1.0
- */
- public KeyboardProperties setCustomKeys(List<String> customKeys) {
- setValue(KEY_CUSTOM_KEYS, customKeys);
- return this;
- }
-
- /**
- * Gets the customKeys.
- *
- * @return List<String> Array of special characters to show in customizable keys. If omitted, keyboard will show
- * default special characters
- * {"string_max_length": 1, "string_min_length": 1, "array_max_size": 10, "array_min_size": 1}
- * @since SmartDeviceLink 7.1.0
- */
- @SuppressWarnings("unchecked")
- public List<String> getCustomKeys() {
- return (List<String>) getObject(String.class, KEY_CUSTOM_KEYS);
- }
-}
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.proxy.rpc.enums.KeyboardInputMask;
+import com.smartdevicelink.proxy.rpc.enums.KeyboardLayout;
+import com.smartdevicelink.proxy.rpc.enums.KeypressMode;
+import com.smartdevicelink.proxy.rpc.enums.Language;
+
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * This mode causes the interaction to immediately display a keyboard entry through the HMI.
+ *
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Mandatory</th>
+ * <th> Additional</th>
+ * <th>Description</th>
+ * </tr>
+ * <tr>
+ * <td>language</td>
+ * <td>Language</td>
+ * <td>false</td>
+ * <td></td>
+ * <td>The keyboard language. </td>
+ * </tr>
+ * <tr>
+ * <td>keyboardLayout</td>
+ * <td>KeyboardLayout</td>
+ * <td>false</td>
+ * <td></td>
+ * <td>Desired keyboard layout.</td>
+ * </tr>
+ * <tr>
+ * <td>sendDynamicEntry</td>
+ * <td>Boolean</td>
+ * <td>false</td>
+ * <td></td>
+ * <td>In this mode, all key presses will be sent as they occur. If disabled, entire string of text will be returned only once submitted by user.If omitted, this value will be set to FALSE.</td>
+ * </tr>
+ * <tr>
+ * <td>keypressMode</td>
+ * <td>KeypressMode</td>
+ * <td>False</td>
+ * <td></td>
+ * <td>Desired keypress mode.If omitted, this value will be set to RESEND_CURRENT_ENTRY. </td>
+ * </tr>
+ * <tr>
+ * <td>limitedCharacterList</td>
+ * <td>String</td>
+ * <td>false</td>
+ * <td>Array = true maxLength = 1 minsize = 1 maxsize = 100</td>
+ * <td>Array of keyboard characters to enable. All omitted characters will be greyed out (disabled) on the keyboard. If omitted, the entire keyboard will be enabled.</td>
+ * </tr>
+ *
+ * <tr>
+ * <td>autoCompleteText</td>
+ * <td>String</td>
+ * <td>false</td>
+ * <td>maxlength = 1000 </td>
+ * <td>Allows an app to prepopulate the text field with a suggested or completed entry as the user types.</td>
+ * </tr>
+ * <tr>
+ * <td>autoCompleteList</td>
+ * <td>String</td>
+ * <td>false</td>
+ * <td>Array = true maxlength = 1000 minsize = 0 maxsize = 100</td>
+ * <td>Allows an app to prepopulate the text field with a list of suggested or completed entry as the user types. Set to an empty array to remove the auto-complete list from the screen</td>
+ * </tr>
+ * <tr>
+ * <td>maskInputCharacters</td>
+ * <td>KeyboardInputMask</td>
+ * <td>Allows an app to mask entered characters on HMI</td>
+ * <td>N</td>
+ * <td></td>
+ * <td>
+ * @since SmartDeviceLink 7.1.0
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>customKeys</td>
+ * <td>List<String></td>
+ * <td>Array of special characters to show in customizable keys. If omitted, keyboard will showdefault special characters</td>
+ * <td>N</td>
+ * <td>{"string_max_length": 1, "string_min_length": 1, "array_max_size": 10, "array_min_size": 1}</td>
+ * <td>
+ * @since SmartDeviceLink 7.1.0
+ * </td>
+ * </tr>
+ * </table>
+ *
+ * @since SmartDeviceLink 3.0
+ */
+
+public class KeyboardProperties extends RPCStruct {
+ public static final String KEY_KEYPRESS_MODE = "keypressMode";
+ public static final String KEY_KEYBOARD_LAYOUT = "keyboardLayout";
+ public static final String KEY_LIMITED_CHARACTER_LIST = "limitedCharacterList";
+ @Deprecated
+ public static final String KEY_AUTO_COMPLETE_TEXT = "autoCompleteText";
+ public static final String KEY_AUTO_COMPLETE_LIST = "autoCompleteList";
+ public static final String KEY_MASK_INPUT_CHARACTERS = "maskInputCharacters";
+ public static final String KEY_CUSTOM_KEYS = "customKeys";
+ public static final String KEY_LANGUAGE = "language";
+
+ private static final KeypressMode KEYPRESS_MODE_DEFAULT = KeypressMode.RESEND_CURRENT_ENTRY;
+
+ public KeyboardProperties() {
+ setValue(KEY_KEYPRESS_MODE, KEYPRESS_MODE_DEFAULT);
+ }
+
+ public KeyboardProperties(Hashtable<String, Object> hash) {
+ super(hash);
+ if (!store.containsKey(KEY_KEYPRESS_MODE)) {
+ setValue(KEY_KEYPRESS_MODE, KEYPRESS_MODE_DEFAULT);
+ }
+ }
+
+ public Language getLanguage() {
+ return (Language) getObject(Language.class, KEY_LANGUAGE);
+ }
+
+ public KeyboardProperties setLanguage(Language language) {
+ setValue(KEY_LANGUAGE, language);
+ return this;
+ }
+
+ public KeyboardLayout getKeyboardLayout() {
+ return (KeyboardLayout) getObject(KeyboardLayout.class, KEY_KEYBOARD_LAYOUT);
+ }
+
+ public KeyboardProperties setKeyboardLayout(KeyboardLayout keyboardLayout) {
+ setValue(KEY_KEYBOARD_LAYOUT, keyboardLayout);
+ return this;
+ }
+
+ public KeypressMode getKeypressMode() {
+ KeypressMode kp = (KeypressMode) getObject(KeypressMode.class, KEY_KEYPRESS_MODE);
+ if (kp == null) {
+ kp = KEYPRESS_MODE_DEFAULT;
+ }
+ return kp;
+ }
+
+ public KeyboardProperties setKeypressMode(KeypressMode keypressMode) {
+ if (keypressMode != null) {
+ setValue(KEY_KEYPRESS_MODE, keypressMode);
+ } else {
+ setValue(KEY_KEYPRESS_MODE, KEYPRESS_MODE_DEFAULT);
+ }
+ return this;
+ }
+
+ @SuppressWarnings("unchecked")
+ public List<String> getLimitedCharacterList() {
+ return (List<String>) getObject(String.class, KEY_LIMITED_CHARACTER_LIST);
+ }
+
+ public KeyboardProperties setLimitedCharacterList(List<String> limitedCharacterList) {
+ setValue(KEY_LIMITED_CHARACTER_LIST, limitedCharacterList);
+ return this;
+ }
+
+ /**
+ * Gets the text that allows an app to prepopulate the text field with a suggested entry as the user types
+ *
+ * @return String representing the suggestions text
+ */
+ @Deprecated
+ public String getAutoCompleteText() {
+ return (String) getObject(String.class, KEY_AUTO_COMPLETE_TEXT);
+ }
+
+ /**
+ * Sets the text that allows an app to prepopulate the text field with a suggested entry as the user types
+ *
+ * @param autoCompleteText String representing the suggestions text
+ * @deprecated use {@link #setAutoCompleteList(List <String>)} instead
+ */
+ @Deprecated
+ public KeyboardProperties setAutoCompleteText(String autoCompleteText) {
+ setValue(KEY_AUTO_COMPLETE_TEXT, autoCompleteText);
+ return this;
+ }
+
+ /**
+ * Gets the list that allows an app to prepopulate the text field with a list of suggested or
+ * completed entries as the user types.
+ *
+ * @return List<String> representing the suggestions list
+ */
+ @SuppressWarnings("unchecked")
+ public List<String> getAutoCompleteList() {
+ return (List<String>) getObject(String.class, KEY_AUTO_COMPLETE_LIST);
+ }
+
+ /**
+ * Sets the lists that allows an app to prepopulate the text field with a list of suggested or
+ * completed entries as the user types. Set to an empty array to remove the auto-complete list from the screen
+ *
+ * @param autoCompleteList List<String> representing the suggestions list
+ */
+ public KeyboardProperties setAutoCompleteList(List<String> autoCompleteList) {
+ setValue(KEY_AUTO_COMPLETE_LIST, autoCompleteList);
+ return this;
+ }
+
+ /**
+ * Sets the maskInputCharacters.
+ *
+ * @param maskInputCharacters Allows an app to mask entered characters on HMI
+ * @since SmartDeviceLink 7.1.0
+ */
+ public KeyboardProperties setMaskInputCharacters(KeyboardInputMask maskInputCharacters) {
+ setValue(KEY_MASK_INPUT_CHARACTERS, maskInputCharacters);
+ return this;
+ }
+
+ /**
+ * Gets the maskInputCharacters.
+ *
+ * @return KeyboardInputMask Allows an app to mask entered characters on HMI
+ * @since SmartDeviceLink 7.1.0
+ */
+ public KeyboardInputMask getMaskInputCharacters() {
+ return (KeyboardInputMask) getObject(KeyboardInputMask.class, KEY_MASK_INPUT_CHARACTERS);
+ }
+
+ /**
+ * Sets the customKeys.
+ *
+ * @param customKeys Array of special characters to show in customizable keys. If omitted, keyboard will show
+ * default special characters
+ * {"string_max_length": 1, "string_min_length": 1, "array_max_size": 10, "array_min_size": 1}
+ * @since SmartDeviceLink 7.1.0
+ */
+ public KeyboardProperties setCustomKeys(List<String> customKeys) {
+ setValue(KEY_CUSTOM_KEYS, customKeys);
+ return this;
+ }
+
+ /**
+ * Gets the customKeys.
+ *
+ * @return List<String> Array of special characters to show in customizable keys. If omitted, keyboard will show
+ * default special characters
+ * {"string_max_length": 1, "string_min_length": 1, "array_max_size": 10, "array_min_size": 1}
+ * @since SmartDeviceLink 7.1.0
+ */
+ @SuppressWarnings("unchecked")
+ public List<String> getCustomKeys() {
+ return (List<String>) getObject(String.class, KEY_CUSTOM_KEYS);
+ }
+}