2 * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #ifndef __MSG_MGR_NOTIFICATION_H__
18 #define __MSG_MGR_NOTIFICATION_H__
20 /*==================================================================================================
22 ==================================================================================================*/
25 #include <app_control.h>
27 /*==================================================================================================
29 ==================================================================================================*/
31 #define MSG_NOTI_INTEGRATION
33 #define MSGFW_MESSAGE_TABLE_NAME "MSG_MESSAGE_TABLE"
34 #define MSGFW_FOLDER_TABLE_NAME "MSG_FOLDER_TABLE"
35 #define MSGFW_ADDRESS_TABLE_NAME "MSG_ADDRESS_TABLE"
36 #define MSGFW_CONVERSATION_TABLE_NAME "MSG_CONVERSATION_TABLE"
37 #define MMS_PLUGIN_MESSAGE_TABLE_NAME "MSG_MMS_MESSAGE_TABLE"
38 #define MSGFW_SMS_REPORT_TABLE_NAME "MSG_SMS_REPORT_TABLE"
39 #define MSGFW_REPORT_TABLE_NAME "MSG_REPORT_TABLE"
41 #define MSG_MGR_APP_ID "org.tizen.msg-manager"
42 #define MSG_DEFAULT_APP_ID "org.tizen.message"
43 #define MSG_WEARABLE_APP_ID "org.tizen.w-message"
44 #define MSG_QUICKPANEL_APP_ID "org.tizen.quickpanel"
45 #define MSG_CALL_APP_ID "org.tizen.call-ui"
46 #define MSG_SETTING_APP_ID "org.tizen.setting"
48 #define MSG_MGR_PACKAGE_NAME "msg-manager"
49 #define MSG_MGR_LOCALEDIR TZ_SYS_RO_APP_PATH "/" MSG_MGR_APP_ID "/res/locale"
51 #define MSG_NOTIFICATION_ICON_DIR "/" MSG_QUICKPANEL_APP_ID "/shared/res/noti_icons"
53 /* notification icon */
54 #define MSG_NORMAL_ICON_PATH TZ_SYS_RO_APP_PATH MSG_NOTIFICATION_ICON_DIR "/Message/noti_message.png"
55 #define MSG_SIM_ICON_PATH TZ_SYS_RO_APP_PATH MSG_NOTIFICATION_ICON_DIR "/Message/noti_message_sim-card.png"
56 #define MSG_OTA_ICON_PATH TZ_SYS_RO_APP_PATH MSG_NOTIFICATION_ICON_DIR "/Message/noti_message_OTA.png"
57 #define MSG_VOICE_ICON_PATH TZ_SYS_RO_APP_PATH MSG_NOTIFICATION_ICON_DIR "/Message/noti_voice_mail.png"
58 #define MSG_CB_ICON_PATH TZ_SYS_RO_APP_PATH MSG_NOTIFICATION_ICON_DIR "/Message/noti_message_cb-msg.png"
59 #define MSG_READ_ICON_PATH TZ_SYS_RO_APP_PATH MSG_NOTIFICATION_ICON_DIR "/Message/noti_message_read_report.png"
60 #define MSG_DELIVERY_ICON_PATH TZ_SYS_RO_APP_PATH MSG_NOTIFICATION_ICON_DIR "/Message/noti_message_delivery_report.png"
61 #define MSG_REPLY_ICON_PATH TZ_SYS_RO_APP_PATH MSG_NOTIFICATION_ICON_DIR "/Message/noti_message_reply.png"
62 #define MSG_SMS_SENDING_FAILED_ICON_PATH TZ_SYS_RO_APP_PATH MSG_NOTIFICATION_ICON_DIR "/Message/noti_message_failed.png"
63 #define MSG_MMS_SENDING_FAILED_ICON_PATH TZ_SYS_RO_APP_PATH MSG_NOTIFICATION_ICON_DIR "/Message/noti_message_mms_failed.png"
64 #define MSG_MMS_RETRIVE_FAILED_ICON_PATH TZ_SYS_RO_APP_PATH MSG_NOTIFICATION_ICON_DIR "/Message/noti_message_mms_problem.png"
65 #define MSG_EMERGENCY_ICON_PATH TZ_SYS_RO_APP_PATH MSG_DEFAULT_APP_ID "/res/icons/default/small/noti_emergency_mode.png"
66 #define MSG_NO_CONTACT_PROFILE_ICON_PATH TZ_SYS_RO_APP_PATH MSG_NOTIFICATION_ICON_DIR "/Contact/noti_contact_default.png"
67 #define MSG_ACTIVE_PUSH_ICON_PATH "reserved:push_message"
70 #define MSG_NORMAL_STATUS_ICON "reserved://indicator/icons/notify_message"
71 #define MSG_FAILED_STATUS_ICON "reserved://indicator/icons/notify_message_failed"
72 #define MSG_DELIVER_REPORT_STATUS_ICON "reserved://indicator/icons/delivery_report_message"
73 #define MSG_READ_REPORT_STATUS_ICON "reserved://indicator/icons/read_report_message"
74 #define MSG_VOICE_MSG_STATUS_ICON "reserved://indicator/icons/notify_voicemail"
75 #define MSG_SIM_FULL_STATUS_ICON "reserved://indicator/icons/sim_card_full"
76 #define MSG_STORAGE_FULL_STATUS_ICON "/usr/apps/org.tizen.indicator/res/resource/icons/Storage/b03_storage_memoryfull.png"
78 #ifndef TIZEN_I586_ENABLED
80 #define NEW_MESSAGE "IDS_MSGF_POP_NEW_MESSAGE"
81 #define NEW_MESSAGES "IDS_MSGF_POP_NEW_MESSAGES"
82 #define MSG_UNKNOWN_SENDER "IDS_MSGF_BODY_UNKNOWN"
83 #define MSG_NO_SUBJECT "IDS_MSGF_BODY_NO_SUBJECT"
86 /* message app string for ticker noti */
87 #define SENDING_MULTIMEDIA_MESSAGE_FAILED "IDS_MSGF_POP_SENDING_MULTIMEDIA_MESSAGE_FAILED"
88 #define MESSAGE_RETRIEVED "IDS_MSGF_BODY_MESSAGE_RETRIEVED"
89 #define SMS_MESSAGE_SENDING_FAIL "IDS_MSGF_POP_SENDING_MESSAGE_FAILED"
90 #define SMS_MESSAGE_SIM_MESSAGE_FULL "IDS_MSGF_BODY_SIM_MEMORY_FULL_DELETE_SOME_ITEMS"
91 #define SMS_MESSAGE_MEMORY_FULL "IDS_MSGF_POP_NOT_ENOUGH_MEMORY_DELETE_SOME_ITEMS"
92 #define SMS_SIM_CARD_FULL "IDS_MSG_HEADER_SIM_CARD_FULL"
94 /* message app string for quickpanel noti */
95 #define MSG_STRING_CALL "IDS_MSG_BUTTON_CALL_ABB2"
96 #define MSG_STRING_REPLY "IDS_MSG_BUTTON_REPLY_ABB"
97 #define MSG_STRING_VIEW "IDS_MSG_BUTTON_VIEW"
98 #define MSG_MESSAGE "IDS_MSG_BODY_MESSAGES_M_APPLICATION_NAME_ABB"
99 #define VOICE_MAIL "IDS_MSGF_BODY_VOICEMAIL"
100 #define CB_MESSAGE "IDS_MSGF_BODY_CB_MESSAGES"
101 #define CP_MESSAGE "IDS_MSGF_BODY_CP_MESSAGES"
102 #define PUSH_MESSAGE "IDS_MSGF_BODY_PUSH_MESSAGES"
103 #define DELIVERY_MESSAGE "IDS_MSGF_BODY_DELIVERY_REPORT"
104 #define READ_REPORT_MESSAGE "IDS_MSGF_POP_READ_REPORT"
105 #define MESSAGE_DELIVERED "IDS_MSG_SBODY_MESSAGE_DELIVERED_M_STATUS_ABB"
106 #define MESSAGE_DELIVERED_POPUP "IDS_MSG_TPOP_MESSAGE_DELIVERED"
107 #define MESSAGE_EXPIRED "IDS_MSG_SBODY_MESSAGE_EXPIRED_M_STATUS_ABB"
108 #define MESSAGE_REJECTED "IDS_MSG_SBODY_MESSAGE_REJECTED_M_STATUS_ABB"
109 #define MESSAGE_DELAYED "IDS_MSG_SBODY_MESSAGE_DELAYED_M_STATUS_ABB"
110 #define MESSAGE_DELAYED_POPUP "IDS_MSG_TPOP_MESSAGE_DELAYED"
111 #define RECIPIENT_NOT_AVAILABLE "IDS_MSG_SBODY_RECIPIENT_NOT_AVAILABLE_M_STATUS_ABB"
112 #define UNABLE_TO_DELIVER_MESSAGE_RECIPIENT_NOT_AVAILABLE "IDS_MSG_TPOP_COULDNT_DELIVER_MESSAGE_RECIPIENT_NOT_AVAILABLE"
113 #define UNABLE_TO_DELIVER_MESSAGE_MESSAGE_REJECTED "IDS_MSG_TPOP_COULDNT_DELIVER_MESSAGE_MESSAGE_REJECTED_BY_RECIPIENT"
114 #define UNABLE_TO_DELIVER_MESSAGE_MESSAGE_EXPIRED "IDS_MSG_TPOP_COULDNT_DELIVER_MESSAGE_MESSAGE_EXPIRED"
115 #define MESSAGE_READ_BY_PS "IDS_MSG_SBODY_MESSAGE_READ_BY_PS_M_STATUS_ABB"
116 #define MESSAGE_DELETED_BY_PS "IDS_MSG_SBODY_MESSAGE_DELETED_BY_PS_M_STATUS_SBODY_ABB"
117 #define VOICE_1_MESSAGE "IDS_MSGF_BODY_1_MESSAGE"
118 #define VOICE_N_MESSAGE "IDS_MSGF_BODY_PD_MESSAGES"
119 #define SIM_CARD_MESSAGE "IDS_MSGF_BODY_SIM_CARD_MESSAGES"
120 #define FAILED_TO_SEND_MESSAGE "IDS_MSG_HEADER_FAILED_TO_SEND_MESSAGE_ABB"
121 #define MMS_READ_REPORT_SENT "IDS_MSG_SBODY_READ_REPORT_SENT_ABB"
122 #define FAILED_TO_SEND_MMS_READ_REPORT "IDS_MSG_SBODY_FAILED_TO_SEND_READ_REPORT_ABB"
123 #define MESSAGE_SIZE_UNIT_KB "IDS_MSGF_BODY_MSGSIZE_KB"
124 #define MESSAGE_SIZE_STRING "IDS_MSGF_BODY_MESSAGE_SIZE"
125 #define MSG_SUBJECT_COLON "IDS_MSGF_OPT_SUBJECT_COLON"
126 #define MSG_SINGLE_ATTACHMENT "IDS_MSG_SBODY_1_ATTACHMENT"
127 #define MSG_PD_ATTACHMENTS "IDS_MSG_SBODY_PD_ATTACHMENTS"
130 #define NEW_MESSAGE "New message"
131 #define NEW_MESSAGES "New messages"
132 #define MSG_UNKNOWN_SENDER "New message from Unknown."
133 #define MSG_NO_SUBJECT "No subject"
136 /* message app string for ticker noti */
137 #define SMS_MESSAGE_MEMORY_FULL "Not enough memory. Delete some items."
138 #define SMS_SIM_CARD_FULL "SIM card full"
140 /* message app string for quickpanel noti */
141 #define MSG_STRING_CALL "Call"
142 #define MSG_STRING_REPLY "Reply"
143 #define MSG_STRING_VIEW "View"
144 #define MSG_MESSAGE "Message"
145 #define VOICE_MAIL "Voicemail"
146 #define CB_MESSAGE "CB messages"
147 #define CP_MESSAGE "CP messages"
148 #define PUSH_MESSAGE "Push messages"
149 #define DELIVERY_MESSAGE "Delivery report"
150 #define READ_REPORT_MESSAGE "Read report"
151 #define MESSAGE_DELIVERED "Message delivered"
152 #define MESSAGE_DELIVERED_POPUP "Message delivered."
153 #define MESSAGE_EXPIRED "Message expired"
154 #define MESSAGE_REJECTED "Message rejected"
155 #define MESSAGE_DELAYED "Message delayed"
156 #define MESSAGE_DELAYED_POPUP "Message delayed."
157 #define RECIPIENT_NOT_AVAILABLE "Recipient not available"
158 #define UNABLE_TO_DELIVER_MESSAGE_RECIPIENT_NOT_AVAILABLE "Couldn't deliver message. Recipient not available."
159 #define UNABLE_TO_DELIVER_MESSAGE_MESSAGE_REJECTED "Couldn't deliver message. Message rejected by recipient."
160 #define UNABLE_TO_DELIVER_MESSAGE_MESSAGE_EXPIRED "Couldn't deliver message. Message expired."
161 #define MESSAGE_READ_BY_PS "Message read by %s"
162 #define MESSAGE_DELETED_BY_PS "Message deleted by %s"
163 #define VOICE_1_MESSAGE "1 message"
164 #define VOICE_N_MESSAGE "%d messages"
165 #define SIM_CARD_MESSAGE "SIM card messages"
166 #define FAILED_TO_SEND_MESSAGE "Failed to send message."
167 #define MMS_READ_REPORT_SENT "Read report sent"
168 #define FAILED_TO_SEND_MMS_READ_REPORT "Failed to send read report"
169 #define MESSAGE_SIZE_UNIT_KB "KB"
170 #define MESSAGE_SIZE_STRING "Message Size"
171 #define MSG_SUBJECT_COLON "Subject:"
172 #define MSG_SINGLE_ATTACHMENT "1 attachment"
173 #define MSG_PD_ATTACHMENTS "%d attachments"
177 #define NOTIFICATION_PRIV_ID "db/private/msg-service/notification_priv_id"
178 #define VOICE_NOTI_ID_1 "db/private/msg-service/voice_noti_id1"
179 #define VOICE_NOTI_ID_2 "db/private/msg-service/voice_noti_id2"
180 #define CB_NOTI_PRIV_ID "db/private/msg-service/cb_noti_priv_id"
181 #define SIM_MSG_NOTI_PRIV_ID "db/private/msg-service/sim_msg_noti_priv_id"
182 #define MSG_SENTFAIL_NOTI_ID "db/private/msg-service/sentfail_noti_id"
183 #define SIM_FULL_NOTI_PRIV_ID "db/private/msg-service/sim_full_noti_id"
184 #define STORAGE_FULL_NOTI_PRIV_ID "db/private/msg-service/storage_full_noti_id"
186 #define MSG_SETTING_NOTIFICATION "db/private/msg-service/general/notification"
187 #define MSG_SETTING_VIBRATION "db/private/msg-service/general/vibration"
188 #define MSG_SETTING_PREVIEW "db/private/msg-service/general/preview"
189 #define MSG_SETTING_RINGTONE_PATH "db/private/msg-service/general/ringtone_path"
190 #define MSG_SETTING_RINGTONE_TYPE "db/private/msg-service/general/ringtone_type"
192 #define VOICEMAIL_NUMBER "db/private/msg-service/voice_mail/voice_mail_number"
193 #define VOICEMAIL_COUNT "db/private/msg-service/voice_mail/voice_mail_count"
194 #define VOICEMAIL_ALPHA_ID "db/private/msg-service/voice_mail/voice_mail_alphaid"
195 #define VOICEMAIL_DEFAULT_NUMBER "db/private/msg-service/voice_mail/voice_mail_default_number"
196 #define VOICEMAIL_DEFAULT_ALPHA_ID ""
198 #define MSG_ALERT_REP_TYPE "db/setting/sound/noti/msg_alert_rep_type"
200 #define MSG_TEL_URI_VOICEMAIL "tel:VOICEMAIL"
202 #define MSG_NOTI_TEXT_LEN (512)
203 #define MSG_NOTI_TEXT_LEN_S (256)
204 #define MAX_VCONFKEY_NAME_LEN 128
205 #define MSG_ACTIVE_NOTI_BUTTON_NUM 3
206 #define MAX_QUERY_LEN 4096
208 #define MSG_ACTIVE_NOTI_BUTTON_NUM_NONE 0
209 #define MSG_ACTIVE_NOTI_BUTTON_NUM_NORMAL_MESSAGE 3
210 #define MSG_ACTIVE_NOTI_BUTTON_NUM_UNRETRIVED_MESSAGE 1
211 #define MSG_ACTIVE_NOTI_BUTTON_NUM_UNKNOWN_SENDER 1
212 #define MSG_ACTIVE_NOTI_BUTTON_NUM_CB_MESSAGE 1
213 #define MSG_ACTIVE_NOTI_BUTTON_NUM_PUSH_MESSAGE 1
214 #define MSG_ACTIVE_NOTI_BUTTON_NUM_CLASS0_MESSAGE 1
216 typedef unsigned char msg_mgr_notification_type_t; /* _msg_notification_type_e */
217 typedef unsigned char msg_mgr_active_notification_type_t; /* _msg_active_notification_type_e */
220 /*==================================================================================================
222 ==================================================================================================*/
224 enum _msg_mgr_notification_type_e {
225 MSG_MGR_NOTI_TYPE_ALL = 0x00,
227 /* Refresh single/multiple notification */
228 MSG_MGR_NOTI_TYPE_NORMAL,
229 MSG_MGR_NOTI_TYPE_CB,
230 MSG_MGR_NOTI_TYPE_SIM,
231 MSG_MGR_NOTI_TYPE_FAILED,
233 /* Add only single notification */
234 MSG_MGR_NOTI_TYPE_VOICE_1,
235 MSG_MGR_NOTI_TYPE_VOICE_2,
236 MSG_MGR_NOTI_TYPE_MWI,
237 MSG_MGR_NOTI_TYPE_CLASS0,
238 MSG_MGR_NOTI_TYPE_SMS_DELIVERY_REPORT,
239 MSG_MGR_NOTI_TYPE_MMS_READ_REPORT,
240 MSG_MGR_NOTI_TYPE_MMS_DELIVERY_REPORT,
241 MSG_MGR_NOTI_TYPE_MMS_READ_REPORT_SENT,
243 MSG_MGR_NOTI_TYPE_SIM_FULL,
244 MSG_MGR_NOTI_TYPE_STORAGE_FULL,
248 enum _msg_mgr_active_notification_type_e {
249 MSG_MGR_ACTIVE_NOTI_TYPE_NONE,
250 MSG_MGR_ACTIVE_NOTI_TYPE_ACTIVE,
251 MSG_MGR_ACTIVE_NOTI_TYPE_INSTANT,
255 enum _msg_maintype_e {
256 MSG_UNKNOWN_TYPE = 0, /**< Unknown main type */
257 MSG_SMS_TYPE, /**< SMS */
258 MSG_MMS_TYPE, /**< MMS */
262 enum _msg_subtype_e {
263 /* SMS Specific Message Type */
264 MSG_NORMAL_SMS = 0, /**< Text SMS message */
265 MSG_CB_SMS, /**< Cell Broadcasting message */
266 MSG_JAVACB_SMS, /**< JAVA Cell Broadcasting message */
267 MSG_TYPE0_SMS, /**< Short Message Type 0 */
268 MSG_REPLACE_TYPE1_SMS, /**< Replace Short Message Type 1 */
269 MSG_REPLACE_TYPE2_SMS, /**< Replace Short Message Type 2 */
270 MSG_REPLACE_TYPE3_SMS, /**< Replace Short Message Type 3 */
271 MSG_REPLACE_TYPE4_SMS, /**< Replace Short Message Type 4 */
272 MSG_REPLACE_TYPE5_SMS, /**< Replace Short Message Type 5 */
273 MSG_REPLACE_TYPE6_SMS, /**< Replace Short Message Type 6 */
274 MSG_REPLACE_TYPE7_SMS, /**< Replace Short Message Type 7 */
275 MSG_WAP_SI_SMS, /**< WAP Push Message SI */
276 MSG_WAP_SL_SMS, /**< WAP Push Message SL */
277 MSG_WAP_CO_SMS, /**< WAP Push Message CO */
278 MSG_MWI_VOICE_SMS, /**< MWI Message Voice */
279 MSG_MWI_FAX_SMS, /**< MWI Message Fax */
280 MSG_MWI_EMAIL_SMS, /**< MWI Message Email */
281 MSG_MWI_OTHER_SMS, /**< MWI Message Other */
282 MSG_STATUS_REPORT_SMS, /**< SMS-STATUS-REPORT */
283 MSG_SYNCML_CP, /**< SyncML Message CP */
284 MSG_LBS_SMS, /**< LBS Message */
285 MSG_REJECT_SMS, /**< Reject Message */
286 MSG_CONCAT_SIM_SMS, /**< Concatenated Message in SIM */
288 /* MMS Specific Message Type */
289 MSG_SENDREQ_MMS = 24, /**< MMS Send Request message */
290 MSG_SENDCONF_MMS, /**< MMS Send Confirm message */
291 MSG_NOTIFICATIONIND_MMS, /**< MMS Notification Indication message */
292 MSG_GET_MMS, /**< MMS GET MMS message */
293 MSG_NOTIFYRESPIND_MMS, /**< MMS Notify Response Indication message */
294 MSG_RETRIEVE_MMS, /**< MMS Retrive MMS message */
295 MSG_RETRIEVE_AUTOCONF_MMS, /**< MMS Retrieve Confirm message by auto retrieving*/
296 MSG_RETRIEVE_MANUALCONF_MMS, /**< MMS Retrieve Confirm message by manual retrieving*/
297 MSG_ACKNOWLEGEIND_MMS, /**< MMS Acknowledge Indication message */
298 MSG_DELIVERYIND_MMS, /**< MMS Delivery Indication message */
299 MSG_READRECIND_MMS, /**< MMS Read Receive Indication message */
300 MSG_READORGIND_MMS, /**< MMS Read Origin Indication message */
301 MSG_FORWARD_MMS, /**< MMS Forward message */
302 MSG_FORWARDREQ_MMS, /**< MMS Forward Request message */
303 MSG_FORWARDCONF_MMS, /**< MMS Forward Confirm message */
304 MSG_READREPLY_MMS, /**< MMS Read Reply message */
305 MSG_SENDREQ_JAVA_MMS, /**< MMS Send Request message for JAVA MMS */
308 /*==================================================================================================
310 ==================================================================================================*/
311 typedef struct _msg_mgr_message_info_s {
312 msg_message_id_t msgId;
315 msg_network_status_t networkStatus;
316 char displayName[MAX_DISPLAY_NAME_LEN+1];
317 char addressVal[MAX_ADDRESS_VAL_LEN+1];
318 char msgText[MAX_MSG_TEXT_LEN+1];
319 } MSG_MGR_MESSAGE_INFO_S;
321 /*==================================================================================================
323 ==================================================================================================*/
325 void MsgMgrInitNoti();
328 int MsgMgrInsertOnlyActiveNotification(msg_mgr_notification_type_t noti_type, MSG_MGR_MESSAGE_INFO_S *msg_info);
329 int MsgMgrRefreshNotification(msg_mgr_notification_type_t noti_type, bool bFeedback, msg_mgr_active_notification_type_t active_type);
330 int MsgMgrAddReportNotification(msg_mgr_notification_type_t noti_type, MSG_MGR_MESSAGE_INFO_S *msg_info);
331 int MsgMgrDeleteReportNotification(const char *addr);
332 int MsgMgrAddNotification(msg_mgr_notification_type_t noti_type, MSG_MGR_MESSAGE_INFO_S *msg_info);
333 int MsgMgrDeleteNoti(msg_mgr_notification_type_t noti_type, int simIndex);
334 int MsgMgrDeleteSentReadReportNotification();
336 void MsgMgrRefreshAllNotification(bool bWithSimNoti, bool bFeedback, msg_mgr_active_notification_type_t active_type);
337 int MsgMgrInsertInstantMessage(msg_mgr_notification_type_t noti_type);
338 bool MsgMgrCheckNotificationSettingEnable();
339 int MsgMgrInsertTicker(const char* pTickerMsg, const char* pLocaleTickerMsg, bool bPlayFeedback, int msgId);
340 int MsgMgrInsertBadge(unsigned int unreadMsgCnt);
343 #endif /*__MSG_MGR_NOTIFICATION_H__ */