update tizen source
[framework/messaging/msg-service.git] / include / utils / MsgDrmWrapper.h
1 /*
2 *
3 * Copyright (c) 2000-2012 Samsung Electronics Co., Ltd. All Rights Reserved.
4 *
5 * This file is part of msg-service.
6 *
7 * Contact: Jaeyun Jeong <jyjeong@samsung.com>
8 *          Sangkoo Kim <sangkoo.kim@samsung.com>
9 *          Seunghwan Lee <sh.cat.lee@samsung.com>
10 *          SoonMin Jung <sm0415.jung@samsung.com>
11 *          Jae-Young Lee <jy4710.lee@samsung.com>
12 *          KeeBum Kim <keebum.kim@samsung.com>
13 *
14 * PROPRIETARY/CONFIDENTIAL
15 *
16 * This software is the confidential and proprietary information of
17 * SAMSUNG ELECTRONICS ("Confidential Information"). You shall not
18 * disclose such Confidential Information and shall use it only in
19 * accordance with the terms of the license agreement you entered
20 * into with SAMSUNG ELECTRONICS.
21 *
22 * SAMSUNG make no representations or warranties about the suitability
23 * of the software, either express or implied, including but not limited
24 * to the implied warranties of merchantability, fitness for a particular
25 * purpose, or non-infringement. SAMSUNG shall not be liable for any
26 * damages suffered by licensee as a result of using, modifying or
27 * distributing this software or its derivatives.
28 *
29 */
30
31 #ifndef __MSG_DRM_WRAPPER_H_
32 #define __MSG_DRM_WRAPPER_H_
33
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37
38 typedef void* MSG_DRMHANDLE;
39
40 typedef enum {
41         MMS_DRM_RIGHT_PLAY,                                                             //video
42         MSG_DRM_RIGHT_DISPLAY,                                                  //image
43         MSG_DRM_RIGHT_EXECUTE,                                                  //game
44         MSG_DRM_RIGHT_PRINT,
45         MSG_DRM_RIGHT_EXPORT,
46 } MSG_DRM_RIGHT_TYPE;
47
48 typedef enum {
49         MSG_MODE_FILE,
50         MSG_MODE_STREAM
51 } MSG_DRM_OPENMODE;
52
53 typedef enum {
54         MSG_DRM_NONE = 0,
55         MSG_DRM_FORWARD_LOCK,
56         MSG_DRM_COMBINED_DELIVERY,
57         MSG_DRM_SEPARATE_DELIVERY
58 } MSG_DRM_TYPE;
59
60
61 bool MsgDrmRegisterFile(MSG_DRM_OPENMODE eMode, char *pBuffer, int nSize);
62 bool MsgDrmUnregisterFile(char *szFilename);
63
64 bool MsgDrmIsDrmFile(const char *szFilePath);
65
66 bool MsgDrmGetMimeTypeEx(const char *szFileName, char *szMimeType, int nMimeTypeLen);
67 bool MsgDrmGetContentID(const char *szFileName, char *szContentID, int nContentIDLen);
68 bool MsgDrmGetDrmType(const char *szFileName, MSG_DRM_TYPE *eDRMType);
69
70
71 bool MsgDrmOpen(MSG_DRM_OPENMODE eMode, const char *pBuffer, int nSize, MSG_DRMHANDLE *pHandle);
72 bool MsgDrmClose(MSG_DRMHANDLE);
73 bool MsgDrmGetMimeType(MSG_DRMHANDLE pHandle, char *szMimeType, int nMimeTypeLen);
74 int MsgDrmGetStreamSize(MSG_DRMHANDLE pHandle);
75 bool MsgDrmGetStream(MSG_DRMHANDLE pHandle, int nStreamSize, unsigned char *pStream);
76
77 bool MsgDrmIsAvailable(MSG_DRMHANDLE pHandle);
78 bool MsgDrmConsumeRights(MSG_DRMHANDLE pHandle, MSG_DRM_RIGHT_TYPE eRightType, long nMiliSecs);
79 bool MsgDrmOnStart(MSG_DRMHANDLE pHandle, MSG_DRM_RIGHT_TYPE eRightType);
80 bool MsgDrmOnPause(MSG_DRMHANDLE pHandle, MSG_DRM_RIGHT_TYPE eRightType);
81 bool MsgDrmOnResume(MSG_DRMHANDLE pHandle, MSG_DRM_RIGHT_TYPE eRightType);
82 bool MsgDrmOnStop(MSG_DRMHANDLE pHandle, MSG_DRM_RIGHT_TYPE eRightType);
83
84
85 bool MsgDrmConvertDmtoDcfType(char *inputFile, char *outputFile);
86 bool MsgDrmIsConvertedFL(char *szFilePath);
87 #ifdef __cplusplus
88 }
89 #endif
90
91 #endif
92