RSA sync with private
[platform/core/messaging/msg-service.git] / include / common / MsgMmsTypes.h
1 /*
2 * Copyright 2012  Samsung Electronics Co., Ltd
3 *
4 * Licensed under the Flora License, Version 1.0 (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://www.tizenopensource.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 }MMS_MEDIA_S;
106
107 /**
108  *      @brief  Represents attachment information.
109  */
110 typedef struct
111 {
112         MimeType        mediatype;      /**< Indicates the file mime type. see enum MimeType */
113         char            szFileName[MSG_FILENAME_LEN_MAX + 1]; /**< Indicates the file name */
114         char            szFilePath[MSG_FILEPATH_LEN_MAX + 1]; /**< Indicates the file path */
115         int             fileSize;        /**< Indicates the size of the file */
116         MsgDrmType      drmType; /**< Indicates the drm type. see enum MsgDrmType */
117         char            szDrm2FullPath[MSG_FILEPATH_LEN_MAX + 1]; /**< Indicates the fullpath of the DRM */
118 }MMS_ATTACH_S;
119
120 /**
121  *      @brief  Represents SMIL page information.
122  */
123 typedef struct
124 {
125         int             mediaCnt;       /**< The count of the media */
126         GList   *medialist;     /**< The pointer to media list */
127         int             nDur;   /**< Indicates the duration of the page */
128         int             nBegin; /**< Indicates the begin time of the page */
129         int             nEnd;    /**< Indicates the end time of the page */
130         int             nMin;   /**< Indicates the min attribute of the page */
131         int             nMax;   /**< Indicates the max attribute of the page */
132         int             nRepeat;        /**< Indicates the page needs to be displayed repeatedly */
133
134 }MMS_PAGE_S;
135
136 /**
137  *      @brief  Represents length information.
138  */
139 typedef struct
140 {
141         bool    bUnitPercent; /**< Indicates the length is in percentage(%) or not */
142         int     value;  /**< Indicates the value for length */
143 }MMS_LENGTH;
144
145 /**
146  *      @brief  Represents SMIL region information.
147  */
148 typedef struct
149 {
150         char                            szID[MAX_SMIL_REGION_ID + 1]; /**< Indicates the ID of region information */
151         MMS_LENGTH              nLeft; /**< Indicates the left co-ordinate of the region */
152         MMS_LENGTH              nTop; /**< Indicates the top co-ordinate of the region */
153         MMS_LENGTH              width; /**< Indicates the width of the region */
154         MMS_LENGTH              height; /**< Indicates the width of the region */ // '%' rate should be supported
155         int                             bgColor;        /**< Indicates the background color of the region */
156         REGION_FIT_TYPE_T       fit;    /**< Indicates the fit type. see enum REGION_FIT_TYPE_T */
157
158 }MMS_SMIL_REGION;
159
160 /**
161  *      @brief  Represents SMIL root layout information.
162  */
163 typedef struct
164 {
165         MMS_LENGTH      width;          /**< Indicates the width of the root layout */
166         MMS_LENGTH      height;         /**< Indicates the height of the root layout */ // '%' rate should be supported
167         int                     bgColor;                /**< Indicates the background color of the root layout */
168 }MMS_SMIL_ROOTLAYOUT;
169
170
171 /**
172  *      @brief  Represents SMIL transition information.
173  */
174 typedef struct
175 {
176         char                                    szID[MAX_SMIL_TRANSITION_ID + 1];       /**< Indicates the ID of transition information */
177         MmsSmilTransType                nType;                                  /**< Indicates the transition type. see enum MmsSmilTransType */
178         MmsSmilTransSubType     nSubType;                               /**< Indicates the transition sub type. see enum MmsSmilTransSubType */
179         int                                     nDur;                                   /**< Indicates the transition duration */
180 }MMS_SMIL_TRANSITION;
181
182
183 /**
184  *      @brief  Represents SMIL meta information.
185  */
186 typedef struct
187 {
188         char            szID[MAX_SMIL_META_ID + 1];                             /**< Indicates the ID of meta information */
189         char            szName[MAX_SMIL_META_NAME + 1];         /**< Indicates the Name */
190         char            szContent[MAX_SMIL_META_CONTENT + 1];   /**< Indicates the content */
191 }MMS_SMIL_META;
192
193
194 /**
195  *      @brief  Represents application id information for JAVA MMS msg.
196  */
197 typedef struct
198 {
199         bool                    valid;                                                                          /**< Indicates whether application id information is used or not. */
200         char                    appId[MAX_MMS_JAVA_APPID_LEN + 1];                      /**< application id, it should not exceed 32 chars */
201         char                    replyToAppId[MAX_MMS_JAVA_APPID_LEN + 1];       /**< reply to application id, application id, it should not exceeded 32 chars */
202 }MMS_APPID_INFO_S;
203
204
205
206 #define         MAX_FULL_PATH_SIZE_S    160     // max length for internal file path
207
208 typedef struct
209 {
210         char                                    szMsgID[MMS_MSG_ID_LEN + 1];
211         char                                    retrievedFilePath[MAX_FULL_PATH_SIZE_S + 1];
212         char                                    szTrID[MMS_TR_ID_LEN + 1];
213         MMS_APPID_INFO_S        msgAppId;
214 }MMS_RECV_DATA_S;
215
216
217 /**
218  *      @brief  Represents MMS message data.
219  */
220 typedef struct _MMS_MESSAGE_DATA_S
221 {
222         char                                    szSmilFilePath[MSG_FILEPATH_LEN_MAX + 1];       /**< Indicates the SMIL file path */
223         int                                             pageCnt;        /**< The count of the SMIL pages */
224         GList                                   *pagelist;      /**< The pointer to SMIL pages list */
225         int                                             regionCnt;      /**< The count of the SMIL regions */
226         GList                                   *regionlist;    /**< The pointer to SMIL regions list */
227         int                                             attachCnt;      /**< The count of the attachments */
228         GList                                   *attachlist;    /**< The pointer to attachment list */
229         int                                             transitionCnt;  /**< The count of the SMIL transitions information */
230         GList                                   *transitionlist;        /**< The pointer to SMIL transitions list */
231         int                                             metaCnt;        /**< The count of the SMIL meta information */
232         GList                                   *metalist;      /**< The pointer to SMIL meta list */
233         MMS_SMIL_ROOTLAYOUT             rootlayout;     /**< Indicates the root layout information */
234         MMS_APPID_INFO_S                msgAppId;
235 }MMS_MESSAGE_DATA_S;
236
237 /**
238  *      @}
239  */
240
241
242
243 #endif
244