Knox Tizen Wearable SDK
kiosk.h
1 /*
2  * Copyright (c) 2000-2017 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * PROPRIETARY/CONFIDENTIAL
5  *
6  * This software is the confidential and proprietary information of
7  * SAMSUNG ELECTRONICS ("Confidential Information").
8  * You shall not disclose such Confidential Information and shall
9  * use it only in accordance with the terms of the license agreement
10  * you entered into with SAMSUNG ELECTRONICS.
11  * SAMSUNG make no representations or warranties about the suitability
12  * of the software, either express or implied, including but not
13  * limited to the implied warranties of merchantability, fitness for
14  * a particular purpose, or non-infringement.
15  * SAMSUNG shall not be liable for any damages suffered by licensee as
16  * a result of using, modifying or distributing this software or its derivatives.
17  */
18 
19 /*
20  *@brief This file serves as interface between the Application and MDM server daemon.
21  */
22 
23 #ifndef LIBMDM_MDM_KIOSK_H
24 #define LIBMDM_MDM_KIOSK_H
25 
26 #include <stdio.h>
27 #include "mdm_client_type.h"
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 
124 mdm_result_t knox_mdm_set_allow_hardware_key(const char *key_name, mdm_status_t allow);
125 
183 mdm_status_t knox_mdm_get_allow_hardware_key(const char *key_name);
184 
185 /*
186  * @brief API to enable or disable changes to the watch face.
187  *
188  * @since_mdm 2.2.0
189  *
190  * @since_tizen 3.0.0.1
191  *
192  * @feature %http://developer.samsung.com/tizen/feature/mdm
193  *
194  * @par Usage:
195  * Use this API to allow or block the end user from changing the watch face.
196  * For example, If watch face change is restricted then the end user can't change the current watch face.
197  *
198  * @remark
199  * Restriction of changing watch face #mdm_status_t is written to #MDM_POLICY_ON_WATCHFACE notification file.
200  * You can register a callback for this event using #mdm_register_policy_receiver.
201  *
202  * @code{.c}
203  mdm_result_t ret = mdm_get_service();
204 
205  if ( ret == MDM_RESULT_SUCCESS) {
206  ret = knox_mdm_set_allow_watchface_changes(MDM_RESTRICTED);
207 
208  if ( ret == MDM_RESULT_SUCCESS) {
209  // watch face changes are forbidden
210  }
211  }
212  mdm_release_service();
213  * @endcode
214  *
215  * @privlevel public
216  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.kiosk
217  *
218  * @param[in] allow Can be set to #MDM_ALLOWED (watch face change is allowed) or #MDM_RESTRICTED (watch face
219  * change is not allowed). By default watch face change is allowed.
220  * @return #mdm_result_t : MDM_RESULT_SUCCESS upon successful configuration of end user permission to change the watch
221  face, or an error code from the values listed below upon failure.
222  *
223  * @retval #MDM_RESULT_SUCCESS Successful
224  * @retval #MDM_RESULT_FAIL General failure
225  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
226  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
227  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
228  *
229  * @par Permission:
230  * Usage of this API is restricted to registered clients only.
231  *
232  * @see knox_mdm_get_allow_watchface_change
233  *
234  */
235 mdm_result_t knox_mdm_set_allow_watchface_change(mdm_status_t allow);
236 
237 /*
238  * @brief API to check if end users are allowed to change the watch face.
239  *
240  * @since_mdm 2.2.0
241  *
242  * @since_tizen 3.0.0.1
243  *
244  * @feature %http://developer.samsung.com/tizen/feature/mdm
245  *
246  * @par Usage:
247  * Use this API to check if end users are allowed to make modifications to the device watch face changes.
248  *
249  * @code{.c}
250  mdm_result_t ret = mdm_get_service();
251 
252  if ( ret == MDM_RESULT_SUCCESS) {
253  mdm_status status = knox_mdm_get_allow_watchface_changes();
254 
255  if ( status != MDM_STATUS_ERROR ) {
256  if ( status == MDM_ALLOWED ) {
257  // watch face change is allowed
258  } else {
259  // watch face change is restricted
260  }
261  } else {
262  // error has occurred
263  }
264  }
265  mdm_release_service();
266  * @endcode
267  *
268  * @privlevel public
269  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.kiosk
270  *
271  * @return #mdm_status_t : Whether watchface change is allowed
272  *
273  * @retval #MDM_ALLOWED User can change watch face.
274  * @retval #MDM_RESTRICTED Usear cannot change watch face.
275  * @retval #MDM_STATUS_ERROR Error
276  *
277  * @par Permission:
278  * Usage of this API is restricted to registered clients only.
279  *
280  * @see knox_mdm_set_allow_watchface_change
281  *
282  */
283 mdm_status_t knox_mdm_get_allow_watchface_change(void);
284 
285 
286 /* --------------------------------------------------------------------------------------------------------
287  * HIDDEN DOCUMENTATION
288  * --------------------------------------------------------------------------------------------------------
289  *
290  * Hidden documentation won't be generated by doxygen unless
291  * KIOSK_COMMON section is added to the ENABLED_SECTIONS
292  * in the Doxygen configuration file.
293  */
295 
296 /*
297  * THIS is DEPRECATED. Left for compatibility reason.
298  * Do NOT USE THIS.
299  */
300 mdm_status_t mdm_get_allow_watchface_change(void);
301 
333 const char *mdm_get_key_name(int key);
334 
385 mdm_result_t mdm_set_enable_kiosk_mode(const char *p_package_name);
386 
427 mdm_result_t mdm_set_disable_kiosk_mode(void);
428 
462 mdm_status_t mdm_is_kiosk_mode_enabled(void);
463 
494 mdm_data_t *mdm_get_kiosk_home_package(void);
495 
539 mdm_result_t mdm_set_hide_system_bar(mdm_status_t hide);
540 
573 mdm_status_t mdm_is_system_bar_hidden(void);
574 
613 mdm_result_t mdm_set_wipe_recent_tasks(void);
614 
656 mdm_result_t mdm_set_allow_task_manager(mdm_status_t allow);
657 
690 mdm_status_t mdm_is_task_manager_allowed(void);
691 
723 mdm_data_t *mdm_get_hardware_key_list(void);
724 
766 mdm_data_t *mdm_set_allow_hardware_keys(int *p_hw_key_id, int keys_count, mdm_status_t allow);
767 
803 mdm_status_t mdm_is_hardware_key_allowed(int p_hw_key_id);
804 
836 mdm_data_t *mdm_get_all_blocked_hardware_keys(void);
837 
873 mdm_result_t mdm_clear_all_notification(void);
874 
917 mdm_result_t mdm_set_hide_navigation_bar(mdm_status_t hide);
918 
961 mdm_result_t mdm_set_hide_status_bar(mdm_status_t hide);
962 
995 mdm_status_t mdm_is_navigation_bar_hidden(void);
996 
1029 mdm_status_t mdm_is_status_bar_hidden(void);
1030 
1032 /* -----------------------------------------------------------------------------------------------------------------
1033  * END OF HIDDEN DOCUMENTATION
1034  * -----------------------------------------------------------------------------------------------------------------
1035  */
1036 
1037 
1042 #ifdef __cplusplus
1043 }
1044 #endif
1045 
1046 #endif // LIBMDM_MDM_KIOSK_H
This structure is used to store GList.
mdm_status_t
MDM Policy status.
mdm_status_t knox_mdm_get_allow_hardware_key(const char *key_name)
API to check if a specific hardware key is disabled.
mdm_result_t knox_mdm_set_allow_hardware_key(const char *key_name, mdm_status_t allow)
API to disable a specified hardware key.
mdm_result_t
MDM API result.