Tizen 2.0 release 2.0alpha master 2.0_alpha submit/master/20120920.150940
authorJaekyun Lee <jkyun.lee@samsung.com>
Tue, 21 Aug 2012 10:53:48 +0000 (19:53 +0900)
committerJaekyun Lee <jkyun.lee@samsung.com>
Tue, 21 Aug 2012 10:53:48 +0000 (19:53 +0900)
31 files changed:
CMakeLists.txt [new file with mode: 0644]
LICENSE [new file with mode: 0644]
NOTICE [new file with mode: 0644]
data/bluetooth-share-ui.ini [new file with mode: 0644]
data/edc/bt-share-layout.edc [new file with mode: 0644]
data/images/A01-4_Inbound_transfer_failed.png [new file with mode: 0644]
data/images/A01-4_Inbound_transfer_successed.png [new file with mode: 0644]
data/images/A01-4_No_items_Inbound_transfer.png [new file with mode: 0644]
data/images/A01-4_No_items_Outbound_transfer.png [new file with mode: 0644]
data/images/A01-4_Outbound_transfer_failed.png [new file with mode: 0644]
data/images/A01-4_Outbound_transfer_successed.png [new file with mode: 0644]
data/images/Q02_Notification_bluetooth.png [new file with mode: 0644]
data/images/Q02_icon_BT_receive.png [new file with mode: 0644]
data/images/Q02_icon_BT_transmit.png [new file with mode: 0644]
data/org.tizen.bluetooth-share-ui.png [new file with mode: 0644]
data/org.tizen.bluetooth-share-ui.xml [new file with mode: 0644]
debian/changelog [new file with mode: 0644]
debian/compat [new file with mode: 0644]
debian/control [new file with mode: 0644]
debian/docs [new file with mode: 0644]
debian/org.tizen.bluetooth-share-ui.install.in [new file with mode: 0644]
debian/rules [new file with mode: 0755]
packaging/org.tizen.bluetooth-share-ui.spec [new file with mode: 0644]
src/applog.h [new file with mode: 0644]
src/bt-share-ui-ipc.c [new file with mode: 0644]
src/bt-share-ui-ipc.h [new file with mode: 0644]
src/bt-share-ui-main.c [new file with mode: 0644]
src/bt-share-ui-main.h [new file with mode: 0644]
src/bt-share-ui-resource.h [new file with mode: 0644]
src/bt-share-ui-view.c [new file with mode: 0644]
src/bt-share-ui-view.h [new file with mode: 0644]

diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644 (file)
index 0000000..6340d48
--- /dev/null
@@ -0,0 +1,81 @@
+
+
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT(bluetooth-share-ui C)
+
+SET(SRCS ${CMAKE_SOURCE_DIR}/src/bt-share-ui-main.c
+       ${CMAKE_SOURCE_DIR}/src/bt-share-ui-ipc.c
+       ${CMAKE_SOURCE_DIR}/src/bt-share-ui-view.c )
+
+SET(PREFIX ${CMAKE_INSTALL_PREFIX})
+
+IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
+       SET(CMAKE_BUILD_TYPE "Release")
+ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
+MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
+
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR})
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(pkgs REQUIRED
+       appcore-efl
+       bundle
+       dlog
+       dbus-glib-1
+       ecore
+       ecore-x
+       edbus
+       edje
+       elementary
+       evas
+       gobject-2.0
+       utilX
+       bluetooth-api
+       aul
+       capi-appfw-application
+       bluetooth-share-api)
+
+FOREACH(flag ${pkgs_CFLAGS})
+       SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag} -g")
+ENDFOREACH(flag)
+#SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -finstrument-functions")
+
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
+SET(CMAKE_C_FLAGS_DEBUG "-O0 -g ")
+SET(CMAKE_C_FLAGS_RELEASE "-O2")
+#This is flag for Gprof
+#SET(CMAKE_C_FLAGS_RELEASE "-pg")
+
+FIND_PROGRAM(UNAME NAMES uname)
+EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
+IF("${ARCH}" STREQUAL "arm")
+       ADD_DEFINITIONS("-DTARGET")
+       MESSAGE("add -DTARGET")
+ENDIF("${ARCH}" STREQUAL "arm")
+
+ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}/\"")
+ADD_DEFINITIONS("-DSLP_DEBUG")
+
+SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
+
+ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS})
+
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin)
+
+# install desktop file & icon
+SET(PREFIX ${CMAKE_INSTALL_PREFIX})
+INSTALL(FILES ${CMAKE_BINARY_DIR}/data/org.tizen.bluetooth-share-ui.xml DESTINATION /opt/share/packages)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/org.tizen.bluetooth-share-ui.png DESTINATION /opt/share/icons/default/small)
+INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/data/images/ DESTINATION ${PREFIX}/res/images FILES_MATCHING PATTERN "*.png")
+
+ADD_CUSTOM_TARGET(bt-share-layout.edj
+                COMMAND edje_cc -id ${CMAKE_CURRENT_SOURCE_DIR}/data/images
+                ${CMAKE_CURRENT_SOURCE_DIR}/data/edc/bt-share-layout.edc ${CMAKE_CURRENT_BINARY_DIR}/bt-share-layout.edj
+                DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/data/edc/bt-share-layout.edc
+)
+ADD_DEPENDENCIES(${PROJECT_NAME} bt-share-layout.edj)
+
+# install edj file
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/bt-share-layout.edj DESTINATION ${PREFIX}/res/edje)
+
diff --git a/LICENSE b/LICENSE
new file mode 100644 (file)
index 0000000..7ccb5b5
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,75 @@
+Flora License
+
+Version 1.0, May, 2012
+
+http://www.tizenopensource.org/license
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
+
+"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
+
+"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
+
+"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
+
+"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
+
+"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
+
+"Tizen Certified Platform" shall mean a software platform that complies with the standards set forth in the Compatibility Definition Document and passes the Compatibility Test Suite as defined from time to time by the Tizen Technical Steering Group and certified by the Tizen Association or its designated agent.
+
+2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work solely as incorporated into a Tizen Certified Platform, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work solely as incorporated into a Tizen Certified Platform to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof pursuant to the copyright license above, in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
+
+  1. You must give any other recipients of the Work or Derivative Works a copy of this License; and
+
+  2. You must cause any modified files to carry prominent notices stating that You changed the files; and
+
+  3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
+
+  4. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+APPENDIX: How to apply the Flora License to your work
+
+To apply the Flora License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Flora License, Version 1.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.tizenopensource.org/license
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
diff --git a/NOTICE b/NOTICE
new file mode 100644 (file)
index 0000000..ded3804
--- /dev/null
+++ b/NOTICE
@@ -0,0 +1 @@
+Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
\ No newline at end of file
diff --git a/data/bluetooth-share-ui.ini b/data/bluetooth-share-ui.ini
new file mode 100644 (file)
index 0000000..5abbace
--- /dev/null
@@ -0,0 +1,2 @@
+[ProcessSetting]
+BG_SCHEDULE=true
diff --git a/data/edc/bt-share-layout.edc b/data/edc/bt-share-layout.edc
new file mode 100644 (file)
index 0000000..8d58e18
--- /dev/null
@@ -0,0 +1,244 @@
+#define PROGRESSBAR_WIDTH 570.0
+#define ITEM_HEIGHT 50
+#define ITEM_WIDTH 50
+#define X_ALIGN 0.5
+#define Y_ALIGN 0.5
+
+#define BT_PAD_L \
+               part { \
+                       name: "pad_l"; \
+                       type: RECT; \
+                       scale: 1; \
+                       description { state: "default" 0.0; \
+                               align: 0.0 0.0; \
+                               min: 20 0; \
+                               fixed: 1 0; \
+                               color: 0 0 0 0; \
+                               rel1 { relative: 0.0 0.0;} \
+                               rel2 { relative: 0.0 1.0;} \
+                       } \
+               }
+
+#define BT_PAD_R \
+               part { \
+                       name: "pad_r"; \
+                       type: RECT; \
+                       scale: 1; \
+                       description { state: "default" 0.0; \
+                               align: 1.0 0.0; \
+                               min: 20 0; \
+                               fixed: 1 0; \
+                               color: 0 0 0 0; \
+                               rel1 { relative: 1.0 0.0;} \
+                               rel2 { relative: 1.0 1.0;} \
+                       } \
+               }
+
+#define BT_POPUP_MSG_ITEM(sz, f1, f2, lo) \
+               part { \
+                       name: "msg1"; \
+                       type: TEXT; \
+                       scale: 1; \
+                       description { \
+                               state: "default" 0.0; \
+                               min: sz 50; \
+                               align: 0.5 0.0; \
+                               fixed: f1 f2; \
+                               color: 0 0 0 255; \
+                               text { \
+                                       font: "SLP:style=Roman"; \
+                                       text_class: "slp_roman"; \
+                                       size: 28; \
+                                       min: 0 0; \
+                                       align: 0.5 0.5; \
+                               } \
+                               rel1 { relative: 1.0 0.0; to_x: "pad_l";} \
+                               rel2 { relative: 0.0 lo; to_x: "pad_r";} \
+                       } \
+               }
+
+#define BT_POPUP_ITEM(item_name, pre_item_name) \
+               part {name: "msg"item_name; \
+                         type: TEXT; \
+                         scale: 1; \
+                        description { \
+                               min: 0 ITEM_HEIGHT; \
+                               state: "default" 0.0; \
+                               align: X_ALIGN 0.0; \
+                               fixed: 0 1; \
+                               color: 0 0 0 255; \
+                               text { \
+                                               font: "SLP:style=Roman"; \
+                                               text_class: "slp_roman"; \
+                                               size: 28; \
+                                               min: 0 0; \
+                                               align: X_ALIGN Y_ALIGN; \
+                               } \
+                               rel1 { relative: 1.0 1.0; to_x: "pad_l"; to_y: pre_item_name;} \
+                               rel2 { relative: 0.0 1.0; to_x: "pad_r"; to_y: pre_item_name;} \
+                       } \
+               }
+
+collections {
+       group {
+               name: "progress_popup";
+               parts {
+                       BT_PAD_L
+                       BT_PAD_R
+                       BT_POPUP_MSG_ITEM(0, 0, 1, 0.0);
+                       BT_POPUP_ITEM("2", "msg1");
+                       BT_POPUP_ITEM("3", "msg2");
+                       BT_POPUP_ITEM("4", "msg3");
+
+                       part {
+                               name: "popup_pb";
+                               type: SWALLOW;
+                               scale: 1;
+                               mouse_events: 0;
+                               repeat_events: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       min: PROGRESSBAR_WIDTH 50;
+                                       fixed: 1 0;
+                                       rel1 { relative: 1.0 0.8; to_x: "pad_l"; }
+                                       rel2 { relative: 0.0 1.0; to_x: "pad_r";}
+                               }
+                       }
+
+                       part {
+                               name: "percent";
+                               type: TEXT;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       min: 0 50;
+                                       align: 0.5 0.0;
+                                       fixed: 0 1;
+                                       color: 0 0 0 255;
+                                       text {
+                                               font: "SLP:style=Roman";
+                                               text_class: "slp_roman";
+                                               size: 28;
+                                               min: 0 0;
+                                               align: 0.0 0.5;
+                                       }
+
+                                       rel1 { relative: 0.7 0.9; to_x: "pad_l";}
+                                       rel2 { relative: 0.0 1.0; to_x: "pad_r";}
+                               }
+                       }
+
+                       part {
+                               name: "status_text";
+                               type: TEXT;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       min: 0 50;
+                                       align: 1.0 0.0;
+                                       fixed: 0 1;
+                                       color: 0 0 0 255;
+                                       text {
+                                               font: "SLP:style=Roman";
+                                               text_class: "slp_roman";
+                                               size: 28;
+                                               min: 0 0;
+                                               align: 1.0 0.5;
+                                       }
+
+                                       rel1 { relative: 0.7 0.9; to_x: "pad_l";}
+                                       rel2 { relative: 0.0 1.0; to_x: "pad_r";}
+                               }
+                       }
+               }
+       }
+
+       group {
+               name: "ft_popup";
+               parts {
+                       BT_PAD_L
+                       BT_PAD_R
+                       BT_POPUP_MSG_ITEM(150, 1, 0, 0.3);
+                       BT_POPUP_ITEM("2", "msg1");
+                       BT_POPUP_ITEM("3", "msg2");
+               }
+       }
+
+       group {
+               name: "list";
+
+               parts{
+                       part { name: "background";
+                               type: RECT;
+                               mouse_events: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 0.0; }
+                                       rel2 { relative: 1.0 1.0; }
+                                       color: 0 0 0 0;
+                               }
+                       }
+
+               part { name: "content";
+                               type: SWALLOW;
+                               mouse_events: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       visible: 1;
+                                       fixed: 1 1;
+                                       rel1 { relative: 0.0 0.0; offset: 0 0; to: "background"; }
+                                       rel2 { relative: 1.0 1.0; offset: 0 0; to: "background"; }
+                               }
+                       }
+               }
+       }
+
+       group {
+               name: "nocontent";
+
+               parts{
+                       part { name: "background";
+                               type: RECT;
+                               mouse_events: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 0.0; }
+                                       rel2 { relative: 1.0 1.0; }
+                                       color: 0 0 0 0;
+                               }
+                       }
+
+               part { name: "content";
+                       type: SWALLOW;
+                       mouse_events: 0;
+                       description {
+                               state: "default" 0.0;
+                               visible: 1;
+                               fixed: 1 1;
+                               rel1 { relative: 0.3 0.2; offset: 0 0; to: "background"; }
+                               rel2 { relative: 0.7 0.6; offset: 0 0; to: "background"; }
+                       }
+               }
+
+               part { name: "text";
+                       type: TEXT;
+                       scale: 1;
+                       description {
+                               state: "default" 0.0;
+                               min: 0 50;
+                               align: 0.5 0.5;
+                               fixed: 0 1;
+                               color: 0 0 0 255;
+                               text {
+                                       size: 36;
+                                       min: 0 0;
+                                       align: 0.5 0.5;
+                               }
+                               rel1 { relative: 0.0 0.8; offset: 0 0; to: "background"; }
+                               rel2 { relative: 1.0 1.0; offset: 0 0; to: "background"; }
+
+                       }
+               }
+       }
+}
+
diff --git a/data/images/A01-4_Inbound_transfer_failed.png b/data/images/A01-4_Inbound_transfer_failed.png
new file mode 100644 (file)
index 0000000..76f30c6
Binary files /dev/null and b/data/images/A01-4_Inbound_transfer_failed.png differ
diff --git a/data/images/A01-4_Inbound_transfer_successed.png b/data/images/A01-4_Inbound_transfer_successed.png
new file mode 100644 (file)
index 0000000..c11f159
Binary files /dev/null and b/data/images/A01-4_Inbound_transfer_successed.png differ
diff --git a/data/images/A01-4_No_items_Inbound_transfer.png b/data/images/A01-4_No_items_Inbound_transfer.png
new file mode 100644 (file)
index 0000000..26bd3a7
Binary files /dev/null and b/data/images/A01-4_No_items_Inbound_transfer.png differ
diff --git a/data/images/A01-4_No_items_Outbound_transfer.png b/data/images/A01-4_No_items_Outbound_transfer.png
new file mode 100644 (file)
index 0000000..59946e6
Binary files /dev/null and b/data/images/A01-4_No_items_Outbound_transfer.png differ
diff --git a/data/images/A01-4_Outbound_transfer_failed.png b/data/images/A01-4_Outbound_transfer_failed.png
new file mode 100644 (file)
index 0000000..b4fe450
Binary files /dev/null and b/data/images/A01-4_Outbound_transfer_failed.png differ
diff --git a/data/images/A01-4_Outbound_transfer_successed.png b/data/images/A01-4_Outbound_transfer_successed.png
new file mode 100644 (file)
index 0000000..eec2b16
Binary files /dev/null and b/data/images/A01-4_Outbound_transfer_successed.png differ
diff --git a/data/images/Q02_Notification_bluetooth.png b/data/images/Q02_Notification_bluetooth.png
new file mode 100644 (file)
index 0000000..1719f19
Binary files /dev/null and b/data/images/Q02_Notification_bluetooth.png differ
diff --git a/data/images/Q02_icon_BT_receive.png b/data/images/Q02_icon_BT_receive.png
new file mode 100644 (file)
index 0000000..821f8ec
Binary files /dev/null and b/data/images/Q02_icon_BT_receive.png differ
diff --git a/data/images/Q02_icon_BT_transmit.png b/data/images/Q02_icon_BT_transmit.png
new file mode 100644 (file)
index 0000000..6819ca8
Binary files /dev/null and b/data/images/Q02_icon_BT_transmit.png differ
diff --git a/data/org.tizen.bluetooth-share-ui.png b/data/org.tizen.bluetooth-share-ui.png
new file mode 100644 (file)
index 0000000..6aefb32
Binary files /dev/null and b/data/org.tizen.bluetooth-share-ui.png differ
diff --git a/data/org.tizen.bluetooth-share-ui.xml b/data/org.tizen.bluetooth-share-ui.xml
new file mode 100644 (file)
index 0000000..3d53001
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns="http://tizen.org/ns/packages" package="org.tizen.bluetooth-share-ui" version="0.0.14" install-location="internal-only">
+       <label>bluetooth-share-ui</label>
+       <author email="injun.yang@samsung.com" href="www.samsung.com">Injun Yang</author>
+       <description>Bluetooth Share UI application</description>
+
+       <ui-application appid="org.tizen.bluetooth-share-ui" exec="/opt/apps/org.tizen.bluetooth-share-ui/bin/bluetooth-share-ui" nodisplay="true" taskmanage="false" multiple="false" type="capp">
+               <icon>org.tizen.bluetooth-share-ui.png</icon>
+               <label>bluetooth-share-ui</label>
+       </ui-application>
+</manifest>
diff --git a/debian/changelog b/debian/changelog
new file mode 100644 (file)
index 0000000..80d8883
--- /dev/null
@@ -0,0 +1,143 @@
+bluetooth-share-ui (0.0.18) unstable; urgency=low
+
+  * Upload the package
+  * Git: slp/pkgs/b/bluetooth-share-ui
+  * Tag: bluetooth-share-ui_0.0.18
+
+ -- InJun Yang <injun.yang@samsung.com>  Tue, 07 Aug 2012 12:57:35 +0900
+
+bluetooth-share-ui (0.0.17) unstable; urgency=low
+
+  * Apply pkg manifest
+  * Git: slp/pkgs/b/bluetooth-share-ui
+  * Tag: bluetooth-share-ui_0.0.17
+
+ -- InJun Yang <injun.yang@samsung.com>  Tue, 31 Jul 2012 15:11:49 +0900
+
+bluetooth-share-ui (0.0.16) unstable; urgency=low
+
+  * Change text color
+  * Git: slp/pkgs/b/bluetooth-share-ui
+  * Tag: bluetooth-share-ui_0.0.16
+
+ -- InJun Yang <injun.yang@samsung.com>  Tue, 31 Jul 2012 10:11:23 +0900
+
+bluetooth-share-ui (0.0.15) unstable; urgency=low
+
+  * Code refactoring
+  * Git: slp/pkgs/b/bluetooth-share-ui
+  * Tag: bluetooth-share-ui_0.0.15
+
+ -- InJun Yang <injun.yang@samsung.com>  Tue, 10 Jul 2012 19:28:09 +0900
+
+bluetooth-share-ui (0.0.14) unstable; urgency=low
+
+  * Ordering inbound/outbound view
+  * Git: slp/pkgs/b/bluetooth-share-ui
+  * Tag: bluetooth-share-ui_0.0.14
+
+ -- InJun Yang <injun.yang@samsung.com>  Tue, 10 Jul 2012 08:55:44 +0900
+
+bluetooth-share-ui (0.0.13) unstable; urgency=low
+
+  * Upload the package
+  * Git: slp/pkgs/b/bluetooth-share-ui
+  * Tag: bluetooth-share-ui_0.0.13
+
+ -- InJun Yang <injun.yang@samsung.com>  Fri, 06 Jul 2012 20:09:50 +0900
+
+bluetooth-share-ui (0.0.12) unstable; urgency=low
+
+  * Upload the package
+  * Git: slp/pkgs/b/bluetooth-share-ui
+  * Tag: bluetooth-share-ui_0.0.12
+
+ -- InJun Yang <injun.yang@samsung.com>  Wed, 20 Jun 2012 20:42:55 +0900
+
+bluetooth-share-ui (0.0.11) unstable; urgency=low
+
+  * Remove the progress popup in error case
+  * Git: slp/pkgs/b/bluetooth-share-ui
+  * Tag: bluetooth-share-ui_0.0.11
+
+ -- DoHyun Pyun <dh79.pyun@samsung.com>  Mon, 04 Jun 2012 09:00:48 +0900
+
+bluetooth-share-ui (0.0.10) unstable; urgency=low
+
+  * Upload the package
+  * Git: slp/pkgs/b/bluetooth-share-ui
+  * Tag: bluetooth-share-ui_0.0.10
+
+ -- InJun Yang <injun.yang@samsung.com>  Tue, 29 May 2012 17:45:20 +0900
+
+bluetooth-share-ui (0.0.9) unstable; urgency=low
+
+  * Upload the package
+  * Git: slp/pkgs/b/bluetooth-share-ui
+  * Tag: bluetooth-share-ui_0.0.9
+
+ -- InJun Yang <injun.yang@samsung.com>  Thu, 24 May 2012 15:03:56 +0900
+
+bluetooth-share-ui (0.0.8) unstable; urgency=low
+
+  * Upload the package
+  * Git: slp/pkgs/b/bluetooth-share-ui
+  * Tag: bluetooth-share-ui_0.0.8
+
+ -- DoHyun Pyun <dh79.pyun@samsung.com>  Mon, 21 May 2012 14:30:23 +0900
+
+bluetooth-share-ui (0.0.7) unstable; urgency=low
+
+  * Support the dynamic font change
+  * Git: slp/pkgs/b/bluetooth-share-ui
+  * Tag: bluetooth-share-ui_0.0.7
+
+ -- DoHyun Pyun <dh79.pyun@samsung.com>  Mon, 14 May 2012 10:46:32 +0900
+
+bluetooth-share-ui (0.0.6) unstable; urgency=low
+
+  * Upload the package
+  * Git: slp/pkgs/b/bluetooth-share-ui
+  * Tag: bluetooth-share-ui_0.0.6
+
+ -- InJun Yang <injun.yang@samsung.com>  Thu, 22 Mar 2012 16:45:01 +0900
+
+bluetooth-share-ui (0.0.5) unstable; urgency=low
+
+  * Apply remained EFL changes
+  * Git: slp/pkgs/b/bluetooth-share-ui
+  * Tag: bluetooth-share-ui_0.0.5
+
+ -- Hocheol Seo <hocheol.seo@samsung.com>  Sat, 17 Mar 2012 14:59:52 +0900
+
+bluetooth-share-ui (0.0.4) unstable; urgency=low
+
+  * SLP prefix is changed
+  * Git: slp/pkgs/b/bluetooth-share-ui
+  * Tag: bluetooth-share-ui_0.0.4
+
+ -- InJun Yang <injun.yang@samsung.com>  Thu, 15 Mar 2012 18:48:04 +0900
+
+bluetooth-share-ui (0.0.3) unstable; urgency=low
+
+  * Apply and upload the Elementary API changes
+  * Git: 165.213.180.234:slp/pkgs/b/bluetooth-share-ui
+  * Tag: bluetooth-share-ui_0.0.3
+
+ -- DoHyun Pyun <dh79.pyun@samsung.com>  Tue, 13 Mar 2012 18:53:47 +0530
+
+bluetooth-share-ui (0.0.2) unstable; urgency=low
+
+   * Apply the winset API changes
+   * Git: 165.213.180.234:slp/pkgs/b/bluetooth-share-ui
+   * Tag: bluetooth-share-ui_0.0.2
+
+ -- DoHyun Pyun <dh79.pyun@samsung.com>  Thu, 16 Feb 2012 10:09:01 +0900
+
+bluetooth-share-ui (0.0.1) unstable; urgency=low
+
+   * Initial release
+   * Git: 165.213.180.234:slp/pkgs/b/bluetooth-share-ui
+   * Tag: bluetooth-share-ui_0.0.1
+
+ -- Injun Yang <injun.yang@samsung.com>  Mon, 10 Oct 2011 16:17:49 +0900
diff --git a/debian/compat b/debian/compat
new file mode 100644 (file)
index 0000000..7ed6ff8
--- /dev/null
@@ -0,0 +1 @@
+5
diff --git a/debian/control b/debian/control
new file mode 100644 (file)
index 0000000..aa33fe5
--- /dev/null
@@ -0,0 +1,19 @@
+Source: bluetooth-share-ui
+Section: main
+Priority: extra
+Maintainer: Hocheol Seo <hocheol.seo@samsung.com>, DoHyun Pyun <dh79.pyun@samsung.com>, InJun Yang <injun.yang@samsung.com>, Chanyeol Park <chanyeol.park@samsung.com>
+Uploaders: Sunil Behera <sunil.behera@samsung.com>, Syam Sidhardhan <s.syam@samsung.com>
+Build-Depends: debhelper (>= 5),libevas-dev, libecore-dev, libelm-dev, libslp-sensor-dev, libappcore-efl-dev, libslp-utilx-dev, dlog-dev, libdbus-glib-1-dev, libglib2.0-dev, libaul-1-dev, libbluetooth-frwk-dev (>= 0.1.0), capi-appfw-application-dev, libbluetooth-share-dev
+Standards-Version: 0.1.0
+
+Package: org.tizen.bluetooth-share-ui
+Section: main
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, libslp-utilx-0, libdlog-0
+Description: bluetooth share UI application
+
+Package: org.tizen.bluetooth-share-ui-dbg
+Section: debug
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: bluetooth share UI application (unstripped)
diff --git a/debian/docs b/debian/docs
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/debian/org.tizen.bluetooth-share-ui.install.in b/debian/org.tizen.bluetooth-share-ui.install.in
new file mode 100644 (file)
index 0000000..a20de48
--- /dev/null
@@ -0,0 +1,5 @@
+@PREFIX@/bin/bluetooth-share-ui
+@RESDIR@/edje/*
+@RESDIR@/images/*
+/opt/share/applications/org.tizen.bluetooth-share-ui.desktop
+/opt/share/icons/default/small/*
diff --git a/debian/rules b/debian/rules
new file mode 100755 (executable)
index 0000000..c7f02cf
--- /dev/null
@@ -0,0 +1,144 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+CFLAGS ?= -Wall -g
+CXXFLAGS ?=  -Wall -g
+LDFLAGS ?= 
+#PREFIX ?= /usr
+PREFIX ?= /opt/apps/org.tizen.bluetooth-share-ui
+DATADIR ?= /opt/apps/org.tizen.bluetooth-share-ui
+RESDIR ?= /opt/apps/org.tizen.bluetooth-share-ui/res
+
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+       CFLAGS += -O0
+       CXXFLAGS += -O0
+else
+       CFLAGS += -O2
+       CXXFLAGS += -O2
+endif
+
+LDFLAGS += -Wl,--rpath=$(PREFIX)/lib -Wl,--as-needed
+
+#CMAKE_TMP_DIR = $(CURDIR)/cmake_tmp
+
+
+configure: configure-stamp
+configure-stamp:
+       dh_testdir
+       # Add here commands to configure the package.
+#      mkdir -p $(CMAKE_TMP_DIR);
+       CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" cmake . -DCMAKE_INSTALL_PREFIX=$(PREFIX)
+
+       touch configure-stamp
+
+build: build-stamp
+
+build-stamp: configure-stamp 
+       dh_testdir
+
+       # Add here commands to compile the package.
+       $(MAKE)
+       #docbook-to-man debian/wavplayer.sgml > wavplayer.1
+
+       for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
+               cat $$f > $${f%.in}; \
+               sed -i -e "s#@PREFIX@#$(PREFIX)#g" $${f%.in}; \
+               sed -i -e "s#@DATADIR@#$(DATADIR)#g" $${f%.in}; \
+               sed -i -e "s#@RESDIR@#$(RESDIR)#g" $${f%.in}; \
+       done
+
+
+       touch $@
+
+clean:
+       dh_testdir
+       dh_testroot
+       rm -f build-stamp configure-stamp
+
+       # Add here commands to clean up after the build process.
+       -$(MAKE) clean
+       #rm -rf $(CMAKE_TMP_DIR)
+
+       for f in `find $(CURDIR)/ -name "CMakeCache.txt"`; do \
+               rm -f $${f}; \
+       done
+
+       for f in `find $(CURDIR)/ -name "CMakeFiles"`; do \
+               rm -rf $${f}; \
+       done
+
+       for f in `find $(CURDIR)/ -name "cmake_install.cmake"`; do \
+               rm -f $${f}; \
+       done
+
+       for f in `find $(CURDIR)/ -name "Makefile"`; do \
+               rm -f $${f}; \
+       done
+
+       for f in `find $(CURDIR)/ -name "install_manifest.txt"`; do \
+               rm -f $${f}; \
+       done
+
+       for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
+               rm -f $${f%.in}; \
+       done
+       rm -f data/*.desktop
+       rm -f *.edj
+
+       dh_clean
+
+install: build
+       dh_testdir
+       dh_testroot
+       dh_clean -k
+       dh_installdirs
+
+       # Add here commands to install the package into debian/wavplayer.
+       $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
+
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+       dh_testdir
+       dh_testroot
+#      dh_installchangelogs 
+#      dh_installdocs
+       dh_installexamples
+       dh_install --sourcedir=debian/tmp
+#      dh_installmenu
+#      dh_installdebconf       
+#      dh_installlogrotate
+#      dh_installemacsen
+#      dh_installpam
+#      dh_installmime
+#      dh_python
+#      dh_installinit
+#      dh_installcron
+#      dh_installinfo
+       dh_installman
+       dh_link
+       dh_strip --dbg-package=org.tizen.bluetooth-share-ui-dbg
+       dh_compress
+       dh_fixperms
+#      dh_perl
+       dh_makeshlibs
+       dh_installdeb
+       dh_shlibdeps
+       dh_gencontrol
+       dh_md5sums
+       dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
diff --git a/packaging/org.tizen.bluetooth-share-ui.spec b/packaging/org.tizen.bluetooth-share-ui.spec
new file mode 100644 (file)
index 0000000..0f160b8
--- /dev/null
@@ -0,0 +1,63 @@
+%define _optdir        /opt
+%define _appdir %{_optdir}/apps
+
+Name:       org.tizen.bluetooth-share-ui
+Summary:    bluetooth share UI application
+Version: 0.0.18
+Release:    1
+Group:      TO_BE_FILLED
+License:    TO_BE_FILLED
+Source0:    %{name}-%{version}.tar.gz
+BuildRequires:  pkgconfig(dbus-glib-1)
+BuildRequires:  pkgconfig(dlog)
+BuildRequires:  pkgconfig(vconf)
+BuildRequires:  pkgconfig(appcore-efl)
+BuildRequires:  pkgconfig(bundle)
+BuildRequires:  pkgconfig(ecore)
+BuildRequires:  pkgconfig(ecore-x)
+BuildRequires:  pkgconfig(edbus)
+BuildRequires:  pkgconfig(edje)
+BuildRequires:  pkgconfig(elementary)
+BuildRequires:  pkgconfig(evas)
+BuildRequires:  pkgconfig(utilX)
+BuildRequires:  pkgconfig(bluetooth-api)
+BuildRequires:  pkgconfig(aul)
+BuildRequires:  pkgconfig(capi-appfw-application)
+BuildRequires:  pkgconfig(bluetooth-share-api)
+
+BuildRequires:  cmake
+BuildRequires:  edje-tools
+BuildRequires:  gettext-devel
+
+%description
+bluetooth share UI application
+
+
+%prep
+%setup -q
+
+%build
+cmake . -DCMAKE_INSTALL_PREFIX=%{_appdir}/org.tizen.bluetooth-share-ui
+make %{?jobs:-j%jobs}
+
+%install
+rm -rf %{buildroot}
+%make_install
+
+%post
+
+%postun
+
+
+#%files
+#%defattr(-,root,root,-)
+
+%files
+%defattr(-,root,root,-)
+%{_appdir}/org.tizen.bluetooth-share-ui/res/edje/bt-share-layout.edj
+%{_appdir}/org.tizen.bluetooth-share-ui/res/images/*
+%{_appdir}/org.tizen.bluetooth-share-ui/bin/bluetooth-share-ui
+%{_optdir}/share/icons/default/small/org.tizen.bluetooth-share-ui.png
+%{_optdir}/share/packages/org.tizen.bluetooth-share-ui.xml
+
+
diff --git a/src/applog.h b/src/applog.h
new file mode 100644 (file)
index 0000000..dfb8e3a
--- /dev/null
@@ -0,0 +1,187 @@
+/*
+ * Copyright 2012  Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *   http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __APPLOG_H__
+#define __APPLOG_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * SYSLOG_INFO(), SYSLOG_ERR(), SYSLOG_DBG() are syslog() wrappers.
+ * PRT_INFO(), PRT_ERR(), PRT_DBG() are fprintf() wrappers.
+ *
+ * If SLP_DEBUG is not defined, SYSLOG_DBG() and PRT_DBG() is ignored.
+ *
+ * IF SLP_SYSLOG_OUT or SLP_DAEMON is defined,
+ *   INFO(), ERR(), DBG() are SYSLOG_XXX()
+ * Otherwise,
+ *   They are PRT_XXX()
+ *
+ *
+ * warn_if(exrp, fmt, ...)
+ *   If expr is true, The fmt string is printed using ERR().
+ *
+ * ret_if(), retv_if(), retm_if(), retvm_if()
+ *   If expr is true, current function return.
+ *   Postfix 'v' means that it has a return value and
+ *   'm' means that it has output message.
+ *
+ */
+
+#if defined(SLP_SYSLOG_OUT) || defined(SLP_DAEMON)
+#include <syslog.h>
+#endif
+#include <stdio.h>
+#include <dlog.h>
+
+#define BT_SHARE "BT_SHARE_UI"
+
+#if defined(SLP_SYSLOG_OUT) || defined(SLP_DAEMON)
+#define __LOG(prio, fmt, arg...) \
+       do { syslog(prio, fmt, ##arg); } while (0)
+
+#define __LOGD(prio, fmt, arg...) \
+       do {
+               syslog(prio, "[%s:%d] "fmt"\n", __FILE__, __LINE__, ##arg);
+       } while (0)
+#else
+#define __LOG(prio, fmt, arg...) do { } while (0)
+#define __LOGD(prio, fmt, arg...) do { } while (0)
+#endif
+
+#define __PRT(prio, fmt, arg...) \
+       do { \
+               fprintf((LOG_PRI(prio) == LOG_ERR ? stderr : stdout), \
+               fmt"\n", ##arg); \
+       } while (0)
+
+#define __PRTD(prio, fmt, arg...) \
+       do { \
+               fprintf((LOG_PRI(prio) == LOG_ERR ? stderr : stdout), \
+               "[%s:%d] "fmt"\n", __FILE__, __LINE__, ##arg); \
+       } while (0)
+#define _NOUT (prio, fmt, arg...) do { } while (0)
+
+#ifdef SLP_DEBUG
+#define _LOGD __LOGD
+#define _LOG  __LOGD
+#define _PRTD __PRTD
+#define _PRT  __PRTD
+#else
+#define _LOGD _NOUT
+#define _LOG  __LOG
+#define _PRTD _NOUT
+#define _PRT  __PRT
+#endif
+
+#define SYSLOG_INFO(fmt, arg...) _LOG(LOG_INFO, fmt, ##arg)
+#define SYSLOG_ERR(fmt, arg...) _LOG(LOG_ERR, fmt, ##arg)
+#define SYSLOG_DBG(fmt, arg...) _LOGD(LOG_DEBUG, fmt, ##arg)
+
+#define PRT_INFO(fmt, arg...) \
+       LOG(LOG_DEBUG, BT_SHARE, "%s:%d "fmt, __func__, __LINE__, ##arg)
+
+#define PRT_ERR(fmt, arg...) \
+       LOG(LOG_DEBUG, BT_SHARE, "%s:%d "fmt, __func__, __LINE__, ##arg)
+
+#define PRT_DBG(fmt, arg...) \
+       LOG(LOG_DEBUG, BT_SHARE, "%s:%d "fmt, __func__, __LINE__, ##arg)
+
+#if defined(SLP_SYSLOG_OUT) || defined(SLP_DAEMON)
+#define INFO SYSLOG_INFO
+#define ERR SYSLOG_ERR
+#define DBG SYSLOG_DBG
+#else
+#define INFO(fmt, arg...) \
+       SLOG(LOG_DEBUG, BT_SHARE, "%s:%d "fmt, __func__, __LINE__, ##arg)
+
+#define ERR(fmt, arg...) \
+       SLOG(LOG_DEBUG, BT_SHARE, "%s:%d "fmt, __func__, __LINE__, ##arg)
+
+#define DBG(fmt, arg...) \
+       SLOG(LOG_DEBUG, BT_SHARE, "%s:%d "fmt, __func__, __LINE__, ##arg)
+#endif
+
+#ifdef SLP_DEBUG
+#define warn_if(expr, fmt, arg...) do { \
+               if (expr) { \
+                       ERR("(%s) -> "fmt, #expr, ##arg); \
+               } \
+       } while (0)
+#define ret_if(expr) do { \
+               if (expr) { \
+                       ERR("(%s) -> %s() return", #expr, __FUNCTION__); \
+                       return; \
+               } \
+       } while (0)
+#define retv_if(expr, val) do { \
+               if (expr) { \
+                       ERR("(%s) -> %s() return", #expr, __FUNCTION__); \
+                       return (val); \
+               } \
+       } while (0)
+#define retm_if(expr, fmt, arg...) do { \
+               if (expr) { \
+                       ERR(fmt, ##arg); \
+                       ERR("(%s) -> %s() return", #expr, __FUNCTION__); \
+                       return; \
+               } \
+       } while (0)
+#define retvm_if(expr, val, fmt, arg...) do { \
+               if (expr) { \
+                       ERR(fmt, ##arg); \
+                       ERR("(%s) -> %s() return", #expr, __FUNCTION__); \
+                       return (val); \
+               } \
+       } while (0)
+
+#else
+#define warn_if(expr, fmt, arg...) do { \
+               if (expr) { \
+                       ERR(fmt, ##arg); \
+               } \
+       } while (0)
+#define ret_if(expr) do { \
+               if (expr) { \
+                       return; \
+               } \
+       } while (0)
+#define retv_if(expr, val) do { \
+               if (expr) { \
+                       return (val); \
+               } \
+       } while (0)
+#define retm_if(expr, fmt, arg...) do { \
+               if (expr) { \
+                       ERR(fmt, ##arg); \
+                       return; \
+               } \
+       } while (0)
+#define retvm_if(expr, val, fmt, arg...) do { \
+               if (expr) { \
+                       ERR(fmt, ##arg); \
+                       return (val); \
+               } \
+       } while (0)
+
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+#endif                         /* __APPLOG_H__ */
diff --git a/src/bt-share-ui-ipc.c b/src/bt-share-ui-ipc.c
new file mode 100644 (file)
index 0000000..db4020d
--- /dev/null
@@ -0,0 +1,449 @@
+/*
+ * Copyright 2012  Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *   http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <dbus/dbus.h>
+#include <dbus/dbus-glib-bindings.h>
+#include <glib.h>
+#include <stdlib.h>
+#include <string.h>
+#include <bluetooth-api.h>
+#include "applog.h"
+#include "bt-share-ui-main.h"
+#include "bt-share-ui-ipc.h"
+#include "bt-share-ui-view.h"
+#include "bt-share-ui-resource.h"
+
+#include "bluetooth-share-api.h"
+
+#define BT_ADDRESS_LENGTH_MAX  6
+
+
+static void __handle_progress_signal(void *data, DBusMessage * msg)
+{
+       int transfer_id;
+       int percentage;
+       const char *filename;
+       gboolean completed;
+       int error_type;
+       bt_share_appdata_t *ad = (bt_share_appdata_t *)data;
+
+       retm_if(ad == NULL, "Invalid argument: data is NULL\n");
+       retm_if(msg == NULL, "Invalid argument: msg is NULL\n");
+
+       if (!dbus_message_get_args(msg, NULL,
+                               DBUS_TYPE_INT32, &transfer_id,
+                               DBUS_TYPE_STRING, &filename,
+                               DBUS_TYPE_INT32, &percentage,
+                               DBUS_TYPE_BOOLEAN, &completed,
+                               DBUS_TYPE_INT32, &error_type,
+                               DBUS_TYPE_INVALID)) {
+               DBG("Event handling failed\n");
+               return;
+       }
+
+       if(completed == FALSE) {
+               _bt_update_progress_popup(ad, transfer_id, filename, percentage);
+       } else {
+               if(error_type == BLUETOOTH_ERROR_NONE) {
+                       _bt_destroy_progress_popup(ad);
+
+                       if (ad->app_layout == NULL)
+                               _bt_terminate_app();
+               } else {
+                       DBG("Don,t terminate. Warning Popup will be shown.\n");
+               }
+       }
+}
+
+
+static void __handle_error_signal(void *data, DBusMessage * msg)
+{
+       int error;
+       bt_share_appdata_t *ad = (bt_share_appdata_t *)data;
+
+       retm_if(ad == NULL, "Invalid argument: data is NULL\n");
+       retm_if(msg == NULL, "Invalid argument: msg is NULL\n");
+       DBG("+\n");
+
+       if (!dbus_message_get_args(msg, NULL,
+                                  DBUS_TYPE_INT32, &error,
+                                  DBUS_TYPE_INVALID)) {
+               ERR("Event handling failed\n");
+               return;
+       }
+
+       switch(error){
+       case BLUETOOTH_ERROR_NOT_CONNECTED:
+               _bt_destroy_progress_popup(ad);
+               _bt_create_info_popup(ad, BT_STR_INFORMATION,
+                       BT_STR_UNABLE_TO_SEND);
+               break;
+       case BLUETOOTH_ERROR_CANCEL:
+               _bt_destroy_progress_popup(ad);
+               _bt_create_info_popup(ad, BT_STR_INFORMATION,
+                       BT_STR_UNABLE_TO_RECEIVE);
+               break;
+       case BLUETOOTH_ERROR_CANCEL_BY_USER:
+       case BLUETOOTH_ERROR_ACCESS_DENIED:
+       case BLUETOOTH_ERROR_OUT_OF_MEMORY:
+       case BLUETOOTH_ERROR_INTERNAL:
+               _bt_destroy_progress_popup(ad);
+               DBG("error : %d\n", error);
+               break;
+       default:
+               break;
+       }
+}
+
+
+static void __bt_add_tr_data_list(bt_share_appdata_t *ad, int transfer_type)
+{
+       GSList *list = NULL;
+       sqlite3 *db = NULL;
+       bt_tr_data_t *info = NULL;
+       int len = 0;
+       int i;
+
+       db = bt_share_open_db();
+       if (!db)
+               return;
+
+       list = bt_share_get_completed_tr_data_list(db, transfer_type);
+       if (list == NULL) {
+               bt_share_close_db(db);
+               return;
+       }
+       bt_share_close_db(db);
+
+       /* Append new tr data to tr_data_list */
+       len =  g_slist_length(list);
+       for (i = 0; i < len; i++) {
+               info = list->data;
+               if (transfer_type == BT_TR_OUTBOUND &&
+                               info->id > ad->outbound_latest_id)
+                       ad->tr_data_list = g_slist_append(ad->tr_data_list, info);
+               else if (transfer_type == BT_TR_INBOUND &&
+                               info->id > ad->inbound_latest_id)
+                       ad->tr_data_list = g_slist_append(ad->tr_data_list, info);
+               list = g_slist_next(list);
+       }
+
+       bt_share_release_tr_data_list(list);
+}
+
+static void __handle_update_view_signal(void *data, DBusMessage * msg)
+{
+       retm_if(data== NULL, "Invalid argument: data is NULL\n");
+       retm_if(msg == NULL, "Invalid argument: msg is NULL\n");
+
+       char *table;
+       bt_share_appdata_t *ad = (bt_share_appdata_t *)data;
+       GSList *list_iter = NULL;
+       sqlite3 *db = NULL;
+       int ret;
+       bt_tr_data_t *info = NULL;
+       int transfer_type;
+
+       DBG("+\n");
+
+       if (ad->app_layout == NULL)
+               return;
+
+       if (!dbus_message_get_args(msg, NULL,
+                                  DBUS_TYPE_STRING, &table,
+                                  DBUS_TYPE_INVALID)) {
+               ERR("Event handling failed\n");
+               return;
+       }
+
+       if (g_strcmp0(table, "inbound") == 0)
+               transfer_type = BT_TR_INBOUND;
+       else if (g_strcmp0(table, "outbound") == 0)
+               transfer_type = BT_TR_OUTBOUND;
+
+       __bt_add_tr_data_list(ad, transfer_type);
+
+       /* Insert new transfer result to first genlist item  */
+       list_iter = ad->tr_data_list;
+       if (transfer_type == BT_TR_INBOUND && ad->tr_type == BT_TR_INBOUND) {
+               while (NULL != list_iter) {
+                       info = list_iter->data;
+                       if (info->id > ad->inbound_latest_id)
+                               _bt_prepend_genlist_tr_data_item(ad, info, transfer_type);
+                       list_iter = g_slist_next(list_iter);
+               }
+       } else if (transfer_type == BT_TR_OUTBOUND && ad->tr_type == BT_TR_OUTBOUND) {
+               while (NULL != list_iter) {
+                       info = list_iter->data;
+                       if (info->id > ad->outbound_latest_id)
+                               _bt_prepend_genlist_tr_data_item(ad, info, transfer_type);
+                       list_iter = g_slist_next(list_iter);
+               }
+       }
+
+       evas_object_show(ad->tr_genlist);
+       DBG("-\n");
+}
+
+void _bt_signal_init(bt_share_appdata_t *ad)
+{
+       DBG("+\n");
+
+       E_DBus_Connection *conn = NULL;
+       E_DBus_Signal_Handler *sh = NULL;
+       e_dbus_init();
+
+       conn = e_dbus_bus_get(DBUS_BUS_SYSTEM);
+       retm_if(conn == NULL, "conn is NULL\n");
+
+       e_dbus_request_name(conn, BT_SHARE_UI_INTERFACE, 0, NULL, NULL);
+
+       sh = e_dbus_signal_handler_add(conn,
+                                      NULL,
+                                      BT_SHARE_ENG_OBJECT,
+                                      BT_SHARE_ENG_INTERFACE,
+                                      BT_SHARE_ENG_SIGNAL_PROGRESS,
+                                      __handle_progress_signal, ad);
+       retm_if(sh == NULL, "Progress Event register failed\n");
+       ad->progress_sh = sh;
+
+       sh = e_dbus_signal_handler_add(conn,
+                                      NULL,
+                                      BT_SHARE_ENG_OBJECT,
+                                      BT_SHARE_ENG_INTERFACE,
+                                      BT_SHARE_ENG_SIGNAL_ERROR,
+                                      __handle_error_signal, ad);
+       retm_if(sh == NULL, "Progress Event register failed\n");
+       ad->error_sh = sh;
+
+       sh = e_dbus_signal_handler_add(conn,
+                                      NULL,
+                                      BT_SHARE_ENG_OBJECT,
+                                      BT_SHARE_ENG_INTERFACE,
+                                      BT_SHARE_ENG_SIGNAL_UPDATE_VIEW,
+                                      __handle_update_view_signal, ad);
+       retm_if(sh == NULL, "Progress Event register failed\n");
+       ad->update_sh = sh;
+
+       ad->dbus_conn = conn;
+
+       DBG(" -\n");
+}
+
+
+void _bt_signal_deinit(bt_share_appdata_t *ad)
+{
+       DBG("+\n");
+       ret_if(ad == NULL);
+
+       e_dbus_signal_handler_del(ad->dbus_conn, ad->progress_sh);
+       e_dbus_signal_handler_del(ad->dbus_conn, ad->error_sh);
+       e_dbus_signal_handler_del(ad->dbus_conn, ad->update_sh);
+       DBG("-\n");
+       return;
+}
+
+int _bt_abort_signal_send(bt_share_appdata_t *ad,
+                               bt_share_popup_data_t *pb_data)
+{
+       DBG("+\n");
+       DBusMessage *msg = NULL;
+
+       retvm_if(pb_data == NULL, -1,
+                "progressbar data is NULL\n");
+       retvm_if(ad->dbus_conn == NULL, -1,
+                "Invalid argument: ad->dbus_conn is NULL\n");
+
+       msg = dbus_message_new_signal(BT_SHARE_ENG_OBJECT,
+                       BT_SHARE_UI_INTERFACE,
+                       BT_SHARE_UI_SIGNAL_OPPABORT);
+
+       retvm_if(msg == NULL, -1, "msg is NULL\n");
+
+       if (!dbus_message_append_args(msg,
+                       DBUS_TYPE_STRING, &pb_data->transfer_type,
+                       DBUS_TYPE_INT32, &pb_data->transfer_id,
+                       DBUS_TYPE_INVALID)) {
+               ERR("Abort sending failed\n");
+               dbus_message_unref(msg);
+               return -1;
+       }
+
+       DBG("pb_data->transfer_type = %s", pb_data->transfer_type);
+       DBG("pb_data->transfer_id = %d", pb_data->transfer_id);
+
+       e_dbus_message_send(ad->dbus_conn, msg, NULL, -1, NULL);
+       dbus_message_unref(msg);
+       DBG("-\n");
+       return 0;
+}
+
+int _bt_signal_send(bt_share_appdata_t *ad, char *signal, char *member)
+{
+       DBusMessage *msg = NULL;
+
+       retvm_if(ad->dbus_conn== NULL, -1,
+                "Invalid argument: ad->dbus_conn is NULL\n");
+
+       msg = dbus_message_new_signal(BT_SHARE_ENG_OBJECT,
+                                                     BT_SHARE_UI_INTERFACE,
+                                                     signal);
+
+       retvm_if(msg == NULL, -1, "msg is NULL\n");
+
+       if(member) {
+               if (!dbus_message_append_args(msg,
+                                             DBUS_TYPE_STRING, &member,
+                                             DBUS_TYPE_INVALID)) {
+                       ERR("Connect sending failed\n");
+                       dbus_message_unref(msg);
+                       return -1;
+               }
+       }
+
+       e_dbus_message_send(ad->dbus_conn, msg, NULL, -1, NULL);
+       dbus_message_unref(msg);
+
+       return 0;
+}
+
+static void __bt_conv_addr_string_to_addr_type(char *addr,
+                                                 const char *address)
+{
+       int i;
+       char *ptr = NULL;
+
+       if (!address || !addr)
+               return;
+
+       for (i = 0; i < BT_ADDRESS_LENGTH_MAX; i++) {
+               addr[i] = strtol(address, &ptr, 16);
+               if (ptr != NULL) {
+                       if (ptr[0] != ':')
+                               return;
+
+                       address = ptr + 1;
+               }
+       }
+}
+
+int _bt_share_ui_ipc_retry_send(bt_share_appdata_t *ad, bt_tr_data_t *info)
+{
+       DBG("+\n");
+       DBusMessage *msg = NULL;
+       int reserved = 0;
+       int filecount = 1;
+       char *mode = NULL;
+       const char *bd_addr = NULL;
+
+       retvm_if(info == NULL, -1, "Invalid argument: info is NULL\n");
+
+       retvm_if(ad->dbus_conn == NULL, -1,
+                       "Invalid argument: ad->dbus_conn is NULL\n");
+
+
+       mode = strdup("Normal");
+       if (mode == NULL)
+               return -1;
+
+       bd_addr = (char *)calloc(sizeof(char *), BT_ADDRESS_LENGTH_MAX);
+       if (bd_addr == NULL) {
+               free(mode);
+               return -1;
+       }
+
+       __bt_conv_addr_string_to_addr_type((char *)bd_addr, info->addr);
+
+       DBG("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X",
+               bd_addr[0], bd_addr[1], bd_addr[2],
+               bd_addr[3], bd_addr[4], bd_addr[5]);
+
+       msg = dbus_message_new_signal(BT_SHARE_ENG_OBJECT,
+                                               BT_SHARE_UI_INTERFACE,
+                                               BT_SHARE_UI_SIGNAL_SEND_FILE);
+
+       if (msg == NULL) {
+               ERR("msg is NULL\n");
+               free((void *)bd_addr);
+               free(mode);
+               return -1;
+       }
+
+       if (!dbus_message_append_args(msg,
+                                     DBUS_TYPE_INT32, &reserved,
+                                     DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE,
+                                     &bd_addr, BT_ADDRESS_LENGTH_MAX,
+                                     DBUS_TYPE_INT32, &filecount,
+                                     DBUS_TYPE_STRING, &info->file_path,
+                                     DBUS_TYPE_STRING, &mode,
+                                     DBUS_TYPE_INVALID)) {
+               ERR("Connect sending failed\n");
+               dbus_message_unref(msg);
+               free((void *)bd_addr);
+               free(mode);
+               return -1;
+       }
+
+       e_dbus_message_send(ad->dbus_conn, msg, NULL, -1, NULL);
+       dbus_message_unref(msg);
+       free((void *)bd_addr);
+       free(mode);
+
+       DBG("-\n");
+       return 0;
+}
+
+
+int _bt_share_ui_ipc_info_update(bt_share_appdata_t *ad, int uid)
+{
+       DBG("+\n");
+       retv_if(ad == NULL, -1);
+
+       DBusMessage *msg = NULL;
+       int info_uid = 0;
+       int info_type = 0;
+
+       info_uid = uid;
+       info_type = ad->tr_type;
+
+       DBG("info_uid = %d\n", info_uid);
+       DBG("info_type = %d\n", info_type);
+
+       retvm_if(ad->dbus_conn == NULL, -1,
+                       "Invalid argument: ad->dbus_conn is NULL\n");
+
+       msg = dbus_message_new_signal(BT_SHARE_ENG_OBJECT,
+                                     BT_SHARE_UI_INTERFACE,
+                                     BT_SHARE_UI_SIGNAL_INFO_UPDATE);
+
+       retvm_if(msg == NULL, -1, "msg is NULL\n");
+
+       if (!dbus_message_append_args(msg,
+                                     DBUS_TYPE_INT32, &info_uid,
+                                     DBUS_TYPE_INT32, &info_type,
+                                     DBUS_TYPE_INVALID)) {
+               ERR("Connect sending failed\n");
+               dbus_message_unref(msg);
+               return -1;
+       }
+
+       e_dbus_message_send(ad->dbus_conn, msg, NULL, -1, NULL);
+       dbus_message_unref(msg);
+
+       DBG("-\n");
+       return 0;
+}
+
diff --git a/src/bt-share-ui-ipc.h b/src/bt-share-ui-ipc.h
new file mode 100644 (file)
index 0000000..4f576a4
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2012  Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *   http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __DEF_BT_SHARE_UI_IPC_H_
+#define __DEF_BT_SHARE_UI_IPC_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "bluetooth-share-api.h"
+
+#define BT_SHARE_UI_INTERFACE "User.BluetoothShare.UI"
+#define BT_SHARE_UI_SIGNAL_OPPABORT "opp_abort"
+#define BT_SHARE_UI_SIGNAL_GET_TR_DATA "get_data"
+#define BT_SHARE_UI_SIGNAL_SEND_FILE "send_file"
+#define BT_SHARE_UI_SIGNAL_INFO_UPDATE "info_update"
+
+#define BT_SHARE_ENG_INTERFACE "User.BluetoothShare.Engine"
+#define BT_SHARE_ENG_OBJECT "/org/projectx/transfer_info"
+#define BT_SHARE_ENG_SIGNAL_PROGRESS "transfer_progress"
+#define BT_SHARE_ENG_SIGNAL_ERROR "error_type"
+#define BT_SHARE_ENG_SIGNAL_UPDATE_VIEW "update_view"
+
+typedef enum {
+       BT_TR_ONGOING = -1,
+       BT_TR_SUCCESS,
+       BT_TR_FAIL
+} bt_app_tr_status_t;
+
+typedef struct {
+       int uid;
+       int tr_status;
+       char *device_name;
+       char *filepath;
+       int timestamp;
+       char *addr;
+} bt_tr_info_t;
+
+void _bt_signal_init(bt_share_appdata_t *ad);
+void _bt_signal_deinit(bt_share_appdata_t *ad);
+int _bt_signal_send(bt_share_appdata_t *ad, char *signal, char *member);
+int _bt_share_ui_ipc_retry_send(bt_share_appdata_t *ad, bt_tr_data_t *info);
+int _bt_share_ui_ipc_info_update(bt_share_appdata_t *ad, int uid);
+int _bt_abort_signal_send(bt_share_appdata_t *ad,
+                         bt_share_popup_data_t *pb_data);
+#ifdef __cplusplus
+}
+#endif
+#endif                         /* __DEF_BT_SHARE_UI_IPC_H_ */
diff --git a/src/bt-share-ui-main.c b/src/bt-share-ui-main.c
new file mode 100644 (file)
index 0000000..fcc0b8f
--- /dev/null
@@ -0,0 +1,291 @@
+/*
+ * Copyright 2012  Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *   http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <stdio.h>
+#include <sensor.h>
+#include <appcore-efl.h>
+#include <Ecore_X.h>
+#include <utilX.h>
+#include <vconf.h>
+#include <vconf-keys.h>
+#include <E_DBus.h>
+#include <X11/Xatom.h>
+#include <X11/Xutil.h>
+#include <aul.h>
+#include "applog.h"
+#include "bt-share-ui-main.h"
+#include "bt-share-ui-view.h"
+#include "bt-share-ui-ipc.h"
+#include "bt-share-ui-resource.h"
+
+#include "bluetooth-share-api.h"
+
+bt_share_appdata_t *app_state = NULL;
+
+static int __bt_utilx_ss_get_window_property(Display *dpy,
+                                               Window win,
+                                               Atom atom,
+                                               Atom type,
+                                               unsigned int *val,
+                                               unsigned int len)
+{
+       unsigned char *prop_ret;
+       Atom type_ret;
+       unsigned long bytes_after;
+       unsigned long num_ret;
+       int format_ret;
+       unsigned int i;
+       int num;
+
+       prop_ret = NULL;
+       if (XGetWindowProperty(dpy, win, atom, 0, 0x7fffffff, False,
+                              type, &type_ret, &format_ret, &num_ret,
+                              &bytes_after, &prop_ret) != Success)
+               return -1;
+
+       if (type_ret != type || format_ret != 32)
+               num = -1;
+       else if (num_ret == 0 || !prop_ret)
+               num = 0;
+       else {
+               if (num_ret < len)
+                       len = num_ret;
+               for (i = 0; i < len; i++) {
+                       val[i] = ((unsigned long *)prop_ret)[i];
+               }
+               num = len;
+       }
+
+       if (prop_ret)
+               XFree(prop_ret);
+
+       return num;
+}
+
+
+static int __bt_utilx_rotation_get(Display *dpy, Window win)
+{
+       Window active_win;
+       Window root_win;
+       int rotation = -1;
+       int ret;
+
+       Atom atom_active_win;
+       Atom atom_win_rotate_angle;
+
+       root_win = XDefaultRootWindow(dpy);
+
+       atom_active_win = XInternAtom(dpy, "_NET_ACTIVE_WINDOW", False);
+       ret =
+           __bt_utilx_ss_get_window_property(dpy, root_win, atom_active_win,
+                                             XA_WINDOW,
+                                             (unsigned int *)&active_win, 1);
+
+       if (ret < 0)
+               return ret;
+
+       atom_win_rotate_angle =
+           XInternAtom(dpy, "_E_ILLUME_ROTATE_WINDOW_ANGLE", False);
+       ret =
+           __bt_utilx_ss_get_window_property(dpy, active_win,
+                                             atom_win_rotate_angle,
+                                             XA_CARDINAL,
+                                             (unsigned int *)&rotation, 1);
+
+       if (ret != -1)
+               return rotation;
+
+       return -1;
+}
+
+static int __bt_x_rotation(Evas_Object *parent)
+{
+       Ecore_X_Window xwin;
+       Display *dpy;
+       int rotation;
+
+       xwin = elm_win_xwindow_get(parent);
+       dpy = ecore_x_display_get();
+
+       rotation = __bt_utilx_rotation_get(dpy, xwin);
+
+       if (rotation == -1)
+               rotation = 0;
+
+       if (rotation >= 0)
+               elm_win_rotation_with_resize_set(parent, rotation);
+
+       return 0;
+}
+
+static int __bt_share_launch_handler(bt_share_appdata_t *ad, bundle *b)
+{
+       const char *launch_type = NULL;
+       bt_share_popup_data_t *pb_data = NULL;
+       const char *str = NULL;
+       const char *transfer_type = NULL;
+       const char *temp = NULL;
+
+       retvm_if(ad == NULL, -1, "Invalid param");
+       retvm_if(b == NULL, -1, "Invalid param");
+
+       launch_type = bundle_get_val(b, "launch-type");
+       if (!launch_type)
+               return -1;
+
+       if (!strcasecmp(launch_type, "ongoing")) {
+               pb_data = g_new0(bt_share_popup_data_t, 1);
+               pb_data->filename = g_strdup(bundle_get_val(b, "filename"));
+               pb_data->percentage = g_strdup(bundle_get_val(b, "percentage"));
+               pb_data->transfer_type = g_strdup(bundle_get_val(b, "transfer_type"));
+               temp = bundle_get_val(b, "transfer_id");
+               if (temp != NULL)
+                       pb_data->transfer_id = atoi(temp);
+               if (g_strcmp0(pb_data->transfer_type, "outbound") == 0) {
+                       pb_data->progress_cnt = g_strdup(bundle_get_val(b, "progress_cnt"));
+                       DBG("progress cnt : %s \n", pb_data->progress_cnt);
+               }
+
+               DBG("filename %s \n", pb_data->filename);
+               DBG("percentage %s \n", pb_data->percentage);
+               DBG("transfer_type %s \n", pb_data->transfer_type);
+               DBG("transfer_id %d \n", pb_data->transfer_id);
+
+                _bt_create_progress_popup(pb_data);
+       } else if (!strcasecmp(launch_type, "warning_popup")) {
+               _bt_destroy_progress_popup(ad);
+               str = bundle_get_val(b, "message");
+               _bt_create_extinctive_info_popup(ad, BT_STR_INFORMATION, str);
+       } else if (!strcasecmp(launch_type, "transfer_list")) {
+               _bt_destroy_progress_popup(ad);
+               transfer_type = bundle_get_val(b, "transfer_type");
+               if (!transfer_type)
+                       return -1;
+
+               DBG("transfer_type %s \n", transfer_type);
+
+               if (!strcmp(transfer_type, "outbound"))
+                       ad->tr_type = BT_TR_OUTBOUND;
+               else
+                       ad->tr_type = BT_TR_INBOUND;
+
+               if (_bt_create_transfer_list(ad))
+                       ERR("UI creation failed");
+       } else {
+               ERR("Invalid bundle value");
+               return -1;
+       }
+
+       return 0;
+}
+
+static int __app_create(void *data)
+{
+       DBG(" __app_create\n");
+       bt_share_appdata_t *ad = data;
+       Evas_Object *win = NULL;
+
+       /* create window */
+       win = _bt_create_win(PACKAGE);
+       retv_if(win == NULL, -1);
+       ad->win = win;
+
+       /* init internationalization */
+       if (appcore_set_i18n(BT_COMMON_PKG, BT_COMMON_RES) < 0)
+               return -1;
+
+       return 0;
+}
+
+static int __app_reset(bundle *b, void *data)
+{
+       DBG("__app_reset\n");
+       bt_share_appdata_t *ad = data;
+       int ret;
+       retv_if(ad == NULL, -1);
+
+       if(ad->dbus_conn == NULL) {
+               _bt_signal_init(ad);
+       }
+
+       ret = __bt_share_launch_handler(ad, b);
+       if (ret < 0)
+               _bt_terminate_app();
+
+       /* Set the real rotate mode */
+       __bt_x_rotation(ad->win);
+
+       if (ad->progress_popup || ad->info_popup) {
+               if (ad->app_layout == NULL)
+                       elm_win_alpha_set(ad->win, 1);
+       }
+
+       evas_object_show(ad->win);
+       elm_win_activate(ad->win);
+
+       return 0;
+}
+
+static int __app_terminate(void *data)
+{
+       DBG("__app_terminate \n");
+       bt_share_appdata_t *ad = data;
+
+       _bt_destroy_info_popup(ad);
+       _bt_signal_deinit(ad);
+
+       if (ad->tr_data_itc) {
+               elm_genlist_item_class_free(ad->tr_data_itc);
+               ad->tr_data_itc = NULL;
+       }
+
+       if (ad->win)
+               evas_object_del(ad->win);
+
+       return 0;
+}
+
+static int __app_pause(void *data)
+{
+       DBG("__app_pause \n");
+       return 0;
+}
+
+static int __app_resume(void *data)
+{
+       DBG("__app_resume\n");
+       return 0;
+}
+
+
+int main(int argc, char *argv[])
+{
+       bt_share_appdata_t ad;
+       app_state = &ad;
+       struct appcore_ops ops = {
+               .create = __app_create,
+               .terminate = __app_terminate,
+               .pause = __app_pause,
+               .resume = __app_resume,
+               .reset = __app_reset,
+       };
+
+       memset(&ad, 0x0, sizeof(bt_share_appdata_t));
+       ops.data = &ad;
+
+       return appcore_efl_main(PACKAGE, &argc, &argv, &ops);
+}
+
diff --git a/src/bt-share-ui-main.h b/src/bt-share-ui-main.h
new file mode 100644 (file)
index 0000000..4991ed8
--- /dev/null
@@ -0,0 +1,108 @@
+/*
+ * Copyright 2012  Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *   http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __DEF_BT_SHARE_UI_MAIN_H_
+#define __DEF_BT_SHARE_UI_MAIN_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <Elementary.h>
+#include <dlog.h>
+#include <glib.h>
+#include <dbus/dbus-glib.h>
+
+
+#if !defined(PACKAGE)
+#define PACKAGE "org.tizen.bluetooth-share-ui"
+#endif
+
+#if !defined(LOCALEDIR)
+#define        LOCALEDIR "/opt/apps/org.tizen.bluetooth/res/locale"
+#endif
+
+#if !defined(EDJFILE)
+#define        EDJFILE "/opt/apps/org.tizen.bluetooth-share-ui/res/edje/bt-share-layout.edj"
+#endif
+
+
+typedef enum {
+       BT_TR_OUTBOUND,
+       BT_TR_INBOUND
+} bt_share_tr_type_t;
+
+typedef enum {
+       BT_FT_RECV_FAIL_POPUP,
+       BT_FT_RECV_SUCCESS_POPUP,
+       BT_FT_SENT_POPUP,
+       BT_FT_RETRY_POPUP
+} bt_share_ft_popup_type_t;
+
+typedef struct {
+       const char *filename;
+       const char *percentage;
+       const char *transfer_type;
+       const char *progress_cnt;
+       int transfer_id;
+} bt_share_popup_data_t;
+
+typedef struct {
+       Evas_Object *win;
+       Evas_Object *layout_main;
+       Evas_Object *app_layout;
+       Evas_Object *navi_fr;
+       Evas_Object *nocontent;
+       Elm_Object_Item *toolbar_item;
+
+       /*  Progress Popup */
+       Evas_Object *progress_layout;
+       Evas_Object *progress_popup;
+       Evas_Object *pb;
+       int pb_transfer_id;
+
+
+       /* File transfer status popup*/
+       Evas_Object *ft_layout;
+       Evas_Object *ft_popup;
+
+       /* Information Popup */
+       Evas_Object *info_popup;
+
+       /* Transfer data list*/
+       Evas_Object *tr_genlist;
+       Elm_Genlist_Item_Class *tr_data_itc;
+       Elm_Object_Item *selected_item;
+       GSList *tr_data_list;
+
+       /* Timer Handler */
+       int timer;
+
+       E_DBus_Connection *dbus_conn;
+       E_DBus_Signal_Handler *progress_sh;
+       E_DBus_Signal_Handler *error_sh;
+       E_DBus_Signal_Handler *update_sh;
+
+       bt_share_tr_type_t tr_type;
+       int list_item_cnt;
+       int inbound_latest_id;
+       int outbound_latest_id;
+} bt_share_appdata_t;
+
+#ifdef __cplusplus
+}
+#endif
+#endif                         /* __DEF_BT_SHARE_UI_MAIN_H_ */
diff --git a/src/bt-share-ui-resource.h b/src/bt-share-ui-resource.h
new file mode 100644 (file)
index 0000000..75e5a68
--- /dev/null
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2012  Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *   http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __DEF_BLUETOOTH_SHARE_UI_RES_H_
+#define __DEF_BLUETOOTH_SHARE_UI_RES_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <libintl.h>
+
+/*==============  String ================= */
+#define BT_COMMON_PKG          "ug-setting-bluetooth-efl"
+#define BT_COMMON_RES          "/opt/ug/res/locale"
+
+#define BT_PKGNAME "org.tizen.bluetooth-share-ui"
+#define BT_PREFIX "/opt/apps/"BT_PKGNAME
+#define BT_IMAGE_DIR BT_PREFIX"/res/images/"
+
+#define BT_ICON_RECV_FAIL \
+       BT_IMAGE_DIR"A01-4_Inbound_transfer_failed.png"
+#define BT_ICON_RECV_PASS \
+       BT_IMAGE_DIR"A01-4_Inbound_transfer_successed.png"
+#define BT_ICON_SEND_FAIL \
+       BT_IMAGE_DIR"A01-4_Outbound_transfer_failed.png"
+#define BT_ICON_SEND_PASS \
+       BT_IMAGE_DIR"A01-4_Outbound_transfer_successed.png"
+#define BT_ICON_INBOUND \
+       BT_IMAGE_DIR"A01-4_No_items_Inbound_transfer.png"
+#define BT_ICON_OUTBOUND \
+       BT_IMAGE_DIR"A01-4_No_items_Outbound_transfer.png"
+
+#define BT_STR_MEMORY_FULL     \
+       dgettext(BT_COMMON_PKG, "IDS_BT_POP_MEMORYFULL")
+#define BT_STR_UNABLE_TO_SEND  \
+       dgettext(BT_COMMON_PKG, "IDS_BT_POP_SENDINGFAIL")
+#define BT_STR_FT      \
+       dgettext(BT_COMMON_PKG, "IDS_BT_BODY_FILE_TRANSFER")
+
+#define BT_STR_SHARING_FN  _("Sharing... %s")
+#define BT_STR_INBOUND_TR  _("Inbound transfers")
+#define BT_STR_OUTBOUND_TR  _("Outound transfers")
+#define BT_STR_CLR_LIST  _("Clear list")
+#define BT_STR_YESTERDAY  _("Yesterday")
+#define BT_STR_FILE_NOT_RECV  _("File not received")
+#define BT_STR_FILE_S  _("File: %s")
+#define BT_STR_FAIL_S  _("Failure reason: %s")
+#define BT_STR_TR_CANCELLED _("Transfer Cancelled")
+#define BT_STR_TO_S _("To: %s")
+#define BT_STR_FROM_S _("From: %s")
+#define BT_STR_FILE_TYPE_S _("File type: %s")
+#define BT_STR_FILE_SIZE_S _("File size: %s")
+#define BT_STR_SEND_FAIL_TO_S _("Sending failed to %s")
+#define BT_STR_RETRY _("Retry")
+#define BT_STR_TR_HISTORY_EMPTY _("Transfer history is empty")
+#define BT_STR_SHARING  _("Sharing... ")
+#define BT_STR_RECEIVING  _("Receiving...")
+#define BT_STR_UNABLE_TO_RECEIVE "Unable to receive"
+
+#define BT_STR_INFORMATION dgettext("sys_string", "IDS_COM_OPT_INFORMATION")
+#define BT_STR_OK dgettext("sys_string", "IDS_COM_SK_OK")
+#define BT_STR_CANCEL dgettext("sys_string", "IDS_COM_SK_CANCEL")
+#define BT_STR_CLOSE dgettext("sys_string", "IDS_COM_BODY_CLOSE")
+
+#ifdef __cplusplus
+}
+#endif
+#endif                         /* __DEF_BLUETOOTH_SHARE_UI_RES_H_ */
diff --git a/src/bt-share-ui-view.c b/src/bt-share-ui-view.c
new file mode 100644 (file)
index 0000000..c1af79a
--- /dev/null
@@ -0,0 +1,1202 @@
+/*
+ * Copyright 2012  Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *   http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <glib.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <Ecore_X.h>
+#include <appcore-efl.h>
+#include <utilX.h>
+#include <Elementary.h>
+#include <aul.h>
+#include <app.h>
+#include <vconf.h>
+#include <vconf-keys.h>
+
+#include "applog.h"
+#include "bt-share-ui-view.h"
+#include "bt-share-ui-ipc.h"
+#include "bt-share-ui-resource.h"
+#include "bt-share-ui-main.h"
+
+#include "bluetooth-share-api.h"
+
+#define BT_NAVI_ITEM_ADj 3
+#define BT_TIMESTAMP_LEN_MAX 18
+#define DOWNLOAD_PATH "/opt/media/Downloads"
+#define BT_FILE_PATH_LEN_MAX   (4096 + 10)
+
+extern bt_share_appdata_t *app_state;
+static char *month_str[] = {
+       "Jan", "Feb", "Mar", "Apr", "May", "Jun",
+       "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
+};
+
+static void __bt_nocontent_set(bt_share_appdata_t *ad, gboolean set);
+
+Evas_Object *_bt_create_win(const char *name)
+{
+       Evas_Object *eo = NULL;
+       int w;
+       int h;
+
+       eo = elm_win_add(NULL, name, ELM_WIN_BASIC);
+       if (!eo)
+               return NULL;
+
+       elm_win_title_set(eo, name);
+       elm_win_borderless_set(eo, EINA_TRUE);
+       ecore_x_window_size_get(ecore_x_window_root_first_get(),
+                               &w, &h);
+       evas_object_resize(eo, w, h);
+
+       return eo;
+}
+
+
+void _bt_terminate_app(void)
+{
+       DBG(" +\n");
+       elm_exit();
+       DBG(" -\n");
+}
+
+static void __bt_sel_item_del(bt_share_appdata_t *ad)
+{
+       ret_if(ad == NULL);
+
+       if (ad->selected_item == NULL)
+               return;
+
+       elm_object_item_del(ad->selected_item);
+       ad->selected_item = NULL;
+       ad->list_item_cnt--;
+       if (ad->list_item_cnt == 0) {
+               __bt_nocontent_set(ad, TRUE);
+               elm_object_item_disabled_set(ad->toolbar_item, EINA_TRUE);
+       }
+}
+
+static void __bt_destroy_ft_popup(bt_share_appdata_t *ad)
+{
+       DBG("+\n");
+
+       ret_if(ad == NULL);
+
+       if (ad->ft_popup) {     /* popup object */
+               DBG("delete ft_popup\n");
+               evas_object_del(ad->ft_popup);
+               ad->ft_popup = NULL;
+       }
+
+       ad->ft_layout = NULL;
+       DBG("-\n");
+       return;
+}
+
+static void __bt_ft_retry_popup_cb(void *data, Evas_Object *obj,
+                       void *event_info)
+{
+       DBG(" +\n");
+
+       ret_if(data == NULL);
+       bt_share_appdata_t *ad = app_state;
+       bt_tr_data_t *info = (bt_tr_data_t *)data;
+       const char *event = elm_object_text_get(obj);
+
+       __bt_destroy_ft_popup(ad);
+
+       if (!strcmp(event, BT_STR_RETRY)) {
+               DBG("Retry sending \n");
+               if (!_bt_share_ui_ipc_retry_send(ad, info)) {
+                       DBG(" info->id %d \n",  info->id);
+                       _bt_share_ui_ipc_info_update(ad, info->id);
+                       __bt_sel_item_del(ad);
+               }
+       } else if (!strcmp(event, BT_STR_CANCEL)) {
+               DBG("Cancel \n");
+               _bt_share_ui_ipc_info_update(ad, info->id);
+               __bt_sel_item_del(ad);
+       }
+
+       if (obj != NULL)
+               evas_object_del(obj);
+
+       DBG("-\n");
+       return;
+}
+
+static void __bt_ft_popup_cb(void *data, Evas_Object *obj,
+                       void *event_info)
+{
+       DBG(" +\n");
+       ret_if(data == NULL);
+       bt_share_appdata_t *ad = app_state;
+       bt_tr_data_t *info = (bt_tr_data_t *)data;
+       const char *event = elm_object_text_get(obj);
+
+       __bt_destroy_ft_popup(ad);
+
+       if (!strcmp(event, BT_STR_OK))  {
+               DBG("OK \n");
+               _bt_share_ui_ipc_info_update(ad, info->id);
+               __bt_sel_item_del(ad);
+       }
+
+       if (obj != NULL)
+               evas_object_del(obj);
+
+       DBG("-\n");
+       return;
+}
+
+Evas_Object *_bt_create_popup_layout(bt_share_appdata_t *ad)
+{
+       Evas_Object *layout = NULL;
+
+       layout = elm_layout_add(ad->ft_popup);
+       elm_layout_file_set(layout, EDJFILE, "ft_popup");
+       evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND,
+                                        EVAS_HINT_EXPAND);
+       return layout;
+}
+
+Evas_Object *_bt_create_popup_pb_layout(bt_share_appdata_t *ad,
+                                       Evas_Object *parent)
+{
+       Evas_Object *layout = NULL;
+       Evas_Object *pb = NULL;
+
+       layout = elm_layout_add(parent);
+       elm_layout_file_set(layout, EDJFILE, "progress_popup");
+       evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND,
+                                        EVAS_HINT_EXPAND);
+
+       pb = elm_progressbar_add(layout);
+       elm_object_part_content_set(layout, "popup_pb", pb);
+       elm_object_style_set(pb, "list_progress");
+       elm_progressbar_horizontal_set(pb, EINA_TRUE);
+       evas_object_size_hint_align_set(pb, EVAS_HINT_FILL,
+                                       EVAS_HINT_FILL);
+       evas_object_size_hint_weight_set(pb, EVAS_HINT_EXPAND,
+                                        EVAS_HINT_EXPAND);
+       evas_object_show(pb);
+       ad->pb = pb;
+
+       return layout;
+}
+
+static void __bt_update_popup_pb_layout(Evas_Object *layout,
+                                       bt_share_ft_popup_type_t type,
+                                       char *device_name, char *filepath)
+{
+       char msg[BT_GLOBALIZATION_STR_LENGTH] = { 0 };
+       char mime_type[BT_MIME_TYPE_MAX_LEN] = { 0 };
+       char file_size_str[BT_FILE_SIZE_STR] = { 0 };
+       char *name = NULL;
+       int file_size = 0;
+       struct stat file_attr;
+
+       if (type == BT_FT_SENT_POPUP)
+               snprintf(msg, sizeof(msg), BT_STR_TO_S, device_name);
+       else
+               snprintf(msg, sizeof(msg), BT_STR_FROM_S, device_name);
+
+       elm_object_part_text_set(layout, "msg1", msg);
+
+       if (filepath != NULL) {
+               name = strrchr(filepath, '/');
+               if (name != NULL)
+                       name++;
+               else
+                       name = filepath;
+
+               snprintf(msg, sizeof(msg), BT_STR_FILE_S, name);
+               elm_object_part_text_set(layout, "msg2", msg);
+       }
+
+       if (aul_get_mime_from_file(filepath, mime_type,
+                       BT_FILE_NAME_LEN_MAX) == AUL_R_OK) {
+               DBG(" mime type    =%s  \n", mime_type);
+
+               snprintf(msg, sizeof(msg), BT_STR_FILE_TYPE_S,
+                                       mime_type);
+               elm_object_part_text_set(layout, "msg3", msg);
+       }
+
+       if (stat(filepath, &file_attr) == 0) {
+               file_size = file_attr.st_size;
+
+               if (file_size < 1024)
+                       snprintf(file_size_str, sizeof(file_size_str),
+                               "%dbytes", file_size);
+               else if (file_size > 1024 * 1024)
+                       snprintf(file_size_str, sizeof(file_size_str),
+                               "%dMB", file_size / (1024 * 1024));
+               else
+                       snprintf(file_size_str, sizeof(file_size_str),
+                               "%dKB", file_size / 1024);
+
+               snprintf(msg, sizeof(msg), BT_STR_FILE_SIZE_S,
+                               file_size_str);
+
+               elm_object_part_text_set(layout, "msg4", msg);
+       }
+       return;
+}
+
+Evas_Object *_bt_create_btn(Evas_Object *parent, char *btn_type,
+                       char *btn_txt, void *cb, void *data)
+{
+       Evas_Object *btn = NULL;
+
+       if (btn_type == NULL || btn_txt == NULL) {
+               DBG("Invalid parameter!\n");
+               return NULL;
+       }
+
+       btn = elm_button_add(parent);
+       elm_object_style_set(btn, "popup_button/default");
+       elm_object_text_set(btn, btn_txt);
+       elm_object_part_content_set(parent, btn_type, btn);
+       evas_object_smart_callback_add(btn, "clicked", cb, data);
+       return btn;
+}
+
+Evas_Object *_bt_create_ft_popup(bt_share_ft_popup_type_t type,
+                                       bt_tr_data_t *info)
+{
+       DBG(" +\n");
+       bt_share_appdata_t *ad = app_state;
+       Evas_Object *layout = NULL;
+       Evas_Object *btn1 = NULL;
+       Evas_Object *btn2 = NULL;
+       char msg[BT_GLOBALIZATION_STR_LENGTH] = { 0 };
+       char *name = NULL;
+
+       if (info->file_path == NULL)
+               return NULL;
+
+       ad->ft_popup = elm_popup_add(ad->win);
+
+       evas_object_size_hint_weight_set(ad->ft_popup,
+                                        EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+
+       elm_object_part_text_set(ad->ft_popup, "title,text", BT_STR_FT);
+
+       if (type == BT_FT_RETRY_POPUP) {
+               btn1 = _bt_create_btn(ad->ft_popup, "button1", BT_STR_RETRY,
+                               __bt_ft_retry_popup_cb, info);
+               btn2 = _bt_create_btn(ad->ft_popup,  "button2", BT_STR_CANCEL,
+                               __bt_ft_retry_popup_cb, info);
+       } else {
+               btn1 = _bt_create_btn(ad->ft_popup, "button1", BT_STR_OK,
+                               __bt_ft_popup_cb, info);
+       }
+
+       if (type == BT_FT_SENT_POPUP) {
+               layout = _bt_create_popup_pb_layout(ad, ad->ft_popup);
+               elm_progressbar_value_set(ad->pb, 1.0);
+               elm_object_part_text_set(layout, "percent", "100%");
+               __bt_update_popup_pb_layout(layout, type,
+                                       info->dev_name, info->file_path);
+       } else if (type == BT_FT_RECV_SUCCESS_POPUP) {
+               layout = _bt_create_popup_pb_layout(ad, ad->ft_popup);
+               elm_progressbar_value_set(ad->pb, 1.0);
+               elm_object_part_text_set(layout, "percent", "100%");
+               __bt_update_popup_pb_layout(layout, type,
+                                       info->dev_name, info->file_path);
+       } else if (type == BT_FT_RECV_FAIL_POPUP) {
+               layout = _bt_create_popup_layout(ad);
+               elm_object_part_text_set(layout, "msg1", BT_STR_FILE_NOT_RECV);
+               snprintf(msg, sizeof(msg), BT_STR_FILE_S, info->file_path);
+               elm_object_part_text_set(layout, "msg2", msg);
+               snprintf(msg, sizeof(msg), BT_STR_FAIL_S, BT_STR_TR_CANCELLED);
+               elm_object_part_text_set(layout, "msg3", msg);
+       } else  if (type == BT_FT_RETRY_POPUP) {
+               layout = _bt_create_popup_layout(ad);
+               snprintf(msg, sizeof(msg), BT_STR_SEND_FAIL_TO_S, info->dev_name);
+               elm_object_part_text_set(layout, "msg1", msg);
+
+               name = strrchr(info->file_path, '/');
+               if (name != NULL)
+                       name++;
+               else
+                       name = info->file_path;
+
+               snprintf(msg, sizeof(msg), BT_STR_FILE_S, name);
+               elm_object_part_text_set(layout, "msg2", msg);
+               snprintf(msg, sizeof(msg), BT_STR_FAIL_S, BT_STR_TR_CANCELLED);
+               elm_object_part_text_set(layout, "msg3", msg);
+       }
+
+       ad->ft_layout = layout;
+
+       elm_object_content_set(ad->ft_popup, layout);
+       evas_object_show(ad->ft_popup);
+
+       DBG(" -\n");
+       return NULL;
+}
+
+
+void _progress_popup_cb(void *data, Evas_Object *obj,
+                       void *event_info)
+{
+       DBG(" +\n");
+       bt_share_appdata_t *ad = app_state;
+       bt_share_popup_data_t *pb_data = NULL;
+       const char *event = elm_object_text_get(obj);
+
+       ret_if(data == NULL);
+
+       pb_data = (bt_share_popup_data_t *)data;
+
+       _bt_destroy_progress_popup(ad);
+
+       if (!strcmp(event, BT_STR_OK))  {
+               DBG("OK \n");
+       } else if (!strcmp(event, BT_STR_CANCEL))  {
+               DBG("Cancel \n");
+               _bt_abort_signal_send(ad, pb_data);
+       }
+
+       if (obj != NULL)
+               evas_object_del(obj);
+
+       g_free((gpointer)pb_data->filename);
+       g_free((gpointer)pb_data->percentage);
+       g_free((gpointer)pb_data->transfer_type);
+       g_free((gpointer)pb_data);
+
+       if (ad->app_layout == NULL)
+               _bt_terminate_app();
+
+       DBG("-\n");
+       return;
+}
+
+void _bt_create_progress_popup(bt_share_popup_data_t *data)
+{
+       DBG(" +\n");
+       ret_if(data == NULL);
+       bt_share_appdata_t *ad = app_state;
+       char temp[BT_PERCENT_STR_LEN] = { 0 };
+       float i = 0.0;
+       int tmp = 0;
+       char msg[2 * BT_FILE_NAME_LEN_MAX] = { 0, };
+
+       if (NULL == ad->progress_popup) {
+               ad->progress_popup = elm_popup_add(ad->win);
+               evas_object_size_hint_weight_set(ad->progress_popup,
+                                                EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+
+               _bt_create_btn(ad->progress_popup, "button1", BT_STR_CLOSE,
+                               _progress_popup_cb, data);
+
+               _bt_create_btn(ad->progress_popup, "button2", BT_STR_CANCEL,
+                               _progress_popup_cb, data);
+
+               ad->progress_layout = _bt_create_popup_pb_layout(ad, ad->progress_popup);
+       }
+       tmp = atoi(data->percentage);
+       elm_progressbar_unit_format_set(ad->pb, NULL);
+       i = (float)tmp / (float)100.0;
+       elm_progressbar_value_set(ad->pb, i);
+       evas_object_show(ad->pb);
+
+       if (!strcmp(data->transfer_type, "outbound")) {
+               snprintf(msg, sizeof(msg), BT_STR_SHARING);
+               elm_object_part_text_set(ad->progress_layout, "status_text",
+                                       data->progress_cnt);
+       } else {
+               snprintf(msg, sizeof(msg), BT_STR_RECEIVING);
+       }
+
+       elm_object_part_text_set(ad->progress_layout, "msg2",
+                               msg);
+
+       elm_object_part_text_set(ad->progress_layout, "msg3",
+                               data->filename);
+
+       snprintf(temp, BT_PERCENT_STR_LEN, "%d%%", tmp);
+       elm_object_part_text_set(ad->progress_layout, "percent",
+                               temp);
+
+       ad->pb_transfer_id = data->transfer_id;
+
+       elm_object_content_set(ad->progress_popup, ad->progress_layout);
+       evas_object_show(ad->progress_popup);
+
+       DBG(" -\n");
+       return;
+}
+
+
+int _bt_destroy_progress_popup(bt_share_appdata_t *ad)
+{
+       DBG("+\n");
+
+       retvm_if(ad == NULL, 0,
+                "Invalid argument: ad is NULL\n");
+
+       if (ad->progress_popup) {       /* popup object */
+               DBG("delete popup\n");
+               evas_object_del(ad->progress_popup);
+               ad->progress_popup = NULL;
+       }
+       ad->pb = NULL;
+       ad->progress_layout = NULL;
+       ad->pb_transfer_id = -1;
+
+       DBG("-\n");
+       return 0;
+}
+
+int _bt_update_progress_popup(bt_share_appdata_t *ad, int transfer_id, const char *name, int percentage)
+{
+       char temp[BT_PERCENT_STR_LEN] = {0};
+
+       retvm_if(ad == NULL, 0,
+                "Invalid argument: ad is NULL\n");
+
+       if (ad->pb_transfer_id != transfer_id)
+               return 0;
+
+       elm_object_part_text_set(ad->progress_layout,
+                       "msg3", name);
+
+       float i = 0.0;
+       i = (float)(percentage) / (float)100.0;
+       elm_progressbar_value_set(ad->pb, i);
+       evas_object_show(ad->pb);
+
+       snprintf(temp, BT_PERCENT_STR_LEN, "%d%%", percentage);
+       elm_object_part_text_set(ad->progress_layout,
+                       "percent", temp);
+
+       return 0;
+}
+
+
+static gboolean __bt_info_popup_timer_cb(void *data, Evas_Object *obj,
+                                   void *event_info)
+{
+       bt_share_appdata_t *ad;
+       ad = (bt_share_appdata_t *)data;
+       retv_if(ad == NULL, FALSE);
+
+       _bt_destroy_info_popup(ad);
+       return FALSE;
+}
+
+Evas_Object *_bt_create_info_popup(bt_share_appdata_t *ad, const char *title, const char *text)
+{
+       DBG("+\n");
+       Evas_Object *popup = NULL;
+       retv_if((!ad || !title || !text), NULL);
+
+       if(ad->info_popup != NULL )
+               return NULL;
+
+       popup = elm_popup_add(ad->win);
+       evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND,
+                                        EVAS_HINT_EXPAND);
+       elm_object_part_text_set(popup, "title,text", title);
+       elm_object_text_set(popup, text);
+       elm_popup_timeout_set(popup, BT_INFO_POPUP_TIMEOUT_IN_SEC);
+       evas_object_smart_callback_add(popup, "timeout",
+                       (Evas_Smart_Cb) __bt_info_popup_timer_cb, ad);
+       evas_object_show(popup);
+       ad->info_popup = popup;
+
+       DBG("-\n");
+       return popup;
+}
+
+static gboolean __bt_extinctive_info_popup_timer_cb(void *data, Evas_Object *obj,
+                                   void *event_info)
+{
+       bt_share_appdata_t *ad;
+       ad = (bt_share_appdata_t *)data;
+       retv_if(ad == NULL, FALSE);
+
+       _bt_destroy_info_popup(ad);
+       _bt_terminate_app();
+       return FALSE;
+}
+
+Evas_Object *_bt_create_extinctive_info_popup(bt_share_appdata_t *ad, const char *title, const char *text)
+{
+       DBG("+\n");
+       Evas_Object *popup = NULL;
+       retv_if((!ad || !title || !text), NULL);
+
+       if(ad->info_popup != NULL )
+               return NULL;
+
+       popup = elm_popup_add(ad->win);
+       evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND,
+                                        EVAS_HINT_EXPAND);
+       elm_object_part_text_set(popup, "title,text", title);
+       elm_object_text_set(popup, text);
+       elm_popup_timeout_set(popup, BT_INFO_POPUP_TIMEOUT_IN_SEC);
+       evas_object_smart_callback_add(popup, "timeout",
+                       (Evas_Smart_Cb) __bt_extinctive_info_popup_timer_cb, ad);
+       evas_object_show(popup);
+       ad->info_popup = popup;
+
+       DBG("-\n");
+       return popup;
+}
+
+
+int _bt_destroy_info_popup(bt_share_appdata_t *ad)
+{
+       DBG("+\n");
+       retvm_if(ad == NULL, 0,
+                "Invalid argument: ad is NULL\n");
+
+       if (ad->info_popup) {
+               DBG("delete popup\n");
+               evas_object_del(ad->info_popup);
+               ad->info_popup = NULL;
+       }
+
+       DBG("-\n");
+       return 0;
+}
+
+static void __bt_back_button_cb(void *data,
+                                                   Evas_Object *obj,
+                                                   void *event_info)
+{
+       bt_share_appdata_t *ad = (bt_share_appdata_t *)data;
+       int ret;
+
+       if (ad->tr_genlist) {
+               elm_genlist_clear(ad->tr_genlist);
+               ad->tr_genlist = NULL;
+       }
+
+       if (ad->navi_fr) {
+               evas_object_del(ad->navi_fr);
+               ad->navi_fr = NULL;
+       }
+
+       if (ad->layout_main) {
+               evas_object_del(ad->layout_main);
+               ad->layout_main = NULL;
+       }
+
+       if (ad->tr_data_list) {
+               ret = bt_share_release_tr_data_list(ad->tr_data_list);
+               if (ret != BT_SHARE_ERR_NONE)
+                       ERR("Transfer data release failed \n");
+               ad->tr_data_list = NULL;
+       }
+
+       _bt_terminate_app();
+}
+
+
+Evas_Object *__bt_create_bg(Evas_Object *parent, char *style)
+{
+       Evas_Object *bg = NULL;
+
+       if (parent == NULL)
+               return NULL;
+
+       bg = elm_bg_add(parent);
+
+       evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND,
+                               EVAS_HINT_EXPAND);
+
+       if (style)
+               elm_object_style_set(bg, style);
+
+       elm_win_resize_object_add(parent, bg);
+
+       evas_object_show(bg);
+
+       return bg;
+}
+
+static void __bt_clear_list_btn_cb(void *data,
+                                       Evas_Object *obj,
+                                       void *event_info)
+{
+       DBG("+\n");
+       bt_share_appdata_t *ad = (bt_share_appdata_t *)data;
+       int clear_list = -1;
+
+       _bt_share_ui_ipc_info_update(ad, clear_list);
+
+       if (ad->tr_genlist) {
+               elm_genlist_clear(ad->tr_genlist);
+               ad->tr_genlist = NULL;
+       }
+
+       ad->list_item_cnt = 0;
+       __bt_nocontent_set(ad, TRUE);
+       elm_object_item_disabled_set(ad->toolbar_item, EINA_TRUE);
+       DBG("-\n");
+}
+
+static gboolean __bt_is_year_leap(int year)
+{
+       if (year % 400 == 0 || ((year % 100 != 0) && (year % 4 == 0))) {
+               DBG("Year %d is a leap year\n", year);
+               return TRUE;
+       } else {
+               DBG("Year %d is not a leap year", year);
+       }
+       return FALSE;
+}
+
+static int __bt_get_passed_day_count(int year, int month)
+{
+       int i = 1;
+       int days = 0;
+       int leap = 0;
+
+       for (i = 1; i< month; i++) {
+               switch (i) {
+               /*Months with 30 days*/
+               case 4:
+               case 6:
+               case 9:
+               case 11:
+                       days = days +30;
+                       break;
+               /*Month of February*/
+               case 2:
+                       leap = __bt_is_year_leap(year);
+                       if (leap == TRUE)
+                               days = days + 29;
+                       else
+                               days = days + 28;
+                       break;
+               /*Months with 31 days*/
+               case 1:
+               case 3:
+               case 5:
+               case 7:
+               case 8:
+               case 10:
+               case 12:
+                       days = days + 31;
+                       break;
+
+               default:
+                       DBG("Incorrect month\n");
+                       break;
+               }
+       }
+       return days;
+}
+
+static char *__bt_get_tr_timedate(time_t timestamp)
+{
+       struct tm *pt;
+       struct tm *current_time;
+       time_t rawtime;
+       char buf[BT_TIMESTAMP_LEN_MAX] = { 0 };
+       int cy;
+       int cm;
+       int cd;
+       int ry;
+       int rm;
+       int rd;
+
+       /* Get current time */
+       time(&rawtime);
+       current_time = localtime(&rawtime);
+       cy = current_time->tm_year + 1900;
+       cm = current_time->tm_mon + 1;
+       cd = current_time->tm_mday;
+
+       /* Get recorded time */
+       pt = localtime(&timestamp);
+       ry = pt->tm_year + 1900;
+       rm = pt->tm_mon + 1;
+       rd = pt->tm_mday;
+
+       if (cy == ry && cm == rm && cd == rd) {
+               int format = 0;
+               if (vconf_get_int(VCONFKEY_REGIONFORMAT_TIME1224, &format) != 0) {
+                       ERR("vconf get failed\n");
+               }
+
+               if (format == VCONFKEY_TIME_FORMAT_12)
+                       strftime(buf, sizeof(buf), "%I:%M %p", pt);
+               else
+                       strftime(buf, sizeof(buf), "%H:%M", pt);
+       } else if (cy == ry && cm == rm && cd - 1 == rd) {
+               return g_strdup(BT_STR_YESTERDAY);
+       } else {
+               snprintf(buf, sizeof(buf), "%d %s %d", rd, month_str[rm - 1], ry);
+       }
+
+        return g_strdup(buf);
+}
+
+static Evas_Object *__bt_tr_icon_get(void *data, Evas_Object *obj,
+                                           const char *part)
+{
+       Evas_Object *icon = NULL;
+       bt_tr_data_t *info = NULL;
+       bt_share_appdata_t *ad = app_state;
+
+       retv_if(data == NULL, NULL);
+       info = (bt_tr_data_t *)data;
+
+       if (!strcmp(part, "elm.icon")) {
+               icon = elm_icon_add(obj);
+               if (ad->tr_type == BT_TR_OUTBOUND) {
+                       if (info->tr_status == BT_TR_SUCCESS) {
+                               DBG("BT_ICON_SEND_PASS %s\n", BT_ICON_SEND_PASS);
+                               elm_icon_file_set(icon, BT_ICON_SEND_PASS, NULL);
+                       } else
+                               elm_icon_file_set(icon, BT_ICON_SEND_FAIL, NULL);
+               } else {
+                       if (info->tr_status == BT_TR_SUCCESS)
+                               elm_icon_file_set(icon, BT_ICON_RECV_PASS, NULL);
+                       else
+                               elm_icon_file_set(icon, BT_ICON_RECV_FAIL, NULL);
+               }
+               evas_object_size_hint_aspect_set(icon,
+                       EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
+               elm_icon_resizable_set(icon, 1, 1);
+               evas_object_show(icon);
+       } else  {
+               ERR("no image found. \n");
+               return NULL;
+       }
+
+       return icon;
+}
+
+static char *__bt_tr_label_get(void *data, Evas_Object *obj,
+                                     const char *part)
+{
+       bt_tr_data_t *info = NULL;
+       char *name = NULL;
+       char buf[BT_GLOBALIZATION_STR_LENGTH] = { 0 };
+
+       retv_if(data == NULL, NULL);
+       info = (bt_tr_data_t *)data;
+
+       if (!strcmp(part, "elm.text.1")) {
+               name = strrchr(info->file_path, '/');
+               if (name != NULL)
+                       name++;
+               else
+                       name = info->file_path;
+
+               g_strlcpy(buf, name, BT_GLOBALIZATION_STR_LENGTH);
+       } else if (strcmp(part, "elm.text.2") == 0) {
+               g_strlcpy(buf, info->dev_name, BT_GLOBALIZATION_STR_LENGTH);
+       } else if (strcmp(part, "elm.text.3") == 0) {
+               char *date = NULL;
+               date = __bt_get_tr_timedate((time_t)(info->timestamp));
+               g_strlcpy(buf, date, BT_GLOBALIZATION_STR_LENGTH);
+               g_free(date);
+       } else {
+               DBG("empty text for label. \n");
+               return NULL;
+       }
+
+       return strdup(buf);
+}
+
+static Evas_Object *__bt_create_scroller(Evas_Object *parent, Evas_Object *ly)
+{
+       Evas_Object *scroller;
+
+       if(parent == NULL)
+               return NULL;
+
+       scroller = elm_scroller_add(parent);
+
+       elm_scroller_bounce_set(scroller, EINA_FALSE, EINA_TRUE);
+       elm_scroller_policy_set(scroller, ELM_SCROLLER_POLICY_OFF,
+                               ELM_SCROLLER_POLICY_AUTO);
+
+       if (ly != NULL)
+               elm_object_content_set(scroller, ly);
+
+       evas_object_show(scroller);
+
+       return scroller;
+}
+
+static gboolean __bt_open_received_file(const char *path)
+{
+        service_h handle;
+        service_create(&handle);
+        service_set_operation(handle, SERVICE_OPERATION_VIEW);
+        service_set_uri (handle, path);
+        service_send_launch_request(handle, NULL, NULL);
+        service_destroy(handle);
+        return TRUE;
+}
+
+static gint __handle_compare(gconstpointer a, gconstpointer b)
+{
+       bt_tr_data_t *info = (bt_tr_data_t *)a;
+       int id = (int) b;
+
+       if (info->id == id)
+               return 0;
+       else
+               return -1;
+}
+
+static void __bt_remove_tr_data_node(bt_share_appdata_t *ad, int id)
+{
+       GSList *l = NULL;
+       bt_tr_data_t *info = NULL;
+       l = g_slist_find_custom(ad->tr_data_list, (gconstpointer) id, __handle_compare);
+       if (!l) {
+               info = l->data;
+               ad->tr_data_list = g_slist_remove(ad->tr_data_list, info);
+       }
+}
+
+static void __bt_tr_data_recv_item_sel(void *data, Evas_Object *obj,
+                                     void *event_info)
+{
+       DBG("+ \n");
+       bt_share_appdata_t *ad = app_state;
+       bt_tr_data_t *info = NULL;
+       char path[BT_FILE_PATH_LEN_MAX] = {0, };
+       char *ext = NULL;
+
+       ret_if(data == NULL);
+       ret_if(event_info == NULL);
+
+       info = (bt_tr_data_t *)data;
+       __bt_remove_tr_data_node(ad, info->id);
+
+       ad->selected_item = (Elm_Object_Item *)event_info;
+       elm_genlist_item_selected_set((Elm_Object_Item *)event_info,
+                                     EINA_FALSE);
+
+       if (info->tr_status == BT_TR_SUCCESS) {
+               if (info->file_path == NULL)
+                       return;
+
+               DBG("info->filepath = %s \n", info->file_path);
+               snprintf(path, BT_FILE_PATH_LEN_MAX-1, "%s/%s",
+                                       DOWNLOAD_PATH, info->file_path);
+
+               ext = strrchr(path, '.') + 1;
+               if (ext) {
+                       if (0 == strcmp(ext, "vcf") || 0 == strcmp(ext, "vcal")) {
+                               free(info->file_path);
+                               info->file_path = strdup(path);
+                               _bt_create_ft_popup(BT_FT_RECV_SUCCESS_POPUP, info);
+                               DBG("- \n");
+                               return;
+                       }
+               }
+
+               __bt_open_received_file(path);
+               _bt_share_ui_ipc_info_update(ad, info->id);
+               __bt_sel_item_del(ad);
+       } else {
+               _bt_create_ft_popup(BT_FT_RECV_FAIL_POPUP, info);
+       }
+       DBG("- \n");
+       return;
+}
+
+static void __bt_tr_data_sent_item_sel(void *data, Evas_Object *obj,
+                                     void *event_info)
+{
+       DBG("+ \n");
+       bt_share_appdata_t *ad = app_state;
+       bt_tr_data_t *info = NULL;
+
+       ret_if(data == NULL);
+       ret_if(event_info == NULL);
+
+       info = (bt_tr_data_t *)data;
+       ad->selected_item = (Elm_Object_Item *)event_info;
+       elm_genlist_item_selected_set((Elm_Object_Item *)event_info,
+                                     EINA_FALSE);
+
+       if (info->tr_status == BT_TR_SUCCESS)
+               _bt_create_ft_popup(BT_FT_SENT_POPUP, info);
+       else
+               _bt_create_ft_popup(BT_FT_RETRY_POPUP, info);
+
+       __bt_remove_tr_data_node(ad, info->id);
+
+       DBG("- \n");
+       return;
+}
+
+void _bt_append_genlist_tr_data_item(bt_share_appdata_t *ad, bt_tr_data_t *info, int tr_type)
+{
+       DBG("+\n");
+
+       if (ad == NULL)
+               return;
+
+       if (info == NULL)
+               return;
+
+       if (tr_type == BT_TR_OUTBOUND) {
+               elm_genlist_item_append(ad->tr_genlist, ad->tr_data_itc, info, NULL,
+                                   ELM_GENLIST_ITEM_NONE,
+                                   __bt_tr_data_sent_item_sel, info);
+               ad->list_item_cnt++;
+
+               if (ad->outbound_latest_id < info->id)
+                       ad->outbound_latest_id = info->id;
+       } else if (tr_type == BT_TR_INBOUND) {
+               elm_genlist_item_append(ad->tr_genlist, ad->tr_data_itc, info, NULL,
+                                   ELM_GENLIST_ITEM_NONE,
+                                   __bt_tr_data_recv_item_sel, info);
+               ad->list_item_cnt++;
+
+               if (ad->inbound_latest_id < info->id)
+                       ad->inbound_latest_id = info->id;
+       } else {
+               DBG("Transfer is ongoing for data or data invalid. \n");
+       }
+
+       DBG("-\n");
+       return;
+}
+
+
+void _bt_prepend_genlist_tr_data_item(bt_share_appdata_t *ad, bt_tr_data_t *info, int tr_type)
+{
+       DBG("+\n");
+
+       if (ad == NULL)
+               return;
+
+       if (info == NULL)
+               return;
+
+       if (tr_type == BT_TR_OUTBOUND) {
+               elm_genlist_item_prepend(ad->tr_genlist, ad->tr_data_itc, info, NULL,
+                                   ELM_GENLIST_ITEM_NONE,
+                                   __bt_tr_data_sent_item_sel, info);
+               ad->list_item_cnt++;
+
+               if (ad->outbound_latest_id < info->id)
+                       ad->outbound_latest_id = info->id;
+       } else if (tr_type == BT_TR_INBOUND) {
+               elm_genlist_item_prepend(ad->tr_genlist, ad->tr_data_itc, info, NULL,
+                                   ELM_GENLIST_ITEM_NONE,
+                                   __bt_tr_data_recv_item_sel, info);
+               ad->list_item_cnt++;
+
+               if (ad->inbound_latest_id < info->id)
+                       ad->inbound_latest_id = info->id;
+       } else {
+               DBG("Transfer is ongoing for data or data invalid. \n");
+       }
+
+       DBG("-\n");
+       return;
+}
+
+static void __bt_add_tr_data_genlist(Evas_Object *parent,
+                                                 bt_share_appdata_t *ad)
+{
+       if (ad == NULL)
+               return;
+
+       GSList *list_iter = NULL;
+       sqlite3 *db = NULL;
+
+       ad->tr_genlist = elm_genlist_add(parent);
+
+        /* Set item class for transfer data*/
+       if (ad->tr_data_itc == NULL) {
+               ad->tr_data_itc = elm_genlist_item_class_new();
+               if (ad->tr_data_itc == NULL)
+                       return;
+
+               ad->tr_data_itc->item_style = "3text.1icon.2";
+               ad->tr_data_itc->func.text_get = __bt_tr_label_get;
+               ad->tr_data_itc->func.content_get = __bt_tr_icon_get;
+               ad->tr_data_itc->func.state_get = NULL;
+               ad->tr_data_itc->func.del = NULL;
+       }
+
+       DBG("ad->tr_type = %d \n", ad->tr_type);
+
+       db = bt_share_open_db();
+       if (!db)
+               return;
+
+       ad->tr_data_list = bt_share_get_completed_tr_data_list(db, ad->tr_type);
+       if (ad->tr_data_list == NULL) {
+               bt_share_close_db(db);
+               return;
+       }
+       bt_share_close_db(db);
+
+       list_iter = ad->tr_data_list;
+
+       while (NULL != list_iter) {
+               _bt_append_genlist_tr_data_item(ad,  list_iter->data, ad->tr_type);
+               list_iter = g_slist_next(list_iter);
+       }
+
+       evas_object_show(ad->tr_genlist);
+
+       return;
+}
+
+static void __bt_nocontent_set(bt_share_appdata_t *ad, gboolean set)
+{
+       Evas_Object *icon = NULL;
+       ret_if(ad == NULL);
+       elm_object_part_content_unset(ad->app_layout, "content");
+
+       if (set == TRUE) {
+               ad->nocontent = elm_layout_add(ad->layout_main);
+               if (ad->nocontent == NULL)
+                       return;
+
+               elm_layout_file_set(ad->nocontent, EDJFILE, "nocontent");
+
+               icon = elm_icon_add(ad->nocontent);
+
+               if (ad->tr_type == BT_TR_OUTBOUND)
+                       elm_icon_file_set(icon, BT_ICON_OUTBOUND, NULL);
+               else
+                       elm_icon_file_set(icon, BT_ICON_INBOUND, NULL);
+
+               evas_object_size_hint_aspect_set(icon,
+                       EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
+               elm_icon_resizable_set(icon, 1, 1);
+               evas_object_show(icon);
+
+               elm_object_part_text_set(ad->nocontent, "text",
+                                         BT_STR_TR_HISTORY_EMPTY);
+
+               elm_object_part_content_set(ad->nocontent, "content", icon);
+               evas_object_show(ad->nocontent);
+               elm_object_part_content_set(ad->app_layout, "content",
+                       ad->nocontent);
+       } else {
+               if (ad->nocontent != NULL)
+                       evas_object_del(ad->nocontent);
+       }
+}
+
+static Evas_Object *__bt_create_list_view(bt_share_appdata_t *ad)
+{
+       Evas_Object *scroller = NULL;
+       Evas_Object *layout = NULL;
+
+       __bt_add_tr_data_genlist(ad->layout_main, ad);
+       scroller = __bt_create_scroller(ad->layout_main, ad->tr_genlist);
+       layout = elm_layout_add(ad->layout_main);
+
+       if (layout == NULL)
+               return NULL;
+
+       elm_layout_file_set(layout, EDJFILE, "list");
+       elm_object_part_content_set(layout, "content", scroller);
+       evas_object_show(layout);
+
+       return layout;
+}
+
+int _bt_create_transfer_list(bt_share_appdata_t *ad)
+{
+       Elm_Object_Item *navi_it = NULL;
+       Evas_Object *back_btn = NULL;
+       Evas_Object *toolbar = NULL;
+       Elm_Object_Item  *item = NULL;
+       char title[BT_GLOBALIZATION_STR_LENGTH] = { 0 };
+       int i = 0;
+
+       if (NULL == ad)
+               return -1;
+
+       __bt_create_bg(ad->win, "group_list");
+
+       ad->layout_main = elm_layout_add(ad->win);
+       elm_layout_theme_set(ad->layout_main, "layout", "application",
+                            "default");
+       evas_object_size_hint_weight_set(ad->layout_main,
+                               EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       elm_win_resize_object_add(ad->win, ad->layout_main);
+       elm_object_signal_emit(ad->layout_main,
+                               "elm,state,show,content", "elm");
+       evas_object_show(ad->layout_main);
+
+       ad->navi_fr = elm_naviframe_add(ad->layout_main);
+       elm_object_part_content_set(ad->layout_main, "elm.swallow.content",
+                              ad->navi_fr);
+       evas_object_show(ad->navi_fr);
+
+       back_btn = elm_button_add(ad->navi_fr);
+
+       ad->app_layout = __bt_create_list_view(ad);
+       if (ad->app_layout == NULL)
+               return -1;
+
+       if (ad->tr_type == BT_TR_OUTBOUND)
+               g_strlcpy(title, BT_STR_OUTBOUND_TR,
+                               BT_GLOBALIZATION_STR_LENGTH);
+       else
+               g_strlcpy(title, BT_STR_INBOUND_TR,
+                               BT_GLOBALIZATION_STR_LENGTH);
+
+       navi_it = elm_naviframe_item_push(ad->navi_fr,
+                                               title,
+                                              back_btn, NULL, ad->app_layout, NULL);
+
+       elm_object_style_set(back_btn, "naviframe/back_btn/default");
+       evas_object_smart_callback_add(back_btn, "clicked",
+                                      __bt_back_button_cb, (void *)ad);
+       elm_object_focus_allow_set(back_btn, EINA_FALSE);
+
+       toolbar = elm_toolbar_add(ad->navi_fr);
+       if (toolbar == NULL)
+               return -1;
+
+       elm_toolbar_shrink_mode_set(toolbar, ELM_TOOLBAR_SHRINK_EXPAND);
+       elm_object_style_set(toolbar, "default");
+
+       ad->toolbar_item = elm_toolbar_item_append(toolbar, NULL, BT_STR_CLR_LIST,
+                                               __bt_clear_list_btn_cb, ad);
+
+       /*Below code has been added to align the item as per UI specs.v1.6 */
+       for (i = 0; i < BT_NAVI_ITEM_ADj; i++) {
+               item = elm_toolbar_item_append(toolbar, NULL, NULL, NULL, NULL);
+               elm_object_item_disabled_set(item, EINA_TRUE);
+       }
+
+       elm_object_item_part_content_set(navi_it,
+                               "controlbar", toolbar);
+
+       return 0;
+}
+
diff --git a/src/bt-share-ui-view.h b/src/bt-share-ui-view.h
new file mode 100644 (file)
index 0000000..5635599
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2012  Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *   http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __DEF_BT_SHARE_UI_VIEW_H_
+#define __DEF_BT_SHARE_UI_VIEW_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "bt-share-ui-main.h"
+#include "bt-share-ui-ipc.h"
+
+#include "bluetooth-share-api.h"
+
+#define BT_GLOBALIZATION_STR_LENGTH    256
+#define BT_FILE_NAME_LEN_MAX 255
+#define BT_POPUP_TEXT_LEN \
+               (BT_GLOBALIZATION_STR_LENGTH + BT_FILE_NAME_LEN_MAX)
+#define BT_PERCENT_STR_LEN 5
+
+#define BT_MIME_TYPE_MAX_LEN   20
+#define BT_FILE_SIZE_STR 10
+#define BT_INFO_POPUP_TIMEOUT_IN_SEC 2
+
+Evas_Object *_bt_create_win(const char *name);
+void _bt_terminate_app(void);
+void _bt_create_progress_popup(bt_share_popup_data_t *data);
+int _bt_update_progress_popup(bt_share_appdata_t *ad, int transfer_id, const char *name, int percentage);
+Evas_Object *_bt_create_info_popup(bt_share_appdata_t *ad, const char *title, const char *text);
+Evas_Object *_bt_create_extinctive_info_popup(bt_share_appdata_t *ad, const char *title, const char *text);
+
+
+int _bt_destroy_progress_popup(bt_share_appdata_t *ad);
+
+void _bt_append_genlist_tr_data_item(bt_share_appdata_t *ad, bt_tr_data_t *info, int tr_type);
+void _bt_prepend_genlist_tr_data_item(bt_share_appdata_t *ad, bt_tr_data_t *info, int tr_type);
+int  _bt_create_transfer_list(bt_share_appdata_t *ad);
+int _bt_destroy_info_popup(bt_share_appdata_t *ad);
+
+#ifdef __cplusplus
+}
+#endif
+#endif                         /* __DEF_BT_SHARE_UI_VIEW_H_ */