4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Hakjoo Ko <hakjoo.ko@samsung.com>
7 * Mahendra Kumar Prajapat <mahendra.p@samsung.com>
8 * Harsha Shekar <h.shekar@samsung.com>
10 * Licensed under the Apache License, Version 2.0 (the "License");
11 * you may not use this file except in compliance with the License.
12 * You may obtain a copy of the License at
14 * http://www.apache.org/licenses/LICENSE-2.0
16 * Unless required by applicable law or agreed to in writing, software
17 * distributed under the License is distributed on an "AS IS" BASIS,
18 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 * See the License for the specific language governing permissions and
20 * limitations under the License.
26 * @brief DRM Client API declaration header file.
27 * @author Mahendra Kumar Prajapat (mahendra.p@samsung.com)
28 * @author Harsha Shekar (h.shekar@samsung.com)
30 * @history 0.1: DRM Client API Declarations
33 #ifndef __DRM_CLIENT_H__
34 #define __DRM_CLIENT_H__
38 #endif /*__cplusplus */
40 #include "drm_client_types.h"
43 * @defgroup DRMCLIENT drm-client
52 * @addtogroup DRMCLIENT
57 * An application can check that a file is DRM file
58 * (OMA DRM, PlayReady, DivX etc.)
60 * @param[in] file_path Specifies the pointer points a DRM file path.
61 * @param[out] is_drm_file DRM_TRUE if the input file is a DRM file
63 * @return 0 on success, else a negative error value
64 * @retval DRM_RETURN_SUCCESS on success
65 * @retval DRM_RETURN_INVALID_ARG if arguments are invalid
66 * @retval DRM_RETURN_COMMUNICATION_ERROR if socket error
67 * @retval DRM_RETURN_INTERNAL_ERROR if operation error
73 int drm_is_drm_file(const char *file_path, drm_bool_type_e *is_drm_file);
76 * An application can get DRM file type of the file that is
77 * specified in file_path
79 * @param[in] file_path Specifies the pointer points a DRM file path.
80 * @param[out] file_type DRM file type.
81 * @return 0 on success, else a negative error value
82 * @retval DRM_RETURN_SUCCESS on success
83 * @retval DRM_RETURN_INVALID_ARG if arguments are invalid
88 int drm_get_file_type(const char *file_path, drm_file_type_e *file_type);
91 * An application can check that a DRM file has valid license or not.
93 * @param[in] file_path DRM file path.
94 * @param[in] perm_type Enumeration type of permission.
95 * @param[out] license_status license status.
96 * @return 0 on success, else a negative error value
97 * @retval DRM_RETURN_SUCCESS on success
98 * @retval DRM_RETURN_INVALID_ARG if arguments are invalid
99 * @retval DRM_RETURN_COMMUNICATION_ERROR if socket error
100 * @retval DRM_RETURN_INTERNAL_ERROR if operation error
105 int drm_get_license_status(const char *file_path,
106 drm_permission_type_e perm_type,
107 drm_license_status_e *license_status);
110 * An application can get DRM Content information for the file
111 * specified in file_path.
113 * @param[in] file_path DRM file path.
114 * @param[out] content_info Content information.
115 * @return 0 on success, else a negative error value
116 * @retval DRM_RETURN_SUCCESS on success
117 * @retval DRM_RETURN_INVALID_ARG if arguments are invalid
118 * @retval DRM_RETURN_COMMUNICATION_ERROR if socket error
119 * @retval DRM_RETURN_INTERNAL_ERROR if operation error
124 int drm_get_content_info(const char *file_path,
125 drm_content_info_s *content_info);
128 * An application can get file information of a DRM file.
130 * @param[in] file_path DRM file path.
131 * @param[out] fileInfo DRM file info.
132 * @return 0 on success, else a negative error value
133 * @retval DRM_RETURN_SUCCESS on success
134 * @retval DRM_RETURN_INVALID_ARG if arguments are invalid
135 * @retval DRM_RETURN_COMMUNICATION_ERROR if socket error
136 * @retval DRM_RETURN_INTERNAL_ERROR if operation error
141 int drm_get_file_info(const char *file_path, drm_file_info_s *file_info);
144 * An application can get constraints associated with
145 * given permission & given file
147 * @param[in] file_path DRM file path.
148 * @param[in] perm_type Enumeration type of permission.
149 * @param[out] constraint_info Constraint info.
150 * @return 0 on success, else a negative error value
151 * @retval DRM_RETURN_SUCCESS on success
152 * @retval DRM_RETURN_INVALID_ARG if arguments are invalid
153 * @retval DRM_RETURN_COMMUNICATION_ERROR if socket error
154 * @retval DRM_RETURN_INTERNAL_ERROR if operation error
159 int drm_get_constraint_info(const char *file_path,
160 drm_permission_type_e perm_type,
161 drm_constraint_info_s *constraint_info);
164 * An application can check the feasibility of actions to be
165 * performed based on the type of DRM file.
167 * @param[in] action Action to be taken.
168 * @param[in] action_data Data needed to check action
170 * @param[out] is_allowed DRM_TRUE if action is allowed
172 * @return 0 on success, else a negative error value
173 * @retval DRM_RETURN_SUCCESS on success
174 * @retval DRM_RETURN_INVALID_ARG if arguments are invalid
175 * @retval DRM_RETURN_COMMUNICATION_ERROR if socket error
176 * @retval DRM_RETURN_INTERNAL_ERROR if operation error
181 int drm_is_action_allowed(drm_action_type_e action,
182 drm_action_allowed_data_s *action_data,
183 drm_bool_type_e *is_allowed);
187 * An application can get the requested data from DRM.
189 * @param[in] data_type Data types as per enum drm_data_type_e.
190 * @param[in] input Pointer to appropriate structure as per data_type.
191 * @param[out] output Output data. Pointer to appropriate structure as
194 * @return 0 on success, else a negative error value
195 * @retval DRM_RETURN_SUCCESS on success
196 * @retval DRM_RETURN_INVALID_ARG if arguments are invalid
197 * @retval DRM_RETURN_COMMUNICATION_ERROR if socket error
198 * @retval DRM_RETURN_INTERNAL_ERROR if operation error
199 * @remarks Please typecast to appropriate data structures
202 * if data_type = DRM_DATA_TYPE_SECURE_CLOCK
203 * then input type: input = NULL
204 * and output type: output = pointer to struct
205 * drm_secure_clock_data_s
207 * if data_type = DRM_DATA_TYPE_TRANSACTION_TRACKING_FLAG
208 * then input type: input = NULL
209 * and output type: output = pointer to int
211 * if data_type = DRM_DATA_TYPE_TRANSACTION_TRACKING_ID
212 * then input type: input = pointer to file path (const char)
213 * and output type: output = pointer to struct
214 * drm_transaction_id_info_s
216 * if data_type = DRM_DATA_TYPE_DIVX_REGISTRATION_CODE
217 * then input type: input = NULL
218 * and output type: output = pointer to struct drm_code_info_s
220 * if data_type = DRM_DATA_TYPE_DIVX_DEREGISTRATION_CODE
221 * then input type: input = NULL
222 * and output type: output = pointer to struct drm_code_info_s
227 int drm_get_data(drm_data_type_e data_type, void *input, void *output);
230 * An application can do particular request to DRM.
232 * @param[in] request_type Request types as per enum drm_request_type_e.
233 * @param[in] input Pointer to appropriate structure as per
235 * @param[out] output Output data. Pointer to appropriate structure as
238 * @return 0 on success, else a negative error value
239 * @retval DRM_RETURN_SUCCESS on success
240 * @retval DRM_RETURN_INVALID_ARG if arguments are invalid
241 * @retval DRM_RETURN_COMMUNICATION_ERROR if socket error
242 * @retval DRM_RETURN_INTERNAL_ERROR if operation error
243 * @remarks Please typecast to appropriate data structures
246 * if request_type = DRM_REQUEST_TYPE_REGISTER_FILE
247 * then input type: input = pointer to const char (file_path)
248 * and output type: output = NULL
250 * if request_type = DRM_REQUEST_TYPE_UNREGISTER_FILE
251 * then input type: input = pointer to struct drm_unregister_info_s
252 * and output type: output = NULL
254 * if request_type = DRM_REQUEST_TYPE_UNREGISTER_ALL_FILES
255 * then input type: input = NULL
256 * and output type: output = NULL
258 * if request_type = DRM_REQUEST_TYPE_REGISTER_LICENSE
259 * then input type: input = pointer to
260 * struct drm_register_lic_info_s.
261 * and output type: output = pointer to
262 * struct drm_register_lic_resp_s.
264 * if request_type = DRM_REQUEST_TYPE_SUBMIT_INITIATOR_URL
265 * then input type: input = pointer to struct drm_initiator_info_s
266 * and output type: output = pointer to struct drm_web_server_resp_data_s
268 * if request_type = DRM_REQUEST_TYPE_SUBMIT_ROAP_MESSAGE
269 * then input type: input = pointer to struct drm_submit_roap_message_info_s
270 * and output type: output = NULL
272 * if request_type = DRM_REQUEST_TYPE_SUBMIT_ROAP_USER_CONSENT
273 * then input type: input = pointer to struct drm_submit_roap_user_consent_info_s
274 * and output type: output = NULL
276 * if request_type = DRM_REQUEST_TYPE_HTTP_USER_CANCEL
277 * then input type: input = pointer to struct drm_http_user_cancel_info_s
278 * and output type: output = NULL
280 * if request_type = DRM_REQUEST_TYPE_REGISTER_COPY_FILE
281 * then input type: input = pointer to struct drm_register_copy_file_info_s
282 * and output type: output = NULL
284 * if request_type = DRM_REQUEST_TYPE_REGISTER_MOVE_FILE
285 * then input type: input = pointer to struct drm_register_copy_file_info_s
286 * and output type: output = NULL
288 * if request_type = DRM_REQUEST_TYPE_INSERT_EXT_MEMORY
289 * then input type: input = NULL
290 * and output type: output = NULL
292 * if request_type = DRM_REQUEST_TYPE_EXTRACT_EXT_MEMORY
293 * then input type: input = NULL
294 * and output type: output = NULL
296 * if request_type = DRM_REQUEST_TYPE_REGISTER_SETAS
297 * then input type: input = pointer to struct drm_register_setas_info_s
298 * and output type: output = NULL
300 * if request_type = DRM_REQUEST_TYPE_UNREGISTER_SETAS
301 * then input type: input = pointer to struct drm_unregister_setas_info_s
302 * and output type: output = NULL
307 int drm_process_request(drm_request_type_e request_type,
308 void *input, void *output);
317 #endif /* __cplusplus */
319 #endif /*__DRM_CLIENT_H__ */