sync RSA
authorJunyong Sim <junyong.sim@samsung.com>
Fri, 9 Nov 2012 08:12:57 +0000 (17:12 +0900)
committerJunyong Sim <junyong.sim@samsung.com>
Fri, 9 Nov 2012 08:12:57 +0000 (17:12 +0900)
20 files changed:
.gitignore [new file with mode: 0644]
packaging/libug-setting-nfc-efl.install.in
packaging/libug-share-nfc-efl.install.in
packaging/ug-nfc-efl [new file with mode: 0644]
packaging/ug-nfc-efl.spec
packaging/ug-share-nfc-efl [new file with mode: 0644]
ug-nfc-setting-efl/CMakeLists.txt
ug-nfc-setting-efl/data/edc/ug-setting-nfc-efl.edc [moved from ug-nfc-setting-efl/data/edc/ug-nfc-setting-efl.edc with 74% similarity]
ug-nfc-setting-efl/data/icons/nfc.png [deleted file]
ug-nfc-setting-efl/data/icons/setting-nfc.png [new file with mode: 0644]
ug-nfc-setting-efl/include/ug-nfc-setting-main.h
ug-nfc-setting-efl/src/ug-nfc-setting-main.c
ug-nfc-setting-efl/src/ug-nfc-setting-popup.c
ug-nfc-share-efl/CMakeLists.txt
ug-nfc-share-efl/data/edc/ug-share-nfc-efl.edc [moved from ug-nfc-share-efl/data/edc/ug-nfc-share-efl.edc with 50% similarity]
ug-nfc-share-efl/data/images/white/U05_popup_Share_help.png [new file with mode: 0644]
ug-nfc-share-efl/include/ug-nfc-share-main.h
ug-nfc-share-efl/src/ug-nfc-share-main.c
ug-nfc-share-efl/src/ug-nfc-share-popup.c
ug-nfc-share-efl/src/ug-nfc-share-tag.c

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..e34ca1c
--- /dev/null
@@ -0,0 +1,17 @@
+.cproject
+.project
+build-stamp
+cmake_tmp/
+configure-stamp
+debian/files
+debian/*.debhelper.log
+debian/*.install
+debian/*.debhelper
+debian/*.substvars
+debian/*.init
+debian/libug-setting-nfc-efl/
+debian/libug-setting-nfc-efl-dbg/
+debian/libug-share-nfc-efl/
+debian/libug-share-nfc-efl-dbg/
+debian/tmp/
+gbs_temp/
index 6eac2ed..15683fb 100644 (file)
@@ -1,4 +1,4 @@
-/opt/ug/lib/libug-setting-nfc-efl*
-/opt/ug/res/edje/ug-setting-nfc-efl/*
-/opt/ug/res/icons/*
-/opt/ug/res/locale/*/LC_MESSAGES/ug-setting-nfc-efl*
+/usr/ug/lib/libug-setting-nfc-efl*
+/usr/ug/res/locale/*/LC_MESSAGES/ug-setting-nfc-efl*
+/usr/ug/res/icons/*
+/usr/ug/res/edje/ug-setting-nfc-efl/*
index fae256c..edd01a1 100644 (file)
@@ -1,4 +1,4 @@
-/opt/ug/lib/libug-share-nfc-efl*
-/opt/ug/res/edje/ug-share-nfc-efl/*
-/opt/ug/res/images/*
-/opt/ug/res/locale/*/LC_MESSAGES/ug-share-nfc-efl*
+/usr/ug/lib/libug-share-nfc-efl*
+/usr/ug/res/locale/*/LC_MESSAGES/ug-share-nfc-efl*
+/usr/ug/res/images/*
+/usr/ug/res/edje/ug-share-nfc-efl/*
diff --git a/packaging/ug-nfc-efl b/packaging/ug-nfc-efl
new file mode 100644 (file)
index 0000000..7ccb5b5
--- /dev/null
@@ -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.
index 24e58e1..d3ce0a5 100644 (file)
@@ -1,11 +1,11 @@
-%define _optdir        /opt
-%define _ugdir %{_optdir}/ug
+%define _usrdir        /usr
+%define _ugdir %{_usrdir}/ug
 
 
 Name:       ug-nfc-efl
 Summary:    UI gadget about the nfc
 Version:    0.0.2
-Release:    21
+Release:    36
 Group:      TO_BE/FILLED_IN
 License:    Samsung Proprietary License
 Source0:    %{name}-%{version}.tar.gz
@@ -66,25 +66,32 @@ make %{?jobs:-j%jobs}
 cd cmake_tmp
 rm -rf %{buildroot}
 %make_install
+mkdir -p %{buildroot}/usr/share/license
+cp -af %{_builddir}/%{name}-%{version}/packaging/ug-nfc-efl %{buildroot}/usr/share/license/
+cp -af %{_builddir}/%{name}-%{version}/packaging/ug-share-nfc-efl %{buildroot}/usr/share/license/
 
 %post
 
 
 %post -n ug-share-nfc-efl
-vconftool set -t int -f db/private/ug-nfc-efl/last_file_number 0 -u 5000
+vconftool set -t string db/nfc/predefined_item "None" -u 5000 -f
+vconftool set -t int -f db/private/ug-nfc-efl/last_file_number 0 -u 5000 -f
 
 %postun
 
 %files
 %manifest ug-nfc-efl.manifest
 %defattr(-,root,root,-)
-/opt/ug/lib/libug-setting-nfc-efl*
-/opt/ug/res/locale/*/LC_MESSAGES/ug-setting-nfc-efl*
-/opt/ug/res/icons/*
+/usr/ug/lib/libug-setting-nfc-efl*
+/usr/ug/res/locale/*/LC_MESSAGES/ug-setting-nfc-efl*
+/usr/ug/res/icons/*
+/usr/share/license/ug-nfc-efl
 
 %files -n ug-share-nfc-efl
+%manifest ug-nfc-efl.manifest
 %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*
+/usr/ug/lib/libug-share-nfc-efl*
+/usr/ug/res/locale/*/LC_MESSAGES/ug-share-nfc-efl*
+/usr/ug/res/images/*
+/usr/ug/res/edje/*
+/usr/share/license/ug-share-nfc-efl
diff --git a/packaging/ug-share-nfc-efl b/packaging/ug-share-nfc-efl
new file mode 100644 (file)
index 0000000..7ccb5b5
--- /dev/null
@@ -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.
index be86fea..00cb069 100644 (file)
@@ -11,6 +11,11 @@ SET(LOCALEDIR "${RESDIR}/locale")
 SET(EDJDIR "${RESDIR}/edje/${PROJECT_NAME}")
 SET(ICONDIR "${RESDIR}/icons/${PROJECT_NAME}")
 
+ADD_DEFINITIONS("-DPACKAGE=\"ug-setting-nfc-efl\"")
+ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
+ADD_DEFINITIONS("-DLOCALEDIR=\"${LOCALEDIR}\"")
+ADD_DEFINITIONS("-DEDJDIR=\"${EDJDIR}\"")
+
 SET(SRCS
 src/ug-nfc-setting-main.c
 src/ug-nfc-setting-popup.c
@@ -62,16 +67,16 @@ ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS})
 SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION 0.1.0)
 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_ug_nfc_setting_LDFLAGS})
 
-ADD_CUSTOM_TARGET(ug-nfc-setting-efl.edj
+ADD_CUSTOM_TARGET(ug-setting-nfc-efl.edj
                 COMMAND edje_cc
-                ${CMAKE_CURRENT_SOURCE_DIR}/data/edc/ug-nfc-setting-efl.edc ${CMAKE_BINARY_DIR}/ug-nfc-setting-efl.edj
-                DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/data/edc/ug-nfc-setting-efl.edc
+                ${CMAKE_CURRENT_SOURCE_DIR}/data/edc/ug-setting-nfc-efl.edc ${CMAKE_BINARY_DIR}/ug-setting-nfc-efl.edj
+                DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/data/edc/ug-setting-nfc-efl.edc
 )
-ADD_DEPENDENCIES(${PROJECT_NAME} ug-nfc-setting-efl.edj)
+ADD_DEPENDENCIES(${PROJECT_NAME} ug-setting-nfc-efl.edj)
 
-INSTALL(TARGETS ${PROJECT_NAME} DESTINATION /opt/ug/lib)
-INSTALL(FILES ${CMAKE_BINARY_DIR}/ug-nfc-setting-efl.edj DESTINATION ${EDJDIR})
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIBDIR})
+INSTALL(FILES ${CMAKE_BINARY_DIR}/ug-setting-nfc-efl.edj DESTINATION ${EDJDIR})
 
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/nfc.png DESTINATION ${ICONDIR})
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/setting-nfc.png DESTINATION ${ICONDIR})
 
 ADD_SUBDIRECTORY(po)
@@ -71,8 +71,9 @@
                } \
        } \
 
-#define SETTING_LIST_HEIGHT    (40+113+113)
-#define SCREEN_HEIGHT          1280
+#define SETTING_LIST_HEIGHT            (40+1+112+1+112+1+1)
+#define PREDEFINED_ITEM_HEIGHT (40+1+112+15+1)
+#define SCREEN_HEIGHT                  1280
 
 collections {
 
@@ -111,36 +112,67 @@ collections {
                                }
                        }
 
+                       PADDING_LEFT(40)
+                       PADDING_RIGHT(40)
+
+                       part
+                       {
+                               name: "sbeam_help";
+                               type: SWALLOW;
+                               scale:1;
+                               description
+                               {
+                                       state: "default" 0.0;
+                                       rel1{relative: 1 1; to_x:"left_pad"; to_y: "setting_list";}
+                                       rel2{relative: 0 1; to_x:"right_pad";to_y: "setting_list";}
+                                       align: 0 0;
+                               }
+                       }
+
                        part
                        {
-                               name: "setting_list_pad";
+                               name: "list_pad_1";
                                type: RECT;
                                scale: 1;
                                description
                                {
                                        state: "default" 0.0;
                                        color: 0 0 0 0;
-                                       min: 0 36;
+                                       min: 0 40;
                                        fixed: 0 1;
-                                       rel1 {relative: 0 1; to_y: "setting_list";}
-                                       rel2 {relative: 1 1; to_y: "setting_list";}
+                                       rel1 {relative: 0 1; to_y: "sbeam_help";}
+                                       rel2 {relative: 1 1; to_y: "sbeam_help";}
                                        align:0 0;
                                }
                        }
 
-                       PADDING_LEFT(40)
-                       PADDING_RIGHT(40)
+                       part
+                       {
+                               name: "predefined_item_list";
+                               type: SWALLOW;
+                               scale:1;
+                               description
+                               {
+                                       state: "default" 0.0;
+                                       min: 0 PREDEFINED_ITEM_HEIGHT;
+                                       fixed: 0 1;
+                                       rel1 {relative: 0 1; to_y: "list_pad_1";}
+                                       rel2 {relative: 1 1; to_y: "list_pad_1";}
+                                       align: 0 0;
+                               }
+                       }
+
                        PADDING_BOTTOM(40)
 
                        part
                        {
-                               name: "sbeam_help";
+                               name: "predefined_item_help";
                                type: SWALLOW;
                                scale:1;
                                description
                                {
                                        state: "default" 0.0;
-                                       rel1{relative: 1 1; to_x:"left_pad"; to_y: "setting_list";}
+                                       rel1{relative: 1 1; to_x:"left_pad"; to_y: "predefined_item_list";}
                                        rel2{relative: 0 0; to_x:"right_pad";to_y: "bottom_pad";}
                                        align: 0 0;
                                }
diff --git a/ug-nfc-setting-efl/data/icons/nfc.png b/ug-nfc-setting-efl/data/icons/nfc.png
deleted file mode 100644 (file)
index 705855b..0000000
Binary files a/ug-nfc-setting-efl/data/icons/nfc.png and /dev/null differ
diff --git a/ug-nfc-setting-efl/data/icons/setting-nfc.png b/ug-nfc-setting-efl/data/icons/setting-nfc.png
new file mode 100644 (file)
index 0000000..51145f1
Binary files /dev/null and b/ug-nfc-setting-efl/data/icons/setting-nfc.png differ
index 2ac96e2..d96d713 100644 (file)
@@ -28,14 +28,11 @@ extern "C" {
 #include <dlog.h>
 #include <nfc.h>
 
-#define PACKAGE "ug-setting-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-setting-efl.edj"
-#define LOCALE_PATH            PREFIX"/res/locale"
+#define LOCALE_PATH            LOCALEDIR
+#define EDJ_PATH               EDJDIR
+#define EDJ_FILE                       EDJ_PATH"/"PACKAGE".edj"
+
+#define PREDEFINED_ITEM_FILE_PATH              "/usr/apps/org.tizen.57r43275q7/share"
 
 #ifdef LOG_TAG
 #undef LOG_TAG
@@ -53,7 +50,12 @@ extern "C" {
 #define IDS_NFC_S_BEAM                                 dgettext(PACKAGE, "IDS_NFC_OPT_S_BEAM")
 #define IDS_NFC_S_BEAM_DESCRIPTION_MSG_CHN             dgettext(PACKAGE, "IDS_NFC_BODY_S_BEAM_DESCRIPTION_MSG_CHN")
 #define IDS_CLOSE                                      dgettext("sys_string", "IDS_COM_POP_CLOSE")
+#define IDS_NONE                                       dgettext("sys_string", "IDS_COM_BODY_NONE")
+
+#define IDS_PREDEFINED_ITEM                            _("Predefined item")
+#define IDS_PREDEFINED_ITEM_DESCRIPTION_MSG            _("You can beam selected item to other NFC device by holding the devices close together in homescreenor main menu.")
 
+#define IDS_SECURITY_POLICY_RESTRICTS_USE_OF_PS        _("Security policy restricts use of %s")
 #define IDS_NFC_SERVICE_IS_NOT_SUPPORTED               _("NFC service is not supported")
 
 typedef enum _NFCSettingType {
@@ -61,6 +63,7 @@ typedef enum _NFCSettingType {
 #ifdef _SBEAM_SUPPORT_
        NFC_S_BEAM,
 #endif
+       NFC_PREDEFINED_ITEM,
        NFC_SETTING_MAX
 } NFCSettingType;
 
index a3bee46..cad3b18 100644 (file)
 #define S_BEAM_DESCRIPTION_MSG_WRAP_WIDTH      640
 #endif
 
-static Elm_Genlist_Item_Class itc_seperator;
-static Elm_Genlist_Item_Class itc;
+#define MAX_PREDEFINED_ITEM_COUNT      100
+
+static Elm_Genlist_Item_Class itc_check;
+static Elm_Genlist_Item_Class itc_helptext;
+static Elm_Genlist_Item_Class itc_2text;
+static Elm_Genlist_Item_Class itc_radio;
+
 static Elm_Object_Item *on_off_item = NULL;
 #ifdef _SBEAM_SUPPORT_
 static Elm_Object_Item *sbeam_item = NULL;
+static Elm_Object_Item *sbeam_item_help = NULL;
 #endif
+static Elm_Object_Item *predefined_item = NULL;
+static Elm_Object_Item *predefined_item_help = NULL;
+
+Evas_Object *radio_main = NULL;
+char **predefined_item_list = NULL;
+int predefined_item_count = 0;
+static int state_index = 0; //selected radio index
+
 static bool pending_status = FALSE;
 
 
+static void _mdm_restricted_popup_response_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       ugdata_t *ug_data = (ugdata_t *)data;
+       if (!ug_data)
+               return;
+
+       LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__);
+       LOGD("[%s(): %d] END >>>>", __FUNCTION__, __LINE__);
+}
+
+static void _mdm_restricted_popup(void *data)
+{
+       LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__);
+
+       char popup_str[POPUP_TEXT_SIZE] = { 0, };
+       ugdata_t *ug_data = (ugdata_t *)data;
+       if (!ug_data)
+               return;
+
+       snprintf(popup_str, POPUP_TEXT_SIZE, IDS_SECURITY_POLICY_RESTRICTS_USE_OF_PS, IDS_NFC_NFC);
+       ug_nfc_setting_create_popup(ug_data, ug_data->base_layout, popup_str, NULL, 0, NULL, 0, NULL, 0, true, true, _mdm_restricted_popup_response_cb);
+
+       LOGD("[%s(): %d] END >>>>", __FUNCTION__, __LINE__);
+}
+
+
 static void _app_error_popup_response_cb(void *data, Evas_Object *obj, void *event_info)
 {
        ugdata_t *ug_data = (ugdata_t *)data;
@@ -283,29 +323,28 @@ static void _set_pending_status(bool status)
        pending_status = status;
 }
 
-static void _activation_completed_cb(nfc_error_e error, void *user_data)
-{
-       LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__);
-
-       nfc_manager_deinitialize();
-
-       LOGD("[%s(): %d] END <<<<", __FUNCTION__, __LINE__);
-}
-
-static void _change_nfc_onoff_setting(void)
+static void _change_nfc_onoff_setting(void *data)
 {
        int status;
        int result;
 
        LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__);
 
+       ugdata_t *ug_data = (ugdata_t *)data;
+       if (!ug_data)
+               return;
+
        if ((result = vconf_get_bool(VCONFKEY_NFC_STATE, &status)) == 0)
        {
                LOGD("[%s(): %d] vconf_get_bool status [%d]\n", __FUNCTION__, __LINE__, status);
-               nfc_manager_initialize(NULL, NULL);
 
+               result = nfc_manager_set_activation(!status, NULL, NULL);
+               if (result == NFC_ERROR_SECURITY_RESTRICTED)
+               {
+                       _mdm_restricted_popup(ug_data);
+                       return;
+               }
                _set_pending_status(TRUE);
-               nfc_manager_set_activation(!status, _activation_completed_cb, NULL);
        }
        else
        {
@@ -318,8 +357,8 @@ static void _change_nfc_onoff_setting(void)
 #ifdef _SBEAM_SUPPORT_
 static void _change_nfc_sbeam_setting(void)
 {
-       int status;
-       int result;
+       int status = 0;
+       int result = -1;
 
        LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__);
 
@@ -329,11 +368,27 @@ static void _change_nfc_sbeam_setting(void)
 
                if (status)
                {
-                       vconf_set_bool(VCONFKEY_NFC_SBEAM, FALSE);
+                       result = vconf_set_bool(VCONFKEY_NFC_SBEAM, FALSE);
+                       if (!result )
+                       {
+                               LOGD("[%s(): %d] vconf_set_bool success\n", __FUNCTION__, __LINE__);
+                       }
+                       else
+                       {
+                               LOGD("[%s(): %d] vconf_set_bool failed\n", __FUNCTION__, __LINE__);
+                       }
                }
                else
                {
-                       vconf_set_bool(VCONFKEY_NFC_SBEAM, TRUE);
+                       result = vconf_set_bool(VCONFKEY_NFC_SBEAM, TRUE);
+                       if (!result )
+                       {
+                               LOGD("[%s(): %d] vconf_set_bool success\n", __FUNCTION__, __LINE__);
+                       }
+                       else
+                       {
+                               LOGD("[%s(): %d] vconf_set_bool failed\n", __FUNCTION__, __LINE__);
+                       }
                }
        }
        else
@@ -345,28 +400,17 @@ static void _change_nfc_sbeam_setting(void)
 }
 #endif
 
-static void _nfc_onoff_vconf_update_cb(keynode_t *key, void *data)
+void _nfc_activation_changed_cb(bool activated , void *user_data)
 {
        LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__);
 
-       int nfc_mode = 0;
 #ifdef _SBEAM_SUPPORT_
        int sbeam_state = 0;
        static int sbeam_off_by_nfcOnOff = EINA_FALSE;
 #endif
        int result;
 
-       if ((result = vconf_get_bool(VCONFKEY_NFC_STATE, &nfc_mode)) == 0)
-       {
-               LOGD("[%s(): %d] vconf_get_bool status [%d]\n", __FUNCTION__, __LINE__, nfc_mode);
-       }
-       else
-       {
-               LOGD("[%s(): %d] vconf_get_bool failed\n", __FUNCTION__, __LINE__);
-               return;
-       }
-
-       LOGD("nfc mode %s \n", nfc_mode > 0 ? "ON" : "OFF");
+       LOGD("nfc mode %s \n", activated ? "ON" : "OFF");
 
 #ifdef _SBEAM_SUPPORT_
        if ((result = vconf_get_bool(VCONFKEY_NFC_SBEAM, &sbeam_state)) == 0)
@@ -389,48 +433,56 @@ static void _nfc_onoff_vconf_update_cb(keynode_t *key, void *data)
        if (on_off_item != NULL)
                elm_genlist_item_update(on_off_item);
 
-#ifdef _SBEAM_SUPPORT_
-       if (nfc_mode == VCONFKEY_NFC_STATE_OFF)
+       if (activated == true)
        {
-               /* sbeam setting disabled */
-               elm_object_item_disabled_set(sbeam_item, EINA_TRUE);
+               /* predefined item setting enabled */
+               elm_object_item_disabled_set(predefined_item, EINA_FALSE);
+               elm_object_item_disabled_set(predefined_item_help, EINA_FALSE);
 
-               if (sbeam_state == VCONFKEY_NFC_SBEAM_OFF)
+#ifdef _SBEAM_SUPPORT_
+               /* sbeam setting enabled */
+               elm_object_item_disabled_set(sbeam_item, EINA_FALSE);
+               elm_object_item_disabled_set(sbeam_item_help, EINA_FALSE);
+
+               if (sbeam_off_by_nfcOnOff != EINA_TRUE)
                        return;
 
-               LOGD("Turning S Beam off \n");
+               LOGD("Turning S Beam on \n");
 
                _change_nfc_sbeam_setting();
 
                if (sbeam_item != NULL)
                        elm_genlist_item_update(sbeam_item);
 
-               /* set internal flag */
-               sbeam_off_by_nfcOnOff = EINA_TRUE;
+               /* unset internal flag */
+               sbeam_off_by_nfcOnOff = EINA_FALSE;
+#endif
        }
-       else if (nfc_mode > VCONFKEY_NFC_STATE_OFF)
+       else
        {
-               /* sbeam setting enabled */
-               elm_object_item_disabled_set(sbeam_item, EINA_FALSE);
+               /* predefined item setting disabled */
+               elm_object_item_disabled_set(predefined_item, EINA_TRUE);
+               elm_object_item_disabled_set(predefined_item_help, EINA_TRUE);
 
-               if (sbeam_off_by_nfcOnOff != EINA_TRUE)
+#ifdef _SBEAM_SUPPORT_
+               /* sbeam setting disabled */
+               elm_object_item_disabled_set(sbeam_item, EINA_TRUE);
+               elm_object_item_disabled_set(sbeam_item_help, EINA_TRUE);
+
+               if (sbeam_state == VCONFKEY_NFC_SBEAM_OFF)
                        return;
 
-               LOGD("Turning S Beam on \n");
+               LOGD("Turning S Beam off \n");
 
                _change_nfc_sbeam_setting();
 
                if (sbeam_item != NULL)
                        elm_genlist_item_update(sbeam_item);
 
-               /* unset internal flag */
-               sbeam_off_by_nfcOnOff = EINA_FALSE;
-       }
-       else
-       {
-               LOGD("Invalid Vconf value \n");
-       }
+               /* set internal flag */
+               sbeam_off_by_nfcOnOff = EINA_TRUE;
 #endif
+       }
 
        LOGD("[%s(): %d] END <<<<", __FUNCTION__, __LINE__);
 }
@@ -468,6 +520,194 @@ static Evas_Object *_create_main_layout(Evas_Object *parent)
        return layout;
 }
 
+static char *_gl_radio_text_get(void *data, Evas_Object *obj, const char *part)
+{
+       int index = (int) data;
+
+       if (!strcmp(part, "elm.text"))
+       {
+               return strdup(predefined_item_list[index]);
+       }
+
+       return NULL;
+}
+
+static Evas_Object *_gl_radio_content_get(void *data, Evas_Object *obj, const char *part)
+{
+       int index = (int) data;
+       Evas_Object *radio = NULL;
+
+       if (!strcmp(part, "elm.icon") || !strcmp(part, "elm.swallow.icon"))
+       {
+               radio = elm_radio_add(obj);
+               elm_radio_state_value_set(radio, index);
+               elm_radio_group_add(radio, radio_main);
+
+               if (index == state_index)
+                       elm_radio_value_set(radio, state_index);
+
+               evas_object_size_hint_weight_set(radio, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+               evas_object_size_hint_align_set(radio, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+               return radio;
+       }
+
+       return NULL;
+}
+
+static Eina_Bool _gl_radio_state_get(void *data, Evas_Object *obj, const char *part)
+{
+       return EINA_FALSE;
+}
+
+static void _gl_radio_sel(void *data, Evas_Object *obj, void *event_info)
+{
+       Elm_Object_Item *item = (Elm_Object_Item *) event_info;
+       int result = -1;
+       int index = 0;
+
+       if (item)
+       {
+               index = (int) elm_object_item_data_get(item);
+
+               LOGD("[Genlist] Selected Text : %s\n", predefined_item_list[index]);
+
+               state_index = index;
+               result = vconf_set_str(VCONFKEY_NFC_PREDEFINED_ITEM, predefined_item_list[index]);
+               if (!result )
+               {
+                       LOGD("[%s(): %d] vconf_set_str success\n", __FUNCTION__, __LINE__);
+               }
+               else
+               {
+                       LOGD("[%s(): %d] vconf_set_str failed\n", __FUNCTION__, __LINE__);
+               }
+
+               elm_genlist_item_update(item);
+       }
+}
+
+static Evas_Object *_ug_nfc_create_predefined_item_layout(void *data)
+{
+       LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__);
+
+       ugdata_t *ug_data = (ugdata_t *)data;
+       Evas_Object *layout = NULL;
+       Evas_Object *genlist = NULL;
+       FILE *fp = NULL;
+       int index = 0;
+       char buf[1024] = { 0 , };
+
+       layout = elm_layout_add(ug_data->base_naviframe);
+       if (layout == NULL)
+       {
+               LOGD("[%s(): %d] layout is null", __FUNCTION__, __LINE__);
+               return NULL;
+       }
+       elm_layout_theme_set(layout, "layout", "application", "noindicator");
+       evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       evas_object_show(layout);
+
+       /* make a list */
+       genlist = elm_genlist_add(layout);
+       if (genlist == NULL)
+       {
+               LOGD("[%s(): %d] genlist is null", __FUNCTION__, __LINE__);
+               return NULL;
+       }
+
+       if (!radio_main)
+       {
+               radio_main = elm_radio_add(genlist);
+               elm_radio_state_value_set(radio_main, 0);
+               elm_radio_value_set(radio_main, 0);
+       }
+
+       itc_radio.item_style = "1text.1icon.2";
+       itc_radio.func.text_get = _gl_radio_text_get;
+       itc_radio.func.content_get = _gl_radio_content_get;
+       itc_radio.func.state_get = _gl_radio_state_get;
+       itc_radio.func.del = NULL;
+
+       /* file open to make a list */
+       if ((fp = fopen(PREDEFINED_ITEM_FILE_PATH, "r")) == NULL)
+       {
+               LOGD("file open error");
+               return NULL;
+       }
+
+       if (fscanf(fp, "%d", &predefined_item_count))
+       {
+               LOGD("count [%d]", predefined_item_count);
+       }
+
+       if ((predefined_item_count < 0) || (predefined_item_count > MAX_PREDEFINED_ITEM_COUNT))
+       {
+               LOGD("The value of item_count is wrong");
+               fclose(fp);
+               return NULL;
+       }
+
+       predefined_item_count++; /* for none menu */
+
+       predefined_item_list = malloc(sizeof(char *) * predefined_item_count);
+
+       for (index = 0; index < predefined_item_count; index++) {
+               if (index == 0)
+               {
+                       LOGD("first item");
+
+                       predefined_item_list[index] = strdup(IDS_NONE);
+                       elm_genlist_item_append(genlist, &itc_radio, (void *)index, NULL, ELM_GENLIST_ITEM_NONE, _gl_radio_sel, NULL);
+               }
+               else
+               {
+                       if (fscanf(fp, "%s", buf))
+                       {
+                               LOGD("buf [%s]", buf);
+                               predefined_item_list[index] = strdup(buf);
+
+                               elm_genlist_item_append(genlist, &itc_radio, (void *)index, NULL, ELM_GENLIST_ITEM_NONE, _gl_radio_sel, NULL);
+                       }
+               }
+       }
+
+       evas_object_show(genlist);
+       elm_object_part_content_set(layout, "elm.swallow.content", genlist);
+
+       fclose(fp);
+
+       LOGD("[%s(): %d] END <<<<", __FUNCTION__, __LINE__);
+
+       return layout;
+}
+
+static void _back_clicked_cb_from_predefined_item(void *data, Evas_Object *obj, void *event_info)
+{
+       LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__);
+
+       ugdata_t *ug_data = data;
+       int index;
+
+       elm_naviframe_item_pop(ug_data->base_naviframe);
+
+       for (index  = 0; index < predefined_item_count; index++)
+       {
+               free(predefined_item_list[index]);
+       }
+       free(predefined_item_list);
+
+       predefined_item_count = 0;
+
+       if (radio_main)
+       {
+               evas_object_del(radio_main);
+               radio_main = NULL;
+       }
+
+       LOGD("[%s(): %d] END <<<<", __FUNCTION__, __LINE__);
+}
+
 // get the state of item
 static Eina_Bool _gl_state_get(void *data, Evas_Object *obj, const char *part)
 {
@@ -524,6 +764,18 @@ static Eina_Bool _gl_state_get(void *data, Evas_Object *obj, const char *part)
                }
        }
 #endif
+       else if (item_data->type == NFC_PREDEFINED_ITEM)
+       {
+               char *selected_item = NULL;
+
+               selected_item = vconf_get_str(VCONFKEY_NFC_PREDEFINED_ITEM);
+
+               if (strcmp(selected_item, "None"))
+               {
+                       LOGD("[%s(): %d] vconf_get_str=> is not None", __FUNCTION__, __LINE__);
+                       result = EINA_TRUE;
+               }
+       }
        else
        {
                LOGD("[%s(): %d] item_data->type error", __FUNCTION__, __LINE__);
@@ -548,6 +800,8 @@ static void _gl_del(void *data, Evas_Object *obj)
 
 static void _gl_sel_activation(void *data, Evas_Object *obj, void *event_info)
 {
+       LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__);
+
        Elm_Object_Item *item = (Elm_Object_Item *)event_info;
        gl_item_data *item_data = (gl_item_data *)data;
 
@@ -561,15 +815,13 @@ static void _gl_sel_activation(void *data, Evas_Object *obj, void *event_info)
 
        if (item_data->type == NFC_ON_OFF)
        {
-               LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__);
-
                if (_get_pending_status())
                {
                        LOGD("[%s(): %d] pending status \n", __FUNCTION__, __LINE__);
                        return;
                }
 
-               _change_nfc_onoff_setting();
+               _change_nfc_onoff_setting(item_data->data);
 
                elm_genlist_item_update(item);
        }
@@ -581,6 +833,26 @@ static void _gl_sel_activation(void *data, Evas_Object *obj, void *event_info)
                elm_genlist_item_update(item);
        }
 #endif
+       else if (item_data->type == NFC_PREDEFINED_ITEM)
+       {
+               Evas_Object *predefined_item_layout = NULL;
+               Evas_Object *l_button = NULL;
+               ugdata_t *ug_data = item_data->data;
+
+               LOGD("[%s(): %d] NFC_PREDEFINED_ITEM", __FUNCTION__, __LINE__);
+
+               /* create setting view */
+               predefined_item_layout = _ug_nfc_create_predefined_item_layout(ug_data);
+               if (predefined_item_layout == NULL)
+                       return;
+
+               /* Push navifreme */
+               l_button = elm_button_add(ug_data->base_naviframe);
+               elm_object_style_set(l_button, "naviframe/back_btn/default");
+               evas_object_smart_callback_add(l_button, "clicked", _back_clicked_cb_from_predefined_item, ug_data);
+
+               ug_data->base_navi_it = elm_naviframe_item_push(ug_data->base_naviframe, IDS_PREDEFINED_ITEM, l_button, NULL, predefined_item_layout, NULL);
+       }
        else
        {
                LOGD("[%s(): %d] item_data->type error", __FUNCTION__, __LINE__);
@@ -609,7 +881,7 @@ static void _check_changed_cb(void *data, Evas_Object *obj, void *event_info)
                        return;
                }
 
-               _change_nfc_onoff_setting();
+               _change_nfc_onoff_setting(item_data->data);
 
                if (on_off_item != NULL)
                        elm_genlist_item_update(on_off_item);
@@ -705,6 +977,10 @@ static Evas_Object *_gl_content_get(void *data, Evas_Object *obj, const char *pa
                elm_object_style_set(content, "on&off");
        }
 #endif
+       else if (item_data->type == NFC_PREDEFINED_ITEM)
+       {
+               LOGD("[%s(): %d] NFC_PREDEFINED_ITEM ", __FUNCTION__, __LINE__);
+       }
        else
        {
                LOGD("[%s(): %d] item_data->type error", __FUNCTION__, __LINE__);
@@ -722,6 +998,9 @@ static char *_gl_text_get_onoff(void *data, Evas_Object *obj, const char *part)
        gl_item_data *item_data = (gl_item_data *)data;
        char *text = NULL;
 
+       LOGD("part:%s", part);
+
+       // label for 'elm.text' part
        if (item_data == NULL)
        {
                LOGD("[%s(): %d] item_data is null", __FUNCTION__, __LINE__);
@@ -738,6 +1017,18 @@ static char *_gl_text_get_onoff(void *data, Evas_Object *obj, const char *part)
                text = strdup(IDS_NFC_S_BEAM);
        }
 #endif
+       else if (item_data->type == NFC_PREDEFINED_ITEM)
+       {
+               if (!strcmp(part, "elm.text.1"))
+               {
+                       text = strdup(IDS_PREDEFINED_ITEM);
+               }
+               else
+               {
+                       text = vconf_get_str(VCONFKEY_NFC_PREDEFINED_ITEM);
+                       LOGD("[%s]", text);
+               }
+       }
        else
        {
                LOGD("[%s(): %d] type error", __FUNCTION__, __LINE__);
@@ -748,18 +1039,49 @@ static char *_gl_text_get_onoff(void *data, Evas_Object *obj, const char *part)
        return text;
 }
 
+static char *_gl_text_get_help(void *data, Evas_Object *obj, const char *part)
+{
+       LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__);
+
+       int index = (int) data;
+       char *text = NULL;
+
+       LOGD("index:%d", index);
+
+       if (index == 0)
+       {
+               text = strdup(IDS_NFC_S_BEAM_DESCRIPTION_MSG_CHN);
+
+       }
+       else if (index == 1)
+       {
+               text = strdup(IDS_PREDEFINED_ITEM_DESCRIPTION_MSG);
+       }
+
+       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;
+       LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__);
 
+       ugdata_t *ug_data = (ugdata_t *)data;
        Evas_Object *layout = NULL;
        Evas_Object *genlist = NULL;
+       int result = 0;
+       int on = 0;
 
-       /* edj is set to layout */
+       /* Add layout*/
        layout = elm_layout_add(ug_data->base_naviframe);
-       elm_layout_file_set(layout, EDJ_FILE, "nfc_setting");
+       if (layout == NULL)
+       {
+               LOGD("[%s(): %d] layout is null", __FUNCTION__, __LINE__);
+               return NULL;
+       }
+       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);
        evas_object_show(layout);
 
        /* make genlist */
@@ -769,64 +1091,72 @@ static Evas_Object *_ug_nfc_create_setting_layout(void *data)
                LOGD("[%s(): %d] genlist is null", __FUNCTION__, __LINE__);
                return NULL;
        }
-       elm_genlist_bounce_set(genlist, EINA_FALSE, EINA_FALSE);
-       elm_object_style_set(genlist, "dialogue");
+       elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS);
 
-       itc_seperator.item_style = "dialogue/separator";
-       itc_seperator.func.text_get = NULL;
-       itc_seperator.func.content_get = NULL;
-       itc_seperator.func.state_get = NULL;
-       itc_seperator.func.del = NULL;
+       itc_check.item_style = "dialogue/1text.1icon";
+       itc_check.func.text_get = _gl_text_get_onoff;
+       itc_check.func.content_get = _gl_content_get;
+       itc_check.func.state_get = _gl_state_get;
+       itc_check.func.del = _gl_del;
 
-       itc.item_style = "dialogue/1text.1icon";
-       itc.func.text_get = _gl_text_get_onoff;
-       itc.func.content_get = _gl_content_get;
-       itc.func.state_get = _gl_state_get;
-       itc.func.del = NULL;
+       itc_helptext.item_style = "multiline/1text";
+       itc_helptext.func.text_get = _gl_text_get_help;
+       itc_helptext.func.content_get = NULL;
+       itc_helptext.func.state_get = NULL;
+       itc_helptext.func.del = NULL;
 
-       /* seperator */
-       Elm_Object_Item* seperator1 = elm_genlist_item_append(genlist, &itc_seperator, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
-       elm_genlist_item_select_mode_set(seperator1, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
+       itc_2text.item_style = "dialogue/2text.3";
+       itc_2text.func.text_get = _gl_text_get_onoff;
+       itc_2text.func.content_get = _gl_content_get;
+       itc_2text.func.state_get = _gl_state_get;
+       itc_2text.func.del = _gl_del;
 
-       /* NFC setting */
+
+       /* 1. NFC setting */
        gl_item_data *on_off_data = NULL;
        on_off_data = malloc(sizeof(gl_item_data));
        on_off_data->type = NFC_ON_OFF;
        on_off_data->data = ug_data;
-       on_off_item = elm_genlist_item_append(genlist, &itc, (void *)on_off_data, NULL, ELM_GENLIST_ITEM_NONE, _gl_sel_activation, (void *)on_off_data);
+       on_off_item = elm_genlist_item_append(genlist, &itc_check, (void *)on_off_data, NULL, ELM_GENLIST_ITEM_NONE, _gl_sel_activation, (void *)on_off_data);
 
 #ifdef _SBEAM_SUPPORT_
-       /* S beam setting */
+       /* 2. S beam setting */
        gl_item_data *sbeam_data = NULL;
        sbeam_data = malloc(sizeof(gl_item_data));
        sbeam_data->type = NFC_S_BEAM;
        sbeam_data->data = ug_data;
-       sbeam_item = elm_genlist_item_append(genlist, &itc, (void *)sbeam_data, NULL, ELM_GENLIST_ITEM_NONE, _gl_sel_activation, (void *)sbeam_data);
+       sbeam_item = elm_genlist_item_append(genlist, &itc_check, (void *)sbeam_data, NULL, ELM_GENLIST_ITEM_NONE, _gl_sel_activation, (void *)sbeam_data);
+
+       /* 2. S beam setting Help Text */
+       sbeam_item_help = elm_genlist_item_append(genlist, &itc_helptext, (void *)0, NULL, ELM_GENLIST_ITEM_NONE, _gl_sel_activation, NULL);
 
-       /* S beam setting */
-       int result = 0;
-       int on = 0;
        if (((result = vconf_get_bool(VCONFKEY_NFC_STATE, &on)) == 0) && (on == 0))
        {
                elm_object_item_disabled_set(sbeam_item, TRUE);
+               elm_object_item_disabled_set(sbeam_item_help, TRUE);
        }
 #endif
 
+       /* 3. Predefined item setting */
+       gl_item_data *predefined_item_data = NULL;
+       predefined_item_data = malloc(sizeof(gl_item_data));
+       predefined_item_data->type = NFC_PREDEFINED_ITEM;
+       predefined_item_data->data = ug_data;
+       predefined_item = elm_genlist_item_append(genlist, &itc_2text, (void *)predefined_item_data, NULL, ELM_GENLIST_ITEM_NONE, _gl_sel_activation, (void *)predefined_item_data);
+
+       /* 3. Predefined item setting Help Text*/
+       predefined_item_help = elm_genlist_item_append(genlist, &itc_helptext, (void *)1, NULL, ELM_GENLIST_ITEM_NONE, _gl_sel_activation, NULL);
+
+       if (((result = vconf_get_bool(VCONFKEY_NFC_STATE, &on)) == 0) && (on == 0))
+       {
+               elm_object_item_disabled_set(predefined_item, TRUE);
+               elm_object_item_disabled_set(predefined_item_help, TRUE);
+       }
+
        evas_object_show(genlist);
-       elm_object_part_content_set(layout, "setting_list", genlist);
+       elm_object_part_content_set(layout, "elm.swallow.content", genlist);
 
-#ifdef _SBEAM_SUPPORT_
-       /* set help text */
-       char path[1024] = { 0, };
-       Evas_Object *label = NULL;
-
-       _get_label_text(UG_FONT_HELP, IDS_NFC_S_BEAM_DESCRIPTION_MSG_CHN, UG_ALIGN_LEFT, path, sizeof(path));
-       label = elm_label_add(layout);
-       elm_object_part_content_set(layout, "sbeam_help", label);
-       elm_label_wrap_width_set(label, S_BEAM_DESCRIPTION_MSG_WRAP_WIDTH);
-       elm_label_line_wrap_set(label, ELM_WRAP_MIXED);
-       elm_object_text_set(label, path);
-#endif
+       LOGD("[%s(): %d] END <<<<", __FUNCTION__, __LINE__);
 
        return layout;
 }
@@ -842,19 +1172,21 @@ static void _back_clicked_cb(void *data, Evas_Object *obj, void *event_info)
 
 static void *__ug_nfc_setting_create(ui_gadget_h ug, enum ug_mode mode, service_h service, void *priv)
 {
+       LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__);
+
        ugdata_t *ug_data = (ugdata_t *)priv;
        Evas_Object *parent = NULL;
        Evas_Object *nfc_setting_layout = NULL;
        Evas_Object *l_button = NULL;
 
-       parent = ug_get_parent_layout(ug);
-       if (!parent)
-               return NULL;
-
        /* set text domain */
        bindtextdomain(NFCUG_TEXT_DOMAIN, NFCUG_LOCALEDIR);
 
+       parent = ug_get_parent_layout(ug);
+       if (!parent)
+               return NULL;
        ug_data->ug_win_main = parent;
+       evas_object_show(ug_data->ug_win_main);
        ug_data->nfc_setting_ug = ug;
 
        ug_data->base_layout = _create_main_layout(ug_data->ug_win_main);
@@ -863,8 +1195,6 @@ static void *__ug_nfc_setting_create(ui_gadget_h ug, enum ug_mode mode, service_
 
        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 setting view */
@@ -874,12 +1204,16 @@ static void *__ug_nfc_setting_create(ui_gadget_h ug, enum ug_mode mode, service_
 
        /* Push navifreme */
        l_button = elm_button_add(ug_data->base_naviframe);
-       evas_object_smart_callback_add(l_button, "clicked", _back_clicked_cb, ug_data->nfc_setting_ug);
-       ug_data->base_navi_it = elm_naviframe_item_push(ug_data->base_naviframe, IDS_NFC_NFC, l_button, NULL, nfc_setting_layout, "1line");
        elm_object_style_set(l_button, "naviframe/back_btn/default");
+       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_NFC, l_button, NULL, nfc_setting_layout, NULL);
 
-       /* Register Vconf Noti */
-       vconf_notify_key_changed(VCONFKEY_NFC_STATE, _nfc_onoff_vconf_update_cb, NULL);
+       /* Register activation changed callback */
+       nfc_manager_initialize(NULL, NULL);
+       nfc_manager_set_activation_changed_cb(_nfc_activation_changed_cb, ug_data);
+
+       LOGD("[%s(): %d] END <<<<", __FUNCTION__, __LINE__);
 
        return ug_data->base_layout;
 }
@@ -888,17 +1222,10 @@ static void __ug_nfc_setting_destroy(ui_gadget_h ug, service_h service, void *pr
 {
        LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__);
        ugdata_t *ug_data = (ugdata_t *)priv;
-       int result;
 
        if (ug_data == NULL)
                return;
 
-       /* Unregister Vconf Noti */
-       if ((result = vconf_ignore_key_changed(VCONFKEY_NFC_STATE, _nfc_onoff_vconf_update_cb)) == 0)
-       {
-               LOGD("[%s(): %d] vconf_ignore_key_changed status \n", __FUNCTION__, __LINE__);
-       }
-
        nfc_manager_unset_activation_changed_cb();
 
        nfc_manager_deinitialize();
index cbec540..8e918de 100644 (file)
@@ -129,7 +129,10 @@ Evas_Object *ug_nfc_setting_create_popup(void *data,
        }
 
        if (enable_timeout)
+       {
                elm_popup_timeout_set(_popup, NFC_POPUP_AUTO_TIMEOUT_SEC);
+               evas_object_smart_callback_add(_popup, "timeout", _ug_nfc_setting_popup_response_cb, NULL);
+       }
 
        _ug_nfc_setting_popup_show_cb(NULL);
 
index f99f2a0..ada6d8a 100644 (file)
@@ -11,6 +11,12 @@ SET(LOCALEDIR "${RESDIR}/locale")
 SET(EDJDIR "${RESDIR}/edje/${PROJECT_NAME}")
 SET(IMAGEDIR "${RESDIR}/images/${PROJECT_NAME}")
 
+ADD_DEFINITIONS("-DPACKAGE=\"ug-share-nfc-efl\"")
+ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
+ADD_DEFINITIONS("-DLOCALEDIR=\"${LOCALEDIR}\"")
+ADD_DEFINITIONS("-DIMGDIR=\"${IMGDIR}\"")
+ADD_DEFINITIONS("-DEDJDIR=\"${EDJDIR}\"")
+
 SET(SRCS
 src/ug-nfc-share-main.c
 src/ug-nfc-share-tag.c
@@ -65,15 +71,15 @@ 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
+ADD_CUSTOM_TARGET(ug-share-nfc-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
+                ${CMAKE_CURRENT_SOURCE_DIR}/data/edc/ug-share-nfc-efl.edc ${CMAKE_BINARY_DIR}/ug-share-nfc-efl.edj
+                DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/data/edc/ug-share-nfc-efl.edc
 )
-ADD_DEPENDENCIES(${PROJECT_NAME} ug-nfc-share-efl.edj)
+ADD_DEPENDENCIES(${PROJECT_NAME} ug-share-nfc-efl.edj)
 
-INSTALL(TARGETS ${PROJECT_NAME} DESTINATION /opt/ug/lib)
-INSTALL(FILES ${CMAKE_BINARY_DIR}/ug-nfc-share-efl.edj DESTINATION ${EDJDIR})
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIBDIR})
+INSTALL(FILES ${CMAKE_BINARY_DIR}/ug-share-nfc-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")
@@ -1,6 +1,5 @@
 collections {
 
-#define SCREEN_HEIGHT (1280 - 108)
 
        group
        {
@@ -261,4 +260,264 @@ collections {
                        }
                }
        }
+
+       group
+       {
+               name: "share_via_nfc_wvga";
+
+               parts
+               {
+                       part
+                       {
+                               name: "genlist";
+                               type: SWALLOW;
+                               scale: 1;
+                               description
+                               {
+                                       state: "default" 0.0;
+                                       min: 0 112;
+                                       fixed: 0 1;
+                                       rel1{relative: 0 0; }
+                                       rel2{relative: 1 0;}
+                                       align: 0 0;
+                               }
+                       }
+                       part
+                       {
+                               name: "left_pad";
+                               type: RECT;
+                               scale: 1;
+                               description
+                               {
+                                       state: "default" 0.0;
+                                       color: 0 0 0 0;
+                                       min: 16 0;
+                                       fixed: 1 0;
+                                       rel1 {relative: 0 0;}
+                                       rel2 {relative: 0 1;}
+                                       align: 0 0;
+                               }
+                       }
+                       part
+                       {
+                               name: "right_pad";
+                               type: RECT;
+                               scale: 1;
+                               description
+                               {
+                                       state: "default" 0.0;
+                                       color: 0 0 0 0;
+                                       min: 16 0;
+                                       fixed: 1 0;
+                                       rel1 {relative: 1 0;}
+                                       rel2 {relative: 1 1;}
+                                       align: 1 0;
+                               }
+                       }
+                       part
+                       {
+                               name: "top_pad";
+                               type: RECT;
+                               scale: 1;
+                               description
+                               {
+                                       state: "default" 0.0;
+                                       color: 0 0 0 0;
+                                       min: 0 23;
+                                       fixed: 0 1;
+                                       rel1 {relative: 1 1; to_x: "left_pad"; to_y: "genlist";}
+                                       rel2 {relative: 0 1; to_x: "right_pad"; to_y: "genlist";}
+                                       align: 0 0;
+                               }
+                       }
+                       part
+                       {
+                               name: "label_name";
+                               type: SWALLOW;
+                               scale: 1;
+                               description
+                               {
+                                       state: "default" 0.0;
+                                       min: 0 38;
+                                       fixed: 0 1;
+                                       rel1{relative: 1 1; to_x:"left_pad";to_y: "top_pad";}
+                                       rel2{relative: 0 1; to_x:"right_pad";to_y: "top_pad";}
+                                       align: 0 0;
+                               }
+                       }
+                       part
+                       {
+                               name: "top_pad1";
+                               type: RECT;
+                               scale: 1;
+                               description
+                               {
+                                       state: "default" 0.0;
+                                       color: 0 0 0 0;
+                                       min: 0 38;
+                                       fixed: 0 1;
+                                       rel1 {relative: 1 1; to_x: "left_pad"; to_y: "label_name";}
+                                       rel2 {relative: 0 1; to_x: "right_pad"; to_y: "label_name";}
+                                       align: 0 0;
+                               }
+                       }
+                       part
+                       {
+                               name: "label_message";
+                               type: SWALLOW;
+                               scale:1;
+
+                               description
+                               {
+                                       state: "default" 0.0;
+                                       min: 0 76;
+                                       fixed: 0 1;
+                                       rel1{relative: 1 1; to_x: "left_pad"; to_y: "top_pad1";}
+                                       rel2{relative: 0 1; to_x: "right_pad"; to_y: "top_pad1";}
+                                       align: 0 0;
+                               }
+                       }
+                       part
+                       {
+                               name: "top_pad2";
+                               type: RECT;
+                               scale: 1;
+                               description
+                               {
+                                       state: "default" 0.0;
+                                       color: 0 0 0 0;
+                                       min: 0 40;
+                                       fixed: 0 1;
+                                       rel1 {relative: 1 1; to_x: "left_pad"; to_y: "label_message";}
+                                       rel2 {relative: 0 1; to_x: "right_pad"; to_y: "label_message";}
+                                       align: 0 0;
+                               }
+                       }
+                       part
+                       {
+                               name: "left_pad1";
+                               type: RECT;
+                               scale: 1;
+                               description
+                               {
+                                       state: "default" 0.0;
+                                       color: 0 0 0 0;
+                                       min: 56 0;
+                                       fixed: 1 0;
+                                       rel1 {relative: 1 1;to_x: "left_pad"; to_y: "top_pad2";}
+                                       rel2 {relative: 1 1;to_x: "left_pad"; }
+                                       align: 0 0;
+                               }
+                       }
+                       part
+                       {
+                               name: "right_pad1";
+                               type: RECT;
+                               scale: 1;
+                               description
+                               {
+                                       state: "default" 0.0;
+                                       color: 0 0 0 0;
+                                       min: 56 0;
+                                       fixed: 1 0;
+                                       rel1 {relative: 0 1; to_x: "right_pad"; to_y:"top_pad2";}
+                                       rel2 {relative: 0 1; to_x:"right_pad";}
+                                       align: 1 0;
+                               }
+                       }
+                       part
+                       {
+                               name: "touch_image";
+                               type: SWALLOW;
+                               scale: 1;
+                               description
+                               {
+                                       state: "default" 0.0;
+                                       min: 360 300;
+                                       fixed: 0 0;
+                                       rel1{relative: 1 1; to_x:"left_pad1"; to_y:"top_pad2";}
+                                       rel2{relative: 0 0; to_x:"right_pad1"; to_y:"bottom_pad2";}
+                                       align: 0.5 0.5;
+                               }
+                       }
+                       part
+                       {
+                               name: "bottom_pad2";
+                               type: RECT;
+                               scale: 1;
+                               description
+                               {
+                                       state: "default" 0.0;
+                                       color: 0 0 0 0;
+                                       min: 0 78;
+                                       fixed: 0 1;
+                                       align: 0 1;
+                                       rel1 {relative: 1 0; to_x: "left_pad"; to_y: "label_cancel_message";}
+                                       rel2 {relative: 0 0; to_x: "right_pad"; to_y: "label_cancel_message";}
+                               }
+                       }
+                       part
+                       {
+                               name: "label_cancel_message";
+                               type: SWALLOW;
+                               scale: 1;
+                               description
+                               {
+                                       state: "default" 0.0;
+                                       min: 0 38;
+                                       fixed: 0 1;
+                                       rel1{relative: 1 0; to_x: "left_pad"; to_y: "bottom_pad1";}
+                                       rel2{relative: 0 0; to_x: "right_pad"; to_y: "bottom_pad1";}
+                                       align: 0 1;
+                               }
+                       }
+                       part
+                       {
+                               name: "bottom_pad1";
+                               type: RECT;
+                               scale: 1;
+                               description
+                               {
+                                       state: "default" 0.0;
+                                       color: 0 0 0 0;
+                                       min: 0 22;
+                                       fixed: 0 1;
+                                       align: 0 1;
+                                       rel1 {relative: 1 0; to_x: "left_pad"; to_y: "cancel_button";}
+                                       rel2 {relative: 0 0; to_x: "right_pad"; to_y: "cancel_button";}
+                               }
+                       }
+                       part
+                       {
+                               name: "cancel_button";
+                               type: SWALLOW;
+                               scale: 1;
+                               description
+                               {
+                                       state: "default" 0.0;
+                                       min: 0 74;
+                                       fixed: 0 1;
+                                       rel1{relative: 1 0; to_x: "left_pad"; to_y: "bottom_pad";}
+                                       rel2{relative: 0 0; to_x: "right_pad"; to_y: "bottom_pad";}
+                                       align:0 1;
+                               }
+                       }
+                       part
+                       {
+                               name: "bottom_pad";
+                               type: RECT;
+                               scale: 1;
+                               description
+                               {
+                                       state: "default" 0.0;
+                                       color: 0 0 0 0;
+                                       min: 0 15;
+                                       fixed: 0 1;
+                                       align: 0 1;
+                                       rel1 {relative: 0 1;}
+                                       rel2 {relative: 1 1;}
+                               }
+                       }
+               }
+       }
 }
diff --git a/ug-nfc-share-efl/data/images/white/U05_popup_Share_help.png b/ug-nfc-share-efl/data/images/white/U05_popup_Share_help.png
new file mode 100644 (file)
index 0000000..bf8fbec
Binary files /dev/null and b/ug-nfc-share-efl/data/images/white/U05_popup_Share_help.png differ
index bc13c05..bc7a716 100644 (file)
@@ -41,15 +41,10 @@ extern "C" {
 #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"
+#define LOCALE_PATH            LOCALEDIR
+#define IMAGES_PATH            IMAGEDIR
+#define EDJ_PATH               EDJDIR
+#define EDJ_FILE                       EDJ_PATH"/"PACKAGE".edj"
 
 #ifdef LOG_TAG
 #undef LOG_TAG
@@ -81,10 +76,12 @@ extern "C" {
 #define IDS_TO_CANCEL_SHARING_TAP_CANCEL                                       dgettext(PACKAGE, "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL")
 #define IDS_TRANSFER_FAILED                                                    dgettext(PACKAGE, "IDS_NFC_POP_TRANSFER_FAILED")
 #define IDS_SERVICE_NOT_AVAILABLE_NFC_TURNED_OFF_TURN_ON_NFC_Q         dgettext(PACKAGE, "IDS_NFC_POP_SERVICE_NOT_AVAILABLE_NFC_TURNED_OFF_TURN_ON_NFC_Q")
-//#define IDS_TAG_SHARED                                                               dgettext(PACKAGE, "IDS_NFC_POP_TAG_SHARED")
-#define IDS_TAG_SHARED                                                         _("Shared")
-//#define IDS_FAILED_TO_SHARE_TAG                                              dgettext(PACKAGE, "IDS_NFC_POP_FAILED_TO_SHARE_TAG")
-#define IDS_FAILED_TO_SHARE_TAG                                                _("Failed")
+//#define IDS_NFC_NFC                                                          dgettext(PACKAGE, "IDS_NFC_BODY_NFC")
+#define IDS_NFC_NFC                                                            _("NFC")
+#define IDS_SECURITY_POLICY_RESTRICTS_USE_OF_PS                                _("Security policy restricts use of %s")
+
+#define IDS_SHARED                                                             _("Shared")
+#define IDS_UNABLE_TO_SHARE                                                    _("Unable to share")
 
 #define IDS_HANDOVER   _("HANDOVER")
 #define IDS_NFC_SERVICE_IS_NOT_SUPPORTED               _("NFC service is not supported")
index 64ddf98..3e29c1d 100644 (file)
@@ -49,6 +49,8 @@ void ug_nfc_share_create_nfc_share_view(void *user_data);
 bool ug_nfc_share_check_nfc_isAvailable(void *user_data);
 static void ug_nfc_share_create_data(ugdata_t* ug_data);
 
+static Ecore_Timer *mdmPopup_timer = NULL;
+
 int _get_theme_type()
 {
        /* TODO : will be added */
@@ -422,6 +424,33 @@ static void _win_del(void *data, Evas_Object *obj, void *event_info)
        LOGD("[%s(): %d] END >>>>", __FUNCTION__, __LINE__);
 }
 
+static void _mdm_restricted_popup_response_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       ugdata_t *ug_data = (ugdata_t *)data;
+       ret_if(ug_data == NULL);
+
+       LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__);
+       LOGD("[%s(): %d] END >>>>", __FUNCTION__, __LINE__);
+
+       ug_destroy_me(ug_data->nfc_share_ug);
+}
+
+static Eina_Bool _mdm_restricted_popup(void *data)
+{
+       LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__);
+
+       char popup_str[POPUP_TEXT_SIZE] = { 0, };
+       ugdata_t *ug_data = (ugdata_t *)data;
+       retv_if(ug_data == NULL, ECORE_CALLBACK_CANCEL);
+
+       snprintf(popup_str, POPUP_TEXT_SIZE, IDS_SECURITY_POLICY_RESTRICTS_USE_OF_PS, IDS_NFC_NFC);
+       ug_nfc_share_create_popup(ug_data, ug_data->base_layout, popup_str, NULL, 0, NULL, 0, NULL, 0, true, true, _mdm_restricted_popup_response_cb);
+
+       LOGD("[%s(): %d] END >>>>", __FUNCTION__, __LINE__);
+
+       return ECORE_CALLBACK_CANCEL;
+}
+
 static void _activation_completed_cb(nfc_error_e error, void *user_data)
 {
        ugdata_t *ug_data = (ugdata_t *)user_data;
@@ -451,7 +480,12 @@ static void _setting_on_YesNo_popup_response_cb(void *data, Evas_Object *obj, vo
                /* setting is on */
                LOGD("setting is on >>>>", __FUNCTION__, __LINE__);
 
-               nfc_manager_set_activation(TRUE, _activation_completed_cb, ug_data);
+               result = nfc_manager_set_activation(TRUE, _activation_completed_cb, ug_data);
+               if (result == NFC_ERROR_SECURITY_RESTRICTED)
+               {
+                       LOGD("mdmPopup_timer START ");
+                       mdmPopup_timer = ecore_timer_add(0.25, _mdm_restricted_popup, ug_data);
+               }
                break;
 
        case UG_NFC_POPUP_RESP_CANCEL :
@@ -543,13 +577,25 @@ static Evas_Object *ug_nfc_share_create_layout(void *data)
        Evas_Object *cancel_btn = NULL;
        nfc_ndef_message_h msg = NULL;
        ug_nfc_share_tag_type type = UG_NFC_SHARE_TAG_MAX;
+       int width, height;
 
        LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__);
 
+       ecore_x_window_size_get(ecore_x_window_root_first_get(), &width, &height);
+       LOGD("width[%d] / height[%d]\n", width, height);
+
        /* create base layout */
        layout = elm_layout_add(ug_data->base_naviframe);
        retv_if(layout == NULL, NULL);
        elm_layout_file_set(layout, EDJ_FILE, "share_via_nfc");
+       if (width == 480) // WVGA
+       {
+               elm_layout_file_set(layout, EDJ_FILE, "share_via_nfc_wvga");
+       }
+       else // HD
+       {
+               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);
@@ -569,7 +615,14 @@ static Evas_Object *ug_nfc_share_create_layout(void *data)
 
        /* create image */
        Evas_Object *image = NULL;
-       _get_image_path("U05_AfterSelect_Share_help.png", path, sizeof(path));
+       if (width == 480) // WVGA
+       {
+               _get_image_path("U05_popup_Share_help.png", path, sizeof(path));
+       }
+       else // HD
+       {
+               _get_image_path("U05_AfterSelect_Share_help.png", path, sizeof(path));
+       }
        image = _create_image(layout, path, "touch_image", ug_data);
        retv_if(image == NULL, NULL);
        evas_object_show(image);
@@ -663,7 +716,7 @@ void ug_nfc_share_create_nfc_share_view(void *user_data)
                return;
        }
 
-       ug_data->base_navi_it = elm_naviframe_item_push(ug_data->base_naviframe, IDS_SHARE_VIA_NFC, NULL, NULL, nfc_share_layout, "1line");
+       ug_data->base_navi_it = elm_naviframe_item_push(ug_data->base_naviframe, IDS_SHARE_VIA_NFC, NULL, NULL, nfc_share_layout, NULL);
        elm_object_item_signal_emit(ug_data->base_navi_it, "elm,state,controlbar,close", "");
 
        LOGD("[%s(): %d] END >>>>", __FUNCTION__, __LINE__);
@@ -988,7 +1041,7 @@ static void ug_nfc_share_set_tag_type_from_bundle(bundle *bd)
 static void *__ug_nfc_share_create(ui_gadget_h ug, enum ug_mode mode, service_h service, void *priv)
 {
        ugdata_t *ug_data = (ugdata_t *)priv;
-       int display_mode = -1;
+
        LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__);
 
        /* set text domain */
@@ -1024,14 +1077,6 @@ static void *__ug_nfc_share_create(ui_gadget_h ug, enum ug_mode mode, service_h
        ug_data->bd = bd;
 #endif
 
-       /* set rotate as portrait */
-       display_mode = elm_win_rotation_get(ug_data->ug_win_main);
-
-       LOGD("display_mode[%d]", display_mode);
-
-       if ((display_mode == 90) || (display_mode == 270))
-               elm_win_rotation_with_resize_set(ug_data->ug_win_main, 0);
-
        /* parse pameter, and them set request type */
        ug_nfc_share_set_tag_type_from_bundle(ug_data->bd);
 
@@ -1097,21 +1142,66 @@ static void __ug_nfc_share_start(ui_gadget_h ug, service_h service, void *priv)
 static void __ug_nfc_share_pause(ui_gadget_h ug, service_h service, void *priv)
 {
        LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__);
+
+       LOGD("[%s(): %d] END >>>>", __FUNCTION__, __LINE__);
 }
 
 static void __ug_nfc_share_resume(ui_gadget_h ug, service_h service, void *priv)
 {
        LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__);
+
+       LOGD("[%s(): %d] END >>>>", __FUNCTION__, __LINE__);
 }
 
 static void __ug_nfc_share_message(ui_gadget_h ug, service_h msg, service_h service, void *priv)
 {
        LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__);
+
+       LOGD("[%s(): %d] END >>>>", __FUNCTION__, __LINE__);
 }
 
 static void __ug_nfc_share_event(ui_gadget_h ug, enum ug_event event, service_h service, void *priv)
 {
        LOGD("[%s(): %d] BEGIN >>>>", __FUNCTION__, __LINE__);
+
+       ugdata_t *ug_data = (ugdata_t *)priv;
+
+       LOGD("event[%d]", event);
+
+       switch (event) {
+       case UG_EVENT_LOW_MEMORY:
+               LOGD("UG_EVENT_LOW_MEMORY");
+               break;
+       case UG_EVENT_LOW_BATTERY:
+               LOGD("UG_EVENT_LOW_BATTERY");
+               break;
+       case UG_EVENT_LANG_CHANGE:
+               LOGD("UG_EVENT_LANG_CHANGE");
+               break;
+       case UG_EVENT_ROTATE_PORTRAIT:
+               elm_win_rotation_with_resize_set(ug_data->ug_win_main, 0);
+               LOGD("UG_EVENT_ROTATE_PORTRAIT");
+               break;
+       case UG_EVENT_ROTATE_PORTRAIT_UPSIDEDOWN:
+               elm_win_rotation_with_resize_set(ug_data->ug_win_main, 0);
+               LOGD("UG_EVENT_ROTATE_PORTRAIT_UPSIDEDOWN");
+               break;
+       case UG_EVENT_ROTATE_LANDSCAPE:
+               LOGD("UG_EVENT_ROTATE_LANDSCAPE");
+               elm_win_rotation_with_resize_set(ug_data->ug_win_main, 0);
+               break;
+       case UG_EVENT_ROTATE_LANDSCAPE_UPSIDEDOWN:
+               LOGD("UG_EVENT_ROTATE_LANDSCAPE_UPSIDEDOWN");
+               elm_win_rotation_with_resize_set(ug_data->ug_win_main, 0);
+               break;
+       case UG_EVENT_REGION_CHANGE:
+               LOGD("UG_EVENT_REGION_CHANGE");
+               break;
+       default:
+               break;
+       }
+
+       LOGD("[%s(): %d] END >>>>", __FUNCTION__, __LINE__);
 }
 
 UG_MODULE_API int UG_MODULE_INIT(struct ug_module_ops *ops)
index 9090732..288f4c8 100644 (file)
@@ -129,7 +129,10 @@ Evas_Object *ug_nfc_share_create_popup(void *data,
        }
 
        if (enable_timeout)
+       {
                elm_popup_timeout_set(_popup, NFC_POPUP_AUTO_TIMEOUT_SEC);
+               evas_object_smart_callback_add(_popup, "timeout", _ug_nfc_share_popup_response_cb, NULL);
+       }
 
        _ug_nfc_share_popup_show_cb(NULL);
 
index 6924815..00f9baf 100644 (file)
@@ -464,20 +464,20 @@ static void _p2p_connection_handover_completed_cb(nfc_error_e result, nfc_ac_typ
 
                if (_bt_ipc_send_obex_message(address, (uint8_t *)data, strlen(data) + 1) == 0)
                {
-                       _show_status_text(ug_data, IDS_TAG_SHARED);
+                       _show_status_text(ug_data, IDS_SHARED);
                }
                else
                {
                        LOGD("_bt_ipc_send_obex_message failed");
 
-                       _show_status_text(ug_data, IDS_FAILED_TO_SHARE_TAG);
+                       _show_status_text(ug_data, IDS_UNABLE_TO_SHARE);
                }
        }
        else
        {
                LOGD("p2p_connection_handover failed");
 
-               _show_status_text(ug_data, IDS_FAILED_TO_SHARE_TAG);
+               _show_status_text(ug_data, IDS_UNABLE_TO_SHARE);
        }
 
        LOGD("[%s(): %d] END>>>>", __FUNCTION__, __LINE__);
@@ -502,13 +502,13 @@ static void _p2p_send_completed_cb(nfc_error_e result, void *user_data)
        {
                LOGD("_p2p_send_completed_cb is completed");
 
-               _show_status_text(ug_data, IDS_TAG_SHARED);
+               _show_status_text(ug_data, IDS_SHARED);
        }
        else
        {
                LOGD("_p2p_send_completed_cb failed");
 
-               _show_status_text(ug_data, IDS_FAILED_TO_SHARE_TAG);
+               _show_status_text(ug_data, IDS_UNABLE_TO_SHARE);
        }
 
        LOGD("[%s(): %d] END>>>>", __FUNCTION__, __LINE__);