diff options
author | Sungjae Lim <neueziel.lim> | 2012-08-22 12:35:29 +0900 |
---|---|---|
committer | Sungjae Lim <neueziel.lim> | 2012-08-22 12:35:29 +0900 |
commit | 1d8f790fe816521cd23ba43546c1a9bd61e0850b (patch) | |
tree | 350f7228fbed868eca0c13d080b749351a0c8c71 /ug-nfc-setting-efl | |
parent | 41e5350c0b8f2d4c13acb75a0927d9b9ae9fe948 (diff) | |
download | ug-nfc-efl-1d8f790fe816521cd23ba43546c1a9bd61e0850b.tar.gz ug-nfc-efl-1d8f790fe816521cd23ba43546c1a9bd61e0850b.tar.bz2 ug-nfc-efl-1d8f790fe816521cd23ba43546c1a9bd61e0850b.zip |
Update the latest source
Diffstat (limited to 'ug-nfc-setting-efl')
49 files changed, 1317 insertions, 130 deletions
diff --git a/ug-nfc-setting-efl/CMakeLists.txt b/ug-nfc-setting-efl/CMakeLists.txt index 12821b5..72a0fe8 100644 --- a/ug-nfc-setting-efl/CMakeLists.txt +++ b/ug-nfc-setting-efl/CMakeLists.txt @@ -8,10 +8,12 @@ SET(INCLUDEDIR "\${prefix}/include") SET(VERSION 0.1.0) SET(RESDIR "${PREFIX}/res") SET(LOCALEDIR "${RESDIR}/locale") +SET(EDJDIR "${RESDIR}/edje/${PROJECT_NAME}") SET(ICONDIR "${RESDIR}/icons/${PROJECT_NAME}") SET(SRCS src/ug-nfc-setting-main.c +src/ug-nfc-setting-popup.c ) IF("${CMAKE_BUILD_TYPE}" STREQUAL "") @@ -22,13 +24,22 @@ MESSAGE("Build type: ${CMAKE_BUILD_TYPE}") INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include) INCLUDE(FindPkgConfig) -pkg_check_modules(pkgs_ug_nfc_setting REQUIRED elementary appcore-efl ui-gadget evas ecore-x edje ecore dbus-glib-1 capi-network-nfc) +pkg_check_modules(pkgs_ug_nfc_setting REQUIRED +ecore-x +ecore-evas +elementary +ui-gadget-1 +dlog +vconf +capi-appfw-application +capi-network-nfc +) FOREACH(flag ${pkgs_ug_nfc_setting_CFLAGS}) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") ENDFOREACH(flag) -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror-implicit-function-declaration -Wl,--unresolved-symbols=ignore-in-shared-libs") +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror-implicit-function-declaration") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") SET(CMAKE_C_FLAGS_DEBUG "-O0 -g") SET(CMAKE_C_FLAGS_RELEASE "-O2") @@ -43,14 +54,23 @@ ENDIF("${ARCH}" STREQUAL "arm") SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed") ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"") +ADD_DEFINITIONS("-DEDJDIR=\"${EDJDIR}\"") ADD_DEFINITIONS("-DRESDIR=\"${RESDIR}\"") ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS}) SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION 0.1.0) TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_ug_nfc_setting_LDFLAGS}) +ADD_CUSTOM_TARGET(ug-nfc-setting-efl.edj + COMMAND edje_cc + ${CMAKE_CURRENT_SOURCE_DIR}/data/edc/ug-nfc-setting-efl.edc ${CMAKE_BINARY_DIR}/ug-nfc-setting-efl.edj + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/data/edc/ug-nfc-setting-efl.edc +) +ADD_DEPENDENCIES(${PROJECT_NAME} ug-nfc-setting-efl.edj) + INSTALL(TARGETS ${PROJECT_NAME} DESTINATION /opt/ug/lib) +INSTALL(FILES ${CMAKE_BINARY_DIR}/ug-nfc-setting-efl.edj DESTINATION ${EDJDIR}) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/org.tizen.nfc-app.png DESTINATION ${ICONDIR}) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/nfc.png DESTINATION ${ICONDIR}) ADD_SUBDIRECTORY(po) diff --git a/ug-nfc-setting-efl/data/edc/ug-nfc-setting-efl.edc b/ug-nfc-setting-efl/data/edc/ug-nfc-setting-efl.edc new file mode 100644 index 0000000..6c24744 --- /dev/null +++ b/ug-nfc-setting-efl/data/edc/ug-nfc-setting-efl.edc @@ -0,0 +1,105 @@ +collections { + + styles + { + style + { + name: "style_txt_desc_black"; + base: "font=SLP:style=Regular text_class=slp_regular font_size=40 align=left color=#FFFFFF wrap=word"; + tag: "br" "\n"; + tag: "tab" "\t"; + tag: "b" "+ font=SLP:style=Bold"; + tag: "link" "+ color=#800 underline=on underline_color=#8008"; + tag: "hilight" "+ font=SLP:style=Bold"; + + } + } + + group{ + name: "nfc_setting"; + parts + { + part + { + name: "setting_list"; + type: SWALLOW; + scale:1; + description + { + state: "default" 0.0; + min: 0 50; + fixed: 0 1; + rel1{relative: 0 0;} + rel2{relative: 1 0.3;} + align: 0.5 0.0; + } + } + + part + { + name: "left_pad"; + type: RECT; + scale: 1; + description + { + state: "default" 0.0; + color: 0 0 0 0; + min: 16 0; + fixed: 1 0; + rel1 {relative: 0 1; to_y: "setting_list";} + rel2 {relative: 0 1;} + align: 0 0; + } + } + + part + { + name: "right_pad"; + type: RECT; + scale: 1; + description + { + state: "default" 0.0; + color: 0 0 0 0; + min: 16 0; + fixed: 1 0; + rel1 {relative: 1 1; to_y: "setting_list";} + rel2 {relative: 1 1;} + align: 0 0; + } + } + + part + { + name: "bottom_pad"; + type: RECT; + scale: 1; + description + { + state: "default" 0.0; + color: 0 0 0 0; + min: 0 16; + fixed: 0 1; + rel1 {relative: 0 0.75;} + rel2 {relative: 1 0.75;} + align: 0 0; + } + } + + + part + { + name: "sbeam_help"; + type: SWALLOW; + scale:1; + description + { + state: "default" 0.0; + rel1{relative: 1 1; to_x:"left_pad"; to_y: "setting_list";} + rel2{relative: 0 0; to_x:"right_pad";to_y: "bottom_pad";} + align: 0 0; + } + } + } + } +} diff --git a/ug-nfc-setting-efl/data/icons/nfc.png b/ug-nfc-setting-efl/data/icons/nfc.png Binary files differnew file mode 100644 index 0000000..705855b --- /dev/null +++ b/ug-nfc-setting-efl/data/icons/nfc.png diff --git a/ug-nfc-setting-efl/data/icons/org.tizen.nfc-app.png b/ug-nfc-setting-efl/data/icons/org.tizen.nfc-app.png Binary files differdeleted file mode 100644 index 687e327..0000000 --- a/ug-nfc-setting-efl/data/icons/org.tizen.nfc-app.png +++ /dev/null diff --git a/ug-nfc-setting-efl/include/ug-nfc-setting-main.h b/ug-nfc-setting-efl/include/ug-nfc-setting-main.h index eb6a9f9..cd9e065 100644 --- a/ug-nfc-setting-efl/include/ug-nfc-setting-main.h +++ b/ug-nfc-setting-efl/include/ug-nfc-setting-main.h @@ -14,6 +14,7 @@ * limitations under the License. */ + #ifndef __UG_NFC_SETTING_MAIN_H__ #define __UG_NFC_SETTING_MAIN_H__ @@ -32,6 +33,8 @@ extern "C" { #undef PREFIX #endif #define PREFIX "/opt/ug/" +#define EDJ_PATH PREFIX"/res/edje/"PACKAGE +#define EDJ_FILE EDJ_PATH"/ug-nfc-setting-efl.edj" #define LOCALE_PATH PREFIX"/res/locale" #ifdef LOG_TAG @@ -43,23 +46,55 @@ extern "C" { #define NFCUG_TEXT_DOMAIN PACKAGE #define NFCUG_LOCALEDIR LOCALE_PATH +#define POPUP_TEXT_SIZE 1024 + /* Registered string in STMS NFC */ -#define IDS_ACTIVATION dgettext(PACKAGE, "IDS_NFC_POP_ACTIVATION") -#define IDS_NFC dgettext(PACKAGE, "IDS_NFC_BODY_NFC") +#define IDS_NFC_NFC dgettext(PACKAGE, "IDS_NFC_BODY_NFC") +#define IDS_NFC_S_BEAM dgettext(PACKAGE, "IDS_NFC_OPT_S_BEAM") +#define IDS_NFC_S_BEAM_DESCRIPTION_MSG_CHN dgettext(PACKAGE, "IDS_NFC_BODY_S_BEAM_DESCRIPTION_MSG_CHN") +#define IDS_CLOSE dgettext("sys_string", "IDS_COM_POP_CLOSE") + +#define IDS_NFC_SERVICE_IS_NOT_SUPPORTED _("NFC service is not supported") +typedef enum _NFCSettingType { + NFC_ON_OFF = 0, + NFC_S_BEAM, + NFC_SETTING_MAX +} NFCSettingType; + +enum +{ + UG_FONT_LIST = 0, + UG_FONT_SBEAM_TITLE, + UG_FONT_LIVEBOX, + UG_FONT_HELP, + UG_FONT_MAX, +}; + +enum +{ + UG_ALIGN_LEFT, + UG_ALIGN_CENTER, + UG_ALIGN_RIGHT, +}; typedef struct _ugdata_t { Evas_Object* ug_win_main; - struct ui_gadget *nfc_setting_ug; + ui_gadget_h nfc_setting_ug; Evas_Object* base_layout; Evas_Object *bg; - Evas_Object *check; Evas_Object* base_naviframe; Elm_Object_Item *base_navi_it; }ugdata_t; +typedef struct _gl_item_data_t +{ + NFCSettingType type; + ugdata_t *data; +}gl_item_data; + #ifdef __cplusplus } #endif diff --git a/ug-nfc-setting-efl/include/ug-nfc-setting-popup.h b/ug-nfc-setting-efl/include/ug-nfc-setting-popup.h new file mode 100644 index 0000000..0239e91 --- /dev/null +++ b/ug-nfc-setting-efl/include/ug-nfc-setting-popup.h @@ -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 __UG_NFC_SETTING_POPUP_H__ +#define __UG_NFC_SETTING_POPUP_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include "ug-nfc-setting-main.h" + +typedef void (*UG_NFC_POPUP_USER_RESP_CB)(void *data, Evas_Object *obj, void *event_info); + +enum { + UG_NFC_POPUP_RESP_NONE = -1, + UG_NFC_POPUP_RESP_TIMEOUT = -2, + UG_NFC_POPUP_RESP_OK = -3, + UG_NFC_POPUP_RESP_CANCEL = -4, + UG_NFC_POPUP_RESP_CLOSE = -5 +}; + + +Evas_Object *ug_nfc_setting_create_popup(void *data, + Evas_Object *parent_layout, + const char *description, + const char *btn1_text, + int btn1_type, + const char *btn2_text, + int btn2_type, + const char *btn3_text, + int btn3_type, + bool is_alert_type, + bool enable_timeout, + UG_NFC_POPUP_USER_RESP_CB response_cb); +void ug_nfc_setting_close_popup(Evas_Object* popup); + +#ifdef __cplusplus +} +#endif + + +#endif /*__UG_NFC_SETTING_POPUP_H__*/ + diff --git a/ug-nfc-setting-efl/po/POTFILES.in b/ug-nfc-setting-efl/po/POTFILES.in index 2068f24..2068f24 100755..100644 --- a/ug-nfc-setting-efl/po/POTFILES.in +++ b/ug-nfc-setting-efl/po/POTFILES.in diff --git a/ug-nfc-setting-efl/po/ar.po b/ug-nfc-setting-efl/po/ar.po new file mode 100644 index 0000000..879c027 --- /dev/null +++ b/ug-nfc-setting-efl/po/ar.po @@ -0,0 +1,9 @@ +msgid "IDS_NFC_BODY_NFC" +msgstr "NFC" + +msgid "IDS_NFC_BODY_S_BEAM_DESCRIPTION_MSG_CHN" +msgstr "When this feature is turned on, you can beam files to other NFC and WLAN Direct devices by holding the devices close together. For example, you can beam image/video files from the Gallery, music files from the Music player, and more. Just bring the devices together (typically back to back) and then tap your screen. The app determines what is beamed" + +msgid "IDS_NFC_OPT_S_BEAM" +msgstr "S Beam" + diff --git a/ug-nfc-setting-efl/po/bg.po b/ug-nfc-setting-efl/po/bg.po new file mode 100644 index 0000000..879c027 --- /dev/null +++ b/ug-nfc-setting-efl/po/bg.po @@ -0,0 +1,9 @@ +msgid "IDS_NFC_BODY_NFC" +msgstr "NFC" + +msgid "IDS_NFC_BODY_S_BEAM_DESCRIPTION_MSG_CHN" +msgstr "When this feature is turned on, you can beam files to other NFC and WLAN Direct devices by holding the devices close together. For example, you can beam image/video files from the Gallery, music files from the Music player, and more. Just bring the devices together (typically back to back) and then tap your screen. The app determines what is beamed" + +msgid "IDS_NFC_OPT_S_BEAM" +msgstr "S Beam" + diff --git a/ug-nfc-setting-efl/po/ca.po b/ug-nfc-setting-efl/po/ca.po new file mode 100644 index 0000000..879c027 --- /dev/null +++ b/ug-nfc-setting-efl/po/ca.po @@ -0,0 +1,9 @@ +msgid "IDS_NFC_BODY_NFC" +msgstr "NFC" + +msgid "IDS_NFC_BODY_S_BEAM_DESCRIPTION_MSG_CHN" +msgstr "When this feature is turned on, you can beam files to other NFC and WLAN Direct devices by holding the devices close together. For example, you can beam image/video files from the Gallery, music files from the Music player, and more. Just bring the devices together (typically back to back) and then tap your screen. The app determines what is beamed" + +msgid "IDS_NFC_OPT_S_BEAM" +msgstr "S Beam" + diff --git a/ug-nfc-setting-efl/po/cs.po b/ug-nfc-setting-efl/po/cs.po new file mode 100644 index 0000000..879c027 --- /dev/null +++ b/ug-nfc-setting-efl/po/cs.po @@ -0,0 +1,9 @@ +msgid "IDS_NFC_BODY_NFC" +msgstr "NFC" + +msgid "IDS_NFC_BODY_S_BEAM_DESCRIPTION_MSG_CHN" +msgstr "When this feature is turned on, you can beam files to other NFC and WLAN Direct devices by holding the devices close together. For example, you can beam image/video files from the Gallery, music files from the Music player, and more. Just bring the devices together (typically back to back) and then tap your screen. The app determines what is beamed" + +msgid "IDS_NFC_OPT_S_BEAM" +msgstr "S Beam" + diff --git a/ug-nfc-setting-efl/po/da.po b/ug-nfc-setting-efl/po/da.po new file mode 100644 index 0000000..879c027 --- /dev/null +++ b/ug-nfc-setting-efl/po/da.po @@ -0,0 +1,9 @@ +msgid "IDS_NFC_BODY_NFC" +msgstr "NFC" + +msgid "IDS_NFC_BODY_S_BEAM_DESCRIPTION_MSG_CHN" +msgstr "When this feature is turned on, you can beam files to other NFC and WLAN Direct devices by holding the devices close together. For example, you can beam image/video files from the Gallery, music files from the Music player, and more. Just bring the devices together (typically back to back) and then tap your screen. The app determines what is beamed" + +msgid "IDS_NFC_OPT_S_BEAM" +msgstr "S Beam" + diff --git a/ug-nfc-setting-efl/po/de_DE.po b/ug-nfc-setting-efl/po/de_DE.po index 93e9121..879c027 100755..100644 --- a/ug-nfc-setting-efl/po/de_DE.po +++ b/ug-nfc-setting-efl/po/de_DE.po @@ -1,6 +1,9 @@ msgid "IDS_NFC_BODY_NFC" msgstr "NFC" -msgid "IDS_NFC_POP_ACTIVATION" -msgstr "Aktivierung" +msgid "IDS_NFC_BODY_S_BEAM_DESCRIPTION_MSG_CHN" +msgstr "When this feature is turned on, you can beam files to other NFC and WLAN Direct devices by holding the devices close together. For example, you can beam image/video files from the Gallery, music files from the Music player, and more. Just bring the devices together (typically back to back) and then tap your screen. The app determines what is beamed" + +msgid "IDS_NFC_OPT_S_BEAM" +msgstr "S Beam" diff --git a/ug-nfc-setting-efl/po/el_GR.po b/ug-nfc-setting-efl/po/el_GR.po index 6de0b24..879c027 100755..100644 --- a/ug-nfc-setting-efl/po/el_GR.po +++ b/ug-nfc-setting-efl/po/el_GR.po @@ -1,6 +1,9 @@ msgid "IDS_NFC_BODY_NFC" msgstr "NFC" -msgid "IDS_NFC_POP_ACTIVATION" -msgstr "Ενεργοποίηση" +msgid "IDS_NFC_BODY_S_BEAM_DESCRIPTION_MSG_CHN" +msgstr "When this feature is turned on, you can beam files to other NFC and WLAN Direct devices by holding the devices close together. For example, you can beam image/video files from the Gallery, music files from the Music player, and more. Just bring the devices together (typically back to back) and then tap your screen. The app determines what is beamed" + +msgid "IDS_NFC_OPT_S_BEAM" +msgstr "S Beam" diff --git a/ug-nfc-setting-efl/po/en.po b/ug-nfc-setting-efl/po/en.po index dcd1598..879c027 100755..100644 --- a/ug-nfc-setting-efl/po/en.po +++ b/ug-nfc-setting-efl/po/en.po @@ -1,6 +1,9 @@ msgid "IDS_NFC_BODY_NFC" msgstr "NFC" -msgid "IDS_NFC_POP_ACTIVATION" -msgstr "Activation" +msgid "IDS_NFC_BODY_S_BEAM_DESCRIPTION_MSG_CHN" +msgstr "When this feature is turned on, you can beam files to other NFC and WLAN Direct devices by holding the devices close together. For example, you can beam image/video files from the Gallery, music files from the Music player, and more. Just bring the devices together (typically back to back) and then tap your screen. The app determines what is beamed" + +msgid "IDS_NFC_OPT_S_BEAM" +msgstr "S Beam" diff --git a/ug-nfc-setting-efl/po/en_US.po b/ug-nfc-setting-efl/po/en_US.po new file mode 100644 index 0000000..879c027 --- /dev/null +++ b/ug-nfc-setting-efl/po/en_US.po @@ -0,0 +1,9 @@ +msgid "IDS_NFC_BODY_NFC" +msgstr "NFC" + +msgid "IDS_NFC_BODY_S_BEAM_DESCRIPTION_MSG_CHN" +msgstr "When this feature is turned on, you can beam files to other NFC and WLAN Direct devices by holding the devices close together. For example, you can beam image/video files from the Gallery, music files from the Music player, and more. Just bring the devices together (typically back to back) and then tap your screen. The app determines what is beamed" + +msgid "IDS_NFC_OPT_S_BEAM" +msgstr "S Beam" + diff --git a/ug-nfc-setting-efl/po/es_ES.po b/ug-nfc-setting-efl/po/es_ES.po index 025d808..879c027 100755..100644 --- a/ug-nfc-setting-efl/po/es_ES.po +++ b/ug-nfc-setting-efl/po/es_ES.po @@ -1,6 +1,9 @@ msgid "IDS_NFC_BODY_NFC" msgstr "NFC" -msgid "IDS_NFC_POP_ACTIVATION" -msgstr "Activación" +msgid "IDS_NFC_BODY_S_BEAM_DESCRIPTION_MSG_CHN" +msgstr "When this feature is turned on, you can beam files to other NFC and WLAN Direct devices by holding the devices close together. For example, you can beam image/video files from the Gallery, music files from the Music player, and more. Just bring the devices together (typically back to back) and then tap your screen. The app determines what is beamed" + +msgid "IDS_NFC_OPT_S_BEAM" +msgstr "S Beam" diff --git a/ug-nfc-setting-efl/po/fi.po b/ug-nfc-setting-efl/po/fi.po new file mode 100644 index 0000000..879c027 --- /dev/null +++ b/ug-nfc-setting-efl/po/fi.po @@ -0,0 +1,9 @@ +msgid "IDS_NFC_BODY_NFC" +msgstr "NFC" + +msgid "IDS_NFC_BODY_S_BEAM_DESCRIPTION_MSG_CHN" +msgstr "When this feature is turned on, you can beam files to other NFC and WLAN Direct devices by holding the devices close together. For example, you can beam image/video files from the Gallery, music files from the Music player, and more. Just bring the devices together (typically back to back) and then tap your screen. The app determines what is beamed" + +msgid "IDS_NFC_OPT_S_BEAM" +msgstr "S Beam" + diff --git a/ug-nfc-setting-efl/po/fr_FR.po b/ug-nfc-setting-efl/po/fr_FR.po index dcd1598..879c027 100755..100644 --- a/ug-nfc-setting-efl/po/fr_FR.po +++ b/ug-nfc-setting-efl/po/fr_FR.po @@ -1,6 +1,9 @@ msgid "IDS_NFC_BODY_NFC" msgstr "NFC" -msgid "IDS_NFC_POP_ACTIVATION" -msgstr "Activation" +msgid "IDS_NFC_BODY_S_BEAM_DESCRIPTION_MSG_CHN" +msgstr "When this feature is turned on, you can beam files to other NFC and WLAN Direct devices by holding the devices close together. For example, you can beam image/video files from the Gallery, music files from the Music player, and more. Just bring the devices together (typically back to back) and then tap your screen. The app determines what is beamed" + +msgid "IDS_NFC_OPT_S_BEAM" +msgstr "S Beam" diff --git a/ug-nfc-setting-efl/po/he.po b/ug-nfc-setting-efl/po/he.po new file mode 100644 index 0000000..879c027 --- /dev/null +++ b/ug-nfc-setting-efl/po/he.po @@ -0,0 +1,9 @@ +msgid "IDS_NFC_BODY_NFC" +msgstr "NFC" + +msgid "IDS_NFC_BODY_S_BEAM_DESCRIPTION_MSG_CHN" +msgstr "When this feature is turned on, you can beam files to other NFC and WLAN Direct devices by holding the devices close together. For example, you can beam image/video files from the Gallery, music files from the Music player, and more. Just bring the devices together (typically back to back) and then tap your screen. The app determines what is beamed" + +msgid "IDS_NFC_OPT_S_BEAM" +msgstr "S Beam" + diff --git a/ug-nfc-setting-efl/po/hi.po b/ug-nfc-setting-efl/po/hi.po new file mode 100644 index 0000000..84cafc3 --- /dev/null +++ b/ug-nfc-setting-efl/po/hi.po @@ -0,0 +1,9 @@ +msgid "IDS_NFC_BODY_NFC" +msgstr "एनएफसी" + +msgid "IDS_NFC_BODY_S_BEAM_DESCRIPTION_MSG_CHN" +msgstr "When this feature is turned on, you can beam files to other NFC and WLAN Direct devices by holding the devices close together. For example, you can beam image/video files from the Gallery, music files from the Music player, and more. Just bring the devices together (typically back to back) and then tap your screen. The app determines what is beamed" + +msgid "IDS_NFC_OPT_S_BEAM" +msgstr "S Beam" + diff --git a/ug-nfc-setting-efl/po/hr.po b/ug-nfc-setting-efl/po/hr.po new file mode 100644 index 0000000..879c027 --- /dev/null +++ b/ug-nfc-setting-efl/po/hr.po @@ -0,0 +1,9 @@ +msgid "IDS_NFC_BODY_NFC" +msgstr "NFC" + +msgid "IDS_NFC_BODY_S_BEAM_DESCRIPTION_MSG_CHN" +msgstr "When this feature is turned on, you can beam files to other NFC and WLAN Direct devices by holding the devices close together. For example, you can beam image/video files from the Gallery, music files from the Music player, and more. Just bring the devices together (typically back to back) and then tap your screen. The app determines what is beamed" + +msgid "IDS_NFC_OPT_S_BEAM" +msgstr "S Beam" + diff --git a/ug-nfc-setting-efl/po/hu.po b/ug-nfc-setting-efl/po/hu.po new file mode 100644 index 0000000..879c027 --- /dev/null +++ b/ug-nfc-setting-efl/po/hu.po @@ -0,0 +1,9 @@ +msgid "IDS_NFC_BODY_NFC" +msgstr "NFC" + +msgid "IDS_NFC_BODY_S_BEAM_DESCRIPTION_MSG_CHN" +msgstr "When this feature is turned on, you can beam files to other NFC and WLAN Direct devices by holding the devices close together. For example, you can beam image/video files from the Gallery, music files from the Music player, and more. Just bring the devices together (typically back to back) and then tap your screen. The app determines what is beamed" + +msgid "IDS_NFC_OPT_S_BEAM" +msgstr "S Beam" + diff --git a/ug-nfc-setting-efl/po/id.po b/ug-nfc-setting-efl/po/id.po new file mode 100644 index 0000000..879c027 --- /dev/null +++ b/ug-nfc-setting-efl/po/id.po @@ -0,0 +1,9 @@ +msgid "IDS_NFC_BODY_NFC" +msgstr "NFC" + +msgid "IDS_NFC_BODY_S_BEAM_DESCRIPTION_MSG_CHN" +msgstr "When this feature is turned on, you can beam files to other NFC and WLAN Direct devices by holding the devices close together. For example, you can beam image/video files from the Gallery, music files from the Music player, and more. Just bring the devices together (typically back to back) and then tap your screen. The app determines what is beamed" + +msgid "IDS_NFC_OPT_S_BEAM" +msgstr "S Beam" + diff --git a/ug-nfc-setting-efl/po/it_IT.po b/ug-nfc-setting-efl/po/it_IT.po index 22697f8..879c027 100755..100644 --- a/ug-nfc-setting-efl/po/it_IT.po +++ b/ug-nfc-setting-efl/po/it_IT.po @@ -1,6 +1,9 @@ msgid "IDS_NFC_BODY_NFC" msgstr "NFC" -msgid "IDS_NFC_POP_ACTIVATION" -msgstr "Attivazione" +msgid "IDS_NFC_BODY_S_BEAM_DESCRIPTION_MSG_CHN" +msgstr "When this feature is turned on, you can beam files to other NFC and WLAN Direct devices by holding the devices close together. For example, you can beam image/video files from the Gallery, music files from the Music player, and more. Just bring the devices together (typically back to back) and then tap your screen. The app determines what is beamed" + +msgid "IDS_NFC_OPT_S_BEAM" +msgstr "S Beam" diff --git a/ug-nfc-setting-efl/po/ja_JP.po b/ug-nfc-setting-efl/po/ja_JP.po index 21dd4c1..879c027 100755..100644 --- a/ug-nfc-setting-efl/po/ja_JP.po +++ b/ug-nfc-setting-efl/po/ja_JP.po @@ -1,6 +1,9 @@ msgid "IDS_NFC_BODY_NFC" msgstr "NFC" -msgid "IDS_NFC_POP_ACTIVATION" -msgstr "アクティベーション" +msgid "IDS_NFC_BODY_S_BEAM_DESCRIPTION_MSG_CHN" +msgstr "When this feature is turned on, you can beam files to other NFC and WLAN Direct devices by holding the devices close together. For example, you can beam image/video files from the Gallery, music files from the Music player, and more. Just bring the devices together (typically back to back) and then tap your screen. The app determines what is beamed" + +msgid "IDS_NFC_OPT_S_BEAM" +msgstr "S Beam" diff --git a/ug-nfc-setting-efl/po/ko_KR.po b/ug-nfc-setting-efl/po/ko_KR.po index 185b371..31e8402 100755..100644 --- a/ug-nfc-setting-efl/po/ko_KR.po +++ b/ug-nfc-setting-efl/po/ko_KR.po @@ -1,6 +1,9 @@ msgid "IDS_NFC_BODY_NFC" msgstr "NFC" -msgid "IDS_NFC_POP_ACTIVATION" -msgstr "실행" +msgid "IDS_NFC_BODY_S_BEAM_DESCRIPTION_MSG_CHN" +msgstr "이 기능을 켜면 디바이스를 가까이 놓아 다른 NFC 및 WLAN Direct 기기로 파일을 무선 송수신할 수 있습니다. 예를 들어 갤러리의 이미지/동영상 파일, 뮤직 플레이어의 음악 파일 등을 송수신할 수 있습니다. 디바이스를 가까이에 놓은 후(대개 뒷면을 맞댐) 화면을 누르세요. 송수신될 내용은 애플리케이션에 의해 결정됩니다" + +msgid "IDS_NFC_OPT_S_BEAM" +msgstr "S Beam" diff --git a/ug-nfc-setting-efl/po/lt.po b/ug-nfc-setting-efl/po/lt.po new file mode 100644 index 0000000..879c027 --- /dev/null +++ b/ug-nfc-setting-efl/po/lt.po @@ -0,0 +1,9 @@ +msgid "IDS_NFC_BODY_NFC" +msgstr "NFC" + +msgid "IDS_NFC_BODY_S_BEAM_DESCRIPTION_MSG_CHN" +msgstr "When this feature is turned on, you can beam files to other NFC and WLAN Direct devices by holding the devices close together. For example, you can beam image/video files from the Gallery, music files from the Music player, and more. Just bring the devices together (typically back to back) and then tap your screen. The app determines what is beamed" + +msgid "IDS_NFC_OPT_S_BEAM" +msgstr "S Beam" + diff --git a/ug-nfc-setting-efl/po/lv.po b/ug-nfc-setting-efl/po/lv.po new file mode 100644 index 0000000..879c027 --- /dev/null +++ b/ug-nfc-setting-efl/po/lv.po @@ -0,0 +1,9 @@ +msgid "IDS_NFC_BODY_NFC" +msgstr "NFC" + +msgid "IDS_NFC_BODY_S_BEAM_DESCRIPTION_MSG_CHN" +msgstr "When this feature is turned on, you can beam files to other NFC and WLAN Direct devices by holding the devices close together. For example, you can beam image/video files from the Gallery, music files from the Music player, and more. Just bring the devices together (typically back to back) and then tap your screen. The app determines what is beamed" + +msgid "IDS_NFC_OPT_S_BEAM" +msgstr "S Beam" + diff --git a/ug-nfc-setting-efl/po/ms.po b/ug-nfc-setting-efl/po/ms.po new file mode 100644 index 0000000..879c027 --- /dev/null +++ b/ug-nfc-setting-efl/po/ms.po @@ -0,0 +1,9 @@ +msgid "IDS_NFC_BODY_NFC" +msgstr "NFC" + +msgid "IDS_NFC_BODY_S_BEAM_DESCRIPTION_MSG_CHN" +msgstr "When this feature is turned on, you can beam files to other NFC and WLAN Direct devices by holding the devices close together. For example, you can beam image/video files from the Gallery, music files from the Music player, and more. Just bring the devices together (typically back to back) and then tap your screen. The app determines what is beamed" + +msgid "IDS_NFC_OPT_S_BEAM" +msgstr "S Beam" + diff --git a/ug-nfc-setting-efl/po/nl_NL.po b/ug-nfc-setting-efl/po/nl_NL.po index 297f541..879c027 100755..100644 --- a/ug-nfc-setting-efl/po/nl_NL.po +++ b/ug-nfc-setting-efl/po/nl_NL.po @@ -1,6 +1,9 @@ msgid "IDS_NFC_BODY_NFC" msgstr "NFC" -msgid "IDS_NFC_POP_ACTIVATION" -msgstr "Inschakelen" +msgid "IDS_NFC_BODY_S_BEAM_DESCRIPTION_MSG_CHN" +msgstr "When this feature is turned on, you can beam files to other NFC and WLAN Direct devices by holding the devices close together. For example, you can beam image/video files from the Gallery, music files from the Music player, and more. Just bring the devices together (typically back to back) and then tap your screen. The app determines what is beamed" + +msgid "IDS_NFC_OPT_S_BEAM" +msgstr "S Beam" diff --git a/ug-nfc-setting-efl/po/no.po b/ug-nfc-setting-efl/po/no.po new file mode 100644 index 0000000..879c027 --- /dev/null +++ b/ug-nfc-setting-efl/po/no.po @@ -0,0 +1,9 @@ +msgid "IDS_NFC_BODY_NFC" +msgstr "NFC" + +msgid "IDS_NFC_BODY_S_BEAM_DESCRIPTION_MSG_CHN" +msgstr "When this feature is turned on, you can beam files to other NFC and WLAN Direct devices by holding the devices close together. For example, you can beam image/video files from the Gallery, music files from the Music player, and more. Just bring the devices together (typically back to back) and then tap your screen. The app determines what is beamed" + +msgid "IDS_NFC_OPT_S_BEAM" +msgstr "S Beam" + diff --git a/ug-nfc-setting-efl/po/pl.po b/ug-nfc-setting-efl/po/pl.po new file mode 100644 index 0000000..879c027 --- /dev/null +++ b/ug-nfc-setting-efl/po/pl.po @@ -0,0 +1,9 @@ +msgid "IDS_NFC_BODY_NFC" +msgstr "NFC" + +msgid "IDS_NFC_BODY_S_BEAM_DESCRIPTION_MSG_CHN" +msgstr "When this feature is turned on, you can beam files to other NFC and WLAN Direct devices by holding the devices close together. For example, you can beam image/video files from the Gallery, music files from the Music player, and more. Just bring the devices together (typically back to back) and then tap your screen. The app determines what is beamed" + +msgid "IDS_NFC_OPT_S_BEAM" +msgstr "S Beam" + diff --git a/ug-nfc-setting-efl/po/pt_PT.po b/ug-nfc-setting-efl/po/pt_PT.po index f43b1cd..879c027 100755..100644 --- a/ug-nfc-setting-efl/po/pt_PT.po +++ b/ug-nfc-setting-efl/po/pt_PT.po @@ -1,6 +1,9 @@ msgid "IDS_NFC_BODY_NFC" msgstr "NFC" -msgid "IDS_NFC_POP_ACTIVATION" -msgstr "Activação" +msgid "IDS_NFC_BODY_S_BEAM_DESCRIPTION_MSG_CHN" +msgstr "When this feature is turned on, you can beam files to other NFC and WLAN Direct devices by holding the devices close together. For example, you can beam image/video files from the Gallery, music files from the Music player, and more. Just bring the devices together (typically back to back) and then tap your screen. The app determines what is beamed" + +msgid "IDS_NFC_OPT_S_BEAM" +msgstr "S Beam" diff --git a/ug-nfc-setting-efl/po/ro.po b/ug-nfc-setting-efl/po/ro.po new file mode 100644 index 0000000..879c027 --- /dev/null +++ b/ug-nfc-setting-efl/po/ro.po @@ -0,0 +1,9 @@ +msgid "IDS_NFC_BODY_NFC" +msgstr "NFC" + +msgid "IDS_NFC_BODY_S_BEAM_DESCRIPTION_MSG_CHN" +msgstr "When this feature is turned on, you can beam files to other NFC and WLAN Direct devices by holding the devices close together. For example, you can beam image/video files from the Gallery, music files from the Music player, and more. Just bring the devices together (typically back to back) and then tap your screen. The app determines what is beamed" + +msgid "IDS_NFC_OPT_S_BEAM" +msgstr "S Beam" + diff --git a/ug-nfc-setting-efl/po/ru_RU.po b/ug-nfc-setting-efl/po/ru_RU.po index b308cc1..879c027 100755..100644 --- a/ug-nfc-setting-efl/po/ru_RU.po +++ b/ug-nfc-setting-efl/po/ru_RU.po @@ -1,6 +1,9 @@ msgid "IDS_NFC_BODY_NFC" msgstr "NFC" -msgid "IDS_NFC_POP_ACTIVATION" -msgstr "Активация" +msgid "IDS_NFC_BODY_S_BEAM_DESCRIPTION_MSG_CHN" +msgstr "When this feature is turned on, you can beam files to other NFC and WLAN Direct devices by holding the devices close together. For example, you can beam image/video files from the Gallery, music files from the Music player, and more. Just bring the devices together (typically back to back) and then tap your screen. The app determines what is beamed" + +msgid "IDS_NFC_OPT_S_BEAM" +msgstr "S Beam" diff --git a/ug-nfc-setting-efl/po/sk.po b/ug-nfc-setting-efl/po/sk.po new file mode 100644 index 0000000..879c027 --- /dev/null +++ b/ug-nfc-setting-efl/po/sk.po @@ -0,0 +1,9 @@ +msgid "IDS_NFC_BODY_NFC" +msgstr "NFC" + +msgid "IDS_NFC_BODY_S_BEAM_DESCRIPTION_MSG_CHN" +msgstr "When this feature is turned on, you can beam files to other NFC and WLAN Direct devices by holding the devices close together. For example, you can beam image/video files from the Gallery, music files from the Music player, and more. Just bring the devices together (typically back to back) and then tap your screen. The app determines what is beamed" + +msgid "IDS_NFC_OPT_S_BEAM" +msgstr "S Beam" + diff --git a/ug-nfc-setting-efl/po/sl.po b/ug-nfc-setting-efl/po/sl.po new file mode 100644 index 0000000..879c027 --- /dev/null +++ b/ug-nfc-setting-efl/po/sl.po @@ -0,0 +1,9 @@ +msgid "IDS_NFC_BODY_NFC" +msgstr "NFC" + +msgid "IDS_NFC_BODY_S_BEAM_DESCRIPTION_MSG_CHN" +msgstr "When this feature is turned on, you can beam files to other NFC and WLAN Direct devices by holding the devices close together. For example, you can beam image/video files from the Gallery, music files from the Music player, and more. Just bring the devices together (typically back to back) and then tap your screen. The app determines what is beamed" + +msgid "IDS_NFC_OPT_S_BEAM" +msgstr "S Beam" + diff --git a/ug-nfc-setting-efl/po/sr.po b/ug-nfc-setting-efl/po/sr.po new file mode 100644 index 0000000..879c027 --- /dev/null +++ b/ug-nfc-setting-efl/po/sr.po @@ -0,0 +1,9 @@ +msgid "IDS_NFC_BODY_NFC" +msgstr "NFC" + +msgid "IDS_NFC_BODY_S_BEAM_DESCRIPTION_MSG_CHN" +msgstr "When this feature is turned on, you can beam files to other NFC and WLAN Direct devices by holding the devices close together. For example, you can beam image/video files from the Gallery, music files from the Music player, and more. Just bring the devices together (typically back to back) and then tap your screen. The app determines what is beamed" + +msgid "IDS_NFC_OPT_S_BEAM" +msgstr "S Beam" + diff --git a/ug-nfc-setting-efl/po/sv.po b/ug-nfc-setting-efl/po/sv.po new file mode 100644 index 0000000..879c027 --- /dev/null +++ b/ug-nfc-setting-efl/po/sv.po @@ -0,0 +1,9 @@ +msgid "IDS_NFC_BODY_NFC" +msgstr "NFC" + +msgid "IDS_NFC_BODY_S_BEAM_DESCRIPTION_MSG_CHN" +msgstr "When this feature is turned on, you can beam files to other NFC and WLAN Direct devices by holding the devices close together. For example, you can beam image/video files from the Gallery, music files from the Music player, and more. Just bring the devices together (typically back to back) and then tap your screen. The app determines what is beamed" + +msgid "IDS_NFC_OPT_S_BEAM" +msgstr "S Beam" + diff --git a/ug-nfc-setting-efl/po/th.po b/ug-nfc-setting-efl/po/th.po new file mode 100644 index 0000000..879c027 --- /dev/null +++ b/ug-nfc-setting-efl/po/th.po @@ -0,0 +1,9 @@ +msgid "IDS_NFC_BODY_NFC" +msgstr "NFC" + +msgid "IDS_NFC_BODY_S_BEAM_DESCRIPTION_MSG_CHN" +msgstr "When this feature is turned on, you can beam files to other NFC and WLAN Direct devices by holding the devices close together. For example, you can beam image/video files from the Gallery, music files from the Music player, and more. Just bring the devices together (typically back to back) and then tap your screen. The app determines what is beamed" + +msgid "IDS_NFC_OPT_S_BEAM" +msgstr "S Beam" + diff --git a/ug-nfc-setting-efl/po/tr_TR.po b/ug-nfc-setting-efl/po/tr_TR.po index f70a67d..879c027 100755..100644 --- a/ug-nfc-setting-efl/po/tr_TR.po +++ b/ug-nfc-setting-efl/po/tr_TR.po @@ -1,6 +1,9 @@ msgid "IDS_NFC_BODY_NFC" msgstr "NFC" -msgid "IDS_NFC_POP_ACTIVATION" -msgstr "Etkinleştirme" +msgid "IDS_NFC_BODY_S_BEAM_DESCRIPTION_MSG_CHN" +msgstr "When this feature is turned on, you can beam files to other NFC and WLAN Direct devices by holding the devices close together. For example, you can beam image/video files from the Gallery, music files from the Music player, and more. Just bring the devices together (typically back to back) and then tap your screen. The app determines what is beamed" + +msgid "IDS_NFC_OPT_S_BEAM" +msgstr "S Beam" diff --git a/ug-nfc-setting-efl/po/uk.po b/ug-nfc-setting-efl/po/uk.po new file mode 100644 index 0000000..879c027 --- /dev/null +++ b/ug-nfc-setting-efl/po/uk.po @@ -0,0 +1,9 @@ +msgid "IDS_NFC_BODY_NFC" +msgstr "NFC" + +msgid "IDS_NFC_BODY_S_BEAM_DESCRIPTION_MSG_CHN" +msgstr "When this feature is turned on, you can beam files to other NFC and WLAN Direct devices by holding the devices close together. For example, you can beam image/video files from the Gallery, music files from the Music player, and more. Just bring the devices together (typically back to back) and then tap your screen. The app determines what is beamed" + +msgid "IDS_NFC_OPT_S_BEAM" +msgstr "S Beam" + diff --git a/ug-nfc-setting-efl/po/vi.po b/ug-nfc-setting-efl/po/vi.po new file mode 100644 index 0000000..879c027 --- /dev/null +++ b/ug-nfc-setting-efl/po/vi.po @@ -0,0 +1,9 @@ +msgid "IDS_NFC_BODY_NFC" +msgstr "NFC" + +msgid "IDS_NFC_BODY_S_BEAM_DESCRIPTION_MSG_CHN" +msgstr "When this feature is turned on, you can beam files to other NFC and WLAN Direct devices by holding the devices close together. For example, you can beam image/video files from the Gallery, music files from the Music player, and more. Just bring the devices together (typically back to back) and then tap your screen. The app determines what is beamed" + +msgid "IDS_NFC_OPT_S_BEAM" +msgstr "S Beam" + diff --git a/ug-nfc-setting-efl/po/zh_CN.po b/ug-nfc-setting-efl/po/zh_CN.po index 7731686..3d309b4 100755..100644 --- a/ug-nfc-setting-efl/po/zh_CN.po +++ b/ug-nfc-setting-efl/po/zh_CN.po @@ -1,6 +1,9 @@ msgid "IDS_NFC_BODY_NFC" msgstr "NFC" -msgid "IDS_NFC_POP_ACTIVATION" -msgstr "启动" +msgid "IDS_NFC_BODY_S_BEAM_DESCRIPTION_MSG_CHN" +msgstr "当该功能开启时,您可通过将设备紧靠在一起将文件无线传输至其他 NFC 和 WLAN Direct 设备。例如,您可无线传输来自图库的图片/视频文件、来自音乐播放器的音乐文件,以及更多。只需要将设备放在一起(通常背对背)然后轻敲您的屏幕。应用程序判定无线传输的内容" + +msgid "IDS_NFC_OPT_S_BEAM" +msgstr "S 传送" diff --git a/ug-nfc-setting-efl/po/zh_HK.po b/ug-nfc-setting-efl/po/zh_HK.po index 6d903f7..feaeadd 100755..100644 --- a/ug-nfc-setting-efl/po/zh_HK.po +++ b/ug-nfc-setting-efl/po/zh_HK.po @@ -1,6 +1,9 @@ msgid "IDS_NFC_BODY_NFC" msgstr "NFC" -msgid "IDS_NFC_POP_ACTIVATION" -msgstr "啟動" +msgid "IDS_NFC_BODY_S_BEAM_DESCRIPTION_MSG_CHN" +msgstr "當此功能開啟時,您可通過將裝置緊靠一起時,可發送檔案至其他 NFC 與 WLAN Direct 裝置。例如,您可從媒體瀏覽器發送圖像/影片檔案、從音樂播放器發送音樂檔案等。只需將裝置靠在一起(一般以背對背)然後輕觸螢幕。應用程式將決定發送的檔案" + +msgid "IDS_NFC_OPT_S_BEAM" +msgstr "S Beam" diff --git a/ug-nfc-setting-efl/po/zh_TW.po b/ug-nfc-setting-efl/po/zh_TW.po index 6d903f7..e8e1eef 100755..100644 --- a/ug-nfc-setting-efl/po/zh_TW.po +++ b/ug-nfc-setting-efl/po/zh_TW.po @@ -1,6 +1,9 @@ msgid "IDS_NFC_BODY_NFC" msgstr "NFC" -msgid "IDS_NFC_POP_ACTIVATION" -msgstr "啟動" +msgid "IDS_NFC_BODY_S_BEAM_DESCRIPTION_MSG_CHN" +msgstr "開啟此功能時,將裝置握住靠在一起時,可發送檔案至其他 NFC 與 WLAN Direct 裝置。例如,您可自媒體瀏覽器發送影像/影片檔案、自音樂播放器發送音樂檔案等。只需將裝置靠在一起(一般以背對背)然後輕觸螢幕。應用程式將決定發送的檔案" + +msgid "IDS_NFC_OPT_S_BEAM" +msgstr "S Beam" diff --git a/ug-nfc-setting-efl/src/ug-nfc-setting-main.c b/ug-nfc-setting-efl/src/ug-nfc-setting-main.c index 13471bf..e913cad 100644 --- a/ug-nfc-setting-efl/src/ug-nfc-setting-main.c +++ b/ug-nfc-setting-efl/src/ug-nfc-setting-main.c @@ -14,7 +14,9 @@ * limitations under the License. */ + #include "ug-nfc-setting-main.h" +#include "ug-nfc-setting-popup.h" #include <stdio.h> #include <Elementary.h> @@ -24,24 +26,273 @@ #include <vconf.h> #include <sys/types.h> #include <sys/wait.h> -#include <appcore-efl.h> - #define _EDJ(obj) elm_layout_edje_get(obj) #ifndef UG_MODULE_API #define UG_MODULE_API __attribute__ ((visibility("default"))) #endif -#define NET_NFC_VCONF_KEY_PROGRESS "memory/nfc/progress" - #define NFC_MANAGER_ENABLE 1 #define NFC_MANAGER_DISABLE 0 static Elm_Genlist_Item_Class itc_seperator; -static Elm_Genlist_Item_Class itc_onoff; +static Elm_Genlist_Item_Class itc; static Elm_Object_Item *on_off_item = NULL; +static Elm_Object_Item *sbeam_item = NULL; +static bool pending_status = FALSE; + + +static void _app_error_popup_response_cb(void *data, Evas_Object *obj, void *event_info) +{ + ugdata_t *ug_data = (ugdata_t *)data; + int result = (int)event_info; + + LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__); + + if (ug_data == NULL) + return; + + switch (result) + { + case UG_NFC_POPUP_RESP_CLOSE : + /* destroy UG */ + LOGD("ug_destroy_me >>>>", __FUNCTION__, __LINE__); + ug_destroy_me(ug_data->nfc_setting_ug); + break; + + default : + break; + } + + LOGD("[%s(): %d] END <<<<", __FUNCTION__, __LINE__); +} + +static void _show_app_error_popup(void *data) +{ + ugdata_t *ug_data = (ugdata_t *)data; + char popup_str[POPUP_TEXT_SIZE] = { 0, }; + + LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__); + + if (ug_data == NULL) + return; + + memcpy(popup_str, IDS_NFC_SERVICE_IS_NOT_SUPPORTED, strlen(IDS_NFC_SERVICE_IS_NOT_SUPPORTED)); + + ug_nfc_setting_create_popup(ug_data, ug_data->base_layout, popup_str, IDS_CLOSE, UG_NFC_POPUP_RESP_CLOSE, NULL, 0, NULL, 0, false, false, _app_error_popup_response_cb); + + LOGD("[%s(): %d] END <<<<", __FUNCTION__, __LINE__); +} + +int _get_theme_type() +{ + /* TODO : will be added */ + return 0; +} + +const char *_get_font_name(int font) +{ + const char *name = NULL; + + /* TODO : will be improved */ + if (_get_theme_type() == 0) + { + switch (font) + { + case UG_FONT_LIST : + name = "SLP"; + break; + + case UG_FONT_SBEAM_TITLE : + name = "SLP"; + break; + + case UG_FONT_LIVEBOX : + name = "SLP"; + break; + + case UG_FONT_HELP : + name = "SLP"; + break; + + default : + LOGD("[%s(): %d] unknown font type [%d]", __FUNCTION__, __LINE__, font); + break; + } + } + + return name; +} + +uint32_t _get_font_color(int font) +{ + uint32_t color = 0x00808080; + + /* TODO : will be improved */ + if (_get_theme_type() == 0) + { + switch (font) + { + case UG_FONT_LIST : + color = 0x00000000; + break; + + case UG_FONT_SBEAM_TITLE : + color = 0x00000000; + break; + + case UG_FONT_LIVEBOX : + color = 0x00FFFFFF; + break; + + case UG_FONT_HELP : + color = 0x00000000; + break; + + default : + LOGD("[%s(): %d] unknown font type [%d]", __FUNCTION__, __LINE__, font); + break; + } + } + + return color; +} + +int _get_font_size(int font) +{ + int size = 0; + + /* TODO : will be improved */ + if (_get_theme_type() == 0) + { + switch (font) + { + case UG_FONT_LIST : + size = 28; + break; + + case UG_FONT_SBEAM_TITLE : + size = 38; + break; + + case UG_FONT_LIVEBOX : + size = 30; + break; + + case UG_FONT_HELP : + size = 32; + break; + + default : + LOGD("[%s(): %d] unknown font type [%d]", __FUNCTION__, __LINE__, font); + break; + } + } + + return size; +} -static void _change_nfc_setting(void) +const char *_get_font_style(int font) +{ + const char *style = NULL; + + /* TODO : will be improved */ + if (_get_theme_type() == 0) + { + switch (font) + { + case UG_FONT_LIST : + style = "bold"; + break; + + case UG_FONT_SBEAM_TITLE : + style = ""; + break; + + case UG_FONT_LIVEBOX : + style = ""; + break; + + case UG_FONT_HELP : + style = "bold"; + break; + + default : + LOGD("[%s(): %d] unknown font type [%d]", __FUNCTION__, __LINE__, font); + break; + } + } + + return style; +} + +bool _get_label_text(int font, const char *text, int align, char *output, int len) +{ + bool result = false; + char *align_begin = NULL; + char *align_end = NULL; + + if (text == NULL) + return result; + + switch (align) + { + case UG_ALIGN_CENTER : + align_begin = "<align=center>"; + align_end = "</align>"; + break; + + case UG_ALIGN_RIGHT : + align_begin = "<align=right>"; + align_end = "</align>"; + break; + + case UG_ALIGN_LEFT : + default : + align_begin = ""; + align_end = ""; + break; + } + + /* TODO : will be improved */ + if (_get_font_style(font) != NULL) + { + snprintf(output, len, "%s<font_size=%d><color=#%06X><b>%s</b></color></font_size>%s", align_begin, _get_font_size(font), _get_font_color(font), text, align_end); + } + else + { + snprintf(output, len, "%s<font_size=%d><color=#%06X>%s</color></font_size>%s", align_begin, _get_font_size(font), _get_font_color(font), text, align_end); + } + + return result; +} + +static bool _get_pending_status(void) +{ + return pending_status; +} + +static void _set_pending_status(bool status) +{ + pending_status = status; +} + +static void _activation_completed_cb(nfc_error_e error, void *user_data) +{ + LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__); + +#if 0 + _set_pending_status(FALSE); + + if (on_off_item != NULL) + elm_genlist_item_update(on_off_item); +#endif + nfc_manager_deinitialize(); + + LOGD("[%s(): %d] END <<<<", __FUNCTION__, __LINE__); +} + +static void _change_nfc_onoff_setting(void) { int status; int result; @@ -51,8 +302,10 @@ static void _change_nfc_setting(void) if ((result = vconf_get_bool(VCONFKEY_NFC_STATE, &status)) == 0) { LOGD("[%s(): %d] vconf_get_bool status [%d]\n", __FUNCTION__, __LINE__, status); + nfc_manager_initialize(NULL, NULL); - nfc_manager_set_activation(!status, NULL, NULL); + _set_pending_status(TRUE); + nfc_manager_set_activation(!status, _activation_completed_cb, NULL); } else { @@ -62,19 +315,114 @@ static void _change_nfc_setting(void) LOGD("[%s(): %d] END <<<<", __FUNCTION__, __LINE__); } -static void _vconf_key_cb(keynode_t *node, void *user_data) +static void _change_nfc_sbeam_setting(void) { + int status; + int result; + LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__); - if (node == NULL || user_data == NULL) + if ((result = vconf_get_bool(VCONFKEY_NFC_SBEAM, &status)) == 0) + { + LOGD("[%s(): %d] vconf_get_bool status [%d]\n", __FUNCTION__, __LINE__, status); + + if (status) + { + vconf_set_bool(VCONFKEY_NFC_SBEAM, FALSE); + } + else + { + vconf_set_bool(VCONFKEY_NFC_SBEAM, TRUE); + } + } + else + { + LOGD("[%s(): %d] vconf_get_bool failed\n", __FUNCTION__, __LINE__); + } + + LOGD("[%s(): %d] END <<<<", __FUNCTION__, __LINE__); +} + +static void _nfc_onoff_vconf_update_cb(keynode_t *key, void *data) +{ + LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__); + + int nfc_mode = 0; + int sbeam_state = 0; + static int sbeam_off_by_nfcOnOff = EINA_FALSE; + int result; + + if ((result = vconf_get_bool(VCONFKEY_NFC_STATE, &nfc_mode)) == 0) + { + LOGD("[%s(): %d] vconf_get_bool status [%d]\n", __FUNCTION__, __LINE__, nfc_mode); + } + else + { + LOGD("[%s(): %d] vconf_get_bool failed\n", __FUNCTION__, __LINE__); + return; + } + + if ((result = vconf_get_bool(VCONFKEY_NFC_SBEAM, &sbeam_state)) == 0) + { + LOGD("[%s(): %d] vconf_get_bool status [%d]\n", __FUNCTION__, __LINE__, sbeam_state); + } + else { - LOGE("[%s(): %d] abnormal parameter", __FUNCTION__, __LINE__); + LOGD("[%s(): %d] vconf_get_bool failed\n", __FUNCTION__, __LINE__); return; } + LOGD("nfc mode %s \n", nfc_mode > 0 ? "ON" : "OFF"); + LOGD("S BEAM state %d, NFC was off by nfcOnOff %s \n", + sbeam_state, sbeam_off_by_nfcOnOff == EINA_TRUE ? "Yes" : "No"); + + /* nfc setting ui updated */ + _set_pending_status(FALSE); + if (on_off_item != NULL) elm_genlist_item_update(on_off_item); + if (nfc_mode == VCONFKEY_NFC_STATE_OFF) + { + /* sbeam setting disabled */ + elm_object_item_disabled_set(sbeam_item, EINA_TRUE); + + if (sbeam_state == VCONFKEY_NFC_SBEAM_OFF) + return; + + LOGD("Turning S Beam off \n"); + + _change_nfc_sbeam_setting(); + + if (sbeam_item != NULL) + elm_genlist_item_update(sbeam_item); + + /* set internal flag */ + sbeam_off_by_nfcOnOff = EINA_TRUE; + } + else if (nfc_mode > VCONFKEY_NFC_STATE_OFF) + { + /* sbeam setting enabled */ + elm_object_item_disabled_set(sbeam_item, EINA_FALSE); + + if (sbeam_off_by_nfcOnOff != EINA_TRUE) + return; + + LOGD("Turning S Beam on \n"); + + _change_nfc_sbeam_setting(); + + if (sbeam_item != NULL) + elm_genlist_item_update(sbeam_item); + + /* unset internal flag */ + sbeam_off_by_nfcOnOff = EINA_FALSE; + } + else + { + LOGD("Invalid Vconf value \n"); + } + LOGD("[%s(): %d] END <<<<", __FUNCTION__, __LINE__); } @@ -85,8 +433,6 @@ static Evas_Object *_create_bg(Evas_Object *win) evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(bg, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_object_style_set(bg, "transparent"); - elm_win_resize_object_add(win, bg); evas_object_show(bg); @@ -94,7 +440,7 @@ static Evas_Object *_create_bg(Evas_Object *win) return bg; } -static Evas_Object *_create_main_layout(Evas_Object* parent) +static Evas_Object *_create_main_layout(Evas_Object *parent) { Evas_Object *layout; @@ -121,21 +467,55 @@ static Eina_Bool _gl_state_get(void *data, Evas_Object *obj, const char *part) LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__); - if (!vconf_get_bool(VCONFKEY_NFC_STATE, &enable)) + gl_item_data *item_data = (gl_item_data *)data; + + if (item_data == NULL) + { + LOGD("[%s(): %d] item_data is null", __FUNCTION__, __LINE__); + return EINA_FALSE; + } + + if (item_data->type == NFC_ON_OFF) { - if (enable != 0) + if (!vconf_get_bool(VCONFKEY_NFC_STATE, &enable)) { - LOGD("[%s(): %d] vconf_get_bool true", __FUNCTION__, __LINE__); - result = EINA_TRUE; + if (enable != 0) + { + LOGD("[%s(): %d] vconf_get_bool true", __FUNCTION__, __LINE__); + result = EINA_TRUE; + } + else + { + LOGD("[%s(): %d] vconf_get_bool false", __FUNCTION__, __LINE__); + } } else { - LOGD("[%s(): %d] vconf_get_bool false", __FUNCTION__, __LINE__); + LOGD("[%s(): %d] vconf_get_bool error [%d]", __FUNCTION__, __LINE__, result); + } + } + else if (item_data->type == NFC_S_BEAM) + { + if (!vconf_get_bool(VCONFKEY_NFC_SBEAM, &enable)) + { + if (enable != 0) + { + LOGD("[%s(): %d] vconf_get_bool true", __FUNCTION__, __LINE__); + result = EINA_TRUE; + } + else + { + LOGD("[%s(): %d] vconf_get_bool false", __FUNCTION__, __LINE__); + } + } + else + { + LOGD("[%s(): %d] vconf_get_bool error [%d]", __FUNCTION__, __LINE__, result); } } else { - LOGD("[%s(): %d] vconf_get_bool error [%d]", __FUNCTION__, __LINE__, result); + LOGD("[%s(): %d] item_data->type error", __FUNCTION__, __LINE__); } LOGD("[%s(): %d] END <<<<", __FUNCTION__, __LINE__); @@ -146,60 +526,91 @@ static Eina_Bool _gl_state_get(void *data, Evas_Object *obj, const char *part) // callback for 'deletion' static void _gl_del(void *data, Evas_Object *obj) { + gl_item_data *item_data = (gl_item_data *)data; + LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__); - LOGD("[%s(): %d] END <<<<", __FUNCTION__, __LINE__); - return; + free(item_data); + + LOGD("[%s(): %d] END <<<<", __FUNCTION__, __LINE__); } static void _gl_sel_activation(void *data, Evas_Object *obj, void *event_info) { Elm_Object_Item *item = (Elm_Object_Item *)event_info; + gl_item_data *item_data = (gl_item_data *)data; - LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__); + elm_genlist_item_selected_set(item, 0); - if (item == NULL) + if ((item == NULL) || (item_data == NULL)) { - LOGD("[%s(): %d] item is null\n", __FUNCTION__, __LINE__); + LOGD("[%s(): %d] item or item_data is null\n", __FUNCTION__, __LINE__); return; } - ugdata_t *ug_data = (ugdata_t *)data; - if (ug_data == NULL) + if (item_data->type == NFC_ON_OFF) { - LOGD("[%s(): %d] ug_data is null\n", __FUNCTION__, __LINE__); - goto ERROR; - } + LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__); - elm_genlist_item_selected_set(item, 0); + if (_get_pending_status()) + { + LOGD("[%s(): %d] pending status \n", __FUNCTION__, __LINE__); + return; + } - _change_nfc_setting(); + _change_nfc_onoff_setting(); -ERROR : - elm_genlist_item_update(item); + elm_genlist_item_update(item); + } + else if (item_data->type == NFC_S_BEAM) + { + _change_nfc_sbeam_setting(); + + elm_genlist_item_update(item); + } + else + { + LOGD("[%s(): %d] item_data->type error", __FUNCTION__, __LINE__); + } LOGD("[%s(): %d] END <<<<", __FUNCTION__, __LINE__); } -static void _nfc_on_off_changed_cb(void *data, Evas_Object *obj, void *event_info) +static void _check_changed_cb(void *data, Evas_Object *obj, void *event_info) { - ugdata_t *ug_data = (ugdata_t *)data; - int state = 0; - int result = EINA_FALSE; + gl_item_data *item_data = (gl_item_data *)data; LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__); - _change_nfc_setting(); + if (item_data == NULL) + { + LOGD("[%s(): %d] item_data is null\n", __FUNCTION__, __LINE__); + return; + } + + if (item_data->type == NFC_ON_OFF) + { + if (_get_pending_status()) + { + LOGD("[%s(): %d] pending status \n", __FUNCTION__, __LINE__); + return; + } - if (((result = vconf_get_bool(VCONFKEY_NFC_STATE, &state)) == 0) && (state != 0)) + _change_nfc_onoff_setting(); + + if (on_off_item != NULL) + elm_genlist_item_update(on_off_item); + } + else if (item_data->type == NFC_S_BEAM) { - LOGD("[%s(): %d] vconf_get_bool true", __FUNCTION__, __LINE__); - elm_check_state_set(ug_data->check, EINA_TRUE); + _change_nfc_sbeam_setting(); + + if (sbeam_item != NULL) + elm_genlist_item_update(sbeam_item); } else { - LOGD("[%s(): %d] vconf_get_bool false or failed", __FUNCTION__, __LINE__); - elm_check_state_set(ug_data->check, EINA_FALSE); + LOGD("[%s(): %d] item_data->type error", __FUNCTION__, __LINE__); } LOGD("[%s(): %d] END <<<<", __FUNCTION__, __LINE__); @@ -211,32 +622,77 @@ static Evas_Object *_gl_content_get(void *data, Evas_Object *obj, const char *pa Evas_Object *content = NULL; int on; int result = EINA_FALSE; + ugdata_t *ug_data = NULL; - ugdata_t *ug_data = (ugdata_t *)data; + gl_item_data *item_data = (gl_item_data *)data; + if (item_data == NULL) + { + LOGD("[%s(): %d] item_data is null", __FUNCTION__, __LINE__); + return NULL; + } + ug_data = item_data->data; if (ug_data == NULL) { - LOGD("[%s(): %d] ug data is null", __FUNCTION__, __LINE__); + LOGD("[%s(): %d] ug_data is null", __FUNCTION__, __LINE__); return NULL; } - ug_data->check = content = elm_check_add(obj); - evas_object_propagate_events_set(ug_data->check, EINA_FALSE); - evas_object_smart_callback_add(ug_data->check, "changed", _nfc_on_off_changed_cb, ug_data); - - if (((result = vconf_get_bool(VCONFKEY_NFC_STATE, &on)) == 0) && (on != 0)) + if (item_data->type == NFC_ON_OFF) { - LOGD("[%s(): %d] vconf_get_bool true", __FUNCTION__, __LINE__); - elm_check_state_set(ug_data->check, EINA_TRUE); + if (_get_pending_status()) + { + content = elm_progressbar_add(obj); + elm_object_style_set(content, "list_process"); + evas_object_size_hint_align_set(content, EVAS_HINT_FILL, 0.5); + evas_object_size_hint_weight_set(content, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_show(content); + elm_progressbar_pulse(content, EINA_TRUE); + } + else + { + content = elm_check_add(obj); + evas_object_propagate_events_set(content, EINA_FALSE); + evas_object_smart_callback_add(content, "changed", _check_changed_cb, item_data); + + if (((result = vconf_get_bool(VCONFKEY_NFC_STATE, &on)) == 0) && (on != 0)) + { + LOGD("[%s(): %d] vconf_get_bool true", __FUNCTION__, __LINE__); + elm_check_state_set(content, EINA_TRUE); + } + else + { + LOGD("[%s(): %d] vconf_get_bool false", __FUNCTION__, __LINE__); + elm_check_state_set(content, EINA_FALSE); + } + + elm_object_style_set(content, "on&off"); + } + } + else if (item_data->type == NFC_S_BEAM) + { + content = elm_check_add(obj); + evas_object_propagate_events_set(content, EINA_FALSE); + evas_object_smart_callback_add(content, "changed", _check_changed_cb, item_data); + + if (((result = vconf_get_bool(VCONFKEY_NFC_SBEAM, &on)) == 0) && (on != 0)) + { + LOGD("[%s(): %d] vconf_get_bool true", __FUNCTION__, __LINE__); + elm_check_state_set(content, EINA_TRUE); + } + else + { + LOGD("[%s(): %d] vconf_get_bool false", __FUNCTION__, __LINE__); + elm_check_state_set(content, EINA_FALSE); + } + + elm_object_style_set(content, "on&off"); } else { - LOGD("[%s(): %d] vconf_get_bool false or failed", __FUNCTION__, __LINE__); - elm_check_state_set(ug_data->check, EINA_FALSE); + LOGD("[%s(): %d] item_data->type error", __FUNCTION__, __LINE__); } - elm_object_style_set(content, "on&off"); - LOGD("[%s(): %d] END <<<<", __FUNCTION__, __LINE__); return content; @@ -245,29 +701,49 @@ static Evas_Object *_gl_content_get(void *data, Evas_Object *obj, const char *pa static char *_gl_text_get_onoff(void *data, Evas_Object *obj, const char *part) { LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__); + + gl_item_data *item_data = (gl_item_data *)data; char *text = NULL; - text = strdup(IDS_ACTIVATION); + if (item_data == NULL) + { + LOGD("[%s(): %d] item_data is null", __FUNCTION__, __LINE__); + return NULL; + } + + if (item_data->type == NFC_ON_OFF) + { + text = strdup(IDS_NFC_NFC); + } + else if (item_data->type == NFC_S_BEAM) + { + text = strdup(IDS_NFC_S_BEAM); + } + else + { + LOGD("[%s(): %d] type error", __FUNCTION__, __LINE__); + } LOGD("[%s(): %d] END <<<<", __FUNCTION__, __LINE__); + return text; } -static Evas_Object *_ug_nfc_create_setting_layout(void* data) +static Evas_Object *_ug_nfc_create_setting_layout(void *data) { - ugdata_t* ug_data = (ugdata_t*)data; - Evas_Object* layout = NULL; + ugdata_t *ug_data = (ugdata_t *)data; + + Evas_Object *layout = NULL; Evas_Object *genlist = NULL; + /* edj is set to layout */ layout = elm_layout_add(ug_data->base_naviframe); - elm_layout_theme_set(layout, "layout", "application", "noindicator"); + elm_layout_file_set(layout, EDJ_FILE, "nfc_setting"); evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL); - - elm_object_style_set(ug_data->bg, "group_list"); - evas_object_show(layout); + /* make genlist */ genlist = elm_genlist_add(layout); if (genlist == NULL) { @@ -275,6 +751,7 @@ static Evas_Object *_ug_nfc_create_setting_layout(void* data) return NULL; } elm_genlist_bounce_set(genlist, EINA_FALSE, EINA_FALSE); + elm_object_style_set(genlist, "dialogue"); itc_seperator.item_style = "grouptitle.dialogue.seperator"; itc_seperator.func.text_get = NULL; @@ -282,39 +759,69 @@ static Evas_Object *_ug_nfc_create_setting_layout(void* data) itc_seperator.func.state_get = NULL; itc_seperator.func.del = NULL; - itc_onoff.item_style = "dialogue/1text.1icon"; - itc_onoff.func.text_get = _gl_text_get_onoff; - itc_onoff.func.content_get = _gl_content_get; - itc_onoff.func.state_get = _gl_state_get; - itc_onoff.func.del = NULL; + itc.item_style = "dialogue/1text.1icon"; + itc.func.text_get = _gl_text_get_onoff; + itc.func.content_get = _gl_content_get; + itc.func.state_get = _gl_state_get; + itc.func.del = NULL; - // seperator + /* seperator */ Elm_Object_Item* dialoguegroup = elm_genlist_item_append(genlist, &itc_seperator, NULL, NULL, ELM_GENLIST_ITEM_GROUP, NULL, NULL); elm_genlist_item_select_mode_set(dialoguegroup, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY); - //activation - on_off_item = elm_genlist_item_append(genlist, &itc_onoff, (void *)data, NULL, ELM_GENLIST_ITEM_NONE, _gl_sel_activation, (void *)data); - - vconf_notify_key_changed(VCONFKEY_NFC_STATE, _vconf_key_cb, data); - vconf_notify_key_changed(NET_NFC_VCONF_KEY_PROGRESS, _vconf_key_cb, data); + /* NFC setting */ + gl_item_data *on_off_data = NULL; + on_off_data = malloc(sizeof(gl_item_data)); + on_off_data->type = NFC_ON_OFF; + on_off_data->data = ug_data; + on_off_item = elm_genlist_item_append(genlist, &itc, (void *)on_off_data, NULL, ELM_GENLIST_ITEM_NONE, _gl_sel_activation, (void *)on_off_data); + + /* S beam setting */ + gl_item_data *sbeam_data = NULL; + sbeam_data = malloc(sizeof(gl_item_data)); + sbeam_data->type = NFC_S_BEAM; + sbeam_data->data = ug_data; + sbeam_item = elm_genlist_item_append(genlist, &itc, (void *)sbeam_data, NULL, ELM_GENLIST_ITEM_NONE, _gl_sel_activation, (void *)sbeam_data); + + /* S beam setting */ + int result = 0; + int on = 0; + if (((result = vconf_get_bool(VCONFKEY_NFC_STATE, &on)) == 0) && (on == 0)) + { + elm_object_item_disabled_set(sbeam_item, TRUE); + } evas_object_show(genlist); - elm_object_part_content_set(layout, "elm.swallow.content", genlist); + elm_object_part_content_set(layout, "setting_list", genlist); + + /* set help text */ + char path[1024] = { 0, }; + Evas_Object *label = NULL; + + _get_label_text(UG_FONT_HELP, IDS_NFC_S_BEAM_DESCRIPTION_MSG_CHN, UG_ALIGN_LEFT, path, sizeof(path)); + label = elm_label_add(layout); + elm_object_part_content_set(layout, "sbeam_help", label); + elm_label_line_wrap_set(label, ELM_WRAP_MIXED); + elm_object_text_set(label, path); return layout; } static void _back_clicked_cb(void *data, Evas_Object *obj, void *event_info) { + LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__); + ug_destroy_me(data); + + LOGD("[%s(): %d] END <<<<", __FUNCTION__, __LINE__); } -static void *__ug_nfc_setting_create(struct ui_gadget *ug, enum ug_mode mode, bundle *bd, void *user_data) +static void *__ug_nfc_setting_create(ui_gadget_h ug, enum ug_mode mode, service_h service, void *priv) { - ugdata_t* ug_data = (ugdata_t*)user_data; - Evas_Object* parent = NULL; - Evas_Object* nfc_setting_layout = NULL; - Evas_Object* l_button = NULL; + ugdata_t *ug_data = (ugdata_t *)priv; + Evas_Object *parent = NULL; + Evas_Object *nfc_setting_layout = NULL; + Evas_Object *l_button = NULL; parent = ug_get_parent_layout(ug); if (!parent) @@ -336,56 +843,93 @@ static void *__ug_nfc_setting_create(struct ui_gadget *ug, enum ug_mode mode, bu evas_object_show(ug_data->base_layout); evas_object_show(ug_data->base_naviframe); + /* create setting view */ nfc_setting_layout = _ug_nfc_create_setting_layout(ug_data); if (nfc_setting_layout == NULL) return NULL; + /* Push navifreme */ l_button = elm_button_add(ug_data->base_naviframe); evas_object_smart_callback_add(l_button, "clicked", _back_clicked_cb, ug_data->nfc_setting_ug); - ug_data->base_navi_it = elm_naviframe_item_push(ug_data->base_naviframe, IDS_NFC, l_button, NULL, nfc_setting_layout, "1line"); + ug_data->base_navi_it = elm_naviframe_item_push(ug_data->base_naviframe, IDS_NFC_NFC, l_button, NULL, nfc_setting_layout, "1line"); elm_object_style_set(l_button, "naviframe/back_btn/default"); + /* Register Vconf Noti */ + vconf_notify_key_changed(VCONFKEY_NFC_STATE, _nfc_onoff_vconf_update_cb, NULL); + return ug_data->base_layout; } -static void __ug_nfc_setting_destroy(struct ui_gadget *ug, bundle *bd, void *user_data) +static void __ug_nfc_setting_destroy(ui_gadget_h ug, service_h service, void *priv) { - ugdata_t *ug_data = (ugdata_t *)user_data; + LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__); + ugdata_t *ug_data = (ugdata_t *)priv; + int result; if (ug_data == NULL) return; - vconf_ignore_key_changed(VCONFKEY_NFC_STATE, _vconf_key_cb); - vconf_ignore_key_changed(NET_NFC_VCONF_KEY_PROGRESS, _vconf_key_cb); + /* Unregister Vconf Noti */ + if ((result = vconf_ignore_key_changed(VCONFKEY_NFC_STATE, _nfc_onoff_vconf_update_cb)) == 0) + { + LOGD("[%s(): %d] vconf_ignore_key_changed status \n", __FUNCTION__, __LINE__); + } + + nfc_manager_unset_activation_changed_cb(); + + nfc_manager_deinitialize(); evas_object_del(ug_get_layout(ug)); + + LOGD("[%s(): %d] END <<<<", __FUNCTION__, __LINE__); } -static void __ug_nfc_setting_start(struct ui_gadget *ug, bundle *bd, void *user_data) +static void __ug_nfc_setting_start(ui_gadget_h ug, service_h service, void *priv) { + LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__); + + ugdata_t *ug_data = (ugdata_t *)priv; + + /* check nfc-device*/ + if (!nfc_manager_is_supported()) + { + LOGD("It is not nfc device >>>>"); + _show_app_error_popup(ug_data); + } + + LOGD("[%s(): %d] END <<<<", __FUNCTION__, __LINE__); } -static void __ug_nfc_setting_pause(struct ui_gadget *ug, bundle *bd, void *user_data) +static void __ug_nfc_setting_pause(ui_gadget_h ug, service_h service, void *priv) { + LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__); + LOGD("[%s(): %d] END <<<<", __FUNCTION__, __LINE__); } -static void __ug_nfc_setting_resume(struct ui_gadget *ug, bundle *bd, void *user_data) +static void __ug_nfc_setting_resume(ui_gadget_h ug, service_h service, void *priv) { + LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__); + LOGD("[%s(): %d] END <<<<", __FUNCTION__, __LINE__); } -static void __ug_nfc_setting_message(struct ui_gadget *ug, bundle *msg, bundle *bd, void *user_data) +static void __ug_nfc_setting_message(ui_gadget_h ug, service_h msg, service_h service, void *priv) { + LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__); + LOGD("[%s(): %d] END <<<<", __FUNCTION__, __LINE__); } -static void __ug_nfc_setting_event(struct ui_gadget *ug, enum ug_event event, bundle *bd, void *user_data) +static void __ug_nfc_setting_event(ui_gadget_h ug, enum ug_event event, service_h service, void *priv) { + LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__); + LOGD("[%s(): %d] END <<<<", __FUNCTION__, __LINE__); } UG_MODULE_API int UG_MODULE_INIT(struct ug_module_ops *ops) { + ugdata_t *ug_data; // User defined private data + LOGD("[%s(): %d] UG_MODULE_INIT!!\n", __FUNCTION__, __LINE__); - ugdata_t *ug_data; // User defined private data if (!ops) return -1; @@ -409,7 +953,7 @@ UG_MODULE_API int UG_MODULE_INIT(struct ug_module_ops *ops) UG_MODULE_API void UG_MODULE_EXIT(struct ug_module_ops *ops) { - ugdata_t* ug_data; + ugdata_t *ug_data; if (!ops) return; diff --git a/ug-nfc-setting-efl/src/ug-nfc-setting-popup.c b/ug-nfc-setting-efl/src/ug-nfc-setting-popup.c new file mode 100644 index 0000000..cbec540 --- /dev/null +++ b/ug-nfc-setting-efl/src/ug-nfc-setting-popup.c @@ -0,0 +1,155 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "ug-nfc-setting-popup.h" + + +#define NFC_POPUP_AUTO_TIMEOUT_SEC 3.0 + + +static Evas_Object *_popup = NULL; +static UG_NFC_POPUP_USER_RESP_CB _user_response_cb; +static void *_user_data = NULL; + + +static void _ug_nfc_setting_popup_response_cb(void *data, Evas_Object *obj, void *event_info) +{ + LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__); + + int btn_type = (int)data; + UG_NFC_POPUP_USER_RESP_CB temp_cb = _user_response_cb; + void *temp_data = _user_data; + + LOGD("btn_type: %d", (int)btn_type); + LOGD("Popup is removed: [%p]", obj); + evas_object_del(_popup); + + _popup = NULL; + _user_response_cb = NULL; + _user_data = NULL; + + if (temp_cb) + temp_cb(temp_data, obj, (void*)btn_type); + + LOGD("[%s(): %d] END>>>>", __FUNCTION__, __LINE__); +} + +static Eina_Bool _ug_nfc_setting_popup_show_cb(void *data) +{ + LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__); + + if (_popup) + evas_object_show(_popup); + + LOGD("[%s(): %d] END>>>>", __FUNCTION__, __LINE__); + + return ECORE_CALLBACK_CANCEL; +} + +static void _ug_nfc_setting_popup_block_clicked_cb(void *data, Evas_Object *obj, void *event_info) +{ + LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__); + + _ug_nfc_setting_popup_response_cb((void*)UG_NFC_POPUP_RESP_CLOSE, _popup, NULL); + + LOGD("[%s(): %d] END>>>>", __FUNCTION__, __LINE__); +} + +Evas_Object *ug_nfc_setting_create_popup(void *data, + Evas_Object *parent_layout, + const char *description, + const char *btn1_text, + int btn1_type, + const char *btn2_text, + int btn2_type, + const char *btn3_text, + int btn3_type, + bool is_alert_type, + bool enable_timeout, + UG_NFC_POPUP_USER_RESP_CB response_cb) +{ + LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__); + + Evas_Object *btn = NULL; + + if (data == NULL) + return NULL; + + if (_popup) { + ug_nfc_setting_close_popup(_popup); + _popup = NULL; + } + + _popup = elm_popup_add(parent_layout); + LOGD("Popup is created: [%p]", _popup); + evas_object_size_hint_weight_set(_popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + + elm_object_text_set(_popup, description); + + if(btn1_text) { + btn = elm_button_add(_popup); + elm_object_style_set (btn, "popup_button/default"); + elm_object_text_set(btn, btn1_text); + elm_object_part_content_set(_popup, "button1", btn); + evas_object_smart_callback_add(btn, "clicked", _ug_nfc_setting_popup_response_cb, (void*)btn1_type); + } + if (btn2_text) { + btn = elm_button_add(_popup); + elm_object_style_set (btn, "popup_button/default"); + elm_object_text_set(btn, btn2_text); + elm_object_part_content_set(_popup, "button2", btn); + evas_object_smart_callback_add(btn, "clicked", _ug_nfc_setting_popup_response_cb, (void*)btn2_type); + } + if (btn3_text) { + btn = elm_button_add(_popup); + elm_object_style_set (btn, "popup_button/default"); + elm_object_text_set(btn, btn3_text); + elm_object_part_content_set(_popup, "button3", btn); + evas_object_smart_callback_add(btn, "clicked", _ug_nfc_setting_popup_response_cb, (void*)btn3_type); + } + + _user_response_cb = response_cb; + _user_data = data; + + if (is_alert_type) { + evas_object_smart_callback_add(_popup, "block,clicked", _ug_nfc_setting_popup_block_clicked_cb, NULL); + } + + if (enable_timeout) + elm_popup_timeout_set(_popup, NFC_POPUP_AUTO_TIMEOUT_SEC); + + _ug_nfc_setting_popup_show_cb(NULL); + + LOGD("[%s(): %d] END>>>>", __FUNCTION__, __LINE__); + + return _popup; +} + + +void ug_nfc_setting_close_popup(Evas_Object* popup) +{ + LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__); + + if (NULL == popup || NULL == _popup || _popup != popup) { + LOGD("NULL == popup || NULL == _popup || _popup != popup"); + } + + _ug_nfc_setting_popup_response_cb((void*)UG_NFC_POPUP_RESP_CLOSE, _popup, NULL); + + LOGD("[%s(): %d] END>>>>", __FUNCTION__, __LINE__); +} + + |