1 package com.smartdevicelink.proxy.rpc.enums;
\r
5 * Defines logical buttons which, on a given SMARTDEVICELINK unit, would correspond to
\r
6 * either physical or soft (touchscreen) buttons. These logical buttons present
\r
7 * a standard functional abstraction which the developer can rely upon,
\r
8 * independent of the SMARTDEVICELINK unit. For example, the developer can rely upon the OK
\r
9 * button having the same meaning to the user across SMARTDEVICELINK platforms.
\r
12 * The preset buttons (0-9) can typically be interpreted by the application as
\r
13 * corresponding to some user-configured choices, though the application is free
\r
14 * to interpret these button presses as it sees fit.
\r
17 * The application can discover which buttons a given SMARTDEVICELINK unit implements by
\r
18 * interrogating the ButtonCapabilities parameter of the
\r
19 * RegisterAppInterface response.
\r
22 * @since SmartDeviceLink 1.0
\r
24 public enum ButtonName{
\r
26 * Represents the button usually labeled "OK". A typical use of this button
\r
27 * is for the user to press it to make a selection.
\r
29 * @since SmartDeviceLink 1.0
\r
33 * Represents the seek-left button. A typical use of this button is for the
\r
34 * user to scroll to the left through menu choices one menu item per press.
\r
36 * @since SmartDeviceLink 1.0
\r
40 * Represents the seek-right button. A typical use of this button is for the
\r
41 * user to scroll to the right through menu choices one menu item per press.
\r
43 * @since SmartDeviceLink 1.0
\r
47 * Represents a turn of the tuner knob in the clockwise direction one tick.
\r
49 * @since SmartDeviceLink 1.0
\r
53 * Represents a turn of the tuner knob in the counter-clockwise direction
\r
56 * @since SmartDeviceLink 1.0
\r
60 * Represents the preset 0 button.
\r
62 * @since SmartDeviceLink 1.0
\r
66 * Represents the preset 1 button.
\r
68 * @since SmartDeviceLink 1.0
\r
72 * Represents the preset 2 button.
\r
74 * @since SmartDeviceLink 1.0
\r
78 * Represents the preset 3 button.
\r
80 * @since SmartDeviceLink 1.0
\r
84 * Represents the preset 4 button.
\r
86 * @since SmartDeviceLink 1.0
\r
90 * Represents the preset 5 button.
\r
92 * @since SmartDeviceLink 1.0
\r
96 * Represents the preset 6 button.
\r
98 * @since SmartDeviceLink 1.0
\r
102 * Represents the preset 7 button.
\r
104 * @since SmartDeviceLink 1.0
\r
108 * Represents the preset 8 button.
\r
110 * @since SmartDeviceLink 1.0
\r
114 * Represents the preset 9 button.
\r
116 * @since SmartDeviceLink 1.0
\r
118 PRESET_9, CUSTOM_BUTTON;
\r
120 public static ButtonName valueForString(String value) {
\r
121 return valueOf(value);
\r
125 * indexForPresetButton returns the integer index for preset buttons
\r
126 * which match the preset order. E.G.: indexForPresetButton(PRESET_1)
\r
127 * returns the value 1. If the buttonName given is not a preset button,
\r
128 * the method will return null.
\r
130 * @param buttonName
\r
133 public static Integer indexForPresetButton(ButtonName buttonName) {
\r
135 Integer returnIndex = null;
\r
137 switch(buttonName) {
\r
170 return returnIndex;
\r