Modify flora license version.
[platform/core/messaging/msg-service.git] / include / common / MsgInternalTypes.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_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 #include <inttypes.h>
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         size_t                                  mmsDataSize;
266 } MSG_MESSAGE_HIDDEN_S;
267
268 /**
269  *      @brief  Represents message information for thread view.
270  */
271 typedef struct
272 {
273         msg_thread_id_t                 threadId;                                                                                                                       /**< Indicates the thread ID of this peer. */
274         char                                    threadName[MAX_THREAD_NAME_LEN+1];              /**< Indicates the name of this peer. > */
275         MSG_MAIN_TYPE_T                 mainType;                                                               /**< Indicates the latest msg main type. */
276         MSG_SUB_TYPE_T                  subType;                                                                /**< Indicates the latest msg sub type. */
277         char                                    threadData[MAX_THREAD_DATA_LEN+1];              /**< Indicates the latest msg data. */
278         time_t                                  threadTime;                                                                                                             /**< Indicates the latest msg time. */
279         msg_direction_type_t    direction;                                                                                                                      /**< Indicates whether the message is MO or MT (affecting address). */
280         int                                             unreadCnt;                                                                                                              /**< Indicates the unread messages from the Peer. */
281         int                                             smsCnt;                                                                                                                 /**< Indicates the SMS messages from the Peer. */
282         int                                             mmsCnt;                                                                                                                 /**< Indicates the MMS messages from the Peer. */
283         bool                                    bProtected;                                                                                                             /**< Indicates whether the thread includes protected messages.  */
284 } MSG_THREAD_VIEW_S;
285
286
287 /**
288  *      @brief  Represents message information for conversation view.
289  */
290 typedef struct
291 {
292         msg_message_id_t                        msgId;                                                                  /**< Indicates the message ID of this message. */
293         msg_thread_id_t                 threadId;                                                               /**< Indicates the thread ID of this peer. */
294         MSG_MAIN_TYPE_T                 mainType;                                                       /**< Message main type. See enum _MSG_MAIN_TYPE_E */
295         MSG_SUB_TYPE_T                  subType;                                                                /**< Message sub type. See enum _MSG_SUB_TYPE_E */
296         msg_folder_id_t                 folderId;                                                               /**< Indicates the folder ID. see enum _MSG_FOLDER_TYPE_E */
297         msg_storage_id_t                                storageId;                                                              /**< Indicates where the message is saved. see enum _MSG_FOLDER_TYPE_E*/
298         time_t                                                          displayTime;                                            /**< Indicates the display time related to the specific operation. */
299         time_t                                                          scheduledTime;                                  /**< Indicates the time to send scheduled message. */
300         msg_network_status_t            networkStatus;                                          /**< Indicates the network status of the message. */
301         bool                                                                    bRead;                                                                  /**< Indicates whether the message is read or not. */
302         bool                                                                    bProtected;                                                     /**< Indicates whether the message is protected or not. */
303         msg_direction_type_t            direction;                                                              /**< Indicates whether the message is MO or MT, affecting address. */
304         int                                                                     pageCount;                                              /**< Indicates the count of pageCount in mms. */
305         int                                                                     attachCount;                                            /**< Indicates the count of attached files in mms. */
306         char                                                                    attachFileName[MSG_FILENAME_LEN_MAX+1]; /**< Indicates the thumbnail path. */
307         char                                                                    audioFileName[MSG_FILENAME_LEN_MAX+1];  /**< Indicates the thumbnail path. */
308         char                                                                    imageThumbPath[MSG_FILEPATH_LEN_MAX+1]; /**< Indicates the thumbnail path. */
309         char                                                                    videoThumbPath[MSG_FILEPATH_LEN_MAX+1];         /**< Indicates the thumbnail path. */
310         char                                                                    subject[MAX_SUBJECT_LEN+1];                                                     /**< Indicates the message subject. */
311         size_t                                                          textSize;                                                               /**< Indicates the data size. The unit is byte. */
312         char                                                                    *pText;                                                                 /**< Indicates the message payload information as a body. default character encoding is UTF-8*/
313 } MSG_CONVERSATION_VIEW_S;
314
315
316 /**
317  *      @brief  Represents sim message informatioin list.
318  */
319 typedef struct
320 {
321         int nIdxCnt;            /**< The count of sim index */
322         int nMsgCnt;            /**< The count of sim message */
323         MSG_MESSAGE_INFO_S              *simMsgInfo;            /**< The pointer to sim message informatioin */
324 } MSG_SIM_MSG_INFO_LIST_S;
325
326
327 /**
328  *      @brief  Represents a request in the framework. \n
329  *      Applications compose a request and send it to the framework via Message handle. \n
330  *      This request ID is used to manage the request by the framework.
331  */
332 typedef struct
333 {
334         msg_request_id_t                reqId;          /**< Indicates the request ID, which is unique.
335                                                                                 When applications submit a request to the framework, this value will be set by the framework. */
336         MSG_MESSAGE_INFO_S              msgInfo;        /**< Indicates the message structure to be sent by applications. */
337         MSG_SENDINGOPT_INFO_S   sendOptInfo;
338 } MSG_REQUEST_INFO_S;
339
340
341 /**
342  *      @brief  Represents proxy information. \n
343  *      This stucture contains the information about the status cnf of a sent message.
344  */
345 typedef struct
346 {
347         int                                             listenerFd;             /**< Rx fd for status cnf */
348 #ifdef __x86_64__
349         uint64_t                                handleAddr;             /**< Handle address for status cnf */
350 #else
351         unsigned int                    handleAddr;             /**< Handle address for status cnf */
352 #endif
353         msg_message_id_t                sentMsgId;              /**< The ID of a sent message for updating message status */
354
355 } MSG_PROXY_INFO_S;
356
357 /**
358  *      @brief  Aux data structure for MSG_CMD_REG_INCOMING_MSG_CB. \n
359  *      This stucture contains the information about the receiver for msgType and port.
360  */
361 typedef struct
362 {
363         int                             listenerFd;
364         MSG_MAIN_TYPE_T         msgType;
365         unsigned short          port;
366 } MSG_CMD_REG_INCOMING_MSG_CB_S;
367
368 typedef struct
369 {
370         int                             listenerFd;
371         MSG_MAIN_TYPE_T         msgType;
372         bool                            bsave;
373 } MSG_CMD_REG_CB_INCOMING_MSG_CB_S;
374
375
376 /**
377  *      @brief  Aux data structure for MSG_CMD_REG_INCOMING_MMS_CONF_MSG_CB. \n
378  *      This stucture contains the information about the receiver for msgType and port.
379  */
380 typedef struct
381 {
382         int                             listenerFd;
383         MSG_MAIN_TYPE_T         msgType;
384         char appId[MAX_MMS_JAVA_APPID_LEN+1];
385 } MSG_CMD_REG_INCOMING_MMS_CONF_MSG_CB_S;
386
387
388 /**
389  *      @brief  Aux data structure for MSG_CMD_REG_INCOMING_SYNCML_MSG_CB. \n
390  *      This stucture contains the information about the receiver for msgType and port.
391  */
392 typedef struct
393 {
394         int                             listenerFd;
395         MSG_MAIN_TYPE_T         msgType;
396 } MSG_CMD_REG_INCOMING_SYNCML_MSG_CB_S;
397
398
399 /**
400  *      @brief  Aux data structure for MSG_CMD_REG_INCOMING_LBS_MSG_CB_S. \n
401  *      This stucture contains the information about the receiver for msgType and port.
402  */
403 typedef struct
404 {
405         int                             listenerFd;
406         MSG_MAIN_TYPE_T         msgType;
407 } MSG_CMD_REG_INCOMING_LBS_MSG_CB_S;
408
409
410 /**
411  *      @brief  Aux data structure for MSG_CMD_REG_INCOMING_JAVAMMS_TRID_S. \n
412  *      This stucture contains the information about the sent Java MMS messge transactionId.
413  */
414 typedef struct
415 {
416         bool                    posted;
417         char                    id[MMS_TR_ID_LEN+1];
418         char                            pduFileName[MAX_COMMON_INFO_SIZE+1];
419 } MSG_CMD_REG_INCOMING_JAVAMMS_TRID_S;
420
421
422 /**
423  *      @brief  Aux data structure for MSG_CMD_REG_SYNCML_MSG_OPERATION_CB. \n
424  *      This stucture contains the information about the receiver for msgType and port.
425  */
426 typedef struct
427 {
428         int                             listenerFd;
429         MSG_MAIN_TYPE_T         msgType;
430 } MSG_CMD_REG_SYNCML_MSG_OPERATION_CB_S;
431
432 typedef struct
433 {
434         int                             listenerFd;
435         MSG_MAIN_TYPE_T         msgType;
436         char appId[MAX_WAPPUSH_ID_LEN+1];
437         char content_type[MAX_WAPPUSH_CONTENT_TYPE_LEN+1];
438 } MSG_CMD_REG_INCOMING_PUSH_MSG_CB_S;
439
440 typedef struct
441 {
442         int                             listenerFd;
443         MSG_MAIN_TYPE_T         msgType;
444         bool                            bsave;
445 } MSG_CMD_REG_INCOMING_CB_MSG_CB_S;
446
447
448 typedef struct
449 {
450         int                                             alarm_id;
451         MSG_REQUEST_INFO_S              reqInfo;
452 }MSG_SCHEDULED_MSG_S;
453
454 /**
455  *      @brief  Represents a CB message in the framework.
456  */
457 typedef struct
458 {
459         MSG_SUB_TYPE_T                  type;
460         time_t                                  receivedTime;
461
462         unsigned short                  serialNum;
463         unsigned short                  messageId;      // Message Identifier
464         unsigned char                   dcs;            // data coding scheme
465         int                                             cbTextLen;      // length of cbText
466         unsigned char                   cbText[MAX_CB_MSG_TEXT_LEN];// cb message text (UTF8)
467
468         unsigned short                  etwsWarningType;
469         unsigned char                   etwsWarningSecurityInfo[MAX_ETWS_WARNING_SECURITY_INFO_LEN];
470         unsigned char                   language_type[MAX_CB_MSG_LANGUAGE_TYPE_LEN];
471 } MSG_CB_MSG_S;
472
473
474 /*==================================================================================================
475                                          ENUMS
476 ==================================================================================================*/
477
478 /**
479  *      @brief  Represents the values of a message main type. \n
480  *      Three main types of a message are predefined : SMS, MMS, and Email. More main types of a message can be defined here. \n
481  *      This enum is used as the value of MSG_MAIN_TYPE_T.
482  */
483 enum _MSG_MAIN_TYPE_E
484 {
485         MSG_UNKNOWN_TYPE = 0,           /**< Unknown main type */
486         MSG_SMS_TYPE,                           /**< SMS */
487         MSG_MMS_TYPE,                           /**< MMS */
488 };
489
490
491 /**
492  *      @brief  Represents the values of a message sub type. \n
493  *      Three sub types of a message are predefined : NORMAL, WAPPUSH, and CB. More sub types of a message can be defined here. \n
494  *      This enum is used as the value of MSG_SUB_TYPE_T.
495  */
496 enum _MSG_SUB_TYPE_E
497 {
498         /* SMS Specific Message Type */
499         MSG_NORMAL_SMS = 0,                     /**< Text SMS message */
500         MSG_CB_SMS,                                     /**< Cell Broadcasting  message */
501         MSG_JAVACB_SMS,                         /**< JAVA Cell Broadcasting  message */
502         MSG_TYPE0_SMS,                                  /**< Short Message Type 0 */
503         MSG_REPLACE_TYPE1_SMS,          /**< Replace Short Message Type 1 */
504         MSG_REPLACE_TYPE2_SMS,          /**< Replace Short Message Type 2 */
505         MSG_REPLACE_TYPE3_SMS,          /**< Replace Short Message Type 3 */
506         MSG_REPLACE_TYPE4_SMS,          /**< Replace Short Message Type 4 */
507         MSG_REPLACE_TYPE5_SMS,          /**< Replace Short Message Type 5 */
508         MSG_REPLACE_TYPE6_SMS,          /**< Replace Short Message Type 6 */
509         MSG_REPLACE_TYPE7_SMS,          /**< Replace Short Message Type 7 */
510         MSG_WAP_SI_SMS,                         /**< WAP Push Message SI */
511         MSG_WAP_SL_SMS,                         /**< WAP Push Message SL */
512         MSG_WAP_CO_SMS,                         /**< WAP Push Message CO */
513         MSG_MWI_VOICE_SMS,                      /**< MWI Message Voice */
514         MSG_MWI_FAX_SMS,                                /**< MWI Message Fax */
515         MSG_MWI_EMAIL_SMS,                      /**< MWI Message Email */
516         MSG_MWI_OTHER_SMS,                      /**< MWI Message Other */
517         MSG_STATUS_REPORT_SMS,          /**< SMS-STATUS-REPORT */
518         MSG_SYNCML_CP,                          /**< SyncML Message CP */
519         MSG_LBS_SMS,                                    /**< LBS Message */
520         MSG_REJECT_SMS,                         /**< Reject Message */
521         MSG_CONCAT_SIM_SMS,                     /**< Concatenated Message in SIM */
522
523         /* MMS Specific Message Type */
524         MSG_SENDREQ_MMS = 24,                                   /**< MMS Send Request message */
525         MSG_SENDCONF_MMS,                               /**< MMS Send Confirm message */
526         MSG_NOTIFICATIONIND_MMS,                        /**< MMS Notification Indication message */
527         MSG_GET_MMS,                                            /**< MMS GET MMS message */
528         MSG_NOTIFYRESPIND_MMS,                  /**< MMS Notify Response Indication message */
529         MSG_RETRIEVE_MMS,                                       /**< MMS Retrive MMS message */
530         MSG_RETRIEVE_AUTOCONF_MMS,              /**< MMS Retrieve Confirm message by auto retrieving*/
531         MSG_RETRIEVE_MANUALCONF_MMS,    /**< MMS Retrieve Confirm message by manual retrieving*/
532         MSG_ACKNOWLEGEIND_MMS,                  /**< MMS Acknowledge Indication message */
533         MSG_DELIVERYIND_MMS,                            /**< MMS Delivery Indication message */
534         MSG_READRECIND_MMS,                             /**< MMS Read Receive Indication message */
535         MSG_READORGIND_MMS,                             /**< MMS Read Origin Indication message */
536         MSG_FORWARD_MMS,                                        /**< MMS Forward message */
537         MSG_FORWARDREQ_MMS,                             /**< MMS Forward Request message */
538         MSG_FORWARDCONF_MMS,                    /**< MMS Forward Confirm message */
539         MSG_READREPLY_MMS,                              /**< MMS Read Reply message */
540         MSG_SENDREQ_JAVA_MMS,                   /**< MMS Send Request message for JAVA MMS */
541
542         MSG_ETWS_SMS,
543 };
544
545 /**
546  *      @brief  Represents the values of a message transaction type. \n
547  *      This enum is used as the value of MSG_MMS_TRANSACTION_TYPE_T.
548  */
549 enum _MSG_MMS_TRANSACTION_TYPE_E
550 {
551         MSG_MMS_SEND_COMPLETE = 0,
552         MSG_MMS_RETRIEVE_COMPLETE,
553         MSG_MMS_UNKNOWN,
554 };
555
556 /**
557  *      @brief  Represents the values of File Type of MMS. \n
558  *      This enum is used as the value of .
559  */
560 enum _MSG_MMS_ITEM_TYPE_E
561 {
562         MSG_MMS_ITEM_TYPE_IMG,                  /**< Indicates the image media */
563         MSG_MMS_ITEM_TYPE_AUDIO,                /**< Indicates the audio media */
564         MSG_MMS_ITEM_TYPE_VIDEO,                /**< Indicates the video media */
565         MSG_MMS_ITEM_TYPE_ATTACH,               /**< Indicates the attach file */
566         MSG_MMS_ITEM_TYPE_PAGE, /**< Indicates the page count */
567 };
568 #endif
569