From a84fa198b760ee58df060de4ebc33f94643c810c Mon Sep 17 00:00:00 2001 From: Taejin Woo Date: Thu, 5 Nov 2015 18:33:12 +0900 Subject: [PATCH 2/5] Initial Release Change-Id: Iae7cd1064cee40f1c39079adede19199a37af808 Signed-off-by: Taejin Woo --- AUTHORS | 2 + CMakeLists.txt | 92 ++ LICENSE | 75 ++ NOTICE | 1 + bluetooth-share-ui.manifest | 16 + data/bluetooth-share-ui.ini | 2 + data/edc/bt-share-layout.edc | 342 ++++++ data/edc/image_macro.edc | 55 + data/edc/images.edc | 9 + data/images/bluetooth_inbound_transfer_failed.png | Bin 0 -> 1484 bytes .../bluetooth_inbound_transfer_successed.png | Bin 0 -> 1229 bytes data/images/bluetooth_outbound_transfer_failed.png | Bin 0 -> 1479 bytes .../bluetooth_outbound_transfer_successed.png | Bin 0 -> 1237 bytes data/org.tizen.bluetooth-share-ui.efl | 34 + data/org.tizen.bluetooth-share-ui.png | Bin 0 -> 7620 bytes data/org.tizen.bluetooth-share-ui.xml | 10 + debian/changelog | 303 ++++++ debian/compat | 1 + debian/control | 19 + debian/docs | 0 debian/org.tizen.bluetooth-share-ui.install.in | 5 + debian/rules | 144 +++ packaging/org.tizen.bluetooth-share-ui.spec | 94 ++ src/applog.h | 95 ++ src/bt-share-ui-ipc.c | 854 +++++++++++++++ src/bt-share-ui-ipc.h | 86 ++ src/bt-share-ui-main.c | 376 +++++++ src/bt-share-ui-main.h | 144 +++ src/bt-share-ui-popup.c | 825 ++++++++++++++ src/bt-share-ui-popup.h | 68 ++ src/bt-share-ui-resource.h | 117 ++ src/bt-share-ui-view.c | 1125 ++++++++++++++++++++ src/bt-share-ui-view.h | 57 + src/bt-share-ui-widget.c | 192 ++++ src/bt-share-ui-widget.h | 56 + 35 files changed, 5199 insertions(+) create mode 100644 AUTHORS create mode 100644 CMakeLists.txt create mode 100644 LICENSE create mode 100644 NOTICE create mode 100644 bluetooth-share-ui.manifest create mode 100644 data/bluetooth-share-ui.ini create mode 100644 data/edc/bt-share-layout.edc create mode 100644 data/edc/image_macro.edc create mode 100644 data/edc/images.edc create mode 100644 data/images/bluetooth_inbound_transfer_failed.png create mode 100644 data/images/bluetooth_inbound_transfer_successed.png create mode 100644 data/images/bluetooth_outbound_transfer_failed.png create mode 100644 data/images/bluetooth_outbound_transfer_successed.png create mode 100644 data/org.tizen.bluetooth-share-ui.efl create mode 100644 data/org.tizen.bluetooth-share-ui.png create mode 100644 data/org.tizen.bluetooth-share-ui.xml create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/docs create mode 100644 debian/org.tizen.bluetooth-share-ui.install.in create mode 100755 debian/rules create mode 100755 packaging/org.tizen.bluetooth-share-ui.spec create mode 100644 src/applog.h create mode 100755 src/bt-share-ui-ipc.c create mode 100644 src/bt-share-ui-ipc.h create mode 100644 src/bt-share-ui-main.c create mode 100755 src/bt-share-ui-main.h create mode 100755 src/bt-share-ui-popup.c create mode 100644 src/bt-share-ui-popup.h create mode 100644 src/bt-share-ui-resource.h create mode 100755 src/bt-share-ui-view.c create mode 100644 src/bt-share-ui-view.h create mode 100644 src/bt-share-ui-widget.c create mode 100644 src/bt-share-ui-widget.h diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..b00a70d --- /dev/null +++ b/AUTHORS @@ -0,0 +1,2 @@ +Taesoo Jun +DoHyun Pyun diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..2af5d0e --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,92 @@ + + +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-widget.c + ${CMAKE_SOURCE_DIR}/src/bt-share-ui-popup.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 + edbus + edje + elementary + efl-extension + evas + gobject-2.0 + bluetooth-api + aul + capi-appfw-application + capi-network-bluetooth + bluetooth-share-api + notification) + +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} -fPIC") +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 -pie") + +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 /usr/share/packages) +INSTALL(FILES ${CMAKE_BINARY_DIR}/data/org.tizen.bluetooth-share-ui.efl DESTINATION /etc/smack/accesses.d) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/org.tizen.bluetooth-share-ui.png DESTINATION /usr/share/icons/default/small) + +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) + +ADD_CUSTOM_TARGET(images.edj + COMMAND edje_cc -id ${CMAKE_CURRENT_SOURCE_DIR}/data/images + ${CMAKE_CURRENT_SOURCE_DIR}/data/edc/images.edc ${CMAKE_CURRENT_BINARY_DIR}/images.edj + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/data/edc/images.edc +) +ADD_DEPENDENCIES(${PROJECT_NAME} images.edj) + +# install edj file +INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/bt-share-layout.edj DESTINATION ${PREFIX}/res/edje) +INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/images.edj DESTINATION ${PREFIX}/res/edje) + diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..7ccb5b5 --- /dev/null +++ b/LICENSE @@ -0,0 +1,75 @@ +Flora License + +Version 1.0, May, 2012 + +http://www.tizenopensource.org/license + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +"Tizen Certified Platform" shall mean a software platform that complies with the standards set forth in the Compatibility Definition Document and passes the Compatibility Test Suite as defined from time to time by the Tizen Technical Steering Group and certified by the Tizen Association or its designated agent. + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work solely as incorporated into a Tizen Certified Platform, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work solely as incorporated into a Tizen Certified Platform to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof pursuant to the copyright license above, in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + 1. You must give any other recipients of the Work or Derivative Works a copy of this License; and + + 2. You must cause any modified files to carry prominent notices stating that You changed the files; and + + 3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + 4. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Flora License to your work + +To apply the Flora License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Flora License, Version 1.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.tizenopensource.org/license + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/NOTICE b/NOTICE new file mode 100644 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/bluetooth-share-ui.manifest b/bluetooth-share-ui.manifest new file mode 100644 index 0000000..494fe7f --- /dev/null +++ b/bluetooth-share-ui.manifest @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/data/bluetooth-share-ui.ini b/data/bluetooth-share-ui.ini new file mode 100644 index 0000000..5abbace --- /dev/null +++ b/data/bluetooth-share-ui.ini @@ -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 index 0000000..944e215 --- /dev/null +++ b/data/edc/bt-share-layout.edc @@ -0,0 +1,342 @@ +#define BG_COLOR 8 8 8 255 +#define FONT_COLOR 250 250 250 255 +#define NOCONTENT_FONT_COLOR 110 111 118 255 + +#define IMG_H 252 +#define IMG_W 252 + +#define BT_POPUP_PAD_W 18 +#define BT_POPUP_PAD_H 18 +#define BT_POPUP_PROGRESSVIEW_CONTENT_MIN 320 0 +#define BT_POPUP_PROGRESSVIEW_PROGRESS_MIN 320 35 +#define BT_POPUP_PROGRESSVIEW_LABEL_MIN 320 28 + +#define POPUP_TEXT_FONT_SIZE1 30 +#define POPUP_TEXT_FONT_SIZE2 24 +//#define POPUP_PROGRESSBAR_2TEXT_VIEW_LAYOUT_BG_MIN_INC 0 168 +#define POPUP_PROGRESSBAR_2TEXT_VIEW_LAYOUT_BG_MIN_INC 0 175 +#define POPUP_PROGRESSBAR_VIEW_LAYOUT_PADDING_INC 15 27 +#define POPUP_PROGRESSBAR_VIEW_LAYOUT_TEXT_FONT_SIZE_INC 0 38 +#define POPUP_PROGRESSBAR_VIEW_LAYOUT_SUBTEXT_FONT_SIZE_INC 0 32 +#define POPUP_PROGRESSBAR_VIEW_LAYOUT_BG_INC 0 69 + +collections { + base_scale: 1.8; + group { + name: "popup_2text_progressbar_view_layout"; + styles { + style { + name: "popup_processing_style"; + base: "font=Tizen:style=Regular font_size="POPUP_TEXT_FONT_SIZE1" align=left color=#070707FF wrap=mixed text_class=tizen"; + // base: "font=Tizen:style=Regular align=left font_size="POPUP_TEXT_FONT_SIZE1" color=#FFFFFF color_class=T123 wrap=mixed ellipsis=1.0 text_class=T123"; + tag: "br" "\n"; + tag: "tab" "\t"; + } + style { + name: "popup_subtext_style"; + base: "font=Tizen:style=Regular font_size="POPUP_TEXT_FONT_SIZE2" align=left color=#070707FF wrap=mixed text_class=tizen"; + // base: "font=Tizen:style=Regular align=left font_size="POPUP_TEXT_FONT_SIZE2" color=#FFFFFF color_class=T024 wrap=mixed ellipsis=1.0 text_class=T024"; + tag: "br" "\n"; + tag: "tab" "\t"; + } + } + parts { + part { + name: "bg"; + type: SPACER; + scale: 1; + description { + state: "default" 0.0; + min: POPUP_PROGRESSBAR_2TEXT_VIEW_LAYOUT_BG_MIN_INC; + fixed: 1 0; + } + } + part { name: "pad_l_t"; + type: SPACER; + scale: 1; + description { + state: "default" 0.0; + min: POPUP_PROGRESSBAR_VIEW_LAYOUT_PADDING_INC; + max: POPUP_PROGRESSBAR_VIEW_LAYOUT_PADDING_INC; + fixed: 1 1; + rel2.relative: 0.0 0.0; + align: 0.0 0.0; + } + } + part { name: "pad_r_t"; + type: SPACER; + scale: 1; + description { + state: "default" 0.0; + min: POPUP_PROGRESSBAR_VIEW_LAYOUT_PADDING_INC; + max: POPUP_PROGRESSBAR_VIEW_LAYOUT_PADDING_INC; + fixed: 1 1; + rel1.relative: 1.0 1.0; + align: 1.0 1.0; + } + } + part { name: "elm.text.description"; + type: TEXTBLOCK; + scale: 1; + description { + state: "default" 0.0; + min: POPUP_PROGRESSBAR_VIEW_LAYOUT_TEXT_FONT_SIZE_INC; + fixed: 0 1; + rel1 { + relative: 1.0 1.0; + to: "pad_l_t"; + } + rel2 { + relative: 0.0 1.0; + to_x: "pad_r_t"; + to_y: "pad_l_t"; + } + text { + style: "popup_processing_style"; + min: 0 1; + } + align: 0.0 0.0; + } + } + part { name: "elm.subtext.description"; + type: TEXTBLOCK; + scale: 1; + description { + state: "default" 0.0; + min: POPUP_PROGRESSBAR_VIEW_LAYOUT_SUBTEXT_FONT_SIZE_INC; + fixed: 1 1; + rel1 { + relative: 1.0 1.0; + to_x: "pad_l_t"; + to_y: "elm.text.description"; + } + rel2 { + relative: 0.0 1.0; + to_x: "pad_r_t"; + to_y: "elm.text.description"; + } + text { + style: "popup_subtext_style"; + min: 0 1; + } + align: 0.0 0.0; + } + } + part { + name: "progressbar_bg"; + type: SPACER; + scale: 1; + description { + state: "default" 0.0; + fixed: 0 1; + min: POPUP_PROGRESSBAR_VIEW_LAYOUT_BG_INC; + rel1 { + relative: 1.0 1.0; + to_x: "pad_l_t"; + to_y: "elm.subtext.description"; + offset: 0 7; + + } + rel2 { + relative: 0.0 1.0; + to_x: "pad_r_t"; + to_y: "elm.subtext.description"; + } + align: 0.0 0.0; + } + } + part { + name: "progressbar"; + type: SWALLOW; + scale: 1; + description { + state: "default" 0.0; + fixed: 0 1; + rel1.to: "progressbar_bg"; + rel2.to: "progressbar_bg"; + } + } + } + } + + + group { name: "progress_popup"; + parts { + part { name: "pad_t"; + type: SPACER; + scale: 1; + description { state: "default" 0.0; + align: 0.5 0.0; + min: 0 BT_POPUP_PAD_H; + fixed: 0 1; + rel1 { + relative: 1.0 0.0;to_x: "pad_l"; + } + rel2 { + relative: 0.0 0.0;to_x: "pad_r"; + } + } + } + part { name: "pad_l"; + type: SPACER; + scale: 1; + description { state: "default" 0.0; + min: BT_POPUP_PAD_W 0; + max: BT_POPUP_PAD_W 0; + fixed: 1 0; + rel1 { + relative: 0.0 0.0; + } + rel2 { + relative: 0.0 1.0; + } + align: 0.0 0.0; + } + } + part { name: "pad_r"; + type: SPACER; + scale: 1; + description { state: "default" 0.0; + min: BT_POPUP_PAD_W 0; + max: BT_POPUP_PAD_W 0; + fixed: 1 0; + rel1 { + relative: 1.0 0.0; + } + rel2 { + relative: 1.0 1.0; + } + align: 1.0 0.0; + } + } + + part { name:"elm.swallow.content"; + type: SWALLOW; + scale: 1; + description { state: "default" 0.0; + min: BT_POPUP_PROGRESSVIEW_CONTENT_MIN; + align: 0.5 0.5; + fixed: 1 0; + rel1 { + relative: 1.0 1.0; + to_x: "pad_l"; + to_y: "pad_t"; + } + rel2 { + relative: 0.0 0.0; + to_x: "pad_r"; + to_y: "pad_pb"; + } + } + } + part { name: "elm.swallow.progressbar"; + type: SWALLOW; + scale: 1; + mouse_events: 1; + repeat_events: 1; + description { state: "default" 0.0; + align: 0.5 1.0; + min: BT_POPUP_PROGRESSVIEW_PROGRESS_MIN; + fixed: 1 1; + rel1 { + relative: 1.0 0.0; + to_x: "pad_l"; + to_y: "pad_pb"; + } + rel2 { + relative: 0.0 1.0; + to_x: "pad_r"; + to_y: "pad_pb"; + } + } + } + part { name: "pad_pb"; + type: SPACER; + scale: 1; + description { state: "default" 0.0; + align: 0.5 1.0; + min: 320 55; + fixed: 1 1; + rel1 { + relative: 1.0 1.0; + to_x: "pad_l"; + } + rel2 { + relative: 0.0 1.0; + to_x: "pad_r"; + } + } + } + } + } + + group { + name: "share_view"; + parts{ + part { name: "background"; + type: RECT; + mouse_events: 1; + scale: 1; + description { + state: "default" 0; + rel1 { relative: 0 0; } + rel2 { relative: 1 1; } + color: 20 107 147 255; + } + } + + part { name: "elm.swallow.content"; + type: SWALLOW; + scale: 1; + description { + state: "default" 0; + visible: 1; + rel1 { relative: 0 0; to:"background"; } + rel2 { relative: 1 1; to:"background"; } + } + } + + part { name: "elm.swallow.image"; + type: SWALLOW; + scale: 1; + description { + state: "default" 0; + visible: 1; + fixed: 1 1; + min: IMG_W IMG_H; + align: 0.5 0.5; + rel1 { relative: 0.5 0.5; to:"background"; } + rel2 { relative: 0.5 0.5; to:"background"; } + } + } + + part { name: "elm.text"; + type: TEXT; + scale: 1; + description { + state: "default" 0.0; + min: 0 20; + align: 0.5 0.5; + fixed: 0 1; + text { + text_class: "T0221"; + min: 0 0; + align: 0.5 0.5; + } + rel1 { + relative: 0 0; + to: "background"; + + } + + rel2 { + relative: 1 1; + to: "background"; + } + + } + } + } + } +} + diff --git a/data/edc/image_macro.edc b/data/edc/image_macro.edc new file mode 100644 index 0000000..668db1e --- /dev/null +++ b/data/edc/image_macro.edc @@ -0,0 +1,55 @@ +#define RESOURCE_IMAGE( FILE_NAME ) \ + group { \ + name: FILE_NAME; \ + images.image: FILE_NAME COMP; \ + parts { \ + part { name: "image"; \ + description { \ + state: "default" 0.0; \ + image.normal: FILE_NAME; \ + aspect: 1 1; \ + aspect_preference: BOTH; \ + } \ + } \ + } \ + } + +#define RESOURCE_IMAGE_TRANSFER( FILE_NAME ) \ + group { \ + name: FILE_NAME; \ + images.image: FILE_NAME COMP; \ + parts { \ + part { name: "image"; \ + description { \ + state: "default" 0.0; \ + image.normal: FILE_NAME; \ + aspect: 1 1; \ + aspect_preference: BOTH; \ + color: 0 0 0 255; \ + } \ + description { \ + state: "selected" 0.0; \ + image.normal: FILE_NAME; \ + aspect: 1 1; \ + aspect_preference: BOTH; \ + color: 0 0 0 255; \ + } \ + } \ + } \ + } + +#define RESOURCE_IMAGE_LOSSY( FILE_NAME ) \ + group { \ + name: FILE_NAME; \ + images.image: FILE_NAME LOSSY 85; \ + parts { \ + part { name: "image"; \ + description { \ + state: "default" 0.0; \ + image.normal: FILE_NAME; \ + aspect: 1 1; \ + aspect_preference: BOTH; \ + } \ + } \ + } \ + } diff --git a/data/edc/images.edc b/data/edc/images.edc new file mode 100644 index 0000000..89c0dfb --- /dev/null +++ b/data/edc/images.edc @@ -0,0 +1,9 @@ +#include "image_macro.edc" + +collections { + base_scale: 1.8; + RESOURCE_IMAGE_TRANSFER("bluetooth_inbound_transfer_failed.png"); + RESOURCE_IMAGE_TRANSFER("bluetooth_inbound_transfer_successed.png"); + RESOURCE_IMAGE_TRANSFER("bluetooth_outbound_transfer_failed.png"); + RESOURCE_IMAGE_TRANSFER("bluetooth_outbound_transfer_successed.png"); +} diff --git a/data/images/bluetooth_inbound_transfer_failed.png b/data/images/bluetooth_inbound_transfer_failed.png new file mode 100644 index 0000000000000000000000000000000000000000..303e9749299acb71ee322081f4c3da9eda279b48 GIT binary patch literal 1484 zcmeAS@N?(olHy`uVBq!ia0vp^dLYcf1|-9GYMTQo$r9IylHmNblJdl&R0hYC{G?O` z&)mfH)S%SFl*+=BsWuD@%u1Od5hW46K32*3xq68pHF_1f1wh>l3^w)^1&PVosU-?Y zsp*+{wo31J?^jaDOtDo8H}y5}EpSfF$n>ZxN)4{^3rViZPPR-@vbR&PsjvbXkegbP zs8ErclUHn2VXFi-*9yo63F|81#=KlDb#X~hD#E>34K5C;EJ)Q4 zN-fSWElLJPT$(b-ssbzLqSVBa{GyQj{2W*)24v)y=b2Bw} zF)=lQ>2=9ZF3nBND}m`vLFhHXsTY(KatnYqyQCInmZhe+73JqDfW2&$iQ6rPIL(9V zO~LIJBb<8mfsWA!MJ!T8!-RmT2gHOYTObFX@Kf`Esl5o8tj|o}5XZp4xO!uW$mB!ERts?V zr_GjGQ6Zoh`JY?=gG8G8?zBy62K;pfm7kxzwLg5@(k$n8*$T$uUd(fWu}E@yV@cPiI2Z<+Yq%bIsV*`bF56?;F2a zYnYxoSIO>Hd!*0QYh_C9k!MmXk4<+t<{Zp#PkIc_kp(GmOnaQFmI9if!^4=d79TYf3WzW@Mu^KHdk2KSu)pKOBL(&wzYRycQ? zgXMSD|Jy#CNp1SQt<~^%o%d2P>1A{HC+%CZXv;R0kLMk^*5_#DX`h_-SW$YAd7zyngIG z7sh{llFQLK`%F{&8q#W_X5`+R9oxP(_0D0YK|V*==5my)>ObV$du8>R=|Z1h z{(G@1m!2+{v*Fi~Pu7w89Mms8A%4*VfhnS|>t`k{%ByVB5xscq wAlD40K(oWoA27tQ{!F}Ib8=PMekLAo8F>JQ#l02Z$dp00i_>zopr00d4il3^w)^1&PVosU-?Y zsp*+{wo31J?^jaDOtDo8H}y5}EpSfF$n>ZxN)4{^3rViZPPR-@vbR&PsjvbXkegbP zs8ErclUHn2VXFi-*9yo63F|81#=KlDb#X~hD#E>34K5C;EJ)Q4 zN-fSWElLJPT$(b-ssbzLqSVBa{GyQj{2W*)24v)yr*nFEgLTg9c{4 z9bua9r+M8lwOy?HR;VUr<@(YeT}A6IzCTiH&0HVwjAylz{*L_Rdgs^=`~7#?UKu{| z!?g>!_xZU0O#IAkb?M%cX`d$B@AZ)2)Ra^gxs{vlT)E0Wc4^(E&Y5LF&m``07Re_LJeIpdNKIwAqz{;)cHEL^a4zlQaxg}%kOOG*H-J8BEYvmH%L;6!V`)6|m2=856efQ6Ax!AV+mNLfaA9^pYdvJ8t{?E^Z m>W$m__j7~1d*E{ww*kYRy;A#EyGJX63K&mUKbLh*2~7YL^{k2j literal 0 HcmV?d00001 diff --git a/data/images/bluetooth_outbound_transfer_failed.png b/data/images/bluetooth_outbound_transfer_failed.png new file mode 100644 index 0000000000000000000000000000000000000000..a668c13529da6ac5a63b0269c4ccc9882bdb00fb GIT binary patch literal 1479 zcmeAS@N?(olHy`uVBq!ia0vp^dLYcf1|-9GYMTQo$r9IylHmNblJdl&R0hYC{G?O` z&)mfH)S%SFl*+=BsWuD@%u1Od5hW46K32*3xq68pHF_1f1wh>l3^w)^1&PVosU-?Y zsp*+{wo31J?^jaDOtDo8H}y5}EpSfF$n>ZxN)4{^3rViZPPR-@vbR&PsjvbXkegbP zs8ErclUHn2VXFi-*9yo63F|81#=KlDb#X~hD#E>34K5C;EJ)Q4 zN-fSWElLJPT$(b-ssbzLqSVBa{GyQj{2W*)24v)y>2=9ZF3nBND}m`vLFhHdsTY(KatnYqyQCInmZhe+73JqDfW2&$iQ6qEIL(9V zO~LIJQ=EGBfsWA!MJ!T8!-RmT2gHOYTObFX@Kf`Esl5o8taE>VD`j9{vi5Xw45_&F zX69*amq3~0ce8bFB=}F+6d-mfWnqg@Z_b`$ZZ{*Ubajs1Pe@J8OifNz^_4uC-0G5& zKFLV#tO18{%>Cf!*FL`9_rxyk)t^_B&+UBv=UsYV_4)VbVq7n8nUut{b%}>_mv^D2 z-qEEy)E}8X;Ca)SrGHdZTw8teJvQDwwH#FryC#J1ndY%MgSBvdSX`;6mE#iI>EX6h zzJ>g=zi#pSg7|`q4=c(vOGQt0rT;hhwlko7s@DX;TmB2Y#1z2BicEhLbZ60@?(_Gy zhlxsmX%;PD{q%r!PIKyo%xbf+Pq8T+OB{qsX7psTvCpc_X|mc}ELqyu=wA0pZn}Mh z{E4h{kNH~WcC1#=_1RMrxJz^o*UtO8Ek~2jEWhWsXOhZ^9V)U+%Wa;UcQAZQu{wXd z>d66%`No=GjyDU*3l`Z;NDhv%JAVA--={~GzSV#9zc+7Q`P?u4(kJ*Q?~|Ch`Ni@I z(eu^LzdkEueUzVNdZP5n^dId7we^xR=ReDy=``uCE}WAU;L;bX<#GQ{{)r_QHootP zSNm+TpL>F2dCJ!py&f~wcJp>SuNM8TwaufNX$|LFNdeJY-U@EdRGK0_Dt5muIQOJ2 z_2`G-8RFZtf5ruH`L!^a9QZB9lNV9DT1NG}?*1YzyM51d7bP0l+XkK-&rpL literal 0 HcmV?d00001 diff --git a/data/images/bluetooth_outbound_transfer_successed.png b/data/images/bluetooth_outbound_transfer_successed.png new file mode 100644 index 0000000000000000000000000000000000000000..157f7bb7bd3cd40b07186e04131971a613f88a5b GIT binary patch literal 1237 zcmeAS@N?(olHy`uVBq!ia0vp^dLYcf1|-9GYMTQo$r9IylHmNblJdl&R0hYC{G?O` z&)mfH)S%SFl*+=BsWuD@%u1Od5hW46K32*3xq68pHF_1f1wh>l3^w)^1&PVosU-?Y zsp*+{wo31J?^jaDOtDo8H}y5}EpSfF$n>ZxN)4{^3rViZPPR-@vbR&PsjvbXkegbP zs8ErclUHn2VXFi-*9yo63F|81#=KlDb#X~hD#E>34K5C;EJ)Q4 zN-fSWElLJPT$(b-ssbzLqSVBa{GyQj{2W*)24v)y*A8>2=9ZF3nBND}m`vLFhHcsTY(KatnYqyQCInmZhe+73JqDfW2&$iQ6p(IL(9V zO~LIJL!5f`fsWA!MJ!T8!-RmT2gHOYTObFX@Kf`Esl5o8tTQyP{9<5W^z?Lb45_&F z=H|hyW(NVb1m7y2FH`op^qu7XlBTzEuS&bj<#g^Znl?{ne35vuH-x#e!O8Q+nL|^$ zdLCu9h5lf#iztn?n|3smr`OO?K3m|+76x{if&+}Jh)lxLtVdOnHrkS3l-H^cT$tt+{Plx4sQFeP#K*g zY%CTJ8kqSk9*9nTdTY7e!TS<_d~a@%NO$zKocO26@x4~-8BNV}y_oCgCKVa}|El_R za-L7I`OX yIQQbd2ld%@kIz0`dQw8MPMitoyoTGmI1Ly$8--^5SNBx_6*Qi%elF{r5}E+T54HaQ literal 0 HcmV?d00001 diff --git a/data/org.tizen.bluetooth-share-ui.efl b/data/org.tizen.bluetooth-share-ui.efl new file mode 100644 index 0000000..d20f919 --- /dev/null +++ b/data/org.tizen.bluetooth-share-ui.efl @@ -0,0 +1,34 @@ +org.tizen.app-tray org.tizen.bluetooth-share-ui r-x--- ------ +org.tizen.quickpanel org.tizen.bluetooth-share-ui r-x--- ------ +org.tizen.indicator org.tizen.bluetooth-share-ui rwx--- ------ +org.tizen.lockscreen org.tizen.bluetooth-share-ui r-x--- ------ +org.tizen.bluetooth-share-ui org.tizen.indicator rw---- ------ +org.tizen.bluetooth-share-ui bt_share::db rw---- ------ +org.tizen.bluetooth-share-ui ail::db rw---- ------ +org.tizen.bluetooth-share-ui isf r----- ------ +org.tizen.bluetooth-share-ui system::use_internet r----- ------ +org.tizen.bluetooth-share-ui system::ext_storage rwxat- ------ +org.tizen.bluetooth-share-ui xorg rw---- ------ +org.tizen.bluetooth-share-ui sound_server rw---- ------ +org.tizen.bluetooth-share-ui dbus rw---- ------ +org.tizen.bluetooth-share-ui app-svc::db rw---- ------ +org.tizen.bluetooth-share-ui ug_bluetooth r-x--- ------ +org.tizen.bluetooth-share-ui stest-service -w---- ------ +org.tizen.bluetooth-share-ui aul::launch --x--- ------ +org.tizen.bluetooth-share-ui notification::db rw---- ------ +org.tizen.bluetooth-share-ui data-provider-master::notification -w---- ------ +org.tizen.bluetooth-share-ui data-provider-master::notification.client -w---- ------ +stest-service org.tizen.bluetooth-share-ui r-x--- ------ +org.tizen.bluetooth-share-ui system::homedir rwxat- ------ +org.tizen.bluetooth-share-ui system::media rwxat- ------ +org.tizen.bluetooth-share-ui system::share rwxat- ------ +org.tizen.bluetooth-share-ui pulseaudio rwxat- ------ +e17 org.tizen.bluetooth-share-ui -w---- ------ +org.tizen.bluetooth-share-ui device::app_logging -w---- ------ +org.tizen.bluetooth-share-ui sys-assert::core rwxat- ------ +org.tizen.bluetooth-share-ui privacy-manager::db r----l ------ +org.tizen.bluetooth-share-ui pkgmgr::db r----l ------ +org.tizen.bluetooth-share-ui tizen::vconf::public r----- ------ +org.tizen.bluetooth-share-ui tizen::vconf::public::r::platform::rw rw---- ------ + +org.tizen.bluetooth-share-ui ecore::lock rwxat- ------ diff --git a/data/org.tizen.bluetooth-share-ui.png b/data/org.tizen.bluetooth-share-ui.png new file mode 100644 index 0000000000000000000000000000000000000000..34dd0c1f83f9ff3a570a871d3a10be2baa136aeb GIT binary patch literal 7620 zcmV;#9XsNQP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB zfoHYnBQIkwkyowPu(zdms`p{<7e4kra-ZWq<2*OsGTvEV%s0Td$hXT+!*8Bnh2KMe zBmZRodjHV?r+_5^X9J0WL4jKW`}lf%A-|44I@@LTvf1rHjG(ze6+w@Jt%Bvjts!X0 z?2xS?_ve_-kiKB_KiJlZ$9G`c^=E@oNG)mWWaNo-3TIW8)$Hg0Ub-~8?KhvJ>$ z3*&nim@mj(aCxE5!t{lw7O5^0EIO7zOo&c6l<+|iDySBWCGrz@C5{St!X3hAA}`T4 z(TLbXTq+(;@<=L8dXnssyft|w#WSTW<++3>sgS%(4NTpeI-VAqb|7ssJvzNHgOZVu zaYCvgO_R1~>SyL=cFU|~g|hy|Zi}}s9+d~lYqOB71z9Z$wnC=pR9Yz4DhIM>Wmjgu z&56o6maCpC&F##y%G;1PobR9i?GnNg;gYtchD%p19a!eQtZF&3JaKv33gZ<8D~47E ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i& z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01 z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F} z000v2Nkl$O%oZ98H2{a z+yq!e6d|wxfkINEUK05n!hT68b_hGS&dm39W;(;wa=>ywpbDP!O(X(|SH(@0_15Vmo9N7>mSAjhpK9qCrZOGiUi{_g4s2&yXrQV!(!wZ7?^!1D+Fmb1UO2qHG&LNu4cF)~|+OW}`iF37*Xy`SS}(48L$+w#7mn&<@!A^?PK zi9JW62;1_$Yu5Q5NGKz(Uh6A}N?Nt|NJKPQ68|5}qjHSMHXNO^@4Y)Ce@%xOdDR-< zNCK@asg0%#L`D*?P0fXM-*Bw>S~lED>Va&sBo5R@1%aL&x2AMthkzVYSdyj+_ENdu z@*E4NZgfr;68|wc9SUc-_wpXtbNe8S%Q1iyOMbOs2W5WCqYC!Yn8K2@vj)44k6wg*{`=oydb~CW$yMyrLHQ6vkYQd~%v~W0J<)>-l`LhD@>b1V9^%3Xh{k16$ zwuxG09%H~y$7W;q_XlH4Pd%lVw7=FwUD%#_^;+N5GXioI<7l(o|>y80F?ooNzk%*UA$Ew-6~&P9klx#3)$!7h$=Y4{o{IK=l2F-RCg^U zzj-WVqdI8!ajX2%b^&?i>e9TBDeo+AIQLbY;n^;H@cqGf_^Vk^Q_y$H8!UuOdB>Hj zOY=?(q$1eDqhZ@Ho%18;Ryf1L@xAcRTL)lxrkd2>G9ALvux%)UEo>9Wacg|Nf>C*M zW#hTorES}Wl�IqkDU>>-Hg7Fs2(s5(T}=MjOGXym{OjU$3}8DjW;zBDTkt=O!C> zmDOQiSv4Y&NUO&+!SL9`9Blh;K8AKpP84rTLS4l62!;n+1#-f=gPx%2Oh0svvJn9G zRR=NtncaBq-4Zl5HpXS=m_AI%owNqw=Upg#tri-caAB_--2GTo)H z+fD(}v}u|@Y$p~ANtk(2I+jiBiGk^Ahj9dBAl(J&O~*Tj30FN^jKZy@ZL;&qerecq z#}M2*Dg#VX!rE3Jwh^^y+DSl;T~(4DFr6#vBX;6YB#Frb+*o~MKg=1^14VZZ!M&Ge zfRXF~k^ndZsVd0hfnW9Do;Rvcu&M|L4%NhEr$-Z5@y%Rp`p^F8>*Wb)pFd(FXgXJn zT~(6Z0;B+@1fx<(WUuaJFg!o`i*U=Oa;*4fE;bkBBQH%kD-6Fl&Ols&)ZLKYbi7e% zWBjj+@XGG$HhtTK{4UrsV*ubd9d4hLKrkv50ZeHD(vmbOY&(fVQ94+BRTeVcr^a+ix02BZSo6cno z5hr0X6?1GbGXm2zp=qa1;nH-0l{e(!+e0&O`)d`bYI061TC{-prQ?hUKe((rmVCW0 z(sU6=2O)$)A?zrr!R*&70MZlE)`p0Ku<3jS0F?2o4h#%gvUenrqAdYGd$STM*_b@4 zH@sdi7-OfL_KiUq*!M#(=DbmX!oB{O#MAEX4GhXq@Y@^uVSN8CaZk4_3w8cRJoa`e zR_?5WWq3fkf<#0`5lbRu$zJ1E9T>=^q$?~Zu^|s}j#^SM>%}tMzP1QuhmXQETbJX~ z4F$iyDIYI?Cl5W{yj_k`fbg?_&%~a)FOCZ$5g`~1;+@^)xN7+>{OZF7nC>)4-2enn zTqxv7NJ&?4%aJ2mx=W%q#z3kL=}E)Jk}$4X@ge^F!9fIrLBz`uO&-<_`+j&arVZ@^ z7Uvwn1%_v8*nZn!EV(upF12+z)ih01Rv*RO4SR9pn*At=YLK2ZkfsBiBhl@(965rG z{>{FPRRL>CbubBP4-uH-fSD1na0mq>(y{1&Fcrt44BL?@$&7k}Bt&xrko-2;j)d({hDg8muAlqEwkA`R>TF@Bf(DbY zVb@{Q`hysq28pwfq3dzc%nIy07)Lj zX_=;Vf^i1YG<5f>c<}oE?E(=1x~J)w{FOYsUtf*@34rkvqV?39LlO#zngrmnJL3s3 zBHS_}6U)Cf5Luox%eUNpRURf?oQ+u<_hV~$AgLpBTP9+?pot40!a)fSQct(#cm!T4 z7>f0`3_D{Gk6V7G3tR3SiDlRIgTayVHh>5m1VM->0QnV$OfyA{WFXveSvG!g{Q#sJ z9nY&U2Fw}P7uOBxhFKdv!}deLl(JJ{3}EEvoZ+Y@SW50*|8y0bZX1r3Q-;I^(XuQY ztE-PIgE>y?6Ne!^JlJ;6rFiVxT<9rerzRLU!x63k6-JVQ6d=sKq9^wKNz_O)L_^CLkNe%amFr&1rzeH>qnR3-+H=I0;C}r6yOjS45fM! zfxIZoz_z<-aH%3L3lG=S;-`Q32;chc9_(*uJ(Ky_ksu~4-HxSi?1SIm5SN`7 z_w-`N?91@*gubyA7)b;&_GB(f6@_DO+hXe3naY6$SNFvOU(bi8@HSca&YnY<|I()@ zYeForR^s?L#t~LsSolr_-Yh9?x;r)8RFpN`u7iU;FDIb%EXJO|0k5OC`PFm!l zaO~v@qa7fLL~f(9UD!E$G#f>agK z<;Fj&O-xv}1JAs@4-E|sakGe{a=KvG+{^L6)j1GIY&(x{3Zor-=bX!ZAgW53pL86& zdB;dxlGCMakzw0@T)E^utlwJ?$M8UEMr?M{R_|!uO7s9pL!pwx3>NC@R+;|ym`mS<}6~z+uB7J z5DYt7vWU81Zy6#{%CW@UKNg+Dj^iRj;pR^;?icUjmCqU>T^>kPkFgM~gez_Mq!Z5} zE1W1*EF%(fHKR+qw|3-)G97Eu%I)ez`e4k#T}frxXwdoX}!-r9#B zUONl`P1wSu5i% z6_9ev?)hVDT7U!qL**|3Vq#rW#~0rd7lo>Vz95|MTwp~NzF z0EqD~a@Or$NzqDo;v8Kxj{muNIBx%Hzxb-PZR1#-AOHPwF@CqL3XZ0?DD$nmlQWEw zW21GwF4+2(j(B2vG=JgdrIKiFd0o=0yR->p26s@u{Kiv`d{kD4tS$!nc5}!5bW>9k zwtZ5CAFtbk{eJt41Q_QDyTX3mT;Pl?^F13_C_0FVk8j5Ee^kQKTy2L|9nn$Kb%3yH--FkjRO#vzEz7HmCxQ`s zmL{0X?37wP?VtBMj)VG!Mm+UeF`oXL52ny!;Z>6IH=4r12w|_zpE$*Te|bmoLlY`M zw7gfE-ifSi9}BmCT#m0j`d2);=^&!20jX+9Vd3$u8Iu*oKc84}ib&Eb@&b#aj+~z5 zQTrVWMmvF&vP~BH8yfNSUyAY6J0*y6H7UOE%a-NUL6DWY;EP&~C|cXOf6=6%!f>xg zB!^CcGg8}QW2AL5!PHe=`K;n)mCC?|^@N!oI|xkyBvZJQ~srH6S<} zTl&QH#T^0?0P^O)Iu*bR$AVGO6ixnLd~&UxuaoMTxqVvE|&2-uTgnO+@ULvf_U z+={1fT5-mH{cOt~=Kgr&WX{=I+mYU?`p|g|Vop~#6v2a1(u|5?@# zr;CW#i;Q7tMQspto|Q~v49Ly&f(V~7MpMe3zWL*`{;rOeh8;L>qt~)&Ib)dB6t&s0 zK;*mtF)Pi0M^}glg{s14mn@yyd8J`b>gqrG2Gq$wsnOiE8HgKilr5AmEu+HEN zw=l*E7{_=Jl!)n|A!H_OhGeJ$>23{%CIAMTByAzWI!XA$q2ClFeFRMTYgl^UwI)m9 zd@>j&abPSM%Q=3`vL(W%ji~Lwb|f50E$rotL2w2|aOjGFOH-hpxMYy1N&@eL@U|`G zD~DIkJeJZ>s + + + Injun Yang + Bluetooth Share UI application + + org.tizen.bluetooth-share-ui.png + + + diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..9ce8633 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,303 @@ +bluetooth-share-ui (0.0.38) unstable; urgency=low + + * Tagging and package upload + * Git: magnolia/apps/connectivity/bluetooth-share-ui + * Tag: bluetooth-share-ui_0.0.38 + + -- InJun Yang Fri, 22 Feb 2013 19:20:37 +0900 + +bluetooth-share-ui (0.0.37) unstable; urgency=low + + * Tagging and package upload + * Git: magnolia/apps/connectivity/bluetooth-share-ui + * Tag: bluetooth-share-ui_0.0.37 + + -- DoHyun Pyun Tue, 05 Feb 2013 19:15:09 +0900 + +bluetooth-share-ui (0.0.36) unstable; urgency=low + + * Tagging and package upload + * Git: magnolia/apps/connectivity/bluetooth-share-ui + * Tag: bluetooth-share-ui_0.0.36 + + -- InJun Yang Fri, 01 Feb 2013 20:19:22 +0900 + +bluetooth-share-ui (0.0.35) unstable; urgency=low + + * Tagging and package upload + * Git: magnolia/apps/connectivity/bluetooth-share-ui + * Tag: bluetooth-share-ui_0.0.35 + + -- DoHyun Pyun Thu, 24 Jan 2013 11:37:34 +0900 + +bluetooth-share-ui (0.0.34) unstable; urgency=low + + * Tagging and package upload + * Git: magnolia/apps/connectivity/bluetooth-share-ui + * Tag: bluetooth-share-ui_0.0.34 + + -- Jaganath K Tue, 15 Jan 2013 18:17:28 +0530 + +bluetooth-share-ui (0.0.33) unstable; urgency=low + + * Tagging and package upload + * Git: magnolia/apps/connectivity/bluetooth-share-ui + * Tag: bluetooth-share-ui_0.0.33 + + -- Sunil Kumar Behera Wed, 09 Jan 2013 19:49:19 +0900 + +bluetooth-share-ui (0.0.32) unstable; urgency=low + + * Tagging and package upload + * Git: magnolia/apps/connectivity/bluetooth-share-ui + * Tag: bluetooth-share-ui_0.0.32 + + -- Sunil Kumar Behera Wed, 26 Dec 2012 15:15:45 +0530 + +bluetooth-share-ui (0.0.31) unstable; urgency=low + + * Tagging and package upload + * Git: magnolia/apps/connectivity/bluetooth-share-ui + * Tag: bluetooth-share-ui_0.0.31 + + -- Sunil Kumar Behera Thu, 20 Dec 2012 16:50:02 +0530 + +bluetooth-share-ui (0.0.30) unstable; urgency=low + + * Tagging and package upload + * Git: magnolia/apps/connectivity/bluetooth-share-ui + * Tag: bluetooth-share-ui_0.0.30 + + -- Chethan T N Thu, 20 Dec 2012 17:41:51 +0900 + +bluetooth-share-ui (0.0.29) unstable; urgency=low + + * Display the clear button + * Git: magnolia/apps/connectivity/bluetooth-share-ui + * Tag: bluetooth-share-ui_0.0.29 + + -- DoHyun Pyun Thu, 15 Nov 2012 15:26:52 +0900 + +bluetooth-share-ui (0.0.28) unstable; urgency=low + + * Upload package for prevent defect fix + * Git: magnolia/apps/connectivity/bluetooth-share-ui + * Tag: bluetooth-share-ui_0.0.28 + + -- Chethan T N Fri, 09 Nov 2012 11:39:45 +0900 + +bluetooth-share-ui (0.0.27) unstable; urgency=low + + * Applied screen rotaion and prevent defect fix + * Git: magnolia/apps/connectivity/bluetooth-share-ui + * Tag: bluetooth-share-ui_0.0.27 + + -- Chethan T N Thu, 08 Nov 2012 17:44:59 +0900 + +bluetooth-share-ui (0.0.26) unstable; urgency=low + + * Add incicator window + * Git: magnolia/apps/connectivity/bluetooth-share-ui + * Tag: bluetooth-share-ui_0.0.26 + + -- InJun Yang Wed, 31 Oct 2012 15:01:01 +0900 + +bluetooth-share-ui (0.0.25) unstable; urgency=low + + * Fix : Retry file send crash issue + * Git: magnolia/apps/connectivity/bluetooth-share-ui + * Tag: bluetooth-share-ui_0.0.25 + + -- Chethan T N Fri, 26 Oct 2012 17:44:55 +0530 + +bluetooth-share-ui (0.0.24) unstable; urgency=low + + * Change directory path + * Git: magnolia/apps/connectivity/bluetooth-share-ui + * Tag: bluetooth-share-ui_0.0.24 + + -- InJun Yang Thu, 25 Oct 2012 13:58:16 +0900 + +bluetooth-share-ui (0.0.23) unstable; urgency=low + + * Upload the package + * Git: magnolia/apps/connectivity/bluetooth-share-ui + * Tag: bluetooth-share-ui_0.0.23 + + -- InJun Yang Fri, 12 Oct 2012 21:51:21 +0900 + +bluetooth-share-ui (0.0.22) unstable; urgency=low + + * Copy the license file in target + * Git: magnolia/apps/connectivity/bluetooth-share-ui + * Tag: bluetooth-share-ui_0.0.22 + + -- DoHyun Pyun Thu, 11 Oct 2012 15:52:05 +0900 + +bluetooth-share-ui (0.0.21) unstable; urgency=low + + * Apply smack manifest file + * Git: magnolia/apps/connectivity/bluetooth-share-ui + * Tag: bluetooth-share-ui_0.0.21 + + -- Sangki Park Mon, 24 Sep 2012 13:58:42 +0900 + +bluetooth-share-ui (0.0.20) unstable; urgency=low + + * Upload the package + * Git: magnolia/apps/connectivity/bluetooth-share-ui + * Tag: bluetooth-share-ui_0.0.20 + + -- InJun Yang Thu, 23 Aug 2012 09:37:13 +0900 + +bluetooth-share-ui (0.0.19) unstable; urgency=low + + * Upload the package + * Git: slp/pkgs/b/bluetooth-share-ui + * Tag: bluetooth-share-ui_0.0.19 + + -- InJun Yang Fri, 10 Aug 2012 12:26:41 +0900 + +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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 Mon, 10 Oct 2011 16:17:49 +0900 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..7ed6ff8 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +5 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..6264d8c --- /dev/null +++ b/debian/control @@ -0,0 +1,19 @@ +Source: bluetooth-share-ui +Section: main +Priority: extra +Maintainer: Hocheol Seo , DoHyun Pyun , InJun Yang , Chanyeol Park +Uploaders: Sunil Behera , Syam Sidhardhan +Build-Depends: debhelper (>= 5),libevas-dev, libecore-dev, libelm-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 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 index 0000000..a20de48 --- /dev/null +++ b/debian/org.tizen.bluetooth-share-ui.install.in @@ -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 index 0000000..c7f02cf --- /dev/null +++ b/debian/rules @@ -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 100755 index 0000000..d56c10f --- /dev/null +++ b/packaging/org.tizen.bluetooth-share-ui.spec @@ -0,0 +1,94 @@ +%define _usrdir /usr +%define _appdir %{_usrdir}/apps + +Name: org.tizen.bluetooth-share-ui +Summary: bluetooth share UI application +Version: 0.0.88 +Release: 1 +Group: TO_BE_FILLED +License: Flora-1.1 +Source0: %{name}-%{version}.tar.gz + +%if "%{?tizen_profile_name}" != "mobile" +ExcludeArch: %{arm} %ix86 x86_64 +%endif + +Requires(post): sys-assert +BuildRequires: pkgconfig(dbus-glib-1) +BuildRequires: pkgconfig(dlog) +BuildRequires: pkgconfig(vconf) +BuildRequires: pkgconfig(appcore-efl) +BuildRequires: pkgconfig(bundle) +BuildRequires: pkgconfig(ecore) +BuildRequires: pkgconfig(edbus) +BuildRequires: pkgconfig(edje) +BuildRequires: pkgconfig(elementary) +BuildRequires: pkgconfig(efl-extension) +BuildRequires: pkgconfig(evas) +BuildRequires: pkgconfig(bluetooth-api) +BuildRequires: pkgconfig(aul) +BuildRequires: pkgconfig(capi-appfw-application) +BuildRequires: pkgconfig(capi-network-bluetooth) +BuildRequires: pkgconfig(bluetooth-share-api) +BuildRequires: pkgconfig(notification) + +BuildRequires: cmake +BuildRequires: edje-tools +BuildRequires: gettext-devel +BuildRequires: hash-signer + +%define PKG_NAME org.tizen.bluetooth-share-ui + +%description +bluetooth share UI application + + +%prep +%setup -q + +%build +export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE" +export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE" +export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE" + +export CFLAGS="$CFLAGS -DTIZEN_EFL_THEME_2.2" +export CFLAGS+=" -fpie -fvisibility=hidden" +export LDFLAGS+=" -Wl,--rpath=/usr/lib -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs -pie" + +cmake . -DCMAKE_INSTALL_PREFIX=%{_appdir}/org.tizen.bluetooth-share-ui +make %{?jobs:-j%jobs} + + +%install +rm -rf %{buildroot} +%make_install +PKG_ID=org.tizen.bluetooth-share-ui +%define tizen_sign 1 +%define tizen_sign_base /usr/apps/${PKG_ID} +%define tizen_sign_level platform +%define tizen_author_sign 1 +%define tizen_dist_sign 1 + +install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/org.tizen.bluetooth-share-ui + +%post + +%postun + + +#%files +#%defattr(-,root,root,-) + +%files +%manifest bluetooth-share-ui.manifest +/etc/smack/accesses.d/org.tizen.bluetooth-share-ui.efl +%defattr(-,root,root,-) +%{_appdir}/org.tizen.bluetooth-share-ui/res/edje/bt-share-layout.edj +%{_appdir}/org.tizen.bluetooth-share-ui/res/edje/images.edj +%{_appdir}/org.tizen.bluetooth-share-ui/bin/bluetooth-share-ui +%{_appdir}/org.tizen.bluetooth-share-ui/author-signature.xml +%{_appdir}/org.tizen.bluetooth-share-ui/signature1.xml +%{_usrdir}/share/icons/default/small/org.tizen.bluetooth-share-ui.png +%{_usrdir}/share/packages/org.tizen.bluetooth-share-ui.xml +%{_datadir}/license/org.tizen.bluetooth-share-ui + diff --git a/src/applog.h b/src/applog.h new file mode 100644 index 0000000..2acc160 --- /dev/null +++ b/src/applog.h @@ -0,0 +1,95 @@ +/* +* bluetooth-share-ui +* +* Copyright 2012 Samsung Electronics Co., Ltd +* +* Contact: Hocheol Seo +* GirishAshok Joshi +* DoHyun Pyun +* +* 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 + +/* + * 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. + * + */ + +#include +#include + +#undef LOG_TAG +#define LOG_TAG "BLUETOOTH_SHARE_UI" + +#define INFO(fmt, arg...) \ + SLOGI(fmt, ##arg) + +#define ERR(fmt, arg...) \ + SLOGE(fmt, ##arg) + +#define DBG(fmt, arg...) \ + SLOGD(fmt, ##arg) + +#define DBG_SECURE(fmt, args...) SECURE_SLOGD(fmt, ##args) +#define ERR_SECURE(fmt, args...) SECURE_SLOGE(fmt, ##args) +#define INFO_SECURE(fmt, args...) SECURE_SLOGI(fmt, ##args) + +#define FN_START DBG("[ENTER FUNC]"); +#define FN_END DBG("[EXIT FUNC]"); + +#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) + +#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 100755 index 0000000..28e2864 --- /dev/null +++ b/src/bt-share-ui-ipc.c @@ -0,0 +1,854 @@ +/* +* bluetooth-share-ui +* +* Copyright 2012 Samsung Electronics Co., Ltd +* +* Contact: Hocheol Seo +* GirishAshok Joshi +* DoHyun Pyun +* +* 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 +#include +#include +#include +#include +#include +#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-popup.h" +#include "bt-share-ui-resource.h" + + +#define BT_ADDRESS_LENGTH_MAX 6 +#define DBUS_CORE_APPS_PATH "/Org/Tizen/Coreapps/home/raise" +#define DBUS_CORE_APPS_INTERFACE "org.tizen.coreapps.home.raise" +#define DBUS_CORE_APPS_MEMBER "homeraise" + + +static void __handle_opp_client_signal(void *data, DBusMessage *msg) +{ + bluetooth_event_param_t event_info = { 0, }; + int result = BLUETOOTH_ERROR_NONE; + const char *member = dbus_message_get_member(msg); + + retm_if(data == NULL, "Invalid argument: data is NULL\n"); + retm_if(msg == NULL, "Invalid argument: msg is NULL\n"); + + if (dbus_message_get_type(msg) != DBUS_MESSAGE_TYPE_SIGNAL) + return; + + if (!dbus_message_has_interface(msg, BT_EVENT_SERVICE)) + return; + + if (!dbus_message_has_path(msg, BT_OPP_CLIENT_PATH)) + return; + + ret_if(member == NULL); + + if (strcasecmp(member, BT_OPP_CONNECTED) == 0) { + char *address = NULL; + int request_id = 0; + + if (!dbus_message_get_args(msg, NULL, + DBUS_TYPE_INT32, &result, + DBUS_TYPE_STRING, &address, + DBUS_TYPE_INT32, &request_id, + DBUS_TYPE_INVALID)) { + ERR("Unexpected parameters in signal"); + return; + } + event_info.event = BLUETOOTH_EVENT_OPC_CONNECTED; + event_info.param_data = address; + event_info.result = result; + event_info.user_data = data; + + _bt_share_ui_event_handler(BLUETOOTH_EVENT_OPC_CONNECTED, + &event_info, event_info.user_data); + } else if (strcasecmp(member, BT_TRANSFER_PROGRESS) == 0) { + char *file_name = NULL; + int request_id = 0; + guint64 size = 0; + int progress = 0; + bt_opc_transfer_info_t transfer_info; + + if (!dbus_message_get_args(msg, NULL, + DBUS_TYPE_INT32, &result, + DBUS_TYPE_STRING, &file_name, + DBUS_TYPE_UINT64, &size, + DBUS_TYPE_INT32, &progress, + DBUS_TYPE_INT32, &request_id, + DBUS_TYPE_INVALID)) { + ERR("Unexpected parameters in signal"); + return; + } + + memset(&transfer_info, 0x00, sizeof(bt_opc_transfer_info_t)); + + transfer_info.filename = g_strdup(file_name); + transfer_info.size = size; + transfer_info.percentage = progress; + + event_info.event = BLUETOOTH_EVENT_OPC_TRANSFER_PROGRESS; + event_info.param_data = &transfer_info; + event_info.result = result; + event_info.user_data = data; + + _bt_share_ui_event_handler( + BLUETOOTH_EVENT_OPC_TRANSFER_PROGRESS, + &event_info, event_info.user_data); + + g_free(transfer_info.filename); + } else if (strcasecmp(member, BT_TRANSFER_COMPLETED) == 0) { + char *file_name = NULL; + int request_id = 0; + guint64 size = 0; + bt_opc_transfer_info_t transfer_info; + + if (!dbus_message_get_args(msg, NULL, + DBUS_TYPE_INT32, &result, + DBUS_TYPE_STRING, &file_name, + DBUS_TYPE_UINT64, &size, + DBUS_TYPE_INT32, &request_id, + DBUS_TYPE_INVALID)) { + ERR("Unexpected parameters in signal"); + return; + } + + memset(&transfer_info, 0x00, sizeof(bt_opc_transfer_info_t)); + + transfer_info.filename = g_strdup(file_name); + transfer_info.size = size; + + event_info.event = BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETE; + event_info.param_data = &transfer_info; + event_info.result = result; + event_info.user_data = data; + + _bt_share_ui_event_handler( + BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETE, + &event_info, event_info.user_data); + + g_free(transfer_info.filename); + } +} + +static void __handle_obex_server_signal(void *data, DBusMessage *msg) +{ + bluetooth_event_param_t event_info = { 0, }; + int result = BLUETOOTH_ERROR_NONE; + const char *member = dbus_message_get_member(msg); + + retm_if(data == NULL, "Invalid argument: data is NULL\n"); + retm_if(msg == NULL, "Invalid argument: msg is NULL\n"); + + if (dbus_message_get_type(msg) != DBUS_MESSAGE_TYPE_SIGNAL) + return; + + if (!dbus_message_has_interface(msg, BT_EVENT_SERVICE)) + return; + + if (!dbus_message_has_path(msg, BT_OPP_SERVER_PATH)) + return; + + retm_if(member == NULL, "member value is NULL\n"); + + if (strcasecmp(member, BT_TRANSFER_PROGRESS) == 0) { + char *file_name = NULL; + char *type = NULL; + int transfer_id = 0; + int progress = 0; + int server_type = 0; /* bt_server_type_t */ + guint64 size = 0; + bt_obex_server_transfer_info_t transfer_info; + + if (!dbus_message_get_args(msg, NULL, + DBUS_TYPE_INT32, &result, + DBUS_TYPE_STRING, &file_name, + DBUS_TYPE_STRING, &type, + DBUS_TYPE_UINT64, &size, + DBUS_TYPE_INT32, &transfer_id, + DBUS_TYPE_INT32, &progress, + DBUS_TYPE_INT32, &server_type, + DBUS_TYPE_INVALID)) { + ERR("Unexpected parameters in signal"); + return; + } + + memset(&transfer_info, 0x00, + sizeof(bt_obex_server_transfer_info_t)); + + transfer_info.filename = g_strdup(file_name); + transfer_info.type = g_strdup(type); + transfer_info.file_size = size; + transfer_info.transfer_id = transfer_id; + transfer_info.percentage = progress; + + event_info.event = BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_PROGRESS; + event_info.param_data = &transfer_info; + event_info.result = result; + event_info.user_data = data; + + _bt_share_ui_event_handler( + BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_PROGRESS, + &event_info, event_info.user_data); + + g_free(transfer_info.filename); + g_free(transfer_info.type); + } else if (strcasecmp(member, BT_TRANSFER_COMPLETED) == 0) { + char *file_name = NULL; + char *device_name = NULL; + char *type = NULL; + char *file_path; + int transfer_id = 0; + int server_type = 0; /* bt_server_type_t */ + guint64 size = 0; + bt_obex_server_transfer_info_t transfer_info; + + if (!dbus_message_get_args(msg, NULL, + DBUS_TYPE_INT32, &result, + DBUS_TYPE_STRING, &file_name, + DBUS_TYPE_STRING, &type, + DBUS_TYPE_STRING, &device_name, + DBUS_TYPE_STRING, &file_path, + DBUS_TYPE_UINT64, &size, + DBUS_TYPE_INT32, &transfer_id, + DBUS_TYPE_INT32, &server_type, + DBUS_TYPE_INVALID)) { + ERR("Unexpected parameters in signal"); + return; + } + + memset(&transfer_info, 0x00, + sizeof(bt_obex_server_transfer_info_t)); + + transfer_info.filename = g_strdup(file_name); + transfer_info.type = g_strdup(type); + transfer_info.device_name = g_strdup(device_name); + transfer_info.file_path = g_strdup(file_path); + transfer_info.file_size = size; + transfer_info.transfer_id = transfer_id; + + event_info.event = BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_COMPLETED; + event_info.param_data = &transfer_info; + event_info.result = result; + event_info.user_data = data; + + _bt_share_ui_event_handler( + BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_COMPLETED, + &event_info, event_info.user_data); + + g_free(transfer_info.filename); + g_free(transfer_info.type); + g_free(transfer_info.device_name); + g_free(transfer_info.file_path); + } +} + +static void __handle_update_view_signal(void *data, DBusMessage * msg) +{ + bt_share_appdata_t *ad; + char *db; + + retm_if(data == NULL, "Invalid argument: data is NULL\n"); + retm_if(msg == NULL, "Invalid argument: msg is NULL\n"); + + ad = (bt_share_appdata_t *)data; + + DBG("+"); + + if (!dbus_message_get_args(msg, NULL, + DBUS_TYPE_STRING, &db, + DBUS_TYPE_INVALID)) { + ERR("Event handling failed"); + return; + } + + _bt_share_ui_handle_update_view(ad, db); +} + +static void __handle_home_key_signal(void *data, DBusMessage *msg) +{ + const char *member; + + retm_if(data == NULL, "Invalid argument: data is NULL"); + retm_if(msg == NULL, "Invalid argument: msg is NULL"); + + member = dbus_message_get_member(msg); + retm_if(member == NULL, "member value is NULL"); + + if (dbus_message_get_type(msg) != DBUS_MESSAGE_TYPE_SIGNAL) + return; + + if (!dbus_message_has_interface(msg, DBUS_CORE_APPS_INTERFACE) || + !dbus_message_has_path(msg, DBUS_CORE_APPS_PATH)) + return; + + DBG("Received signal : %s", member); + + if (strcasecmp(member, DBUS_CORE_APPS_MEMBER) == 0) { + _bt_terminate_app(); + } +} + +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); + if (list == NULL) + return; + } + + bt_share_release_tr_data_list(list); +} + +void _bt_signal_init(bt_share_appdata_t *ad) +{ + 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_OPP_CLIENT_PATH, + BT_EVENT_SERVICE, + BT_TRANSFER_CONNECTED, + __handle_opp_client_signal, ad); + retm_if(sh == NULL, "Connect Event register failed\n"); + ad->client_connected_sh = sh; + + sh = e_dbus_signal_handler_add(conn, + NULL, + BT_OPP_CLIENT_PATH, + BT_EVENT_SERVICE, + BT_TRANSFER_PROGRESS, + __handle_opp_client_signal, ad); + retm_if(sh == NULL, "progress Event register failed\n"); + ad->client_progress_sh = sh; + + sh = e_dbus_signal_handler_add(conn, + NULL, + BT_OPP_CLIENT_PATH, + BT_EVENT_SERVICE, + BT_TRANSFER_COMPLETED, + __handle_opp_client_signal, ad); + retm_if(sh == NULL, "complete Event register failed\n"); + ad->client_completed_sh = sh; + + sh = e_dbus_signal_handler_add(conn, + NULL, + BT_OPP_SERVER_PATH, + BT_EVENT_SERVICE, + BT_TRANSFER_PROGRESS, + __handle_obex_server_signal, ad); + retm_if(sh == NULL, "progress Event register failed\n"); + ad->server_progress_sh = sh; + + sh = e_dbus_signal_handler_add(conn, + NULL, + BT_OPP_SERVER_PATH, + BT_EVENT_SERVICE, + BT_TRANSFER_COMPLETED, + __handle_obex_server_signal, ad); + retm_if(sh == NULL, "complete Event register failed\n"); + ad->server_completed_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; + + sh = e_dbus_signal_handler_add(conn, + NULL, + DBUS_CORE_APPS_PATH, + DBUS_CORE_APPS_INTERFACE, + DBUS_CORE_APPS_MEMBER, + __handle_home_key_signal, ad); + retm_if(sh == NULL, "Connect Event register failed"); + ad->app_core_sh = sh; + + ad->dbus_conn = conn; + + return; +} + + +void _bt_signal_deinit(bt_share_appdata_t *ad) +{ + ret_if(ad == NULL); + + e_dbus_signal_handler_del(ad->dbus_conn, ad->client_connected_sh); + e_dbus_signal_handler_del(ad->dbus_conn, ad->client_progress_sh); + e_dbus_signal_handler_del(ad->dbus_conn, ad->client_completed_sh); + e_dbus_signal_handler_del(ad->dbus_conn, ad->server_progress_sh); + e_dbus_signal_handler_del(ad->dbus_conn, ad->server_completed_sh); + e_dbus_signal_handler_del(ad->dbus_conn, ad->update_sh); + e_dbus_signal_handler_del(ad->dbus_conn, ad->app_core_sh); + return; +} + +int _bt_abort_signal_send(bt_share_appdata_t *ad, + bt_share_popup_data_t *pb_data) +{ + DBG("+"); + 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"); + dbus_message_unref(msg); + return -1; + } + + ad->opp_transfer_abort = TRUE; /* Transfer aborted by user */ + + INFO("pb_data->transfer_type = %s", pb_data->transfer_type); + INFO("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("-"); + 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("+"); + DBusMessage *msg = NULL; + DBusMessageIter iter; + DBusMessageIter array_iter; + DBusMessageIter file_iter; + DBusMessageIter filepath_iter; + const char *bd_addr = NULL; + char **file_path; + int i; + + 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"); + + bd_addr = (char *)calloc(sizeof(char), BT_ADDRESS_LENGTH_MAX); + if (bd_addr == NULL) { + 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"); + free((void *)bd_addr); + return -1; + } + + if (!g_utf8_validate(info->file_path, -1, NULL)) { + ERR("Invalid filepath"); + free((void *)bd_addr); + + _bt_create_info_popup(ad, BT_STR_INFORMATION, + BT_STR_UNABLE_TO_SEND); + + return -1; + } +/* file validation check begin*/ + + if (access(info->file_path, F_OK) != 0) { + ERR("access failed. May be file is deleted from the Device"); + free((void *)bd_addr); + + _bt_create_info_popup(ad, BT_STR_INFORMATION, + BT_STR_FILE_NOT_EXIST); + + return 0; + } +/* file validation check end*/ + + file_path = g_new0(char *, 1); + file_path[0] = g_strdup(info->content); + + dbus_message_iter_init_append(msg, &iter); + + dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, + DBUS_TYPE_BYTE_AS_STRING, &array_iter); + + for (i = 0; i < BT_ADDRESS_LENGTH_MAX; i++) { + dbus_message_iter_append_basic(&array_iter, + DBUS_TYPE_BYTE, &bd_addr[i]); + } + dbus_message_iter_close_container(&iter, &array_iter); + + dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, + &info->dev_name); + dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, + &info->type); + + dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, + DBUS_TYPE_ARRAY_AS_STRING + DBUS_TYPE_BYTE_AS_STRING, &file_iter); + + dbus_message_iter_open_container(&file_iter, DBUS_TYPE_ARRAY, + DBUS_TYPE_BYTE_AS_STRING, &filepath_iter); + + for (i = 0; i < strlen(file_path[0]); i++) { + dbus_message_iter_append_basic(&filepath_iter, + DBUS_TYPE_BYTE, &file_path[0][i]); + } + + dbus_message_iter_close_container(&file_iter, &filepath_iter); + dbus_message_iter_close_container(&iter, &file_iter); + + e_dbus_message_send(ad->dbus_conn, msg, NULL, -1, NULL); + dbus_message_unref(msg); + free((void *)bd_addr); + g_free(file_path[0]); + g_free(file_path); + + DBG("-"); + return 0; +} + + +int _bt_share_ui_ipc_info_update(bt_share_appdata_t *ad, int uid) +{ + DBG("+"); + retv_if(ad == NULL, -1); + + DBusMessage *msg = NULL; + int info_uid = 0; + int info_type = 0; + + info_uid = uid; + info_type = ad->tr_type; + + INFO("info_uid = %d", info_uid); + INFO("info_type = %d", 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"); + dbus_message_unref(msg); + return -1; + } + + e_dbus_message_send(ad->dbus_conn, msg, NULL, -1, NULL); + dbus_message_unref(msg); + + DBG("-"); + return 0; +} + +void _bt_share_ui_handle_update_view(bt_share_appdata_t *ad, + char *table) +{ + GSList *list_iter = NULL; + bt_tr_data_t *info = NULL; + int transfer_type; + + DBG("+"); + + if (g_strcmp0(table, BT_INBOUND_TABLE) == 0) + transfer_type = BT_TR_INBOUND; + else if (g_strcmp0(table, BT_OUTBOUND_TABLE) == 0) + transfer_type = BT_TR_OUTBOUND; + else + return; + + __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("-"); +} + +static void __bt_share_ui_handle_progress(bt_share_appdata_t *ad, + int transfer_id, char *name, int percentage, + gboolean completed, int error_type) +{ + + if (completed == FALSE) { + _bt_update_progress_popup(ad, transfer_id, name, percentage); + } else { + if (error_type == BLUETOOTH_ERROR_NONE) { + if (ad->progress_popup && + (ad->pb_transfer_id == transfer_id)) + _bt_destroy_progress_popup(ad); + } else { + DBG("Don,t terminate. Warning Popup will be shown."); + } + } +} +static void __bt_share_ui_handle_error(bt_share_appdata_t *ad, int error_type, + bt_share_tr_type_e trans_type) +{ + + DBG("Error type : %d", error_type); + + switch (error_type) { + 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); + DBG("opp_transfer_abort by user:%d, trans_type = %d", + ad->opp_transfer_abort, ad->tr_type); + if (ad->ft_type != BT_FT_RETRY_POPUP && + ad->ft_type != BT_FT_SENT_POPUP && + ad->ft_type != BT_FT_FILE_NOT_EXIST && + (trans_type == BT_TR_INBOUND) && + !ad->opp_transfer_abort) + _bt_create_info_popup(ad, BT_STR_INFORMATION, + BT_STR_UNABLE_TO_RECEIVE); + else if (!ad->opp_transfer_abort && + (trans_type == BT_TR_OUTBOUND)) + _bt_create_info_popup(ad, BT_STR_INFORMATION, + BT_STR_UNABLE_TO_SEND); + ad->opp_transfer_abort = FALSE; + 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); + break; + default: + break; + } +} + +void _bt_share_ui_event_handler(int event, bluetooth_event_param_t *param, + void *user_data){ + + bt_obex_server_transfer_info_t *transfer_info; + bt_opc_transfer_info_t *client_info; + char *name = NULL; + int percentage = 0; + bt_share_appdata_t *ad = (bt_share_appdata_t *)user_data; + + switch (event) { + case BLUETOOTH_EVENT_OPC_CONNECTED: + INFO("BLUETOOTH_EVENT_OPC_CONNECTED"); + if (param->result != BLUETOOTH_ERROR_NONE) { + __bt_share_ui_handle_error(ad, param->result, + BT_TR_OUTBOUND); + _bt_share_ui_handle_update_view(ad, BT_OUTBOUND_TABLE); + } + break; + + case BLUETOOTH_EVENT_OPC_TRANSFER_PROGRESS: + client_info = (bt_opc_transfer_info_t *)param->param_data; + + name = strrchr(client_info->filename, '/'); + if (name) + name++; + else + name = client_info->filename; + + percentage = client_info->percentage; + __bt_share_ui_handle_progress(ad, 0, name, percentage, + FALSE, BLUETOOTH_ERROR_NONE); + break; + + case BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETE: + INFO("BT_SHARE_EVENT_OPC_TRANSFER_COMPLETE "); + client_info = (bt_opc_transfer_info_t *)param->param_data; + + if (param->result != BLUETOOTH_ERROR_NONE) { + __bt_share_ui_handle_error(ad, param->result, + BT_TR_OUTBOUND); + + if (ad->tr_view) + _bt_share_ui_handle_update_view(ad, BT_OUTBOUND_TABLE); + else if (ad->info_popup == NULL) + _bt_terminate_app(); + + return; + } + + INFO_SECURE("client_info->filename = [%s]", + client_info->filename); + + name = strrchr(client_info->filename, '/'); + if (name) + name++; + else + name = client_info->filename; + + INFO("name address = [%x]", name); + __bt_share_ui_handle_progress(ad, 0, name, 100, TRUE, + param->result); + + if (ad->tr_view == NULL) + _bt_terminate_app(); + else + _bt_share_ui_handle_update_view(ad, BT_OUTBOUND_TABLE); + + break; + + case BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_PROGRESS: + if (param->result == BLUETOOTH_ERROR_NONE) { + transfer_info = param->param_data; + __bt_share_ui_handle_progress(ad, + transfer_info->transfer_id, + transfer_info->filename, + transfer_info->percentage, + FALSE, BLUETOOTH_ERROR_NONE); + } + break; + + case BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_COMPLETED: + INFO("BT_EVENT_OBEX_TRANSFER_COMPLETED "); + + if (param->result != BLUETOOTH_ERROR_NONE) { + __bt_share_ui_handle_error(ad, param->result, + BT_TR_INBOUND); + + if (ad->tr_view) + _bt_share_ui_handle_update_view(ad, + BT_INBOUND_TABLE); + + return; + } + + transfer_info = param->param_data; + + __bt_share_ui_handle_progress(ad, transfer_info->transfer_id, + transfer_info->filename, + transfer_info->percentage, TRUE, param->result); + + if (ad->tr_view == NULL) + _bt_terminate_app(); + else + _bt_share_ui_handle_update_view(ad, BT_INBOUND_TABLE); + + break; + + default: + DBG("Unhandled event %x", event); + break; + } + +} diff --git a/src/bt-share-ui-ipc.h b/src/bt-share-ui-ipc.h new file mode 100644 index 0000000..4552bea --- /dev/null +++ b/src/bt-share-ui-ipc.h @@ -0,0 +1,86 @@ +/* +* bluetooth-share-ui +* +* Copyright 2012 Samsung Electronics Co., Ltd +* +* Contact: Hocheol Seo +* GirishAshok Joshi +* DoHyun Pyun +* +* 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" +#include + +#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" +#define BT_INBOUND_TABLE "inbound" +#define BT_OUTBOUND_TABLE "outbound" + +#define BT_EVENT_SERVICE "org.projectx.bt_event" +#define BT_OPP_CLIENT_PATH "/org/projectx/bt/opp_client" +#define BT_OPP_SERVER_PATH "/org/projectx/bt/opp_server" +#define BT_OPP_CONNECTED "OppConnected" +#define BT_TRANSFER_STARTED "TransferStarted" +#define BT_TRANSFER_PROGRESS "TransferProgress" +#define BT_TRANSFER_COMPLETED "TransferCompleted" +#define BT_TRANSFER_CONNECTED "TransferConnected" + +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_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); +void _bt_share_ui_event_handler(int event, bluetooth_event_param_t *param, + void *user_data); +void _bt_share_ui_handle_update_view(bt_share_appdata_t *ad, + char *table); + +#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 index 0000000..774e47b --- /dev/null +++ b/src/bt-share-ui-main.c @@ -0,0 +1,376 @@ +/* +* bluetooth-share-ui +* +* Copyright 2012 Samsung Electronics Co., Ltd +* +* Contact: Hocheol Seo +* GirishAshok Joshi +* DoHyun Pyun +* +* 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 +#include +#include +#include +#if 0 +#include +#include +#endif +#include +#include +#include +#if 0 +#include +#include +#endif +#include +#include +#include "applog.h" +#include "bt-share-ui-main.h" +#include "bt-share-ui-view.h" +#include "bt-share-ui-popup.h" +#include "bt-share-ui-ipc.h" +#include "bt-share-ui-resource.h" +#include +#include +#include + +bt_share_appdata_t *app_state = NULL; + +static void __bt_lang_changed_cb(app_event_info_h event_info, void *data) +{ + DBG("+"); + ret_if(data == NULL); + + bt_share_appdata_t *ad = (bt_share_appdata_t *)data; + + if (ad->tr_genlist) { + elm_genlist_realized_items_update(ad->tr_genlist); + } + + if (ad->navi_it) { + elm_object_item_text_set(ad->navi_it, + (ad->tr_type == BT_TR_INBOUND) ? + BT_STR_RECEIVED_FILES : + BT_STR_SENT_FILES); + Evas_Object *nocontents = elm_object_item_part_content_get( + ad->navi_it, + "elm.swallow.content"); + elm_object_part_text_set(nocontents, "elm.text", + BT_STR_NO_TRANSFER_HISTORY); + } + + if (ad->ft_popup) { + _bt_lang_changed_ft_popup(ad); + } + + if (ad->progress_popup) { + _bt_lang_changed_progress_popup(ad); + } +} + +static int __bt_parse_launch_mode(bt_share_appdata_t *ad, bundle *b) +{ + const char *launch_type = NULL; + + retvm_if(ad == NULL, -1, "Invalid param"); + retvm_if(b == NULL, -1, "Invalid param"); + + launch_type = bundle_get_val(b, "launch-type"); + retv_if(!launch_type, -1); + + if (!strcasecmp(launch_type, "ongoing")) { + ad->launch_mode = BT_LAUNCH_ONGOING; + } else if (!strcasecmp(launch_type, "warning_popup")) { + ad->launch_mode = BT_LAUNCH_WARNING_POPUP; + } else if (!strcasecmp(launch_type, "transfer_list")) { + ad->launch_mode = BT_LAUNCH_TRANSFER_LIST; + } else { + ERR("Invalid bundle value"); + return -1; + } + return 0; +} + +static int __bt_share_launch_handler(bt_share_appdata_t *ad, bundle *b) +{ + INFO("+"); + bt_share_popup_data_t *pb_data = NULL; + const char *str = NULL; + const char *transfer_type = NULL; + const char *temp = NULL; + int tr_type = 0; + sqlite3 *db = NULL; + bt_adapter_state_e bt_state = BT_ADAPTER_DISABLED; + + retvm_if(ad == NULL, -1, "Invalid param"); + retvm_if(b == NULL, -1, "Invalid param"); + + if (ad->launch_mode == BT_LAUNCH_ONGOING) { + INFO("BT_LAUNCH_ONGOING"); + + /*Check adapter state, if disabled then return */ + if (bt_adapter_get_state(&bt_state) == BT_ERROR_NONE) { + if (bt_state == BT_ADAPTER_DISABLED) { + DBG("Adapter disabled, returning"); + return 0; + } + } else + ERR("bt_adapter_get_state() failed"); + + + + if (ad->tr_view == NULL) { + Evas_Object *e = NULL; + Ecore_Evas *ee = NULL; + e = evas_object_evas_get(ad->win); + ee = ecore_evas_ecore_evas_get(e); + ecore_evas_name_class_set(ee,"APP_POPUP","APP_POPUP"); + } + + 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")); + INFO("progress cnt : %s", pb_data->progress_cnt); + ad->ft_type = BT_FT_SENT_POPUP; + } + + INFO_SECURE("filename %s", pb_data->filename); + INFO("percentage %s", pb_data->percentage); + INFO("transfer_type %s", pb_data->transfer_type); + INFO("transfer_id %d", pb_data->transfer_id); + /* Notificaton id of ongoing item */ + if (ad->progress_popup) + _bt_destroy_progress_popup(ad); + ad->progress_popup = _bt_create_progress_popup(pb_data); + retvm_if (ad->progress_popup == NULL, -1, "fail to create progress popup"); + + evas_object_data_set(ad->progress_popup, "progressbar_data", pb_data); + } else if (ad->launch_mode == BT_LAUNCH_WARNING_POPUP) { + INFO("BT_LAUNCH_WARNING_POPUP"); + if (ad->progress_popup) + _bt_destroy_progress_popup(ad); + str = bundle_get_val(b, "message"); + _bt_create_extinctive_info_popup(ad, BT_STR_INFORMATION, str); + } else if (ad->launch_mode == BT_LAUNCH_TRANSFER_LIST) { + INFO("BT_LAUNCH_TRANSFER_LIST"); + elm_win_indicator_mode_set(ad->win, ELM_WIN_INDICATOR_SHOW); + elm_win_indicator_opacity_set(ad->win, ELM_WIN_INDICATOR_OPAQUE); + + if (ad->progress_popup) + _bt_destroy_progress_popup(ad); + transfer_type = bundle_get_val(b, "transfer_type"); + retvm_if (!transfer_type, -1, "Invalid transfer type!"); + + if (!strcmp(transfer_type, "outbound")) + tr_type = BT_TR_OUTBOUND; + else + tr_type = BT_TR_INBOUND; + + retvm_if(ad->tr_view && ad->tr_type == tr_type, 0, + "same view. no need to create transfer view!"); + + INFO("Transfer type : %s", transfer_type); + ad->tr_type = tr_type; + + /* Get data from share DB */ + db = bt_share_open_db(); + retvm_if(!db, NULL, "fail to open db!"); + + ad->tr_data_list = bt_share_get_completed_tr_data_list(db, ad->tr_type); + bt_share_close_db(db); + + if (ad->tr_data_list) + _bt_create_transfer_view(ad); + else + _bt_nocontent_set(ad, TRUE); + + } else { + ERR("Invalid bundle value"); + return -1; + } + + return 0; +} + +static bool __app_create(void *data) +{ + INFO(" __app_create"); + bt_share_appdata_t *ad = data; + Evas_Object *win = NULL; + int ret; + bt_adapter_state_e status = BT_ADAPTER_DISABLED; + + elm_app_base_scale_set(1.8); + + /* create window */ + win = _bt_create_win(PACKAGE); + retv_if(win == NULL, false); + ad->win = win; + + bindtextdomain(BT_COMMON_PKG, BT_COMMON_RES); + + if (bt_initialize() != BT_ERROR_NONE) + ERR("bt_initialize() failed"); + + if (bt_adapter_get_state(&status) != BT_ERROR_NONE) + ERR("bt_adapter_get_state() failed!"); + + ad->bt_status = status; + + /* Set event callbacks */ + ret = + bt_adapter_set_state_changed_cb(_bt_cb_state_changed, (void *)ad); + if (ret != BT_ERROR_NONE) + ERR("bt_adapter_set_state_changed_cb failed"); + return true; +} + +static void __app_service(app_control_h app_control, void *user_data) +{ + INFO("__app_service"); + bt_share_appdata_t *ad = user_data; + int ret; + bundle *b = NULL; + ret_if(ad == NULL); + + ret = app_control_export_as_bundle(app_control, &b); + + if (ad->dbus_conn == NULL) { + _bt_signal_init(ad); + } + + if(__bt_parse_launch_mode(ad, b) == -1) { + if (b) + bundle_free(b); + return; + } + + if (ad->launch_mode == BT_LAUNCH_ONGOING || + ad->launch_mode == BT_LAUNCH_WARNING_POPUP) { + if (ad->tr_view == NULL) { + if (elm_win_alpha_get(ad->win) == FALSE) { + elm_win_alpha_set(ad->win, TRUE); + int ret = 0; +#if 0 + Display *dpy; + Window win; + + dpy = ecore_x_display_get(); + win = elm_win_xwindow_get(ad->win); + + ret = utilx_set_window_opaque_state(dpy, + win, UTILX_OPAQUE_STATE_ON); +#endif + + if (!ret) + { + ERR("Error! Failed to set opaque state."); + } + } + } + } else if (elm_win_alpha_get(ad->win)) + elm_win_alpha_set(ad->win, FALSE); + + + /* Set rotation Callback */ + if (elm_win_wm_rotation_supported_get(ad->win)) { + int rots[4] = { 0, 90, 180, 270 }; + elm_win_wm_rotation_available_rotations_set(ad->win, (const int *)(&rots), 4); + } + + ret = __bt_share_launch_handler(ad, b); + if (ret < 0) + _bt_terminate_app(); + + + evas_object_show(ad->win); + elm_win_activate(ad->win); + bundle_free(b); +} + +static void __app_terminate(void *data) +{ + INFO("__app_terminate "); + bt_share_appdata_t *ad = data; + int err; + + _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); + + err = bt_adapter_unset_state_changed_cb(); + if (err != BT_ERROR_NONE) + ERR("unset of state change cb failed: %d", err); + + err = bt_deinitialize(); + if (err != BT_ERROR_NONE) + ERR("bt_deinitialize failed: %d", err); + + +} + +static void __app_pause(void *data) +{ + INFO("__app_pause "); +} + +static void __app_resume(void *data) +{ + INFO("__app_resume"); +} + +EXPORT int main(int argc, char *argv[]) +{ + DBG("Start bluetooth-share-ui main()"); + + ui_app_lifecycle_callback_s callback = {0,}; + app_event_handler_h lang_changed_handler; + bt_share_appdata_t ad = {0,}; + app_state = &ad; + + callback.create = __app_create; + callback.terminate = __app_terminate; + callback.pause = __app_pause; + callback.resume = __app_resume; + callback.app_control = __app_service; + + ui_app_add_event_handler(&lang_changed_handler, APP_EVENT_LANGUAGE_CHANGED, __bt_lang_changed_cb, &ad); + + DBG("ui_app_main() is called."); + int ret = ui_app_main(argc, argv, &callback, &ad); + if (ret != APP_ERROR_NONE) { + ERR("ui_app_main() is failed. err = %d", ret); + } + + DBG("End bluetooth-share-ui main()"); + return ret; +} + diff --git a/src/bt-share-ui-main.h b/src/bt-share-ui-main.h new file mode 100755 index 0000000..efb953a --- /dev/null +++ b/src/bt-share-ui-main.h @@ -0,0 +1,144 @@ +/* +* bluetooth-share-ui +* +* Copyright 2012 Samsung Electronics Co., Ltd +* +* Contact: Hocheol Seo +* GirishAshok Joshi +* DoHyun Pyun +* +* 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 +#include +#include +#include +#include +#include +#include +#include +#define EXPORT __attribute__((visibility("default"))) + +#if !defined(PACKAGE) +#define PACKAGE "org.tizen.bluetooth-share-ui" +#endif + +#if !defined(EDJFILE) +#define EDJDIR "/usr/apps/org.tizen.bluetooth-share-ui/res/edje" +#define EDJFILE EDJDIR"/bt-share-layout.edj" +#define EDJ_IMAGES EDJDIR "/images.edj" +#define VCONFKEY_SETAPPL_CHANGE_UI_THEME_INT VCONFKEY_SETAPPL_PREFIX"/change_ui/theme" + +#endif + + +typedef enum { + BT_TR_OUTBOUND, + BT_TR_INBOUND +} bt_share_tr_type_e; + +typedef enum { + CSC_DCM, + CSC_FTM, +} bt_share_csc_type_t; + +typedef enum { + BT_FT_RECV_FAIL_POPUP, + BT_FT_RECV_SUCCESS_POPUP, + BT_FT_SENT_POPUP, + BT_FT_RETRY_POPUP, + BT_FT_FILE_NOT_EXIST +} bt_share_ft_popup_type_e; + +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 { + bt_tr_data_t *tr_data; + gboolean highlighted; +} bt_gl_data_t; + +typedef enum { + BT_LAUNCH_ONGOING = 0x00, + BT_LAUNCH_WARNING_POPUP = 0x01, + BT_LAUNCH_TRANSFER_LIST = 0x02, +} bt_share_launch_mode_t; + +typedef struct { + bt_share_launch_mode_t launch_mode; + bt_adapter_state_e bt_status; + Evas_Object *win; + Evas_Object *bg; + Evas_Object *conform; + Evas_Object *tr_view; + Evas_Object *navi_fr; + Elm_Object_Item *navi_it; + Evas_Object *toolbar_btn; + + /* Progress Popup */ + Evas_Object *progress_layout; + Evas_Object *progress_popup; + Evas_Object *pb; + int pb_transfer_id; + bt_share_popup_data_t *progress_data; + + /* File transfer status popup*/ + Evas_Object *ft_popup; + bt_share_ft_popup_type_e ft_type; + bt_tr_data_t *ft_info; + + /* 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 *client_connected_sh; + E_DBus_Signal_Handler *client_progress_sh; + E_DBus_Signal_Handler *client_completed_sh; + E_DBus_Signal_Handler *server_progress_sh; + E_DBus_Signal_Handler *server_completed_sh; + E_DBus_Signal_Handler *update_sh; + E_DBus_Signal_Handler *app_core_sh; + + bt_share_tr_type_e tr_type; + int inbound_latest_id; + int outbound_latest_id; + bool opp_transfer_abort; +} bt_share_appdata_t; + +#ifdef __cplusplus +} +#endif +#endif /* __DEF_BT_SHARE_UI_MAIN_H_ */ diff --git a/src/bt-share-ui-popup.c b/src/bt-share-ui-popup.c new file mode 100755 index 0000000..0c9dc18 --- /dev/null +++ b/src/bt-share-ui-popup.c @@ -0,0 +1,825 @@ +/* +* bluetooth-share-ui +* +* Copyright 2012 Samsung Electronics Co., Ltd +* +* Contact: Hocheol Seo +* GirishAshok Joshi +* DoHyun Pyun +* +* 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 +#include +#include +#include +#if 0 +#include +#include +#endif +#include +#include +#include +#include +#include +#include +#include + +#include "applog.h" +#include "bt-share-ui-view.h" +#include "bt-share-ui-popup.h" +#include "bt-share-ui-ipc.h" +#include "bt-share-ui-resource.h" +#include "bt-share-ui-widget.h" +#include "bt-share-ui-main.h" + +#define NEW_LINE "\n" + +extern bt_share_appdata_t *app_state; + + +static void __bt_destroy_ft_popup(bt_share_appdata_t *ad) +{ + DBG(""); + ret_if(ad == NULL); + + if (ad->ft_popup) { + DBG("delete ft_popup"); + evas_object_del(ad->ft_popup); + ad->ft_popup = NULL; + } + + return; +} + +static void __bt_ft_retry_ok_cb(void *data, Evas_Object *obj, void *event_info) +{ + DBG("+"); + + ret_if(data == NULL); + bt_share_appdata_t *ad = app_state; + bt_tr_data_t *info = (bt_tr_data_t *)data; + + __bt_destroy_ft_popup(ad); + + if (ad->bt_status == BT_ADAPTER_ENABLED) { + if (!_bt_share_ui_ipc_retry_send(ad, info)) { + INFO(" info->id %d", info->id); + _bt_share_ui_ipc_info_update(ad, info->id); + _bt_delete_selected_item(ad); + } + } + + DBG("-"); + return; +} + +static void __bt_ft_retry_cancel_cb(void *data, Evas_Object *obj, void *event_info) +{ + DBG("+"); + + ret_if(data == NULL); + bt_share_appdata_t *ad = app_state; + + __bt_destroy_ft_popup(ad); + + DBG("-"); + return; +} + +static void __bt_ft_retry_mouseup_cb(void *data, + Evas *e, Evas_Object *obj, void *event_info) +{ + Evas_Event_Mouse_Up *ev = event_info; + bt_share_appdata_t *ad = app_state; + bt_tr_data_t *info = (bt_tr_data_t *)data; + + DBG("Mouse event callback function is called +"); + if (ev->button == 3) { + __bt_destroy_ft_popup(ad); + _bt_share_ui_ipc_info_update(ad, info->id); + } + + DBG("Mouse event callback -"); +} + +static void __bt_ft_ok_popup_cb(void *data, Evas_Object *obj, + void *event_info) +{ + DBG(" +"); + ret_if(data == NULL); + ret_if(!obj); + bt_share_appdata_t *ad = app_state; + bt_tr_data_t *info = (bt_tr_data_t *)data; + + const char *text = elm_object_text_get(obj); + + if (!g_strcmp0(text, BT_STR_RETRY)) { + __bt_ft_retry_ok_cb(data, obj, event_info); + return; + } + + __bt_destroy_ft_popup(ad); + + if (ad->bt_status == BT_ADAPTER_DISABLED) + _bt_update_tr_notification(info); + else /*Adapter enabled case */ + _bt_share_ui_ipc_info_update(ad, info->id); + + _bt_delete_selected_item(ad); + + DBG("-"); + return; +} + +static void __bt_ft_ok_mouseup_cb(void *data, + Evas *e, Evas_Object *obj, void *event_info) +{ + Evas_Event_Mouse_Up *ev = event_info; + bt_share_appdata_t *ad = app_state; + bt_tr_data_t *info = (bt_tr_data_t *)data; + + DBG("Mouse event callback function is called +"); + + if (ev->button == 3) { + __bt_destroy_ft_popup(ad); + _bt_share_ui_ipc_info_update(ad, info->id); + _bt_delete_selected_item(ad); + } + DBG("Mouse event callback -"); +} + +static Evas_Object *__bt_create_popup_layout(Evas_Object *parent, bt_share_appdata_t *ad) +{ + Evas_Object *layout = NULL; + + layout = elm_layout_add(parent); + elm_layout_file_set(layout, EDJFILE, "ft_popup"); + evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, + EVAS_HINT_EXPAND); + ad->progress_layout = layout; + return layout; +} + +static Evas_Object *__bt_create_progressbar(Evas_Object *parent, bt_share_appdata_t *ad) +{ + Evas_Object *progressbar = NULL; + progressbar = elm_progressbar_add(parent); + elm_object_style_set(progressbar, "list_progress"); + elm_progressbar_horizontal_set(progressbar, EINA_TRUE); + evas_object_size_hint_align_set(progressbar, EVAS_HINT_FILL, 0.5); + evas_object_size_hint_weight_set(progressbar, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_object_signal_emit(progressbar, "elm,units,show", "elm"); + elm_progressbar_value_set(progressbar, 0.0); + evas_object_show(progressbar); + return progressbar; +} + +static Evas_Object *__bt_create_popup_pb_layout(Evas_Object *parent, bt_share_appdata_t *ad) +{ + Evas_Object *layout = NULL; + + layout = elm_layout_add(parent); + elm_layout_file_set(layout, EDJFILE, "popup_2text_progressbar_view_layout"); + evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, + EVAS_HINT_EXPAND); + ad->progress_layout = layout; + return layout; +} + +Evas_Object *_bt_create_ft_popup(bt_share_ft_popup_type_e type, bt_tr_data_t *info) +{ + DBG(" +"); + bt_share_appdata_t *ad = app_state; + Evas_Object *popup = NULL; + char msg[BT_GLOBALIZATION_STR_LENGTH] = { 0 }; + char tmp[BT_GLOBALIZATION_STR_LENGTH] = { 0 }; + char *name = NULL; + char *markup_text = NULL; + + if (info->file_path == NULL) { + ERR("Invalid data"); + return NULL; + } + + popup = elm_popup_add(ad->win); + evas_object_size_hint_weight_set(popup, + EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + + INFO("Popup type : %d", type); + ad->ft_type = type; + ad->ft_info = info; + + if (type == BT_FT_SENT_POPUP) { + DBG("BT_FT_SENT_POPUP"); + elm_object_part_text_set(popup, "title,text", BT_STR_SENT_FILES); + char file_size_str[BT_FILE_SIZE_STR] = { 0 }; + + snprintf(msg, sizeof(msg), BT_STR_TO_S, info->dev_name); + g_strlcat(msg, NEW_LINE, BT_GLOBALIZATION_STR_LENGTH); + + name = strrchr(info->file_path, '/'); + if (name != NULL) + name++; + else + name = info->file_path; + + snprintf(tmp, sizeof(tmp), BT_STR_FILE_S, name); + g_strlcat(msg, tmp, BT_GLOBALIZATION_STR_LENGTH); + g_strlcat(msg, NEW_LINE, BT_GLOBALIZATION_STR_LENGTH); + + /* file size */ + if (info->size < 1024) + snprintf(file_size_str, sizeof(file_size_str), + "%dB", info->size); + else if (info->size > 1024 * 1024) + snprintf(file_size_str, sizeof(file_size_str), + "%dMB", info->size / (1024 * 1024)); + else + snprintf(file_size_str, sizeof(file_size_str), + "%dKB", info->size / 1024); + + snprintf(tmp, sizeof(tmp), BT_STR_FILE_SIZE_S, file_size_str); + g_strlcat(msg, tmp, BT_GLOBALIZATION_STR_LENGTH); + + markup_text = elm_entry_utf8_to_markup(msg); + elm_object_text_set(popup, markup_text); + } else if (type == BT_FT_RECV_SUCCESS_POPUP) { + DBG("BT_FT_RECV_SUCCESS_POPUP"); + elm_object_part_text_set(popup, "title,text", BT_STR_RECEIVED_FILES); + char file_size_str[BT_FILE_SIZE_STR] = { 0 }; + + snprintf(msg, sizeof(msg), BT_STR_FROM_S, info->dev_name); + g_strlcat(msg, NEW_LINE, BT_GLOBALIZATION_STR_LENGTH); + + name = strrchr(info->file_path, '/'); + if (name != NULL) + name++; + else + name = info->file_path; + + snprintf(tmp, sizeof(tmp), BT_STR_FILE_S, name); + g_strlcat(msg, tmp, BT_GLOBALIZATION_STR_LENGTH); + g_strlcat(msg, NEW_LINE, BT_GLOBALIZATION_STR_LENGTH); + + /* file size */ + if (info->size < 1024) + snprintf(file_size_str, sizeof(file_size_str), + "%dB", info->size); + else if (info->size > 1024 * 1024) + snprintf(file_size_str, sizeof(file_size_str), + "%dMB", info->size / (1024 * 1024)); + else + snprintf(file_size_str, sizeof(file_size_str), + "%dKB", info->size / 1024); + + snprintf(tmp, sizeof(tmp), BT_STR_FILE_SIZE_S, file_size_str); + g_strlcat(msg, tmp, BT_GLOBALIZATION_STR_LENGTH); + + markup_text = elm_entry_utf8_to_markup(msg); + elm_object_text_set(popup, markup_text); + } else if (type == BT_FT_RECV_FAIL_POPUP) { + DBG("BT_FT_RECV_FAIL_POPUP"); + elm_object_part_text_set(popup, "title,text", BT_STR_UNABLE_TO_RECEIVED_FILES); + + g_strlcat(msg, BT_STR_FILE_NOT_RECV, BT_GLOBALIZATION_STR_LENGTH); + g_strlcat(msg, NEW_LINE, BT_GLOBALIZATION_STR_LENGTH); + + snprintf(tmp, sizeof(tmp), BT_STR_FILE_S, info->file_path); + g_strlcat(msg, tmp, BT_GLOBALIZATION_STR_LENGTH); + + markup_text = elm_entry_utf8_to_markup(msg); + elm_object_text_set(popup, markup_text); + } else if (type == BT_FT_FILE_NOT_EXIST) { + elm_object_part_text_set(popup, "title,text", BT_STR_RECEIVED_FILES); + __bt_create_popup_layout(popup, ad); + + g_strlcat(msg, BT_STR_FILE_NOT_EXIST, BT_GLOBALIZATION_STR_LENGTH); + g_strlcat(msg, NEW_LINE, BT_GLOBALIZATION_STR_LENGTH); + + snprintf(tmp, sizeof(tmp), BT_STR_FILE_S, info->file_path); + g_strlcat(msg, tmp, BT_GLOBALIZATION_STR_LENGTH); + + markup_text = elm_entry_utf8_to_markup(msg); + elm_object_text_set(popup, markup_text); + } else if (type == BT_FT_RETRY_POPUP) { + elm_object_part_text_set(popup, "title,text", BT_STR_UNABLE_TO_SEND_FILES); + + snprintf(msg, sizeof(msg), BT_STR_SEND_FAIL_TO_S, info->dev_name); + g_strlcat(msg, NEW_LINE, BT_GLOBALIZATION_STR_LENGTH); + + name = strrchr(info->file_path, '/'); + if (name != NULL) + name++; + else + name = info->file_path; + + snprintf(tmp, sizeof(tmp), BT_STR_FILE_S, name); + g_strlcat(msg, tmp, BT_GLOBALIZATION_STR_LENGTH); + + markup_text = elm_entry_utf8_to_markup(msg); + elm_object_text_set(popup, markup_text); + } + + evas_object_show(popup); + + if (type == BT_FT_RETRY_POPUP) { + if (ad->bt_status == BT_ADAPTER_DISABLED || + access(info->file_path, F_OK) != 0) { + _bt_create_button(popup, "popup", "button1", + BT_STR_OK, NULL, __bt_ft_ok_popup_cb, info); + } else { + _bt_create_button(popup, "popup", "button1", + BT_STR_RETRY, NULL, __bt_ft_retry_ok_cb, info); + } + eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, + __bt_ft_retry_cancel_cb, info); + evas_object_event_callback_add(popup, EVAS_CALLBACK_MOUSE_UP, + __bt_ft_retry_mouseup_cb, info); + } else { + _bt_create_button(popup, "popup", "button1", + BT_STR_OK, NULL, __bt_ft_ok_popup_cb, info); + eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, + __bt_ft_ok_popup_cb, info); + evas_object_event_callback_add(popup, EVAS_CALLBACK_MOUSE_UP, + __bt_ft_ok_mouseup_cb, info); + } + + if(markup_text) + free(markup_text); + + DBG("-"); + return popup; +} + +void _bt_lang_changed_ft_popup(bt_share_appdata_t *ad) +{ + DBG(" +"); + char msg[BT_GLOBALIZATION_STR_LENGTH] = { 0 }; + char tmp[BT_GLOBALIZATION_STR_LENGTH] = { 0 }; + char *name = NULL; + char *markup_text = NULL; + Evas_Object *btn1 = NULL; + + if (ad->ft_type == BT_FT_SENT_POPUP) { + elm_object_part_text_set(ad->ft_popup, "title,text", BT_STR_SENT_FILES); + char file_size_str[BT_FILE_SIZE_STR] = { 0 }; + + snprintf(msg, sizeof(msg), BT_STR_FROM_S, ad->ft_info->dev_name); + g_strlcat(msg, NEW_LINE, BT_GLOBALIZATION_STR_LENGTH); + + name = strrchr(ad->ft_info->file_path, '/'); + if (name != NULL) + name++; + else + name = ad->ft_info->file_path; + + snprintf(tmp, sizeof(tmp), BT_STR_FILE_S, name); + g_strlcat(msg, tmp, BT_GLOBALIZATION_STR_LENGTH); + g_strlcat(msg, NEW_LINE, BT_GLOBALIZATION_STR_LENGTH); + + /* file size */ + if (ad->ft_info->size < 1024) + snprintf(file_size_str, sizeof(file_size_str), + "%dB", ad->ft_info->size); + else if (ad->ft_info->size > 1024 * 1024) + snprintf(file_size_str, sizeof(file_size_str), + "%dMB", ad->ft_info->size / (1024 * 1024)); + else + snprintf(file_size_str, sizeof(file_size_str), + "%dKB", ad->ft_info->size / 1024); + + snprintf(tmp, sizeof(tmp), BT_STR_FILE_SIZE_S, file_size_str); + g_strlcat(msg, tmp, BT_GLOBALIZATION_STR_LENGTH); + + markup_text = elm_entry_utf8_to_markup(msg); + elm_object_text_set(ad->ft_popup, markup_text); + } else if (ad->ft_type == BT_FT_RECV_SUCCESS_POPUP) { + elm_object_part_text_set(ad->ft_popup, "title,text", BT_STR_RECEIVED_FILES); + char file_size_str[BT_FILE_SIZE_STR] = { 0 }; + + snprintf(msg, sizeof(msg), BT_STR_FROM_S, ad->ft_info->dev_name); + g_strlcat(msg, NEW_LINE, BT_GLOBALIZATION_STR_LENGTH); + + name = strrchr(ad->ft_info->file_path, '/'); + if (name != NULL) + name++; + else + name = ad->ft_info->file_path; + + snprintf(tmp, sizeof(tmp), BT_STR_FILE_S, name); + g_strlcat(msg, tmp, BT_GLOBALIZATION_STR_LENGTH); + g_strlcat(msg, NEW_LINE, BT_GLOBALIZATION_STR_LENGTH); + + /* file size */ + if (ad->ft_info->size < 1024) + snprintf(file_size_str, sizeof(file_size_str), + "%dB", ad->ft_info->size); + else if (ad->ft_info->size > 1024 * 1024) + snprintf(file_size_str, sizeof(file_size_str), + "%dMB", ad->ft_info->size / (1024 * 1024)); + else + snprintf(file_size_str, sizeof(file_size_str), + "%dKB", ad->ft_info->size / 1024); + + snprintf(tmp, sizeof(tmp), BT_STR_FILE_SIZE_S, file_size_str); + g_strlcat(msg, tmp, BT_GLOBALIZATION_STR_LENGTH); + + markup_text = elm_entry_utf8_to_markup(msg); + elm_object_text_set(ad->ft_popup, markup_text); + } else if (ad->ft_type == BT_FT_RECV_FAIL_POPUP) { + elm_object_part_text_set(ad->ft_popup, "title,text", BT_STR_UNABLE_TO_RECEIVED_FILES); + + g_strlcat(msg, BT_STR_FILE_NOT_RECV, BT_GLOBALIZATION_STR_LENGTH); + g_strlcat(msg, NEW_LINE, BT_GLOBALIZATION_STR_LENGTH); + + snprintf(tmp, sizeof(tmp), BT_STR_FILE_S, ad->ft_info->file_path); + g_strlcat(msg, tmp, BT_GLOBALIZATION_STR_LENGTH); + g_strlcat(msg, NEW_LINE, BT_GLOBALIZATION_STR_LENGTH); + + snprintf(tmp, sizeof(tmp), BT_STR_FAIL_S, BT_STR_TR_CANCELLED); + g_strlcat(msg, tmp, BT_GLOBALIZATION_STR_LENGTH); + + markup_text = elm_entry_utf8_to_markup(msg); + elm_object_text_set(ad->ft_popup, markup_text); + } else if (ad->ft_type == BT_FT_FILE_NOT_EXIST) { + elm_object_part_text_set(ad->ft_popup, "title,text", BT_STR_RECEIVED_FILES); + + g_strlcat(msg, BT_STR_FILE_NOT_EXIST, BT_GLOBALIZATION_STR_LENGTH); + g_strlcat(msg, NEW_LINE, BT_GLOBALIZATION_STR_LENGTH); + + snprintf(tmp, sizeof(tmp), BT_STR_FILE_S, ad->ft_info->file_path); + g_strlcat(msg, tmp, BT_GLOBALIZATION_STR_LENGTH); + + markup_text = elm_entry_utf8_to_markup(msg); + elm_object_text_set(ad->ft_popup, markup_text); + } else if (ad->ft_type == BT_FT_RETRY_POPUP) { + elm_object_part_text_set(ad->ft_popup, "title,text", BT_STR_UNABLE_TO_SEND_FILES); + + snprintf(msg, sizeof(msg), BT_STR_SEND_FAIL_TO_S, ad->ft_info->dev_name); + g_strlcat(msg, NEW_LINE, BT_GLOBALIZATION_STR_LENGTH); + + name = strrchr(ad->ft_info->file_path, '/'); + if (name != NULL) + name++; + else + name = ad->ft_info->file_path; + + snprintf(tmp, sizeof(tmp), BT_STR_FILE_S, name); + g_strlcat(msg, tmp, BT_GLOBALIZATION_STR_LENGTH); + + markup_text = elm_entry_utf8_to_markup(msg); + elm_object_text_set(ad->ft_popup, markup_text); + } + + if (ad->ft_type == BT_FT_RETRY_POPUP) { + btn1 = elm_object_part_content_get(ad->ft_popup, "button1"); + if (ad->bt_status == BT_ADAPTER_DISABLED) { + if (btn1) + elm_object_text_set(btn1, BT_STR_OK); + } else { + if (btn1) + elm_object_text_set(btn1, BT_STR_RETRY); + } + } else { + btn1 = elm_object_part_content_get(ad->ft_popup, "button1"); + if (btn1) + elm_object_text_set(btn1, BT_STR_OK); + } + + if(markup_text) + free(markup_text); + + DBG(" -"); +} + +static void __bt_progress_ok_cb(void *data, Evas_Object *obj, void *event_info) +{ + DBG(" +"); + ret_if(data == NULL); + + bt_share_appdata_t *ad = NULL; + + ad = (bt_share_appdata_t *)data; + + _bt_destroy_progress_popup(ad); + + if (ad->tr_view == NULL) + _bt_terminate_app(); + + DBG("-"); + return; +} + +static void __bt_progress_cancel_cb(void *data, Evas_Object *obj, + void *event_info) +{ + DBG(" +"); + ret_if(data == NULL); + + bt_share_appdata_t *ad = NULL; + bt_share_popup_data_t *pb_data = NULL; + + ad = (bt_share_appdata_t *)data; + pb_data = evas_object_data_get(ad->progress_popup, "progressbar_data"); + _bt_abort_signal_send(ad, pb_data); + + _bt_destroy_progress_popup(ad); + + if (ad->tr_view == NULL) + _bt_terminate_app(); + + DBG("-"); + return; +} + +static void __bt_progress_mouseup_cb(void *data, + Evas *e, Evas_Object *obj, void *event_info) +{ + Evas_Event_Mouse_Up *ev = event_info; + bt_share_appdata_t *ad = NULL; + bt_share_popup_data_t *pb_data = NULL; + + ad = (bt_share_appdata_t *)data; + pb_data = evas_object_data_get(ad->progress_popup, "progressbar_data"); + + DBG("Mouse event callback function is called +"); + + if (ev->button == 3) { + _bt_abort_signal_send(ad, pb_data); + _bt_destroy_progress_popup(ad); + + if (ad->tr_view == NULL) + _bt_terminate_app(); + } + DBG("Mouse event callback -"); +} + +Evas_Object *_bt_create_progress_popup(bt_share_popup_data_t *data) +{ + DBG(" +"); + retv_if(data == NULL, NULL); + Evas_Object *popup = NULL; + Evas_Object *layout = NULL; + Evas_Object *progressbar = NULL; + bt_share_appdata_t *ad = app_state; + char temp[BT_PERCENT_STR_LEN] = { 0 }; + float i = 0.0; + int tmp = 0; + char *markup_text = NULL; + + popup = elm_popup_add(ad->win); + evas_object_size_hint_weight_set(popup, + EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + + layout = __bt_create_popup_pb_layout(popup, ad); + + elm_object_part_text_set(popup, "title,text", (!strcmp(data->transfer_type, "outbound")) ? + BT_STR_SEND_FILES : BT_STR_RECEIVE_FILES); + elm_object_part_text_set(layout, "elm.text.description", (!strcmp(data->transfer_type, "outbound")) ? + BT_STR_SENDING : BT_STR_RECEIVING); + + markup_text = elm_entry_utf8_to_markup(data->filename); + elm_object_part_text_set(layout, "elm.subtext.description", markup_text); + + if(markup_text) + free(markup_text); + + progressbar = __bt_create_progressbar(popup, ad); + elm_object_part_content_set(layout, "progressbar", progressbar); + ad->pb = progressbar; + + 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); + + snprintf(temp, BT_PERCENT_STR_LEN, "%d%%", tmp); + elm_object_part_text_set(progressbar,"elm.text.bottom.left", temp); + elm_object_signal_emit(progressbar, "elm.text.bottom.show", "elm"); + + ad->pb_transfer_id = data->transfer_id; + elm_object_content_set(popup, layout); + + _bt_create_button(popup, "popup", "button1", + BT_STR_RESUME, NULL, __bt_progress_ok_cb, ad); + _bt_create_button(popup, "popup", "button2", + BT_STR_CANCEL, NULL, __bt_progress_cancel_cb, ad); + eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, + __bt_progress_ok_cb, ad); + evas_object_event_callback_add(popup, EVAS_CALLBACK_MOUSE_UP, + __bt_progress_mouseup_cb, ad); + + evas_object_show(popup); + + DBG("-"); + ad->progress_data = data; + return popup; +} + +int _bt_destroy_progress_popup(bt_share_appdata_t *ad) +{ + DBG("+"); + + retvm_if(ad == NULL, 0, + "Invalid argument: ad is NULL"); + bt_share_popup_data_t *pb_data = NULL; + + if (ad->progress_popup) { + pb_data = evas_object_data_get(ad->progress_popup, + "progressbar_data"); + if (pb_data) { + g_free((gpointer)pb_data->filename); + g_free((gpointer)pb_data->percentage); + g_free((gpointer)pb_data->transfer_type); + g_free((gpointer)pb_data); + } + + evas_object_del(ad->progress_popup); + ad->progress_popup = NULL; + } + + DBG("-"); + return 0; +} + +void _bt_lang_changed_progress_popup(bt_share_appdata_t *ad) +{ + DBG(" +"); + ret_if(ad == NULL); + Evas_Object *btn1 = NULL; + Evas_Object *btn2 = NULL; + + elm_object_part_text_set(ad->progress_popup, "title,text", + (!strcmp(ad->progress_data->transfer_type, "outbound")) ? + BT_STR_SEND_FILES : BT_STR_RECEIVE_FILES); + elm_object_part_text_set(ad->progress_layout, "elm.text.description", + (!strcmp(ad->progress_data->transfer_type, "outbound")) ? + BT_STR_SENDING : BT_STR_RECEIVING); + + btn1 = elm_object_part_content_get(ad->progress_popup, "button1"); + if (btn1) + elm_object_text_set(btn1, BT_STR_RESUME); + btn2 = elm_object_part_content_get(ad->progress_popup, "button2"); + if (btn2) + elm_object_text_set(btn2, BT_STR_CANCEL); + + DBG(" -"); +} + +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"); + retvm_if(ad->pb_transfer_id != transfer_id, 0, "Invalid transfer_id!"); + retvm_if(!ad->progress_popup, 0, "No progress_popup!"); + + 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->pb,"elm.text.bottom.left", temp); + elm_object_signal_emit(ad->pb, "elm,bottom,text,show", "elm"); + return 0; +} + + +static gboolean __bt_info_popup_timer_cb(void *data, Evas_Object *obj, + void *event_info) +{ + DBG("+"); + bt_share_appdata_t *ad = (bt_share_appdata_t *)data; + retv_if(ad == NULL, FALSE); + + _bt_destroy_info_popup(ad); + + if (ad->tr_view == NULL) { + _bt_terminate_app(); + } + DBG("-"); + return FALSE; +} + +Evas_Object *_bt_create_info_popup(bt_share_appdata_t *ad, + const char *title, const char *text) +{ + DBG("+"); + Evas_Object *popup = NULL; + + retv_if((!ad || !title || !text), NULL); + retv_if (ad->info_popup != NULL, NULL); + + popup = elm_popup_add(ad->win); + elm_object_style_set(popup, "toast"); + evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, + EVAS_HINT_EXPAND); + + eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, + eext_popup_back_cb, NULL); + elm_object_text_set(popup, text); + evas_object_smart_callback_add(popup, "block,clicked", + (Evas_Smart_Cb)__bt_info_popup_timer_cb, ad); + + if(!elm_config_access_get()) { + 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); + } else { + evas_object_smart_callback_add(popup, "access,read,stop", + (Evas_Smart_Cb) __bt_info_popup_timer_cb, ad); + } + + evas_object_show(popup); + ad->info_popup = popup; + + DBG("-"); + 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); + + if (!ad->tr_view) + _bt_terminate_app(); + + return FALSE; +} + +Evas_Object *_bt_create_extinctive_info_popup(bt_share_appdata_t *ad, + const char *title, const char *text) +{ + DBG("+"); + Evas_Object *popup = NULL; + + retv_if((!ad || !title || !text), NULL); + + if (ad->info_popup != NULL) + return NULL; + + popup = elm_popup_add(ad->win); + elm_object_style_set(popup, "toast"); + evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, + EVAS_HINT_EXPAND); + + eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, + eext_popup_back_cb, NULL); + elm_object_text_set(popup, text); + evas_object_smart_callback_add(popup, "block,clicked", + (Evas_Smart_Cb)__bt_extinctive_info_popup_timer_cb, ad); + + if(!elm_config_access_get()) { + 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); + } else { + evas_object_smart_callback_add(popup, "access,read,stop", + (Evas_Smart_Cb) __bt_extinctive_info_popup_timer_cb, ad); + } + + evas_object_show(popup); + ad->info_popup = popup; + + DBG("-"); + return popup; +} + + +int _bt_destroy_info_popup(bt_share_appdata_t *ad) +{ + DBG("+"); + retvm_if(ad == NULL, 0, + "Invalid argument: ad is NULL\n"); + + if (ad->info_popup) { + DBG("delete popup"); + evas_object_del(ad->info_popup); + ad->info_popup = NULL; + } + + DBG("-"); + return 0; +} + diff --git a/src/bt-share-ui-popup.h b/src/bt-share-ui-popup.h new file mode 100644 index 0000000..8d8bed3 --- /dev/null +++ b/src/bt-share-ui-popup.h @@ -0,0 +1,68 @@ +/* +* bluetooth-share-ui +* +* Copyright 2012 Samsung Electronics Co., Ltd +* +* Contact: Hocheol Seo +* GirishAshok Joshi +* DoHyun Pyun +* +* 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_POPUP_H_ +#define __DEF_BT_SHARE_UI_POPUP_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include "bt-share-ui-main.h" + + +#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_ft_popup(bt_share_ft_popup_type_e type, + bt_tr_data_t *info); + +void _bt_lang_changed_ft_popup(bt_share_appdata_t *ad); + +Evas_Object *_bt_create_progress_popup(bt_share_popup_data_t *data); +void _bt_lang_changed_progress_popup(bt_share_appdata_t *ad); + +int _bt_update_progress_popup(bt_share_appdata_t *ad, int transfer_id, + const char *name, int percentage); + +int _bt_destroy_progress_popup(bt_share_appdata_t *ad); + + +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_info_popup(bt_share_appdata_t *ad); + +#ifdef __cplusplus +} +#endif +#endif /* __DEF_BT_SHARE_UI_POPUP_H_ */ diff --git a/src/bt-share-ui-resource.h b/src/bt-share-ui-resource.h new file mode 100644 index 0000000..66b5c27 --- /dev/null +++ b/src/bt-share-ui-resource.h @@ -0,0 +1,117 @@ +/* +* bluetooth-share-ui +* +* Copyright 2012 Samsung Electronics Co., Ltd +* +* Contact: Hocheol Seo +* GirishAshok Joshi +* DoHyun Pyun +* +* 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 + +/*============== String ================= */ +#define BT_COMMON_PKG "ug-bluetooth-efl" +#define BT_COMMON_RES "/usr/apps/ug-bluetooth-efl/shared/res/locale/" + +#define BT_PKGNAME "org.tizen.bluetooth-share-ui" +#define BT_PREFIX "/usr/apps/"BT_PKGNAME + +#define BT_ICON_RECV_FAIL "bluetooth_inbound_transfer_failed.png" +#define BT_ICON_RECV_PASS "bluetooth_inbound_transfer_successed.png" +#define BT_ICON_SEND_FAIL "bluetooth_outbound_transfer_failed.png" +#define BT_ICON_SEND_PASS "bluetooth_outbound_transfer_successed.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_ST_BODY_TRANSFER_FILES") +#define BT_STR_SEND_FILES \ + dgettext(BT_COMMON_PKG, "IDS_SMT_POP_SEND_FILES") +#define BT_STR_SENDING \ + dgettext(BT_COMMON_PKG, "IDS_BT_POP_SENDING_ING") +#define BT_STR_RECEIVING \ + dgettext(BT_COMMON_PKG, "IDS_BT_POP_RECEIVING_ING") +#define BT_STR_CLR_LIST \ + dgettext(BT_COMMON_PKG, "IDS_BT_BODY_CLEAR_LIST") +#define BT_STR_FILE_NOT_EXIST \ + dgettext(BT_COMMON_PKG, "IDS_BT_POP_FILE_DOES_NOT_EXIST") +#define BT_STR_NO_TRANSFER_HISTORY \ + dgettext(BT_COMMON_PKG, "IDS_BT_BODY_NO_TRANSFER_HISTORY") +#define BT_STR_SEND_FAIL_TO_S \ + dgettext(BT_COMMON_PKG, "IDS_BT_BODY_SENDING_FAILED_TO_PS") +#define BT_STR_FILE_NOT_RECV \ + dgettext(BT_COMMON_PKG, "IDS_BT_POP_FILE_NOT_RECEIVED") +#define BT_STR_FILE_S \ + dgettext(BT_COMMON_PKG, "IDS_BT_POP_FILE_C_PS") +#define BT_STR_FAIL_S \ + dgettext(BT_COMMON_PKG, "IDS_BT_POP_FAILURE_REASON_C_PS") +#define BT_STR_TO_S \ + dgettext(BT_COMMON_PKG, "IDS_BT_POP_TO_C_PS") +#define BT_STR_FILE_TYPE_S \ + dgettext(BT_COMMON_PKG, "IDS_BT_POP_FILE_TYPE_C_PS") +#define BT_STR_FILE_SIZE_S \ + dgettext(BT_COMMON_PKG, "IDS_BT_POP_FILE_SIZE_C_PS") +#define BT_STR_FROM_S \ + dgettext(BT_COMMON_PKG, "IDS_BT_HEADER_FROM_C_PS") +#define BT_STR_TR_CANCELLED \ + dgettext(BT_COMMON_PKG, "IDS_BT_POP_TRANSFER_CANCELLED") +#define BT_STR_UNABLE_TO_RECEIVE \ + dgettext(BT_COMMON_PKG, "IDS_BT_BODY_UNABLE_TO_RECEIVE") +#define BT_STR_SENT_FILES \ + dgettext(BT_COMMON_PKG, "IDS_BT_HEADER_SENT_FILES") +#define BT_STR_RECEIVED_FILES \ + dgettext(BT_COMMON_PKG, "IDS_BT_OPT_RECEIVED_FILES") +#define BT_STR_RECEIVE_FILES \ + dgettext(BT_COMMON_PKG, "IDS_BT_HEADER_RECEIVE_FILES_ABB") +#define BT_STR_UNABLE_TO_RECEIVED_FILES \ + dgettext(BT_COMMON_PKG, "IDS_BT_HEADER_UNABLE_TO_RECEIVE_FILES_ABB") +#define BT_STR_UNABLE_TO_SEND_FILES \ + dgettext(BT_COMMON_PKG, "IDS_BT_HEADER_UNABLE_TO_SEND_FILES_ABB") +#define BT_STR_UNABLE_TO_FIND_APPLICATION \ + dgettext(BT_COMMON_PKG, "IDS_MF_TPOP_UNABLE_TO_FIND_APPLICATION_TO_PERFORM_THIS_ACTION") +#define BT_STR_TR_COPIED_STATUS \ + dgettext(BT_COMMON_PKG, "IDS_BT_MBODY_P1SD_FILES_COPIED_P2SD_FAILED_ABB") +#define BT_STR_TR_1FILE_COPIED_STATUS \ + dgettext(BT_COMMON_PKG, "IDS_BT_MBODY_1_FILE_COPIED_PD_FAILED_ABB") + +#define BT_STR_INFORMATION dgettext(BT_COMMON_PKG, "IDS_ST_BODY_INFORMATION") +#define BT_STR_OK dgettext(BT_COMMON_PKG, "IDS_BT_BUTTON_OK") +#define BT_STR_HIDE dgettext(BT_COMMON_PKG, "IDS_CST_OPT_HIDE") +#define BT_STR_RESUME dgettext(BT_COMMON_PKG, "IDS_MAPS_POP_RESUME") +#define BT_STR_CANCEL dgettext(BT_COMMON_PKG, "IDS_BR_SK_CANCEL") +#define BT_STR_CLOSE dgettext(BT_COMMON_PKG, "IDS_CAM_SK_CLOSE") +#define BT_STR_YESTERDAY dgettext(BT_COMMON_PKG, "IDS_ST_BODY_YESTERDAY") +#define BT_STR_RETRY dgettext(BT_COMMON_PKG, "IDS_ST_BUTTON_RETRY") + +/* Access information */ +#define BT_STR_ACCES_INFO_MAX_LEN 512 +#define BT_STR_ACC_ICON "Icon" +#define BT_STR_ACC_TITLE "Title" + +#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 100755 index 0000000..77d333e --- /dev/null +++ b/src/bt-share-ui-view.c @@ -0,0 +1,1125 @@ +/* +* bluetooth-share-ui +* +* Copyright 2012 Samsung Electronics Co., Ltd +* +* Contact: Hocheol Seo +* GirishAshok Joshi +* DoHyun Pyun +* +* 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 +#include +#include +#include +#if 0 +#include +#include +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#if 0 +#include +#endif +#include + +#include "applog.h" +#include "bt-share-ui-view.h" +#include "bt-share-ui-popup.h" +#include "bt-share-ui-ipc.h" +#include "bt-share-ui-resource.h" +#include "bt-share-ui-widget.h" +#include "bt-share-ui-main.h" + + +#define BT_TIMESTAMP_LEN_MAX 18 +#define BT_DOWNLOAD_PHONE_FOLDER "/opt/usr/media/Downloads" +#define BT_DOWNLOAD_MMC_FOLDER "/opt/storage/sdcard/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_more_menu_cb(void *data, + Evas_Object *obj, void *event_info); + +Evas_Object *_bt_create_win(const char *name) +{ + Evas_Object *eo = NULL; + int w; + int h; + +#if 0 + eo = (Evas_Object *)app_get_preinitialized_window(name); +#endif + if (eo == NULL) { + ERR("app_get_preinitialized_window fail!"); + eo = elm_win_add(NULL, name, ELM_WIN_BASIC); + } + retv_if(!eo, NULL); + + elm_win_title_set(eo, name); + elm_win_borderless_set(eo, EINA_TRUE); +#if 0 + ecore_x_window_size_get(ecore_x_window_root_first_get(), &w, &h); +#endif + evas_object_resize(eo, w, h); + return eo; +} + +void _bt_terminate_app(void) +{ + DBG("Terminate BT SHARE UI"); + elm_exit(); +} + +void _bt_delete_selected_item(bt_share_appdata_t *ad) +{ + DBG("+"); + ret_if(ad == NULL); + +/* "Bluetooth share has closed unexpectedly" crash occurring. + After press OK in receive failed pop up. + TMWC-726 +*/ +#if 0 + if (ad->selected_item == NULL) + return; + + elm_object_item_del(ad->selected_item); + ad->selected_item = NULL; +#endif + + if (elm_genlist_items_count(ad->tr_genlist) == 0) { + _bt_nocontent_set(ad, TRUE); + ad->tr_genlist = NULL; + } +} + +static void __bt_clear_view(void *data) +{ + DBG("+"); + + bt_share_appdata_t *ad = (bt_share_appdata_t *)data; + ret_if(!ad); + + if (ad->tr_genlist) { + elm_genlist_clear(ad->tr_genlist); + ad->tr_genlist = NULL; + } + + if (ad->toolbar_btn) { + evas_object_del(ad->toolbar_btn); + ad->toolbar_btn = NULL; + } + + if (ad->navi_fr) { + evas_object_del(ad->navi_fr); + ad->navi_fr = NULL; + } + + if (ad->tr_view) { + evas_object_del(ad->tr_view); + ad->tr_view = NULL; + } + DBG("-"); +} + +static Eina_Bool __bt_back_button_cb(void *data, Elm_Object_Item *it) +{ + DBG("pop current view "); + retvm_if(!data, EINA_FALSE, "invalid parameter!"); + + bt_share_appdata_t *ad = (bt_share_appdata_t *)data; + int ret; + + __bt_clear_view(data); + + 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 "); + ad->tr_data_list = NULL; + } + + _bt_terminate_app(); + + return EINA_FALSE; +} + +static void __bt_clear_list_btn_cb(void *data, + Evas_Object *obj, + void *event_info) +{ + bt_share_appdata_t *ad = (bt_share_appdata_t *)data; + int clear_list = -1; + int ret; + + DBG("Clear genlist item"); + + notification_h noti = NULL; + int priv_id = 0; + notification_list_h list_head = NULL; + notification_list_h list_traverse = NULL; + char *app_id = NULL; + char *opp_role = NULL; + + if (ad->bt_status == BT_ADAPTER_DISABLED) { + sqlite3 *db = NULL; + bt_tr_db_table_e table; + + /* Update bt-share DB */ + db = bt_share_open_db(); + if (!db) + return; + + table = ad->tr_type ? BT_DB_INBOUND : BT_DB_OUTBOUND; + bt_share_remove_all_tr_data(db, table); + bt_share_close_db(db); + + /* Delete notification */ + notification_get_list(NOTIFICATION_TYPE_NOTI, -1, &list_head); + list_traverse = list_head; + + if (ad->tr_type == BT_DB_INBOUND) + opp_role = "bluetooth-share-opp-server"; + else + opp_role = "bluetooth-share-opp-client"; + + while (list_traverse != NULL) { + noti = notification_list_get_data(list_traverse); + notification_get_pkgname(noti, &app_id); + + if (g_strcmp0(app_id, opp_role) == 0) { + notification_get_id(noti, NULL, &priv_id); + notification_delete_by_priv_id(app_id, NOTIFICATION_TYPE_NOTI, priv_id); + priv_id = 0; + } + list_traverse = notification_list_get_next(list_traverse); + } + + if (list_head != NULL) { + notification_free_list(list_head); + list_head = NULL; + } + } else { + _bt_share_ui_ipc_info_update(ad, clear_list); + } + + if (ad->tr_genlist) { + elm_genlist_clear(ad->tr_genlist); + ad->tr_genlist = 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 "); + ad->tr_data_list = NULL; + } + + _bt_nocontent_set(ad, TRUE); + +} + +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); + retv_if(current_time == NULL, NULL); + cy = current_time->tm_year + 1900; + cm = current_time->tm_mon + 1; + cd = current_time->tm_mday; + + /* Get recorded time */ + pt = localtime(×tamp); + retv_if(pt == NULL, NULL); + 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"); + } + + if (format == VCONFKEY_TIME_FORMAT_12) + if (pt->tm_hour >=0 && pt->tm_hour < 12) + strftime(buf, sizeof(buf), "%I:%M AM", pt); + else + strftime(buf, sizeof(buf), "%I:%M PM", 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 *ly = NULL; + Evas_Object *icon = NULL; + bt_tr_data_t *info = NULL; + bt_share_appdata_t *ad = app_state; + char *img; + bt_gl_data_t *gl_data; + + retv_if(data == NULL, NULL); + + gl_data = (bt_gl_data_t *)data; + + info = gl_data->tr_data; + retv_if(info == NULL, NULL); + + if (!strcmp("elm.swallow.icon", part)) { + ly = elm_layout_add(obj); + elm_layout_theme_set(ly, "layout", "list/B/type.3", "default"); + + icon = elm_icon_add(obj); + if (ad->tr_type == BT_TR_OUTBOUND) { + img = (info->tr_status == BT_TR_SUCCESS) ? + BT_ICON_SEND_PASS : BT_ICON_SEND_FAIL; + } else { + img = (info->tr_status == BT_TR_SUCCESS) ? + BT_ICON_RECV_PASS : BT_ICON_RECV_FAIL; + } + + elm_image_file_set(icon, EDJ_IMAGES, img); + evas_object_size_hint_align_set(icon, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_size_hint_weight_set(icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + + evas_object_color_set(icon, 76, 76, 76 , 255); + + evas_object_show(icon); + elm_layout_content_set(ly, "elm.swallow.content", icon); + } + + return ly; +} + +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 }; + bt_gl_data_t *gl_data; + + retv_if(data == NULL, NULL); + gl_data = (bt_gl_data_t *)data; + + info = gl_data->tr_data; + retv_if(info == NULL, NULL); + + if (!strcmp("elm.text", part)) { + 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("elm.text.sub", part)) { + char *marked_name = elm_entry_utf8_to_markup(info->dev_name); + g_strlcpy(buf, marked_name, BT_GLOBALIZATION_STR_LENGTH); + if (marked_name) + free(marked_name); + } else if (!strcmp("elm.text.sub.end", part)) { + char *date = NULL; + date = __bt_get_tr_timedate((time_t)(info->timestamp)); + snprintf(buf, BT_GLOBALIZATION_STR_LENGTH, "%s", date); + g_free(date); + } else { + DBG("empty text for label."); + return NULL; + } + + return strdup(buf); +} + +static void __bt_tr_del(void *data, Evas_Object *obj) +{ + bt_gl_data_t *gl_data; + gl_data = (bt_gl_data_t *)data; + + g_free(gl_data); +} + +static void __bt_genlist_realized_cb(void *data, + Evas_Object *obj, void *event_info) +{ + retm_if(event_info == NULL, "Invalid param\n"); + + Elm_Object_Item *item = (Elm_Object_Item *)event_info; +#ifdef KIRAN_ACCESSIBILITY + Evas_Object *ao; + char str[BT_STR_ACCES_INFO_MAX_LEN] = {0, }; +#endif + char *name; + char *date; + bt_tr_data_t *info; + bt_gl_data_t *gl_data; + + gl_data = (bt_gl_data_t *)elm_object_item_data_get(item); + ret_if(gl_data == NULL); + + info = gl_data->tr_data; + + ret_if(info == NULL); + ret_if(info->dev_name == NULL); + ret_if(info->file_path == NULL); + + name = strrchr(info->file_path, '/'); + if (name != NULL) + name++; + else + name = info->file_path; + + date = __bt_get_tr_timedate((time_t)(info->timestamp)); + +#ifdef KIRAN_ACCESSIBILITY + snprintf(str, sizeof(str), "%s, %s, %s, %s", + BT_STR_ACC_ICON, name, info->dev_name, date); + ao = elm_object_item_access_object_get(item); + elm_access_info_set(ao, ELM_ACCESS_INFO, str); +#endif + g_free(date); +} + +static void __bt_popup_del_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + DBG("+"); + retm_if(data == NULL, "data is NULL"); + bt_share_appdata_t *ad = (bt_share_appdata_t *)data; + + evas_object_del(ad->info_popup); + ad->info_popup = NULL; + DBG("-"); +} + +void __bt_popup_del_by_timeout(void *data, Evas_Object *obj, void *event_info) +{ + DBG("+"); + bt_share_appdata_t *ad = (bt_share_appdata_t *)data; + ret_if(!ad); + if (ad->info_popup){ + evas_object_del(ad->info_popup); + ad->info_popup = NULL; + } + DBG("-"); +} + +Evas_Object *__bt_create_error_popup(bt_share_appdata_t *ad) +{ + DBG("+"); + Evas_Object *popup = NULL; + retvm_if(ad == NULL, NULL, "ad is NULL"); + + popup = elm_popup_add(ad->win); + retvm_if(popup == NULL, NULL, "popup is NULL"); + + elm_object_focus_set(popup, EINA_FALSE); + evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + + elm_object_text_set(popup, BT_STR_UNABLE_TO_FIND_APPLICATION); + + elm_popup_timeout_set(popup, 3); + evas_object_smart_callback_add(popup, "timeout", (Evas_Smart_Cb)__bt_popup_del_by_timeout, ad); + evas_object_show(popup); + evas_object_event_callback_add(popup, EVAS_CALLBACK_DEL, __bt_popup_del_cb, ad); + + ad->info_popup = popup; + + DBG("-"); + return popup; +} + +static gboolean __bt_open_received_file(const char *path) +{ + DBG("+"); + app_control_h handle; + int ret; + bt_share_appdata_t *ad = app_state; + + app_control_create(&handle); + app_control_set_operation(handle, APP_CONTROL_OPERATION_VIEW); + app_control_set_uri(handle, path); + ret = app_control_send_launch_request(handle, NULL, NULL); + + if (ret == APP_CONTROL_ERROR_APP_NOT_FOUND) + __bt_create_error_popup(ad); + + app_control_destroy(handle); + DBG("-"); + 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) +{ + DBG("+"); + 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); + } + + if (g_slist_length(ad->tr_data_list) == 0) { + _bt_nocontent_set(ad, TRUE); + ad->tr_genlist = NULL; + } +} + +void _bt_update_tr_notification(void *data) +{ + ret_if(data == NULL); + + bt_share_appdata_t *ad = app_state; + bt_tr_data_t *info = NULL; + sqlite3 *db = NULL; + int success = 0; + int fail = 0; + char *opp_role = NULL; + notification_h noti = NULL; + int priv_id = 0; + notification_list_h list_head = NULL; + notification_list_h list_traverse = NULL; + char *app_id = NULL; + + info = (bt_tr_data_t *)data; + + DBG("Transfer type: %s", ad->tr_type == BT_DB_INBOUND ? "Receive" : "Sent"); + + db = bt_share_open_db(); + if (!db) + return; + + if (ad->tr_type == BT_DB_INBOUND) + opp_role = "bluetooth-share-opp-server"; + else + opp_role = "bluetooth-share-opp-client"; + + + /* Delete selected outbound db / notification info */ + if (bt_share_remove_tr_data_by_id(db, ad->tr_type, info->id) == 0) + DBG("successfully TR ID removed from DB"); +#if 0 + bt_share_get_tr_result_count(db, ad->tr_type, &success, &fail); +#endif + DBG("success: %d, fail: %d", success, fail); + + /* Delete notification */ + notification_get_list(NOTIFICATION_TYPE_NOTI, -1, &list_head); + list_traverse = list_head; + + while (list_traverse != NULL) { + noti = notification_list_get_data(list_traverse); + notification_get_pkgname(noti, &app_id); + + if (g_strcmp0(app_id, opp_role) == 0) { + notification_get_id(noti, NULL, &priv_id); + break; + } + list_traverse = notification_list_get_next(list_traverse); + } + + if (success == 0 && fail == 0) { + notification_delete_by_priv_id(app_id, NOTIFICATION_TYPE_NOTI, priv_id); + } else { + char str[BT_GLOBALIZATION_STR_LENGTH] = { 0 }; + if (success == 1) + snprintf(str, sizeof(str), BT_STR_TR_1FILE_COPIED_STATUS, fail); + else + snprintf(str, sizeof(str), BT_STR_TR_COPIED_STATUS, + success, fail); + + notification_set_content(noti, str, NULL); + notification_update(noti); + } + + if (list_head != NULL) { + notification_free_list(list_head); + list_head = NULL; + } + + bt_share_close_db(db); +} + +static void __bt_tr_data_recv_item_sel(void *data, Evas_Object *obj, + void *event_info) +{ + bt_share_appdata_t *ad = app_state; + bt_tr_data_t *info = NULL; + char *path = NULL; + char *ext = NULL; + int default_memory = 0; + + DBG("Select received item"); + + 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) { + ret_if(info->file_path == NULL); + INFO_SECURE("File : %s", info->file_path); + if (vconf_get_int(VCONFKEY_SETAPPL_DEFAULT_MEM_BLUETOOTH_INT, + &default_memory) != 0) { + ERR("vconf get failed"); + } + path = info->file_path; + INFO_SECURE("path : %s", path); + ext = strrchr(path, '.'); + if (ext) { + ext++; + if (0 == g_strcmp0(ext, "vcf")) { + ad->ft_popup = _bt_create_ft_popup( + BT_FT_RECV_SUCCESS_POPUP, info); + return; + } + } + + if (access(path, F_OK) == 0) { + __bt_open_received_file(path); + if (ad->bt_status == BT_ADAPTER_DISABLED) { + _bt_update_tr_notification(info); + _bt_delete_selected_item(ad); + } else { /*Adapter enabled case */ + _bt_share_ui_ipc_info_update(ad, info->id); + _bt_delete_selected_item(ad); + } + } else { + ad->ft_popup = _bt_create_ft_popup(BT_FT_FILE_NOT_EXIST, + info); + _bt_share_ui_ipc_info_update(ad, info->id); + _bt_delete_selected_item(ad); + } + + } else { + ad->ft_popup = _bt_create_ft_popup(BT_FT_RECV_FAIL_POPUP, info); + } + + return; +} + +static void __bt_tr_data_sent_item_sel(void *data, Evas_Object *obj, + void *event_info) +{ + DBG("+"); + 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) + ad->ft_popup = _bt_create_ft_popup(BT_FT_SENT_POPUP, info); + else + ad->ft_popup = _bt_create_ft_popup(BT_FT_RETRY_POPUP, info); + + DBG("-"); + return; +} + +void _bt_append_genlist_tr_data_item(bt_share_appdata_t *ad, + Evas_Object *genlist, bt_tr_data_t *info, int tr_type) +{ + DBG("+"); + + retm_if (ad == NULL || info == NULL, "Invalid parameters!"); + + bt_gl_data_t *gl_data = NULL; + + gl_data = g_new0(bt_gl_data_t, 1); + gl_data->tr_data = info; + + if (tr_type == BT_TR_OUTBOUND) { + elm_genlist_item_append(genlist, ad->tr_data_itc, gl_data, + NULL, ELM_GENLIST_ITEM_NONE, + __bt_tr_data_sent_item_sel, info); + + if (ad->outbound_latest_id < info->id) + ad->outbound_latest_id = info->id; + } else if (tr_type == BT_TR_INBOUND) { + elm_genlist_item_append(genlist, ad->tr_data_itc, gl_data, + NULL, ELM_GENLIST_ITEM_NONE, + __bt_tr_data_recv_item_sel, info); + + if (ad->inbound_latest_id < info->id) + ad->inbound_latest_id = info->id; + } else { + ERR("Transfer type is invalid"); + } + + evas_object_show(genlist); + + DBG("-"); +} + + +void _bt_prepend_genlist_tr_data_item(bt_share_appdata_t *ad, + bt_tr_data_t *info, int tr_type) +{ + DBG("+"); + + if (ad == NULL || info == NULL) + return; + + if (elm_genlist_items_count(ad->tr_genlist) == 0) { + _bt_nocontent_set(ad, FALSE); + } + + bt_gl_data_t *gl_data; + + gl_data = g_new0(bt_gl_data_t, 1); + gl_data->tr_data = info; + + if (tr_type == BT_TR_OUTBOUND) { + elm_genlist_item_prepend(ad->tr_genlist, ad->tr_data_itc, + gl_data, NULL, + ELM_GENLIST_ITEM_NONE, + __bt_tr_data_sent_item_sel, info); + + 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, + gl_data, NULL, + ELM_GENLIST_ITEM_NONE, + __bt_tr_data_recv_item_sel, info); + + if (ad->inbound_latest_id < info->id) + ad->inbound_latest_id = info->id; + } else { + ERR("Transfer type is invalid"); + g_free(gl_data); + } + + evas_object_show(ad->tr_genlist); + + DBG("-"); + return; +} + +static void __bt_share_gl_highlighted(void *data, Evas_Object *obj, + void *event_info) +{ + Elm_Object_Item *item = (Elm_Object_Item *)event_info; + bt_gl_data_t *gl_data; + DBG("+"); + + ret_if(item == NULL); + + gl_data = (bt_gl_data_t *)elm_object_item_data_get(item); + ret_if(gl_data == NULL); + + gl_data->highlighted = TRUE; + + elm_genlist_item_fields_update(item, "*", + ELM_GENLIST_ITEM_FIELD_CONTENT); + + DBG("-"); +} + +static void __bt_share_gl_unhighlighted(void *data, Evas_Object *obj, + void *event_info) +{ + Elm_Object_Item *item = (Elm_Object_Item *)event_info; + bt_gl_data_t *gl_data; + DBG("+"); + + ret_if(item == NULL); + + gl_data = (bt_gl_data_t *)elm_object_item_data_get(item); + ret_if(gl_data == NULL); + gl_data->highlighted = FALSE; + + elm_genlist_item_fields_update(item, "*", + ELM_GENLIST_ITEM_FIELD_CONTENT); + + DBG("-"); +} + +static Evas_Object *__bt_add_tr_data_genlist(Evas_Object *parent, + bt_share_appdata_t *ad) +{ + DBG("+"); + retvm_if (ad == NULL, NULL, "Inavalid parameter!"); + + Evas_Object *genlist = elm_genlist_add(parent); + + evas_object_smart_callback_add(genlist, "highlighted", + __bt_share_gl_highlighted, ad); + + evas_object_smart_callback_add(genlist, "unhighlighted", + __bt_share_gl_unhighlighted, ad); + + evas_object_smart_callback_add(genlist, "realized", + __bt_genlist_realized_cb, ad); + + ad->tr_data_itc = elm_genlist_item_class_new(); + if (ad->tr_data_itc) { + ad->tr_data_itc->item_style = "type1"; + 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 = __bt_tr_del; + } + + elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS); + DBG("-"); + return genlist; +} + +static Evas_Object * __bt_create_naviframe(bt_share_appdata_t *ad) +{ + DBG("+"); + retv_if (ad == NULL, NULL); + Evas_Object *navi_fr = NULL; + /* Naviframe */ + navi_fr = elm_naviframe_add(ad->tr_view); + eext_object_event_callback_add(navi_fr, EEXT_CALLBACK_BACK, + eext_naviframe_back_cb, NULL); + elm_object_part_content_set(ad->tr_view, "elm.swallow.content", navi_fr); + evas_object_show(navi_fr); + DBG("-"); + return navi_fr; +} + +void _bt_nocontent_set(bt_share_appdata_t *ad, gboolean set) +{ + DBG("+"); + ret_if(ad == NULL); + Evas_Object *layout = NULL; + Evas_Object *nocontents = NULL; + Evas_Object *genlist = NULL; + Elm_Object_Item *navi_it = NULL; + + DBG("Set nocontent status : %d", set); + + if (set == TRUE) { + /* Full view layout */ + layout = elm_layout_add(ad->navi_fr); + elm_layout_file_set(layout, EDJFILE, "nocontents_layout"); + evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL); + + /* Create elm_layout and set its style as nocontents/text */ + nocontents = elm_layout_add(layout); + elm_layout_theme_set(nocontents, "layout", "nocontents", "default"); + evas_object_size_hint_weight_set(nocontents, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(nocontents, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_object_part_text_set(nocontents, "elm.text", BT_STR_NO_TRANSFER_HISTORY); + elm_layout_signal_emit(nocontents, "text,disabled", ""); + elm_layout_signal_emit(nocontents, "align.center", "elm"); + + if (ad->navi_it) { + elm_object_item_part_content_set(ad->navi_it, + "elm.swallow.content", nocontents); + } else { + navi_it = elm_naviframe_item_push(ad->navi_fr, + (ad->tr_type == BT_TR_INBOUND) ? + BT_STR_RECEIVED_FILES : + BT_STR_SENT_FILES, + NULL, NULL, nocontents, NULL); + elm_naviframe_item_pop_cb_set(navi_it, + __bt_back_button_cb, ad); + ad->navi_it = navi_it; + } + + if (ad->toolbar_btn) { + evas_object_del(ad->toolbar_btn); + ad->toolbar_btn = NULL; + } + eext_object_event_callback_del(ad->navi_fr, EEXT_CALLBACK_MORE, + __bt_more_menu_cb); + + }else { + genlist = __bt_add_tr_data_genlist(ad->tr_view, ad); + retvm_if (genlist == NULL, -1, "genlist is NULL!"); + + if (ad->tr_genlist) { + DBG("Clear the previous genlist"); + elm_genlist_clear(ad->tr_genlist); + ad->tr_genlist = NULL; + } + + ad->tr_genlist = genlist; + + if (ad->navi_it) { + elm_object_item_part_content_set(ad->navi_it, + "elm.swallow.content", genlist); + } else { + navi_it = elm_naviframe_item_push(ad->navi_fr, + (ad->tr_type == BT_TR_INBOUND) ? + BT_STR_RECEIVED_FILES : + BT_STR_SENT_FILES, + NULL, NULL, genlist, NULL); + elm_naviframe_item_pop_cb_set(navi_it, __bt_back_button_cb, ad); + ad->navi_it = navi_it; + } + + eext_object_event_callback_add(ad->navi_fr, EEXT_CALLBACK_MORE, + __bt_more_menu_cb, ad); + } +} + +void _bt_cb_state_changed(int result, + bt_adapter_state_e adapter_state, + void *user_data) +{ + DBG("bluetooth %s", adapter_state == BT_ADAPTER_ENABLED ? + "enabled" : "disabled"); + + ret_if(!user_data); + ret_if(result != BT_ERROR_NONE); + + bt_share_appdata_t *ad = (bt_share_appdata_t *)user_data; + Evas_Object *btn = NULL; + + ad->bt_status = adapter_state; + + if (ad->ft_popup && ad->ft_type == BT_FT_RETRY_POPUP) { + btn = elm_object_part_content_get(ad->ft_popup, "button1"); + ret_if(!btn); + elm_object_text_set(btn, adapter_state == BT_ADAPTER_ENABLED ? BT_STR_RETRY : BT_STR_OK); + } + + if(adapter_state == BT_ADAPTER_DISABLED && ad->progress_popup) { + DBG("Adapter disabled, and progress popup is present, destroying"); + _bt_destroy_progress_popup(ad); + } +} + +static void __bt_move_clear_ctxpopup(Evas_Object *ctxpopup, + bt_share_appdata_t *ad) +{ + FN_START; + Evas_Coord w, h; + int pos = -1; + + ret_if(ad == NULL); + ret_if(ad->win == NULL); + + elm_win_screen_size_get(ad->win, NULL, NULL, &w, &h); + pos = elm_win_rotation_get(ad->win); + + switch (pos) { + case 0: + case 180: + evas_object_move(ctxpopup, (w / 2), h); + break; + case 90: + evas_object_move(ctxpopup, (h / 2), w); + break; + case 270: + evas_object_move(ctxpopup, (h / 2), w); + break; + } + FN_END; +} + +static void __bt_clear_btn_del_cb(void *data) +{ + FN_START; + bt_share_appdata_t *ad = NULL; + + ret_if(data == NULL); + ad = (bt_share_appdata_t *)data; + + if (ad->toolbar_btn != NULL) { + evas_object_del(ad->toolbar_btn); + ad->toolbar_btn = NULL; + } + + FN_END; +} + +static void __bt_win_rotation_changed_cb(void *data, Evas_Object *obj, + void *event_info) +{ + bt_share_appdata_t *ad = (bt_share_appdata_t *)data; + __bt_move_clear_ctxpopup(ad->toolbar_btn, ad); +} + +static void __bt_clear_btn_delete_cb(void *data, Evas *e, + Evas_Object *obj, void *event_info) +{ + FN_START; + Evas_Object *navi = (Evas_Object *)data; + Evas_Object *ctx = obj; + + ret_if (navi == NULL); + + evas_object_event_callback_del_full(ctx, EVAS_CALLBACK_DEL, + __bt_clear_btn_delete_cb, navi); + FN_END; +} + +static void __bt_more_menu_cb(void *data, + Evas_Object *obj, void *event_info) +{ + FN_START; + + Evas_Object *more_ctxpopup = NULL; + bt_share_appdata_t *ad; + + ad = (bt_share_appdata_t *)data; + ret_if(ad == NULL); + + more_ctxpopup = elm_ctxpopup_add(ad->win); + ad->toolbar_btn = more_ctxpopup; + eext_object_event_callback_add(more_ctxpopup, + EEXT_CALLBACK_BACK, __bt_clear_btn_del_cb, ad); + eext_object_event_callback_add(more_ctxpopup, + EEXT_CALLBACK_MORE, __bt_clear_btn_del_cb, ad); + elm_object_style_set(more_ctxpopup, "more/default"); + elm_ctxpopup_auto_hide_disabled_set(more_ctxpopup, EINA_TRUE); + + elm_ctxpopup_item_append(more_ctxpopup, BT_STR_CLR_LIST, + NULL, __bt_clear_list_btn_cb, ad); + evas_object_smart_callback_add(ad->win, "rotation,changed", + __bt_win_rotation_changed_cb, ad); + evas_object_event_callback_add(more_ctxpopup, EVAS_CALLBACK_DEL, + __bt_clear_btn_delete_cb, ad); + + elm_ctxpopup_direction_priority_set(more_ctxpopup, ELM_CTXPOPUP_DIRECTION_UP, + ELM_CTXPOPUP_DIRECTION_DOWN, + ELM_CTXPOPUP_DIRECTION_UNKNOWN, + ELM_CTXPOPUP_DIRECTION_UNKNOWN); + + __bt_move_clear_ctxpopup(more_ctxpopup, ad); + evas_object_show(more_ctxpopup); + + FN_END; +} +int _bt_create_transfer_view(bt_share_appdata_t *ad) +{ + DBG("Create transfer view"); + retv_if (ad == NULL, -1); + + Elm_Object_Item *navi_it = NULL; + Evas_Object *conform = NULL; + Evas_Object *navi_fr = NULL; + Evas_Object *bg = NULL; + Evas_Object *layout = NULL; + Evas_Object *genlist = NULL; + GSList *list_iter = NULL; + + __bt_clear_view(ad); + bg = _bt_create_bg(ad->win, NULL); + retv_if (bg == NULL, -1); + ad->bg = bg; + + conform = _bt_create_conformant(ad->win, NULL); + retvm_if (conform == NULL, -1, "conform is NULL!"); + ad->conform = conform; + + bg = elm_bg_add(conform); + elm_object_style_set(bg, "indicator/headerbg"); + elm_object_part_content_set(conform, "elm.swallow.indicator_bg", bg); + evas_object_show(bg); + + layout = _bt_create_layout(conform, EDJFILE, "share_view"); + ad->tr_view = layout; + + elm_object_content_set(conform, layout); + elm_win_conformant_set(ad->win, EINA_TRUE); + + navi_fr = __bt_create_naviframe(ad); + retvm_if (navi_fr == NULL, -1, "navi_fr is NULL!"); + ad->navi_fr = navi_fr; + + /* Genlist */ + genlist = __bt_add_tr_data_genlist(layout, ad); + retvm_if (genlist == NULL, -1, "genlist is NULL!"); + ad->tr_genlist = genlist; + + list_iter = ad->tr_data_list; + + /* Add genlist item */ + while (NULL != list_iter) { + _bt_append_genlist_tr_data_item(ad, genlist, list_iter->data, + ad->tr_type); + list_iter = g_slist_next(list_iter); + } + eext_object_event_callback_add(navi_fr, EEXT_CALLBACK_MORE, + __bt_more_menu_cb, ad); + navi_it = elm_naviframe_item_push(navi_fr, + (ad->tr_type == BT_TR_INBOUND) ? + BT_STR_RECEIVED_FILES : + BT_STR_SENT_FILES, + NULL, NULL, genlist, NULL); + elm_naviframe_item_pop_cb_set(navi_it, __bt_back_button_cb, ad); + ad->navi_it = navi_it; + + DBG("-"); + return 0; +} + diff --git a/src/bt-share-ui-view.h b/src/bt-share-ui-view.h new file mode 100644 index 0000000..e221d8d --- /dev/null +++ b/src/bt-share-ui-view.h @@ -0,0 +1,57 @@ +/* +* bluetooth-share-ui +* +* Copyright 2012 Samsung Electronics Co., Ltd +* +* Contact: Hocheol Seo +* GirishAshok Joshi +* DoHyun Pyun +* +* 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 +#include + +#define BT_GLOBALIZATION_STR_LENGTH 256 +#define BT_FILE_NAME_LEN_MAX 255 + +Evas_Object *_bt_create_win(const char *name); +void _bt_terminate_app(void); +void _bt_append_genlist_tr_data_item(bt_share_appdata_t *ad, + Evas_Object *genlist, 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); +void _bt_delete_selected_item(bt_share_appdata_t *ad); +int _bt_create_transfer_view(bt_share_appdata_t *ad); +void _bt_nocontent_set(bt_share_appdata_t *ad, gboolean set); +void _bt_cb_state_changed(int result, + bt_adapter_state_e adapter_state, + void *user_data); +void _bt_update_tr_notification(void *data); + +#ifdef __cplusplus +} +#endif +#endif /* __DEF_BT_SHARE_UI_VIEW_H_ */ diff --git a/src/bt-share-ui-widget.c b/src/bt-share-ui-widget.c new file mode 100644 index 0000000..9715af8 --- /dev/null +++ b/src/bt-share-ui-widget.c @@ -0,0 +1,192 @@ +/* +* ug-setting-bluetooth-efl +* +* Copyright 2012 Samsung Electronics Co., Ltd +* +* Contact: Hocheol Seo +* GirishAshok Joshi +* DoHyun Pyun +* +* 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 + +#include +#include "applog.h" +#include "bt-share-ui-widget.h" +#include "bt-share-ui-main.h" +#include + +#define IMG_PATH_MAX 256 + +Evas_Object *_bt_create_naviframe(Evas_Object *parent) +{ + Evas_Object *nf; + + retvm_if(parent == NULL, NULL, "Invalid argument: parent is NULL\n"); + + nf = elm_naviframe_add(parent); + elm_object_part_content_set(parent, "elm.swallow.content", nf); + evas_object_show(nf); + + return nf; +} + +Evas_Object *_bt_create_button(Evas_Object *parent, char *style, char *part, + char *text, char *icon_path, + Evas_Smart_Cb func, void *data) +{ + Evas_Object *btn = NULL; + Evas_Object *icon = NULL; + + retvm_if(parent == NULL, NULL, "Invalid argument: parent is NULL\n"); + btn = elm_button_add(parent); + + if (style) + elm_object_style_set(btn, style); + + if (part) + elm_object_part_content_set(parent, part, btn); + + if (icon_path) { + icon = elm_image_add(btn); + elm_image_file_set(icon, icon_path, NULL); + elm_object_part_content_set(btn, "elm.icon", icon); + } + + if (text) + elm_object_text_set(btn, text); + + if (func) + evas_object_smart_callback_add(btn, "clicked", func, data); + + evas_object_show(btn); + + return btn; +} + +Evas_Object *_bt_create_progressbar(Evas_Object *parent, const char *style) +{ + Evas_Object *progress_bar = NULL; + + retvm_if(parent == NULL, NULL, "Invalid argument: parent is NULL\n"); + + progress_bar = elm_progressbar_add(parent); + + if (style) + elm_object_style_set(progress_bar, style); + else + elm_object_style_set(progress_bar, "list_process"); + + evas_object_show(progress_bar); + elm_progressbar_pulse(progress_bar, EINA_TRUE); + + return progress_bar; +} + +Evas_Object *_bt_create_bg(Evas_Object *parent, char *style) +{ + retvm_if(parent == NULL, NULL, "Invalid argument: parent is NULL\n"); + + Evas_Object *bg = NULL; +#if 0 + Evas_Object *bg = app_get_preinitialized_background(); +#endif + if (bg == NULL) { + ERR("app_get_preinitialized_background fail!"); + 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); + + evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, + EVAS_HINT_EXPAND); + elm_win_resize_object_add(parent, bg); + evas_object_show(bg); + + return bg; +} + +Evas_Object *_bt_create_layout(Evas_Object *parent, char *edj, char *content) +{ + Evas_Object *layout; + + retvm_if(parent == NULL, NULL, "Invalid argument: parent is NULL\n"); + + layout = elm_layout_add(parent); + + if (edj != NULL && content != NULL) + elm_layout_file_set(layout, edj, content); + else { + elm_layout_theme_set(layout, "layout", "application", + "default"); + evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, + EVAS_HINT_EXPAND); + } + + evas_object_show(layout); + + return layout; +} + +Evas_Object *_bt_create_label(Evas_Object *parent, const char *text) +{ + Evas_Object *label; + + retvm_if(parent == NULL, NULL, "Invalid argument: parent is NULL\n"); + + label = elm_label_add(parent); + elm_label_line_wrap_set(label, ELM_WRAP_MIXED); + + if (text) + elm_object_text_set(label, text); + + evas_object_size_hint_weight_set(label, EVAS_HINT_EXPAND, 0.0); + evas_object_size_hint_align_set(label, EVAS_HINT_FILL, EVAS_HINT_FILL); + + evas_object_show(label); + + return label; +} + +Evas_Object *_bt_create_conformant(Evas_Object *parent, Evas_Object *content) +{ + Evas_Object *conform = NULL; + + elm_win_conformant_set(parent, 1); +#if 0 + conform = (Evas_Object *)app_get_preinitialized_conformant(); +#endif + if (conform == NULL) { + ERR("app_get_preinitialized_conformant fail!"); + conform = elm_conformant_add(parent); + } + + evas_object_size_hint_weight_set(conform, EVAS_HINT_EXPAND, + EVAS_HINT_EXPAND); + elm_win_resize_object_add(parent, conform); + /* elm_object_style_set(conform, "internal_layout"); */ + evas_object_show(conform); + + if (content) + elm_object_content_set(conform, content); + + return conform; +} + diff --git a/src/bt-share-ui-widget.h b/src/bt-share-ui-widget.h new file mode 100644 index 0000000..b51dca9 --- /dev/null +++ b/src/bt-share-ui-widget.h @@ -0,0 +1,56 @@ +/* +* bluetooth-share-ui +* +* Copyright 2012 Samsung Electronics Co., Ltd +* +* Contact: Hocheol Seo +* GirishAshok Joshi +* DoHyun Pyun +* +* 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 __BT_SHARE_UI_WIDGET_H__ +#define __BT_SHARE_UI_WIDGET_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include + +Evas_Object *_bt_create_naviframe(Evas_Object *parent); + +Evas_Object *_bt_create_button(Evas_Object *parent, char *style, char *part, + char *text, char *icon_path, + Evas_Smart_Cb func, void *data); + +Evas_Object *_bt_create_progressbar(Evas_Object *parent, + const char *style); + +Evas_Object *_bt_create_bg(Evas_Object *parent, char *style); + +Evas_Object *_bt_create_layout(Evas_Object *parent, char *edj, + char *content); + +Evas_Object *_bt_create_label(Evas_Object *parent, const char *text); + +Evas_Object *_bt_create_conformant(Evas_Object *parent, + Evas_Object *content); + +#ifdef __cplusplus +} +#endif +#endif /* __BT_SHARE_UI_WIDGET_H__ */ -- 2.7.4 From 0f4d76df7324adfef8c8c670c4d73b55a64d0ad6 Mon Sep 17 00:00:00 2001 From: Taejin Woo Date: Mon, 4 Jan 2016 09:04:13 +0900 Subject: [PATCH 3/5] Remove Sys-assert dependency Change-Id: I44150a0757ebcefba3668a4a927610a30bdc5ac2 Signed-off-by: Taejin Woo --- data/org.tizen.bluetooth-share-ui.efl | 1 - packaging/org.tizen.bluetooth-share-ui.spec | 1 - 2 files changed, 2 deletions(-) diff --git a/data/org.tizen.bluetooth-share-ui.efl b/data/org.tizen.bluetooth-share-ui.efl index d20f919..db2aaa8 100644 --- a/data/org.tizen.bluetooth-share-ui.efl +++ b/data/org.tizen.bluetooth-share-ui.efl @@ -25,7 +25,6 @@ org.tizen.bluetooth-share-ui system::share rwxat- ------ org.tizen.bluetooth-share-ui pulseaudio rwxat- ------ e17 org.tizen.bluetooth-share-ui -w---- ------ org.tizen.bluetooth-share-ui device::app_logging -w---- ------ -org.tizen.bluetooth-share-ui sys-assert::core rwxat- ------ org.tizen.bluetooth-share-ui privacy-manager::db r----l ------ org.tizen.bluetooth-share-ui pkgmgr::db r----l ------ org.tizen.bluetooth-share-ui tizen::vconf::public r----- ------ diff --git a/packaging/org.tizen.bluetooth-share-ui.spec b/packaging/org.tizen.bluetooth-share-ui.spec index d56c10f..b7290ac 100755 --- a/packaging/org.tizen.bluetooth-share-ui.spec +++ b/packaging/org.tizen.bluetooth-share-ui.spec @@ -13,7 +13,6 @@ Source0: %{name}-%{version}.tar.gz ExcludeArch: %{arm} %ix86 x86_64 %endif -Requires(post): sys-assert BuildRequires: pkgconfig(dbus-glib-1) BuildRequires: pkgconfig(dlog) BuildRequires: pkgconfig(vconf) -- 2.7.4 From c36009786769d2036f70d238d7531e0c6477b993 Mon Sep 17 00:00:00 2001 From: DoHyun Pyun Date: Tue, 3 May 2016 13:59:19 +0900 Subject: [PATCH 4/5] Fix Jira issue (TSAM-2484) Can't open received file http://suprem.sec.samsung.net/jira/browse/TSAM-2484 Change-Id: Ie2ce7e6f9c48a25c694fa0a97947d795442e5add Signed-off-by: DoHyun Pyun --- data/org.tizen.bluetooth-share-ui.xml | 4 ++-- packaging/org.tizen.bluetooth-share-ui.spec | 2 +- src/bt-share-ui-resource.h | 4 ++-- src/bt-share-ui-view.c | 3 ++- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/data/org.tizen.bluetooth-share-ui.xml b/data/org.tizen.bluetooth-share-ui.xml index 89cf260..4b6c69e 100644 --- a/data/org.tizen.bluetooth-share-ui.xml +++ b/data/org.tizen.bluetooth-share-ui.xml @@ -1,9 +1,9 @@ - + Injun Yang Bluetooth Share UI application - + org.tizen.bluetooth-share-ui.png diff --git a/packaging/org.tizen.bluetooth-share-ui.spec b/packaging/org.tizen.bluetooth-share-ui.spec index b7290ac..29946bc 100755 --- a/packaging/org.tizen.bluetooth-share-ui.spec +++ b/packaging/org.tizen.bluetooth-share-ui.spec @@ -9,7 +9,7 @@ Group: TO_BE_FILLED License: Flora-1.1 Source0: %{name}-%{version}.tar.gz -%if "%{?tizen_profile_name}" != "mobile" +%if "%{?profile}" != "mobile" ExcludeArch: %{arm} %ix86 x86_64 %endif diff --git a/src/bt-share-ui-resource.h b/src/bt-share-ui-resource.h index 66b5c27..8bcc941 100644 --- a/src/bt-share-ui-resource.h +++ b/src/bt-share-ui-resource.h @@ -31,8 +31,8 @@ extern "C" { #include /*============== String ================= */ -#define BT_COMMON_PKG "ug-bluetooth-efl" -#define BT_COMMON_RES "/usr/apps/ug-bluetooth-efl/shared/res/locale/" +#define BT_COMMON_PKG "ug-setting-bluetooth-efl" +#define BT_COMMON_RES "/usr/ug/res/locale/" #define BT_PKGNAME "org.tizen.bluetooth-share-ui" #define BT_PREFIX "/usr/apps/"BT_PKGNAME diff --git a/src/bt-share-ui-view.c b/src/bt-share-ui-view.c index 77d333e..f7ad7c3 100755 --- a/src/bt-share-ui-view.c +++ b/src/bt-share-ui-view.c @@ -85,8 +85,9 @@ Evas_Object *_bt_create_win(const char *name) elm_win_borderless_set(eo, EINA_TRUE); #if 0 ecore_x_window_size_get(ecore_x_window_root_first_get(), &w, &h); -#endif evas_object_resize(eo, w, h); +#endif + return eo; } -- 2.7.4 From 91be7e78d47d3e73e6b489c724ed244a200925e4 Mon Sep 17 00:00:00 2001 From: DoHyun Pyun Date: Tue, 3 May 2016 15:04:26 +0900 Subject: [PATCH 5/5] Add the privilege for appmanager Change-Id: I7d2b4a3a5d45270792b67a0bf15ad972f060e795 Signed-off-by: DoHyun Pyun --- data/org.tizen.bluetooth-share-ui.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/data/org.tizen.bluetooth-share-ui.xml b/data/org.tizen.bluetooth-share-ui.xml index 4b6c69e..c849372 100644 --- a/data/org.tizen.bluetooth-share-ui.xml +++ b/data/org.tizen.bluetooth-share-ui.xml @@ -7,4 +7,8 @@ org.tizen.bluetooth-share-ui.png + + http://tizen.org/privilege/appmanager.launch + http://tizen.org/privilege/appmanager.kill + -- 2.7.4