Include device-policy-manager.h for the shared types
[platform/core/security/dpm-telephony.git] / api / telephony.h
1 /*
2  *  Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  *  Licensed under the Apache License, Version 2.0 (the "License");
5  *  you may not use this file except in compliance with the License.
6  *  You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  *  Unless required by applicable law or agreed to in writing, software
11  *  distributed under the License is distributed on an "AS IS" BASIS,
12  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  *  See the License for the specific language governing permissions and
14  *  limitations under the License
15  */
16
17 #ifndef __CAPI_DPM_TELEPHONY_POLICY_H__
18 #define __CAPI_DPM_TELEPHONY_POLICY_H__
19
20 #include <stdbool.h>
21
22 #include <dpm/device-policy-manager.h>
23
24 /**
25  * @file restriction.h
26  * @brief This file provides APIs to control restriction functionality.
27  */
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
33 /**
34  * @addtogroup  CAPI_DPM_TELEPHONY_POLICY_MODULE
35  * @{
36  */
37
38 /**
39  * @partner
40  * @brief       Allows or disallows user to use of SMS or text messaging.
41  * @details     An administrator can disable the text messaging capability
42  *              without any user interaction
43  * @since_tizen 3.0
44  * @privlevel   partner
45  * @privilege   %http://tizen.org/privilege/dpm.message
46  * @param[in]   handle Device policy manager handle
47  * @param[in]   sim_id SIM identifier
48  * @param[in]   allow If true, allow the use of SMS or text messaging,
49  *              if false, disallow the use of SMS or text messaging.
50  * @return      #DPM_ERROR_NONE on success, otherwise a negative value
51  * @retval      #DPM_ERROR_NONE Successful
52  * @retval      #DPM_ERROR_TIMED_OUT Time out
53  * @retval      #DPM_ERROR_INVALID_PARAMETER Invalid parameter
54  * @retval      #DPM_ERROR_PERMISSION_DENIED The application does not have
55  *              the privilege to call this API
56  * @pre         The handle must be created by dpm_manager_create().
57  * @see         dpm_telephony_get_messaging_state()
58  */
59 int dpm_telephony_set_messaging_state(device_policy_manager_h handle, const char *sim_id, bool allow);
60
61 /**
62  * @brief       Checks whether the text messaging is allowed or not.
63  * @details     An administrator can use this API to check whether text messaging capability
64  *              is enabled or not.
65  * @since_tizen 3.0
66  * @param[in]   handle Device policy manager handle
67  * @param[in]   sim_id SIM identifier
68  * @param[out]  is_allowed true if the messaging is allowed, false otherwise.
69  * @return      #DPM_ERROR_NONE on success, otherwise a negative value
70  * @retval      #DPM_ERROR_NONE Successful
71  * @retval      #DPM_ERROR_TIMED_OUT Time out
72  * @retval      #DPM_ERROR_INVALID_PARAMETER Invalid parameter
73  * @pre         The handle must be created by dpm_manager_create().
74  * @see         dpm_telephony_set_messaging_state()
75  */
76 int dpm_telephony_get_messaging_state(device_policy_manager_h handle, const char *sim_id, bool *is_allowed);
77
78 /**
79  * @}
80  */
81
82 #ifdef __cplusplus
83 }
84 #endif /* __cplusplus */
85
86 #endif /* __CAPI_DPM_TELEPHONY_POLICY_H__ */