Modify flora license version.
[platform/core/messaging/msg-service.git] / include / common / MsgMmsTypes.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 MSG_MMS_TYPES_H
18 #define MSG_MMS_TYPES_H
19
20 /**
21  *      @file           MsgMmsTypes.h
22  *      @brief          Defines MMS types of messaging framework
23  *      @version        1.0
24  */
25
26 /**
27  *      @section                Introduction
28  *      - Introduction : Overview on MMS message Types
29  *      @section                Program
30  *      - Program : MMS message Types Reference
31  */
32
33 /*==================================================================================================
34                                          INCLUDE FILES
35 ==================================================================================================*/
36 #include "MsgTypes.h"
37
38
39 #include <glib.h>
40
41
42 /**
43  *      @ingroup                MESSAGING_FRAMEWORK
44  *      @defgroup       MESSAGING_MMS_TYPES     Messaging MMS Types
45  *      @{
46  */
47
48
49 /*==================================================================================================
50                                          STRUCTURES
51 ==================================================================================================*/
52
53 /**
54  *      @brief  Represents text information.
55  */
56 typedef struct  {
57         char                    szTransInId[MAX_SMIL_TRANSIN_ID + 1];  /**< Indicates the In SMIL transition id */
58         char                    szTransOutId[MAX_SMIL_TRANSOUT_ID + 1]; /**< Indicates the Out SMIL transition id */
59         int                             nRepeat; /**< Indicates the text needs to be displayed repeatedly */
60         int                             nBegin;  /**< Indicates the begin time */
61         int                             nEnd;   /**< Indicates the end time */
62         int                             nDurTime; /**< Indicates the duration */
63         int                             nBgColor; /**< Indicates the background color of the text */
64         bool                    bBold;  /**< Indicates whether the text is bold */
65         bool                    bUnderLine; /**< Indicates whether the text is underlined */
66         bool                    bItalic;                /**< Indicates whether the text is Italic */
67         bool                    bReverse;       /**< Indicates whether the text is reversed */
68         MmsTextDirection        nDirection; /**< Indicates the text direction type. see enum MmsTextDirection */
69         int                             nSize;  /**< Indicates the font size */
70         int                             nColor; /**< Indicates the font color */
71 }MmsSmilText;
72
73 /**
74  *      @brief  Represents video information.
75  */
76 typedef struct {
77         char                    szTransInId[MAX_SMIL_TRANSIN_ID + 1]; /**< Indicates the In SMIL transition id */
78         char                    szTransOutId[MAX_SMIL_TRANSOUT_ID + 1];  /**< Indicates the Out SMIL transition id */
79         int                             nRepeat; /**< Indicates the video needs to be displayed repeatedly */
80         int                             nBegin;  /**< Indicates the begin time */
81         int                             nEnd;   /**< Indicates the end time */
82         int                             nDurTime;  /**< Indicates the duration */
83         int                             nBgColor;  /**< Indicates the background color of the text */
84 }MmsSmilAVI;
85
86 /**
87  *      @brief  Represents media information.
88  */
89 typedef struct
90 {
91         MmsSmilMediaType        mediatype; /**< Indicates the SMIL media type. see enum MmsSmilMediaType */
92
93         char                    szSrc[MSG_FILEPATH_LEN_MAX + 1];/**< Indicates the media source name */
94         char                    szFileName[MSG_FILENAME_LEN_MAX + 1]; /**< Indicates the file name */
95         char                    szFilePath[MSG_FILEPATH_LEN_MAX + 1]; /**< Indicates the file path */
96         char                    szContentID[MSG_MSG_ID_LEN + 1]; /**< Indicates the content id */
97         char                    regionId[MAX_SMIL_REGION_ID + 1]; /**< Indicates the region id */
98         char                    szAlt[MAX_SMIL_ALT_LEN + 1]; /**< Indicates the alternative text to be displayed in failure case */
99         MsgDrmType              drmType; /**< Indicates the drm type. see enum MsgDrmType */
100         char                    szDrm2FullPath[MSG_FILEPATH_LEN_MAX + 1];  /**< Indicates the fullpath of the DRM */
101         union{
102                 MmsSmilText     sText;  /**< Indicates the text attributes */
103                 MmsSmilAVI      sAVI; /**< Indicates the video attributes */
104         } sMedia;
105
106         char szContentType[MSG_MSG_ID_LEN + 1];
107         char szContentLocation[MSG_MSG_ID_LEN + 1];
108
109 }MMS_MEDIA_S;
110
111 /**
112  *      @brief  Represents attachment information.
113  */
114 typedef struct
115 {
116         MimeType        mediatype;      /**< Indicates the file mime type. see enum MimeType */
117         char            szFileName[MSG_FILENAME_LEN_MAX + 1]; /**< Indicates the file name */
118         char            szFilePath[MSG_FILEPATH_LEN_MAX + 1]; /**< Indicates the file path */
119         int             fileSize;        /**< Indicates the size of the file */
120         MsgDrmType      drmType; /**< Indicates the drm type. see enum MsgDrmType */
121         char            szDrm2FullPath[MSG_FILEPATH_LEN_MAX + 1]; /**< Indicates the fullpath of the DRM */
122         char szContentType[MSG_MSG_ID_LEN + 1];
123
124 }MMS_ATTACH_S;
125
126 /**
127  *      @brief  Represents SMIL page information.
128  */
129 typedef struct
130 {
131         int             mediaCnt;       /**< The count of the media */
132         GList   *medialist;     /**< The pointer to media list */
133         int             nDur;   /**< Indicates the duration of the page */
134         int             nBegin; /**< Indicates the begin time of the page */
135         int             nEnd;    /**< Indicates the end time of the page */
136         int             nMin;   /**< Indicates the min attribute of the page */
137         int             nMax;   /**< Indicates the max attribute of the page */
138         int             nRepeat;        /**< Indicates the page needs to be displayed repeatedly */
139
140 }MMS_PAGE_S;
141
142 /**
143  *      @brief  Represents length information.
144  */
145 typedef struct
146 {
147         bool    bUnitPercent; /**< Indicates the length is in percentage(%) or not */
148         int     value;  /**< Indicates the value for length */
149 }MMS_LENGTH;
150
151 /**
152  *      @brief  Represents SMIL region information.
153  */
154 typedef struct
155 {
156         char                            szID[MAX_SMIL_REGION_ID + 1]; /**< Indicates the ID of region information */
157         MMS_LENGTH              nLeft; /**< Indicates the left co-ordinate of the region */
158         MMS_LENGTH              nTop; /**< Indicates the top co-ordinate of the region */
159         MMS_LENGTH              width; /**< Indicates the width of the region */
160         MMS_LENGTH              height; /**< Indicates the width of the region */ // '%' rate should be supported
161         bool                    bBgColor;       /**< Indicates the background color set in the region */
162         int                             bgColor;        /**< Indicates the background color of the region */
163         REGION_FIT_TYPE_T       fit;    /**< Indicates the fit type. see enum REGION_FIT_TYPE_T */
164
165 }MMS_SMIL_REGION;
166
167 /**
168  *      @brief  Represents SMIL root layout information.
169  */
170 typedef struct
171 {
172         MMS_LENGTH      width;          /**< Indicates the width of the root layout */
173         MMS_LENGTH      height;         /**< Indicates the height of the root layout */ // '%' rate should be supported
174         bool            bBgColor;       /**< Indicates the background color set in the root layout */
175         int                     bgColor;                /**< Indicates the background color of the root layout */
176 }MMS_SMIL_ROOTLAYOUT;
177
178
179 /**
180  *      @brief  Represents SMIL transition information.
181  */
182 typedef struct
183 {
184         char                                    szID[MAX_SMIL_TRANSITION_ID + 1];       /**< Indicates the ID of transition information */
185         MmsSmilTransType                nType;                                  /**< Indicates the transition type. see enum MmsSmilTransType */
186         MmsSmilTransSubType     nSubType;                               /**< Indicates the transition sub type. see enum MmsSmilTransSubType */
187         int                                     nDur;                                   /**< Indicates the transition duration */
188 }MMS_SMIL_TRANSITION;
189
190
191 /**
192  *      @brief  Represents SMIL meta information.
193  */
194 typedef struct
195 {
196         char            szID[MAX_SMIL_META_ID + 1];                             /**< Indicates the ID of meta information */
197         char            szName[MAX_SMIL_META_NAME + 1];         /**< Indicates the Name */
198         char            szContent[MAX_SMIL_META_CONTENT + 1];   /**< Indicates the content */
199 }MMS_SMIL_META;
200
201
202 /**
203  *      @brief  Represents application id information for JAVA MMS msg.
204  */
205 typedef struct
206 {
207         bool                    valid;                                                                          /**< Indicates whether application id information is used or not. */
208         char                    appId[MAX_MMS_JAVA_APPID_LEN + 1];                      /**< application id, it should not exceed 32 chars */
209         char                    replyToAppId[MAX_MMS_JAVA_APPID_LEN + 1];       /**< reply to application id, application id, it should not exceeded 32 chars */
210 }MMS_APPID_INFO_S;
211
212
213
214 #define         MAX_FULL_PATH_SIZE_S    160     // max length for internal file path
215
216 typedef struct
217 {
218         char                                    szMsgID[MMS_MSG_ID_LEN + 1];
219         char                                    retrievedFilePath[MAX_FULL_PATH_SIZE_S + 1];
220         char                                    szTrID[MMS_TR_ID_LEN + 1];
221         MMS_APPID_INFO_S        msgAppId;
222 }MMS_RECV_DATA_S;
223
224 typedef struct _MMS_HEADER_DATA_S
225 {
226         char messageID[MSG_MSG_ID_LEN + 1];
227         char trID[MSG_MSG_ID_LEN + 1];
228         char contentLocation[MSG_MSG_ID_LEN + 1];
229         char szContentType[MSG_MSG_ID_LEN + 1];//string : ex) application/vnd.wap.multipart.related
230         int contentType;//MimeType : ex) application/vnd.wap.multipart.related
231         int messageType;//MmsMsgType : ex) sendreq
232         int mmsVersion;//1.0 1.3
233         int messageClass;//Personal | Advertisement | Informational | Auto
234         int contentClass;//text | image-basic| image-rich | video-basic | video-rich | megapixel | content-basic | content-rich
235         int mmsPriority;//_MSG_PRIORITY_TYPE_E : Low | Normal | High
236 } MMS_HEADER_DATA_S;
237
238 typedef struct
239 {
240         MimeType        type;   /**< Indicates the multipart mime type. see enum MimeType */
241         char            szContentType[MSG_MSG_ID_LEN + 1];              /**< Indicates the content type */
242         char            szFileName[MSG_FILENAME_LEN_MAX + 1];           /**< Indicates the file name */
243         char            szFilePath[MSG_FILEPATH_LEN_MAX + 1];           /**< Indicates the file path */
244         char            szContentID[MSG_MSG_ID_LEN + 1];                /**< Indicates the content id */
245         char            szContentLocation[MSG_MSG_ID_LEN + 1];  /**< Indicates the content Location */
246 } MMS_MULTIPART_DATA_S;
247
248 /**
249  *      @brief  Represents MMS message data.
250  */
251 typedef struct _MMS_MESSAGE_DATA_S
252 {
253         int                                     backup_type; //normal = 0|| backup = 1;
254         char                                    szSmilFilePath[MSG_FILEPATH_LEN_MAX + 1];       /**< Indicates the SMIL file path */
255         int                                             pageCnt;        /**< The count of the SMIL pages */
256         GList                                   *pagelist;      /**< The pointer to SMIL pages list */
257         int                                             regionCnt;      /**< The count of the SMIL regions */
258         GList                                   *regionlist;    /**< The pointer to SMIL regions list */
259         int                                             attachCnt;      /**< The count of the attachments */
260         GList                                   *attachlist;    /**< The pointer to attachment list */
261         int                                             transitionCnt;  /**< The count of the SMIL transitions information */
262         GList                                   *transitionlist;        /**< The pointer to SMIL transitions list */
263         int                                             metaCnt;        /**< The count of the SMIL meta information */
264         GList                                   *metalist;      /**< The pointer to SMIL meta list */
265         MMS_SMIL_ROOTLAYOUT             rootlayout;     /**< Indicates the root layout information */
266         MMS_APPID_INFO_S                msgAppId;
267         MMS_HEADER_DATA_S header;
268         MMS_MULTIPART_DATA_S smil;
269 } MMS_MESSAGE_DATA_S;
270
271 #endif