Modify flora license version.
[platform/core/messaging/msg-service.git] / plugin / mms_plugin / include / MmsPluginSMILValidate.h
1 /*
2 * Copyright 2012-2013  Samsung Electronics Co., Ltd
3 *
4 * Licensed under the Flora License, Version 1.1 (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://floralicense.org/license/
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 MMS_PLUGIN_SMIL_VALIDATE_H
18 #define MMS_PLUGIN_SMIL_VALIDATE_H
19
20 #include "MsgMmsTypes.h"
21
22 /**
23  *      @brief  Represents the default values of SMIL root layout. \n
24  */
25 #define MSG_SMIL_ROOT_LAYOUT_WIDTH      (100)
26 #define MSG_SMIL_ROOT_LAYOUT_HEIGHT     (100)
27 #define MSG_SMIL_ROOT_LAYOUT_IN_PERCENT (true)
28 #define MSG_SMIL_ROOT_LAYOUT_BG_COLOR   "#FFFFFF"
29
30 /**
31  *      @brief  Represents the default values of SMIL Region \n
32  */
33 #define MSG_SMIL_DEFAULT_TXT_REG        "text"
34 #define MSG_SMIL_DEFAULT_IMG_REG        "image"
35 #define MSG_SMIL_DEFAULT_FULL_REG       "full"
36 #define MSG_SMIL_REG_FIT_TYPE           "meet"
37 #define MSG_SMIL_REG_BG_COLOR           "#FFFFFF"
38
39 #define MSG_SMIL_FULL_REG_LEFT                          (0)
40 #define MSG_SMIL_FULL_REG_TOP                           (0)
41 #define MSG_SMIL_FULL_REG_WIDTH                         (100)
42 #define MSG_SMIL_FULL_REG_HEIGHT                        (100)
43
44 #define MSG_SMIL_FIRST_REG_LEFT                         (0)
45 #define MSG_SMIL_FIRST_REG_TOP                          (0)
46 #define MSG_SMIL_FIRST_REG_WIDTH                        (100)
47 #define MSG_SMIL_FIRST_REG_HEIGHT                       (50)
48
49 #define MSG_SMIL_SECOND_REG_LEFT                        (0)
50 #define MSG_SMIL_SECOND_REG_TOP                         (50)
51 #define MSG_SMIL_SECOND_REG_WIDTH                       (100)
52 #define MSG_SMIL_SECOND_REG_HEIGHT                      (50)
53
54 /**
55  *      @brief  Represents the default values of SMIL Media \n
56  */
57 #define MSG_SMIL_REG_POSITION_IS_DEFAULT        (true)
58 #define MSG_SMIL_TEXT_ON_TOP                            (true)
59
60
61 /*==================================================================================================
62  *                                     ENUMS
63  *==================================================================================================*/
64
65 /**
66  *      @brief  Represents the values of an smil error code. \n
67  *      Success code is zero, but all error codes SHOULD be negative and smaller than MSG_SMIL_ERR_BEGIN. \n
68  */
69 enum MSG_SMIL_ERR_E {
70         MSG_SMIL_SUCCESS = 0,
71         MSG_SMIL_ERR_UNKNOWN = -255,
72         MSG_SMIL_ERR_INVALID_ROOTLAYOUT,
73         MSG_SMIL_ERR_INVALID_REGION_INFO,
74         MSG_SMIL_ERR_SIMILAR_MEDIA_EXISTS,
75         MSG_SMIL_ERR_INVALID_SMIL_FILE_PATH,
76         MSG_SMIL_ERR_INVALID_PAGE_INFO,
77         MSG_SMIL_ERR_INVALID_PAGE_DUR,
78         MSG_SMIL_ERR_INVALID_PARAM,
79 };
80
81 /**     @fn             MSG_SMIL_ERR_E MsgMMSCreateSMIL(MMS_MESSAGE_DATA_S *pMsgData)
82  *      @brief  Creates a SMIL buffer based on the Message handle.
83  *      @param  pMsgData is Message handle. \n
84  *      @param  pError is a pointer to a SMIL error type. \n
85  *      @return MSG_SMIL_ERR_E \n
86  *      @retval MSG_SMIL_SUCCESS                Success in operation. \n
87  *      @retval MSG_SMIL_ERR_UNKNOWN                            Encoding failed \n
88  *      @retval MSG_SMIL_ERR_INVALID_ROOTLAYOUT         Invalid Root Layout \n
89   *     @retval MSG_SMIL_ERR_INVALID_REGION_INFO        Invalid Region \n
90  *      @retval MSG_SMIL_ERR_SIMILAR_MEDIA_EXISTS       Duplicate media \n
91  *      @retval MSG_SMIL_ERR_INVALID_SMIL_FILE_PATH     Invalid Smil Path \n
92  *      @retval MSG_SMIL_ERR_INVALID_PAGE_INFO          Invalid Page Info \n
93  *      @retval MSG_SMIL_ERR_INVALID_PAGE_DUR           Invalid Page Duration \n
94  *      @retval MSG_SMIL_ERR_INVALID_PARAM                      Invalid Parameter \n
95  */
96 MSG_SMIL_ERR_E MsgMMSCreateSMIL(MMS_MESSAGE_DATA_S *pMsgData);
97
98 /**     @fn             MSG_SMIL_ERR_E _MsgMMSValidateSMILRootLayout(MMS_MESSAGE_DATA_S *pMsgData)
99  *      @brief  Validates the Root layout information present in the Message handle.
100  *      @param  pMsgData is Message handle. \n
101  *      @return MSG_SMIL_ERR_E \n
102  *      @retval MSG_SMIL_SUCCESS                                                Success in operation. \n
103  *      @retval MSG_SMIL_ERR_INVALID_ROOTLAYOUT                 Failure in operation. \n
104  */
105 MSG_SMIL_ERR_E _MsgMMSValidateSMILRootLayout(MMS_MESSAGE_DATA_S *pMsgData);
106
107 /**     @fn             MSG_SMIL_ERR_E _MsgMMSAddDefaultSMILRegions(MMS_MESSAGE_DATA_S *pMsgData)
108  *      @brief  Adds the default Region information based on the Message handle.
109  *      @param  pMsgData is Message handle. \n
110  *      @return MSG_SMIL_ERR_E \n
111  *      @retval MSG_SMIL_SUCCESS                                                Success in operation. \n
112  *      @retval MSG_SMIL_ERR_INVALID_ROOTLAYOUT                 Failure in operation. \n
113  */
114 MSG_SMIL_ERR_E _MsgMMSAddDefaultSMILRootLayout(MMS_MESSAGE_DATA_S *pMsgData);
115
116 /**     @fn             MSG_SMIL_ERR_E _MsgMMSValidateSMILRegion(MMS_MESSAGE_DATA_S *pMsgData, bool *pbRegAdded)
117  *      @brief  Validates the Region information present in the Message handle.
118  *      @param  pMsgData is Message handle. \n
119  *      @return MSG_SMIL_ERR_E \n
120  *      @retval MSG_SMIL_SUCCESS                                                Success in operation. \n
121  *      @retval MSG_SMIL_ERR_INVALID_REGION_INFO                Failure in operation. \n
122  *      @retval MSG_SMIL_ERR_INVALID_PAGE_INFO                  Failure in operation. \n
123  */
124 MSG_SMIL_ERR_E _MsgMMSValidateSMILRegion(MMS_MESSAGE_DATA_S *pMsgData, bool *pbRegAdded);
125
126 /**     @fn             MSG_SMIL_ERR_E _MsgMMSAddDefaultFirstSMILRegion(MMS_MESSAGE_DATA_S *pMsgData, bool bTextReg)
127  *      @brief  Adds the default first Region information when two regions are present in a page based on the Message handle.
128  *      @param  pMsgData is Message handle. \n
129  *      @return MSG_SMIL_ERR_E \n
130  *      @retval MSG_SMIL_SUCCESS                                                Success in operation. \n
131  *      @retval MSG_SMIL_ERR_INVALID_REGION_INFO                Failure in operation. \n
132  */
133 MSG_SMIL_ERR_E _MsgMMSAddDefaultFirstSMILRegion(MMS_MESSAGE_DATA_S *pMsgData, bool bTextReg);
134
135 /**     @fn             MSG_SMIL_ERR_E _MsgMMSAddDefaultSecondSMILRegion(MMS_MESSAGE_DATA_S *pMsgData, bool bTextReg)
136  *      @brief  Adds the default second Region information when two regions are present in a page based on the Message handle.
137  *      @param  pMsgData is Message handle. \n
138  *      @return MSG_SMIL_ERR_E \n
139  *      @retval MSG_SMIL_SUCCESS                                                Success in operation. \n
140  *      @retval MSG_SMIL_ERR_INVALID_REGION_INFO                Failure in operation. \n
141  */
142 MSG_SMIL_ERR_E _MsgMMSAddDefaultSecondSMILRegion(MMS_MESSAGE_DATA_S *pMsgData, bool bTextReg);
143
144 /**     @fn             MSG_SMIL_ERR_E _MsgMMSAddDefaultFullSMILRegion(MMS_MESSAGE_DATA_S *pMsgData)
145  *      @brief  Adds the default full Region information when only region is present in a page based on the Message handle.
146  *      @param  pMsgData is Message handle. \n
147  *      @return MSG_SMIL_ERR_E \n
148  *      @retval MSG_SMIL_SUCCESS                                                Success in operation. \n
149  *      @retval MSG_SMIL_ERR_INVALID_REGION_INFO                Failure in operation. \n
150  */
151 MSG_SMIL_ERR_E _MsgMMSAddDefaultFullSMILRegion(MMS_MESSAGE_DATA_S *pMsgData);
152
153 /**     @fn             MSG_SMIL_ERR_E _MsgMMSValidateSMILPage(MMS_MESSAGE_DATA_S *pMsgData, bool bRegAdded)
154  *      @brief  Validates the Page information present in 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_PAGE_INFO                  Failure in operation. \n
159  *      @retval MSG_SMIL_ERR_SIMILAR_MEDIA_EXISTS               Same Kind of Media Exists in SMIL page. \n
160  *      @retval MSG_SMIL_ERR_INVALID_REGION_INFO                Failure in operation. \n
161  */
162 MSG_SMIL_ERR_E _MsgMMSValidateSMILPage(MMS_MESSAGE_DATA_S *pMsgData, bool bRegAdded);
163
164 #endif //MMS_PLUGIN_SMIL_ENCODE_H