2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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
17 #ifndef __CAPI_DPM_TELEPHONY_POLICY_H__
18 #define __CAPI_DPM_TELEPHONY_POLICY_H__
22 #include <dpm/device-policy-manager.h>
26 * @brief This file provides APIs to control restriction functionality.
34 * @addtogroup CAPI_DPM_TELEPHONY_POLICY_MODULE
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
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()
59 int dpm_telephony_set_messaging_state(device_policy_manager_h handle, const char *sim_id, bool allow);
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
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()
76 int dpm_telephony_get_messaging_state(device_policy_manager_h handle, const char *sim_id, bool *is_allowed);
84 #endif /* __cplusplus */
86 #endif /* __CAPI_DPM_TELEPHONY_POLICY_H__ */