diff options
author | Kim Kibum <kb0929.kim@samsung.com> | 2012-06-08 14:54:07 +0900 |
---|---|---|
committer | Kim Kibum <kb0929.kim@samsung.com> | 2012-06-08 14:54:07 +0900 |
commit | 5f6271abd18e2d811315f56c48ecd927c9e9436c (patch) | |
tree | 8c85b9a44e77a3d9d095a92962c18882592f16a7 /common | |
parent | 49f24a8d096e66cccb869a4da0ec38a069eae870 (diff) | |
download | message-app-5f6271abd18e2d811315f56c48ecd927c9e9436c.tar.gz message-app-5f6271abd18e2d811315f56c48ecd927c9e9436c.tar.bz2 message-app-5f6271abd18e2d811315f56c48ecd927c9e9436c.zip |
apply FSL(Flora Software License)
Diffstat (limited to 'common')
77 files changed, 854 insertions, 0 deletions
diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt new file mode 100755 index 0000000..3529d93 --- /dev/null +++ b/common/CMakeLists.txt @@ -0,0 +1,49 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) +PROJECT(msg-common C) + +SET(VERSION 0.1.0) +################################# +# Message Common # +################################# + +SET(COMMON_SRCS + ./msg-ui-common-utility.c +) + +INCLUDE_DIRECTORIES( + ${CMAKE_SOURCE_COMMON_DIR} +) + +INCLUDE(FindPkgConfig) +pkg_check_modules(pkgs REQUIRED + appcore-common appcore-efl appsvc + bundle + capi-appfw-application contacts-service + dlog devman_haptic + elementary ecore ecore-x ecore-input ecore-imf ecore-file eina + glib-2.0 + heynoti + icu-i18n + msg-service + ui-gadget + utilX + vconf +) + +FOREACH(flag ${pkgs_CFLAGS}) + SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") +ENDFOREACH(flag) + +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") +SET(CMAKE_C_FLAGS_DEBUG "-O0 -g") + +ADD_DEFINITIONS("-DFACTORYFS=\"$ENV{PREFIX}\"") +ADD_DEFINITIONS("-DDATAFS=\"$ENV{DATADIR}\"") +ADD_DEFINITIONS("-DTARGET") + +ADD_LIBRARY(${PROJECT_NAME} SHARED ${COMMON_SRCS}) +SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${VERSION} ) +TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} ${CMAKE_LDFLAGS}) + +# Install so files. +INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIBDIR}) diff --git a/common/data/edc_image/00_button_03_dim.png b/common/data/edc_image/00_button_03_dim.png Binary files differnew file mode 100755 index 0000000..118cbb9 --- /dev/null +++ b/common/data/edc_image/00_button_03_dim.png diff --git a/common/data/edc_image/00_button_03_focus.png b/common/data/edc_image/00_button_03_focus.png Binary files differnew file mode 100755 index 0000000..e0f8ebf --- /dev/null +++ b/common/data/edc_image/00_button_03_focus.png diff --git a/common/data/edc_image/00_button_03_normal.png b/common/data/edc_image/00_button_03_normal.png Binary files differnew file mode 100755 index 0000000..118cbb9 --- /dev/null +++ b/common/data/edc_image/00_button_03_normal.png diff --git a/common/data/edc_image/00_button_03_press.png b/common/data/edc_image/00_button_03_press.png Binary files differnew file mode 100755 index 0000000..2f0dbc3 --- /dev/null +++ b/common/data/edc_image/00_button_03_press.png diff --git a/common/data/edc_image/00_list_bar_group_middle_focus.png b/common/data/edc_image/00_list_bar_group_middle_focus.png Binary files differnew file mode 100755 index 0000000..96374f5 --- /dev/null +++ b/common/data/edc_image/00_list_bar_group_middle_focus.png diff --git a/common/data/edc_image/00_list_bar_press_1x80.png b/common/data/edc_image/00_list_bar_press_1x80.png Binary files differnew file mode 100755 index 0000000..0e0becb --- /dev/null +++ b/common/data/edc_image/00_list_bar_press_1x80.png diff --git a/common/data/edc_image/00_list_photo_default.png b/common/data/edc_image/00_list_photo_default.png Binary files differnew file mode 100755 index 0000000..2d15281 --- /dev/null +++ b/common/data/edc_image/00_list_photo_default.png diff --git a/common/data/edc_image/00_sweep_list_bg.png b/common/data/edc_image/00_sweep_list_bg.png Binary files differnew file mode 100755 index 0000000..b08f111 --- /dev/null +++ b/common/data/edc_image/00_sweep_list_bg.png diff --git a/common/data/edc_image/07_message_add files_bg.PNG b/common/data/edc_image/07_message_add files_bg.PNG Binary files differnew file mode 100755 index 0000000..074b806 --- /dev/null +++ b/common/data/edc_image/07_message_add files_bg.PNG diff --git a/common/data/edc_image/07_message_bubble_readmessage.png b/common/data/edc_image/07_message_bubble_readmessage.png Binary files differnew file mode 100755 index 0000000..5b57efe --- /dev/null +++ b/common/data/edc_image/07_message_bubble_readmessage.png diff --git a/common/data/edc_image/07_message_bubble_reponsible_message.png b/common/data/edc_image/07_message_bubble_reponsible_message.png Binary files differnew file mode 100755 index 0000000..1e0f324 --- /dev/null +++ b/common/data/edc_image/07_message_bubble_reponsible_message.png diff --git a/common/data/edc_image/07_message_bubble_sentmessage.png b/common/data/edc_image/07_message_bubble_sentmessage.png Binary files differnew file mode 100755 index 0000000..7ae30ba --- /dev/null +++ b/common/data/edc_image/07_message_bubble_sentmessage.png diff --git a/common/data/edc_image/07_message_list_badge_01.png b/common/data/edc_image/07_message_list_badge_01.png Binary files differnew file mode 100755 index 0000000..d1acc0d --- /dev/null +++ b/common/data/edc_image/07_message_list_badge_01.png diff --git a/common/data/edc_image/07_message_list_bg.PNG b/common/data/edc_image/07_message_list_bg.PNG Binary files differnew file mode 100755 index 0000000..2ba50b9 --- /dev/null +++ b/common/data/edc_image/07_message_list_bg.PNG diff --git a/common/data/edc_image/07_message_sweep_list_bg.png b/common/data/edc_image/07_message_sweep_list_bg.png Binary files differnew file mode 100755 index 0000000..d32d1e3 --- /dev/null +++ b/common/data/edc_image/07_message_sweep_list_bg.png diff --git a/common/data/edc_image/27_textinput_predictive_btn_arrow_down.png b/common/data/edc_image/27_textinput_predictive_btn_arrow_down.png Binary files differnew file mode 100755 index 0000000..41932ca --- /dev/null +++ b/common/data/edc_image/27_textinput_predictive_btn_arrow_down.png diff --git a/common/data/edc_image/27_textinput_predictive_btn_arrow_up.png b/common/data/edc_image/27_textinput_predictive_btn_arrow_up.png Binary files differnew file mode 100755 index 0000000..2fdda91 --- /dev/null +++ b/common/data/edc_image/27_textinput_predictive_btn_arrow_up.png diff --git a/common/data/edc_image/M01_btn_Unread_message.png b/common/data/edc_image/M01_btn_Unread_message.png Binary files differnew file mode 100755 index 0000000..68772aa --- /dev/null +++ b/common/data/edc_image/M01_btn_Unread_message.png diff --git a/common/data/edc_image/M01_btn_Unread_message_HD.png b/common/data/edc_image/M01_btn_Unread_message_HD.png Binary files differnew file mode 100755 index 0000000..55004f5 --- /dev/null +++ b/common/data/edc_image/M01_btn_Unread_message_HD.png diff --git a/common/data/edc_image/M01_btn_Unread_message_white_theme.png b/common/data/edc_image/M01_btn_Unread_message_white_theme.png Binary files differnew file mode 100755 index 0000000..68772aa --- /dev/null +++ b/common/data/edc_image/M01_btn_Unread_message_white_theme.png diff --git a/common/data/edc_image/M01_search_input_field_bg.png b/common/data/edc_image/M01_search_input_field_bg.png Binary files differnew file mode 100755 index 0000000..038da87 --- /dev/null +++ b/common/data/edc_image/M01_search_input_field_bg.png diff --git a/common/data/edc_image/Seven_IM_input_field_01.png b/common/data/edc_image/Seven_IM_input_field_01.png Binary files differnew file mode 100755 index 0000000..6125f7e --- /dev/null +++ b/common/data/edc_image/Seven_IM_input_field_01.png diff --git a/common/data/edc_image/Seven_IM_input_field_02.png b/common/data/edc_image/Seven_IM_input_field_02.png Binary files differnew file mode 100755 index 0000000..fed0b36 --- /dev/null +++ b/common/data/edc_image/Seven_IM_input_field_02.png diff --git a/common/data/edc_image/black/07_message_add files_bg.PNG b/common/data/edc_image/black/07_message_add files_bg.PNG Binary files differnew file mode 100755 index 0000000..074b806 --- /dev/null +++ b/common/data/edc_image/black/07_message_add files_bg.PNG diff --git a/common/data/edc_image/black/M01_search_input_field_bg.png b/common/data/edc_image/black/M01_search_input_field_bg.png Binary files differnew file mode 100755 index 0000000..038da87 --- /dev/null +++ b/common/data/edc_image/black/M01_search_input_field_bg.png diff --git a/common/data/edc_image/white/07_message_add files_bg.PNG b/common/data/edc_image/white/07_message_add files_bg.PNG Binary files differnew file mode 100755 index 0000000..074b806 --- /dev/null +++ b/common/data/edc_image/white/07_message_add files_bg.PNG diff --git a/common/data/edc_image/white/M01_icon_minus.png b/common/data/edc_image/white/M01_icon_minus.png Binary files differnew file mode 100755 index 0000000..1943f8d --- /dev/null +++ b/common/data/edc_image/white/M01_icon_minus.png diff --git a/common/data/edc_image/white/M01_search_input_field_bg.png b/common/data/edc_image/white/M01_search_input_field_bg.png Binary files differnew file mode 100755 index 0000000..f5aaa5e --- /dev/null +++ b/common/data/edc_image/white/M01_search_input_field_bg.png diff --git a/common/data/image/00_list_photo_default.png b/common/data/image/00_list_photo_default.png Binary files differnew file mode 100755 index 0000000..2d15281 --- /dev/null +++ b/common/data/image/00_list_photo_default.png diff --git a/common/data/image/01_dialog_field_bg.png b/common/data/image/01_dialog_field_bg.png Binary files differnew file mode 100755 index 0000000..67d3908 --- /dev/null +++ b/common/data/image/01_dialog_field_bg.png diff --git a/common/data/image/01_dialog_field_bg_dim.png b/common/data/image/01_dialog_field_bg_dim.png Binary files differnew file mode 100755 index 0000000..25c4acf --- /dev/null +++ b/common/data/image/01_dialog_field_bg_dim.png diff --git a/common/data/image/01_dialogue_field_bg_press.png b/common/data/image/01_dialogue_field_bg_press.png Binary files differnew file mode 100755 index 0000000..8686f16 --- /dev/null +++ b/common/data/image/01_dialogue_field_bg_press.png diff --git a/common/data/image/01_header_icon_cancel.png b/common/data/image/01_header_icon_cancel.png Binary files differnew file mode 100755 index 0000000..4fb54c3 --- /dev/null +++ b/common/data/image/01_header_icon_cancel.png diff --git a/common/data/image/01_header_icon_done.png b/common/data/image/01_header_icon_done.png Binary files differnew file mode 100755 index 0000000..d771640 --- /dev/null +++ b/common/data/image/01_header_icon_done.png diff --git a/common/data/image/01_navi_icon_delete.png b/common/data/image/01_navi_icon_delete.png Binary files differnew file mode 100755 index 0000000..4f0f16e --- /dev/null +++ b/common/data/image/01_navi_icon_delete.png diff --git a/common/data/image/07_message_sim.png b/common/data/image/07_message_sim.png Binary files differnew file mode 100755 index 0000000..84aff16 --- /dev/null +++ b/common/data/image/07_message_sim.png diff --git a/common/data/image/07_message_title_button.png b/common/data/image/07_message_title_button.png Binary files differnew file mode 100755 index 0000000..3c6909b --- /dev/null +++ b/common/data/image/07_message_title_button.png diff --git a/common/data/image/17_default_image.png b/common/data/image/17_default_image.png Binary files differnew file mode 100755 index 0000000..780985e --- /dev/null +++ b/common/data/image/17_default_image.png diff --git a/common/data/image/60_myfiles_file_etc.png b/common/data/image/60_myfiles_file_etc.png Binary files differnew file mode 100755 index 0000000..26748d8 --- /dev/null +++ b/common/data/image/60_myfiles_file_etc.png diff --git a/common/data/image/M01_btn_Unread_message.png b/common/data/image/M01_btn_Unread_message.png Binary files differnew file mode 100755 index 0000000..55004f5 --- /dev/null +++ b/common/data/image/M01_btn_Unread_message.png diff --git a/common/data/image/M01_btn_Unread_message_HD.png b/common/data/image/M01_btn_Unread_message_HD.png Binary files differnew file mode 100755 index 0000000..55004f5 --- /dev/null +++ b/common/data/image/M01_btn_Unread_message_HD.png diff --git a/common/data/image/M01_btn_Unread_message_press.png b/common/data/image/M01_btn_Unread_message_press.png Binary files differnew file mode 100755 index 0000000..55004f5 --- /dev/null +++ b/common/data/image/M01_btn_Unread_message_press.png diff --git a/common/data/image/M01_btn_Unread_message_press_HD.png b/common/data/image/M01_btn_Unread_message_press_HD.png Binary files differnew file mode 100755 index 0000000..55004f5 --- /dev/null +++ b/common/data/image/M01_btn_Unread_message_press_HD.png diff --git a/common/data/image/M01_icon_OTA.png b/common/data/image/M01_icon_OTA.png Binary files differnew file mode 100755 index 0000000..6143020 --- /dev/null +++ b/common/data/image/M01_icon_OTA.png diff --git a/common/data/image/M01_icon_OTA_HD.png b/common/data/image/M01_icon_OTA_HD.png Binary files differnew file mode 100755 index 0000000..ffeb5d3 --- /dev/null +++ b/common/data/image/M01_icon_OTA_HD.png diff --git a/common/data/image/M01_icon_OTA_press.png b/common/data/image/M01_icon_OTA_press.png Binary files differnew file mode 100755 index 0000000..7dcdb30 --- /dev/null +++ b/common/data/image/M01_icon_OTA_press.png diff --git a/common/data/image/M01_icon_OTA_press_HD.png b/common/data/image/M01_icon_OTA_press_HD.png Binary files differnew file mode 100755 index 0000000..ffeb5d3 --- /dev/null +++ b/common/data/image/M01_icon_OTA_press_HD.png diff --git a/common/data/image/M01_icon_Push.png b/common/data/image/M01_icon_Push.png Binary files differnew file mode 100755 index 0000000..f130891 --- /dev/null +++ b/common/data/image/M01_icon_Push.png diff --git a/common/data/image/M01_icon_Push_HD.png b/common/data/image/M01_icon_Push_HD.png Binary files differnew file mode 100755 index 0000000..b6be564 --- /dev/null +++ b/common/data/image/M01_icon_Push_HD.png diff --git a/common/data/image/M01_icon_Push_press.png b/common/data/image/M01_icon_Push_press.png Binary files differnew file mode 100755 index 0000000..c229030 --- /dev/null +++ b/common/data/image/M01_icon_Push_press.png diff --git a/common/data/image/M01_icon_Push_press_HD.png b/common/data/image/M01_icon_Push_press_HD.png Binary files differnew file mode 100755 index 0000000..b6be564 --- /dev/null +++ b/common/data/image/M01_icon_Push_press_HD.png diff --git a/common/data/image/M01_icon_broadcasting.png b/common/data/image/M01_icon_broadcasting.png Binary files differnew file mode 100755 index 0000000..5ffd70a --- /dev/null +++ b/common/data/image/M01_icon_broadcasting.png diff --git a/common/data/image/M01_icon_broadcasting_HD.png b/common/data/image/M01_icon_broadcasting_HD.png Binary files differnew file mode 100755 index 0000000..bd4d650 --- /dev/null +++ b/common/data/image/M01_icon_broadcasting_HD.png diff --git a/common/data/image/M01_icon_broadcasting_press.png b/common/data/image/M01_icon_broadcasting_press.png Binary files differnew file mode 100755 index 0000000..038cd2a --- /dev/null +++ b/common/data/image/M01_icon_broadcasting_press.png diff --git a/common/data/image/M01_icon_broadcasting_press_HD.png b/common/data/image/M01_icon_broadcasting_press_HD.png Binary files differnew file mode 100755 index 0000000..bd4d650 --- /dev/null +++ b/common/data/image/M01_icon_broadcasting_press_HD.png diff --git a/common/data/image/M01_icon_minus.png b/common/data/image/M01_icon_minus.png Binary files differnew file mode 100755 index 0000000..bddc2cf --- /dev/null +++ b/common/data/image/M01_icon_minus.png diff --git a/common/data/image/controlbar/01_controlbar_icon_call.png b/common/data/image/controlbar/01_controlbar_icon_call.png Binary files differnew file mode 100755 index 0000000..b8b7806 --- /dev/null +++ b/common/data/image/controlbar/01_controlbar_icon_call.png diff --git a/common/data/image/controlbar/01_controlbar_icon_compose.png b/common/data/image/controlbar/01_controlbar_icon_compose.png Binary files differnew file mode 100755 index 0000000..20b71f7 --- /dev/null +++ b/common/data/image/controlbar/01_controlbar_icon_compose.png diff --git a/common/data/image/controlbar/01_controlbar_icon_create.png b/common/data/image/controlbar/01_controlbar_icon_create.png Binary files differnew file mode 100755 index 0000000..0dc1144 --- /dev/null +++ b/common/data/image/controlbar/01_controlbar_icon_create.png diff --git a/common/data/image/controlbar/01_controlbar_icon_delete.png b/common/data/image/controlbar/01_controlbar_icon_delete.png Binary files differnew file mode 100755 index 0000000..faaa0d3 --- /dev/null +++ b/common/data/image/controlbar/01_controlbar_icon_delete.png diff --git a/common/data/image/controlbar/01_controlbar_icon_edit.png b/common/data/image/controlbar/01_controlbar_icon_edit.png Binary files differnew file mode 100755 index 0000000..4ddc598 --- /dev/null +++ b/common/data/image/controlbar/01_controlbar_icon_edit.png diff --git a/common/data/image/controlbar/01_controlbar_icon_forward.png b/common/data/image/controlbar/01_controlbar_icon_forward.png Binary files differnew file mode 100755 index 0000000..a1fca43 --- /dev/null +++ b/common/data/image/controlbar/01_controlbar_icon_forward.png diff --git a/common/data/image/controlbar/01_controlbar_icon_info.png b/common/data/image/controlbar/01_controlbar_icon_info.png Binary files differnew file mode 100755 index 0000000..12a5b06 --- /dev/null +++ b/common/data/image/controlbar/01_controlbar_icon_info.png diff --git a/common/data/image/controlbar/01_controlbar_icon_move.png b/common/data/image/controlbar/01_controlbar_icon_move.png Binary files differnew file mode 100755 index 0000000..fdc8c8a --- /dev/null +++ b/common/data/image/controlbar/01_controlbar_icon_move.png diff --git a/common/data/image/controlbar/01_controllbar_icon_add_to_contact.png b/common/data/image/controlbar/01_controllbar_icon_add_to_contact.png Binary files differnew file mode 100755 index 0000000..65d47e4 --- /dev/null +++ b/common/data/image/controlbar/01_controllbar_icon_add_to_contact.png diff --git a/common/data/image/controlbar/01_controllbar_icon_close.png b/common/data/image/controlbar/01_controllbar_icon_close.png Binary files differnew file mode 100755 index 0000000..91b04e5 --- /dev/null +++ b/common/data/image/controlbar/01_controllbar_icon_close.png diff --git a/common/data/image/indicator_live panel_handle.png b/common/data/image/indicator_live panel_handle.png Binary files differnew file mode 100755 index 0000000..2c05453 --- /dev/null +++ b/common/data/image/indicator_live panel_handle.png diff --git a/common/data/image/org.tizen.message.cb.png b/common/data/image/org.tizen.message.cb.png Binary files differnew file mode 100755 index 0000000..e7bfab5 --- /dev/null +++ b/common/data/image/org.tizen.message.cb.png diff --git a/common/data/image/org.tizen.message.noti.png b/common/data/image/org.tizen.message.noti.png Binary files differnew file mode 100755 index 0000000..e7bfab5 --- /dev/null +++ b/common/data/image/org.tizen.message.noti.png diff --git a/common/data/image/org.tizen.message.png b/common/data/image/org.tizen.message.png Binary files differnew file mode 100755 index 0000000..e7bfab5 --- /dev/null +++ b/common/data/image/org.tizen.message.png diff --git a/common/data/image/org.tizen.message.voice.png b/common/data/image/org.tizen.message.voice.png Binary files differnew file mode 100755 index 0000000..e7bfab5 --- /dev/null +++ b/common/data/image/org.tizen.message.voice.png diff --git a/common/data/image/white/M01_icon_minus.png b/common/data/image/white/M01_icon_minus.png Binary files differnew file mode 100755 index 0000000..1943f8d --- /dev/null +++ b/common/data/image/white/M01_icon_minus.png diff --git a/common/msg-ui-bundle.h b/common/msg-ui-bundle.h new file mode 100755 index 0000000..2ac8b7c --- /dev/null +++ b/common/msg-ui-bundle.h @@ -0,0 +1,138 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.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_BUNDLE_H__ +#define __MSG_BUNDLE_H__ + + + /* Bundle key name */ +#define MSG_BUNDLE_KEY_TYPE "type" +#define MSG_BUNDLE_KEY_RUN_TYPE "RUN_TYPE" /* type for email */ +#define MSG_BUNDLE_KEY_LAUNCH_TYPE "launch-type" /* type for call */ + +#define MSG_BUNDLE_KEY_MSG_ID "msgId" +#define MSG_BUNDLE_KEY_THREAD_ID "threadId" +#define MSG_BUNDLE_KEY_THREAD_NAME "threadName" +#define MSG_BUNDLE_KEY_THREAD_ADDRESS "threadAddr" +#define MSG_BUNDLE_KEY_CONTACT_ID "contactId" + +#define MSG_BUNDLE_KEY_COMPOSER "composer" +#define MSG_BUNDLE_KEY_TO "TO" +#define MSG_BUNDLE_KEY_CC "CC" +#define MSG_BUNDLE_KEY_BCC "BCC" + +#define MSG_BUNDLE_KEY_BODY "BODY" +#define MSG_BUNDLE_KEY_FORWARD "FORWARD" +#define MSG_BUNDLE_KEY_RECIPIENT "recipient" +#define MSG_BUNDLE_KEY_NUMBER_INDEX "number/index" +#define MSG_BUNDLE_KEY_INDEX "index" +#define MSG_BUNDLE_KEY_COMPOSER_RESPONSE "composer_resp" + +#define MSG_BUNDLE_KEY_REQUEST_TYPE "request_type" +#define MSG_BUNDLE_KEY_FILE_TYPE "file_type" +#define MSG_BUNDLE_KEY_SELECT_TYPE "select_type" +#define MSG_BUNDLE_KEY_PREVIEW_DATA "preview_data" + +#define MSG_BUNDLE_KEY_GET_SEL_LIST "get_select_list" +#define MSG_BUNDLE_KEY_NAMECARD_INDEX "id" +#define MSG_BUNDLE_KEY_COUNT "count" +#define MSG_BUNDLE_KEY_IMAGE "image" +#define MSG_BUNDLE_KEY_TEXT "text" +#define MSG_BUNDLE_KEY_PATH "path" +#define MSG_BUNDLE_KEY_MM_PATH "PATH" + +#define MSG_BUNDLE_KEY_CALLER "CALLER" +#define MSG_BUNDLE_KEY_RESOLUTION "RESOLUTION" +#define MSG_BUNDLE_KEY_LIMIT "LIMIT" +#define MSG_BUNDLE_KEY_SIZE "SIZE" +#define MSG_BUNDLE_KEY_QUALITY "QUALITY" + +#define MSG_BUNDLE_KEY_LAUNCH_APPLICATION "launching_application" +#define MSG_BUNDLE_KEY_VIEWER_MESSAGE "msg_viewer_message" + +#define MSG_BUNDLE_KEY_RESULT "result" +#define MSG_BUNDLE_KEY_MODE "mode" +#define MSG_BUNDLE_KEY_DESTROY "destroy" +#define MSG_BUNDLE_KEY_NUMBER "number" +#define MSG_BUNDLE_KEY_MAX "max" +#define MSG_BUNDLE_KEY_PWD_RESULT "Result" +#define MSG_BUNDLE_KEY_FROM "from" +#define MSG_BUNDLE_KEY_LAYOUT "layout" + +#define MSG_BUNDLE_KEY_VCALL_TYPE "KEY_CALL_TYPE" +#define MSG_BUNDLE_KEY_VCALL_HANDLE "KEY_CALL_HANDLE" +#define MSG_BUNDLE_KEY_VCALL_PARTY_NUM "KEY_CALLING_PARTY_NUMBER" +#define MSG_BUNDLE_KEY_VCALL_CLI_CAUSE "KEY_CLI_CAUSE" +#define MSG_BUNDLE_KEY_VCALL_FORWARDED "KEY_FORWARDED" + +/* Bundle value name */ +#define MSG_BUNDLE_VALUE_COMPOSE "compose" +#define MSG_BUNDLE_VALUE_SMS_URI "sms" +#define MSG_BUNDLE_VALUE_MMSTO_URI "mmsto" +#define MSG_BUNDLE_VALUE_NEW_MSG "new_msg" +#define MSG_BUNDLE_VALUE_MSG_ID "msg_id" +#define MSG_BUNDLE_VALUE_CREATE_MSG "create_msg" +#define MSG_BUNDLE_VALUE_INTERNAL "internal" + +#define MSG_BUNDLE_VALUE_IMAGE "IMAGE" +#define MSG_BUNDLE_VALUE_VIDEO "VIDEO" +#define MSG_BUNDLE_VALUE_SOUND "SOUND" +#define MSG_BUNDLE_VALUE_ALL "ALL" +#define MSG_BUNDLE_VALUE_GALLERY_ALL "all" +#define MSG_BUNDLE_VALUE_MULTI_FILE "MULTI_FILE" +#define MSG_BUNDLE_VALUE_OTHERS "OTHERS" +#define MSG_BUNDLE_VALUE_FILE "file" +#define MSG_BUNDLE_VALUE_SELECT_MULTIPLE "select-multiple" + +#define MSG_BUNDLE_VALUE_GET "get" + +#define MSG_BUNDLE_VALUE_NORMAL "normal" +#define MSG_BUNDLE_VALUE_EDIT "edit" +#define MSG_BUNDLE_VALUE_SEARCH_MODE "search_mode" +#define MSG_BUNDLE_VALUE_NO_CONTENT "no_content" + +#define MSG_BUNDLE_VALUE_DEL_ALL "del_all" +#define MSG_BUNDLE_VALUE_FORWARDED "forwarded" + +#define MSG_BUNDLE_VALUE_DESTROY "destroy" +#define MSG_BUNDLE_VALUE_ERROR "error" +#define MSG_BUNDLE_VALUE_SENT "sent" +#define MSG_BUNDLE_VALUE_RESET "reset" +#define MSG_BUNDLE_VALUE_FOCUS_IN "focus_in" + +#define MSG_BUNDLE_VALUE_VGA "VGA" +#define MSG_BUNDLE_VALUE_QCIF "QCIF" +#define MSG_BUNDLE_VALUE_LOW "LOW" +#define MSG_BUNDLE_VALUE_CAM_LIMIT_SIZE "295" /* Limit size of camcoder in message composer */ +#define MSG_BUNDLE_VALUE_VR_LIMIT_SIZE "300" /* Limit size of voice recorder in message composer */ + +#define MSG_BUNDLE_VALUE_PREVIEW_MODE "preview_mode" +#define MSG_BUNDLE_VALUE_CALENDAR_MAX "3" + +#define MSG_BUNDLE_VALUE_EMAIL_COMPOSE "5" + +#define MSG_BUNDLE_VALUE_CALL_MO "MO" /* "MO" : normal call, "EMERGENCY" : emergency call */ +#define MSG_BUNDLE_VALUE_VCALL_MO "mo" +#define MSG_BUNDLE_VALUE_VCALL_HANDLE "1" +#define MSG_BUNDLE_VALUE_VCALL_FALSE "-1" +#define MSG_BUNDLE_VALUE_AUTO_REJECT_LIST "1" +#define MSG_BUNDLE_VALUE_CONTACT_CHECK_LIST "46" + +#define MSG_BUNDLE_VALUE_RET_YES "yes" +#define MSG_BUNDLE_VALUE_RET_NO "no" + +#endif /* __MSG_BUNDLE_H__ */ + diff --git a/common/msg-ui-common-utility.c b/common/msg-ui-common-utility.c new file mode 100755 index 0000000..c4fb2bc --- /dev/null +++ b/common/msg-ui-common-utility.c @@ -0,0 +1,308 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.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. + */ + +/*================= + * INCLUDE HEADERS + * ================= */ +#include <msg-ui-util.h> +#include <msg-ui-common-utility.h> + +/* for i18n */ +#include <unicode/uloc.h> +#include <unicode/ucal.h> +#include <unicode/udat.h> +#include <unicode/udatpg.h> +#include <unicode/ustring.h> + +/*========================== + * FUNCTION IMPLEMENTATIONS + *========================== */ +const char *msg_common_get_default_locale() +{ + const char *locale; + UErrorCode status = U_ZERO_ERROR; + /* ICU API to set default locale */ + uloc_setDefault(getenv("LC_TIME"), &status); + locale = uloc_getDefault(); + + return locale; +} + +char *msg_common_get_date_best_pattern(const char* locale, char* skeleton) +{ + MSG_UI_ENTER(MSG_UI_LEVEL_DEBUG); + MSG_UI_RETV_IF(MSG_UI_LEVEL_ERR, locale == NULL || skeleton == NULL, NULL); + + UErrorCode status = U_ZERO_ERROR; + UDateTimePatternGenerator *generator = NULL; + UChar bestPattern[MSG_COMMON_MAX_UCHAR_PATTERN_LEN + 1] = {0,}; + char bestPatternString[MSG_COMMON_MAX_CHAR_PATTERN_LEN + 1] = {0,}; + int32_t bestPatternCapacity = 0; + int32_t bestPatternLength = 0; + + UChar customSkeleton[MSG_COMMON_MAX_UCHAR_PATTERN_LEN + 1] = {0,}; + int skeletonLength = 0; + + skeletonLength = strlen(skeleton); + /* convert char to uchar */ + if (skeletonLength <= MSG_COMMON_MAX_UCHAR_PATTERN_LEN) + u_uastrncpy(customSkeleton, skeleton, skeletonLength); + else + u_uastrncpy(customSkeleton, skeleton, MSG_COMMON_MAX_UCHAR_PATTERN_LEN); + + generator = udatpg_open(locale, &status); + bestPatternCapacity = MSG_COMMON_MAX_UCHAR_PATTERN_LEN; + + /* get bestpattern from customskeletom of uchar */ + bestPatternLength = udatpg_getBestPattern(generator, customSkeleton, u_strlen(customSkeleton), bestPattern, bestPatternCapacity, &status); + + /* convert uchar to char to know bestpatternstring */ + u_austrcpy(bestPatternString, bestPattern); + + udatpg_close(generator); + + MSG_UI_LEAVE(MSG_UI_LEVEL_DEBUG); + + return strdup(bestPatternString); +} + +char *msg_common_get_formatted_date(const char* locale, char* bestPattern, void *time) +{ + MSG_UI_RETV_IF(MSG_UI_LEVEL_ERR, locale == NULL || bestPattern == NULL || time == NULL, NULL); + + UErrorCode status = U_ZERO_ERROR; + UDate date; + UDateFormat *date_format = NULL; + UChar uBestPattern[MSG_COMMON_MAX_UCHAR_PATTERN_LEN + 1] = {0,}; + UChar formatted[MSG_COMMON_MAX_UCHAR_PATTERN_LEN + 1] = {0,}; + char formattedString[MSG_COMMON_MAX_CHAR_PATTERN_LEN + 1] = {0,}; + int32_t formattedCapacity = 0; + int patternLength = 0, formattedLength = 0; + + patternLength = strlen(bestPattern); + /* convert char to uchar */ + if (patternLength <= MSG_COMMON_MAX_UCHAR_PATTERN_LEN) + u_uastrncpy(uBestPattern, bestPattern, patternLength); + else + u_uastrncpy(uBestPattern, bestPattern, MSG_COMMON_MAX_UCHAR_PATTERN_LEN); + + /* convert time_t to UDate, if it is */ + if (time) { + time_t msg_time = *(time_t *) time; + date = (UDate) msg_time * 1000; /* Equivalent to Date = ucal_getNow() in Milliseconds */ + } else + date = ucal_getNow(); + + date_format = udat_open(UDAT_IGNORE, UDAT_IGNORE, locale, NULL, -1, uBestPattern, -1, &status); + formattedCapacity = MSG_COMMON_MAX_UCHAR_PATTERN_LEN; + /* get formatted string */ + formattedLength = udat_format(date_format, date, formatted, formattedCapacity, NULL, &status); + /* convert uchar to char */ + u_austrcpy(formattedString, formatted); + + udat_close(date_format); + + return strdup(formattedString); +} + +char *msg_common_get_date_text(const char* locale, char* skeleton, void* time) +{ + MSG_UI_ENTER(MSG_UI_LEVEL_DEBUG); + MSG_UI_RETV_IF(MSG_UI_LEVEL_ERR, locale == NULL, NULL); + MSG_UI_RETV_IF(MSG_UI_LEVEL_ERR, skeleton == NULL, NULL); + + UChar customSkeleton[MSG_COMMON_MAX_UCHAR_PATTERN_LEN + 1] = {0,}; + int skeletonLength = 0; + + skeletonLength = strlen(skeleton); + /* convert char to uchar */ + if (skeletonLength <= MSG_COMMON_MAX_UCHAR_PATTERN_LEN) + u_uastrncpy(customSkeleton, skeleton, skeletonLength); + else + u_uastrncpy(customSkeleton, skeleton, MSG_COMMON_MAX_UCHAR_PATTERN_LEN); + + UErrorCode status = U_ZERO_ERROR; + UDateTimePatternGenerator *generator = NULL; + UDateFormat *date_format = NULL; + UDate date; + UChar bestPattern[MSG_COMMON_MAX_UCHAR_PATTERN_LEN + 1] = {0,}; + UChar formatted[MSG_COMMON_MAX_UCHAR_PATTERN_LEN + 1] = {0,}; + char bestPatternString[MSG_COMMON_MAX_CHAR_PATTERN_LEN + 1] = {0,}; + char formattedString[MSG_COMMON_MAX_CHAR_PATTERN_LEN + 1] = {0,}; + int32_t bestPatternCapacity = 0; + int32_t bestPatternLength = 0; + int32_t formattedCapacity = 0; + int32_t formattedLength = 0; + + generator = udatpg_open(locale, &status); + bestPatternCapacity = MSG_COMMON_MAX_UCHAR_PATTERN_LEN; + + /* get bestpattern from customskeletom of uchar */ + bestPatternLength = udatpg_getBestPattern(generator, customSkeleton, u_strlen(customSkeleton), bestPattern, bestPatternCapacity, &status); + + /* convert uchar to char to know bestpatternstring */ + u_austrcpy(bestPatternString, bestPattern); + + /* convert time_t to UDate, if it is */ + if (time) { + time_t msg_time = *(time_t *) time; + date = (UDate) msg_time * 1000; /* Equivalent to Date = ucal_getNow() in Milliseconds */ + } else + date = ucal_getNow(); + + date_format = udat_open(UDAT_IGNORE, UDAT_IGNORE, locale, NULL, -1, bestPattern, -1, &status); + formattedCapacity = MSG_COMMON_MAX_UCHAR_PATTERN_LEN; + /* get formatted string */ + formattedLength = udat_format(date_format, date, formatted, formattedCapacity, NULL, &status); + /* convert uchar to char */ + u_austrcpy(formattedString, formatted); + + udatpg_close(generator); + udat_close(date_format); + + return strdup(formattedString); +} + + +MSG_BOOL msg_common_is_valid_phone_number(const char *address) +{ + MSG_UI_ENTER(MSG_UI_LEVEL_DEBUG); + MSG_UI_RETVM_IF(MSG_UI_LEVEL_ERR, address == NULL, FALSE, "address is NULL"); + + int addr_len = 0; + addr_len = strlen(address); + + if (addr_len == 0) + return FALSE; + + /* length check phone address should be longer than 2 and shorter than 40 */ + if (addr_len > 2 && addr_len <= MSG_COMMON_NUMBER_MAX_LEN) { + const char *pszOneChar = address; + + if (*pszOneChar == '+') + ++pszOneChar; + + while (*pszOneChar) { + if (!isdigit(*pszOneChar) && (*pszOneChar != '*') && (*pszOneChar != '#')) + return FALSE; + + ++pszOneChar; + } + + return TRUE; + } else { + MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "invalid address length [%d]", addr_len); + return FALSE; + } +} + +MSG_BOOL msg_common_is_valid_email_addr(const char *address) +{ + MSG_UI_ENTER(MSG_UI_LEVEL_DEBUG); + MSG_UI_RETVM_IF(MSG_UI_LEVEL_ERR, address == NULL, FALSE, "address is NULL"); + + const char *pszOneChar = address; + MSG_BOOL bIsPrefixStringCorrect = FALSE; + MSG_BOOL bIsSurfixStringCorrect = FALSE; + MSG_BOOL bIsExistAt = FALSE; + + for (; *pszOneChar != '\0'; ++pszOneChar) { + if (bIsExistAt == FALSE) { + if (isalnum(*pszOneChar) || *pszOneChar == '.' || *pszOneChar == '_' || *pszOneChar == '-') { + bIsPrefixStringCorrect = TRUE; + continue; + } else if (*pszOneChar == '@') { + if (bIsPrefixStringCorrect == FALSE) + return FALSE; + else + bIsExistAt = TRUE; + } else { + return FALSE; + } + } else { + if (isalnum(*pszOneChar) || *pszOneChar == '.' || *pszOneChar == '_' || *pszOneChar == '-') { + bIsSurfixStringCorrect = TRUE; + continue; + } else { + return FALSE; + } + } + } + + return (bIsPrefixStringCorrect) && (bIsSurfixStringCorrect) && (bIsExistAt); +} + +MSG_BOOL msg_common_is_connected_call(void) +{ + int call_status = 0; + + if (vconf_get_int(VCONFKEY_CALL_STATE, &call_status) < 0) + return FALSE; + + MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "call_status = %d", call_status); + + if (call_status != VCONFKEY_CALL_OFF) + return TRUE; + else + return FALSE; +} + +char *msg_common_get_current_theme_name(void) +{ + char *theme_name = NULL; + char *save_ptr = NULL; + + /* Get current theme path. Return value is a full path of theme file. */ + const char *current_theme_path = elm_theme_get(NULL); + MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "current_theme_path is %s", current_theme_path); + + if (current_theme_path == NULL) { + MSG_UI_DEBUG(MSG_UI_LEVEL_ERR, "current_theme_path is NULL !!"); + return NULL; + } + + theme_name = strdup(current_theme_path); + if (theme_name == NULL) { + MSG_UI_DEBUG(MSG_UI_LEVEL_ERR, "strdup is NULL !!"); + return NULL; + } + + theme_name = strtok_r(theme_name, ":", &save_ptr); + if (theme_name == NULL) { + MSG_UI_DEBUG(MSG_UI_LEVEL_ERR, "theme_name_dup is NULL !!"); + return NULL; + } + + MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "theme_name is %s", theme_name); + + return theme_name; +} + +MSG_BOOL msg_common_is_sim_inserted(void) +{ + int sim_slot_status = 0; + + if (vconf_get_int(VCONFKEY_TELEPHONY_SIM_SLOT, &sim_slot_status) < 0) + return FALSE; + + MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "sim_slot_status = %d", sim_slot_status); + + if (sim_slot_status == VCONFKEY_TELEPHONY_SIM_INSERTED) + return TRUE; + else + return FALSE; +} + diff --git a/common/msg-ui-common-utility.h b/common/msg-ui-common-utility.h new file mode 100755 index 0000000..144115d --- /dev/null +++ b/common/msg-ui-common-utility.h @@ -0,0 +1,155 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.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_UI_COMMON_UTILITY_H__ +#define __MSG_UI_COMMON_UTILITY_H__ + +/*================================================================================================== + INCLUDE HEADERS + * ==================================================================================================*/ + +#include <glib.h> +#include <Elementary.h> + +/*================================================================================================== + DEFINITIONS + *==================================================================================================*/ +/* for i18n */ +#define MSG_COMMON_MAX_UCHAR_PATTERN_LEN 64 +#define MSG_COMMON_MAX_CHAR_PATTERN_LEN 128 + +/* for cutlink*/ +#define MSG_COMMON_TAG_TEXT "<wrap=char>" +#define MSG_COMMON_TAG_LINK "<color=#72b1f2 underline=on underline_color=#72b1f2>" +#define MSG_COMMON_CUTLINK_MAX_NUMBER_LEN 40 +#define MSG_COMMON_CUTLINK_MAX_EMAIL_LEN 128 +#define MSG_COMMON_CUTLINK_MAX_URL_LEN 256 +#define MSG_COMMON_MAX_CUTLINK_LEN MSG_COMMON_CUTLINK_MAX_URL_LEN +#define MSG_COMMON_CUTLINK_COUNT_MAX 50 /* maximum cutlink count */ + +#define MSG_COMMON_NUMBER_MAX_LEN 40 + +/*================================================================================================== + ENUMERATIONS + *==================================================================================================*/ + +typedef enum { + MSG_COMMON_LINK_NONE, + MSG_COMMON_LINK_PHONE, + MSG_COMMON_LINK_EMAIL, + MSG_COMMON_LINK_URL, + MSG_COMMON_LINK_RTSP, + MSG_COMMON_LINK_WAP, +} MsgLinkType; + +/*================================================================================================== + STRUCTURES + *==================================================================================================*/ + +typedef struct { + gchar *pattern; + MsgLinkType type; +} MsgLinkPattern; + +typedef struct { + gchar *string; + MsgLinkType type; + gint s_offset; + gint e_offset; +} MsgLinkInfo; + +/*================================================================================================== + FUNCTION DECLARATIONS + *==================================================================================================*/ + +/* + *@fn msg_common_get_default_locale(); + *@brief This function is used to get default locale + *@return default locale string on success, else NULL pointer on failure + *@param[in] None + */ +const char *msg_common_get_default_locale(); + +/* + *@fn msg_common_get_date_text(const char* locale, char* skeleton, void* time); + *@brief This function is used to get data & time string based on both locale and skeleton. + * Caller must free returned string after using it, else memory will be leaked + *@return data and time formated string on success, else NULL pointer on failure + *@param[in] locale locale info. of current setting + *@param[in] skeleton skeleton string caller want to see + *@param[in] time_t time_t pointer to be diaplayed. If NULL is passed, current time will be displayed + */ +char *msg_common_get_date_text(const char* locale, char* skeleton, void* time); + +/* + *@fn msg_common_is_valid_phone_number(const char* address); + *@brief This function is used to check address is valid number or not + *@return return TRUE if address is valide number type, else FALSE + *@param[in] address string pointer of address + */ +MSG_BOOL msg_common_is_valid_phone_number(const char *address); + +/* + *@fn msg_common_is_valid_email_addr(const char* address); + *@brief This function is used to check address is valid email address or not + *@return return TRUE if address is valide email address type, else FALSE + *@param[in] address string pointer of address + */ +MSG_BOOL msg_common_is_valid_email_addr(const char *address); + +/* + *@fn msg_common_is_connected_call(void); + *@brief This function is used to know (voice or video)call is connected or not + *@return return TRUE if call is connected status, else FALSE + */ +MSG_BOOL msg_common_is_connected_call(void); + +/* + *@fn msg_common_get_date_best_pattern(const char* locale, char* skeleton); + *@brief This function is used to get best pattern string based on both locale and skeleton. + *@return best pattern based on locale for data and time on success, else NULL pointer on failure + *@param[in] locale locale info. of current setting + *@param[in] skeleton skeleton string caller want to see + */ +char *msg_common_get_date_best_pattern(const char* locale, char* skeleton); + +/* + *@fn msg_common_get_formatted_date(const char* locale, char* bestPattern, void *time); + *@brief This function is used to get data & time string from best pattern based on locale. + *@return data and time formated string on success, else NULL pointer on failure + *@param[in] locale locale info. of current setting + *@param[in] bestPattern best pattern for date and time based on locale + *@param[in] time_t time_t pointer to be diaplayed. If NULL is passed, current time will be displayed + */ +char *msg_common_get_formatted_date(const char* locale, char* bestPattern, void *time); + +/* + *@fn msg_common_get_current_theme_name(void); + *@brief This function is used to get current theme name. + *@return return theme name. if it is failed, it will return NULL. Caller should free the memory. + */ +char *msg_common_get_current_theme_name(void); + +/* + *@fn msg_common_check_sim_existence(void); + *@brief This function is used to know whether SIM is inserted or not. + *@return return TRUE if SIM is inserted, else FALSE + */ +MSG_BOOL msg_common_is_sim_inserted(void); + + +#endif + diff --git a/common/msg-ui-util.h b/common/msg-ui-util.h new file mode 100755 index 0000000..83af85b --- /dev/null +++ b/common/msg-ui-util.h @@ -0,0 +1,204 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.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 <stdio.h> +#include <string.h> +#include "dlog.h" +#include <vconf.h> +#include <heynoti.h> +#include "msg-ui-bundle.h" + +#include <unicode/udat.h> +#include <unicode/utypes.h> +#include <unicode/ustring.h> + +#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 (1530) +#define MSG_UI_URL_MAX_LEN (1024) +#define DEF_MAX_EMAIL_LEN (255) + +#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" + +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_DEBUG, 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_THEME_BLUE_HD "blue-hd" +#define MSG_THEME_WHITE_HD "white-hd" + +#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" + +/* 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 IMGDIR"/01_header_icon_cancel.png" +#define MSG_HEADER_ICON_DONE IMGDIR"/01_header_icon_done.png" + +/* Controlbar Icon */ +#define MSG_CONTROLBAR_IMG_PATH IMGDIR"/controlbar/" + +#define MSG_CONTROLBAR_ICON_COMPOSE MSG_CONTROLBAR_IMG_PATH"01_controlbar_icon_compose.png" +#define MSG_CONTROLBAR_ICON_CANCEL MSG_CONTROLBAR_IMG_PATH"01_controllbar_icon_close.png" +#define MSG_CONTROLBAR_ICON_EDIT MSG_CONTROLBAR_IMG_PATH"01_controlbar_icon_edit.png" +#define MSG_CONTROLBAR_ICON_DELETE MSG_CONTROLBAR_IMG_PATH"01_controlbar_icon_delete.png" +#define MSG_CONTROLBAR_ICON_MOVE MSG_CONTROLBAR_IMG_PATH"01_controlbar_icon_move.png" +#define MSG_CONTROLBAR_ICON_FORWARD MSG_CONTROLBAR_IMG_PATH"01_controlbar_icon_forward.png" +#define MSG_CONTROLBAR_ICON_VOICE_CALL MSG_CONTROLBAR_IMG_PATH"01_controlbar_icon_call.png" +#define MSG_CONTROLBAR_ICON_ADD_TO_CONTACT MSG_CONTROLBAR_IMG_PATH"01_controllbar_icon_add_to_contact.png" +#define MSG_CONTROLBAR_ICON_VIEW_CONTACT_DETAIL MSG_CONTROLBAR_IMG_PATH"01_controlbar_icon_info.png" + +/* setting */ +#define MSG_CONTROLBAR_ICON_CREATE MSG_CONTROLBAR_IMG_PATH"01_controlbar_icon_create.png" + + +typedef enum { + MSG_TIME_FORMAT_12H = 0, + MSG_TIME_FORMAT_24H, + MSG_TIME_FORMAT_UNKNOWN + +} msg_time_format; + +enum { + MSG_UI_THEME_WHITE, + MSG_UI_THEME_BLUE_HD, +}; + +enum { + CONTROLBAR_ITEM_1 = 0, + CONTROLBAR_ITEM_2, + CONTROLBAR_ITEM_3, + CONTROLBAR_ITEM_4, +}; + +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__ */ |