SDL_Android/SmartDeviceLinkAndroidProxy - added the correct version of the proxy
[profile/ivi/smartdevicelink.git] / SDL_Android / SmartDeviceLinkProxyAndroid / src / com / smartdevicelink / proxy / rpc / SetGlobalProperties.java
1 package com.smartdevicelink.proxy.rpc;\r
2 \r
3 import java.util.Hashtable;\r
4 import java.util.Vector;\r
5 \r
6 import com.smartdevicelink.proxy.RPCRequest;\r
7 import com.smartdevicelink.proxy.constants.Names;\r
8 /**\r
9  * Sets value(s) for the specified global property(ies)\r
10  * <p>\r
11  * Function Group: Base <p>\r
12  * <b>HMILevel needs to be FULL, LIMITED or BACKGROUND</b>\r
13  * </p>\r
14  * \r
15  * @since SmartDeviceLink 1.0\r
16  * @see ResetGlobalProperties\r
17  */\r
18 public class SetGlobalProperties extends RPCRequest {\r
19         /**\r
20          * Constructs a new SetGlobalProperties object\r
21          */\r
22     public SetGlobalProperties() {\r
23         super("SetGlobalProperties");\r
24     }\r
25         /**\r
26          * Constructs a new SetGlobalProperties object indicated by the Hashtable\r
27          * parameter\r
28          * <p>\r
29          * \r
30          * @param hash\r
31          *            The Hashtable to use\r
32          */    \r
33     public SetGlobalProperties(Hashtable hash) {\r
34         super(hash);\r
35     }\r
36         /**\r
37          * Gets a Vector<TTSChunk> for Help Prompt representing Array of one or more\r
38          * TTSChunk elements specifying the help prompt used in an interaction\r
39          * started by PTT\r
40          * \r
41          * @return Vector<TTSChunk> -an Array of one or more TTSChunk elements\r
42          *         specifying the help prompt used in an interaction started by PTT\r
43          */    \r
44     public Vector<TTSChunk> getHelpPrompt() {\r
45         if (parameters.get(Names.helpPrompt) instanceof Vector<?>) {\r
46                 Vector<?> list = (Vector<?>)parameters.get(Names.helpPrompt);\r
47                 if (list != null && list.size() > 0) {\r
48                     Object obj = list.get(0);\r
49                     if (obj instanceof TTSChunk) {\r
50                         return (Vector<TTSChunk>) list;\r
51                     } else if (obj instanceof Hashtable) {\r
52                         Vector<TTSChunk> newList = new Vector<TTSChunk>();\r
53                         for (Object hashObj : list) {\r
54                             newList.add(new TTSChunk((Hashtable)hashObj));\r
55                         }\r
56                         return newList;\r
57                     }\r
58                 }\r
59         }\r
60             return null;\r
61     }\r
62         /**\r
63          * Sets a Vector<TTSChunk> for Help Prompt that Array of one or more\r
64          * TTSChunk elements specifying the help prompt used in an interaction\r
65          * started by PTT\r
66          * \r
67          * @param helpPrompt\r
68          *            a Vector<TTSChunk> of one or more TTSChunk elements\r
69          *            <p>\r
70          *            <b>Notes: </b>\r
71          *            <ul>\r
72          *            <li>Array must have at least one element</li>\r
73          *            <li>Only optional it timeoutPrompt has been specified</li>\r
74          *            </ul>\r
75          */    \r
76     public void setHelpPrompt(Vector<TTSChunk> helpPrompt) {\r
77         if (helpPrompt != null) {\r
78             parameters.put(Names.helpPrompt, helpPrompt);\r
79         }\r
80     }\r
81         /**\r
82          * Gets a Vector<TTSChunk> for Timeout Prompt representing Array of one or\r
83          * more TTSChunk elements specifying the help prompt used in an interaction\r
84          * started by PTT\r
85          * \r
86          * @return Vector<TTSChunk> -an Array of one or more TTSChunk elements\r
87          *         specifying the help prompt used in an interaction started by PTT\r
88          */    \r
89     public Vector<TTSChunk> getTimeoutPrompt() {\r
90         if (parameters.get(Names.timeoutPrompt) instanceof Vector<?>) {\r
91                 Vector<?> list = (Vector<?>)parameters.get(Names.timeoutPrompt);\r
92                 if (list != null && list.size() > 0) {\r
93                     Object obj = list.get(0);\r
94                     if (obj instanceof TTSChunk) {\r
95                         return (Vector<TTSChunk>) list;\r
96                     } else if (obj instanceof Hashtable) {\r
97                         Vector<TTSChunk> newList = new Vector<TTSChunk>();\r
98                         for (Object hashObj : list) {\r
99                             newList.add(new TTSChunk((Hashtable)hashObj));\r
100                         }\r
101                         return newList;\r
102                     }\r
103                 }\r
104         }\r
105         return null;\r
106     }\r
107         /**\r
108          * Sets a Vector<TTSChunk> for Timeout Prompt representing Array of one or\r
109          * more TTSChunk elements specifying the help prompt used in an interaction\r
110          * started by PTT\r
111          * \r
112          */    \r
113     public void setTimeoutPrompt(Vector<TTSChunk> timeoutPrompt) {\r
114         if (timeoutPrompt != null) {\r
115             parameters.put(Names.timeoutPrompt, timeoutPrompt);\r
116         }\r
117     }\r
118 \r
119         /**\r
120          * Gets a voice recognition Help Title\r
121          * \r
122          * @return String - a String value representing the text, which is shown as\r
123          *         title of the VR help screen used in an interaction started by PTT\r
124          * @since SmartDeviceLink 2.0\r
125          */\r
126     public String getVrHelpTitle() {\r
127         return (String) parameters.get(Names.vrHelpTitle);\r
128     }\r
129 \r
130         /**\r
131          * Sets a voice recognition Help Title\r
132          * \r
133          * @param vrHelpTitle\r
134          *            a String value representing a voice recognition Help Title\r
135          *            <p>\r
136          *            <b>Notes: </b><br/>\r
137          *            <ul>\r
138          *            <li>If omitted on supported displays, the default SMARTDEVICELINK help\r
139          *            title will be used</li>\r
140          *            <li>If omitted and one or more vrHelp items are provided, the\r
141          *            request will be rejected.</li>\r
142          *            <li>String Maxlength = 500</li>\r
143          *            </ul>\r
144          * @since SmartDeviceLink 2.0\r
145          */\r
146     public void setVrHelpTitle(String vrHelpTitle) {\r
147         if (vrHelpTitle != null) {\r
148             parameters.put(Names.vrHelpTitle, vrHelpTitle);\r
149         } else {\r
150                 parameters.remove(Names.vrHelpTitle);\r
151         }\r
152     }\r
153 \r
154         /**\r
155          * Gets items listed in the VR help screen used in an interaction started by\r
156          * PTT\r
157          * \r
158          * @return Vector<VrHelpItem> - a Vector value representing items listed in\r
159          *         the VR help screen used in an interaction started by PTT\r
160          * @since SmartDeviceLink 2.0\r
161          */\r
162     public Vector<VrHelpItem> getVrHelp() {\r
163         if (parameters.get(Names.vrHelp) instanceof Vector<?>) {\r
164                 Vector<?> list = (Vector<?>)parameters.get(Names.vrHelp);\r
165                 if (list != null && list.size() > 0) {\r
166                     Object obj = list.get(0);\r
167                     if (obj instanceof VrHelpItem) {\r
168                         return (Vector<VrHelpItem>) list;\r
169                     } else if (obj instanceof Hashtable) {\r
170                         Vector<VrHelpItem> newList = new Vector<VrHelpItem>();\r
171                         for (Object hashObj : list) {\r
172                             newList.add(new VrHelpItem((Hashtable)hashObj));\r
173                         }\r
174                         return newList;\r
175                     }\r
176                 }\r
177         }\r
178         return null;\r
179     }\r
180 \r
181         /**\r
182          * Sets the items listed in the VR help screen used in an interaction\r
183          * started by PTT\r
184          * \r
185          * @param vrHelp\r
186          *            a Vector value representing items listed in the VR help screen\r
187          *            used in an interaction started by PTT\r
188          *            <p>\r
189          *            <b>Notes: </b><br/>\r
190          *            <ul>\r
191          *            <li>If omitted on supported displays, the default SmartDeviceLink VR\r
192          *            help / What Can I Say? screen will be used</li>\r
193          *            <li>If the list of VR Help Items contains nonsequential\r
194          *            positions (e.g. [1,2,4]), the RPC will be rejected</li>\r
195          *            <li>If omitted and a vrHelpTitle is provided, the request\r
196          *            will be rejected</li>\r
197          *            <li>Array Minsize: = 1</li>\r
198          *            <li>Array Maxsize = 100</li>\r
199          *            </ul>\r
200          * @since SmartDeviceLink 2.0\r
201          */\r
202     public void setVrHelp(Vector<VrHelpItem> vrHelp) {\r
203         if (vrHelp != null) {\r
204             parameters.put(Names.vrHelp, vrHelp);\r
205         } else {\r
206                 parameters.remove(Names.vrHelp);\r
207         }\r
208     }\r
209 }\r