summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKim Kibum <kb0929.kim@samsung.com>2012-06-08 14:54:17 +0900
committerKim Kibum <kb0929.kim@samsung.com>2012-06-08 14:54:17 +0900
commit41e5350c0b8f2d4c13acb75a0927d9b9ae9fe948 (patch)
treee1d5e16ecf6c78d99bca1b7e99952e535de41cf5
parentc8d1525215d9d5f8417c235032dd9d95cbc61fac (diff)
downloadug-nfc-efl-41e5350c0b8f2d4c13acb75a0927d9b9ae9fe948.tar.gz
ug-nfc-efl-41e5350c0b8f2d4c13acb75a0927d9b9ae9fe948.tar.bz2
ug-nfc-efl-41e5350c0b8f2d4c13acb75a0927d9b9ae9fe948.zip
apply FSL(Flora Software License)
-rw-r--r--AUTHORS1
-rw-r--r--CMakeLists.txt7
-rw-r--r--LICENSE75
-rw-r--r--debian/changelog7
-rw-r--r--debian/compat1
-rw-r--r--debian/control31
-rw-r--r--debian/libug-setting-nfc-efl.install.in3
-rw-r--r--debian/libug-setting-nfc-efl.postinst7
-rw-r--r--debian/libug-share-nfc-efl.install.in4
-rw-r--r--debian/libug-share-nfc-efl.postinst8
-rwxr-xr-xdebian/rules131
-rw-r--r--packaging/libug-setting-nfc-efl.install.in3
-rw-r--r--packaging/libug-share-nfc-efl.install.in4
-rw-r--r--packaging/ug-nfc-efl.spec100
-rw-r--r--ug-nfc-setting-efl/CMakeLists.txt56
-rw-r--r--ug-nfc-setting-efl/data/icons/org.tizen.nfc-app.pngbin0 -> 8881 bytes
-rw-r--r--ug-nfc-setting-efl/include/ug-nfc-setting-main.h67
-rwxr-xr-xug-nfc-setting-efl/po/CMakeLists.txt25
-rwxr-xr-xug-nfc-setting-efl/po/POTFILES.in3
-rwxr-xr-xug-nfc-setting-efl/po/de_DE.po6
-rwxr-xr-xug-nfc-setting-efl/po/el_GR.po6
-rwxr-xr-xug-nfc-setting-efl/po/en.po6
-rwxr-xr-xug-nfc-setting-efl/po/es_ES.po6
-rwxr-xr-xug-nfc-setting-efl/po/fr_FR.po6
-rwxr-xr-xug-nfc-setting-efl/po/it_IT.po6
-rwxr-xr-xug-nfc-setting-efl/po/ja_JP.po6
-rwxr-xr-xug-nfc-setting-efl/po/ko_KR.po6
-rwxr-xr-xug-nfc-setting-efl/po/nl_NL.po6
-rwxr-xr-xug-nfc-setting-efl/po/pt_PT.po6
-rwxr-xr-xug-nfc-setting-efl/po/ru_RU.po6
-rwxr-xr-xug-nfc-setting-efl/po/tr_TR.po6
-rwxr-xr-xug-nfc-setting-efl/po/update-po.sh57
-rwxr-xr-xug-nfc-setting-efl/po/zh_CN.po6
-rwxr-xr-xug-nfc-setting-efl/po/zh_HK.po6
-rwxr-xr-xug-nfc-setting-efl/po/zh_TW.po6
-rw-r--r--ug-nfc-setting-efl/src/ug-nfc-setting-main.c423
-rw-r--r--ug-nfc-share-efl/CMakeLists.txt71
-rw-r--r--ug-nfc-share-efl/data/edc/ug-nfc-share-efl.edc96
-rw-r--r--ug-nfc-share-efl/data/images/U05_AfterSelect_Share_help.pngbin0 -> 17320 bytes
-rw-r--r--ug-nfc-share-efl/data/images/U05_AfterSelect_Write_help.pngbin0 -> 21409 bytes
-rwxr-xr-xug-nfc-share-efl/data/images/U05_AfterSelect_bookmark.pngbin0 -> 14176 bytes
-rwxr-xr-xug-nfc-share-efl/data/images/U05_AfterSelect_contact.pngbin0 -> 12269 bytes
-rwxr-xr-xug-nfc-share-efl/data/images/U05_AfterSelect_memo.pngbin0 -> 10946 bytes
-rw-r--r--ug-nfc-share-efl/include/ug-nfc-share-common-debug.h116
-rw-r--r--ug-nfc-share-efl/include/ug-nfc-share-common-error.h25
-rw-r--r--ug-nfc-share-efl/include/ug-nfc-share-common-util.h212
-rw-r--r--ug-nfc-share-efl/include/ug-nfc-share-main.h136
-rw-r--r--ug-nfc-share-efl/include/ug-nfc-share-popup.h57
-rw-r--r--ug-nfc-share-efl/include/ug-nfc-share-tag.h48
-rwxr-xr-xug-nfc-share-efl/po/CMakeLists.txt25
-rwxr-xr-xug-nfc-share-efl/po/POTFILES.in3
-rwxr-xr-xug-nfc-share-efl/po/de_DE.po21
-rwxr-xr-xug-nfc-share-efl/po/el_GR.po21
-rwxr-xr-xug-nfc-share-efl/po/en.po21
-rwxr-xr-xug-nfc-share-efl/po/es_ES.po21
-rwxr-xr-xug-nfc-share-efl/po/fr_FR.po21
-rwxr-xr-xug-nfc-share-efl/po/it_IT.po21
-rwxr-xr-xug-nfc-share-efl/po/ja_JP.po21
-rwxr-xr-xug-nfc-share-efl/po/ko_KR.po21
-rwxr-xr-xug-nfc-share-efl/po/nl_NL.po21
-rwxr-xr-xug-nfc-share-efl/po/pt_PT.po21
-rwxr-xr-xug-nfc-share-efl/po/ru_RU.po21
-rwxr-xr-xug-nfc-share-efl/po/tr_TR.po21
-rwxr-xr-xug-nfc-share-efl/po/update-po.sh57
-rwxr-xr-xug-nfc-share-efl/po/zh_CN.po21
-rwxr-xr-xug-nfc-share-efl/po/zh_HK.po21
-rwxr-xr-xug-nfc-share-efl/po/zh_TW.po21
-rw-r--r--ug-nfc-share-efl/src/ug-nfc-share-common-util.c226
-rw-r--r--ug-nfc-share-efl/src/ug-nfc-share-main.c1017
-rw-r--r--ug-nfc-share-efl/src/ug-nfc-share-popup.c149
-rw-r--r--ug-nfc-share-efl/src/ug-nfc-share-tag.c1168
71 files changed, 4824 insertions, 0 deletions
diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..6c3e926
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1 @@
+Junyong Sim <junyong.sim@samsung.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..ff141b3
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,7 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+
+MESSAGE("NFC UI Gardet version: ${VERSION}")
+
+ADD_SUBDIRECTORY(ug-nfc-setting-efl)
+ADD_SUBDIRECTORY(ug-nfc-share-efl)
+
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..7ccb5b5
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,75 @@
+Flora License
+
+Version 1.0, May, 2012
+
+http://www.tizenopensource.org/license
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
+
+"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
+
+"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
+
+"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
+
+"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
+
+"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
+
+"Tizen Certified Platform" shall mean a software platform that complies with the standards set forth in the Compatibility Definition Document and passes the Compatibility Test Suite as defined from time to time by the Tizen Technical Steering Group and certified by the Tizen Association or its designated agent.
+
+2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work solely as incorporated into a Tizen Certified Platform, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work solely as incorporated into a Tizen Certified Platform to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof pursuant to the copyright license above, in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
+
+ 1. You must give any other recipients of the Work or Derivative Works a copy of this License; and
+
+ 2. You must cause any modified files to carry prominent notices stating that You changed the files; and
+
+ 3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
+
+ 4. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+APPENDIX: How to apply the Flora License to your work
+
+To apply the Flora License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Flora License, Version 1.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.tizenopensource.org/license
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..7b55434
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,7 @@
+ug-nfc-efl (0.0.1-7) unstable; urgency=low
+
+ * intergration from private git
+ * Git: 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
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..7ed6ff8
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+5
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..13d9801
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,31 @@
+Source: ug-nfc-efl
+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
+Standards-Version: 0.1.0
+
+Package: libug-setting-nfc-efl
+Section: libs
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: UI gadget about the setting of nfc
+
+Package: libug-setting-nfc-efl-dbg
+Section: debug
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, libug-setting-nfc-efl(= ${Source-Version})
+Description: UI gadget about the setting of nfc (unstripped)
+
+Package: libug-share-nfc-efl
+Section: libs
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: UI gadget about the share of nfc
+
+Package: libug-share-nfc-efl-dbg
+Section: debug
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, libug-share-nfc-efl(= ${Source-Version})
+Description: UI gadget about the share of nfc (unstripped)
diff --git a/debian/libug-setting-nfc-efl.install.in b/debian/libug-setting-nfc-efl.install.in
new file mode 100644
index 0000000..7ac5b56
--- /dev/null
+++ b/debian/libug-setting-nfc-efl.install.in
@@ -0,0 +1,3 @@
+/opt/ug/lib/libug-setting-nfc-efl*
+/opt/ug/res/locale/*/LC_MESSAGES/ug-setting-nfc-efl*
+/opt/ug/res/icons/*
diff --git a/debian/libug-setting-nfc-efl.postinst b/debian/libug-setting-nfc-efl.postinst
new file mode 100644
index 0000000..7a41673
--- /dev/null
+++ b/debian/libug-setting-nfc-efl.postinst
@@ -0,0 +1,7 @@
+#!/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
new file mode 100644
index 0000000..c9b48c2
--- /dev/null
+++ b/debian/libug-share-nfc-efl.install.in
@@ -0,0 +1,4 @@
+/opt/ug/lib/libug-share-nfc-efl*
+/opt/ug/res/edje/*
+/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
new file mode 100644
index 0000000..1e42d6b
--- /dev/null
+++ b/debian/libug-share-nfc-efl.postinst
@@ -0,0 +1,8 @@
+#!/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/debian/rules b/debian/rules
new file mode 100755
index 0000000..1fc14e2
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,131 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+CFLAGS ?= -Wall -g
+CXXFLAGS ?= -Wall -g
+LDFLAGS ?=
+PREFIX ?= /opt/ug
+DATADIR ?= /opt/ug/res
+
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+ CFLAGS += -O0
+ CXXFLAGS += -O0
+else
+ CFLAGS += -O2
+ CXXFLAGS += -O2
+endif
+
+LDFLAGS += -Wl,--rpath=$(PREFIX)/lib -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs
+
+CMAKE_TMP_DIR = $(CURDIR)/cmake_tmp
+
+
+configure: configure-stamp
+configure-stamp:
+ dh_testdir
+ # Add here commands to configure the package.
+ mkdir -p $(CMAKE_TMP_DIR);
+ cd $(CMAKE_TMP_DIR); CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" cmake .. -DCMAKE_INSTALL_PREFIX=$(PREFIX) -DVERSION=$(VERSION)
+
+ touch configure-stamp
+
+build: build-stamp
+
+build-stamp: configure-stamp
+ dh_testdir
+
+ # Add here commands to compile the package.
+ cd $(CMAKE_TMP_DIR) && $(MAKE)
+ #docbook-to-man debian/wavplayer.sgml > wavplayer.1
+
+ for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
+ cat $$f > $${f%.in}; \
+ sed -i -e "s#@PREFIX@#$(PREFIX)#g" $${f%.in}; \
+ sed -i -e "s#@DATADIR@#$(DATADIR)#g" $${f%.in}; \
+ done
+
+ touch $@
+
+clean:
+ dh_testdir
+ dh_testroot
+ rm -f build-stamp configure-stamp
+
+ # Add here commands to clean up after the build process.
+ -cd $(CMAKE_TMP_DIR) && $(MAKE) clean
+ rm -rf $(CMAKE_TMP_DIR)
+ rm -rf CMakeCache.txt
+ rm -rf CMakeFiles
+ rm -rf cmake_install.cmake
+ rm -rf Makefile
+ rm -rf install_manifest.txt
+ rm -rf *.so
+ rm -rf *.edj
+ rm -rf po/*.mo
+ rm -rf po/CMakeCache.txt
+ rm -rf po/CMakeFiles
+ rm -rf po/cmake_install.cmake
+ rm -rf po/Makefile
+ rm -rf po/install_manifest.txt
+
+ for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
+ rm -f $${f%.in}; \
+ done
+
+ dh_clean
+
+install: build
+ dh_testdir
+ dh_testroot
+ dh_clean -k
+ dh_installdirs
+
+ # Add here commands to install the package into debian/wavplayer.
+ cd $(CMAKE_TMP_DIR) && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
+
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+ dh_testdir
+ dh_testroot
+# dh_installchangelogs
+# dh_installdocs
+# dh_installexamples
+ dh_install --sourcedir=debian/tmp
+# dh_installmenu
+# dh_installdebconf
+# dh_installlogrotate
+# dh_installemacsen
+# dh_installpam
+# dh_installmime
+# dh_python
+# dh_installinit
+# dh_installcron
+# dh_installinfo
+# dh_installman
+ dh_link
+ dh_strip --dbg-package=libug-setting-nfc-efl-dbg --dbg-package=libug-share-nfc-efl-dbg
+ dh_compress
+ dh_fixperms
+# dh_perl
+ dh_makeshlibs
+ dh_installdeb
+ dh_shlibdeps
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
diff --git a/packaging/libug-setting-nfc-efl.install.in b/packaging/libug-setting-nfc-efl.install.in
new file mode 100644
index 0000000..7ac5b56
--- /dev/null
+++ b/packaging/libug-setting-nfc-efl.install.in
@@ -0,0 +1,3 @@
+/opt/ug/lib/libug-setting-nfc-efl*
+/opt/ug/res/locale/*/LC_MESSAGES/ug-setting-nfc-efl*
+/opt/ug/res/icons/*
diff --git a/packaging/libug-share-nfc-efl.install.in b/packaging/libug-share-nfc-efl.install.in
new file mode 100644
index 0000000..c9b48c2
--- /dev/null
+++ b/packaging/libug-share-nfc-efl.install.in
@@ -0,0 +1,4 @@
+/opt/ug/lib/libug-share-nfc-efl*
+/opt/ug/res/edje/*
+/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
new file mode 100644
index 0000000..56f77d8
--- /dev/null
+++ b/packaging/ug-nfc-efl.spec
@@ -0,0 +1,100 @@
+%define _optdir /opt
+%define _ugdir %{_optdir}/ug
+
+
+Name: ug-nfc-efl
+Summary: UI gadget about the nfc
+Version: 0.0.1
+Release: 1
+Group: TO_BE/FILLED_IN
+License: Flora Software 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)
+Requires(post): /sbin/ldconfig
+Requires(post): /usr/bin/vconftool
+Requires(postun): /sbin/ldconfig
+
+%description
+UI gadget about the nfc
+
+%prep
+%setup -q
+
+%package devel
+Summary: ug for nfc setting
+Group: Development/Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description devel
+ug for nfc setting
+
+%package -n ug-share-nfc-efl
+Summary: ug for nfc share
+Group: Development/Libraries
+Requires(post): /sbin/ldconfig
+Requires(post): /usr/bin/vconftool
+Requires: %{name} = %{version}-%{release}
+
+%description -n ug-share-nfc-efl
+ug for nfc share
+
+
+%build
+mkdir cmake_tmp
+cd cmake_tmp
+cmake .. -DCMAKE_INSTALL_PREFIX=%{_ugdir}
+
+make %{?jobs:-j%jobs}
+
+
+%install
+cd cmake_tmp
+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
+
+%postun
+
+%files
+%defattr(-,root,root,-)
+/opt/ug/lib/libug-setting-nfc-efl*
+/opt/ug/res/locale/*/LC_MESSAGES/ug-setting-nfc-efl*
+/opt/ug/res/icons/*
+
+%files -n ug-share-nfc-efl
+%defattr(-,root,root,-)
+/opt/ug/lib/libug-share-nfc-efl*
+/opt/ug/res/edje/*
+/opt/ug/res/images/*
+/opt/ug/res/locale/*/LC_MESSAGES/ug-share-nfc-efl*
diff --git a/ug-nfc-setting-efl/CMakeLists.txt b/ug-nfc-setting-efl/CMakeLists.txt
new file mode 100644
index 0000000..12821b5
--- /dev/null
+++ b/ug-nfc-setting-efl/CMakeLists.txt
@@ -0,0 +1,56 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT(ug-setting-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(ICONDIR "${RESDIR}/icons/${PROJECT_NAME}")
+
+SET(SRCS
+src/ug-nfc-setting-main.c
+)
+
+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_setting REQUIRED elementary appcore-efl ui-gadget evas ecore-x edje ecore dbus-glib-1 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} ${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("-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})
+
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION /opt/ug/lib)
+
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/org.tizen.nfc-app.png DESTINATION ${ICONDIR})
+
+ADD_SUBDIRECTORY(po)
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
new file mode 100644
index 0000000..687e327
--- /dev/null
+++ b/ug-nfc-setting-efl/data/icons/org.tizen.nfc-app.png
Binary files differ
diff --git a/ug-nfc-setting-efl/include/ug-nfc-setting-main.h b/ug-nfc-setting-efl/include/ug-nfc-setting-main.h
new file mode 100644
index 0000000..eb6a9f9
--- /dev/null
+++ b/ug-nfc-setting-efl/include/ug-nfc-setting-main.h
@@ -0,0 +1,67 @@
+/*
+ * 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_MAIN_H__
+#define __UG_NFC_SETTING_MAIN_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#include <ui-gadget-module.h>
+#include <Evas.h>
+#include <Elementary.h>
+#include <dlog.h>
+#include <nfc.h>
+
+#define PACKAGE "ug-setting-nfc-efl"
+#ifdef PREFIX
+#undef PREFIX
+#endif
+#define PREFIX "/opt/ug/"
+#define LOCALE_PATH PREFIX"/res/locale"
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+
+#define LOG_TAG "UG_NFC_SETTING_EFL"
+
+#define NFCUG_TEXT_DOMAIN PACKAGE
+#define NFCUG_LOCALEDIR LOCALE_PATH
+
+/* Registered string in STMS NFC */
+#define IDS_ACTIVATION dgettext(PACKAGE, "IDS_NFC_POP_ACTIVATION")
+#define IDS_NFC dgettext(PACKAGE, "IDS_NFC_BODY_NFC")
+
+
+typedef struct _ugdata_t
+{
+ Evas_Object* ug_win_main;
+ struct ui_gadget *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;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*__UG_NFC_SETTING_MAIN_H__*/
diff --git a/ug-nfc-setting-efl/po/CMakeLists.txt b/ug-nfc-setting-efl/po/CMakeLists.txt
new file mode 100755
index 0000000..310db0a
--- /dev/null
+++ b/ug-nfc-setting-efl/po/CMakeLists.txt
@@ -0,0 +1,25 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 0.1)
+PROJECT(ug-setting-nfc-efl C)
+
+SET(POFILES en.po nl_NL.po de_DE.po zh_HK.po zh_CN.po ru_RU.po ko_KR.po zh_TW.po ja_JP.po es_ES.po el_GR.po it_IT.po tr_TR.po pt_PT.po fr_FR.po)
+
+SET(MSGFMT "/usr/bin/msgfmt")
+
+FOREACH(pofile ${POFILES})
+ SET(pofile ${CMAKE_CURRENT_SOURCE_DIR}/${pofile})
+ MESSAGE("PO: ${pofile}")
+ GET_FILENAME_COMPONENT(absPofile ${pofile} ABSOLUTE)
+ GET_FILENAME_COMPONENT(lang ${absPofile} NAME_WE)
+ SET(moFile ${CMAKE_CURRENT_BINARY_DIR}/${lang}.mo)
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${moFile}
+ COMMAND ${MSGFMT} -o ${moFile} ${absPofile}
+ DEPENDS ${absPofile}
+ )
+ INSTALL(FILES ${moFile}
+ DESTINATION res/locale/${lang}/LC_MESSAGES RENAME ${PROJECT_NAME}.mo)
+ SET(moFiles ${moFiles} ${moFile})
+ENDFOREACH(pofile)
+
+MESSAGE(".mo files: ${moFiles}")
+ADD_CUSTOM_TARGET(po ALL DEPENDS ${moFiles})
diff --git a/ug-nfc-setting-efl/po/POTFILES.in b/ug-nfc-setting-efl/po/POTFILES.in
new file mode 100755
index 0000000..2068f24
--- /dev/null
+++ b/ug-nfc-setting-efl/po/POTFILES.in
@@ -0,0 +1,3 @@
+# List of source files containing translatable strings.
+./src/ug-nfc-share-main.c
+./src/ug-nfc-share-tag.c
diff --git a/ug-nfc-setting-efl/po/de_DE.po b/ug-nfc-setting-efl/po/de_DE.po
new file mode 100755
index 0000000..93e9121
--- /dev/null
+++ b/ug-nfc-setting-efl/po/de_DE.po
@@ -0,0 +1,6 @@
+msgid "IDS_NFC_BODY_NFC"
+msgstr "NFC"
+
+msgid "IDS_NFC_POP_ACTIVATION"
+msgstr "Aktivierung"
+
diff --git a/ug-nfc-setting-efl/po/el_GR.po b/ug-nfc-setting-efl/po/el_GR.po
new file mode 100755
index 0000000..6de0b24
--- /dev/null
+++ b/ug-nfc-setting-efl/po/el_GR.po
@@ -0,0 +1,6 @@
+msgid "IDS_NFC_BODY_NFC"
+msgstr "NFC"
+
+msgid "IDS_NFC_POP_ACTIVATION"
+msgstr "Ενεργοποίηση"
+
diff --git a/ug-nfc-setting-efl/po/en.po b/ug-nfc-setting-efl/po/en.po
new file mode 100755
index 0000000..dcd1598
--- /dev/null
+++ b/ug-nfc-setting-efl/po/en.po
@@ -0,0 +1,6 @@
+msgid "IDS_NFC_BODY_NFC"
+msgstr "NFC"
+
+msgid "IDS_NFC_POP_ACTIVATION"
+msgstr "Activation"
+
diff --git a/ug-nfc-setting-efl/po/es_ES.po b/ug-nfc-setting-efl/po/es_ES.po
new file mode 100755
index 0000000..025d808
--- /dev/null
+++ b/ug-nfc-setting-efl/po/es_ES.po
@@ -0,0 +1,6 @@
+msgid "IDS_NFC_BODY_NFC"
+msgstr "NFC"
+
+msgid "IDS_NFC_POP_ACTIVATION"
+msgstr "Activación"
+
diff --git a/ug-nfc-setting-efl/po/fr_FR.po b/ug-nfc-setting-efl/po/fr_FR.po
new file mode 100755
index 0000000..dcd1598
--- /dev/null
+++ b/ug-nfc-setting-efl/po/fr_FR.po
@@ -0,0 +1,6 @@
+msgid "IDS_NFC_BODY_NFC"
+msgstr "NFC"
+
+msgid "IDS_NFC_POP_ACTIVATION"
+msgstr "Activation"
+
diff --git a/ug-nfc-setting-efl/po/it_IT.po b/ug-nfc-setting-efl/po/it_IT.po
new file mode 100755
index 0000000..22697f8
--- /dev/null
+++ b/ug-nfc-setting-efl/po/it_IT.po
@@ -0,0 +1,6 @@
+msgid "IDS_NFC_BODY_NFC"
+msgstr "NFC"
+
+msgid "IDS_NFC_POP_ACTIVATION"
+msgstr "Attivazione"
+
diff --git a/ug-nfc-setting-efl/po/ja_JP.po b/ug-nfc-setting-efl/po/ja_JP.po
new file mode 100755
index 0000000..21dd4c1
--- /dev/null
+++ b/ug-nfc-setting-efl/po/ja_JP.po
@@ -0,0 +1,6 @@
+msgid "IDS_NFC_BODY_NFC"
+msgstr "NFC"
+
+msgid "IDS_NFC_POP_ACTIVATION"
+msgstr "アクティベーション"
+
diff --git a/ug-nfc-setting-efl/po/ko_KR.po b/ug-nfc-setting-efl/po/ko_KR.po
new file mode 100755
index 0000000..185b371
--- /dev/null
+++ b/ug-nfc-setting-efl/po/ko_KR.po
@@ -0,0 +1,6 @@
+msgid "IDS_NFC_BODY_NFC"
+msgstr "NFC"
+
+msgid "IDS_NFC_POP_ACTIVATION"
+msgstr "실행"
+
diff --git a/ug-nfc-setting-efl/po/nl_NL.po b/ug-nfc-setting-efl/po/nl_NL.po
new file mode 100755
index 0000000..297f541
--- /dev/null
+++ b/ug-nfc-setting-efl/po/nl_NL.po
@@ -0,0 +1,6 @@
+msgid "IDS_NFC_BODY_NFC"
+msgstr "NFC"
+
+msgid "IDS_NFC_POP_ACTIVATION"
+msgstr "Inschakelen"
+
diff --git a/ug-nfc-setting-efl/po/pt_PT.po b/ug-nfc-setting-efl/po/pt_PT.po
new file mode 100755
index 0000000..f43b1cd
--- /dev/null
+++ b/ug-nfc-setting-efl/po/pt_PT.po
@@ -0,0 +1,6 @@
+msgid "IDS_NFC_BODY_NFC"
+msgstr "NFC"
+
+msgid "IDS_NFC_POP_ACTIVATION"
+msgstr "Activação"
+
diff --git a/ug-nfc-setting-efl/po/ru_RU.po b/ug-nfc-setting-efl/po/ru_RU.po
new file mode 100755
index 0000000..b308cc1
--- /dev/null
+++ b/ug-nfc-setting-efl/po/ru_RU.po
@@ -0,0 +1,6 @@
+msgid "IDS_NFC_BODY_NFC"
+msgstr "NFC"
+
+msgid "IDS_NFC_POP_ACTIVATION"
+msgstr "Активация"
+
diff --git a/ug-nfc-setting-efl/po/tr_TR.po b/ug-nfc-setting-efl/po/tr_TR.po
new file mode 100755
index 0000000..f70a67d
--- /dev/null
+++ b/ug-nfc-setting-efl/po/tr_TR.po
@@ -0,0 +1,6 @@
+msgid "IDS_NFC_BODY_NFC"
+msgstr "NFC"
+
+msgid "IDS_NFC_POP_ACTIVATION"
+msgstr "Etkinleştirme"
+
diff --git a/ug-nfc-setting-efl/po/update-po.sh b/ug-nfc-setting-efl/po/update-po.sh
new file mode 100755
index 0000000..f23c1fa
--- /dev/null
+++ b/ug-nfc-setting-efl/po/update-po.sh
@@ -0,0 +1,57 @@
+#!/bin/sh
+
+PACKAGE=infoalarm
+SRCROOT=..
+POTFILES=POTFILES.in
+
+#ALL_LINGUAS= am az be ca cs da de el en_CA en_GB es et fi fr hr hu it ja ko lv mk ml ms nb ne nl pa pl pt pt_BR ru rw sk sl sr sr@Latn sv ta tr uk vi zh_CN zh_TW
+ALL_LINGUAS="en_US en_GB ja ko zh_CN"
+
+XGETTEXT=/usr/bin/xgettext
+MSGMERGE=/usr/bin/msgmerge
+
+echo -n "Make ${PACKAGE}.pot "
+if [ ! -e $POTFILES ] ; then
+ echo "$POTFILES not found"
+ exit 1
+fi
+
+$XGETTEXT --default-domain=${PACKAGE} --directory=${SRCROOT} \
+ --add-comments --keyword --keyword=_ --keyword=N_ --files-from=$POTFILES \
+&& test ! -f ${PACKAGE}.po \
+ || (rm -f ${PACKAGE}.pot && mv ${PACKAGE}.po ${PACKAGE}.pot)
+
+if [ $? -ne 0 ]; then
+ echo "error"
+ exit 1
+else
+ echo "done"
+fi
+
+for LANG in $ALL_LINGUAS; do
+ echo "$LANG : "
+
+ if [ ! -e $LANG.po ] ; then
+ sed 's/CHARSET/UTF-8/g' ${PACKAGE}.pot > ${LANG}.po
+ echo "${LANG}.po created"
+ else
+ if $MSGMERGE ${LANG}.po ${PACKAGE}.pot -o ${LANG}.new.po ; then
+ if cmp ${LANG}.po ${LANG}.new.po > /dev/null 2>&1; then
+ rm -f ${LANG}.new.po
+ else
+ if mv -f ${LANG}.new.po ${LANG}.po; then
+ echo ""
+ else
+ echo "msgmerge for $LANG.po failed: cannot move $LANG.new.po to $LANG.po" 1>&2
+ rm -f ${LANG}.new.po
+ exit 1
+ fi
+ fi
+ else
+ echo "msgmerge for $LANG failed!"
+ rm -f ${LANG}.new.po
+ fi
+ fi
+ echo ""
+done
+
diff --git a/ug-nfc-setting-efl/po/zh_CN.po b/ug-nfc-setting-efl/po/zh_CN.po
new file mode 100755
index 0000000..7731686
--- /dev/null
+++ b/ug-nfc-setting-efl/po/zh_CN.po
@@ -0,0 +1,6 @@
+msgid "IDS_NFC_BODY_NFC"
+msgstr "NFC"
+
+msgid "IDS_NFC_POP_ACTIVATION"
+msgstr "启动"
+
diff --git a/ug-nfc-setting-efl/po/zh_HK.po b/ug-nfc-setting-efl/po/zh_HK.po
new file mode 100755
index 0000000..6d903f7
--- /dev/null
+++ b/ug-nfc-setting-efl/po/zh_HK.po
@@ -0,0 +1,6 @@
+msgid "IDS_NFC_BODY_NFC"
+msgstr "NFC"
+
+msgid "IDS_NFC_POP_ACTIVATION"
+msgstr "啟動"
+
diff --git a/ug-nfc-setting-efl/po/zh_TW.po b/ug-nfc-setting-efl/po/zh_TW.po
new file mode 100755
index 0000000..6d903f7
--- /dev/null
+++ b/ug-nfc-setting-efl/po/zh_TW.po
@@ -0,0 +1,6 @@
+msgid "IDS_NFC_BODY_NFC"
+msgstr "NFC"
+
+msgid "IDS_NFC_POP_ACTIVATION"
+msgstr "啟動"
+
diff --git a/ug-nfc-setting-efl/src/ug-nfc-setting-main.c b/ug-nfc-setting-efl/src/ug-nfc-setting-main.c
new file mode 100644
index 0000000..13471bf
--- /dev/null
+++ b/ug-nfc-setting-efl/src/ug-nfc-setting-main.c
@@ -0,0 +1,423 @@
+/*
+ * 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-main.h"
+
+#include <stdio.h>
+#include <Elementary.h>
+#include <Ecore.h>
+#include <bundle.h>
+#include <Ecore_X.h>
+#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_Object_Item *on_off_item = NULL;
+
+static void _change_nfc_setting(void)
+{
+ int status;
+ int result;
+
+ LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__);
+
+ if ((result = vconf_get_bool(VCONFKEY_NFC_STATE, &status)) == 0)
+ {
+ LOGD("[%s(): %d] vconf_get_bool status [%d]\n", __FUNCTION__, __LINE__, status);
+
+ nfc_manager_set_activation(!status, NULL, NULL);
+ }
+ else
+ {
+ LOGD("[%s(): %d] vconf_get_bool failed\n", __FUNCTION__, __LINE__);
+ }
+
+ LOGD("[%s(): %d] END <<<<", __FUNCTION__, __LINE__);
+}
+
+static void _vconf_key_cb(keynode_t *node, void *user_data)
+{
+ LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__);
+
+ if (node == NULL || user_data == NULL)
+ {
+ LOGE("[%s(): %d] abnormal parameter", __FUNCTION__, __LINE__);
+ return;
+ }
+
+ if (on_off_item != NULL)
+ elm_genlist_item_update(on_off_item);
+
+ LOGD("[%s(): %d] END <<<<", __FUNCTION__, __LINE__);
+}
+
+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_object_style_set(bg, "transparent");
+
+ elm_win_resize_object_add(win, bg);
+
+ evas_object_show(bg);
+
+ return bg;
+}
+
+static Evas_Object *_create_main_layout(Evas_Object* parent)
+{
+ Evas_Object *layout;
+
+ if (parent == NULL)
+ return NULL;
+
+ layout = elm_layout_add(parent);
+
+ elm_layout_theme_set(layout, "layout", "application", "default");
+
+ evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_win_resize_object_add(parent, layout);
+
+ evas_object_show(layout);
+
+ return layout;
+}
+
+// get the state of item
+static Eina_Bool _gl_state_get(void *data, Evas_Object *obj, const char *part)
+{
+ Eina_Bool result = EINA_FALSE;
+ int enable = 0;
+
+ LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__);
+
+ if (!vconf_get_bool(VCONFKEY_NFC_STATE, &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);
+ }
+
+ LOGD("[%s(): %d] END <<<<", __FUNCTION__, __LINE__);
+
+ return result;
+}
+
+// callback for 'deletion'
+static void _gl_del(void *data, Evas_Object *obj)
+{
+ LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__);
+ LOGD("[%s(): %d] END <<<<", __FUNCTION__, __LINE__);
+
+ return;
+}
+
+static void _gl_sel_activation(void *data, Evas_Object *obj, void *event_info)
+{
+ Elm_Object_Item *item = (Elm_Object_Item *)event_info;
+
+ LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__);
+
+ if (item == NULL)
+ {
+ LOGD("[%s(): %d] item is null\n", __FUNCTION__, __LINE__);
+ return;
+ }
+
+ ugdata_t *ug_data = (ugdata_t *)data;
+ if (ug_data == NULL)
+ {
+ LOGD("[%s(): %d] ug_data is null\n", __FUNCTION__, __LINE__);
+ goto ERROR;
+ }
+
+ elm_genlist_item_selected_set(item, 0);
+
+ _change_nfc_setting();
+
+ERROR :
+ elm_genlist_item_update(item);
+
+ LOGD("[%s(): %d] END <<<<", __FUNCTION__, __LINE__);
+}
+
+static void _nfc_on_off_changed_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ ugdata_t *ug_data = (ugdata_t *)data;
+ int state = 0;
+ int result = EINA_FALSE;
+
+ LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__);
+
+ _change_nfc_setting();
+
+ if (((result = vconf_get_bool(VCONFKEY_NFC_STATE, &state)) == 0) && (state != 0))
+ {
+ LOGD("[%s(): %d] vconf_get_bool true", __FUNCTION__, __LINE__);
+ elm_check_state_set(ug_data->check, EINA_TRUE);
+ }
+ else
+ {
+ LOGD("[%s(): %d] vconf_get_bool false or failed", __FUNCTION__, __LINE__);
+ elm_check_state_set(ug_data->check, EINA_FALSE);
+ }
+
+ LOGD("[%s(): %d] END <<<<", __FUNCTION__, __LINE__);
+}
+
+static Evas_Object *_gl_content_get(void *data, Evas_Object *obj, const char *part)
+{
+ LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__);
+ Evas_Object *content = NULL;
+ int on;
+ int result = EINA_FALSE;
+
+ ugdata_t *ug_data = (ugdata_t *)data;
+
+ if (ug_data == NULL)
+ {
+ 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))
+ {
+ LOGD("[%s(): %d] vconf_get_bool true", __FUNCTION__, __LINE__);
+ elm_check_state_set(ug_data->check, EINA_TRUE);
+ }
+ else
+ {
+ LOGD("[%s(): %d] vconf_get_bool false or failed", __FUNCTION__, __LINE__);
+ elm_check_state_set(ug_data->check, EINA_FALSE);
+ }
+
+ elm_object_style_set(content, "on&off");
+
+ LOGD("[%s(): %d] END <<<<", __FUNCTION__, __LINE__);
+
+ return content;
+}
+
+static char *_gl_text_get_onoff(void *data, Evas_Object *obj, const char *part)
+{
+ LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__);
+ char *text = NULL;
+
+ text = strdup(IDS_ACTIVATION);
+
+ LOGD("[%s(): %d] END <<<<", __FUNCTION__, __LINE__);
+ return text;
+}
+
+static Evas_Object *_ug_nfc_create_setting_layout(void* data)
+{
+ ugdata_t* ug_data = (ugdata_t*)data;
+ Evas_Object* layout = NULL;
+ Evas_Object *genlist = NULL;
+
+ layout = elm_layout_add(ug_data->base_naviframe);
+ elm_layout_theme_set(layout, "layout", "application", "noindicator");
+ 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);
+
+ genlist = elm_genlist_add(layout);
+ if (genlist == NULL)
+ {
+ LOGD("[%s(): %d] genlist is null", __FUNCTION__, __LINE__);
+ return NULL;
+ }
+ elm_genlist_bounce_set(genlist, EINA_FALSE, EINA_FALSE);
+
+ itc_seperator.item_style = "grouptitle.dialogue.seperator";
+ itc_seperator.func.text_get = NULL;
+ itc_seperator.func.content_get = NULL;
+ 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;
+
+ // 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);
+
+ evas_object_show(genlist);
+ elm_object_part_content_set(layout, "elm.swallow.content", genlist);
+
+ return layout;
+}
+
+static void _back_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ ug_destroy_me(data);
+}
+
+static void *__ug_nfc_setting_create(struct ui_gadget *ug, enum ug_mode mode, bundle *bd, void *user_data)
+{
+ ugdata_t* ug_data = (ugdata_t*)user_data;
+ Evas_Object* parent = NULL;
+ Evas_Object* nfc_setting_layout = NULL;
+ Evas_Object* l_button = NULL;
+
+ parent = ug_get_parent_layout(ug);
+ if (!parent)
+ return NULL;
+
+ /* set text domain */
+ bindtextdomain(NFCUG_TEXT_DOMAIN, NFCUG_LOCALEDIR);
+
+ ug_data->ug_win_main = parent;
+ ug_data->nfc_setting_ug = ug;
+
+ ug_data->base_layout = _create_main_layout(ug_data->ug_win_main);
+ ug_data->bg = _create_bg(ug_data->base_layout);
+ elm_object_part_content_set(ug_data->base_layout, "elm.swallow.bg", ug_data->bg);
+
+ 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);
+
+ nfc_setting_layout = _ug_nfc_create_setting_layout(ug_data);
+ if (nfc_setting_layout == NULL)
+ return NULL;
+
+ 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");
+ elm_object_style_set(l_button, "naviframe/back_btn/default");
+
+ return ug_data->base_layout;
+}
+
+static void __ug_nfc_setting_destroy(struct ui_gadget *ug, bundle *bd, void *user_data)
+{
+ ugdata_t *ug_data = (ugdata_t *)user_data;
+
+ 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);
+
+ evas_object_del(ug_get_layout(ug));
+}
+
+static void __ug_nfc_setting_start(struct ui_gadget *ug, bundle *bd, void *user_data)
+{
+}
+
+static void __ug_nfc_setting_pause(struct ui_gadget *ug, bundle *bd, void *user_data)
+{
+}
+
+static void __ug_nfc_setting_resume(struct ui_gadget *ug, bundle *bd, void *user_data)
+{
+}
+
+static void __ug_nfc_setting_message(struct ui_gadget *ug, bundle *msg, bundle *bd, void *user_data)
+{
+}
+
+static void __ug_nfc_setting_event(struct ui_gadget *ug, enum ug_event event, bundle *bd, void *user_data)
+{
+}
+
+UG_MODULE_API int UG_MODULE_INIT(struct ug_module_ops *ops)
+{
+ LOGD("[%s(): %d] UG_MODULE_INIT!!\n", __FUNCTION__, __LINE__);
+
+ ugdata_t *ug_data; // User defined private data
+ if (!ops)
+ return -1;
+
+ //app_data = calloc(1, sizeof(struct ugdata));
+ ug_data = (ugdata_t *)malloc(sizeof(ugdata_t));
+ if (!ug_data)
+ return -1;
+
+ ops->create = __ug_nfc_setting_create;
+ ops->start = __ug_nfc_setting_start;
+ ops->pause = __ug_nfc_setting_pause;
+ ops->resume = __ug_nfc_setting_resume;
+ ops->destroy = __ug_nfc_setting_destroy;
+ ops->message = __ug_nfc_setting_message;
+ ops->event = __ug_nfc_setting_event;
+ ops->priv = ug_data;
+ ops->opt = UG_OPT_INDICATOR_ENABLE;
+
+ return 0;
+}
+
+UG_MODULE_API void UG_MODULE_EXIT(struct ug_module_ops *ops)
+{
+ ugdata_t* ug_data;
+
+ if (!ops)
+ return;
+
+ ug_data = ops->priv;
+
+ if (ug_data)
+ free(ug_data);
+
+ ops->priv = NULL;
+}
diff --git a/ug-nfc-share-efl/CMakeLists.txt b/ug-nfc-share-efl/CMakeLists.txt
new file mode 100644
index 0000000..7750571
--- /dev/null
+++ b/ug-nfc-share-efl/CMakeLists.txt
@@ -0,0 +1,71 @@
+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}")
+
+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
+)
+
+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/data/edc/ug-nfc-share-efl.edc b/ug-nfc-share-efl/data/edc/ug-nfc-share-efl.edc
new file mode 100644
index 0000000..796fd21
--- /dev/null
+++ b/ug-nfc-share-efl/data/edc/ug-nfc-share-efl.edc
@@ -0,0 +1,96 @@
+/*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+
+ * http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+collections {
+ group{
+ name: "share_via_nfc";
+ parts
+ {
+ part
+ {
+ name: "label_name";
+ type: SWALLOW;
+ 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;}
+ 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;}
+ align: 0 0;
+ }
+ }
+
+ part
+ {
+ name: "touch_image";
+ type: SWALLOW;
+ scale: 1;
+ 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;
+ }
+ }
+ part
+ {
+ name: "label_cancel_message";
+ type: SWALLOW;
+ 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;
+ }
+ }
+
+ part
+ {
+ name: "cancel_button";
+ type: SWALLOW;
+ scale: 1;
+ description
+ {
+ state: "default" 0.0;
+ rel1{relative: 0 1020/1130; offset:20 0;}
+ rel2{relative: 1 1100/1130; offset: -20 0;}
+ align:0 0;
+ }
+ }
+
+ }
+ }
+}
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
new file mode 100644
index 0000000..53d145a
--- /dev/null
+++ b/ug-nfc-share-efl/data/images/U05_AfterSelect_Share_help.png
Binary files differ
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
new file mode 100644
index 0000000..2ecc2a9
--- /dev/null
+++ b/ug-nfc-share-efl/data/images/U05_AfterSelect_Write_help.png
Binary files differ
diff --git a/ug-nfc-share-efl/data/images/U05_AfterSelect_bookmark.png b/ug-nfc-share-efl/data/images/U05_AfterSelect_bookmark.png
new file mode 100755
index 0000000..c49ffd9
--- /dev/null
+++ b/ug-nfc-share-efl/data/images/U05_AfterSelect_bookmark.png
Binary files differ
diff --git a/ug-nfc-share-efl/data/images/U05_AfterSelect_contact.png b/ug-nfc-share-efl/data/images/U05_AfterSelect_contact.png
new file mode 100755
index 0000000..4604b59
--- /dev/null
+++ b/ug-nfc-share-efl/data/images/U05_AfterSelect_contact.png
Binary files differ
diff --git a/ug-nfc-share-efl/data/images/U05_AfterSelect_memo.png b/ug-nfc-share-efl/data/images/U05_AfterSelect_memo.png
new file mode 100755
index 0000000..cfd2516
--- /dev/null
+++ b/ug-nfc-share-efl/data/images/U05_AfterSelect_memo.png
Binary files differ
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
new file mode 100644
index 0000000..d308502
--- /dev/null
+++ b/ug-nfc-share-efl/include/ug-nfc-share-common-debug.h
@@ -0,0 +1,116 @@
+/*
+ * 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_SHARE_DEBUG_H__
+#define __UG_NFC_SHARE_DEBUG_H__
+
+#define COLOR_RED "\033[0;31m"
+#define COLOR_GREEN "\033[0;32m"
+#define COLOR_BROWN "\033[0;33m"
+#define COLOR_BLUE "\033[0;34m"
+#define COLOR_PURPLE "\033[0;35m"
+#define COLOR_CYAN "\033[0;36m"
+#define COLOR_LIGHTBLUE "\033[0;37m"
+#define COLOR_END "\033[0;m"
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+
+#define LOG_TAG "UG_NFC_SHARE_EFL"
+
+#define UG_NFC_SHARE_ENABLE_DLOG
+
+#ifdef UG_NFC_SHARE_ENABLE_DLOG
+#define UG_NFC_SHARE_DEBUG(fmt, ...)\
+ do\
+ {\
+ LOGD("[%s(): %d]" fmt, __FUNCTION__, __LINE__,##__VA_ARGS__);\
+ } while (0)
+
+#define UG_NFC_SHARE_DEBUG_ERR(fmt, ...)\
+ do\
+ {\
+ LOGE(COLOR_RED"[%s(): %d]" fmt COLOR_END, __FUNCTION__, __LINE__,##__VA_ARGS__);\
+ }while (0)
+
+#define UG_NFC_SHARE_BEGIN() \
+ do\
+ {\
+ LOGD(COLOR_BLUE"[%s(): %d] BEGIN >>>>"COLOR_END, __FUNCTION__ ,__LINE__);\
+ } while( 0 )
+
+#define UG_NFC_SHARE_END() \
+ do\
+ {\
+ LOGD(COLOR_BLUE"[%s(): %d] END <<<<"COLOR_END, __FUNCTION__,__LINE__ );\
+ } \
+ while( 0 )
+
+#else
+#define UG_NFC_SHARE_DEBUG(fmt, ...) \
+ do\
+ {\
+ printf("\n [%s: %s: %s(): %d] " fmt"\n", APPNAME, rindex(__FILE__, '/')+1, __FUNCTION__, __LINE__, ##__VA_ARGS__);\
+ } while (0)
+
+#define UG_NFC_SHARE_BEGIN() \
+ do\
+ {\
+ printf("\n [%s: %s: %d] : BEGIN >>>> %s() \n", APPNAME, rindex(__FILE__, '/')+1, __LINE__ , __FUNCTION__);\
+ } while( 0 )
+
+#define UG_NFC_SHARE_END() \
+ do\
+ {\
+ printf("\n [%s: %s: %d]: END <<<< %s()\n", APPNAME, rindex(__FILE__, '/')+1, __LINE__ , __FUNCTION__); \
+ } \
+ while( 0 )
+#endif
+
+
+#define ret_if(expr) do { \
+ if(expr) { \
+ UG_NFC_SHARE_DEBUG_ERR("(%s) ", #expr); \
+ UG_NFC_SHARE_END();\
+ return; \
+ } \
+} while (0)
+#define retm_if(expr, fmt, arg...) do { \
+ if(expr) { \
+ UG_NFC_SHARE_DEBUG_ERR("(%s) "fmt, #expr, ##arg); \
+ UG_NFC_SHARE_END();\
+ return; \
+ } \
+ } while (0)
+#define retv_if(expr, val) do { \
+ if(expr) { \
+ UG_NFC_SHARE_DEBUG_ERR("(%s) ", #expr); \
+ UG_NFC_SHARE_END();\
+ return (val); \
+ } \
+ } while (0)
+#define retvm_if(expr, val, fmt, arg...) do { \
+ if(expr) { \
+ UG_NFC_SHARE_DEBUG_ERR("(%s) "fmt, #expr, ##arg); \
+ UG_NFC_SHARE_END();\
+ return (val); \
+ } \
+} while (0)
+
+
+#endif /*__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
new file mode 100644
index 0000000..fd8029f
--- /dev/null
+++ b/ug-nfc-share-efl/include/ug-nfc-share-common-error.h
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+
+ * http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __UG_NFC_SHARE_ERROR_H__
+#define __UG_NFC_SHARE_ERROR_H__
+
+typedef enum{
+ UG_NFC_SHARE_ERROR = -1,
+ UG_NFC_SHARE_OK = 0
+}ug_nfc_share_result_e;
+
+#endif /*__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
new file mode 100644
index 0000000..24bbcda
--- /dev/null
+++ b/ug-nfc-share-efl/include/ug-nfc-share-common-util.h
@@ -0,0 +1,212 @@
+/*
+ * 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_SHARE_COMMON_UTIL_H__
+#define __UG_NFC_SHARE_COMMON_UTIL_H__
+
+#include <glib.h>
+#include <assert.h>
+#include <dlog.h>
+
+#define _STRNCPY(DEST, SRC, LEN) _strncpy(DEST, SRC, LEN , __FILE__, __LINE__)
+#define _STRCAT(DEST, SRC, DEST_SIZE) _strcat(DEST, SRC, DEST_SIZE, __FILE__, __LINE__)
+#define _STRCMP(SRC1, SRC2) _strcmp(SRC1, SRC2, __FILE__, __LINE__)
+
+char* _strncpy(char* dest, const char* src, int len, char* file, int line);
+char* _strcat(char* dest, const char* src, int dest_size, char* file, int line);
+int _strcmp(const char* src1, const char* src2, char* file, int line);
+
+
+#define UG_NFC_SHARE_MAX_HEAP_SIZE 5*1024*1024
+
+#ifdef _UG_NFC_SHARE_MEM_TRACE_
+
+typedef struct _ug_nfc_share_mem_unit_t ug_nfc_share_mem_unit_t;
+struct _ug_nfc_share_mem_unit_t
+{
+ void* address;
+ gint size;
+ gchar *func_name;
+ gint line;
+ ug_nfc_share_mem_unit_t *next;
+ ug_nfc_share_mem_unit_t *prev;
+};
+
+void ug_nfc_share_memory_unit_add(gchar *func_name, gint line_num, void* pMemory, gint size);
+void ug_nfc_share_memory_unit_delete(void* pMemory);
+void ug_nfc_share_memory_print_list(void);
+
+
+#define _EDJ(obj) elm_layout_edje_get(obj)
+
+#define UG_NFC_SHARE_MEM_MALLOC(ptr,no_elements,type) \
+ do{\
+ if((gint)(no_elements)<=0)\
+ {\
+ ptr = NULL;\
+ }\
+ else if(UG_NFC_SHARE_MAX_HEAP_SIZE<(gint)(no_elements)*sizeof(type))\
+ {\
+ assert(0);\
+ }\
+ else\
+ {\
+ ptr=(type*)g_malloc0((gint)(no_elements)*sizeof(type));\
+ assert(ptr);\
+ UG_NFC_SHARE_DEBUG("Allocate memory. pointer:%p\n", ptr);\
+ gchar *func_name = g_malloc0(sizeof(__FUNCTION__));\
+ snprintf(func_name, sizeof(__FUNCTION__), __FUNCTION__);\
+ ug_nfc_share_memory_unit_add(func_name, __LINE__, ptr, (no_elements)*sizeof(type));\
+ }\
+ }while(0)
+
+#define UG_NFC_SHARE_MEM_STRDUP(ptr,str) \
+ do {\
+ if((str) != NULL)\
+ {\
+ ptr = g_strdup((const char *)(str));\
+ assert(ptr);\
+ UG_NFC_SHARE_DEBUG("Allocate memory. pointer:%p\n", (ptr));\
+ gchar *func_name = g_malloc0(sizeof(__FUNCTION__));\
+ snprintf(func_name, sizeof(__FUNCTION__), __FUNCTION__);\
+ ug_nfc_share_memory_unit_add(func_name, __LINE__, (ptr), (strlen(ptr)+1)*sizeof(char));\
+ }\
+ else\
+ {\
+ (ptr) = NULL;\
+ }\
+ }while(0)
+
+#define UG_NFC_SHARE_MEM_STRNDUP(ptr,str,buf_size)\
+ do {\
+ if((str) != NULL && (buf_size) >= 0 )\
+ {\
+ ptr = g_strndup((const char *)(str),(buf_size));\
+ assert(ptr);\
+ UG_NFC_SHARE_DEBUG("Allocate memory. pointer:%p\n", (ptr));\
+ gchar *func_name = g_malloc0(sizeof(__FUNCTION__));\
+ snprintf(func_name, sizeof(__FUNCTION__), __FUNCTION__);\
+ ug_nfc_share_memory_unit_add(func_name, __LINE__, (ptr), (strlen(ptr)+1)*sizeof(char));\
+ }\
+ else\
+ {\
+ (ptr) = NULL;\
+ }\
+ }while(0)
+
+#define UG_NFC_SHARE_MEM_MEMDUP(ptr,src,buf_size)\
+ do {\
+ if((src) != NULL && (buf_size) >= 0 )\
+ {\
+ ptr = g_malloc0((buf_size));\
+ assert(ptr);\
+ memcpy((ptr), (void *)(src),(buf_size));\
+ UG_NFC_SHARE_DEBUG("Allocate memory. pointer:%p\n", (ptr));\
+ gchar *func_name = g_malloc0(sizeof(__FUNCTION__));\
+ snprintf(func_name, sizeof(__FUNCTION__), __FUNCTION__);\
+ ug_nfc_share_memory_unit_add(func_name, __LINE__, (ptr), (strlen(ptr)+1)*sizeof(char));\
+ }\
+ else\
+ {\
+ (ptr) = NULL;\
+ }\
+ }while(0)
+
+#define UG_NFC_SHARE_MEM_FREE(ptr) \
+ do {\
+ if(ptr != NULL)\
+ {\
+ UG_NFC_SHARE_DEBUG("Free memory. pointer:%p\n", ptr);\
+ ug_nfc_share_memory_unit_delete( ptr );\
+ g_free(ptr);\
+ ptr = NULL;\
+ }\
+ }while(0)
+
+#else /* _UG_NFC_SHARE_MEM_TRACE_ */
+
+#define UG_NFC_SHARE_MEM_MALLOC(ptr,no_elements,type) \
+ do{\
+ if((gint)(no_elements)<=0)\
+ {\
+ ptr=NULL;\
+ }\
+ else if(UG_NFC_SHARE_MAX_HEAP_SIZE<(gint)(no_elements)*sizeof(type))\
+ {\
+ assert(0);\
+ }\
+ else\
+ {\
+ ptr=(type*)g_malloc0((gint)(no_elements)*sizeof(type));\
+ assert(ptr);\
+ }\
+ }while(0)
+
+#define UG_NFC_SHARE_MEM_STRDUP(ptr,str) \
+ do {\
+ if((str) != NULL)\
+ {\
+ ptr = g_strdup((const char *)(str));\
+ assert(ptr);\
+ }\
+ else\
+ {\
+ (ptr) = NULL;\
+ }\
+ }while(0)
+
+#define UG_NFC_SHARE_MEM_STRNDUP(ptr,str,buf_size)\
+ do {\
+ if((str) != NULL && (buf_size) >= 0 )\
+ {\
+ ptr = g_strndup((const char *)(str),(buf_size));\
+ assert(ptr);\
+ }\
+ else\
+ {\
+ (ptr) = NULL;\
+ }\
+ }while(0)
+
+#define UG_NFC_SHARE_MEM_MEMDUP(ptr,src,buf_size)\
+ do {\
+ if((src) != NULL && (buf_size) >= 0 )\
+ {\
+ ptr = g_malloc0((buf_size));\
+ assert(ptr);\
+ memcpy((ptr), (void *)(src),(buf_size));\
+ }\
+ else\
+ {\
+ (ptr) = NULL;\
+ }\
+ }while(0)
+
+#define UG_NFC_SHARE_MEM_FREE(ptr) \
+ do {\
+ if(ptr != NULL)\
+ {\
+ g_free(ptr);\
+ ptr = NULL;\
+ }\
+ }while(0)
+
+#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
new file mode 100644
index 0000000..cc3988d
--- /dev/null
+++ b/ug-nfc-share-efl/include/ug-nfc-share-main.h
@@ -0,0 +1,136 @@
+/*
+ * 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_SHARE_MAIN_H__
+#define __UG_NFC_SHARE_MAIN_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#include <ui-gadget-module.h>
+#include <Evas.h>
+#include <Elementary.h>
+#include <dlog.h>
+#include <stdbool.h>
+#include <string.h>
+#include <appsvc.h>
+
+#include <appcore-efl.h>
+#include <Ecore_X.h>
+#include <utilX.h>
+
+#include <assert.h>
+#include <glib.h>
+
+#include <nfc.h>
+
+#include "ug-nfc-share-common-error.h"
+#include "ug-nfc-share-common-debug.h"
+#include "ug-nfc-share-common-util.h"
+
+#define PACKAGE "ug-share-nfc-efl"
+#ifdef PREFIX
+#undef PREFIX
+#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 LOCALE_PATH PREFIX"/res/locale"
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+
+#define LOG_TAG "UG_NFC_SHARE_EFL"
+
+#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) : "")
+
+#define UG_NFC_SHARE_HANDOVER_FILE_SIZE (10 * 1024) /* 10kB */
+#define UG_NFC_SHARE_DB_MAX_ROW_COUNT 100
+
+
+/* Buffer length for Text */
+#define POPUP_TEXT_SIZE 1024
+#define LABEL_TEXT_SIZE 1024
+
+#define NFCUG_TEXT_DOMAIN PACKAGE
+#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_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?")
+
+/* 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")
+
+/**** 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_type;
+
+
+typedef struct _ugdata_t
+{
+ Evas_Object* ug_win_main;
+ struct ui_gadget *nfc_share_ug;
+ Evas_Object* base_layout;
+ Evas_Object *bg;
+
+ Evas_Object* base_naviframe;
+ Elm_Object_Item *base_navi_it;
+
+ nfc_ndef_message_h current_ndef;
+ char *uri;
+}ugdata_t;
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*__UG_NFC_SHARE_MAIN_H__*/
diff --git a/ug-nfc-share-efl/include/ug-nfc-share-popup.h b/ug-nfc-share-efl/include/ug-nfc-share-popup.h
new file mode 100644
index 0000000..f7d7441
--- /dev/null
+++ b/ug-nfc-share-efl/include/ug-nfc-share-popup.h
@@ -0,0 +1,57 @@
+/*
+ * 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_SHARE_POPUP_H__
+#define __UG_NFC_SHARE_POPUP_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#include "ug-nfc-share-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_share_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_share_close_popup(Evas_Object* popup);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /*__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
new file mode 100644
index 0000000..734185a
--- /dev/null
+++ b/ug-nfc-share-efl/include/ug-nfc-share-tag.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+
+ * http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __UG_NFC_SHARE_TAG_H__
+#define __UG_NFC_SHARE_TAG_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#include "ug-nfc-share-main.h"
+
+#define UG_NFC_SHARE_LAST_FILE_NUMBER_KEY "db/nfc/last_file_number"
+#define UG_NFC_SHARE_FILE_NAME_PREFIX _("nfc_receive_file_")
+
+/* get and set function */
+char* ug_nfc_share_get_display_str(void);
+void ug_nfc_share_set_display_str(const char* text);
+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 */
+char *ug_nfc_share_get_display_text_from_ndef(ug_nfc_share_tag_type record_type, nfc_ndef_message_h ndef_msg);
+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);
+void ug_nfc_unset_nfc_callback(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*__UG_NFC_SHARE_MAIN_H__*/
diff --git a/ug-nfc-share-efl/po/CMakeLists.txt b/ug-nfc-share-efl/po/CMakeLists.txt
new file mode 100755
index 0000000..85343f9
--- /dev/null
+++ b/ug-nfc-share-efl/po/CMakeLists.txt
@@ -0,0 +1,25 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 0.1)
+PROJECT(ug-share-nfc-efl C)
+
+SET(POFILES en.po nl_NL.po de_DE.po zh_HK.po zh_CN.po ru_RU.po ko_KR.po zh_TW.po ja_JP.po es_ES.po el_GR.po it_IT.po tr_TR.po pt_PT.po fr_FR.po)
+
+SET(MSGFMT "/usr/bin/msgfmt")
+
+FOREACH(pofile ${POFILES})
+ SET(pofile ${CMAKE_CURRENT_SOURCE_DIR}/${pofile})
+ MESSAGE("PO: ${pofile}")
+ GET_FILENAME_COMPONENT(absPofile ${pofile} ABSOLUTE)
+ GET_FILENAME_COMPONENT(lang ${absPofile} NAME_WE)
+ SET(moFile ${CMAKE_CURRENT_BINARY_DIR}/${lang}.mo)
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${moFile}
+ COMMAND ${MSGFMT} -o ${moFile} ${absPofile}
+ DEPENDS ${absPofile}
+ )
+ INSTALL(FILES ${moFile}
+ DESTINATION res/locale/${lang}/LC_MESSAGES RENAME ${PROJECT_NAME}.mo)
+ SET(moFiles ${moFiles} ${moFile})
+ENDFOREACH(pofile)
+
+MESSAGE(".mo files: ${moFiles}")
+ADD_CUSTOM_TARGET(po ALL DEPENDS ${moFiles})
diff --git a/ug-nfc-share-efl/po/POTFILES.in b/ug-nfc-share-efl/po/POTFILES.in
new file mode 100755
index 0000000..2068f24
--- /dev/null
+++ b/ug-nfc-share-efl/po/POTFILES.in
@@ -0,0 +1,3 @@
+# List of source files containing translatable strings.
+./src/ug-nfc-share-main.c
+./src/ug-nfc-share-tag.c
diff --git a/ug-nfc-share-efl/po/de_DE.po b/ug-nfc-share-efl/po/de_DE.po
new file mode 100755
index 0000000..f29c411
--- /dev/null
+++ b/ug-nfc-share-efl/po/de_DE.po
@@ -0,0 +1,21 @@
+msgid "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL"
+msgstr "Tippen Sie auf „Abbrechen“, um die Freigabe abzubrechen"
+
+msgid "IDS_NFC_HEADER_SHARE_VIA_NFC"
+msgstr "Über NFC freigeben"
+
+msgid "IDS_NFC_POP_FAILED_TO_SHARE_TAG"
+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"
+
diff --git a/ug-nfc-share-efl/po/el_GR.po b/ug-nfc-share-efl/po/el_GR.po
new file mode 100755
index 0000000..cb5124e
--- /dev/null
+++ b/ug-nfc-share-efl/po/el_GR.po
@@ -0,0 +1,21 @@
+msgid "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL"
+msgstr "Για να ακυρώσετε την κοινή χρήση, πατήστε “Άκυρο”"
+
+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_PS_TAG_SHARED"
+msgstr "Έγινε κοινή χρήση της ετικέτας %s"
+
+msgid "IDS_NFC_POP_TRANSFER_FAILED"
+msgstr "Σφάλμα μεταφοράς"
+
+msgid "IDS_NFC_BODY_PS_SELECTED"
+msgstr "Επιλέχθηκε το %s"
+
diff --git a/ug-nfc-share-efl/po/en.po b/ug-nfc-share-efl/po/en.po
new file mode 100755
index 0000000..907749e
--- /dev/null
+++ b/ug-nfc-share-efl/po/en.po
@@ -0,0 +1,21 @@
+msgid "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL"
+msgstr "To cancel sharing, tap Cancel"
+
+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_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"
+
diff --git a/ug-nfc-share-efl/po/es_ES.po b/ug-nfc-share-efl/po/es_ES.po
new file mode 100755
index 0000000..6746300
--- /dev/null
+++ b/ug-nfc-share-efl/po/es_ES.po
@@ -0,0 +1,21 @@
+msgid "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL"
+msgstr "Para detener el uso compartido, pulse Cancelar"
+
+msgid "IDS_NFC_HEADER_SHARE_VIA_NFC"
+msgstr "Compartir mediante NFC"
+
+msgid "IDS_NFC_POP_FAILED_TO_SHARE_TAG"
+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"
+
diff --git a/ug-nfc-share-efl/po/fr_FR.po b/ug-nfc-share-efl/po/fr_FR.po
new file mode 100755
index 0000000..e577c3a
--- /dev/null
+++ b/ug-nfc-share-efl/po/fr_FR.po
@@ -0,0 +1,21 @@
+msgid "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL"
+msgstr "Pour annuler le partage, appuyez sur Annuler"
+
+msgid "IDS_NFC_HEADER_SHARE_VIA_NFC"
+msgstr "Partager via NFC"
+
+msgid "IDS_NFC_POP_FAILED_TO_SHARE_TAG"
+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"
+
+msgid "IDS_NFC_BODY_PS_SELECTED"
+msgstr "%s sélectionné"
+
diff --git a/ug-nfc-share-efl/po/it_IT.po b/ug-nfc-share-efl/po/it_IT.po
new file mode 100755
index 0000000..aee0d88
--- /dev/null
+++ b/ug-nfc-share-efl/po/it_IT.po
@@ -0,0 +1,21 @@
+msgid "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL"
+msgstr "Per annullare la condivisione, toccare Annulla"
+
+msgid "IDS_NFC_HEADER_SHARE_VIA_NFC"
+msgstr "Condividi con NFC"
+
+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"
+
+msgid "IDS_NFC_POP_TRANSFER_FAILED"
+msgstr "Errore trasferimento"
+
+msgid "IDS_NFC_BODY_PS_SELECTED"
+msgstr "%s selezionato"
+
diff --git a/ug-nfc-share-efl/po/ja_JP.po b/ug-nfc-share-efl/po/ja_JP.po
new file mode 100755
index 0000000..e63961a
--- /dev/null
+++ b/ug-nfc-share-efl/po/ja_JP.po
@@ -0,0 +1,21 @@
+msgid "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL"
+msgstr "共有を解除するには、[キャンセル]をタップしてください。"
+
+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_PS_TAG_SHARED"
+msgstr "%sタグを共有しました。"
+
+msgid "IDS_NFC_POP_TRANSFER_FAILED"
+msgstr "転送​に​失敗​しました"
+
+msgid "IDS_NFC_BODY_PS_SELECTED"
+msgstr "%s​が​選択​されました"
+
diff --git a/ug-nfc-share-efl/po/ko_KR.po b/ug-nfc-share-efl/po/ko_KR.po
new file mode 100755
index 0000000..5a4ecaa
--- /dev/null
+++ b/ug-nfc-share-efl/po/ko_KR.po
@@ -0,0 +1,21 @@
+msgid "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL"
+msgstr "공유를 취소하려면 [취소]를 누르세요"
+
+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_PS_TAG_SHARED"
+msgstr "%s 태그가 공유되었습니다"
+
+msgid "IDS_NFC_POP_TRANSFER_FAILED"
+msgstr "연결하지 못하였습니다"
+
+msgid "IDS_NFC_BODY_PS_SELECTED"
+msgstr "%s가 선택되었습니다"
+
diff --git a/ug-nfc-share-efl/po/nl_NL.po b/ug-nfc-share-efl/po/nl_NL.po
new file mode 100755
index 0000000..2d2ac1f
--- /dev/null
+++ b/ug-nfc-share-efl/po/nl_NL.po
@@ -0,0 +1,21 @@
+msgid "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL"
+msgstr "Tik op Annuleren om delen te annuleren"
+
+msgid "IDS_NFC_HEADER_SHARE_VIA_NFC"
+msgstr "Delen via NFC"
+
+msgid "IDS_NFC_POP_FAILED_TO_SHARE_TAG"
+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"
+
diff --git a/ug-nfc-share-efl/po/pt_PT.po b/ug-nfc-share-efl/po/pt_PT.po
new file mode 100755
index 0000000..982c0bc
--- /dev/null
+++ b/ug-nfc-share-efl/po/pt_PT.po
@@ -0,0 +1,21 @@
+msgid "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL"
+msgstr "Para cancelar a partilha, toque em Cancelar"
+
+msgid "IDS_NFC_HEADER_SHARE_VIA_NFC"
+msgstr "Partilhar via NFC"
+
+msgid "IDS_NFC_POP_FAILED_TO_SHARE_TAG"
+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"
+
diff --git a/ug-nfc-share-efl/po/ru_RU.po b/ug-nfc-share-efl/po/ru_RU.po
new file mode 100755
index 0000000..32c4793
--- /dev/null
+++ b/ug-nfc-share-efl/po/ru_RU.po
@@ -0,0 +1,21 @@
+msgid "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL"
+msgstr "Чтобы не предоставлять доступ, нажмите Отмена"
+
+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_PS_TAG_SHARED"
+msgstr "Метка %s отправлена"
+
+msgid "IDS_NFC_POP_TRANSFER_FAILED"
+msgstr "Сбой перевода"
+
+msgid "IDS_NFC_BODY_PS_SELECTED"
+msgstr "Выбрано: %s"
+
diff --git a/ug-nfc-share-efl/po/tr_TR.po b/ug-nfc-share-efl/po/tr_TR.po
new file mode 100755
index 0000000..6b3d071
--- /dev/null
+++ b/ug-nfc-share-efl/po/tr_TR.po
@@ -0,0 +1,21 @@
+msgid "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL"
+msgstr "Paylaşmayı iptal etmek için, İptal'e basın"
+
+msgid "IDS_NFC_HEADER_SHARE_VIA_NFC"
+msgstr "NFC ile paylaş"
+
+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ı"
+
+msgid "IDS_NFC_POP_TRANSFER_FAILED"
+msgstr "Transfer başarısız"
+
+msgid "IDS_NFC_BODY_PS_SELECTED"
+msgstr "%s seçildi"
+
diff --git a/ug-nfc-share-efl/po/update-po.sh b/ug-nfc-share-efl/po/update-po.sh
new file mode 100755
index 0000000..f23c1fa
--- /dev/null
+++ b/ug-nfc-share-efl/po/update-po.sh
@@ -0,0 +1,57 @@
+#!/bin/sh
+
+PACKAGE=infoalarm
+SRCROOT=..
+POTFILES=POTFILES.in
+
+#ALL_LINGUAS= am az be ca cs da de el en_CA en_GB es et fi fr hr hu it ja ko lv mk ml ms nb ne nl pa pl pt pt_BR ru rw sk sl sr sr@Latn sv ta tr uk vi zh_CN zh_TW
+ALL_LINGUAS="en_US en_GB ja ko zh_CN"
+
+XGETTEXT=/usr/bin/xgettext
+MSGMERGE=/usr/bin/msgmerge
+
+echo -n "Make ${PACKAGE}.pot "
+if [ ! -e $POTFILES ] ; then
+ echo "$POTFILES not found"
+ exit 1
+fi
+
+$XGETTEXT --default-domain=${PACKAGE} --directory=${SRCROOT} \
+ --add-comments --keyword --keyword=_ --keyword=N_ --files-from=$POTFILES \
+&& test ! -f ${PACKAGE}.po \
+ || (rm -f ${PACKAGE}.pot && mv ${PACKAGE}.po ${PACKAGE}.pot)
+
+if [ $? -ne 0 ]; then
+ echo "error"
+ exit 1
+else
+ echo "done"
+fi
+
+for LANG in $ALL_LINGUAS; do
+ echo "$LANG : "
+
+ if [ ! -e $LANG.po ] ; then
+ sed 's/CHARSET/UTF-8/g' ${PACKAGE}.pot > ${LANG}.po
+ echo "${LANG}.po created"
+ else
+ if $MSGMERGE ${LANG}.po ${PACKAGE}.pot -o ${LANG}.new.po ; then
+ if cmp ${LANG}.po ${LANG}.new.po > /dev/null 2>&1; then
+ rm -f ${LANG}.new.po
+ else
+ if mv -f ${LANG}.new.po ${LANG}.po; then
+ echo ""
+ else
+ echo "msgmerge for $LANG.po failed: cannot move $LANG.new.po to $LANG.po" 1>&2
+ rm -f ${LANG}.new.po
+ exit 1
+ fi
+ fi
+ else
+ echo "msgmerge for $LANG failed!"
+ rm -f ${LANG}.new.po
+ fi
+ fi
+ echo ""
+done
+
diff --git a/ug-nfc-share-efl/po/zh_CN.po b/ug-nfc-share-efl/po/zh_CN.po
new file mode 100755
index 0000000..3618cf2
--- /dev/null
+++ b/ug-nfc-share-efl/po/zh_CN.po
@@ -0,0 +1,21 @@
+msgid "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL"
+msgstr "若要取消共享,点击取消"
+
+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_PS_TAG_SHARED"
+msgstr "%s 标签已共享"
+
+msgid "IDS_NFC_POP_TRANSFER_FAILED"
+msgstr "转换失败"
+
+msgid "IDS_NFC_BODY_PS_SELECTED"
+msgstr "已选择%s"
+
diff --git a/ug-nfc-share-efl/po/zh_HK.po b/ug-nfc-share-efl/po/zh_HK.po
new file mode 100755
index 0000000..02d0c74
--- /dev/null
+++ b/ug-nfc-share-efl/po/zh_HK.po
@@ -0,0 +1,21 @@
+msgid "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL"
+msgstr "如要取消分享,輕觸取消"
+
+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_PS_TAG_SHARED"
+msgstr "%s 已分享標籤"
+
+msgid "IDS_NFC_POP_TRANSFER_FAILED"
+msgstr "傳送失敗"
+
+msgid "IDS_NFC_BODY_PS_SELECTED"
+msgstr "%s 已選擇"
+
diff --git a/ug-nfc-share-efl/po/zh_TW.po b/ug-nfc-share-efl/po/zh_TW.po
new file mode 100755
index 0000000..20c495e
--- /dev/null
+++ b/ug-nfc-share-efl/po/zh_TW.po
@@ -0,0 +1,21 @@
+msgid "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL"
+msgstr "若要取消分享,輕觸取消"
+
+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_PS_TAG_SHARED"
+msgstr "%s 已分享標籤"
+
+msgid "IDS_NFC_POP_TRANSFER_FAILED"
+msgstr "傳輸失敗"
+
+msgid "IDS_NFC_BODY_PS_SELECTED"
+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
new file mode 100644
index 0000000..1b6c3eb
--- /dev/null
+++ b/ug-nfc-share-efl/src/ug-nfc-share-common-util.c
@@ -0,0 +1,226 @@
+/*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+
+ * http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <string.h>
+
+#include "appsvc.h"
+#include <aul.h>
+
+#include "ug-nfc-share-common-util.h"
+#include "ug-nfc-share-common-debug.h"
+
+char* _strncpy(char* dest, const char* src, int len, char* file, int line)
+{
+ if(dest == NULL || src == NULL || len <= 0)
+ {
+ UG_NFC_SHARE_DEBUG_ERR("STRNCPY ERROR at %s(%d)", file, line);
+ return dest;
+ }
+
+ strncpy(dest, src, len);
+ dest[len] = '\0';
+
+ return dest;
+}
+
+char* _strcat(char* dest, const char* src, int dest_size, char* file, int line)
+{
+ if(dest == NULL || src == NULL || dest_size <= 0)
+ {
+ UG_NFC_SHARE_DEBUG_ERR("STRNCAT ERROR at %s(%d)", file, line);
+ return dest;
+ }
+
+ int ret_len = 0;
+
+ ret_len = g_strlcat(dest, src, dest_size);
+ if(ret_len >= dest_size)
+ {
+ UG_NFC_SHARE_DEBUG_ERR("STRNCAT SIZE ERROR at %s(%d)", file, line);
+ //return dest;
+ }
+ return dest;
+}
+
+int _strcmp(const char* src1, const char* src2, char* file, int line)
+{
+ if(src1 == NULL || src2 == NULL)
+ {
+ UG_NFC_SHARE_DEBUG_ERR("STRCMP ERROR at %s(%d)", file, line);
+ return -1;
+ }
+
+ return strcmp(src1, src2);
+}
+
+
+#ifdef _UG_NFC_SHARE_MEM_TRACE_
+static gint g_ug_nfc_share_total_memory_size = 0;
+static gint g_ug_nfc_share_peak_memory_size = 0;
+static ug_nfc_share_mem_unit_t *g_memory_unit_first = NULL;
+static ug_nfc_share_mem_unit_t *g_memory_unit_last = NULL;
+
+void ug_nfc_share_memory_unit_add(gchar *func_name, gint line_num, void* pMemory, gint size )
+{
+
+ ug_nfc_share_mem_unit_t * unit_mem;
+
+ if( g_memory_unit_first == NULL )
+ {
+ unit_mem = g_malloc0(sizeof(ug_nfc_share_mem_unit_t));
+ if( unit_mem == NULL )
+ {
+ UG_NFC_SHARE_DEBUG_ERR("\n\n ## [%s - %d] ## out of memory!\n\n", __FUNCTION__, __LINE__);
+ return ;
+ }
+ else
+ {
+ unit_mem->size = size;
+ unit_mem->address = pMemory;
+ unit_mem->func_name = func_name;
+ unit_mem->line = line_num;
+ unit_mem->next = NULL;
+ unit_mem->prev = NULL;
+ }
+ g_memory_unit_first = unit_mem;
+ g_memory_unit_last = unit_mem;
+ }
+ else
+ {
+ unit_mem = g_malloc0(sizeof(ug_nfc_share_mem_unit_t));
+ if( unit_mem == NULL )
+ {
+ UG_NFC_SHARE_DEBUG_ERR("\n\n ## [%s - %d] ## out of memory!\n\n", __FUNCTION__, __LINE__);
+ return ;
+ }
+ else
+ {
+ unit_mem->size = size;
+ unit_mem->address = pMemory;
+ unit_mem->func_name = func_name;
+ unit_mem->line = line_num;
+ unit_mem->next = NULL;
+ unit_mem->prev = g_memory_unit_last;
+ }
+ g_memory_unit_last->next = unit_mem;
+ g_memory_unit_last = unit_mem;
+
+ }
+ g_ug_nfc_share_total_memory_size = g_ug_nfc_share_total_memory_size + size;
+ if( g_ug_nfc_share_peak_memory_size < g_ug_nfc_share_total_memory_size )
+ g_ug_nfc_share_peak_memory_size = g_ug_nfc_share_total_memory_size;
+
+}
+void ug_nfc_share_memory_unit_delete(void* pMemory)
+{
+ ug_nfc_share_mem_unit_t *tmp;
+ if( pMemory == g_memory_unit_first->address )
+ {
+ tmp = g_memory_unit_first;
+ g_memory_unit_first = tmp->next;
+ if(g_memory_unit_first != NULL)
+ g_memory_unit_first->prev = NULL;
+
+ g_ug_nfc_share_total_memory_size = g_ug_nfc_share_total_memory_size - tmp->size;
+ g_free(tmp->func_name);
+ tmp->func_name = NULL;
+ g_free(tmp);
+ tmp = NULL;
+ }
+ else if( pMemory == g_memory_unit_last->address )
+ {
+ tmp = g_memory_unit_last;
+
+ g_memory_unit_last = tmp->prev;
+ g_memory_unit_last->next = NULL;
+
+ g_ug_nfc_share_total_memory_size = g_ug_nfc_share_total_memory_size - tmp->size;
+ g_free(tmp->func_name);
+ tmp->func_name = NULL;
+
+ g_free(tmp);
+ tmp = NULL;
+
+ }
+ else
+ {
+ tmp = g_memory_unit_first;
+ for( ; tmp != g_memory_unit_last && tmp != NULL; )
+ {
+ if( tmp->address == pMemory )
+ {
+ tmp->prev->next = tmp->next;
+ tmp->next->prev = tmp->prev;
+
+ g_ug_nfc_share_total_memory_size = g_ug_nfc_share_total_memory_size - tmp->size;
+ g_free(tmp->func_name);
+ tmp->func_name = NULL;
+ g_free( tmp );
+ tmp = NULL;
+ break;
+ }
+ tmp = tmp->next;
+ }
+ }
+
+}
+
+void
+ug_nfc_share_memory_print_list()
+{
+ ug_nfc_share_mem_unit_t *tmp = g_memory_unit_first;
+ while(tmp != NULL)
+ {
+ UG_NFC_SHARE_DEBUG_ERR("func_name:%s(%d) <address:%p, size:%d>", tmp->func_name, tmp->line, tmp->address, tmp->size);
+ tmp = tmp->next;
+ }
+ UG_NFC_SHARE_DEBUG("total memory size :%d", g_ug_nfc_share_total_memory_size);
+ UG_NFC_SHARE_DEBUG("peak memory size :%d", g_ug_nfc_share_peak_memory_size);
+
+
+}
+#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
new file mode 100644
index 0000000..6d2cc9a
--- /dev/null
+++ b/ug-nfc-share-efl/src/ug-nfc-share-main.c
@@ -0,0 +1,1017 @@
+/*
+ * 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-share-main.h"
+#include "ug-nfc-share-tag.h"
+#include "ug-nfc-share-popup.h"
+
+#include <stdio.h>
+#include <Elementary.h>
+#include <Ecore.h>
+#include <bundle.h>
+#include <Ecore_X.h>
+#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 */
+#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 Evas_Object *_subwindow = NULL;
+
+/******************* 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)
+{
+ Evas_Object *button;
+
+ retv_if(parent == NULL, NULL);
+
+ button = elm_button_add(parent);
+ if (style != NULL)
+ {
+ elm_object_style_set(button, style);
+ }
+
+ if (label != NULL)
+ {
+ elm_object_text_set(button, label);
+ }
+
+ evas_object_smart_callback_add(button, "clicked", func, (void*)data);
+ evas_object_show(button);
+ elm_object_part_content_set(parent, swallow, button);
+
+ return button;
+}
+
+static Evas_Object *_create_image(Evas_Object *parent, const char *file_path, const char *swallow, void *data)
+{
+ Evas_Object *image;
+
+
+ retv_if(parent == NULL, NULL);
+ retv_if(file_path == NULL, NULL);
+ retv_if(swallow == NULL, NULL);
+
+ image = elm_image_add(parent);
+ retv_if(image == NULL, NULL);
+
+ elm_image_file_set(image, file_path, NULL);
+ elm_image_no_scale_set(image, 1);
+ elm_image_resizable_set(image, 0, 0);
+ elm_object_part_content_set(parent, swallow, image);
+
+
+ return image;
+}
+
+static Evas_Object *_create_label(Evas_Object *parent, const char *text, const char *swallow, void *data)
+{
+ Evas_Object *label;
+
+ retv_if(parent == NULL, NULL);
+
+ label = elm_label_add(parent);
+ elm_object_part_content_set(parent, swallow, label);
+ elm_object_text_set(label, text);
+
+ return label;
+}
+
+static Evas_Object *_create_box(Evas_Object *parent, bool is_hori)
+{
+ Evas_Object *box;
+
+ retv_if(parent == NULL, NULL);
+
+ box = elm_box_add(parent);
+ evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(box);
+
+ return box;
+}
+
+static Evas_Object *_create_scroller(Evas_Object *parent)
+{
+ Evas_Object *scroller;
+
+ retv_if(parent == NULL, NULL);
+
+ scroller = elm_scroller_add(parent);
+
+ elm_scroller_bounce_set(scroller, EINA_FALSE, EINA_FALSE);
+ elm_scroller_policy_set(scroller, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO);
+ evas_object_show(scroller);
+ elm_object_part_content_set(parent, "elm.swallow.content", scroller);
+
+ return scroller;
+}
+
+static Evas_Object *_create_layout(Evas_Object *parent, const char *clas, const char *group, const char *style, bool signal)
+{
+ Evas_Object *ly;
+
+
+ retv_if(parent == NULL, NULL);
+
+ ly = elm_layout_add(parent);
+
+ elm_layout_theme_set(ly, clas, group, style);
+ evas_object_size_hint_weight_set(ly, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(ly, EVAS_HINT_FILL, 0.0);
+
+ evas_object_show(ly);
+
+
+ return ly;
+}
+
+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);
+
+ return bg;
+}
+
+static Evas_Object *_create_main_layout(Evas_Object* parent)
+{
+ Evas_Object *layout;
+
+ if (parent == NULL)
+ return NULL;
+
+ layout = elm_layout_add(parent);
+
+ elm_layout_theme_set(layout, "layout", "application", "default");
+
+ evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_win_resize_object_add(parent, layout);
+
+ evas_object_show(layout);
+
+ return layout;
+}
+
+static void _win_del(void *data, Evas_Object *obj, void *event_info)
+{
+ LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__);
+
+ LOGD("[%s(): %d] END >>>>", __FUNCTION__, __LINE__);
+}
+
+static Evas_Object* _create_win(Evas_Object * parent)
+{
+ Evas_Object *eo;
+ int w, h;
+
+ eo = elm_win_add(parent, "NFCShareSubWindow", ELM_WIN_BASIC);
+ if (eo)
+ {
+ elm_win_title_set(eo, "NFCShareSubWindow");
+ elm_win_borderless_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);
+ elm_win_indicator_mode_set(eo, EINA_TRUE);
+ }
+
+ 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)
+{
+ char *temp_text = NULL;
+
+ 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);
+
+error:
+ LOGD("[%s(): %d] END >>>>", __FUNCTION__, __LINE__);
+
+ return TRUE;
+}
+
+static void _handover_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;
+
+ /* remove subwindow */
+ if (_subwindow)
+ evas_object_del(_subwindow);
+
+ 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;
+ }
+
+ /* 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;
+ }
+ }
+ 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;
+ }
+ }
+ 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;
+ }
+
+ ug_nfc_share_create_nfc_share_view(ug_data);
+
+ LOGD("[%s(): %d] END>>>>", __FUNCTION__, __LINE__);
+}
+
+
+static void _show_handover_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,};
+
+ _subwindow = _create_win(ug_data->ug_win_main);
+ ret_if(_subwindow == NULL);
+
+ 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));
+
+ 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);
+
+ evas_object_show(_subwindow);
+
+ LOGD("[%s(): %d] END>>>>", __FUNCTION__, __LINE__);
+}
+
+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);
+
+ int result = (int) event_info;
+
+ /* remove subwindow */
+ if (_subwindow)
+ evas_object_del(_subwindow);
+
+ 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;
+
+ default:
+ break;
+ }
+
+ LOGD("[%s(): %d] END>>>>", __FUNCTION__, __LINE__);
+}
+
+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,};
+
+ _subwindow = _create_win(ug_data->ug_win_main);
+ ret_if(_subwindow == NULL);
+
+ 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));
+
+ 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);
+
+ evas_object_show(_subwindow);
+
+ 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);
+
+ LOGD("[%s(): %d] END>>>>", __FUNCTION__, __LINE__);
+}
+
+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;
+ 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;
+
+
+ /* 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);
+ 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();
+
+
+ /* 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";
+
+
+ /* create image */
+ Evas_Object *image = NULL;
+ image = _create_image(layout, file_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);
+
+
+ /* 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);
+
+ if(NFC_ERROR_NONE == nfc_manager_initialize(NULL,NULL))
+ {
+ LOGD("nfc_manager_initialize success\n");
+ ug_nfc_set_nfc_callback(ug_data);
+ }
+ else
+ {
+ LOGD("nfc_manager_initialize FAIL!!!!\n");
+ }
+
+ return layout_base;
+}
+
+/******************* UI Functions ENDZZZ*************/
+
+static char *_get_file_path_from_uri(char *uri)
+{
+ char *path = NULL;
+
+ if (uri != NULL)
+ {
+ if (strlen(uri) > 8 && strncmp(uri, "file:///", 8) == 0)
+ {
+ path = uri + 7;
+ }
+ else if(strlen(uri) > 6 && strncmp(uri, "file:/", 6) == 0)
+ {
+ path = uri + 5;
+ }
+ else if(uri[0] == '/')
+ {
+ path = uri;
+ }
+ }
+
+ return path;
+}
+
+void ug_nfc_share_create_base_view(void *user_data)
+{
+ LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__);
+
+ ugdata_t* ug_data = (ugdata_t*)user_data;
+
+ /* create base layout */
+ ug_data->base_layout = _create_main_layout(ug_data->ug_win_main);
+ ug_data->bg = _create_bg(ug_data->base_layout);
+ 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;
+
+ 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 share layout */
+ nfc_share_layout = ug_nfc_share_create_layout(ug_data);
+
+ 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");
+
+ 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);
+
+ 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)
+{
+ char *token = NULL;
+ char *param = NULL;
+ int i = 0;
+
+ param = (char *)bundle_txt;
+ while (((token = strstr(param, NET_NFC_SHARE_SEPERATOR)) != NULL) && i < number_of_files)
+ {
+ *token = '\0';
+ datalist[i] = param;
+ LOGD("ug_get_share_data_list [%d] [%s]\n", i, datalist[i]);
+ param = token + 1;
+ i++;
+ }
+ if (i == (number_of_files - 1))
+ {
+ datalist[i] = param;
+ LOGD("data [%d] [%s]\n", i, datalist[i]);
+ }
+ else
+ {
+ LOGD("Not match : [%d] / [%d]\n", number_of_files, i);
+ return -1;
+ }
+
+ return 0;
+}
+
+void ug_nfc_share_create_data(struct ui_gadget *ug, bundle *bd, ugdata_t* ug_data)
+{
+
+ 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;
+
+ int number_of_data = 0;
+ char *request_data_temp = NULL;
+
+ int result = UG_NFC_SHARE_ERROR;
+ nfc_ndef_message_h msg = NULL;
+
+
+ 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));
+
+ if (request_data == NULL || strlen(request_data) == 0 || number_of_data < 1)
+ {
+ LOGD("request_data IS NULL\n");
+ /* exit */
+ 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)
+ {
+ struct stat st;
+ char *path = NULL;
+ char *pathlist[number_of_data];
+ int sum_filesize = 0;
+ int i = 0;
+
+
+ LOGD("data is file\n");
+
+ ug_get_share_data_list(request_data_temp, pathlist , number_of_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++ ;
+ }
+
+ 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*/
+ 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);
+ }
+ else
+ {
+ LOGD("file path for AC : [%s]\n", request_data);
+
+ if (ug_data->uri != NULL)
+ {
+ UG_NFC_SHARE_MEM_FREE(ug_data->uri);
+ ug_data->uri = NULL;
+ }
+
+ if (number_of_data > 1)
+ {
+ UG_NFC_SHARE_MEM_STRDUP(ug_data->uri, request_data);
+ }
+ else
+ {
+ UG_NFC_SHARE_MEM_STRDUP(ug_data->uri, path);
+ }
+
+ ug_nfc_share_set_tag_type(UG_NFC_SHARE_TAG_HANDOVER);
+ }
+ }
+ else if (strncmp(request_type, NET_NFC_SHARE_REQUEST_TYPE_BUFFER, strlen(NET_NFC_SHARE_REQUEST_TYPE_BUFFER)) == 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 */
+
+ result = nfc_ndef_message_create(&msg);
+ if(result != NFC_ERROR_NONE)
+ {
+ LOGD("nfc_ndef_message_create failed\n");
+
+ return ;
+ }
+ 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 ;
+
+ }
+
+ /* set UG data */
+ ug_data->ug_win_main = ug_get_parent_layout(ug);
+ ug_data->nfc_share_ug = ug;
+
+ LOGD("[%s(): %d] END >>>>", __FUNCTION__, __LINE__);
+}
+
+
+
+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 text domain */
+ bindtextdomain(NFCUG_TEXT_DOMAIN, NFCUG_LOCALEDIR);
+
+ /* parsing pameter to make nfc data */
+ ug_nfc_share_create_data(ug, bd, ug_data);
+
+ /* 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);
+ }
+
+ 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)
+{
+ LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__);
+
+ ugdata_t *ug_data = (ugdata_t *)user_data;
+
+ if (ug_data == NULL)
+ return;
+
+ 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_pause(struct ui_gadget *ug, bundle *bd, void *user_data)
+{
+}
+
+static void __ug_nfc_share_resume(struct ui_gadget *ug, bundle *bd, void *user_data)
+{
+}
+
+static void __ug_nfc_share_message(struct ui_gadget *ug, bundle *msg, bundle *bd, void *user_data)
+{
+}
+
+static void __ug_nfc_share_event(struct ui_gadget *ug, enum ug_event event, bundle *bd, void *user_data)
+{
+}
+
+UG_MODULE_API int UG_MODULE_INIT(struct ug_module_ops *ops)
+{
+ LOGD("[%s(): %d] UG_MODULE_INIT!!\n", __FUNCTION__, __LINE__);
+
+ ugdata_t *ug_data; // User defined private data
+ if (!ops)
+ return -1;
+
+ ug_data = (ugdata_t *)malloc(sizeof(ugdata_t));
+ if (!ug_data)
+ return -1;
+
+ memset(ug_data, 0x00, sizeof(ugdata_t));
+
+ ops->create = __ug_nfc_share_create;
+ ops->start = __ug_nfc_share_start;
+ ops->pause = __ug_nfc_share_pause;
+ ops->resume = __ug_nfc_share_resume;
+ ops->destroy = __ug_nfc_share_destroy;
+ ops->message = __ug_nfc_share_message;
+ ops->event = __ug_nfc_share_event;
+ ops->priv = ug_data;
+ ops->opt = UG_OPT_INDICATOR_ENABLE;
+
+ return 0;
+}
+
+UG_MODULE_API void UG_MODULE_EXIT(struct ug_module_ops *ops)
+{
+ ugdata_t* ug_data;
+
+ if (!ops)
+ return;
+
+ ug_data = ops->priv;
+
+ if (ug_data)
+ free(ug_data);
+
+ 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
new file mode 100644
index 0000000..6c654f4
--- /dev/null
+++ b/ug-nfc-share-efl/src/ug-nfc-share-popup.c
@@ -0,0 +1,149 @@
+/*
+ * 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-share-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_share_popup_response_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__);
+
+ int btn_type = (int)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);
+
+ _popup = NULL;
+ _user_response_cb = NULL;
+ _user_data = NULL;
+
+ LOGD("[%s(): %d] END>>>>", __FUNCTION__, __LINE__);
+}
+
+static Eina_Bool _ug_nfc_share_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_share_popup_block_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__);
+
+ _ug_nfc_share_popup_response_cb((void*)UG_NFC_POPUP_RESP_CLOSE, _popup, NULL);
+
+ LOGD("[%s(): %d] END>>>>", __FUNCTION__, __LINE__);
+}
+
+Evas_Object *ug_nfc_share_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;
+
+ retv_if(NULL == data, NULL);
+
+ if (_popup) {
+ ug_nfc_share_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_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_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_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);
+ }
+
+ _user_response_cb = response_cb;
+ _user_data = data;
+
+ if (is_alert_type) {
+ evas_object_smart_callback_add(_popup, "block,clicked", _ug_nfc_share_popup_block_clicked_cb, NULL);
+ }
+
+ if (enable_timeout)
+ elm_popup_timeout_set(_popup, NFC_POPUP_AUTO_TIMEOUT_SEC);
+
+ _ug_nfc_share_popup_show_cb(NULL);
+
+ LOGD("[%s(): %d] END>>>>", __FUNCTION__, __LINE__);
+
+ return _popup;
+}
+
+
+void ug_nfc_share_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_share_popup_response_cb((void*)UG_NFC_POPUP_RESP_CLOSE, _popup, NULL);
+
+ LOGD("[%s(): %d] END>>>>", __FUNCTION__, __LINE__);
+}
+
+
diff --git a/ug-nfc-share-efl/src/ug-nfc-share-tag.c b/ug-nfc-share-efl/src/ug-nfc-share-tag.c
new file mode 100644
index 0000000..b6265f8
--- /dev/null
+++ b/ug-nfc-share-efl/src/ug-nfc-share-tag.c
@@ -0,0 +1,1168 @@
+/*
+ * 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-share-tag.h"
+#include "ug-nfc-share-popup.h"
+
+#include <stdio.h>
+#include <Elementary.h>
+#include <Ecore.h>
+#include <bundle.h>
+#include <Ecore_X.h>
+#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>
+
+
+#define NFC_POPUP_TIMEOUT 3.0
+
+static ug_nfc_share_tag_type ug_nfc_share_tagType;
+static char *ug_nfc_share_displayText = NULL;
+
+
+int _bt_ipc_send_obex_message(uint8_t *address, const uint8_t *files, uint32_t length);
+
+/*-----------------------------------------------------------------------------------------------*/
+
+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__);
+
+ char popup_str[POPUP_TEXT_SIZE] = { 0, };
+
+ ugdata_t* ug_data = (ugdata_t*)data;
+ ret_if(ug_data == 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__);
+}
+
+static void _success_popup_response_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ LOGD("[%s(): %d] BEGIN>>>>", __FUNCTION__, __LINE__);
+
+ int result = (int) event_info;
+
+ ugdata_t* ug_data = (ugdata_t*)data;
+ ret_if(ug_data == NULL);
+
+ if (result == UG_NFC_POPUP_RESP_OK)
+ {
+ LOGD("UG_NFC_POPUP_RESP_OK");
+ }
+ else
+ {
+ LOGD("UG_NFC_POPUP_RESP_OK NOT!!");
+ }
+
+ 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;
+ 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, IDS_PS_TAG_SHARED, display_str);
+
+ 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);
+
+ UG_NFC_SHARE_MEM_FREE(display_str);
+
+ LOGD("[%s(): %d] END>>>>", __FUNCTION__, __LINE__);
+}
+
+char *ug_nfc_share_get_display_str(void)
+{
+ return ug_nfc_share_displayText;
+}
+
+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);
+}
+
+ug_nfc_share_tag_type ug_nfc_share_get_tag_type(void)
+{
+ return ug_nfc_share_tagType;
+}
+
+void ug_nfc_share_set_tag_type(ug_nfc_share_tag_type tag_type)
+{
+ if (tag_type < 0 || tag_type >= UG_NFC_SHARE_TAG_MAX)
+ return;
+
+ ug_nfc_share_tagType = tag_type;
+}
+
+nfc_ndef_message_h ug_nfc_share_get_current_ndef(void *data)
+{
+ ugdata_t *ug_data = (ugdata_t *)data;
+
+ LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__);
+
+ retv_if(ug_data == NULL, NULL);
+
+ LOGD("[%s(): %d] END >>>>", __FUNCTION__, __LINE__);
+
+ return ug_data->current_ndef;
+}
+
+ug_nfc_share_result_e ug_nfc_share_set_current_ndef(void *data, nfc_ndef_message_h ndef_msg)
+{
+ LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__);
+
+ ugdata_t *ug_data = (ugdata_t *)data;
+ if (ug_data == NULL)
+ {
+ LOGD("[%s(): %d] ug_data is null", __FUNCTION__, __LINE__);
+ return UG_NFC_SHARE_ERROR;
+ }
+
+ if (ug_data->current_ndef != NULL)
+ {
+ if (nfc_ndef_message_destroy(ug_data->current_ndef) != NFC_ERROR_NONE)
+ {
+ LOGD("nfc_ndef_message_destroy failed");
+ }
+ }
+
+ ug_data->current_ndef = ndef_msg;
+ LOGD("[%s(): %d] END >>>>", __FUNCTION__, __LINE__);
+
+ return UG_NFC_SHARE_OK;
+
+}
+
+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));
+
+ result = UG_NFC_SHARE_OK;
+
+ LOGD("[%s(): %d] END >>>>", __FUNCTION__, __LINE__);
+
+ return result;
+}
+
+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;
+ struct stat st;
+ uint8_t *type_buffer = NULL;
+ uint32_t type_size = 0;
+ nfc_ndef_record_h record = NULL;
+ FILE *file = NULL;
+ char *file_name = NULL;
+ uint8_t *file_data = NULL;
+ long int file_len = 0;
+
+
+ LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__);
+
+ retv_if(msg == NULL, result);
+ retv_if(path == NULL, result);
+ /*Cause of Svace warning */
+ /*Name : TOCTTOU_SEQUENCE
+ Mitigation :
+ 1.use fstat inplace of stat
+ 2.or using check-Use-Check Pattern
+ */
+ retv_if((stat(path, &st) == -1 && errno == ENOENT), result);
+
+ /* read file and make payload*/
+ file = fopen(path, "r");
+
+ if (file != NULL)
+ {
+ long int read_count = 0, read_total = 0;
+
+ fseek(file, 0, SEEK_END);
+ file_len = ftell(file);
+ fseek(file, 0, SEEK_SET);
+
+ UG_NFC_SHARE_MEM_MALLOC(file_data, file_len, uint8_t);
+ if (file_data == NULL)
+ {
+ LOGD("ERROR :: UG_NFC_SHARE_MEM_MALLOC failed");
+
+ fclose(file);
+
+ return result;
+ }
+
+ do
+ {
+ read_count = fread(file_data + read_total, 1, file_len - read_total, file);
+ read_total += read_count;
+ }
+ while (read_count != 0 && read_total < file_len);
+
+ fclose(file);
+
+ LOGD("fread(%s) success, size %ld\n", path, file_len);
+ }
+ else
+ {
+ LOGD("fopen(%s) error\n");
+
+ return result;
+ }
+
+ /* get type data */
+ result = ug_nfc_share_make_mime_type_data_from_file_path(path, &type_buffer, &type_size);
+ if (result != UG_NFC_SHARE_OK)
+ {
+ LOGD("ERROR :: _make_mime_type_data_from_file_path failed [%d]", result);
+
+ return result;
+ }
+
+
+ /* get file name for id */
+ file_name = strrchr(path, '/');
+ if (file_name == NULL)
+ {
+ file_name = (char *)path;
+ }
+ else
+ {
+ file_name++;
+ }
+
+ 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);
+ if (result != NFC_ERROR_NONE)
+ {
+ LOGD("nfc_ndef_record_create failed (%d)", result);
+
+ return result;
+ }
+
+ /* make file NDEF message */
+ 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 result;
+ }
+
+ /* append record to ndef message */
+ result = nfc_ndef_message_append_record(*msg, record);
+ if (result != NFC_ERROR_NONE)
+ {
+ LOGD("nfc_ndef_message_append_record failed (%d)", result);
+
+ return result;
+ }
+
+ LOGD("ug_nfc_share_make_ndef_message_from_file success");
+
+ LOGD("[%s(): %d] END>>>>", __FUNCTION__, __LINE__);
+
+ return result;
+}
+
+/* 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;
+ struct stat st;
+ uint8_t *type_buffer = NULL;
+ uint32_t type_size = 0;
+ nfc_ndef_record_h record = NULL;
+ FILE *file = NULL;
+ char *file_name = NULL;
+ uint8_t *file_data = NULL;
+ long int file_len = 0;
+ int index;
+
+
+ LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__);
+
+ retv_if(msg == NULL, result);
+ retv_if(path == NULL, result);
+ /*Cause of Svace warning */
+ /*Name : TOCTTOU_SEQUENCE
+ Mitigation :
+ 1.use fstat inplace of stat
+ 2.or using check-Use-Check Pattern
+ */
+
+ for (index = 0; index < record_count; index++)
+ {
+ retv_if((stat(path[index], &st) == -1 && errno == ENOENT), result);
+
+ /* read file and make payload*/
+ file = fopen(path[index], "r");
+
+ if (file != NULL)
+ {
+ long int read_count = 0, read_total = 0;
+
+ fseek(file, 0, SEEK_END);
+ file_len = ftell(file);
+ fseek(file, 0, SEEK_SET);
+
+ UG_NFC_SHARE_MEM_MALLOC(file_data, file_len, uint8_t);
+ if (file_data == NULL)
+ {
+ LOGD("ERROR :: UG_NFC_SHARE_MEM_MALLOC failed");
+
+ fclose(file);
+
+ return result;
+ }
+
+ do
+ {
+ read_count = fread(file_data + read_total, 1, file_len - read_total, file);
+ read_total += read_count;
+ }
+ while (read_count != 0 && read_total < file_len);
+
+ fclose(file);
+
+ LOGD("fread(%s) success, size %ld\n", path[index], file_len);
+ }
+ else
+ {
+ LOGD("fopen(%s) error\n");
+
+ return result;
+ }
+
+ /* get type data */
+ result = ug_nfc_share_make_mime_type_data_from_file_path(path[index], &type_buffer, &type_size);
+ if (result != UG_NFC_SHARE_OK)
+ {
+ LOGD("ERROR :: _make_mime_type_data_from_file_path failed [%d]", result);
+
+ return result;
+ }
+
+
+ /* get file name for id */
+ file_name = strrchr(path[index], '/');
+ if (file_name == NULL)
+ {
+ file_name = (char *)path[index];
+ }
+ else
+ {
+ file_name++;
+ }
+
+ 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);
+ if (result != NFC_ERROR_NONE)
+ {
+ LOGD("nfc_ndef_record_create failed (%d)", result);
+
+ return result;
+ }
+
+ /* make file NDEF message */
+ 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 result;
+ }
+
+ /* append record to ndef message */
+ result = nfc_ndef_message_append_record(*msg, record);
+ if (result != NFC_ERROR_NONE)
+ {
+ LOGD("nfc_ndef_message_append_record failed (%d)", result);
+
+ return result;
+ }
+
+ LOGD("ug_nfc_share_make_ndef_message_from_file success");
+
+ LOGD("[%s(): %d] END>>>>", __FUNCTION__, __LINE__);
+ }
+ return result;
+}
+
+void _ug_nfc_share_get_bt_addr_from_string(uint8_t *addr, char *addr_string)
+{
+ char *temp = NULL;
+
+ if (addr == NULL || addr_string == NULL)
+ {
+ return;
+ }
+
+ LOGD("string : %s", addr_string);
+
+ UG_NFC_SHARE_MEM_STRNDUP(temp, addr_string, strlen(addr_string));
+ if (temp != NULL)
+ {
+ char *token = NULL;
+ long value;
+ int count = 0;
+
+ token = strtok(temp, ":");
+
+ do
+ {
+ value = strtol(token, NULL, 16);
+
+ addr[count++] = (uint8_t)value;
+ }
+ while (token = strtok(NULL, ":"));
+ }
+}
+
+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)
+{
+ LOGD("[%s(): %d] BEGIN>>>>", __FUNCTION__, __LINE__);
+
+ ugdata_t* ug_data = (ugdata_t*)user_data;
+ uint8_t *data = (uint8_t *)ac_data;
+
+ if(result == NFC_ERROR_NONE)
+ {
+ uint8_t address[6] = { 0, };
+
+ 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();
+
+ _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)
+ {
+ /* show success popup */
+ _show_success_popup(ug_data);
+ }
+ else
+ {
+ LOGD("_bt_ipc_send_obex_message failed");
+
+ /* show failure popup */
+ _show_failure_popup(ug_data, IDS_FAILED_TO_SHARE_TAG);
+ }
+ }
+ else
+ {
+ LOGD("p2p_connection_handover failed");
+
+ /* show failure popup */
+ _show_failure_popup(ug_data, IDS_FAILED_TO_SHARE_TAG);
+ }
+
+ LOGD("[%s(): %d] END>>>>", __FUNCTION__, __LINE__);
+}
+
+static void _p2p_send_completed_cb(nfc_error_e result, void *user_data)
+{
+ LOGD("[%s(): %d] BEGIN>>>>", __FUNCTION__, __LINE__);
+
+ ugdata_t* ug_data = (ugdata_t*)user_data;
+
+ 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);
+ }
+ else
+ {
+ LOGD("_p2p_send_completed_cb failed");
+
+ /* show failure popup */
+ _show_failure_popup(ug_data, IDS_FAILED_TO_SHARE_TAG);
+ }
+
+ LOGD("[%s(): %d] END>>>>", __FUNCTION__, __LINE__);
+}
+
+static void _p2p_target_discovered_cb(nfc_discovered_type_e type, nfc_p2p_target_h target, void *user_data)
+{
+ LOGD("[%s(): %d] BEGIN>>>>", __FUNCTION__, __LINE__);
+
+ ugdata_t* ug_data = (ugdata_t*)user_data;
+
+ if(type == NFC_DISCOVERED_TYPE_ATTACHED)
+ {
+ int result = NFC_ERROR_NONE;
+
+ LOGD("NFC_DISCOVERED_TYPE_ATTACHED");
+
+ if (ug_nfc_share_get_tag_type() == UG_NFC_SHARE_TAG_HANDOVER)
+ {
+ LOGD("UG_NFC_SHARE_TAG_HANDOVER\n");
+
+ /* The code below will be changed after capi is completed */
+ if ((result = nfc_p2p_connection_handover(target, NFC_AC_TYPE_UNKNOWN, _p2p_connection_handover_completed_cb, ug_data)) != NFC_ERROR_NONE)
+ {
+ LOGD("nfc_p2p_connection_handover failed [%d]", result);
+ }
+
+ return;
+ }
+ else
+ {
+ nfc_ndef_message_h msg = NULL;
+
+ msg = ug_nfc_share_get_current_ndef(ug_data);
+ if(msg == NULL)
+ {
+ LOGD("nfc_ndef_message_h is NULL!!\n");
+ return;
+ }
+
+ result = nfc_p2p_send(target, msg, _p2p_send_completed_cb, ug_data);
+ if(result != NFC_ERROR_NONE)
+ {
+ LOGD("nfc_p2p_send failed[%d]\n", result);
+ return;
+ }
+ }
+ }
+ else
+ {
+ LOGD("NFC_DISCOVERED_TYPE_DETACHED");
+ }
+
+ LOGD("[%s(): %d] END>>>>", __FUNCTION__, __LINE__);
+}
+
+void ug_nfc_set_nfc_callback(void *user_data)
+{
+ LOGD("[%s(): %d] BEGIN>>>>", __FUNCTION__, __LINE__);
+
+ nfc_manager_set_p2p_target_discovered_cb(_p2p_target_discovered_cb, user_data);
+
+ LOGD("[%s(): %d] END>>>>", __FUNCTION__, __LINE__);
+}
+
+void ug_nfc_unset_nfc_callback(void)
+{
+ LOGD("[%s(): %d] BEGIN>>>>", __FUNCTION__, __LINE__);
+
+ nfc_manager_unset_p2p_target_discovered_cb();
+
+ LOGD("[%s(): %d] END>>>>", __FUNCTION__, __LINE__);
+}
+
+int _bt_ipc_send_obex_message(uint8_t *address, const uint8_t *files, uint32_t length)
+{
+ int result = 0;
+ uint32_t i, count = 1;
+ E_DBus_Connection *conn = NULL;
+
+ LOGD("[%s(): %d] BEGIN>>>>", __FUNCTION__, __LINE__);
+
+ if (address == NULL || files == NULL)
+ {
+ LOGD("invalid param [%p] [%p]", address, files);
+ return 0;
+ }
+
+ /* count files */
+ for (i = 0; i < length; i++)
+ {
+ if (files[i] == '?')
+ {
+ count++;
+ }
+ }
+
+ if (e_dbus_init() > 0)
+ {
+ if ((conn = e_dbus_bus_get(DBUS_BUS_SYSTEM)) != NULL)
+ {
+ DBusMessage *msg = NULL;
+
+ if (e_dbus_request_name(conn, "User.Bluetooth.UG", 0, NULL, NULL) != NULL)
+ {
+ if ((msg = dbus_message_new_signal("/org/projectx/connect_device", "User.Bluetooth.UG", "Send")) != NULL)
+ {
+ int reserved = 0;
+ char *type = "nfc";
+
+ LOGD("msg [%p], reserved [%d], address [%02X:%02X:%02X:%02X:%02X:%02X], count [%d], files [%s]", msg, reserved, address[0], address[1], address[2], address[3], address[4], address[5], count, files);
+
+ if (dbus_message_append_args(msg,
+ DBUS_TYPE_INT32, &reserved,
+ DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE, &address, 6,
+ DBUS_TYPE_INT32, &count,
+ DBUS_TYPE_STRING, &files,
+ DBUS_TYPE_STRING, &type,
+ DBUS_TYPE_INVALID))
+ {
+ e_dbus_message_send(conn, msg, NULL, -1, NULL);
+
+ LOGD("Send success");
+ }
+ else
+ {
+ LOGE("Connect sending failed");
+
+ result = -1;
+ }
+
+ dbus_message_unref(msg);
+ }
+ else
+ {
+ LOGE("dbus_message_new_signal failed");
+
+ result = -1;
+ }
+ }
+ else
+ {
+ LOGE("e_dbus_request_name failed");
+
+ result = -1;
+ }
+
+ e_dbus_connection_close(conn);
+ }
+ else
+ {
+ LOGE("e_dbus_bus_get failed");
+
+ result = -1;
+ }
+
+ e_dbus_shutdown();
+ }
+ else
+ {
+ LOGE("e_dbus_init failed");
+
+ result = -1;
+ }
+
+ LOGD("[%s(): %d] END>>>>", __FUNCTION__, __LINE__);
+
+ return result;
+}