5c5dda59a9e07161614611adaa7411712b5d1ca2
[platform/core/messaging/msg-service.git] / include / common / MsgInternalTypes.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_INTERNAL_TYPES_H
18 #define MSG_INTERNAL_TYPES_H
19
20 /**
21  *      @file           MsgInternalTypes.h
22  *      @brief          Defines types of messaging framework
23  *      @version        1.0
24  */
25
26 /*==================================================================================================
27                                          INCLUDE FILES
28 ==================================================================================================*/
29 #include "MsgMmsTypes.h"
30
31
32 /*==================================================================================================
33                                     DEFINES
34 ==================================================================================================*/
35 #define MSG_DATA_ROOT_PATH              "/opt/usr/data/msg-service/"
36 #define MSG_DATA_PATH                           MSG_DATA_ROOT_PATH"msgdata/"
37 #define MSG_SMIL_FILE_PATH              MSG_DATA_ROOT_PATH"smildata/"
38 #define MSG_IPC_DATA_PATH                       MSG_DATA_ROOT_PATH"ipcdata/"
39 #define MSG_THUMBNAIL_PATH              MSG_DATA_PATH"thumbnails/"
40 #define MAX_FULL_PATH_SIZE              320     // max length for internal file path
41 #define VALID_ADDRESS_LEN               8
42 #define MAX_PRECONFIG_NUM               8
43 #define MAX_THREAD_ADDR_LEN     40
44 #define MAX_THREAD_NAME_LEN     195
45 #define MAX_THREAD_DATA_LEN     128
46 #define MAX_CB_MSG_TEXT_LEN     4200    // 1page max char(93)*max page(15)*max bytes of UTF8 1 char(3)
47 #define MAX_CB_MSG_LANGUAGE_TYPE_LEN    3
48 #define MAX_ETWS_WARNING_SECURITY_INFO_LEN      50
49
50 #define SMS_MINIMUM_SPACE       (3 * 1024)
51 #define MMS_MINIMUM_SPACE       (600 * 1024)
52
53 /*vconf keys*/
54 #define MSG_SIM_IMSI                    "memory/private/msg-service/sim_imsi"
55 #define MSG_SIM_CHANGED "memory/private/msg-service/sim_changed"
56
57
58 #define DEFAULT_SETTING_PATH                            "db/private/msg-service"
59
60 #define DEFAULT_GENERAL_OPT_PATH                DEFAULT_SETTING_PATH"/general"
61 #define DEFAULT_SMS_SEND_OPT_PATH       DEFAULT_SETTING_PATH"/sms_send"
62 #define DEFAULT_SMSC_INFO_PATH                  DEFAULT_SETTING_PATH"/smsc"
63 #define DEFAULT_MMS_SEND_OPT_PATH       DEFAULT_SETTING_PATH"/mms_send"
64 #define DEFAULT_MMS_RECV_OPT_PATH       DEFAULT_SETTING_PATH"/mms_recv"
65 #define DEFAULT_MMS_STYLE_OPT_PATH      DEFAULT_SETTING_PATH"/mms_style"
66 #define DEFAULT_PUSH_MSG_OPT_PATH       DEFAULT_SETTING_PATH"/push_msg"
67 #define DEFAULT_CB_MSG_OPT_PATH         DEFAULT_SETTING_PATH"/cb_msg"
68 #define DEFAULT_VOICE_MAIL_OPT_PATH     DEFAULT_SETTING_PATH"/voice_mail"
69 #define DEFAULT_MSGSIZE_OPT_PATH                DEFAULT_SETTING_PATH"/size_opt"
70 #define DEFAULT_SIM_COUNT_PATH                  DEFAULT_SETTING_PATH"/sim_count"
71
72 #define MSG_KEEP_COPY                           DEFAULT_GENERAL_OPT_PATH"/keep_copy"
73 #define MSG_ALERT_TONE                          VCONFKEY_SETAPPL_NOTI_MSG_ALERT_REP_TYPE_INT
74 #define MSG_AUTO_ERASE                          DEFAULT_GENERAL_OPT_PATH"/auto_erase"
75 #define MSG_BLOCK_MESSAGE               DEFAULT_GENERAL_OPT_PATH"/block_msg"
76 #define CONTACT_SYNC_TIME               DEFAULT_GENERAL_OPT_PATH"/contact_sync_time"
77
78 #define SMS_SEND_DCS                                                    DEFAULT_SMS_SEND_OPT_PATH"/dcs"
79 #define SMS_SEND_NETWORK_MODE   VCONFKEY_MESSAGE_NETWORK_MODE
80 #define SMS_SEND_REPLY_PATH                     DEFAULT_SMS_SEND_OPT_PATH"/reply_path"
81 #define SMS_SEND_DELIVERY_REPORT        DEFAULT_SMS_SEND_OPT_PATH"/delivery_report"
82 #define SMS_SEND_SAVE_STORAGE           DEFAULT_SMS_SEND_OPT_PATH"/save_storage"
83
84 #define SMSC_TOTAL_COUNT                DEFAULT_SMSC_INFO_PATH"/total_count"
85 #define SMSC_SELECTED                   DEFAULT_SMSC_INFO_PATH"/selected"
86 #define SMSC_PID                                                DEFAULT_SMSC_INFO_PATH"/pid"
87 #define SMSC_VAL_PERIOD         DEFAULT_SMSC_INFO_PATH"/val_period"
88 #define SMSC_NAME                                       DEFAULT_SMSC_INFO_PATH"/name"
89 #define SMSC_TON                                                DEFAULT_SMSC_INFO_PATH"/ton"
90 #define SMSC_NPI                                                DEFAULT_SMSC_INFO_PATH"/npi"
91 #define SMSC_ADDRESS                            DEFAULT_SMSC_INFO_PATH"/address"
92
93 #define MMS_SEND_MSG_CLASS                                                      DEFAULT_MMS_SEND_OPT_PATH"/msg_class"
94 #define MMS_SEND_PRIORITY                                                               DEFAULT_MMS_SEND_OPT_PATH"/priority"
95 #define MMS_SEND_EXPIRY_TIME                                                    DEFAULT_MMS_SEND_OPT_PATH"/expiry_time"
96 #define MMS_SEND_CUSTOM_DELIVERY                                DEFAULT_MMS_SEND_OPT_PATH"/custom_delivery"
97 #define MMS_SEND_DELIVERY_TIME                                          DEFAULT_MMS_SEND_OPT_PATH"/delivery_time"
98 #define MMS_SEND_SENDER_VISIBILITY                              DEFAULT_MMS_SEND_OPT_PATH"/sender_visibility"
99 #define MMS_SEND_DELIVERY_REPORT                                        DEFAULT_MMS_SEND_OPT_PATH"/delivery_report"
100 #define MMS_SEND_READ_REPLY                                                     DEFAULT_MMS_SEND_OPT_PATH"/read_reply"
101 #define MMS_SEND_KEEP_COPY                                                      DEFAULT_MMS_SEND_OPT_PATH"/keep_copy"
102 #define MMS_SEND_BODY_REPLYING                                          DEFAULT_MMS_SEND_OPT_PATH"/body_replying"
103 #define MMS_SEND_HIDE_RECIPIENTS                                        DEFAULT_MMS_SEND_OPT_PATH"/hide_recipients"
104 #define MMS_SEND_REPORT_ALLOWED                         DEFAULT_MMS_SEND_OPT_PATH"/report_allowed"
105 #define MMS_SEND_REPLY_CHARGING                                 DEFAULT_MMS_SEND_OPT_PATH"/reply_charging"
106 #define MMS_SEND_REPLY_CHARGING_DEADLINE        DEFAULT_MMS_SEND_OPT_PATH"/reply_charging_deadline"
107 #define MMS_SEND_REPLY_CHARGING_SIZE                    DEFAULT_MMS_SEND_OPT_PATH"/reply_charging_size"
108 #define MMS_SEND_CREATION_MODE                                  DEFAULT_MMS_SEND_OPT_PATH"/creation_mode"
109
110 #define MMS_RECV_HOME_NETWORK           DEFAULT_MMS_RECV_OPT_PATH"/home_network"
111 #define MMS_RECV_ABROAD_NETWORK DEFAULT_MMS_RECV_OPT_PATH"/abroad_network"
112 #define MMS_RECV_READ_RECEIPT                   DEFAULT_MMS_RECV_OPT_PATH"/read_receipt"
113 #define MMS_RECV_DELIVERY_RECEIPT       DEFAULT_MMS_RECV_OPT_PATH"/delivery_receipt"
114 #define MMS_RECV_REJECT_UNKNOWN         DEFAULT_MMS_RECV_OPT_PATH"/reject_unknown"
115 #define MMS_RECV_REJECT_ADVERTISE       DEFAULT_MMS_RECV_OPT_PATH"/reject_advertisement"
116
117 #define MMS_STYLE_FONT_SIZE                                                     DEFAULT_MMS_STYLE_OPT_PATH"/font_size"
118 #define MMS_STYLE_FONT_STYLE_BOLD                       DEFAULT_MMS_STYLE_OPT_PATH"/font_style/bold"
119 #define MMS_STYLE_FONT_STYLE_ITALIC                     DEFAULT_MMS_STYLE_OPT_PATH"/font_style/italic"
120 #define MMS_STYLE_FONT_STYLE_UNDERLINE  DEFAULT_MMS_STYLE_OPT_PATH"/font_style/underline"
121 #define MMS_STYLE_FONT_COLOR_RED                        DEFAULT_MMS_STYLE_OPT_PATH"/font_color/red"
122 #define MMS_STYLE_FONT_COLOR_GREEN              DEFAULT_MMS_STYLE_OPT_PATH"/font_color/green"
123 #define MMS_STYLE_FONT_COLOR_BLUE                       DEFAULT_MMS_STYLE_OPT_PATH"/font_color/blue"
124 #define MMS_STYLE_FONT_COLOR_HUE                        DEFAULT_MMS_STYLE_OPT_PATH"/font_color/hue"
125 #define MMS_STYLE_BG_COLOR_RED                          DEFAULT_MMS_STYLE_OPT_PATH"/bg_color/red"
126 #define MMS_STYLE_BG_COLOR_GREEN                        DEFAULT_MMS_STYLE_OPT_PATH"/bg_color/green"
127 #define MMS_STYLE_BG_COLOR_BLUE                         DEFAULT_MMS_STYLE_OPT_PATH"/bg_color/blue"
128 #define MMS_STYLE_BG_COLOR_HUE                          DEFAULT_MMS_STYLE_OPT_PATH"/bg_color/hue"
129 #define MMS_STYLE_PAGE_DUR                                                      DEFAULT_MMS_STYLE_OPT_PATH"/page_dur"
130 #define MMS_STYLE_PAGE_CUSTOM_DUR                       DEFAULT_MMS_STYLE_OPT_PATH"/page_custom_dur"
131 #define MMS_STYLE_PAGE_DUR_MANUAL                       DEFAULT_MMS_STYLE_OPT_PATH"/page_dur_manual"
132
133 #define PUSH_RECV_OPTION                                DEFAULT_PUSH_MSG_OPT_PATH"/recv_option"
134 #define PUSH_SERVICE_TYPE                               DEFAULT_PUSH_MSG_OPT_PATH"/service_load"
135
136 #define CB_RECEIVE                                              DEFAULT_CB_MSG_OPT_PATH"/receive"
137 #define CB_SAVE                                         DEFAULT_CB_MSG_OPT_PATH"/save"
138 #define CB_MAX_SIM_COUNT                        DEFAULT_CB_MSG_OPT_PATH"/max_sim_count"
139 #define CB_CHANNEL_COUNT                        DEFAULT_CB_MSG_OPT_PATH"/channel_count"
140 #define CB_CHANNEL_ACTIVATE             DEFAULT_CB_MSG_OPT_PATH"/channel_activate"
141 #define CB_CHANNEL_ID_FROM              DEFAULT_CB_MSG_OPT_PATH"/channel_id_from"
142 #define CB_CHANNEL_ID_TO                DEFAULT_CB_MSG_OPT_PATH"/channel_id_to"
143 #define CB_CHANNEL_NAME                 DEFAULT_CB_MSG_OPT_PATH"/channel_name"
144 #define CB_LANGUAGE                                     DEFAULT_CB_MSG_OPT_PATH"/language"
145
146 #define VOICEMAIL_NUMBER                                DEFAULT_VOICE_MAIL_OPT_PATH"/voice_mail_number"
147 #define VOICEMAIL_COUNT                         DEFAULT_VOICE_MAIL_OPT_PATH"/voice_mail_count"
148
149 #define MSGSIZE_OPTION                                  DEFAULT_MSGSIZE_OPT_PATH"/msg_size"
150
151 #define SIM_USED_COUNT                                  DEFAULT_SIM_COUNT_PATH"/used_cnt"
152 #define SIM_TOTAL_COUNT                         DEFAULT_SIM_COUNT_PATH"/total_cnt"
153
154
155 /*==================================================================================================
156                                          TYPES
157 ==================================================================================================*/
158
159 /**
160  *      @brief  Represents a message main type. \n
161  *      The values for this type SHOULD be in _MSG_MAIN_TYPE_E.
162  */
163 typedef unsigned char MSG_MAIN_TYPE_T;
164
165
166 /**
167  *      @brief  Represents a message sub type. \n
168  *      Each main type of a message can be divided into some sub types. \n
169  *      For instance of SMS, the message sub type can be one of the NORMAL, WAPPUSH, CB and so on. \n
170  *      The values for this type SHOULD be in _MSG_SUB_TYPE_E.
171  */
172 typedef unsigned char MSG_SUB_TYPE_T;
173
174
175 /**
176  *      @brief  Represents a message class. \n
177  *      The values for this type SHOULD be in _MSG_CLASS_TYPE_E.
178  */
179 typedef unsigned char MSG_CLASS_TYPE_T;
180
181
182 /**
183  *      @brief  Represents a message class. \n
184  *      The values for this type SHOULD be in _MSG_MMS_TRANSACTION_TYPE_E.
185  */
186 typedef unsigned char MSG_MMS_TRANSACTION_TYPE_T;
187
188
189 /*==================================================================================================
190                                          STRUCTURES
191 ==================================================================================================*/
192
193 /**
194  *      @brief  Represents a message type.
195  */
196 typedef struct
197 {
198         MSG_MAIN_TYPE_T         mainType;       /**< Message main type. See enum _MSG_MAIN_TYPE_E */
199         MSG_SUB_TYPE_T          subType;        /**< Message sub type. See enum _MSG_SUB_TYPE_E */
200         MSG_CLASS_TYPE_T        classType;      /**< Message class type. See enum _MSG_CLASS_TYPE_E */
201 } MSG_MESSAGE_TYPE_S;
202
203
204 /**
205  *      @brief  Represents a message in the framework.
206  */
207 typedef struct
208 {
209         msg_message_id_t                msgId;                                                                                  /**< Indicates the message ID of this message. */
210         msg_thread_id_t                 threadId;                                                                               /**< Indicates the thread ID. */
211         msg_folder_id_t                 folderId;                                                                               /**< Indicates the folder ID. */
212         MSG_MESSAGE_TYPE_S              msgType;                                                                                /**< Indicates the message type such as SMS and MMS */
213         msg_storage_id_t                storageId;                                                                              /**< Indicates where the message is saved. */
214         int                                             nAddressCnt;                                                                    /**< Indicates the count of addresses. */
215         MSG_ADDRESS_INFO_S              addressList[MAX_TO_ADDRESS_CNT];                                /**< Indicates the address information list. */
216         char                                    replyAddress[MAX_PHONE_NUMBER_LEN+1];   /**< Indicates the reply address. */
217         char                                    subject[MAX_SUBJECT_LEN+1];                                             /**< Indicates the message subject. */
218         time_t                                  displayTime;                                                                                                    /**< Indicates the display time related to the specific operation. */
219         msg_network_status_t    networkStatus;                                                                                                  /**< Indicates the network status of the message. */
220         msg_encode_type_t               encodeType;                                                                                                     /**< Indicates the string encoding type. */
221         bool                                    bRead;                                                                                                                          /**< Indicates whether the message is read or not. */
222         bool                                    bProtected;                                                                                                             /**< Indicates whether the message is protected or not. */
223         bool                                    bBackup;                                                                                                                        /**< Indicates whether the message was restored from PC. */
224         msg_priority_type_t             priority;                                                                                                                       /**< Indicates the priority of the message. */
225         msg_direction_type_t    direction;                                                                                                                      /**< Indicates whether the message is MO or MT (affecting address). */
226         MSG_PORT_INFO_S                 msgPort;                                                                                                                        /**< Indicates the port number information. */
227         bool                                            bTextSms;                                                                                                               /**< Indicates whether the message is just a text message or not. */
228         size_t                                  dataSize;                                                                                                                       /**< Indicates the data size. The unit is byte. */
229         char                                    msgData[MAX_MSG_DATA_LEN+1];                                    /**< Indicates the message payload information as a body. */
230         char                                    msgText[MAX_MSG_TEXT_LEN+1];
231         char                                                                            thumbPath[MSG_FILEPATH_LEN_MAX];
232         bool                                    bStore;
233 } MSG_MESSAGE_INFO_S;
234
235 typedef struct
236 {
237         msg_message_id_t                msgId;                                                                  /**< Indicates the message ID of this message. */
238         msg_thread_id_t                 threadId;                                                               /**< Indicates the thread ID. */
239         msg_folder_id_t                 folderId;                                                               /**< Indicates the folder ID. see enum _MSG_FOLDER_TYPE_E */
240         MSG_MAIN_TYPE_T                 mainType;                                                               /**< Message main type. See enum _MSG_MAIN_TYPE_E */
241         MSG_SUB_TYPE_T                  subType;                                                                /**< Message sub type. See enum _MSG_SUB_TYPE_E */
242         MSG_CLASS_TYPE_T                classType;                                                              /**< Message class type. See enum _MSG_CLASS_TYPE_E */
243         msg_storage_id_t                storageId;                                                              /**< Indicates where the message is saved. see enum _MSG_FOLDER_TYPE_E*/
244         msg_struct_list_s               *addr_list;
245         char                                    replyAddress[MAX_PHONE_NUMBER_LEN+1];   /**< Indicates the reply address. */
246         char                                    subject[MAX_SUBJECT_LEN+1];                             /**< Indicates the message subject. */
247         time_t                                  displayTime;                                                    /**< Indicates the display time related to the specific operation. */
248         msg_network_status_t    networkStatus;                                                  /**< Indicates the network status of the message. */
249         msg_encode_type_t               encodeType;                                                             /**< Indicates the string encoding type. */
250         bool                                    bRead;                                                                  /**< Indicates whether the message is read or not. */
251         bool                                    bProtected;                                                             /**< Indicates whether the message is protected or not. */
252         bool                                    bBackup;                                                                /**< Indicates whether the message was restored from PC. */
253         msg_priority_type_t             priority;                                                               /**< Indicates the priority of the message. */
254         msg_direction_type_t    direction;                                                              /**< Indicates whether the message is MO or MT, affecting address. */
255         bool                                    bPortValid;                                                                     /**< Indicates whether port information is used or not. */
256         unsigned short                  dstPort;                                                                /**< Recipient port number, not greater than 16 bit */
257         unsigned short                  srcPort;                                                                /**< Sender port number, not greater than 16 bit */
258         int                                             attachCount;                                                    /**< Indicates the count of attached files in mms. */
259         char                                    thumbPath[MSG_FILEPATH_LEN_MAX+1];
260         size_t                                  dataSize;                                                               /**< Indicates the data size. The unit is byte. */
261         void                                    *pData;                                                                 /**< Indicates the message payload information as a body. default character encoding is UTF-8*/
262         void                                    *pMmsData;                                                              /**< Indicates the message payload information as a body. default character encoding is UTF-8*/
263 } MSG_MESSAGE_HIDDEN_S;
264
265 /**
266  *      @brief  Represents message information for thread view.
267  */
268 typedef struct
269 {
270         msg_thread_id_t                 threadId;                                                                                                                       /**< Indicates the thread ID of this peer. */
271         char                                    threadName[MAX_THREAD_NAME_LEN+1];              /**< Indicates the name of this peer. > */
272         MSG_MAIN_TYPE_T                 mainType;                                                               /**< Indicates the latest msg main type. */
273         MSG_SUB_TYPE_T                  subType;                                                                /**< Indicates the latest msg sub type. */
274         char                                    threadData[MAX_THREAD_DATA_LEN+1];              /**< Indicates the latest msg data. */
275         time_t                                  threadTime;                                                                                                             /**< Indicates the latest msg time. */
276         msg_direction_type_t    direction;                                                                                                                      /**< Indicates whether the message is MO or MT (affecting address). */
277         int                                             unreadCnt;                                                                                                              /**< Indicates the unread messages from the Peer. */
278         int                                             smsCnt;                                                                                                                 /**< Indicates the SMS messages from the Peer. */
279         int                                             mmsCnt;                                                                                                                 /**< Indicates the MMS messages from the Peer. */
280         bool                                    bProtected;                                                                                                             /**< Indicates whether the thread includes protected messages.  */
281 } MSG_THREAD_VIEW_S;
282
283
284 /**
285  *      @brief  Represents message information for conversation view.
286  */
287 typedef struct
288 {
289         msg_message_id_t                        msgId;                                                                  /**< Indicates the message ID of this message. */
290         msg_thread_id_t                 threadId;                                                               /**< Indicates the thread ID of this peer. */
291         MSG_MAIN_TYPE_T                 mainType;                                                       /**< Message main type. See enum _MSG_MAIN_TYPE_E */
292         MSG_SUB_TYPE_T                  subType;                                                                /**< Message sub type. See enum _MSG_SUB_TYPE_E */
293         msg_folder_id_t                 folderId;                                                               /**< Indicates the folder ID. see enum _MSG_FOLDER_TYPE_E */
294         msg_storage_id_t                                storageId;                                                              /**< Indicates where the message is saved. see enum _MSG_FOLDER_TYPE_E*/
295         time_t                                                          displayTime;                                            /**< Indicates the display time related to the specific operation. */
296         time_t                                                          scheduledTime;                                  /**< Indicates the time to send scheduled message. */
297         msg_network_status_t            networkStatus;                                          /**< Indicates the network status of the message. */
298         bool                                                                    bRead;                                                                  /**< Indicates whether the message is read or not. */
299         bool                                                                    bProtected;                                                     /**< Indicates whether the message is protected or not. */
300         msg_direction_type_t            direction;                                                              /**< Indicates whether the message is MO or MT, affecting address. */
301         int                                                                     pageCount;                                              /**< Indicates the count of pageCount in mms. */
302         int                                                                     attachCount;                                            /**< Indicates the count of attached files in mms. */
303         char                                                                    attachFileName[MSG_FILENAME_LEN_MAX+1]; /**< Indicates the thumbnail path. */
304         char                                                                    audioFileName[MSG_FILENAME_LEN_MAX+1];  /**< Indicates the thumbnail path. */
305         char                                                                    imageThumbPath[MSG_FILEPATH_LEN_MAX+1]; /**< Indicates the thumbnail path. */
306         char                                                                    videoThumbPath[MSG_FILEPATH_LEN_MAX+1];         /**< Indicates the thumbnail path. */
307         char                                                                    subject[MAX_SUBJECT_LEN+1];                                                     /**< Indicates the message subject. */
308         size_t                                                          textSize;                                                               /**< Indicates the data size. The unit is byte. */
309         char                                                                    *pText;                                                                 /**< Indicates the message payload information as a body. default character encoding is UTF-8*/
310 } MSG_CONVERSATION_VIEW_S;
311
312
313 /**
314  *      @brief  Represents sim message informatioin list.
315  */
316 typedef struct
317 {
318         int nIdxCnt;            /**< The count of sim index */
319         int nMsgCnt;            /**< The count of sim message */
320         MSG_MESSAGE_INFO_S              *simMsgInfo;            /**< The pointer to sim message informatioin */
321 } MSG_SIM_MSG_INFO_LIST_S;
322
323
324 /**
325  *      @brief  Represents a request in the framework. \n
326  *      Applications compose a request and send it to the framework via Message handle. \n
327  *      This request ID is used to manage the request by the framework.
328  */
329 typedef struct
330 {
331         msg_request_id_t                reqId;          /**< Indicates the request ID, which is unique.
332                                                                                 When applications submit a request to the framework, this value will be set by the framework. */
333         MSG_MESSAGE_INFO_S              msgInfo;        /**< Indicates the message structure to be sent by applications. */
334         MSG_SENDINGOPT_INFO_S   sendOptInfo;
335 } MSG_REQUEST_INFO_S;
336
337
338 /**
339  *      @brief  Represents proxy information. \n
340  *      This stucture contains the information about the status cnf of a sent message.
341  */
342 typedef struct
343 {
344         int                                             listenerFd;             /**< Rx fd for status cnf */
345         unsigned int                    handleAddr;             /**< Handle address for status cnf */
346         msg_message_id_t                sentMsgId;              /**< The ID of a sent message for updating message status */
347 } MSG_PROXY_INFO_S;
348
349
350 /**
351  *      @brief  Aux data structure for MSG_CMD_REG_INCOMING_MSG_CB. \n
352  *      This stucture contains the information about the receiver for msgType and port.
353  */
354 typedef struct
355 {
356         int                             listenerFd;
357         MSG_MAIN_TYPE_T         msgType;
358         unsigned short          port;
359 } MSG_CMD_REG_INCOMING_MSG_CB_S;
360
361 typedef struct
362 {
363         int                             listenerFd;
364         MSG_MAIN_TYPE_T         msgType;
365         bool                            bsave;
366 } MSG_CMD_REG_CB_INCOMING_MSG_CB_S;
367
368
369 /**
370  *      @brief  Aux data structure for MSG_CMD_REG_INCOMING_MMS_CONF_MSG_CB. \n
371  *      This stucture contains the information about the receiver for msgType and port.
372  */
373 typedef struct
374 {
375         int                             listenerFd;
376         MSG_MAIN_TYPE_T         msgType;
377         char appId[MAX_MMS_JAVA_APPID_LEN+1];
378 } MSG_CMD_REG_INCOMING_MMS_CONF_MSG_CB_S;
379
380
381 /**
382  *      @brief  Aux data structure for MSG_CMD_REG_INCOMING_SYNCML_MSG_CB. \n
383  *      This stucture contains the information about the receiver for msgType and port.
384  */
385 typedef struct
386 {
387         int                             listenerFd;
388         MSG_MAIN_TYPE_T         msgType;
389 } MSG_CMD_REG_INCOMING_SYNCML_MSG_CB_S;
390
391
392 /**
393  *      @brief  Aux data structure for MSG_CMD_REG_INCOMING_LBS_MSG_CB_S. \n
394  *      This stucture contains the information about the receiver for msgType and port.
395  */
396 typedef struct
397 {
398         int                             listenerFd;
399         MSG_MAIN_TYPE_T         msgType;
400 } MSG_CMD_REG_INCOMING_LBS_MSG_CB_S;
401
402
403 /**
404  *      @brief  Aux data structure for MSG_CMD_REG_INCOMING_JAVAMMS_TRID_S. \n
405  *      This stucture contains the information about the sent Java MMS messge transactionId.
406  */
407 typedef struct
408 {
409         bool                    posted;
410         char                    id[MMS_TR_ID_LEN+1];
411         char                            pduFileName[MAX_COMMON_INFO_SIZE+1];
412 } MSG_CMD_REG_INCOMING_JAVAMMS_TRID_S;
413
414
415 /**
416  *      @brief  Aux data structure for MSG_CMD_REG_SYNCML_MSG_OPERATION_CB. \n
417  *      This stucture contains the information about the receiver for msgType and port.
418  */
419 typedef struct
420 {
421         int                             listenerFd;
422         MSG_MAIN_TYPE_T         msgType;
423 } MSG_CMD_REG_SYNCML_MSG_OPERATION_CB_S;
424
425 typedef struct
426 {
427         int                             listenerFd;
428         MSG_MAIN_TYPE_T         msgType;
429         char appId[MAX_WAPPUSH_ID_LEN+1];
430 } MSG_CMD_REG_INCOMING_PUSH_MSG_CB_S;
431
432 typedef struct
433 {
434         int                             listenerFd;
435         MSG_MAIN_TYPE_T         msgType;
436         bool                            bsave;
437 } MSG_CMD_REG_INCOMING_CB_MSG_CB_S;
438
439
440 typedef struct
441 {
442         int                                             alarm_id;
443         MSG_REQUEST_INFO_S              reqInfo;
444 }MSG_SCHEDULED_MSG_S;
445
446 /**
447  *      @brief  Represents a CB message in the framework.
448  */
449 typedef struct
450 {
451         MSG_SUB_TYPE_T                  type;
452         time_t                                  receivedTime;
453
454         unsigned short                  serialNum;
455         unsigned short                  messageId;      // Message Identifier
456         unsigned char                   dcs;            // data coding scheme
457         int                                             cbTextLen;      // length of cbText
458         unsigned char                   cbText[MAX_CB_MSG_TEXT_LEN];// cb message text (UTF8)
459
460         unsigned short                  etwsWarningType;
461         unsigned char                   etwsWarningSecurityInfo[MAX_ETWS_WARNING_SECURITY_INFO_LEN];
462         unsigned char                   language_type[MAX_CB_MSG_LANGUAGE_TYPE_LEN];
463 } MSG_CB_MSG_S;
464
465
466 /*==================================================================================================
467                                          ENUMS
468 ==================================================================================================*/
469
470 /**
471  *      @brief  Represents the values of a message main type. \n
472  *      Three main types of a message are predefined : SMS, MMS, and Email. More main types of a message can be defined here. \n
473  *      This enum is used as the value of MSG_MAIN_TYPE_T.
474  */
475 enum _MSG_MAIN_TYPE_E
476 {
477         MSG_UNKNOWN_TYPE = 0,           /**< Unknown main type */
478         MSG_SMS_TYPE,                           /**< SMS */
479         MSG_MMS_TYPE,                           /**< MMS */
480 };
481
482
483 /**
484  *      @brief  Represents the values of a message sub type. \n
485  *      Three sub types of a message are predefined : NORMAL, WAPPUSH, and CB. More sub types of a message can be defined here. \n
486  *      This enum is used as the value of MSG_SUB_TYPE_T.
487  */
488 enum _MSG_SUB_TYPE_E
489 {
490         /* SMS Specific Message Type */
491         MSG_NORMAL_SMS = 0,                     /**< Text SMS message */
492         MSG_CB_SMS,                                     /**< Cell Broadcasting  message */
493         MSG_JAVACB_SMS,                         /**< JAVA Cell Broadcasting  message */
494         MSG_TYPE0_SMS,                                  /**< Short Message Type 0 */
495         MSG_REPLACE_TYPE1_SMS,          /**< Replace Short Message Type 1 */
496         MSG_REPLACE_TYPE2_SMS,          /**< Replace Short Message Type 2 */
497         MSG_REPLACE_TYPE3_SMS,          /**< Replace Short Message Type 3 */
498         MSG_REPLACE_TYPE4_SMS,          /**< Replace Short Message Type 4 */
499         MSG_REPLACE_TYPE5_SMS,          /**< Replace Short Message Type 5 */
500         MSG_REPLACE_TYPE6_SMS,          /**< Replace Short Message Type 6 */
501         MSG_REPLACE_TYPE7_SMS,          /**< Replace Short Message Type 7 */
502         MSG_WAP_SI_SMS,                         /**< WAP Push Message SI */
503         MSG_WAP_SL_SMS,                         /**< WAP Push Message SL */
504         MSG_WAP_CO_SMS,                         /**< WAP Push Message CO */
505         MSG_MWI_VOICE_SMS,                      /**< MWI Message Voice */
506         MSG_MWI_FAX_SMS,                                /**< MWI Message Fax */
507         MSG_MWI_EMAIL_SMS,                      /**< MWI Message Email */
508         MSG_MWI_OTHER_SMS,                      /**< MWI Message Other */
509         MSG_STATUS_REPORT_SMS,          /**< SMS-STATUS-REPORT */
510         MSG_SYNCML_CP,                          /**< SyncML Message CP */
511         MSG_LBS_SMS,                                    /**< LBS Message */
512         MSG_REJECT_SMS,                         /**< Reject Message */
513         MSG_CONCAT_SIM_SMS,                     /**< Concatenated Message in SIM */
514
515         /* MMS Specific Message Type */
516         MSG_SENDREQ_MMS = 24,                                   /**< MMS Send Request message */
517         MSG_SENDCONF_MMS,                               /**< MMS Send Confirm message */
518         MSG_NOTIFICATIONIND_MMS,                        /**< MMS Notification Indication message */
519         MSG_GET_MMS,                                            /**< MMS GET MMS message */
520         MSG_NOTIFYRESPIND_MMS,                  /**< MMS Notify Response Indication message */
521         MSG_RETRIEVE_MMS,                                       /**< MMS Retrive MMS message */
522         MSG_RETRIEVE_AUTOCONF_MMS,              /**< MMS Retrieve Confirm message by auto retrieving*/
523         MSG_RETRIEVE_MANUALCONF_MMS,    /**< MMS Retrieve Confirm message by manual retrieving*/
524         MSG_ACKNOWLEGEIND_MMS,                  /**< MMS Acknowledge Indication message */
525         MSG_DELIVERYIND_MMS,                            /**< MMS Delivery Indication message */
526         MSG_READRECIND_MMS,                             /**< MMS Read Receive Indication message */
527         MSG_READORGIND_MMS,                             /**< MMS Read Origin Indication message */
528         MSG_FORWARD_MMS,                                        /**< MMS Forward message */
529         MSG_FORWARDREQ_MMS,                             /**< MMS Forward Request message */
530         MSG_FORWARDCONF_MMS,                    /**< MMS Forward Confirm message */
531         MSG_READREPLY_MMS,                              /**< MMS Read Reply message */
532         MSG_SENDREQ_JAVA_MMS,                   /**< MMS Send Request message for JAVA MMS */
533
534         MSG_ETWS_SMS,
535 };
536
537 /**
538  *      @brief  Represents the values of a message transaction type. \n
539  *      This enum is used as the value of MSG_MMS_TRANSACTION_TYPE_T.
540  */
541 enum _MSG_MMS_TRANSACTION_TYPE_E
542 {
543         MSG_MMS_SEND_COMPLETE = 0,
544         MSG_MMS_RETRIEVE_COMPLETE,
545         MSG_MMS_UNKNOWN,
546 };
547
548 /**
549  *      @brief  Represents the values of File Type of MMS. \n
550  *      This enum is used as the value of .
551  */
552 enum _MSG_MMS_ITEM_TYPE_E
553 {
554         MSG_MMS_ITEM_TYPE_IMG,                  /**< Indicates the image media */
555         MSG_MMS_ITEM_TYPE_AUDIO,                /**< Indicates the audio media */
556         MSG_MMS_ITEM_TYPE_VIDEO,                /**< Indicates the video media */
557         MSG_MMS_ITEM_TYPE_ATTACH,               /**< Indicates the attach file */
558         MSG_MMS_ITEM_TYPE_PAGE, /**< Indicates the page count */
559 };
560 #endif
561