2 * Copyright 2012 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.tizenopensource.org/license
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.
18 #ifndef __MSG_UTIL_H__
19 #define __MSG_UTIL_H__
26 #include "msg-ui-bundle.h"
28 #include <unicode/udat.h>
29 #include <unicode/utypes.h>
30 #include <unicode/ustring.h>
43 #define MESSAGE_PKGNAME "message"
45 #define _EDJ(o) elm_layout_edje_get(o)
47 #define TAG_MSG_UI "MESSAGE_APP"
49 #define MSG_UI_LEVEL_DEBUG 0
50 #define MSG_UI_LEVEL_ERR 1
51 #define MSG_UI_LEVEL_ASSERT 2
53 #define DEF_BUF_LEN_D (10)
54 #define DEF_BUF_LEN_S (128)
55 #define DEF_BUF_LEN (512)
56 #define DEF_BUF_LEN_L (4096)
58 #define DEF_PATH_MAX (4096)
59 #define DEF_IMG_PATH_LEN (1024)
60 #define DEF_MAX_MSG_TEXT_LEN (1530)
61 #define MSG_UI_URL_MAX_LEN (1024)
62 #define DEF_MAX_EMAIL_LEN (255)
64 #define DEF_THREAD_ADDR_LEN (200)
65 #define DEF_THREAD_NAME_LEN (200)
67 #define DEF_VALID_ADDRESS_LEN (9)
69 #define MSG_UI_TIME_PATTERN_12H "hma"
70 #define MSG_UI_TIME_PATTERN_24H "Hm"
74 MSG_UI_RET_SUCCESS = 0,
77 #define D_PRINT(fmt, args...) \
78 LOG(LOG_DEBUG, TAG_MSG_UI, fmt, ##args);
80 #define D_MSG(fmt, args...) \
81 LOG(LOG_DEBUG, TAG_MSG_UI, "\n[%s %s() #%d ]" fmt "\n", (rindex(__FILE__, '/') ? (rindex(__FILE__, '/')+1) : __FILE__), __FUNCTION__, __LINE__, ##args);
83 #define D_EMSG(fmt, args...) \
84 LOG(LOG_DEBUG, TAG_MSG_UI, "\n[ERROR][%s %s() #%d ]" fmt "\n", (rindex(__FILE__, '/') ? (rindex(__FILE__, '/')+1) : __FILE__), __FUNCTION__, __LINE__, ##args);
87 LOG(LOG_DEBUG, TAG_MSG_UI, "\n[ENTER][%s %s(%p) #%d ]>>>>>\n", (rindex(__FILE__, '/') ? (rindex(__FILE__, '/')+1) : __FILE__), __FUNCTION__, __FUNCTION__, __LINE__);
90 LOG(LOG_DEBUG, TAG_MSG_UI, "\n[LEAVE][%s %s() #%d]<<<<<\n", (rindex(__FILE__, '/') ? (rindex(__FILE__, '/')+1) : __FILE__), __FUNCTION__, __LINE__);
92 #define D_MSG_RETM_IF(expr, fmt, args...) do { \
94 LOG(LOG_ERROR, TAG_MSG_UI, "\n[File: %s : %s() #%d][(%s)] Return message : " fmt "\n", (rindex(__FILE__, '/') ? (rindex(__FILE__, '/')+1) : __FILE__), __FUNCTION__, __LINE__, #expr, ##args); \
99 #define D_MSG_RETVM_IF(expr, val, fmt, args...) do { \
101 LOG(LOG_ERROR, TAG_MSG_UI, "\n[File: %s : %s() #%d][(%s)] Return value : %d, message : " fmt "\n", (rindex(__FILE__, '/') ? (rindex(__FILE__, '/')+1) : __FILE__), __FUNCTION__, __LINE__, #expr, val, ##args); \
107 #define MSG_UI_DEBUG(level, fmt, args...) \
108 LOG(LOG_DEBUG, TAG_MSG_UI, "\n[File: %s : %s() #%d] " fmt "\n", (rindex(__FILE__, '/') ? (rindex(__FILE__, '/')+1) : __FILE__), __FUNCTION__, __LINE__, ##args);
109 #define MSG_UI_ENTER(level) \
110 LOG(LOG_DEBUG, TAG_MSG_UI, "\n[File: %s : %s() #%d] enter \n", (rindex(__FILE__, '/') ? (rindex(__FILE__, '/')+1) : __FILE__), __FUNCTION__, __LINE__);
111 #define MSG_UI_LEAVE(level) \
112 LOG(LOG_DEBUG, TAG_MSG_UI, "\n[File: %s : %s() #%d] leave \n", (rindex(__FILE__, '/') ? (rindex(__FILE__, '/')+1) : __FILE__), __FUNCTION__, __LINE__);
114 #define MSG_UI_RET_IF(level, expr) do { \
116 LOG(LOG_ERROR, TAG_MSG_UI, "\n[File: %s : %s() #%d][(%s)] Return\n", (rindex(__FILE__, '/') ? (rindex(__FILE__, '/')+1) : __FILE__), __FUNCTION__, __LINE__, #expr); \
120 #define MSG_UI_RETV_IF(level, expr, val) do { \
122 LOG(LOG_ERROR, TAG_MSG_UI, "\n[File: %s : %s() #%d][(%s)] Return value : %d\n", (rindex(__FILE__, '/') ? (rindex(__FILE__, '/')+1) : __FILE__), __FUNCTION__, __LINE__, #expr, val); \
126 #define MSG_UI_RETM_IF(level, expr, fmt, args...) do { \
128 LOG(LOG_ERROR, TAG_MSG_UI, "\n[File: %s : %s() #%d][(%s)] Return message : " fmt "\n", (rindex(__FILE__, '/') ? (rindex(__FILE__, '/')+1) : __FILE__), __FUNCTION__, __LINE__, #expr, ##args); \
132 #define MSG_UI_RETVM_IF(level, expr, val, fmt, args...) do { \
134 LOG(LOG_ERROR, TAG_MSG_UI, "\n[File: %s : %s() #%d][(%s)] Return value : %d, message : " fmt "\n", (rindex(__FILE__, '/') ? (rindex(__FILE__, '/')+1) : __FILE__), __FUNCTION__, __LINE__, #expr, val, ##args); \
140 #define MSG_THREAD_UG_NAME "msg-thread-efl"
141 #define MSG_COMPOSER_UG_NAME "msg-composer-efl"
142 #define MSG_SETTING_UG_NAME "msg-setting-efl"
143 #define MSG_BUBBLE_UG_NAME "msg-conversation-efl"
144 #define MSG_VIEWER_UG_NAME "msg-viewer-efl"
146 #define PRIVACY_SETTING_UG_NAME "setting-passwd-efl"
147 #define EMAIL_COMPOSER_UG_NAME "email-composer-efl"
148 #define CALL_SETTING_UG_NAME "setting-call-efl"
150 /* Other application's pkg name */
151 #define VIDEO_CALL_PKG_NAME "org.tizen.vtmain"
152 #define VOICE_CALL_PKG_NAME "org.tizen.call"
153 #define VIDEO_PLAYER_PKG_NAME "org.tizen.video-player"
156 #define MSG_UI_NOTI_UNDER_CONTRUCT "Under construction"
157 #define MSG_UI_NOTI_BLOCKED "Blocked"
158 #define MSG_UI_NOTI_ALREADY_BLOCKED "Already blocked for this address"
161 #define MSG_HEADER_ICON_CANCEL IMGDIR"/01_header_icon_cancel.png"
162 #define MSG_HEADER_ICON_DONE IMGDIR"/01_header_icon_done.png"
164 #define MSG_TITLE_ICON_VOICECALL IMGDIR"/M01_icon_voice_call.png"
165 #define MSG_TITLE_ICON_VIDEOCALL IMGDIR"/M01_icon_video_call.png"
166 #define MSG_TITLE_ICON_ADD_TO_CONTACT IMGDIR"/01_controllbar_icon_add_to_contact.png"
167 #define MSG_CONTROLBAR_ICON_VIEW_CONTACT IMGDIR"/M01_icon_view_contact.png"
169 /* Controlbar Icon */
170 #define MSG_CONTROLBAR_IMG_PATH IMGDIR"/controlbar/"
172 #define MSG_CONTROLBAR_ICON_COMPOSE MSG_CONTROLBAR_IMG_PATH"01_controlbar_icon_compose.png"
173 #define MSG_CONTROLBAR_ICON_CANCEL MSG_CONTROLBAR_IMG_PATH"01_controllbar_icon_close.png"
174 #define MSG_CONTROLBAR_ICON_DELETE MSG_CONTROLBAR_IMG_PATH"01_controlbar_icon_delete.png"
175 #define MSG_CONTROLBAR_ICON_FORWARD MSG_CONTROLBAR_IMG_PATH"01_controlbar_icon_forward.png"
176 #define MSG_CONTROLBAR_ICON_MORE MSG_CONTROLBAR_IMG_PATH"M01_controlbar_icon_more.png"
177 #define MSG_CONTROLBAR_ICON_SETTINGS MSG_CONTROLBAR_IMG_PATH"01_controlbar_icon_settings.png"
178 #define MSG_CONTROLBAR_ICON_EDIT MSG_CONTROLBAR_IMG_PATH"01_controlbar_icon_edit.png"
181 #define MSG_CONTROLBAR_ICON_PAUSE MSG_CONTROLBAR_IMG_PATH"01_controlbar_icon_pause.png"
182 #define MSG_CONTROLBAR_ICON_PLAY MSG_CONTROLBAR_IMG_PATH"01_controlbar_icon_Play.png"
183 #define MSG_CONTROLBAR_ICON_SAVE MSG_CONTROLBAR_IMG_PATH"01_controlbar_icon_save.png"
184 #define MSG_CONTROLBAR_ICON_ATTACH MSG_CONTROLBAR_IMG_PATH"M01_controlbar_icon_attach.png"
185 #define MSG_CONTROLBAR_ICON_REPLY MSG_CONTROLBAR_IMG_PATH"M01_controlbar_icon_reply.png"
186 #define MSG_CONTROLBAR_ICON_RESEND MSG_CONTROLBAR_IMG_PATH"M01_controlbar_icon_resend.png"
189 #define MSG_CONTROLBAR_ICON_CREATE MSG_CONTROLBAR_IMG_PATH"01_controlbar_icon_create.png"
193 MSG_TIME_FORMAT_12H = 0,
195 MSG_TIME_FORMAT_UNKNOWN
200 CONTROLBAR_ITEM_1 = 0,
207 MSG_UI_STATE_NONE = 0,
208 MSG_UI_STATE_RUNNING,
210 MSG_UI_STATE_DESTROY,
214 #endif /* __MSG_UTIL_H__ */