merge with master
authorJinkun Jang <jinkun.jang@samsung.com>
Fri, 15 Mar 2013 16:16:14 +0000 (01:16 +0900)
committerJinkun Jang <jinkun.jang@samsung.com>
Fri, 15 Mar 2013 16:16:14 +0000 (01:16 +0900)
25 files changed:
CMakeLists.txt
packaging/osp-app-controls.spec
res/arm/usr/etc/app-control-alias.ini [deleted file]
res/arm/usr/etc/app-control-appid.ini [deleted file]
res/x86/usr/etc/app-control-alias.ini [deleted file]
res/x86/usr/etc/app-control-appid.ini [deleted file]
res/x86/usr/etc/app-control-info.ini [deleted file]
src/bluetooth-app-control/BluetoothAppControlDllEntry.cpp
src/camera-app-control/CameraAppControlDllEntry.cpp
src/contact-app-control/ContactAppControlDllEntry.cpp
src/nfc-push-ui-app-control/CMakeLists.txt [new file with mode: 0755]
src/nfc-push-ui-app-control/data/dummy.file [new file with mode: 0644]
src/nfc-push-ui-app-control/inc/NfcPushUi.h [new file with mode: 0644]
src/nfc-push-ui-app-control/inc/NfcPushUiForm.h [new file with mode: 0644]
src/nfc-push-ui-app-control/inc/NfcPushUiFrame.h [new file with mode: 0644]
src/nfc-push-ui-app-control/manifest.xml [new file with mode: 0644]
src/nfc-push-ui-app-control/nfc-push-ui-app-control.manifest [new file with mode: 0644]
src/nfc-push-ui-app-control/res/icon.png [new file with mode: 0644]
src/nfc-push-ui-app-control/shared/res/screen-density-xhigh/mainmenu.png [new file with mode: 0644]
src/nfc-push-ui-app-control/src/NfcPushUi.cpp [new file with mode: 0644]
src/nfc-push-ui-app-control/src/NfcPushUiEntry.cpp [new file with mode: 0644]
src/nfc-push-ui-app-control/src/NfcPushUiForm.cpp [new file with mode: 0644]
src/nfc-push-ui-app-control/src/NfcPushUiFrame.cpp [new file with mode: 0644]
src/nfc-push-ui-app-control/system-service-export.ver [new file with mode: 0755]
src/setting-app-control/SettingAppControlDllEntry.cpp

index ed85172..5e0863b 100755 (executable)
@@ -3,16 +3,17 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
 PROJECT(osp-app-controls)
 
 SET(COMMON_INCLUDE_DIRS
-               /usr/include/appfw
-               /usr/include/network
-    /usr/include/osp
-       /usr/include/osp/app
-       /usr/include/osp/base
-       /usr/include/osp/io
-       /usr/include/osp/net
-       /usr/include/osp/security
-       /usr/include/osp/system
-       /usr/include/system
+       /usr/include/appfw
+       /usr/include/network
+       /usr/include/osp
+       /usr/include/osp/app
+       /usr/include/osp/base
+       /usr/include/osp/io
+       /usr/include/osp/net
+       /usr/include/osp/security
+       /usr/include/osp/system
+       /usr/include/osp/media
+       /usr/include/system
        )
      
 SET(EXTRA_CFLAGS  "${EXTRA_CFLAGS} -L/usr/lib/osp" )     
@@ -34,6 +35,14 @@ MACRO(OSP_STRIP _target)
                )   
 ENDMACRO(OSP_STRIP)
 
+MACRO(EXE_STRIP _target)
+       ADD_CUSTOM_COMMAND(TARGET ${this_target}
+    POST_BUILD
+               COMMAND ${CMAKE_STRIP} --strip-unneeded ${EXECUTABLE_OUTPUT_PATH}/${this_target}${CMAKE_EXECUTABLE_SUFFIX}
+       COMMENT "strip ${this_target}"
+       )   
+ENDMACRO(EXE_STRIP)
+
 ADD_SUBDIRECTORY(src/bluetooth-app-control osp-ac-bluetooth)
 ADD_SUBDIRECTORY(src/browser-app-control osp-ac-browser)
 ADD_SUBDIRECTORY(src/calendar-app-control osp-ac-calendar)
@@ -44,6 +53,7 @@ ADD_SUBDIRECTORY(src/contact-app-control osp-ac-contact)
 ADD_SUBDIRECTORY(src/media-app-control osp-ac-media)
 ADD_SUBDIRECTORY(src/message-app-control osp-ac-message)
 ADD_SUBDIRECTORY(src/setting-app-control osp-ac-setting)
+ADD_SUBDIRECTORY(src/nfc-push-ui-app-control osp-ac-nfc-push-ui)
 
 INSTALL(DIRECTORY ${LIBRARY_OUTPUT_PATH}/ DESTINATION lib/osp 
                                FILES_MATCHING PATTERN "*.so*" 
@@ -54,9 +64,4 @@ INSTALL(DIRECTORY ${LIBRARY_OUTPUT_PATH}/debug/ DESTINATION lib/osp/debug
                                FILES_MATCHING PATTERN "*.so*" 
                                PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ                                          
                                                                                GROUP_EXECUTE GROUP_READ
-                                                                               WORLD_EXECUTE WORLD_READ)
-IF("${ARCH}" MATCHES "arm")
-  INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/res/arm/usr/etc DESTINATION ../usr)
-ELSEIF("${ARCH}" MATCHES "x86")
-  INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/res/x86/usr/etc DESTINATION ../usr)
-ENDIF("${ARCH}" MATCHES "arm")
+                                                                               WORLD_EXECUTE WORLD_READ)
\ No newline at end of file
index 4f8fbf2..f3ebaae 100755 (executable)
@@ -3,10 +3,10 @@
 
 Name:          osp-app-controls
 Summary:       osp application controls library
-Version:       1.2.0.0
+Version:       1.2.1.0
 Release:       1
 Group:         System/Libraries
-License:       Apache License, Version 2.0
+License:       Apache-2.0
 Source0:       %{name}-%{version}.tar.gz
 BuildRequires:  cmake
 BuildRequires:  pkgconfig(appsvc)
@@ -20,14 +20,21 @@ BuildRequires:  osp-appfw-internal-devel
 BuildRequires:  pkgconfig(osp-uifw)
 BuildRequires:  pkgconfig(osp-bluetooth)
 BuildRequires:  osp-bluetooth-internal-devel
+BuildRequires:  pkgconfig(osp-nfc)
 BuildRequires:  pkgconfig(osp-social)
+BuildRequires:  pkgconfig(osp-image)
+BuildRequires:  pkgconfig(osp-image-core)
+BuildRequires:  osp-image-internal-devel
 BuildRequires:  osp-social-internal-devel
 BuildRequires:  pkgconfig(contacts-service2)
 
 # runtime requires
+Requires: osp-sys-config
 Requires: osp-appfw 
 Requires: osp-uifw
 Requires: osp-bluetooth
+Requires: osp-nfc
+Requires: osp-installer
 Requires: osp-social
 
 Requires(post): coreutils
@@ -67,12 +74,15 @@ cp %{_builddir}/%{name}-%{version}/LICENSE.APLv2  %{buildroot}/usr/share/license
 %post
 /sbin/ldconfig
 
+/usr/etc/package-manager/backend/tpk -i /usr/apps/42KriKjov3
+cp -f %{_libdir}/osp/osp-ui-app-loader /usr/apps/42KriKjov3/bin/nfc-push-ui-app-control
+
 %postun -p /sbin/ldconfig
 
 %files
 %manifest osp-app-controls.manifest
 /usr/share/license/%{name}
-/usr/etc/*
+/usr/apps/*
 %{_libdir}/osp/*.so*
 
 %files debug
diff --git a/res/arm/usr/etc/app-control-alias.ini b/res/arm/usr/etc/app-control-alias.ini
deleted file mode 100644 (file)
index 8fb0664..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-#osp.appcontrol.CONTACT
-PROVIDER_ALIAS=tizen.contacts
-osp.appcontrol.operation.PICK=http://tizen.org/appcontrol/operation/pick
-osp.appcontrol.operation.ADD=http://tizen.org/appcontrol/operation/add
-osp.appcontrol.operation.EDIT=http://tizen.org/appcontrol/operation/edit
-osp.appcontrol.operation.VIEW=http://tizen.org/appcontrol/operation/view
-#osp.appcontrol.CALENDAR
-PROVIDER_ALIAS=tizen.calendar
-osp.appcontrol.operation.PICK=http://tizen.org/appcontrol/operation/pick
-osp.appcontrol.operation.VIEW=http://tizen.org/appcontrol/operation/view
-#osp.appcontrol.TODO
-PROVIDER_ALIAS=tizen.todo
-osp.appcontrol.operation.PICK=http://tizen.org/appcontrol/operation/pick
-#osp.appcontrol.BT
-PROVIDER_ALIAS=tizen.bluetooth
-osp.appcontrol.operation.PICK=http://tizen.org/appcontrol/operation/pick
-#osp.appcontrol.DIAL
-PROVIDER_ALIAS=tizen.phone
-osp.appcontrol.operation.DEFAULT=http://tizen.org/appcontrol/operation/dial
-#osp.appcontrol.CALL
-PROVIDER_ALIAS=tizen.phone
-osp.appcontrol.operation.DEFAULT=http://tizen.org/appcontrol/operation/call
-#osp.appcontrol.BROWSER
-PROVIDER_ALIAS=tizen.internet
-osp.appcontrol.operation.DEFAULT=http://tizen.org/appcontrol/operation/view
-#osp.appcontrol.MEDIA
-PROVIDER_ALIAS=tizen.filemanager
-osp.appcontrol.operation.PICK=http://tizen.org/appcontrol/operation/pick
-#osp.appcontrol.MESSAGE
-PROVIDER_ALIAS=tizen.messages
-osp.appcontrol.operation.EDIT=http://tizen.org/appcontrol/operation/compose
-#osp.appcontrol.EMAIL
-PROVIDER_ALIAS=tizen.email
-osp.appcontrol.operation.EDIT=http://tizen.org/appcontrol/operation/compose
-#osp.appcontrol.IMAGE
-PROVIDER_ALIAS=tizen.imageviewer
-osp.appcontrol.operation.VIEW=http://tizen.org/appcontrol/operation/view
-#osp.appcontrol.VIDEO
-PROVIDER_ALIAS=tizen.videoplayer
-osp.appcontrol.operation.PLAY=http://tizen.org/appcontrol/operation/view
-#osp.appcontrol.AUDIO
-PROVIDER_ALIAS=tizen.musicplayer
-osp.appcontrol.operation.PLAY=http://tizen.org/appcontrol/operation/view
-#osp.appcontrol.CAMERA
-PROVIDER_ALIAS=tizen.camera
-osp.appcontrol.operation.CAPTURE=http://tizen.org/appcontrol/operation/createcontent
-#osp.appcontrol.SETTINGS
-PROVIDER_ALIAS=tizen.settings
-osp.appcontrol.operation.DEFAULT=http://tizen.org/appcontrol/operation/configure
-#osp.appcontrol.provider.contact
-PROVIDER_ALIAS=tizen.contacts
-osp.appcontrol.operation.pick=http://tizen.org/appcontrol/operation/pick
-osp.appcontrol.operation.add=http://tizen.org/appcontrol/operation/add
-osp.appcontrol.operation.edit=http://tizen.org/appcontrol/operation/edit
-osp.appcontrol.operation.view=http://tizen.org/appcontrol/operation/view
-#osp.appcontrol.provider.calendar
-PROVIDER_ALIAS=tizen.calendar
-osp.appcontrol.operation.pick=http://tizen.org/appcontrol/operation/pick
-osp.appcontrol.operation.view=http://tizen.org/appcontrol/operation/view
-#osp.appcontrol.provider.todo
-PROVIDER_ALIAS=tizen.todo
-osp.appcontrol.operation.pick=http://tizen.org/appcontrol/operation/pick
-#osp.appcontrol.provider.bluetooth
-PROVIDER_ALIAS=tizen.bluetooth
-osp.appcontrol.operation.pick=http://tizen.org/appcontrol/operation/pick
-#osp.appcontrol.provider.call
-PROVIDER_ALIAS=tizen.phone
-osp.appcontrol.operation.call=http://tizen.org/appcontrol/operation/call
-osp.appcontrol.operation.dial=http://tizen.org/appcontrol/operation/dial
-#osp.appcontrol.provider.browser
-PROVIDER_ALIAS=tizen.internet
-osp.appcontrol.operation.view=http://tizen.org/appcontrol/operation/view
-#osp.appcontrol.provider.media
-PROVIDER_ALIAS=tizen.filemanager
-osp.appcontrol.operation.pick=http://tizen.org/appcontrol/operation/pick
-#osp.appcontrol.provider.message
-PROVIDER_ALIAS=tizen.messages
-osp.appcontrol.operation.compose=http://tizen.org/appcontrol/operation/compose
-#osp.appcontrol.provider.email
-PROVIDER_ALIAS=tizen.email
-osp.appcontrol.operation.compose=http://tizen.org/appcontrol/operation/compose
-#osp.appcontrol.provider.image
-PROVIDER_ALIAS=tizen.imageviewer
-osp.appcontrol.operation.view=http://tizen.org/appcontrol/operation/view
-#osp.appcontrol.provider.imageeditor
-PROVIDER_ALIAS=tizen.imageeditor
-osp.appcontrol.operation.crop=http://tizen.org/appcontrol/operation/crop
-#osp.appcontrol.provider.video
-PROVIDER_ALIAS=tizen.videoplayer
-osp.appcontrol.operation.play=http://tizen.org/appcontrol/operation/view
-#osp.appcontrol.provider.audio
-PROVIDER_ALIAS=tizen.musicplayer
-osp.appcontrol.operation.play=http://tizen.org/appcontrol/operation/view
-#osp.appcontrol.provider.camera
-PROVIDER_ALIAS=tizen.camera
-osp.appcontrol.operation.capture=http://tizen.org/appcontrol/operation/createcontent
-osp.appcontrol.operation.record=http://tizen.org/appcontrol/operation/createcontent
-#osp.appcontrol.provider.settings
-PROVIDER_ALIAS=tizen.settings
-osp.appcontrol.operation.configure=http://tizen.org/appcontrol/operation/configure
-#osp.appcontrol.provider.certificatemanager
-PROVIDER_ALIAS=tizen.certificatemanager
-osp.appcontrol.operation.pick=http://tizen.org/appcontrol/operation/pick
-#http://tizen.org/appcontrol/provider/contact
-PROVIDER_ALIAS=tizen.contacts
-http://tizen.org/appcontrol/operation/pick=http://tizen.org/appcontrol/operation/pick
-http://tizen.org/appcontrol/operation/add=http://tizen.org/appcontrol/operation/add
-http://tizen.org/appcontrol/operation/edit=http://tizen.org/appcontrol/operation/edit
-http://tizen.org/appcontrol/operation/view=http://tizen.org/appcontrol/operation/view
-#http://tizen.org/appcontrol/provider/calendar
-PROVIDER_ALIAS=tizen.calendar
-http://tizen.org/appcontrol/operation/pick=http://tizen.org/appcontrol/operation/pick
-http://tizen.org/appcontrol/operation/view=http://tizen.org/appcontrol/operation/view
-#http://tizen.org/appcontrol/provider/bluetooth
-PROVIDER_ALIAS=tizen.bluetooth
-http://tizen.org/appcontrol/operation/pick=http://tizen.org/appcontrol/operation/pick
-#http://tizen.org/appcontrol/provider/call
-PROVIDER_ALIAS=tizen.phone
-http://tizen.org/appcontrol/operation/call=http://tizen.org/appcontrol/operation/call
-http://tizen.org/appcontrol/operation/dial=http://tizen.org/appcontrol/operation/dial
-#http://tizen.org/appcontrol/provider/browser
-PROVIDER_ALIAS=tizen.internet
-http://tizen.org/appcontrol/operation/view=http://tizen.org/appcontrol/operation/view
-#http://tizen.org/appcontrol/provider/media
-PROVIDER_ALIAS=tizen.filemanager
-http://tizen.org/appcontrol/operation/pick=http://tizen.org/appcontrol/operation/pick
-#http://tizen.org/appcontrol/provider/message
-PROVIDER_ALIAS=tizen.messages
-http://tizen.org/appcontrol/operation/compose=http://tizen.org/appcontrol/operation/compose
-#http://tizen.org/appcontrol/provider/email
-PROVIDER_ALIAS=tizen.email
-http://tizen.org/appcontrol/operation/compose=http://tizen.org/appcontrol/operation/compose
-#http://tizen.org/appcontrol/provider/image
-PROVIDER_ALIAS=tizen.imageviewer
-http://tizen.org/appcontrol/operation/view=http://tizen.org/appcontrol/operation/view
-#http://tizen.org/appcontrol/provider/video
-PROVIDER_ALIAS=tizen.videoplayer
-http://tizen.org/appcontrol/operation/play=http://tizen.org/appcontrol/operation/view
-#http://tizen.org/appcontrol/provider/audio
-PROVIDER_ALIAS=tizen.musicplayer
-http://tizen.org/appcontrol/operation/play=http://tizen.org/appcontrol/operation/view
-#http://tizen.org/appcontrol/provider/camera
-PROVIDER_ALIAS=tizen.camera
-http://tizen.org/appcontrol/operation/capture=http://tizen.org/appcontrol/operation/createcontent
-http://tizen.org/appcontrol/operation/record=http://tizen.org/appcontrol/operation/createcontent
-#http://tizen.org/appcontrol/provider/settings
-PROVIDER_ALIAS=tizen.settings
-http://tizen.org/appcontrol/operation/configure=http://tizen.org/appcontrol/operation/configure
-#http://tizen.org/appcontrol/provider/certificatemanager
-PROVIDER_ALIAS=tizen.certificatemanager
-http://tizen.org/appcontrol/operation/pick=http://tizen.org/appcontrol/operation/pick
diff --git a/res/arm/usr/etc/app-control-appid.ini b/res/arm/usr/etc/app-control-appid.ini
deleted file mode 100644 (file)
index c3f821a..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#Alias
-tizen.internet=kmcele1k0n.Internet
diff --git a/res/x86/usr/etc/app-control-alias.ini b/res/x86/usr/etc/app-control-alias.ini
deleted file mode 100644 (file)
index 8fb0664..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-#osp.appcontrol.CONTACT
-PROVIDER_ALIAS=tizen.contacts
-osp.appcontrol.operation.PICK=http://tizen.org/appcontrol/operation/pick
-osp.appcontrol.operation.ADD=http://tizen.org/appcontrol/operation/add
-osp.appcontrol.operation.EDIT=http://tizen.org/appcontrol/operation/edit
-osp.appcontrol.operation.VIEW=http://tizen.org/appcontrol/operation/view
-#osp.appcontrol.CALENDAR
-PROVIDER_ALIAS=tizen.calendar
-osp.appcontrol.operation.PICK=http://tizen.org/appcontrol/operation/pick
-osp.appcontrol.operation.VIEW=http://tizen.org/appcontrol/operation/view
-#osp.appcontrol.TODO
-PROVIDER_ALIAS=tizen.todo
-osp.appcontrol.operation.PICK=http://tizen.org/appcontrol/operation/pick
-#osp.appcontrol.BT
-PROVIDER_ALIAS=tizen.bluetooth
-osp.appcontrol.operation.PICK=http://tizen.org/appcontrol/operation/pick
-#osp.appcontrol.DIAL
-PROVIDER_ALIAS=tizen.phone
-osp.appcontrol.operation.DEFAULT=http://tizen.org/appcontrol/operation/dial
-#osp.appcontrol.CALL
-PROVIDER_ALIAS=tizen.phone
-osp.appcontrol.operation.DEFAULT=http://tizen.org/appcontrol/operation/call
-#osp.appcontrol.BROWSER
-PROVIDER_ALIAS=tizen.internet
-osp.appcontrol.operation.DEFAULT=http://tizen.org/appcontrol/operation/view
-#osp.appcontrol.MEDIA
-PROVIDER_ALIAS=tizen.filemanager
-osp.appcontrol.operation.PICK=http://tizen.org/appcontrol/operation/pick
-#osp.appcontrol.MESSAGE
-PROVIDER_ALIAS=tizen.messages
-osp.appcontrol.operation.EDIT=http://tizen.org/appcontrol/operation/compose
-#osp.appcontrol.EMAIL
-PROVIDER_ALIAS=tizen.email
-osp.appcontrol.operation.EDIT=http://tizen.org/appcontrol/operation/compose
-#osp.appcontrol.IMAGE
-PROVIDER_ALIAS=tizen.imageviewer
-osp.appcontrol.operation.VIEW=http://tizen.org/appcontrol/operation/view
-#osp.appcontrol.VIDEO
-PROVIDER_ALIAS=tizen.videoplayer
-osp.appcontrol.operation.PLAY=http://tizen.org/appcontrol/operation/view
-#osp.appcontrol.AUDIO
-PROVIDER_ALIAS=tizen.musicplayer
-osp.appcontrol.operation.PLAY=http://tizen.org/appcontrol/operation/view
-#osp.appcontrol.CAMERA
-PROVIDER_ALIAS=tizen.camera
-osp.appcontrol.operation.CAPTURE=http://tizen.org/appcontrol/operation/createcontent
-#osp.appcontrol.SETTINGS
-PROVIDER_ALIAS=tizen.settings
-osp.appcontrol.operation.DEFAULT=http://tizen.org/appcontrol/operation/configure
-#osp.appcontrol.provider.contact
-PROVIDER_ALIAS=tizen.contacts
-osp.appcontrol.operation.pick=http://tizen.org/appcontrol/operation/pick
-osp.appcontrol.operation.add=http://tizen.org/appcontrol/operation/add
-osp.appcontrol.operation.edit=http://tizen.org/appcontrol/operation/edit
-osp.appcontrol.operation.view=http://tizen.org/appcontrol/operation/view
-#osp.appcontrol.provider.calendar
-PROVIDER_ALIAS=tizen.calendar
-osp.appcontrol.operation.pick=http://tizen.org/appcontrol/operation/pick
-osp.appcontrol.operation.view=http://tizen.org/appcontrol/operation/view
-#osp.appcontrol.provider.todo
-PROVIDER_ALIAS=tizen.todo
-osp.appcontrol.operation.pick=http://tizen.org/appcontrol/operation/pick
-#osp.appcontrol.provider.bluetooth
-PROVIDER_ALIAS=tizen.bluetooth
-osp.appcontrol.operation.pick=http://tizen.org/appcontrol/operation/pick
-#osp.appcontrol.provider.call
-PROVIDER_ALIAS=tizen.phone
-osp.appcontrol.operation.call=http://tizen.org/appcontrol/operation/call
-osp.appcontrol.operation.dial=http://tizen.org/appcontrol/operation/dial
-#osp.appcontrol.provider.browser
-PROVIDER_ALIAS=tizen.internet
-osp.appcontrol.operation.view=http://tizen.org/appcontrol/operation/view
-#osp.appcontrol.provider.media
-PROVIDER_ALIAS=tizen.filemanager
-osp.appcontrol.operation.pick=http://tizen.org/appcontrol/operation/pick
-#osp.appcontrol.provider.message
-PROVIDER_ALIAS=tizen.messages
-osp.appcontrol.operation.compose=http://tizen.org/appcontrol/operation/compose
-#osp.appcontrol.provider.email
-PROVIDER_ALIAS=tizen.email
-osp.appcontrol.operation.compose=http://tizen.org/appcontrol/operation/compose
-#osp.appcontrol.provider.image
-PROVIDER_ALIAS=tizen.imageviewer
-osp.appcontrol.operation.view=http://tizen.org/appcontrol/operation/view
-#osp.appcontrol.provider.imageeditor
-PROVIDER_ALIAS=tizen.imageeditor
-osp.appcontrol.operation.crop=http://tizen.org/appcontrol/operation/crop
-#osp.appcontrol.provider.video
-PROVIDER_ALIAS=tizen.videoplayer
-osp.appcontrol.operation.play=http://tizen.org/appcontrol/operation/view
-#osp.appcontrol.provider.audio
-PROVIDER_ALIAS=tizen.musicplayer
-osp.appcontrol.operation.play=http://tizen.org/appcontrol/operation/view
-#osp.appcontrol.provider.camera
-PROVIDER_ALIAS=tizen.camera
-osp.appcontrol.operation.capture=http://tizen.org/appcontrol/operation/createcontent
-osp.appcontrol.operation.record=http://tizen.org/appcontrol/operation/createcontent
-#osp.appcontrol.provider.settings
-PROVIDER_ALIAS=tizen.settings
-osp.appcontrol.operation.configure=http://tizen.org/appcontrol/operation/configure
-#osp.appcontrol.provider.certificatemanager
-PROVIDER_ALIAS=tizen.certificatemanager
-osp.appcontrol.operation.pick=http://tizen.org/appcontrol/operation/pick
-#http://tizen.org/appcontrol/provider/contact
-PROVIDER_ALIAS=tizen.contacts
-http://tizen.org/appcontrol/operation/pick=http://tizen.org/appcontrol/operation/pick
-http://tizen.org/appcontrol/operation/add=http://tizen.org/appcontrol/operation/add
-http://tizen.org/appcontrol/operation/edit=http://tizen.org/appcontrol/operation/edit
-http://tizen.org/appcontrol/operation/view=http://tizen.org/appcontrol/operation/view
-#http://tizen.org/appcontrol/provider/calendar
-PROVIDER_ALIAS=tizen.calendar
-http://tizen.org/appcontrol/operation/pick=http://tizen.org/appcontrol/operation/pick
-http://tizen.org/appcontrol/operation/view=http://tizen.org/appcontrol/operation/view
-#http://tizen.org/appcontrol/provider/bluetooth
-PROVIDER_ALIAS=tizen.bluetooth
-http://tizen.org/appcontrol/operation/pick=http://tizen.org/appcontrol/operation/pick
-#http://tizen.org/appcontrol/provider/call
-PROVIDER_ALIAS=tizen.phone
-http://tizen.org/appcontrol/operation/call=http://tizen.org/appcontrol/operation/call
-http://tizen.org/appcontrol/operation/dial=http://tizen.org/appcontrol/operation/dial
-#http://tizen.org/appcontrol/provider/browser
-PROVIDER_ALIAS=tizen.internet
-http://tizen.org/appcontrol/operation/view=http://tizen.org/appcontrol/operation/view
-#http://tizen.org/appcontrol/provider/media
-PROVIDER_ALIAS=tizen.filemanager
-http://tizen.org/appcontrol/operation/pick=http://tizen.org/appcontrol/operation/pick
-#http://tizen.org/appcontrol/provider/message
-PROVIDER_ALIAS=tizen.messages
-http://tizen.org/appcontrol/operation/compose=http://tizen.org/appcontrol/operation/compose
-#http://tizen.org/appcontrol/provider/email
-PROVIDER_ALIAS=tizen.email
-http://tizen.org/appcontrol/operation/compose=http://tizen.org/appcontrol/operation/compose
-#http://tizen.org/appcontrol/provider/image
-PROVIDER_ALIAS=tizen.imageviewer
-http://tizen.org/appcontrol/operation/view=http://tizen.org/appcontrol/operation/view
-#http://tizen.org/appcontrol/provider/video
-PROVIDER_ALIAS=tizen.videoplayer
-http://tizen.org/appcontrol/operation/play=http://tizen.org/appcontrol/operation/view
-#http://tizen.org/appcontrol/provider/audio
-PROVIDER_ALIAS=tizen.musicplayer
-http://tizen.org/appcontrol/operation/play=http://tizen.org/appcontrol/operation/view
-#http://tizen.org/appcontrol/provider/camera
-PROVIDER_ALIAS=tizen.camera
-http://tizen.org/appcontrol/operation/capture=http://tizen.org/appcontrol/operation/createcontent
-http://tizen.org/appcontrol/operation/record=http://tizen.org/appcontrol/operation/createcontent
-#http://tizen.org/appcontrol/provider/settings
-PROVIDER_ALIAS=tizen.settings
-http://tizen.org/appcontrol/operation/configure=http://tizen.org/appcontrol/operation/configure
-#http://tizen.org/appcontrol/provider/certificatemanager
-PROVIDER_ALIAS=tizen.certificatemanager
-http://tizen.org/appcontrol/operation/pick=http://tizen.org/appcontrol/operation/pick
diff --git a/res/x86/usr/etc/app-control-appid.ini b/res/x86/usr/etc/app-control-appid.ini
deleted file mode 100644 (file)
index 0e1afcb..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-#Alias
-tizen.internet=kmcele1k0n.Internet
-tizen.filemanager=0pnxz8hbsr.MyFiles
-tizen.camera=hdufar9ycj.Camera
-tizen.gallery=ijudt7w61q.Gallery
-tizen.imageviewer=jysyv9o1dc.ImageViewer
-tizen.videoplayer=npwf0scb88.VideoPlayer
-tizen.memo=zunqjlsnce.Memo
-tizen.contacts=f9uev8hsyo.Contacts
-tizen.calendar=ph1vq2phrp.Calendar
-tizen.events=ph1vq2phrp.Calendar
-tizen.email=vxqbrefica.Email
-tizen.settings=kto5jikgul.Settings
-tizen.messages=8r4r5ddzzn.Messages
-tizen.musicplayer=dhrul6qzj3.MusicPlayer
-tizen.bluetooth=kto5jikgul.Settings
-tizen.phone=zktdpemtmw.Phone
-samsung.snote=smemo-efl
diff --git a/res/x86/usr/etc/app-control-info.ini b/res/x86/usr/etc/app-control-info.ini
deleted file mode 100644 (file)
index 4a6843d..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-#tizen.todo
-Title=APPCONTROL_PROVIDER_TODO
-Overridable=No
-Vendor=Samsung
-OPID_Count=1
-OPID_0=http://tizen.org/appcontrol/operation/pick
-Path=libosp-ac-calendar.so
-LaunchType=2
-Public=0
-Category=osp.appcontrol.category.calendar
-#tizen.imageeditor
-Title=APPCONTROL_PROVIDER_IMAGE_EDITOR
-Overridable=No
-Vendor=Samsung
-OPID_Count=1
-OPID_0=http://tizen.org/appcontrol/operation/crop
-Path=libosp-ac-media.so
-LaunchType=2
-Public=0
-Category=osp.appcontrol.category.image
-#tizen.certificatemanager
-Title=APPCONTROL_PROVIDER_CERTIFICATE_MANAGER
-Overridable=No
-Vendor=Samsung
-OPID_Count=1
-OPID_0=http://tizen.org/appcontrol/operation/pick
-Path=libosp-ac-certmgr.so
-LaunchType=2
-Public=1
-Name=CertificateManager
-Category=osp.appcontrol.category.certificate
index f156682..25c829c 100755 (executable)
@@ -113,26 +113,58 @@ OnAppControlResult(void* b, int requestCode, service_result_e res, void* userDat
        int minClassType = 0;
        int svcClassType = 0;
        unsigned long svcType = 0;
+       int result = SERVICE_RESULT_SUCCEEDED;
+       const char* pBuf;
 
        HashMap* pResult = new (std::nothrow) HashMap();
        SysTryCatch(NID_APP, pResult != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Allocation failure.");
 
        r = pResult->Construct();
 
-       switch (res)
+       pBuf = appsvc_get_data(pBundle, "result");
+       if (strcmp(pBuf, "success") == 0)
+       {
+               result = SERVICE_RESULT_SUCCEEDED;
+       }
+       else
+       {
+               result = SERVICE_RESULT_FAILED;
+       }
+
+       switch (result)
        {
        case SERVICE_RESULT_SUCCEEDED:
                {
-                       const char* pBuf = appsvc_get_data(pBundle, "address");
+                       pBuf = appsvc_get_data(pBundle, "address");
                        if (pBuf)
                        {
-                               pResult->Add(new (std::nothrow) String(L"addr_val"), new (std::nothrow) String(pBuf));
+                               pResult->Add(new (std::nothrow) String(L"http://tizen.org/appcontrol/data/bluetooth/address"), new (std::nothrow) String(pBuf));
                        }
 
                        pBuf = appsvc_get_data(pBundle, "name");
                        if (pBuf)
                        {
-                               pResult->Add(new (std::nothrow) String(L"dev_name"), new (std::nothrow) String(pBuf));
+                               pResult->Add(new (std::nothrow) String(L"http://tizen.org/appcontrol/data/bluetooth/name"), new (std::nothrow) String(pBuf));
+                       }
+
+                       pBuf = appsvc_get_data(pBundle, "rssi");
+                       if (pBuf)
+                       {
+                               pResult->Add(new (std::nothrow) String(L"http://tizen.org/appcontrol/data/bluetooth/rssi"), new (std::nothrow) String(pBuf));
+                       }
+
+                       pBuf = appsvc_get_data(pBundle, "is_bonded");
+                       if (pBuf)
+                       {
+                               if (*pBuf == '1')
+                               {
+                                       pBuf = "true";
+                               }
+                               else
+                               {
+                                       pBuf = "false";
+                               }
+                               pResult->Add(new (std::nothrow) String(L"http://tizen.org/appcontrol/data/bluetooth/is_paired"), new (std::nothrow) String(pBuf));
                        }
 
                        pBuf = appsvc_get_data(pBundle, "major_class");
@@ -141,7 +173,7 @@ OnAppControlResult(void* b, int requestCode, service_result_e res, void* userDat
                                Integer::Decode(String(pBuf), majClassType);
                                majClassType = (int)_BluetoothAdapterUtility::ConvertToMajorDeviceClassType((bt_major_device_class_e)majClassType);
 
-                               pResult->Add(new (std::nothrow) String(L"maj_cls_type"), new (std::nothrow) String(Integer::ToString(majClassType)));
+                               pResult->Add(new (std::nothrow) String(L"http://tizen.org/appcontrol/data/bluetooth/major_class"), new (std::nothrow) String(Integer::ToString(majClassType)));
                        }
 
                        pBuf = appsvc_get_data(pBundle, "minor_class");
@@ -150,7 +182,7 @@ OnAppControlResult(void* b, int requestCode, service_result_e res, void* userDat
                                Integer::Decode(String(pBuf), minClassType);
                                minClassType = (int)_BluetoothAdapterUtility::ConvertToMinorDeviceClassType((bt_major_device_class_e)majClassType, (bt_minor_device_class_e)minClassType);
 
-                               pResult->Add(new (std::nothrow) String(L"min_cls_type"), new (std::nothrow) String(Integer::ToString(minClassType)));
+                               pResult->Add(new (std::nothrow) String(L"http://tizen.org/appcontrol/data/bluetooth/minor_class"), new (std::nothrow) String(Integer::ToString(minClassType)));
                        }
 
                        pBuf = appsvc_get_data(pBundle, "service_class");
@@ -159,11 +191,13 @@ OnAppControlResult(void* b, int requestCode, service_result_e res, void* userDat
                                Integer::Decode(String(pBuf), svcClassType);
                                svcClassType = (int)_BluetoothAdapterUtility::ConvertToServiceClassList(svcClassType);
 
-                               pResult->Add(new (std::nothrow) String(L"svc_cls_type"), new (std::nothrow) String(Integer::ToString(svcClassType)));
+                               pResult->Add(new (std::nothrow) String(L"http://tizen.org/appcontrol/data/bluetooth/service_class"), new (std::nothrow) String(Integer::ToString(svcClassType)));
                        }
 
                        int len = 0;
                        char** ppArrayBuf = (char**)appsvc_get_data_array(pBundle, "uuids", &len);
+
+                       // TODO: Parsing routine for uuid_list should be added.
                        if (len > 0 && ppArrayBuf != null)
                        {
                                svcType = _BluetoothAdapterUtility::ConvertToServiceList(ppArrayBuf, len);
@@ -177,7 +211,8 @@ OnAppControlResult(void* b, int requestCode, service_result_e res, void* userDat
                                free(ppArrayBuf);
                        }
 
-                       pResult->Add(new (std::nothrow) String(L"svc_type"), new (std::nothrow) String(Long::ToString(svcType)));
+                       // TODO: the uuid_list value should be added to pResult.
+                       pResult->Add(new (std::nothrow) String(L"http://tizen.org/appcontrol/data/bluetooth/service_type"), new (std::nothrow) String(Long::ToString(svcType)));
                }
                break;
        case SERVICE_RESULT_FAILED:
@@ -188,7 +223,7 @@ OnAppControlResult(void* b, int requestCode, service_result_e res, void* userDat
                break;
        }
 
-       _AppControlManager::GetInstance()->FinishAppControl(__req, res, pResult);
+       _AppControlManager::GetInstance()->FinishAppControl(__req, result, pResult);
 
 CATCH:
        __req = -1;
index 3e63acf..acf49d5 100755 (executable)
@@ -78,11 +78,7 @@ StartAppControl(int req, const String& aId, const String& oId, const String* pUr
                        }
 
                        __req = req;
-                       __processId = _AppControlManager::GetInstance()->Launch(msg, "org.tizen.camera-app", APPSVC_OPERATION_CREATE_CONTENT, buffer, NULL, OnAppControlResult, 0);
-                       if (__processId <= 0)
-                       {
-                               __processId = _AppControlManager::GetInstance()->Launch(msg, "com.samsung.camera-app", APPSVC_OPERATION_CREATE_CONTENT, buffer, NULL, OnAppControlResult, 0);
-                       }
+                       __processId = _AppControlManager::GetInstance()->Launch(msg, "camera-efl", APPSVC_OPERATION_CREATE_CONTENT, buffer, NULL, OnAppControlResult, 0);
                }
                SysTryReturnResult(NID_APP, __processId >= 0, E_SYSTEM, "StartAppControl: Launching Camera AppControl is failed.");
 
index 557b303..d356706 100755 (executable)
@@ -331,7 +331,7 @@ StartAppControlForPick(const String* pUri, const String* pMime, const IMap* pMap
                }
                else
                {
-                       SysLog(NID_APP, "returnType must be one of phone, email, contactId, or vcard.");
+                       SysLog(NID_APP, "returnType must be phone, email, contactId, or vcard.");
                        return E_INVALID_ARG;
                }
        }
@@ -358,13 +358,13 @@ StartAppControlForPick(const String* pUri, const String* pMime, const IMap* pMap
                }
                else
                {
-                       SysLog(NID_APP, "returnType must be one of phone, email, contactId.");
+                       SysLog(NID_APP, "returnType must be phone, email, or contactId.");
                        return E_INVALID_ARG;
                }
        }
        else
        {
-               SysLog(NID_APP, "selectionMode must be either of single or multiple.");
+               SysLog(NID_APP, "selectionMode must be either single or multiple.");
                return E_INVALID_ARG;
        }
 
@@ -553,7 +553,7 @@ StartAppControlForView( const String* pUri, const String* pMime, const IMap* pMa
        }
        else
        {
-               SysLog(NID_APP, "viewType must be either of vcf or contact.");
+               SysLog(NID_APP, "viewType must be either vcf or contact.");
                return E_SUCCESS;
        }
        
diff --git a/src/nfc-push-ui-app-control/CMakeLists.txt b/src/nfc-push-ui-app-control/CMakeLists.txt
new file mode 100755 (executable)
index 0000000..6d84489
--- /dev/null
@@ -0,0 +1,45 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+
+SET (this_target nfc-push-ui-app-control)
+SET (APPID 42KriKjov3)
+
+SET(CMAKE_EXECUTABLE_SUFFIX ".exe")
+SET(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/output")
+
+INCLUDE_DIRECTORIES (
+       ${COMMON_INCLUDE_DIRS}  
+       inc     
+       )
+
+SET (${this_target}_SOURCE_FILES
+       src/NfcPushUi.cpp
+       src/NfcPushUiEntry.cpp
+       src/NfcPushUiForm.cpp
+       src/NfcPushUiFrame.cpp
+       )
+       
+## SET EXTRA COMPILER FLAGS
+SET(EXTRA_CFLAGS  "${EXTRA_CFLAGS} -fPIE -Wall -pthread -g3" )
+
+## SET C COMPILER FLAGS
+SET(CMAKE_C_FLAGS "${OSP_DEBUG_FLAGS} ${OSP_OPT_FLAGS} ${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} ${OSP_COMPILER_FLAGS}")
+
+## SET CPP COMPILER FLAGS
+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
+SET(CMAKE_CXX_FLAGS "${OSP_DEBUG_FLAGS} ${OSP_OPT_FLAGS} ${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS} ${OSP_COMPILER_FLAGS}")
+
+## Create Library
+ADD_EXECUTABLE (${this_target} ${${this_target}_SOURCE_FILES})
+
+TARGET_LINK_LIBRARIES(${this_target} -Xlinker --no-undefined -Xlinker --as-needed -pie)
+TARGET_LINK_LIBRARIES(${this_target} -Xlinker --version-script=${CMAKE_CURRENT_SOURCE_DIR}/system-service-export.ver)
+TARGET_LINK_LIBRARIES(${this_target} -L/usr/lib/osp -losp-appfw -losp-nfc -losp-uifw -losp-image -losp-image-core -lchromium)
+
+## strip
+EXE_STRIP(${this_target})
+
+## Copy additional info
+INSTALL(TARGETS ${this_target} DESTINATION ../usr/apps/${APPID}/bin)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/manifest.xml DESTINATION ../usr/apps/${APPID}/info)
+INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/data DESTINATION ../usr/apps/${APPID})
+INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/res DESTINATION ../usr/apps/${APPID})
\ No newline at end of file
diff --git a/src/nfc-push-ui-app-control/data/dummy.file b/src/nfc-push-ui-app-control/data/dummy.file
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/src/nfc-push-ui-app-control/inc/NfcPushUi.h b/src/nfc-push-ui-app-control/inc/NfcPushUi.h
new file mode 100644 (file)
index 0000000..1908c7c
--- /dev/null
@@ -0,0 +1,82 @@
+//
+// Open Service Platform
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+* @file                NfcPushUi.h
+* @brief       This file contains the declaration of NfcPushUiApp class.
+*/
+
+#ifndef _NFC_PUSH_UI_H_
+#define _NFC_PUSH_UI_H_
+
+#include <FAppUiApp.h>
+#include <FAppIAppControlProviderEventListener.h>
+#include <FSysIScreenEventListener.h>
+
+class NfcPushUiApp
+       : public Tizen::App::UiApp
+       , public Tizen::System::IScreenEventListener
+       , public Tizen::App::IAppControlProviderEventListener
+{
+public:
+       static Tizen::App::UiApp* CreateInstance(void);
+
+public:
+       NfcPushUiApp(void);
+       virtual~NfcPushUiApp(void);
+
+public:
+       // Called when the UiApp is initializing.
+       bool OnAppInitializing(Tizen::App::AppRegistry& appRegistry);
+
+       // Called when the UiApp initializing is finished. 
+       bool OnAppInitialized(void); 
+
+       // Called when the UiApp is requested to terminate. 
+       bool OnAppWillTerminate(void); 
+
+       // Called when the UiApp is terminating.
+       bool OnAppTerminating(Tizen::App::AppRegistry& appRegistry, bool forcedTermination = false);
+
+       // Called when the UiApp's frame moves to the top of the screen.
+       void OnForeground(void);
+
+       // Called when this UiApp's frame is moved from top of the screen to the background.
+       void OnBackground(void);
+
+       // Called when the system memory is not sufficient to run the UiApp any further.
+       void OnLowMemory(void);
+
+       // Called when the battery level changes.
+       void OnBatteryLevelChanged(Tizen::System::BatteryLevel batteryLevel);
+
+       // Called when the screen turns on.
+       void OnScreenOn(void);
+
+       // Called when the screen turns off.
+       void OnScreenOff(void);
+
+       // IAppControlProviderEventListener
+       virtual void OnAppControlRequestReceived(RequestId reqId, const Tizen::Base::String& operationId, const Tizen::Base::String* pUriData, const Tizen::Base::String* pMimeType, const Tizen::Base::Collection::IMap* pExtraData);
+
+private:
+       RequestId __reqId;
+       Tizen::Base::String __iconPath;
+       Tizen::Base::String __description;
+};
+
+#endif // _NFC_PUSH_UI_H_
diff --git a/src/nfc-push-ui-app-control/inc/NfcPushUiForm.h b/src/nfc-push-ui-app-control/inc/NfcPushUiForm.h
new file mode 100644 (file)
index 0000000..2f51bb5
--- /dev/null
@@ -0,0 +1,109 @@
+//
+// Open Service Platform
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+* @file                NfcPushUiForm.h
+* @brief       This file contains the declaration of NfcPushUiForm class.
+*/
+
+#ifndef _NFC_PUSH_UI_FORM_H_
+#define _NFC_PUSH_UI_FORM_H_
+
+#include <FGrpRectangle.h>
+#include <FUiCtrlForm.h>
+#include <FUiITouchEventListener.h>
+#include <FNetNfcINfcDeviceDiscoveryEventListener.h>
+#include <FNetNfcINfcManagerEventListener.h>
+#include <FNetNfcNfcManager.h>
+#include <FUiAnimIVisualElementAnimationStatusEventListener.h>
+
+class NfcPushUiForm
+       : public Tizen::Ui::Controls::Form
+       , public Tizen::Ui::ITouchEventListener
+       , public Tizen::Net::Nfc::INfcDeviceDiscoveryEventListener
+       , public Tizen::Net::Nfc::INfcManagerEventListener
+       , public Tizen::Ui::Animations::IVisualElementAnimationStatusEventListener
+{
+public:
+       NfcPushUiForm(void);
+       virtual ~NfcPushUiForm(void);
+       bool Initialize(RequestId reqId, const Tizen::Graphics::Rectangle& rect);
+       void SetAppInfo(const Tizen::Base::String& iconPath, const Tizen::Base::String& description);
+
+public:
+       result CaptureScreen(void);
+       result DrawBitmapToCanvas(const Tizen::Graphics::Rectangle& rect);
+       result DrawAppInfoToCanvas(const Tizen::Graphics::Rectangle& rect);
+       result DrawGuideTextToCanvas(const Tizen::Graphics::Rectangle& rect);
+       void FinishAppControl(RequestId reqId, Tizen::App::AppCtrlResult appCtrlResult);
+
+       void PlayBoundsAnimation(const Tizen::Base::String& animationName, int repeatCount, int duration, bool autoReverse = false);
+       void PlayOpacityAnimation(const Tizen::Base::String& animationName, int duration);
+
+public:
+       virtual result OnInitializing(void);
+       virtual result OnTerminating(void);
+
+       result OnDraw(void);
+
+       // ITouchEventListener
+       void OnTouchPressed(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo & touchInfo) {}
+       void OnTouchLongPressed(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo) {}
+       void OnTouchReleased(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo);
+       void OnTouchMoved(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo) {}
+       void OnTouchDoublePressed(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo) {}
+       void OnTouchFocusIn(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo) {}
+       void OnTouchFocusOut(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo) {}
+       void OnTouchCanceled(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo) {}
+
+       //IVisualElementAnimationStatusEventListener
+       virtual void OnVisualElementAnimationStarted(const Tizen::Ui::Animations::VisualElementAnimation& animation, const Tizen::Base::String& keyName, Tizen::Ui::Animations::VisualElement& target){}
+       virtual void OnVisualElementAnimationRepeated(const Tizen::Ui::Animations::VisualElementAnimation& animation, const Tizen::Base::String& keyName, Tizen::Ui::Animations::VisualElement& target, long currentRepeatCount){}
+       virtual void OnVisualElementAnimationFinished(const Tizen::Ui::Animations::VisualElementAnimation& animation, const Tizen::Base::String& keyName, Tizen::Ui::Animations::VisualElement& target, bool completedNormally);
+
+       // INfcDeviceDiscoveryEventListener
+       virtual void OnNfcDeviceDetected(void) {}
+       virtual void OnNfcDeviceLost(void);
+
+       // INfcManagerEventListener
+       virtual void OnNfcActivated(result r) {}
+       virtual void OnNfcDeactivated(result r) {}
+
+public:
+       static const int _DURATION_GROW_;
+       static const int _DURATION_OPACITY_;
+       static const int _DURATION_REPEAT_;
+       static const int _DURATION_OPACITY2_;
+
+private:
+       RequestId __reqId;
+       Tizen::Graphics::Bitmap* __pCapturedScreen;
+       Tizen::Graphics::Rectangle __rect;
+       bool __isCaptured;
+       Tizen::Base::String __iconPath;
+       Tizen::Base::String __description;
+       Tizen::Net::Nfc::NfcManager* __pNfcManager;
+       Tizen::Ui::Animations::VisualElement* __pVisualElementBounds;
+       Tizen::Ui::Animations::VisualElement* __pVisualElementOpacity;
+       Tizen::Ui::Animations::VisualElement* __pVisualElement;
+       Tizen::Graphics::FloatRectangle __startRect;
+       Tizen::Graphics::FloatRectangle __endRect;
+       float __startOpacity;
+       float __endOpacity;
+};
+
+#endif //_NFC_PUSH_UI_FORM_H_
diff --git a/src/nfc-push-ui-app-control/inc/NfcPushUiFrame.h b/src/nfc-push-ui-app-control/inc/NfcPushUiFrame.h
new file mode 100644 (file)
index 0000000..840a69c
--- /dev/null
@@ -0,0 +1,48 @@
+//
+// Open Service Platform
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+* @file                NfcPushUiFrame.h
+* @brief       This file contains the declaration of NfcPushUiFrame class.
+*/
+
+#ifndef _NFC_PUSH_UI_FRAME_H_
+#define _NFC_PUSH_UI_FRAME_H_
+
+#include <FUiCtrlFrame.h>
+
+class NfcPushUiFrame
+       : public Tizen::Ui::Controls::Frame
+{
+public:
+       NfcPushUiFrame(void);
+       virtual ~NfcPushUiFrame(void);
+
+       void SetRequestId(RequestId reqId);
+       void SetAppInfo(const Tizen::Base::String& iconPath, const Tizen::Base::String& description);
+
+public:
+       virtual result OnInitializing(void);
+       virtual result OnTerminating(void);
+
+private:
+       RequestId __reqId;
+       Tizen::Base::String __iconPath;
+       Tizen::Base::String __description;
+};
+
+#endif //_NFC_PUSH_UI_FRAME_H_
diff --git a/src/nfc-push-ui-app-control/manifest.xml b/src/nfc-push-ui-app-control/manifest.xml
new file mode 100644 (file)
index 0000000..508e77f
--- /dev/null
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Manifest xmlns="http://schemas.tizen.org/2012/06/manifest">
+       <Id>42KriKjov3</Id>
+       <Version>1.0.0</Version>
+       <Type>C++App</Type>
+       <Vendors></Vendors>
+       <Descriptions></Descriptions>
+       <Url></Url>
+       <Apps>
+               <ApiVersion>3.0</ApiVersion>
+               <Privileges>
+            <Privilege>http://tizen.org/privilege/nfc.common</Privilege>
+            <Privilege>http://tizen.org/privilege/nfc.p2p</Privilege>
+            <Privilege>http://tizen.org/privilege/systeminfo</Privilege>
+            <Privilege>http://tizen.org/privilege/inputmanager</Privilege>
+        </Privileges>
+               <UiApp ExecutableName="nfc-push-ui-app-control" Default="True" MainmenuVisible="True" MenuIconVisible="False">
+                       <UiScalability CoordinateSystem="Logical" BaseScreenSize="Normal" LogicalCoordinate="720"></UiScalability>
+                       <UiTheme SystemTheme="White"></UiTheme>
+                       <Names>
+                               <Name Locale="eng-GB">NfcPushUi</Name>
+                       </Names>
+                       <Icons>
+                               <Icon Section="MainMenu" Type="Xhigh">mainmenu.png</Icon>
+                       </Icons>
+            <AppControls>
+                <AppControl Category="osp.appcontrol.category.none" ProviderId="http://tizen.org/appcontrol/provider/nfcpushui">
+                    <Capability OperationId="http://tizen.org/appcontrol/operation/nfc/animation/show">
+                    </Capability>
+                </AppControl>
+            </AppControls>
+                       <LaunchConditions></LaunchConditions>
+                       <Notifications></Notifications>
+               </UiApp>
+       </Apps>
+</Manifest>
diff --git a/src/nfc-push-ui-app-control/nfc-push-ui-app-control.manifest b/src/nfc-push-ui-app-control/nfc-push-ui-app-control.manifest
new file mode 100644 (file)
index 0000000..44cfbb6
--- /dev/null
@@ -0,0 +1,12 @@
+<manifest>
+       <define>
+               <domain name="nfc-push-ui-app-control"/>
+       </define>
+       <request>
+               <domain name="nfc-push-ui-app-control"/>
+       </request>
+       <assign>
+               <filesystem path="/usr/apps/42KriKjov3/bin/nfc-push-ui-app-control.exe" label="nfc-push-ui-app-control" exec_label="nfc-push-ui-app-control"/>
+               <filesystem path="/usr/share/license/nfc-push-ui-app-control" label="_"/>
+       </assign>
+</manifest>
\ No newline at end of file
diff --git a/src/nfc-push-ui-app-control/res/icon.png b/src/nfc-push-ui-app-control/res/icon.png
new file mode 100644 (file)
index 0000000..983c883
Binary files /dev/null and b/src/nfc-push-ui-app-control/res/icon.png differ
diff --git a/src/nfc-push-ui-app-control/shared/res/screen-density-xhigh/mainmenu.png b/src/nfc-push-ui-app-control/shared/res/screen-density-xhigh/mainmenu.png
new file mode 100644 (file)
index 0000000..b0979b1
Binary files /dev/null and b/src/nfc-push-ui-app-control/shared/res/screen-density-xhigh/mainmenu.png differ
diff --git a/src/nfc-push-ui-app-control/src/NfcPushUi.cpp b/src/nfc-push-ui-app-control/src/NfcPushUi.cpp
new file mode 100644 (file)
index 0000000..68e4aed
--- /dev/null
@@ -0,0 +1,132 @@
+//
+// Open Service Platform
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+* @file                NfcPushUi.cpp
+* @brief       This file contains the implementation of NfcPushUi class.
+*/
+
+#include <FBaseSysLog.h>
+#include <FAppAppControlProviderManager.h>
+#include <FApp_AppMessageImpl.h>
+#include "NfcPushUi.h"
+#include "NfcPushUiFrame.h"
+
+using namespace Tizen::App;
+using namespace Tizen::Base;
+using namespace Tizen::System;
+using namespace Tizen::Ui;
+using namespace Tizen::Ui::Controls;
+
+NfcPushUiApp::NfcPushUiApp(void) : __reqId(-1)
+{
+}
+
+NfcPushUiApp::~NfcPushUiApp(void)
+{
+}
+
+UiApp*
+NfcPushUiApp::CreateInstance(void)
+{
+       // Create the instance through the constructor.
+       return new NfcPushUiApp();
+}
+
+bool
+NfcPushUiApp::OnAppInitializing(AppRegistry& appRegistry)
+{
+       // SetAppControlProviderEventListener - to get reqId of this app
+       result r = Tizen::App::AppControlProviderManager::GetInstance()->SetAppControlProviderEventListener(this);
+       SysTryReturn(NID_NET_NFC, r == E_SUCCESS, false, r, "[%s] exception occurred.", GetErrorMessage(r));
+
+       return true;
+}
+
+bool
+NfcPushUiApp::OnAppInitialized(void)
+{
+       // Create a Frame
+       NfcPushUiFrame* pNfcPushUiFrame = new NfcPushUiFrame();
+       pNfcPushUiFrame->Construct();
+       pNfcPushUiFrame->SetName(L"NfcPushUi");
+       pNfcPushUiFrame->SetRequestId(__reqId);
+       pNfcPushUiFrame->SetAppInfo(__iconPath, __description);
+       AddFrame(*pNfcPushUiFrame);
+
+       return true;
+}
+
+bool
+NfcPushUiApp::OnAppWillTerminate(void)
+{
+       return true;
+}
+
+
+bool
+NfcPushUiApp::OnAppTerminating(AppRegistry& appRegistry, bool forcedTermination)
+{
+       return true;
+}
+
+void
+NfcPushUiApp::OnForeground(void)
+{
+}
+
+void
+NfcPushUiApp::OnBackground(void)
+{
+}
+
+void
+NfcPushUiApp::OnLowMemory(void)
+{
+}
+
+void
+NfcPushUiApp::OnBatteryLevelChanged(BatteryLevel batteryLevel)
+{
+}
+
+void
+NfcPushUiApp::OnScreenOn(void)
+{
+}
+
+void
+NfcPushUiApp::OnScreenOff(void)
+{
+}
+
+void
+NfcPushUiApp::OnAppControlRequestReceived(RequestId reqId, const Tizen::Base::String& operationId, const Tizen::Base::String* pUriData, const Tizen::Base::String* pMimeType, const Tizen::Base::Collection::IMap* pExtraData)
+{
+       SysLog(NID_NET_NFC, "nfc-push-ui-app-control RequestId [%d]", reqId);
+
+       __reqId = reqId;
+
+       SysTryReturnVoidResult(NID_NET_NFC, pExtraData != null, E_OPERATION_FAILED, "[E_OPERATION_FAILED] There is no extra data.");
+
+       // set extra data
+       _AppMessageImpl msg;
+       msg.AddData(pExtraData);
+
+       __iconPath = msg.GetValue(L"iconPath");
+       __description = msg.GetValue(L"description");
+}
diff --git a/src/nfc-push-ui-app-control/src/NfcPushUiEntry.cpp b/src/nfc-push-ui-app-control/src/NfcPushUiEntry.cpp
new file mode 100644 (file)
index 0000000..ad2065e
--- /dev/null
@@ -0,0 +1,67 @@
+//
+// Open Service Platform
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+* @file                NfcPushUiEntry.cpp
+* @brief       This file contains the Tizen application entry point.
+*/
+
+#include <FBaseSysLog.h>
+#include "NfcPushUi.h"
+
+using namespace Tizen::Base;
+using namespace Tizen::Base::Collection;
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif // __cplusplus
+
+_EXPORT_ int OspMain(int argc, char *pArgv[]);
+
+/**
+ * The entry function of Tizen application called by the operating system.
+ */
+int
+OspMain(int argc, char *pArgv[])
+{
+       result r = E_SUCCESS;
+
+       SysLog(NID_NET_NFC,"Application started.[%d]", argc);
+       ArrayList* pArgs = new ArrayList();
+       pArgs->Construct();
+       for (int i = 0; i < argc; i++)
+       {
+               pArgs->Add(*(new String(pArgv[i])));
+       }
+
+       r = Tizen::App::UiApp::Execute(NfcPushUiApp::CreateInstance, pArgs);
+       if (IsFailed(r))
+       {
+               SysLogException(NID_NET_NFC, r, "Application execution failed-[%s].", GetErrorMessage(r));
+               r &= 0x0000FFFF;
+       }
+
+       pArgs->RemoveAll(true);
+       delete pArgs;
+       SysLog(NID_NET_NFC,"Application finished.");
+
+       return static_cast<int>(r);
+}
+#ifdef __cplusplus
+}
+#endif // __cplusplus
diff --git a/src/nfc-push-ui-app-control/src/NfcPushUiForm.cpp b/src/nfc-push-ui-app-control/src/NfcPushUiForm.cpp
new file mode 100644 (file)
index 0000000..d10d2b7
--- /dev/null
@@ -0,0 +1,513 @@
+//
+// Open Service Platform
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+* @file                NfcPushUiForm.cpp
+* @brief       This file contains the implementation of NfcPushUiForm class.
+*/
+
+#include <unique_ptr.h>
+#include <FAppApp.h>
+#include <FAppAppControl.h>
+#include <FAppAppResource.h>
+#include <FAppAppControlProviderManager.h>
+#include <FUiAnimVisualElement.h>
+#include <FUiSystemUtil.h>
+#include <FUiAnimVisualElementPropertyAnimation.h>
+#include <FBaseSysLog.h>
+#include <FBaseColAllElementsDeleter.h>
+#include <FIoFile.h>
+#include <FMediaImage.h>
+#include "NfcPushUiForm.h"
+
+using namespace Tizen::Base;
+using namespace Tizen::Base::Collection;
+using namespace Tizen::App;
+using namespace Tizen::Ui;
+using namespace Tizen::Ui::Controls;
+using namespace Tizen::Ui::Animations;
+using namespace Tizen::Graphics;
+using namespace Tizen::Net::Nfc;
+using namespace Tizen::Media;
+
+const int NfcPushUiForm::_DURATION_GROW_ = 500;
+const int NfcPushUiForm::_DURATION_OPACITY_ = 500;
+const int NfcPushUiForm::_DURATION_REPEAT_ = 500;
+const int NfcPushUiForm::_DURATION_OPACITY2_ = 500;
+
+NfcPushUiForm::NfcPushUiForm(void)
+       : __reqId(-1)
+       , __pCapturedScreen(null)
+       , __rect()
+       , __isCaptured(false)
+       , __iconPath()
+       , __description()
+       , __pNfcManager(null)
+       , __pVisualElementBounds(null)
+       , __pVisualElementOpacity(null)
+       , __pVisualElement(null)
+       , __startRect()
+       , __endRect()
+       , __startOpacity(0.0f)
+       , __endOpacity(0.0f)
+{
+}
+
+NfcPushUiForm::~NfcPushUiForm(void)
+{
+       delete __pCapturedScreen;
+       delete __pNfcManager;
+
+       if (__pVisualElement)
+       {
+               __pVisualElement->Destroy();
+       }
+}
+
+bool
+NfcPushUiForm::Initialize(RequestId reqId, const Tizen::Graphics::Rectangle& rect)
+{
+       result r = E_SUCCESS;
+       std::unique_ptr<NfcManager> pNfcManager;
+
+       r = Construct(FORM_STYLE_NORMAL);
+       SysTryReturn(NID_NET_NFC, r == E_SUCCESS, false, r, "[%s] exception occurred.", GetErrorMessage(r));
+
+       // set app size
+       __rect = rect;
+
+       // set request ID
+       __reqId = reqId;
+
+       // NfcManager
+       pNfcManager.reset(new (std::nothrow) NfcManager());
+       SysTryCatch(NID_NET_NFC, pNfcManager != null, r = E_OUT_OF_MEMORY, r, "[%s] exception occurred.", GetErrorMessage(r));
+
+       // construct
+       r = pNfcManager->Construct(*this);
+       SysTryCatch(NID_NET_NFC, r == E_SUCCESS, , r, "[%s] exception occurred.", GetErrorMessage(r));
+
+       // set INfcDeviceDiscoveryEventListener
+       r = pNfcManager->AddDeviceDiscoveryEventListener(*this);
+       SysTryCatch(NID_NET_NFC, r == E_SUCCESS, , r, "[%s] exception occurred.", GetErrorMessage(r));
+
+       __pNfcManager = pNfcManager.release();
+
+       return true;
+
+CATCH:
+       FinishAppControl(__reqId, APP_CTRL_RESULT_FAILED);
+       return false;
+}
+
+void
+NfcPushUiForm::SetAppInfo(const String& iconPath, const String& description)
+{
+       // icon path
+       if (Tizen::Io::File::IsFileExist(iconPath))
+       {
+               __iconPath = iconPath;
+       }
+       else    // if icon path is empty, use default icon.
+       {
+               SysLog(NID_NET_NFC, "There is not such icon. [%ls]", iconPath.GetPointer());
+               __iconPath = App::GetInstance()->GetAppRootPath() + L"res/icon.png";
+               SysLog(NID_NET_NFC, "So use default icon: [%ls]", __iconPath.GetPointer());
+       }
+
+       // description
+       __description = description;
+}
+
+result
+NfcPushUiForm::OnInitializing(void)
+{
+       result r = E_SUCCESS;
+
+       // touch event
+       AddTouchEventListener(*this);
+
+       // visual element
+       __pVisualElement = new (std::nothrow) VisualElement();
+       __pVisualElement->Construct();
+       __pVisualElement->SetName(L"VisualElement");
+       __pVisualElement->SetBounds(FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f));
+       __pVisualElement->SetClipChildrenEnabled(false);
+       __pVisualElement->SetShowState(true);
+       GetVisualElement()->AttachChild(*__pVisualElement);
+
+       ////////////////////////////////////////////////////////////////////////////////
+       // bounds
+       ////////////////////////////////////////////////////////////////////////////////
+       __pVisualElementBounds = new (std::nothrow) VisualElement();
+       __pVisualElementBounds->Construct();
+       __pVisualElementBounds->SetName(L"Grow");
+       __pVisualElementBounds->SetBounds(FloatRectangle((__rect.width / 2.0f) - 75.0f, (__rect.height / 2.0f) - 75.0f, 150.0f, 150.0f));
+       __pVisualElementBounds->SetShowState(true);
+       __pVisualElementBounds->SetImplicitAnimationEnabled(false);
+       __pVisualElement->AttachChild(*__pVisualElementBounds);
+
+       __endRect = __pVisualElementBounds->GetBounds();
+       __startRect = FloatRectangle(__endRect.x + 75.0f, __endRect.y + 75.0f, 0, 0);
+
+       std::unique_ptr<Canvas> pCanvas(__pVisualElementBounds->GetCanvasN());
+       SysTryReturnResult(NID_NET_NFC, pCanvas != null, E_OUT_OF_MEMORY, "Failed to get canvas.");
+       pCanvas->SetForegroundColor(Color::GetColor(COLOR_ID_GREY));
+       pCanvas->SetLineStyle(LINE_STYLE_SOLID);
+       pCanvas->SetLineWidth(4);
+       pCanvas->DrawEllipse(Rectangle(25, 25, 100, 100));
+       pCanvas->SetLineWidth(3);
+       pCanvas->DrawEllipse(Rectangle(15, 15, 120, 120));
+       pCanvas->SetLineWidth(2);
+       pCanvas->DrawEllipse(Rectangle(5, 5, 140, 140));
+
+       __pVisualElementBounds->SetBounds(__startRect);
+
+       SysLog(NID_NET_NFC, "start to play animation");
+       PlayBoundsAnimation(L"grow", 1, _DURATION_GROW_);
+
+       ////////////////////////////////////////////////////////////////////////////////
+       // Opacity rectangle
+       ////////////////////////////////////////////////////////////////////////////////
+       __pVisualElementOpacity = new (std::nothrow) VisualElement();
+       __pVisualElementOpacity->Construct();
+       __pVisualElementOpacity->SetName(L"Opacity");
+       __pVisualElementOpacity->SetBounds(FloatRectangle((__rect.width / 2) - 50, (__rect.height / 2) - 50, 100, 100));
+       __pVisualElementOpacity->SetShowState(true);
+       __pVisualElementOpacity->SetImplicitAnimationEnabled(false);
+       __pVisualElement->AttachChild(*__pVisualElementOpacity);
+
+       pCanvas.reset(__pVisualElementOpacity->GetCanvasN());
+       SysTryReturnResult(NID_NET_NFC, pCanvas != null, E_OUT_OF_MEMORY, "Failed to get canvas.");
+
+       std::unique_ptr<Bitmap> pBitmap;
+       Image image;
+
+       r = image.Construct();
+       SysTryReturnResult(NID_NET_NFC, r == E_SUCCESS, r, "Failed to construct an Image instance.");
+
+       // decode the bitmap
+       pBitmap.reset(image.DecodeN(__iconPath, BITMAP_PIXEL_FORMAT_ARGB8888));
+       SysTryReturnResult(NID_NET_NFC, pBitmap != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
+
+       // scale the bitmap
+       r = pBitmap->Scale(Dimension(100, 100));
+       SysTryReturnResult(NID_NET_NFC, r == E_SUCCESS, r, "Failed to scale the bitmap.");
+
+       __startOpacity = 0.0f;
+       __endOpacity = 1.0f;
+
+       // draw the bitmap
+       r = pCanvas->DrawBitmap(Point(__rect.x, __rect.y), *pBitmap);
+       SysTryReturnResult(NID_NET_NFC, r == E_SUCCESS, r, "Failed to draw the bitmap.");
+
+       // set an opacity level
+       __pVisualElementOpacity->SetOpacity(__startOpacity);
+
+       return r;
+}
+
+result
+NfcPushUiForm::OnTerminating(void)
+{
+       return E_SUCCESS;
+}
+
+result
+NfcPushUiForm::OnDraw(void)
+{
+       result r = E_SUCCESS;
+       Rectangle rect = GetClientAreaBounds();
+
+       if (__isCaptured == false)
+       {
+               // get canvas from form
+               r = CaptureScreen();
+               SysTryCatch(NID_NET_NFC, r == E_SUCCESS, , r, "[%s] exception occurred.", GetErrorMessage(r));
+               __isCaptured = true;
+       }
+
+       // captured screen
+       r = DrawBitmapToCanvas(rect);
+       SysTryCatch(NID_NET_NFC, r == E_SUCCESS, , r, "[%s] Failed to draw captured screen.", GetErrorMessage(r));
+
+       // guide text
+       r = DrawGuideTextToCanvas(rect);
+       SysTryCatch(NID_NET_NFC, r == E_SUCCESS, , r, "[%s] Failed to draw guide text.", GetErrorMessage(r));
+
+       // app info
+       r = DrawAppInfoToCanvas(rect);
+       SysTryCatch(NID_NET_NFC, r == E_SUCCESS, , r, "[%s] Failed to draw app info.", GetErrorMessage(r));
+
+       return r;
+
+CATCH:
+       FinishAppControl(__reqId, APP_CTRL_RESULT_FAILED);
+       return r;
+}
+
+result
+NfcPushUiForm::CaptureScreen(void)
+{
+       if (__pCapturedScreen)
+       {
+               delete __pCapturedScreen;
+               __pCapturedScreen = null;
+       }
+
+       // capture the current screen
+       __pCapturedScreen = SystemUtil::CaptureScreenN();
+       SysTryReturnResult(NID_NET_NFC, __pCapturedScreen != null, GetLastResult(), "Failed to capture the screen.");
+
+       return E_SUCCESS;
+}
+
+result
+NfcPushUiForm::DrawBitmapToCanvas(const Rectangle& rect)
+{
+       result r = E_SUCCESS;
+       std::unique_ptr<Canvas> pCanvas;
+
+       // there should be a captured screen.
+       SysTryReturnResult(NID_NET_NFC, __pCapturedScreen != null, E_INVALID_STATE,
+                       "[E_INVALID_STATE] exception occurred. There is no captures screen.");
+
+       // get canvas
+       pCanvas.reset(GetCanvasN());
+       r = GetLastResult();
+       SysTryReturnResult(NID_NET_NFC, pCanvas != null, r,
+                       "[%s] exception occurred. Failed to get canvas instance.", GetErrorMessage(r));
+
+       // draw bitmap
+       r = pCanvas->DrawBitmap(rect, *__pCapturedScreen);
+       SysTryReturnResult(NID_NET_NFC, r == E_SUCCESS, r,
+                       "[%s] exception occurred. Failed to draw captured screen to canvas.", GetErrorMessage(r));
+
+       // darkening
+       r = pCanvas->FillRectangle(Color(0xC0000000), rect);
+       SysTryReturnResult(NID_NET_NFC, r == E_SUCCESS, r,
+                       "[%s] exception occurred. Failed to darken the captured screen.", GetErrorMessage(r));
+
+       return r;
+}
+
+result
+NfcPushUiForm::DrawAppInfoToCanvas(const Tizen::Graphics::Rectangle& rect)
+{
+    result r = E_SUCCESS;
+    const int textAreaWidth = rect.width;
+
+       std::unique_ptr<EnrichedText> pEnrichedText(new (std::nothrow) EnrichedText());
+       SysTryReturnResult(NID_NET_NFC, pEnrichedText != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
+
+       std::unique_ptr<TextElement> pTextElement(new (std::nothrow) TextElement());
+       SysTryReturnResult(NID_NET_NFC, pTextElement != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
+
+    r = pEnrichedText->Construct(Dimension(textAreaWidth, 200));
+    SysTryReturnResult(NID_NET_NFC, r == E_SUCCESS, r, "Failed to construct an enriched text.");
+
+    pEnrichedText->SetHorizontalAlignment(TEXT_ALIGNMENT_CENTER);
+    pEnrichedText->SetVerticalAlignment(TEXT_ALIGNMENT_MIDDLE);
+    pEnrichedText->SetTextWrapStyle(TEXT_WRAP_CHARACTER_WRAP);
+    pEnrichedText->SetTextAbbreviationEnabled(true);
+
+    // Creates a TextElement and sets attributes
+    r = pTextElement->Construct(__description);
+    SysTryReturnResult(NID_NET_NFC, r == E_SUCCESS, r, "Failed to construct a text element.");
+
+    pTextElement->SetTextColor(Color::GetColor(COLOR_ID_WHITE));
+    {
+        Font font;
+        font.Construct(FONT_STYLE_BOLD, 40);
+        pTextElement->SetFont(font);
+    }
+
+    // Adds the TextElement and the bitmap to the EnrichedText
+    pEnrichedText->Add(*pTextElement);
+
+       // canvas
+       std::unique_ptr<Canvas> pCanvas(GetCanvasN());
+       SysTryReturnResult(NID_NET_NFC, pCanvas != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
+
+       // Draws the EnrichedText at the specified Point
+       pCanvas->DrawText(Point(0, (rect.height / 2) + 100), *pEnrichedText);
+
+    return r;
+}
+
+result
+NfcPushUiForm::DrawGuideTextToCanvas(const Tizen::Graphics::Rectangle& rect)
+{
+    result r = E_SUCCESS;
+    const int textAreaWidth = rect.width;
+
+       std::unique_ptr<EnrichedText> pEnrichedText(new (std::nothrow) EnrichedText());
+       SysTryReturnResult(NID_NET_NFC, pEnrichedText != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
+
+       std::unique_ptr<TextElement> pTextElement(new (std::nothrow) TextElement());
+       SysTryReturnResult(NID_NET_NFC, pTextElement != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
+
+    r = pEnrichedText->Construct(Dimension(textAreaWidth, 100));
+    SysTryReturnResult(NID_NET_NFC, r == E_SUCCESS, r, "Failed to construct an enriched text.");
+
+    r = pEnrichedText->SetHorizontalAlignment(TEXT_ALIGNMENT_CENTER);
+    SysTryReturnResult(NID_NET_NFC, r == E_SUCCESS, r, "Failed to set horizontal alignment.");
+
+    pEnrichedText->SetVerticalAlignment(TEXT_ALIGNMENT_MIDDLE);
+    SysTryReturnResult(NID_NET_NFC, r == E_SUCCESS, r, "Failed to set vertical alignment.");
+
+    pEnrichedText->SetTextWrapStyle(TEXT_WRAP_CHARACTER_WRAP);
+    SysTryReturnResult(NID_NET_NFC, r == E_SUCCESS, r, "Failed to set text wrap style.");
+
+    pEnrichedText->SetTextAbbreviationEnabled(true);
+    SysTryReturnResult(NID_NET_NFC, r == E_SUCCESS, r, "Failed to set abbreviation enabled.");
+
+    // Creates a TextElement and sets attributes
+    r = pTextElement->Construct(L"Tap to send");
+    SysTryReturnResult(NID_NET_NFC, r == E_SUCCESS, r, "Failed to construct a text element.");
+
+       pTextElement->SetTextColor(Color::GetColor(COLOR_ID_WHITE));
+    {
+        Font font;
+        font.Construct(FONT_STYLE_BOLD, 40);
+        pTextElement->SetFont(font);
+    }
+
+    // Adds the TextElement and the bitmap to the EnrichedText
+    r = pEnrichedText->Add(*pTextElement);
+    SysTryReturnResult(NID_NET_NFC, r == E_SUCCESS, r, "Failed to add text element to enriched text.");
+
+       // canvas
+       std::unique_ptr<Canvas> pCanvas(GetCanvasN());
+       SysTryReturnResult(NID_NET_NFC, pCanvas != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
+
+       // Draws the EnrichedText at the specified Point
+       r = pCanvas->DrawText(Point((rect.width - textAreaWidth) / 2, (int)(rect.height / 4)), *pEnrichedText);
+    SysTryReturnResult(NID_NET_NFC, r == E_SUCCESS, r, "Failed to draw text to canvas.");
+
+    return r;
+}
+
+void
+NfcPushUiForm::PlayBoundsAnimation(const Tizen::Base::String& animationName, int repeatCount, int duration, bool autoReverse)
+{
+       std::unique_ptr<VisualElementPropertyAnimation> pAnimation(new (std::nothrow) VisualElementPropertyAnimation());
+       SysTryReturnVoidResult(NID_NET_NFC, pAnimation != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+
+       // bounds
+       pAnimation->SetPropertyName(L"bounds");
+       pAnimation->SetStartValue(Variant(__startRect));
+       pAnimation->SetEndValue(Variant(__endRect));
+       pAnimation->SetDuration(duration);
+       pAnimation->SetRepeatCount(repeatCount);
+       pAnimation->SetAutoReverseEnabled(autoReverse);
+       pAnimation->SetVisualElementAnimationStatusEventListener(this);
+
+       __pVisualElementBounds->AddAnimation(animationName, *pAnimation);
+}
+
+void
+NfcPushUiForm::PlayOpacityAnimation(const Tizen::Base::String& animationName, int duration)
+{
+       std::unique_ptr<VisualElementPropertyAnimation> pAnimation(new (std::nothrow) VisualElementPropertyAnimation());
+       SysTryReturnVoidResult(NID_NET_NFC, pAnimation != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+
+       //opacity
+       pAnimation->SetPropertyName(L"opacity");
+       pAnimation->SetStartValue(Variant(__startOpacity));
+       pAnimation->SetEndValue(Variant(__endOpacity));
+       pAnimation->SetDuration(duration);
+       pAnimation->SetVisualElementAnimationStatusEventListener(this);
+
+       __pVisualElementOpacity->AddAnimation(animationName, *pAnimation);
+}
+
+void
+NfcPushUiForm::FinishAppControl(RequestId reqId, AppCtrlResult appCtrlResult)
+{
+       result r = E_SUCCESS;
+
+       // send result
+       r = AppControlProviderManager::GetInstance()->SendAppControlResult(reqId, appCtrlResult, null);
+       SysTryReturnVoidResult(NID_NET_NFC, r == E_SUCCESS, r, "[%s] exception occurred.", GetErrorMessage(r));
+
+       // terminate
+       SysLog(NID_NET_NFC, "Terminating this app control. [%d]", __reqId);
+       App::GetInstance()->Terminate();
+}
+
+void
+NfcPushUiForm::OnVisualElementAnimationFinished(const VisualElementAnimation& animation, const String& keyName, VisualElement& target, bool completedNormally)
+{
+       if(completedNormally)
+       {
+               if(keyName == L"grow")
+               {
+                       PlayOpacityAnimation(L"opacity", _DURATION_OPACITY_);
+               }
+               else if (keyName == L"opacity")
+               {
+                       float margin = (__endRect.width * 0.2f) / 2;
+                       __startRect = __endRect;
+                       __endRect = FloatRectangle(__startRect.x - margin, __startRect.y - margin,
+                                       __startRect.width + (margin * 2), __startRect.height + (margin * 2));
+
+                       // start second animation - repeat
+                       PlayBoundsAnimation(L"repeat", 0, _DURATION_REPEAT_, true);
+               }
+               else if (keyName == L"shrink")
+               {
+                       __startOpacity = __endOpacity;
+                       __endOpacity = 0.0f;
+                       PlayOpacityAnimation(L"opacity2", _DURATION_OPACITY2_);
+               }
+               else if (keyName == L"opacity2")
+               {
+                       // finish this app control with success
+                       FinishAppControl(__reqId, APP_CTRL_RESULT_SUCCEEDED);
+               }
+       }
+}
+
+// ITouchEventListener
+void
+NfcPushUiForm::OnTouchReleased(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo)
+{
+       // remove the guide text and app info
+       Rectangle rect = GetClientAreaBounds();
+
+       result r = E_SUCCESS;
+
+       // remove the guide text and app description
+       r = DrawBitmapToCanvas(rect);
+       SysTryReturnVoidResult(NID_NET_NFC, r == E_SUCCESS, r, "[%s] Failed to remove guide text and app description.", GetErrorMessage(r));
+
+       // reset the circles size
+       __startRect = __endRect;
+       __endRect = FloatRectangle(__startRect.x + 90.0f, __startRect.y + 90.0f, 0, 0);
+
+       // play animation
+       PlayBoundsAnimation(L"shrink", 1, 500, false);
+}
+
+// INfcDeviceDiscoveryEventListener
+void
+NfcPushUiForm::OnNfcDeviceLost(void)
+{
+       SysLog(NID_NET_NFC, "Devices are lost each other. (User-Cancelled) Terminating this app-control...");
+       FinishAppControl(__reqId, APP_CTRL_RESULT_CANCELED);
+}
diff --git a/src/nfc-push-ui-app-control/src/NfcPushUiFrame.cpp b/src/nfc-push-ui-app-control/src/NfcPushUiFrame.cpp
new file mode 100644 (file)
index 0000000..77a2086
--- /dev/null
@@ -0,0 +1,92 @@
+//
+// Open Service Platform
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+* @file                NfcPushUiFrame.cpp
+* @brief       This file contains the implementation of NfcPushUiFrame class.
+*/
+
+#include <FAppAppControlProviderManager.h>
+#include <FBaseSysLog.h>
+#include "NfcPushUiFrame.h"
+#include "NfcPushUiForm.h"
+
+using namespace Tizen::Base;
+
+NfcPushUiFrame::NfcPushUiFrame(void)
+       : __reqId(-1)
+       , __iconPath()
+       , __description()
+{
+}
+
+NfcPushUiFrame::~NfcPushUiFrame(void)
+{
+}
+
+void
+NfcPushUiFrame::SetRequestId(RequestId reqId)
+{
+       __reqId = reqId;
+}
+
+void
+NfcPushUiFrame::SetAppInfo(const String& iconPath, const String& description)
+{
+       __iconPath = iconPath;
+       __description = description;
+}
+
+result
+NfcPushUiFrame::OnInitializing(void)
+{
+       result r = E_SUCCESS;
+       NfcPushUiForm* pNfcPushUiForm = null;
+       Tizen::Graphics::Rectangle rect;
+
+       // get size of frame
+       rect = GetBounds();
+
+       // Create a form
+       pNfcPushUiForm = new (std::nothrow) NfcPushUiForm();
+       SysTryReturn(NID_NET_NFC, pNfcPushUiForm != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] exception occurred.");
+
+       // initialize a form
+       pNfcPushUiForm->Initialize(__reqId, rect);
+
+       // set app info.
+       pNfcPushUiForm->SetAppInfo(__iconPath, __description);
+
+       // Add the form to the frame
+       r = AddControl(*pNfcPushUiForm);
+       SysTryReturn(NID_NET_NFC, r == E_SUCCESS, r, r, "[%s] exception occurred.", GetErrorMessage(r));
+
+       // Set the current form
+       r = SetCurrentForm(*pNfcPushUiForm);
+       SysTryReturn(NID_NET_NFC, r == E_SUCCESS, r, r, "[%s] exception occurred.", GetErrorMessage(r));
+
+       // Draw and Show the form
+       pNfcPushUiForm->Invalidate(true);
+
+       return r;
+}
+
+result
+NfcPushUiFrame::OnTerminating(void)
+{
+       return E_SUCCESS;
+}
diff --git a/src/nfc-push-ui-app-control/system-service-export.ver b/src/nfc-push-ui-app-control/system-service-export.ver
new file mode 100755 (executable)
index 0000000..68c06a8
--- /dev/null
@@ -0,0 +1,6 @@
+{
+global:
+       OspMain;
+local:
+       *;
+};
index 20765f7..52f1b73 100755 (executable)
@@ -258,6 +258,8 @@ TerminateAppControl(int req)
 void
 OnAppControlResult(void* b, int requestCode, service_result_e res, void* userData)
 {
+       SysLog(NID_APP, "Setting AppControl result received.");
+
        result r = E_SYSTEM;
        bundle* pBundle = static_cast<bundle*>(b);