/* * Copyright 2012 Samsung Electronics Co., Ltd * * Licensed under the Flora License, Version 1.1 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://floralicense.org/license * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __MSG_UTIL_H__ #define __MSG_UTIL_H__ #include #include #include "dlog.h" #include #include "msg-ui-bundle.h" #include #include #include #ifndef MSG_BOOL #define MSG_BOOL char #endif #ifndef TRUE #define TRUE 1 #endif #ifndef FALSE #define FALSE 0 #endif #define MESSAGE_PKGNAME "message" #define _EDJ(o) elm_layout_edje_get(o) #define TAG_MSG_UI "MESSAGE_APP" #define MSG_UI_LEVEL_DEBUG 0 #define MSG_UI_LEVEL_ERR 1 #define MSG_UI_LEVEL_ASSERT 2 #define DEF_BUF_LEN_D (10) #define DEF_BUF_LEN_S (128) #define DEF_BUF_LEN (512) #define DEF_BUF_LEN_L (4096) #define DEF_PATH_MAX (4096) #define DEF_IMG_PATH_LEN (1024) #define DEF_MAX_MSG_TEXT_LEN (153*15) #define MSG_UI_URL_MAX_LEN (1024) #define DEF_MAX_EMAIL_LEN (255) #define DEF_MAX_FILTER_LEN (40) #define DEF_THREAD_ADDR_LEN (200) #define DEF_THREAD_NAME_LEN (200) #define DEF_VALID_ADDRESS_LEN (9) #define MSG_UI_TIME_PATTERN_12H "hma" #define MSG_UI_TIME_PATTERN_24H "Hm" #define MSG_UI_DATE_PATTERN_DEFAULT "EEEMMMdd" #define MSG_UI_DATE_PATTERN_YEAR "EEEMMMddyyyy" enum { MSG_UI_RET_ERR = -1, MSG_UI_RET_SUCCESS = 0, }; #define D_PRINT(fmt, args...) \ LOG(LOG_DEBUG, TAG_MSG_UI, fmt, ##args); #define D_MSG(fmt, args...) \ LOG(LOG_DEBUG, TAG_MSG_UI, "\n[%s %s() #%d ]" fmt "\n", (rindex(__FILE__, '/') ? (rindex(__FILE__, '/')+1) : __FILE__), __FUNCTION__, __LINE__, ##args); #define D_EMSG(fmt, args...) \ LOG(LOG_ERROR, TAG_MSG_UI, "\n[ERROR][%s %s() #%d ]" fmt "\n", (rindex(__FILE__, '/') ? (rindex(__FILE__, '/')+1) : __FILE__), __FUNCTION__, __LINE__, ##args); #define D_ENTER\ LOG(LOG_DEBUG, TAG_MSG_UI, "\n[ENTER][%s %s(%p) #%d ]>>>>>\n", (rindex(__FILE__, '/') ? (rindex(__FILE__, '/')+1) : __FILE__), __FUNCTION__, __FUNCTION__, __LINE__); #define D_LEAVE\ LOG(LOG_DEBUG, TAG_MSG_UI, "\n[LEAVE][%s %s() #%d]<<<<<\n", (rindex(__FILE__, '/') ? (rindex(__FILE__, '/')+1) : __FILE__), __FUNCTION__, __LINE__); #define D_MSG_RETM_IF(expr, fmt, args...) do { \ if (expr) { \ 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); \ return; \ } \ } while (0) #define D_MSG_RETVM_IF(expr, val, fmt, args...) do { \ if (expr) { \ 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); \ return (val); \ } \ } while (0) #define MSG_UI_DEBUG(level, fmt, args...) \ LOG(LOG_DEBUG, TAG_MSG_UI, "\n[File: %s : %s() #%d] " fmt "\n", (rindex(__FILE__, '/') ? (rindex(__FILE__, '/')+1) : __FILE__), __FUNCTION__, __LINE__, ##args); #define MSG_UI_ENTER(level) \ LOG(LOG_DEBUG, TAG_MSG_UI, "\n[File: %s : %s() #%d] enter \n", (rindex(__FILE__, '/') ? (rindex(__FILE__, '/')+1) : __FILE__), __FUNCTION__, __LINE__); #define MSG_UI_LEAVE(level) \ LOG(LOG_DEBUG, TAG_MSG_UI, "\n[File: %s : %s() #%d] leave \n", (rindex(__FILE__, '/') ? (rindex(__FILE__, '/')+1) : __FILE__), __FUNCTION__, __LINE__); #define MSG_UI_RET_IF(level, expr) do { \ if (expr) { \ LOG(LOG_ERROR, TAG_MSG_UI, "\n[File: %s : %s() #%d][(%s)] Return\n", (rindex(__FILE__, '/') ? (rindex(__FILE__, '/')+1) : __FILE__), __FUNCTION__, __LINE__, #expr); \ return; \ } \ } while (0) #define MSG_UI_RETV_IF(level, expr, val) do { \ if (expr) { \ 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); \ return (val); \ } \ } while (0) #define MSG_UI_RETM_IF(level, expr, fmt, args...) do { \ if (expr) { \ 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); \ return; \ } \ } while (0) #define MSG_UI_RETVM_IF(level, expr, val, fmt, args...) do { \ if (expr) { \ 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); \ return (val); \ } \ } while (0) #define MSG_THREAD_UG_NAME "msg-thread-efl" #define MSG_COMPOSER_UG_NAME "msg-composer-efl" #define MSG_SETTING_UG_NAME "msg-setting-efl" #define MSG_BUBBLE_UG_NAME "msg-conversation-efl" #define MSG_VIEWER_UG_NAME "msg-viewer-efl" #define PRIVACY_SETTING_UG_NAME "setting-passwd-efl" #define EMAIL_COMPOSER_UG_NAME "email-composer-efl" #define CALL_SETTING_UG_NAME "setting-call-efl" /* Other application's pkg name */ #define VIDEO_CALL_PKG_NAME "org.tizen.vtmain" #define VOICE_CALL_PKG_NAME "org.tizen.call" #define VIDEO_PLAYER_PKG_NAME "org.tizen.video-player" /* NOTIFY MESSAGE */ #define MSG_UI_NOTI_UNDER_CONTRUCT "Under construction" #define MSG_UI_NOTI_BLOCKED "Blocked" #define MSG_UI_NOTI_ALREADY_BLOCKED "Already blocked for this address" /* Navigation icon*/ #define MSG_HEADER_ICON_CANCEL "01_header_icon_cancel.png" #define MSG_HEADER_ICON_DONE "01_header_icon_done.png" #define MSG_TITLE_ICON_VOICECALL "M01_icon_voice_call.png" #define MSG_TITLE_ICON_VIDEOCALL "M01_icon_video_call.png" #define MSG_TITLE_ICON_ADD_TO_CONTACT "01_controllbar_icon_add_to_contact.png" #define MSG_TITLE_ICON_BLOCK "M01_icon_block.png" #define MSG_TITLE_ICON_UNBLOCK "M01_icon_unblock.png" typedef enum { MSG_TIME_FORMAT_12H = 0, MSG_TIME_FORMAT_24H, MSG_TIME_FORMAT_UNKNOWN } msg_time_format; enum { CONTROLBAR_ITEM_1 = 0, CONTROLBAR_ITEM_2, CONTROLBAR_ITEM_3, CONTROLBAR_ITEM_4, CONTROLBAR_ITEM_MAX }; enum { MSG_UI_STATE_NONE = 0, MSG_UI_STATE_RUNNING, MSG_UI_STATE_PAUSE, MSG_UI_STATE_DESTROY, MSG_UI_STATE_MAX, }; #endif /* __MSG_UTIL_H__ */