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