add po files temporarily
[platform/core/messaging/msg-service.git] / manager / inc / msg-manager-notification.h
1 /*
2  * Copyright (c) 2016 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_MGR_NOTIFICATION_H__
18 #define __MSG_MGR_NOTIFICATION_H__
19
20 /*==================================================================================================
21                                          INCLUDE FILES
22 ==================================================================================================*/
23 #include <msg.h>
24
25 #include <app_control.h>
26
27 /*==================================================================================================
28                                     DEFINES
29 ==================================================================================================*/
30
31 #define MSG_NOTI_INTEGRATION
32
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"
40
41 #define MSG_MGR_APP_ID                          "org.tizen.msg-manager"
42 #define MSG_DEFAULT_APP_ID                      "org.tizen.message"
43 #define MSG_QUICKPANEL_APP_ID           "org.tizen.quickpanel"
44 #define MSG_CALL_APP_ID                         "org.tizen.call-ui"
45 #define MSG_SETTING_APP_ID                      "org.tizen.setting"
46
47 #define MSG_APP_PACKAGE_NAME    "message"
48
49 #define MSG_APP_LOCALEDIR                       TZ_SYS_RO_APP_PATH "/" MSG_MGR_APP_ID "/res/locale"
50
51 #define MSG_NOTIFICATION_ICON_DIR                       "/" MSG_QUICKPANEL_APP_ID "/shared/res/noti_icons"
52
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"
68
69 /* status bar icon */
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
77 #ifndef TIZEN_I586_ENABLED
78 /* system string */
79 #define NEW_MESSAGE                     "IDS_MSGF_POP_NEW_MESSAGE"
80 #define NEW_MESSAGES                    "IDS_MSGF_POP_NEW_MESSAGES"
81 #define MSG_UNKNOWN_SENDER      "IDS_MSGF_BODY_UNKNOWN"
82 #define MSG_NO_SUBJECT                  "IDS_MSGF_BODY_NO_SUBJECT"
83
84
85 /* message app string for ticker noti */
86 #define SENDING_MULTIMEDIA_MESSAGE_FAILED       "IDS_MSGF_POP_SENDING_MULTIMEDIA_MESSAGE_FAILED"
87 #define MESSAGE_RETRIEVED                                                               "IDS_MSGF_BODY_MESSAGE_RETRIEVED"
88 #define SMS_MESSAGE_SENDING_FAIL                                        "IDS_MSGF_POP_SENDING_MESSAGE_FAILED"
89 #define SMS_MESSAGE_SIM_MESSAGE_FULL                            "IDS_MSGF_BODY_SIM_MEMORY_FULL_DELETE_SOME_ITEMS"
90 #define SMS_MESSAGE_MEMORY_FULL                 "IDS_MSGF_POP_NOT_ENOUGH_MEMORY_DELETE_SOME_ITEMS"
91 #define SMS_SIM_CARD_FULL                               "IDS_MSG_HEADER_SIM_CARD_FULL"
92
93 /* message app string for quickpanel noti */
94 #define MSG_MESSAGE             "IDS_MSGF_BODY_MESSAGE"
95 #define VOICE_MAIL                                      "IDS_MSGF_BODY_VOICEMAIL"
96 #define NEW_VOICE_MAIL                  "IDS_MSGF_BODY_NEW_VOICEMAIL"
97 #define CB_MESSAGE "IDS_MSGF_BODY_CB_MESSAGES"
98 #define CP_MESSAGE "IDS_MSGF_BODY_CP_MESSAGES"
99 #define PUSH_MESSAGE "IDS_MSGF_BODY_PUSH_MESSAGES"
100 #define DELIVERY_MESSAGE "IDS_MSGF_BODY_DELIVERY_REPORT"
101 #define READ_REPORT_MESSAGE "IDS_MSGF_POP_READ_REPORT"
102 #define EXPIRED_MESSAGE "IDS_MSGF_BODY_MESSAGE_HAS_EXPIRED"
103 #define REJECTED_MESSAGE "IDS_MSGF_BODY_MMSDELIVERYMSGREJECTED"
104 #define DEFERRED_MESSAGE "IDS_MSGF_POP_MESSAGE_DEFERRED"
105 #define UNRECOGNISED_MESSAGE "IDS_MSGF_POP_MESSAGE_UNRECOGNISED"
106 #define INDETEMINATE_MESSAGE "IDS_MSGF_POP_INDETERMINATE"
107 #define UNREACHABLE_MESSAGE "IDS_MSGF_POP_UNREACHABLE"
108 #define DELIVERED_MESSAGE "IDS_MSGF_BODY_MESSAGE_DELIVERED"
109 #define VOICE_1_MESSAGE "IDS_MSGF_BODY_1_MESSAGE"
110 #define VOICE_N_MESSAGE "IDS_MSGF_BODY_PD_MESSAGES"
111 #define SIM_CARD_MESSAGE                "IDS_MSGF_BODY_SIM_CARD_MESSAGES"
112 #define READ_REPORT_READ                "IDS_COM_BODY_READ"
113 #define READ_REPORT_DELETE      "IDS_MSG_OPT_DELETE"
114 #define FAILED_MSG_EXIST        "IDS_MSG_BODY_FAILED_MESSAGES_EXIST"
115 #define ENABLE_EMERGENCY_MODE   "IDS_MSG_BODY_ENABLE_EMERGENCY_MODE_JPN_DCM"
116 #define EMERGENCY_MODE_DESCRIPTION      "IDS_MSG_SBODY_TAP_HERE_TO_ENABLE_EMERGENCY_MODE_TO_SAVE_BATTERY_POWER_JPN_DCM"
117 #define FAILED_TO_SEND_MESSAGE  "IDS_MSG_HEADER_FAILED_TO_SEND_MESSAGE_ABB"
118 #define MESSAGE_SIZE_UNIT_KB    "IDS_MSGF_BODY_MSGSIZE_KB"
119 #define MESSAGE_SIZE_STRING             "IDS_MSGF_BODY_MESSAGE_SIZE"
120 #define MSG_SUBJECT_COLON       "IDS_MSGF_OPT_SUBJECT_COLON"
121 #else
122 /* system string */
123 #define NEW_MESSAGE                     "New message"
124 #define NEW_MESSAGES                    "New messages"
125 #define MSG_UNKNOWN_SENDER      "New message from Unknown."
126 #define MSG_NO_SUBJECT                  "No subject"
127
128
129 /* message app string for ticker noti */
130 #define SMS_MESSAGE_MEMORY_FULL                 "Not enough memory. Delete some items."
131 #define SMS_SIM_CARD_FULL                               "SIM card full"
132
133 /* message app string for quickpanel noti */
134 #define MSG_MESSAGE             "Message"
135 #define VOICE_MAIL                                      "Voicemail"
136 #define NEW_VOICE_MAIL                  "New voicemail"
137 #define CB_MESSAGE "CB messages"
138 #define CP_MESSAGE "CP messages"
139 #define PUSH_MESSAGE "Push messages"
140 #define DELIVERY_MESSAGE "Delivery report"
141 #define READ_REPORT_MESSAGE "Read report"
142 #define EXPIRED_MESSAGE "Message expired."
143 #define REJECTED_MESSAGE "Message rejected."
144 #define DEFERRED_MESSAGE "Message deferred"
145 #define UNRECOGNISED_MESSAGE "Message unrecognised"
146 #define INDETEMINATE_MESSAGE "Indeterminate."
147 #define UNREACHABLE_MESSAGE "Unreachable"
148 #define DELIVERED_MESSAGE "Message delivered"
149 #define VOICE_1_MESSAGE "1 message"
150 #define VOICE_N_MESSAGE "%d messages"
151 #define SIM_CARD_MESSAGE                "SIM card messages"
152 #define READ_REPORT_READ                "Read"
153 #define READ_REPORT_DELETE      "Deleted."
154 #define FAILED_MSG_EXIST        "Failed messages exist."
155 #define ENABLE_EMERGENCY_MODE   "Enable Emergency mode"
156 #define EMERGENCY_MODE_DESCRIPTION      "Tap here to enable Emergency mode to save battery power."
157 #define FAILED_TO_SEND_MESSAGE  "Failed to send message."
158 #define MESSAGE_SIZE_UNIT_KB    "KB"
159 #define MESSAGE_SIZE_STRING             "Message Size"
160 #define MSG_SUBJECT_COLON       "Subject:"
161 #endif
162
163
164 #define NOTIFICATION_PRIV_ID    "db/private/msg-service/notification_priv_id"
165 #define VOICE_NOTI_ID_1                 "db/private/msg-service/voice_noti_id1"
166 #define VOICE_NOTI_ID_2                 "db/private/msg-service/voice_noti_id2"
167 #define CB_NOTI_PRIV_ID                 "db/private/msg-service/cb_noti_priv_id"
168 #define SIM_MSG_NOTI_PRIV_ID    "db/private/msg-service/sim_msg_noti_priv_id"
169 #define MSG_SENTFAIL_NOTI_ID            "db/private/msg-service/sentfail_noti_id"
170 #define SIM_FULL_NOTI_PRIV_ID   "db/private/msg-service/sim_full_noti_id"
171
172 #define MSG_SETTING_NOTIFICATION        "db/private/msg-service/general/notification"
173 #define MSG_SETTING_VIBRATION           "db/private/msg-service/general/vibration"
174 #define MSG_SETTING_PREVIEW                     "db/private/msg-service/general/preview"
175 #define MSG_SETTING_RINGTONE_PATH                       "db/private/msg-service/general/ringtone_path"
176 #define MSG_SETTING_RINGTONE_TYPE                       "db/private/msg-service/general/ringtone_type"
177
178 #define VOICEMAIL_NUMBER                                "db/private/msg-service/voice_mail/voice_mail_number"
179 #define VOICEMAIL_COUNT                         "db/private/msg-service/voice_mail/voice_mail_count"
180 #define VOICEMAIL_ALPHA_ID                              "db/private/msg-service/voice_mail/voice_mail_alphaid"
181 #define VOICEMAIL_DEFAULT_NUMBER                "db/private/msg-service/voice_mail/voice_mail_default_number"
182 #define VOICEMAIL_DEFAULT_ALPHA_ID              ""
183
184 #define MSG_ALERT_REP_TYPE                      "db/setting/sound/noti/msg_alert_rep_type"
185
186 #define MSG_TEL_URI_VOICEMAIL           "tel:VOICEMAIL"
187
188 #define MSG_NOTI_TEXT_LEN       (512)
189 #define MSG_NOTI_TEXT_LEN_S     (256)
190 #define MAX_VCONFKEY_NAME_LEN   128
191 #define MSG_ACTIVE_NOTI_BUTTON_NUM 3
192 #define MAX_QUERY_LEN           4096
193
194
195
196 typedef unsigned char msg_mgr_notification_type_t; /* _msg_notification_type_e */
197 typedef unsigned char msg_mgr_active_notification_type_t; /* _msg_active_notification_type_e */
198
199
200 /*==================================================================================================
201                                      ENUMS
202 ==================================================================================================*/
203
204 enum _msg_mgr_notification_type_e {
205         MSG_MGR_NOTI_TYPE_ALL = 0x00,
206
207         /* Refresh single/multiple notification */
208         MSG_MGR_NOTI_TYPE_NORMAL,
209         MSG_MGR_NOTI_TYPE_CB,
210         MSG_MGR_NOTI_TYPE_SIM,
211         MSG_MGR_NOTI_TYPE_FAILED,
212
213         /* Add only single notification */
214         MSG_MGR_NOTI_TYPE_VOICE_1,
215         MSG_MGR_NOTI_TYPE_VOICE_2,
216         MSG_MGR_NOTI_TYPE_MWI,
217         MSG_MGR_NOTI_TYPE_CLASS0,
218         MSG_MGR_NOTI_TYPE_SMS_DELIVERY_REPORT,
219         MSG_MGR_NOTI_TYPE_MMS_READ_REPORT,
220         MSG_MGR_NOTI_TYPE_MMS_DELIVERY_REPORT,
221
222         MSG_MGR_NOTI_TYPE_SIM_FULL,
223 };
224
225
226 enum _msg_mgr_active_notification_type_e {
227         MSG_MGR_ACTIVE_NOTI_TYPE_NONE,
228         MSG_MGR_ACTIVE_NOTI_TYPE_ACTIVE,
229         MSG_MGR_ACTIVE_NOTI_TYPE_INSTANT,
230 };
231
232
233 enum _msg_maintype_e
234 {
235         MSG_UNKNOWN_TYPE = 0,           /**< Unknown main type */
236         MSG_SMS_TYPE,                           /**< SMS */
237         MSG_MMS_TYPE,                           /**< MMS */
238 };
239
240
241 enum _msg_subtype_e
242 {
243         /* SMS Specific Message Type */
244         MSG_NORMAL_SMS = 0,                     /**< Text SMS message */
245         MSG_CB_SMS,                                     /**< Cell Broadcasting  message */
246         MSG_JAVACB_SMS,                         /**< JAVA Cell Broadcasting  message */
247         MSG_TYPE0_SMS,                                  /**< Short Message Type 0 */
248         MSG_REPLACE_TYPE1_SMS,          /**< Replace Short Message Type 1 */
249         MSG_REPLACE_TYPE2_SMS,          /**< Replace Short Message Type 2 */
250         MSG_REPLACE_TYPE3_SMS,          /**< Replace Short Message Type 3 */
251         MSG_REPLACE_TYPE4_SMS,          /**< Replace Short Message Type 4 */
252         MSG_REPLACE_TYPE5_SMS,          /**< Replace Short Message Type 5 */
253         MSG_REPLACE_TYPE6_SMS,          /**< Replace Short Message Type 6 */
254         MSG_REPLACE_TYPE7_SMS,          /**< Replace Short Message Type 7 */
255         MSG_WAP_SI_SMS,                         /**< WAP Push Message SI */
256         MSG_WAP_SL_SMS,                         /**< WAP Push Message SL */
257         MSG_WAP_CO_SMS,                         /**< WAP Push Message CO */
258         MSG_MWI_VOICE_SMS,                      /**< MWI Message Voice */
259         MSG_MWI_FAX_SMS,                                /**< MWI Message Fax */
260         MSG_MWI_EMAIL_SMS,                      /**< MWI Message Email */
261         MSG_MWI_OTHER_SMS,                      /**< MWI Message Other */
262         MSG_STATUS_REPORT_SMS,          /**< SMS-STATUS-REPORT */
263         MSG_SYNCML_CP,                          /**< SyncML Message CP */
264         MSG_LBS_SMS,                                    /**< LBS Message */
265         MSG_REJECT_SMS,                         /**< Reject Message */
266         MSG_CONCAT_SIM_SMS,                     /**< Concatenated Message in SIM */
267 };
268
269 /*==================================================================================================
270                                          STRUCTURES
271 ==================================================================================================*/
272 typedef struct _msg_mgr_message_info_s {
273         msg_message_id_t msgId;
274         int sim_idx;
275         time_t displayTime;
276         msg_network_status_t networkStatus;
277         char displayName[MAX_DISPLAY_NAME_LEN+1];
278         char addressVal[MAX_ADDRESS_VAL_LEN+1];
279         char msgText[MAX_MSG_TEXT_LEN+1];
280 } MSG_MGR_MESSAGE_INFO_S;
281
282 /*==================================================================================================
283                                      FUNCTION PROTOTYPES
284 ==================================================================================================*/
285
286 void MsgMgrInitNoti();
287
288 int MsgMgrInsertOnlyActiveNotification(msg_mgr_notification_type_t noti_type, MSG_MGR_MESSAGE_INFO_S *msg_info);
289 int MsgMgrRefreshNotification(msg_mgr_notification_type_t noti_type, bool bFeedback, msg_mgr_active_notification_type_t active_type);
290 int MsgMgrAddReportNotification(msg_mgr_notification_type_t noti_type, MSG_MGR_MESSAGE_INFO_S *msg_info);
291 int MsgMgrDeleteReportNotification(const char *addr);
292 int MsgMgrAddNotification(msg_mgr_notification_type_t noti_type, MSG_MGR_MESSAGE_INFO_S *msg_info);
293 int MsgMgrDeleteNoti(msg_mgr_notification_type_t noti_type, int simIndex);
294
295 void MsgMgrRefreshAllNotification(bool bWithSimNoti, bool bFeedback, msg_mgr_active_notification_type_t active_type);
296 int MsgMgrInsertInstantMessage(msg_mgr_notification_type_t noti_type);
297 bool MsgMgrCheckNotificationSettingEnable();
298 int MsgMgrInsertTicker(const char* pTickerMsg, const char* pLocaleTickerMsg, bool bPlayFeedback, int msgId);
299 int MsgMgrInsertBadge(unsigned int unreadMsgCnt);
300
301
302 #endif /*__MSG_MGR_NOTIFICATION_H__ */
303