apply FSL(Flora Software License)
authorKim Kibum <kb0929.kim@samsung.com>
Fri, 8 Jun 2012 05:54:10 +0000 (14:54 +0900)
committerKim Kibum <kb0929.kim@samsung.com>
Fri, 8 Jun 2012 05:54:10 +0000 (14:54 +0900)
106 files changed:
CMakeLists.txt [new file with mode: 0755]
LICENSE [new file with mode: 0644]
NOTICE [new file with mode: 0644]
app/CMakeLists.txt [new file with mode: 0644]
app/phone.c [new file with mode: 0755]
debian/changelog [new file with mode: 0644]
debian/compat [new file with mode: 0644]
debian/control [new file with mode: 0644]
debian/copyright [new file with mode: 0644]
debian/dirs [new file with mode: 0644]
debian/docs [new file with mode: 0644]
debian/libug-phone-dev.install.in [new file with mode: 0644]
debian/libug-phone-efl.install.in [new file with mode: 0644]
debian/libug-phone-efl.postinst.in [new file with mode: 0755]
debian/org.tizen.phone.install.in [new file with mode: 0644]
debian/org.tizen.phone.postinst.in [new file with mode: 0755]
debian/rules [new file with mode: 0755]
icon_phone.png [new file with mode: 0644]
include/phone-ug.h [new file with mode: 0755]
include/phone.h [new file with mode: 0755]
lib/CMakeLists.txt [new file with mode: 0755]
lib/common/ph-common.c [new file with mode: 0755]
lib/common/ph-text.c [new file with mode: 0755]
lib/dialer/CMakeLists.txt [new file with mode: 0755]
lib/dialer/ph-dialer-main.c [new file with mode: 0755]
lib/dialer/ph-dialer-tapi.c [new file with mode: 0755]
lib/dialer/ph-dialer-tapi.h [new file with mode: 0755]
lib/dialer/ph-dialer-utils.c [new file with mode: 0755]
lib/dialer/ph-dialer-utils.h [new file with mode: 0755]
lib/dialer/ph-dialer-view.c [new file with mode: 0644]
lib/dialer/ph-dialer-view.h [new file with mode: 0755]
lib/edc/dialer.edc [new file with mode: 0644]
lib/edc/progress.edc [new file with mode: 0644]
lib/images/dialer_images/C01-3_dialer_btn_01.png [new file with mode: 0644]
lib/images/dialer_images/C01-3_dialer_btn_02.png [new file with mode: 0644]
lib/images/dialer_images/C01-3_dialer_btn_03.png [new file with mode: 0644]
lib/images/dialer_images/C01-3_dialer_btn_press.png [new file with mode: 0644]
lib/images/dialer_images/C01-3_dialer_icon_01.png [new file with mode: 0644]
lib/images/dialer_images/C01-3_dialer_icon_01_press.png [new file with mode: 0644]
lib/images/dialer_images/C01-3_dialer_icon_03.png [new file with mode: 0755]
lib/images/dialer_images/C01-3_dialer_icon_03_press.png [new file with mode: 0755]
lib/images/dialer_images/C01-3_dialer_icon_call.png [new file with mode: 0644]
lib/images/dialer_images/C01-3_dialer_icon_clear.png [new file with mode: 0644]
lib/images/dialer_images/C01-3_dialer_icon_video_call.png [new file with mode: 0644]
lib/images/dialer_images/C01-3_dialer_icon_video_call_dim.png [new file with mode: 0644]
lib/images/phoneug_images/01_controlbar_icon_contacts.png [new file with mode: 0644]
lib/images/phoneug_images/01_controlbar_icon_create.png [new file with mode: 0644]
lib/images/phoneug_images/01_controlbar_icon_delete.png [new file with mode: 0644]
lib/images/phoneug_images/01_controlbar_icon_dialer.png [new file with mode: 0644]
lib/images/phoneug_images/01_controlbar_icon_edit.png [new file with mode: 0644]
lib/images/phoneug_images/01_controlbar_icon_favorite.png [new file with mode: 0644]
lib/images/phoneug_images/01_controlbar_icon_logs.png [new file with mode: 0644]
lib/images/phoneug_images/01_controlbar_icon_save.png [new file with mode: 0644]
lib/images/phoneug_images/C01-4_icon_Blocked(Auto-rejected).png [new file with mode: 0644]
lib/images/phoneug_images/C01-4_icon_Blocked(Auto-rejected)_64x64.png [new file with mode: 0644]
lib/images/phoneug_images/C01-4_icon_dialed.png [new file with mode: 0644]
lib/images/phoneug_images/C01-4_icon_missed-call.png [new file with mode: 0644]
lib/images/phoneug_images/C01-4_icon_received.png [new file with mode: 0644]
lib/images/phoneug_images/C01-4_icon_rejected.png [new file with mode: 0644]
lib/images/phoneug_images/C01-4_icon_vt-call.png [new file with mode: 0644]
lib/images/phoneug_images/caller_ID_default_70x70_man.png [new file with mode: 0755]
lib/include/phone-common.h [new file with mode: 0755]
lib/include/phone-dialer.h [new file with mode: 0755]
lib/include/phone-log.h [new file with mode: 0755]
lib/include/phone-path.h [new file with mode: 0755]
lib/include/phone-text.h [new file with mode: 0755]
lib/include/phone-ui.h [new file with mode: 0755]
lib/log/CMakeLists.txt [new file with mode: 0755]
lib/log/ph-log-check-view.c [new file with mode: 0755]
lib/log/ph-log-check-view.h [new file with mode: 0755]
lib/log/ph-log-detail-view.c [new file with mode: 0755]
lib/log/ph-log-detail-view.h [new file with mode: 0755]
lib/log/ph-log-main-view.c [new file with mode: 0755]
lib/log/ph-log-main-view.h [new file with mode: 0755]
lib/log/ph-log-main.c [new file with mode: 0755]
lib/log/ph-log-utils.c [new file with mode: 0755]
lib/log/ph-log-utils.h [new file with mode: 0755]
lib/phoneui/CMakeLists.txt [new file with mode: 0755]
lib/phoneui/ph-favorite-edit-view.c [new file with mode: 0755]
lib/phoneui/ph-favorite-edit-view.h [new file with mode: 0644]
lib/phoneui/ph-favorite-view.c [new file with mode: 0755]
lib/phoneui/ph-favorite-view.h [new file with mode: 0755]
lib/phoneui/ph-front-main.c [new file with mode: 0755]
lib/phoneui/ph-front-view.c [new file with mode: 0755]
lib/phoneui/ph-front-view.h [new file with mode: 0755]
packaging/org.tizen.phone.spec [new file with mode: 0644]
phone.desktop.in [new file with mode: 0644]
po/CMakeLists.txt [new file with mode: 0755]
po/POTFILES.in [new file with mode: 0755]
po/de.po [new file with mode: 0644]
po/el.po [new file with mode: 0644]
po/en_GB.po [new file with mode: 0644]
po/en_US.po [new file with mode: 0644]
po/es.po [new file with mode: 0644]
po/fr.po [new file with mode: 0644]
po/it.po [new file with mode: 0644]
po/ja.po [new file with mode: 0644]
po/ko.po [new file with mode: 0644]
po/nl.po [new file with mode: 0644]
po/pt.po [new file with mode: 0644]
po/ru.po [new file with mode: 0644]
po/tr.po [new file with mode: 0644]
po/update-po.sh [new file with mode: 0755]
po/zh_CN.po [new file with mode: 0644]
po/zh_HK.po [new file with mode: 0644]
po/zh_TW.po [new file with mode: 0644]

diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100755 (executable)
index 0000000..f2dd685
--- /dev/null
@@ -0,0 +1,63 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT(phone C)
+
+SET(PACKAGE ${PROJECT_NAME})
+SET(PKGNAME "org.tizen.${PACKAGE}")
+SET(PREFIX ${CMAKE_INSTALL_PREFIX})
+SET(BINDIR "${PREFIX}/bin")
+SET(RESDIR "${PREFIX}/res")
+SET(DATADIR "${PREFIX}/data")
+SET(LOCALEDIR "/opt/ug/res/locale")
+SET(EDC_SRC_DIR "${CMAKE_SOURCE_DIR}/lib/edc")
+SET(EDJDIR "/opt/ug/res/edje/ug-${PACKAGE}")
+SET(IMGDIR "/opt/ug/res/images/ug-${PACKAGE}")
+SET(CMAKE_SKIP_BUILD_RPATH true)
+SET(VERSION_MAJOR 0)
+set(VERSION "${VERSION_MAJOR}.1.3")
+
+IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
+       SET(CMAKE_BUILD_TYPE "Release")
+ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
+MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
+
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(pkgs REQUIRED appcore-efl ui-gadget contacts-service ecore-x evas ecore ecore-input edje 
+eina appsvc)
+
+FOREACH(flag ${pkgs_CFLAGS})
+       SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
+SET(CMAKE_C_FLAGS_DEBUG "")
+SET(CMAKE_C_FLAGS_RELEASE "")
+
+FIND_PROGRAM(UNAME NAMES uname)
+EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
+IF("${ARCH}" STREQUAL "arm")
+       ADD_DEFINITIONS("-DTARGET")
+       MESSAGE("add -DTARGET")
+ENDIF("${ARCH}" STREQUAL "arm")
+
+ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE}\"")
+ADD_DEFINITIONS("-DPACKAGE_NAME=\"${PKGNAME}\"")
+ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
+ADD_DEFINITIONS("-DLOCALEDIR=\"${LOCALEDIR}\"")
+ADD_DEFINITIONS("-DEDJDIR=\"${EDJDIR}\"")
+ADD_DEFINITIONS("-DIMGDIR=\"${IMGDIR}\"")
+ADD_DEFINITIONS("-DUGDATADIR=\"${UGDATADIR}\"")
+
+# install desktop file & icon
+CONFIGURE_FILE(${PROJECT_NAME}.desktop.in ${PKGNAME}.desktop)
+INSTALL(FILES ${CMAKE_BINARY_DIR}/${PKGNAME}.desktop DESTINATION "/opt/share/applications")
+INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/lib/images/phoneug_images/ DESTINATION ${IMGDIR})
+INSTALL(DIRECTORY DESTINATION ${DATADIR})
+
+ADD_SUBDIRECTORY(lib)
+ADD_SUBDIRECTORY(app)
+
+# i18n
+ADD_SUBDIRECTORY(po)
+
diff --git a/LICENSE b/LICENSE
new file mode 100644 (file)
index 0000000..7ccb5b5
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,75 @@
+Flora License
+
+Version 1.0, May, 2012
+
+http://www.tizenopensource.org/license
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
+
+"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
+
+"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
+
+"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
+
+"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
+
+"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
+
+"Tizen Certified Platform" shall mean a software platform that complies with the standards set forth in the Compatibility Definition Document and passes the Compatibility Test Suite as defined from time to time by the Tizen Technical Steering Group and certified by the Tizen Association or its designated agent.
+
+2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work solely as incorporated into a Tizen Certified Platform, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work solely as incorporated into a Tizen Certified Platform to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof pursuant to the copyright license above, in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
+
+  1. You must give any other recipients of the Work or Derivative Works a copy of this License; and
+
+  2. You must cause any modified files to carry prominent notices stating that You changed the files; and
+
+  3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
+
+  4. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+APPENDIX: How to apply the Flora License to your work
+
+To apply the Flora License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   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.
diff --git a/NOTICE b/NOTICE
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt
new file mode 100644 (file)
index 0000000..a3cacb2
--- /dev/null
@@ -0,0 +1,12 @@
+SET(SRCS phone.c)
+
+INCLUDE(FindPkgConfig)
+
+ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
+SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "${EXTRA_CFLAGS} -fpie")
+
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/lib/include)
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} ug-phoneui-efl "-pie")
+
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/icon_${PROJECT_NAME}.png DESTINATION "${RESDIR}/icons/default/small" RENAME "${PKGNAME}.png")
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${BINDIR})
diff --git a/app/phone.c b/app/phone.c
new file mode 100755 (executable)
index 0000000..f5f557b
--- /dev/null
@@ -0,0 +1,227 @@
+/*
+ * 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 <appcore-efl.h>
+#include <Ecore_X.h>
+#include <ui-gadget.h>
+#include <contacts-svc.h>
+#include <vconf.h>
+#include <appsvc.h>
+#include "phone.h"
+#include "phone-ui.h"
+
+
+struct phone_data
+{
+       Evas_Object *win;
+       ph_phoneui_data *phoneui_d;
+       /* add more variables here */
+};
+
+static void phapp_win_del(void *data, Evas_Object *obj, void *event)
+{
+       elm_exit();
+}
+
+static Evas_Object* phapp_create_win(const char *name)
+{
+       Evas_Object *eo;
+       int w, h;
+
+       eo = elm_win_add(NULL, name, ELM_WIN_BASIC);
+       if (eo) {
+               elm_win_title_set(eo, name);
+               elm_win_borderless_set(eo, EINA_TRUE);
+               evas_object_smart_callback_add(eo, "delete,request", phapp_win_del, NULL);
+               ecore_x_window_size_get(ecore_x_window_root_first_get(), &w, &h);
+               evas_object_resize(eo, w, h);
+               elm_win_indicator_mode_set(eo, ELM_WIN_INDICATOR_SHOW);
+       }
+
+       return eo;
+}
+
+static int phapp_region_changed(void *data)
+{
+       PH_FN_CALL;
+       ph_phoneui_data *phoneui_d = data;
+       phone_front_view_region_changed(phoneui_d);
+       return ug_send_event(UG_EVENT_REGION_CHANGE);
+}
+
+static int phapp_open(void *data)
+{
+       PH_FN_CALL;
+       ph_phoneui_data *phoneui_d = data;
+       if (phone_front_view_show_call_app(phoneui_d))
+               return -1;
+       return 0;
+}
+
+static int phapp_create(void *data)
+{
+       PH_FN_CALL;
+       int ret;
+       Evas_Object *win;
+       struct phone_data *ad = data;
+
+       /* create window */
+       win = phapp_create_win(PACKAGE);
+       p_retvm_if(NULL == win, -1, "phapp_create_win() Failed");
+       ad->win = win;
+
+       /* init internationalization */
+       ret = appcore_set_i18n(PACKAGE, LOCALEDIR);
+       p_retvm_if(ret, -1, "appcore_set_i18n() Failed");
+
+       evas_object_show(win);
+
+       ret = contacts_svc_connect();
+       if (CTS_SUCCESS != ret) {
+               Evas_Object *popup;
+               ERR("contacts_svc_connect() Failed(%d)", ret);
+               popup = elm_popup_add(ad->win);
+               evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+               elm_popup_timeout_set(popup, 1.5);
+               elm_object_text_set(popup, T_(PH_GET_TEXT_BASIC, PHTEXT_INITIALIZING));
+               evas_object_show(popup);
+               evas_object_smart_callback_add(popup, "timeout", phapp_win_del, NULL);
+               return 0;
+       }
+
+       UG_INIT_EFL(ad->win, UG_OPT_INDICATOR_PORTRAIT_ONLY);
+       ad->phoneui_d = phone_create_phoneui(ad->win);
+       appcore_set_event_callback(APPCORE_EVENT_REGION_CHANGE, phapp_region_changed, ad->phoneui_d);
+       appcore_set_open_cb(phapp_open, ad->phoneui_d);
+       appcore_measure_start();
+
+       return 0;
+}
+
+static int phapp_terminate(void *data)
+{
+       PH_FN_CALL;
+       struct phone_data *ad = data;
+       if (NULL != ad->win)
+               evas_object_del(ad->win);
+       ug_destroy_all();
+       contacts_svc_disconnect();
+       return 0;
+}
+
+static int phapp_pause(void *data)
+{
+       PH_FN_CALL;
+       struct phone_data *ad = data;
+       if (PH_VIEW_NONE != ad->phoneui_d->select_tab) {
+               int ret = vconf_set_int(PH_START_VIEW, ad->phoneui_d->select_tab);
+               p_warn_if(0 != ret, "vconf_set_int() Failed(%d)", ret);
+       }
+       phone_front_view_pause(ad->phoneui_d);
+       ug_pause();
+       return 0;
+}
+
+static int phapp_resume(void *data)
+{
+       // update missed log info
+       struct phone_data *ad = data;
+       phone_front_view_resume(ad->phoneui_d);
+       ug_resume();
+       return 0;
+}
+
+static int phapp_reset(bundle *b, void *data)
+{
+       PH_FN_CALL;
+       struct phone_data *ad = data;
+       ph_phoneui_data *phoneui_d;
+       char* val;
+       int ret;
+       int index= 0;
+
+       p_retvm_if(NULL == ad || NULL == ad->phoneui_d, -1, "data is null");
+       phoneui_d = ad->phoneui_d;
+
+       // missed_call : show log main view, from idle_lock, quickpanel
+       val = (char*)bundle_get_val(b,"logs");
+       if (val && 0 == strcmp(val, "missed_call")) {
+               phone_front_view_reset(phoneui_d, PH_VIEW_LOG, NULL);
+               return 0;
+       }
+
+       val = (char *)appsvc_get_operation(b);
+       if (val && 0 == strcmp(val, APPSVC_OPERATION_DIAL)) {
+               val = (char*)appsvc_get_uri(b);
+               if (val && 0 == strncmp(val, "tel:", 4))
+                       phone_front_view_reset(phoneui_d, PH_VIEW_DIALER, val);
+               return 0;
+       }
+
+       val = (char*)bundle_get_val(b, "launch_type");
+       if (val) {
+               if (0 == strcmp(val, "log"))
+                       phone_front_view_reset(phoneui_d, PH_VIEW_LOG, NULL);
+               else if (0 == strcmp(val, "favorite"))
+                       phone_front_view_reset(phoneui_d, PH_VIEW_FAVORITE, NULL);
+               else if (0 == strcmp(val, "dialer")) {
+                       if(phone_front_view_show_call_app(phoneui_d)) {
+                               if(phoneui_d->select_tab < PH_VIEW_DIALER)
+                                       elm_exit();
+                       }
+                       else
+                               phone_front_view_reset(phoneui_d, PH_VIEW_DIALER, NULL);
+               }
+               return 0;
+       }
+
+       // during incomming call
+       if (phone_front_view_show_call_app(phoneui_d)) {
+               if(phoneui_d->select_tab < PH_VIEW_DIALER)
+                       elm_exit();
+               return 0;
+       }
+
+       ret = vconf_get_int(PH_START_VIEW, &index);
+       if (ret < 0 || PH_VIEW_MAX <= index || index <= PH_VIEW_NONE) {
+               ERR("vconf_get_int() Failed(%d)", ret);
+               index = PH_VIEW_DIALER;
+       }
+       elm_toolbar_item_selected_set (phoneui_d->item[index], EINA_TRUE);
+
+       if (ad->win)
+               elm_win_activate(ad->win);
+       phoneui_d->timer = ecore_timer_add(3.0, phone_front_view_load_timer, phoneui_d);
+
+       return 0;
+}
+
+API int main(int argc, char *argv[])
+{
+       struct phone_data ad = {0};
+       struct appcore_ops ops = {
+               .create = phapp_create,
+               .terminate = phapp_terminate,
+               .pause = phapp_pause,
+               .resume = phapp_resume,
+               .reset = phapp_reset,
+       };
+
+       ops.data = &ad;
+
+       return appcore_efl_main(PACKAGE, &argc, &argv, &ops);
+}
+
diff --git a/debian/changelog b/debian/changelog
new file mode 100644 (file)
index 0000000..90e0959
--- /dev/null
@@ -0,0 +1,8 @@
+phone (0.3.1-6) unstable; urgency=low
+
+  * Git Initialize
+  * Git: pkgs/p/phoneui
+  * Tag: phone_0.3.1-6
+
+ -- Donghee Ye <donghee.ye@samsung.com>  Thu, 29 Mar 2012 16:01:44 +0900
+
diff --git a/debian/compat b/debian/compat
new file mode 100644 (file)
index 0000000..7ed6ff8
--- /dev/null
@@ -0,0 +1 @@
+5
diff --git a/debian/control b/debian/control
new file mode 100644 (file)
index 0000000..5323066
--- /dev/null
@@ -0,0 +1,30 @@
+Source: phone
+Section: devel
+Priority: extra
+Maintainer: Youngjae Shin <yj99.shin@samsung.com>, Donghee Ye <donghee.ye@samsung.com>, Sunggoo Kim <sung.goo.kim@samsung.com>, Somang Park <somang.park@samsung.com>
+Build-Depends: debhelper (>= 5), libappcore-efl-dev, libcontacts-service-dev, dlog-dev, libglib2.0-dev, libaul-1-dev, libui-gadget-dev, libnotification-dev, libslp-tapi-dev, libug-contacts-dev, libicu-dev, libvconf-dev, libvconf-keys-dev, libheynoti-dev, libappsvc-dev
+Standards-Version: 3.7.2
+Homepage: N/A
+
+Package: libug-phone-efl
+Section: devel
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Phone UI gadget library
+
+Package: libug-phone-dev
+Section: devel
+Architecture: any
+Depends: libug-phone-efl (= ${Source-Version})
+Description: Phone UI gadget Header
+
+Package: org.tizen.phone
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Phone application
+
+Package: phone-dbg
+Section: debug
+Architecture: any
+Depends: org.tizen.phone(= ${Source-Version}), libug-phone-efl(= ${Source-Version})
+Description: Phone application and UI gadget (unstripped)
diff --git a/debian/copyright b/debian/copyright
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/debian/dirs b/debian/dirs
new file mode 100644 (file)
index 0000000..ca882bb
--- /dev/null
@@ -0,0 +1,2 @@
+usr/bin
+usr/sbin
diff --git a/debian/docs b/debian/docs
new file mode 100644 (file)
index 0000000..a0f0008
--- /dev/null
@@ -0,0 +1 @@
+CMakeLists.txt
diff --git a/debian/libug-phone-dev.install.in b/debian/libug-phone-dev.install.in
new file mode 100644 (file)
index 0000000..41a1414
--- /dev/null
@@ -0,0 +1 @@
+usr/include/*
diff --git a/debian/libug-phone-efl.install.in b/debian/libug-phone-efl.install.in
new file mode 100644 (file)
index 0000000..5c70d63
--- /dev/null
@@ -0,0 +1,2 @@
+@UGDIR@/lib/*
+@UGDIR@/res/*
diff --git a/debian/libug-phone-efl.postinst.in b/debian/libug-phone-efl.postinst.in
new file mode 100755 (executable)
index 0000000..a798544
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+mkdir -p @UGDATADIR@
+
+if [ ${USER} = "root" ]
+then
+# Change file owner
+   chgrp 6005 @UGDATADIR@
+   chmod 770 @UGDATADIR@
+fi
+
+echo "Done"
diff --git a/debian/org.tizen.phone.install.in b/debian/org.tizen.phone.install.in
new file mode 100644 (file)
index 0000000..807e1a4
--- /dev/null
@@ -0,0 +1,2 @@
+@PREFIX@/*
+/opt/share/applications/org.tizen.phone.desktop
diff --git a/debian/org.tizen.phone.postinst.in b/debian/org.tizen.phone.postinst.in
new file mode 100755 (executable)
index 0000000..f32672f
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+if [ ${USER} = "root" ]
+then
+# Change file owner
+   chown -R 5000:5000 @PREFIX@/data
+fi
+
+echo "Done"
diff --git a/debian/rules b/debian/rules
new file mode 100755 (executable)
index 0000000..cb83146
--- /dev/null
@@ -0,0 +1,116 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+CFLAGS += -Wall
+LDFLAGS ?=
+PREFIX ?= /opt/apps/org.tizen.phone
+RESDIR ?= ${PREFIX}/res
+UGDIR ?= /opt/ug
+UGDATADIR ?= /opt/data/ug-phone
+
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+       CFLAGS += -O0
+else
+       CFLAGS += -O2
+endif
+
+LDFLAGS += -Wl,--hash-style=both -Wl,--rpath=/usr/lib -Wl,--rpath=${UGDIR}/lib -Wl,--as-needed
+
+CMAKE_BUILD_DIR ?= $(CURDIR)/cmake_build_tmp
+
+configure: configure-stamp
+configure-stamp:
+       dh_testdir
+       # Add here commands to configure the package.
+       mkdir -p $(CMAKE_BUILD_DIR) && cd $(CMAKE_BUILD_DIR) && \
+       CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" cmake .. -DCMAKE_INSTALL_PREFIX="$(PREFIX)"
+
+       touch configure-stamp
+
+build: build-stamp
+
+build-stamp: configure-stamp
+       dh_testdir
+
+       # Add here commands to compile the package.
+       cd $(CMAKE_BUILD_DIR) && $(MAKE)
+
+       for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
+               cat $$f > $${f%.in}; \
+               sed -i -e "s#@PREFIX@#$(PREFIX)#g" $${f%.in}; \
+               sed -i -e "s#@RESDIR@#$(RESDIR)#g" $${f%.in}; \
+               sed -i -e "s#@UGDATADIR@#$(UGDATADIR)#g" $${f%.in}; \
+               sed -i -e "s#@UGDIR@#$(UGDIR)#g" $${f%.in}; \
+       done
+
+       touch $@
+
+clean:
+       dh_testdir
+       dh_testroot
+       rm -f build-stamp configure-stamp
+
+       # Add here commands to clean up after the build process.
+       rm -rf $(CMAKE_BUILD_DIR)
+
+       for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
+               rm -f $${f%.in}; \
+       done
+
+       dh_clean
+
+install: build
+       dh_testdir
+       dh_testroot
+       dh_clean -k
+       dh_installdirs
+
+       # Add here commands to install the package into debian/wavplayer.
+       cd $(CMAKE_BUILD_DIR) && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
+
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+       dh_testdir
+       dh_testroot
+#      dh_installchangelogs
+#      dh_installdocs
+       dh_installexamples
+       dh_install --sourcedir=debian/tmp
+#      dh_installmenu
+#      dh_installdebconf
+#      dh_installlogrotate
+#      dh_installemacsen
+#      dh_installpam
+#      dh_installmime
+#      dh_python
+#      dh_installinit
+#      dh_installcron
+#      dh_installinfo
+       dh_installman
+       dh_link
+       dh_strip --dbg-package=phone-dbg
+       dh_compress
+       dh_fixperms
+#      dh_perl
+       dh_makeshlibs
+       dh_installdeb
+       dh_shlibdeps
+       dh_gencontrol
+       dh_md5sums
+       dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
diff --git a/icon_phone.png b/icon_phone.png
new file mode 100644 (file)
index 0000000..6d4d132
Binary files /dev/null and b/icon_phone.png differ
diff --git a/include/phone-ug.h b/include/phone-ug.h
new file mode 100755 (executable)
index 0000000..c145474
--- /dev/null
@@ -0,0 +1,143 @@
+/*
+ * 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 __PHONE_UG_H__
+#define __PHONE_UG_H__
+
+/**
+ * @defgroup   PHONE_UG PHONE UI-gadget
+ * @ingroup    SLP_UG
+ * @addtogroup PHONE_UG
+ * @{
+ *
+ * Phone UI-gadget
+ * \n This header file contains the declaration & description for Phone UG.
+ *
+ * @section Header To use Them:
+ * @code
+ * #include <phone-ug.h>
+ * @endcode
+ *
+ * @section example Example:
+ * @code
+ #include <stdio.h>
+ #include <ui-gadget.h>
+ #include <phone-ug.h>
+ * @endcode
+ *
+ void phonelog_ug ()
+ {
+    bundle *bd;
+    char buf[16];
+
+    bd = bundle_create();
+    if(NULL == bd) {
+       ERR("bundle_create() Failed");
+       return;
+    }
+
+    snprintf(buf, sizeof(buf), "%d", PH_UG_REQUEST_LOG_CHECK);
+    bundle_add(bd, PH_UG_BUNDLE_TYPE, buf);
+
+    cbs.layout_cb = ug_layout_cb;
+    cbs.result_cb = NULL;
+    cbs.destroy_cb = ug_destroy_cb;
+
+    ug = ug_create(NULL, UG_PHONE_LOG, UG_MODE_FULLVIEW, bd, &cbs);
+    if(NULL == ug)
+       ERR("ug_create() Failed");
+
+    bundle_free(bd);
+ }
+ * @endcode
+ */
+
+/**
+ * The name of phonelog UG
+ */
+#define UG_DIALER_LOG "dialer-efl"
+
+/**
+ * The name of dialer UG
+ * @see #PH_UG_LOG_TYPES
+ */
+#define UG_PHONE_LOG "phonelog-efl"
+
+/**
+ * The name of phoneui UG
+ */
+#define UG_PHONEUI_LOG "phoneui-efl"
+
+
+/**
+ * types of #PH_UG_LOG_TYPES
+ */
+enum PH_UG_LOG_TYPES{
+       PH_UG_REQUEST_LOG_CHECK = 11,
+       PH_UG_REQUEST_LOG_SELECT = 12,
+};
+
+/**
+ * The key of request bundle for type.
+ * \n Value : convert id to string by using \%d.
+ */
+#define PH_UG_BUNDLE_TYPE "type"
+
+/**
+ * The key of result bundle for phonelog index
+ * \n The contact index on #PH_UG_REQUEST_LOG_SELECT
+ * \n Value : convert id to integer by using atoi()
+ * \n Recommends to destroy Phone UG at ug_cbs.destroy_cb.(not ug_cbs.result_cb)
+ * \n In ug_cbs.result_cb, ug_destroy() should not be called.
+ */
+#define PH_UG_BUNDLE_RESULT_PLOG_ID "plog_id"
+
+/**
+ * The key of result bundle for a list of phonelog index
+ * \n The phonelog index on #PH_UG_REQUEST_LOG_CHECK
+ * \n Value : convert string to a integer array by using g_base64_decode()
+ * \n Recommends to destroy Phone UG at ug_cbs.destroy_cb.(not ug_cbs.result_cb)
+ * \n In ug_cbs.result_cb, ug_destroy() should not be called.
+ * @par example
+ * @code
+ void phonelog_result_cb(struct ui_gadget *ug, bundle *result, void *data)
+ {
+    if(NULL == ug || NULL == data)
+       return;
+
+    if(result) {
+       const char *val;
+       int *list, len, i;
+
+       val = bundle_get_val(result, PH_UG_BUNDLE_RESULT_PLOG_ID_LIST);
+       list = (int *)g_base64_decode(val, &len);
+
+       for(i=0;i<len/sizeof(int);i++)
+          printf("selected contact = %d", list[i]);
+
+       g_free(list);
+    }
+ }
+ *
+ * @endcode
+ */
+#define PH_UG_BUNDLE_RESULT_PLOG_ID_LIST "get_select_list"        // TODO : change to "plog_id_list"
+
+/**
+ * @}
+ */
+
+#endif //__PHONE_UG_H__
diff --git a/include/phone.h b/include/phone.h
new file mode 100755 (executable)
index 0000000..6674091
--- /dev/null
@@ -0,0 +1,135 @@
+/*
+ * 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 __PHONE_APP_H__
+#define __PHONE_APP_H__
+
+#include <Elementary.h>
+
+#ifndef API
+#define API __attribute__ ((visibility("default")))
+#endif
+
+#if !defined(PACKAGE)
+#  define PACKAGE "phone"
+#endif
+
+#define _EDJ(obj) (Evas_Object *)elm_layout_edje_get(obj)
+
+#define PH_DLOG_OUT
+#define PH_DEBUGGING
+
+#ifdef PH_DLOG_OUT
+#define LOG_TAG "PHONE"
+#include <dlog.h>
+#define DLOG(prio, fmt, arg...) \
+       do { SLOG(prio, LOG_TAG, fmt, ##arg); } while (0)
+#define INFO(fmt, arg...) SLOGI(fmt, ##arg)
+#define ERR(fmt, arg...) SLOGE("%s:" fmt, __FUNCTION__, ##arg)
+#define DBG(fmt, arg...) SLOGD("%s:" fmt, __FUNCTION__, ##arg)
+#else //PH_DLOG_OUT
+#define PRT(prio, fmt, arg...) \
+       do { fprintf((prio?stderr:stdout), "[Phone]" fmt"\n", ##arg); } while (0)
+#define INFO(fmt, arg...) PRT(0, fmt, ##arg)
+#define ERR(fmt, arg...) PRT(1, "%s :" fmt, __FUNCTION__, ##arg)
+#define DBG(fmt, arg...) \
+       do { \
+               printf("\x1b[105;37m[Phone]\x1b[0m(%s)" fmt "\n", __FUNCTION__, ##arg); \
+       } while (0)
+#endif //PH_DLOG_OUT
+
+#ifdef PH_DEBUGGING
+#define PH_FN_CALL DBG(">>>>>>>>%s called", __FUNCTION__)
+#define PH_FN_END DBG("<<<<<<<<%s ended", __FUNCTION__)
+#define PH_DBG DBG
+#define p_warn_if(expr, fmt, arg...) do { \
+       if (expr) { \
+               DBG("(%s) -> "fmt, #expr, ##arg); \
+       } \
+} while (0)
+#define p_ret_if(expr) do { \
+       if (expr) { \
+               DBG("(%s) -> %s() return", #expr, __FUNCTION__); \
+               return; \
+       } \
+} while (0)
+#define p_retv_if(expr, val) do { \
+       if (expr) { \
+               DBG("(%s) -> %s() return", #expr, __FUNCTION__); \
+               return (val); \
+       } \
+} while (0)
+#define p_retm_if(expr, fmt, arg...) do { \
+       if (expr) { \
+               ERR(fmt, ##arg); \
+               DBG("(%s) -> %s() return", #expr, __FUNCTION__); \
+               return; \
+       } \
+} while (0)
+#define p_retvm_if(expr, val, fmt, arg...) do { \
+       if (expr) { \
+               ERR(fmt, ##arg); \
+               DBG("(%s) -> %s() return", #expr, __FUNCTION__); \
+               return (val); \
+       } \
+} while (0)
+#else //PH_DEBUGGING
+#define PH_FN_CALL
+#define PH_FN_END
+//#define PH_DBG DBG
+#define PH_DBG(...)
+
+#define p_warn_if(expr, fmt, arg...) do { \
+       if (expr) { \
+               ERR(fmt, ##arg); \
+       } \
+} while (0)
+#define p_ret_if(expr) do { \
+       if (expr) { \
+               return; \
+       } \
+} while (0)
+#define p_retv_if(expr, val) do { \
+       if (expr) { \
+               return (val); \
+       } \
+} while (0)
+#define p_retm_if(expr, fmt, arg...) do { \
+       if (expr) { \
+               ERR(fmt, ##arg); \
+               return; \
+       } \
+} while (0)
+#define p_retvm_if(expr, val, fmt, arg...) do { \
+       if (expr) { \
+               ERR(fmt, ##arg); \
+               return (val); \
+       } \
+} while (0)
+
+#endif //PH_DEBUGGING
+
+#define SAFE_STR(src) (src)?src:""
+#define STR_BLANK(src) (src)?" ":"", SAFE_STR(src)
+
+#define SAFE_STRDUP(src) (NULL != src)?strdup(src):NULL
+#define FREEandSTRDUP(dest, src) \
+       do{ \
+               free(dest); dest=NULL;\
+               if (src) dest = strdup(src); \
+       }while(false)
+
+#endif //__PHONE_APP_H__
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
new file mode 100755 (executable)
index 0000000..388f134
--- /dev/null
@@ -0,0 +1,49 @@
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
+
+SET(COMMON_LIB phone-common)
+SET(PHONELOG ug-phonelog-efl)
+SET(PH_VIEW_DIALER ug-dialer-efl)
+SET(MAIN ug-phoneui-efl)
+SET(UGLIBDIR "/opt/ug/lib")
+
+FILE(GLOB COMMON_SRCS common/*.c)
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(ug_pkgs REQUIRED contacts-service)
+
+SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fPIC")
+
+FOREACH(flag ${ug_pkgs_CFLAGS})
+       SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
+SET(ug_pkgs_LDFLAGS "${pkgs_LDFLAGS} ${ug_pkgs_LDFLAGS}")
+
+
+ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_BINARY_DIR}/progress.edj
+       COMMAND edje_cc -id ${CMAKE_SOURCE_DIR}/lib/images
+       ${EDC_SRC_DIR}/progress.edc ${CMAKE_BINARY_DIR}/progress.edj
+       DEPENDS ${EDC_SRC_DIR}/progress.edc
+       )
+
+ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_BINARY_DIR}/dialer.edj
+       COMMAND edje_cc -id ${CMAKE_SOURCE_DIR}/lib/images
+       ${EDC_SRC_DIR}/dialer.edc ${CMAKE_BINARY_DIR}/dialer.edj
+       DEPENDS ${EDC_SRC_DIR}/dialer.edc
+       )
+
+ADD_CUSTOM_TARGET(progress_edj_build DEPENDS ${CMAKE_BINARY_DIR}/progress.edj)
+ADD_CUSTOM_TARGET(dialer_edj_build DEPENDS ${CMAKE_BINARY_DIR}/dialer.edj)
+
+ADD_LIBRARY(${COMMON_LIB} STATIC ${COMMON_SRCS})
+SET_TARGET_PROPERTIES(${COMMON_LIB} PROPERTIES COMPILE_FLAGS ${EXTRA_CFLAGS})
+TARGET_LINK_LIBRARIES(${COMMON_LIB} ${ug_pkgs_LDFLAGS})
+
+#INSTALL(TARGETS ${COMMON_LIB} DESTINATION /usr/lib)
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/include/phone-ug.h DESTINATION /usr/include)
+INSTALL(FILES ${CMAKE_BINARY_DIR}/progress.edj DESTINATION ${EDJDIR})
+INSTALL(FILES ${CMAKE_BINARY_DIR}/dialer.edj DESTINATION ${EDJDIR})
+
+ADD_SUBDIRECTORY(log)
+ADD_SUBDIRECTORY(dialer)
+ADD_SUBDIRECTORY(phoneui)
diff --git a/lib/common/ph-common.c b/lib/common/ph-common.c
new file mode 100755 (executable)
index 0000000..6ef6ed2
--- /dev/null
@@ -0,0 +1,566 @@
+/*
+ * 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 <contacts-ug.h>
+#include <ui-gadget-module.h>
+#include <aul.h>
+#include <appsvc.h>
+
+#include "phone.h"
+#include "phone-common.h"
+
+#define MSG_COMPOSER_UG "msg-composer-efl"
+
+#ifdef PH_TIMECHECK
+double ph_set_start_time(void)
+{
+       struct timeval tv;
+       double curtime;
+
+       gettimeofday(&tv, NULL);
+       curtime = tv.tv_sec * 1000 + (double)tv.tv_usec/1000;
+       return curtime;
+}
+
+double ph_exec_time(double start)
+{
+       double end = ph_set_start_time();
+       return (end - start - ph_correction);
+}
+
+int ph_init_time(void)
+{
+       double temp_t;
+       temp_t = ph_set_start_time();
+       ph_correction = ph_exec_time(temp_t);
+
+       return 0;
+}
+#endif
+
+void phone_progress_popup_del(void *data, Evas_Object *obj, void *event_info)
+{
+       ph_progress_info *p_info = data;
+       p_info->alive = false;
+}
+
+void phone_free_contacts(Eina_List *list)
+{
+       Eina_List *l;
+       ph_contact_d *cd;
+
+       p_retm_if(NULL == list, "list is NULL");
+
+       EINA_LIST_FOREACH(list, l, cd) {
+               if (NULL == cd)
+                       continue;
+
+               free(cd->display);
+               free(cd->img_path);
+               free(cd->number);
+               free(cd);
+       }
+       eina_list_free(list);
+}
+
+void phone_view_back_btn_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       /* TODO : remove evas_object_smart_callback_del, it will be controlled by WINSET */
+       evas_object_smart_callback_del(obj, "clicked", phone_view_back_btn_cb);
+
+       elm_naviframe_item_pop(data);
+}
+
+static void ug_common_layout_cb(struct ui_gadget *ug, enum ug_mode mode, void *priv)
+{
+       Evas_Object *base;
+
+       if (!ug)
+               return;
+
+       base = ug_get_layout(ug);
+       if (!base) {
+               ERR("ug_get_layout() return NULL");
+               ug_destroy(ug);
+               return;
+       }
+       evas_object_size_hint_weight_set(base, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       elm_win_resize_object_add(ug_get_window(), base);
+
+       evas_object_show(base);
+}
+
+static void ug_common_destroy_cb(struct ui_gadget *ug, void *priv)
+{
+       struct ug_priv_data *priv_data;
+
+       p_retm_if(NULL == ug, "ug is NULL");
+       ug_destroy(ug);
+
+       p_retm_if(NULL == priv, "priv is NULL");
+
+       priv_data = (struct ug_priv_data *)priv;
+
+       if (priv_data->destroy_cb)
+               priv_data->destroy_cb(priv_data->cb_param);
+
+       free(priv);
+
+       PH_FN_END;
+}
+
+void* phone_launch_msg_composer_ug(void *parent_ug, char *data,
+               void(*destroy_cb)(void*), void *cb_param)
+{
+       PH_FN_CALL;
+       struct ui_gadget *ug;
+       struct ug_cbs cbs = {0};
+       struct ug_priv_data *priv_data;
+       bundle *kb;
+
+       priv_data = calloc(1, sizeof(struct ug_priv_data));
+       p_retvm_if(NULL == priv_data, NULL, "calloc is failed");
+       priv_data->destroy_cb = destroy_cb;
+       priv_data->cb_param = cb_param;
+
+       kb = bundle_create();
+       if (NULL == kb) {
+               ERR("bundle_create() Failed");
+               free(priv_data);
+               return NULL;
+       }
+       bundle_add(kb, "TO", (char*)data);
+
+       cbs.priv = priv_data;
+       cbs.layout_cb = ug_common_layout_cb;
+       cbs.result_cb = NULL;
+       cbs.destroy_cb = ug_common_destroy_cb;
+
+       ug = ug_create(parent_ug, MSG_COMPOSER_UG, UG_MODE_FULLVIEW, kb, &cbs);
+       bundle_free(kb);
+
+       if (ug == NULL) {
+               free(priv_data);
+               ERR("%s ug_create is failed", MSG_COMPOSER_UG);
+       }
+       return ug;
+}
+
+void* phone_launch_contact_detail_ug(void *parent_ug, int contact_index,
+               void(*destroy_cb)(void*), void *cb_param)
+{
+       PH_FN_CALL;
+       char buf[PH_TEXT_MAX_LEN] = {0};
+       struct ug_cbs cbs = {0};
+       bundle *bd;
+       struct ui_gadget *ug;
+       struct ug_priv_data *priv_data;
+
+       priv_data = calloc(1, sizeof(struct ug_priv_data));
+       p_retvm_if(NULL == priv_data, NULL, "calloc is failed");
+       priv_data->destroy_cb = destroy_cb;
+       priv_data->cb_param = cb_param;
+
+       bd = bundle_create();
+       if (NULL == bd) {
+               ERR("bundle_create() Failed");
+               free(priv_data);
+               return NULL;
+       }
+       snprintf(buf, sizeof(buf), "%d", contact_index);
+       bundle_add(bd, CT_UG_BUNDLE_ID, buf);
+       snprintf(buf, sizeof(buf), "%d", CT_UG_REQUEST_DETAIL);
+       bundle_add(bd, CT_UG_BUNDLE_TYPE, buf);
+
+       cbs.priv = priv_data;
+       cbs.layout_cb = ug_common_layout_cb;
+       cbs.result_cb = NULL;
+       cbs.destroy_cb = ug_common_destroy_cb;
+
+       ug = ug_create(parent_ug, UG_CONTACTS_DETAILS, UG_MODE_FULLVIEW, bd, &cbs);
+       bundle_free(bd);
+
+       if (NULL == ug) {
+               free(priv_data);
+               ERR("%s ug_create fail", UG_CONTACTS_DETAILS);
+       }
+       return ug;
+}
+
+void* phone_launch_contact_add_list_edit_ug(void *parent_ug, char *data,
+               void (*destroy_cb)(void *), void *cb_param)
+{
+       PH_FN_END;
+       char buf[PH_TEXT_MAX_LEN] = {0};
+       struct ug_cbs cbs = {0};
+       struct ug_priv_data *priv_data;
+       struct ui_gadget *ug;
+       bundle *kb;
+
+       priv_data = calloc(1, sizeof(struct ug_priv_data));
+       p_retvm_if(NULL == priv_data, NULL, "calloc is failed");
+       priv_data->destroy_cb = destroy_cb;
+       priv_data->cb_param = cb_param;
+
+       kb = bundle_create();
+       if (NULL == kb) {
+               ERR("bundle_create() Failed");
+               free(priv_data);
+               return NULL;
+       }
+       snprintf(buf, sizeof(buf), "%d", CT_UG_REQUEST_UPDATE_WITH_NUM);
+       bundle_add(kb, CT_UG_BUNDLE_TYPE, buf);
+       snprintf(buf, sizeof(buf), "%s", data);
+       bundle_add(kb, CT_UG_BUNDLE_NUM, buf);
+       PH_DBG("number %s", buf);
+
+       cbs.priv = priv_data;
+       cbs.layout_cb = ug_common_layout_cb;
+       cbs.result_cb = NULL;
+       cbs.destroy_cb = ug_common_destroy_cb;
+
+       ug = ug_create(parent_ug, UG_CONTACTS_LIST, UG_MODE_FULLVIEW, kb, &cbs);
+       bundle_free(kb);
+       if (NULL == ug) {
+               free(priv_data);
+               ERR("%s ug_create fail", UG_CONTACTS_LIST);
+       }
+       return ug;
+}
+
+static void ug_contact_list_result_cb(struct ui_gadget *ug, bundle *result, void *priv)
+{
+       PH_FN_CALL;
+       const char *temp_p = NULL;
+       struct ug_priv_data *priv_data = priv;
+       int id;
+       p_retm_if(NULL == priv, "private data is NULL");
+
+       temp_p = bundle_get_val(result, "id");
+       id = atoi(temp_p);
+       if (priv_data->result_cb)
+               priv_data->result_cb(priv_data->cb_param, (void*)&id);
+       PH_FN_END;
+}
+
+void* phone_launch_contact_list_ug(void *parent_ug, int request,
+               void(*result_cb)(void*, void*), void(*destroy_cb)(void*), void*cb_param)
+{
+       PH_FN_CALL;
+       char ug_request[PH_TEXT_MAX_LEN] = {0};
+       struct ug_priv_data *priv_data;
+       struct ui_gadget *ug;
+       struct ug_cbs cbs = {0};
+       bundle *kb;
+
+       priv_data = calloc(1, sizeof(struct ug_priv_data));
+       p_retvm_if(NULL == priv_data, NULL, "calloc is failed");
+       priv_data->destroy_cb = destroy_cb;
+       priv_data->result_cb = result_cb;
+       priv_data->cb_param = cb_param;
+
+       kb = bundle_create();
+       if (NULL == kb) {
+               ERR("bundle_create() Failed");
+               free(priv_data);
+               return NULL;
+       }
+       snprintf(ug_request, sizeof(ug_request), "%d", request);
+       bundle_add(kb, CT_UG_BUNDLE_TYPE, ug_request);
+
+       cbs.priv = priv_data;
+       cbs.layout_cb = ug_common_layout_cb;
+       cbs.destroy_cb = ug_common_destroy_cb;
+       cbs.result_cb = ug_contact_list_result_cb;
+
+       ug = ug_create(parent_ug, UG_CONTACTS_LIST, UG_MODE_FULLVIEW, kb, &cbs);
+       bundle_free(kb);
+       if (NULL == ug) {
+               free(priv_data);
+               ERR("%s ug_create fail", UG_CONTACTS_LIST);
+       }
+       return ug;
+}
+
+Evas_Object * phone_get_notify(Evas_Object *parent)
+{
+       Evas_Object *notify;
+
+       notify = evas_object_data_get(parent, "notify");
+       if (NULL == notify) {
+               Evas_Object *info_layout;
+               notify = elm_notify_add(parent);
+               elm_notify_orient_set(notify, ELM_NOTIFY_ORIENT_BOTTOM);
+
+               info_layout = elm_layout_add(parent);
+               elm_layout_theme_set(info_layout, "standard", "selectioninfo", "vertical/bottom_64");
+               elm_object_content_set(notify, info_layout);
+               evas_object_layer_set(notify, EVAS_LAYER_MAX);
+               evas_object_data_set(parent, "notify", notify);
+       }
+       return notify;
+}
+
+void phone_show_notify(Evas_Object *parent, const char *msg, double timeout)
+{
+       Evas_Object *layout;
+       Evas_Object *notify;
+
+       notify = phone_get_notify(parent);
+       layout = elm_object_content_get(notify);
+       edje_object_part_text_set(_EDJ(layout), "elm.text", msg);
+
+       elm_notify_timeout_set(notify, timeout);
+
+       if (evas_object_visible_get(notify))
+               evas_object_hide(notify);
+
+       evas_object_show(notify);
+}
+
+void phone_hide_notify(Evas_Object *parent)
+{
+       Evas_Object *notify;
+
+       notify = evas_object_data_get(parent, "notify");
+       if (notify && evas_object_visible_get(notify))
+               evas_object_hide(notify);
+}
+
+static void popup_block_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       evas_object_del(obj);
+}
+
+Evas_Object *phone_create_popup(Evas_Object *parent, const char *desc, double timeout)
+{
+       Evas_Object *popup;
+       popup = elm_popup_add(parent);
+       evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       evas_object_smart_callback_add(popup, "block,clicked", popup_block_clicked_cb, NULL);
+       elm_popup_timeout_set(popup, timeout);
+       elm_object_text_set(popup, desc);
+       evas_object_show(popup);
+       return popup;
+}
+
+Evas_Object* phone_create_confirm_popup(Evas_Object *win, const char* description)
+{
+       Evas_Object* popup = elm_popup_add(win);
+       evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       elm_object_text_set(popup, description);
+       evas_object_show(popup);
+
+       return popup;
+}
+
+void phone_launch_voice_call(char *number, int ct_id)
+{
+       PH_FN_CALL;
+       bundle * kb;
+       char buf[PH_TEXT_MAX_LEN] = {0};
+       p_retm_if(NULL == number, "data is null");
+
+       kb = bundle_create();
+       p_retm_if(NULL == kb, "bundle_create() Failed");
+
+       appsvc_set_operation(kb, APPSVC_OPERATION_CALL);
+       snprintf(buf, sizeof(buf), "tel:%s", number);
+       appsvc_set_uri(kb, buf);
+       if (0 < ct_id) {
+               snprintf(buf, sizeof(buf), "%d", ct_id);
+               appsvc_add_data(kb, "ctindex", buf);
+       }
+       appsvc_run_service(kb, 0, NULL, NULL);
+
+       bundle_free(kb);
+}
+
+Evas_Object* phone_create_layout(Evas_Object *parent, bool is_fullview)
+{
+       Evas_Object *base;
+
+       base = elm_layout_add(parent);
+       p_retvm_if(NULL == base, NULL, "elm_layout_add() Failed");
+       if (is_fullview)
+               elm_layout_theme_set(base, "layout", "application", "default");
+       else
+               elm_layout_theme_set(base, "layout", "application", "noindicator");
+       evas_object_size_hint_weight_set(base, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+
+       return base;
+}
+
+void phone_ug_destroy_me_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       PH_FN_CALL;
+       /* TODO : remove evas_object_smart_callback_del, it will be controlled by WINSET */
+       evas_object_smart_callback_del(obj, "clicked", phone_ug_destroy_me_cb);
+       ug_destroy_me(data);
+       PH_FN_END;
+}
+
+void phone_back_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       Evas_Object *win = data;
+       elm_win_lower(win);
+}
+
+char *phone_get_display_name_from_value(CTSvalue *value, int display_field, int first_field, int last_field)
+{
+       const char *first, *last;
+       char *display, name[PATH_MAX];
+
+       display = contacts_svc_value_steal_str(value, display_field);
+       if (display) return display;
+
+       first = contacts_svc_value_get_str(value, first_field);
+       last = contacts_svc_value_get_str(value, last_field);
+
+       if (CTS_ORDER_NAME_FIRSTLAST == contacts_svc_get_order(CTS_ORDER_OF_DISPLAY))
+               snprintf(name, sizeof(name), "%s%s%s", SAFE_STR(first), STR_BLANK(last));
+       else
+               snprintf(name, sizeof(name), "%s%s%s", SAFE_STR(last), STR_BLANK(first));
+
+       return strdup(name);
+}
+
+Evas_Object* phone_create_bg(Evas_Object *parent)
+{
+       Evas_Object *bg;
+
+       bg = elm_bg_add(parent);
+       p_retvm_if(NULL == bg, NULL, "elm_bg_add() return NULL");
+
+       evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       elm_object_part_content_set(parent, "elm.swallow.bg", bg);
+
+       return bg;
+}
+
+Evas_Object* phone_progressbar_popup(Evas_Object *parent, ph_progress_info *p_info, const char *title)
+{
+       char buf[PH_TEXT_MAX_LEN];
+       Evas_Object *popup;
+       Evas_Object *layout;
+       Evas_Object *label;
+       Evas_Object *progressbar;
+
+       popup = elm_popup_add(parent);
+       p_retvm_if(NULL == popup, NULL, "elm_popup_add() return NULL");
+
+       layout = elm_layout_add(popup);
+       p_retvm_if(NULL == layout, NULL, "elm_layout_add() return NULL");
+       elm_layout_file_set(layout, PROGRESS_EDJ, "popup_center_text_progressview");
+       evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       p_info->layout = layout;
+
+       label = elm_label_add(layout);
+       p_retvm_if(NULL == label, NULL, "elm_label_add() return NULL");
+       snprintf(buf, sizeof(buf), "<align=middle>%s</>", title);
+       elm_object_text_set(label, buf);
+       elm_object_style_set(label, "popup_description/default");
+       elm_label_line_wrap_set(label, EINA_TRUE);
+       evas_object_size_hint_weight_set(label, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       evas_object_size_hint_align_set(label, EVAS_HINT_FILL, EVAS_HINT_FILL);
+       evas_object_show(label);
+
+       progressbar = elm_progressbar_add(layout);
+       p_retvm_if(NULL == progressbar, NULL, "elm_progressbar_add() return NULL");
+       p_info->progressbar= progressbar;
+       elm_object_style_set(progressbar, "list_progress");
+       elm_progressbar_value_set(progressbar, 0.0);
+       evas_object_size_hint_weight_set(progressbar, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       evas_object_show(progressbar);
+
+       elm_object_part_content_set(layout, "elm.swallow.content", label);
+       elm_object_part_content_set(layout, "elm.swallow.end", progressbar);
+       elm_object_content_set(popup, layout);
+
+       evas_object_show(popup);
+       return popup;
+}
+
+void phone_cbar_item_clear(Evas_Object *cbar)
+{
+       Elm_Object_Item *c_item, *n_item;
+       p_retm_if(NULL == cbar, "parameter(toolbar) is NULL");
+       c_item = elm_toolbar_first_item_get(cbar);
+       while(c_item) {
+               n_item = elm_toolbar_item_next_get(c_item);
+               elm_object_item_del(c_item);
+               c_item = n_item;
+       }
+}
+
+Evas_Object *phone_create_icon_with_img(Evas_Object *parent, char *full_path)
+{
+       Evas_Object *ic = elm_icon_add(parent);
+       p_retvm_if(NULL == ic, NULL, "elm_icon_add() return NULL");
+       elm_icon_file_set(ic, full_path, NULL);
+       elm_icon_resizable_set(ic, EINA_TRUE, EINA_TRUE);
+       evas_object_image_smooth_scale_set(ic, EINA_FALSE);
+       return ic;
+}
+
+Evas_Object* phone_naviframe_btn(Evas_Object *parent, const char *label)
+{
+       Evas_Object *btn;
+
+       btn = elm_button_add(parent);
+       elm_object_style_set(btn, "naviframe/title/default");
+       elm_object_text_set(btn, label);
+       evas_object_show(btn);
+
+       return btn;
+}
+
+Evas_Object* phone_create_nocontents(Evas_Object *parent, const char* label)
+{
+       Evas_Object *layout;
+
+       layout = elm_layout_add(parent);
+       p_retvm_if(NULL == layout, NULL, "elm_layout_add() return NULL");
+
+       elm_layout_theme_set(layout, "layout", "nocontents", "full");
+       elm_object_part_text_set(layout, "elm.text", label);
+
+       return layout;
+}
+
+Evas_Object* phone_create_popup_button(Evas_Object *popup, int index, const char* label, Evas_Smart_Cb cb, void *cb_data)
+{
+       Evas_Object *btn;
+       char part[PH_TEXT_SHORT_LEN];
+
+       btn = elm_button_add(popup);
+       elm_object_text_set(btn, label);
+       snprintf(part, sizeof(part), "button%d", index);
+
+       elm_object_part_content_set(popup, part, btn);
+       evas_object_smart_callback_add(btn, "clicked", cb, cb_data);
+       return btn;
+}
+
+void phone_toolbar_disalbed_item_append(Evas_Object *toolbar, int cnt)
+{
+       int i;
+       Elm_Object_Item *item;
+       for(i=0;i<cnt;i++) {
+               item = elm_toolbar_item_append(toolbar, NULL, NULL, NULL, NULL);
+               elm_object_item_disabled_set(item, EINA_TRUE);
+       }
+}
diff --git a/lib/common/ph-text.c b/lib/common/ph-text.c
new file mode 100755 (executable)
index 0000000..c9137be
--- /dev/null
@@ -0,0 +1,89 @@
+/*
+ * 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 <appcore-efl.h>
+
+#include "phone.h"
+#include "phone-text.h"
+
+static const char *basic_str[] = {
+       N_("IDS_PB_ITAB4_DIALLER"),
+       N_("IDS_PB_ITAB4_FAVOURITES"),
+       N_("IDS_CST_BODY_VOICE_MAIL"),
+       N_("IDS_CLOG_ITAB4_LOGS"),
+       N_("IDS_PB_POP_REQUEST_FAILED"),
+       N_("IDS_PB_POP_REQUEST_SUCCESS"),
+       N_("IDS_CALL_POP_EMERGENCY_CALL"),
+       N_("IDS_CLOG_BODY_NO_LOGS"),
+       N_("IDS_PB_BODY_NO_FAVOURITES"),
+       N_("IDS_PB_POP_MAXIMUM_PHONE_NUMBER_LENGTH_EXCEEDED"),
+       N_("IDS_CLOG_POP_DELETING_LOGS_ING"),
+       N_("IDS_PB_POP_DELETING_FAVOURITES_ING"),
+       N_("IDS_PB_POP_INITIALISING_TRY_LATER_ING"),
+};
+
+static const char *base_op_str[] = {
+       N_("IDS_CLOG_HEADER_SELECT_LOGS"),
+       N_("IDS_CST_OPT_CHANGE_CONTACT_ABB"),
+};
+
+const char* phone_get_text(int op, int type)
+{
+       const char **table;
+
+       switch (op) {
+       case PH_GET_TEXT_BASIC:
+               table = basic_str;
+               return dgettext(PACKAGE, table[type]);
+       case PH_GET_TEXT_BASE_OP:
+               table = base_op_str;
+               return dgettext(PACKAGE, table[type]);
+       default:
+               return NULL;
+       }
+}
+
+static const char *sys_str[] = {
+       "IDS_COM_SK_OK",
+       "IDS_COM_SK_EDIT",
+       "IDS_COM_SK_DELETE",
+       "IDS_COM_SK_CANCEL",
+       "IDS_COM_BODY_CALL",
+       "IDS_COM_BODY_MESSAGE",
+       "IDS_COM_BODY_UNKNOWN",
+       "IDS_COM_BODY_SELECT_ALL",
+       "IDS_COM_BODY_CONTACTS",
+       "IDS_COM_BODY_DETAILS",
+       "IDS_COM_BODY_REMOVE",
+       "IDS_COM_POP_FAIL",
+       "IDS_COM_POP_FAILED",
+       "IDS_COM_POP_CLOSE",
+       "IDS_COM_POP_REMOVED",
+       "IDS_COM_POP_DELETED",
+       "IDS_COM_POP_INCORRECT_PASSWORD",
+       "IDS_COM_POP_ALREDY_EXISTS",
+       "IDS_COM_POP_SELECTED",
+       "IDS_COM_OPT_ADD_TO_CONTACTS",
+       "IDS_COM_BODY_TODAY",
+       "IDS_COM_BODY_YESTERDAY",
+       "IDS_COM_BODY_PREVIOUS",
+       "IDS_COM_BODY_NO_NAME",
+};
+
+const char* phone_get_system_string(int type)
+{
+       return dgettext("sys_string", sys_str[type]);
+}
diff --git a/lib/dialer/CMakeLists.txt b/lib/dialer/CMakeLists.txt
new file mode 100755 (executable)
index 0000000..9dba0a5
--- /dev/null
@@ -0,0 +1,21 @@
+LINK_DIRECTORIES(${CMAKE_BINARY_DIR})
+
+SET(TARGET ${PH_VIEW_DIALER})
+
+FILE(GLOB SRCS *.c)
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(dialer_pkgs REQUIRED tapi)
+
+FOREACH(flag ${dialer_pkgs_CFLAGS})
+       SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
+ADD_LIBRARY(${TARGET} SHARED ${SRCS})
+SET_TARGET_PROPERTIES(${TARGET} PROPERTIES VERSION ${VERSION})
+SET_TARGET_PROPERTIES(${TARGET} PROPERTIES COMPILE_FLAGS ${EXTRA_CFLAGS})
+TARGET_LINK_LIBRARIES(${TARGET} ${COMMON_LIB} ${ug_pkgs_LDFLAGS} ${SPEEDDIAL} ${dialer_pkgs_LDFLAGS})
+
+ADD_DEPENDENCIES(${TARGET} dialer_edj_build dialer_theme_build)
+
+INSTALL(TARGETS ${TARGET} DESTINATION ${UGLIBDIR})
diff --git a/lib/dialer/ph-dialer-main.c b/lib/dialer/ph-dialer-main.c
new file mode 100755 (executable)
index 0000000..b319f52
--- /dev/null
@@ -0,0 +1,181 @@
+/*
+ * 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 <bundle.h>
+#include <ui-gadget-module.h>
+
+#include "phone.h"
+#include "phone-dialer.h"
+
+#include "ph-dialer-view.h"
+#include "ph-dialer-utils.h"
+
+static bool dialer_create_ug_view(ph_dialer_data *dial_d, Evas_Object *base)
+{
+       int ret;
+       const char *title;
+       Evas_Object *back_btn;
+       p_retvm_if(NULL == dial_d, false, "Parameter is null");
+
+       if (NULL == dial_d->navi) {
+               dial_d->navi = elm_naviframe_add(base);
+               p_retvm_if(NULL == dial_d->navi, false, "elm_naviframe_add is failed");
+               elm_object_part_content_set(base, "elm.swallow.content", dial_d->navi);
+               evas_object_show(dial_d->navi);
+       }
+
+       ret = ph_dialer_create_content(dial_d);
+       p_retvm_if(ret < 0, false, "Fail to ph_dialer_create_content");
+       if (dial_d->is_emergency)
+               title = T_(PH_GET_TEXT_BASIC, PHTEXT_EMERGENCY_CALL);
+       else
+               title = T_(PH_GET_TEXT_BASIC, PHTEXT_DIALER);
+
+       back_btn = elm_button_add(dial_d->navi);
+       if (back_btn) {
+               evas_object_smart_callback_add(back_btn, "clicked", phone_ug_destroy_me_cb, dial_d->ug);
+               elm_object_style_set(back_btn, "naviframe/back_btn/default");
+       }
+       elm_naviframe_item_push(dial_d->navi, title, back_btn, NULL, dial_d->layout, NULL);
+
+       return true;
+}
+
+void* dialer_on_create(struct ui_gadget *ug, enum ug_mode mode, bundle *data, void *priv)
+{
+       int ret;
+       char *val;
+       Evas_Object *bg;
+       Evas_Object *parent;
+       Evas_Object *base;
+       ph_dialer_data *dial_d = priv;
+
+       p_retvm_if(NULL == ug || NULL == priv, NULL,
+                       "The parameter is invalid(ug=%p, priv=%p)", ug, priv);
+
+       parent = ug_get_parent_layout(ug);
+       p_retvm_if(NULL == parent, NULL, "ug_get_parent_layout() return NULL");
+       dial_d->ug = ug;
+       dial_d->win = ug_get_window();
+
+       bindtextdomain(PACKAGE, LOCALEDIR);
+
+       ret = contacts_svc_connect();
+       p_retvm_if(CTS_SUCCESS != ret, NULL, "contacts_svc_connect() Failed(%d)", ret);
+
+       val = (char*)bundle_get_val(data, "emergency_dialer");
+       if (val && 0 == strcmp(val, "emergency"))
+               dial_d->is_emergency = true;
+       else
+               dial_d->is_emergency = false;
+
+       if (UG_MODE_FULLVIEW == mode)
+               base = phone_create_layout(parent, true);
+       else
+               base = phone_create_layout(parent, false);
+
+       bg = phone_create_bg(base);
+       if (NULL == bg) {
+               PH_DBG("phone_create_bg() return NULL");
+               evas_object_del(base);
+               ret = contacts_svc_disconnect();
+               p_warn_if(CTS_SUCCESS != ret, "contacts_svc_disconnect() Failed(%d)", ret);
+               return NULL;
+       }
+
+       if (!dialer_create_ug_view(dial_d, base)) {
+               evas_object_del(base);
+               ret = contacts_svc_disconnect();
+               p_warn_if(CTS_SUCCESS != ret, "contacts_svc_disconnect() Failed(%d)", ret);
+               base = NULL;
+       }
+       return base;
+}
+
+static void dialer_on_event(struct ui_gadget *ug, enum ug_event event, bundle *data, void *priv)
+{
+}
+
+static void dialer_on_pause(struct ui_gadget *ug, bundle *data, void *priv)
+{
+}
+
+static void dialer_on_resume(struct ui_gadget *ug, bundle *data, void *priv)
+{
+}
+
+static void dialer_on_destroy(struct ui_gadget *ug, bundle *data, void *priv)
+{
+       PH_FN_CALL;
+       if (!ug)
+               return;
+
+       evas_object_del(ug_get_layout(ug));
+       contacts_svc_disconnect();
+}
+
+static void dialer_on_message(struct ui_gadget *ug, bundle *msg, bundle *data, void *priv)
+{
+}
+
+API int UG_MODULE_INIT(struct ug_module_ops *ops)
+{
+       ph_dialer_data *dial_d;
+       p_retvm_if(NULL == ops, -1, "ops is NULL");
+
+       dial_d = calloc(1, sizeof(ph_dialer_data));
+       p_retvm_if(NULL == dial_d, -1, "dial_d is NULL, Not enough memory");
+
+       ops->create = dialer_on_create;
+       ops->start = NULL;
+       ops->pause = dialer_on_pause;
+       ops->resume = dialer_on_resume;
+       ops->destroy = dialer_on_destroy;
+       ops->message = dialer_on_message;
+       ops->event = dialer_on_event;
+       ops->priv = dial_d;
+       ops->opt = UG_OPT_INDICATOR_ENABLE;
+
+       return 0;
+}
+
+API void UG_MODULE_EXIT(struct ug_module_ops *ops)
+{
+       p_retm_if(!ops, "ops is NULL");
+
+       ops->priv = NULL;
+}
+
+API Evas_Object* phone_create_dialer_view(void *ug, Evas_Object *win, Evas_Object *navi)
+{
+       ph_dialer_data *dial_d;
+       p_retvm_if(NULL == navi, NULL, "The parameter(navi) is NULL");
+
+       dial_d = calloc(1, sizeof(ph_dialer_data));
+       p_retvm_if(NULL == dial_d, NULL, "dial_d is NULL, Not enough memory");
+       dial_d->ug = ug;
+       dial_d->win = win;
+
+       dial_d->navi = navi;
+       dial_d->is_emergency = false;
+
+       if (!ph_dialer_create_content(dial_d)) {
+               free(dial_d);
+               return NULL;
+       }
+       return dial_d->layout;
+}
+
diff --git a/lib/dialer/ph-dialer-tapi.c b/lib/dialer/ph-dialer-tapi.c
new file mode 100755 (executable)
index 0000000..b112cdf
--- /dev/null
@@ -0,0 +1,312 @@
+/*
+ * 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 <TapiCommon.h>
+#include <ITapiSim.h>
+#include <ITapiCall.h>
+#include <TapiEvent.h>
+
+#include "phone.h"
+#include "phone-dialer.h"
+#include "ph-dialer-view.h"
+#include "ph-dialer-utils.h"
+
+#define PHONE_PKG "org.tizen.phone"
+
+static int request_id;
+static int iNumOfSIMEvt = 0;
+static unsigned int* SIM_subscription_id;
+
+static void sim_async_event_callback(TelTapiEvent_t* sim_event, void *data)
+{
+       PH_FN_CALL;
+       p_retm_if(NULL == sim_event || NULL == sim_event->pData, "No Event Data!!");
+
+       if (sim_event->EventClass == TAPI_EVENT_CLASS_SIM) {
+               switch (sim_event->EventType) {
+               case TAPI_EVENT_SIM_PB_ACCESS_READ_CNF:
+                       {
+                               TelSimPbRecordData_t *sim_acces_info = (TelSimPbRecordData_t*)sim_event->pData;
+                               if (sim_event->Status != TAPI_SIM_PB_SUCCESS) {
+                                       ERR("SIM phone book access error [%d]", sim_event->Status);
+                                       break;
+                               }
+
+                               if ( sim_acces_info->StorageFileType == TAPI_SIM_PB_ADN){ //KKC - ADN number value!
+                                       char number[PH_TEXT_MAX_LEN] = {0};
+                                       ph_dialer_util_append_node_from_numstr_with_strip(data, (char *)sim_acces_info->ContactInfo.Pb2GData.Number);
+                                       ph_dialer_util_add_dashes(data, DASH_REAL);
+                                       ph_dialer_util_get_numstr_from_node(data, number);
+                                       ph_dialer_entry_set_number(data, number, CURSOR_END, TRUE);
+                               }
+                               else if (sim_acces_info->StorageFileType == TAPI_SIM_PB_3GSIM) {
+                                       int i, k;
+                                       int num_of_pb_rec;
+                                       char *temp;
+                                       TelSimPbRecordData_t *sim_3g_access_info;
+
+                                       temp = (char*)calloc(1, sim_event->pDataLen);
+                                       memcpy(temp , (char*)sim_event->pData, sim_event->pDataLen);
+
+                                       num_of_pb_rec = (sim_event->pDataLen/sizeof(TelSimPbRecordData_t));
+                                       for (k = 0;k< num_of_pb_rec ;k++) {
+                                               sim_3g_access_info = (TelSimPbRecordData_t*)(temp+ k*sizeof(TelSimPbRecordData_t));
+
+                                               for (i = 0;i<sim_3g_access_info->ContactInfo.Pb3GData.FileTypeCount;i++) {
+                                                       if (sim_3g_access_info->ContactInfo.Pb3GData.PbFileDataInfo[i].FileType == TAPI_PB_3G_NUMBER){//KKC - USIM ADN number value!
+                                                               char number[PH_TEXT_MAX_LEN] = {0};
+                                                               ph_dialer_util_append_node_from_numstr_with_strip(data, (char*)(sim_3g_access_info->ContactInfo.Pb3GData.PbFileDataInfo[i].FileData));
+                                                               ph_dialer_util_add_dashes(data, DASH_REAL);
+                                                               ph_dialer_util_get_numstr_from_node(data, number);
+                                                               ph_dialer_entry_set_number(data, number, CURSOR_END, TRUE);
+                                                       }
+                                               }
+                                       }
+                                       free(temp);
+                               }
+                       }
+                       break;
+               case TAPI_EVENT_SIM_VERIFY_PUK_CNF:
+                       {
+                               TelSimSecResult_t *pPinInfo = (TelSimSecResult_t*)sim_event->pData;
+                               if (sim_event->Status == TAPI_SIM_PIN_OPERATION_SUCCESS) {
+                                       if (pPinInfo->type == TAPI_SIM_PTYPE_PUK1) {
+                                               ph_dialer_data *dial_d = data;
+                                               if (dial_d->popup)
+                                                       evas_object_del(dial_d->popup);
+                                               dial_d->popup = phone_create_popup(dial_d->win, T_(PH_GET_TEXT_BASIC, PHTEXT_REQUEST_SUCCESS), 2.0);
+                                               evas_object_smart_callback_add(dial_d->popup, "timeout", ph_dialer_util_popup_response_cb, dial_d);
+                                       }
+                                       else if (pPinInfo->type == TAPI_SIM_PTYPE_PIN2)
+                                               PH_DBG("Unblock PIN2 Success!");
+                               }
+                               else {
+                                       if (pPinInfo->type == TAPI_SIM_PTYPE_PUK1) {
+                                               ph_dialer_data *dial_d = data;
+                                               if (dial_d->popup)
+                                                       evas_object_del(dial_d->popup);
+                                               dial_d->popup = phone_create_popup(dial_d->win, T_(PH_GET_TEXT_BASIC, PHTEXT_REQUEST_FAIL), 2.0);
+                                               evas_object_smart_callback_add(dial_d->popup, "timeout", ph_dialer_util_popup_response_cb, dial_d);
+                                       }
+                                       else if (pPinInfo->type == TAPI_SIM_PTYPE_PIN1
+                                                       || pPinInfo->type == TAPI_SIM_PTYPE_PIN2
+                                                       || pPinInfo->type == TAPI_SIM_PTYPE_PUK2) {
+                                               ERR("%d Verification Failed! - PIN Required", pPinInfo->type);
+                                               PH_DBG("Remainint attempts [%d]", pPinInfo->retry_count);
+                                       }
+                               }
+                       }
+                       break;
+               default:
+                       break;
+               }
+       }
+       else
+               PH_DBG("Undhandled EventClass [0x%x]", sim_event->EventClass);
+       return;
+}
+
+int GCF_subscribe_tapi_events(void *data)
+{
+       int i = 0;
+       int ret_val = TRUE;
+       TapiResult_t api_err;
+       static int SIMEvtList[] = {
+               TAPI_EVENT_SIM_PB_ACCESS_READ_CNF,
+               TAPI_EVENT_SIM_VERIFY_PUK_CNF,
+       };
+
+       tel_init();
+       iNumOfSIMEvt = sizeof(SIMEvtList)/sizeof(int);
+
+       SIM_subscription_id = (unsigned int *) calloc(iNumOfSIMEvt , sizeof (unsigned int));
+       if (SIM_subscription_id == NULL)
+               ERR("calloc error -NULL, errno is [%d]", errno);
+
+       for ( i=0 ; i< iNumOfSIMEvt; i++ ) {
+               api_err = tel_register_event(SIMEvtList[i], &SIM_subscription_id[i], (TelAppCallback)&sim_async_event_callback, data);
+               if (api_err != TAPI_API_SUCCESS) {
+                       ERR("isn't subscribed. sub id is [%d], api_err is [%d]", SIM_subscription_id[i], api_err);
+                       ret_val = FALSE;
+                       break;
+               }
+       }
+       tel_register_app_name(PHONE_PKG);
+       return ret_val;
+}
+
+int GCF_unsubscribe_tapi_events()
+{
+       int i = 0;
+       TapiResult_t api_err;
+       int ret_val = TRUE;
+
+       for (i=0;i<iNumOfSIMEvt; i++) {
+               api_err = tel_deregister_event(SIM_subscription_id[i]);
+               if (api_err != TAPI_API_SUCCESS) {
+                       ERR("TelTapiDeRegister isn't unsubscribed. sub id is [%d] api_err is [%d]", SIM_subscription_id[i], api_err);
+                       ret_val = FALSE;
+                       break;
+               }
+       }
+       tel_deinit();
+       return ret_val;
+}
+
+void GCF_test_puk_operation(const char *puk1, const char *pin1)
+{
+       int length = TAPI_SIM_PIN_LENGTH+1;
+       char init_pin_val[TAPI_SIM_PIN_LENGTH+1]={0};
+       char init_puk_val[TAPI_SIM_PIN_LENGTH+1]={0};
+
+       TelSimSecPw_t puk_data;
+       TelSimSecPw_t new_pin_data;
+       int ret;
+
+       memset(&puk_data, 0, sizeof(TelSimSecPw_t));
+       memset(&new_pin_data, 0, sizeof(TelSimSecPw_t));
+
+       snprintf(init_puk_val, sizeof(init_puk_val), "%s", puk1);
+       snprintf(init_pin_val, sizeof(init_pin_val), "%s", pin1);
+
+       puk_data.type = TAPI_SIM_PTYPE_PUK1;   // 0x00
+       puk_data.pw_len = strlen(init_puk_val);
+       puk_data.pw = (unsigned char*)calloc(1, length);
+       memcpy(puk_data.pw, init_puk_val, sizeof(init_puk_val));
+
+       new_pin_data.type = TAPI_SIM_PTYPE_PIN1;   // 0x00
+       new_pin_data.pw_len = strlen(init_pin_val);
+       new_pin_data.pw = (unsigned char*)calloc(1, length);
+       memcpy(new_pin_data.pw, init_pin_val, sizeof(init_pin_val));
+
+       ret = tel_verify_sim_puks(&puk_data, &new_pin_data, &request_id);
+       if (ret != TAPI_API_SUCCESS)
+               ERR("TAPI API FAIL: Error Code [0x%x]", ret);
+
+       free(puk_data.pw);
+       free(new_pin_data.pw);
+}
+
+void GCF_test_read_contact(int index)
+{
+       TelSimPbFileType_t storage_type = 0;
+       TelSimCardType_t card_type = 0;
+       int ret;
+
+       tel_get_sim_type(&card_type);
+       if (card_type == TAPI_SIM_CARD_TYPE_GSM)
+               storage_type = TAPI_SIM_PB_ADN;
+       else if (card_type == TAPI_SIM_CARD_TYPE_USIM)
+               storage_type = TAPI_SIM_PB_3GSIM;
+
+       ret = tel_read_sim_pb_record(storage_type, index, &request_id);
+       if (ret != TAPI_API_SUCCESS)
+               ERR("TAPI API FAIL: Error Code [0x%x]", ret);
+}
+
+/* Gcf Puk1*/
+#define GCF_PUK1_PRE_VALUE "**05*"
+
+int GCF_check_puk1_str(const char *number, char *dest_puk, char *dest_pin1, char *dest_pin2, int size_dest)
+{
+       int count;
+       p_retv_if(number==NULL || dest_puk==NULL || dest_pin1==NULL, FALSE);
+       count = strlen(number);
+       p_retv_if(count<6, FALSE);
+
+       if (0 == strncmp(number, GCF_PUK1_PRE_VALUE, 5)) {
+               int source_count = strlen(number);
+               int source_index = 0;
+               int dest_index=0;
+               int process_kind=0;//0 : puk / 1: pin 2:pin/
+
+               for (source_index=5;source_index < source_count;source_index++) {
+                       if (process_kind == 0) {
+                               if (size_dest-1 < dest_index)
+                                       return FALSE;
+
+                               if (number[source_index]=='*') {
+                                       process_kind++;
+                                       dest_index=0;
+                                       continue;
+                               }
+                               dest_puk[dest_index++] = number[source_index];
+                       }
+                       else if (process_kind==1) {
+                               if (size_dest-1 < dest_index)
+                                       return FALSE;
+
+                               if (number[source_index]=='*') {
+                                       process_kind++;
+                                       dest_index=0;
+                                       continue;
+                               }
+
+                               dest_pin1[dest_index++] = number[source_index];
+                       }
+                       else if (process_kind==2) {
+                               if (size_dest-1 < dest_index)
+                                       return FALSE;
+
+                               if (number[source_index]=='#') {
+                                       process_kind++;
+                                       dest_index=0;
+                                       continue;
+                               }
+                               dest_pin2[dest_index++] = number[source_index];
+                       }
+                       else
+                               break;
+               }
+               if (process_kind != 3)
+                       return FALSE;
+               return TRUE;
+       }
+       return FALSE;
+}
+
+bool GCF_check_admin_sim(const char *number, int *ret_index)
+{
+       int count;
+       char *dest;
+       bool success;
+       p_retvm_if(number==NULL || ret_index==NULL, FALSE, "Parameter is null");
+
+       count = strlen(number);
+       p_retvm_if(count < 2, FALSE, "number length is too short");
+       dest = (char*)calloc(1, count);
+
+       success = true;
+       if (number[count-1]=='#') {
+               int i=0;
+               for (;i<count-1;i++) {
+                       if ('0' <= number[i] && number[i] <= '9')
+                               dest[i] = number[i];
+                       else {
+                               success = false;
+                               break;
+                       }
+               }
+               if (success)
+                       *ret_index = atoi(dest);
+       }
+       else
+               success = false;
+       free(dest);
+
+       return success;
+}
+
diff --git a/lib/dialer/ph-dialer-tapi.h b/lib/dialer/ph-dialer-tapi.h
new file mode 100755 (executable)
index 0000000..76b57f3
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ * 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 __PH_DIALER_TAPI_H__
+#define __PH_DIALER_TAPI_H__
+
+int GCF_subscribe_tapi_events(void *data);
+int GCF_unsubscribe_tapi_events();
+void GCF_test_puk_operation(const char *puk1, const char *pin1);
+void GCF_test_read_contact(int index);
+int GCF_check_puk1_str(const char *number, char *dest_puk, char *dest_pin1, char *dest_pin2, int size_dest);
+bool GCF_check_admin_sim(const char *number, int *ret_index);
+
+#endif /* __PH_DIALER_TAPI_H__ */
diff --git a/lib/dialer/ph-dialer-utils.c b/lib/dialer/ph-dialer-utils.c
new file mode 100755 (executable)
index 0000000..133d51e
--- /dev/null
@@ -0,0 +1,501 @@
+/*
+ * 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.
+ */
+
+#define _GNU_SOURCE
+#include <string.h>
+#include <vconf.h>
+#include <vconf-keys.h>
+#include <bundle.h>
+#include <aul.h>
+#include <TapiCommon.h>
+#include <ITapiSim.h>
+#include <appsvc.h>
+
+#include "phone.h"
+#include "phone-dialer.h"
+
+#include "ph-dialer-utils.h"
+#include "ph-dialer-view.h"
+
+#define PH_DIALER_KEY_MAX_LEN 256
+
+void ph_dialer_util_entry_clear(ph_dialer_data *dial_d)
+{
+       ph_dialer_util_del_all_number(dial_d);
+       ph_dialer_entry_set_number(dial_d, "", 0, TRUE);
+       if (dial_d->has_focus) {
+               elm_object_focus_set(dial_d->entry, EINA_FALSE);
+               dial_d->has_focus = false;
+       }
+}
+
+void ph_dialer_util_launch_call(ph_dialer_data *dial_d)
+{
+       char num[PH_TEXT_MAX_LEN] = {0};
+       char buf[PH_TEXT_MAX_LEN] = {0};
+       int text_len;
+       bundle* b;
+
+       p_retm_if(dial_d == NULL, "Invalid argument: ph_dialer_data *is NULL");
+
+       text_len = ph_dialer_util_get_pure_numstr_with_plus(dial_d, num);
+       if (0 < text_len) {
+               b = bundle_create();
+               p_retm_if(NULL == b, "bundle_create() Failed");
+
+               if (PH_DAILER_EMERGENCY == dial_d->run_mode) {
+                       bundle_add(b, "launch-type", "EMERGENCY");
+                       bundle_add(b, "number", num);
+                       aul_launch_app(VOICECALL_PKG, b);
+               }
+               else {
+                       appsvc_set_operation(b, APPSVC_OPERATION_CALL);
+                       snprintf(buf, sizeof(buf), "tel:%s", (char*)num);
+                       appsvc_set_uri(b, buf);
+                       appsvc_run_service(b, 0, NULL, NULL);
+               }
+               bundle_free(b);
+       }
+
+       ph_dialer_util_entry_clear(dial_d);
+}
+
+int ph_dialer_util_get_cursor_pos(ph_dialer_data *dial_d)
+{
+       InputNumber *node;
+       int pos = 0;
+       p_retvm_if(NULL == dial_d->number_cursor, 0, "cursor of number is null");
+
+       node = &dial_d->number_head;
+       while (dial_d->number_cursor != node) {
+               node = node->next;
+               if (!node) break;
+               pos++;
+       }
+       return pos;
+}
+
+int ph_dialer_util_is_dash(char ch)
+{
+       if (ch == '-' || ch == '(' || ch == ')' || ch == ' ')
+               return TRUE;
+       return FALSE;
+}
+
+static int dialer_util_is_dash_and_plus(char ch)
+{
+       if (ch == '-' || ch == '+' || ch == '(' || ch == ')' || ch == ' ')
+               return TRUE;
+       return FALSE;
+}
+
+int ph_dialer_util_get_pure_numstr(ph_dialer_data *dial_d, char *dest)
+{
+       InputNumber *node;
+       int cnt = 0;
+       p_retvm_if(NULL == dest, 0, "dest is null");
+
+       node = dial_d->number_head.next;
+       while (1) {
+               if (!node) break;
+               if (dialer_util_is_dash_and_plus(node->num) == FALSE)
+                       dest[cnt++] = node->num;
+               node = node->next;
+       }
+       dest[cnt] = '\0';
+       return cnt;
+}
+
+InputNumber *ph_dialer_util_get_node_by_index(ph_dialer_data *dial_d, int index)
+{
+       InputNumber *node;
+       int i = 0;
+
+       node = &dial_d->number_head;
+       for (; i<index; i++) {
+               if (node->next)
+                       node = node->next;
+       }
+       return node;
+}
+
+int ph_dialer_util_get_pure_numstr_with_plus(ph_dialer_data *dial_d, char *dest)
+{
+       InputNumber *node;
+       int cnt = 0;
+       p_retvm_if(NULL == dest, 0, "dest is null");
+
+       node = dial_d->number_head.next;
+       while (node) {
+               if (ph_dialer_util_is_dash(node->num) == FALSE)
+                       dest[cnt++] = node->num;
+               node = node->next;
+       }
+       dest[cnt] = '\0';
+       return cnt;
+}
+
+int ph_dialer_util_get_numstr_from_node(ph_dialer_data *dial_d, char *dest)
+{
+       InputNumber *node;
+       int cnt = 0;
+       p_retvm_if(NULL == dest, 0, "dest is null");
+
+       node = dial_d->number_head.next;
+       while (node) {
+               dest[cnt++] = node->num;
+               node = node->next;
+       }
+       dest[cnt] = '\0';
+       return cnt;
+}
+
+int ph_dialer_util_del_all_number(ph_dialer_data *dial_d)
+{
+       int len = 0;
+       InputNumber *node = NULL;
+       InputNumber *tmp_node = NULL;
+       p_retvm_if(NULL == dial_d, 0, "dialer data is null");
+
+       node = dial_d->number_head.next;
+       while (node) {
+               tmp_node = node;
+
+               if (node->next)
+                       node->next->prev = node->prev;
+               if (node->prev)
+                       node->prev->next = node->next;
+
+               node = node->next;
+               len++;
+
+               free(tmp_node);
+       }
+       dial_d->number_cursor = &dial_d->number_head;
+       dial_d->entry_font_size = MAX_DIAL_NUMBER_FONT_SIZE;
+
+       return len;
+}
+
+static int dialer_util_is_num_length_over(int len)
+{
+       if (len >= PH_DIALER_KEY_MAX_LEN)
+               return TRUE;
+       return FALSE;
+}
+
+int ph_dialer_util_append_node_from_numstr(ph_dialer_data *dial_d, char *string)
+{
+       int i = 0;
+       int len = 0;
+       InputNumber *node;
+       InputNumber *tmp_node = NULL;
+
+       ph_dialer_util_del_all_number(dial_d);
+
+       node = &dial_d->number_head;
+       len = strlen(string);
+       if (dialer_util_is_num_length_over(len-1) == TRUE) {
+               if (dial_d->popup)
+                       evas_object_del(dial_d->popup);
+               dial_d->popup = phone_create_popup(dial_d->win, T_(PH_GET_TEXT_BASIC, PHTEXT_EXCEED_NUM_MAX_LENGTH), 2.0);
+               evas_object_smart_callback_add(dial_d->popup, "timeout", ph_dialer_util_popup_response_cb, dial_d);
+               len = PH_DIALER_KEY_MAX_LEN;
+               string[len] = '\0';
+       }
+
+       for (; i<len; i++) {
+               tmp_node = calloc(1, sizeof(InputNumber));
+               tmp_node->next = NULL;
+               tmp_node->prev = node;
+               tmp_node->num = string[i];
+
+               node->next = tmp_node;
+               node = node->next;
+       }
+       dial_d->number_cursor = tmp_node;
+       return len;
+}
+
+int ph_dialer_util_append_node_from_numstr_with_strip(ph_dialer_data *dial_d, char *string)
+{
+       int i = 0, cnt = 0, len = 0;
+       InputNumber *node;
+       InputNumber *tmp_node = NULL;
+       p_retvm_if(NULL == string, 0, "Number string is null");
+       ph_dialer_util_del_all_number(dial_d);
+
+       node = &dial_d->number_head;
+       len = strlen(string);
+       if (dialer_util_is_num_length_over(len-1) == TRUE) {
+               if (dial_d->popup)
+                       evas_object_del(dial_d->popup);
+               dial_d->popup = phone_create_popup(dial_d->win, T_(PH_GET_TEXT_BASIC, PHTEXT_EXCEED_NUM_MAX_LENGTH), 2.0);
+               evas_object_smart_callback_add(dial_d->popup, "timeout", ph_dialer_util_popup_response_cb, dial_d);
+               len = PH_DIALER_KEY_MAX_LEN;
+               string[len] = '\0';
+       }
+
+       for (; i<len; i++) {
+               if (ph_dialer_util_is_dash(string[i]) == TRUE)
+                       continue;
+
+               tmp_node = calloc(1, sizeof(InputNumber));
+               tmp_node->next = NULL;
+               tmp_node->prev = node;
+               tmp_node->num = string[i];
+               node->next = tmp_node;
+
+               node = node->next;
+               cnt++;
+       }
+       dial_d->number_cursor = tmp_node;
+       return cnt;
+}
+
+static InputNumber* dialer_util_insert_number_after(InputNumber *node, char num)
+{
+       InputNumber *tmp;
+       p_retvm_if(NULL == node, NULL, "number node is null");
+
+       tmp = calloc(1, sizeof(InputNumber));
+       tmp->next = node->next;
+       tmp->prev = node;
+       tmp->num = num;
+
+       if (node->next)
+               node->next->prev = tmp;
+       node->next = tmp;
+
+       return tmp;
+}
+
+void ph_dialer_util_insert_number_at_cursor(ph_dialer_data *dial_d, char num)
+{
+       InputNumber *cursor;
+       InputNumber *tmp;
+       char buf[PH_TEXT_MAX_LEN] = {0};
+       int len;
+
+       if (dial_d->number_cursor)
+               cursor = dial_d->number_cursor;
+       else
+               cursor = &dial_d->number_head;
+
+       /* check length */
+       len = ph_dialer_util_get_numstr_from_node(dial_d, buf);
+       if (dialer_util_is_num_length_over(len) == TRUE) {
+               if (dial_d->popup)
+                       evas_object_del(dial_d->popup);
+               dial_d->popup = phone_create_popup(dial_d->win, T_(PH_GET_TEXT_BASIC, PHTEXT_EXCEED_NUM_MAX_LENGTH), 2.0);
+               evas_object_smart_callback_add(dial_d->popup, "timeout", ph_dialer_util_popup_response_cb, dial_d);
+               return;
+       }
+
+       tmp = dialer_util_insert_number_after(cursor, num);
+       dial_d->number_cursor = tmp;
+}
+
+char ph_dialer_util_get_number_at_cursor(ph_dialer_data *dial_d)
+{
+       if (dial_d->number_cursor == NULL)
+               return '\0';
+
+       return dial_d->number_cursor->num;
+}
+
+int ph_dialer_util_remove_node_at_cursor(ph_dialer_data *dial_d)
+{
+       InputNumber *cursor = NULL;
+       InputNumber *node_prev = NULL;
+       p_retvm_if(NULL == dial_d->number_cursor, 0, "current cursor is null");
+       cursor = dial_d->number_cursor;
+
+       if (cursor == &dial_d->number_head)
+               return 0;
+
+       if (cursor)
+               node_prev = cursor->prev;
+
+       if (node_prev)
+               node_prev->next = cursor->next;
+
+       if (cursor->next)
+               cursor->next->prev = node_prev;
+
+       free(cursor);
+       dial_d->number_cursor = node_prev;
+       return ph_dialer_util_get_cursor_pos(dial_d);
+}
+
+void ph_dialer_util_strip_from_number_node(ph_dialer_data *dial_d)
+{
+       InputNumber *node, *tmp_node;
+       node = dial_d->number_head.next;
+
+       while (node) {
+               if (ph_dialer_util_is_dash(node->num) == TRUE) {
+                       if (dial_d->number_cursor == node)
+                               dial_d->number_cursor = node->prev;
+                       tmp_node = node;
+
+                       if (node->next)
+                               node->next->prev = node->prev;
+                       if (node->prev)
+                               node->prev->next = node->next;
+
+                       node = node->next;
+                       free(tmp_node);
+               }
+               else
+                       node = node->next;
+       }
+}
+
+void ph_dialer_util_add_dashes(ph_dialer_data *dial_d, DashMode kMode)
+{
+       InputNumber *cursor, *node;
+       int len = 0;
+       int remain = 0;
+       char numstr[PH_TEXT_MAX_LEN] = {0};
+
+       cursor = dial_d->number_cursor;
+       node = dial_d->number_head.next;
+
+       len = ph_dialer_util_get_numstr_from_node(dial_d, numstr);
+       p_retm_if(len < 2, "number is too short");
+       p_retm_if(numstr[0] == '*' || numstr[0] == '#', "the character is reserved string");
+
+       remain = len;
+       /* 123 ~ 12345678901(123-4567-8901) */
+       if (len > (2-kMode) && len < (12+kMode) && node) {      /* 02, 010, 011, ... 0xx */
+               if (node->num == '0') {         /* 02, +cc 2 */
+                       remain--;
+                       node = node->next;
+                       remain--;
+
+                       if (node->num == '2') {          /* 02-, +cc 2- */
+                               node = dialer_util_insert_number_after(node, '-');
+                               if (node) {
+                                       if (kMode) {
+                                               if (dial_d->number_cursor == node->prev) {
+                                                       dial_d->number_cursor = node;
+                                               }
+                                       }
+                                       if (node->next)
+                                               node = node->next;
+                               }
+                       }
+                       else {            /* 0xx, +cc xx */
+                               if (node->next) {
+                                       node = node->next;
+                                       remain--;
+                               }
+
+                               if (len > 3-kMode) {            /* 0xx-, +cc xx- */
+                                       node = dialer_util_insert_number_after(node, '-');
+                                       if (node) {
+                                               if (kMode) {
+                                                       if (dial_d->number_cursor == node->prev) {
+                                                               dial_d->number_cursor = node;
+                                                       }
+                                               }
+                                               if (node->next)
+                                                       node = node->next;
+                                       }
+                               }
+                       }
+
+                       if (remain == 8) {            /* xxx-1234-1234, +cc xx-1234-1234 */
+                               node = node->next;
+                               p_ret_if(node == NULL);
+                               node = node->next;
+                               p_ret_if(node == NULL);
+                               node = node->next;
+                               dialer_util_insert_number_after(node, '-');
+                       }
+                       else if (remain > (int)(3-kMode) && remain < 8) {         /* xxx-123-1234, +cc xx-123-1234 */
+                               node = node->next;
+                               p_ret_if(node == NULL);
+                               node = node->next;
+                               node = dialer_util_insert_number_after(node, '-');
+                               if (node && kMode) {
+                                       if (dial_d->number_cursor == node->prev) {
+                                               dial_d->number_cursor = node;
+                                       }
+                               }
+                       }
+                       else if (remain > 8) {            /* not match rule */
+                               ph_dialer_util_strip_from_number_node(dial_d);
+                       }
+               }
+               else {                 /* 02, +cc 2 */   /* 1234-1234 */
+                       if (len > 4-kMode && len < 9+kMode) {
+                               node = node->next;
+                               p_ret_if(node == NULL);
+                               node = node->next;
+                               p_ret_if(node == NULL);
+                               node = node->next;
+                               node = dialer_util_insert_number_after(node, '-');
+                               if (node && kMode) {
+                                       if (dial_d->number_cursor == node->prev) {
+                                               dial_d->number_cursor = node;
+                                       }
+                               }
+                       }
+               }
+       }
+}
+
+void ph_dialer_util_popup_response_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       ph_dialer_data *dial_d = data;
+       evas_object_del(obj);
+       dial_d->popup = NULL;
+}
+
+void ph_dialer_util_setup_run_mode(ph_dialer_data *dial_d)
+{
+       int ret = 0;
+       int value = 0;
+
+       /* Check call state */
+       ret = vconf_get_int(VCONFKEY_CALL_STATE, &value);
+       if (ret < 0)
+               ERR("vconf_get_int is failed(%d)", ret);
+       else {
+               if (value == VCONFKEY_CALL_OFF
+                               || value == VCONFKEY_CALL_VOICE_CONNECTING
+                               || value == VCONFKEY_CALL_VIDEO_CONNECTING) {
+                       if (dial_d->run_mode == PH_DAILER_EMERGENCY)
+                               edje_object_signal_emit(_EDJ(dial_d->layout), "softkey/dc", "softkey");
+                       else {
+                               if (dial_d->run_mode == PH_DAILER_NORMAL)
+                                       return;
+                               dial_d->run_mode = PH_DAILER_NORMAL;
+                               edje_object_signal_emit(_EDJ(dial_d->layout), "softkey/normal", "softkey");
+                       }
+               }
+               else {   // VCONFKEY_CALL_VOICE_ACTIVE, VCONFKEY_CALL_VIDEO_ACTIVE
+                       if (dial_d->run_mode == PH_DAILER_DURING_CALL)
+                               return;
+                       dial_d->run_mode = PH_DAILER_DURING_CALL;
+                       edje_object_signal_emit(_EDJ(dial_d->layout), "softkey/dc", "softkey");
+               }
+               PH_DBG("run_mode:%d", dial_d->run_mode);
+       }
+}
+
diff --git a/lib/dialer/ph-dialer-utils.h b/lib/dialer/ph-dialer-utils.h
new file mode 100755 (executable)
index 0000000..98db1af
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * 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 __PH_DIALER_UTIL_H__
+#define __PH_DIALER_UTIL_H__
+
+#include <stdio.h>
+
+void ph_dialer_util_launch_call(ph_dialer_data *dial_d);
+
+int ph_dialer_util_get_pure_numstr_with_plus(ph_dialer_data *dial_d, char *dest);
+int ph_dialer_util_get_pure_numstr(ph_dialer_data *dial_d, char *dest);
+int ph_dialer_util_get_numstr_from_node(ph_dialer_data *dial_d, char *dest);
+int ph_dialer_util_del_all_number(ph_dialer_data *dial_d);
+
+int ph_dialer_util_append_node_from_numstr(ph_dialer_data *dial_d, char *string);
+int ph_dialer_util_append_node_from_numstr_with_strip(ph_dialer_data *dial_d, char *string);
+int ph_dialer_util_remove_node_at_cursor(ph_dialer_data *dial_d);
+
+void ph_dialer_util_insert_number_at_cursor(ph_dialer_data *dial_d, char num);
+char ph_dialer_util_get_number_at_cursor(ph_dialer_data *dial_d);
+int ph_dialer_util_get_cursor_pos(ph_dialer_data *dial_d);
+
+InputNumber *ph_dialer_util_get_node_by_index(ph_dialer_data *dial_d, int index);
+void ph_dialer_util_strip_from_number_node(ph_dialer_data *dial_d);
+int ph_dialer_util_is_dash(char ch);
+void ph_dialer_util_add_dashes(ph_dialer_data *dial_d, DashMode kMode);
+void ph_dialer_util_entry_clear(ph_dialer_data *dial_d);
+
+void ph_dialer_util_popup_response_cb(void *data, Evas_Object *obj, void *event_info);
+
+void ph_dialer_util_setup_run_mode(ph_dialer_data *dial_d);
+
+#endif //__PH_DIALER_UTIL_H__
diff --git a/lib/dialer/ph-dialer-view.c b/lib/dialer/ph-dialer-view.c
new file mode 100644 (file)
index 0000000..1083d8d
--- /dev/null
@@ -0,0 +1,780 @@
+/*
+ * 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 <string.h>
+#include <malloc.h>
+#include <Ecore_X.h>
+#include <vconf.h>
+#include <vconf-keys.h>
+
+#include <TapiEvent.h>
+#include <ui-gadget-module.h>
+
+#include "phone.h"
+#include "phone-dialer.h"
+
+#include "ph-dialer-view.h"
+#include "ph-dialer-utils.h"
+
+#define PH_DIALER_ENTRY_DEFAULT_STYLE "<align=center font=SLP:style=Roman font_size=%d color=#ffffff>%s</>"
+#define PH_DIALER_ENTRY_EMPTY_STYLE "<align=center font_size=%d>&#8203;</>"
+
+static void dialer_entry_cursor_changed(void *data, Evas_Object *entry, void *event_info)
+{
+       ph_dialer_data *dial_d = data;
+       dial_d->cursor_changed = true;
+}
+
+static void dialer_entry_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+       ph_dialer_data *dial_d = data;
+       if (dial_d->cursor_changed) {
+               int pos = 0;
+               dial_d->cursor_changed = false;
+               pos = elm_entry_cursor_pos_get(dial_d->entry);
+               dial_d->number_cursor = ph_dialer_util_get_node_by_index(data, pos);
+       }
+       dial_d->has_focus = true;
+}
+
+static void dialer_softkey_longpress(char *source, ph_dialer_data *dial_d)
+{
+       int pos = 0;
+       char dest[PH_TEXT_MAX_LEN] = {0};
+
+       if (strcmp(source, "star") == 0 || strcmp(source, "*") == 0) {
+               if (ph_dialer_util_get_number_at_cursor(dial_d) == '*') {
+                       pos = ph_dialer_util_remove_node_at_cursor(dial_d);
+                       edje_object_signal_emit(_EDJ(dial_d->layout), "pad_clicked", "P");
+                       ph_dialer_util_get_numstr_from_node(dial_d, dest);
+                       ph_dialer_entry_set_number(dial_d, dest, 0, TRUE);
+               }
+       }
+       else if (strcmp(source, "input_back") == 0)
+               ph_dialer_util_entry_clear(dial_d);
+}
+
+static Eina_Bool dialer_keypad_longpress(void *data)
+{
+       PH_FN_CALL;
+       ph_dialer_data *dial_d = data;
+       int text_len = 0;
+       int pos = 0;
+       char dest[PH_TEXT_MAX_LEN] = {0};
+       char *source;
+
+       p_retv_if(NULL == dial_d, -1);
+
+       source = dial_d->longpress_source;
+       text_len = ph_dialer_util_get_pure_numstr_with_plus(dial_d, dest);
+
+       switch (source[0]) {
+       case '0' ... '9':
+               PH_DBG("number(len=%d):[%s]", text_len, dest);
+               if (source[0] == '0') {
+                       pos = ph_dialer_util_remove_node_at_cursor(dial_d);
+                       edje_object_signal_emit(_EDJ(dial_d->layout), "pad_clicked", "+");
+                       break;
+               }
+               break;
+       default:
+               dialer_softkey_longpress(source, dial_d);
+               break;
+       }
+       if (dial_d->longpress_source) {
+               free(dial_d->longpress_source);
+               dial_d->longpress_source = NULL;
+       }
+       dial_d->longpress_timer = NULL;
+       return ECORE_CALLBACK_CANCEL;
+}
+
+static void dialer_keypad_down(void *data, Evas_Object *obj, const char *emission, const char *source)
+{
+       PH_FN_CALL;
+       char dest[PH_TEXT_MAX_LEN] = {0};
+       int snd_id = 0;
+       ph_dialer_data *dial_d = data;
+
+       p_retm_if(dial_d == NULL, "Invalid argument: ph_dialer_data *is NULL");
+       p_retm_if(source == NULL, "source is NULL");
+
+       if (dial_d->longpress_timer) {
+               ecore_timer_del(dial_d->longpress_timer);
+               dial_d->longpress_timer = NULL;
+       }
+
+       if (dial_d->dash_timer) {
+               ecore_timer_del(dial_d->dash_timer);
+               dial_d->dash_timer = NULL;
+       }
+
+       switch (source[0]) {
+       case '0' ... '9':
+               snd_id = source[0] - '0';
+               break;
+       default:
+               if (0 == strcmp(source, "star")) {
+                       source = "*";
+                       snd_id = 11;
+               }
+               else if (0 == strcmp(source, "sharp")) {
+                       source = "#";
+                       snd_id = 10;
+               }
+               break;
+       }
+
+       ph_dialer_util_strip_from_number_node(dial_d);
+       ph_dialer_util_insert_number_at_cursor(dial_d, source[0]);
+       ph_dialer_util_add_dashes(dial_d, DASH_REAL);
+       ph_dialer_util_get_numstr_from_node(dial_d, dest);
+       ph_dialer_entry_set_number(dial_d, dest, 0, TRUE);
+
+       /* create new longpress timer */
+       if (dial_d->longpress_timer) {
+               ecore_timer_del(dial_d->longpress_timer);
+               dial_d->longpress_timer = NULL;
+       }
+       FREEandSTRDUP(dial_d->longpress_source, source);
+       dial_d->longpress_timer = ecore_timer_add(elm_config_longpress_timeout_get(), dialer_keypad_longpress, dial_d);
+}
+
+static Eina_Bool dialer_dash_add_timer(void *data)
+{
+       char dest[PH_TEXT_MAX_LEN] = {0};
+       ph_dialer_data *dial_d = data;
+
+       ph_dialer_util_strip_from_number_node(dial_d);
+       ph_dialer_util_add_dashes(dial_d, DASH_PREVIEW);
+       ph_dialer_util_get_numstr_from_node(dial_d, dest);
+       ph_dialer_entry_set_number(dial_d, dest, 0, TRUE);
+
+       dial_d->dash_timer = NULL;
+       return ECORE_CALLBACK_CANCEL;
+}
+
+static void dialer_keypad_up(void *data, Evas_Object *obj, const char *emission, const char *source)
+{
+       ph_dialer_data *dial_d = data;
+       p_retm_if(data == NULL, "Invalid argument: ph_dialer_data *is NULL");
+       PH_DBG("(source=%s)", source);
+
+       if (dial_d->longpress_timer) {
+               ecore_timer_del(dial_d->longpress_timer);
+               dial_d->longpress_timer = NULL;
+       }
+
+       if (dial_d->dash_timer) {
+               ecore_timer_del(dial_d->dash_timer);
+               dial_d->dash_timer = NULL;
+       }
+       dial_d->dash_timer = ecore_timer_add(0.7, dialer_dash_add_timer, dial_d);
+}
+
+static void dialer_keypad_clicked(void *data, Evas_Object *obj, const char *emission, const char *source)
+{
+       PH_FN_CALL;
+       ph_dialer_data *dial_d = data;
+       char dest[PH_TEXT_MAX_LEN] = {0};
+
+       p_retm_if(NULL == source, "source is null");
+       p_retm_if(NULL == data, "Invalid argument: ph_dialer_data is NULL");
+
+       if (strcmp(source, "+") !=0 && strcmp(source, "P") !=0)
+               return;
+
+       if (dial_d->dash_timer) {
+               ecore_timer_del(dial_d->dash_timer);
+               dial_d->dash_timer = NULL;
+       }
+
+       ph_dialer_util_strip_from_number_node(dial_d);
+       ph_dialer_util_insert_number_at_cursor(dial_d, source[0]);
+       ph_dialer_util_add_dashes(dial_d, DASH_REAL);
+       ph_dialer_util_get_numstr_from_node(dial_d, dest);
+       ph_dialer_entry_set_number(dial_d, dest, 0, FALSE);
+}
+
+static void dialer_softkey_down(void *data, Evas_Object *obj, const char *emission, const char *source)
+{
+       PH_FN_CALL;
+       char dest[PH_TEXT_MAX_LEN] = {0};
+       ph_dialer_data *dial_d = data;
+       p_retm_if(data == NULL, "Invalid argument: ph_dialer_data *is NULL");
+
+       if (0 != strcmp(source, "input_back"))
+               return;
+
+       if (dial_d->dash_timer) {
+               ecore_timer_del(dial_d->dash_timer);
+               dial_d->dash_timer = NULL;
+       }
+
+       ph_dialer_util_strip_from_number_node(dial_d);
+       ph_dialer_util_remove_node_at_cursor(dial_d);
+       ph_dialer_util_add_dashes(dial_d, DASH_REAL);
+       ph_dialer_util_get_numstr_from_node(dial_d, dest);
+       ph_dialer_entry_set_number(dial_d, dest, 0, FALSE);
+
+       if (!*dest && dial_d->has_focus) {
+               elm_object_focus_set(dial_d->entry, EINA_FALSE);
+               dial_d->has_focus = false;
+       }
+
+       if (dial_d->longpress_timer) {
+               ecore_timer_del(dial_d->longpress_timer);
+               dial_d->longpress_timer = NULL;
+       }
+       FREEandSTRDUP(dial_d->longpress_source, source);
+       dial_d->longpress_timer =ecore_timer_add(elm_config_longpress_timeout_get(), dialer_keypad_longpress, dial_d);
+
+}
+
+static void dialer_softkey_up(void *data, Evas_Object *obj, const char *emission, const char *source)
+{
+       PH_FN_CALL;
+       ph_dialer_data *dial_d = data;
+       p_retm_if(NULL == data, "Invalid argument: ph_dialer_data *is NULL");
+
+       if (0 != strcmp(source, "input_back"))
+               return;
+
+       if (dial_d->longpress_timer) {
+               ecore_timer_del(dial_d->longpress_timer);
+               dial_d->longpress_timer = NULL;
+       }
+
+       if (dial_d->dash_timer) {
+               ecore_timer_del(dial_d->dash_timer);
+               dial_d->dash_timer = NULL;
+       }
+       dial_d->dash_timer = ecore_timer_add(0.7, dialer_dash_add_timer, dial_d);
+       PH_FN_END;
+}
+
+static void dialer_softkey_call_clicked(void *data, int type)
+{
+       PH_FN_CALL;
+       ph_dialer_data *dial_d = data;
+       char buf[PH_TEXT_MAX_LEN] = {0};
+       int len;
+
+       p_retm_if(data == NULL, "Invalid argument: ph_dialer_data *is NULL");
+
+       len = ph_dialer_util_get_numstr_from_node(dial_d, buf);
+       if (len == 0) {
+               PH_DBG("text is NULL so input recent number ");
+               char *get_str;
+               if (0 == type)
+                       get_str = contacts_svc_phonelog_get_last_number(CTS_PLOG_LAST_CALL_ONLY);
+
+               if (get_str) {
+                       ph_dialer_util_append_node_from_numstr(dial_d, get_str);
+                       ph_dialer_util_add_dashes(dial_d, DASH_REAL);
+                       ph_dialer_util_get_numstr_from_node(dial_d, buf);
+                       ph_dialer_entry_set_number(dial_d, buf, CURSOR_END, TRUE);
+                       free(get_str);
+               }
+               return;
+       }
+       if (0 == type)
+               ph_dialer_util_launch_call(dial_d);
+}
+
+static void dialer_softkey_clicked(void *data, Evas_Object *obj, const char *emission, const char *source)
+{
+       PH_FN_CALL;
+       ph_dialer_data *dial_d = data;
+       char buf[PH_TEXT_MAX_LEN] = {0};
+       p_retm_if(data == NULL, "Invalid argument: ph_dialer_data *is NULL");
+
+       PH_DBG("source:[%s]", source);
+
+       if (dial_d->longpress_timer) {
+               ecore_timer_del(dial_d->longpress_timer);
+               dial_d->longpress_timer=NULL;
+       }
+
+       if (strstr(source, "call") != NULL)        /* normal/call, dc/call */
+               dialer_softkey_call_clicked(dial_d, 0);
+
+       ph_dialer_util_get_numstr_from_node(dial_d, buf);
+
+       if (strcmp(source, "input_back") != 0)
+               ph_dialer_entry_set_number(dial_d, buf, CURSOR_END, TRUE);
+       else
+               ph_dialer_entry_set_number(dial_d, buf, 0, TRUE);
+}
+
+static void dialer_entry_set_number_noresize(ph_dialer_data *dial_d, char *text)
+{
+       PH_FN_CALL;
+       int size = MAX_DIAL_NUMBER_FONT_SIZE;
+       char buf[PH_TEXT_MAX_LEN] = {0};
+       int pos;
+
+       if (text && *text)
+               snprintf(buf, sizeof(buf), PH_DIALER_ENTRY_DEFAULT_STYLE, size, text);
+       else
+               snprintf(buf, sizeof(buf), PH_DIALER_ENTRY_EMPTY_STYLE, size);
+       elm_entry_entry_set(dial_d->entry, buf);
+
+       if (text && *text)
+               edje_object_signal_emit(_EDJ(dial_d->layout), "input_back/default", "input_back");
+       else
+               edje_object_signal_emit(_EDJ(dial_d->layout), "input_back/dim", "input_back");
+
+       pos = ph_dialer_util_get_cursor_pos(dial_d);
+       elm_entry_cursor_pos_set(dial_d->entry, pos);
+}
+
+void ph_dialer_entry_set_number(ph_dialer_data *dial_d, char *orig, int cursor, int is_need_emit)
+{
+       char text[PH_TEXT_MAX_LEN] = {0};
+
+       if (is_need_emit == TRUE) {
+               if (orig && *orig)
+                       edje_object_signal_emit(_EDJ(dial_d->layout), "input_back/default", "input_back");
+               else
+                       edje_object_signal_emit(_EDJ(dial_d->layout), "input_back/dim", "input_back");
+       }
+
+       if (orig && *orig)
+               snprintf(text, sizeof(text), PH_DIALER_ENTRY_DEFAULT_STYLE, dial_d->entry_font_size, orig);
+       else
+               snprintf(text, sizeof(text), PH_DIALER_ENTRY_EMPTY_STYLE, dial_d->entry_font_size);
+       elm_entry_entry_set(dial_d->entry, text);
+
+       if (cursor == CURSOR_END)
+               cursor = STRLEN(orig);
+       else if (cursor == CURSOR_BEGIN)
+               cursor = 0;
+       else if (cursor == 0)
+               cursor = ph_dialer_util_get_cursor_pos(dial_d);
+
+       dial_d->number_cursor = ph_dialer_util_get_node_by_index(dial_d, cursor);
+       elm_entry_cursor_pos_set(dial_d->entry, cursor);
+}
+
+static void dialer_view_delete_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+       PH_FN_CALL;
+       ph_dialer_data *dial_d = data;
+
+       ph_dialer_util_del_all_number(dial_d);
+
+       if (dial_d->popup)
+               evas_object_del(dial_d->popup);
+
+       if (dial_d->job)
+               ecore_job_del(dial_d->job);
+
+       if (dial_d->dash_timer)
+               ecore_timer_del(dial_d->dash_timer);
+
+       if (dial_d->longpress_timer)
+               ecore_timer_del(dial_d->longpress_timer);
+
+       free(dial_d->longpress_source);
+       free(dial_d->init_text);
+       free(dial_d);
+}
+
+static void dialer_entry_font_check(Evas_Object *entry, ph_dialer_data *dial_d, char *text, int pos)
+{
+       static int status = 0;
+       Ecore_X_Window win;
+       int size;
+       int win_width;
+       int entry_width;
+       char buf[PH_TEXT_MAX_LEN] = {0};
+
+       win = ecore_x_window_root_get(ecore_x_window_focus_get());
+       ecore_x_window_size_get(win, &win_width, NULL);
+       evas_object_size_hint_min_get(entry, &entry_width, NULL);
+
+       size = dial_d->entry_font_size;
+
+       if (win_width < entry_width) {
+               if (MIN_DIAL_NUMBER_FONT_SIZE < size) {
+                       size--;
+                       snprintf(buf, sizeof(buf), PH_DIALER_ENTRY_DEFAULT_STYLE, size, text);
+                       status = -1;
+                       dial_d->entry_font_size = size;
+                       elm_entry_entry_set(dial_d->entry, buf);
+                       elm_entry_cursor_pos_set(dial_d->entry, pos);
+               }
+       }
+       else if (entry_width < win_width) {
+               if (status == -1) {
+                       status = 0;
+                       return;
+               }
+               if (size < MAX_DIAL_NUMBER_FONT_SIZE) {
+                       size++;
+                       snprintf(buf, sizeof(buf), PH_DIALER_ENTRY_DEFAULT_STYLE, size, text);
+                       status = 1;
+                       dial_d->entry_font_size = size;
+                       elm_entry_entry_set(dial_d->entry, buf);
+                       elm_entry_cursor_pos_set(dial_d->entry, pos);
+               }
+       }
+       else
+               status = 0;
+}
+
+static int dialer_include_zero_space(char *text)
+{
+       int len;
+       int i;
+
+       p_retv_if(NULL == text, -1);
+
+       len = strlen(text);
+       for (i = 0;i<len-2;i++) {
+               if (text[i] == (char)0xe2 && text[i+1] == (char)0x80 && text[i+2] == (char)0x8b)
+                       return i;
+       }
+       return -1;
+}
+
+static int dialer_trim_dash_from_numstr(char *src, char *dest_buf, int buf_size, int cursor)
+{
+       int number_index= 0;
+       int scan_index = 0;
+       int zero_pos;
+
+       p_retvm_if(NULL == src || '\0' == *src, -1, "src is NULL");
+       p_retvm_if(NULL == dest_buf, -1, "dest_buf is NULL");
+
+       zero_pos = dialer_include_zero_space(src);
+
+       while (src[scan_index] && number_index < buf_size) {
+               if (scan_index == zero_pos) {
+                       scan_index += 3;
+                       if (number_index < cursor)
+                               cursor--;
+                       continue;
+               }
+               if (!ph_dialer_util_is_dash(src[scan_index]))
+                       dest_buf[number_index++] = src[scan_index];
+               else if (number_index < cursor)
+                       cursor--;
+               scan_index++;
+       }
+       dest_buf[number_index] = '\0';
+       return cursor;
+}
+
+static void dialer_entry_text_changed(void *data, Evas_Object *obj, void *event_info)
+{
+       ph_dialer_data *dial_d = data;
+       int pos, cursor;
+       char node_text[PH_TEXT_MAX_LEN] = {0};
+       char entry_text[PH_TEXT_MAX_LEN] = {0};
+       char *org;
+       char *text;
+       int differ = 0;
+
+       org = SAFE_STRDUP(elm_entry_entry_get(obj));
+       p_retm_if(NULL == org , "entry text is null");
+       text = elm_entry_markup_to_utf8(org);
+
+       // set text when cut/copy/paste
+       ph_dialer_util_get_pure_numstr_with_plus(dial_d, node_text);
+       pos = elm_entry_cursor_pos_get(dial_d->entry);
+       cursor = dialer_trim_dash_from_numstr(text, entry_text, sizeof(entry_text), pos);
+       differ = strcmp(node_text, entry_text);
+
+       if (0 <= dialer_include_zero_space(text) && strlen(text) == 3 && 0 == differ) {
+               free(text);
+               free(org);
+               return;
+       }
+       else if (*text == '\0') {
+               snprintf(node_text, sizeof(node_text), PH_DIALER_ENTRY_EMPTY_STYLE, dial_d->entry_font_size);
+               elm_entry_entry_set(dial_d->entry, node_text);
+               free(text);
+               free(org);
+               return;
+       }
+
+       if (0 != differ) {
+               ph_dialer_util_append_node_from_numstr(dial_d, entry_text);
+               dial_d->number_cursor = ph_dialer_util_get_node_by_index(dial_d, cursor);
+               ph_dialer_util_add_dashes(dial_d, DASH_REAL);
+               ph_dialer_util_get_numstr_from_node(dial_d, node_text);
+               ph_dialer_entry_set_number(dial_d, node_text, 0, TRUE);
+               free(text);
+               free(org);
+               return;
+       }
+
+       if (NULL == strstr(org,"font_size")) {
+               if (MAX_DIAL_NUMBER_FONT_SIZE == dial_d->entry_font_size)       dial_d->entry_font_size--;
+               else if (MIN_DIAL_NUMBER_FONT_SIZE == dial_d->entry_font_size)  dial_d->entry_font_size++;
+       }
+       dialer_entry_font_check(obj, dial_d, text, pos);
+       free(text);
+       free(org);
+}
+
+static void dialer_create_entry(ph_dialer_data *dial_d)
+{
+       Evas_Object *scroller;
+       Evas_Object *entry;
+
+       scroller = elm_scroller_add(dial_d->layout);
+       elm_scroller_bounce_set(scroller, EINA_FALSE, EINA_FALSE);
+       elm_scroller_policy_set(scroller, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
+       elm_scroller_content_min_limit(scroller, EINA_FALSE, EINA_TRUE);
+       elm_object_part_content_set(dial_d->layout, "textblock/textarea", scroller);
+
+       entry = elm_entry_add(dial_d->layout);
+       elm_entry_single_line_set(entry, EINA_TRUE);
+       elm_entry_editable_set(entry, EINA_TRUE);
+       elm_entry_magnifier_disabled_set(entry, EINA_TRUE);
+       elm_entry_input_panel_enabled_set(entry, EINA_FALSE);
+       evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, EVAS_HINT_FILL);
+       elm_object_content_set(scroller, entry);
+       dial_d->entry = entry;
+
+       evas_object_smart_callback_add(entry, "cursor,changed", dialer_entry_cursor_changed, dial_d);
+       evas_object_smart_callback_add(entry, "changed", dialer_entry_text_changed, dial_d);
+       evas_object_event_callback_add(entry, EVAS_CALLBACK_MOUSE_UP, dialer_entry_mouse_up, dial_d);
+}
+
+static void dialer_entry_number_init(void *data)
+{
+       PH_FN_CALL;
+       int ret;
+       char *buf;
+       int value;
+       char num[PH_TEXT_MAX_LEN] = {0};
+       ph_dialer_data *dial_d = data;
+
+       p_retm_if(PH_DAILER_EMERGENCY == dial_d->run_mode, "It is Emergency mode");
+
+       value = FALSE;
+       ret = vconf_get_bool(VCONFKEY_CISSAPPL_PREFIX_DIAL_BOOL, &value);
+
+       if(dial_d->init_text) {
+               ph_dialer_util_append_node_from_numstr_with_strip(dial_d, dial_d->init_text);
+               ph_dialer_util_add_dashes(dial_d, DASH_REAL);
+               ph_dialer_util_get_numstr_from_node(dial_d, num);
+               ph_dialer_entry_set_number(dial_d, num, CURSOR_END, TRUE);
+       }
+       else if (value == TRUE) {
+               ret = vconf_get_int(VCONFKEY_CISSAPPL_PREFIX_DIAL_VALUE_INT, &value);
+               PH_DBG("prefix dial index: %d", value);
+               buf = NULL;
+               switch (value) {
+               case 0:
+                       buf = vconf_get_str(VCONFKEY_CISSAPPL_PREFIX_DIAL_NUM1_STR);
+                       break;
+               case 1:
+                       buf = vconf_get_str(VCONFKEY_CISSAPPL_PREFIX_DIAL_NUM2_STR);
+                       break;
+               case 2:
+                       buf = vconf_get_str(VCONFKEY_CISSAPPL_PREFIX_DIAL_NUM3_STR);
+                       break;
+               case 3:
+                       buf = vconf_get_str(VCONFKEY_CISSAPPL_PREFIX_DIAL_NUM4_STR);
+                       break;
+               case 4:
+                       buf = vconf_get_str(VCONFKEY_CISSAPPL_PREFIX_DIAL_NUM5_STR);
+                       break;
+               default:
+                       PH_DBG("wrong prefix index(%d)", value);
+                       break;
+               }
+
+               if (buf && *buf) {
+                       ph_dialer_util_append_node_from_numstr_with_strip(dial_d, buf);
+                       ph_dialer_util_add_dashes(dial_d, DASH_REAL);
+                       ph_dialer_util_get_numstr_from_node(dial_d, num);
+                       ph_dialer_entry_set_number(dial_d, num, CURSOR_END, TRUE);
+                       free(buf);
+               }
+       }
+       else
+               dialer_entry_set_number_noresize(dial_d, "");
+       dial_d->initialized = TRUE;
+}
+
+static void dialer_lazy_init(void *data)
+{
+       PH_FN_CALL;
+       ph_dialer_data *dial_d = data;
+
+       dialer_create_entry(dial_d);
+
+       dial_d->entry_font_size = MAX_DIAL_NUMBER_FONT_SIZE;
+       dial_d->number_cursor = &(dial_d->number_head);
+
+       edje_object_signal_callback_add(_EDJ(dial_d->layout), "pad_clicked", "*", dialer_keypad_clicked, dial_d);
+       edje_object_signal_callback_add(_EDJ(dial_d->layout), "pad_down", "*", dialer_keypad_down, dial_d);
+       edje_object_signal_callback_add(_EDJ(dial_d->layout), "pad_up", "*", dialer_keypad_up, dial_d);
+       edje_object_signal_callback_add(_EDJ(dial_d->layout), "softkey_clicked", "*", dialer_softkey_clicked, dial_d);
+       edje_object_signal_callback_add(_EDJ(dial_d->layout), "softkey_up", "*", dialer_softkey_up, dial_d);
+       edje_object_signal_callback_add(_EDJ(dial_d->layout), "softkey_down", "*", dialer_softkey_down, dial_d);
+
+       dial_d->job = ecore_job_add(dialer_entry_number_init, dial_d);
+}
+
+static void dialer_layout_flush_post_cb(void *data, Evas *e, void *event_info)
+{
+       ph_dialer_data *dial_d = data;
+       evas_event_callback_del(evas_object_evas_get(dial_d->layout),
+               EVAS_CALLBACK_RENDER_FLUSH_POST, dialer_layout_flush_post_cb);
+       dial_d->job = ecore_job_add(dialer_lazy_init, dial_d);
+}
+
+static void dialer_back_btn_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       ph_dialer_data *dial_d = data;
+       dial_d->initialized = FALSE;
+       ph_dialer_util_entry_clear(dial_d);
+}
+
+int ph_dialer_create_content(ph_dialer_data *dial_d)
+{
+       PH_FN_CALL;
+       dial_d->layout = elm_layout_add(dial_d->navi);
+       p_retvm_if(NULL == dial_d->layout, 0, "elm_layout_add() Failed");
+       elm_layout_file_set(dial_d->layout, DIALER_EDJ, "dialer/main");
+       evas_object_size_hint_weight_set(dial_d->layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+
+       if (dial_d->is_emergency)
+               dial_d->run_mode = PH_DAILER_EMERGENCY;
+       else
+               dial_d->run_mode = PH_DAILER_NORMAL;
+       ph_dialer_util_setup_run_mode(dial_d);
+
+       edje_object_signal_emit(_EDJ(dial_d->layout), "main/default", "main");
+
+       evas_object_data_set(dial_d->layout, KEY_DIALER_DATA, dial_d);
+
+       evas_object_event_callback_add(dial_d->layout, EVAS_CALLBACK_DEL,
+                       dialer_view_delete_cb, dial_d);
+
+       evas_event_callback_add(evas_object_evas_get(dial_d->layout),
+               EVAS_CALLBACK_RENDER_FLUSH_POST, dialer_layout_flush_post_cb, dial_d);
+       return 1;
+}
+
+API void phone_dialer_set_navi(Evas_Object *layout)
+{
+       PH_FN_CALL;
+       ph_dialer_data *dial_d;
+       Evas_Object *cbar;
+       Evas_Object *l_btn;
+       Elm_Object_Item *navi_it;
+       dial_d = evas_object_data_get(layout, KEY_DIALER_DATA);
+       p_retm_if(NULL == dial_d, "dialer data is null");
+       navi_it = elm_naviframe_bottom_item_get(dial_d->navi);
+
+       cbar = elm_object_item_part_content_get(navi_it, "controlbar");
+       if (cbar)
+               phone_cbar_item_clear(cbar);
+
+       if (!dial_d->ug) {
+               l_btn = elm_button_add(dial_d->navi);
+               evas_object_smart_callback_add(l_btn, "clicked", dialer_back_btn_cb, dial_d);
+               evas_object_smart_callback_add(l_btn, "clicked", phone_back_btn_clicked_cb, dial_d ->win);
+               elm_object_style_set(l_btn, "naviframe/back_btn/default");
+       }
+       else {
+               l_btn = phone_naviframe_btn(dial_d->navi, S_(PH_SYS_SK_CANCEL));
+               evas_object_smart_callback_add(l_btn, "clicked", phone_ug_destroy_me_cb, dial_d->ug);
+       }
+       elm_object_item_part_content_set(navi_it, "prev_btn", l_btn);
+}
+
+API void phone_dialer_view_reset(Evas_Object *layout)
+{
+       PH_FN_CALL;
+       ph_dialer_data *dial_d;
+       Elm_Object_Item *item;
+
+       dial_d = evas_object_data_get(layout, KEY_DIALER_DATA);
+       p_retm_if(NULL == dial_d, "dialer data is null");
+
+       if (!dial_d->ug) {
+               Evas_Object *back_btn;
+               Elm_Object_Item *navi_it = elm_naviframe_bottom_item_get(dial_d->navi);
+               back_btn = elm_object_item_part_content_get(navi_it, "prev_btn");
+               if(back_btn)
+                       evas_object_smart_callback_del(back_btn, "clicked", dialer_back_btn_cb);
+       }
+
+       item = elm_naviframe_bottom_item_get(dial_d->navi);
+       if (elm_naviframe_top_item_get(dial_d->navi) != item)
+               elm_naviframe_item_pop_to(item);
+}
+
+API void phone_dialer_check_focus(Evas_Object *layout)
+{
+       PH_FN_CALL;
+       ph_dialer_data *dial_d;
+       char *text;
+
+       dial_d = evas_object_data_get(layout, KEY_DIALER_DATA);
+       p_retm_if(NULL == dial_d, "dialer data is null");
+
+       text = elm_entry_markup_to_utf8(elm_entry_entry_get(dial_d->entry));
+
+       if (dial_d->has_focus && text && dialer_include_zero_space(text) == -1)
+               elm_object_focus_set(dial_d->entry, EINA_TRUE);
+       else {
+               elm_object_focus_set(dial_d->entry, EINA_FALSE);
+               dial_d->has_focus = false;
+       }
+       free(text);
+}
+
+API void phone_dialer_view_resume(Evas_Object *layout)
+{
+       PH_FN_CALL;
+       ph_dialer_data *dial_d;
+       dial_d = evas_object_data_get(layout, KEY_DIALER_DATA);
+       p_retm_if(NULL == dial_d, "dialer data is null");
+
+       if (!dial_d->initialized)
+               dialer_entry_number_init(dial_d);
+}
+
+API void phone_dialer_view_set_num(Evas_Object *layout, char *number)
+{
+       PH_FN_CALL;
+       ph_dialer_data *dial_d;
+       char dest[PH_TEXT_MAX_LEN] = {0};
+       dial_d = evas_object_data_get(layout, KEY_DIALER_DATA);
+       p_retm_if(NULL == dial_d, "dialer data is null");
+
+       if(dial_d->entry) {
+               ph_dialer_util_append_node_from_numstr_with_strip(dial_d, number);
+               ph_dialer_util_add_dashes(dial_d, DASH_REAL);
+               ph_dialer_util_get_numstr_from_node(dial_d, dest);
+               ph_dialer_entry_set_number(dial_d, dest, CURSOR_END, TRUE);
+       }
+       else
+               dial_d->init_text = SAFE_STRDUP(number);
+}
+
+
diff --git a/lib/dialer/ph-dialer-view.h b/lib/dialer/ph-dialer-view.h
new file mode 100755 (executable)
index 0000000..9509e9c
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * 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 __PH_DIALER_VIEW_H__
+#define __PH_DIALER_VIEW_H__
+
+#define KEY_DIALER_DATA        "dialer_data"
+
+int ph_dialer_create_content(ph_dialer_data *dial_d);
+void ph_dialer_entry_set_number(ph_dialer_data *dial_d, char *orig, int cursor, int is_need_emit);
+void phone_dialer_view_set_num(Evas_Object *layout, char *number);
+
+#endif /* __PH_DIALER_VIEW_H__ */
diff --git a/lib/edc/dialer.edc b/lib/edc/dialer.edc
new file mode 100644 (file)
index 0000000..b5d22a0
--- /dev/null
@@ -0,0 +1,847 @@
+/*
+ * 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.
+ */
+
+#define MAIN_H 1280
+#define MAIN_W 720
+#define INDICATOR_H 50
+#define NAVIFRAME_H 100
+#define CONTROLBAR_H 124
+#define KEYPAD_START 265
+#define TEXT_AREA 123
+#define KEYPAD_H 741
+#define BUTTON_W 234
+#define BUTTON_W_PAD 9
+#define BUTTON_H 136
+#define BUTTON_H_PAD 12
+#define MAIN_H_PURE (MAIN_H-INDICATOR_H-CONTROLBAR_H-NAVIFRAME_H)
+#define BTN_2_COL_W (BUTTON_W+BUTTON_W_PAD)
+#define BTN_3_COL_W ((BUTTON_W*2)+(BUTTON_W_PAD*2))
+#define BTN_2_ROW_H (BUTTON_H+BUTTON_H_PAD)
+#define BTN_3_ROW_H ((BUTTON_H*2)+(BUTTON_H_PAD*2))
+#define BTN_4_ROW_H ((BUTTON_H*3)+(BUTTON_H_PAD*3))
+#define BTN_5_ROW_H ((BUTTON_H*4)+(BUTTON_H_PAD*4))
+#define IMAGE_PATH "../images/dialer_images/"
+#define KEYPAD_ANI_TIME 0.03
+
+images {
+       image: IMAGE_PATH"C01-3_dialer_btn_01.png" COMP;
+       image: IMAGE_PATH"C01-3_dialer_btn_02.png" COMP;
+       image: IMAGE_PATH"C01-3_dialer_btn_03.png" COMP;
+       image: IMAGE_PATH"C01-3_dialer_btn_press.png" COMP;
+       image: IMAGE_PATH"C01-3_dialer_icon_01.png" COMP;
+       image: IMAGE_PATH"C01-3_dialer_icon_01_press.png" COMP;
+       image: IMAGE_PATH"C01-3_dialer_icon_03.png" COMP;
+       image: IMAGE_PATH"C01-3_dialer_icon_03_press.png" COMP;
+       image: IMAGE_PATH"C01-3_dialer_icon_call.png" COMP;
+       image: IMAGE_PATH"C01-3_dialer_icon_clear.png" COMP;
+       image: IMAGE_PATH"C01-3_dialer_icon_video_call.png" COMP;
+       image: IMAGE_PATH"C01-3_dialer_icon_video_call_dim.png" COMP;
+}
+
+color_classes {
+       color_class {
+               name: "color/textblock/bg";
+               color: 0 0 0 255;
+       }
+}
+
+
+collections {
+       /*****************************************************************************
+        * dialer main edc group
+        *****************************************************************************/
+       group {
+               name: "dialer/main";
+
+               parts {
+                       /*****************************************************************************
+                        * Main background
+                        *****************************************************************************/
+                       part {
+                               name: "background";
+                               type: RECT;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 0.0; }
+                                       rel2 { relative: 1.0 1.0; }
+                                       color_class: "color/textblock/bg";
+                               }
+                       }
+
+                       /*****************************************************************************
+                        * Number Keypad bg
+                        *****************************************************************************/
+                       part {
+                               name: "keypad/bg";
+                               type: RECT;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 KEYPAD_START/MAIN_H_PURE; to: "background"; }
+                                       rel2 { relative: 1.0 1.0; to: "background"; }
+                                       color: 0 0 0 255;
+                               }
+                       }
+
+                       /*****************************************************************************
+                        * Softkey button
+                        *****************************************************************************/
+#define PART_CALL_SOFTKEY(txt,offx, offy, w, h, icon, icon_press, icon_dim, file, file_press, file_dim) \
+                       part { \
+                               name: txt; \
+                               type: IMAGE; \
+                               scale: 1; \
+                               description { \
+                                       state: "default" 0.0; \
+                                       rel1 { relative: offx/MAIN_W offy/KEYPAD_H; to:"keypad/bg";} \
+                                       rel2 { relative: (offx+w)/MAIN_W (offy+h)/KEYPAD_H; to:"keypad/bg";} \
+                                       image { \
+                                               normal: file; \
+                                               border: 8 8 8 8; \
+                                               border_scale: 1; \
+                                       } \
+                               } \
+                               description { \
+                                       state: "pressed" 0.0; \
+                                       inherit: "default" 0.0; \
+                                       image.normal: file_press; \
+                               } \
+                               description { \
+                                       state: "dim" 0.0; \
+                                       inherit: "default" 0.0; \
+                                       image.normal: file_dim; \
+                               } \
+                               description { \
+                                       state: "hide" 0.0; \
+                                       visible: 0; \
+                               } \
+                       } \
+                       part { \
+                               name: txt"_icon"; \
+                               type: IMAGE; \
+                               scale: 1; \
+                               mouse_events: 0; \
+                               description { \
+                                       state: "default" 0.0; \
+                                       min: 234 h; \
+                                       fixed: 1 1; \
+                                       rel1 { relative: 0.5 0.5; to: txt;} \
+                                       rel2 { relative: 0.5 0.5; to: txt;} \
+                                       align: 0.5 0.5; \
+                                       image.normal: icon; \
+                               } \
+                               description { \
+                                       state: "pressed" 0.0; \
+                                       inherit: "default" 0.0; \
+                                       image.normal: icon_press; \
+                               } \
+                               description { \
+                                       state: "dim" 0.0; \
+                                       inherit: "default" 0.0; \
+                                       image.normal: icon_dim; \
+                               } \
+                               description { \
+                                       state: "hide" 0.0; \
+                                       visible: 0; \
+                               } \
+                       }
+
+                       part {
+                               name: "input_back";
+                               type: IMAGE;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: BTN_3_COL_W/MAIN_W BTN_5_ROW_H/KEYPAD_H; to:"keypad/bg";}
+                                       rel2 { relative: (BTN_3_COL_W+BUTTON_W)/MAIN_W (BTN_5_ROW_H+BUTTON_H)/KEYPAD_H; to:"keypad/bg";}
+                                       image {
+                                               border: 8 8 8 8;
+                                               border_scale: 1;
+                                               normal: IMAGE_PATH"C01-3_dialer_btn_01.png";
+                                       }
+                               }
+                               description {
+                                       state: "pressed" 0.0;
+                                       inherit: "default" 0.0;
+                                       image.normal: IMAGE_PATH"C01-3_dialer_btn_press.png";
+                               }
+                               description {
+                                       state: "dim" 0.0;
+                                       inherit: "default" 0.0;
+                                       image.normal: IMAGE_PATH"C01-3_dialer_btn_01.png";
+                               }
+                       }
+
+                       part {
+                               name: "input_back_icon";
+                               type: IMAGE;
+                               scale: 1;
+                               mouse_events: 0;
+                               description {
+                                       state: "default" 0.0;
+                                        rel1 { relative: BTN_3_COL_W/MAIN_W BTN_5_ROW_H/KEYPAD_H; to:"keypad/bg";}
+                                        rel2 { relative: (BTN_3_COL_W+BUTTON_W)/MAIN_W (BTN_5_ROW_H+BUTTON_H)/KEYPAD_H; to:"keypad/bg";}
+                                        image.normal: IMAGE_PATH"C01-3_dialer_icon_clear.png";
+                               }
+                               description {
+                                       state: "pressed" 0.0;
+                                       inherit: "default" 0.0;
+                                       image.normal: IMAGE_PATH"C01-3_dialer_icon_clear.png";
+                               }
+                               description {
+                                       state: "dim" 0.0;
+                                       inherit: "default" 0.0;
+                                       image.normal: IMAGE_PATH"C01-3_dialer_icon_clear.png";
+                               }
+                       }
+
+                       PART_CALL_SOFTKEY("normal/call", 0, BTN_5_ROW_H, 477, BUTTON_H, IMAGE_PATH"C01-3_dialer_icon_call.png", IMAGE_PATH"C01-3_dialer_icon_call.png", IMAGE_PATH"C01-3_dialer_icon_call.png", IMAGE_PATH"C01-3_dialer_btn_03.png", IMAGE_PATH"C01-3_dialer_btn_press.png", IMAGE_PATH"C01-3_dialer_btn_03.png")
+
+                               /*****************************************************************************
+                                * Number Keypad button
+                                *****************************************************************************/
+#define PART_KEYPAD_CUSTOM_TWO_LABLE(txt, offx, offy, file, file_press,label_left_text,label_left_font,label_left_size,label_right_text,label_right_font,label_right_size) \
+                       part { \
+                               name: txt; \
+                               type: IMAGE; \
+                               scale: 1; \
+                               description { \
+                                       state: "default" 0.0; \
+                                       rel1 { relative: offx/MAIN_W offy/KEYPAD_H; to:"keypad/bg";} \
+                                       rel2 { relative: (offx+BUTTON_W)/MAIN_W (offy+BUTTON_H)/KEYPAD_H; to:"keypad/bg"; } \
+                                       image { \
+                                               normal: file; \
+                                               border: 8 8 8 8; \
+                                               border_scale: 1; \
+                                       } \
+                               } \
+                               description { \
+                                       state: "pressed" 0.0; \
+                                       inherit: "default" 0.0; \
+                                       image.normal: file_press; \
+                               } \
+                               description { \
+                                       state: "hide" 0.0; \
+                                       visible: 0; \
+                               } \
+                       } \
+                       part { \
+                               name: txt"_left"; \
+                               type: TEXT; \
+                               scale: 1; \
+                               effect: SHADOW; \
+                               mouse_events: 0; \
+                               description { \
+                                       state: "default" 0.0; \
+                                       rel1 { relative: 0.08 0.0; to: txt;} \
+                                       rel2 { relative: 0.4 1.0; to: txt;} \
+                                       fixed: 1 1; \
+                                       align: 0.5 0.5; \
+                                       color: 249 249 249 255; \
+                                       text { \
+                                               font: label_left_font; \
+                                               text: label_left_text; \
+                                               size: label_left_size; \
+                                               min: 1 1; \
+                                               align: 0.5 0.5; \
+                                       } \
+                               } \
+                               description { \
+                                       state: "hide" 0.0; \
+                                       visible: 0; \
+                               } \
+                       } \
+                       part { \
+                               name: txt"_right"; \
+                               type: TEXT; \
+                               scale: 1; \
+                               effect: SHADOW; \
+                               mouse_events: 0; \
+                               description { \
+                                       state: "default" 0.0; \
+                                       rel1 { relative: 0.4 0.0; to: txt;} \
+                                       rel2 { relative: 0.92 1.0; to: txt;} \
+                                       fixed: 1 1; \
+                                       align: 0.5 0.5; \
+                                       color: 124 124 124 255; \
+                                       text { \
+                                               font: label_right_font; \
+                                               text: label_right_text; \
+                                               size: label_right_size; \
+                                               min: 1 1; \
+                                               align: 0.5 0.5; \
+                                       } \
+                               } \
+                               description { \
+                                       state: "hide" 0.0; \
+                                       visible: 0; \
+                               } \
+                       }
+
+
+#define PART_KEYPAD_CUSTOM_ONEICON_ONELABEL(txt, offx, offy, file, file_press,icon_left,icon_left_press,icon_left_sizex,icon_left_sizey,label_right_text,label_right_font,label_right_size) \
+                       part { \
+                               name: txt; \
+                               type: IMAGE; \
+                               scale: 1; \
+                               description { \
+                                       state: "default" 0.0; \
+                                       rel1 { relative: offx/MAIN_W offy/KEYPAD_H; to:"keypad/bg";} \
+                                       rel2 { relative: (offx+BUTTON_W)/MAIN_W (offy+BUTTON_H)/KEYPAD_H; to:"keypad/bg"; } \
+                                       image { \
+                                               normal: file; \
+                                               border: 8 8 8 8; \
+                                               border_scale: 1; \
+                                       } \
+                               } \
+                               description { \
+                                       state: "pressed" 0.0; \
+                                       inherit: "default" 0.0; \
+                                       image.normal: file_press; \
+                               } \
+                               description { \
+                                       state: "hide" 0.0; \
+                                       visible: 0; \
+                               } \
+                       } \
+                       part { \
+                               name: txt"_left"; \
+                               type: IMAGE; \
+                               scale: 1; \
+                               mouse_events: 0; \
+                               description { \
+                                       state: "default" 0.0; \
+                                       min: icon_left_sizex icon_left_sizey; \
+                                       fixed: 1 1; \
+                                       rel1 { relative: 0.24 0.5; to: txt;} \
+                                       rel2 { relative: 0.24 0.5; to: txt;} \
+                                       align: 0.5 0.5; \
+                                       image.normal: icon_left; \
+                               } \
+                               description { \
+                                       state: "pressed" 0.0; \
+                                       inherit: "default" 0.0; \
+                                       image.normal: icon_left_press; \
+                               } \
+                               description { \
+                                       state: "hide" 0.0; \
+                                       visible: 0; \
+                               } \
+                       } \
+                       part { \
+                               name: txt"_right"; \
+                               type: TEXT; \
+                               scale: 1; \
+                               effect: SHADOW; \
+                               mouse_events: 0; \
+                               description { \
+                                       state: "default" 0.0; \
+                                       rel1 { relative: 0.4 0.0; to: txt;} \
+                                       rel2 { relative: 0.92 1.0; to: txt;} \
+                                       fixed: 1 1; \
+                                       align: 0.5 0.5; \
+                                       color: 124 124 124 255; \
+                                       text { \
+                                               font: label_right_font; \
+                                               text: label_right_text; \
+                                               size: label_right_size; \
+                                               min: 1 1; \
+                                               align: 0.5 0.5; \
+                                       } \
+                               } \
+                               description { \
+                                       state: "hide" 0.0; \
+                                       visible: 0; \
+                               } \
+                       }
+
+#define PART_KEYPAD_CUSTOM_ONELABEL(txt, offx, offy, file, file_press,label_left_text,label_left_font,label_left_size) \
+                       part { \
+                               name: txt; \
+                               type: IMAGE; \
+                               scale: 1; \
+                               description { \
+                                       state: "default" 0.0; \
+                                       rel1 { relative: offx/MAIN_W offy/KEYPAD_H; to:"keypad/bg";} \
+                                       rel2 { relative: (offx+BUTTON_W)/MAIN_W (offy+BUTTON_H)/KEYPAD_H; to:"keypad/bg"; } \
+                                       image { \
+                                               normal: file; \
+                                               border: 8 8 8 8; \
+                                               border_scale: 1; \
+                                       } \
+                               } \
+                               description { \
+                                       state: "pressed" 0.0; \
+                                       inherit: "default" 0.0; \
+                                       image.normal: file_press; \
+                               } \
+                               description { \
+                                       state: "hide" 0.0; \
+                                       visible: 0; \
+                               } \
+                       } \
+                       part { \
+                               name: txt"_left"; \
+                               type: TEXT; \
+                               scale: 1; \
+                               effect: SHADOW; \
+                               mouse_events: 0; \
+                               description { \
+                                       state: "default" 0.0; \
+                                       rel1 { relative: 0.0 0.0; to: txt;} \
+                                       rel2 { relative: 1.0 1.0; to: txt;} \
+                                       fixed: 1 1; \
+                                       align: 0.5 0.5; \
+                                       color: 249 249 249 255; \
+                                       text { \
+                                               font: label_left_font; \
+                                               text: label_left_text; \
+                                               size: label_left_size; \
+                                               min: 1 1; \
+                                               align: 0.5 0.5; \
+                                       } \
+                               } \
+                               description { \
+                                       state: "hide" 0.0; \
+                                       visible: 0; \
+                               } \
+                       }
+
+                       PART_KEYPAD_CUSTOM_ONELABEL("1", 0,0, IMAGE_PATH"C01-3_dialer_btn_01.png",IMAGE_PATH"C01-3_dialer_btn_press.png","1","SLP:style=Light",116)
+                       PART_KEYPAD_CUSTOM_ONELABEL("2", BTN_2_COL_W,0, IMAGE_PATH"C01-3_dialer_btn_01.png",IMAGE_PATH"C01-3_dialer_btn_press.png","2","SLP:style=Light",116)
+                       PART_KEYPAD_CUSTOM_ONELABEL("3", BTN_3_COL_W,0, IMAGE_PATH"C01-3_dialer_btn_01.png",IMAGE_PATH"C01-3_dialer_btn_press.png","3","SLP:style=Light",116)
+                       PART_KEYPAD_CUSTOM_ONELABEL("4", 0,BTN_2_ROW_H, IMAGE_PATH"C01-3_dialer_btn_01.png",IMAGE_PATH"C01-3_dialer_btn_press.png","4","SLP:style=Light",116)
+                       PART_KEYPAD_CUSTOM_ONELABEL("5", BTN_2_COL_W,BTN_2_ROW_H, IMAGE_PATH"C01-3_dialer_btn_01.png",IMAGE_PATH"C01-3_dialer_btn_press.png","5","SLP:style=Light",116)
+                       PART_KEYPAD_CUSTOM_ONELABEL("6", BTN_3_COL_W,BTN_2_ROW_H, IMAGE_PATH"C01-3_dialer_btn_01.png",IMAGE_PATH"C01-3_dialer_btn_press.png","6","SLP:style=Light",116)
+                       PART_KEYPAD_CUSTOM_ONELABEL("7", 0,BTN_3_ROW_H,IMAGE_PATH"C01-3_dialer_btn_01.png",IMAGE_PATH"C01-3_dialer_btn_press.png","7","SLP:style=Light",116)
+                       PART_KEYPAD_CUSTOM_ONELABEL("8", BTN_2_COL_W,BTN_3_ROW_H,IMAGE_PATH"C01-3_dialer_btn_01.png",IMAGE_PATH"C01-3_dialer_btn_press.png","8","SLP:style=Light",116)
+                       PART_KEYPAD_CUSTOM_ONELABEL("9", BTN_3_COL_W,BTN_3_ROW_H,IMAGE_PATH"C01-3_dialer_btn_01.png",IMAGE_PATH"C01-3_dialer_btn_press.png","9","SLP:style=Light",116)
+                       PART_KEYPAD_CUSTOM_ONELABEL("sharp",BTN_3_COL_W, BTN_4_ROW_H, IMAGE_PATH"C01-3_dialer_btn_01.png",IMAGE_PATH"C01-3_dialer_btn_press.png","#","SLP:style=Light",116)
+
+                       PART_KEYPAD_CUSTOM_ONEICON_ONELABEL("star", 0,BTN_4_ROW_H,IMAGE_PATH"C01-3_dialer_btn_01.png",IMAGE_PATH"C01-3_dialer_btn_press.png",IMAGE_PATH"C01-3_dialer_icon_03.png",IMAGE_PATH"C01-3_dialer_icon_03_press.png",75,75,"P","SLP:style=Roman",56)
+                       PART_KEYPAD_CUSTOM_TWO_LABLE("0", BTN_2_COL_W,BTN_4_ROW_H,IMAGE_PATH"C01-3_dialer_btn_01.png",IMAGE_PATH"C01-3_dialer_btn_press.png","0","SLP:style=Light",116,"+","SLP:style=Roman",64)
+
+                       /*****************************************************************************
+                        * Common place (1 row)
+                        *****************************************************************************/
+                       part {
+                               name: "common_place";
+                               type: RECT;
+                               mouse_events: 0;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 (TEXT_AREA+1)/MAIN_H_PURE; to: "background"; }
+                                       rel2 { relative: 1.0 KEYPAD_START/MAIN_H_PURE; to: "background"; }
+                                       color: 0 0 0 0;
+                                       align: 0.0 0.0;
+                               }
+                               description {
+                                       state: "hide" 0.0;
+                                       inherit: "default" 0.0;
+                                       visible: 0;
+                               }
+                       }
+
+                       /*****************************************************************************
+                        * Textblock
+                        *****************************************************************************/
+                       // for color
+                       part {
+                               name: "textblock/bg";
+                               type: RECT;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 0.0; to: "background";}
+                                       rel2 { relative: 1.0 TEXT_AREA/MAIN_H_PURE; to: "background";}
+                                       align: 0.5 1.0;
+                                       color_class: "color/textblock/bg";
+                               }
+                       }
+
+                       part {
+                               name: "textblock/textarea";
+                               type: SWALLOW;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       fixed: 1 1;
+                                       rel1 { relative: 0.0 0.5; to: "textblock/bg"; }
+                                       rel2 { relative: 1.0 0.5; to: "textblock/bg"; }
+                               }
+                       }
+
+                       /*****************************************************************************
+                        * Programs
+                        *****************************************************************************/
+               programs {
+                       program {
+                               name: "click_exit";
+                               source: "background";
+                               signal: "mouse,clicked,1";
+                               action: SIGNAL_EMIT "EXIT" "EDJ";
+                       }
+
+                       program {
+                               name: "keyinit";
+                               source: "keyinit";
+                               signal: "keyinit";
+                               script {
+                                       emit ("show_star","star");
+                               }
+                       }
+
+                       /*****************************************************************************
+                        * Program: Keypad button
+                        *****************************************************************************/
+#define PROG_KEYPAD(txt) \
+                       program { \
+                               name: "down_"txt; \
+                               signal: "mouse,down,*"; \
+                               source: txt; \
+                               script { \
+                                       set_state(PART:txt, "pressed", 0.0); \
+                                       emit("pad_down", txt); \
+                               } \
+                       } \
+                       program { \
+                               name: "ani_"txt; \
+                               signal: "ani"; \
+                               source: txt; \
+                               action: STATE_SET "default" 0.0; \
+                               transition: SINUSOIDAL KEYPAD_ANI_TIME; \
+                               target: txt; \
+                       } \
+                       program { \
+                               name: "up_"txt; \
+                               signal: "mouse,up,1"; \
+                               source: txt; \
+                               script { \
+                                       emit("pad_up", txt); \
+                                       emit("ani", txt); \
+                               } \
+                       } \
+                       program { \
+                               name: "clicked_"txt; \
+                               signal: "mouse,clicked,1"; \
+                               source: txt; \
+                               script { \
+                                       emit("pad_clicked", txt); \
+                               } \
+                       } \
+                       program { \
+                               name: "hide_"txt; \
+                               signal: "hide_"txt; \
+                               source: txt; \
+                               script { \
+                                       set_state(PART:txt"_left", "hide", 0.0); \
+                                       set_state(PART:txt"_right", "hide", 0.0); \
+                                       set_state(PART:txt, "hide", 0.0); \
+                               } \
+                       } \
+                       program { \
+                               name: "show_"txt; \
+                               signal: "show_"txt; \
+                               source: txt; \
+                               script { \
+                                       set_state(PART:txt"_left", "default", 0.0); \
+                                       set_state(PART:txt"_right", "default", 0.0); \
+                                       set_state(PART:txt, "default", 0.0); \
+                               } \
+                       }
+
+#define PROG_KEYPAD_LEFT_EFFECT(txt) \
+                       program { \
+                               name: "down_"txt; \
+                               signal: "mouse,down,*"; \
+                               source: txt; \
+                               script { \
+                                       set_state(PART:txt, "pressed", 0.0); \
+                                       set_state(PART:txt"_left", "pressed", 0.0); \
+                                       emit("pad_down", txt); \
+                               } \
+                       } \
+                       program { \
+                               name: "ani_"txt; \
+                               signal: "ani"; \
+                               source: txt; \
+                               action: STATE_SET "default" 0.0; \
+                               transition: SINUSOIDAL KEYPAD_ANI_TIME; \
+                               target: txt; \
+                       } \
+                       program { \
+                               name: "up_"txt; \
+                               signal: "mouse,up,1"; \
+                               source: txt; \
+                               script { \
+                                       emit("pad_up", txt); \
+                                       emit("ani", txt); \
+                                       set_state(PART:txt"_left", "default", 0.0); \
+                               } \
+                       } \
+                       program { \
+                               name: "clicked_"txt; \
+                               signal: "mouse,clicked,1"; \
+                               source: txt; \
+                               script { \
+                                       emit("pad_clicked", txt); \
+                               } \
+                       } \
+                       program { \
+                               name: "hide_"txt; \
+                               signal: "hide_"txt; \
+                               source: txt; \
+                               script { \
+                                       set_state(PART:txt"_left", "hide", 0.0); \
+                                       set_state(PART:txt"_right", "hide", 0.0); \
+                                       set_state(PART:txt, "hide", 0.0); \
+                               } \
+                       } \
+                       program { \
+                               name: "show_"txt; \
+                               signal: "show_"txt; \
+                               source: txt; \
+                               script { \
+                                       set_state(PART:txt"_left", "default", 0.0); \
+                                       set_state(PART:txt"_right", "default", 0.0); \
+                                       set_state(PART:txt, "default", 0.0); \
+                               } \
+                       }
+
+#define PROG_KEYPAD_ONE_EFFECT(txt) \
+                       program { \
+                               name: "down_"txt; \
+                               signal: "mouse,down,*"; \
+                               source: txt; \
+                               script { \
+                                       set_state(PART:txt, "pressed", 0.0); \
+                                       set_state(PART:txt"_left", "pressed", 0.0); \
+                                       emit("pad_down", txt); \
+                               } \
+                       } \
+                       program { \
+                               name: "ani_"txt; \
+                               signal: "ani"; \
+                               source: txt; \
+                               action: STATE_SET "default" 0.0; \
+                               transition: SINUSOIDAL KEYPAD_ANI_TIME; \
+                               target: txt; \
+                       } \
+                       program { \
+                               name: "up_"txt; \
+                               signal: "mouse,up,1"; \
+                               source: txt; \
+                               script { \
+                                       emit("pad_up", txt); \
+                                       emit("ani", txt); \
+                                       set_state(PART:txt"_left", "default", 0.0); \
+                               } \
+                       } \
+                       program { \
+                               name: "clicked_"txt; \
+                               signal: "mouse,clicked,1"; \
+                               source: txt; \
+                               script { \
+                                       emit("pad_clicked", txt); \
+                               } \
+                       } \
+                       program { \
+                               name: "hide_"txt; \
+                               signal: "hide_"txt; \
+                               source: txt; \
+                               script { \
+                                       set_state(PART:txt"_left", "hide", 0.0); \
+                                       set_state(PART:txt, "hide", 0.0); \
+                               } \
+                       } \
+                       program { \
+                               name: "show_"txt; \
+                               signal: "show_"txt; \
+                               source: txt; \
+                               script { \
+                                       set_state(PART:txt"_left", "default", 0.0); \
+                                       set_state(PART:txt, "default", 0.0); \
+                               } \
+                       }
+
+                       PROG_KEYPAD_ONE_EFFECT("1")
+                       PROG_KEYPAD_ONE_EFFECT("2")
+                       PROG_KEYPAD_ONE_EFFECT("3")
+                       PROG_KEYPAD_ONE_EFFECT("4")
+                       PROG_KEYPAD_ONE_EFFECT("5")
+                       PROG_KEYPAD_ONE_EFFECT("6")
+                       PROG_KEYPAD_ONE_EFFECT("7")
+                       PROG_KEYPAD_ONE_EFFECT("8")
+                       PROG_KEYPAD_ONE_EFFECT("9")
+                       PROG_KEYPAD_LEFT_EFFECT("star")
+                       PROG_KEYPAD("0")
+                       PROG_KEYPAD_ONE_EFFECT("sharp")
+
+                       /*****************************************************************************
+                        * Program: Softkey button
+                        *****************************************************************************/
+#define PROG_SOFTKEY(txt) \
+                       program { \
+                               name: "down_"txt; \
+                               signal: "mouse,down,*"; \
+                               source: txt; \
+                               script { \
+                                       new st[30]; \
+                                       new Float:vl; \
+                                       get_state (PART:txt, st, 30, vl); \
+                                       if (strcmp(st, "dim") != 0) { \
+                                               set_state(PART:txt, "pressed", 0.0); \
+                                               emit("softkey_down", txt); \
+                                       } \
+                               } \
+                       } \
+                       program { \
+                               name: "up_"txt; \
+                               signal: "mouse,up,1"; \
+                               source: txt; \
+                               script { \
+                                       new st[30]; \
+                                       new Float:vl; \
+                                       get_state (PART:txt, st, 30, vl); \
+                                       if (strcmp(st, "dim") != 0) { \
+                                               set_state(PART:txt, "default", 0.0); \
+                                               emit("softkey_up", txt); \
+                                       } \
+                               } \
+                       } \
+                       program { \
+                               name: "clicked_"txt; \
+                               signal: "mouse,clicked,1"; \
+                               source: txt; \
+                               script { \
+                                       new st[30]; \
+                                       new Float:vl; \
+                                       get_state (PART:txt, st, 30, vl); \
+                                       if (strcmp(st, "dim") != 0) { \
+                                               emit("softkey_clicked", txt); \
+                                       } \
+                               } \
+                       }
+
+                       program {
+                               name: "down_input_back";
+                               signal: "mouse,down,*";
+                               source: "input_back";
+                               script {
+                                       new st[30];
+                                       new Float:vl;
+                                       get_state (PART:"input_back", st, 30, vl);
+                                       if (strcmp(st, "dim") != 0) {
+                                               set_state(PART:"input_back", "pressed", 0.0);
+                                               emit("softkey_down", "input_back");
+                                       }
+                               }
+                       }
+
+                       program {
+                               name: "up_input_back";
+                               signal: "mouse,up,1";
+                               source: "input_back";
+                               script {
+                                       new st[30];
+                                       new Float:vl;
+                                       get_state (PART:"input_back", st, 30, vl);
+                                       if (strcmp(st, "dim") != 0) {
+                                               set_state(PART:"input_back", "default", 0.0);
+                                               emit("softkey_up", "input_back");
+                                       }
+                               }
+                       }
+
+                       program {
+                               name: "dim_input_back";
+                               signal: "input_back/dim";
+                               source: "input_back";
+                               script {
+                                       set_state(PART:"input_back", "dim", 0.0);
+                               }
+                       }
+                       program {
+                               name: "default_input_back";
+                               signal: "input_back/default";
+                               source: "input_back";
+                               script {
+                                       set_state(PART:"input_back", "default", 0.0);
+                               }
+                       }
+
+                       program {
+                               name: "clicked_input_back";
+                               signal: "mouse,clicked,1";
+                               source: "input_back";
+                               script {
+                                       new st[30];
+                                       new Float:vl;
+                                       get_state (PART:"input_back", st, 30, vl);
+                                       if (strcmp(st, "dim") != 0) {
+                                               emit("softkey_clicked", "input_back");
+                                       }
+                               }
+                       }
+
+                       PROG_SOFTKEY("normal/call")
+
+
+                       /*****************************************************************************
+                        * Program: Softkey - normal mode
+                        *****************************************************************************/
+                       program {
+                               name: "prog_softkey_normal";
+                               source: "softkey";
+                               signal: "softkey/normal";
+                               script {
+                                       set_state (PART:"normal/call", "default", 0.0);
+                                       set_state (PART:"normal/call_icon", "default", 0.0);
+                               }
+                       }
+
+                       /*****************************************************************************
+                        * Program: Softkey - during call mode
+                        *****************************************************************************/
+                       program {
+                               name: "prog_softkey_dc";
+                               source: "softkey";
+                               signal: "softkey/dc";
+                               script {
+                                       set_state (PART:"normal/call", "default", 0.0);
+                                       set_state (PART:"normal/call_icon", "default", 0.0);
+                               }
+                       }
+
+                       /*****************************************************************************
+                        * Program: Dialer default
+                        *****************************************************************************/
+                       program {
+                               name: "prog/main";
+                               source: "main";
+                               signal: "main/default";
+                               script {
+                                       emit ("viewcontrol/button", "viewcontrol");
+                                       emit ("keyinit", "keyinit");
+                                       emit ("input_back/dim", "input_back");
+                                       emit ("softkey/normal", "softkey");
+                               }
+                       }
+               }       // programs end
+       }       // end of group
+}
diff --git a/lib/edc/progress.edc b/lib/edc/progress.edc
new file mode 100644 (file)
index 0000000..fa67cb8
--- /dev/null
@@ -0,0 +1,179 @@
+/*
+ * 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.
+ */
+
+collections {
+       group { name: "popup_center_text_progressview";
+               parts{
+                       part { name: "pad_t";
+                               scale : 1;
+                               mouse_events: 0;
+                               repeat_events: 1;
+                               description { state: "default" 0.0;
+                                       align: 0.5 0.0;
+                                       min: 0 14;
+                                       fixed: 0 1;
+                                       rel1 {
+                                               relative: 1.0 0.0;
+                                               to_x: "pad_l";
+                                       }
+                                       rel2 {
+                                               relative: 0.0 0.0;
+                                               to_x: "pad_r";
+                                       }
+                               }
+                       }
+                       part { name: "pad_l";
+                               scale: 1;
+                               description { state: "default" 0.0;
+                                       min : 10 0;
+                                       fixed: 1 0;
+                                       rel1 {
+                                               relative: 0.0 0.0;
+                                       }
+                                       rel2 {
+                                               relative: 0.0 1.0;
+                                       }
+                                       align: 0.0 0.0;
+                               }
+                       }
+                       part { name: "pad_r";
+                               scale: 1;
+                               description { state: "default" 0.0;
+                                       min : 10 0;
+                                       fixed: 1 0;
+                                       rel1 {
+                                               relative: 1.0 0.0;
+                                       }
+                                       rel2 {
+                                               relative: 1.0 1.0;
+                                       }
+                                       align: 1.0 0.0;
+                               }
+                       }
+                       part{ name:"elm.swallow.content";
+                               type: SWALLOW;
+                               description { state: "default" 0.0;
+                                       rel1 {
+                                               relative: 0.0 1.0;
+                                               to: "pad_t";
+                                       }
+                                       rel2 {
+                                               relative: 1.0 0.0;
+                                               to: "pad_b";
+                                       }
+                               }
+                       }
+                       part { name: "pad_b";
+                               scale : 1;
+                               mouse_events: 0;
+                               repeat_events: 1;
+                               description { state: "default" 0.0;
+                                       align: 0.5 1.0;
+                                       min: 0 90;
+                                       fixed: 0 1;
+                                       rel1 {
+                                               relative: 1.0 1.0;
+                                               to_x: "pad_l";
+                                       }
+                                       rel2 {
+                                               relative: 0.0 1.0;
+                                               to_x: "pad_r";
+                                       }
+                               }
+                       }
+                       part { name: "elm.swallow.end";
+                               type: SWALLOW;
+                               scale : 1;
+                               mouse_events: 1;
+                               repeat_events: 1;
+                               description { state: "default" 0.0;
+                                       align: 0.0 0.0;
+                                       fixed: 1 1;
+                                       rel1 {
+                                               relative: 0.0 0.0;
+                                               to: "pad_b";
+                                       }
+                                       rel2 {
+                                               relative: 1.0 1.0;
+                                               to: "pad_b";
+                                       }
+                               }
+                       }
+                       part { name: "pad_bm";
+                               scale : 1;
+                               mouse_events: 0;
+                               repeat_events: 1;
+                               description { state: "default" 0.0;
+                                       align: 0.0 1.0;
+                                       min: 0 52;
+                                       fixed: 0 1;
+                                       rel1 {
+                                               relative: 0.0 1.0;
+                                               to: "pad_b";
+                                       }
+                                       rel2 {
+                                               relative: 1.0 1.0;
+                                               to: "pad_b";
+                                       }
+                               }
+                       }
+                       part { name: "elm.text.subtext1";
+                               type: TEXT;
+                               scale : 1;
+                               description { state: "default" 0.0;
+                                       text {
+                                               font: "SLP:style=Medium";
+                                               size: 16;
+                                               min: 0 0;
+                                               align: 0.0 1.0;
+                                       }
+                                       color: 108 108 108 255;
+                                       align: 0.0 0.5;
+                                       rel1 {
+                                               relative: 0.0 0.0;
+                                               to: "pad_bm";
+                                       }
+                                       rel2 {
+                                               relative: 1.0 1.0;
+                                               to: "pad_bm";
+                                       }
+                               }
+                       }
+                       part { name: "elm.text.subtext2";
+                               type: TEXT;
+                               scale : 1;
+                               description { state: "default" 0.0;
+                                       text {
+                                               font: "SLP:style=Medium";
+                                               size: 16;
+                                               min: 0 0;
+                                               align: 1.0 1.0;
+                                       }
+                                       color: 108 108 108 255;
+                                       align: 1.0 0.5;
+                                       rel1 {
+                                               relative: 0.0 0.0;
+                                               to: "pad_bm";
+                                       }
+                                       rel2 {
+                                               relative: 1.0 1.0;
+                                               to: "pad_bm";
+                                       }
+                               }
+                       }
+               }
+       }
+}
diff --git a/lib/images/dialer_images/C01-3_dialer_btn_01.png b/lib/images/dialer_images/C01-3_dialer_btn_01.png
new file mode 100644 (file)
index 0000000..b809797
Binary files /dev/null and b/lib/images/dialer_images/C01-3_dialer_btn_01.png differ
diff --git a/lib/images/dialer_images/C01-3_dialer_btn_02.png b/lib/images/dialer_images/C01-3_dialer_btn_02.png
new file mode 100644 (file)
index 0000000..ad06527
Binary files /dev/null and b/lib/images/dialer_images/C01-3_dialer_btn_02.png differ
diff --git a/lib/images/dialer_images/C01-3_dialer_btn_03.png b/lib/images/dialer_images/C01-3_dialer_btn_03.png
new file mode 100644 (file)
index 0000000..de780cf
Binary files /dev/null and b/lib/images/dialer_images/C01-3_dialer_btn_03.png differ
diff --git a/lib/images/dialer_images/C01-3_dialer_btn_press.png b/lib/images/dialer_images/C01-3_dialer_btn_press.png
new file mode 100644 (file)
index 0000000..b3f4b0a
Binary files /dev/null and b/lib/images/dialer_images/C01-3_dialer_btn_press.png differ
diff --git a/lib/images/dialer_images/C01-3_dialer_icon_01.png b/lib/images/dialer_images/C01-3_dialer_icon_01.png
new file mode 100644 (file)
index 0000000..6d7fbc3
Binary files /dev/null and b/lib/images/dialer_images/C01-3_dialer_icon_01.png differ
diff --git a/lib/images/dialer_images/C01-3_dialer_icon_01_press.png b/lib/images/dialer_images/C01-3_dialer_icon_01_press.png
new file mode 100644 (file)
index 0000000..b79f2c6
Binary files /dev/null and b/lib/images/dialer_images/C01-3_dialer_icon_01_press.png differ
diff --git a/lib/images/dialer_images/C01-3_dialer_icon_03.png b/lib/images/dialer_images/C01-3_dialer_icon_03.png
new file mode 100755 (executable)
index 0000000..0fba753
Binary files /dev/null and b/lib/images/dialer_images/C01-3_dialer_icon_03.png differ
diff --git a/lib/images/dialer_images/C01-3_dialer_icon_03_press.png b/lib/images/dialer_images/C01-3_dialer_icon_03_press.png
new file mode 100755 (executable)
index 0000000..0fba753
Binary files /dev/null and b/lib/images/dialer_images/C01-3_dialer_icon_03_press.png differ
diff --git a/lib/images/dialer_images/C01-3_dialer_icon_call.png b/lib/images/dialer_images/C01-3_dialer_icon_call.png
new file mode 100644 (file)
index 0000000..b30101b
Binary files /dev/null and b/lib/images/dialer_images/C01-3_dialer_icon_call.png differ
diff --git a/lib/images/dialer_images/C01-3_dialer_icon_clear.png b/lib/images/dialer_images/C01-3_dialer_icon_clear.png
new file mode 100644 (file)
index 0000000..c0a8884
Binary files /dev/null and b/lib/images/dialer_images/C01-3_dialer_icon_clear.png differ
diff --git a/lib/images/dialer_images/C01-3_dialer_icon_video_call.png b/lib/images/dialer_images/C01-3_dialer_icon_video_call.png
new file mode 100644 (file)
index 0000000..47b0ffa
Binary files /dev/null and b/lib/images/dialer_images/C01-3_dialer_icon_video_call.png differ
diff --git a/lib/images/dialer_images/C01-3_dialer_icon_video_call_dim.png b/lib/images/dialer_images/C01-3_dialer_icon_video_call_dim.png
new file mode 100644 (file)
index 0000000..473c90d
Binary files /dev/null and b/lib/images/dialer_images/C01-3_dialer_icon_video_call_dim.png differ
diff --git a/lib/images/phoneug_images/01_controlbar_icon_contacts.png b/lib/images/phoneug_images/01_controlbar_icon_contacts.png
new file mode 100644 (file)
index 0000000..a376989
Binary files /dev/null and b/lib/images/phoneug_images/01_controlbar_icon_contacts.png differ
diff --git a/lib/images/phoneug_images/01_controlbar_icon_create.png b/lib/images/phoneug_images/01_controlbar_icon_create.png
new file mode 100644 (file)
index 0000000..0dc1144
Binary files /dev/null and b/lib/images/phoneug_images/01_controlbar_icon_create.png differ
diff --git a/lib/images/phoneug_images/01_controlbar_icon_delete.png b/lib/images/phoneug_images/01_controlbar_icon_delete.png
new file mode 100644 (file)
index 0000000..faaa0d3
Binary files /dev/null and b/lib/images/phoneug_images/01_controlbar_icon_delete.png differ
diff --git a/lib/images/phoneug_images/01_controlbar_icon_dialer.png b/lib/images/phoneug_images/01_controlbar_icon_dialer.png
new file mode 100644 (file)
index 0000000..1ad19c7
Binary files /dev/null and b/lib/images/phoneug_images/01_controlbar_icon_dialer.png differ
diff --git a/lib/images/phoneug_images/01_controlbar_icon_edit.png b/lib/images/phoneug_images/01_controlbar_icon_edit.png
new file mode 100644 (file)
index 0000000..4ddc598
Binary files /dev/null and b/lib/images/phoneug_images/01_controlbar_icon_edit.png differ
diff --git a/lib/images/phoneug_images/01_controlbar_icon_favorite.png b/lib/images/phoneug_images/01_controlbar_icon_favorite.png
new file mode 100644 (file)
index 0000000..aa13cf9
Binary files /dev/null and b/lib/images/phoneug_images/01_controlbar_icon_favorite.png differ
diff --git a/lib/images/phoneug_images/01_controlbar_icon_logs.png b/lib/images/phoneug_images/01_controlbar_icon_logs.png
new file mode 100644 (file)
index 0000000..384341b
Binary files /dev/null and b/lib/images/phoneug_images/01_controlbar_icon_logs.png differ
diff --git a/lib/images/phoneug_images/01_controlbar_icon_save.png b/lib/images/phoneug_images/01_controlbar_icon_save.png
new file mode 100644 (file)
index 0000000..f8a9278
Binary files /dev/null and b/lib/images/phoneug_images/01_controlbar_icon_save.png differ
diff --git a/lib/images/phoneug_images/C01-4_icon_Blocked(Auto-rejected).png b/lib/images/phoneug_images/C01-4_icon_Blocked(Auto-rejected).png
new file mode 100644 (file)
index 0000000..7f2cf70
Binary files /dev/null and b/lib/images/phoneug_images/C01-4_icon_Blocked(Auto-rejected).png differ
diff --git a/lib/images/phoneug_images/C01-4_icon_Blocked(Auto-rejected)_64x64.png b/lib/images/phoneug_images/C01-4_icon_Blocked(Auto-rejected)_64x64.png
new file mode 100644 (file)
index 0000000..a456542
Binary files /dev/null and b/lib/images/phoneug_images/C01-4_icon_Blocked(Auto-rejected)_64x64.png differ
diff --git a/lib/images/phoneug_images/C01-4_icon_dialed.png b/lib/images/phoneug_images/C01-4_icon_dialed.png
new file mode 100644 (file)
index 0000000..42de25c
Binary files /dev/null and b/lib/images/phoneug_images/C01-4_icon_dialed.png differ
diff --git a/lib/images/phoneug_images/C01-4_icon_missed-call.png b/lib/images/phoneug_images/C01-4_icon_missed-call.png
new file mode 100644 (file)
index 0000000..e55863e
Binary files /dev/null and b/lib/images/phoneug_images/C01-4_icon_missed-call.png differ
diff --git a/lib/images/phoneug_images/C01-4_icon_received.png b/lib/images/phoneug_images/C01-4_icon_received.png
new file mode 100644 (file)
index 0000000..08643a9
Binary files /dev/null and b/lib/images/phoneug_images/C01-4_icon_received.png differ
diff --git a/lib/images/phoneug_images/C01-4_icon_rejected.png b/lib/images/phoneug_images/C01-4_icon_rejected.png
new file mode 100644 (file)
index 0000000..340e373
Binary files /dev/null and b/lib/images/phoneug_images/C01-4_icon_rejected.png differ
diff --git a/lib/images/phoneug_images/C01-4_icon_vt-call.png b/lib/images/phoneug_images/C01-4_icon_vt-call.png
new file mode 100644 (file)
index 0000000..2e9f301
Binary files /dev/null and b/lib/images/phoneug_images/C01-4_icon_vt-call.png differ
diff --git a/lib/images/phoneug_images/caller_ID_default_70x70_man.png b/lib/images/phoneug_images/caller_ID_default_70x70_man.png
new file mode 100755 (executable)
index 0000000..10a4d5b
Binary files /dev/null and b/lib/images/phoneug_images/caller_ID_default_70x70_man.png differ
diff --git a/lib/include/phone-common.h b/lib/include/phone-common.h
new file mode 100755 (executable)
index 0000000..0523652
--- /dev/null
@@ -0,0 +1,185 @@
+/*
+ * 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 __PHONE_COMMON_H__
+#define __PHONE_COMMON_H__
+
+#include <time.h>
+#include <contacts-svc.h>
+
+#include "phone-ug.h"
+#include "phone-path.h"
+#include "phone-text.h"
+
+#define PH_TIMECHECK
+#ifdef PH_TIMECHECK
+double ph_correction, ph_startT;
+double ph_set_start_time(void);
+double ph_exec_time(double start);
+int ph_init_time(void);
+#define PH_TIME_CHECK \
+       DBG("time = %f ms\n", ph_set_start_time());
+#define PH_START_TIME_CHECK \
+       ph_init_time();\
+ph_startT = ph_set_start_time();
+#define PH_END_TIME_CHECK \
+       DBG("time = %f ms\n", ph_exec_time(ph_startT));
+#else //PH_TIMECHECK
+#define PH_START_TIME_CHECK
+#define PH_END_TIME_CHECK
+#endif //PH_TIMECHECK
+
+#if !defined(LOCALEDIR)
+#  define LOCALEDIR "/opt/ug/res/locale"
+#endif
+
+#ifndef STRLEN
+#define STRLEN(str) (((str) == NULL) ? 0: strlen(str))
+#endif
+
+#define PH_TEXT_MAX_LEN 1024
+#define PH_TEXT_SHORT_LEN 256
+
+#define VOICECALL_PKG "org.tizen.call"
+#define VIDEOCALL_PKG "org.tizen.vtmain"
+
+typedef enum{
+       LOG_TYPE_VIDEO_CALL = 0,
+       LOG_TYPE_MAX
+} Log_Type;
+
+typedef enum{
+       LOG_ACTION_DIALLED = 0,
+       LOG_ACTION_MISSED,
+       LOG_ACTION_RECEIVED,
+       LOG_ACTION_REJECTED,
+       LOG_ACTION_BLOCKED,
+       LOG_ACTION_MAX
+} Log_Action;
+
+enum
+{
+       PH_SUBSCRIBE_CONTACT_CHANGE = (1 << 0),
+       PH_SUBSCRIBE_FAVORITE_CHANGE = (1 << 1),
+       PH_SUBSCRIBE_PLOG_CHANGE = (1 << 2),
+};
+
+// for removing build warning ////////////////////////////////////
+////////////////////////////////////////////////////////
+
+typedef void* PTHREAD_FN;
+
+typedef struct {
+       int cnt;
+       int cnt_checked_total;
+       bool alive;
+       bool completed;
+       pthread_t thread;
+       Ecore_Timer *timer;
+       Evas_Object *layout;
+       Evas_Object *progressbar;
+} ph_progress_info;
+
+typedef struct
+{
+       char *plog_display;
+       char *plog_img_path;
+       char *plog_number;
+
+       int id;
+       int plog_ct_id;
+       int plog_num_type;
+       int plog_log_time;
+       int plog_log_type;
+       int plog_duration;
+
+       Eina_Bool checked;//for check genlist
+       int group_index;//it's used as group index value.
+} ph_log_info;
+
+typedef struct
+{
+       int id;
+       char *img_path;
+       char *display;
+       char *number;
+       char *normal_name;
+}ph_contact_d;
+
+typedef struct
+{
+       int id;
+       int contact_id;
+       char *display;
+       char *img_path;
+       char *number;
+       bool img_loaded;
+       bool number_loaded;
+       Eina_Bool is_checked;
+       Elm_Object_Item *item;
+}ph_favor_info;
+
+enum PH_VIEW_TYPE {
+       PH_VIEW_NONE = -1,
+       PH_VIEW_DIALER = 0,
+       PH_VIEW_CONTACT,
+       PH_VIEW_LOG,
+       PH_VIEW_FAVORITE,
+       PH_VIEW_MAX,
+};
+
+struct ug_priv_data
+{
+       void (*result_cb)(void*, void*);
+       void (*destroy_cb)(void*);
+       void *cb_param;
+};
+
+// for removing build warning ////////////////////////////////////
+char* contacts_svc_value_steal_str(CTSvalue* value, int field);
+////////////////////////////////////////////////////////
+
+char *phone_get_display_name_from_value(CTSvalue *name, int display_field, int first_field, int last_field);
+void phone_free_contacts(Eina_List *list);
+
+void* phone_launch_msg_composer_ug(void *parent_ug, char *data, void(*destroy_cb)(void*), void *cb_param);
+void* phone_launch_contact_list_ug(void *parent_ug, int request, void(*result_cb)(void*, void*), void(*destroy_cb)(void*), void *cb_param);
+void* phone_launch_contact_detail_ug(void *parent_ug, int contact_index, void(*destroy_cb)(void*), void *cb_param);
+void* phone_launch_contact_add_list_edit_ug(void *parent_ug, char *data, void(*destroy_cb)(void*), void *cb_param);
+
+void phone_launch_voice_call(char *number, int ct_id);
+
+Evas_Object* phone_create_layout(Evas_Object *parent, bool is_fullview);
+Evas_Object *phone_create_popup(Evas_Object *parent, const char *desc, double timeout);
+Evas_Object* phone_create_confirm_popup(Evas_Object *win, const char* description);
+Evas_Object* phone_create_bg(Evas_Object *parent);
+Evas_Object *phone_create_icon_with_img(Evas_Object *parent, char *full_path);
+Evas_Object* phone_progressbar_popup(Evas_Object *parent, ph_progress_info *p_info, const char *title);
+Evas_Object *phone_get_notify(Evas_Object *parent);
+void phone_show_notify(Evas_Object *parent, const char *msg, double timeout);
+void phone_hide_notify(Evas_Object *parent);
+void phone_progress_popup_del(void *data, Evas_Object *obj, void *event_info);
+void phone_view_back_btn_cb(void *data, Evas_Object *obj, void *event_info);
+void phone_ug_destroy_me_cb(void *data, Evas_Object *obj, void *event_info);
+void phone_back_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info);
+void phone_cbar_item_clear(Evas_Object *toolbar);
+Evas_Object* phone_naviframe_btn(Evas_Object *parent, const char *label);
+Evas_Object* phone_create_nocontents(Evas_Object *parent, const char* label);
+Evas_Object* phone_create_popup_button(Evas_Object *popup, int index, const char* label, Evas_Smart_Cb cb, void *cb_data);
+void phone_toolbar_disalbed_item_append(Evas_Object *toolbar, int cnt);
+
+#endif //__PHONE_COMMON_H__
+
diff --git a/lib/include/phone-dialer.h b/lib/include/phone-dialer.h
new file mode 100755 (executable)
index 0000000..17c7571
--- /dev/null
@@ -0,0 +1,82 @@
+/*
+ * 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 __PHONE_DIALER_H__
+#define __PHONE_DIALER_H__
+
+#include "phone-common.h"
+
+#define MAX_DIAL_NUMBER_FONT_SIZE              98
+#define MIN_DIAL_NUMBER_FONT_SIZE              67
+
+#define CURSOR_BEGIN    -1
+#define CURSOR_END      -2
+
+enum PH_DAILER_TYPES {
+       PH_DAILER_NORMAL = 0,
+       PH_DAILER_DURING_CALL,
+       PH_DAILER_EMERGENCY
+};
+
+typedef enum {
+       DASH_REAL = 0,
+       DASH_PREVIEW
+} DashMode;
+
+typedef enum {
+       MODE_P = 0,
+       MODE_ABC,
+       MODE_123
+} ButtonFunctionMode;
+
+typedef struct _InputNumber {
+       char num;
+
+       struct _InputNumber *prev;
+       struct _InputNumber *next;
+} InputNumber;
+
+typedef struct {
+       Evas_Object *win;
+       Evas_Object *layout;
+       Evas_Object *entry;
+       Evas_Object *navi;
+       Evas_Object *popup;
+       Ecore_Timer *dash_timer;
+       Ecore_Timer *longpress_timer;
+       Ecore_Job *job;
+       char *init_text;
+       char *longpress_source;
+       InputNumber number_head;
+       InputNumber *number_cursor;
+       int entry_font_size;
+       int run_mode;
+       bool is_emergency;
+       bool cursor_changed;
+       bool has_focus;
+       bool initialized;
+       void *ug;
+       Elm_Theme *th;
+}ph_dialer_data;
+
+Evas_Object* phone_create_dialer_view(void *ug, Evas_Object *win, Evas_Object *parent);
+void phone_dialer_set_navi(Evas_Object *layout);
+void phone_dialer_check_focus(Evas_Object *base);
+void phone_dialer_view_reset(Evas_Object *base);
+void phone_dialer_view_resume(Evas_Object *base);
+void phone_dialer_view_set_num(Evas_Object *layout, char *number);
+
+#endif   /* __PHONE_DIALER_H__ */
diff --git a/lib/include/phone-log.h b/lib/include/phone-log.h
new file mode 100755 (executable)
index 0000000..f5b794b
--- /dev/null
@@ -0,0 +1,81 @@
+/*
+ * 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 __PHONE_LOG_H__
+#define __PHONE_LOG_H__
+
+#include <unicode/udat.h>
+
+#include "phone-common.h"
+
+enum {
+       LOG_VIEW_TYPE_NORMAL = 0,
+       LOG_VIEW_TYPE_NORMAL_CHECK,
+       LOG_VIEW_TYPE_VOICE_CALL,
+       LOG_VIEW_TYPE_CHECK,
+       LOG_VIEW_TYPE_SELECT,
+};
+
+enum{
+       LOG_FORMAT_TIME_12 = 0,
+       LOG_FORMAT_TIME_24,
+       LOG_FORMAT_DATE,
+       LOG_FORMAT_DATE_TIME_12,
+       LOG_FORMAT_DATE_TIME_24,
+       LOG_FORMAT_MAX,
+};
+
+typedef struct
+{
+       Evas_Object *win;
+       Evas_Object *box;
+       Evas_Object *navi;
+       Evas_Object *cbar;
+       Evas_Object *genlist;
+       Evas_Object *popup;
+       Elm_Object_Item *navi_item;
+       Elm_Object_Item *ctrl_item;
+       Eina_List *log_list;
+       int view_type;
+       int log_list_count;
+       int pre_date_type;//for index
+       int readed_n;
+       int heynoti_fd;
+       Ecore_Idler *list_idler;
+       Elm_Object_Item *git;
+       Ecore_Timer *timer;
+       void *ug;
+       void *child_ug;
+       UDateFormat *formatter[LOG_FORMAT_MAX];
+       bool is_background;
+       Ecore_Timer *update_timer;
+
+       /* edit mode */
+       Eina_Bool select_all_checked;
+       int cnt_checked;
+       ph_progress_info *p_info;
+       Evas_Object *select_all_check;
+}ph_log_data;
+
+
+Evas_Object *phone_create_log_view(void *ug, Evas_Object *win, Evas_Object *parent);
+void phone_log_views_update(Evas_Object *navi);
+void phone_log_missed_info_update(void *navi);
+void phone_log_view_reset(Evas_Object *layout);
+void phone_log_set_navi(Evas_Object *layout);
+void phone_log_set_background(Evas_Object *obj, bool is_background);
+
+#endif //__PHONE_LOG_H__
diff --git a/lib/include/phone-path.h b/lib/include/phone-path.h
new file mode 100755 (executable)
index 0000000..636ae3c
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * 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 __PHONE_PATH_H__
+#define __PHONE_PATH_H__
+
+#if !defined(IMGDIR)
+#  define IMGDIR "/opt/ug/res/images/ug-"PACKAGE
+#endif
+
+#if !defined(EDJDIR)
+#  define EDJDIR "/opt/ug/res/edje/ug-"PACKAGE
+#endif
+
+#if !defined(UGDATAIDR)
+#  define UGDATAIDR "/opt/data/ug-contacts"
+#endif
+
+#define PROGRESS_EDJ EDJDIR"/progress.edj"
+#define DIALER_EDJ EDJDIR"/dialer.edj"
+
+#define IMG_DEFAULT                    IMGDIR"/caller_ID_default_70x70_man.png"
+#define IMG_BLOCKED_64x64_ICON IMGDIR"/C01-4_icon_Blocked(Auto-rejected)_64x64.png"
+
+#define IMG_DIALER_ICON IMGDIR"/01_controlbar_icon_dialer.png"
+#define IMG_CONTACTS_ICON IMGDIR"/01_controlbar_icon_contacts.png"
+#define IMG_LOGS_ICON IMGDIR"/01_controlbar_icon_logs.png"
+#define IMG_FAVORITE_ICON IMGDIR"/01_controlbar_icon_favorite.png"
+#define IMG_DELETE_ICON IMGDIR"/01_controlbar_icon_delete.png"
+#define IMG_DONE_ICON IMGDIR"/01_controlbar_icon_save.png"
+#define IMG_EDIT_ICON IMGDIR"/01_controlbar_icon_edit.png"
+#define IMG_ADD_ICON IMGDIR"/01_controlbar_icon_create.png"
+
+#endif //__PHONE_PATH_H__
+
diff --git a/lib/include/phone-text.h b/lib/include/phone-text.h
new file mode 100755 (executable)
index 0000000..fcf16e1
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+ * 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 __PHONE_TEXT_H__
+#define __PHONE_TEXT_H__
+
+#include <libintl.h>
+
+enum {
+       PHTEXT_DIALER,
+       PHTEXT_FAVORITES,
+       PHTEXT_VOICE_MAIL,
+       PHTEXT_LOGS,
+       PHTEXT_REQUEST_FAIL,
+       PHTEXT_REQUEST_SUCCESS,
+       PHTEXT_EMERGENCY_CALL,
+       PHTEXT_NO_LOGS,
+       PHTEXT_NO_FAVORITES,
+       PHTEXT_EXCEED_NUM_MAX_LENGTH,
+       PHTEXT_DELETING_LOGS,
+       PHTEXT_DELETING_FAVORITES,
+       PHTEXT_INITIALIZING,
+};
+
+enum {
+       PHTEXT_SELECT_LOGS,
+       PHTEXT_CHANGE_CONTACT,
+};
+
+enum {
+       PH_GET_TEXT_BASIC,
+       PH_GET_TEXT_BASE_OP,
+};
+const char* phone_get_text(int op, int type);
+#define T_(op, type) phone_get_text(op, type)
+
+enum {
+       PH_SYS_SK_OK,
+       PH_SYS_SK_EDIT,
+       PH_SYS_SK_DELETE,
+       PH_SYS_SK_CANCEL,
+       PH_SYS_BODY_CALL,
+       PH_SYS_BODY_MESSAGE,
+       PH_SYS_BODY_UNKNOWN,
+       PH_SYS_BODY_SELECT_ALL,
+       PH_SYS_BODY_CONTACTS,
+       PH_SYS_BODY_DETAILS,
+       PH_SYS_BODY_REMOVE,
+       PH_SYS_POP_FAIL,
+       PH_SYS_POP_FAILED,
+       PH_SYS_POP_CLOSE,
+       PH_SYS_POP_REMOVED,
+       PH_SYS_POP_DELETED,
+       PH_SYS_POP_INCORRECT_PASSWORD,
+       PH_SYS_POP_ALREDY_EXISTS,
+       PH_SYS_POP_SELECTED,
+       PH_SYS_OPT_ADD_TO_CONTACTS,
+       PH_SYS_BODY_TODAY,
+       PH_SYS_BODY_YESTERDAY,
+       PH_SYS_BODY_PREVIOUS,
+       PH_SYS_BODY_NONAME,
+};
+
+const char* phone_get_system_string(int type);
+#define S_(text) phone_get_system_string(text)
+
+#endif //__PHONE_TEXT_H__
diff --git a/lib/include/phone-ui.h b/lib/include/phone-ui.h
new file mode 100755 (executable)
index 0000000..6f36a3c
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * 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 __PHONE_UI_H__
+#define __PHONE_UI_H__
+
+#include "phone-common.h"
+
+#define PH_START_VIEW "db/phone/last_position"
+
+enum {
+       PH_FAVOR_MODE_DEFAULT,
+       PH_FAVOR_MODE_EDIT,
+};
+
+typedef struct
+{
+       Evas_Object *win;
+       Evas_Object *layout;
+       Evas_Object *navi;
+       Evas_Object *tabbar;
+       Evas_Object *sub_view[4];
+       struct ui_gadget *contact_ug;
+       Elm_Object_Item *item[4];
+       void *ug;
+       int select_tab;
+       Ecore_Idler *idler;
+       Ecore_Timer *timer;
+}ph_phoneui_data;
+
+ph_phoneui_data* phone_create_phoneui(Evas_Object *win);
+Eina_Bool phone_front_view_load_timer(void *data);
+void phone_front_view_show_sub_view(ph_phoneui_data *phoneui_d, int type);
+void phone_front_view_reset(ph_phoneui_data *phoneui_d, int tab_index, char *val);
+void phone_front_view_region_changed(ph_phoneui_data *phoneui_d);
+void phone_front_view_resume(ph_phoneui_data *phoneui_d);
+void phone_front_view_pause(ph_phoneui_data *phoneui_d);
+int phone_front_view_show_call_app(ph_phoneui_data *phoneui_d);
+
+Evas_Object* phone_create_favorite_view(void *ug, Evas_Object *win, Evas_Object *navi);
+void phone_favor_set_navi(Evas_Object *base, int mode);
+void phone_favor_view_reset(Evas_Object *base);
+
+#endif /* __PHONE_UI_H__ */
+
diff --git a/lib/log/CMakeLists.txt b/lib/log/CMakeLists.txt
new file mode 100755 (executable)
index 0000000..202901f
--- /dev/null
@@ -0,0 +1,20 @@
+LINK_DIRECTORIES(${CMAKE_BINARY_DIR})
+
+SET(TARGET ${PHONELOG})
+
+FILE(GLOB SRCS *.c)
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(log_pkgs REQUIRED notification icu-i18n heynoti)
+
+FOREACH(flag ${log_pkgs_CFLAGS})
+       SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
+ADD_LIBRARY(${TARGET} SHARED ${SRCS})
+SET_TARGET_PROPERTIES(${TARGET} PROPERTIES VERSION ${VERSION})
+SET_TARGET_PROPERTIES(${TARGET} PROPERTIES COMPILE_FLAGS ${EXTRA_CFLAGS})
+TARGET_LINK_LIBRARIES(${TARGET} ${COMMON_LIB} ${ug_pkgs_LDFLAGS} ${log_pkgs_LDFLAGS})
+
+ADD_DEPENDENCIES(${TARGET} progress_edj_build)
+INSTALL(TARGETS ${TARGET} DESTINATION ${UGLIBDIR})
diff --git a/lib/log/ph-log-check-view.c b/lib/log/ph-log-check-view.c
new file mode 100755 (executable)
index 0000000..f1ab546
--- /dev/null
@@ -0,0 +1,362 @@
+/*
+ * 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 <bundle.h>
+#include <ui-gadget-module.h>
+
+#include "phone.h"
+#include "phone-log.h"
+#include "ph-log-utils.h"
+#include "ph-log-main-view.h"
+
+void ph_log_check_update_button_status(ph_log_data *log_d)
+{
+       Eina_Bool disabled;
+
+       if (0 == log_d->log_list_count)
+               disabled = EINA_TRUE;
+       else if (log_d->genlist && elm_genlist_decorate_mode_get(log_d->genlist)) {
+               if (0 < log_d->cnt_checked)
+                       disabled = EINA_FALSE;
+               else
+                       disabled = EINA_TRUE;
+       }
+       else
+               disabled = EINA_FALSE;
+
+       elm_object_item_disabled_set(log_d->ctrl_item, disabled);
+}
+
+void ph_log_check_update_selection_info(ph_log_data *log_d)
+{
+       if (log_d->cnt_checked == 0) {
+               Evas_Object *notify = phone_get_notify(log_d->navi);
+               if (notify)
+                       evas_object_hide(notify);
+       }
+       else {
+               char info_text[PH_TEXT_SHORT_LEN]={0};
+               snprintf(info_text, sizeof(info_text), "%s (%d)", S_(PH_SYS_POP_SELECTED),
+                               log_d->cnt_checked);
+               phone_show_notify(log_d->navi, info_text, 0.0);
+       }
+}
+
+static void log_check_select_all(ph_log_data *log_d)
+{
+       Eina_List *l;
+       ph_log_info *l_info;
+
+       if (log_d->select_all_checked)
+               log_d->cnt_checked = log_d->log_list_count;
+       else
+               log_d->cnt_checked = 0;
+
+       EINA_LIST_FOREACH(log_d->log_list, l, l_info) {
+               if (!l_info) continue;
+               l_info->checked = log_d->select_all_checked;
+       }
+       elm_genlist_realized_items_update(log_d->genlist);
+
+       ph_log_check_update_selection_info(log_d);
+       ph_log_check_update_button_status(log_d);
+}
+
+
+static void log_check_select_all_changed_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       log_check_select_all(data);
+}
+
+static void log_check_select_all_mouse_up_cb(void *data, Evas *e,
+               Evas_Object *obj, void *event_info)
+{
+       int x, y, w, h;
+       ph_log_data *log_d = data;
+       Evas_Event_Mouse_Up *ev = event_info;
+
+       if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
+               return;
+
+       evas_object_geometry_get(obj, &x, &y, &w, &h);
+       if (ev->output.y < y || y + h < ev->output.y)
+               return;
+
+       elm_check_state_set(log_d->select_all_check, !log_d->select_all_checked);
+       log_check_select_all(log_d);
+}
+
+void ph_log_check_mode_start(ph_log_data *log_d)
+{
+       Evas_Object *layout;
+
+       if (0 < log_d->log_list_count) {
+               layout = elm_layout_add(log_d->box);
+               p_retm_if(NULL == layout, "elm_layout_add() return NULL");
+               elm_layout_theme_set(layout, "genlist", "item", "select_all/default");
+               evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, 0.0);
+               evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
+               evas_object_data_set(log_d->box, "select_all_layout", layout);
+
+               log_d->select_all_check = elm_check_add(layout);
+               p_retm_if(NULL == log_d->select_all_check, "elm_check_add() return NULL");
+               elm_check_state_pointer_set(log_d->select_all_check, &log_d->select_all_checked);
+               evas_object_propagate_events_set(log_d->select_all_check, EINA_FALSE);
+               elm_object_part_content_set(layout, "elm.icon", log_d->select_all_check);
+
+               evas_object_event_callback_add(layout, EVAS_CALLBACK_MOUSE_UP,
+                               log_check_select_all_mouse_up_cb, log_d);
+
+               evas_object_smart_callback_add(log_d->select_all_check, "changed",
+                               log_check_select_all_changed_cb, log_d);
+
+               elm_object_part_text_set(layout, "elm.text", S_(PH_SYS_BODY_SELECT_ALL));
+               evas_object_show(layout);
+               elm_box_pack_start(log_d->box, layout);
+       }
+
+       if (LOG_VIEW_TYPE_NORMAL == log_d->view_type)
+               log_d->view_type = LOG_VIEW_TYPE_NORMAL_CHECK;
+
+       elm_genlist_decorate_mode_set(log_d->genlist, EINA_TRUE);
+       phone_log_set_navi(log_d->navi);
+}
+
+void ph_log_check_mode_end(ph_log_data *log_d, bool redraw)
+{
+       Evas_Object *layout;
+       Evas_Object *back_btn;
+
+       layout = evas_object_data_get(log_d->box, "select_all_layout");
+       elm_box_unpack(log_d->box, layout);
+       evas_object_del(layout);
+       evas_object_data_del(log_d->box, "select_all_layout");
+
+       if (log_d->cnt_checked) {
+               log_d->select_all_checked = EINA_FALSE;
+               log_check_select_all(log_d);
+               log_d->select_all_check= NULL;
+       }
+       if (LOG_VIEW_TYPE_NORMAL_CHECK == log_d->view_type) {
+               log_d->view_type = LOG_VIEW_TYPE_NORMAL;
+               if (log_d->timer)
+                       ecore_timer_del(log_d->timer);
+               log_d->timer = ecore_timer_add(1.0, ph_log_missed_call_count_reset, (void*)log_d);
+       }
+       elm_genlist_decorate_mode_set(log_d->genlist, EINA_FALSE);
+
+       back_btn = elm_button_add(log_d->navi);
+       elm_object_item_part_content_set(log_d->navi_item, "prev_btn", back_btn);
+
+       evas_object_smart_callback_add(back_btn, "clicked", phone_back_btn_clicked_cb, log_d->win);
+       elm_object_style_set(back_btn, "naviframe/end_btn/default");
+
+       if (redraw)
+               phone_log_set_navi(log_d->navi);
+}
+
+void ph_log_check_update_select_all(ph_log_data *log_d)
+{
+       if (log_d->log_list_count == log_d->cnt_checked)
+               log_d->select_all_checked = EINA_TRUE;
+       else
+               log_d->select_all_checked = EINA_FALSE;
+
+       elm_check_state_set(log_d->select_all_check, log_d->select_all_checked);
+}
+
+void ph_log_check_done_btn_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       int i = 0;
+       int *result_list;
+       gchar *encoded_str;
+       bundle *bd;
+       Eina_List *l;
+       ph_log_info *l_info;
+       ph_log_data *log_d = data;
+
+       result_list = calloc(log_d->cnt_checked, sizeof(int));
+       EINA_LIST_FOREACH(log_d->log_list, l, l_info) {
+               if (!l_info) continue;
+               if (l_info->checked)
+                       result_list[i++] = l_info->id;
+       }
+
+       bd = bundle_create();
+       if (result_list) {
+               encoded_str = g_base64_encode((guchar *)result_list, log_d->cnt_checked*sizeof(int));
+               bundle_add(bd, PH_UG_BUNDLE_RESULT_PLOG_ID_LIST, encoded_str);
+               g_free(encoded_str);
+       }
+
+       ug_send_result(log_d->ug, bd);
+       bundle_free(bd);
+       free(result_list);
+       ug_destroy_me(log_d->ug);
+}
+
+static PTHREAD_FN log_check_del(void *data)
+{
+       ph_log_data *log_d = data;
+       ph_progress_info *p_info = log_d->p_info;
+       Eina_List *l;
+       ph_log_info *l_info;
+
+       EINA_LIST_FOREACH(log_d->log_list, l, l_info) {
+               if (!p_info->alive) {
+                       p_info->completed = true;
+                       break;
+               }
+               if (!l_info) continue;
+
+               if (TRUE == l_info->checked) {
+                       if (CTS_SUCCESS != ph_log_util_del_log_by_number(l_info->plog_number)) {
+                               p_info->completed = true;
+                               break;
+                       }
+                       p_info->cnt++;
+               }
+               if (p_info->cnt == p_info->cnt_checked_total)
+                       break;
+       }
+
+       pthread_exit(NULL);
+}
+
+
+static Eina_Bool log_check_del_timer(void *data)
+{
+       ph_log_data *log_d = data;
+       ph_progress_info *p_info = log_d->p_info;
+
+       p_retvm_if(NULL == p_info, ECORE_CALLBACK_CANCEL, "parameter(ph_progress_info) is NULL");
+
+       if (!p_info->completed) {
+               char count[PH_TEXT_SHORT_LEN];
+               char percent[5];
+               double value = (double)p_info->cnt / (double)p_info->cnt_checked_total;
+
+               elm_progressbar_value_set(p_info->progressbar, value);
+               snprintf(percent, sizeof(percent), "%d%%", (int)(100.0 * (double)p_info->cnt/(double)p_info->cnt_checked_total));
+               snprintf(count, sizeof(count), "%d/%d", p_info->cnt, p_info->cnt_checked_total);
+               edje_object_part_text_set(elm_layout_edje_get(p_info->layout), "elm.text.subtext1", percent);
+               edje_object_part_text_set(elm_layout_edje_get(p_info->layout), "elm.text.subtext2", count);
+
+               if (p_info->cnt == p_info->cnt_checked_total)
+                       p_info->completed = true;
+
+               return ECORE_CALLBACK_RENEW;
+       }
+       else {
+               int ret;
+               const char *message;
+
+               pthread_join(p_info->thread, NULL);
+
+               if (p_info->cnt == p_info->cnt_checked_total) {
+                       message = S_(PH_SYS_POP_DELETED);
+                       ret = contacts_svc_end_trans(true);
+               }
+               else {
+                       message = S_(PH_SYS_POP_FAILED);
+                       ret = contacts_svc_end_trans(false);
+               }
+
+               if (ret < CTS_SUCCESS) {
+                       ERR("contacts_svc_end_trans() Failed(%d)", ret);
+                       message = S_(PH_SYS_POP_FAILED);
+               }
+
+               evas_object_del(log_d->popup);
+               log_d->popup = NULL;
+
+               if (NULL != p_info) {
+                       free(p_info);
+                       log_d->p_info = NULL;
+               }
+
+               ph_log_check_mode_end(log_d, true);
+               phone_show_notify(log_d->navi, message, 2.0);
+
+               return ECORE_CALLBACK_CANCEL;
+       }
+}
+
+void ph_log_check_del_btn_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       PH_FN_CALL;
+       int ret;
+       ph_log_data *log_d = data;
+       ph_progress_info *p_info;
+
+       p_info = calloc(1, sizeof(ph_progress_info));
+       p_retm_if(NULL == p_info, "calloc return NULL");
+
+       log_d->p_info = p_info;
+       p_info->cnt_checked_total = log_d->cnt_checked;
+       p_info->alive = true;
+
+       ret = contacts_svc_begin_trans();
+       if (CTS_SUCCESS != ret) {
+               ERR("contacts_svc_begin_trans() Failed(%d)", ret);
+               free(p_info);
+               log_d->p_info = NULL;
+               return;
+       }
+
+       ret = pthread_create(&p_info->thread, NULL, log_check_del, log_d);
+       if (0 != ret) {
+               ERR("Thread creation failed(%d)", ret);
+               free(p_info);
+               log_d->p_info = NULL;
+
+               ret = contacts_svc_end_trans(false);
+               p_warn_if(ret < CTS_SUCCESS, "contacts_svc_end_trans(%d) Failed", ret);
+               return;
+       }
+
+       p_info->timer = ecore_timer_add(0.2, log_check_del_timer, log_d);
+       if (NULL == p_info->timer) {
+               ERR("ecore_timer_add() return NULL");
+
+               p_info->alive = false;
+               pthread_join(p_info->thread, NULL);
+               free(p_info);
+               log_d->p_info = NULL;
+
+               ret = contacts_svc_end_trans(false);
+               p_warn_if(ret < CTS_SUCCESS, "contacts_svc_end_trans(%d) Failed", ret);
+               return;
+       }
+
+       log_d->popup = phone_progressbar_popup(log_d->win, p_info, T_(PH_GET_TEXT_BASIC, PHTEXT_DELETING_LOGS));
+       phone_create_popup_button(log_d->popup, 1, S_(PH_SYS_SK_CANCEL), phone_progress_popup_del, p_info);
+}
+
+
+void ph_log_check_check_changed_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       ph_log_data *log_d = data;
+
+       if (elm_check_state_get(obj))
+               log_d->cnt_checked++;
+       else
+               log_d->cnt_checked--;
+
+       ph_log_check_update_select_all(log_d);
+       ph_log_check_update_selection_info(log_d);
+       ph_log_check_update_button_status(log_d);
+}
diff --git a/lib/log/ph-log-check-view.h b/lib/log/ph-log-check-view.h
new file mode 100755 (executable)
index 0000000..eb24bfc
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * 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 __PH_LOG_CHECK_VIEW_H_
+#define __PH_LOG_CHECK_VIEW_H_
+
+void ph_log_check_mode_start(ph_log_data *log_d);
+void ph_log_check_mode_end(ph_log_data *log_d, bool redraw);
+void ph_log_check_update_select_all(ph_log_data *log_d);
+void ph_log_check_update_selection_info(ph_log_data *log_d);
+void ph_log_check_update_button_status(ph_log_data *log_d);
+void ph_log_check_done_btn_cb(void *data, Evas_Object *obj, void *event_info);
+void ph_log_check_del_btn_cb(void *data, Evas_Object *obj, void *event_info);
+void ph_log_check_check_changed_cb(void *data, Evas_Object *obj, void *event_info);
+
+#endif /* __PH_LOG_CHECK_VIEW_H_ */
diff --git a/lib/log/ph-log-detail-view.c b/lib/log/ph-log-detail-view.c
new file mode 100755 (executable)
index 0000000..379bd27
--- /dev/null
@@ -0,0 +1,647 @@
+/*
+ * 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 <ui-gadget-module.h>
+
+#include "phone.h"
+#include "phone-log.h"
+#include "ph-log-utils.h"
+#include "ph-log-detail-view.h"
+
+#define KEY_LOG_DETAIL_DATA    "logdetail_d"
+
+enum LOG_DETAIL_ITC_TYPE {
+       LOG_DETAIL_ITC_TOP_INFO = 0,
+       LOG_DETAIL_ITC_TOP_BTNS,
+       LOG_DETAIL_ITC_DETAIL,
+       LOG_DETAIL_ITC_BOTTOM_BTN,
+       LOG_DETAIL_ITC_MAX,
+};
+
+static Elm_Genlist_Item_Class log_detail_itcs[LOG_DETAIL_ITC_MAX] = {
+       {.item_style="dialogue/bg/2text.2icon"},
+       {.item_style="dialogue/bg/2icon"},
+       {.item_style="2text.2icon"},
+       {.item_style="dialogue/bg/1icon"},
+};
+
+typedef struct
+{
+       int plog_id;
+       int plog_type;
+       int plog_time;
+       int plog_duration;
+}ph_log_detail_info;
+
+static void log_detail_destroy_child_ug(void *data)
+{
+       ph_log_detail_data *logdetail_d = data;
+       logdetail_d->child_ug = NULL;
+}
+
+static void log_detail_msg_btn_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       ph_log_detail_data *logdetail_d = data;
+       logdetail_d->child_ug = phone_launch_msg_composer_ug(logdetail_d->ug, logdetail_d->log_number,
+                       log_detail_destroy_child_ug, logdetail_d);
+}
+
+static void log_detail_call_btn_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       ph_log_detail_data *logdetail_d = data;
+       phone_launch_voice_call(logdetail_d->log_number, logdetail_d->contact_id);
+}
+
+static int log_detail_is_msg_type(int type)
+{
+       switch (type) {
+       case CTS_PLOG_TYPE_SMS_INCOMMING:
+       case CTS_PLOG_TYPE_SMS_OUTGOING:
+       case CTS_PLOG_TYPE_SMS_BLOCKED:
+       case CTS_PLOG_TYPE_MMS_INCOMMING:
+       case CTS_PLOG_TYPE_MMS_OUTGOING:
+       case CTS_PLOG_TYPE_MMS_BLOCKED:
+               return TRUE;
+       default:
+               return FALSE;
+       }
+}
+
+static void log_detail_gl_sel(void *data, Evas_Object *obj, void *event_info)
+{
+       Elm_Object_Item *gli = event_info;
+       ph_log_detail_data *logdetail_d;
+       p_retm_if(NULL == data, "Data is null");
+       logdetail_d = evas_object_data_get(obj, KEY_LOG_DETAIL_DATA);
+       elm_genlist_item_selected_set(gli, EINA_FALSE);
+}
+
+static void log_detail_append_separator(Evas_Object *genlist)
+{
+       static Elm_Genlist_Item_Class itc = { .item_style="dialogue/separator/10" };
+
+       Elm_Object_Item *item = elm_genlist_item_append(genlist, &itc, NULL, NULL,
+                       ELM_GENLIST_ITEM_NONE, NULL, NULL);
+       elm_genlist_item_select_mode_set(item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
+}
+
+static void log_detail_fill_genlist(ph_log_detail_data *logdetail_d)
+{
+       Eina_List *l;
+       ph_log_detail_info * l_detail_info;
+
+       p_retm_if(NULL == logdetail_d->genlist, "Genlist is null");
+
+       logdetail_d->top_item = elm_genlist_item_append(logdetail_d->genlist, &log_detail_itcs[LOG_DETAIL_ITC_TOP_INFO], logdetail_d,
+                       NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
+       if (logdetail_d->log_number) {
+               elm_genlist_item_append(logdetail_d->genlist, &log_detail_itcs[LOG_DETAIL_ITC_TOP_BTNS], logdetail_d,
+                               NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
+               log_detail_append_separator(logdetail_d->genlist);
+       }
+
+       EINA_LIST_FOREACH(logdetail_d->log_list, l, l_detail_info) {
+               Elm_Object_Item * it;
+               if (!l_detail_info) continue;
+               it = elm_genlist_item_append(logdetail_d->genlist, &log_detail_itcs[LOG_DETAIL_ITC_DETAIL], l_detail_info,
+                               NULL, ELM_GENLIST_ITEM_NONE, log_detail_gl_sel, l_detail_info);
+       }
+
+       if (logdetail_d->log_number) {
+               log_detail_append_separator(logdetail_d->genlist);
+               if (logdetail_d->contact_id <= 0)
+                       logdetail_d->bottom_item = elm_genlist_item_append(logdetail_d->genlist, &log_detail_itcs[LOG_DETAIL_ITC_BOTTOM_BTN], logdetail_d,
+                                       NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
+               log_detail_append_separator(logdetail_d->genlist);
+       }
+}
+
+static void log_detail_free_log_data(Eina_List *list)
+{
+       Eina_List *l;
+       ph_log_detail_info *l_detail_info;
+       p_retm_if(NULL == list, "data is null");
+
+       EINA_LIST_FOREACH(list, l, l_detail_info) {
+               if (!l_detail_info) continue;
+               free(l_detail_info);
+       }
+       eina_list_free(list);
+}
+
+static Eina_List *log_detail_load_log_data(char *req_number, int *ref_count)
+{
+       int count = 0;
+       CTSiter *iter;
+       Eina_List *list = NULL;
+
+       contacts_svc_get_list_with_str(CTS_LIST_PLOGS_OF_NUMBER, req_number, &iter);
+
+       while (CTS_SUCCESS == contacts_svc_iter_next(iter)) {
+               CTSvalue *plog = NULL;
+               int type;
+               ph_log_detail_info *l_detail_info;
+               plog = contacts_svc_iter_get_info(iter);
+               type = contacts_svc_value_get_int(plog, CTS_LIST_PLOG_LOG_TYPE_INT);
+               if (log_detail_is_msg_type(type)) {
+                       contacts_svc_value_free(plog);
+                       continue;
+               }
+               l_detail_info = calloc(1, sizeof(ph_log_detail_info));
+               l_detail_info->plog_id = contacts_svc_value_get_int(plog, CTS_LIST_PLOG_ID_INT);
+               l_detail_info->plog_type = type;
+               l_detail_info->plog_time = contacts_svc_value_get_int(plog, CTS_LIST_PLOG_LOG_TIME_INT);
+               l_detail_info->plog_duration = contacts_svc_value_get_int(plog, CTS_LIST_PLOG_DURATION_INT);
+
+               list = eina_list_append(list, (void*)l_detail_info);
+               count++;
+               contacts_svc_value_free(plog);
+       }
+       contacts_svc_iter_remove(iter);
+
+       *ref_count = count;
+       return list;
+}
+
+static void log_detail_load_list(ph_log_detail_data * logdetail_d)
+{
+       log_detail_free_log_data(logdetail_d->log_list);
+       logdetail_d->log_list_count = 0;
+       logdetail_d->log_list = log_detail_load_log_data(logdetail_d->log_number, &(logdetail_d->log_list_count));
+}
+
+static Eina_Bool log_detail_refresh_view(void *data)
+{
+       ph_log_detail_data *logdetail_d = data;
+       log_detail_load_list(logdetail_d);
+       elm_genlist_clear(logdetail_d->genlist);
+       log_detail_fill_genlist(logdetail_d);
+       logdetail_d->idler = NULL;
+       return ECORE_CALLBACK_CANCEL;
+}
+
+static void log_detail_list_changed_cb(void *data)
+{
+       ph_log_detail_data *detail_data = data;
+       if (detail_data->idler) {
+               ecore_idler_del(detail_data->idler);
+               detail_data->idler = NULL;
+       }
+       detail_data->idler = ecore_idler_add(log_detail_refresh_view, detail_data);
+}
+
+static void log_detail_get_contact_info(char *req_number, ph_log_detail_data *logdetail_d)
+{
+       int index;
+       int ret;
+       CTSstruct *contact = NULL;
+       CTSvalue *value = NULL;
+
+       p_retm_if(NULL == req_number, "Parameter is null");
+       free(logdetail_d->log_display);
+       logdetail_d->log_display = NULL;
+       free(logdetail_d->log_img_path);
+       logdetail_d->log_img_path = NULL;
+
+       index = 0;
+       if (logdetail_d->contact_id > 0) {
+               GSList *num_list, *cursor;
+               ret = contacts_svc_get_contact(logdetail_d->contact_id, &contact);
+               if (ret == CTS_SUCCESS) {
+                       contacts_svc_struct_get_list(contact, CTS_CF_NUMBER_LIST, &num_list);
+                       if (CTS_SUCCESS == ret) {
+                               for (cursor = num_list;cursor;cursor=cursor->next) {
+                                       const char *num = contacts_svc_value_get_str(cursor->data, CTS_NUM_VAL_NUMBER_STR);
+                                       if (strcmp(req_number, num) == 0) {
+                                               index = logdetail_d->contact_id;
+                                               break;
+                                       }
+                               }
+                       }
+                       contacts_svc_struct_free(contact);
+               }
+       }
+
+       if (index <= 0)
+               index = contacts_svc_find_contact_by(CTS_FIND_BY_NUMBER, req_number);
+
+       if (0 < index) {
+               ret = contacts_svc_get_contact(index, &contact);
+               if (ret < CTS_SUCCESS)
+                       ERR("contacts_svc_get_contact is failed");
+               else {
+                       ret = contacts_svc_struct_get_value(contact, CTS_CF_NAME_VALUE, &value);
+                       if (ret < CTS_SUCCESS) {
+                               ERR("contacts_svc_struct_get_value is failed");
+                               contacts_svc_struct_free(contact);
+                       }
+                       else{
+                               logdetail_d->log_display = phone_get_display_name_from_value(value, CTS_NAME_VAL_DISPLAY_STR,
+                                               CTS_NAME_VAL_FIRST_STR, CTS_NAME_VAL_LAST_STR);
+                               logdetail_d->contact_id = index;
+                               ret = contacts_svc_struct_get_value(contact, CTS_CF_BASE_INFO_VALUE, &value);
+                               if (ret < CTS_SUCCESS) {
+                                       ERR("contacts_svc_struct_get_value is failed");
+                                       contacts_svc_struct_free(contact);
+                                       return;
+                               }
+                               logdetail_d->log_img_path = contacts_svc_value_steal_str(value, CTS_BASE_VAL_IMG_PATH_STR);
+                               contacts_svc_struct_free(contact);
+                               return;
+                       }
+               }
+       }
+       logdetail_d->contact_id = 0;
+}
+
+static void log_detail_update_view_with_contact(void *data)
+{
+       ph_log_detail_data *logdetail_d = data;
+       log_detail_get_contact_info(logdetail_d->log_number, logdetail_d);
+
+       if (logdetail_d->top_item)
+               elm_genlist_item_update(logdetail_d->top_item);
+
+       if (0 < logdetail_d->contact_id && logdetail_d->bottom_item) {
+               elm_object_item_del(logdetail_d->bottom_item);
+               logdetail_d->bottom_item = NULL;
+       }
+       else if (logdetail_d->contact_id <= 0 && !logdetail_d->bottom_item)
+               logdetail_d->bottom_item = elm_genlist_item_append(logdetail_d->genlist, &log_detail_itcs[LOG_DETAIL_ITC_BOTTOM_BTN], logdetail_d,
+                                       NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
+}
+
+static void log_detail_add_contact_btn_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       ph_log_detail_data *logdetail_d = data;
+       logdetail_d->child_ug = phone_launch_contact_add_list_edit_ug(logdetail_d->ug, logdetail_d->log_number,
+                       log_detail_destroy_child_ug, logdetail_d);
+}
+
+static void log_detail_img_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       ph_log_detail_data *logdetail_d = data;
+       p_retm_if(NULL == logdetail_d, "detail data is null");
+
+       if (0 < logdetail_d->contact_id)
+               logdetail_d->child_ug = phone_launch_contact_detail_ug(logdetail_d->ug, logdetail_d->contact_id,
+                               log_detail_destroy_child_ug, logdetail_d);
+}
+
+static void log_detail_popup_hide_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       ph_log_detail_data *logdetail_d = data;
+       evas_object_del(logdetail_d->popup);
+       logdetail_d->popup = NULL;
+}
+
+static void log_detail_delete_confirm_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       int ret;
+       ph_log_detail_data *logdetail_d = data ;
+       evas_object_del(logdetail_d->popup);
+       logdetail_d->popup = NULL;
+
+       ret = ph_log_util_del_log_by_number(logdetail_d->log_number);
+       if (CTS_SUCCESS != ret)
+               phone_show_notify(logdetail_d->navi, S_(PH_SYS_POP_FAILED), 2.0);
+       else {
+               phone_show_notify(logdetail_d->navi, S_(PH_SYS_POP_DELETED), 2.0);
+               elm_naviframe_item_pop(logdetail_d->navi);
+       }
+}
+
+static void log_detail_del_btn_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       ph_log_detail_data *logdetail_d = data ;
+       char buf[PH_TEXT_MAX_LEN] = {0};
+       snprintf(buf, sizeof(buf), "%s?", S_(PH_SYS_SK_DELETE));
+       logdetail_d->popup = phone_create_confirm_popup(logdetail_d->win, buf);
+       phone_create_popup_button(logdetail_d->popup, 1, S_(PH_SYS_SK_OK), log_detail_delete_confirm_cb, logdetail_d);
+       phone_create_popup_button(logdetail_d->popup, 2, S_(PH_SYS_SK_CANCEL), log_detail_popup_hide_cb, logdetail_d);
+}
+
+static Evas_Object *log_detail_gl_top_info_icon_get(void *data, Evas_Object *obj, const char *part)
+{
+       ph_log_detail_data *logdetail_d = data;
+       if (0 == strcmp(part, "elm.icon.1")) {
+               Evas_Object *detail_img = NULL;
+               if (logdetail_d->log_img_path)
+                       detail_img = phone_create_icon_with_img(obj, logdetail_d->log_img_path);
+               else
+                       detail_img = phone_create_icon_with_img(obj, IMG_DEFAULT);
+               if (detail_img)
+                       evas_object_smart_callback_add(detail_img, "clicked", log_detail_img_clicked_cb, logdetail_d);
+               return detail_img;
+       }
+       return NULL;
+}
+
+static Evas_Object *log_detail_gl_top_btns_icon_get(void *data, Evas_Object *obj, const char *part)
+{
+       ph_log_detail_data *logdetail_d = data;
+       if (0 == strcmp(part, "elm.icon.1")) {
+               Evas_Object *btn = elm_button_add(logdetail_d->layout);
+               p_retvm_if(NULL == btn, NULL, "elm_button_add() return NULL");
+               elm_object_style_set(btn, "style2");
+               elm_object_text_set(btn, S_(PH_SYS_BODY_CALL));
+               evas_object_smart_callback_add(btn, "clicked", log_detail_call_btn_cb, logdetail_d);
+               if (!logdetail_d->log_number || !*logdetail_d->log_number)
+                       elm_object_disabled_set(btn, EINA_TRUE);
+               return btn;
+       }
+       else if (0 == strcmp(part, "elm.icon.2")) {
+               Evas_Object *btn = elm_button_add(logdetail_d->layout);
+               p_retvm_if(NULL == btn, NULL, "elm_button_add() return NULL");
+               elm_object_style_set(btn, "style2");
+               elm_object_text_set(btn, S_(PH_SYS_BODY_MESSAGE));
+               evas_object_smart_callback_add(btn, "clicked", log_detail_msg_btn_cb, logdetail_d);
+               if (!logdetail_d->log_number || !*logdetail_d->log_number)
+                       elm_object_disabled_set(btn, EINA_TRUE);
+               return btn;
+       }
+       return NULL;
+}
+
+
+static char *log_detail_gl_top_info_label_get(void *data, Evas_Object *obj, const char *part)
+{
+       ph_log_detail_data *logdetail_d = data;
+
+       if (0 == strcmp(part, "elm.text.1")) {
+               if (logdetail_d->log_display && *logdetail_d->log_display)
+                       return strdup(logdetail_d->log_display);
+               else if (logdetail_d->log_number && *logdetail_d->log_number)
+                       return strdup(logdetail_d->log_number);
+               else
+                       return strdup(S_(PH_SYS_BODY_UNKNOWN));
+       }
+       else if (0 == strcmp(part, "elm.text.2")) {
+               char buf[PATH_MAX] = {0};
+               if (!logdetail_d->log_number || !*logdetail_d->log_number)
+                       return NULL;
+
+               if (logdetail_d->log_display && *logdetail_d->log_display)
+                       snprintf(buf, sizeof(buf), "%s (%d)", logdetail_d->log_number, logdetail_d->log_list_count);
+               else
+                       snprintf(buf, sizeof(buf), "(%d)", logdetail_d->log_list_count);
+               return strdup(buf);
+       }
+       return NULL;
+}
+
+static Evas_Object *log_detail_gl_bottom_btns_icon_get(void *data, Evas_Object *obj, const char *part)
+{
+       ph_log_detail_data *logdetail_d = data;
+       Evas_Object *btn;
+
+       if (0 == strcmp(part, "elm.icon.1") || 0 == strcmp(part, "elm.icon")) {
+               if (0 < logdetail_d->contact_id)
+                       return NULL;
+
+               btn = elm_button_add(logdetail_d->layout);
+               p_retvm_if(NULL == btn, NULL, "elm_button_add() return NULL");
+               elm_object_style_set(btn, "style2");
+               elm_object_text_set(btn, S_(PH_SYS_OPT_ADD_TO_CONTACTS));
+               evas_object_smart_callback_add(btn, "clicked", log_detail_add_contact_btn_cb, logdetail_d);
+               return btn;
+       }
+       return NULL;
+}
+
+static Evas_Object *log_detail_gl_icon_get(void *data, Evas_Object *obj, const char *part)
+{
+       ph_log_detail_info * l_detail_info = data;
+       char buf[PATH_MAX]={0};
+       Evas_Object *ic;
+
+       if (0 == strcmp(part, "elm.icon.2")) {
+               char *made_data = ph_log_util_get_icon_type(l_detail_info->plog_type);
+               snprintf(buf, sizeof(buf), "%s", made_data);
+               free(made_data);
+       }
+       else if (0 == strcmp(part, "elm.icon.1")) {
+               char *made_data = ph_log_util_get_icon_path_with_action(l_detail_info->plog_type);
+               snprintf(buf, sizeof(buf), "%s", made_data);
+               free(made_data);
+       }
+       else
+               return NULL;
+       ic = elm_icon_add(obj);
+       p_retvm_if(NULL == ic, NULL, "elm_icon_add() return NULL");
+       elm_icon_file_set(ic, buf, NULL);
+       evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
+       return ic;
+}
+
+static char *log_detail_get_duration_from_number(int number)
+{
+       int sec, min, hour, day;
+       struct tm tmp={0};
+       char buf[PATH_MAX]={0};
+       char buf_t[PATH_MAX]={0};
+
+       sec = number;
+       day = sec/(60*60*24);
+       sec %= (60*60*24);
+       hour = sec/(60*60);
+       sec %= (60*60);
+       min = sec/(60);
+       sec %= (60);
+       tmp.tm_mday = day;
+       tmp.tm_hour = hour;
+       tmp.tm_min = min;
+       tmp.tm_sec = sec;
+       strftime(buf_t, sizeof(buf_t), "%H:%M:%S", &tmp);
+       snprintf(buf, sizeof(buf), "%s", buf_t);
+
+       return strdup(buf_t);
+}
+
+static int log_detail_is_call_ing_type(int type)
+{
+       switch (type) {
+       case CTS_PLOG_TYPE_VOICE_INCOMMING:
+       case CTS_PLOG_TYPE_VOICE_OUTGOING:
+       case CTS_PLOG_TYPE_VIDEO_INCOMMING:
+       case CTS_PLOG_TYPE_VIDEO_OUTGOING:
+               return TRUE;
+       default:
+               return FALSE;
+       }
+}
+
+static char* log_detail_gl_label_get(void *data, Evas_Object *obj, const char *part)
+{
+       ph_log_detail_info * l_detail_info = data;
+
+       if (0 == strcmp(part, "elm.text.1")) {
+               ph_log_detail_data *logdetail_d;
+               logdetail_d = evas_object_data_get(obj, KEY_LOG_DETAIL_DATA);
+               return ph_log_util_get_time_date(logdetail_d->log_d->formatter, l_detail_info->plog_time, l_detail_info->plog_duration, TRUE);
+       }
+       else if (0 == strcmp(part, "elm.text.2")) {
+               if (TRUE == log_detail_is_call_ing_type(l_detail_info->plog_type))
+                       return log_detail_get_duration_from_number(l_detail_info->plog_duration);
+       }
+
+       return NULL;
+}
+
+static inline void log_detail_create_itcs()
+{
+       log_detail_itcs[LOG_DETAIL_ITC_DETAIL].func.text_get = log_detail_gl_label_get;
+       log_detail_itcs[LOG_DETAIL_ITC_DETAIL].func.content_get = log_detail_gl_icon_get;
+
+       log_detail_itcs[LOG_DETAIL_ITC_TOP_INFO].func.text_get = log_detail_gl_top_info_label_get;
+       log_detail_itcs[LOG_DETAIL_ITC_TOP_INFO].func.content_get = log_detail_gl_top_info_icon_get;
+
+       log_detail_itcs[LOG_DETAIL_ITC_TOP_BTNS].func.content_get = log_detail_gl_top_btns_icon_get;
+
+       log_detail_itcs[LOG_DETAIL_ITC_BOTTOM_BTN].func.content_get = log_detail_gl_bottom_btns_icon_get;
+}
+
+static Evas_Object* log_detail_create_genlist(ph_log_detail_data *logdetail_d, Evas_Object *parent)
+{
+       Evas_Object *genlist;
+
+       genlist = elm_genlist_add(parent);
+       p_retvm_if(NULL == genlist, NULL, "elm_genlist_add() return NULL");
+       evas_object_size_hint_weight_set(genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       evas_object_size_hint_align_set(genlist, EVAS_HINT_FILL, EVAS_HINT_FILL);
+       evas_object_data_set(genlist, KEY_LOG_DETAIL_DATA, logdetail_d);
+
+       log_detail_create_itcs();
+       return genlist;
+}
+
+static void log_detail_view_delete_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+       PH_FN_CALL;
+       ph_log_detail_data *logdetail_d = data;
+
+       p_retm_if(NULL == logdetail_d, "log detail data is null");
+
+       contacts_svc_unsubscribe_change_with_data(CTS_SUBSCRIBE_PLOG_CHANGE,
+                       log_detail_list_changed_cb, logdetail_d);
+       contacts_svc_unsubscribe_change_with_data(CTS_SUBSCRIBE_CONTACT_CHANGE,
+                       log_detail_update_view_with_contact, logdetail_d);
+
+       evas_object_data_del(logdetail_d->navi, KEY_LOG_DETAIL_DATA);
+
+       elm_object_part_content_set(logdetail_d->layout, "elm.swallow.bg", NULL);
+
+       if (logdetail_d->log_list)
+               log_detail_free_log_data(logdetail_d->log_list);
+
+       if (logdetail_d->idler)
+               ecore_idler_del(logdetail_d->idler);
+
+       if (logdetail_d->popup)
+               evas_object_del(logdetail_d->popup);
+
+       if (logdetail_d->child_ug)
+               ug_destroy(logdetail_d->child_ug);
+
+       free(logdetail_d->log_display);
+       free(logdetail_d->log_number);
+       free(logdetail_d->log_img_path);
+       free(logdetail_d);
+}
+
+static void log_detail_back_btn_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       PH_FN_CALL;
+       ph_log_detail_data *logdetail_d = data;
+
+       /* TODO : remove evas_object_smart_callback_del, it will be controlled by WINSET */
+       evas_object_smart_callback_del(obj, "clicked", log_detail_back_btn_cb);
+
+       elm_naviframe_item_pop(logdetail_d->navi);
+       phone_log_missed_info_update(logdetail_d->navi);
+}
+
+Evas_Object *ph_create_log_detail_view(ph_log_data *log_d, ph_log_info *l_info)
+{
+       Evas_Object *back_btn;
+       Evas_Object *layout;
+       Evas_Object *bg;
+       Evas_Object *genlist;
+       Evas_Object *cbar;
+       Elm_Object_Item *navi_it;
+       ph_log_detail_data *logdetail_d;
+       p_retvm_if(NULL == l_info, NULL, "Log information is null");
+
+       logdetail_d = calloc(1, sizeof(ph_log_detail_data));
+       p_retvm_if(NULL == logdetail_d, NULL, "Fail to calloc ph_log_detail_data");
+       logdetail_d->ug = log_d->ug;
+       logdetail_d->win = log_d->win;
+       logdetail_d->navi = log_d->navi;
+       logdetail_d->log_d = log_d;
+
+       layout = elm_layout_add(logdetail_d->navi);
+       if (NULL == layout) {
+               ERR("elm_layout_add() return NULL");
+               free(logdetail_d);
+               return NULL;
+       }
+       elm_layout_theme_set(layout, "layout", "application", "noindicator");
+       logdetail_d->layout = layout;
+
+       genlist = log_detail_create_genlist(logdetail_d, layout);
+       if (NULL == genlist) {
+               ERR("log_detail_create_genlist() return NULL");
+               free(logdetail_d);
+               return NULL;
+       }
+       logdetail_d->genlist = genlist;
+       elm_object_part_content_set(logdetail_d->layout, "elm.swallow.content", genlist);
+
+       logdetail_d->contact_id = l_info->plog_ct_id;
+       logdetail_d->log_number = SAFE_STRDUP(l_info->plog_number);
+       if (l_info->plog_img_path)
+               logdetail_d->log_img_path = strdup(l_info->plog_img_path);
+       if (l_info->plog_display && *l_info->plog_display)
+               logdetail_d->log_display = strdup(l_info->plog_display);
+
+       log_detail_load_list(logdetail_d);
+       log_detail_fill_genlist(logdetail_d);
+
+       evas_object_event_callback_add(logdetail_d->layout, EVAS_CALLBACK_DEL,
+                       log_detail_view_delete_cb, logdetail_d);
+
+       contacts_svc_subscribe_change(CTS_SUBSCRIBE_PLOG_CHANGE, log_detail_list_changed_cb, logdetail_d);
+       contacts_svc_subscribe_change(CTS_SUBSCRIBE_CONTACT_CHANGE, log_detail_update_view_with_contact, logdetail_d);
+
+       back_btn = elm_button_add(layout);
+       evas_object_smart_callback_add(back_btn, "clicked", log_detail_back_btn_cb, logdetail_d);
+       elm_object_style_set(back_btn, "naviframe/back_btn/default");
+       navi_it = elm_naviframe_item_push(logdetail_d->navi, S_(PH_SYS_BODY_DETAILS), back_btn, NULL, layout, NULL);
+
+       cbar = elm_toolbar_add(logdetail_d->navi);
+       elm_toolbar_shrink_mode_set(cbar, ELM_TOOLBAR_SHRINK_EXPAND);
+
+       elm_toolbar_item_append(cbar, IMG_DELETE_ICON, NULL, log_detail_del_btn_cb, logdetail_d);
+       phone_toolbar_disalbed_item_append(cbar, 3);
+
+       elm_object_item_part_content_set(navi_it, "controlbar", cbar);
+       evas_object_data_set(logdetail_d->navi, KEY_LOG_DETAIL_DATA, logdetail_d);
+
+       bg = phone_create_bg(logdetail_d->layout);
+       elm_object_style_set(bg, "group_list");
+       return layout;
+}
+
diff --git a/lib/log/ph-log-detail-view.h b/lib/log/ph-log-detail-view.h
new file mode 100755 (executable)
index 0000000..85ec092
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * 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 __PH_LOG_DETAIL_VIEW_H_
+#define __PH_LOG_DETAIL_VIEW_H_
+
+typedef struct
+{
+       Evas_Object *win;
+       Evas_Object *navi;
+       Evas_Object *layout;
+       Evas_Object *genlist;
+       Evas_Object *popup;
+       Elm_Object_Item *top_item;
+       Elm_Object_Item *bottom_item;
+       char *log_display;
+       char *log_number;
+       char *log_img_path;
+       int contact_id;
+       int log_list_count;
+       Eina_List *log_list;
+       Ecore_Idler *idler;
+       void *ug;
+       void *child_ug;
+       ph_log_data *log_d;
+}ph_log_detail_data;
+
+Evas_Object *ph_create_log_detail_view(ph_log_data *log_d, ph_log_info *l_info);
+
+
+#endif /* __PH_LOG_DETAIL_VIEW_H_ */
diff --git a/lib/log/ph-log-main-view.c b/lib/log/ph-log-main-view.c
new file mode 100755 (executable)
index 0000000..c94d4c7
--- /dev/null
@@ -0,0 +1,726 @@
+/*
+ * 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 <notification.h>
+#include <ui-gadget-module.h>
+#include <heynoti.h>
+
+#include "phone.h"
+#include "phone-log.h"
+#include "ph-log-utils.h"
+#include "ph-log-main-view.h"
+#include "ph-log-detail-view.h"
+#include "ph-log-check-view.h"
+
+#define KEY_LOG_DATA   "log_data"
+
+static Elm_Genlist_Item_Class itc, itc_one, itc_date;
+
+// 0: today, 1: yesterday, 2: previous
+static int log_get_date_type(int log_time, int log_duration)
+{
+       time_t stime;
+       struct timeval timeval;
+       struct tm *tmp;
+       int yday, cur_yday;
+
+       gettimeofday(&timeval, 0);
+       tmp = localtime(&timeval.tv_sec);
+       p_retvm_if(NULL == tmp, 2, "localtime is null");
+       cur_yday = tmp->tm_yday;
+
+       stime = log_time - log_duration;
+       tmp = localtime(&stime);
+       p_retvm_if(NULL == tmp, 2, "localtime is null");
+
+       yday = tmp->tm_yday;
+
+       if (yday == cur_yday)
+               return 0;
+       else if (yday == cur_yday-1)
+               return 1;
+       else
+               return 2;
+}
+
+static void log_append_separate_date_index(ph_log_data *log_d, void *data, int index)
+{
+       ph_log_info *l_info = data;
+       int type = log_get_date_type(l_info->plog_log_time, l_info->plog_duration);
+
+       if (0 == index || log_d->pre_date_type != type) {
+               log_d->pre_date_type = type;
+               l_info->group_index = type;
+               log_d->git = elm_genlist_item_append(log_d->genlist, &itc_date,
+                               data, NULL, ELM_GENLIST_ITEM_GROUP, NULL, NULL);
+       }
+}
+
+static void log_gl_item_sel(void *data, Evas_Object *obj, void *event_info)
+{
+       bundle *bd;
+       char buf[16];
+       Elm_Object_Item *item = event_info;
+       ph_log_info *l_info = data;
+       ph_log_data *log_d = evas_object_data_get(obj, KEY_LOG_DATA);
+       elm_genlist_item_selected_set(item, EINA_FALSE);
+
+       if (elm_genlist_decorate_mode_get(log_d->genlist)) {
+               l_info->checked = !l_info->checked;
+               if (l_info->checked)
+                       log_d->cnt_checked++;
+               else
+                       log_d->cnt_checked--;
+
+               elm_genlist_item_fields_update(event_info, "elm.edit.icon.1", ELM_GENLIST_ITEM_FIELD_CONTENT);
+               ph_log_check_update_select_all(log_d);
+               ph_log_check_update_selection_info(log_d);
+               ph_log_check_update_button_status(log_d);
+               return;
+       }
+
+       switch (log_d->view_type) {
+       case LOG_VIEW_TYPE_VOICE_CALL:
+               if (l_info->plog_number && *l_info->plog_number)
+                       phone_launch_voice_call(l_info->plog_number, l_info->plog_ct_id);
+               break;
+       case LOG_VIEW_TYPE_SELECT:
+               bd = bundle_create();
+               p_retm_if(NULL == bd, "bundle_create() Failed");
+               snprintf(buf, sizeof(buf), "%d", l_info->id);
+               bundle_add(bd, PH_UG_BUNDLE_RESULT_PLOG_ID, buf);
+               PH_DBG("plog_id : %d %s", l_info->id, buf);
+               ug_send_result(log_d->ug, bd);
+               bundle_free(bd);
+               ug_destroy_me(log_d->ug);
+               break;
+       case LOG_VIEW_TYPE_NORMAL:
+               ph_create_log_detail_view(log_d, l_info);
+               break;
+       default:
+               ERR("Invalid view type(%d)", log_d->view_type);
+               break;
+       }
+}
+
+#define N 20
+static Eina_Bool log_append_item_part(void *data)
+{
+       int count;
+       Eina_List *l;
+       ph_log_info *l_info;
+       ph_log_data * log_d = data;
+
+       count = 0;
+       l = eina_list_nth_list(log_d->log_list, log_d->readed_n);
+       EINA_LIST_FOREACH(l, l, l_info) {
+               if (N == count) break;
+               log_append_separate_date_index(log_d, l_info, count + log_d->readed_n);
+
+               elm_genlist_item_append(log_d->genlist, &itc, l_info,
+                               log_d->git, ELM_GENLIST_ITEM_NONE, log_gl_item_sel, l_info);
+               count++;
+       }
+       if (N <= count) {
+               log_d->readed_n += N;
+               return ECORE_CALLBACK_RENEW;
+       }
+       else {
+               log_d->list_idler = NULL;
+               return ECORE_CALLBACK_CANCEL;
+       }
+}
+
+static void log_fill_genlist(ph_log_data * log_d)
+{
+       int count;
+       Eina_List *l;
+       ph_log_info *l_info;
+
+       p_retm_if(NULL == log_d || NULL == log_d->genlist, "Genlist is null");
+
+       if (log_d->list_idler) {
+               ecore_idler_del(log_d->list_idler);
+               log_d->list_idler = NULL;
+       }
+
+       log_d->readed_n = 0;
+       count = 0;
+       EINA_LIST_FOREACH(log_d->log_list, l, l_info) {
+               if (N == count) break;
+               log_append_separate_date_index(log_d, l_info, count);
+
+               if (l_info->plog_number && *l_info->plog_number)
+                       elm_genlist_item_append(log_d->genlist, &itc, l_info,
+                                       log_d->git, ELM_GENLIST_ITEM_NONE, log_gl_item_sel, l_info);
+               else
+                       elm_genlist_item_append(log_d->genlist, &itc_one, l_info,
+                                       log_d->git, ELM_GENLIST_ITEM_NONE, log_gl_item_sel, l_info);
+               count++;
+       }
+       if (N <= count) {
+               log_d->readed_n += N;
+               log_d->list_idler = ecore_idler_add(log_append_item_part, log_d);
+       }
+}
+
+static void log_free_log_list(ph_log_data *log_d)
+{
+       ph_log_info *l_info;
+
+       p_ret_if(NULL == log_d->log_list);
+
+       EINA_LIST_FREE(log_d->log_list, l_info) {
+               if (NULL == l_info) continue;
+               free(l_info->plog_display);
+               free(l_info->plog_img_path);
+               free(l_info->plog_number);
+               free(l_info);
+       }
+       log_d->log_list = NULL;
+}
+
+static Eina_List *log_load_data(int *ref_count, bool include_unknown)
+{
+       PH_FN_CALL;
+       int ret = CTS_SUCCESS;
+       int count = 0;
+       Eina_List *list = NULL;
+       CTSiter *iter;
+
+       ret = contacts_svc_get_list(CTS_LIST_GROUPING_CALL_PLOG, &iter);
+       p_retvm_if(CTS_SUCCESS != ret, NULL, "contacts_svc_get_list is failed");
+
+       while (CTS_SUCCESS == contacts_svc_iter_next(iter)) {
+               CTSvalue *plog = NULL;
+               ph_log_info *l_info;
+               char *number;
+
+               plog = contacts_svc_iter_get_info(iter);
+               number = (char*)contacts_svc_value_get_str(plog, CTS_LIST_PLOG_NUMBER_STR);
+
+               if (false == include_unknown && (!number || !*number)) {
+                       contacts_svc_value_free(plog);
+                       ret = contacts_svc_iter_next(iter);
+                       continue;
+               }
+
+               l_info = calloc(1, sizeof(ph_log_info));
+               l_info->id = contacts_svc_value_get_int(plog, CTS_LIST_PLOG_ID_INT);
+               l_info->plog_ct_id = contacts_svc_value_get_int(plog, CTS_LIST_PLOG_RELATED_ID_INT);
+               l_info->plog_number = SAFE_STRDUP(number);
+               l_info->plog_log_type = contacts_svc_value_get_int(plog, CTS_LIST_PLOG_LOG_TYPE_INT);
+               l_info->plog_log_time = contacts_svc_value_get_int(plog, CTS_LIST_PLOG_LOG_TIME_INT);
+               l_info->plog_duration = contacts_svc_value_get_int(plog, CTS_LIST_PLOG_DURATION_INT);
+               l_info->plog_num_type = contacts_svc_value_get_int(plog, CTS_LIST_PLOG_NUM_TYPE_INT);
+               l_info->plog_display = phone_get_display_name_from_value(plog, CTS_LIST_PLOG_DISPLAY_NAME_STR,
+                               CTS_LIST_PLOG_FIRST_NAME_STR, CTS_LIST_PLOG_LAST_NAME_STR);
+               l_info->plog_img_path = contacts_svc_value_steal_str(plog, CTS_LIST_PLOG_IMG_PATH_STR);
+
+               list = eina_list_append(list, (void*)l_info);
+               count++;
+
+               contacts_svc_value_free(plog);
+       }
+       contacts_svc_iter_remove(iter);
+
+       *ref_count = count;
+       return list;
+}
+
+static void log_load_list(ph_log_data * log_d)
+{
+       p_retm_if(NULL == log_d, "Parameter is null");
+       log_free_log_list(log_d);
+       log_d->log_list_count = 0;
+       log_d->log_list = log_load_data(&(log_d->log_list_count), true);
+}
+
+Eina_Bool ph_log_missed_call_count_reset(void *data)
+{
+       ph_log_data * log_d = data;
+
+       notification_delete_group_by_group_id(VOICECALL_PKG, 0, 1001);
+       notification_delete_group_by_group_id(VIDEOCALL_PKG, 0, 1001);
+
+       contacts_svc_phonelog_set_seen(0, CTS_PLOG_TYPE_NONE);
+
+       log_d->timer = NULL;
+       return ECORE_CALLBACK_CANCEL;
+}
+
+API void phone_log_set_background(Evas_Object *obj, bool is_background)
+{
+       ph_log_data *log_d;
+       log_d = evas_object_data_get(obj, KEY_LOG_DATA);
+       p_retm_if(NULL == log_d, "log data is null");
+
+       log_d->is_background = is_background;
+       if (log_d->update_timer) {
+               ecore_timer_del(log_d->update_timer);
+               log_d->update_timer = NULL;
+               ph_log_data_changed_cb(log_d);
+       }
+}
+
+API void phone_log_missed_info_update(void *layout)
+{
+       ph_log_data *log_d;
+       log_d = evas_object_data_get(layout, KEY_LOG_DATA);
+       p_retm_if(NULL == log_d , "log data is null");
+
+       if(elm_naviframe_top_item_get(log_d->navi) == elm_naviframe_bottom_item_get(log_d->navi)) {
+               if (LOG_VIEW_TYPE_NORMAL == log_d->view_type) {
+                       if (log_d->timer)
+                               ecore_timer_del(log_d->timer);
+                       log_d->timer = ecore_timer_add(1.0, ph_log_missed_call_count_reset, (void*)log_d);
+               }
+       }
+}
+
+static void log_delete_btn_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       ph_log_data * log_d = data;
+       ph_log_check_mode_start(log_d);
+}
+
+static char* log_gl_label_get(void *data, Evas_Object *obj, const char *part)
+{
+       char buf[PH_TEXT_MAX_LEN]={0};
+       ph_log_info *l_info = data;
+       if (0 == strcmp(part, "elm.text.1")) {
+               if (NULL == l_info->plog_number || '\0' == l_info->plog_number[0]) {
+                       snprintf(buf, sizeof(buf), S_(PH_SYS_BODY_UNKNOWN));
+                       return strdup(buf);
+               }
+               else if (l_info->plog_display && *l_info->plog_display)
+                       snprintf(buf, sizeof(buf), "%s", l_info->plog_display);
+               else
+                       snprintf(buf, sizeof(buf), "%s", l_info->plog_number);
+               return strdup(buf);
+       }
+       else if ((strcmp(part, "elm.text.2") == 0)) {
+               ph_log_data * log_d;
+               log_d = evas_object_data_get(obj, KEY_LOG_DATA);
+               return ph_log_util_get_time_date(log_d->formatter, l_info->plog_log_time, l_info->plog_duration, FALSE);
+       }
+       else
+               return NULL;
+}
+
+static Evas_Object *log_gl_icon_get(void *data, Evas_Object *obj, const char *part)
+{
+       char buf[PATH_MAX];
+       ph_log_info * l_info = data;
+       ph_log_data * log_d;
+
+       buf[0] = '\0';
+       log_d = evas_object_data_get(obj, KEY_LOG_DATA);
+
+       if (0 == strcmp(part, "elm.icon.1")) {
+               char *icon_type = ph_log_util_get_icon_type(l_info->plog_log_type);
+               Evas_Object *ic;
+               if (icon_type) {
+                       snprintf(buf, sizeof(buf), "%s", icon_type);
+                       free(icon_type);
+
+                       ic = elm_icon_add(obj);
+                       p_retvm_if(NULL == ic, NULL, "elm_icon_add is failed");
+                       elm_icon_file_set(ic, buf, NULL);
+                       evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
+                       return ic;
+               }
+       }
+       else if (0 == strcmp(part, "elm.icon.2")) {
+               char *icon_path = ph_log_util_get_icon_path_with_action(l_info->plog_log_type);
+               if (icon_path) {
+                       Evas_Object *ic;
+                       snprintf(buf, sizeof(buf), "%s", icon_path);
+                       free(icon_path);
+
+                       ic = elm_icon_add(obj);
+                       p_retvm_if(NULL == ic, NULL, "elm_icon_add is failed");
+                       elm_icon_file_set(ic, buf, NULL);
+                       evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
+                       return ic;
+               }
+       }
+       else if (0 == strcmp(part, "elm.icon.3")) {
+               if (l_info->plog_img_path) {
+                       Evas_Object *ic = elm_icon_add(obj);
+                       p_retvm_if(NULL == ic, NULL, "elm_icon_add is failed");
+
+                       snprintf(buf, sizeof(buf), "%s", l_info->plog_img_path);
+
+                       elm_icon_file_set(ic, buf, NULL);
+                       evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
+                       return ic;
+               }
+       }
+       else if (0 == strcmp(part, "elm.edit.icon.1")) {
+               Evas_Object *check;
+               check = elm_check_add(obj);
+               p_retvm_if(NULL == check, NULL, "elm_check_add() return NULL");
+               elm_check_state_pointer_set(check, &l_info->checked);
+               evas_object_smart_callback_add(check, "changed", ph_log_check_check_changed_cb, log_d);
+               return check;
+       }
+       return NULL;
+}
+
+static char* log_gl_sep_date_label_get(void *data, Evas_Object *obj, const char *part)
+{
+       ph_log_info *cd = data;
+       const char *when;
+       int index = cd->group_index;
+
+       if (0 == strcmp(part, "elm.text")) {
+               char *date_temp;
+               ph_log_data *log_d;
+
+               if (0 == index)
+                       when = S_(PH_SYS_BODY_TODAY);
+               else if (1 == index)
+                       when = S_(PH_SYS_BODY_YESTERDAY);
+               else
+                       when = S_(PH_SYS_BODY_PREVIOUS);
+
+               log_d = evas_object_data_get(obj, KEY_LOG_DATA);
+               date_temp = ph_log_util_get_time_date(log_d->formatter, cd->plog_log_time, -1, FALSE);
+               if (date_temp) {
+                       char buf[PATH_MAX]={0};
+                       snprintf(buf, sizeof(buf), " %s (%s)", when, date_temp);
+                       free(date_temp);
+                       return strdup(buf);
+               }
+               else
+                       return strdup(when);
+       }
+       else
+               return NULL;
+}
+
+static void log_cancel_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       ph_log_data *log_d = data;
+       phone_hide_notify(log_d->navi);
+       ph_log_check_mode_end(log_d, true);
+}
+
+static Evas_Object* log_create_genlist(ph_log_data * log_d)
+{
+       PH_FN_CALL;
+       Evas_Object *genlist = elm_genlist_add(log_d->box);
+       p_retvm_if(NULL == genlist, NULL, "elm_genlist_add() return NULL");
+
+       evas_object_size_hint_weight_set(genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       evas_object_size_hint_align_set(genlist, EVAS_HINT_FILL, EVAS_HINT_FILL);
+       elm_genlist_homogeneous_set(genlist, EINA_TRUE);
+       evas_object_show(genlist);
+       evas_object_data_set(genlist, KEY_LOG_DATA, log_d);
+       elm_genlist_block_count_set(genlist, 10);
+       return genlist;
+}
+
+static Evas_Object* log_fill_layout(void *data)
+{
+       ph_log_data *log_d = data;
+       log_load_list(log_d);
+       if (0 < log_d->log_list_count) {
+               if (NULL == log_d->genlist)
+                       log_d->genlist = log_create_genlist(log_d);
+               else
+                       elm_genlist_clear(log_d->genlist);
+               log_fill_genlist(log_d);
+               return log_d->genlist;
+       }
+       else {
+               Evas_Object *noc;
+               noc = phone_create_nocontents(log_d->box, T_(PH_GET_TEXT_BASIC, PHTEXT_NO_LOGS));
+               evas_object_size_hint_weight_set(noc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+               evas_object_size_hint_align_set(noc, EVAS_HINT_FILL, EVAS_HINT_FILL);
+               evas_object_show(noc);
+               log_d->genlist = NULL;
+               return noc;
+       }
+}
+
+Eina_Bool ph_log_data_changed_cb(void *data)
+{
+       PH_FN_CALL;
+       Evas_Object *content;
+       ph_log_data *log_d = data;
+
+       if (log_d->update_timer) {
+               ecore_timer_del(log_d->update_timer);
+               log_d->update_timer = NULL;
+       }
+       elm_box_clear(log_d->box);
+
+       if (log_d->genlist) {
+               evas_object_del(log_d->genlist);
+               log_d->genlist = NULL;
+       }
+
+       content = log_fill_layout(log_d);
+       p_retvm_if(NULL == content, ECORE_CALLBACK_CANCEL, "log_fill_layout() return NULL");
+
+       elm_box_pack_end(log_d->box, content);
+       if (LOG_VIEW_TYPE_CHECK == log_d->view_type
+                       || LOG_VIEW_TYPE_NORMAL_CHECK == log_d->view_type)
+               ph_log_check_mode_start(log_d);
+       ph_log_check_update_button_status(log_d);
+
+       return ECORE_CALLBACK_CANCEL;
+}
+
+static void log_data_lazy_update(void *data)
+{
+       PH_FN_CALL;
+       ph_log_data *log_d = data;
+       if (log_d->update_timer) {
+               ecore_timer_del(log_d->update_timer);
+               log_d->update_timer = NULL;
+       }
+
+       if (log_d->is_background)
+               log_d->update_timer = ecore_timer_add(3.0, ph_log_data_changed_cb, log_d);
+       else
+               ph_log_data_changed_cb(log_d);
+}
+
+static void log_view_delete_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+       PH_FN_CALL;
+       int ret;
+       ph_log_data *log_d = data;
+
+       p_retm_if(NULL == log_d, "log_d is null");
+
+       contacts_svc_unsubscribe_change_with_data(CTS_SUBSCRIBE_CONTACT_CHANGE,
+                       log_data_lazy_update, log_d);
+       contacts_svc_unsubscribe_change_with_data(CTS_SUBSCRIBE_PLOG_CHANGE,
+                       log_data_lazy_update, log_d);
+
+       if (0 < log_d->heynoti_fd) {
+               heynoti_unsubscribe(log_d->heynoti_fd, "setting_time_changed", ph_log_timezone_changed);
+               heynoti_close(log_d->heynoti_fd);
+       }
+
+       evas_object_data_del(log_d->navi, KEY_LOG_DATA);
+
+       log_free_log_list(log_d);
+
+       if (log_d->list_idler)
+               ecore_idler_del(log_d->list_idler);
+
+       if (log_d->popup)
+               evas_object_del(log_d->popup);
+
+       if (log_d->p_info) {
+               log_d->p_info->alive = false;
+               pthread_join(log_d->p_info->thread, NULL);
+               ret = contacts_svc_end_trans(false);
+               p_warn_if(ret < CTS_SUCCESS, "contacts_svc_end_trans() Failed(%d)", ret);
+               ecore_timer_del(log_d->p_info->timer);
+               free(log_d->p_info);
+       }
+
+       if (log_d->timer)
+               ecore_timer_del(log_d->timer);
+
+       if (log_d->update_timer)
+               ecore_timer_del(log_d->update_timer);
+
+       ph_log_util_delete_date_format(log_d->formatter);
+
+       free(log_d);
+       PH_FN_END;
+}
+
+static void log_set_genlist_item_style()
+{
+       itc.item_style = "2text.3icon";
+       itc.decorate_all_item_style = "edit_default";
+       itc.func.text_get = log_gl_label_get;
+       itc.func.content_get = log_gl_icon_get;
+       itc.func.state_get = NULL;
+
+       itc_one.item_style = "2text.3icon";
+       itc_one.decorate_all_item_style = "edit_default";
+       itc_one.func.text_get = log_gl_label_get;
+       itc_one.func.content_get = log_gl_icon_get;
+       itc_one.func.state_get = NULL;
+
+       itc_date.item_style ="grouptitle";
+       itc_date.func.text_get = log_gl_sep_date_label_get;
+}
+
+static void log_genlist_update(Evas_Object *genlist)
+{
+       PH_FN_CALL;
+       Elm_Object_Item *item;
+       p_retm_if(NULL == genlist, "Genlist is null");
+
+       item = elm_genlist_first_item_get(genlist);
+       while (item) {
+               elm_genlist_item_update(item);
+               item = elm_genlist_item_next_get(item);
+       }
+}
+
+API void phone_log_views_update(Evas_Object *navi)
+{
+       ph_log_data *log_d;
+       ph_log_detail_data *logdetail_d;
+
+       log_d = evas_object_data_get(navi, KEY_LOG_DATA);
+       if (log_d) {
+               ph_log_util_generate_date_format(log_d->formatter);
+               log_genlist_update(log_d->genlist);
+       }
+
+       logdetail_d = evas_object_data_get(navi, "logdetail_d");
+       if (logdetail_d)
+               log_genlist_update(logdetail_d->genlist);
+}
+
+void ph_log_timezone_changed(void *data)
+{
+       PH_FN_CALL;
+       phone_log_views_update(data);
+}
+
+API void phone_log_view_reset(Evas_Object *layout)
+{
+       PH_FN_CALL;
+       ph_log_data *log_d;
+       Elm_Object_Item *item;
+
+       log_d = evas_object_data_get(layout, KEY_LOG_DATA);
+       p_retm_if(NULL == log_d, "log_d is null");
+
+       if (log_d->child_ug) {
+               ug_destroy(log_d->child_ug);
+               log_d->child_ug = NULL;
+       }
+
+       item = elm_naviframe_bottom_item_get(log_d->navi);
+       if (elm_naviframe_top_item_get(log_d->navi) != item)
+               elm_naviframe_item_pop_to(item);
+       else if (LOG_VIEW_TYPE_NORMAL_CHECK == log_d->view_type)
+               ph_log_check_mode_end(log_d, false);
+       log_d->ctrl_item = NULL;
+}
+
+API void phone_log_set_navi(Evas_Object *layout)
+{
+       PH_FN_CALL;
+       ph_log_data *log_d;
+       Evas_Object *cbar;
+       Evas_Object *l_btn;
+       Elm_Object_Item *navi_it;
+
+       log_d = evas_object_data_get(layout, KEY_LOG_DATA);
+       p_retm_if(NULL == log_d, "log data is NULL");
+
+       navi_it = elm_naviframe_bottom_item_get(log_d->navi);
+       p_retm_if(NULL == navi_it, "navi item is NULL");
+       cbar = elm_object_item_part_content_get(navi_it, "controlbar");
+       if(cbar)
+               phone_cbar_item_clear(cbar);
+       else {
+               cbar = elm_toolbar_add(log_d->navi);
+               elm_toolbar_shrink_mode_set(cbar, ELM_TOOLBAR_SHRINK_EXPAND);
+               elm_object_item_part_content_set(navi_it, "controlbar", cbar);
+       }
+
+       /* back button */
+       switch (log_d->view_type) {
+       case LOG_VIEW_TYPE_NORMAL:
+               log_d->ctrl_item = elm_toolbar_item_append(cbar, IMG_DELETE_ICON, NULL, log_delete_btn_cb, log_d);
+               phone_toolbar_disalbed_item_append(cbar, 3);
+               l_btn = elm_button_add(log_d->navi);
+               evas_object_smart_callback_add(l_btn, "clicked", phone_back_btn_clicked_cb, log_d->win);
+               elm_object_style_set(l_btn, "naviframe/back_btn/default");
+               elm_object_item_part_content_set(log_d->navi_item, "prev_btn", l_btn);
+               break;
+       case LOG_VIEW_TYPE_NORMAL_CHECK:
+               log_d->ctrl_item = elm_toolbar_item_append(cbar, IMG_DELETE_ICON, NULL, ph_log_check_del_btn_cb, log_d);
+               phone_toolbar_disalbed_item_append(cbar, 3);
+               l_btn = phone_naviframe_btn(log_d->navi, S_(PH_SYS_SK_CANCEL));
+               evas_object_smart_callback_add(l_btn, "clicked", log_cancel_clicked_cb, log_d);
+               elm_object_item_part_content_set(log_d->navi_item, "prev_btn", l_btn);
+               break;
+       case LOG_VIEW_TYPE_CHECK:
+               log_d->ctrl_item = elm_toolbar_item_append(cbar, IMG_DONE_ICON, NULL, ph_log_check_done_btn_cb, log_d);
+               phone_toolbar_disalbed_item_append(cbar, 3);
+               break;
+       case LOG_VIEW_TYPE_SELECT:
+       case LOG_VIEW_TYPE_VOICE_CALL:
+               break;
+       default:
+               break;
+       }
+
+       if (log_d->ug) {
+               l_btn = phone_naviframe_btn(log_d->navi, S_(PH_SYS_SK_CANCEL));
+               evas_object_smart_callback_add(l_btn, "clicked", phone_ug_destroy_me_cb, log_d->ug);
+               elm_object_item_part_content_set(log_d->navi_item, "prev_btn", l_btn);
+       }
+
+       if(log_d->ctrl_item) {
+               ph_log_check_update_button_status(log_d);
+       }
+}
+
+int ph_log_create_content(ph_log_data *log_d)
+{
+       int ret;
+       Evas_Object *box;
+       Evas_Object *content;
+
+       box = elm_box_add(log_d->navi);
+       p_retvm_if(NULL == box, -1, "elm_box_add() return NULL");
+       log_d->box = box;
+
+       log_set_genlist_item_style();
+       content = log_fill_layout(log_d);
+       p_retvm_if(NULL == content, -1, "log_fill_layout() return NULL");
+       elm_box_pack_end(box, content);
+
+       evas_object_event_callback_add(box, EVAS_CALLBACK_DEL,
+                       log_view_delete_cb, log_d);
+
+       contacts_svc_subscribe_change(CTS_SUBSCRIBE_PLOG_CHANGE,
+                       log_data_lazy_update, log_d);
+       contacts_svc_subscribe_change(CTS_SUBSCRIBE_CONTACT_CHANGE,
+                       log_data_lazy_update, log_d);
+
+       evas_object_data_set(log_d->navi, KEY_LOG_DATA, log_d);
+
+       log_d->heynoti_fd = heynoti_init();
+       if (log_d->heynoti_fd < 0)
+               ERR("heynoti_init is failed(%d)", log_d->heynoti_fd);
+       else {
+               ret = heynoti_subscribe(log_d->heynoti_fd, "setting_time_changed", ph_log_timezone_changed, log_d->navi);
+               p_warn_if(ret < 0, "heynoti_subscribe is failed(%d)", ret);
+               ret = heynoti_attach_handler(log_d->heynoti_fd);
+               p_warn_if(ret < 0, "heynoti_attach_handler is failed(%d)", ret);
+       }
+
+       return 0;
+}
diff --git a/lib/log/ph-log-main-view.h b/lib/log/ph-log-main-view.h
new file mode 100755 (executable)
index 0000000..7edfe1a
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * 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 __PH_LOG_MAIN_VIEW_H__
+#define __PH_LOG_MAIN_VIEW_H__
+
+int ph_log_create_content(ph_log_data *log_d);
+Eina_Bool ph_log_missed_call_count_reset(void *data);
+void ph_log_timezone_changed(void *data);
+Eina_Bool ph_log_data_changed_cb(void *data);
+
+#endif /* __PH_LOG_MAIN_VIEW_H__ */
diff --git a/lib/log/ph-log-main.c b/lib/log/ph-log-main.c
new file mode 100755 (executable)
index 0000000..415bcf1
--- /dev/null
@@ -0,0 +1,263 @@
+/*
+ * 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 <ui-gadget-module.h>
+
+#include "phone.h"
+#include "phone-log.h"
+#include "ph-log-utils.h"
+#include "ph-log-main-view.h"
+#include "ph-log-check-view.h"
+#include "ph-log-detail-view.h"
+
+static inline void log_init_time_format(void)
+{
+       static int already_init = FALSE;
+
+       if (!already_init) {
+               UErrorCode status = U_ZERO_ERROR;
+               uloc_setDefault(getenv("LC_TIME"), &status);
+               already_init = TRUE;
+       }
+}
+
+static bool log_create_ug_view(int request, ph_log_data *log_d, Evas_Object *base)
+{
+       PH_FN_CALL;
+       int ret;
+       p_retvm_if(NULL == log_d, false, "Parameter is null");
+
+       if (NULL == log_d->navi) {
+               log_d->navi = elm_naviframe_add(base);
+               p_retvm_if(NULL == log_d->navi, false, "elm_naviframe_add is failed");
+               elm_object_part_content_set(base, "elm.swallow.content", log_d->navi);
+               evas_object_show(log_d->navi);
+       }
+
+       ret = ph_log_create_content(log_d);
+       if (ret < 0) {
+               ERR("Fail to ph_log_create_content");
+               return false;
+       }
+       log_d->navi_item = elm_naviframe_item_push(log_d->navi, T_(PH_GET_TEXT_BASE_OP, PHTEXT_SELECT_LOGS),
+                       NULL, NULL, log_d->box, NULL);
+
+       if (PH_UG_REQUEST_LOG_SELECT == request)
+               log_d->view_type = LOG_VIEW_TYPE_SELECT;
+       else if (PH_UG_REQUEST_LOG_CHECK == request)
+               log_d->view_type = LOG_VIEW_TYPE_CHECK;
+
+       if (LOG_VIEW_TYPE_CHECK == log_d->view_type)
+               ph_log_check_mode_start(log_d);
+       else
+               phone_log_set_navi(log_d->navi);
+
+       return true;
+}
+
+static void *log_on_create(struct ui_gadget *ug, enum ug_mode mode, bundle *bd, void *priv)
+{
+       PH_FN_CALL;
+       int ret;
+       Evas_Object *bg;
+       Evas_Object *parent;
+       Evas_Object *base;
+       ph_log_data *log_d;
+       int request = PH_UG_REQUEST_LOG_CHECK;
+
+       if (!ug || !priv)
+               return NULL;
+
+       bindtextdomain(PACKAGE, LOCALEDIR);
+
+       parent = ug_get_parent_layout(ug);
+       if (!parent)
+               return NULL;
+
+       ret = contacts_svc_connect();
+       p_retvm_if(CTS_SUCCESS != ret, NULL, "contacts_svc_connect() Failed(%d)", ret);
+
+       if (bd) {
+               const char* val = NULL;
+               val = bundle_get_val(bd, "type");
+               if (val) request = atoi(val);
+               PH_DBG("log request : %d", request);
+       }
+
+       if (mode==UG_MODE_FULLVIEW)
+               base = phone_create_layout(parent, true);
+       else
+               base = phone_create_layout(parent, false);
+
+       log_d = priv;
+       log_d->win = ug_get_window();
+       log_d->ug = ug;
+
+       bg = phone_create_bg(base);
+       if (NULL == bg) {
+               PH_DBG("phone_create_bg() return NULL");
+               evas_object_del(base);
+               ret = contacts_svc_disconnect();
+               p_warn_if(CTS_SUCCESS != ret, "contacts_svc_disconnect() Failed(%d)", ret);
+               return NULL;
+       }
+
+       log_init_time_format();
+       ph_log_util_generate_date_format(log_d->formatter);
+
+       if (!log_create_ug_view(request, log_d, base)) {
+               ph_log_util_delete_date_format(log_d->formatter);
+               evas_object_del(base);
+               ret = contacts_svc_disconnect();
+               p_warn_if(CTS_SUCCESS != ret, "contacts_svc_disconnect() Failed(%d)", ret);
+               return NULL;
+       }
+
+       return base;
+}
+
+static void log_on_start(struct ui_gadget *ug, bundle *data, void *priv)
+{
+}
+
+static void log_on_pause(struct ui_gadget *ug, bundle *data, void *priv)
+{
+       PH_FN_CALL;
+       ph_log_data *log_d = priv;
+       log_d->is_background = true;
+
+}
+
+static void log_on_resume(struct ui_gadget *ug, bundle *data, void *priv)
+{
+       PH_FN_CALL;
+       ph_log_data *log_d = priv;
+
+       log_d->is_background = false;
+       if (log_d->update_timer) {
+               ecore_timer_del(log_d->update_timer);
+               log_d->update_timer = NULL;
+               ph_log_data_changed_cb(log_d);
+       }
+}
+
+static void log_on_destroy(struct ui_gadget *ug, bundle *data, void *priv)
+{
+       PH_FN_CALL;
+
+       if (!ug)
+               return;
+
+       evas_object_del(ug_get_layout(ug));
+       contacts_svc_disconnect();
+       PH_FN_END;
+}
+
+static void log_on_message(struct ui_gadget *ug, bundle *msg, bundle *data, void *priv)
+{
+}
+
+static void log_on_event(struct ui_gadget *ug, enum ug_event event, bundle *data, void *priv)
+{
+       ph_log_data *log_d = priv;
+
+       switch (event) {
+       case UG_EVENT_REGION_CHANGE:
+               if (log_d->navi)
+                       phone_log_views_update(log_d->navi);
+               break;
+       default:
+               break;
+       }
+}
+
+static void log_on_key_event(struct ui_gadget *ug, enum ug_key_event event, bundle *data, void *priv)
+{
+       PH_FN_CALL;
+       if (!ug)
+               return;
+
+       switch (event) {
+       case UG_KEY_EVENT_END:
+               ug_destroy_me(ug);
+               break;
+       default:
+               break;
+       }
+}
+
+API int UG_MODULE_INIT(struct ug_module_ops *ops)
+{
+       ph_log_data *log_d;
+
+       if (!ops)
+               return -1;
+
+       log_d = calloc(1, sizeof(ph_log_data));
+       p_retvm_if(NULL == log_d, -1, "calloc is failed");
+
+       ops->create = log_on_create;
+       ops->start = log_on_start;
+       ops->pause = log_on_pause;
+       ops->resume = log_on_resume;
+       ops->destroy = log_on_destroy;
+       ops->message = log_on_message;
+       ops->event = log_on_event;
+       ops->key_event = log_on_key_event;
+       ops->priv = log_d;
+       ops->opt = UG_OPT_INDICATOR_ENABLE;
+
+       return 0;
+}
+
+API void UG_MODULE_EXIT(struct ug_module_ops *ops)
+{
+       PH_FN_CALL;
+
+       if (!ops)
+               return;
+
+       ops->priv = NULL;
+       PH_FN_END;
+}
+
+API Evas_Object* phone_create_log_view(void *ug, Evas_Object *win, Evas_Object *parent)
+{
+       PH_FN_CALL;
+       int ret;
+       ph_log_data * log_d = calloc(1, sizeof(ph_log_data));
+       p_retvm_if(NULL == log_d, NULL, "Fail to calloc ph_log_data");
+       log_d->ug = ug;
+       log_d->win = win;
+       log_d->navi = parent;
+       log_d->navi_item = elm_naviframe_bottom_item_get(log_d->navi);
+       if (log_d->ug)
+               log_d->view_type = LOG_VIEW_TYPE_VOICE_CALL;
+       else
+               log_d->view_type = LOG_VIEW_TYPE_NORMAL;
+
+       log_init_time_format();
+       ph_log_util_generate_date_format(log_d->formatter);
+
+       ret = ph_log_create_content(log_d);
+       if (ret < 0) {
+               free(log_d);
+               return NULL;
+       }
+
+       return log_d->box;
+}
+
diff --git a/lib/log/ph-log-utils.c b/lib/log/ph-log-utils.c
new file mode 100755 (executable)
index 0000000..544b080
--- /dev/null
@@ -0,0 +1,305 @@
+/*
+ * 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 <stdlib.h>
+#include <unicode/udatpg.h>
+#include <Elementary.h>
+#include <vconf.h>
+#include <appcore-efl.h>
+
+#include "phone.h"
+#include "phone-log.h"
+#include "ph-log-utils.h"
+
+static char *m_img_logtype_tbl[LOG_TYPE_MAX] = {
+       IMGDIR"/C01-4_icon_vt-call.png",
+};
+
+static char *m_img_logaction_tbl[LOG_ACTION_MAX] = {
+       IMGDIR"/C01-4_icon_dialed.png",
+       IMGDIR"/C01-4_icon_missed-call.png",
+       IMGDIR"/C01-4_icon_received.png",
+       IMGDIR"/C01-4_icon_rejected.png",
+       IMGDIR"/C01-4_icon_Blocked(Auto-rejected).png"
+};
+
+static const char *date_time_format[] = {
+       "hm",
+       "Hm",
+       "yMMMdd",
+       "yMMMddhm",
+       "yMMMddHm",
+};
+
+static enum appcore_time_format time_format = APPCORE_TIME_FORMAT_12;
+
+// for removing build warning ////////////////////////////////////
+int32_t u_strlen(const UChar *s);
+UChar* u_uastrncpy(UChar *dst, const char *src, int32_t n);
+char* u_austrncpy(char *dst, const UChar *src, int32_t n);
+//////////////////////////////////////////////////////////////////
+
+int ph_log_util_del_log_by_number(char *number)
+{
+       if (number)
+               return contacts_svc_delete_phonelog(CTS_PLOG_DEL_BY_NUMBER, number);
+       else
+               return contacts_svc_delete_phonelog(CTS_PLOG_DEL_NO_NUMBER);
+}
+
+static int log_util_is_call_dial_type(int type)
+{
+       if (type == CTS_PLOG_TYPE_VOICE_OUTGOING
+                       || type == CTS_PLOG_TYPE_VIDEO_OUTGOING)
+               return TRUE;
+       else
+               return FALSE;
+}
+
+static int log_util_is_call_miss_type(int type)
+{
+       switch (type) {
+       case CTS_PLOG_TYPE_VOICE_INCOMMING_UNSEEN:
+       case CTS_PLOG_TYPE_VOICE_INCOMMING_SEEN:
+       case CTS_PLOG_TYPE_VIDEO_INCOMMING_UNSEEN:
+       case CTS_PLOG_TYPE_VIDEO_INCOMMING_SEEN:
+               return TRUE;
+       default:
+               return FALSE;
+       }
+}
+
+static int log_util_is_call_receive_type(int type)
+{
+       if (type == CTS_PLOG_TYPE_VOICE_INCOMMING
+                       || type == CTS_PLOG_TYPE_VIDEO_INCOMMING)
+               return TRUE;
+       else
+               return FALSE;
+}
+
+static int log_util_is_call_rejected_type(int type)
+{
+       if (type == CTS_PLOG_TYPE_VOICE_REJECT
+                       || type == CTS_PLOG_TYPE_VIDEO_REJECT)
+               return TRUE;
+       else
+               return FALSE;
+}
+
+static int log_util_is_voice_call_type(int type)
+{
+       switch (type) {
+       case CTS_PLOG_TYPE_VOICE_INCOMMING:
+       case CTS_PLOG_TYPE_VOICE_OUTGOING:
+       case CTS_PLOG_TYPE_VOICE_INCOMMING_UNSEEN:
+       case CTS_PLOG_TYPE_VOICE_INCOMMING_SEEN:
+       case CTS_PLOG_TYPE_VOICE_REJECT:
+       case CTS_PLOG_TYPE_VOICE_BLOCKED:
+               return TRUE;
+       default:
+               return FALSE;
+       }
+}
+
+static int log_util_is_video_call_type(int type)
+{
+       switch (type) {
+       case CTS_PLOG_TYPE_VIDEO_INCOMMING:
+       case CTS_PLOG_TYPE_VIDEO_OUTGOING:
+       case CTS_PLOG_TYPE_VIDEO_INCOMMING_UNSEEN:
+       case CTS_PLOG_TYPE_VIDEO_INCOMMING_SEEN:
+       case CTS_PLOG_TYPE_VIDEO_REJECT:
+       case CTS_PLOG_TYPE_VIDEO_BLOCKED:
+               return TRUE;
+       default:
+               return FALSE;
+       }
+}
+
+static int log_util_is_blocked_type(int type)
+{
+       switch (type) {
+       case CTS_PLOG_TYPE_VOICE_BLOCKED:
+       case CTS_PLOG_TYPE_VIDEO_BLOCKED:
+               return TRUE;
+       default:
+               return FALSE;
+       }
+}
+
+char *ph_log_util_get_icon_path_with_action(int log_type)
+{
+       char buf[PATH_MAX]={0};
+       Log_Action action = -1;
+
+       if (TRUE == log_util_is_call_dial_type(log_type))
+               action = LOG_ACTION_DIALLED;
+       else if (TRUE == log_util_is_call_miss_type(log_type))
+               action = LOG_ACTION_MISSED;
+       else if (TRUE == log_util_is_call_receive_type(log_type))
+               action = LOG_ACTION_RECEIVED;
+       else if (TRUE == log_util_is_call_rejected_type(log_type))
+               action = LOG_ACTION_REJECTED;
+       else if (TRUE == log_util_is_blocked_type(log_type))
+               action = LOG_ACTION_BLOCKED;
+       else {
+               PH_DBG("error invalid type %d", log_type);
+               return NULL;
+       }
+       snprintf(buf, sizeof(buf), "%s", m_img_logaction_tbl[action]);
+       return strdup(buf);
+}
+
+char *ph_log_util_get_icon_type(int log_type)
+{
+       Log_Type type = -1;
+       char buf[PATH_MAX]={0};
+
+       if (TRUE == log_util_is_voice_call_type(log_type))
+               return NULL;
+       else if (TRUE == log_util_is_video_call_type(log_type))
+               type = LOG_TYPE_VIDEO_CALL;
+       else {
+               PH_DBG("error invalid type");
+               return NULL;
+       }
+       snprintf(buf, sizeof(buf), "%s", m_img_logtype_tbl[type]);
+       return strdup(buf);
+}
+
+static char *log_util_get_formatted_date(UDateFormat **formatter, int log_time,
+               date_style style)
+{
+       time_t stime;
+       UErrorCode status = U_ZERO_ERROR;
+       UDate date;
+       UChar formatted[64] = {0};
+       int32_t formatted_size;
+       int32_t formatted_len;
+       char formatted_str[PH_TEXT_SHORT_LEN] = {0};
+       int type = LOG_FORMAT_DATE;
+
+       stime = log_time;
+       date = (UDate)stime * 1000;
+
+       formatted_size = (int32_t)(sizeof(formatted)/sizeof(UChar));
+       if (PH_LOG_TIME_ONLY == style) {
+               if (APPCORE_TIME_FORMAT_24 == time_format)
+                       type = LOG_FORMAT_TIME_24;
+               else
+                       type = LOG_FORMAT_TIME_12;
+       }
+       else if (PH_LOG_TIME_DATE == style) {
+               if (APPCORE_TIME_FORMAT_24 == time_format)
+                       type = LOG_FORMAT_DATE_TIME_24;
+               else
+                       type = LOG_FORMAT_DATE_TIME_12;
+       }
+       else if (PH_LOG_DATE_ONLY == style)
+               type = LOG_FORMAT_DATE;
+       formatted_len = udat_format(formatter[type], date, formatted, formatted_size, NULL, &status);
+       u_austrncpy(formatted_str, formatted, PH_TEXT_SHORT_LEN);
+       return strdup(formatted_str);
+}
+
+char *ph_log_util_get_time_date(UDateFormat ** formatter, int log_time, int log_duration, int display_yesterday)
+{
+       char buf[PATH_MAX] = {0};
+       time_t stime;
+       struct timeval timeval;
+       struct tm *tmp;
+       int yday = -1, cur_yday = -1;
+
+       if (-1 == log_duration)
+               return log_util_get_formatted_date(formatter, log_time, PH_LOG_DATE_ONLY);
+
+       gettimeofday(&timeval, 0);
+       tmp = localtime(&timeval.tv_sec);
+       if (tmp)
+               cur_yday = tmp->tm_yday;
+
+       stime = log_time - log_duration;
+       tmp = localtime(&stime);
+       if (tmp)
+               yday = tmp->tm_yday;
+
+       if ((0 <= yday && 0 <= cur_yday) && (yday == cur_yday || yday == cur_yday-1)) {
+               char *time = log_util_get_formatted_date(formatter, log_time, PH_LOG_TIME_ONLY);
+               if (display_yesterday && (yday == cur_yday-1))
+                       snprintf(buf, sizeof(buf), "%s %s", S_(PH_SYS_BODY_YESTERDAY), time);
+               else
+                       snprintf(buf, sizeof(buf), "%s", time);
+               free(time);
+       }
+       else {
+               char *date = log_util_get_formatted_date(formatter, log_time, PH_LOG_TIME_DATE);
+               snprintf(buf, sizeof(buf), "%s", date);
+               free(date);
+       }
+       return strdup(buf);
+}
+
+void ph_log_util_generate_date_format(UDateFormat **formatter)
+{
+       PH_FN_CALL;
+       UDateTimePatternGenerator *generator;
+       UErrorCode error = U_ZERO_ERROR;
+       UChar utimezone_id [256] = {0};
+       char *timezone_id = NULL;
+       const char *locale;
+       int i;
+       int ret;
+
+       timezone_id = vconf_get_str(VCONFKEY_SETAPPL_TIMEZONE_ID);
+       if (timezone_id) {
+               u_uastrncpy(utimezone_id, timezone_id, strlen(timezone_id));
+               ucal_setDefaultTimeZone(utimezone_id , &error);
+               free(timezone_id);
+       }
+
+       ret = appcore_get_timeformat(&time_format);
+       if (ret < -1 || time_format < APPCORE_TIME_FORMAT_12)
+               time_format = APPCORE_TIME_FORMAT_12;
+
+       locale = uloc_getDefault();
+       ph_log_util_delete_date_format(formatter);
+
+       generator = udatpg_open(locale, &error);
+       p_retm_if(NULL == generator, "udatpg_open is failed(%d)", error);
+
+       for (i=LOG_FORMAT_TIME_12;i<LOG_FORMAT_MAX;i++) {
+               UChar skeleton[64]={'\0'};
+               UChar best_pattern[64] = {0};
+
+               u_uastrncpy(skeleton, date_time_format[i], strlen(date_time_format[i]));
+               udatpg_getBestPattern(generator, skeleton, u_strlen(skeleton), best_pattern,
+                               (int32_t)(sizeof(best_pattern)/sizeof(UChar)), &error);
+               formatter[i] = udat_open(UDAT_IGNORE, UDAT_IGNORE, locale, NULL, -1, best_pattern, -1, &error);
+       }
+       udatpg_close(generator);
+}
+
+void ph_log_util_delete_date_format(UDateFormat **formatter)
+{
+       int i;
+       for (i=LOG_FORMAT_TIME_12;i<LOG_FORMAT_MAX;i++) {
+               if (formatter[i]) {
+                       udat_close(formatter[i]);
+                       formatter[i] = NULL;
+               }
+       }
+}
diff --git a/lib/log/ph-log-utils.h b/lib/log/ph-log-utils.h
new file mode 100755 (executable)
index 0000000..49415f7
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * 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 __PH_LOG_UTILS_H__
+#define __PH_LOG_UTILS_H__
+
+#include <unicode/udat.h>
+
+typedef enum date_style{
+       PH_LOG_TIME_ONLY,
+       PH_LOG_DATE_ONLY,
+       PH_LOG_TIME_DATE,
+}date_style;
+
+char *ph_log_util_get_icon_path_with_action(int log_type);
+char *ph_log_util_get_icon_type(int log_type);
+char *ph_log_util_get_time_date(UDateFormat ** formatter, int log_time, int log_duration, int display_yesterday);
+
+void ph_log_util_generate_date_format(UDateFormat ** formatter);
+void ph_log_util_delete_date_format(UDateFormat ** formatter);
+
+int ph_log_util_del_log_by_number(char *number);
+
+#endif /* __PH_LOG_UTILS_H__ */
diff --git a/lib/phoneui/CMakeLists.txt b/lib/phoneui/CMakeLists.txt
new file mode 100755 (executable)
index 0000000..8203819
--- /dev/null
@@ -0,0 +1,12 @@
+LINK_DIRECTORIES(${CMAKE_BINARY_DIR})
+
+SET(TARGET ${MAIN})
+
+FILE(GLOB SRCS *.c)
+
+ADD_LIBRARY(${TARGET} SHARED ${SRCS})
+SET_TARGET_PROPERTIES(${TARGET} PROPERTIES VERSION ${VERSION})
+SET_TARGET_PROPERTIES(${TARGET} PROPERTIES COMPILE_FLAGS ${EXTRA_CFLAGS})
+TARGET_LINK_LIBRARIES(${TARGET} ${COMMON_LIB} ${ug_pkgs_LDFLAGS} ${SPEEDDIAL} ${PHONELOG} ${PH_VIEW_DIALER} -L/opt/ug/lib/ -lug-contacts-list-efl -lug-contacts-details-efl)
+
+INSTALL(TARGETS ${TARGET} DESTINATION ${UGLIBDIR})
diff --git a/lib/phoneui/ph-favorite-edit-view.c b/lib/phoneui/ph-favorite-edit-view.c
new file mode 100755 (executable)
index 0000000..eb788fd
--- /dev/null
@@ -0,0 +1,343 @@
+/*
+ * 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 "phone.h"
+#include "phone-ui.h"
+#include "ph-favorite-view.h"
+#include "ph-favorite-edit-view.h"
+
+static inline void favor_edit_all_item_check_set(Evas_Object *genlist,
+               Eina_Bool checked)
+{
+       Elm_Object_Item *item;
+
+       item = elm_genlist_first_item_get(genlist);
+       while (NULL != item) {
+               ph_favor_info *f_info = elm_object_item_data_get(item);
+               f_info->is_checked = checked;
+               item = elm_genlist_item_next_get(item);
+       }
+       elm_genlist_realized_items_update(genlist);
+}
+
+static Eina_Bool favor_edit_del_timer(void *data)
+{
+       PH_FN_CALL;
+       ph_favorite_data *favor_d = data;
+       ph_progress_info *p_info = favor_d->p_info;
+
+       p_retvm_if(NULL == p_info, ECORE_CALLBACK_CANCEL, "parameter(ph_progress_info) is NULL");
+
+       if (!p_info->completed) {
+               char count[PH_TEXT_SHORT_LEN];
+               char percent[5];
+               double value = (double)p_info->cnt / (double)p_info->cnt_checked_total;
+
+               elm_progressbar_value_set(p_info->progressbar, value);
+               snprintf(percent, sizeof(percent), "%d%%", (int)(100.0 * (double)p_info->cnt/(double)p_info->cnt_checked_total));
+               snprintf(count, sizeof(count), "%d/%d", p_info->cnt, p_info->cnt_checked_total);
+               edje_object_part_text_set(elm_layout_edje_get(p_info->layout), "elm.text.subtext1", percent);
+               edje_object_part_text_set(elm_layout_edje_get(p_info->layout), "elm.text.subtext2", count);
+
+               if (p_info->cnt == p_info->cnt_checked_total)
+                       p_info->completed = true;
+
+               return ECORE_CALLBACK_RENEW;
+       }
+       else {
+               int ret;
+               const char *message;
+
+               pthread_join(p_info->thread, NULL);
+
+               if (p_info->cnt == p_info->cnt_checked_total) {
+                       message = S_(PH_SYS_POP_DELETED);
+                       ret = contacts_svc_end_trans(true);
+                       ph_favor_edit_mode_end(favor_d, true);
+               }
+               else {
+                       message = S_(PH_SYS_POP_FAILED);
+                       ret = contacts_svc_end_trans(false);
+               }
+
+               if (ret < CTS_SUCCESS) {
+                       ERR("contacts_svc_end_trans() Failed(%d)", ret);
+                       message = S_(PH_SYS_POP_FAILED);
+               }
+
+               evas_object_del(favor_d->popup);
+               favor_d->popup = NULL;
+
+               if (NULL != p_info) {
+                       favor_d->p_info = NULL;
+                       free(p_info);
+               }
+               phone_show_notify(favor_d->navi, message, 2.0);
+               return ECORE_CALLBACK_CANCEL;
+       }
+}
+
+static PTHREAD_FN favor_edit_del(void *data)
+{
+       PH_FN_CALL;
+       Eina_List *l;
+       ph_favor_info*f_info;
+       ph_favorite_data *favor_d = data;
+       ph_progress_info *p_info = favor_d->p_info;
+
+       EINA_LIST_FOREACH(favor_d->favorite_list, l, f_info) {
+               if (!p_info->alive) {
+                       p_info->completed = true;
+                       break;
+               }
+               if (!f_info) continue;
+
+               if (TRUE == f_info->is_checked) {
+                       if (CTS_SUCCESS != contacts_svc_delete_favorite(f_info->id)) {
+                               p_info->completed = true;
+                               break;
+                       }
+                       p_info->cnt++;
+               }
+               if (p_info->cnt == p_info->cnt_checked_total)
+                       break;
+       }
+       pthread_exit(NULL);
+
+}
+
+void ph_favor_edit_del_btn_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       PH_FN_CALL;
+       int ret;
+       ph_favorite_data *favor_d = data;
+       ph_progress_info *p_info;
+
+       p_info = calloc(1, sizeof(ph_progress_info));
+       p_retm_if(NULL == p_info, "calloc return NULL");
+
+       favor_d->p_info = p_info;
+       p_info->cnt_checked_total = favor_d->checked_cnt;
+       p_info->alive = true;
+
+       ret = contacts_svc_begin_trans();
+       if (ret < CTS_SUCCESS) {
+               ERR("contacts_svc_begin_trans() Failed(%d)", ret);
+               free(p_info);
+               favor_d->p_info = NULL;
+               return;
+       }
+       ret = pthread_create(&p_info->thread, NULL, favor_edit_del, favor_d);
+       if (0 != ret) {
+               ERR("Thread creation failed(%d)", ret);
+               free(p_info);
+               favor_d->p_info = NULL;
+
+               ret = contacts_svc_end_trans(false);
+               p_warn_if(ret < CTS_SUCCESS, "contacts_svc_end_trans() Failed(%d)", ret);
+               return;
+       }
+
+       p_info->timer = ecore_timer_add(0.2, favor_edit_del_timer, favor_d);
+       if (NULL == p_info->timer) {
+               ERR("ecore_timer_add() return NULL");
+
+               p_info->alive = false;
+               pthread_join(p_info->thread, NULL);
+
+               free(p_info);
+               favor_d->p_info = NULL;
+
+               ret = contacts_svc_end_trans(false);
+               p_warn_if(ret < CTS_SUCCESS, "contacts_svc_end_trans() Failed(%d)", ret);
+               return;
+       }
+       favor_d->popup = phone_progressbar_popup(favor_d->win, p_info, T_(PH_GET_TEXT_BASIC, PHTEXT_DELETING_FAVORITES));
+       phone_create_popup_button(favor_d->popup, 1, S_(PH_SYS_SK_CANCEL), phone_progress_popup_del, p_info);
+}
+
+static void favor_edit_select_all_changed_cb(ph_favorite_data * favor_d)
+{
+       Eina_List *l;
+       ph_favor_info *f_info;
+
+       p_retm_if(NULL == favor_d, "Parameter is null");
+
+       if (favor_d->is_all_check)
+               favor_d->checked_cnt = favor_d->favorite_list_count;
+       else
+               favor_d->checked_cnt = 0;
+
+       EINA_LIST_FOREACH(favor_d->favorite_list, l, f_info) {
+               if (!f_info) continue;
+               f_info->is_checked = favor_d->is_all_check;
+       }
+
+       elm_genlist_realized_items_update(favor_d->genlist);
+       ph_favor_edit_set_selection_info(favor_d);
+       ph_favor_update_button_status(favor_d);
+}
+
+static void favor_edit_select_all_mouse_up_cb(void *data, Evas *evas, Evas_Object *obj, void *event_info)
+{
+       int x, y, w, h;
+       ph_favorite_data *favor_d = data;
+       Evas_Event_Mouse_Up *ev = event_info;
+
+       if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
+               return;
+
+       evas_object_geometry_get(obj, &x, &y, &w, &h);
+       if (ev->output.y < y || y + h < ev->output.y)
+               return;
+
+       favor_d->is_all_check = !favor_d->is_all_check;
+       elm_check_state_set(favor_d->select_all_checkbox, favor_d->is_all_check);
+       favor_edit_select_all_changed_cb(favor_d);
+}
+
+static void favor_edit_select_all_check_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       ph_favorite_data *favor_d = data;
+       favor_edit_select_all_changed_cb(favor_d);
+}
+
+static void favor_edit_create_select_all(ph_favorite_data *favor_d)
+{
+       Evas_Object *layout;
+       Evas_Object *check;
+       layout = elm_layout_add(favor_d->box);
+       elm_layout_theme_set(layout, "genlist", "item", "select_all/default");
+       evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, 0.0);
+       evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
+       evas_object_event_callback_add(layout, EVAS_CALLBACK_MOUSE_UP,
+                       favor_edit_select_all_mouse_up_cb, favor_d);
+
+       check = elm_check_add(layout);
+       elm_check_state_pointer_set(check, &(favor_d->is_all_check));
+       evas_object_smart_callback_add(check, "changed", favor_edit_select_all_check_cb, favor_d);
+       evas_object_propagate_events_set(check, EINA_FALSE);
+       elm_object_part_content_set(layout, "elm.icon", check);
+       favor_d->select_all_checkbox = check;
+       evas_object_data_set(favor_d->select_all_checkbox, "layout", layout);
+
+       elm_object_part_text_set(layout, "elm.text", S_(PH_SYS_BODY_SELECT_ALL));
+       elm_box_pack_start(favor_d->box, layout);
+       evas_object_show(layout);
+}
+
+void ph_favor_edit_check_changed_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       PH_FN_CALL;
+       ph_favorite_data * favor_d = data;
+       if (elm_check_state_get(obj))
+               favor_d->checked_cnt++;
+       else
+               favor_d->checked_cnt--;
+
+       if (favor_d->favorite_list_count == favor_d->checked_cnt)
+               favor_d->is_all_check = EINA_TRUE;
+       else
+               favor_d->is_all_check = EINA_FALSE;
+       elm_check_state_set(favor_d->select_all_checkbox, favor_d->is_all_check);
+
+       elm_genlist_realized_items_update(favor_d->genlist);
+
+       ph_favor_edit_set_selection_info(favor_d);
+       ph_favor_update_button_status(favor_d);
+}
+
+void ph_favor_edit_set_selection_info(const void *data)
+{
+       ph_favorite_data * favor_d = (ph_favorite_data*)data;
+       p_retm_if(NULL == favor_d, "Selection info is null");
+
+       if (0 == favor_d->checked_cnt) {
+               Evas_Object *notify = phone_get_notify(favor_d->navi);
+               if (notify)
+                       evas_object_hide(notify);
+       }
+       else {
+               char info_text[PH_TEXT_SHORT_LEN]={0};
+               snprintf(info_text, sizeof(info_text), "%s (%d)", S_(PH_SYS_POP_SELECTED),
+                               favor_d->checked_cnt);
+               phone_show_notify(favor_d->navi, info_text, 0.0);
+       }
+}
+
+void ph_favor_edit_mode_start(ph_favorite_data *favor_d)
+{
+       PH_FN_CALL;
+       Evas_Object *bg;
+       p_retm_if(NULL == favor_d, "Favorite data is null");
+
+       bg = phone_create_bg(favor_d->base);
+       elm_object_style_set(bg, "edit_mode");
+
+       elm_genlist_reorder_mode_set(favor_d->genlist, EINA_TRUE);
+       elm_genlist_decorate_mode_set(favor_d->genlist, EINA_TRUE);
+       elm_genlist_select_mode_set(favor_d->genlist, ELM_OBJECT_SELECT_MODE_ALWAYS);
+       favor_edit_create_select_all(favor_d);
+
+       phone_favor_set_navi(favor_d->layout, PH_FAVOR_MODE_EDIT);
+}
+
+void ph_favor_edit_mode_end(ph_favorite_data *favor_d, bool redraw)
+{
+       PH_FN_CALL;
+       Evas_Object *bg;
+       Evas_Object *layout;
+       Evas_Object *back_btn;
+
+       bg = elm_object_part_content_unset(favor_d->base, "elm.swallow.bg");
+       if (bg)
+               evas_object_del(bg);
+
+       layout = evas_object_data_get(favor_d->select_all_checkbox, "layout");
+       elm_box_unpack(favor_d->box, layout);
+       evas_object_del(layout);
+       favor_d->select_all_checkbox = NULL;
+
+       if (favor_d->checked_cnt) {
+               favor_d->checked_cnt = 0;
+               favor_d->is_all_check = EINA_FALSE;
+               favor_edit_all_item_check_set(favor_d->genlist, EINA_FALSE);
+       }
+
+       elm_genlist_decorate_mode_set(favor_d->genlist, EINA_FALSE);
+       elm_genlist_reorder_mode_set(favor_d->genlist, EINA_FALSE);
+       elm_genlist_select_mode_set(favor_d->genlist, ELM_OBJECT_SELECT_MODE_ALWAYS);
+
+       back_btn = elm_button_add(favor_d->navi);
+       elm_object_item_part_content_set(favor_d->navi_item, "prev_btn", back_btn);
+       if (favor_d->ug) {
+               evas_object_smart_callback_add(back_btn, "clicked", phone_ug_destroy_me_cb, favor_d->ug);
+               elm_object_style_set(back_btn, "naviframe/back_btn/default");
+       }
+       else {
+               evas_object_smart_callback_add(back_btn, "clicked", phone_back_btn_clicked_cb, favor_d->win);
+               elm_object_style_set(back_btn, "naviframe/end_btn/default");
+       }
+       if (redraw)
+               phone_favor_set_navi(favor_d->layout, PH_FAVOR_MODE_DEFAULT);
+}
+
+void ph_favor_edit_cancel_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       ph_favorite_data *favor_d = data;
+       phone_hide_notify(favor_d->navi);
+       ph_favor_edit_mode_end(favor_d, true);
+}
diff --git a/lib/phoneui/ph-favorite-edit-view.h b/lib/phoneui/ph-favorite-edit-view.h
new file mode 100644 (file)
index 0000000..53ddf9e
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ * 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 __PH_FAVORITE_EDIT_H__
+#define __PH_FAVORITE_EDIT_H__
+
+void ph_favor_edit_mode_start(ph_favorite_data *favor_d);
+void ph_favor_edit_mode_end(ph_favorite_data *favor_d, bool redraw);
+void ph_favor_edit_set_selection_info(const void *data);
+void ph_favor_edit_check_changed_cb(void *data, Evas_Object *obj, void *event_info);
+void ph_favor_edit_del_btn_cb(void *data, Evas_Object *obj, void *event_info);
+void ph_favor_edit_cancel_cb(void *data, Evas_Object *obj, void *event_info);
+
+#endif /* __PH_FAVORITE_EDIT_H__ */
diff --git a/lib/phoneui/ph-favorite-view.c b/lib/phoneui/ph-favorite-view.c
new file mode 100755 (executable)
index 0000000..ef12b89
--- /dev/null
@@ -0,0 +1,698 @@
+/*
+ * 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 <contacts-svc.h>
+#include <contacts-ug.h>
+#include <ui-gadget-module.h>
+
+#include "phone.h"
+#include "phone-common.h"
+#include "phone-ui.h"
+#include "ph-favorite-view.h"
+#include "ph-favorite-edit-view.h"
+
+#define KEY_FAVOR_DATA "favor_d"
+#define PH_FAVOR_LIST_ICON_SIZE 70
+
+static Elm_Genlist_Item_Class itc_favor, itc_favor_one;
+
+/* for removing build warning */
+int ctui_detail_create_view_without_del(Evas_Object *win, Evas_Object *navi, struct ui_gadget *ug, int id);
+
+static char* favor_get_contact_number(int contact_id)
+{
+       int ret;
+       char *number;
+       CTSvalue *value;
+
+       ret = contacts_svc_get_contact_value(CTS_GET_DEFAULT_NUMBER_VALUE, contact_id, &value);
+       p_retvm_if(ret != CTS_SUCCESS, NULL, "contacts_svc_get_contact_value() Failed(%d)", ret);
+
+       number = contacts_svc_value_steal_str(value, CTS_NUM_VAL_NUMBER_STR);
+       contacts_svc_value_free(value);
+
+       return number;
+}
+
+static void favor_load_favorite_data(ph_favorite_data *favor_d)
+{
+       int count = 0;
+       int ret = 0;
+       Eina_List *list = NULL;
+       CTSiter *iter;
+
+       ret = contacts_svc_get_list(CTS_LIST_ALL_CONTACT_FAVORITE, &iter);
+       if (CTS_SUCCESS != ret) {
+               ERR("contacts_svc_get_list is failed");
+               favor_d->favorite_list_count = 0;
+               return;
+       }
+
+       ret = contacts_svc_iter_next(iter);
+       contacts_svc_begin_trans();
+       favor_d->version = contacts_svc_end_trans(true);
+
+       while (CTS_SUCCESS == ret) {
+               CTSvalue *pfav = NULL;
+               ph_favor_info *f_info;
+               pfav = contacts_svc_iter_get_info(iter);
+
+               f_info = calloc(1, sizeof(ph_favor_info));
+               f_info->id = contacts_svc_value_get_int(pfav, CTS_LIST_SHORTCUT_ID_INT);
+               f_info->contact_id = contacts_svc_value_get_int(pfav, CTS_LIST_SHORTCUT_CONTACT_ID_INT);
+               f_info->display = phone_get_display_name_from_value(pfav, CTS_LIST_SHORTCUT_DISPLAY_NAME_STR,
+                               CTS_LIST_SHORTCUT_FIRST_NAME_STR, CTS_LIST_SHORTCUT_LAST_NAME_STR);
+               f_info->img_path = contacts_svc_value_steal_str(pfav, CTS_LIST_SHORTCUT_IMG_PATH_STR);
+
+               list = eina_list_append(list, (void*)f_info);
+               count++;
+               contacts_svc_value_free(pfav);
+               ret = contacts_svc_iter_next(iter);
+       }
+       contacts_svc_iter_remove(iter);
+
+       favor_d->favorite_list_count = count;
+       favor_d->favorite_list = list;
+}
+
+static void favor_free_data(Eina_List *list)
+{
+       Eina_List *l;
+       ph_favor_info *f_info;
+       p_retm_if(NULL == list, "List is null");
+
+       EINA_LIST_FOREACH(list, l, f_info) {
+               if (NULL == f_info)
+                       continue;
+               free(f_info->display);
+               free(f_info->img_path);
+               free(f_info->number);
+               free(f_info);
+       }
+       eina_list_free(list);
+}
+
+static void favor_destroy_child_ug(void *data)
+{
+       ph_favorite_data *favor_d = data;
+       favor_d->child_ug = NULL;
+}
+static void favor_load_list(ph_favorite_data *favor_d)
+{
+       p_retm_if(NULL == favor_d, "Parameter is null");
+
+       favor_free_data(favor_d->favorite_list);
+       favor_d->favorite_list = NULL;
+       favor_load_favorite_data(favor_d);
+}
+
+static void favor_gl_item_sel(void *data, Evas_Object *obj, void *event_info)
+{
+       ph_favor_info *f_info;
+       ph_favorite_data *favor_d = data;
+       Elm_Object_Item *item = event_info;
+
+       elm_genlist_item_selected_set(item, EINA_FALSE);
+
+       f_info = elm_object_item_data_get(item);
+       p_retm_if(NULL == f_info, "elm_object_item_data_get() return NULL");
+
+       if (elm_genlist_decorate_mode_get(favor_d->genlist)) {
+               f_info->is_checked = !f_info->is_checked;
+
+               if (f_info->is_checked)
+                       favor_d->checked_cnt++;
+               else
+                       favor_d->checked_cnt--;
+
+               if (favor_d->favorite_list_count == favor_d->checked_cnt)
+                       favor_d->is_all_check = TRUE;
+               else
+                       favor_d->is_all_check = FALSE;
+               elm_check_state_set(favor_d->select_all_checkbox, favor_d->is_all_check);
+
+               elm_genlist_item_fields_update(item, "elm.edit.icon.1", ELM_GENLIST_ITEM_FIELD_CONTENT);
+
+               ph_favor_edit_set_selection_info(favor_d);
+               ph_favor_update_button_status(favor_d);
+       }
+       else {
+               bindtextdomain("contacts", "/opt/ug/res/locale");       // TODO : should be revised
+               ctui_detail_create_view_without_del(favor_d->win, favor_d->navi, favor_d->ug, f_info->contact_id);
+       }
+}
+
+#define N 20
+
+static Eina_Bool favor_append_item_part(void *data)
+{
+       int count;
+       Eina_List *l;
+       ph_favor_info *fd;
+       ph_favorite_data *favor_d = data;
+
+       count = 0;
+       l = eina_list_nth_list(favor_d->favorite_list, favor_d->readed_n);
+       EINA_LIST_FOREACH(l, l, fd) {
+               if (N == count) break;
+               if (!fd) continue;
+               fd->item = elm_genlist_item_append(favor_d->genlist, &itc_favor, fd,
+                               NULL, ELM_GENLIST_ITEM_NONE, favor_gl_item_sel, favor_d);
+               count++;
+       }
+       if (N <= count) {
+               favor_d->readed_n += N;
+               return ECORE_CALLBACK_RENEW;
+       }
+       else {
+               favor_d->list_idler = NULL;
+               return ECORE_CALLBACK_CANCEL;
+       }
+}
+
+static void favor_fill_genlist(ph_favorite_data *favor_d)
+{
+       int count;
+       Eina_List *l;
+       ph_favor_info *fd;
+       p_retm_if(NULL == favor_d->genlist, "Parameter is null");
+
+       PH_DBG("favorite_data_list_count = %d", favor_d->favorite_list_count);
+
+       if (favor_d->list_idler) {
+               ecore_idler_del(favor_d->list_idler);
+               favor_d->list_idler = NULL;
+       }
+
+       favor_d->readed_n = 0;
+       count = 0;
+       EINA_LIST_FOREACH(favor_d->favorite_list, l, fd) {
+               if (N == count) break;
+               if (!fd) continue;
+               fd->item = elm_genlist_item_append(favor_d->genlist, &itc_favor, fd,
+                               NULL, ELM_GENLIST_ITEM_NONE, favor_gl_item_sel, favor_d);
+               count++;
+       }
+
+       if (N <= count) {
+               favor_d->readed_n = N;
+               favor_d->list_idler = ecore_idler_add(favor_append_item_part, favor_d);
+       }
+}
+
+void ph_favor_update_button_status(ph_favorite_data *favor_d)
+{
+       p_retm_if(NULL == favor_d || NULL == favor_d->navi_btn, "Navi button is null");
+       if (!favor_d->genlist || (0 == favor_d->favorite_list_count && EINA_FALSE == elm_genlist_decorate_mode_get(favor_d->genlist))
+                       || (0 == favor_d->checked_cnt && EINA_TRUE == elm_genlist_decorate_mode_get(favor_d->genlist)))
+               elm_object_item_disabled_set(favor_d->navi_btn, EINA_TRUE);
+       else
+               elm_object_item_disabled_set(favor_d->navi_btn, EINA_FALSE);
+}
+
+static char *favor_gl_label_get(void *data, Evas_Object *obj, const char *part)
+{
+       char buf[PATH_MAX] = {0};
+       ph_favor_info * f_info =data;
+
+       if (0 == strcmp(part, "elm.text")) {
+               if (f_info->display && *f_info->display)
+                       snprintf(buf, sizeof(buf), "%s", f_info->display);
+               else {
+                       if (!f_info->number_loaded) {
+                               f_info->number = SAFE_STRDUP(favor_get_contact_number(f_info->contact_id));
+                               f_info->number_loaded = true;
+                       }
+
+                       if (!f_info->number || !*f_info->number)
+                               return strdup(S_(PH_SYS_BODY_NONAME));
+                       else
+                               snprintf(buf, sizeof(buf), "%s", f_info->number);
+               }
+               return strdup(buf);
+       }
+       else
+               return NULL;
+}
+
+static Evas_Object *favor_gl_icon_get(void *data, Evas_Object *obj, const char *part)
+{
+       ph_favor_info * f_info = data;
+       ph_favorite_data *favor_d = evas_object_data_get(obj, KEY_FAVOR_DATA);
+
+       if (0 == strcmp(part, "elm.icon")) {
+               Evas_Object *ic;
+               char buf[PATH_MAX]={0};
+               if (f_info->img_path) {
+                       snprintf(buf, sizeof(buf), "%s", f_info->img_path);
+
+                       ic = elm_icon_add(obj);
+                       p_retvm_if(NULL == ic, NULL, "elm_icon_add is failed");
+                       elm_icon_prescale_set(ic, PH_FAVOR_LIST_ICON_SIZE);
+                       elm_icon_file_set(ic, buf, NULL);
+                       evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
+                       return ic;
+               }
+               else return NULL;
+       }
+       else if (0 == strcmp(part, "elm.edit.icon.1")) {
+               Evas_Object *check = elm_check_add(obj);
+               elm_check_state_pointer_set(check, &(f_info->is_checked));
+               evas_object_smart_callback_add(check, "changed", ph_favor_edit_check_changed_cb, favor_d);
+               return check;
+       }
+       else
+               return NULL;
+}
+
+static void favor_gl_move(void *data, Evas_Object *obj, void *event_info)
+{
+       int ori_favor_id = -1;
+       int front_favor_id = -1;
+       int back_favor_id = -1;
+       ph_favor_info *f_info;
+       Elm_Object_Item *prev_item;
+       Elm_Object_Item *next_item;
+       Elm_Object_Item *it = event_info;
+
+       f_info = elm_object_item_data_get(it);
+       p_retm_if(NULL == f_info, "elm_object_item_data_get() return NULL");
+       ori_favor_id = f_info->id;
+
+       prev_item = elm_genlist_item_prev_get(it);
+       if (prev_item) {
+               f_info = elm_object_item_data_get(prev_item);
+               if (f_info)
+                       front_favor_id = f_info->id;
+       }
+
+       next_item = elm_genlist_item_next_get(it);
+       if (next_item) {
+               f_info = elm_object_item_data_get(next_item);
+               if (f_info)
+                       back_favor_id = f_info->id;
+       }
+
+       PH_DBG("ori %d front %d back %d", ori_favor_id, front_favor_id, back_favor_id);
+       if (-1 != ori_favor_id && -1 != front_favor_id && -1 != back_favor_id)
+               contacts_svc_favorite_order(ori_favor_id, front_favor_id, back_favor_id);
+}
+
+static void favor_edit_btn_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       ph_favorite_data *favor_d = data;
+       p_retm_if(NULL == favor_d, "parameter(favor_d) is NULL");
+
+       ph_favor_edit_mode_start(favor_d);
+}
+
+static void favor_popup_response_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       ph_favorite_data *favor_d = data;
+       evas_object_del(favor_d->popup);
+       favor_d->popup = NULL;
+}
+
+static void favor_add_start_cb(void *data, void *data2)
+{
+       ph_favorite_data *favor_d = data;
+       int *contact_id = data2;
+       int ret;
+       PH_DBG("%d", *contact_id);
+       ret = contacts_svc_set_favorite(CTS_FAVOR_CONTACT, *contact_id);
+       if (ret < CTS_SUCCESS) {
+               favor_d->popup = phone_create_popup(favor_d->win, S_(PH_SYS_POP_ALREDY_EXISTS), 1.5);
+               evas_object_smart_callback_add(favor_d->popup, "timeout", favor_popup_response_cb, favor_d);
+       }
+}
+
+static void favor_add_btn_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       ph_favorite_data *favor_d = data;
+       favor_d->child_ug = phone_launch_contact_list_ug(favor_d->ug, CT_UG_REQUEST_SELECT_CONTACT,
+                       favor_add_start_cb, favor_destroy_child_ug, data);
+}
+
+static Evas_Object* favor_create_genlist(ph_favorite_data * favor_d)
+{
+       Evas_Object *genlist = elm_genlist_add(favor_d->box);
+       p_retvm_if(NULL == genlist, NULL, "elm_genlist_add() return NULL");
+
+       evas_object_size_hint_weight_set(genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       evas_object_size_hint_align_set(genlist, EVAS_HINT_FILL, EVAS_HINT_FILL);
+       elm_genlist_homogeneous_set(genlist, EINA_TRUE);
+
+       evas_object_data_set(genlist, KEY_FAVOR_DATA, favor_d);
+       elm_genlist_block_count_set(genlist, 10);
+
+       if (!favor_d->ug)
+               evas_object_smart_callback_add(genlist, "moved", favor_gl_move, NULL);
+       
+       return genlist;
+}
+
+static void favor_fill_layout(ph_favorite_data *favor_d)
+{
+       if (0 < favor_d->favorite_list_count) {
+               if (favor_d->select_all_checkbox)
+                       elm_check_state_set(favor_d->select_all_checkbox, EINA_FALSE);
+               favor_d->checked_cnt = 0;
+
+               if (NULL == favor_d->genlist) {
+                       favor_d->box = elm_box_add(favor_d->layout);
+                       evas_object_size_hint_weight_set(favor_d->box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+                       evas_object_show(favor_d->box);
+                       elm_object_part_content_set(favor_d->layout, "elm.swallow.content", favor_d->box);
+
+                       favor_d->genlist = favor_create_genlist(favor_d);
+                       evas_object_show(favor_d->genlist);
+                       elm_box_pack_end(favor_d->box, favor_d->genlist);
+                       favor_fill_genlist(favor_d);
+               }
+               else {
+                       elm_genlist_clear(favor_d->genlist);
+                       favor_fill_genlist(favor_d);
+               }
+       }
+       else {
+               Evas_Object *noc;
+               noc = phone_create_nocontents(favor_d->layout, T_(PH_GET_TEXT_BASIC, PHTEXT_NO_FAVORITES));
+               elm_object_part_content_set(favor_d->layout, "elm.swallow.content", noc);
+               favor_d->genlist = NULL;
+               favor_d->box = NULL;
+       }
+}
+
+static void favor_data_changed_cb(void *data)
+{
+       ph_favorite_data *favor_d = data;
+       p_retm_if(NULL == favor_d, "favor_d is null");
+
+       favor_load_list(favor_d);
+       favor_fill_layout(favor_d);
+       ph_favor_update_button_status(favor_d);
+}
+
+static ph_favor_info* favor_find_info_by_contact_id (ph_favorite_data *favor_d, int contact_id)
+{
+       ph_favor_info *f_info;
+       Eina_List *l;
+       EINA_LIST_FOREACH(favor_d->favorite_list, l, f_info) {
+               if (!f_info) continue;
+               if (f_info->contact_id == contact_id)
+                       return f_info;
+       }
+       return NULL;
+}
+
+static int favor_set_updated_data(ph_favorite_data *favor_d, int ab_id)
+{
+       CTSiter *iter;
+       int contact_id;
+       int ret;
+
+       ret = contacts_svc_get_updated_contacts(ab_id, favor_d->version, &iter);
+       if (CTS_SUCCESS != ret) {
+               if (CTS_ERR_DB_RECORD_NOT_FOUND == ret)
+                       return TRUE;
+               ERR("contacts_svc_get_updated_contacts is failed(%d)", ret);
+               return FALSE;
+       }
+
+       while (CTS_SUCCESS == contacts_svc_iter_next(iter)) {
+               CTSvalue *value = NULL;
+               CTSvalue *row_info = NULL;
+               CTSstruct *contact = NULL;
+               ph_favor_info *f_info;
+               int type;
+               int ver;
+
+               row_info = contacts_svc_iter_get_info(iter);
+               contact_id = contacts_svc_value_get_int(row_info, CTS_LIST_CHANGE_ID_INT);
+               type = contacts_svc_value_get_int(row_info, CTS_LIST_CHANGE_TYPE_INT);
+               ver = contacts_svc_value_get_int(row_info, CTS_LIST_CHANGE_VER_INT);
+               if (favor_d->version < ver)
+                       favor_d->version = ver;
+
+               switch (type) {
+               case CTS_OPERATION_UPDATED :
+                       contacts_svc_get_contact(contact_id, &contact);
+                       f_info = favor_find_info_by_contact_id(favor_d, contact_id);
+                       if (f_info) {
+                               ret = contacts_svc_struct_get_value(contact, CTS_CF_NAME_VALUE, &value);
+                               if (ret < CTS_SUCCESS) {
+                                       ERR("contacts_svc_struct_get_value is failed");
+                                       contacts_svc_struct_free(contact);
+                                       break;
+                               }
+                               else {
+                                       free(f_info->display);
+                                       f_info->display = phone_get_display_name_from_value(value, CTS_NAME_VAL_DISPLAY_STR,
+                                                       CTS_NAME_VAL_FIRST_STR, CTS_NAME_VAL_LAST_STR);
+                                       f_info->number_loaded = false;
+                                       free(f_info->number);
+                                       f_info->number = NULL;
+                                       free(f_info->img_path);
+                                       ret = contacts_svc_struct_get_value(contact, CTS_CF_BASE_INFO_VALUE, &value);
+                                       if (ret < CTS_SUCCESS) {
+                                               ERR("contacts_svc_struct_get_value is failed");
+                                               contacts_svc_struct_free(contact);
+                                               f_info->img_path = NULL;
+                                               break;
+                                       }
+                                       f_info->img_path = contacts_svc_value_steal_str(value, CTS_BASE_VAL_IMG_PATH_STR);
+                               }
+                               elm_genlist_item_update(f_info->item);
+                       }
+                       contacts_svc_struct_free(contact);
+                       break;
+               case CTS_OPERATION_DELETED :
+                       f_info = favor_find_info_by_contact_id(favor_d, contact_id);
+                       if (!f_info) break;
+                       favor_d->favorite_list = eina_list_remove(favor_d->favorite_list, f_info);
+                       favor_d->favorite_list_count--;
+                       elm_object_item_del(f_info->item);
+                       free(f_info->display);
+                       free(f_info->img_path);
+                       free(f_info->number);
+                       free(f_info);
+                       break;
+               case CTS_OPERATION_INSERTED :
+               default :
+                       break;
+               }
+               contacts_svc_value_free(row_info);
+       }
+       contacts_svc_iter_remove(iter);
+       return TRUE;
+}
+
+static void favor_contact_data_changed_cb(void *data)
+{
+       PH_FN_CALL;
+       ph_favorite_data *favor_d = data;
+       CTSiter *ab_iter;
+       int ab_id;
+       int ret;
+       p_retm_if(NULL == favor_d, "favor_d is null");
+
+       ret = favor_set_updated_data(favor_d, 0);
+       if (!ret) {
+               ERR("favor_set_updated_data is failed(%d)", ret);
+               return;
+       }
+
+       ret = contacts_svc_get_list(CTS_LIST_ALL_ADDRESSBOOK, &ab_iter);
+       if (CTS_SUCCESS != ret) {
+               ERR("contacts_svc_get_list is failed(%d)", ret);
+               return;
+       }
+
+       while (CTS_SUCCESS == contacts_svc_iter_next(ab_iter)) {
+               CTSvalue *info;
+               info = contacts_svc_iter_get_info(ab_iter);
+               ab_id = contacts_svc_value_get_int(info, CTS_LIST_ADDRESSBOOK_ID_INT);
+               ret = favor_set_updated_data(favor_d, ab_id);
+               if (!ret) {
+                       ERR("favor_set_updated_data is failed");
+                       contacts_svc_iter_remove(ab_iter);
+                       return;
+               }
+       }
+       contacts_svc_iter_remove(ab_iter);
+
+       if (favor_d->favorite_list_count <= 0)
+               favor_fill_layout(favor_d);
+
+       ph_favor_update_button_status(favor_d);
+}
+
+static void favor_view_delete_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+       ph_favorite_data *favor_d = data;
+       int ret;
+       p_retm_if(NULL == favor_d, "favor_d is null");
+
+       if (favor_d->p_info) {
+               favor_d->p_info->alive = false;
+               pthread_join(favor_d->p_info->thread, NULL);
+               ret = contacts_svc_end_trans(false);
+               p_warn_if(ret < CTS_SUCCESS, "contacts_svc_end_trans() Failed(%d)", ret);
+               ecore_timer_del(favor_d->p_info->timer);
+               free(favor_d->p_info);
+       }
+       contacts_svc_unsubscribe_change_with_data(CTS_SUBSCRIBE_CONTACT_CHANGE,
+                       favor_contact_data_changed_cb, favor_d);
+       contacts_svc_unsubscribe_change_with_data(CTS_SUBSCRIBE_FAVORITE_CHANGE,
+                       favor_data_changed_cb, favor_d);
+
+       if (favor_d->favorite_list)
+               favor_free_data(favor_d->favorite_list);
+
+       if (favor_d->list_idler)
+               ecore_idler_del(favor_d->list_idler);
+
+       if (favor_d->popup)
+               evas_object_del(favor_d->popup);
+
+       free(favor_d);
+}
+
+static void favor_set_genlist_item_style()
+{
+       itc_favor.item_style = "1text.1icon.5";
+       itc_favor.func.text_get = favor_gl_label_get;
+       itc_favor.func.content_get = favor_gl_icon_get;
+       itc_favor.func.state_get = NULL;
+       itc_favor.func.del = NULL;
+       itc_favor.decorate_all_item_style = "edit_default";
+
+       itc_favor_one.item_style = "1text.1icon.5";
+       itc_favor_one.func.text_get = favor_gl_label_get;
+       itc_favor_one.func.content_get = favor_gl_icon_get;
+       itc_favor_one.func.state_get = NULL;
+       itc_favor_one.func.del = NULL;
+       itc_favor_one.decorate_all_item_style = "edit_default";
+}
+
+static int favor_create_layout(ph_favorite_data *favor_d, Evas_Object *parent)
+{
+       Evas_Object *layout;
+
+       favor_d->navi = parent;
+       layout = phone_create_layout(favor_d->navi, false);
+       p_retvm_if(NULL == layout, -1, "phone_create_layout is failed");
+       favor_d->layout = layout;
+
+       favor_set_genlist_item_style();
+       favor_load_list(favor_d);
+       favor_fill_layout(favor_d);
+
+       evas_object_event_callback_add(favor_d->layout, EVAS_CALLBACK_DEL,
+                       favor_view_delete_cb, favor_d);
+
+       contacts_svc_subscribe_change(CTS_SUBSCRIBE_FAVORITE_CHANGE,
+                       favor_data_changed_cb, favor_d);
+       contacts_svc_subscribe_change(CTS_SUBSCRIBE_CONTACT_CHANGE,
+                       favor_contact_data_changed_cb, favor_d);
+       return 0;
+}
+
+API void phone_favor_set_navi(Evas_Object *layout, int mode)
+{
+       PH_FN_CALL;
+       ph_favorite_data *favor_d = evas_object_data_get(layout, KEY_FAVOR_DATA);
+       Elm_Object_Item *navi_it;
+       Evas_Object *cbar;
+       Evas_Object *l_btn;
+       navi_it = elm_naviframe_bottom_item_get(favor_d->navi);
+       p_retm_if(NULL == navi_it, "navi item is NULL");
+       cbar = elm_object_item_part_content_get(navi_it, "controlbar");
+       if (cbar)
+               phone_cbar_item_clear(cbar);
+       else {
+               cbar = elm_toolbar_add(favor_d->navi);
+               elm_toolbar_shrink_mode_set(cbar, ELM_TOOLBAR_SHRINK_EXPAND);
+               elm_object_item_part_content_set(navi_it, "controlbar", cbar);
+       }
+
+       if (favor_d->ug) {
+               l_btn = phone_naviframe_btn(favor_d->navi, S_(PH_SYS_SK_CANCEL));
+               evas_object_smart_callback_add(l_btn, "clicked", ph_favor_edit_cancel_cb, favor_d);
+               elm_object_item_part_content_set(favor_d->navi_item, "prev_btn", l_btn);
+       }
+       else {
+               if (mode == PH_FAVOR_MODE_DEFAULT) {
+                       favor_d->navi_btn = elm_toolbar_item_append(cbar, IMG_EDIT_ICON, NULL, favor_edit_btn_cb, favor_d);
+                       phone_toolbar_disalbed_item_append(cbar, 1);
+                       elm_toolbar_item_append(cbar, IMG_ADD_ICON, NULL, favor_add_btn_cb, favor_d);
+                       phone_toolbar_disalbed_item_append(cbar, 1);
+
+                       l_btn = elm_button_add(favor_d->navi);
+                       evas_object_smart_callback_add(l_btn, "clicked", phone_back_btn_clicked_cb, favor_d->win);
+                       elm_object_style_set(l_btn, "naviframe/back_btn/default");
+                       elm_object_item_part_content_set(favor_d->navi_item, "prev_btn", l_btn);
+               }
+               else if (mode == PH_FAVOR_MODE_EDIT) {
+                       favor_d->navi_btn = elm_toolbar_item_append(cbar, IMG_DELETE_ICON, NULL, ph_favor_edit_del_btn_cb, favor_d);
+                       phone_toolbar_disalbed_item_append(cbar, 3);
+                       l_btn = phone_naviframe_btn(favor_d->navi, S_(PH_SYS_SK_CANCEL));
+                       evas_object_smart_callback_add(l_btn, "clicked", ph_favor_edit_cancel_cb, favor_d);
+                       elm_object_item_part_content_set(favor_d->navi_item, "prev_btn", l_btn);
+               }
+               ph_favor_update_button_status(favor_d);
+       }
+}
+
+Evas_Object* phone_create_favorite_view(void *ug, Evas_Object *win, Evas_Object *navi)
+{
+       int ret;
+       ph_favorite_data *favor_d = calloc(1, sizeof(ph_favorite_data));
+       p_retvm_if(NULL == favor_d, NULL, "Fail to calloc ph_favorite_data");
+       favor_d->ug = ug;
+       favor_d->win = win;
+       favor_d->navi_item = elm_naviframe_bottom_item_get(navi);
+       ret = favor_create_layout(favor_d, navi);
+       if (ret < 0) {
+               free(favor_d);
+               return NULL;
+       }
+
+       evas_object_data_set(favor_d->layout, KEY_FAVOR_DATA, favor_d);
+       return favor_d->layout;
+}
+
+void phone_favor_view_reset(Evas_Object *base)
+{
+       PH_FN_CALL;
+       ph_favorite_data *favor_d;
+       Elm_Object_Item *item;
+
+       favor_d = evas_object_data_get(base, KEY_FAVOR_DATA);
+       p_retm_if(NULL == favor_d, "favor_d is null");
+
+       if (favor_d->child_ug) {
+               ug_destroy(favor_d->child_ug);
+               favor_d->child_ug = NULL;
+       }
+
+       item = elm_naviframe_bottom_item_get(favor_d->navi);
+       if (elm_naviframe_top_item_get(favor_d->navi) != item)
+               elm_naviframe_item_pop_to(item);
+       else if (favor_d->genlist && elm_genlist_decorate_mode_get(favor_d->genlist))
+               ph_favor_edit_mode_end(favor_d, false);
+       favor_d->navi_btn = NULL;
+}
diff --git a/lib/phoneui/ph-favorite-view.h b/lib/phoneui/ph-favorite-view.h
new file mode 100755 (executable)
index 0000000..879494e
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * 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 __PH_FAVORTIE_VIEW_H__
+#define __PH_FAVORTIE_VIEW_H__
+
+typedef struct
+{
+       Evas_Object *win;
+       Evas_Object *base;
+       Evas_Object *navi;
+       Elm_Object_Item *navi_item;
+       Evas_Object *layout;
+       Evas_Object *cbar;
+       Elm_Object_Item *navi_btn;
+       Evas_Object *genlist;
+       Evas_Object *popup;
+       Evas_Object *box;
+       Evas_Object *select_all_checkbox;
+       Eina_List *favorite_list;
+       Eina_Bool is_all_check;
+       int checked_cnt;
+       int favorite_list_count;
+       int readed_n;
+       int version;
+       Ecore_Idler *list_idler;
+       void *ug;
+       void *child_ug;
+       ph_progress_info *p_info;
+}ph_favorite_data;
+
+void ph_favor_update_button_status(ph_favorite_data *favor_d);
+
+
+#endif /* __PH_FAVORTIE_VIEW_H__ */
+
diff --git a/lib/phoneui/ph-front-main.c b/lib/phoneui/ph-front-main.c
new file mode 100755 (executable)
index 0000000..cf9c1db
--- /dev/null
@@ -0,0 +1,180 @@
+/*
+ * 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 <ui-gadget-module.h>
+#include <vconf.h>
+
+#include "phone.h"
+#include "phone-ug.h"
+#include "phone-ui.h"
+#include "ph-front-view.h"
+
+void *phoneui_on_create(struct ui_gadget *ug, enum ug_mode mode, bundle *data, void *priv)
+{
+       PH_FN_CALL;
+       int ret;
+       Evas_Object *bg;
+       Evas_Object *parent;
+       Evas_Object *layout;
+       ph_phoneui_data *phoneui_d;
+
+       if (!ug || !priv)
+               return NULL;
+
+       bindtextdomain(PACKAGE, LOCALEDIR);
+
+       ret = contacts_svc_connect();
+       p_retvm_if(ret < CTS_SUCCESS, NULL, "contacts_svc_connect() Failed(%d)", ret);
+
+       parent = ug_get_parent_layout(ug);
+       if (!parent)
+               return NULL;
+
+       phoneui_d = priv;
+       phoneui_d->win = ug_get_window();
+       phoneui_d->select_tab = PH_VIEW_NONE;
+       phoneui_d->ug = ug;
+
+       layout = ph_front_create_toolbar(phoneui_d);
+
+       bg = phone_create_bg(layout);
+       if (NULL == bg) {
+               PH_DBG("phone_create_bg() return NULL");
+               ret = contacts_svc_disconnect();
+               p_warn_if(ret < CTS_SUCCESS, "contacts_svc_disconnect() Failed(%d)", ret);
+               return NULL;
+       }
+
+       return layout;
+}
+
+void phoneui_on_start(struct ui_gadget *ug, bundle *data, void *priv)
+{
+       PH_FN_CALL;
+       ph_phoneui_data *phoneui_d = priv;
+       int index;
+       int ret;
+       ret = vconf_get_int(PH_START_VIEW, &index);
+       if (ret < 0 || PH_VIEW_MAX <= index || index <= PH_VIEW_NONE) {
+               ERR("vconf_get_int() Failed(%d)", ret);
+               index = PH_VIEW_DIALER;
+       }
+
+       elm_toolbar_item_selected_set(phoneui_d->item[index], EINA_TRUE);
+
+       phoneui_d->timer = ecore_timer_add(3.0, phone_front_view_load_timer, phoneui_d);
+       PH_FN_END;
+}
+
+void phoneui_on_pause(struct ui_gadget *ug, bundle *data, void *priv)
+{
+}
+
+void phoneui_on_resume(struct ui_gadget *ug, bundle *data, void *priv)
+{
+}
+
+void phoneui_on_destroy(struct ui_gadget *ug, bundle *data, void *priv)
+{
+       PH_FN_CALL;
+       if (!ug)
+               return;
+
+       evas_object_del(ug_get_layout(ug));
+       contacts_svc_disconnect();
+       PH_FN_END;
+}
+
+void phoneui_on_message(struct ui_gadget *ug, bundle *msg, bundle *data, void *priv)
+{
+}
+
+void phoneui_on_event(struct ui_gadget *ug, enum ug_event event, bundle *data, void *priv)
+{
+       ph_phoneui_data *phoneui_d = priv;
+       switch (event) {
+               case UG_EVENT_REGION_CHANGE:
+                       phone_front_view_region_changed(phoneui_d);
+                       break;
+               default:
+                       break;
+       }
+}
+
+void phoneui_on_key_event(struct ui_gadget *ug, enum ug_key_event event, bundle *data, void *priv)
+{
+}
+
+API int UG_MODULE_INIT(struct ug_module_ops *ops)
+{
+       ph_phoneui_data *phoneui_d;
+
+       if (!ops)
+               return -1;
+
+       phoneui_d = calloc(1, sizeof(ph_phoneui_data));
+       if (!phoneui_d)
+               return -1;
+
+       ops->create = phoneui_on_create;
+       ops->start = phoneui_on_start;
+       ops->pause = phoneui_on_pause;
+       ops->resume = phoneui_on_resume;
+       ops->destroy = phoneui_on_destroy;
+       ops->message = phoneui_on_message;
+       ops->event = phoneui_on_event;
+       ops->key_event = phoneui_on_key_event;
+       ops->priv = phoneui_d;
+       ops->opt = UG_OPT_INDICATOR_ENABLE;
+
+       return 0;
+}
+
+API void UG_MODULE_EXIT(struct ug_module_ops *ops)
+{
+       PH_FN_CALL;
+       if (!ops)
+               return;
+       ops->priv = NULL;
+}
+
+API ph_phoneui_data* phone_create_phoneui(Evas_Object *win)
+{
+       PH_FN_CALL;
+       Evas_Object *bg;
+       Evas_Object *layout;
+       ph_phoneui_data *phoneui_d = calloc(1, sizeof(ph_phoneui_data));
+       phoneui_d->win = win;
+       phoneui_d->select_tab = PH_VIEW_NONE;
+
+       layout = ph_front_create_toolbar(phoneui_d);
+
+       if (NULL == layout) {
+               PH_DBG("layout_main is null");
+               free(phoneui_d);
+               return NULL;
+       }
+
+       bg = phone_create_bg(layout);
+       if (NULL == bg) {
+               PH_DBG("phone_create_bg() return NULL");
+               free(phoneui_d);
+               return NULL;
+       }
+
+       return phoneui_d;
+}
+
diff --git a/lib/phoneui/ph-front-view.c b/lib/phoneui/ph-front-view.c
new file mode 100755 (executable)
index 0000000..2babe0b
--- /dev/null
@@ -0,0 +1,382 @@
+/*
+ * 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 <ui-gadget-module.h>
+#include <bundle.h>
+#include <vconf.h>
+#include <aul.h>
+#include <appsvc.h>
+
+#include "phone.h"
+#include "phone-ui.h"
+#include "phone-log.h"
+#include "phone-dialer.h"
+#include "ph-front-view.h"
+
+// for removing build warning ////////////////////////////////////
+void ctui_change_background(void *data, bool is_background);
+void ctui_list_view_reset(void *clist_d);
+Evas_Object* ctui_create_phone_list_view(void *ug, Evas_Object *win, Evas_Object *navi);
+void ct_list_navi_set(int mode, void *clist_d);
+////////////////////////////////////////////////////////
+
+static void front_view_reset_current_sub_view(ph_phoneui_data *phoneui_d)
+{
+       PH_FN_CALL;
+       p_ret_if(phoneui_d->select_tab <= PH_VIEW_NONE || PH_VIEW_MAX <= phoneui_d->select_tab);
+       if (phoneui_d->sub_view[phoneui_d->select_tab]) {
+               switch (phoneui_d->select_tab) {
+               case PH_VIEW_DIALER:
+                       phone_dialer_view_reset(phoneui_d->sub_view[PH_VIEW_DIALER]);
+                       break;
+               case PH_VIEW_CONTACT :
+                       ctui_list_view_reset(evas_object_data_get(phoneui_d->navi, "clist_d"));
+                       break;
+               case PH_VIEW_LOG :
+                       phone_log_view_reset(phoneui_d->navi);
+                       break;
+               case PH_VIEW_FAVORITE :
+                       phone_favor_view_reset(phoneui_d->sub_view[PH_VIEW_FAVORITE]);
+                       break;
+               }
+       }
+}
+
+static void front_view_load_sub_view(ph_phoneui_data *phoneui_d, int tab_index)
+{
+       PH_FN_CALL;
+       switch (tab_index) {
+       case PH_VIEW_CONTACT:
+               phoneui_d->sub_view[PH_VIEW_CONTACT] = ctui_create_phone_list_view(phoneui_d->ug,
+                               phoneui_d->win, phoneui_d->navi);
+               return;
+       case PH_VIEW_DIALER:
+               phoneui_d->sub_view[tab_index] = phone_create_dialer_view(phoneui_d->ug,
+                               phoneui_d->win, phoneui_d->navi);
+               break;
+       case PH_VIEW_LOG:
+               phoneui_d->sub_view[tab_index] = phone_create_log_view(phoneui_d->ug,
+                               phoneui_d->win, phoneui_d->navi);
+               break;
+       case PH_VIEW_FAVORITE:
+               phoneui_d->sub_view[tab_index] = phone_create_favorite_view(phoneui_d->ug,
+                               phoneui_d->win, phoneui_d->navi);
+               break;
+       default:
+               return;
+       };
+}
+
+static void front_view_show_sub_view(ph_phoneui_data *phoneui_d, int tab_index)
+{
+       PH_FN_CALL;
+       Evas_Object *view;
+       p_retm_if(tab_index <= PH_VIEW_NONE || PH_VIEW_MAX <= tab_index, "tab index is invalid");
+       p_retm_if(phoneui_d->select_tab == tab_index, "The tab is already shown");
+
+       front_view_reset_current_sub_view(phoneui_d);
+       phone_hide_notify(phoneui_d->navi);
+
+       switch (tab_index) {
+       case PH_VIEW_DIALER:
+               if (NULL == phoneui_d->sub_view[tab_index])
+                       phoneui_d->sub_view[tab_index] = phone_create_dialer_view(phoneui_d->ug,
+                                       phoneui_d->win, phoneui_d->navi);
+               phone_dialer_set_navi(phoneui_d->sub_view[PH_VIEW_DIALER]);
+               phone_dialer_check_focus(phoneui_d->sub_view[PH_VIEW_DIALER]);
+               if(!phoneui_d->ug)
+                       phone_front_view_show_call_app(phoneui_d);
+               break;
+       case PH_VIEW_CONTACT:
+               if (NULL == phoneui_d->sub_view[tab_index]) {
+                       phoneui_d->sub_view[PH_VIEW_CONTACT] = ctui_create_phone_list_view(phoneui_d->ug,
+                                       phoneui_d->win, phoneui_d->navi);
+               }
+               ct_list_navi_set(0, evas_object_data_get(phoneui_d->navi, "clist_d"));
+               break;
+       case PH_VIEW_LOG:
+               if (NULL == phoneui_d->sub_view[tab_index])
+                       phoneui_d->sub_view[tab_index] = phone_create_log_view(phoneui_d->ug,
+                                       phoneui_d->win, phoneui_d->navi);
+               if (!phoneui_d->ug)
+                       phone_log_missed_info_update(phoneui_d->navi);
+               phone_log_set_navi(phoneui_d->navi);
+               break;
+       case PH_VIEW_FAVORITE:
+               if (NULL == phoneui_d->sub_view[tab_index])
+                       phoneui_d->sub_view[tab_index] = phone_create_favorite_view(phoneui_d->ug,
+                                       phoneui_d->win, phoneui_d->navi);
+               phone_favor_set_navi(phoneui_d->sub_view[tab_index], PH_FAVOR_MODE_DEFAULT);
+               break;
+       default:
+               return;
+       }
+       phoneui_d->select_tab = tab_index;
+       view = elm_object_part_content_get(phoneui_d->layout, "elm.swallow.content");
+       if (view) {
+               elm_object_part_content_unset(phoneui_d->layout, "elm.swallow.content");
+               evas_object_hide(view);
+       }
+       elm_object_part_content_set(phoneui_d->layout, "elm.swallow.content", phoneui_d->sub_view[tab_index]);
+       evas_object_show(phoneui_d->sub_view[tab_index]);
+}
+
+static Eina_Bool front_view_load_all_sub_view(void *data)
+{
+       PH_FN_CALL;
+       ph_phoneui_data *phoneui_d = data;
+       int i;
+
+       for (i=PH_VIEW_DIALER;i<PH_VIEW_MAX;i++) {
+               if (NULL == phoneui_d->sub_view[i]) {
+                       front_view_load_sub_view(phoneui_d, i);
+                       return ECORE_CALLBACK_RENEW;
+               }
+       }
+       phoneui_d->idler = NULL;
+       return ECORE_CALLBACK_CANCEL;
+}
+
+API Eina_Bool phone_front_view_load_timer(void *data)
+{
+       ph_phoneui_data *phoneui_d = data;
+       phoneui_d->idler = ecore_idler_add(front_view_load_all_sub_view, phoneui_d);
+       phoneui_d->timer = NULL;
+       return ECORE_CALLBACK_CANCEL;
+}
+
+static void front_view_change_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       PH_FN_CALL;
+       int i;
+       Elm_Object_Item *selected_it;
+       ph_phoneui_data *phoneui_d = data;
+
+       selected_it = elm_toolbar_selected_item_get(obj);
+
+       for (i=PH_VIEW_DIALER;i<PH_VIEW_MAX;i++) {
+               if (phoneui_d->item[i])
+                       if (selected_it == phoneui_d->item[i]) break;
+       }
+       PH_DBG("cur sel : %d, sel index : %d", phoneui_d->select_tab, i);
+       front_view_show_sub_view(phoneui_d, i);
+}
+
+static void front_view_delete_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+       PH_FN_CALL;
+       ph_phoneui_data *phoneui_d = data;
+       int i;
+
+       p_retm_if(NULL == phoneui_d, "phoneui_d is null");
+
+       if (PH_VIEW_NONE != phoneui_d->select_tab) {
+               int ret = vconf_set_int(PH_START_VIEW, phoneui_d->select_tab);
+               p_warn_if(0 != ret, "vconf_set_int() Failed(%d)", ret);
+       }
+
+       if (phoneui_d->contact_ug) {
+               ug_destroy(phoneui_d->contact_ug);
+               phoneui_d->sub_view[PH_VIEW_CONTACT] = NULL;
+       }
+
+       for (i=0;i<PH_VIEW_MAX;i++) {
+               if (phoneui_d->sub_view[i]) {
+                       evas_object_del(phoneui_d->sub_view[i]);
+               }
+       }
+
+       if (phoneui_d->idler)
+               ecore_idler_del(phoneui_d->idler);
+
+       if (phoneui_d->timer)
+               ecore_timer_del(phoneui_d->timer);
+
+       free(phoneui_d);
+       PH_FN_END;
+}
+
+Evas_Object* ph_front_create_toolbar(ph_phoneui_data *phoneui_d)
+{
+       Evas_Object *base;
+       Evas_Object *layout;
+       Evas_Object *naviframe;
+       Evas_Object *toolbar;
+       Elm_Object_Item *navi_it;
+
+       base = elm_layout_add(phoneui_d->win);
+       p_retvm_if(NULL == base, NULL, "elm_layout_add() Failed");
+       evas_object_size_hint_weight_set(base, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       elm_layout_theme_set(base, "layout", "application", "default");
+       elm_win_resize_object_add(phoneui_d->win, base);
+       evas_object_show(base);
+
+       naviframe = elm_naviframe_add(base);
+       elm_naviframe_prev_btn_auto_pushed_set(naviframe, EINA_FALSE);
+       elm_object_part_content_set(base, "elm.swallow.content", naviframe);
+       phoneui_d->navi = naviframe;
+
+       layout = elm_layout_add(naviframe);
+       p_retvm_if(NULL == layout, NULL, "elm_layout_add() Failed");
+       elm_layout_theme_set(layout, "layout", "tabbar", "default");
+       phoneui_d->layout = layout;
+
+       toolbar = elm_toolbar_add(naviframe);
+       p_retvm_if(NULL == toolbar, NULL, "elm_toolbar_add() Failed");
+       elm_object_style_set(toolbar, "tabbar");
+       elm_object_part_content_set(layout, "elm.swallow.tabbar", toolbar);
+       phoneui_d->tabbar = toolbar;
+
+       elm_toolbar_shrink_mode_set(toolbar, ELM_TOOLBAR_SHRINK_EXPAND);
+
+       phoneui_d->item[PH_VIEW_DIALER] = elm_toolbar_item_append(toolbar,
+                       IMG_DIALER_ICON, T_(PH_GET_TEXT_BASIC, PHTEXT_DIALER), front_view_change_cb, phoneui_d);
+       phoneui_d->item[PH_VIEW_CONTACT] = elm_toolbar_item_append(toolbar,
+                       IMG_CONTACTS_ICON, S_(PH_SYS_BODY_CONTACTS), front_view_change_cb, phoneui_d);
+       phoneui_d->item[PH_VIEW_LOG] = elm_toolbar_item_append(toolbar,
+                       IMG_LOGS_ICON, T_(PH_GET_TEXT_BASIC, PHTEXT_LOGS), front_view_change_cb, phoneui_d);
+       phoneui_d->item[PH_VIEW_FAVORITE] = elm_toolbar_item_append(toolbar,
+                       IMG_FAVORITE_ICON, T_(PH_GET_TEXT_BASIC, PHTEXT_FAVORITES), front_view_change_cb, phoneui_d);
+
+       navi_it = elm_naviframe_item_push(naviframe, NULL, NULL, NULL, layout, NULL);
+       elm_naviframe_item_title_visible_set(navi_it, EINA_FALSE);
+       evas_object_event_callback_add(phoneui_d->layout, EVAS_CALLBACK_DEL,
+                       front_view_delete_cb, phoneui_d);
+
+       elm_toolbar_select_mode_set(toolbar, ELM_OBJECT_SELECT_MODE_ALWAYS);
+       PH_FN_END;
+       return base;
+}
+
+API void phone_front_view_region_changed(ph_phoneui_data *phoneui_d)
+{
+       if (phoneui_d && phoneui_d->sub_view[PH_VIEW_LOG])
+               phone_log_views_update(phoneui_d->navi);
+}
+
+API void phone_front_view_pause(ph_phoneui_data *phoneui_d)
+{
+       if (phoneui_d && phoneui_d->sub_view[PH_VIEW_LOG])
+               phone_log_set_background(phoneui_d->navi, true);
+       if (phoneui_d && phoneui_d->sub_view[PH_VIEW_CONTACT])
+               ctui_change_background(phoneui_d->navi, true);
+}
+
+API void phone_front_view_resume(ph_phoneui_data *phoneui_d)
+{
+       if (phoneui_d && phoneui_d->sub_view[PH_VIEW_LOG]) {
+               phone_log_set_background(phoneui_d->navi, false);
+               if (PH_VIEW_LOG == phoneui_d->select_tab)
+                       phone_log_missed_info_update(phoneui_d->navi);
+       }
+       if(phoneui_d && phoneui_d->sub_view[PH_VIEW_CONTACT])
+               ctui_change_background(phoneui_d->navi, false);
+       if (phoneui_d && phoneui_d->sub_view[PH_VIEW_DIALER]) {
+               if (PH_VIEW_DIALER == phoneui_d->select_tab)
+                       phone_dialer_view_resume(phoneui_d->sub_view[PH_VIEW_DIALER]);
+       }
+}
+
+API void phone_front_view_reset(ph_phoneui_data *phoneui_d, int tab_index, char *val)
+{
+       PH_FN_CALL;
+       int call_launched = FALSE;
+       Evas_Object *view;
+
+       front_view_reset_current_sub_view(phoneui_d);
+       if (phoneui_d->sub_view[PH_VIEW_LOG])
+               phone_log_set_background(phoneui_d->navi, false);
+       if (phoneui_d->sub_view[PH_VIEW_CONTACT])
+               ctui_change_background(phoneui_d->navi, false);
+
+       if(PH_VIEW_NONE != tab_index) {
+               switch (tab_index) {
+               case PH_VIEW_DIALER:
+                       if (NULL == phoneui_d->sub_view[tab_index])
+                               phoneui_d->sub_view[tab_index] = phone_create_dialer_view(phoneui_d->ug, phoneui_d->win, phoneui_d->navi);
+                       if (val)
+                               phone_dialer_view_set_num(phoneui_d->sub_view[PH_VIEW_DIALER], val+4);
+                       else
+                               phone_dialer_view_resume(phoneui_d->sub_view[PH_VIEW_DIALER]);
+
+                       phone_dialer_set_navi(phoneui_d->sub_view[PH_VIEW_DIALER]);
+                       phone_dialer_check_focus(phoneui_d->sub_view[PH_VIEW_DIALER]);
+
+                       if(!phoneui_d->ug)
+                               call_launched = phone_front_view_show_call_app(phoneui_d);
+                       break;
+               case PH_VIEW_LOG:
+                       if (NULL == phoneui_d->sub_view[tab_index])
+                               phoneui_d->sub_view[tab_index] = phone_create_log_view(phoneui_d->ug, phoneui_d->win, phoneui_d->navi);
+                       if (!phoneui_d->ug)
+                               phone_log_missed_info_update(phoneui_d->navi);
+                       phone_log_set_navi(phoneui_d->navi);
+                       break;
+               case PH_VIEW_FAVORITE:
+                       if (NULL == phoneui_d->sub_view[tab_index])
+                               phoneui_d->sub_view[tab_index] = phone_create_favorite_view(phoneui_d->ug, phoneui_d->win, phoneui_d->navi);
+                       phone_favor_set_navi(phoneui_d->sub_view[tab_index], PH_FAVOR_MODE_DEFAULT);
+                       break;
+               default:
+                       break;
+               }
+
+               view = elm_object_part_content_get(phoneui_d->layout, "elm.swallow.content");
+               if (view) {
+                       elm_object_part_content_unset(phoneui_d->layout, "elm.swallow.content");
+                       evas_object_hide(view);
+               }
+               elm_object_part_content_set(phoneui_d->layout, "elm.swallow.content", phoneui_d->sub_view[tab_index]);
+               evas_object_show(phoneui_d->sub_view[tab_index]);
+               phoneui_d->select_tab = tab_index;
+               elm_toolbar_item_selected_set(phoneui_d->item[tab_index], EINA_TRUE);
+               if (!phoneui_d->ug)
+                       vconf_set_int(PH_START_VIEW, tab_index);
+       }
+
+       if (phoneui_d->win && FALSE == call_launched)
+               elm_win_activate(phoneui_d->win);
+       phoneui_d->timer = ecore_timer_add(3.0, phone_front_view_load_timer, phoneui_d);
+}
+
+static int front_view_call_app_check(const char *pkg_name, void *data)
+{
+       int *call_app_launched = data;
+
+       // premise : Only one Call app can be running at a time
+       if (1 == aul_app_is_running(pkg_name)) {
+               aul_open_app(pkg_name);
+               *call_app_launched = TRUE;
+               return 0;
+       }
+       return 1;
+}
+
+API int phone_front_view_show_call_app(ph_phoneui_data *phoneui_d)
+{
+       PH_FN_CALL;
+       bundle * bd;
+       int call_app_launched = FALSE;
+       bd = bundle_create();
+       appsvc_set_operation(bd, APPSVC_OPERATION_CALL);
+       appsvc_set_uri(bd, "tel:");
+       appsvc_get_list(bd, front_view_call_app_check, (void *)&call_app_launched);
+
+       if (call_app_launched)
+               return 1;
+       return 0;
+}
+
diff --git a/lib/phoneui/ph-front-view.h b/lib/phoneui/ph-front-view.h
new file mode 100755 (executable)
index 0000000..883d432
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * 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 __PH_FRONT_VIEW_H__
+#define __PH_FRONT_VIEW_H__
+
+Evas_Object* ph_front_create_toolbar(ph_phoneui_data *phoneui_d);
+
+#endif /* __PH_FRONT_VIEW_H__ */
+
diff --git a/packaging/org.tizen.phone.spec b/packaging/org.tizen.phone.spec
new file mode 100644 (file)
index 0000000..cf9a1d1
--- /dev/null
@@ -0,0 +1,76 @@
+Name:       org.tizen.phone
+Summary:    Phone Application and gadgets
+Version:    0.3.1
+Release:    6
+Group:      Applications
+License:    Flora Software License
+Source0:    %{name}-%{version}.tar.gz
+BuildRequires: pkgconfig(appcore-efl)
+BuildRequires: pkgconfig(contacts-service)
+BuildRequires: pkgconfig(ecore)
+BuildRequires: pkgconfig(appsvc)
+BuildRequires: pkgconfig(ecore-input)
+BuildRequires: pkgconfig(ecore-x)
+BuildRequires: pkgconfig(edje)
+BuildRequires: pkgconfig(eina)
+BuildRequires: pkgconfig(evas)
+BuildRequires: pkgconfig(heynoti)
+BuildRequires: pkgconfig(icu-i18n)
+BuildRequires: pkgconfig(notification)
+BuildRequires: pkgconfig(tapi)
+BuildRequires: pkgconfig(ui-gadget)
+BuildRequires: libug-contacts-devel
+
+BuildRequires:  cmake
+BuildRequires:  edje-bin
+BuildRequires:  embryo-bin
+BuildRequires:  gettext-devel
+
+%description
+Phone application.
+
+%package -n libug-phone-efl
+Summary:    Phone UI gadget library
+Group:      devel
+
+%description -n libug-phone-efl
+Phone UI gadget library.
+
+%package -n libug-phone-devel
+Summary:    Phone UI gadget Header
+Group:      devel
+Requires:   libug-phone-efl = %{version}-%{release}
+
+%description -n libug-phone-devel
+Phone UI gadget Header.
+
+
+%prep
+%setup -q
+
+%build
+%define PREFIX    "/opt/apps/org.tizen.phone"
+export LDFLAGS+=" -Wl,--hash-style=both -Wl,--rpath=/usr/lib -Wl,--rpath=/opt/ug/lib -Wl,--as-needed"
+cmake . -DCMAKE_INSTALL_PREFIX=%{PREFIX}
+make %{?jobs:-j%jobs}
+
+%install
+%make_install
+
+
+%find_lang phone
+
+
+%files
+/opt/apps/org.tizen.phone/bin/phone
+/opt/apps/org.tizen.phone/res/icons/default/small/org.tizen.phone.png
+/opt/share/applications/org.tizen.phone.desktop
+
+
+%files -f phone.lang -n libug-phone-efl
+/opt/ug/res/images/*
+/opt/ug/res/edje/*
+/opt/ug/lib/*
+
+%files -n libug-phone-devel
+/usr/include/phone-ug.h
diff --git a/phone.desktop.in b/phone.desktop.in
new file mode 100644 (file)
index 0000000..f115e98
--- /dev/null
@@ -0,0 +1,26 @@
+Name=Phone
+Name[ko_KR]=전화
+Name[de_DE]=Telefon
+Name[en_GB]=Phone
+Name[en_US]=Phone
+Name[es_ES]=Phone
+Name[fr_FR]=Phone
+Name[it_IT]=Telef.
+Name[ja_JP]=電話
+Name[nl_NL]=Telefoon
+Name[pt_PT]=Telef.
+Name[ru_RU]=Телефон
+Name[tr_TR]=Telefon
+Name[zh_CN]=手机
+Name[zh_HK]=電話
+Name[zh_TW]=電話
+Type=Application
+Exec=@PREFIX@/bin/@PROJECT_NAME@
+Icon=@PKGNAME@.png
+MimeType=
+NoDisplay=False
+Version=0.1.1
+X-TIZEN-TaskManage=False
+X-TIZEN-Multiple=False
+X-TIZEN-Removable=False
+X-TIZEN-Svc=http://tizen.org/appsvc/operation/dial|tel|NULL
diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt
new file mode 100755 (executable)
index 0000000..afd8761
--- /dev/null
@@ -0,0 +1,24 @@
+# for i18n
+
+SET(POFILES en_GB.po en_US.po nl.po de.po zh_HK.po zh_CN.po ru.po ko.po zh_TW.po ja.po es.po el.po it.po tr.po pt.po fr.po)
+
+SET(MSGFMT "/usr/bin/msgfmt")
+
+FOREACH(pofile ${POFILES})
+       SET(pofile ${CMAKE_CURRENT_SOURCE_DIR}/${pofile})
+       MESSAGE("PO: ${pofile}")
+       GET_FILENAME_COMPONENT(absPofile ${pofile} ABSOLUTE)
+       GET_FILENAME_COMPONENT(lang ${absPofile} NAME_WE)
+       SET(moFile ${CMAKE_CURRENT_BINARY_DIR}/${lang}.mo)
+       ADD_CUSTOM_COMMAND(
+               OUTPUT ${moFile}
+               COMMAND ${MSGFMT} -o ${moFile} ${absPofile}
+               DEPENDS ${absPofile}
+               )
+       INSTALL(FILES ${moFile}
+               DESTINATION ${LOCALEDIR}/${lang}/LC_MESSAGES RENAME ${PROJECT_NAME}.mo)
+       SET(moFiles ${moFiles} ${moFile})
+ENDFOREACH(pofile)
+
+MESSAGE(".mo files: ${moFiles}")
+ADD_CUSTOM_TARGET(po ALL DEPENDS ${moFiles})
diff --git a/po/POTFILES.in b/po/POTFILES.in
new file mode 100755 (executable)
index 0000000..32d88ae
--- /dev/null
@@ -0,0 +1,2 @@
+# List of source files containing translatable strings.
+lib/common/ph-text.c
diff --git a/po/de.po b/po/de.po
new file mode 100644 (file)
index 0000000..4dbacb6
--- /dev/null
+++ b/po/de.po
@@ -0,0 +1,77 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2011-12-28 13:08+0900\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: lib/common/ph-text.c:30
+msgid "IDS_PB_ITAB4_DIALLER"
+msgstr "Telefon"
+
+#: lib/common/ph-text.c:31
+msgid "IDS_PB_ITAB4_FAVOURITES"
+msgstr "Favoriten"
+
+#: lib/common/ph-text.c:32
+msgid "IDS_CST_BODY_VOICE_MAIL"
+msgstr "Mailbox"
+
+#: lib/common/ph-text.c:33
+msgid "IDS_CLOG_ITAB4_LOGS"
+msgstr "Protok."
+
+#: lib/common/ph-text.c:34
+msgid "IDS_PB_POP_REQUEST_FAILED"
+msgstr "Anforderung fehlgeschlagen"
+
+#: lib/common/ph-text.c:35
+msgid "IDS_PB_POP_REQUEST_SUCCESS"
+msgstr "Erfolg anfordern"
+
+#: lib/common/ph-text.c:36
+msgid "IDS_CALL_POP_EMERGENCY_CALL"
+msgstr "Notruf"
+
+#: lib/common/ph-text.c:37
+msgid "IDS_CLOG_BODY_NO_LOGS"
+msgstr "Keine Protokolle"
+
+#: lib/common/ph-text.c:38
+msgid "IDS_PB_BODY_NO_FAVOURITES"
+msgstr "Keine Favoriten"
+
+#: lib/common/ph-text.c:39
+msgid "IDS_PB_POP_MAXIMUM_PHONE_NUMBER_LENGTH_EXCEEDED"
+msgstr "Maximale Länge für Telefonnummer überschritten"
+
+#: lib/common/ph-text.c:40
+msgid "IDS_CLOG_POP_DELETING_LOGS_ING"
+msgstr "Protokolle werden gelöscht..."
+
+#: lib/common/ph-text.c:41
+msgid "IDS_PB_POP_DELETING_FAVOURITES_ING"
+msgstr "Favoriten werden gelöscht..."
+
+#: lib/common/ph-text.c:42
+msgid "IDS_PB_POP_INITIALISING_TRY_LATER_ING"
+msgstr "Initialisierung. Später versuchen..."
+
+#: lib/common/ph-text.c:46
+msgid "IDS_CLOG_HEADER_SELECT_LOGS"
+msgstr "Protokolle auswählen"
+
+#: lib/common/ph-text.c:47
+msgid "IDS_CST_OPT_CHANGE_CONTACT_ABB"
+msgstr "Kontakt ändern"
diff --git a/po/el.po b/po/el.po
new file mode 100644 (file)
index 0000000..d0d9ab9
--- /dev/null
+++ b/po/el.po
@@ -0,0 +1,77 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2011-12-28 13:08+0900\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: lib/common/ph-text.c:30
+msgid "IDS_PB_ITAB4_DIALLER"
+msgstr "Κλήση"
+
+#: lib/common/ph-text.c:31
+msgid "IDS_PB_ITAB4_FAVOURITES"
+msgstr "Αγαπημένα"
+
+#: lib/common/ph-text.c:32
+msgid "IDS_CST_BODY_VOICE_MAIL"
+msgstr "Τηλεφωνητής"
+
+#: lib/common/ph-text.c:33
+msgid "IDS_CLOG_ITAB4_LOGS"
+msgstr "Αρχεία καταγρ."
+
+#: lib/common/ph-text.c:34
+msgid "IDS_PB_POP_REQUEST_FAILED"
+msgstr "Αποτυχία αιτήματος"
+
+#: lib/common/ph-text.c:35
+msgid "IDS_PB_POP_REQUEST_SUCCESS"
+msgstr "Επιτυχές αίτημα"
+
+#: lib/common/ph-text.c:36
+msgid "IDS_CALL_POP_EMERGENCY_CALL"
+msgstr "Κλήση έκτακτης ανάγκης"
+
+#: lib/common/ph-text.c:37
+msgid "IDS_CLOG_BODY_NO_LOGS"
+msgstr "Δεν υπάρχουν αρχεία καταγραφής"
+
+#: lib/common/ph-text.c:38
+msgid "IDS_PB_BODY_NO_FAVOURITES"
+msgstr "Δεν υπάρχουν αγαπημένα"
+
+#: lib/common/ph-text.c:39
+msgid "IDS_PB_POP_MAXIMUM_PHONE_NUMBER_LENGTH_EXCEEDED"
+msgstr "Έγινε υπέρβαση του μέγιστου μήκους αριθμού τηλεφώνου"
+
+#: lib/common/ph-text.c:40
+msgid "IDS_CLOG_POP_DELETING_LOGS_ING"
+msgstr "Διαγραφή αρχείων κλήσεων..."
+
+#: lib/common/ph-text.c:41
+msgid "IDS_PB_POP_DELETING_FAVOURITES_ING"
+msgstr "Διαγραφή αγαπημένων..."
+
+#: lib/common/ph-text.c:42
+msgid "IDS_PB_POP_INITIALISING_TRY_LATER_ING"
+msgstr "Προετοιμασία. Προσπαθήστε αργότερα..."
+
+#: lib/common/ph-text.c:46
+msgid "IDS_CLOG_HEADER_SELECT_LOGS"
+msgstr "Επιλογή αρχείων καταγραφής"
+
+#: lib/common/ph-text.c:47
+msgid "IDS_CST_OPT_CHANGE_CONTACT_ABB"
+msgstr "Αλλαγή επαφής"
diff --git a/po/en_GB.po b/po/en_GB.po
new file mode 100644 (file)
index 0000000..972b025
--- /dev/null
@@ -0,0 +1,77 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2011-12-28 13:08+0900\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: lib/common/ph-text.c:30
+msgid "IDS_PB_ITAB4_DIALLER"
+msgstr "Dialler"
+
+#: lib/common/ph-text.c:31
+msgid "IDS_PB_ITAB4_FAVOURITES"
+msgstr "Favourites"
+
+#: lib/common/ph-text.c:32
+msgid "IDS_CST_BODY_VOICE_MAIL"
+msgstr "Voice mail"
+
+#: lib/common/ph-text.c:33
+msgid "IDS_CLOG_ITAB4_LOGS"
+msgstr "Logs"
+
+#: lib/common/ph-text.c:34
+msgid "IDS_PB_POP_REQUEST_FAILED"
+msgstr "Request failed"
+
+#: lib/common/ph-text.c:35
+msgid "IDS_PB_POP_REQUEST_SUCCESS"
+msgstr "Request success"
+
+#: lib/common/ph-text.c:36
+msgid "IDS_CALL_POP_EMERGENCY_CALL"
+msgstr "Emergency call"
+
+#: lib/common/ph-text.c:37
+msgid "IDS_CLOG_BODY_NO_LOGS"
+msgstr "No logs"
+
+#: lib/common/ph-text.c:38
+msgid "IDS_PB_BODY_NO_FAVOURITES"
+msgstr "No favourites"
+
+#: lib/common/ph-text.c:39
+msgid "IDS_PB_POP_MAXIMUM_PHONE_NUMBER_LENGTH_EXCEEDED"
+msgstr "Maximum phone number length exceeded"
+
+#: lib/common/ph-text.c:40
+msgid "IDS_CLOG_POP_DELETING_LOGS_ING"
+msgstr "Deleting logs..."
+
+#: lib/common/ph-text.c:41
+msgid "IDS_PB_POP_DELETING_FAVOURITES_ING"
+msgstr "Deleting favourites..."
+
+#: lib/common/ph-text.c:42
+msgid "IDS_PB_POP_INITIALISING_TRY_LATER_ING"
+msgstr "Initialising. Try later..."
+
+#: lib/common/ph-text.c:46
+msgid "IDS_CLOG_HEADER_SELECT_LOGS"
+msgstr "Select logs"
+
+#: lib/common/ph-text.c:47
+msgid "IDS_CST_OPT_CHANGE_CONTACT_ABB"
+msgstr "Change contact"
diff --git a/po/en_US.po b/po/en_US.po
new file mode 100644 (file)
index 0000000..225a7e1
--- /dev/null
@@ -0,0 +1,77 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2011-12-28 13:08+0900\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: lib/common/ph-text.c:30
+msgid "IDS_PB_ITAB4_DIALLER"
+msgstr "Dialer"
+
+#: lib/common/ph-text.c:31
+msgid "IDS_PB_ITAB4_FAVOURITES"
+msgstr "Favorites"
+
+#: lib/common/ph-text.c:32
+msgid "IDS_CST_BODY_VOICE_MAIL"
+msgstr "Voice mail"
+
+#: lib/common/ph-text.c:33
+msgid "IDS_CLOG_ITAB4_LOGS"
+msgstr "Logs"
+
+#: lib/common/ph-text.c:34
+msgid "IDS_PB_POP_REQUEST_FAILED"
+msgstr "Request failed"
+
+#: lib/common/ph-text.c:35
+msgid "IDS_PB_POP_REQUEST_SUCCESS"
+msgstr "Request success"
+
+#: lib/common/ph-text.c:36
+msgid "IDS_CALL_POP_EMERGENCY_CALL"
+msgstr "Emergency call"
+
+#: lib/common/ph-text.c:37
+msgid "IDS_CLOG_BODY_NO_LOGS"
+msgstr "No logs"
+
+#: lib/common/ph-text.c:38
+msgid "IDS_PB_BODY_NO_FAVOURITES"
+msgstr "No favorites"
+
+#: lib/common/ph-text.c:39
+msgid "IDS_PB_POP_MAXIMUM_PHONE_NUMBER_LENGTH_EXCEEDED"
+msgstr "Maximum phone number length exceeded"
+
+#: lib/common/ph-text.c:40
+msgid "IDS_CLOG_POP_DELETING_LOGS_ING"
+msgstr "Deleting logs..."
+
+#: lib/common/ph-text.c:41
+msgid "IDS_PB_POP_DELETING_FAVOURITES_ING"
+msgstr "Deleting favorites..."
+
+#: lib/common/ph-text.c:42
+msgid "IDS_PB_POP_INITIALISING_TRY_LATER_ING"
+msgstr "Initializing. Try later..."
+
+#: lib/common/ph-text.c:46
+msgid "IDS_CLOG_HEADER_SELECT_LOGS"
+msgstr "Select logs"
+
+#: lib/common/ph-text.c:47
+msgid "IDS_CST_OPT_CHANGE_CONTACT_ABB"
+msgstr "Change contact"
diff --git a/po/es.po b/po/es.po
new file mode 100644 (file)
index 0000000..091ccb4
--- /dev/null
+++ b/po/es.po
@@ -0,0 +1,77 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2011-12-28 13:08+0900\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: lib/common/ph-text.c:30
+msgid "IDS_PB_ITAB4_DIALLER"
+msgstr "Marcador"
+
+#: lib/common/ph-text.c:31
+msgid "IDS_PB_ITAB4_FAVOURITES"
+msgstr "Favoritos"
+
+#: lib/common/ph-text.c:32
+msgid "IDS_CST_BODY_VOICE_MAIL"
+msgstr "Buzón de voz"
+
+#: lib/common/ph-text.c:33
+msgid "IDS_CLOG_ITAB4_LOGS"
+msgstr "Registro"
+
+#: lib/common/ph-text.c:34
+msgid "IDS_PB_POP_REQUEST_FAILED"
+msgstr "Petición fallida"
+
+#: lib/common/ph-text.c:35
+msgid "IDS_PB_POP_REQUEST_SUCCESS"
+msgstr "Solicitud correcta"
+
+#: lib/common/ph-text.c:36
+msgid "IDS_CALL_POP_EMERGENCY_CALL"
+msgstr "Llamada de emergencia"
+
+#: lib/common/ph-text.c:37
+msgid "IDS_CLOG_BODY_NO_LOGS"
+msgstr "Ningún registro"
+
+#: lib/common/ph-text.c:38
+msgid "IDS_PB_BODY_NO_FAVOURITES"
+msgstr "Ningún favorito"
+
+#: lib/common/ph-text.c:39
+msgid "IDS_PB_POP_MAXIMUM_PHONE_NUMBER_LENGTH_EXCEEDED"
+msgstr "Longitud máxima de número de teléfono superada"
+
+#: lib/common/ph-text.c:40
+msgid "IDS_CLOG_POP_DELETING_LOGS_ING"
+msgstr "Eliminando registros..."
+
+#: lib/common/ph-text.c:41
+msgid "IDS_PB_POP_DELETING_FAVOURITES_ING"
+msgstr "Eliminando favoritos..."
+
+#: lib/common/ph-text.c:42
+msgid "IDS_PB_POP_INITIALISING_TRY_LATER_ING"
+msgstr "Inicializando. Inténtelo más tarde..."
+
+#: lib/common/ph-text.c:46
+msgid "IDS_CLOG_HEADER_SELECT_LOGS"
+msgstr "Seleccionar registros"
+
+#: lib/common/ph-text.c:47
+msgid "IDS_CST_OPT_CHANGE_CONTACT_ABB"
+msgstr "Cambiar contacto"
diff --git a/po/fr.po b/po/fr.po
new file mode 100644 (file)
index 0000000..323e02b
--- /dev/null
+++ b/po/fr.po
@@ -0,0 +1,77 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2011-12-28 13:08+0900\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: lib/common/ph-text.c:30
+msgid "IDS_PB_ITAB4_DIALLER"
+msgstr "Numérot."
+
+#: lib/common/ph-text.c:31
+msgid "IDS_PB_ITAB4_FAVOURITES"
+msgstr "Favoris"
+
+#: lib/common/ph-text.c:32
+msgid "IDS_CST_BODY_VOICE_MAIL"
+msgstr "Messagerie vocale"
+
+#: lib/common/ph-text.c:33
+msgid "IDS_CLOG_ITAB4_LOGS"
+msgstr "Journaux"
+
+#: lib/common/ph-text.c:34
+msgid "IDS_PB_POP_REQUEST_FAILED"
+msgstr "Echec de la demande"
+
+#: lib/common/ph-text.c:35
+msgid "IDS_PB_POP_REQUEST_SUCCESS"
+msgstr "Demande réussie"
+
+#: lib/common/ph-text.c:36
+msgid "IDS_CALL_POP_EMERGENCY_CALL"
+msgstr "Appel d'urgence"
+
+#: lib/common/ph-text.c:37
+msgid "IDS_CLOG_BODY_NO_LOGS"
+msgstr "Aucun journal"
+
+#: lib/common/ph-text.c:38
+msgid "IDS_PB_BODY_NO_FAVOURITES"
+msgstr "Aucun favori"
+
+#: lib/common/ph-text.c:39
+msgid "IDS_PB_POP_MAXIMUM_PHONE_NUMBER_LENGTH_EXCEEDED"
+msgstr "Longueur maximum autorisée pour les numéros de téléphone dépassée"
+
+#: lib/common/ph-text.c:40
+msgid "IDS_CLOG_POP_DELETING_LOGS_ING"
+msgstr "Suppression des journaux..."
+
+#: lib/common/ph-text.c:41
+msgid "IDS_PB_POP_DELETING_FAVOURITES_ING"
+msgstr "Suppression des favoris..."
+
+#: lib/common/ph-text.c:42
+msgid "IDS_PB_POP_INITIALISING_TRY_LATER_ING"
+msgstr "Initialisation en cours. Essayez plus tard..."
+
+#: lib/common/ph-text.c:46
+msgid "IDS_CLOG_HEADER_SELECT_LOGS"
+msgstr "Sélectionner des journaux"
+
+#: lib/common/ph-text.c:47
+msgid "IDS_CST_OPT_CHANGE_CONTACT_ABB"
+msgstr "Changer le contact"
diff --git a/po/it.po b/po/it.po
new file mode 100644 (file)
index 0000000..4c71dfc
--- /dev/null
+++ b/po/it.po
@@ -0,0 +1,77 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2011-12-28 13:08+0900\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: lib/common/ph-text.c:30
+msgid "IDS_PB_ITAB4_DIALLER"
+msgstr "Tastiera"
+
+#: lib/common/ph-text.c:31
+msgid "IDS_PB_ITAB4_FAVOURITES"
+msgstr "Preferiti"
+
+#: lib/common/ph-text.c:32
+msgid "IDS_CST_BODY_VOICE_MAIL"
+msgstr "Segreteria telefonica"
+
+#: lib/common/ph-text.c:33
+msgid "IDS_CLOG_ITAB4_LOGS"
+msgstr "Registri"
+
+#: lib/common/ph-text.c:34
+msgid "IDS_PB_POP_REQUEST_FAILED"
+msgstr "Errore richiesta"
+
+#: lib/common/ph-text.c:35
+msgid "IDS_PB_POP_REQUEST_SUCCESS"
+msgstr "Richiesta riuscita"
+
+#: lib/common/ph-text.c:36
+msgid "IDS_CALL_POP_EMERGENCY_CALL"
+msgstr "Chiamata di emergenza"
+
+#: lib/common/ph-text.c:37
+msgid "IDS_CLOG_BODY_NO_LOGS"
+msgstr "Nessun registro"
+
+#: lib/common/ph-text.c:38
+msgid "IDS_PB_BODY_NO_FAVOURITES"
+msgstr "Nessun preferito"
+
+#: lib/common/ph-text.c:39
+msgid "IDS_PB_POP_MAXIMUM_PHONE_NUMBER_LENGTH_EXCEEDED"
+msgstr "Lunghezza massima di numeri di telefono superata"
+
+#: lib/common/ph-text.c:40
+msgid "IDS_CLOG_POP_DELETING_LOGS_ING"
+msgstr "Eliminazione registri in corso..."
+
+#: lib/common/ph-text.c:41
+msgid "IDS_PB_POP_DELETING_FAVOURITES_ING"
+msgstr "Eliminazione preferiti in corso..."
+
+#: lib/common/ph-text.c:42
+msgid "IDS_PB_POP_INITIALISING_TRY_LATER_ING"
+msgstr "Inizializzazione in corso. Riprovare più tardi..."
+
+#: lib/common/ph-text.c:46
+msgid "IDS_CLOG_HEADER_SELECT_LOGS"
+msgstr "Seleziona registri"
+
+#: lib/common/ph-text.c:47
+msgid "IDS_CST_OPT_CHANGE_CONTACT_ABB"
+msgstr "Modifica contatto"
diff --git a/po/ja.po b/po/ja.po
new file mode 100644 (file)
index 0000000..7fb9411
--- /dev/null
+++ b/po/ja.po
@@ -0,0 +1,77 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2011-12-28 13:08+0900\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: lib/common/ph-text.c:30
+msgid "IDS_PB_ITAB4_DIALLER"
+msgstr "ダイヤル"
+
+#: lib/common/ph-text.c:31
+msgid "IDS_PB_ITAB4_FAVOURITES"
+msgstr "お気に入り"
+
+#: lib/common/ph-text.c:32
+msgid "IDS_CST_BODY_VOICE_MAIL"
+msgstr "留守番電話"
+
+#: lib/common/ph-text.c:33
+msgid "IDS_CLOG_ITAB4_LOGS"
+msgstr "履歴"
+
+#: lib/common/ph-text.c:34
+msgid "IDS_PB_POP_REQUEST_FAILED"
+msgstr "要求​に​失敗​しました"
+
+#: lib/common/ph-text.c:35
+msgid "IDS_PB_POP_REQUEST_SUCCESS"
+msgstr "要求に成功しました。"
+
+#: lib/common/ph-text.c:36
+msgid "IDS_CALL_POP_EMERGENCY_CALL"
+msgstr "緊急通話"
+
+#: lib/common/ph-text.c:37
+msgid "IDS_CLOG_BODY_NO_LOGS"
+msgstr "履歴がありません。"
+
+#: lib/common/ph-text.c:38
+msgid "IDS_PB_BODY_NO_FAVOURITES"
+msgstr "お気に入りがありません。"
+
+#: lib/common/ph-text.c:39
+msgid "IDS_PB_POP_MAXIMUM_PHONE_NUMBER_LENGTH_EXCEEDED"
+msgstr "電話番号の最大桁数を超えています。"
+
+#: lib/common/ph-text.c:40
+msgid "IDS_CLOG_POP_DELETING_LOGS_ING"
+msgstr "ログを削除中..."
+
+#: lib/common/ph-text.c:41
+msgid "IDS_PB_POP_DELETING_FAVOURITES_ING"
+msgstr "お気に入りを削除中..."
+
+#: lib/common/ph-text.c:42
+msgid "IDS_PB_POP_INITIALISING_TRY_LATER_ING"
+msgstr "初期化中です。後ほどお試しください..."
+
+#: lib/common/ph-text.c:46
+msgid "IDS_CLOG_HEADER_SELECT_LOGS"
+msgstr "ログの選択"
+
+#: lib/common/ph-text.c:47
+msgid "IDS_CST_OPT_CHANGE_CONTACT_ABB"
+msgstr "連絡先変更"
diff --git a/po/ko.po b/po/ko.po
new file mode 100644 (file)
index 0000000..8d054d7
--- /dev/null
+++ b/po/ko.po
@@ -0,0 +1,77 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2011-12-28 13:08+0900\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: lib/common/ph-text.c:30
+msgid "IDS_PB_ITAB4_DIALLER"
+msgstr "다이얼 화면"
+
+#: lib/common/ph-text.c:31
+msgid "IDS_PB_ITAB4_FAVOURITES"
+msgstr "즐겨찾기"
+
+#: lib/common/ph-text.c:32
+msgid "IDS_CST_BODY_VOICE_MAIL"
+msgstr "음성 메시지"
+
+#: lib/common/ph-text.c:33
+msgid "IDS_CLOG_ITAB4_LOGS"
+msgstr "최근기록"
+
+#: lib/common/ph-text.c:34
+msgid "IDS_PB_POP_REQUEST_FAILED"
+msgstr "요청을 수행하지 못하였습니다"
+
+#: lib/common/ph-text.c:35
+msgid "IDS_PB_POP_REQUEST_SUCCESS"
+msgstr "요청에 성공하였습니다"
+
+#: lib/common/ph-text.c:36
+msgid "IDS_CALL_POP_EMERGENCY_CALL"
+msgstr "긴급전화"
+
+#: lib/common/ph-text.c:37
+msgid "IDS_CLOG_BODY_NO_LOGS"
+msgstr "기록이 없습니다"
+
+#: lib/common/ph-text.c:38
+msgid "IDS_PB_BODY_NO_FAVOURITES"
+msgstr "자주 사용하는 연락처 목록이 없습니다"
+
+#: lib/common/ph-text.c:39
+msgid "IDS_PB_POP_MAXIMUM_PHONE_NUMBER_LENGTH_EXCEEDED"
+msgstr "최대 전화번호 길이를 초과하였습니다"
+
+#: lib/common/ph-text.c:40
+msgid "IDS_CLOG_POP_DELETING_LOGS_ING"
+msgstr "기록 삭제 중..."
+
+#: lib/common/ph-text.c:41
+msgid "IDS_PB_POP_DELETING_FAVOURITES_ING"
+msgstr "즐겨찾기 삭제 중..."
+
+#: lib/common/ph-text.c:42
+msgid "IDS_PB_POP_INITIALISING_TRY_LATER_ING"
+msgstr "초기화 중... 잠시 후 다시 시도하세요"
+
+#: lib/common/ph-text.c:46
+msgid "IDS_CLOG_HEADER_SELECT_LOGS"
+msgstr "기록을 선택하세요"
+
+#: lib/common/ph-text.c:47
+msgid "IDS_CST_OPT_CHANGE_CONTACT_ABB"
+msgstr "연락처 변경"
diff --git a/po/nl.po b/po/nl.po
new file mode 100644 (file)
index 0000000..daeadba
--- /dev/null
+++ b/po/nl.po
@@ -0,0 +1,77 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2011-12-28 13:08+0900\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: lib/common/ph-text.c:30
+msgid "IDS_PB_ITAB4_DIALLER"
+msgstr "Kiezer"
+
+#: lib/common/ph-text.c:31
+msgid "IDS_PB_ITAB4_FAVOURITES"
+msgstr "Favo- rieten"
+
+#: lib/common/ph-text.c:32
+msgid "IDS_CST_BODY_VOICE_MAIL"
+msgstr "Voicemail"
+
+#: lib/common/ph-text.c:33
+msgid "IDS_CLOG_ITAB4_LOGS"
+msgstr "Logbe- standen"
+
+#: lib/common/ph-text.c:34
+msgid "IDS_PB_POP_REQUEST_FAILED"
+msgstr "Aanvraag mislukt"
+
+#: lib/common/ph-text.c:35
+msgid "IDS_PB_POP_REQUEST_SUCCESS"
+msgstr "Verzoek geaccepteerd"
+
+#: lib/common/ph-text.c:36
+msgid "IDS_CALL_POP_EMERGENCY_CALL"
+msgstr "Noodoproep"
+
+#: lib/common/ph-text.c:37
+msgid "IDS_CLOG_BODY_NO_LOGS"
+msgstr "Geen gegevens"
+
+#: lib/common/ph-text.c:38
+msgid "IDS_PB_BODY_NO_FAVOURITES"
+msgstr "Geen favorieten"
+
+#: lib/common/ph-text.c:39
+msgid "IDS_PB_POP_MAXIMUM_PHONE_NUMBER_LENGTH_EXCEEDED"
+msgstr "Maximale lengte telefoonnummer overschreden"
+
+#: lib/common/ph-text.c:40
+msgid "IDS_CLOG_POP_DELETING_LOGS_ING"
+msgstr "Logbestanden verwijderen..."
+
+#: lib/common/ph-text.c:41
+msgid "IDS_PB_POP_DELETING_FAVOURITES_ING"
+msgstr "Favorieten verwijderen..."
+
+#: lib/common/ph-text.c:42
+msgid "IDS_PB_POP_INITIALISING_TRY_LATER_ING"
+msgstr "Bezig met initialiseren. Probeer het later..."
+
+#: lib/common/ph-text.c:46
+msgid "IDS_CLOG_HEADER_SELECT_LOGS"
+msgstr "Logbestanden selecteren"
+
+#: lib/common/ph-text.c:47
+msgid "IDS_CST_OPT_CHANGE_CONTACT_ABB"
+msgstr "Contact wijzigen"
diff --git a/po/pt.po b/po/pt.po
new file mode 100644 (file)
index 0000000..52863c7
--- /dev/null
+++ b/po/pt.po
@@ -0,0 +1,77 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2011-12-28 13:08+0900\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: lib/common/ph-text.c:30
+msgid "IDS_PB_ITAB4_DIALLER"
+msgstr "Marcador"
+
+#: lib/common/ph-text.c:31
+msgid "IDS_PB_ITAB4_FAVOURITES"
+msgstr "Favorit."
+
+#: lib/common/ph-text.c:32
+msgid "IDS_CST_BODY_VOICE_MAIL"
+msgstr "Correio de voz"
+
+#: lib/common/ph-text.c:33
+msgid "IDS_CLOG_ITAB4_LOGS"
+msgstr "Registos"
+
+#: lib/common/ph-text.c:34
+msgid "IDS_PB_POP_REQUEST_FAILED"
+msgstr "Pedido falhou"
+
+#: lib/common/ph-text.c:35
+msgid "IDS_PB_POP_REQUEST_SUCCESS"
+msgstr "Sucesso do pedido"
+
+#: lib/common/ph-text.c:36
+msgid "IDS_CALL_POP_EMERGENCY_CALL"
+msgstr "Chamada de emergência"
+
+#: lib/common/ph-text.c:37
+msgid "IDS_CLOG_BODY_NO_LOGS"
+msgstr "Nenhum registo"
+
+#: lib/common/ph-text.c:38
+msgid "IDS_PB_BODY_NO_FAVOURITES"
+msgstr "Nenhuns favoritos"
+
+#: lib/common/ph-text.c:39
+msgid "IDS_PB_POP_MAXIMUM_PHONE_NUMBER_LENGTH_EXCEEDED"
+msgstr "Comprimento máximo do número de telefone excedido"
+
+#: lib/common/ph-text.c:40
+msgid "IDS_CLOG_POP_DELETING_LOGS_ING"
+msgstr "A eliminar registos..."
+
+#: lib/common/ph-text.c:41
+msgid "IDS_PB_POP_DELETING_FAVOURITES_ING"
+msgstr "A eliminar favoritos..."
+
+#: lib/common/ph-text.c:42
+msgid "IDS_PB_POP_INITIALISING_TRY_LATER_ING"
+msgstr "A iniciar. Tente mais tarde..."
+
+#: lib/common/ph-text.c:46
+msgid "IDS_CLOG_HEADER_SELECT_LOGS"
+msgstr "Seleccionar registos"
+
+#: lib/common/ph-text.c:47
+msgid "IDS_CST_OPT_CHANGE_CONTACT_ABB"
+msgstr "Trocar contacto"
diff --git a/po/ru.po b/po/ru.po
new file mode 100644 (file)
index 0000000..bbcd6ca
--- /dev/null
+++ b/po/ru.po
@@ -0,0 +1,77 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2011-12-28 13:08+0900\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: lib/common/ph-text.c:30
+msgid "IDS_PB_ITAB4_DIALLER"
+msgstr "Набор"
+
+#: lib/common/ph-text.c:31
+msgid "IDS_PB_ITAB4_FAVOURITES"
+msgstr "Избранное"
+
+#: lib/common/ph-text.c:32
+msgid "IDS_CST_BODY_VOICE_MAIL"
+msgstr "Голосовая почта"
+
+#: lib/common/ph-text.c:33
+msgid "IDS_CLOG_ITAB4_LOGS"
+msgstr "Журналы"
+
+#: lib/common/ph-text.c:34
+msgid "IDS_PB_POP_REQUEST_FAILED"
+msgstr "Сбой запроса"
+
+#: lib/common/ph-text.c:35
+msgid "IDS_PB_POP_REQUEST_SUCCESS"
+msgstr "Запрос успешно выполнен"
+
+#: lib/common/ph-text.c:36
+msgid "IDS_CALL_POP_EMERGENCY_CALL"
+msgstr "Экстренный вызов"
+
+#: lib/common/ph-text.c:37
+msgid "IDS_CLOG_BODY_NO_LOGS"
+msgstr "Нет журналов"
+
+#: lib/common/ph-text.c:38
+msgid "IDS_PB_BODY_NO_FAVOURITES"
+msgstr "Нет избранных"
+
+#: lib/common/ph-text.c:39
+msgid "IDS_PB_POP_MAXIMUM_PHONE_NUMBER_LENGTH_EXCEEDED"
+msgstr "Превышена максимальная длина номера телефона"
+
+#: lib/common/ph-text.c:40
+msgid "IDS_CLOG_POP_DELETING_LOGS_ING"
+msgstr "Удаление журналов..."
+
+#: lib/common/ph-text.c:41
+msgid "IDS_PB_POP_DELETING_FAVOURITES_ING"
+msgstr "Удаление избранного..."
+
+#: lib/common/ph-text.c:42
+msgid "IDS_PB_POP_INITIALISING_TRY_LATER_ING"
+msgstr "Инициализация. Повторите попытку позже..."
+
+#: lib/common/ph-text.c:46
+msgid "IDS_CLOG_HEADER_SELECT_LOGS"
+msgstr "Выбрать журналы"
+
+#: lib/common/ph-text.c:47
+msgid "IDS_CST_OPT_CHANGE_CONTACT_ABB"
+msgstr "Изменить контакт"
diff --git a/po/tr.po b/po/tr.po
new file mode 100644 (file)
index 0000000..67d884b
--- /dev/null
+++ b/po/tr.po
@@ -0,0 +1,77 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2011-12-28 13:08+0900\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: lib/common/ph-text.c:30
+msgid "IDS_PB_ITAB4_DIALLER"
+msgstr "Telefon"
+
+#: lib/common/ph-text.c:31
+msgid "IDS_PB_ITAB4_FAVOURITES"
+msgstr "Favoriler"
+
+#: lib/common/ph-text.c:32
+msgid "IDS_CST_BODY_VOICE_MAIL"
+msgstr "Sesli posta"
+
+#: lib/common/ph-text.c:33
+msgid "IDS_CLOG_ITAB4_LOGS"
+msgstr "Günlükler"
+
+#: lib/common/ph-text.c:34
+msgid "IDS_PB_POP_REQUEST_FAILED"
+msgstr "İstek hatası"
+
+#: lib/common/ph-text.c:35
+msgid "IDS_PB_POP_REQUEST_SUCCESS"
+msgstr "Talep başarılı"
+
+#: lib/common/ph-text.c:36
+msgid "IDS_CALL_POP_EMERGENCY_CALL"
+msgstr "Acil arama"
+
+#: lib/common/ph-text.c:37
+msgid "IDS_CLOG_BODY_NO_LOGS"
+msgstr "Kayıt yok"
+
+#: lib/common/ph-text.c:38
+msgid "IDS_PB_BODY_NO_FAVOURITES"
+msgstr "Favori yok"
+
+#: lib/common/ph-text.c:39
+msgid "IDS_PB_POP_MAXIMUM_PHONE_NUMBER_LENGTH_EXCEEDED"
+msgstr "Maksimum telefon numarası uzunluğu aşıldı"
+
+#: lib/common/ph-text.c:40
+msgid "IDS_CLOG_POP_DELETING_LOGS_ING"
+msgstr "Kayıtlar siliniyor..."
+
+#: lib/common/ph-text.c:41
+msgid "IDS_PB_POP_DELETING_FAVOURITES_ING"
+msgstr "Favoriler siliniyor..."
+
+#: lib/common/ph-text.c:42
+msgid "IDS_PB_POP_INITIALISING_TRY_LATER_ING"
+msgstr "Başlatılıyor. Sonra deneyin..."
+
+#: lib/common/ph-text.c:46
+msgid "IDS_CLOG_HEADER_SELECT_LOGS"
+msgstr "Kayıtları seç"
+
+#: lib/common/ph-text.c:47
+msgid "IDS_CST_OPT_CHANGE_CONTACT_ABB"
+msgstr "Kişiyi değiştir"
diff --git a/po/update-po.sh b/po/update-po.sh
new file mode 100755 (executable)
index 0000000..7abf056
--- /dev/null
@@ -0,0 +1,60 @@
+#!/bin/sh
+
+PACKAGE=phone
+SRCROOT=..
+POTFILES=POTFILES.in
+
+#ALL_LINGUAS= am az be ca cs da de el en_CA en_GB es et fi fr hr hu it ja ko lv mk ml ms nb ne nl pa pl pt pt_BR ru rw sk sl sr sr@Latn sv ta tr uk vi zh_CN zh_TW
+ALL_LINGUAS="en_GB de el en_US es fr it ja ko nl pt ru tr zh_CN zh_HK zh_TW"
+
+XGETTEXT=/usr/bin/xgettext
+MSGMERGE=/usr/bin/msgmerge
+
+echo -n "Make ${PACKAGE}.pot  "
+if [ ! -e $POTFILES ] ; then
+   echo "$POTFILES not found"
+   exit 1
+fi
+
+$XGETTEXT --default-domain=${PACKAGE} --directory=${SRCROOT} \
+      --keyword=_ --keyword=N_ --files-from=$POTFILES
+if [ $? -ne 0 ]; then
+   echo "xgettext error"
+   exit 1
+fi
+
+if [ ! -f ${PACKAGE}.po ]; then
+   echo "No such file: ${PACKAGE}.po"
+   exit 1
+fi
+
+rm -f ${PACKAGE}.pot && mv ${PACKAGE}.po ${PACKAGE}.pot
+echo "done"
+
+for LANG in $ALL_LINGUAS; do
+   echo "$LANG : "
+
+   if [ ! -e $LANG.po ] ; then
+      sed 's/CHARSET/UTF-8/g' ${PACKAGE}.pot > ${LANG}.po
+      echo "${LANG}.po created"
+   else
+      if $MSGMERGE ${LANG}.po ${PACKAGE}.pot -o ${LANG}.new.po ; then
+         if cmp ${LANG}.po ${LANG}.new.po > /dev/null 2>&1; then
+            rm -f ${LANG}.new.po
+         else
+            if mv -f ${LANG}.new.po ${LANG}.po; then
+               echo ""
+            else
+               echo "msgmerge for $LANG.po failed: cannot move $LANG.new.po to $LANG.po" 1>&2
+               rm -f ${LANG}.new.po
+               exit 1
+            fi
+         fi
+      else
+         echo "msgmerge for $LANG failed!"
+         rm -f ${LANG}.new.po
+      fi
+   fi
+   echo ""
+done
+
diff --git a/po/zh_CN.po b/po/zh_CN.po
new file mode 100644 (file)
index 0000000..21d563a
--- /dev/null
@@ -0,0 +1,77 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2011-12-28 13:08+0900\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: lib/common/ph-text.c:30
+msgid "IDS_PB_ITAB4_DIALLER"
+msgstr "拨号程序"
+
+#: lib/common/ph-text.c:31
+msgid "IDS_PB_ITAB4_FAVOURITES"
+msgstr "收藏"
+
+#: lib/common/ph-text.c:32
+msgid "IDS_CST_BODY_VOICE_MAIL"
+msgstr "语音信箱"
+
+#: lib/common/ph-text.c:33
+msgid "IDS_CLOG_ITAB4_LOGS"
+msgstr "记录"
+
+#: lib/common/ph-text.c:34
+msgid "IDS_PB_POP_REQUEST_FAILED"
+msgstr "请求失败"
+
+#: lib/common/ph-text.c:35
+msgid "IDS_PB_POP_REQUEST_SUCCESS"
+msgstr "请求成功"
+
+#: lib/common/ph-text.c:36
+msgid "IDS_CALL_POP_EMERGENCY_CALL"
+msgstr "紧急呼叫"
+
+#: lib/common/ph-text.c:37
+msgid "IDS_CLOG_BODY_NO_LOGS"
+msgstr "没有记录"
+
+#: lib/common/ph-text.c:38
+msgid "IDS_PB_BODY_NO_FAVOURITES"
+msgstr "没有联系人"
+
+#: lib/common/ph-text.c:39
+msgid "IDS_PB_POP_MAXIMUM_PHONE_NUMBER_LENGTH_EXCEEDED"
+msgstr "已超过最大手机号码长度"
+
+#: lib/common/ph-text.c:40
+msgid "IDS_CLOG_POP_DELETING_LOGS_ING"
+msgstr "正在删除记录"
+
+#: lib/common/ph-text.c:41
+msgid "IDS_PB_POP_DELETING_FAVOURITES_ING"
+msgstr "正在删除收藏…"
+
+#: lib/common/ph-text.c:42
+msgid "IDS_PB_POP_INITIALISING_TRY_LATER_ING"
+msgstr "正在初始化。稍后重试…"
+
+#: lib/common/ph-text.c:46
+msgid "IDS_CLOG_HEADER_SELECT_LOGS"
+msgstr "选择记录"
+
+#: lib/common/ph-text.c:47
+msgid "IDS_CST_OPT_CHANGE_CONTACT_ABB"
+msgstr "更改联系人"
diff --git a/po/zh_HK.po b/po/zh_HK.po
new file mode 100644 (file)
index 0000000..548a9d0
--- /dev/null
@@ -0,0 +1,77 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2011-12-28 13:08+0900\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: lib/common/ph-text.c:30
+msgid "IDS_PB_ITAB4_DIALLER"
+msgstr "撥號器"
+
+#: lib/common/ph-text.c:31
+msgid "IDS_PB_ITAB4_FAVOURITES"
+msgstr "我的最愛"
+
+#: lib/common/ph-text.c:32
+msgid "IDS_CST_BODY_VOICE_MAIL"
+msgstr "留言信箱"
+
+#: lib/common/ph-text.c:33
+msgid "IDS_CLOG_ITAB4_LOGS"
+msgstr "記錄"
+
+#: lib/common/ph-text.c:34
+msgid "IDS_PB_POP_REQUEST_FAILED"
+msgstr "請求失敗"
+
+#: lib/common/ph-text.c:35
+msgid "IDS_PB_POP_REQUEST_SUCCESS"
+msgstr "請求成功"
+
+#: lib/common/ph-text.c:36
+msgid "IDS_CALL_POP_EMERGENCY_CALL"
+msgstr "緊急通話"
+
+#: lib/common/ph-text.c:37
+msgid "IDS_CLOG_BODY_NO_LOGS"
+msgstr "沒有通話記錄"
+
+#: lib/common/ph-text.c:38
+msgid "IDS_PB_BODY_NO_FAVOURITES"
+msgstr "無我的最愛"
+
+#: lib/common/ph-text.c:39
+msgid "IDS_PB_POP_MAXIMUM_PHONE_NUMBER_LENGTH_EXCEEDED"
+msgstr "已超過電話號碼長度上限"
+
+#: lib/common/ph-text.c:40
+msgid "IDS_CLOG_POP_DELETING_LOGS_ING"
+msgstr "正在刪除記錄…"
+
+#: lib/common/ph-text.c:41
+msgid "IDS_PB_POP_DELETING_FAVOURITES_ING"
+msgstr "正在刪除我的最愛…"
+
+#: lib/common/ph-text.c:42
+msgid "IDS_PB_POP_INITIALISING_TRY_LATER_ING"
+msgstr "正在初始化。請稍後再試..."
+
+#: lib/common/ph-text.c:46
+msgid "IDS_CLOG_HEADER_SELECT_LOGS"
+msgstr "選擇記錄"
+
+#: lib/common/ph-text.c:47
+msgid "IDS_CST_OPT_CHANGE_CONTACT_ABB"
+msgstr "更改聯絡人"
diff --git a/po/zh_TW.po b/po/zh_TW.po
new file mode 100644 (file)
index 0000000..be8894b
--- /dev/null
@@ -0,0 +1,77 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2011-12-28 13:08+0900\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: lib/common/ph-text.c:30
+msgid "IDS_PB_ITAB4_DIALLER"
+msgstr "撥號程式"
+
+#: lib/common/ph-text.c:31
+msgid "IDS_PB_ITAB4_FAVOURITES"
+msgstr "我的最愛"
+
+#: lib/common/ph-text.c:32
+msgid "IDS_CST_BODY_VOICE_MAIL"
+msgstr "語音信箱"
+
+#: lib/common/ph-text.c:33
+msgid "IDS_CLOG_ITAB4_LOGS"
+msgstr "記錄"
+
+#: lib/common/ph-text.c:34
+msgid "IDS_PB_POP_REQUEST_FAILED"
+msgstr "要求失敗"
+
+#: lib/common/ph-text.c:35
+msgid "IDS_PB_POP_REQUEST_SUCCESS"
+msgstr "要求成功"
+
+#: lib/common/ph-text.c:36
+msgid "IDS_CALL_POP_EMERGENCY_CALL"
+msgstr "緊急電話"
+
+#: lib/common/ph-text.c:37
+msgid "IDS_CLOG_BODY_NO_LOGS"
+msgstr "無記錄"
+
+#: lib/common/ph-text.c:38
+msgid "IDS_PB_BODY_NO_FAVOURITES"
+msgstr "沒有我的最愛"
+
+#: lib/common/ph-text.c:39
+msgid "IDS_PB_POP_MAXIMUM_PHONE_NUMBER_LENGTH_EXCEEDED"
+msgstr "已達電話號碼長度上限"
+
+#: lib/common/ph-text.c:40
+msgid "IDS_CLOG_POP_DELETING_LOGS_ING"
+msgstr "正在刪除記錄…"
+
+#: lib/common/ph-text.c:41
+msgid "IDS_PB_POP_DELETING_FAVOURITES_ING"
+msgstr "正在刪除我的最愛…"
+
+#: lib/common/ph-text.c:42
+msgid "IDS_PB_POP_INITIALISING_TRY_LATER_ING"
+msgstr "初始化中。請稍候再試…"
+
+#: lib/common/ph-text.c:46
+msgid "IDS_CLOG_HEADER_SELECT_LOGS"
+msgstr "選擇記錄"
+
+#: lib/common/ph-text.c:47
+msgid "IDS_CST_OPT_CHANGE_CONTACT_ABB"
+msgstr "變更聯絡人"