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 | |
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
118 files changed, 3130 insertions, 1433 deletions
diff --git a/AUTHORS b/AUTHORS deleted file mode 100644 index 6c3e926..0000000 --- a/AUTHORS +++ /dev/null @@ -1 +0,0 @@ -Junyong Sim <junyong.sim@samsung.com> diff --git a/debian/changelog b/debian/changelog index 7b55434..a985ed2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,7 +1,160 @@ +ug-nfc-efl (0.0.1-20) unstable; urgency=low + + * Remove unused code and vconf key + * Git: slp/pkgs/u/ug-nfc-efl + * Tag: ug-nfc-efl_0.0.1-20 + + -- Wonkyu Kwon <wonkyu.kwon@samsung.com> Thu, 24 May 2012 19:53:20 +0900 + +ug-nfc-efl (0.0.1-19) unstable; urgency=low + + * modify the private vconf + * Git: slp/pkgs/u/ug-nfc-efl + * Tag: ug-nfc-efl_0.0.1-19 + + -- Sungjae Lim <neueziel.lim@samsung.com> Wed, 16 May 2012 11:49:24 +0900 + +ug-nfc-efl (0.0.1-18) unstable; urgency=low + + * Update shared popup, Fix the string length problem in memo app + * Git: slp/pkgs/u/ug-nfc-efl + * Tag: ug-nfc-efl_0.0.1-18 + + -- Wonkyu Kwon <wonkyu.kwon@samsung.com> Thu, 10 May 2012 10:49:24 +0900 + +ug-nfc-efl (0.0.1-17) unstable; urgency=low + + * apply S beam and remove the routine to initialize the vconf "db/nfc/enable" during installing + * Git: slp/pkgs/u/ug-nfc-efl + * Tag: ug-nfc-efl_0.0.1-17 + + -- Junyong Sim <junyong.sim@samsung.com> Mon, 07 May 2012 16:32:16 +0900 + +ug-nfc-efl (0.0.1-16) unstable; urgency=low + + * Fix : [S1-2460] Complete black screen displaying continuously while sharing any song through the NFC + * Git: slp/pkgs/u/ug-nfc-efl + * Tag: ug-nfc-efl_0.0.1-16 + + -- Wonkyu Kwon <wonkyu.kwon@samsung.com> Fri, 04 May 2012 11:30:33 +0900 + +ug-nfc-efl (0.0.1-15) unstable; urgency=low + + * apply S BEAM setting + * Git: slp/pkgs/u/ug-nfc-efl + * Tag: ug-nfc-efl_0.0.1-15 + + -- Junyong Sim <junyong.sim@samsung.com> Wed, 02 May 2012 10:34:45 +0900 + +ug-nfc-efl (0.0.1-14) unstable; urgency=low + + * apply Redwood GUI for UG + * Git: slp/pkgs/u/ug-nfc-efl + * Tag: ug-nfc-efl_0.0.1-14 + + -- Junyong Sim <junyong.sim@samsung.com> Thu, 19 Apr 2012 17:02:40 +0900 + +ug-nfc-efl (0.0.1-13) unstable; urgency=low + + * add progressbar on the setting menu of nfc + * Git: slp/pkgs/u/ug-nfc-efl + * Tag: ug-nfc-efl_0.0.1-13 + + -- Junyong Sim <junyong.sim@samsung.com> Mon, 09 Apr 2012 09:55:02 +0900 + +ug-nfc-efl (0.0.1-12) unstable; urgency=low + + * remove nfc in Cmake + * Git: slp/pkgs/u/ug-nfc-efl + * Tag: ug-nfc-efl_0.0.1-12 + + -- Junyong Sim <junyong.sim@samsung.com> Thu, 22 Mar 2012 18:53:32 +0900 + +ug-nfc-efl (0.0.1-11) unstable; urgency=low + + * fix jira issue + * Git: slp/pkgs/u/ug-nfc-efl + * Tag: ug-nfc-efl_0.0.1-11 + + -- Junyong Sim <junyong.sim@samsung.com> Thu, 22 Mar 2012 17:10:45 +0900 + +ug-nfc-efl (0.0.1-10) unstable; urgency=low + + * remove the header of nfc-manager + * Git: slp/pkgs/u/ug-nfc-efl + * Tag: ug-nfc-efl_0.0.1-10 + + -- Junyong Sim <junyong.sim@samsung.com> Fri, 16 Mar 2012 14:41:45 +0900 + +ug-nfc-efl (0.0.1-9) unstable; urgency=low + + * remove the dependency of unused packages + * Git: slp/pkgs/u/ug-nfc-efl + * Tag: ug-nfc-efl_0.0.1-9 + + -- Junyong Sim <junyong.sim@samsung.com> Fri, 16 Mar 2012 11:32:43 +0900 + +ug-nfc-efl (0.0.1-8) unstable; urgency=low + + * package upload for Elementary API changes + * Git: slp/pkgs/u/ug-nfc-efl + * Tag: ug-nfc-efl_0.0.1-8 + + -- Junyong Sim <junyong.sim@samsung.com> Wed, 14 Mar 2012 20:03:55 +0900 + ug-nfc-efl (0.0.1-7) unstable; urgency=low - * intergration from private git - * Git: pkgs/u/ug-nfc-efl + * Upload package + * Git: slp/pkgs/u/ug-nfc-efl * Tag: ug-nfc-efl_0.0.1-7 - -- Junyong Sim <junyong.sim@samsung.com> Thu, 29 Mar 2012 16:00:39 +0900 + -- Junyong Sim <junyong.sim@samsung.com> Mon, 12 Mar 2012 17:06:58 +0900 + +ug-nfc-efl (0.0.1-6) unstable; urgency=low + + * Upload package + * Git: slp/pkgs/u/ug-nfc-efl + * Tag: ug-nfc-efl_0.0.1-6 + + -- Wonkyu Kwon <wonkyu.kwon@samsung.com> Mon, 27 Feb 2012 18:00:00 +0900 + +ug-nfc-efl (0.0.1-5) unstable; urgency=low + + * change nfc icon + * Git: slp/pkgs/u/ug-nfc-efl + * Tag: ug-nfc-efl_0.0.1-5 + + -- Junyong Sim <junyong.sim@samsung.com> Fri, 17 Feb 2012 11:10:44 +0900 + +ug-nfc-efl (0.0.1-4) unstable; urgency=low + + * update changelog + * Git: slp/pkgs/u/ug-nfc-efl + * Tag: ug-nfc-efl_0.0.1-4 + + -- Junyong Sim <junyong.sim@samsung.com> Thu, 16 Feb 2012 08:46:36 +0900 + +ug-nfc-efl (0.0.1-3) unstable; urgency=low + + * share vi NFC updated + * Git: slp/pkgs/u/ug-nfc-efl + * Tag: ug-nfc-efl_0.0.1-3 + + -- Sechang Sohn <sc.sohn@samsung.com> Wed, 15 Feb 2012 08:46:15 +0900 + +ug-nfc-efl (0.0.1-2) unstable; urgency=low + + * move vconf value(db/nfc/enable) + * Git: slp/pkgs/u/ug-nfc-efl + * Tag: ug-nfc-efl_0.0.1-2 + + -- Junyong Sim <junyong.sim@samsung.com> Mon, 30 Jan 2012 16:55:30 +0900 + +ug-nfc-efl (0.0.1-1) unstable; urgency=low + + * first source package for building + * Git: slp/pkgs/u/ug-nfc-efl + * Tag: ug-nfc-efl_0.0.1-1 + + -- Junyong Sim <junyong.sim@samsung.com> Thu, 26 Jan 2012 19:13:37 +0900 + diff --git a/debian/control b/debian/control index 13d9801..0888129 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,7 @@ Section: libs Priority: extra Maintainer:junyong.sim@samsung.com Uploaders: junyong.sim@samsung.com -Build-Depends: debhelper (>= 5),libappcore-efl-dev,libcontacts-service-dev,libbluetooth-frwk-dev,libslp-utilx-dev,libedbus-dev,syspopup-dev,libedje-dev,libecore-dev,libevas-dev,libug-contacts-dev,libui-gadget-dev,libappsvc-dev,libxdgmime-dev,capi-network-nfc-dev +Build-Depends: debhelper (>= 5),libappcore-efl-dev,libcontacts-service-dev,libbluetooth-frwk-dev,libslp-utilx-dev,libedbus-dev,syspopup-dev,libedje-dev,libecore-dev,libevas-dev,libug-contacts-dev,libui-gadget-dev,libappsvc-dev,libxdgmime-dev,capi-network-nfc-dev, syspopup-caller-dev Standards-Version: 0.1.0 Package: libug-setting-nfc-efl diff --git a/debian/libug-setting-nfc-efl.install.in b/debian/libug-setting-nfc-efl.install.in index 7ac5b56..6eac2ed 100644 --- a/debian/libug-setting-nfc-efl.install.in +++ b/debian/libug-setting-nfc-efl.install.in @@ -1,3 +1,4 @@ /opt/ug/lib/libug-setting-nfc-efl* -/opt/ug/res/locale/*/LC_MESSAGES/ug-setting-nfc-efl* +/opt/ug/res/edje/ug-setting-nfc-efl/* /opt/ug/res/icons/* +/opt/ug/res/locale/*/LC_MESSAGES/ug-setting-nfc-efl* diff --git a/debian/libug-setting-nfc-efl.postinst b/debian/libug-setting-nfc-efl.postinst index 7a41673..1a24852 100644 --- a/debian/libug-setting-nfc-efl.postinst +++ b/debian/libug-setting-nfc-efl.postinst @@ -1,7 +1 @@ #!/bin/sh -if [ ${USER} == "root" ] -then -vconftool set -t bool db/nfc/enable 0 -u 5000 -else -vconftool set -t bool db/nfc/enable 0 -fi diff --git a/debian/libug-share-nfc-efl.install.in b/debian/libug-share-nfc-efl.install.in index c9b48c2..fae256c 100644 --- a/debian/libug-share-nfc-efl.install.in +++ b/debian/libug-share-nfc-efl.install.in @@ -1,4 +1,4 @@ /opt/ug/lib/libug-share-nfc-efl* -/opt/ug/res/edje/* +/opt/ug/res/edje/ug-share-nfc-efl/* /opt/ug/res/images/* /opt/ug/res/locale/*/LC_MESSAGES/ug-share-nfc-efl* diff --git a/debian/libug-share-nfc-efl.postinst b/debian/libug-share-nfc-efl.postinst deleted file mode 100644 index 1e42d6b..0000000 --- a/debian/libug-share-nfc-efl.postinst +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -if [ ${USER} == "root" ] -then -vconftool set -t int db/nfc/last_file_number 0 -u 5000 -else -vconftool set -t int db/nfc/last_file_number 0 -fi - diff --git a/packaging/libug-setting-nfc-efl.install.in b/packaging/libug-setting-nfc-efl.install.in index 7ac5b56..6eac2ed 100644 --- a/packaging/libug-setting-nfc-efl.install.in +++ b/packaging/libug-setting-nfc-efl.install.in @@ -1,3 +1,4 @@ /opt/ug/lib/libug-setting-nfc-efl* -/opt/ug/res/locale/*/LC_MESSAGES/ug-setting-nfc-efl* +/opt/ug/res/edje/ug-setting-nfc-efl/* /opt/ug/res/icons/* +/opt/ug/res/locale/*/LC_MESSAGES/ug-setting-nfc-efl* diff --git a/packaging/libug-share-nfc-efl.install.in b/packaging/libug-share-nfc-efl.install.in index c9b48c2..fae256c 100644 --- a/packaging/libug-share-nfc-efl.install.in +++ b/packaging/libug-share-nfc-efl.install.in @@ -1,4 +1,4 @@ /opt/ug/lib/libug-share-nfc-efl* -/opt/ug/res/edje/* +/opt/ug/res/edje/ug-share-nfc-efl/* /opt/ug/res/images/* /opt/ug/res/locale/*/LC_MESSAGES/ug-share-nfc-efl* diff --git a/packaging/ug-nfc-efl.spec b/packaging/ug-nfc-efl.spec index 56f77d8..7fbb8b9 100644 --- a/packaging/ug-nfc-efl.spec +++ b/packaging/ug-nfc-efl.spec @@ -4,37 +4,26 @@ Name: ug-nfc-efl Summary: UI gadget about the nfc -Version: 0.0.1 -Release: 1 +Version: 0.0.2 +Release: 17 Group: TO_BE/FILLED_IN -License: Flora Software License +License: Samsung Proprietary License Source0: %{name}-%{version}.tar.gz Source1: libug-setting-nfc-efl.install.in Source2: libug-share-nfc-efl.install.in -BuildRequires: cmake -BuildRequires: edje-tools -BuildRequires: gettext-tools -BuildRequires: pkgconfig(nfc-common-lib) -BuildRequires: pkgconfig(security-server) -BuildRequires: pkgconfig(contacts-service) -BuildRequires: pkgconfig(elementary) -BuildRequires: pkgconfig(bundle) -BuildRequires: pkgconfig(ui-gadget) -BuildRequires: pkgconfig(dlog) -BuildRequires: pkgconfig(vconf) -BuildRequires: pkgconfig(bluetooth-api) -BuildRequires: pkgconfig(edbus) -BuildRequires: pkgconfig(evas) -BuildRequires: pkgconfig(edje) -BuildRequires: pkgconfig(ecore) -BuildRequires: pkgconfig(eina) -BuildRequires: pkgconfig(aul) -BuildRequires: pkgconfig(appcore-efl) -BuildRequires: pkgconfig(syspopup-caller) -BuildRequires: pkgconfig(appsvc) -BuildRequires: pkgconfig(capi-network-nfc) -BuildRequires: pkgconfig(nfc) -BuildRequires: pkgconfig(utilX) +BuildRequires: pkgconfig(elementary) +BuildRequires: pkgconfig(ui-gadget-1) +BuildRequires: pkgconfig(dlog) +BuildRequires: pkgconfig(vconf) +BuildRequires: pkgconfig(utilX) +BuildRequires: pkgconfig(syspopup-caller) +BuildRequires: pkgconfig(capi-appfw-application) +BuildRequires: pkgconfig(capi-network-nfc) + +BuildRequires: cmake +BuildRequires: edje-tools +BuildRequires: gettext-tools + Requires(post): /sbin/ldconfig Requires(post): /usr/bin/vconftool Requires(postun): /sbin/ldconfig @@ -56,7 +45,7 @@ ug for nfc setting %package -n ug-share-nfc-efl Summary: ug for nfc share Group: Development/Libraries -Requires(post): /sbin/ldconfig +Requires(post): /sbin/ldconfig Requires(post): /usr/bin/vconftool Requires: %{name} = %{version}-%{release} @@ -78,11 +67,10 @@ rm -rf %{buildroot} %make_install %post -vconftool set -t bool db/nfc/enable 0 -u 5000 %post -n ug-share-nfc-efl -vconftool set -t int db/nfc/last_file_number 0 -u 5000 +vconftool set -t int -f db/private/ug-nfc-efl/last_file_number 0 -u 5000 %postun 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__); +} + + diff --git a/ug-nfc-share-efl/CMakeLists.txt b/ug-nfc-share-efl/CMakeLists.txt index 7750571..ff141b3 100644 --- a/ug-nfc-share-efl/CMakeLists.txt +++ b/ug-nfc-share-efl/CMakeLists.txt @@ -1,71 +1,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6) -PROJECT(ug-share-nfc-efl C) -SET(PREFIX ${CMAKE_INSTALL_PREFIX}) -SET(EXEC_PREFIX "\${prefix}") -SET(LIBDIR "\${prefix}/lib") -SET(INCLUDEDIR "\${prefix}/include") -SET(VERSION 0.1.0) -SET(RESDIR "${PREFIX}/res") -SET(LOCALEDIR "${RESDIR}/locale") -SET(EDJDIR "${RESDIR}/edje/${PROJECT_NAME}") -SET(IMAGEDIR "${RESDIR}/images/${PROJECT_NAME}") +MESSAGE("NFC UI Gardet version: ${VERSION}") -SET(SRCS -src/ug-nfc-share-main.c -src/ug-nfc-share-tag.c -src/ug-nfc-share-common-util.c -src/ug-nfc-share-popup.c -) +ADD_SUBDIRECTORY(ug-nfc-setting-efl) +ADD_SUBDIRECTORY(ug-nfc-share-efl) -IF("${CMAKE_BUILD_TYPE}" STREQUAL "") - SET(CMAKE_BUILD_TYPE "Release") -ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "") -MESSAGE("Build type: ${CMAKE_BUILD_TYPE}") - -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include) - -INCLUDE(FindPkgConfig) -pkg_check_modules(pkgs_ug_nfc_share REQUIRED elementary appcore-efl ui-gadget edbus evas ecore-x edje ecore dbus-glib-1 appsvc contacts-service capi-network-nfc) - -FOREACH(flag ${pkgs_ug_nfc_share_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} ${EXTRA_CFLAGS}") -SET(CMAKE_C_FLAGS_DEBUG "-O0 -g") -SET(CMAKE_C_FLAGS_RELEASE "-O2") - -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") - -SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed") - -ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"") -ADD_DEFINITIONS("-DEDJDIR=\"${EDJDIR}\"") -ADD_DEFINITIONS("-DRESDIR=\"${RESDIR}\"") -ADD_DEFINITIONS("-DIMAGEDIR=\"${IMAGEDIR}\"") - -ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS}) -SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION 0.1.0) -TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_ug_nfc_share_LDFLAGS}) - -ADD_CUSTOM_TARGET(ug-nfc-share-efl.edj - COMMAND edje_cc -id ${CMAKE_CURRENT_SOURCE_DIR}/data/images - ${CMAKE_CURRENT_SOURCE_DIR}/data/edc/ug-nfc-share-efl.edc ${CMAKE_BINARY_DIR}/ug-nfc-share-efl.edj - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/data/edc/ug-nfc-share-efl.edc -) -ADD_DEPENDENCIES(${PROJECT_NAME} ug-nfc-share-efl.edj) - -INSTALL(TARGETS ${PROJECT_NAME} DESTINATION /opt/ug/lib) -INSTALL(FILES ${CMAKE_BINARY_DIR}/ug-nfc-share-efl.edj DESTINATION ${EDJDIR}) - -INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/data/images/ DESTINATION ${IMAGEDIR} FILES_MATCHING PATTERN "*.png") -INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/data/images/ DESTINATION ${IMAGEDIR} FILES_MATCHING PATTERN "*.jpg") - -ADD_SUBDIRECTORY(po) diff --git a/ug-nfc-share-efl/LICENSE b/ug-nfc-share-efl/LICENSE new file mode 100644 index 0000000..7ccb5b5 --- /dev/null +++ b/ug-nfc-share-efl/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/ug-nfc-share-efl/data/edc/ug-nfc-share-efl.edc b/ug-nfc-share-efl/data/edc/ug-nfc-share-efl.edc index 796fd21..216706e 100644 --- a/ug-nfc-share-efl/data/edc/ug-nfc-share-efl.edc +++ b/ug-nfc-share-efl/data/edc/ug-nfc-share-efl.edc @@ -1,54 +1,171 @@ -/* - * 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 +collections { - * 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 SCREEN_HEIGHT (1280 - 108) -collections { - group{ + group + { name: "share_via_nfc"; + parts { part { + name: "genlist"; + type: SWALLOW; + scale: 1; + description + { + state: "default" 0.0; + min: 0 112; + fixed: 0 1; + rel1{relative: 0 0; } + rel2{relative: 1 0;} + align: 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 0;} + 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 0;} + rel2 {relative: 1 1;} + align: 1 0; + } + } + part + { + name: "top_pad"; + type: RECT; + scale: 1; + description + { + state: "default" 0.0; + color: 0 0 0 0; + min: 0 23; + fixed: 0 1; + rel1 {relative: 1 1; to_x: "left_pad"; to_y: "genlist";} + rel2 {relative: 0 1; to_x: "right_pad"; to_y: "genlist";} + align: 0 0; + } + } + part + { name: "label_name"; type: SWALLOW; - scale:1; + scale: 1; description { - fixed: 1 1; state: "default" 0.0; - rel1{relative: 0 20/1130; offset:20 0;} - rel2{relative: 1 140/1130; offset:-20 0;} + min: 0 38; + fixed: 0 1; + rel1{relative: 1 1; to_x:"left_pad";to_y: "top_pad";} + rel2{relative: 0 1; to_x:"right_pad";to_y: "top_pad";} + align: 0 0; + } + } + part + { + name: "top_pad1"; + type: RECT; + scale: 1; + description + { + state: "default" 0.0; + color: 0 0 0 0; + min: 0 38; + fixed: 0 1; + rel1 {relative: 1 1; to_x: "left_pad"; to_y: "label_name";} + rel2 {relative: 0 1; to_x: "right_pad"; to_y: "label_name";} align: 0 0; } } - part { name: "label_message"; type: SWALLOW; scale:1; + description { - fixed: 1 1; state: "default" 0.0; - rel1{relative: 0 180/1130; offset:20 0;} - rel2{relative: 1 220/1130; offset:-20 0;} + min: 0 76; + fixed: 0 1; + rel1{relative: 1 1; to_x: "left_pad"; to_y: "top_pad1";} + rel2{relative: 0 1; to_x: "right_pad"; to_y: "top_pad1";} align: 0 0; } } - + part + { + name: "top_pad2"; + type: RECT; + scale: 1; + description + { + state: "default" 0.0; + color: 0 0 0 0; + min: 0 40; + fixed: 0 1; + rel1 {relative: 1 1; to_x: "left_pad"; to_y: "label_message";} + rel2 {relative: 0 1; to_x: "right_pad"; to_y: "label_message";} + align: 0 0; + } + } + part + { + name: "left_pad1"; + type: RECT; + scale: 1; + description + { + state: "default" 0.0; + color: 0 0 0 0; + min: 56 0; + fixed: 1 0; + rel1 {relative: 1 1;to_x: "left_pad"; to_y: "top_pad2";} + rel2 {relative: 1 1;to_x: "left_pad"; } + align: 0 0; + } + } + part + { + name: "right_pad1"; + type: RECT; + scale: 1; + description + { + state: "default" 0.0; + color: 0 0 0 0; + min: 56 0; + fixed: 1 0; + rel1 {relative: 0 1; to_x: "right_pad"; to_y:"top_pad2";} + rel2 {relative: 0 1; to_x:"right_pad";} + align: 1 0; + } + } part { name: "touch_image"; @@ -57,9 +174,27 @@ collections { description { state: "default" 0.0; - rel1{relative: 0 250/1130; offset:0 0;} - rel2{relative: 1 860/1130; offset:0 0;} - align: 0.5 0; + min: 576 560; + fixed: 0 0; + rel1{relative: 1 1; to_x:"left_pad1"; to_y:"top_pad2";} + rel2{relative: 0 0; to_x:"right_pad1"; to_y:"bottom_pad2";} + align: 0.5 0.5; + } + } + part + { + name: "bottom_pad2"; + type: RECT; + scale: 1; + description + { + state: "default" 0.0; + color: 0 0 0 0; + min: 0 78; + fixed: 0 1; + align: 0 1; + rel1 {relative: 1 0; to_x: "left_pad"; to_y: "label_cancel_message";} + rel2 {relative: 0 0; to_x: "right_pad"; to_y: "label_cancel_message";} } } part @@ -69,14 +204,30 @@ collections { scale: 1; description { - fixed: 1 1; state: "default" 0.0; - rel1{relative: 0 900/1130; offset:20 0;} - rel2{relative: 1 980/1130; offset: -20 0;} - align: 0 0; + min: 0 38; + fixed: 0 1; + rel1{relative: 1 0; to_x: "left_pad"; to_y: "bottom_pad1";} + rel2{relative: 0 0; to_x: "right_pad"; to_y: "bottom_pad1";} + align: 0 1; + } + } + part + { + name: "bottom_pad1"; + type: RECT; + scale: 1; + description + { + state: "default" 0.0; + color: 0 0 0 0; + min: 0 22; + fixed: 0 1; + align: 0 1; + rel1 {relative: 1 0; to_x: "left_pad"; to_y: "cancel_button";} + rel2 {relative: 0 0; to_x: "right_pad"; to_y: "cancel_button";} } } - part { name: "cancel_button"; @@ -85,12 +236,29 @@ collections { description { state: "default" 0.0; - rel1{relative: 0 1020/1130; offset:20 0;} - rel2{relative: 1 1100/1130; offset: -20 0;} - align:0 0; + min: 0 74; + fixed: 0 1; + rel1{relative: 1 0; to_x: "left_pad"; to_y: "bottom_pad";} + rel2{relative: 0 0; to_x: "right_pad"; to_y: "bottom_pad";} + align:0 1; + } + } + part + { + name: "bottom_pad"; + type: RECT; + scale: 1; + description + { + state: "default" 0.0; + color: 0 0 0 0; + min: 0 15; + fixed: 0 1; + align: 0 1; + rel1 {relative: 0 1;} + rel2 {relative: 1 1;} } } - } } } diff --git a/ug-nfc-share-efl/data/images/U05_AfterSelect_Share_help.png b/ug-nfc-share-efl/data/images/U05_AfterSelect_Share_help.png Binary files differdeleted file mode 100644 index 53d145a..0000000 --- a/ug-nfc-share-efl/data/images/U05_AfterSelect_Share_help.png +++ /dev/null diff --git a/ug-nfc-share-efl/data/images/U05_AfterSelect_Write_help.png b/ug-nfc-share-efl/data/images/U05_AfterSelect_Write_help.png Binary files differdeleted file mode 100644 index 2ecc2a9..0000000 --- a/ug-nfc-share-efl/data/images/U05_AfterSelect_Write_help.png +++ /dev/null diff --git a/ug-nfc-share-efl/data/images/U05_AfterSelect_bookmark.png b/ug-nfc-share-efl/data/images/U05_AfterSelect_bookmark.png Binary files differdeleted file mode 100755 index c49ffd9..0000000 --- a/ug-nfc-share-efl/data/images/U05_AfterSelect_bookmark.png +++ /dev/null diff --git a/ug-nfc-share-efl/data/images/U05_AfterSelect_contact.png b/ug-nfc-share-efl/data/images/U05_AfterSelect_contact.png Binary files differdeleted file mode 100755 index 4604b59..0000000 --- a/ug-nfc-share-efl/data/images/U05_AfterSelect_contact.png +++ /dev/null diff --git a/ug-nfc-share-efl/data/images/U05_AfterSelect_memo.png b/ug-nfc-share-efl/data/images/U05_AfterSelect_memo.png Binary files differdeleted file mode 100755 index cfd2516..0000000 --- a/ug-nfc-share-efl/data/images/U05_AfterSelect_memo.png +++ /dev/null diff --git a/ug-nfc-share-efl/data/images/white/U05_AfterSelect_Share_help.png b/ug-nfc-share-efl/data/images/white/U05_AfterSelect_Share_help.png Binary files differnew file mode 100644 index 0000000..c322968 --- /dev/null +++ b/ug-nfc-share-efl/data/images/white/U05_AfterSelect_Share_help.png diff --git a/ug-nfc-share-efl/include/ug-nfc-share-common-debug.h b/ug-nfc-share-efl/include/ug-nfc-share-common-debug.h index d308502..fa57b4a 100644..100755 --- a/ug-nfc-share-efl/include/ug-nfc-share-common-debug.h +++ b/ug-nfc-share-efl/include/ug-nfc-share-common-debug.h @@ -14,6 +14,7 @@ * limitations under the License. */ + #ifndef __UG_NFC_SHARE_DEBUG_H__ #define __UG_NFC_SHARE_DEBUG_H__ diff --git a/ug-nfc-share-efl/include/ug-nfc-share-common-error.h b/ug-nfc-share-efl/include/ug-nfc-share-common-error.h index fd8029f..b0ed937 100644..100755 --- a/ug-nfc-share-efl/include/ug-nfc-share-common-error.h +++ b/ug-nfc-share-efl/include/ug-nfc-share-common-error.h @@ -14,6 +14,7 @@ * limitations under the License. */ + #ifndef __UG_NFC_SHARE_ERROR_H__ #define __UG_NFC_SHARE_ERROR_H__ diff --git a/ug-nfc-share-efl/include/ug-nfc-share-common-util.h b/ug-nfc-share-efl/include/ug-nfc-share-common-util.h index 24bbcda..7be901d 100644 --- a/ug-nfc-share-efl/include/ug-nfc-share-common-util.h +++ b/ug-nfc-share-efl/include/ug-nfc-share-common-util.h @@ -14,6 +14,7 @@ * limitations under the License. */ + #ifndef __UG_NFC_SHARE_COMMON_UTIL_H__ #define __UG_NFC_SHARE_COMMON_UTIL_H__ @@ -206,7 +207,5 @@ void ug_nfc_share_memory_print_list(void); #endif /* _UG_NFC_SHARE_MEM_TRACE_ */ -int ug_nfc_share_launch_service(const char *operation, const char *uri, const char *mime); - #endif /*__UG_NFC_SHARE_COMMON_UTIL_H__*/ diff --git a/ug-nfc-share-efl/include/ug-nfc-share-main.h b/ug-nfc-share-efl/include/ug-nfc-share-main.h index cc3988d..96af344 100644 --- a/ug-nfc-share-efl/include/ug-nfc-share-main.h +++ b/ug-nfc-share-efl/include/ug-nfc-share-main.h @@ -14,6 +14,7 @@ * limitations under the License. */ + #ifndef __UG_NFC_SHARE_MAIN_H__ #define __UG_NFC_SHARE_MAIN_H__ @@ -27,12 +28,10 @@ extern "C" { #include <dlog.h> #include <stdbool.h> #include <string.h> -#include <appsvc.h> -#include <appcore-efl.h> #include <Ecore_X.h> #include <utilX.h> - +#include <bundle.h> #include <assert.h> #include <glib.h> @@ -48,8 +47,8 @@ extern "C" { #endif #define PREFIX "/opt/ug/" #define EDJ_PATH PREFIX"/res/edje/"PACKAGE -#define EDJ_FILE EDJ_PATH"/ug-nfc-share-efl.edj" -#define IMAGES_PATH PREFIX"/res/images/"PACKAGE +#define EDJ_FILE EDJ_PATH"/ug-nfc-share-efl.edj" +#define IMAGES_PATH PREFIX"/res/images/"PACKAGE #define LOCALE_PATH PREFIX"/res/locale" #ifdef LOG_TAG @@ -58,6 +57,9 @@ extern "C" { #define LOG_TAG "UG_NFC_SHARE_EFL" +#define NFC_SHARE_SERVICE "com.samsung.nfc-share-service" +#define NFC_SHARE_SERVICE_SHARE_VIA_UG "http://tizen.org/appsvc/operation/nfc_share_via_ug" + #define GET_SAFE_STRING(x) ((x) != NULL ? (x) : "NULL") #define STRING_AND_SIZE(x) (x), strlen((x)) #define NULL_TO_EMPTY_STRING(x) (((x) != NULL) ? (x) : "") @@ -74,58 +76,73 @@ extern "C" { #define NFCUG_LOCALEDIR LOCALE_PATH /* Registered string in STMS NFC */ -#define IDS_PS_SELECTED dgettext(PACKAGE, "IDS_NFC_BODY_PS_SELECTED") -#define IDS_SHARE_VIA_NFC dgettext(PACKAGE, "IDS_NFC_HEADER_SHARE_VIA_NFC") -#define IDS_GENTLY_TOUCH_PHONES_TOGETHER_TO_SHARE dgettext(PACKAGE, "IDS_NFC_BODY_GENTLY_TOUCH_PHONES_TOGETHER_TO_SHARE") -#define IDS_TO_CANCEL_SHARING_TAP_CANCEL dgettext(PACKAGE, "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL") -#define IDS_PS_TAG_SHARED dgettext(PACKAGE, "IDS_NFC_POP_PS_TAG_SHARED") -#define IDS_FAILED_TO_SHARE_TAG dgettext(PACKAGE, "IDS_NFC_POP_FAILED_TO_SHARE_TAG") +#define IDS_SHARE_VIA_NFC dgettext(PACKAGE, "IDS_NFC_HEADER_SHARE_VIA_NFC") +#define IDS_GENTLY_TOUCH_PHONES_TOGETHER_TO_SHARE dgettext(PACKAGE, "IDS_NFC_BODY_GENTLY_TOUCH_PHONES_TOGETHER_TO_SHARE") +#define IDS_TO_CANCEL_SHARING_TAP_CANCEL dgettext(PACKAGE, "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL") +#define IDS_TAG_SHARED dgettext(PACKAGE, "IDS_NFC_POP_TAG_SHARED") +#define IDS_FAILED_TO_SHARE_TAG dgettext(PACKAGE, "IDS_NFC_POP_FAILED_TO_SHARE_TAG") +#define IDS_TRANSFER_FAILED dgettext(PACKAGE, "IDS_NFC_POP_TRANSFER_FAILED") +#define IDS_SERVICE_NOT_AVAILABLE_NFC_TURNED_OFF_TURN_ON_NFC_Q dgettext(PACKAGE, "IDS_NFC_POP_SERVICE_NOT_AVAILABLE_NFC_TURNED_OFF_TURN_ON_NFC_Q") #define IDS_HANDOVER _("HANDOVER") -#define IDS_TRANSFER_FAILED dgettext(PACKAGE, "IDS_NFC_POP_TRANSFER_FAILED") #define IDS_UNABLE_TO_SHARE_FILES_MAXIMUM_FILE_SIZE_EXCEEDED_SHARE_FILES_VIA_BLUETOOTH_PAIRED_DEVICES_MAY_BE_DISCONNECTED_CONTINUE_Q \ _("File size exceeds allowed limit. Share files via Bluetooth. Continue?") -#define IDS_SERVICE_NOT_AVAILABLE_NFC_TURNED_OFF_TURN_ON_NFC_Q _("Service not available. NFC turned off. Turn on NFC?") +#define IDS_NFC_SERVICE_IS_NOT_SUPPORTED _("NFC service is not supported") /* System string */ #define IDS_YES dgettext("sys_string", "IDS_COM_SK_YES") #define IDS_NO dgettext("sys_string", "IDS_COM_SK_NO") -#define IDS_OK dgettext("sys_string", "IDS_COM_SK_OK") -#define IDS_NONE dgettext("sys_string", "IDS_COM_BODY_NONE") -#define IDS_UNKNOWN dgettext("sys_string", "IDS_COM_BODY_UNKNOWN") -#define IDS_CANCEL dgettext("sys_string", "IDS_COM_SK_CANCEL") +#define IDS_OK dgettext("sys_string", "IDS_COM_SK_OK") +#define IDS_NONE dgettext("sys_string", "IDS_COM_BODY_NONE") +#define IDS_UNKNOWN dgettext("sys_string", "IDS_COM_BODY_UNKNOWN") +#define IDS_CANCEL dgettext("sys_string", "IDS_COM_SK_CANCEL") +#define IDS_CLOSE dgettext("sys_string", "IDS_COM_POP_CLOSE") /**** common lib functions endzz **********/ typedef enum { - UG_NFC_SHARE_TAG_CONTACT = 0, - UG_NFC_SHARE_TAG_URL, - UG_NFC_SHARE_TAG_MPLAYER, - UG_NFC_SHARE_TAG_MEMO, - UG_NFC_SHARE_TAG_BT, - UG_NFC_SHARE_TAG_WIFI, - UG_NFC_SHARE_TAG_PROFILE, - UG_NFC_SHARE_TAG_ALLSHARE, - UG_NFC_SHARE_TAG_FILE, - UG_NFC_SHARE_TAG_HANDOVER, - UG_NFC_SHARE_TAG_UNKNOWN, - UG_NFC_SHARE_TAG_MAX + UG_NFC_SHARE_TAG_CONTACT = 0, + UG_NFC_SHARE_TAG_URL, + UG_NFC_SHARE_TAG_MPLAYER, + UG_NFC_SHARE_TAG_MEMO, + UG_NFC_SHARE_TAG_BT, + UG_NFC_SHARE_TAG_WIFI, + UG_NFC_SHARE_TAG_PROFILE, + UG_NFC_SHARE_TAG_ALLSHARE, + UG_NFC_SHARE_TAG_FILE, + UG_NFC_SHARE_TAG_HANDOVER, + UG_NFC_SHARE_TAG_UNKNOWN, + UG_NFC_SHARE_TAG_MAX } ug_nfc_share_tag_type; +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_share_ug; + ui_gadget_h nfc_share_ug; Evas_Object* base_layout; Evas_Object *bg; + nfc_ndef_message_h current_ndef; + bundle *bd; Evas_Object* base_naviframe; Elm_Object_Item *base_navi_it; - - nfc_ndef_message_h current_ndef; - char *uri; }ugdata_t; diff --git a/ug-nfc-share-efl/include/ug-nfc-share-popup.h b/ug-nfc-share-efl/include/ug-nfc-share-popup.h index f7d7441..54ecf8d 100644 --- a/ug-nfc-share-efl/include/ug-nfc-share-popup.h +++ b/ug-nfc-share-efl/include/ug-nfc-share-popup.h @@ -1,18 +1,21 @@ /* - * 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. - */ + * nfc-app + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0 + * + * 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_SHARE_POPUP_H__ #define __UG_NFC_SHARE_POPUP_H__ diff --git a/ug-nfc-share-efl/include/ug-nfc-share-tag.h b/ug-nfc-share-efl/include/ug-nfc-share-tag.h index 734185a..ba493ce 100644..100755 --- a/ug-nfc-share-efl/include/ug-nfc-share-tag.h +++ b/ug-nfc-share-efl/include/ug-nfc-share-tag.h @@ -14,6 +14,7 @@ * limitations under the License. */ + #ifndef __UG_NFC_SHARE_TAG_H__ #define __UG_NFC_SHARE_TAG_H__ @@ -23,19 +24,25 @@ extern "C" { #include "ug-nfc-share-main.h" -#define UG_NFC_SHARE_LAST_FILE_NUMBER_KEY "db/nfc/last_file_number" +#if 0 +#define UG_NFC_SHARE_LAST_FILE_NUMBER_KEY "db/private/ug-nfc-efl/last_file_number" #define UG_NFC_SHARE_FILE_NAME_PREFIX _("nfc_receive_file_") +#endif /* get and set function */ +#if 0 char* ug_nfc_share_get_display_str(void); void ug_nfc_share_set_display_str(const char* text); +#endif ug_nfc_share_tag_type ug_nfc_share_get_tag_type(void); void ug_nfc_share_set_tag_type(ug_nfc_share_tag_type tag_type); nfc_ndef_message_h ug_nfc_share_get_current_ndef(void *data); ug_nfc_share_result_e ug_nfc_share_set_current_ndef(void *data, nfc_ndef_message_h ndef_msg); /* util function */ +#if 0 char *ug_nfc_share_get_display_text_from_ndef(ug_nfc_share_tag_type record_type, nfc_ndef_message_h ndef_msg); +#endif ug_nfc_share_result_e ug_nfc_share_make_ndef_message_from_file(nfc_ndef_message_h *msg, const char *path); ug_nfc_share_result_e ug_nfc_share_make_ndef_message_from_multi_file(nfc_ndef_message_h *msg, const char *path[], int record_count); /* nfc_handover */ void ug_nfc_set_nfc_callback(void *user_data); diff --git a/ug-nfc-share-efl/po/ar.po b/ug-nfc-share-efl/po/ar.po new file mode 100644 index 0000000..6a8011b --- /dev/null +++ b/ug-nfc-share-efl/po/ar.po @@ -0,0 +1,21 @@ +msgid "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL" +msgstr "لإلغاء المشاركة، انقر فوق إلغاء" + +msgid "IDS_NFC_POP_SERVICE_NOT_AVAILABLE_NFC_TURNED_OFF_TURN_ON_NFC_Q" +msgstr "الخدمة غير متاحة. تم إيقاف تشغيل NFC. هل تريد تشغيل NFC؟" + +msgid "IDS_NFC_HEADER_SHARE_VIA_NFC" +msgstr "مشاركة عبر NFC" + +msgid "IDS_NFC_POP_FAILED_TO_SHARE_TAG" +msgstr "فشلت مشاركة العلامة" + +msgid "IDS_NFC_BODY_GENTLY_TOUCH_PHONES_TOGETHER_TO_SHARE" +msgstr "قم بملامسة الهواتف ببعضها البعض برفق لمشاركتها" + +msgid "IDS_NFC_POP_TRANSFER_FAILED" +msgstr "فشل التحويل" + +msgid "IDS_NFC_POP_TAG_SHARED" +msgstr "تمت مشاركة العلامة" + diff --git a/ug-nfc-share-efl/po/bg.po b/ug-nfc-share-efl/po/bg.po new file mode 100644 index 0000000..ce5a168 --- /dev/null +++ b/ug-nfc-share-efl/po/bg.po @@ -0,0 +1,21 @@ +msgid "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL" +msgstr "За да отмените споделянето, чукнете Отказ" + +msgid "IDS_NFC_POP_SERVICE_NOT_AVAILABLE_NFC_TURNED_OFF_TURN_ON_NFC_Q" +msgstr "Услугата не е достъпна. NFC е изключено. Включване на NFC?" + +msgid "IDS_NFC_HEADER_SHARE_VIA_NFC" +msgstr "Споделяне през NFC" + +msgid "IDS_NFC_POP_FAILED_TO_SHARE_TAG" +msgstr "Неуспешно споделяне на тага" + +msgid "IDS_NFC_BODY_GENTLY_TOUCH_PHONES_TOGETHER_TO_SHARE" +msgstr "Леко докоснете телефоните един в друг, за да споделите" + +msgid "IDS_NFC_POP_TRANSFER_FAILED" +msgstr "Прехвърлянето неуспешно" + +msgid "IDS_NFC_POP_TAG_SHARED" +msgstr "Отбелязване на споделени" + diff --git a/ug-nfc-share-efl/po/ca.po b/ug-nfc-share-efl/po/ca.po new file mode 100644 index 0000000..652fe95 --- /dev/null +++ b/ug-nfc-share-efl/po/ca.po @@ -0,0 +1,21 @@ +msgid "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL" +msgstr "Per cancel·lar la compartició, toqui Cancel·lar" + +msgid "IDS_NFC_POP_SERVICE_NOT_AVAILABLE_NFC_TURNED_OFF_TURN_ON_NFC_Q" +msgstr "Servei no disponible. NFC desactivat. Activar NFC?" + +msgid "IDS_NFC_HEADER_SHARE_VIA_NFC" +msgstr "Compartir mitjançant NFC" + +msgid "IDS_NFC_POP_FAILED_TO_SHARE_TAG" +msgstr "Error en compartir etiqueta" + +msgid "IDS_NFC_BODY_GENTLY_TOUCH_PHONES_TOGETHER_TO_SHARE" +msgstr "Toqui suaument un telèfon amb l'altre per compartir" + +msgid "IDS_NFC_POP_TRANSFER_FAILED" +msgstr "Error de transferència" + +msgid "IDS_NFC_POP_TAG_SHARED" +msgstr "Etiqueta compartida" + diff --git a/ug-nfc-share-efl/po/cs.po b/ug-nfc-share-efl/po/cs.po new file mode 100644 index 0000000..b1b1219 --- /dev/null +++ b/ug-nfc-share-efl/po/cs.po @@ -0,0 +1,21 @@ +msgid "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL" +msgstr "Chcete-li zrušit sdílení, klepněte na tlačítko Zrušit" + +msgid "IDS_NFC_POP_SERVICE_NOT_AVAILABLE_NFC_TURNED_OFF_TURN_ON_NFC_Q" +msgstr "Služba je nedostupná. NFC bylo vypnuto. Zapnout NFC?" + +msgid "IDS_NFC_HEADER_SHARE_VIA_NFC" +msgstr "Sdílet přes NFC" + +msgid "IDS_NFC_POP_FAILED_TO_SHARE_TAG" +msgstr "Značku se nepodařilo sdílet" + +msgid "IDS_NFC_BODY_GENTLY_TOUCH_PHONES_TOGETHER_TO_SHARE" +msgstr "Pro sdílení se jemně dotkněte telefony" + +msgid "IDS_NFC_POP_TRANSFER_FAILED" +msgstr "Chyba přenosu" + +msgid "IDS_NFC_POP_TAG_SHARED" +msgstr "Značka je sdílena" + diff --git a/ug-nfc-share-efl/po/da.po b/ug-nfc-share-efl/po/da.po new file mode 100644 index 0000000..3d629fd --- /dev/null +++ b/ug-nfc-share-efl/po/da.po @@ -0,0 +1,21 @@ +msgid "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL" +msgstr "Tryk på Annuller for at annullere deling" + +msgid "IDS_NFC_POP_SERVICE_NOT_AVAILABLE_NFC_TURNED_OFF_TURN_ON_NFC_Q" +msgstr "Tjeneste ikke tilgængelig. NFC deaktiveret. Aktivér NFC?" + +msgid "IDS_NFC_HEADER_SHARE_VIA_NFC" +msgstr "Del via NFC" + +msgid "IDS_NFC_POP_FAILED_TO_SHARE_TAG" +msgstr "Kunne ikke dele tag" + +msgid "IDS_NFC_BODY_GENTLY_TOUCH_PHONES_TOGETHER_TO_SHARE" +msgstr "Lad telefonerne røre hinanden forsigtigt for at dele" + +msgid "IDS_NFC_POP_TRANSFER_FAILED" +msgstr "Overførselsfejl" + +msgid "IDS_NFC_POP_TAG_SHARED" +msgstr "Tag delt" + diff --git a/ug-nfc-share-efl/po/de_DE.po b/ug-nfc-share-efl/po/de_DE.po index f29c411..d4dd4c1 100755 --- a/ug-nfc-share-efl/po/de_DE.po +++ b/ug-nfc-share-efl/po/de_DE.po @@ -1,6 +1,9 @@ msgid "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL" msgstr "Tippen Sie auf „Abbrechen“, um die Freigabe abzubrechen" +msgid "IDS_NFC_POP_SERVICE_NOT_AVAILABLE_NFC_TURNED_OFF_TURN_ON_NFC_Q" +msgstr "Dienst nicht verfügbar. NFC deaktiviert. NFC aktivieren?" + msgid "IDS_NFC_HEADER_SHARE_VIA_NFC" msgstr "Über NFC freigeben" @@ -10,12 +13,9 @@ msgstr "Tag konnte nicht freigegeben werden." msgid "IDS_NFC_BODY_GENTLY_TOUCH_PHONES_TOGETHER_TO_SHARE" msgstr "Führen Sie die Telefone leicht zusammen, um freizugeben." -msgid "IDS_NFC_POP_PS_TAG_SHARED" -msgstr "%s-Tag freigegeben" - msgid "IDS_NFC_POP_TRANSFER_FAILED" msgstr "Übertragungsfehler" -msgid "IDS_NFC_BODY_PS_SELECTED" -msgstr "%s ausgewählt" +msgid "IDS_NFC_POP_TAG_SHARED" +msgstr "Tag freigegeben" diff --git a/ug-nfc-share-efl/po/el_GR.po b/ug-nfc-share-efl/po/el_GR.po index cb5124e..a6b2d69 100755 --- a/ug-nfc-share-efl/po/el_GR.po +++ b/ug-nfc-share-efl/po/el_GR.po @@ -1,6 +1,9 @@ msgid "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL" msgstr "Για να ακυρώσετε την κοινή χρήση, πατήστε “Άκυρο”" +msgid "IDS_NFC_POP_SERVICE_NOT_AVAILABLE_NFC_TURNED_OFF_TURN_ON_NFC_Q" +msgstr "Η υπηρεσία δεν είναι διαθέσιμη. Το NFC είναι απενεργοποιημένο. Να ενεργοποιηθεί το NFC;" + msgid "IDS_NFC_HEADER_SHARE_VIA_NFC" msgstr "Κοινή χρήση μέσω NFC" @@ -10,12 +13,9 @@ msgstr "Αποτυχία κοινής χρήσης ετικέτας" msgid "IDS_NFC_BODY_GENTLY_TOUCH_PHONES_TOGETHER_TO_SHARE" msgstr "Αγγίξτε απαλά τα τηλέφωνα για κοινή χρήση" -msgid "IDS_NFC_POP_PS_TAG_SHARED" -msgstr "Έγινε κοινή χρήση της ετικέτας %s" - msgid "IDS_NFC_POP_TRANSFER_FAILED" msgstr "Σφάλμα μεταφοράς" -msgid "IDS_NFC_BODY_PS_SELECTED" -msgstr "Επιλέχθηκε το %s" +msgid "IDS_NFC_POP_TAG_SHARED" +msgstr "Έγινε κοινή χρήση της ετικέτας" diff --git a/ug-nfc-share-efl/po/en.po b/ug-nfc-share-efl/po/en.po index 907749e..2ec339c 100755 --- a/ug-nfc-share-efl/po/en.po +++ b/ug-nfc-share-efl/po/en.po @@ -1,6 +1,9 @@ msgid "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL" msgstr "To cancel sharing, tap Cancel" +msgid "IDS_NFC_POP_SERVICE_NOT_AVAILABLE_NFC_TURNED_OFF_TURN_ON_NFC_Q" +msgstr "Service not available. NFC turned off. Turn on NFC?" + msgid "IDS_NFC_HEADER_SHARE_VIA_NFC" msgstr "Share via NFC" @@ -10,12 +13,9 @@ msgstr "Failed to share tag" msgid "IDS_NFC_BODY_GENTLY_TOUCH_PHONES_TOGETHER_TO_SHARE" msgstr "Gently touch phones together to share" -msgid "IDS_NFC_POP_PS_TAG_SHARED" -msgstr "%s tag shared" - msgid "IDS_NFC_POP_TRANSFER_FAILED" msgstr "Transfer failed" -msgid "IDS_NFC_BODY_PS_SELECTED" -msgstr "%s selected" +msgid "IDS_NFC_POP_TAG_SHARED" +msgstr "Tag shared" diff --git a/ug-nfc-share-efl/po/en_US.po b/ug-nfc-share-efl/po/en_US.po new file mode 100644 index 0000000..2ec339c --- /dev/null +++ b/ug-nfc-share-efl/po/en_US.po @@ -0,0 +1,21 @@ +msgid "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL" +msgstr "To cancel sharing, tap Cancel" + +msgid "IDS_NFC_POP_SERVICE_NOT_AVAILABLE_NFC_TURNED_OFF_TURN_ON_NFC_Q" +msgstr "Service not available. NFC turned off. Turn on NFC?" + +msgid "IDS_NFC_HEADER_SHARE_VIA_NFC" +msgstr "Share via NFC" + +msgid "IDS_NFC_POP_FAILED_TO_SHARE_TAG" +msgstr "Failed to share tag" + +msgid "IDS_NFC_BODY_GENTLY_TOUCH_PHONES_TOGETHER_TO_SHARE" +msgstr "Gently touch phones together to share" + +msgid "IDS_NFC_POP_TRANSFER_FAILED" +msgstr "Transfer failed" + +msgid "IDS_NFC_POP_TAG_SHARED" +msgstr "Tag shared" + diff --git a/ug-nfc-share-efl/po/es_ES.po b/ug-nfc-share-efl/po/es_ES.po index 6746300..31eb68f 100755 --- a/ug-nfc-share-efl/po/es_ES.po +++ b/ug-nfc-share-efl/po/es_ES.po @@ -1,6 +1,9 @@ msgid "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL" msgstr "Para detener el uso compartido, pulse Cancelar" +msgid "IDS_NFC_POP_SERVICE_NOT_AVAILABLE_NFC_TURNED_OFF_TURN_ON_NFC_Q" +msgstr "Servicio no disponible. NFC apagado. ¿Encender NFC?" + msgid "IDS_NFC_HEADER_SHARE_VIA_NFC" msgstr "Compartir mediante NFC" @@ -10,12 +13,9 @@ msgstr "Error al compartir etiqueta" msgid "IDS_NFC_BODY_GENTLY_TOUCH_PHONES_TOGETHER_TO_SHARE" msgstr "Toque un teléfono con otro con suavidad para compartir" -msgid "IDS_NFC_POP_PS_TAG_SHARED" -msgstr "Etiqueta %s compartida" - msgid "IDS_NFC_POP_TRANSFER_FAILED" msgstr "Error de transferencia" -msgid "IDS_NFC_BODY_PS_SELECTED" -msgstr "Se ha seleccionado %s" +msgid "IDS_NFC_POP_TAG_SHARED" +msgstr "Etiqueta compartida" diff --git a/ug-nfc-share-efl/po/fi.po b/ug-nfc-share-efl/po/fi.po new file mode 100644 index 0000000..45d2563 --- /dev/null +++ b/ug-nfc-share-efl/po/fi.po @@ -0,0 +1,21 @@ +msgid "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL" +msgstr "Lopeta jakaminen napauttamalla Peruuta" + +msgid "IDS_NFC_POP_SERVICE_NOT_AVAILABLE_NFC_TURNED_OFF_TURN_ON_NFC_Q" +msgstr "Palvelu ei ole käytettävissä. NFC on poistettu käytöstä. Otetaanko NFC käyttöön?" + +msgid "IDS_NFC_HEADER_SHARE_VIA_NFC" +msgstr "Jaa NFC:n kautta" + +msgid "IDS_NFC_POP_FAILED_TO_SHARE_TAG" +msgstr "Tunnisteen jakaminen epäonnistui" + +msgid "IDS_NFC_BODY_GENTLY_TOUCH_PHONES_TOGETHER_TO_SHARE" +msgstr "Jaa koskettamalla puhelimet varovasti toisiinsa" + +msgid "IDS_NFC_POP_TRANSFER_FAILED" +msgstr "Siirtovirhe" + +msgid "IDS_NFC_POP_TAG_SHARED" +msgstr "Tunniste jaettu" + diff --git a/ug-nfc-share-efl/po/fr_FR.po b/ug-nfc-share-efl/po/fr_FR.po index e577c3a..3a5309c 100755 --- a/ug-nfc-share-efl/po/fr_FR.po +++ b/ug-nfc-share-efl/po/fr_FR.po @@ -1,6 +1,9 @@ msgid "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL" msgstr "Pour annuler le partage, appuyez sur Annuler" +msgid "IDS_NFC_POP_SERVICE_NOT_AVAILABLE_NFC_TURNED_OFF_TURN_ON_NFC_Q" +msgstr "Service non disponible. NFC désactivé. Activer NFC ?" + msgid "IDS_NFC_HEADER_SHARE_VIA_NFC" msgstr "Partager via NFC" @@ -10,12 +13,9 @@ msgstr "Impossible de partager le tag" msgid "IDS_NFC_BODY_GENTLY_TOUCH_PHONES_TOGETHER_TO_SHARE" msgstr "Faites entrer doucement en contact les téléphones pour partager" -msgid "IDS_NFC_POP_PS_TAG_SHARED" -msgstr "Tag%s partagé" - msgid "IDS_NFC_POP_TRANSFER_FAILED" -msgstr "Erreur de transfert" +msgstr "Echec du transfert" -msgid "IDS_NFC_BODY_PS_SELECTED" -msgstr "%s sélectionné" +msgid "IDS_NFC_POP_TAG_SHARED" +msgstr "Tag partagé" diff --git a/ug-nfc-share-efl/po/he.po b/ug-nfc-share-efl/po/he.po new file mode 100644 index 0000000..1714ff3 --- /dev/null +++ b/ug-nfc-share-efl/po/he.po @@ -0,0 +1,21 @@ +msgid "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL" +msgstr "כדי לבטל את השיתוף, הקש על ’אישור’" + +msgid "IDS_NFC_POP_SERVICE_NOT_AVAILABLE_NFC_TURNED_OFF_TURN_ON_NFC_Q" +msgstr "השירות אינו זמין. NFC כבוי. להפעיל NFC?" + +msgid "IDS_NFC_HEADER_SHARE_VIA_NFC" +msgstr "שתף באמצעות NFC" + +msgid "IDS_NFC_POP_FAILED_TO_SHARE_TAG" +msgstr "שיתוף התגית נכשל" + +msgid "IDS_NFC_BODY_GENTLY_TOUCH_PHONES_TOGETHER_TO_SHARE" +msgstr "גע בטלפון בעדינות באמצעות הטלפון השני כדי לשתף" + +msgid "IDS_NFC_POP_TRANSFER_FAILED" +msgstr "ההעברה נכשלה" + +msgid "IDS_NFC_POP_TAG_SHARED" +msgstr "התגית שותפה" + diff --git a/ug-nfc-share-efl/po/hi.po b/ug-nfc-share-efl/po/hi.po new file mode 100644 index 0000000..3e931d0 --- /dev/null +++ b/ug-nfc-share-efl/po/hi.po @@ -0,0 +1,21 @@ +msgid "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL" +msgstr "साझाकरण रद्द करने के लिए, रद्द करें टेप करें" + +msgid "IDS_NFC_POP_SERVICE_NOT_AVAILABLE_NFC_TURNED_OFF_TURN_ON_NFC_Q" +msgstr "सेवा उपलब्ध नहीं है। NFC बंद किया गया है। NFC चालू करें?" + +msgid "IDS_NFC_HEADER_SHARE_VIA_NFC" +msgstr "NFC के द्वारा साझा करें" + +msgid "IDS_NFC_POP_FAILED_TO_SHARE_TAG" +msgstr "टैग साझा करने में विफल" + +msgid "IDS_NFC_BODY_GENTLY_TOUCH_PHONES_TOGETHER_TO_SHARE" +msgstr "साझा करने के लिए फ़ोन्स को एक साथ हल्के से स्पर्श करें" + +msgid "IDS_NFC_POP_TRANSFER_FAILED" +msgstr "स्थानांतरण विफल" + +msgid "IDS_NFC_POP_TAG_SHARED" +msgstr "साझा किए गए टैग करें" + diff --git a/ug-nfc-share-efl/po/hr.po b/ug-nfc-share-efl/po/hr.po new file mode 100644 index 0000000..f4fa418 --- /dev/null +++ b/ug-nfc-share-efl/po/hr.po @@ -0,0 +1,21 @@ +msgid "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL" +msgstr "Za odustajanje od dijeljenja dodirnite Odustani" + +msgid "IDS_NFC_POP_SERVICE_NOT_AVAILABLE_NFC_TURNED_OFF_TURN_ON_NFC_Q" +msgstr "Usluga nedostupna. NFC isključen. Uključiti NFC?" + +msgid "IDS_NFC_HEADER_SHARE_VIA_NFC" +msgstr "Dijeli putem NFC" + +msgid "IDS_NFC_POP_FAILED_TO_SHARE_TAG" +msgstr "Greška dijeljenja oznake" + +msgid "IDS_NFC_BODY_GENTLY_TOUCH_PHONES_TOGETHER_TO_SHARE" +msgstr "Nježno dodirni telefone za dijeljenje" + +msgid "IDS_NFC_POP_TRANSFER_FAILED" +msgstr "Greška prijenosa" + +msgid "IDS_NFC_POP_TAG_SHARED" +msgstr "Oznaka dijeljena" + diff --git a/ug-nfc-share-efl/po/hu.po b/ug-nfc-share-efl/po/hu.po new file mode 100644 index 0000000..a3401a8 --- /dev/null +++ b/ug-nfc-share-efl/po/hu.po @@ -0,0 +1,21 @@ +msgid "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL" +msgstr "A megosztás megszüntetéséhez érintse meg a Mégse gombot" + +msgid "IDS_NFC_POP_SERVICE_NOT_AVAILABLE_NFC_TURNED_OFF_TURN_ON_NFC_Q" +msgstr "A szolgáltatás nem elérhető. Az NFC ki van kapcsolva. Bekapcsolja az NFC-t?" + +msgid "IDS_NFC_HEADER_SHARE_VIA_NFC" +msgstr "Megosztás NFC-n" + +msgid "IDS_NFC_POP_FAILED_TO_SHARE_TAG" +msgstr "Nem sikerült megosztani a címkét" + +msgid "IDS_NFC_BODY_GENTLY_TOUCH_PHONES_TOGETHER_TO_SHARE" +msgstr "Finoman érintse egymáshoz a telefonokat a megosztáshoz" + +msgid "IDS_NFC_POP_TRANSFER_FAILED" +msgstr "Hívásátadás sikertelen" + +msgid "IDS_NFC_POP_TAG_SHARED" +msgstr "Címke megosztva" + diff --git a/ug-nfc-share-efl/po/id.po b/ug-nfc-share-efl/po/id.po new file mode 100644 index 0000000..f9b5e66 --- /dev/null +++ b/ug-nfc-share-efl/po/id.po @@ -0,0 +1,21 @@ +msgid "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL" +msgstr "Untuk membatalkan berbagi, ketuk Batal" + +msgid "IDS_NFC_POP_SERVICE_NOT_AVAILABLE_NFC_TURNED_OFF_TURN_ON_NFC_Q" +msgstr "Layanan tidak tersedia. NFC dinonaktifkan. Aktifkan NFC?" + +msgid "IDS_NFC_HEADER_SHARE_VIA_NFC" +msgstr "Bagi lewat NFC" + +msgid "IDS_NFC_POP_FAILED_TO_SHARE_TAG" +msgstr "Gagal berbagi tag" + +msgid "IDS_NFC_BODY_GENTLY_TOUCH_PHONES_TOGETHER_TO_SHARE" +msgstr "Sentuh telepon dengan lembut secara bersamaan untuk berbagi" + +msgid "IDS_NFC_POP_TRANSFER_FAILED" +msgstr "Pemindahan gagal" + +msgid "IDS_NFC_POP_TAG_SHARED" +msgstr "Tag dibagi" + diff --git a/ug-nfc-share-efl/po/it_IT.po b/ug-nfc-share-efl/po/it_IT.po index aee0d88..a28e84d 100755 --- a/ug-nfc-share-efl/po/it_IT.po +++ b/ug-nfc-share-efl/po/it_IT.po @@ -1,5 +1,8 @@ msgid "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL" -msgstr "Per annullare la condivisione, toccare Annulla" +msgstr "Per annullare la condivisione, toccate Annulla" + +msgid "IDS_NFC_POP_SERVICE_NOT_AVAILABLE_NFC_TURNED_OFF_TURN_ON_NFC_Q" +msgstr "Servizio non disponibile. NFC disattivato. Attivare NFC?" msgid "IDS_NFC_HEADER_SHARE_VIA_NFC" msgstr "Condividi con NFC" @@ -8,14 +11,11 @@ msgid "IDS_NFC_POP_FAILED_TO_SHARE_TAG" msgstr "Impossibile condividere tag" msgid "IDS_NFC_BODY_GENTLY_TOUCH_PHONES_TOGETHER_TO_SHARE" -msgstr "Per avviare la condivisione, far toccare leggermente i telefoni" - -msgid "IDS_NFC_POP_PS_TAG_SHARED" -msgstr "%s tag condivisi" +msgstr "Per avviare la condivisione, toccate leggermente i telefoni" msgid "IDS_NFC_POP_TRANSFER_FAILED" msgstr "Errore trasferimento" -msgid "IDS_NFC_BODY_PS_SELECTED" -msgstr "%s selezionato" +msgid "IDS_NFC_POP_TAG_SHARED" +msgstr "Tag condiviso" diff --git a/ug-nfc-share-efl/po/ja_JP.po b/ug-nfc-share-efl/po/ja_JP.po index e63961a..47fa877 100755 --- a/ug-nfc-share-efl/po/ja_JP.po +++ b/ug-nfc-share-efl/po/ja_JP.po @@ -1,6 +1,9 @@ msgid "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL" msgstr "共有を解除するには、[キャンセル]をタップしてください。" +msgid "IDS_NFC_POP_SERVICE_NOT_AVAILABLE_NFC_TURNED_OFF_TURN_ON_NFC_Q" +msgstr "サービスを利用できません。NFCがOFFになっています。NFCをONにしますか?" + msgid "IDS_NFC_HEADER_SHARE_VIA_NFC" msgstr "NFCで共有" @@ -10,12 +13,9 @@ msgstr "タグの共有に失敗しました。" msgid "IDS_NFC_BODY_GENTLY_TOUCH_PHONES_TOGETHER_TO_SHARE" msgstr "共有するには、端末同士をゆっくりと近づけてください。" -msgid "IDS_NFC_POP_PS_TAG_SHARED" -msgstr "%sタグを共有しました。" - msgid "IDS_NFC_POP_TRANSFER_FAILED" -msgstr "転送に失敗しました" +msgstr "転送に失敗しました。" -msgid "IDS_NFC_BODY_PS_SELECTED" -msgstr "%sが選択されました" +msgid "IDS_NFC_POP_TAG_SHARED" +msgstr "タグが共有されました。" diff --git a/ug-nfc-share-efl/po/ko_KR.po b/ug-nfc-share-efl/po/ko_KR.po index 5a4ecaa..3fcd0ca 100755 --- a/ug-nfc-share-efl/po/ko_KR.po +++ b/ug-nfc-share-efl/po/ko_KR.po @@ -1,6 +1,9 @@ msgid "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL" msgstr "공유를 취소하려면 [취소]를 누르세요" +msgid "IDS_NFC_POP_SERVICE_NOT_AVAILABLE_NFC_TURNED_OFF_TURN_ON_NFC_Q" +msgstr "NFC가 꺼져 있어 서비스를 이용할 수 없습니다. NFC를 켤까요?" + msgid "IDS_NFC_HEADER_SHARE_VIA_NFC" msgstr "NFC로 공유" @@ -10,12 +13,9 @@ msgstr "태그를 공유하지 못하였습니다" msgid "IDS_NFC_BODY_GENTLY_TOUCH_PHONES_TOGETHER_TO_SHARE" msgstr "공유하려면 휴대폰을 서로 가볍게 부딪히세요" -msgid "IDS_NFC_POP_PS_TAG_SHARED" -msgstr "%s 태그가 공유되었습니다" - msgid "IDS_NFC_POP_TRANSFER_FAILED" msgstr "연결하지 못하였습니다" -msgid "IDS_NFC_BODY_PS_SELECTED" -msgstr "%s가 선택되었습니다" +msgid "IDS_NFC_POP_TAG_SHARED" +msgstr "태그가 공유되었습니다" diff --git a/ug-nfc-share-efl/po/lt.po b/ug-nfc-share-efl/po/lt.po new file mode 100644 index 0000000..c5c1e65 --- /dev/null +++ b/ug-nfc-share-efl/po/lt.po @@ -0,0 +1,21 @@ +msgid "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL" +msgstr "Jei norite atšaukti bendrinimą, bakstelėkite „Atšaukti“" + +msgid "IDS_NFC_POP_SERVICE_NOT_AVAILABLE_NFC_TURNED_OFF_TURN_ON_NFC_Q" +msgstr "Paslauga nepasiekiama. NFC išjungtas. Įjungti NFC?" + +msgid "IDS_NFC_HEADER_SHARE_VIA_NFC" +msgstr "Bendrinti per NFC" + +msgid "IDS_NFC_POP_FAILED_TO_SHARE_TAG" +msgstr "Nepavyko bendrinti žymos" + +msgid "IDS_NFC_BODY_GENTLY_TOUCH_PHONES_TOGETHER_TO_SHARE" +msgstr "Jei norite bendrinti, švelniai pridėkite vieną telefoną prie kito" + +msgid "IDS_NFC_POP_TRANSFER_FAILED" +msgstr "Persiųsti nepavyko" + +msgid "IDS_NFC_POP_TAG_SHARED" +msgstr "Žyma bendrinta" + diff --git a/ug-nfc-share-efl/po/lv.po b/ug-nfc-share-efl/po/lv.po new file mode 100644 index 0000000..a59874f --- /dev/null +++ b/ug-nfc-share-efl/po/lv.po @@ -0,0 +1,21 @@ +msgid "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL" +msgstr "Lai atceltu kopīgošanu, pieskarieties pie Atcelt" + +msgid "IDS_NFC_POP_SERVICE_NOT_AVAILABLE_NFC_TURNED_OFF_TURN_ON_NFC_Q" +msgstr "Pakalpojums nav pieejams. NFC ir izslēgts. Vai ieslēgt NFC?" + +msgid "IDS_NFC_HEADER_SHARE_VIA_NFC" +msgstr "Kopīgot, izmantojot NFC" + +msgid "IDS_NFC_POP_FAILED_TO_SHARE_TAG" +msgstr "Neizdevās kopīgot atzīmi" + +msgid "IDS_NFC_BODY_GENTLY_TOUCH_PHONES_TOGETHER_TO_SHARE" +msgstr "Viegli pieskarieties ar vienu tālruni otram, lai kopīgotu" + +msgid "IDS_NFC_POP_TRANSFER_FAILED" +msgstr "Pārsūtīšana neizdevās" + +msgid "IDS_NFC_POP_TAG_SHARED" +msgstr "Atzīme ir kopīgota" + diff --git a/ug-nfc-share-efl/po/ms.po b/ug-nfc-share-efl/po/ms.po new file mode 100644 index 0000000..7ff562d --- /dev/null +++ b/ug-nfc-share-efl/po/ms.po @@ -0,0 +1,21 @@ +msgid "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL" +msgstr "Untuk batalkan perkongsian, ketik Batal" + +msgid "IDS_NFC_POP_SERVICE_NOT_AVAILABLE_NFC_TURNED_OFF_TURN_ON_NFC_Q" +msgstr "Perkhidmatan tidak tersedia. NFC dimatikan. Hidupkan NFC?" + +msgid "IDS_NFC_HEADER_SHARE_VIA_NFC" +msgstr "Kongsi melalui NFC" + +msgid "IDS_NFC_POP_FAILED_TO_SHARE_TAG" +msgstr "Gagal untuk berkongsi tag" + +msgid "IDS_NFC_BODY_GENTLY_TOUCH_PHONES_TOGETHER_TO_SHARE" +msgstr "Sentuh telefon bersama dengan lembut untuk berkongsi" + +msgid "IDS_NFC_POP_TRANSFER_FAILED" +msgstr "Pindahan gagal" + +msgid "IDS_NFC_POP_TAG_SHARED" +msgstr "Tag dikongsi" + diff --git a/ug-nfc-share-efl/po/nl_NL.po b/ug-nfc-share-efl/po/nl_NL.po index 2d2ac1f..20fc2cf 100755 --- a/ug-nfc-share-efl/po/nl_NL.po +++ b/ug-nfc-share-efl/po/nl_NL.po @@ -1,6 +1,9 @@ msgid "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL" msgstr "Tik op Annuleren om delen te annuleren" +msgid "IDS_NFC_POP_SERVICE_NOT_AVAILABLE_NFC_TURNED_OFF_TURN_ON_NFC_Q" +msgstr "Service niet beschikbaar. NFC uitgeschakeld. NFC inschakelen?" + msgid "IDS_NFC_HEADER_SHARE_VIA_NFC" msgstr "Delen via NFC" @@ -10,12 +13,9 @@ msgstr "Kan tag niet delen" msgid "IDS_NFC_BODY_GENTLY_TOUCH_PHONES_TOGETHER_TO_SHARE" msgstr "Houd de telefoons voorzichtig tegen elkaar om te delen" -msgid "IDS_NFC_POP_PS_TAG_SHARED" -msgstr "%s tag gedeeld" - msgid "IDS_NFC_POP_TRANSFER_FAILED" msgstr "Fout bij doorverbinden" -msgid "IDS_NFC_BODY_PS_SELECTED" -msgstr "%s geselecteerd" +msgid "IDS_NFC_POP_TAG_SHARED" +msgstr "Gedeelde tag" diff --git a/ug-nfc-share-efl/po/no.po b/ug-nfc-share-efl/po/no.po new file mode 100644 index 0000000..18c87fa --- /dev/null +++ b/ug-nfc-share-efl/po/no.po @@ -0,0 +1,21 @@ +msgid "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL" +msgstr "For å avbryte deling trykker du på Avbryt" + +msgid "IDS_NFC_POP_SERVICE_NOT_AVAILABLE_NFC_TURNED_OFF_TURN_ON_NFC_Q" +msgstr "Tjenesten er ikke tilgjengelig. NFC er slått av. Slå på NFC?" + +msgid "IDS_NFC_HEADER_SHARE_VIA_NFC" +msgstr "Del via NFC" + +msgid "IDS_NFC_POP_FAILED_TO_SHARE_TAG" +msgstr "Kunne ikke dele tagg" + +msgid "IDS_NFC_BODY_GENTLY_TOUCH_PHONES_TOGETHER_TO_SHARE" +msgstr "Legg telefonene forsiktig mot hverandre for å dele" + +msgid "IDS_NFC_POP_TRANSFER_FAILED" +msgstr "Overføringsfeil" + +msgid "IDS_NFC_POP_TAG_SHARED" +msgstr "Tagg delt" + diff --git a/ug-nfc-share-efl/po/pl.po b/ug-nfc-share-efl/po/pl.po new file mode 100644 index 0000000..dcde8f9 --- /dev/null +++ b/ug-nfc-share-efl/po/pl.po @@ -0,0 +1,21 @@ +msgid "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL" +msgstr "Aby anulować udostępnianie, dotknij opcji Anuluj" + +msgid "IDS_NFC_POP_SERVICE_NOT_AVAILABLE_NFC_TURNED_OFF_TURN_ON_NFC_Q" +msgstr "Usługa niedostępna. NFC wyłączony. Włączyć NFC?" + +msgid "IDS_NFC_HEADER_SHARE_VIA_NFC" +msgstr "Udostępnij przez NFC" + +msgid "IDS_NFC_POP_FAILED_TO_SHARE_TAG" +msgstr "Udostępnianie etykiety nie powiodło się" + +msgid "IDS_NFC_BODY_GENTLY_TOUCH_PHONES_TOGETHER_TO_SHARE" +msgstr "Delikatnie przyłóż telefony do siebie, aby udostępnić" + +msgid "IDS_NFC_POP_TRANSFER_FAILED" +msgstr "Błąd transferu" + +msgid "IDS_NFC_POP_TAG_SHARED" +msgstr "Etykieta została udostępniona" + diff --git a/ug-nfc-share-efl/po/pt_PT.po b/ug-nfc-share-efl/po/pt_PT.po index 982c0bc..9534bee 100755 --- a/ug-nfc-share-efl/po/pt_PT.po +++ b/ug-nfc-share-efl/po/pt_PT.po @@ -1,6 +1,9 @@ msgid "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL" msgstr "Para cancelar a partilha, toque em Cancelar" +msgid "IDS_NFC_POP_SERVICE_NOT_AVAILABLE_NFC_TURNED_OFF_TURN_ON_NFC_Q" +msgstr "Serviço indisponível. NFC desligado. Ligar NFC?" + msgid "IDS_NFC_HEADER_SHARE_VIA_NFC" msgstr "Partilhar via NFC" @@ -10,12 +13,9 @@ msgstr "Falha ao partilhar etiqueta" msgid "IDS_NFC_BODY_GENTLY_TOUCH_PHONES_TOGETHER_TO_SHARE" msgstr "Toque suavemente com o telefone no outro para partilhar" -msgid "IDS_NFC_POP_PS_TAG_SHARED" -msgstr "%s etiquetas partilhadas" - msgid "IDS_NFC_POP_TRANSFER_FAILED" msgstr "Erro de transferência" -msgid "IDS_NFC_BODY_PS_SELECTED" -msgstr "%s seleccionado" +msgid "IDS_NFC_POP_TAG_SHARED" +msgstr "Etiqueta partilhada" diff --git a/ug-nfc-share-efl/po/ro.po b/ug-nfc-share-efl/po/ro.po new file mode 100644 index 0000000..e7336b9 --- /dev/null +++ b/ug-nfc-share-efl/po/ro.po @@ -0,0 +1,21 @@ +msgid "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL" +msgstr "Pentru anularea partajării, atingeţi Anulare" + +msgid "IDS_NFC_POP_SERVICE_NOT_AVAILABLE_NFC_TURNED_OFF_TURN_ON_NFC_Q" +msgstr "Serviciul nu este disponibil. NFC este oprit. Porniţi NFC?" + +msgid "IDS_NFC_HEADER_SHARE_VIA_NFC" +msgstr "Partajare prin NFC" + +msgid "IDS_NFC_POP_FAILED_TO_SHARE_TAG" +msgstr "Partajarea etichetei nu a reuşit" + +msgid "IDS_NFC_BODY_GENTLY_TOUCH_PHONES_TOGETHER_TO_SHARE" +msgstr "Atingeţi uşor telefoanele pentru a partaja" + +msgid "IDS_NFC_POP_TRANSFER_FAILED" +msgstr "Transfer nereuşit" + +msgid "IDS_NFC_POP_TAG_SHARED" +msgstr "Etichetă partajată" + diff --git a/ug-nfc-share-efl/po/ru_RU.po b/ug-nfc-share-efl/po/ru_RU.po index 32c4793..04f420d 100755 --- a/ug-nfc-share-efl/po/ru_RU.po +++ b/ug-nfc-share-efl/po/ru_RU.po @@ -1,6 +1,9 @@ msgid "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL" msgstr "Чтобы не предоставлять доступ, нажмите Отмена" +msgid "IDS_NFC_POP_SERVICE_NOT_AVAILABLE_NFC_TURNED_OFF_TURN_ON_NFC_Q" +msgstr "Служба недоступна. Связь NFC выключена. Включить NFC?" + msgid "IDS_NFC_HEADER_SHARE_VIA_NFC" msgstr "Отправить через NFC" @@ -10,12 +13,9 @@ msgstr "Не удалось отправить метку" msgid "IDS_NFC_BODY_GENTLY_TOUCH_PHONES_TOGETHER_TO_SHARE" msgstr "Прикоснитесь одним телефоном к другому для отправки" -msgid "IDS_NFC_POP_PS_TAG_SHARED" -msgstr "Метка %s отправлена" - msgid "IDS_NFC_POP_TRANSFER_FAILED" -msgstr "Сбой перевода" +msgstr "Сбой передачи" -msgid "IDS_NFC_BODY_PS_SELECTED" -msgstr "Выбрано: %s" +msgid "IDS_NFC_POP_TAG_SHARED" +msgstr "Метка отправлена" diff --git a/ug-nfc-share-efl/po/sk.po b/ug-nfc-share-efl/po/sk.po new file mode 100644 index 0000000..62b29c1 --- /dev/null +++ b/ug-nfc-share-efl/po/sk.po @@ -0,0 +1,21 @@ +msgid "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL" +msgstr "Ak chcete zrušiť zdieľanie, ťuknite na tlačidlo Zrušiť" + +msgid "IDS_NFC_POP_SERVICE_NOT_AVAILABLE_NFC_TURNED_OFF_TURN_ON_NFC_Q" +msgstr "Služba nie je k dispozícii. Funkcia NFC je vypnutá. Zapnúť funkciu NFC?" + +msgid "IDS_NFC_HEADER_SHARE_VIA_NFC" +msgstr "Zdieľať cez NFC" + +msgid "IDS_NFC_POP_FAILED_TO_SHARE_TAG" +msgstr "Nepodarilo sa zdieľať značku" + +msgid "IDS_NFC_BODY_GENTLY_TOUCH_PHONES_TOGETHER_TO_SHARE" +msgstr "Jemným dotykom telefónov spustíte zdieľanie" + +msgid "IDS_NFC_POP_TRANSFER_FAILED" +msgstr "Chyba prenosu" + +msgid "IDS_NFC_POP_TAG_SHARED" +msgstr "Značka sa zdieľa" + diff --git a/ug-nfc-share-efl/po/sl.po b/ug-nfc-share-efl/po/sl.po new file mode 100644 index 0000000..67d11f2 --- /dev/null +++ b/ug-nfc-share-efl/po/sl.po @@ -0,0 +1,21 @@ +msgid "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL" +msgstr "Če želite preklicati skupno rabo, pritisnite Prekliči" + +msgid "IDS_NFC_POP_SERVICE_NOT_AVAILABLE_NFC_TURNED_OFF_TURN_ON_NFC_Q" +msgstr "Storitev ni na voljo. NFC je izklopljen. Želite vklopiti NFC?" + +msgid "IDS_NFC_HEADER_SHARE_VIA_NFC" +msgstr "Skupna raba prek NFC" + +msgid "IDS_NFC_POP_FAILED_TO_SHARE_TAG" +msgstr "Skupna raba oznake ni uspela" + +msgid "IDS_NFC_BODY_GENTLY_TOUCH_PHONES_TOGETHER_TO_SHARE" +msgstr "Za skupno rabo se s telefonom rahlo dotaknite drugega telefona" + +msgid "IDS_NFC_POP_TRANSFER_FAILED" +msgstr "Prenos ni uspel" + +msgid "IDS_NFC_POP_TAG_SHARED" +msgstr "Oznaka je v skupni rabi" + diff --git a/ug-nfc-share-efl/po/sr.po b/ug-nfc-share-efl/po/sr.po new file mode 100644 index 0000000..b6a5b11 --- /dev/null +++ b/ug-nfc-share-efl/po/sr.po @@ -0,0 +1,21 @@ +msgid "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL" +msgstr "Da bi otkazao deljenje, kucni Otkaži" + +msgid "IDS_NFC_POP_SERVICE_NOT_AVAILABLE_NFC_TURNED_OFF_TURN_ON_NFC_Q" +msgstr "Usluga nije dostupna. NFC je isključen. Uključiti NFC?" + +msgid "IDS_NFC_HEADER_SHARE_VIA_NFC" +msgstr "Podeli putem NFC-a" + +msgid "IDS_NFC_POP_FAILED_TO_SHARE_TAG" +msgstr "Deljenje oznake nije uspelo" + +msgid "IDS_NFC_BODY_GENTLY_TOUCH_PHONES_TOGETHER_TO_SHARE" +msgstr "Nežno dodirni telefon o telefon za deljenje" + +msgid "IDS_NFC_POP_TRANSFER_FAILED" +msgstr "Prenos neuspešan" + +msgid "IDS_NFC_POP_TAG_SHARED" +msgstr "Oznaka je podeljena" + diff --git a/ug-nfc-share-efl/po/sv.po b/ug-nfc-share-efl/po/sv.po new file mode 100644 index 0000000..3a6af42 --- /dev/null +++ b/ug-nfc-share-efl/po/sv.po @@ -0,0 +1,21 @@ +msgid "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL" +msgstr "Tryck på Avbryt om du vill avbryta delning" + +msgid "IDS_NFC_POP_SERVICE_NOT_AVAILABLE_NFC_TURNED_OFF_TURN_ON_NFC_Q" +msgstr "Tjänsten är inte tillgänglig. NFC är avstängt. Slå på NFC?" + +msgid "IDS_NFC_HEADER_SHARE_VIA_NFC" +msgstr "Dela via NFC" + +msgid "IDS_NFC_POP_FAILED_TO_SHARE_TAG" +msgstr "Det gick inte att dela tagg" + +msgid "IDS_NFC_BODY_GENTLY_TOUCH_PHONES_TOGETHER_TO_SHARE" +msgstr "Sammanför försiktigt telefonerna för att dela" + +msgid "IDS_NFC_POP_TRANSFER_FAILED" +msgstr "Överföringsfel" + +msgid "IDS_NFC_POP_TAG_SHARED" +msgstr "Taggen har delats" + diff --git a/ug-nfc-share-efl/po/th.po b/ug-nfc-share-efl/po/th.po new file mode 100644 index 0000000..52f9e14 --- /dev/null +++ b/ug-nfc-share-efl/po/th.po @@ -0,0 +1,21 @@ +msgid "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL" +msgstr "เมื่อต้องการยกเลิกการแชร์ ให้สัมผัส ยกเลิก" + +msgid "IDS_NFC_POP_SERVICE_NOT_AVAILABLE_NFC_TURNED_OFF_TURN_ON_NFC_Q" +msgstr "บริการไม่พร้อมใช้งาน NFC ปิด เปิด NFC?" + +msgid "IDS_NFC_HEADER_SHARE_VIA_NFC" +msgstr "แชร์ผ่าน NFC" + +msgid "IDS_NFC_POP_FAILED_TO_SHARE_TAG" +msgstr "แชร์แท็กไม่ได้" + +msgid "IDS_NFC_BODY_GENTLY_TOUCH_PHONES_TOGETHER_TO_SHARE" +msgstr "ค่อยๆ สัมผัสโทรศัพท์พร้อมกันเพื่อแชร์" + +msgid "IDS_NFC_POP_TRANSFER_FAILED" +msgstr "โอนสายผิดพลาด" + +msgid "IDS_NFC_POP_TAG_SHARED" +msgstr "แชร์แท็กแล้ว" + diff --git a/ug-nfc-share-efl/po/tr_TR.po b/ug-nfc-share-efl/po/tr_TR.po index 6b3d071..513aa38 100755 --- a/ug-nfc-share-efl/po/tr_TR.po +++ b/ug-nfc-share-efl/po/tr_TR.po @@ -1,6 +1,9 @@ msgid "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL" msgstr "Paylaşmayı iptal etmek için, İptal'e basın" +msgid "IDS_NFC_POP_SERVICE_NOT_AVAILABLE_NFC_TURNED_OFF_TURN_ON_NFC_Q" +msgstr "Servis kullanılamıyor. NFC kapatıldı. NFC açılsın mı?" + msgid "IDS_NFC_HEADER_SHARE_VIA_NFC" msgstr "NFC ile paylaş" @@ -8,14 +11,11 @@ msgid "IDS_NFC_POP_FAILED_TO_SHARE_TAG" msgstr "Etiket paylaşılamadı" msgid "IDS_NFC_BODY_GENTLY_TOUCH_PHONES_TOGETHER_TO_SHARE" -msgstr "Paylaşmak için hafifçe telefonlara dokunun" - -msgid "IDS_NFC_POP_PS_TAG_SHARED" -msgstr "%s etiket paylaşıldı" +msgstr "Paylaşmak için hafifçe telefonları birbirine dokundurun." msgid "IDS_NFC_POP_TRANSFER_FAILED" msgstr "Transfer başarısız" -msgid "IDS_NFC_BODY_PS_SELECTED" -msgstr "%s seçildi" +msgid "IDS_NFC_POP_TAG_SHARED" +msgstr "Etiket paylaşıldı" diff --git a/ug-nfc-share-efl/po/uk.po b/ug-nfc-share-efl/po/uk.po new file mode 100644 index 0000000..f4b1a6d --- /dev/null +++ b/ug-nfc-share-efl/po/uk.po @@ -0,0 +1,21 @@ +msgid "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL" +msgstr "Щоб скасувати спільний доступ, натисніть "Скасувати"" + +msgid "IDS_NFC_POP_SERVICE_NOT_AVAILABLE_NFC_TURNED_OFF_TURN_ON_NFC_Q" +msgstr "Служба недоступна. NFC вимкнено. Увімкнути NFC?" + +msgid "IDS_NFC_HEADER_SHARE_VIA_NFC" +msgstr "Спільний доступ через NFC" + +msgid "IDS_NFC_POP_FAILED_TO_SHARE_TAG" +msgstr "Не вдалося відкрити спільний доступ до тегу" + +msgid "IDS_NFC_BODY_GENTLY_TOUCH_PHONES_TOGETHER_TO_SHARE" +msgstr "Для надання спільного доступу обережно прикладіть телефони один до одного" + +msgid "IDS_NFC_POP_TRANSFER_FAILED" +msgstr "Збій передачі" + +msgid "IDS_NFC_POP_TAG_SHARED" +msgstr "Надано спільний доступ до тегу" + diff --git a/ug-nfc-share-efl/po/vi.po b/ug-nfc-share-efl/po/vi.po new file mode 100644 index 0000000..d4ae503 --- /dev/null +++ b/ug-nfc-share-efl/po/vi.po @@ -0,0 +1,21 @@ +msgid "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL" +msgstr "Để hủy chia sẻ, chạm Hủy" + +msgid "IDS_NFC_POP_SERVICE_NOT_AVAILABLE_NFC_TURNED_OFF_TURN_ON_NFC_Q" +msgstr "Không có dịch vụ. Đã tắt NFC. Bật NFC?" + +msgid "IDS_NFC_HEADER_SHARE_VIA_NFC" +msgstr "Chia sẻ qua NFC" + +msgid "IDS_NFC_POP_FAILED_TO_SHARE_TAG" +msgstr "Không thể chia sẻ thẻ" + +msgid "IDS_NFC_BODY_GENTLY_TOUCH_PHONES_TOGETHER_TO_SHARE" +msgstr "Chạm nhẹ giữa các điện thoại để chia sẻ" + +msgid "IDS_NFC_POP_TRANSFER_FAILED" +msgstr "Không chuyển được" + +msgid "IDS_NFC_POP_TAG_SHARED" +msgstr "Thẻ chia sẻ" + diff --git a/ug-nfc-share-efl/po/zh_CN.po b/ug-nfc-share-efl/po/zh_CN.po index 3618cf2..8429081 100755 --- a/ug-nfc-share-efl/po/zh_CN.po +++ b/ug-nfc-share-efl/po/zh_CN.po @@ -1,6 +1,9 @@ msgid "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL" msgstr "若要取消共享,点击取消" +msgid "IDS_NFC_POP_SERVICE_NOT_AVAILABLE_NFC_TURNED_OFF_TURN_ON_NFC_Q" +msgstr "服务不可用。NFC 已关闭。是否开启 NFC?" + msgid "IDS_NFC_HEADER_SHARE_VIA_NFC" msgstr "通过 NFC 共享" @@ -10,12 +13,9 @@ msgstr "共享标签失败" msgid "IDS_NFC_BODY_GENTLY_TOUCH_PHONES_TOGETHER_TO_SHARE" msgstr "轻轻地将手机触碰在一起以共享" -msgid "IDS_NFC_POP_PS_TAG_SHARED" -msgstr "%s 标签已共享" - msgid "IDS_NFC_POP_TRANSFER_FAILED" msgstr "转换失败" -msgid "IDS_NFC_BODY_PS_SELECTED" -msgstr "已选择%s" +msgid "IDS_NFC_POP_TAG_SHARED" +msgstr "标签已共享" diff --git a/ug-nfc-share-efl/po/zh_HK.po b/ug-nfc-share-efl/po/zh_HK.po index 02d0c74..aca1fbc 100755 --- a/ug-nfc-share-efl/po/zh_HK.po +++ b/ug-nfc-share-efl/po/zh_HK.po @@ -1,6 +1,9 @@ msgid "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL" msgstr "如要取消分享,輕觸取消" +msgid "IDS_NFC_POP_SERVICE_NOT_AVAILABLE_NFC_TURNED_OFF_TURN_ON_NFC_Q" +msgstr "服務不可用。NFC 已關閉。開啟 NFC 嗎?" + msgid "IDS_NFC_HEADER_SHARE_VIA_NFC" msgstr "透過 NFC 分享" @@ -8,14 +11,11 @@ msgid "IDS_NFC_POP_FAILED_TO_SHARE_TAG" msgstr "分享標籤失敗" msgid "IDS_NFC_BODY_GENTLY_TOUCH_PHONES_TOGETHER_TO_SHARE" -msgstr "將手機輕輕碰觸在一起以分享" - -msgid "IDS_NFC_POP_PS_TAG_SHARED" -msgstr "%s 已分享標籤" +msgstr "輕輕地將手機碰觸在一起以分享" msgid "IDS_NFC_POP_TRANSFER_FAILED" msgstr "傳送失敗" -msgid "IDS_NFC_BODY_PS_SELECTED" -msgstr "%s 已選擇" +msgid "IDS_NFC_POP_TAG_SHARED" +msgstr "已分享標籤" diff --git a/ug-nfc-share-efl/po/zh_TW.po b/ug-nfc-share-efl/po/zh_TW.po index 20c495e..91a701a 100755 --- a/ug-nfc-share-efl/po/zh_TW.po +++ b/ug-nfc-share-efl/po/zh_TW.po @@ -1,6 +1,9 @@ msgid "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL" msgstr "若要取消分享,輕觸取消" +msgid "IDS_NFC_POP_SERVICE_NOT_AVAILABLE_NFC_TURNED_OFF_TURN_ON_NFC_Q" +msgstr "服務無法使用。NFC 已關閉。開啟 NFC 嗎?" + msgid "IDS_NFC_HEADER_SHARE_VIA_NFC" msgstr "透過 NFC 分享" @@ -10,12 +13,9 @@ msgstr "分享標籤失敗" msgid "IDS_NFC_BODY_GENTLY_TOUCH_PHONES_TOGETHER_TO_SHARE" msgstr "將手機輕輕碰觸在一起以共享" -msgid "IDS_NFC_POP_PS_TAG_SHARED" -msgstr "%s 已分享標籤" - msgid "IDS_NFC_POP_TRANSFER_FAILED" msgstr "傳輸失敗" -msgid "IDS_NFC_BODY_PS_SELECTED" -msgstr "%個已選擇" +msgid "IDS_NFC_POP_TAG_SHARED" +msgstr "標籤已分享" diff --git a/ug-nfc-share-efl/src/ug-nfc-share-common-util.c b/ug-nfc-share-efl/src/ug-nfc-share-common-util.c index 1b6c3eb..086221c 100644 --- a/ug-nfc-share-efl/src/ug-nfc-share-common-util.c +++ b/ug-nfc-share-efl/src/ug-nfc-share-common-util.c @@ -14,10 +14,8 @@ * limitations under the License. */ -#include <string.h> -#include "appsvc.h" -#include <aul.h> +#include <string.h> #include "ug-nfc-share-common-util.h" #include "ug-nfc-share-common-debug.h" @@ -194,33 +192,3 @@ ug_nfc_share_memory_print_list() } #endif /*_UG_NFC_SHARE_MEM_TRACE_*/ -int ug_nfc_share_launch_service(const char *operation, const char *uri, const char *mime) -{ - int result = -1; - - bundle *bd = NULL; - - bd = bundle_create(); - retv_if(bd == NULL, result); - - if (operation != NULL) - { - appsvc_set_operation(bd, operation); - } - - if (uri != NULL) - { - appsvc_set_uri(bd, uri); - } - - if (mime != NULL) - { - appsvc_set_mime(bd, mime); - } - - result = appsvc_run_service(bd, 0, NULL, NULL); - - bundle_free(bd); - - return result; -} diff --git a/ug-nfc-share-efl/src/ug-nfc-share-main.c b/ug-nfc-share-efl/src/ug-nfc-share-main.c index 6d2cc9a..fbc61c6 100644 --- a/ug-nfc-share-efl/src/ug-nfc-share-main.c +++ b/ug-nfc-share-efl/src/ug-nfc-share-main.c @@ -14,6 +14,7 @@ * limitations under the License. */ + #include "ug-nfc-share-main.h" #include "ug-nfc-share-tag.h" #include "ug-nfc-share-popup.h" @@ -26,39 +27,241 @@ #include <vconf.h> #include <sys/types.h> #include <sys/wait.h> -#include <appcore-efl.h> /* external library header */ #include "xdgmime.h" -#include <contacts-svc.h> #include <assert.h> #include <glib.h> - #ifndef UG_MODULE_API #define UG_MODULE_API __attribute__ ((visibility("default"))) #endif - /* nfc_handover */ +/* nfc_handover */ #define NET_NFC_SHARE_SEPERATOR "?" #define NET_NFC_SHARE_REQUEST_TYPE_BUFFER "data_buffer" #define NET_NFC_SHARE_REQUEST_TYPE_PATH "file_path" -#define NFC_SETTING_KEY_NAME "db/nfc/enable" - #define DISPLAY_STRING_MAX_SIZE 90 #define ABBREVIATION_TEXT "..." void ug_nfc_share_create_base_view(void *user_data); void ug_nfc_share_create_nfc_share_view(void *user_data); bool ug_nfc_share_check_nfc_isAvailable(void *user_data); -void ug_nfc_share_create_data(struct ui_gadget *ug, bundle *bd, ugdata_t* ug_data); +static void ug_nfc_share_create_data(ugdata_t* ug_data); + +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; +} + +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); + } -static Evas_Object *_subwindow = NULL; + return result; +} + +void _get_image_path(const char *image, char *path, int len) +{ + const char *prefix = NULL; + + switch (_get_theme_type()) + { + /* TODO : will be improved */ + case 0 : + prefix = IMAGES_PATH"/white"; + break; + + default : + prefix = IMAGES_PATH"/black"; + break; + } + + if (image != NULL) + { + snprintf(path, len, "%s/%s", prefix, image); + } + else + { + snprintf(path, len, "%s", prefix); + } +} /******************* UI Functions *************/ -static Evas_Object *_create_button(Evas_Object *parent, void(*func)(void *data, Evas_Object *obj, void *event_info), const char *label, const char *swallow, const char *style, void *data) +static Evas_Object *_create_button(Evas_Object *parent, void (*func)(void *data, Evas_Object *obj, void *event_info), const char *label, const char *swallow, const char *style, void *data) { Evas_Object *button; @@ -86,7 +289,6 @@ static Evas_Object *_create_image(Evas_Object *parent, const char *file_path, co { Evas_Object *image; - retv_if(parent == NULL, NULL); retv_if(file_path == NULL, NULL); retv_if(swallow == NULL, NULL); @@ -99,7 +301,6 @@ static Evas_Object *_create_image(Evas_Object *parent, const char *file_path, co elm_image_resizable_set(image, 0, 0); elm_object_part_content_set(parent, swallow, image); - return image; } @@ -150,7 +351,6 @@ static Evas_Object *_create_layout(Evas_Object *parent, const char *clas, const { Evas_Object *ly; - retv_if(parent == NULL, NULL); ly = elm_layout_add(parent); @@ -161,7 +361,6 @@ static Evas_Object *_create_layout(Evas_Object *parent, const char *clas, const evas_object_show(ly); - return ly; } @@ -170,8 +369,6 @@ static Evas_Object *_create_bg(Evas_Object *win) Evas_Object *bg = elm_bg_add(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_win_resize_object_add(win, bg); evas_object_show(bg); @@ -205,7 +402,7 @@ static void _win_del(void *data, Evas_Object *obj, void *event_info) LOGD("[%s(): %d] END >>>>", __FUNCTION__, __LINE__); } -static Evas_Object* _create_win(Evas_Object * parent) +static Evas_Object* _create_win_for_popup(Evas_Object * parent) { Evas_Object *eo; int w, h; @@ -215,6 +412,7 @@ static Evas_Object* _create_win(Evas_Object * parent) { elm_win_title_set(eo, "NFCShareSubWindow"); elm_win_borderless_set(eo, EINA_TRUE); + elm_win_alpha_set(eo, EINA_TRUE); evas_object_smart_callback_add(eo, "delete,request", _win_del, NULL); ecore_x_window_size_get(ecore_x_window_root_first_get(), &w, &h); evas_object_resize(eo, w, h); @@ -224,300 +422,113 @@ static Evas_Object* _create_win(Evas_Object * parent) return eo; } -/* nfc_handover required to multi file name */ -static bool _get_display_text(ug_nfc_share_tag_type type, nfc_ndef_message_h ndef_msg, char *text) +static void _activation_completed_cb(nfc_error_e error, void *user_data) { - char *temp_text = NULL; + ugdata_t *ug_data = (ugdata_t *)user_data; LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__); - retv_if(ndef_msg == NULL, FALSE); - - if (type == UG_NFC_SHARE_TAG_HANDOVER) - { - char *file_name = NULL; - nfc_ndef_record_h record = NULL; - uint8_t *payload_buffer = NULL; - uint32_t payload_size = 0; - int result = 0; - int count = 0; - - - result = nfc_ndef_message_get_record_count(ndef_msg, &count); - if (result != NFC_ERROR_NONE) - { - LOGD("nfc_ndef_message_get_record_count failed[%d]", result); - goto error; - } - - LOGD("count = [%d]", count); - - //If count>2, we should implement for this case. - result = nfc_ndef_message_get_record(ndef_msg, 0, &record); - if (result != NFC_ERROR_NONE) - { - LOGD("nfc_ndef_message_get_record failed[%d]", result); - goto error; - } - - result = nfc_ndef_record_get_payload(record, &payload_buffer, &payload_size); - if (result != NFC_ERROR_NONE) - { - LOGD("nfc_ndef_record_get_payload failed[%d]\n", result); - goto error; - } - - if (payload_buffer != NULL && strlen(payload_buffer) > 0) - { - /* write file name into id */ - file_name = strrchr(payload_buffer, '/'); - if (file_name == NULL) - { - file_name = (char *)payload_buffer; - } - else - { - file_name++; - } - - UG_NFC_SHARE_MEM_STRDUP(temp_text, file_name); - } - } - else - { - LOGD("->>>>>>>>>>>>>>>>>>>. type is-- %d ",type); - temp_text = ug_nfc_share_get_display_text_from_ndef(type, ndef_msg); - } - - if (temp_text == NULL) - { - UG_NFC_SHARE_MEM_STRDUP(temp_text, IDS_UNKNOWN); - } - - ug_nfc_share_set_display_str(temp_text); - - char display_text[100]; - - memset(display_text, 0x00, sizeof(display_text)); - - if (strlen(temp_text) > DISPLAY_STRING_MAX_SIZE) - { - memcpy(display_text, temp_text, DISPLAY_STRING_MAX_SIZE); - memcpy(display_text+DISPLAY_STRING_MAX_SIZE, ABBREVIATION_TEXT, strlen(ABBREVIATION_TEXT)); - } - else - { - memcpy(display_text, temp_text, strlen(temp_text)); - } - - - snprintf(text, LABEL_TEXT_SIZE, IDS_PS_SELECTED, display_text); - - UG_NFC_SHARE_MEM_FREE(temp_text); + ret_if(ug_data == NULL); -error: - LOGD("[%s(): %d] END >>>>", __FUNCTION__, __LINE__); + /* create share view */ + ug_nfc_share_create_nfc_share_view(ug_data); - return TRUE; + LOGD("[%s(): %d] END <<<<", __FUNCTION__, __LINE__); } -static void _handover_popup_response_cb(void *data, Evas_Object *obj, void *event_info) +static void _setting_on_YesNo_popup_response_cb(void *data, Evas_Object *obj, void *event_info) { - LOGD("[%s(): %d] BEGIN>>>>", __FUNCTION__, __LINE__); - ugdata_t *ug_data = (ugdata_t *)data; - ret_if(ug_data == NULL); - - nfc_ndef_message_h msg = NULL; - nfc_ndef_record_h record = NULL; + int result = (int)event_info; - int result = (int) event_info; + LOGD("[%s(): %d] BEGIN>>>>", __FUNCTION__, __LINE__); - /* remove subwindow */ - if (_subwindow) - evas_object_del(_subwindow); + ret_if(ug_data == NULL); switch (result) { - case UG_NFC_POPUP_RESP_OK: - { - char temp_data[1024] = { 0, }; - - LOGD("ELM_POPUP_RESPONSE_OK"); - - snprintf(temp_data, sizeof(temp_data), "%s", ug_data->uri); - LOGD("new uri : %s\n", temp_data); - - /* create record */ - result = nfc_ndef_record_create_mime(&record, "file", temp_data, strlen(temp_data)); - if (result != NFC_ERROR_NONE) - { - LOGD("nfc_ndef_record_create failed (%d)\n", result); - return; - } - - /* create ndef msg*/ - result = nfc_ndef_message_create(&msg); - if (result != NFC_ERROR_NONE) - { - LOGD("nfc_ndef_message_create failed (%d)\n", result); - return; - } + case UG_NFC_POPUP_RESP_OK : + /* setting is on */ + LOGD("setting is on >>>>", __FUNCTION__, __LINE__); - /* append record to ndef msg */ - result = nfc_ndef_message_append_record(msg, record); - if (result != NFC_ERROR_NONE) - { - LOGD("nfc_ndef_message_create failed (%d)\n", result); - return; - } - } + nfc_manager_set_activation(TRUE, _activation_completed_cb, ug_data); break; - case UG_NFC_POPUP_RESP_CANCEL: - { - LOGD("ELM_POPUP_RESPONSE_CANCEL"); - -#if 0 - /* destroy UG */ - LOGD("ug_destroy_me >>>>", __FUNCTION__, __LINE__); - ug_destroy_me(ug_data->nfc_share_ug); -#endif - result = ug_nfc_share_make_ndef_message_from_file(&msg, ug_data->uri); - if (result != UG_NFC_SHARE_OK) - { - LOGD("nfc_app_make_ndef_message_from_file failed (%d)\n", result); - return; - } - - /* change type : UG_NFC_SHARE_TAG_HANDOVER -> UG_NFC_SHARE_TAG_FILE */ - ug_nfc_share_set_tag_type(UG_NFC_SHARE_TAG_FILE); - - if (ug_data->uri != NULL) - { - UG_NFC_SHARE_MEM_FREE(ug_data->uri); - ug_data->uri = NULL; - } - } + case UG_NFC_POPUP_RESP_CANCEL : + /* destroy UG */ + LOGD("ug_destroy_me >>>>", __FUNCTION__, __LINE__); + ug_destroy_me(ug_data->nfc_share_ug); break; - default: - return; - } - if (!ug_nfc_share_set_current_ndef(ug_data, msg)) - { - LOGD("ug_nfc_share_set_current_ndef success\n"); - } - else - { - LOGD("ug_nfc_share_set_current_ndef failed (%d)\n", result); - return; + default : + break; } - ug_nfc_share_create_nfc_share_view(ug_data); - LOGD("[%s(): %d] END>>>>", __FUNCTION__, __LINE__); } - -static void _show_handover_popup(void *data) +static void _setting_on_YesNo_popup(void *data) { - LOGD("[%s(): %d] BEGIN>>>>", __FUNCTION__, __LINE__); - ugdata_t *ug_data = (ugdata_t *)data; - ret_if(ug_data == NULL); + char popup_str[POPUP_TEXT_SIZE] = { 0, }; - char popup_str[POPUP_TEXT_SIZE] = {0,}; - - _subwindow = _create_win(ug_data->ug_win_main); - ret_if(_subwindow == NULL); + LOGD("[%s(): %d] BEGIN>>>>", __FUNCTION__, __LINE__); - memcpy(popup_str, IDS_UNABLE_TO_SHARE_FILES_MAXIMUM_FILE_SIZE_EXCEEDED_SHARE_FILES_VIA_BLUETOOTH_PAIRED_DEVICES_MAY_BE_DISCONNECTED_CONTINUE_Q, \ - strlen(IDS_UNABLE_TO_SHARE_FILES_MAXIMUM_FILE_SIZE_EXCEEDED_SHARE_FILES_VIA_BLUETOOTH_PAIRED_DEVICES_MAY_BE_DISCONNECTED_CONTINUE_Q)); + ret_if(ug_data == NULL); - ug_nfc_share_create_popup(ug_data, _subwindow, popup_str, IDS_YES, UG_NFC_POPUP_RESP_OK, IDS_NO, UG_NFC_POPUP_RESP_CANCEL, NULL, 0, false, false, _handover_popup_response_cb); + memcpy(popup_str, IDS_SERVICE_NOT_AVAILABLE_NFC_TURNED_OFF_TURN_ON_NFC_Q, strlen(IDS_SERVICE_NOT_AVAILABLE_NFC_TURNED_OFF_TURN_ON_NFC_Q)); - evas_object_show(_subwindow); + ug_nfc_share_create_popup(ug_data, ug_data->base_layout, popup_str, IDS_YES, UG_NFC_POPUP_RESP_OK, IDS_NO, UG_NFC_POPUP_RESP_CANCEL, NULL, 0, false, false, _setting_on_YesNo_popup_response_cb); LOGD("[%s(): %d] END>>>>", __FUNCTION__, __LINE__); } -static void _setting_on_YesNo_popup_response_cb(void *data, Evas_Object *obj, void *event_info) +static void _app_error_popup_response_cb(void *data, Evas_Object *obj, void *event_info) { - LOGD("[%s(): %d] BEGIN>>>>", __FUNCTION__, __LINE__); - ugdata_t *ug_data = (ugdata_t *)data; - ret_if(ug_data == NULL); + int result = (int)event_info; - int result = (int) event_info; + LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__); - /* remove subwindow */ - if (_subwindow) - evas_object_del(_subwindow); + if (ug_data == NULL) + return; switch (result) { - case UG_NFC_POPUP_RESP_OK: - /* setting is on */ - LOGD("setting is on >>>>", __FUNCTION__, __LINE__); - nfc_manager_set_activation(TRUE, NULL,NULL); - - /* check if handover is needed */ - if (ug_nfc_share_get_tag_type() == UG_NFC_SHARE_TAG_HANDOVER) { - _show_handover_popup(ug_data); - return; - } - - /* create share view */ - ug_nfc_share_create_nfc_share_view(ug_data); - - break; - - case UG_NFC_POPUP_RESP_CANCEL: - /* destroy UG */ - LOGD("ug_destroy_me >>>>", __FUNCTION__, __LINE__); - ug_destroy_me(ug_data->nfc_share_ug); - - break; + case UG_NFC_POPUP_RESP_CLOSE : + /* destroy UG */ + LOGD("ug_destroy_me >>>>", __FUNCTION__, __LINE__); + ug_destroy_me(ug_data->nfc_share_ug); + break; - default: - break; + default : + break; } - LOGD("[%s(): %d] END>>>>", __FUNCTION__, __LINE__); + LOGD("[%s(): %d] END <<<<", __FUNCTION__, __LINE__); } -static void _setting_on_YesNo_popup(void *data) +static void _show_app_error_popup(void *data) { - LOGD("[%s(): %d] BEGIN>>>>", __FUNCTION__, __LINE__); - ugdata_t *ug_data = (ugdata_t *)data; - ret_if(ug_data == NULL); - - char popup_str[POPUP_TEXT_SIZE] = {0,}; + char popup_str[POPUP_TEXT_SIZE] = { 0, }; - _subwindow = _create_win(ug_data->ug_win_main); - ret_if(_subwindow == NULL); + LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__); - memcpy(popup_str, IDS_SERVICE_NOT_AVAILABLE_NFC_TURNED_OFF_TURN_ON_NFC_Q, strlen(IDS_SERVICE_NOT_AVAILABLE_NFC_TURNED_OFF_TURN_ON_NFC_Q)); + if (ug_data == NULL) + return; - ug_nfc_share_create_popup(ug_data, _subwindow, popup_str, IDS_YES, UG_NFC_POPUP_RESP_OK, IDS_NO, UG_NFC_POPUP_RESP_CANCEL, NULL, 0, false, false, _setting_on_YesNo_popup_response_cb); + memcpy(popup_str, IDS_NFC_SERVICE_IS_NOT_SUPPORTED, strlen(IDS_NFC_SERVICE_IS_NOT_SUPPORTED)); - evas_object_show(_subwindow); + ug_nfc_share_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__); + LOGD("[%s(): %d] END <<<<", __FUNCTION__, __LINE__); } static void _back_clicked_cb(void *data, Evas_Object *obj, void *event_info) { LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__); - /* nfc deactivate */ - if(nfc_manager_deinitialize () != NFC_ERROR_NONE) - { - LOGD("nfc_manager_deinitialize failed", __FUNCTION__, __LINE__); - } - /* destroy UG */ ug_destroy_me(data); @@ -526,103 +537,57 @@ static void _back_clicked_cb(void *data, Evas_Object *obj, void *event_info) static Evas_Object *ug_nfc_share_create_layout(void *data) { - LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__); - ugdata_t* ug_data = (ugdata_t*)data; - Evas_Object *layout_base = NULL; Evas_Object *layout = NULL; - Evas_Object *scroller = NULL; - Evas_Object *box_base = NULL; + Evas_Object *cancel_btn = NULL; nfc_ndef_message_h msg = NULL; ug_nfc_share_tag_type type = UG_NFC_SHARE_TAG_MAX; - char label_string[LABEL_TEXT_SIZE] = {0,}; - char *file_path = NULL; + LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__); /* create base layout */ - layout_base = elm_layout_add(ug_data->base_naviframe); - retv_if(layout_base == NULL, NULL); - elm_layout_theme_set(layout_base, "layout", "application", "noindicator"); - evas_object_size_hint_weight_set(layout_base, EVAS_HINT_EXPAND, 0.0); - evas_object_size_hint_align_set(layout_base, EVAS_HINT_FILL, 0.0); - evas_object_show(layout_base); - retv_if(layout_base == NULL, NULL); - - - /* Add scroller */ - scroller = _create_scroller(layout_base); - retv_if(scroller == NULL, NULL); - - - /* Add box_base */ - box_base = _create_box(layout_base, FALSE); - retv_if(box_base == NULL, NULL); - - - /* create layout for edc */ - layout = elm_layout_add(layout_base); + layout = elm_layout_add(ug_data->base_naviframe); + retv_if(layout == NULL, NULL); elm_layout_file_set(layout, EDJ_FILE, "share_via_nfc"); 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); evas_object_show(layout); - /* get data */ msg = ug_nfc_share_get_current_ndef(ug_data); type = ug_nfc_share_get_tag_type(); + char path[1024] = { 0, }; + Evas_Object *label = NULL; - /* create label name */ - if(!_get_display_text(type, msg, label_string)) - { - return NULL; - } - - Evas_Object *label_name = NULL; - label_name = _create_label(layout, label_string, "label_name", NULL); - retv_if(label_name == NULL, NULL); - elm_label_line_wrap_set(label_name, ELM_WRAP_WORD); - evas_object_show(label_name); - - - /* create message label */ - Evas_Object *label_message = NULL; - label_message = _create_label(layout, IDS_GENTLY_TOUCH_PHONES_TOGETHER_TO_SHARE, "label_message", NULL); - retv_if(label_message == NULL, NULL); - elm_label_line_wrap_set(label_message, ELM_WRAP_WORD); - evas_object_show(label_message); - - - file_path = IMAGES_PATH"/U05_AfterSelect_Share_help.png"; - + _get_label_text(UG_FONT_HELP, IDS_GENTLY_TOUCH_PHONES_TOGETHER_TO_SHARE, UG_ALIGN_LEFT, path, sizeof(path)); + label = elm_label_add(layout); + elm_object_part_content_set(layout, "label_name", label); + elm_label_line_wrap_set(label, ELM_WRAP_WORD); + elm_object_text_set(label, path); /* create image */ Evas_Object *image = NULL; - image = _create_image(layout, file_path, "touch_image", ug_data); + _get_image_path("U05_AfterSelect_Share_help.png", path, sizeof(path)); + image = _create_image(layout, path, "touch_image", ug_data); retv_if(image == NULL, NULL); evas_object_show(image); - - /* create cancel message label */ - Evas_Object *label_cancel_message = NULL; - label_cancel_message = _create_label(layout, IDS_TO_CANCEL_SHARING_TAP_CANCEL, "label_cancel_message", NULL); - retv_if(label_cancel_message == NULL, NULL); - elm_label_line_wrap_set(label_cancel_message, ELM_WRAP_WORD); - evas_object_show(label_cancel_message); - +#if 0 + _get_label_text(UG_FONT_HELP, IDS_TO_CANCEL_SHARING_TAP_CANCEL, UG_ALIGN_LEFT, path, sizeof(path)); + label = elm_label_add(layout); + elm_object_part_content_set(layout, "label_cancel_message", label); + elm_label_line_wrap_set(label, ELM_WRAP_WORD); + elm_object_text_set(label, path); +#endif /* create cancel button */ - Evas_Object *cancel_button = NULL; - cancel_button = _create_button(layout, _back_clicked_cb, IDS_CANCEL, "cancel_button", "style1", ug_data->nfc_share_ug); - retv_if(cancel_button == NULL, NULL); - evas_object_show(cancel_button); - - /* push layout to box and add scroller to box */ - elm_box_pack_end(box_base, layout); - elm_object_content_set(scroller, box_base); + cancel_btn = _create_button(layout, _back_clicked_cb, IDS_CANCEL, "cancel_button", "style1", ug_data->nfc_share_ug); + retv_if(cancel_btn == NULL, NULL); + evas_object_show(cancel_btn); - if(NFC_ERROR_NONE == nfc_manager_initialize(NULL,NULL)) + if (NFC_ERROR_NONE == nfc_manager_initialize(NULL, NULL)) { LOGD("nfc_manager_initialize success\n"); ug_nfc_set_nfc_callback(ug_data); @@ -632,7 +597,7 @@ static Evas_Object *ug_nfc_share_create_layout(void *data) LOGD("nfc_manager_initialize FAIL!!!!\n"); } - return layout_base; + return layout; } /******************* UI Functions ENDZZZ*************/ @@ -647,11 +612,11 @@ static char *_get_file_path_from_uri(char *uri) { path = uri + 7; } - else if(strlen(uri) > 6 && strncmp(uri, "file:/", 6) == 0) + else if (strlen(uri) > 6 && strncmp(uri, "file:/", 6) == 0) { path = uri + 5; } - else if(uri[0] == '/') + else if (uri[0] == '/') { path = uri; } @@ -662,84 +627,75 @@ static char *_get_file_path_from_uri(char *uri) void ug_nfc_share_create_base_view(void *user_data) { - LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__); - ugdata_t* ug_data = (ugdata_t*)user_data; + LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__); + /* create base layout */ ug_data->base_layout = _create_main_layout(ug_data->ug_win_main); - ug_data->bg = _create_bg(ug_data->base_layout); + ug_data->bg = _create_bg(ug_data->ug_win_main); elm_object_part_content_set(ug_data->base_layout, "elm.swallow.bg", ug_data->bg); evas_object_show(ug_data->base_layout); LOGD("[%s(): %d] END >>>>", __FUNCTION__, __LINE__); - } void ug_nfc_share_create_nfc_share_view(void *user_data) { - LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__); - ugdata_t* ug_data = (ugdata_t*)user_data; Evas_Object* nfc_share_layout = NULL; Evas_Object* l_button = NULL; + LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__); + ug_data->base_naviframe = elm_naviframe_add(ug_data->base_layout); elm_object_part_content_set(ug_data->base_layout, "elm.swallow.content", ug_data->base_naviframe); - - evas_object_show(ug_data->base_layout); evas_object_show(ug_data->base_naviframe); + /* create data */ + ug_nfc_share_create_data(ug_data); + /* create share layout */ nfc_share_layout = ug_nfc_share_create_layout(ug_data); - if(nfc_share_layout == NULL) { + if (nfc_share_layout == NULL) + { LOGD("nfc_share_layout is NULL\n"); return; } - /* push naviframe */ - l_button = elm_button_add(ug_data->base_naviframe); - evas_object_smart_callback_add(l_button, "clicked", _back_clicked_cb, ug_data->nfc_share_ug); - ug_data->base_navi_it = elm_naviframe_item_push(ug_data->base_naviframe, IDS_SHARE_VIA_NFC, l_button, NULL, nfc_share_layout, "1line"); - elm_object_style_set(l_button, "naviframe/back_btn/default"); + ug_data->base_navi_it = elm_naviframe_item_push(ug_data->base_naviframe, IDS_SHARE_VIA_NFC, NULL, NULL, nfc_share_layout, "1line"); + elm_object_item_signal_emit(ug_data->base_navi_it, "elm,state,controlbar,close", ""); LOGD("[%s(): %d] END >>>>", __FUNCTION__, __LINE__); - } bool ug_nfc_share_check_nfc_isAvailable(void *user_data) { - LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__); - ugdata_t *ug_data = (ugdata_t *)user_data; - ret_if(ug_data == NULL); - int result = EINA_FALSE; int on; - /* check if nfc is on */ - result = vconf_get_bool(NFC_SETTING_KEY_NAME, &on); + LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__); + + retv_if(ug_data == NULL, FALSE); - if (!on) { + /* check if nfc is on */ + result = vconf_get_bool(VCONFKEY_NFC_STATE, &on); + if (!on) + { /* show nfc on/off popup */ _setting_on_YesNo_popup(ug_data); return FALSE; } - /* check if handover is needed */ - if (ug_nfc_share_get_tag_type() == UG_NFC_SHARE_TAG_HANDOVER) { - _show_handover_popup(ug_data); - return FALSE; - } - LOGD("[%s(): %d] END >>>>", __FUNCTION__, __LINE__); return TRUE; } - /* nfc_handover */ -static int ug_get_share_data_list( char *bundle_txt, char *datalist[], int number_of_files) +/* nfc_handover */ +static int ug_get_share_data_list(char *bundle_txt, char *datalist[], int number_of_files) { char *token = NULL; char *param = NULL; @@ -768,28 +724,26 @@ static int ug_get_share_data_list( char *bundle_txt, char *datalist[], int numbe return 0; } -void ug_nfc_share_create_data(struct ui_gadget *ug, bundle *bd, ugdata_t* ug_data) +static void ug_nfc_share_create_data(ugdata_t* ug_data) { + bundle *bd = ug_data->bd; + int type; LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__); - char *key[] = {"count","request_type","request_data"}; - - char *count = (char *)bundle_get_val(bd,key[0]); - char *request_type = (char *)bundle_get_val(bd,key[1]); - char *request_data = (char *)bundle_get_val(bd,key[2]); - char *extra = NULL; + char *key[] = { "count", "request_type", "request_data" }; + char *count = (char *)bundle_get_val(bd, key[0]); + char *request_data = (char *)bundle_get_val(bd, key[2]); int number_of_data = 0; - char *request_data_temp = NULL; int result = UG_NFC_SHARE_ERROR; nfc_ndef_message_h msg = NULL; - + type = ug_nfc_share_get_tag_type(); number_of_data = atoi(count); - LOGD("count : %s, request_type : %s, request_data : %s request_data strlen %d\n", GET_SAFE_STRING(count), GET_SAFE_STRING(request_type), GET_SAFE_STRING(request_data), strlen(request_data)); + LOGD("count : %s, request_data : %s request_data strlen %d\n", GET_SAFE_STRING(count), GET_SAFE_STRING(request_data), strlen(request_data)); if (request_data == NULL || strlen(request_data) == 0 || number_of_data < 1) { @@ -798,186 +752,375 @@ void ug_nfc_share_create_data(struct ui_gadget *ug, bundle *bd, ugdata_t* ug_dat return; } - request_data_temp = malloc (strlen (request_data) + 1); - memset(request_data_temp,0x00,strlen(request_data)+1); - memcpy(request_data_temp,request_data,strlen(request_data)); - request_data_temp[strlen(request_data)] = '\0'; - - /* process data and store specific space for sharing data */ - if (strncmp(request_type, NET_NFC_SHARE_REQUEST_TYPE_PATH, strlen(NET_NFC_SHARE_REQUEST_TYPE_PATH)) == 0) + switch (type) { - struct stat st; - char *path = NULL; - char *pathlist[number_of_data]; - int sum_filesize = 0; - int i = 0; - + case UG_NFC_SHARE_TAG_FILE : + { + char *pathlist[number_of_data]; + char *request_data_temp = NULL; - LOGD("data is file\n"); + LOGD("file path for NFC P2P : request_data [%s]\n", request_data); - ug_get_share_data_list(request_data_temp, pathlist , number_of_data); + UG_NFC_SHARE_MEM_STRDUP(request_data_temp, request_data); - while (i< number_of_data) - { - path = _get_file_path_from_uri(pathlist[i]); - stat(path, &st); - sum_filesize += st.st_size; - LOGD("ug_nfc_share_create_data #[%d] filename(%s) size = (%d) sum_filesize = (%d) \n", i, path, st.st_size, sum_filesize); - i++ ; - } + ug_get_share_data_list(request_data_temp, pathlist, number_of_data); - if (sum_filesize < UG_NFC_SHARE_HANDOVER_FILE_SIZE) - { - LOGD("file path for NFC P2P : request_data [%s]\n", request_data); - /* nfc_handover required to seperator depends on AC later*/ + /* nfc_handover required to seperator depends on AC later*/ result = ug_nfc_share_make_ndef_message_from_multi_file(&msg, (const char **)pathlist, number_of_data); if (result != UG_NFC_SHARE_OK) { LOGD("ug_nfc_share_make_ndef_message_from_file failed (%d)\n", result); - return ; } - ug_nfc_share_set_tag_type(UG_NFC_SHARE_TAG_FILE); + UG_NFC_SHARE_MEM_FREE(request_data_temp); } - else + break; + + case UG_NFC_SHARE_TAG_HANDOVER : { + nfc_ndef_record_h record = NULL; + LOGD("file path for AC : [%s]\n", request_data); - if (ug_data->uri != NULL) + /* create record */ + result = nfc_ndef_record_create_mime(&record, "file", (uint8_t *)request_data, strlen(request_data)); + if (result != NFC_ERROR_NONE) { - UG_NFC_SHARE_MEM_FREE(ug_data->uri); - ug_data->uri = NULL; + LOGD("nfc_ndef_record_create failed (%d)\n", result); + return; } - if (number_of_data > 1) + /* create ndef msg*/ + result = nfc_ndef_message_create(&msg); + if (result != NFC_ERROR_NONE) { - UG_NFC_SHARE_MEM_STRDUP(ug_data->uri, request_data); + LOGD("nfc_ndef_message_create failed (%d)\n", result); + nfc_ndef_record_destroy(record); + return; } - else + + /* append record to ndef msg */ + result = nfc_ndef_message_append_record(msg, record); + if (result != NFC_ERROR_NONE) + { + LOGD("nfc_ndef_message_create failed (%d)\n", result); + nfc_ndef_message_destroy(msg); + nfc_ndef_record_destroy(record); + return; + } + } + break; + + case UG_NFC_SHARE_TAG_URL : + { + /* nfc_handover now no user case of multi recored for buffered string*/ + nfc_ndef_record_h record = NULL; + + /* make memo NDEF message */ + LOGD("data is string\n"); + + result = nfc_ndef_record_create_uri(&record, request_data); + if (result != NFC_ERROR_NONE) + { + LOGD("nfc_ndef_record_create failed (%d)\n", result); + return; + } + + /* create ndef msg*/ + result = nfc_ndef_message_create(&msg); + if (result != NFC_ERROR_NONE) + { + LOGD("nfc_ndef_message_create failed (%d)\n", result); + nfc_ndef_record_destroy(record); + return; + } + + /* append record to ndef msg */ + result = nfc_ndef_message_append_record(msg, record); + if (result != NFC_ERROR_NONE) + { + LOGD("nfc_ndef_message_create failed (%d)\n", result); + nfc_ndef_message_destroy(msg); + nfc_ndef_record_destroy(record); + return; + } + } + break; + + case UG_NFC_SHARE_TAG_MEMO : + { + /* nfc_handover now no user case of multi recored for buffered string*/ + nfc_ndef_record_h record = NULL; + + /* make memo NDEF message */ + LOGD("UG_NFC_SHARE_TAG_MEMO\n"); + + result = nfc_ndef_record_create_text(&record, request_data, "en-US", NFC_ENCODE_UTF_8); + if (result != NFC_ERROR_NONE) + { + LOGD("nfc_ndef_record_create failed (%d)\n", result); + return; + } + + /* create ndef msg*/ + result = nfc_ndef_message_create(&msg); + if (result != NFC_ERROR_NONE) { - UG_NFC_SHARE_MEM_STRDUP(ug_data->uri, path); + LOGD("nfc_ndef_message_create failed (%d)\n", result); + nfc_ndef_record_destroy(record); + return; } - ug_nfc_share_set_tag_type(UG_NFC_SHARE_TAG_HANDOVER); + /* append record to ndef msg */ + result = nfc_ndef_message_append_record(msg, record); + if (result != NFC_ERROR_NONE) + { + LOGD("nfc_ndef_message_create failed (%d)\n", result); + nfc_ndef_message_destroy(msg); + nfc_ndef_record_destroy(record); + return; + } } + break; + + default : + break; } - else if (strncmp(request_type, NET_NFC_SHARE_REQUEST_TYPE_BUFFER, strlen(NET_NFC_SHARE_REQUEST_TYPE_BUFFER)) == 0) + + result = ug_nfc_share_set_current_ndef(ug_data, msg); + if (result != UG_NFC_SHARE_OK) + { + LOGD("ug_nfc_share_set_current_ndef failed (%d)\n", result); + } + + LOGD("[%s(): %d] END >>>>", __FUNCTION__, __LINE__); +} + +static void ug_nfc_share_set_tag_type_from_bundle(bundle *bd) +{ + int count = 0; + + char *temp_count = (char *)bundle_get_val(bd, "count"); + char *request_type = (char *)bundle_get_val(bd, "request_type"); + char *request_data = (char *)bundle_get_val(bd, "request_data"); + + LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__); + + count = atoi(temp_count); + + LOGD("count : %d, request_type : %s, request_data : %s request_data strlen %d\n", count, + GET_SAFE_STRING(request_type), GET_SAFE_STRING(request_data), strlen(request_data)); + + if (request_data == NULL || strlen(request_data) == 0 || count < 1) + { + LOGD("request_data IS NULL\n"); + /* exit */ + return; + } + + /* process data and store specific space for sharing data */ + if (strncmp(request_type, NET_NFC_SHARE_REQUEST_TYPE_PATH, strlen(NET_NFC_SHARE_REQUEST_TYPE_PATH)) == 0) { - /* nfc_handover now no user case of multi recored for buffered string*/ - nfc_ndef_record_h record = NULL; - /* make memo NDEF message */ - LOGD("data is string\n"); - request_data[(strlen (request_data) -1)] = '\0'; /* nfc_handover todo, this may be memory issue of MEMO app */ + struct stat st; + size_t sum_filesize = 0; + char *temp_data = NULL; + char *token = NULL; - result = nfc_ndef_message_create(&msg); - if(result != NFC_ERROR_NONE) + LOGD("data is file(s)\n"); + + UG_NFC_SHARE_MEM_STRDUP(temp_data, request_data); + if (temp_data != NULL) { - LOGD("nfc_ndef_message_create failed\n"); + /* get files size */ + token = strtok(temp_data, NET_NFC_SHARE_SEPERATOR); + for (; token != NULL; token = strtok(NULL, NET_NFC_SHARE_SEPERATOR)) + { + LOGD("token [%s]\n", token); + if (stat(token, &st) == 0) + { + sum_filesize += st.st_size; + } + else + { + LOGE("file not found : %s", token); + } + } + + /* set share type */ + if (sum_filesize < UG_NFC_SHARE_HANDOVER_FILE_SIZE) + { + LOGD("file path for NFC P2P : request_data [%s]\n", request_data); + + ug_nfc_share_set_tag_type(UG_NFC_SHARE_TAG_FILE); + } + else + { + LOGD("file path for Handover : [%s]\n", request_data); + + ug_nfc_share_set_tag_type(UG_NFC_SHARE_TAG_HANDOVER); + } - return ; + UG_NFC_SHARE_MEM_FREE(temp_data); } - if( (strncmp(request_data, "http://", strlen("http://")) == 0) ||(strncmp(request_data, "https://", strlen("https://")) == 0)) + else + { + LOGE("alloc failed"); + } + } + else if (strncmp(request_type, NET_NFC_SHARE_REQUEST_TYPE_BUFFER, strlen(NET_NFC_SHARE_REQUEST_TYPE_BUFFER)) == 0) + { + if ((strncmp(request_data, "http://", strlen("http://")) == 0) || (strncmp(request_data, "https://", strlen("https://")) == 0)) { LOGD("data is URI\n"); - result = nfc_ndef_record_create_uri(&record, request_data); ug_nfc_share_set_tag_type(UG_NFC_SHARE_TAG_URL); } else { LOGD("data is MEMO\n"); - result = nfc_ndef_record_create_text(&record,request_data, "en-US" ,NFC_ENCODE_UTF_8); ug_nfc_share_set_tag_type(UG_NFC_SHARE_TAG_MEMO); } - - result = nfc_ndef_message_append_record(msg, record); - } - result = ug_nfc_share_set_current_ndef(ug_data, msg); - if (result != UG_NFC_SHARE_OK) - { - LOGD("ug_nfc_share_set_current_ndef failed (%d)\n", result); - return ; + LOGD("[%s(): %d] END >>>>", __FUNCTION__, __LINE__); +} - } +static void *__ug_nfc_share_create(ui_gadget_h ug, enum ug_mode mode, service_h service, void *priv) +{ + ugdata_t *ug_data = (ugdata_t *)priv; + int display_mode = -1; + LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__); + + /* set text domain */ + bindtextdomain(NFCUG_TEXT_DOMAIN, NFCUG_LOCALEDIR); /* set UG data */ ug_data->ug_win_main = ug_get_parent_layout(ug); ug_data->nfc_share_ug = ug; +#if 0 + if (SERVICE_ERROR_NONE != service_export_as_bundle(service, &ug_data->bd)) + return NULL; +#else + bundle *bd = NULL; + char *temp_count = NULL; + char *request_type = NULL; + char *request_data = NULL; + char *mime_type = NULL; + + bd = bundle_create(); + if (bd == NULL) + return NULL; - LOGD("[%s(): %d] END >>>>", __FUNCTION__, __LINE__); -} + service_get_extra_data(service, "count", &temp_count); + service_get_extra_data(service, "request_type", &request_type); + service_get_extra_data(service, "request_data", &request_data); + service_get_extra_data(service, "mime_type", &mime_type); + bundle_add(bd, "count", temp_count); + bundle_add(bd, "request_type", request_type); + bundle_add(bd, "request_data", request_data); + bundle_add(bd, "mime_type", mime_type); + ug_data->bd = bd; +#endif -static void *__ug_nfc_share_create(struct ui_gadget *ug, enum ug_mode mode, bundle *bd, void *user_data) -{ - LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__); - ugdata_t* ug_data = (ugdata_t*)user_data; + /* set rotate as portrait */ + display_mode = elm_win_rotation_get(ug_data->ug_win_main); - /* set text domain */ - bindtextdomain(NFCUG_TEXT_DOMAIN, NFCUG_LOCALEDIR); + LOGD("display_mode[%d]", display_mode); - /* parsing pameter to make nfc data */ - ug_nfc_share_create_data(ug, bd, ug_data); + if ((display_mode == 90) || (display_mode == 270)) + elm_win_rotation_with_resize_set(ug_data->ug_win_main, 0); + + /* parse pameter, and them set request type */ + ug_nfc_share_set_tag_type_from_bundle(ug_data->bd); /* create base layout */ ug_nfc_share_create_base_view(ug_data); - /* check whether nfc is available */ - if (ug_nfc_share_check_nfc_isAvailable(ug_data)) { - LOGD("Normal NFC", __FUNCTION__, __LINE__); - - /* create share view */ - ug_nfc_share_create_nfc_share_view(ug_data); - } + /* create share view */ + ug_nfc_share_create_nfc_share_view(ug_data); LOGD("[%s(): %d] END >>>>", __FUNCTION__, __LINE__); return ug_data->base_layout; } -static void __ug_nfc_share_destroy(struct ui_gadget *ug, bundle *bd, void *user_data) +static void __ug_nfc_share_destroy(ui_gadget_h ug, service_h service, void *priv) { - LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__); + ugdata_t *ug_data = (ugdata_t *)priv; - ugdata_t *ug_data = (ugdata_t *)user_data; + LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__); if (ug_data == NULL) return; + /* unset callback */ + ug_nfc_unset_nfc_callback(); + + /* nfc deactivate */ + if (nfc_manager_deinitialize() != NFC_ERROR_NONE) + { + LOGD("nfc_manager_deinitialize failed", __FUNCTION__, __LINE__); + } + + if (ug_data->bd != NULL) + { + bundle_free(ug_data->bd); + ug_data->bd = NULL; + } + evas_object_del(ug_get_layout(ug)); LOGD("[%s(): %d] END >>>>", __FUNCTION__, __LINE__); } -static void __ug_nfc_share_start(struct ui_gadget *ug, bundle *bd, void *user_data) +static void __ug_nfc_share_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); + return; + } + + ug_nfc_share_check_nfc_isAvailable(ug_data); + + LOGD("[%s(): %d] END >>>>", __FUNCTION__, __LINE__); } -static void __ug_nfc_share_pause(struct ui_gadget *ug, bundle *bd, void *user_data) +static void __ug_nfc_share_pause(ui_gadget_h ug, service_h service, void *priv) { + LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__); } -static void __ug_nfc_share_resume(struct ui_gadget *ug, bundle *bd, void *user_data) +static void __ug_nfc_share_resume(ui_gadget_h ug, service_h service, void *priv) { + LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__); } -static void __ug_nfc_share_message(struct ui_gadget *ug, bundle *msg, bundle *bd, void *user_data) +static void __ug_nfc_share_message(ui_gadget_h ug, service_h msg, service_h service, void *priv) { + LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__); } -static void __ug_nfc_share_event(struct ui_gadget *ug, enum ug_event event, bundle *bd, void *user_data) +static void __ug_nfc_share_event(ui_gadget_h ug, enum ug_event event, service_h service, void *priv) { + LOGD("[%s(): %d] BEGIN >>>>", __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; @@ -1002,7 +1145,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; @@ -1014,4 +1157,3 @@ UG_MODULE_API void UG_MODULE_EXIT(struct ug_module_ops *ops) ops->priv = NULL; } - diff --git a/ug-nfc-share-efl/src/ug-nfc-share-popup.c b/ug-nfc-share-efl/src/ug-nfc-share-popup.c index 6c654f4..9090732 100644 --- a/ug-nfc-share-efl/src/ug-nfc-share-popup.c +++ b/ug-nfc-share-efl/src/ug-nfc-share-popup.c @@ -14,6 +14,7 @@ * limitations under the License. */ + #include "ug-nfc-share-popup.h" @@ -30,11 +31,10 @@ static void _ug_nfc_share_popup_response_cb(void *data, Evas_Object *obj, void * 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); - if (_user_response_cb) - _user_response_cb(_user_data, obj, (void*)btn_type); - LOGD("Popup is removed: [%p]", obj); evas_object_del(_popup); @@ -42,6 +42,9 @@ static void _ug_nfc_share_popup_response_cb(void *data, Evas_Object *obj, void * _user_response_cb = NULL; _user_data = NULL; + if (temp_cb) + temp_cb(temp_data, obj, (void*)btn_type); + LOGD("[%s(): %d] END>>>>", __FUNCTION__, __LINE__); } @@ -98,18 +101,21 @@ Evas_Object *ug_nfc_share_create_popup(void *data, 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_share_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_share_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_share_popup_response_cb, (void*)btn3_type); diff --git a/ug-nfc-share-efl/src/ug-nfc-share-tag.c b/ug-nfc-share-efl/src/ug-nfc-share-tag.c index b6265f8..a44ddf2 100644 --- a/ug-nfc-share-efl/src/ug-nfc-share-tag.c +++ b/ug-nfc-share-efl/src/ug-nfc-share-tag.c @@ -14,6 +14,7 @@ * limitations under the License. */ + #include "ug-nfc-share-tag.h" #include "ug-nfc-share-popup.h" @@ -25,11 +26,10 @@ #include <vconf.h> #include <sys/types.h> #include <sys/wait.h> -#include <appcore-efl.h> /* external library header */ #include "xdgmime.h" -#include <contacts-svc.h> +#include "syspopup_caller.h" #define NFC_POPUP_TIMEOUT 3.0 @@ -42,89 +42,58 @@ int _bt_ipc_send_obex_message(uint8_t *address, const uint8_t *files, uint32_t l /*-----------------------------------------------------------------------------------------------*/ -static void _failure_popup_response_cb(void *data, Evas_Object *obj, void *event_info) -{ - LOGD("[%s(): %d] BEGIN>>>>", __FUNCTION__, __LINE__); - - int result = (int) event_info; - - // to do : action will be determined - LOGD("[%s(): %d] END>>>>", __FUNCTION__, __LINE__); -} - static void _show_failure_popup(void *data, char *str) { - LOGD("[%s(): %d] BEGIN>>>>", __FUNCTION__, __LINE__); + ugdata_t *ug_data = (ugdata_t *)data; - char popup_str[POPUP_TEXT_SIZE] = { 0, }; + LOGD("[%s(): %d] BEGIN>>>>", __FUNCTION__, __LINE__); - ugdata_t* ug_data = (ugdata_t*)data; ret_if(ug_data == NULL); + ret_if(str == NULL); - ug_nfc_share_create_popup(ug_data, ug_data->base_layout, popup_str, NULL, 0, NULL, 0, NULL, 0, true, false, _failure_popup_response_cb); - - LOGD("[%s(): %d] END>>>>", __FUNCTION__, __LINE__); -} + bundle *bd = NULL; -static void _success_popup_response_cb(void *data, Evas_Object *obj, void *event_info) -{ - LOGD("[%s(): %d] BEGIN>>>>", __FUNCTION__, __LINE__); + bd = bundle_create(); + bundle_add(bd, "0", "info"); + bundle_add(bd, "1", str); + bundle_add(bd, "2", "0"); // bottom orientation + bundle_add(bd, "3", "2"); // terminated after 2 seconds - int result = (int) event_info; + syspopup_launch("tickernoti-syspopup", bd); - ugdata_t* ug_data = (ugdata_t*)data; - ret_if(ug_data == NULL); + bundle_free(bd); - if (result == UG_NFC_POPUP_RESP_OK) - { - LOGD("UG_NFC_POPUP_RESP_OK"); - } - else - { - LOGD("UG_NFC_POPUP_RESP_OK NOT!!"); - } + ug_destroy_me(ug_data->nfc_share_ug); LOGD("[%s(): %d] END>>>>", __FUNCTION__, __LINE__); } static void _show_success_popup(void *data) { - LOGD("[%s(): %d] BEGIN>>>>", __FUNCTION__, __LINE__); - char popup_str[POPUP_TEXT_SIZE] = { 0, }; - char *display_str = NULL; + ugdata_t *ug_data = (ugdata_t *)data; + + LOGD("[%s(): %d] BEGIN>>>>", __FUNCTION__, __LINE__); - ugdata_t* ug_data = (ugdata_t*)data; ret_if(ug_data == NULL); - UG_NFC_SHARE_MEM_STRDUP(display_str, ug_nfc_share_get_display_str()); - if (display_str == NULL) - { - UG_NFC_SHARE_MEM_STRDUP(display_str, IDS_NONE); - } + snprintf(popup_str, POPUP_TEXT_SIZE, "%s", IDS_TAG_SHARED); - snprintf(popup_str, POPUP_TEXT_SIZE, IDS_PS_TAG_SHARED, display_str); + bundle *bd = NULL; - ug_nfc_share_create_popup(data, ug_data->base_layout, popup_str, IDS_OK, UG_NFC_POPUP_RESP_OK, NULL, 0, NULL, 0, false, false, _success_popup_response_cb); + bd = bundle_create(); + bundle_add(bd, "0", "info"); + bundle_add(bd, "1", popup_str); + bundle_add(bd, "2", "0"); // bottom orientation + bundle_add(bd, "3", "2"); // terminated after 2 seconds - UG_NFC_SHARE_MEM_FREE(display_str); + syspopup_launch("tickernoti-syspopup", bd); - LOGD("[%s(): %d] END>>>>", __FUNCTION__, __LINE__); -} + bundle_free(bd); -char *ug_nfc_share_get_display_str(void) -{ - return ug_nfc_share_displayText; -} + ug_destroy_me(ug_data->nfc_share_ug); -void ug_nfc_share_set_display_str(const char* text) -{ - if (ug_nfc_share_displayText != NULL) - { - UG_NFC_SHARE_MEM_FREE(ug_nfc_share_displayText); - } - - UG_NFC_SHARE_MEM_STRDUP(ug_nfc_share_displayText, text); + LOGD("[%s(): %d] END>>>>", __FUNCTION__, __LINE__); } ug_nfc_share_tag_type ug_nfc_share_get_tag_type(void) @@ -179,466 +148,20 @@ ug_nfc_share_result_e ug_nfc_share_set_current_ndef(void *data, nfc_ndef_message } -static ug_nfc_share_result_e ug_nfc_share_get_extension_from_mime_type(const char *mime_type, char *extension, size_t ext_size) -{ - ug_nfc_share_result_e result = UG_NFC_SHARE_ERROR; -#if 1 - size_t length = 0; - const char *temp_ext = NULL; -#else - const char **temp_name; -#endif - - LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__); - - retv_if(mime_type == NULL, result); - retv_if((extension == NULL || ext_size == 0), result); - - memset(extension, 0, ext_size); - -#if 1 - length = strlen(mime_type); - - if (strncmp(mime_type, "image/png", length) == 0) - { - temp_ext = ".png"; - } - else if (strncmp(mime_type, "image/gif", length) == 0) - { - temp_ext = ".gif"; - } - else if (strncmp(mime_type, "image/bmp", length) == 0) - { - temp_ext = ".bmp"; - } - else if (strncmp(mime_type, "image/jpeg", length) == 0) - { - temp_ext = ".jpg"; - } - else if (strncmp(mime_type, "audio/mpeg", length) == 0) - { - temp_ext = ".mp3"; - } - else if (strncmp(mime_type, "audio/midi", length) == 0) - { - temp_ext = ".mid"; - } - else if (strncmp(mime_type, "audio/x-wav", length) == 0) - { - temp_ext = ".wav"; - } - else if (strncmp(mime_type, "video/mplength", length) == 0) - { - temp_ext = ".mplength"; - } - else if (strncmp(mime_type, "video/mpeg", length) == 0) - { - temp_ext = ".mpg"; - } - else if (strncmp(mime_type, "video/quicktime", length) == 0) - { - temp_ext = ".mov"; - } - else if (strncmp(mime_type, "video/x-flv", length) == 0) - { - temp_ext = ".flv"; - } - else if (strncmp(mime_type, "video/x-msvideo", length) == 0) - { - temp_ext = ".avi"; - } - else if (strncmp(mime_type, "video/x-ms-asf", length) == 0) - { - temp_ext = ".asf"; - } - else if (strncmp(mime_type, "video/x-msvideo", length) == 0) - { - temp_ext = ".avi"; - } - else - { - temp_ext = ""; - } - - strncpy(extension, temp_ext, ext_size - 1); - extension[ext_size - 1] = '\0'; - -#else - temp_name = xdg_mime_get_file_names_from_mime_type(mime_type); - LOGD("xdg_mime_get_file_names_from_mime_type(%s)", mime_type); - if (temp_name != NULL) - { - LOGD("temp_name (%p)", temp_name); - if (temp_name[0] != NULL) - { - LOGD("temp_name[0] (%p)", temp_name[0]); - LOGD("temp_name[0] : %s", temp_name[0]); - - strncpy(extension, temp_name[0], ext_size - 1); - extension[ext_size - 1] = '\0'; - } - } -#endif - - LOGD("extension : %s", extension); - - result = UG_NFC_SHARE_OK; - - LOGD("[%s(): %d] END >>>>", __FUNCTION__, __LINE__); - - return result; -} - -static ug_nfc_share_result_e ug_nfc_share_get_file_name_from_record(nfc_ndef_record_h record, char *file_name, size_t name_size) -{ - ug_nfc_share_result_e result = UG_NFC_SHARE_ERROR; - uint8_t *id_buffer = NULL; - uint32_t id_size = 0; - - LOGD("[%s(): %d] END >>>>", __FUNCTION__, __LINE__); - - retv_if(record == NULL, result); - retv_if((file_name == NULL || name_size == 0), result); - - result = nfc_ndef_record_get_id(record, &id_buffer, &id_size); - if (result != NFC_ERROR_NONE) - { - LOGD("nfc_ndef_record_get_id failed [%d]", result); - goto ERROR; - } - - if (id_buffer == NULL || id_size == 0) - { - int last_file_num = 0; - uint8_t *type_buffer = NULL; - uint32_t type_size = 0; - char extension[10] = { 0, }; - - /* generate file name */ - /* get record type name - maybe mime type string */ - result = nfc_ndef_record_get_type(record, &type_buffer, &type_size); - if (result != NFC_ERROR_NONE) - { - LOGD("nfc_ndef_record_get_type failed (%d)", result); - goto ERROR; - } - - LOGD("type_buffer : %s", type_buffer); - - ug_nfc_share_get_extension_from_mime_type(type_buffer, extension, sizeof(extension)); - - /* get current file number */ - vconf_get_int(UG_NFC_SHARE_LAST_FILE_NUMBER_KEY, &last_file_num); - last_file_num++; - vconf_set_int(UG_NFC_SHARE_LAST_FILE_NUMBER_KEY, last_file_num); - - /* make file name */ - snprintf(file_name, name_size, "%s%04d%s", UG_NFC_SHARE_FILE_NAME_PREFIX, last_file_num, extension); - } - else - { - strncpy(file_name, id_buffer, name_size - 1); - file_name[name_size - 1] = '\0'; - } - - LOGD("file name : %s", file_name); - - result = UG_NFC_SHARE_OK; - -ERROR : - - LOGD("[%s(): %d] END >>>>", __FUNCTION__, __LINE__); - - return result; -} - -static char *ug_nfc_share_get_display_text_from_record(ug_nfc_share_tag_type record_type, nfc_ndef_record_h record) -{ - int result = UG_NFC_SHARE_ERROR; - char *disp_text = NULL; - uint8_t *payload_buffer = NULL; - uint32_t payload_size = 0; - - LOGD("[%s(): %d] END >>>>", __FUNCTION__, __LINE__); - - switch (record_type) - { - case UG_NFC_SHARE_TAG_CONTACT : - { - CTSstruct *pCts = NULL; - CTSvalue *value = NULL; - char *temp = NULL; - - LOGD("record_type : UG_NFC_SHARE_TAG_CONTACT"); - - result = nfc_ndef_record_get_payload(record, &payload_buffer, &payload_size); - if (result != NFC_ERROR_NONE) - { - LOGD("nfc_ndef_record_get_payload failed[%d]", result); - break; - } - - if ((result = contacts_svc_get_contact_from_vcard(payload_buffer, &pCts)) == CTS_SUCCESS) - { - contacts_svc_struct_get_value(pCts, CTS_CF_NAME_VALUE, &value); - temp = (char *)contacts_svc_value_get_str(value, CTS_NAME_VAL_FIRST_STR); - if (temp != NULL) - { - UG_NFC_SHARE_MEM_STRDUP(disp_text, temp); - } - else - { - UG_NFC_SHARE_MEM_STRDUP(disp_text, "NULL"); - } - LOGD("display_name:%s", disp_text); - } - else - { - LOGD("contacts_svc_get_contact is failed [result : %d]", result); - } - } - break; - - case UG_NFC_SHARE_TAG_URL : - LOGD("record_type : UG_NFC_SHARE_TAG_URL"); - - result = nfc_ndef_record_get_uri(record, &disp_text); - if (result != NFC_ERROR_NONE) - { - LOGD("nfc_ndef_record_get_uri failed[%d]", result); - break; - } - break; - - case UG_NFC_SHARE_TAG_MPLAYER : - LOGD("record_type : UG_NFC_SHARE_TAG_MPLAYER"); - break; - - case UG_NFC_SHARE_TAG_MEMO : - LOGD("record_type : UG_NFC_SHARE_TAG_MEMO"); - - result = nfc_ndef_record_get_text(record, &disp_text); - if (result != NFC_ERROR_NONE) - { - LOGD("nfc_ndef_record_get_text failed[%d]", result); - break; - } - break; - - case UG_NFC_SHARE_TAG_BT : - { - int name_len = 0; - - LOGD("record_type : UG_NFC_SHARE_TAG_BT"); - - result = nfc_ndef_record_get_payload(record, &payload_buffer, &payload_size); - if (result != NFC_ERROR_NONE) - { - LOGD("nfc_ndef_record_get_payload failed[%d]", result); - break; - } - - LOGD("buffer:%s", payload_buffer); - name_len = ((int)(payload_buffer[0]) * 256 + (int)(payload_buffer[1])) - 9; - - UG_NFC_SHARE_MEM_MALLOC(disp_text, name_len, char); - if (disp_text != NULL) - memcpy(disp_text, payload_buffer + 9, name_len); - } - break; - - case UG_NFC_SHARE_TAG_WIFI : - LOGD("record_type : UG_NFC_SHARE_TAG_WIFI"); - break; - - case UG_NFC_SHARE_TAG_PROFILE : - LOGD("record_type : UG_NFC_SHARE_TAG_PROFILE"); - break; - - case UG_NFC_SHARE_TAG_ALLSHARE : - LOGD("record_type : UG_NFC_SHARE_TAG_ALLSHARE"); - break; - - case UG_NFC_SHARE_TAG_FILE : - { - char file_name[1024] = { 0, }; - - LOGD("record_type : UG_NFC_SHARE_TAG_FILE"); - - /* get file name */ - ug_nfc_share_get_file_name_from_record(record, file_name, sizeof(file_name)); - UG_NFC_SHARE_MEM_STRDUP(disp_text, file_name); - } - break; - - case UG_NFC_SHARE_TAG_HANDOVER : - { - LOGD("record_type : UG_NFC_SHARE_TAG_HANDOVER"); - - /* get file name */ - UG_NFC_SHARE_MEM_STRDUP(disp_text, IDS_HANDOVER); - } - break; - - case UG_NFC_SHARE_TAG_UNKNOWN : - LOGD("record_type : UG_NFC_SHARE_TAG_UNKNOWN"); - break; - - default : - break; - } - - LOGD("[%s(): %d] END >>>>", __FUNCTION__, __LINE__); - - return disp_text; -} - -char *ug_nfc_share_get_display_text_from_ndef(ug_nfc_share_tag_type record_type, nfc_ndef_message_h ndef_msg) -{ - int result = UG_NFC_SHARE_ERROR; - char *disp_text = NULL; - nfc_ndef_record_h record = NULL; - int count = 0; - - LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__); - - result = nfc_ndef_message_get_record_count(ndef_msg, &count); - if (result != NFC_ERROR_NONE) - { - LOGD("nfc_ndef_message_get_record_count failed[%d]", result); - goto error; - } - LOGD("count = [%d]", count); - - //If count>2, we should implement for this case. - result = nfc_ndef_message_get_record(ndef_msg, 0, &record); - if (result != NFC_ERROR_NONE) - { - LOGD("nfc_ndef_message_get_record failed[%d]", result); - goto error; - } - - disp_text = ug_nfc_share_get_display_text_from_record(record_type, record); - -error : - - LOGD("[%s(): %d] END >>>>", __FUNCTION__, __LINE__); - - return disp_text; -} - static ug_nfc_share_result_e ug_nfc_share_make_mime_type_data_from_file_path(const char *path, uint8_t **type_data, uint32_t *type_size) { ug_nfc_share_result_e result = UG_NFC_SHARE_ERROR; -#if 0 - char *extension = NULL; - char *mime_str = NULL; - int length = 0; -#else - struct stat st; const char *mime_type; -#endif LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__); retv_if(path == NULL, result); retv_if(type_data == NULL, result); -#if 0 - length = strlen(path); - - if (length > 5 && strncmp(mime_type, ".jpeg", 5) == 0) - { - memcpy(*type_data, STRING_AND_SIZE("image/jpeg")); - *type_size = strlen("image/jpeg"); - } - else if (length > 5 && strncmp(mime_type, ".mpeg", 5) == 0) - { - memcpy(*type_data, STRING_AND_SIZE("image/mpeg")); - *type_size = strlen("image/mpeg"); - } - else if (length > 4 && strncmp(mime_type, ".png", 4) == 0) - { - memcpy(*type_data, STRING_AND_SIZE("image/png")); - *type_size = strlen("image/png"); - } - else if (length > 4 && strncmp(mime_type, ".gif", 4) == 0) - { - memcpy(*type_data, STRING_AND_SIZE("image/gif")); - *type_size = strlen("image/gif"); - } - else if (length > 4 && strncmp(mime_type, ".bmp", 4) == 0) - { - memcpy(*type_data, STRING_AND_SIZE("image/bmp")); - *type_size = strlen("image/bmp"); - } - else if (length > 4 && ((strncmp(mime_type, ".jpg", 4) == 0) || (strncmp(mime_type, ".jpe", 4) == 0))) - { - memcpy(*type_data, STRING_AND_SIZE("image/jpeg")); - *type_size = strlen("image/jpeg"); - } - else if (length > 4 && strncmp(mime_type, ".mp3", 4) == 0) - { - memcpy(*type_data, STRING_AND_SIZE("audio/mpeg")); - *type_size = strlen("audio/mpeg"); - } - else if (length > 4 && strncmp(mime_type, ".mid", 4) == 0) - { - memcpy(*type_data, STRING_AND_SIZE("audio/midi")); - *type_size = strlen("audio/midi"); - } - else if (length > 4 && strncmp(mime_type, ".wav", 4) == 0) - { - memcpy(*type_data, STRING_AND_SIZE("audio/x-wav")); - *type_size = strlen("audio/x-wav"); - } - else if (length > 4 && strncmp(mime_type, ".mp4", 4) == 0) - { - memcpy(*type_data, STRING_AND_SIZE("video/mp4")); - *type_size = strlen("video/mp4"); - } - else if (length > 4 && ((strncmp(mime_type, ".mpe", 4) == 0) || (strncmp(mime_type, ".mpg", 4) == 0))) - { - memcpy(*type_data, STRING_AND_SIZE("video/mpeg")); - *type_size = strlen("video/mpeg"); - } - else if (length > 4 && strncmp(mime_type, ".mov", 4) == 0) - { - memcpy(*type_data, STRING_AND_SIZE("video/quicktime")); - *type_size = strlen("video/quicktime"); - } - else if (length > 4 && strncmp(mime_type, ".flv", 4) == 0) - { - memcpy(*type_data, STRING_AND_SIZE("video/x-flv")); - *type_size = strlen("video/x-flv"); - } - else if (length > 4 && strncmp(mime_type, ".avi", 4) == 0) - { - memcpy(*type_data, STRING_AND_SIZE("video/x-msvideo")); - *type_size = strlen("video/x-msvideo"); - } - else if (length > 4 && strncmp(mime_type, ".asf", 4) == 0) - { - memcpy(*type_data, STRING_AND_SIZE("video/x-ms-asf")); - *type_size = strlen("video/x-ms-asf"); - } - else if (length > 4 && strncmp(mime_type, ".avi", 4) == 0) - { - memcpy(*type_data, STRING_AND_SIZE("video/x-msvideo")); - *type_size = strlen("video/x-msvideo"); - } - else - { - memcpy(*type_data, STRING_AND_SIZE("application/octet-stream")); - *type_size = strlen("application/octet-stream"); - } -#else -// mime_type = xdg_mime_get_mime_type_for_file(path, &st); mime_type = xdg_mime_get_mime_type_from_file_name(path); UG_NFC_SHARE_MEM_MALLOC(*type_data, strlen(mime_type), uint8_t); memcpy(*type_data, mime_type, strlen(mime_type)); *type_size = strlen(mime_type); -#endif LOGD("mime type : %s", GET_SAFE_STRING((char *)*type_data)); @@ -651,10 +174,10 @@ static ug_nfc_share_result_e ug_nfc_share_make_mime_type_data_from_file_path(con ug_nfc_share_result_e ug_nfc_share_make_ndef_message_from_file(nfc_ndef_message_h *msg, const char *path) { - ug_nfc_share_result_e result = UG_NFC_SHARE_ERROR; + int result = UG_NFC_SHARE_ERROR; struct stat st; uint8_t *type_buffer = NULL; - uint32_t type_size = 0; + int type_size = 0; nfc_ndef_record_h record = NULL; FILE *file = NULL; char *file_name = NULL; @@ -676,7 +199,6 @@ ug_nfc_share_result_e ug_nfc_share_make_ndef_message_from_file(nfc_ndef_message_ /* read file and make payload*/ file = fopen(path, "r"); - if (file != NULL) { long int read_count = 0, read_total = 0; @@ -714,7 +236,7 @@ ug_nfc_share_result_e ug_nfc_share_make_ndef_message_from_file(nfc_ndef_message_ } /* get type data */ - result = ug_nfc_share_make_mime_type_data_from_file_path(path, &type_buffer, &type_size); + result = ug_nfc_share_make_mime_type_data_from_file_path(path, &type_buffer, (uint32_t *)&type_size); if (result != UG_NFC_SHARE_OK) { LOGD("ERROR :: _make_mime_type_data_from_file_path failed [%d]", result); @@ -722,7 +244,6 @@ ug_nfc_share_result_e ug_nfc_share_make_ndef_message_from_file(nfc_ndef_message_ return result; } - /* get file name for id */ file_name = strrchr(path, '/'); if (file_name == NULL) @@ -737,7 +258,7 @@ ug_nfc_share_result_e ug_nfc_share_make_ndef_message_from_file(nfc_ndef_message_ LOGD("file name : %s", file_name); /* create record */ - result = nfc_ndef_record_create(&record, NFC_RECORD_TNF_MIME_MEDIA, type_buffer, type_size, file_name, strlen(file_name), file_data, file_len); + result = nfc_ndef_record_create(&record, NFC_RECORD_TNF_MIME_MEDIA, type_buffer, type_size, (uint8_t *)file_name, strlen(file_name), file_data, file_len); if (result != NFC_ERROR_NONE) { LOGD("nfc_ndef_record_create failed (%d)", result); @@ -775,10 +296,10 @@ ug_nfc_share_result_e ug_nfc_share_make_ndef_message_from_file(nfc_ndef_message_ /* nfc_handover */ ug_nfc_share_result_e ug_nfc_share_make_ndef_message_from_multi_file(nfc_ndef_message_h *msg, const char *path[], int record_count) { - ug_nfc_share_result_e result = UG_NFC_SHARE_ERROR; + int result = UG_NFC_SHARE_ERROR; struct stat st; uint8_t *type_buffer = NULL; - uint32_t type_size = 0; + int type_size = 0; nfc_ndef_record_h record = NULL; FILE *file = NULL; char *file_name = NULL; @@ -842,7 +363,7 @@ ug_nfc_share_result_e ug_nfc_share_make_ndef_message_from_multi_file(nfc_ndef_me } /* get type data */ - result = ug_nfc_share_make_mime_type_data_from_file_path(path[index], &type_buffer, &type_size); + result = ug_nfc_share_make_mime_type_data_from_file_path(path[index], &type_buffer, (uint32_t *)&type_size); if (result != UG_NFC_SHARE_OK) { LOGD("ERROR :: _make_mime_type_data_from_file_path failed [%d]", result); @@ -850,7 +371,6 @@ ug_nfc_share_result_e ug_nfc_share_make_ndef_message_from_multi_file(nfc_ndef_me return result; } - /* get file name for id */ file_name = strrchr(path[index], '/'); if (file_name == NULL) @@ -865,7 +385,7 @@ ug_nfc_share_result_e ug_nfc_share_make_ndef_message_from_multi_file(nfc_ndef_me LOGD("file name : %s", file_name); /* create record */ - result = nfc_ndef_record_create(&record, NFC_RECORD_TNF_MIME_MEDIA, type_buffer, type_size, file_name, strlen(file_name), file_data, file_len); + result = nfc_ndef_record_create(&record, NFC_RECORD_TNF_MIME_MEDIA, type_buffer, type_size, (uint8_t *)file_name, strlen(file_name), file_data, file_len); if (result != NFC_ERROR_NONE) { LOGD("nfc_ndef_record_create failed (%d)", result); @@ -926,8 +446,9 @@ void _ug_nfc_share_get_bt_addr_from_string(uint8_t *addr, char *addr_string) addr[count++] = (uint8_t)value; } - while (token = strtok(NULL, ":")); + while ((token = strtok(NULL, ":")) != NULL); } + UG_NFC_SHARE_MEM_FREE(temp); } static void _p2p_connection_handover_completed_cb(nfc_error_e result, nfc_ac_type_e carrior, void *ac_data, int ac_data_size, void *user_data) @@ -935,23 +456,32 @@ static void _p2p_connection_handover_completed_cb(nfc_error_e result, nfc_ac_typ LOGD("[%s(): %d] BEGIN>>>>", __FUNCTION__, __LINE__); ugdata_t* ug_data = (ugdata_t*)user_data; - uint8_t *data = (uint8_t *)ac_data; + + /* To prevent write event during showing popup, unset response callback */ + ug_nfc_unset_nfc_callback(); + + /* nfc deactivate */ + if(nfc_manager_deinitialize () != NFC_ERROR_NONE) + { + LOGD("nfc_manager_deinitialize failed", __FUNCTION__, __LINE__); + } if(result == NFC_ERROR_NONE) { uint8_t address[6] = { 0, }; + char *data = NULL; LOGD("p2p_connection_handover is completed"); - LOGD("uri[%d] = %s", strlen(ug_data->uri), ug_data->uri); - /* To prevent write event during showing popup, unset response callback */ - ug_nfc_unset_nfc_callback(); + data = (char *)bundle_get_val(ug_data->bd, "request_data"); + + LOGD("uri[%d] = %s", strlen(data), data); _ug_nfc_share_get_bt_addr_from_string(address, (char *)ac_data); LOGD("address[%d] = { 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X }", sizeof(address), address[0], address[1], address[2], address[3], address[4], address[5]); - if (_bt_ipc_send_obex_message(address, ug_data->uri, strlen(ug_data->uri)) == 0) + if (_bt_ipc_send_obex_message(address, (uint8_t *)data, strlen(data) + 1) == 0) { /* show success popup */ _show_success_popup(ug_data); @@ -981,13 +511,19 @@ static void _p2p_send_completed_cb(nfc_error_e result, void *user_data) ugdata_t* ug_data = (ugdata_t*)user_data; + /* To prevent write event during showing popup, unset response callback */ + ug_nfc_unset_nfc_callback(); + + /* nfc deactivate */ + if(nfc_manager_deinitialize () != NFC_ERROR_NONE) + { + LOGD("nfc_manager_deinitialize failed", __FUNCTION__, __LINE__); + } + if(result == NFC_ERROR_NONE) { LOGD("_p2p_send_completed_cb is completed"); - /* To prevent write event during showing popup, unset response callback */ - ug_nfc_unset_nfc_callback(); - /* show success popup */ _show_success_popup(ug_data); } @@ -1143,8 +679,6 @@ int _bt_ipc_send_obex_message(uint8_t *address, const uint8_t *files, uint32_t l result = -1; } - - e_dbus_connection_close(conn); } else { |