package com.smartdevicelink.proxy.rpc; import java.util.Hashtable; import com.smartdevicelink.proxy.RPCStruct; import com.smartdevicelink.proxy.rpc.enums.ButtonName; /** * Provides information about the capabilities of a SDL HMI button. *

Parameter List

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
NameTypeDescriptionSmartDeviceLink Ver. Available
nameButtonNameThe name of theSDL HMI button.SmartDeviceLink 1.0
shortPressAvailableBooleanThe button supports a SHORT press. See {@linkplain ButtonPressMode} for more information.SmartDeviceLink 1.0
longPressAvailableBooleanThe button supports a LONG press. See {@linkplain ButtonPressMode} for more information.SmartDeviceLink 1.0
upDownAvailableBooleanThe button supports "button down" and "button up". When the button is depressed, the {@linkplain OnButtonEvent} notification will be invoked with a value of BUTTONDOWN. *

When the button is released, the {@linkplain OnButtonEvent} notification will be invoked with a value of BUTTONUP.

SmartDeviceLink 1.0
* *

Upon the request HMI must provide the list of the following information:

*

The names of all existing/supported hardware buttons.

*

The availability of LONG/SHORT press for each existing/supported hardware button correspondingly

*

The availability of UP/DOWN events for each existing/supported hardware button correspondingly.

* * @since SmartDeviceLink 1.0 * * @see ButtonName * @see ButtonEventMode * @see ButtonPressMode * * * * @see OnButtonEvent * @see OnButtonPress * */ public class ButtonCapabilities extends RPCStruct { public static final String KEY_NAME = "name"; public static final String KEY_SHORT_PRESS_AVAILABLE = "shortPressAvailable"; public static final String KEY_LONG_PRESS_AVAILABLE = "longPressAvailable"; public static final String KEY_UP_DOWN_AVAILABLE = "upDownAvailable"; /** * Constructs a newly allocated ButtonCapabilities object */ public ButtonCapabilities() { } /** * Constructs a newly allocated ButtonCapabilities object indicated by the Hashtable parameter * @param hash The Hashtable to use */ public ButtonCapabilities(Hashtable hash) { super(hash); } /** * Get the name of theSDL HMI button. * @return ButtonName the name of the Button */ public ButtonName getName() { return (ButtonName) getObject(ButtonName.class, KEY_NAME); } /** * Set the name of theSDL HMI button. * @param name the name of button */ public void setName( ButtonName name ) { setValue(KEY_NAME, name); } /** * Whether the button supports a SHORT press. See {@linkplain com.smartdevicelink.proxy.rpc.enums.ButtonPressMode} for more information. * @return True if support otherwise False. */ public Boolean getShortPressAvailable() { return getBoolean( KEY_SHORT_PRESS_AVAILABLE ); } /** * Set the button supports a SHORT press. See {@linkplain com.smartdevicelink.proxy.rpc.enums.ButtonPressMode} for more information. * @param shortPressAvailable True if support otherwise False. */ public void setShortPressAvailable( Boolean shortPressAvailable ) { setValue(KEY_SHORT_PRESS_AVAILABLE, shortPressAvailable); } /** * Whether the button supports a LONG press. See {@linkplain com.smartdevicelink.proxy.rpc.enums.ButtonPressMode} for more information. * @return True if support otherwise False. */ public Boolean getLongPressAvailable() { return getBoolean( KEY_LONG_PRESS_AVAILABLE ); } /** * Set the button supports a LONG press. See {@linkplain com.smartdevicelink.proxy.rpc.enums.ButtonPressMode} for more information. * @param longPressAvailable True if support otherwise False. */ public void setLongPressAvailable( Boolean longPressAvailable ) { setValue(KEY_LONG_PRESS_AVAILABLE, longPressAvailable); } /** * Whether the button supports "button down" and "button up". When the button is depressed, the {@linkplain OnButtonEvent} notification will be invoked with a value of BUTTONDOWN. * @return True if support otherwise False. */ public Boolean getUpDownAvailable() { return getBoolean( KEY_UP_DOWN_AVAILABLE ); } /** * Set the button supports "button down" and "button up". When the button is depressed, the {@linkplain OnButtonEvent} notification will be invoked with a value of BUTTONDOWN. * @param upDownAvailable True if support otherwise False. */ public void setUpDownAvailable( Boolean upDownAvailable ) { setValue(KEY_UP_DOWN_AVAILABLE, upDownAvailable); } }