SDL_Android/SmartDeviceLinkAndroidProxy - added the correct version of the proxy
[profile/ivi/smartdevicelink.git] / SDL_Android / SmartDeviceLinkProxyAndroid / src / com / smartdevicelink / proxy / rpc / ShowConstantTBT.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 /**\r
10  * This RPC is used to update the user with navigation information for the\r
11  * constantly shown screen (base screen), but also for the alert type screen\r
12  * <p>\r
13  * Function Group: Navigation\r
14  * <p>\r
15  * <b>HMILevel needs to be FULL, LIMITED or BACKGROUND</b>\r
16  * <p>\r
17  * \r
18  * @since SmartDeviceLink 2.0\r
19  * @see AlertManeuver\r
20  * @see UpdateTurnList\r
21  */\r
22 public class ShowConstantTBT extends RPCRequest {\r
23 \r
24         /**\r
25          * Constructs a new ShowConstantTBT object\r
26          */\r
27     public ShowConstantTBT() {\r
28         super("ShowConstantTBT");\r
29     }\r
30 \r
31         /**\r
32          * Constructs a new ShowConstantTBT object indicated by the Hashtable\r
33          * parameter\r
34          * <p>\r
35          * \r
36          * @param hash\r
37          *            The Hashtable to use\r
38          */\r
39     public ShowConstantTBT(Hashtable hash) {\r
40         super(hash);\r
41     }\r
42 \r
43         /**\r
44          * Sets a text for navigation text field 1\r
45          * \r
46          * @param navigationText1\r
47          *            a String value representing a text for navigation text field 1\r
48          *            <p>\r
49          *            <b>Notes: </b>Maxlength=500\r
50          */\r
51     public void setNavigationText1(String navigationText1) {\r
52         if (navigationText1 != null) {\r
53             parameters.put(Names.navigationText1, navigationText1);\r
54         } else {\r
55                 parameters.remove(Names.navigationText1);\r
56         }\r
57     }\r
58 \r
59         /**\r
60          * Gets a text for navigation text field 1\r
61          * \r
62          * @return String -a String value representing a text for navigation text\r
63          *         field 1\r
64          */\r
65     public String getNavigationText1() {\r
66         return (String) parameters.get(Names.navigationText1);\r
67     }\r
68 \r
69         /**\r
70          * Sets a text for navigation text field 2\r
71          * \r
72          * @param navigationText2\r
73          *            a String value representing a text for navigation text field 2\r
74          *            <p>\r
75          *            <b>Notes: </b>Maxlength=500\r
76          */\r
77     public void setNavigationText2(String navigationText2) {\r
78         if (navigationText2 != null) {\r
79             parameters.put(Names.navigationText2, navigationText2);\r
80         } else {\r
81                 parameters.remove(Names.navigationText2);\r
82         }\r
83     }\r
84 \r
85         /**\r
86          * Gets a text for navigation text field 2\r
87          * \r
88          * @return String -a String value representing a text for navigation text\r
89          *         field 2\r
90          */\r
91     public String getNavigationText2() {\r
92         return (String) parameters.get(Names.navigationText2);\r
93     }\r
94 \r
95         /**\r
96          * Sets a text field for estimated time of arrival\r
97          * \r
98          * @param eta\r
99          *            a String value representing a text field for estimated time of\r
100          *            arrival\r
101          *            <p>\r
102          *            <b>Notes: </b>Maxlength=500\r
103          */\r
104     public void setEta(String eta) {\r
105         if (eta != null) {\r
106             parameters.put(Names.eta, eta);\r
107         } else {\r
108                 parameters.remove(Names.eta);\r
109         }\r
110     }\r
111 \r
112         /**\r
113          * Gets a text field for estimated time of arrival\r
114          * \r
115          * @return String -a String value representing a text field for estimated\r
116          *         time of arrival\r
117          */\r
118     public String getEta() {\r
119         return (String) parameters.get(Names.eta);\r
120     }\r
121 \r
122         /**\r
123          * Sets a text field for total distance\r
124          * \r
125          * @param totalDistance\r
126          *            a String value representing a text field for total distance\r
127          *            <p>\r
128          *            <b>Notes: </b>Maxlength=500\r
129          */\r
130     public void setTotalDistance(String totalDistance) {\r
131         if (totalDistance != null) {\r
132             parameters.put(Names.totalDistance, totalDistance);\r
133         } else {\r
134                 parameters.remove(Names.totalDistance);\r
135         }\r
136     }\r
137 \r
138         /**\r
139          * Gets a text field for total distance\r
140          * \r
141          * @return String -a String value representing a text field for total\r
142          *         distance\r
143          */\r
144     public String getTotalDistance() {\r
145         return (String) parameters.get(Names.totalDistance);\r
146     }\r
147 \r
148         /**\r
149          * Sets an Image for turnicon\r
150          * \r
151          * @param turnIcon\r
152          *            an Image value\r
153          */\r
154     public void setTurnIcon(Image turnIcon) {\r
155         if (turnIcon != null) {\r
156             parameters.put(Names.turnIcon, turnIcon);\r
157         } else {\r
158                 parameters.remove(Names.turnIcon);\r
159         }\r
160     }\r
161 \r
162         /**\r
163          * Gets an Image for turnicon\r
164          * \r
165          * @return Image -an Image value representing an Image for turnicon\r
166          */\r
167     public Image getTurnIcon() {\r
168         Object obj = parameters.get(Names.turnIcon);\r
169         if (obj instanceof Image) {\r
170             return (Image) obj;\r
171         } else {\r
172                 return new Image((Hashtable) obj);\r
173         }\r
174     }\r
175 \r
176         /**\r
177          * Sets a Fraction of distance till next maneuver\r
178          * \r
179          * @param distanceToManeuver\r
180          *            a Double value representing a Fraction of distance till next\r
181          *            maneuver\r
182          *            <p>\r
183          *            <b>Notes: </b>Minvalue=0; Maxvalue=1000000000\r
184          */\r
185     public void setDistanceToManeuver(Double distanceToManeuver) {\r
186         if (distanceToManeuver != null) {\r
187             parameters.put(Names.distanceToManeuver, distanceToManeuver);\r
188         } else {\r
189                 parameters.remove(Names.distanceToManeuver);\r
190         }\r
191     }\r
192 \r
193         /**\r
194          * Gets a Fraction of distance till next maneuver\r
195          * \r
196          * @return Double -a Double value representing a Fraction of distance till\r
197          *         next maneuver\r
198          */\r
199     public Double getDistanceToManeuver() {\r
200         return (Double) parameters.get(Names.distanceToManeuver);\r
201     }\r
202 \r
203         /**\r
204          * Sets a Distance till next maneuver (starting from) from previous maneuver\r
205          * \r
206          * @param distanceToManeuverScale\r
207          *            a Double value representing a Distance till next maneuver\r
208          *            (starting from) from previous maneuver\r
209          *            <p>\r
210          *            <b>Notes: </b>Minvalue=0; Maxvalue=1000000000\r
211          */\r
212     public void setDistanceToManeuverScale(Double distanceToManeuverScale) {\r
213         if (distanceToManeuverScale != null) {\r
214             parameters.put(Names.distanceToManeuverScale, distanceToManeuverScale);\r
215         } else {\r
216                 parameters.remove(Names.distanceToManeuverScale);\r
217         }\r
218     }\r
219 \r
220         /**\r
221          * Gets a Distance till next maneuver (starting from) from previous maneuver\r
222          * \r
223          * @return Double -a Double value representing a Distance till next maneuver\r
224          *         (starting from) from previous maneuver\r
225          */\r
226     public Double getDistanceToManeuverScale() {\r
227         return (Double) parameters.get(Names.distanceToManeuverScale);\r
228     }\r
229 \r
230         /**\r
231          * Sets a maneuver complete flag. If and when a maneuver has completed while\r
232          * an AlertManeuver is active, the app must send this value set to TRUE in\r
233          * order to clear the AlertManeuver overlay<br/>\r
234          * If omitted the value will be assumed as FALSE\r
235          * <p>\r
236          * \r
237          * @param maneuverComplete\r
238          *            a Boolean value\r
239          */\r
240     public void setManeuverComplete(Boolean maneuverComplete) {\r
241         if (maneuverComplete != null) {\r
242             parameters.put(Names.maneuverComplete, maneuverComplete);\r
243         } else {\r
244                 parameters.remove(Names.maneuverComplete);\r
245         }\r
246     }\r
247 \r
248         /**\r
249          * Gets a maneuver complete flag\r
250          * \r
251          * @return Boolean -a Boolean value\r
252          */\r
253     public Boolean getManeuverComplete() {\r
254         return (Boolean) parameters.get(Names.maneuverComplete);\r
255     }\r
256 \r
257         /**\r
258          * Sets Three dynamic SoftButtons available (first SoftButton is fixed to\r
259          * "Turns"). If omitted on supported displays, the currently displayed\r
260          * SoftButton values will not change\r
261          * <p>\r
262          * <b>Notes: </b>Minsize=0; Maxsize=3\r
263          * \r
264          * @param softButtons a Vector<SoftButton> value\r
265          */\r
266     public void setSoftButtons(Vector<SoftButton> softButtons) {\r
267         if (softButtons != null) {\r
268             parameters.put(Names.softButtons, softButtons);\r
269         } else {\r
270                 parameters.remove(Names.softButtons);\r
271         }\r
272     }\r
273 \r
274         /**\r
275          * Gets Three dynamic SoftButtons available (first SoftButton is fixed to\r
276          * "Turns"). If omitted on supported displays, the currently displayed\r
277          * SoftButton values will not change\r
278          * @return Vector<SoftButton> -a Vector<SoftButton> value\r
279          */\r
280     public Vector<SoftButton> getSoftButtons() {\r
281         if (parameters.get(Names.softButtons) instanceof Vector<?>) {\r
282                 Vector<?> list = (Vector<?>)parameters.get(Names.softButtons);\r
283                 if (list != null && list.size() > 0) {\r
284                     Object obj = list.get(0);\r
285                     if (obj instanceof SoftButton) {\r
286                         return (Vector<SoftButton>) list;\r
287                     } else if (obj instanceof Hashtable) {\r
288                         Vector<SoftButton> newList = new Vector<SoftButton>();\r
289                         for (Object hashObj : list) {\r
290                             newList.add(new SoftButton((Hashtable)hashObj));\r
291                         }\r
292                         return newList;\r
293                     }\r
294                 }\r
295         }\r
296         return null;\r
297     }\r
298 }\r