All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.smartdevicelink.proxy.rpc.KeyboardProperties Maven / Gradle / Ivy

Go to download

The app library component of SDL is meant to run on the end user’s smart-device from within SDL enabled apps, as an embedded app, or connected to the cloud. App libraries allow the apps to connect to SDL enabled head-units and hardware through bluetooth, USB, and TCP for Android, and cloud and embedded apps can connect through web sockets, Java Beans, and other custom transports. Once the library establishes a connection between the smart device and head-unit through the preferred method of transport, the two components are able to communicate using the SDL defined protocol. The app integrating this library project is then able to expose its functionality to the head-unit through text, media, and other interactive elements.

There is a newer version: 5.7.0
Show newest version
/*
 * 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.
 *
 * 

Parameter List

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
NameTypeMandatory AdditionalDescription
languageLanguagefalseThe keyboard language.
keyboardLayoutKeyboardLayoutfalseDesired keyboard layout.
sendDynamicEntryBooleanfalseIn 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.
keypressModeKeypressModeFalseDesired keypress mode.If omitted, this value will be set to RESEND_CURRENT_ENTRY.
limitedCharacterListStringfalseArray = true maxLength = 1 minsize = 1 maxsize = 100Array of keyboard characters to enable. All omitted characters will be greyed out (disabled) on the keyboard. If omitted, the entire keyboard will be enabled.
autoCompleteTextStringfalsemaxlength = 1000 Allows an app to prepopulate the text field with a suggested or completed entry as the user types.
autoCompleteListStringfalseArray = true maxlength = 1000 minsize = 0 maxsize = 100Allows 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
maskInputCharactersKeyboardInputMaskfalse * SmartDeviceLink 7.1.0 * Allows an app to mask entered characters on HMI
customKeysListfalse * SmartDeviceLink 7.1.0 * * 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 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 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 getLimitedCharacterList() { return (List) getObject(String.class, KEY_LIMITED_CHARACTER_LIST); } public KeyboardProperties setLimitedCharacterList(List 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 )} 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 representing the suggestions list */ @SuppressWarnings("unchecked") public List getAutoCompleteList() { return (List) 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 representing the suggestions list */ public KeyboardProperties setAutoCompleteList(List autoCompleteList) { setValue(KEY_AUTO_COMPLETE_LIST, autoCompleteList); return this; } /** * Sets the maskInputCharacters. * * @param maskInputCharacters Allows an app to mask entered characters on HMI * 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} * SmartDeviceLink 7.1.0 */ public KeyboardProperties setCustomKeys(List customKeys) { setValue(KEY_CUSTOM_KEYS, customKeys); return this; } /** * Gets the customKeys. * * @return List 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} * SmartDeviceLink 7.1.0 */ @SuppressWarnings("unchecked") public List getCustomKeys() { return (List) getObject(String.class, KEY_CUSTOM_KEYS); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy