update tizen source
[framework/messaging/msg-service.git] / plugin / mms_plugin / include / MmsPluginSMILValidate.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 MMS_PLUGIN_SMIL_VALIDATE_H
32 #define MMS_PLUGIN_SMIL_VALIDATE_H
33
34
35 /*==================================================================================================
36  *                                     HEADER
37  *==================================================================================================*/
38 #include "MsgTypes.h"
39 #include "MsgMmsTypes.h"
40 #include "MmsPluginMessage.h"
41
42 /*==================================================================================================
43  *                                     DEFINE
44  *==================================================================================================*/
45 /**
46  *      @brief  Represents the default values of SMIL root layout. \n
47  */
48 #define MSG_SMIL_ROOT_LAYOUT_WIDTH      (100)
49 #define MSG_SMIL_ROOT_LAYOUT_HEIGHT     (100)
50 #define MSG_SMIL_ROOT_LAYOUT_IN_PERCENT (true)
51 #define MSG_SMIL_ROOT_LAYOUT_BG_COLOR   "#FFFFFF"
52
53 /**
54  *      @brief  Represents the default values of SMIL Region \n
55  */
56 #define MSG_SMIL_DEFAULT_TXT_REG        "text"
57 #define MSG_SMIL_DEFAULT_IMG_REG        "image"
58 #define MSG_SMIL_DEFAULT_FULL_REG       "full"
59 #define MSG_SMIL_REG_FIT_TYPE           "meet"
60 #define MSG_SMIL_REG_BG_COLOR           "#FFFFFF"
61
62 #define MSG_SMIL_FULL_REG_LEFT                          (0)
63 #define MSG_SMIL_FULL_REG_TOP                           (0)
64 #define MSG_SMIL_FULL_REG_WIDTH                         (100)
65 #define MSG_SMIL_FULL_REG_HEIGHT                        (100)
66
67 #define MSG_SMIL_FIRST_REG_LEFT                         (0)
68 #define MSG_SMIL_FIRST_REG_TOP                          (0)
69 #define MSG_SMIL_FIRST_REG_WIDTH                        (100)
70 #define MSG_SMIL_FIRST_REG_HEIGHT                       (50)
71
72 #define MSG_SMIL_SECOND_REG_LEFT                        (0)
73 #define MSG_SMIL_SECOND_REG_TOP                         (50)
74 #define MSG_SMIL_SECOND_REG_WIDTH                       (100)
75 #define MSG_SMIL_SECOND_REG_HEIGHT                      (50)
76
77 /**
78  *      @brief  Represents the default values of SMIL Media \n
79  */
80 #define MSG_SMIL_REG_POSITION_IS_DEFAULT        (true)
81 #define MSG_SMIL_TEXT_ON_TOP                            (true)
82
83
84 /*==================================================================================================
85  *                                     ENUMS
86  *==================================================================================================*/
87
88 /**
89  *      @brief  Represents the values of an smil error code. \n
90  *      Success code is zero, but all error codes SHOULD be negative and smaller than MSG_SMIL_ERR_BEGIN. \n
91  */
92 enum MSG_SMIL_ERR_E {
93         MSG_SMIL_SUCCESS = 0,
94         MSG_SMIL_ERR_UNKNOWN = -255,
95         MSG_SMIL_ERR_INVALID_ROOTLAYOUT,
96         MSG_SMIL_ERR_INVALID_REGION_INFO,
97         MSG_SMIL_ERR_SIMILAR_MEDIA_EXISTS,
98         MSG_SMIL_ERR_INVALID_SMIL_FILE_PATH,
99         MSG_SMIL_ERR_INVALID_PAGE_INFO,
100         MSG_SMIL_ERR_INVALID_PAGE_DUR,
101         MSG_SMIL_ERR_INVALID_PARAM,
102 };
103
104 /*==================================================================================================
105  *                                     FUNCTIONS
106  *==================================================================================================*/
107
108 /**     @fn             MSG_SMIL_ERR_E MsgMMSCreateSMIL(MMS_MESSAGE_DATA_S *pMsgData)
109  *      @brief  Creates a SMIL buffer based on the Message handle.
110  *      @param  pMsgData is Message handle. \n
111  *      @param  pError is a pointer to a SMIL error type. \n
112  *      @return MSG_SMIL_ERR_E \n
113  *      @retval MSG_SMIL_SUCCESS                Success in operation. \n
114  *      @retval MSG_SMIL_ERR_UNKNOWN                            Encoding failed \n
115  *      @retval MSG_SMIL_ERR_INVALID_ROOTLAYOUT         Invalid Root Layout \n
116   *     @retval MSG_SMIL_ERR_INVALID_REGION_INFO        Invalid Region \n
117  *      @retval MSG_SMIL_ERR_SIMILAR_MEDIA_EXISTS       Duplicate media \n
118  *      @retval MSG_SMIL_ERR_INVALID_SMIL_FILE_PATH     Invalid Smil Path \n
119  *      @retval MSG_SMIL_ERR_INVALID_PAGE_INFO          Invalid Page Info \n
120  *      @retval MSG_SMIL_ERR_INVALID_PAGE_DUR           Invalid Page Duration \n
121  *      @retval MSG_SMIL_ERR_INVALID_PARAM                      Invalid Parameter \n
122  */
123 MSG_SMIL_ERR_E MsgMMSCreateSMIL(MMS_MESSAGE_DATA_S *pMsgData);
124
125 /**     @fn             MSG_SMIL_ERR_E _MsgMMSValidateSMILRootLayout(MMS_MESSAGE_DATA_S *pMsgData)
126  *      @brief  Validates the Root layout information present in the Message handle.
127  *      @param  pMsgData is Message handle. \n
128  *      @return MSG_SMIL_ERR_E \n
129  *      @retval MSG_SMIL_SUCCESS                                                Success in operation. \n
130  *      @retval MSG_SMIL_ERR_INVALID_ROOTLAYOUT                 Failure in operation. \n
131  */
132 MSG_SMIL_ERR_E _MsgMMSValidateSMILRootLayout(MMS_MESSAGE_DATA_S *pMsgData);
133
134 /**     @fn             MSG_SMIL_ERR_E _MsgMMSAddDefaultSMILRegions(MMS_MESSAGE_DATA_S *pMsgData)
135  *      @brief  Adds the default Region information based on the Message handle.
136  *      @param  pMsgData is Message handle. \n
137  *      @return MSG_SMIL_ERR_E \n
138  *      @retval MSG_SMIL_SUCCESS                                                Success in operation. \n
139  *      @retval MSG_SMIL_ERR_INVALID_ROOTLAYOUT                 Failure in operation. \n
140  */
141 MSG_SMIL_ERR_E _MsgMMSAddDefaultSMILRootLayout(MMS_MESSAGE_DATA_S *pMsgData);
142
143 /**     @fn             MSG_SMIL_ERR_E _MsgMMSValidateSMILRegion(MMS_MESSAGE_DATA_S *pMsgData, bool *pbRegAdded)
144  *      @brief  Validates the Region information present in the Message handle.
145  *      @param  pMsgData is Message handle. \n
146  *      @return MSG_SMIL_ERR_E \n
147  *      @retval MSG_SMIL_SUCCESS                                                Success in operation. \n
148  *      @retval MSG_SMIL_ERR_INVALID_REGION_INFO                Failure in operation. \n
149  *      @retval MSG_SMIL_ERR_INVALID_PAGE_INFO                  Failure in operation. \n
150  */
151 MSG_SMIL_ERR_E _MsgMMSValidateSMILRegion(MMS_MESSAGE_DATA_S *pMsgData, bool *pbRegAdded);
152
153 /**     @fn             MSG_SMIL_ERR_E _MsgMMSAddDefaultFirstSMILRegion(MMS_MESSAGE_DATA_S *pMsgData, bool bTextReg)
154  *      @brief  Adds the default first Region information when two regions are present in a page based on the Message handle.
155  *      @param  pMsgData is Message handle. \n
156  *      @return MSG_SMIL_ERR_E \n
157  *      @retval MSG_SMIL_SUCCESS                                                Success in operation. \n
158  *      @retval MSG_SMIL_ERR_INVALID_REGION_INFO                Failure in operation. \n
159  */
160 MSG_SMIL_ERR_E _MsgMMSAddDefaultFirstSMILRegion(MMS_MESSAGE_DATA_S *pMsgData, bool bTextReg);
161
162 /**     @fn             MSG_SMIL_ERR_E _MsgMMSAddDefaultSecondSMILRegion(MMS_MESSAGE_DATA_S *pMsgData, bool bTextReg)
163  *      @brief  Adds the default second Region information when two regions are present in a page based on the Message handle.
164  *      @param  pMsgData is Message handle. \n
165  *      @return MSG_SMIL_ERR_E \n
166  *      @retval MSG_SMIL_SUCCESS                                                Success in operation. \n
167  *      @retval MSG_SMIL_ERR_INVALID_REGION_INFO                Failure in operation. \n
168  */
169 MSG_SMIL_ERR_E _MsgMMSAddDefaultSecondSMILRegion(MMS_MESSAGE_DATA_S *pMsgData, bool bTextReg);
170
171 /**     @fn             MSG_SMIL_ERR_E _MsgMMSAddDefaultFullSMILRegion(MMS_MESSAGE_DATA_S *pMsgData)
172  *      @brief  Adds the default full Region information when only region is present in a page based on the Message handle.
173  *      @param  pMsgData is Message handle. \n
174  *      @return MSG_SMIL_ERR_E \n
175  *      @retval MSG_SMIL_SUCCESS                                                Success in operation. \n
176  *      @retval MSG_SMIL_ERR_INVALID_REGION_INFO                Failure in operation. \n
177  */
178 MSG_SMIL_ERR_E _MsgMMSAddDefaultFullSMILRegion(MMS_MESSAGE_DATA_S *pMsgData);
179
180 /**     @fn             MSG_SMIL_ERR_E _MsgMMSValidateSMILPage(MMS_MESSAGE_DATA_S *pMsgData, bool bRegAdded)
181  *      @brief  Validates the Page information present in the Message handle.
182  *      @param  pMsgData is Message handle. \n
183  *      @return MSG_SMIL_ERR_E \n
184  *      @retval MSG_SMIL_SUCCESS                                                Success in operation. \n
185  *      @retval MSG_SMIL_ERR_INVALID_PAGE_INFO                  Failure in operation. \n
186  *      @retval MSG_SMIL_ERR_SIMILAR_MEDIA_EXISTS               Same Kind of Media Exists in SMIL page. \n
187  *      @retval MSG_SMIL_ERR_INVALID_REGION_INFO                Failure in operation. \n
188  */
189 MSG_SMIL_ERR_E _MsgMMSValidateSMILPage(MMS_MESSAGE_DATA_S *pMsgData, bool bRegAdded);
190
191 #endif // MMS_PLUGIN_SMIL_ENCODE_H