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