SDL_Android/SmartDeviceLinkAndroidProxy - added the correct version of the proxy
[profile/ivi/smartdevicelink.git] / SDL_Android / SmartDeviceLinkProxyAndroid / src / com / smartdevicelink / proxy / rpc / MenuParams.java
1 package com.smartdevicelink.proxy.rpc;\r
2 \r
3 import java.util.Hashtable;\r
4 \r
5 import com.smartdevicelink.proxy.RPCStruct;\r
6 import com.smartdevicelink.proxy.constants.Names;\r
7 /**\r
8  * Used when adding a sub menu to an application menu or existing sub menu.\r
9  * <p><b> Parameter List\r
10  * <table border="1" rules="all">\r
11  *              <tr>\r
12  *                      <th>Name</th>\r
13  *                      <th>Type</th>\r
14  *                      <th>Description</th>\r
15  *                      <th>SmartDeviceLink Ver. Available</th>\r
16  *              </tr>\r
17  *              <tr>\r
18  *                      <td>parentID</td>\r
19  *                      <td>Int32</td>\r
20  *                      <td>The unique ID of an existing submenu to which a command will be added.\r
21  *                                      If this element is not provided, the command will be added to the top level of the Command Menu.\r
22  *                                      <ul>\r
23  *                                      <li>Min: 0</li>\r
24  *                                      <li>Max: 2000000000</li>\r
25  *                                      </ul>\r
26  *                      </td>\r
27  *                      <td>SmartDeviceLink 1.0</td>\r
28  *              </tr>\r
29   *             <tr>\r
30  *                      <td>position</td>\r
31  *                      <td>Int16</td>\r
32  *                      <td>Position within the items of the parent Command Menu. 0 will insert at the front, 1 will insert after the first existing element, etc. \r
33  *                                      Position of any submenu will always be located before the return and exit options.\r
34  *                                      <ul>\r
35  *                                              <li>Min Value: 0</li>\r
36  *                                              <li>Max Value: 1000</li>\r
37  *                                              <li>If position is greater or equal than the number of items in the parent Command Menu, the sub menu will be appended to the end of that Command Menu.</li>\r
38  *                                              <li>If this element is omitted, the entry will be added at the end of the parent menu.</li>\r
39  *                                      </ul>\r
40  *                      </td>\r
41  *                      <td>SmartDeviceLink 1.0</td>\r
42  *              </tr>\r
43  *     <tr>\r
44  *                      <td>menuName</td>\r
45  *                      <td>String</td>\r
46  *                      <td>Text which appears in menu, representing this command.\r
47  *                              <ul>\r
48  *                                              <li>Min: 1</li>\r
49  *                                              <li>Max: 100</li>\r
50  *                                      </ul>\r
51  *                      </td>\r
52  *                      <td>SmartDeviceLink 1.0</td>\r
53  *              </tr>\r
54  * </table>\r
55  * @since SmartDeviceLink 1.0\r
56  */\r
57 public class MenuParams extends RPCStruct {\r
58         /**\r
59          * Constructs a newly allocated MenuParams object\r
60          */\r
61     public MenuParams() { }\r
62     /**\r
63      * Constructs a newly allocated MenuParams object indicated by the Hashtable parameter\r
64      * @param hash The Hashtable to use\r
65      */    \r
66     public MenuParams(Hashtable hash) {\r
67         super(hash);\r
68     }\r
69     /**\r
70      * Get the unique ID of an existing submenu to which a command will be added.\r
71      *  If this element is not provided, the command will be added to the top level of the Command Menu.\r
72      * @return parentID Min: 0 Max: 2000000000\r
73      */    \r
74     public Integer getParentID() {\r
75         return (Integer) store.get( Names.parentID );\r
76     }\r
77     /**\r
78      * Set the unique ID of an existing submenu to which a command will be added.\r
79      *  If this element is not provided, the command will be added to the top level of the Command Menu.\r
80      * @param parentID Min: 0; Max: 2000000000\r
81      */    \r
82     public void setParentID( Integer parentID ) {\r
83         if (parentID != null) {\r
84             store.put(Names.parentID, parentID );\r
85         }\r
86     }\r
87     /**\r
88      * Get the position within the items of the parent Command Menu. 0 will insert at the front, 1 will insert after the first existing element, etc. \r
89      *  Position of any submenu will always be located before the return and exit options.\r
90      *                                  <ul>\r
91      *                                          <li>Min Value: 0</li>\r
92      *                                          <li>Max Value: 1000</li>\r
93      *                                          <li>If position is greater or equal than the number of items in the parent Command Menu, the sub menu will be appended to the end of that Command Menu.</li>\r
94      *                                          <li>If this element is omitted, the entry will be added at the end of the parent menu.</li>\r
95      *                                  </ul>\r
96      * @return  the position within the items of the parent Command Menu\r
97      */    \r
98     public Integer getPosition() {\r
99         return (Integer) store.get( Names.position );\r
100     }\r
101     /**\r
102      * Set the position within the items of the parent Command Menu. 0 will insert at the front, 1 will insert after the first existing element, etc. \r
103      *  Position of any submenu will always be located before the return and exit options.\r
104      *                                  <ul>\r
105      *                                          <li>Min Value: 0</li>\r
106      *                                          <li>Max Value: 1000</li>\r
107      *                                          <li>If position is greater or equal than the number of items in the parent Command Menu, the sub menu will be appended to the end of that Command Menu.</li>\r
108      *                                          <li>If this element is omitted, the entry will be added at the end of the parent menu.</li>\r
109      *                                  </ul>\r
110      * @param position Mix: 0 Max: 1000\r
111      */    \r
112     public void setPosition( Integer position ) {\r
113         if (position != null) {\r
114             store.put(Names.position, position );\r
115         }\r
116     }\r
117     /**\r
118      * Get the text which appears in menu, representing this command.\r
119      *                          <ul>\r
120      *                                          <li>Min: 1</li>\r
121      *                                          <li>Max: 100</li>\r
122      *                                  </ul>\r
123      * @return menuName the menu name\r
124      */\r
125     \r
126     public String getMenuName() {\r
127         return (String) store.get( Names.menuName );\r
128     }\r
129     /**\r
130      * Set text which appears in menu, representing this command.\r
131      *                          <ul>\r
132      *                                          <li>Min: 1</li>\r
133      *                                          <li>Max: 100</li>\r
134      *                                  </ul>\r
135      * @param menuName the menu name\r
136      */\r
137     \r
138     public void setMenuName( String menuName ) {\r
139         if (menuName != null) {\r
140             store.put(Names.menuName, menuName );\r
141         }\r
142     }\r
143 }\r