diff options
261 files changed, 46163 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100755 index 00000000..d1418c51 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,297 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) +PROJECT(browser CXX) + +SET(SRCS + src/browser-class.cpp + src/browser-window.cpp + src/browser-main.cpp + src/browser-common-view.cpp + src/browser-data-manager.cpp + src/browser-utility.cpp + src/browser-extension/browser-find-word.cpp + src/browser-extension/browser-download-manager.cpp + src/browser-extension/browser-exscheme-handler.cpp + src/browser-extension/browser-picker-handler.cpp + src/browser-extension/browser-notification-manager.cpp + src/browser-security/browser-personal-data-manager.cpp + src/browser-security/browser-authentication-manager.cpp + src/browser-security/browser-certificate-manager.cpp + src/browser-view/browser-view.cpp + src/browser-view/browser-predictive-history.cpp + src/browser-view/browser-context-menu.cpp + src/browser-multi-window/browser-multi-window-view.cpp + src/data-network/browser-network-manager.cpp + src/browser-bookmark/browser-bookmark-view.cpp + src/browser-bookmark/browser-add-to-bookmark-view.cpp + src/browser-bookmark/browser-new-folder-view.cpp + src/browser-bookmark/browser-select-folder-view.cpp + src/browser-history/browser-history-layout.cpp + src/database/browser-bookmark-db.cpp + src/database/browser-user-agent-db.cpp + src/database/browser-history-db.cpp + src/database/browser-personal-data-db.cpp + src/database/browser-notification-db.cpp + src/browser-settings/browser-settings-class.cpp + src/browser-settings/browser-settings-main-view.cpp + src/browser-settings/browser-settings-edit-homepage-view.cpp + src/browser-settings/browser-settings-clear-data-view.cpp + src/browser-settings/browser-settings-plugin-view.cpp + src/browser-settings/browser-settings-user-agent-view.cpp + src/browser-settings/browser-settings-accelerated-composition.cpp +) + +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}/src/include) +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src) +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/database) +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/data-network) +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/browser-bookmark) +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/browser-view) +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/browser-multi-window) +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/browser-history) +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/browser-settings) +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/browser-extension) +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/browser-security) + +# set pkg-config modules +INCLUDE(FindPkgConfig) +pkg_check_modules(pkgs REQUIRED + eina ecore evas ecore-evas edbus elementary + appcore-efl dlog db-util utilX ui-gadget tapi sensor + secure-storage libsoup-2.4 libxml-2.0 libssl elm-webview notification + ecore-input ecore-imf edje cairo ecore-x ewebkit appsvc devman + capi-appfw-app-manager capi-appfw-application capi-web-url-download devman_haptic +) + +FIND_LIBRARY(LIB_GNUTLS gnutls) +FOREACH(flag ${pkgs_CFLAGS}) + SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") +ENDFOREACH(flag) + +# set extra defines +SET(PREFIX ${CMAKE_INSTALL_PREFIX}) +SET(BINDIR "${PREFIX}/bin") +SET(RESDIR "${PREFIX}/res") +SET(DATADIR "${PREFIX}/data") +# res (read-only) +SET(EDJE_DIR "${RESDIR}/edje/") +SET(LOCALE_DIR "${RESDIR}/locale/") +SET(IMAGES_DIR "${RESDIR}/images/") +SET(HTML_DIR "${RESDIR}/html/") +SET(ICON_DIR "${RESDIR}/icons/default/small/") +# data +SET(XML_DIR "${DATADIR}/xml/") +SET(OPML_DIR "${DATADIR}/opml/") +SET(DATABASE_DIR "${DATADIR}/db/") +SET(SCREENSHOTS_DIR "${DATADIR}/screenshots/") +SET(CERTIFICATES_TMP_FILE "${DATADIR}/certificates.crt") +SET(WEBKIT_SOUP_CACHE_DIR "${DATADIR}/cache/") +# other defines +SET(CERTIFICATES_DIR "/opt/etc/ssl/certs/") +SET(DATABASENAME ".browser.db") +SET(HISTORY_DATABASENAME ".browser-history.db") +SET(CREDENTIAL_DATABASENAME ".browser-credential.db") +SET(SPEEDDIAL_DATABASENAME ".browser-speeddial.db") +SET(COOKIES_DATABASENAME ".browser-cookies.db") +SET(DESKTOP_DIR "/opt/share/applications") +ADD_DEFINITIONS( + -DPROJECT_NAME=\"${PROJECT_NAME}\" + -DDATABASENAME=\"${DATABASENAME}\" + -DHISTORY_DATABASENAME=\"${HISTORY_DATABASENAME}\" + -DCREDENTIAL_DATABASENAME=\"${CREDENTIAL_DATABASENAME}\" + -DSPEEDDIAL_DATABASENAME=\"${SPEEDDIAL_DATABASENAME}\" + -DCOOKIES_DATABASENAME=\"${COOKIES_DATABASENAME}\" + -DEDJE_DIR=\"${EDJE_DIR}\" + -DLOCALEDIR=\"${LOCALE_DIR}\" + -DIMAGES_DIR=\"${IMAGES_DIR}\" + -DSCREENSHOTS_DIR=\"${SCREENSHOTS_DIR}\" + -DHTML_DIR=\"${HTML_DIR}\" + -DXML_DIR=\"${XML_DIR}\" + -DOPML_DIR=\"${OPML_DIR}\" + -DCERTIFICATES_DIR=\"${CERTIFICATES_DIR}\" + -DCERTIFICATES_TMP_FILE=\"${CERTIFICATES_TMP_FILE}\" + -DDATABASE_DIR=\"${DATABASE_DIR}\" + -DWEBKIT_SOUP_CACHE_DIR=\"${WEBKIT_SOUP_CACHE_DIR}\" + -DLOG_TAG=\"org.tizen.browser\" + -D__BUILD__ +) + +# set flags +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS}") +SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -g") +SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2") + +FIND_PROGRAM(UNAME NAMES uname) +EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH") +IF("${ARCH}" STREQUAL "arm") + ADD_DEFINITIONS("-D_TARGET") + MESSAGE("add -D_TARGET") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpie") + #SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -mabi=aapcs-linux -march=armv7-a -msoft-float") + SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -mabi=aapcs-linux -mfpu=vfp -mfloat-abi=softfp") + SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie") +ENDIF("${ARCH}" STREQUAL "arm") + +SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed -Wl,--hash-style=both") + +# real make?? +ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS}) +TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} ${LIB_GNUTLS}) +#TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} ewebkit) + +# browser-define.edj +ADD_CUSTOM_TARGET(browser-define.edj + COMMAND edje_cc -id ${CMAKE_SOURCE_DIR}/images + ${CMAKE_SOURCE_DIR}/edc/browser-define.edc + ${CMAKE_BINARY_DIR}/edc/browser-define.edj + DEPENDS ${CMAKE_SOURCE_DIR}/edc/browser-define.edc + ) +ADD_DEPENDENCIES(${PROJECT_NAME} browser-define.edj) + +# browser-view-progressbar.edj +ADD_CUSTOM_TARGET(browser-view-progressbar.edj + COMMAND edje_cc -id ${CMAKE_SOURCE_DIR}/images + ${CMAKE_SOURCE_DIR}/edc/browser-view-progressbar.edc + ${CMAKE_BINARY_DIR}/edc/browser-view-progressbar.edj + DEPENDS ${CMAKE_SOURCE_DIR}/edc/browser-view-progressbar.edc + ) +ADD_DEPENDENCIES(${PROJECT_NAME} browser-view-progressbar.edj) + +# browser-naviframe.edj +ADD_CUSTOM_TARGET(browser-naviframe.edj + COMMAND edje_cc -id ${CMAKE_SOURCE_DIR}/images + ${CMAKE_SOURCE_DIR}/edc/browser-naviframe.edc + ${CMAKE_BINARY_DIR}/edc/browser-naviframe.edj + DEPENDS ${CMAKE_SOURCE_DIR}/edc/browser-naviframe.edc + ) +ADD_DEPENDENCIES(${PROJECT_NAME} browser-naviframe.edj) + +# browser-view-main.edj +ADD_CUSTOM_TARGET(browser-view-main.edj + COMMAND edje_cc -id ${CMAKE_SOURCE_DIR}/images + ${CMAKE_SOURCE_DIR}/edc/browser-view-main.edc + ${CMAKE_BINARY_DIR}/edc/browser-view-main.edj + DEPENDS ${CMAKE_SOURCE_DIR}/edc/browser-view-main.edc + ) +ADD_DEPENDENCIES(${PROJECT_NAME} browser-view-main.edj) + +# browser-view-url-layout.edj +ADD_CUSTOM_TARGET(browser-view-url-layout.edj + COMMAND edje_cc -id ${CMAKE_SOURCE_DIR}/images + ${CMAKE_SOURCE_DIR}/edc/browser-view-url-layout.edc + ${CMAKE_BINARY_DIR}/edc/browser-view-url-layout.edj + DEPENDS ${CMAKE_SOURCE_DIR}/edc/browser-view-url-layout.edc + ) +ADD_DEPENDENCIES(${PROJECT_NAME} browser-view-url-layout.edj) + +# browser-view-find-word-layout.edj +ADD_CUSTOM_TARGET(browser-view-find-word-layout.edj + COMMAND edje_cc -id ${CMAKE_SOURCE_DIR}/images + ${CMAKE_SOURCE_DIR}/edc/browser-view-find-word-layout.edc + ${CMAKE_BINARY_DIR}/edc/browser-view-find-word-layout.edj + DEPENDS ${CMAKE_SOURCE_DIR}/edc/browser-view-find-word-layout.edc + ) +ADD_DEPENDENCIES(${PROJECT_NAME} browser-view-find-word-layout.edj) + +# browser-view-control-bar.edj +ADD_CUSTOM_TARGET(browser-view-control-bar.edj + COMMAND edje_cc -id ${CMAKE_SOURCE_DIR}/images + ${CMAKE_SOURCE_DIR}/edc/browser-view-control-bar.edc + ${CMAKE_BINARY_DIR}/edc/browser-view-control-bar.edj + DEPENDS ${CMAKE_SOURCE_DIR}/edc/browser-view-control-bar.edc + ) +ADD_DEPENDENCIES(${PROJECT_NAME} browser-view-control-bar.edj) + +# browser-bookmark-view.edj +ADD_CUSTOM_TARGET(browser-bookmark-view.edj + COMMAND edje_cc -id ${CMAKE_SOURCE_DIR}/images + ${CMAKE_SOURCE_DIR}/edc/browser-bookmark-view.edc + ${CMAKE_BINARY_DIR}/edc/browser-bookmark-view.edj + DEPENDS ${CMAKE_SOURCE_DIR}/edc/browser-bookmark-view.edc + ) +ADD_DEPENDENCIES(${PROJECT_NAME} browser-bookmark-view.edj) + +# browser-multi-window.edj +ADD_CUSTOM_TARGET(browser-multi-window.edj + COMMAND edje_cc -id ${CMAKE_SOURCE_DIR}/images + ${CMAKE_SOURCE_DIR}/edc/browser-multi-window.edc + ${CMAKE_BINARY_DIR}/edc/browser-multi-window.edj + DEPENDS ${CMAKE_SOURCE_DIR}/edc/browser-multi-window.edc + ) +ADD_DEPENDENCIES(${PROJECT_NAME} browser-multi-window.edj) + +# browser-predictive-history.edj +ADD_CUSTOM_TARGET(browser-predictive-history.edj + COMMAND edje_cc -id ${CMAKE_SOURCE_DIR}/images + ${CMAKE_SOURCE_DIR}/edc/browser-predictive-history.edc + ${CMAKE_BINARY_DIR}/edc/browser-predictive-history.edj + DEPENDS ${CMAKE_SOURCE_DIR}/edc/browser-predictive-history.edc + ) +ADD_DEPENDENCIES(${PROJECT_NAME} browser-predictive-history.edj) + +# browser-settings.edj +ADD_CUSTOM_TARGET(browser-settings.edj + COMMAND edje_cc -id ${CMAKE_SOURCE_DIR}/images + ${CMAKE_SOURCE_DIR}/edc/browser-settings.edc + ${CMAKE_BINARY_DIR}/edc/browser-settings.edj + DEPENDS ${CMAKE_SOURCE_DIR}/edc/browser-settings.edc + ) +ADD_DEPENDENCIES(${PROJECT_NAME} browser-settings.edj) + +# browser-picker-layout.edj +ADD_CUSTOM_TARGET(browser-picker-layout.edj + COMMAND edje_cc -id ${CMAKE_SOURCE_DIR}/images + ${CMAKE_SOURCE_DIR}/edc/browser-picker-layout.edc + ${CMAKE_BINARY_DIR}/edc/browser-picker-layout.edj + DEPENDS ${CMAKE_SOURCE_DIR}/edc/browser-picker-layout.edc + ) +ADD_DEPENDENCIES(${PROJECT_NAME} browser-picker-layout.edj) + +# install browser +INSTALL(PROGRAMS ${PROJECT_NAME} DESTINATION bin) +# install edj +INSTALL(FILES ${CMAKE_BINARY_DIR}/edc/browser-define.edj DESTINATION ${EDJE_DIR}) +INSTALL(FILES ${CMAKE_BINARY_DIR}/edc/browser-naviframe.edj DESTINATION ${EDJE_DIR}) +INSTALL(FILES ${CMAKE_BINARY_DIR}/edc/browser-view-main.edj DESTINATION ${EDJE_DIR}) +INSTALL(FILES ${CMAKE_BINARY_DIR}/edc/browser-view-progressbar.edj DESTINATION ${EDJE_DIR}) +INSTALL(FILES ${CMAKE_BINARY_DIR}/edc/browser-view-url-layout.edj DESTINATION ${EDJE_DIR}) +INSTALL(FILES ${CMAKE_BINARY_DIR}/edc/browser-view-find-word-layout.edj DESTINATION ${EDJE_DIR}) +INSTALL(FILES ${CMAKE_BINARY_DIR}/edc/browser-view-control-bar.edj DESTINATION ${EDJE_DIR}) +INSTALL(FILES ${CMAKE_BINARY_DIR}/edc/browser-bookmark-view.edj DESTINATION ${EDJE_DIR}) +INSTALL(FILES ${CMAKE_BINARY_DIR}/edc/browser-multi-window.edj DESTINATION ${EDJE_DIR}) +INSTALL(FILES ${CMAKE_BINARY_DIR}/edc/browser-predictive-history.edj DESTINATION ${EDJE_DIR}) +INSTALL(FILES ${CMAKE_BINARY_DIR}/edc/browser-settings.edj DESTINATION ${EDJE_DIR}) +INSTALL(FILES ${CMAKE_BINARY_DIR}/edc/browser-picker-layout.edj DESTINATION ${EDJE_DIR}) + +# install images +INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/images/install/ DESTINATION ${IMAGES_DIR} + FILES_MATCHING + PATTERN "*.png" +) +# install html files +INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/html/ DESTINATION ${HTML_DIR} + FILES_MATCHING PATTERN "*.html" + PATTERN "*.png" +) +# install empty directories +INSTALL(DIRECTORY DESTINATION ${DATABASE_DIR}) +INSTALL(DIRECTORY DESTINATION ${XML_DIR}) +INSTALL(DIRECTORY DESTINATION ${OPML_DIR}) +INSTALL(DIRECTORY DESTINATION ${SCREENSHOTS_DIR}) +INSTALL(DIRECTORY DESTINATION ${WEBKIT_SOUP_CACHE_DIR}) + +# install desktop file & icon +CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/resource/org.tizen.${PROJECT_NAME}.desktop.in org.tizen.${PROJECT_NAME}.desktop) +INSTALL(FILES ${CMAKE_BINARY_DIR}/org.tizen.${PROJECT_NAME}.desktop DESTINATION ${DESKTOP_DIR}) +INSTALL(FILES ${CMAKE_SOURCE_DIR}/resource/org.tizen.${PROJECT_NAME}.png DESTINATION ${ICON_DIR}) +INSTALL(FILES ${CMAKE_SOURCE_DIR}/resource/default_0 DESTINATION ${SCREENSHOTS_DIR}) +INSTALL(FILES ${CMAKE_SOURCE_DIR}/resource/default_1 DESTINATION ${SCREENSHOTS_DIR}) +INSTALL(FILES ${CMAKE_SOURCE_DIR}/resource/default_2 DESTINATION ${SCREENSHOTS_DIR}) +INSTALL(FILES ${CMAKE_SOURCE_DIR}/resource/default_3 DESTINATION ${SCREENSHOTS_DIR}) + +# i18n +ADD_SUBDIRECTORY(po) diff --git a/INSTALL b/INSTALL new file mode 100755 index 00000000..906443a1 --- /dev/null +++ b/INSTALL @@ -0,0 +1,33 @@ +1. make the build directory + + ex) + + $ mkdir build + + +2. change the working directory to the build directory + + ex) + + $ cd build + + +3. run 'cmake' + + $ cmake ${SOURCE_DIR} -DCMAKE_INSTALL_PREFIX=/opt/apps/@@PKGNAME@@ + + ex) + + $ cmake .. -DCMAKE_INSTALL_PREFIX=/opt/apps/org.tizen.browser + + or + + $ cmake .. + + +4. make & make install + + ex) + + $ make -j 2 && make install + diff --git a/LICENSE b/LICENSE new file mode 100755 index 00000000..7ccb5b5a --- /dev/null +++ b/LICENSE @@ -0,0 +1,75 @@ +Flora License + +Version 1.0, May, 2012 + +http://www.tizenopensource.org/license + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +"Tizen Certified Platform" shall mean a software platform that complies with the standards set forth in the Compatibility Definition Document and passes the Compatibility Test Suite as defined from time to time by the Tizen Technical Steering Group and certified by the Tizen Association or its designated agent. + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work solely as incorporated into a Tizen Certified Platform, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work solely as incorporated into a Tizen Certified Platform to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof pursuant to the copyright license above, in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + 1. You must give any other recipients of the Work or Derivative Works a copy of this License; and + + 2. You must cause any modified files to carry prominent notices stating that You changed the files; and + + 3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + 4. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Flora License to your work + +To apply the Flora License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Flora License, Version 1.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.tizenopensource.org/license + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/debian/changelog b/debian/changelog new file mode 100755 index 00000000..e6d73598 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,9 @@ +browser (0.1.14-0) unstable; urgency=low + + * Git : slp/plgs/b/browser + * Tag : browser_0.1.14-0 + + * Replace icon of browser(internet) + * update spec file + + -- Junghwan Kang <junghwan.kang@samsung.com> Sat, 21 Apr 2012 20:05:28 +0900 diff --git a/debian/compat b/debian/compat new file mode 100755 index 00000000..7ed6ff82 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +5 diff --git a/debian/control b/debian/control new file mode 100755 index 00000000..46b6608a --- /dev/null +++ b/debian/control @@ -0,0 +1,19 @@ +Source: browser +Section: misc +Priority: extra +Maintainer: JungHwan Kang <junghwan.kang@samsung.com>, Sangpyo Kim <sangpyo7.kim@samsung.com>, Hyerim Bae <hyerim.bae@samsung.com>, Inbum Chang <ibchang@samsung.com> +Uploaders: JungHwan Kang <junghwan.kang@samsung.com>, Sangpyo Kim <sangpyo7.kim@samsung.com>, Hyerim Bae <hyerim.bae@samsung.com>, Inbum Chang <ibchang@samsung.com> +Build-Depends: debhelper (>= 5), libelm-webview-dev, libeina-dev(>=0.0.1), libwebkit-engine-dev, libappcore-common-dev, libappcore-efl-dev, libecore-dev(>=0.9), libevas-dev(>=0.1), libcairo2-dev, dlog-dev, libvconf-dev, libslp-db-util-dev, libaul-1-dev, libui-gadget-dev, libssl-dev, libss-client-dev, libxml2-dev, libbundle-dev, libsoup2.4-dev, libgnutls-dev, libedje-dev, libslp-tapi-dev, libslp-sensor-dev, libslp-utilx-dev, libappsvc-dev, libdevman-dev, libnotification-dev, capi-appfw-application, capi-appfw-app-manager-dev, capi-web-url-download-dev, libdevman-haptic-dev +Standards-Version: 0.1.0 + +Package: org.tizen.browser +Section: misc +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: webkit browser with EFL + +Package: org.tizen.browser-dbg +Section: debug +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, org.tizen.browser (= ${Source-Version}) +Description: webkit browser with EFL (unstripped) diff --git a/debian/dirs b/debian/dirs new file mode 100755 index 00000000..ca882bbb --- /dev/null +++ b/debian/dirs @@ -0,0 +1,2 @@ +usr/bin +usr/sbin diff --git a/debian/docs b/debian/docs new file mode 100755 index 00000000..e69de29b --- /dev/null +++ b/debian/docs diff --git a/debian/org.tizen.browser.install.in b/debian/org.tizen.browser.install.in new file mode 100755 index 00000000..971fab7a --- /dev/null +++ b/debian/org.tizen.browser.install.in @@ -0,0 +1,9 @@ +@PREFIX@/bin/* +@PREFIX@/res/* +@PREFIX@/res/locale/* +@PREFIX@/res/edje/* +@PREFIX@/res/icons/* +@PREFIX@/res/html/* +@PREFIX@/res/images/* +@PREFIX@/data/* +opt/share/applications/* diff --git a/debian/org.tizen.browser.postinst b/debian/org.tizen.browser.postinst new file mode 100755 index 00000000..5e3947db --- /dev/null +++ b/debian/org.tizen.browser.postinst @@ -0,0 +1,217 @@ +#!/bin/sh +if [ ${USER} == "root" ] +then + # Change file owner + chown -R 5000:5000 /opt/apps/org.tizen.browser/data +fi + +### Bookmark ### +if [ ! -f /opt/dbspace/.internet_bookmark.db ]; +then + sqlite3 /opt/dbspace/.internet_bookmark.db 'PRAGMA journal_mode=PERSIST; + CREATE TABLE bookmarks(id INTEGER PRIMARY KEY AUTOINCREMENT, type INTEGER, parent INTEGER, address, title, creationdate, sequence INTEGER, updatedate, editable INTEGER, accesscount INTEGER, favicon BLOB, favicon_length INTEGER, favicon_w INTEGER, favicon_h INTEGER); + create index idx_bookmarks_on_parent_type on bookmarks(parent, type); + + insert into bookmarks (type, parent, title, creationdate, editable, sequence, accesscount) values(1, 0, "Bookmarks", DATETIME("now"), 0, 1, 0);' +fi + +##### History ###### +if [ ! -f /opt/dbspace/.browser-history.db ]; +then + sqlite3 /opt/dbspace/.browser-history.db 'PRAGMA journal_mode=PERSIST; + CREATE TABLE history(id INTEGER PRIMARY KEY AUTOINCREMENT, address, title, counter INTEGER, visitdate DATETIME, favicon BLOB, favicon_length INTEGER, favicon_w INTEGER, favicon_h INTEGER);' +fi + +##### Notification ##### +if [ ! -f /opt/apps/org.tizen.browser/data/db/.browser-notification.db ]; +then + sqlite3 /opt/apps/org.tizen.browser/data/db/.browser-notification.db 'PRAGMA journal_mode=PERSIST; + CREATE TABLE notification_table(id INTEGER PRIMARY KEY AUTOINCREMENT, notification INTEGER, title, body, url, iconURL, iconValidity INTEGER); + CREATE TABLE notification_permitted_domains(domain PRIMARY KEY);' +fi + +##### Password ###### +if [ ! -f /opt/apps/org.tizen.browser/data/db/.browser-credential.db ]; +then + sqlite3 /opt/apps/org.tizen.browser/data/db/.browser-credential.db 'PRAGMA journal_mode=PERSIST; + create table passwords(id integer primary key autoincrement, address, login, password)' +fi + +#### USER AGENTS ##### +#initDB +#rm /opt/apps/org.tizen.browser/data/db/.browser.db +# create db +#FILE = /opt/apps/org.tizen.browser/data/db/.browser.db +if [ ! -f /opt/apps/org.tizen.browser/data/db/.browser.db ]; +then + sqlite3 /opt/apps/org.tizen.browser/data/db/.browser.db 'PRAGMA journal_mode=PERSIST; + create table user_agents(name primary key, value)' + # mobile + sqlite3 /opt/apps/org.tizen.browser/data/db/.browser.db 'PRAGMA journal_mode=PERSIST; + insert into user_agents values("Galaxy S", "Mozilla/5.0 (Linux; U; Android 2.3.7; en-gb; GT-I9000 Build/GRJ22) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1"); + insert into user_agents values("Galaxy S II", "Mozilla/5.0 (Linux; U; Android 2.3.5; en-gb; GT-I9100 Build/GINGERBREAD) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1"); + insert into user_agents values("SLP Galaxy", "Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; GT-I9500 Build/GINGERBREAD) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1"); + insert into user_agents values("Tizen", "Mozilla/5.0 (Linux; U; Tizen 1.0; en-us) AppleWebKit/534.46 (KHTML, like Gecko) Mobile Tizen Browser/1.0"); + insert into user_agents values("Galaxy Nexus", "Mozilla/5.0 (Linux; U; Android 4.0.3; en-us; Galaxy Nexus Build/IML74K) AppleWebKit/535.7 (KHTML, like Gecko) Mobile Safari/535.7"); + insert into user_agents values("Samsung", "Mozilla/5.0 (SAMSUNG; SAMSUNG-GT-I9200/1.0; U; Linux/SLP/2.0; ko-kr) AppleWebKit/534.4 (KHTML, like Gecko) Dolfin/2.0 Mobile"); + insert into user_agents values("Samsung Dolfin", "SAMSUNG-GT-S8500/S8500XXJD2 SHP/VPP/R5 Dolfin/2.0 Nextreaming SMM-MMS/1.2.0 profile/MIDP-2.1 configuration/CLDC-1.1"); + insert into user_agents values("Apple iPhone 3", "Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0 like Mac OS X; en-us) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/1A542a Safari/419.3"); + insert into user_agents values("Apple iPhone 4", "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_2_1 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Mobile/8C148 Safari/6533.18.5"); + insert into user_agents values("Apple iOS 5", "Mozilla/5.0 (iPhone; CPU iPhone OS 5_0 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.0.2 Mobile/9A5259f Safari/6533.18.5"); + insert into user_agents values("Android 2.3 (Nexus One)", "Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; Nexus One Build/GRJ22) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1"); + insert into user_agents values("Opera Mobi", "Opera/9.80 (Windows NT 6.1; U; Edition IBIS; en) Presto/2.6.30 Version/10.63"); + insert into user_agents values("Samsung Bada", "Mozilla/5.0 (SAMSUNG; SAMSUNG-GT-S8500/1.0; U; Bada/1.0; en-us) AppleWebKit/533.1 (KHTML, like Gecko) Dolfin/2.0 Mobile WVGA SMM-MMS/1.2.0 OPN-B"); + insert into user_agents values("Orange TV", "Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A543a Safari/419.3 OrangeAppliTV/2.3.9"); + insert into user_agents values("Chrome Browser for android", "Mozilla/5.0 (Linux; U; Android 4.0.1; ko-kr; Galaxy Nexus Build/ITL41F) AppleWebKit/535.7 (KHTML, like Gecko) CrMo/16.0.912.75 Mobile Safari/535.7"); + insert into user_agents values("MANGO(Nokia 800C)", "Mozilla/5.0 (compatible; MSIE 9.0; Windows Phone OS 7.5; Trident/5.0; IEMobile/9.0; Nokia; 800C)"); + insert into user_agents values("System user agent", ""); + insert into user_agents values("Samsung Bada 2.0", "Mozilla/5.0 (SAMSUNG; SAMSUNG-GT-S8500/1.0; U; Bada/2.0; en-us) AppleWebKit/534.20 (KHTML, like Gecko) Mobile WVGA SMM-MMS/1.2.0 OPN-B Dolfin/3.0")' + + # desktop + sqlite3 /opt/apps/org.tizen.browser/data/db/.browser.db 'PRAGMA journal_mode=PERSIST; + insert into user_agents values("Samsung Desktop", "Mozilla/5.0 (U; Linux/SLP/2.0; ko-kr) AppleWebKit/533.1 (KHTML, like Gecko)"); + insert into user_agents values("Firefox 5", "Mozilla/5.0 (Windows NT 6.1; rv:9.0.1) Gecko/20100101 Firefox/9.0.1"); + insert into user_agents values("Firefox 5 Fennec(Mobile)", "Mozilla/5.0 (Android; Linux armv7l; rv:5.0) Gecko/20110615 Firefox/5.0 Fennec/5.0"); + insert into user_agents values("Safari 5.0", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/534.52.7 (KHTML, like Gecko) Version/5.1.2 Safari/534.52.7"); + insert into user_agents values("Google Chrome 18.0", "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.16 (KHTML, like Gecko) Chrome/18.0.1003.1 Safari/535.16"); + insert into user_agents values("Internet Explorer 9", "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)"); + insert into user_agents values("Galaxy Tab 10.1", "Mozilla/5.0 (Linux; U; Android 3.0.1; en-us; GT-P7100 Build/HRI83) AppleWebKit/534.13 (KHTML, like Gecko) Version/4.0 Safari/534.13"); + insert into user_agents values("iPad 2", "Mozilla/5.0 (iPad; U; CPU OS 4_3_5 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8L1 Safari/6533.18.5")' +fi + +#init cookies DB +#rm /optpps/org.tizen.browser/data/db/dbspace/.browser-cookies.db +# create cookies db +#FILE = /opt/apps/org.tizen.browser/data/db/.browser-cookies.db + +if [ ! -f /opt/apps/org.tizen.browser/data/db/.browser-cookies.db ]; +then + sqlite3 /opt/apps/org.tizen.browser/data/db/.browser-cookies.db 'CREATE TABLE moz_cookies (id INTEGER PRIMARY KEY, name TEXT, value TEXT, host TEXT, path TEXT,expiry INTEGER, lastAccessed INTEGER, isSecure INTEGER, isHttpOnly INTEGER);' + #test cookie + #sqlite3 /opt/apps/org.tizen.browser/data/db/.browser-cookies.db 'INSERT INTO moz_cookies values(NULL, "cookies_name_test", "cookies_value_test", "www.cookies_test.com", "cookies_path_test", 2011, NULL, 1, 0);' +fi + +# Change db file owner & permission +if [ ${USER} == "root" ] +then + #chown root:root /opt/apps/org.tizen.browser/data/db + chown :6002 /opt/apps/org.tizen.browser/data/db/.browser.db + chown :6002 /opt/apps/org.tizen.browser/data/db/.browser.db-journal + chown :6002 /opt/apps/org.tizen.browser/data/db/.browser-cookies.db + chown :6002 /opt/apps/org.tizen.browser/data/db/.browser-cookies.db-journal + chown :6002 /opt/dbspace/.browser-history.db + chown :6002 /opt/dbspace/.browser-history.db-journal + chown :6002 /opt/dbspace/.internet_bookmark.db + chown :6002 /opt/dbspace/.internet_bookmark.db-journal + chown :6002 /opt/apps/org.tizen.browser/data/db/.browser-credential.db + chown :6002 /opt/apps/org.tizen.browser/data/db/.browser-credential.db-journal + chown :6002 /opt/apps/org.tizen.browser/data/db/.browser-notification.db + chown :6002 /opt/apps/org.tizen.browser/data/db/.browser-notification.db-journal + chmod 660 /opt/apps/org.tizen.browser/data/db/.browser.db + chmod 660 /opt/apps/org.tizen.browser/data/db/.browser.db-journal + chmod 660 /opt/apps/org.tizen.browser/data/db/.browser-cookies.db + chmod 660 /opt/apps/org.tizen.browser/data/db/.browser-cookies.db-journal + chmod 666 /opt/dbspace/.browser-history.db + chmod 666 /opt/dbspace/.browser-history.db-journal + chmod 660 /opt/dbspace/.internet_bookmark.db + chmod 660 /opt/dbspace/.internet_bookmark.db-journal + chmod 660 /opt/apps/org.tizen.browser/data/db/.browser-credential.db + chmod 660 /opt/apps/org.tizen.browser/data/db/.browser-credential.db-journal + chmod 660 /opt/apps/org.tizen.browser/data/db/.browser-notification.db + chmod 660 /opt/apps/org.tizen.browser/data/db/.browser-notification.db-journal +fi + +################################################## +# set default vconf values +################################################## +if [ ${USER} == "root" ] +then + vconftool set -t bool db/browser/ShowMySitesGuide 1 -g 6514 + vconftool set -t string db/browser/Last/Url "" -g 6514 + vconftool set -t string db/browsersetting/LastVisitedUrl "" -g 6514 + vconftool set -t int db/browser/BrowserBrightnessLevel -1 -g 6514 +# Browser settings vconf values +# Set vconf values with -g/-u options + vconftool set -t string db/browsersetting/Homepage "Most visited sites" -g 6514 # "Most visited sites", "user set site", "Empty page" + vconftool set -t string db/browsersetting/HomepageMode "MOST_VISITED_SITES" -g 6514 + vconftool set -t string db/browsersetting/UserAgent "Tizen" -g 6514 + vconftool set -t string db/browsersetting/UserHomepage "www.tizen.org" -g 6514 # default site is www.tizen.org + vconftool set -t string db/browsersetting/DefaultViewLevel "Readable" -g 6514 # "Readable", "Fit to width" + vconftool set -t bool db/browsersetting/EnableLandscape 1 -g 6514 + vconftool set -t bool db/browsersetting/RunJavaScript 1 -g 6514 + vconftool set -t bool db/browsersetting/DisplayImages 1 -g 6514 + vconftool set -t bool db/browsersetting/BlockPopup 1 -g 6514 + vconftool set -t string db/browsersetting/AutoSaveIDPassword "Always ask" -g 6514 # "On", "Off" + vconftool set -t string db/browsersetting/SaveIDPassword "ALWAYS_ASK" -g 6514 # "On", "Off" + vconftool set -t string db/browsersetting/CustomUserAgent "" -g 6514 + # set default vconf value for reader + vconftool set -t bool db/browsersetting/RunReader 1 -g 6514 + vconftool set -t int db/browsersetting/FontSize 16 -g 6514 + # set default vconf value for plugins + vconftool set -t bool db/browsersetting/RunPlugins 1 -g 6514 + vconftool set -t bool db/browsersetting/RunFlash 0 -g 6514 + vconftool set -t bool db/browsersetting/PauseFlash 1 -g 6514 + # set search vconf + vconftool set -t string db/browsersetting/SearchEngine "Google" -g 6514 # "Google", "Yahoo", "Bing" + vconftool set -t string db/browsersetting/SearchUrl "http://www.google.com/m/search?q=" -g 6514 + vconftool set -t bool db/browsersetting/SearchCaseSensitive 0 -g 6514 + # privacy + vconftool set -t string db/browsersetting/CookieOption "Accept all" -g 6514 + vconftool set -t bool db/browsersetting/CookieOptionInt 1 -g 6514 + # performance + vconftool set -t bool db/browsersetting/FastRendering 1 -g 6514 + vconftool set -t bool db/browsersetting/LargeRenderingBuffer 1 -g 6514 + vconftool set -t bool db/browsersetting/AcceleratedComposition 1 -g 6514 + vconftool set -t bool db/browsersetting/SamsungAppsInstall 0 -g 6514 + vconftool set -t bool db/browsersetting/ExternalVideoPlayer 0 -g 6514 # if the AcceleratedComposition is 0, this must be 0 + vconftool set -t bool db/browsersetting/CompositedRenderLayerBorders 0 -g 6514 # if the AcceleratedComposition is 0, this must be 0 + vconftool set -t bool db/browsersetting/PhysicsEngine 0 -g 6514 + vconftool set -t bool db/browsersetting/RecordingSurface 0 -g 6514 + vconftool set -t bool db/browsersetting/RemoteWebInspector 0 -g 6514 + vconftool set -t bool db/browsersetting/DemoSetting 0 -g 6514 + vconftool set -t bool db/browsersetting/DemoMode 0 -g 6514 +else + vconftool set -t bool db/browser/ShowMySitesGuide 1 + vconftool set -t string db/browser/Last/Url "" + vconftool set -t string db/browsersetting/LastVisitedUrl "" + vconftool set -t int db/browser/BrowserBrightnessLevel -1 +# Browser settings vconf values +# Set without -g, -u options + vconftool set -t string db/browsersetting/Homepage "Recently visited site" # "Recently visited site", "user set site", "Empty page" + vconftool set -t string db/browsersetting/HomepageMode "MOST_VISITED_SITES" + vconftool set -t string db/browsersetting/UserHomepage "www.tizen.org" # default site is www.tizen.org + vconftool set -t string db/browsersetting/UserAgent "Tizen" + vconftool set -t string db/browsersetting/DefaultViewLevel "Readable" # "Readable", "Fit to width" + vconftool set -t bool db/browsersetting/EnableLandscape 1 + vconftool set -t bool db/browsersetting/RunJavaScript 1 + vconftool set -t bool db/browsersetting/DisplayImages 1 + vconftool set -t bool db/browsersetting/BlockPopup 1 + vconftool set -t string db/browsersetting/AutoSaveIDPassword "Always ask" # "On", "Off" + vconftool set -t string db/browsersetting/SaveIDPassword "ALWAYS_ASK" + vconftool set -t string db/browsersetting/CustomUserAgent "" + # set default vconf value for reader + vconftool set -t bool db/browsersetting/RunReader 1 + vconftool set -t int db/browsersetting/FontSize 16 + # set default vconf value for plugins + vconftool set -t bool db/browsersetting/RunPlugins 1 + vconftool set -t bool db/browsersetting/RunFlash 0 + # set search vconf + vconftool set -t string db/browsersetting/SearchEngine "Google" # "Google", "Yahoo", "Bing" + vconftool set -t string db/browsersetting/SearchUrl "http://www.google.com/m/search?q=" + vconftool set -t bool db/browsersetting/SearchCaseSensitive 0 + # privacy + vconftool set -t string db/browsersetting/CookieOption "Accept all" + vconftool set -t bool db/browsersetting/CookieOptionInt 1 + # performance + vconftool set -t bool db/browsersetting/FastRendering 1 + vconftool set -t bool db/browsersetting/LargeRenderingBuffer 1 + vconftool set -t bool db/browsersetting/AcceleratedComposition 1 + vconftool set -t bool db/browsersetting/SamsungAppsInstall 0 + vconftool set -t bool db/browsersetting/ExternalVideoPlayer 0 # if the AcceleratedComposition is 0, this must be 0 + vconftool set -t bool db/browsersetting/CompositedRenderLayerBorders 0 # if the AcceleratedComposition is 0, this must be 0 + vconftool set -t bool db/browsersetting/PhysicsEngine 0 + vconftool set -t bool db/browsersetting/RecordingSurface 0 + vconftool set -t bool db/browsersetting/RemoteWebInspector 0 + vconftool set -t bool db/browsersetting/DemoMode 0 + vconftool set -t bool db/browsersetting/DemoSetting 0 +fi diff --git a/debian/rules b/debian/rules new file mode 100755 index 00000000..ba9c4b8a --- /dev/null +++ b/debian/rules @@ -0,0 +1,145 @@ +#!/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 + + +# These are used for cross-compiling and for saving the configure script +# from having to guess our platform (since we know it already) +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) + +CFLAGS ?= -Wall +CXXFLAGS ?= -Wall +LDFLAGS ?= +PREFIX ?= /opt/apps/org.tizen.browser +RESDIR ?= /opt/apps/org.tizen.browser/res +DATADIR ?= /opt/apps/org.tizen.browser/data + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 + CXXFLAGS += -O0 +else + CFLAGS += -O2 + CXXFLAGS += -O2 +endif + +CFLAGS += -fPIC +CXXFLAGS += -fPIC +LDFLAGS += -Wl,--rpath=$(PREFIX)/lib -Wl,--hash-style=both -Wl,--as-needed + +configure: configure-stamp +configure-stamp: + dh_testdir + # Add here commands to configure the package. + CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" cmake . -DCMAKE_INSTALL_PREFIX=$(PREFIX) -DENABLE_GEOLOCATION_DIALOG=ON + + touch configure-stamp + +build: build-stamp + +build-stamp: configure-stamp + dh_testdir + + # Add here commands to compile the package. + $(MAKE) + #docbook-to-man debian/ncurses.sgml > ncurses.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#@RESDIR@#$(RESDIR)#g" $${f%.in}; \ + sed -i -e "s#@DATADIR@#$(DATADIR)#g" $${f%.in}; \ + done + + touch $@ + +clean: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + + # Add here commands to clean up after the build process. + -$(MAKE) clean + rm -rf CMakeCache.txt + rm -rf CMakeFiles + rm -rf cmake_install.cmake + rm -rf Makefile + rm -rf install_manifest.txt + + rm -rf po/CMakeCache.txt + rm -rf po/CMakeFiles + rm -rf po/cmake_install.cmake + rm -rf po/Makefile + rm -rf po/install_manifest.txt + + rm -rf browser.edj + rm -rf browser_theme.edj + rm -rf ug_effect.edj + +ifneq "$(wildcard /usr/share/misc/config.sub)" "" + cp -f /usr/share/misc/config.sub config.sub +endif +ifneq "$(wildcard /usr/share/misc/config.guess)" "" + cp -f /usr/share/misc/config.guess config.guess +endif + + for f in `find $(CURDIR)/debian/ -name "*.in"`; do \ + rm -f $${f%.in}; \ + done + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Add here commands to install the package into debian/ncurses. + $(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 --list-missing --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.browser-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/edc/browser-bookmark-view.edc b/edc/browser-bookmark-view.edc new file mode 100755 index 00000000..75f011c2 --- /dev/null +++ b/edc/browser-bookmark-view.edc @@ -0,0 +1,456 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "browser-macro.edc" + +collections { + group { + name: "bookmark/content_layout"; + parts { + part { name: "bg"; + mouse_events: 0; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + align: 0.0 0.0; + rel1 { relative: 0.0 0.0; } + rel2 { relative: 1.0 1.0; } + color: 255 255 255 255; + } + } + part { name: "elm.swallow.upperlist"; + mouse_events: 1; + type: SWALLOW; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + min: 0 0; + max: 0 0; + rel1 { relative: 0.0 0.0; to: bg; } + rel2 { relative: 1.0 0.0; to: bg; } + } + description { + state: "show_upper_folder" 0.0; + inherit: "default" 0.0; + visible: 1; + min: 0 115; + max: 999999 115; + fixed: 0 1; + align: 0.0 0.0; + } + } + part { name: "upper_list_bottom_line"; + mouse_events: 0; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + min: 0 0; + max: 999999 0; + fixed: 0 1; + rel1 { relative: 0.0 1.0; to: "elm.swallow.upperlist"; } + rel2 { relative: 1.0 1.0; to: "elm.swallow.upperlist"; } + color: 200 200 200 255; + } + } + part { name: "elm.swallow.content_box"; + mouse_events: 1; + type: SWALLOW; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + rel1 { relative: 0.0 1.0; to_x: bg; to_y: "upper_list_bottom_line"; } + rel2 { relative: 1.0 1.0; to: bg; } + color: 0 255 0 255; + } + description { + state: "empty" 0.0; + inherit: "default" 0.0; + visible: 0; + min: 0 0; + max: 0 0; + } + } + part { name: "elm.swallow.no_content"; + mouse_events: 1; + type: SWALLOW; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + rel1 { relative: 0.0 1.0; to_x: bg; to_y: "upper_list_bottom_line"; } + rel2 { relative: 1.0 1.0; to: bg; } + color: 0 0 255 255; + } + description { + state: "empty" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + } + programs { + program { name: "hide,upper_folder"; + signal: "hide,upper_folder,signal"; + action: STATE_SET "default" 0.0; + target: "elm.swallow.upperlist"; + target: "upper_list_bottom_line"; + } + program { name: "show,upper_folder"; + signal: "show,upper_folder,signal"; + action: STATE_SET "show_upper_folder" 0.0; + target: "elm.swallow.upperlist"; + target: "upper_list_bottom_line"; + } + program { name: "show,content_box"; + signal: "show,content_box,signal"; + action: STATE_SET "default" 0.0; + target: "elm.swallow.content_box"; + target: "elm.swallow.no_content"; + } + program { name: "hide,content_box"; + signal: "hide,content_box,signal"; + action: STATE_SET "empty" 0.0; + target: "elm.swallow.content_box"; + target: "elm.swallow.no_content"; + } + } + } + group { + name: "bookmark/main_layout"; + parts { + part { name: "elm.swallow.tabbar"; + mouse_events: 1; + repeat_events: 1; + type: SWALLOW; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + min: 0 117; + fixed: 0 1; + align: 0.0 0.0; + rel1 { relative: 0.0 0.0; } + rel2 { relative: 1.0 0.0; } + } + } + part { name: "elm.swallow.content"; + mouse_events: 1; + repeat_events: 1; + type: SWALLOW; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + align: 0.0 0.0; + rel1 { relative: 0.0 1.0; to: "elm.swallow.tabbar"; } + rel2 { relative: 1.0 1.0; } + } + description { + state: "unvisible" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + part { name: "elm.swallow.content1"; + mouse_events: 1; + repeat_events: 1; + type: SWALLOW; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + align: 0.0 0.0; + rel1 { relative: 0.0 0.0; to: "elm.swallow.content"; } + rel2 { relative: 1.0 1.0; to: "elm.swallow.content"; } + } + description { + state: "unvisible" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + } + programs { + program { name: "show,content0"; + signal: "show,content0,signal"; + action: STATE_SET "default" 0.0; + target: "elm.swallow.content"; + after: "hide,content1"; + } + program { name: "hide,content1"; + action: STATE_SET "unvisible" 0.0; + target: "elm.swallow.content1"; + } + program { name: "show,content1"; + signal: "show,content1,signal"; + action: STATE_SET "default" 0.0; + target: "elm.swallow.content1"; + after: "hide,content0"; + } + program { name: "hide,content0"; + action: STATE_SET "unvisible" 0.0; + target: "elm.swallow.content"; + } + } + } + + group { + name: "bookmark/bookmark-folder-view-layout"; + parts { + part { name: "bg"; + mouse_events: 0; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + rel1 { relative: 0.0 0.0; } + rel2 { relative: 1.0 1.0; } + color: 100 100 100 255; + } + } + part { name: "elm.swallow.folderlist"; + mouse_events: 1; + type: SWALLOW; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + rel1 { relative: 0.0 0.0; to: bg; } + rel2 { relative: 1.0 0.0; to_x: bg; to_y: elm.swallow.controlbar; } + } + } + part { name: "elm.swallow.controlbar"; + mouse_events: 1; + type: SWALLOW; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + min: 0 96; + max: 800 96; + fixed: 0 1; + align: 0.0 1.0; + rel1 { relative: 0.0 1.0; to_x: bg; to_y: bg; } + rel2 { relative: 1.0 1.0; to_x: bg; to_y: bg; } + } + } + } + } + + group { name: "browser/popup_center_progressview"; + parts{ + part { name: "elm.title"; + type: TEXT; + scale : 1; + description { state: "default" 0.0; + max: 240 24; + text { + font: "SLP:style=Medium"; + size: 33; + min: 0 0; + align: 0.5 0.0; + } + color: 108 108 108 255; + align: 0.5 0.0; + rel1 { + relative: 0.0 0.0; + to: "elm.swallow.content"; + } + rel2 { + relative: 1.0 0.0; + to: "elm.swallow.content"; + } + } + } + part{ name:"elm.swallow.content"; + type: SWALLOW; + scale : 1; + description { state: "default" 0.0; + min: 0 105; + align: 0.5 0.8; + fixed: 1 0; + rel1 { + relative: 0.0 0.0; + } + rel2 { + relative: 1.0 1.0; + } + } + } + part { name: "elm.text.left"; + type: TEXT; + scale : 1; + description { state: "default" 0.0; + max: 225 24; + text { + font: "SLP:style=Medium"; + size: 24; + min: 0 0; + align: 0.0 1.0; + } + color: 108 108 108 255; + align: 0.0 1.0; + rel1 { + relative: 0.0 0.0; + to: "elm.swallow.content"; + } + rel2 { + relative: 1.0 1.0; + to: "elm.swallow.content"; + } + } + } + part { name: "elm.text.right"; + type: TEXT; + scale : 1; + description { state: "default" 0.0; + max: 225 24; + text { + font: "SLP:style=Medium"; + size: 24; + min: 0 0; + align: 1.0 1.0; + } + color: 108 108 108 255; + align: 1.0 1.0; + rel1 { + relative: 0.0 0.0; + to: "elm.swallow.content"; + } + rel2 { + relative: 1.0 1.0; + to: "elm.swallow.content"; + } + } + } + } + } + +#define NOCONTENT_TEXT_BLOCK_STYLE_COLOR_INC 81 78 76 255 +#define NOCONTENT_TEXT_BLOCK_TEXT_SIZE_INC 42 +#define NOCONTENT_MIDDLE_PADDING_INC 54 +#define NOCONTENT_BASE_SEARCH_PADDING_INC 40 +#define NOCONTENT_IMAGE_REL1_WIDTH_HEIGHT_INC 0.282 0.294 +#define NOCONTENT_IMAGE_REL2_WIDTH_HEIGHT_INC 0.718 0.54 +#define NOCONTENT_BG_COLOR_INC 0 0 0 255 +#define NOCONTENT_TEXT_STYLE_BG_MIN_INC 0 120 + +group { + name: "elm/layout/no_bookmark/full"; + alias: "elm/no_bookmark/base/full"; + alias: "elm/no_bookmark/base/default"; + styles{ + style { name: "nocontent_style"; + base: "font=SLP:style=Roman font_size="NOCONTENT_TEXT_BLOCK_TEXT_SIZE_INC" align=center color=#ffffff wrap=mixed ellipsis=1.0"; + tag: "br" "\n"; + tag: "hilight" "+ font=SLP:style=Bold"; + tag: "b" "+ font=SLP:style=Bold"; + tag: "tab" "\t"; + } + } + images { + image: "bookmarks/I01_Nocontents_Bookmarks.png" COMP; + } + parts { + part { name: "bg"; + type: RECT; + scale: 1; + description { state: "default" 0.0; + visible: 1; + min: 200 200; + rel1 { + relative: 0.0 0.0; + } + rel2 { + relative: 1.0 1.0; + } + color: NOCONTENT_BG_COLOR_INC; + } + } + part { name: "nocontents.image"; + description { state: "default" 0.0; + visible: 1; + align: 0.5 0.0; + rel1 { + relative: NOCONTENT_IMAGE_REL1_WIDTH_HEIGHT_INC; + to: "bg"; + } + rel2 { + relative: NOCONTENT_IMAGE_REL2_WIDTH_HEIGHT_INC; + to: "bg"; + } + image { + normal: "bookmarks/I01_Nocontents_Bookmarks.png"; + border: 1 1 1 1; + border_scale: 1; + } + aspect: 1.0 1.0; + aspect_preference: BOTH; + } + } + part { name: "middle.padding"; + type: RECT; + scale: 1; + description { state: "default" 0.0; + visible: 0; + min: 1 NOCONTENT_MIDDLE_PADDING_INC; + max: 1 NOCONTENT_MIDDLE_PADDING_INC; + align: 0.5 0.0; + rel1 { + relative: 0.0 1.0; + to_y: "nocontents.image"; + } + } + } + part { name: "elm.text"; + type: TEXTBLOCK; + scale: 1; + description { state: "default" 0.0; + min: NOCONTENT_TEXT_STYLE_BG_MIN_INC; + fixed: 0 1; + align: 0.5 0.5; + visible: 1; + rel1 { + relative: 0.0 1.0; + to_x: "bg"; + to_y: "middle.padding"; + } + rel2 { + relative: 1.0 1.0; + to_x: "bg"; + to_y: "middle.padding"; + } + color: NOCONTENT_TEXT_BLOCK_STYLE_COLOR_INC; + text { + style: "nocontent_style"; + align: 0.5 0.5; + min: 0 0; + max: 0 1; + } + } + } + } +} + +} + diff --git a/edc/browser-define.edc b/edc/browser-define.edc new file mode 100755 index 00000000..bafc8f29 --- /dev/null +++ b/edc/browser-define.edc @@ -0,0 +1,871 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "browser-macro.edc" + +/* define of buttons & icons */ + +collections { + group { + name: "elm/icon/browser_control_bar_multi_window/default"; + min: 56 56; + images.image: "icon/I01_title_icon_multiview.png" COMP; + images.image: "icon/I01_title_icon_multiview_press.png" COMP; + parts { + part { + name: "base"; + scale: 1; + description { + state: "default" 0.0; + min: 56 56; + max: 56 56; + fixed: 1 1; + aspect: 1.0 1.0; + aspect_preference: BOTH; + image.normal: "icon/I01_title_icon_multiview.png"; + } + description { + state: "pressed" 0.0; + min: 56 56; + max: 56 56; + fixed: 1 1; + aspect: 1.0 1.0; + aspect_preference: BOTH; + image.normal: "icon/I01_title_icon_multiview_press.png"; + } + } + part { name: "elm.text"; + type: TEXT; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + visible: 0; + rel1 { relative: 0.0 0.0; to: "base"; } + rel2 { relative: 1.0 1.0; to: "base"; } + align: 0.4 0.5; + color: 57 57 57 255; + text { + font: "SLP:style=Medium"; + size: 25; + min: 0 0; + align: 0.5 0.4; + max: 1 0; + } + } + description { state: "1" 0.0; + inherit: "default" 0.0; + visible: 1; + text { + font: "SLP:style=Medium"; + size: 25; + text: "1"; + min: 0 0; + align: 0.5 0.4; + max: 1 0; + } + } + description { state: "2" 0.0; + inherit: "default" 0.0; + visible: 1; + text { + font: "SLP:style=Medium"; + size: 25; + text: "2"; + min: 0 0; + align: 0.5 0.4; + max: 1 0; + } + } + description { state: "3" 0.0; + inherit: "default" 0.0; + visible: 1; + text { + font: "SLP:style=Medium"; + size: 25; + text: "3"; + min: 0 0; + align: 0.5 0.4; + max: 1 0; + } + } + description { state: "4" 0.0; + inherit: "default" 0.0; + visible: 1; + text { + font: "SLP:style=Medium"; + size: 25; + text: "4"; + min: 0 0; + align: 0.5 0.4; + max: 1 0; + } + } + description { state: "5" 0.0; + inherit: "default" 0.0; + visible: 1; + text { + font: "SLP:style=Medium"; + size: 25; + text: "5"; + min: 0 0; + align: 0.5 0.4; + max: 1 0; + } + } + description { state: "6" 0.0; + inherit: "default" 0.0; + visible: 1; + text { + font: "SLP:style=Medium"; + size: 25; + text: "6"; + min: 0 0; + align: 0.5 0.4; + max: 1 0; + } + } + description { state: "7" 0.0; + inherit: "default" 0.0; + visible: 1; + text { + font: "SLP:style=Medium"; + size: 25; + text: "7"; + min: 0 0; + align: 0.5 0.4; + max: 1 0; + } + } + description { state: "8" 0.0; + inherit: "default" 0.0; + visible: 1; + text { + font: "SLP:style=Medium"; + size: 25; + text: "8"; + min: 0 0; + align: 0.5 0.4; + max: 1 0; + } + } + description { state: "9" 0.0; + inherit: "default" 0.0; + visible: 1; + text { + font: "SLP:style=Medium"; + size: 25; + text: "9"; + min: 0 0; + align: 0.5 0.4; + max: 1 0; + } + } + } + programs { + program { name: "hide,multi_window_text"; + signal: "hide,multi_window_text,signal"; + action: STATE_SET "default" 0.0; + target: "elm.text"; + } + program { name: "show,multi_window_1"; + signal: "show,multi_window_1,signal"; + action: STATE_SET "1" 0.0; + target: "elm.text"; + } + program { name: "show,multi_window_2"; + signal: "show,multi_window_2,signal"; + action: STATE_SET "2" 0.0; + target: "elm.text"; + } + program { name: "show,multi_window_3"; + signal: "show,multi_window_3,signal"; + action: STATE_SET "3" 0.0; + target: "elm.text"; + } + program { name: "show,multi_window_4"; + signal: "show,multi_window_4,signal"; + action: STATE_SET "4" 0.0; + target: "elm.text"; + } + program { name: "show,multi_window_5"; + signal: "show,multi_window_5,signal"; + action: STATE_SET "5" 0.0; + target: "elm.text"; + } + program { name: "show,multi_window_6"; + signal: "show,multi_window_6,signal"; + action: STATE_SET "6" 0.0; + target: "elm.text"; + } + program { name: "show,multi_window_7"; + signal: "show,multi_window_7,signal"; + action: STATE_SET "7" 0.0; + target: "elm.text"; + } + program { name: "show,multi_window_8"; + signal: "show,multi_window_8,signal"; + action: STATE_SET "8" 0.0; + target: "elm.text"; + } + program { name: "show,multi_window_9"; + signal: "show,multi_window_9,signal"; + action: STATE_SET "9" 0.0; + target: "elm.text"; + } + program { name: "multi_window,pressed"; + signal: "mouse,down,1"; + source: "base"; + action: STATE_SET "pressed" 0.0; + target: "base"; + } + program { name: "multi_window,default"; + signal: "mouse,up,1"; + source: "base"; + action: STATE_SET "default" 0.0; + target: "base"; + } + } + } + } + +BUTTON_WITH_BG(title_back, "icon/I01_title_btn.png", + "icon/I01_title_btn_press.png", "icon/I01_btn_back.png", 6, 6, 6, 6, 124, 74, 56, 56); + +BUTTON_WITH_BG(bookmark_controlbar_back, "icon/I01_Back_btn_normal.png", + "icon/I01_Back_btn_press.png", "icon/I01_btn_back.png", 7, 7, 7, 7, 112, 82, 56, 56); + +BUTTON_WITH_BG(find_word_prev, "icon/I01_btn_normal.png", + "icon/I01_btn_press.png", "icon/I01_picker_arrow_left.png", 0, 0, 0, 0, 74, 74, 74, 74); + +BUTTON_WITH_BG(find_word_next, "icon/I01_btn_normal.png", + "icon/I01_btn_press.png", "icon/I01_picker_arrow_right.png", 0, 0, 0, 0, 74, 74, 74, 74); + +BUTTON_WITH_BG(reader_icon, "icon/I01_btn_normal.png", + "icon/I01_btn_press.png", "icon/I01_fit_screen.png", 0, 0, 0, 0, 74, 74, 74, 74); + +TITLE_BUTTON(title_button, "icon/I01_title_btn.png", + "icon/I01_title_btn_press.png", 6, 6, 6, 6); + +TITLE_BUTTON(close_button, "icon/I01_Option_header_bt.png", + "icon/I01_Option_header_bt_press.png", 4, 4, 4, 4); + +/* ifdef ZOOM_BUTTON */ +ZOOM_BUTTON(zoom_out, "browser-view-images/00_zoom_out.png", + "browser-view-images/00_zoom_out_press.png", "browser-view-images/00_zoom_out_disable.png", 0, 0, 0, 0); +ZOOM_BUTTON(zoom_in, "browser-view-images/00_zoom_in.png", + "browser-view-images/00_zoom_in_press.png", "browser-view-images/00_zoom_in_disable.png", 0, 0, 0, 0); +/* endif ZOOM_BUTTON */ + +#define BUTTON_STATE_ENABLED 0 +#define BUTTON_STATE_DISABLED 1 + group { name: "elm/button/base/browser/navigationbar_control/button"; + script { + public button_state = BUTTON_STATE_ENABLED; + } + images.image: "icon/I01_Option_header_bt.png" COMP; + images.image: "icon/I01_Option_header_bt_dim.png" COMP; + images.image: "icon/I01_Option_header_bt_press.png" COMP; + parts { + part { name: "button_image"; + type: IMAGE; + mouse_events: 1; + scale: 1; + description { state: "default" 0.0; +#ifdef WVGA_NBEAT // 480 * 800 + min: 20 50; +#else + min: 30 75; +#endif + color: 0 0 0 0; +#ifdef WVGA_NBEAT // 480 * 800 + rel1.offset: 5 5; + rel2.offset: -6 -6; +#else +// rel1.offset: 7 7; +// rel2.offset: -9 -9; + rel1.offset: 7 12; + rel2.offset: -9 -4; +#endif + image.normal: "icon/I01_Option_header_bt.png"; + image.border: 4 4 4 4; + color: 255 255 255 255; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + image.normal: "icon/I01_Option_header_bt_dim.png"; + } + description { state: "clicked" 0.0; + inherit: "default" 0.0; + image.normal: "icon/I01_Option_header_bt_press.png"; + } + } + part { + name: "padding_left_top"; + type: RECT; + scale: 1; + mouse_events: 0; + description { state: "default" 0.0; + align: 0.0 0.0; + rel1.relative: 0.0 0.0; + rel2.relative: 0.0 0.0; +#ifdef WVGA_NBEAT // 480 * 800 + min: 10 5; +#else + min: 15 7; +#endif + fixed: 1 1; + visible: 0; + } + } + part { + name: "padding_right_bottom"; + type: RECT; + scale: 1; + mouse_events: 0; + description { state: "default" 0.0; + align: 1.0 1.0; + rel1.relative: 1.0 1.0; + rel2.relative: 1.0 1.0; +#ifdef WVGA_NBEAT // 480 * 800 + min: 10 5; +#else + min: 15 7; +#endif + fixed: 1 1; + visible: 0; + } + } + part { + name: "icon_rect"; + type: RECT; + scale: 1; + mouse_events: 0; + description { state: "default" 0.0; + visible: 1; + min: 0 0; + fixed: 1 0; + rel1 { relative: 1.0 1.0; to: "padding_left_top"; } + rel2 { relative: 1.0 0.0; to_x: "padding_left_top"; to_y: "padding_right_bottom"; } + align: 0.0 0.5; + color: 0 0 0 0; + } + description { state: "visible" 0.0; + visible: 1; +#ifdef WVGA_NBEAT // 480 * 800 + min: 22 22; +#else + min: 33 33; +#endif + fixed: 1 0; + rel1 { relative: 1.0 1.0; to: "padding_left_top"; } + rel2 { relative: 1.0 0.0; to_x: "padding_left_top"; to_y: "padding_right_bottom"; } + align: 0.0 0.5; + color: 0 0 0 0; + } + description { state: "icononly" 0.0; + inherit: "default" 0.0; + } + } + part { + name: "padding_after_icon"; + type: RECT; + scale: 1; + mouse_events: 0; + description { state: "default" 0.0; //when only icon or no icon is there + align: 0.0 0.0; + rel1 { relative: 1.0 0.0; to: "icon_rect"; } + rel2 { relative: 1.0 1.0; to: "icon_rect"; } + fixed: 1 0; + min: 0 0; + color: 0 0 0 0; + } + description { state: "visible" 0.0; + visible: 1; + align: 0.0 0.0; + rel1 { relative: 1.0 0.0; to: "icon_rect"; } + rel2 { relative: 1.0 1.0; to: "icon_rect"; } + fixed: 1 0; +#ifdef WVGA_NBEAT // 480 * 800 + min: 6 0; +#else + min: 9 0; +#endif + color: 0 0 0 0; + } + description { state: "icononly" 0.0; + inherit: "default" 0.0; + } + } + part { + name: "padding_before_text"; + type: RECT; + scale: 1; + mouse_events: 0; + description { state: "default" 0.0; //when only icon or no icon is there + align: 1.0 0.5; + rel1 { relative: 0.0 1.0; to_x: "elm.text"; to_y: "padding_left_top"; } + rel2 { relative: 0.0 0.0; to_x: "elm.text"; to_y: "padding_right_bottom"; } + fixed: 1 0; +#ifdef WVGA_NBEAT // 480 * 800 + min: 6 0; +#else + min: 9 0; +#endif + color: 0 0 0 0; + } + } + part { name: "elm.swallow.content"; + type: SWALLOW; + scale: 1; + clip_to: "disabler"; + description { state: "default" 0.0; + visible: 0; + align: 0.0 0.5; + rel1 { relative: 1.0 1.0; to: "padding_left_top"; } + rel2 { relative: 1.0 0.0; to_x: "padding_left_top"; to_y: "padding_right_bottom"; } + fixed: 1 0; + } + description { state: "visible" 0.0; + fixed: 1 0; + visible: 1; +#ifdef WVGA_NBEAT // 480 * 800 + min: 22 22; + max: 22 22; +#else + min: 33 33; + max: 33 33; +#endif + align: 1.0 0.5; + rel1 { relative: 0.0 1.0; to_x: "padding_before_text"; to_y: "padding_left_top"; } + rel2 { relative: 0.0 0.0; to_x: "padding_before_text"; to_y: "padding_right_bottom"; } + aspect: 1.0 1.0; + aspect_preference: VERTICAL; + } + description { state: "icononly" 0.0; + visible: 1; +#ifdef WVGA_NBEAT // 480 * 800 + min: 30 30; + max: 30 30; +#else + min: 45 45; + max: 45 45; +#endif + rel1 { relative: 1.0 1.0; to: "padding_left_top"; } + rel2 { relative: 0.0 0.0; to: "padding_right_bottom"; } + align: 0.5 0.5; + aspect: 1.0 1.0; + aspect_preference: VERTICAL; + } + } + part { name: "elm.text"; + type: TEXT; + mouse_events: 0; + scale: 1; + clip_to: "disabler"; + description { state: "default" 0.0; + visible: 0; + rel1 { relative: 1.0 1.0; to_x: "padding_after_icon"; to_y: "padding_left_top"; } + rel2 { relative: 0.0 0.0; to: "padding_right_bottom"; } + align: 0.5 0.5; + color: 255 255 255 255; + text { + font: "SLP:style=Medium"; +#ifdef WVGA_NBEAT // 480 * 800 + size: 20; +#else + size: 30; +#endif + min: 0 0; +// align: 0.5 0.5; + align: 0.5 0.6; + max: 1 0; + } + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + description { state: "clicked" 0.0; + inherit: "default" 0.0; + visible: 1; + min: 0 0; + color2: 0 0 0 102; + } + description { state: "focused" 0.0; + inherit: "default" 0.0; + visible: 1; + min: 0 0; + color: 255 255 255 255; + color2: 0 0 0 102; + } + } + part { name: "over2"; + type: RECT; + mouse_events: 1; + repeat_events: 1; + ignore_flags: ON_HOLD; + description { state: "default" 0.0; + color: 0 0 0 0; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + part { name: "over3"; + type: RECT; + mouse_events: 1; + repeat_events: 1; + description { state: "default" 0.0; + color: 0 0 0 0; + } + description { state: "clicked" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part { name: "disabler"; + type: RECT; + description { state: "default" 0.0; + color: 255 255 255 255; + } + description { state: "disabled" 0.0; + color: 255 255 255 127; + } + } + } + programs { + program { name: "button_click"; + signal: "mouse,down,1"; + source: "over2"; + action: SIGNAL_EMIT "elm,action,press" ""; + after: "button_click_anim"; + } + program { name: "button_click_anim"; + action: STATE_SET "clicked" 0.0; + target: "button_image"; + after: "text_clicked"; + } + program { name: "text_clicked"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.text", st, 30, vl); + if (!strcmp(st, "visible")) + set_state(PART:"elm.text", "clicked", 0.0); + } + } + program { name: "button_unpress"; + action: SIGNAL_EMIT "elm,action,unpress" ""; + } + program { name: "button_mouseout_clicked"; + signal: "mouse,up,1"; + source: "over3"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.swallow.content", st, 30, vl); + if (strcmp(st, "icononly")) + { + emit("elm,action,default,text,set", ""); + set_state(PART:"elm.text", "visible", 0.0); + } + if(get_int(button_state) != BUTTON_STATE_DISABLED) + set_state(PART:"button_image", "default", 0.0); + } + after: button_unpress; + } + program { name: "button_click2"; + signal: "mouse,down,1"; + source: "over3"; + action: STATE_SET "clicked" 0.0; + target: "over3"; + } + program { name: "button_unclick2"; + signal: "mouse,clicked,1"; + source: "over3"; + action: STATE_SET "default" 0.0; + target: "over3"; + } + program { name: "button_unclick3"; + signal: "mouse,clicked,1"; + source: "over2"; + action: SIGNAL_EMIT "elm,action,click" ""; + } + program { name: "text_show"; + signal: "elm,state,text,visible"; + source: "elm"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.swallow.content", st, 30, vl); + if (!strcmp(st, "icononly")) + { + set_state(PART:"elm.swallow.content", "visible", 0.0); + set_state(PART:"icon_rect", "visible", 0.0); + set_state(PART:"padding_after_icon", "visible", 0.0); + } + set_state(PART:"elm.text", "visible", 0.0); + } + } + program { name: "text_hide"; + signal: "elm,state,text,hidden"; + source: "elm"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.swallow.content", st, 30, vl); + if (!strcmp(st, "visible")) + { + set_state(PART:"elm.swallow.content", "icononly", 0.0); + set_state(PART:"icon_rect", "icononly", 0.0); + set_state(PART:"padding_after_icon", "icononly", 0.0); + } + set_state(PART:"elm.text", "default", 0.0); + } + } + program { name: "icon_show"; + signal: "elm,state,icon,visible"; + source: "elm"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.text", st, 30, vl); + if (!strcmp(st, "visible")) + { + set_state(PART:"elm.swallow.content", "visible", 0.0); + set_state(PART:"icon_rect", "visible", 0.0); + set_state(PART:"padding_after_icon", "visible", 0.0); + } + else + { + set_state(PART:"elm.swallow.content", "icononly", 0.0); + set_state(PART:"icon_rect", "icononly", 0.0); + set_state(PART:"padding_after_icon", "icononly", 0.0); + } + } + } + program { name: "icon_hide"; + signal: "elm,state,icon,hidden"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.swallow.content"; + } + program { name: "disable"; + signal: "elm,state,disabled"; + source: "elm"; + action: STATE_SET "disabled" 0.0; + target: "button_image"; + target: "over2"; + target: "disabler"; + after: "disable_text"; + } + program { name: "disable_text"; + script { + set_int(button_state, BUTTON_STATE_DISABLED); + set_state(PART:"elm.text", "visible", 0.0); + } + } + program { name: "enable"; + signal: "elm,state,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "button_image"; + target: "over2"; + target: "disabler"; + after: "enable_text"; + } + program { name: "enable_text"; + script { + set_int(button_state, BUTTON_STATE_ENABLED); + set_state(PART:"elm.text", "visible", 0.0); + } + } + program { name: "focused"; + action: STATE_SET "focused" 0.0; + target: "button_image"; + target: "elm.text"; + } + program { name: "unfocused"; + action: STATE_SET "default" 0.0; + target: "button_image"; + after: "unfocus_text"; + } + program { name: "unfocus_text"; + action: STATE_SET "visible" 0.0; + target: "elm.text"; + } + } + } + +#ifdef WVGA_NBEAT // 480 * 800 + +#define BUTTON_NAVIBAR_BACK_BUTTON_BUTTON_IMAGE_MIN_INC 67 40 +#define BUTTON_NAVIBAR_BACK_BUTTON_BG_MIN_MAX_INC 22 20 + +#else + +#define BUTTON_NAVIBAR_BACK_BUTTON_BUTTON_IMAGE_MIN_INC 100 60 +#define BUTTON_NAVIBAR_BACK_BUTTON_BG_MIN_MAX_INC 33 30 + +#endif + +#define NAVIBAR_TITLE_RIGHT_SEPARATOR_COLOR_INC 84 93 110 255 +#define NAVIBAR_TITLE_LEFT_SEPARATOR_COLOR_INC 35 45 61 255 + + group { name: "elm/button/base/naviframe/back_btn/browser/default"; + alias: "elm/button/base/naviframe_end_btn/browser/default"; + //TODO: Remove this alias later + alias: "elm/button/base/navigationbar_prev_btn/browser/default"; + alias: "elm/button/base/navigationbar_backbutton/browser/default"; + alias: "elm/button/base/navigationbar_end_btn/browser/default"; + images { + image: "browser-view-images/I01_btn_prev.png" COMP; + image: "browser-view-images/I01_btn_prev_press.png" COMP; + } + parts { + part { name: "button_image"; + type: RECT; + mouse_events: 1; + scale: 1; + description { state: "default" 0.0; + min: BUTTON_NAVIBAR_BACK_BUTTON_BUTTON_IMAGE_MIN_INC; + color: 0 0 0 0; + } + description { + state: "clicked" 0.0; + inherit: "default" 0.0; + } + description { + state: "disabled" 0.0; + inherit: "default" 0.0; + } + } + part {name: "padding_right"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + align: 1 0; + min: 1 0; + rel1 { relative: 1 0.2; } + rel2 { relative: 1 0.8; } + fixed: 1 0; + color: NAVIBAR_TITLE_RIGHT_SEPARATOR_COLOR_INC; + } + } + part {name: "padding_before_right"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + align: 1 0; + min: 1 0; + rel1 { relative: 0 0; to: "padding_right"; } + rel2 { relative: 0 1; to: "padding_right"; } + fixed: 1 0; + color: NAVIBAR_TITLE_LEFT_SEPARATOR_COLOR_INC; + } + } + part { name: "button_center_part"; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + min: BUTTON_NAVIBAR_BACK_BUTTON_BG_MIN_MAX_INC; + max: BUTTON_NAVIBAR_BACK_BUTTON_BG_MIN_MAX_INC; + align: 0.5 0.5; + rel2 { relative: 0 1; to_x: "padding_before_right"; } + image { + normal: "browser-view-images/I01_btn_prev.png"; + } + } + description { + state: "clicked" 0.0; + inherit: "default" 0.0; + image.normal: "browser-view-images/I01_btn_prev_press.png"; + } + } + part { name: "over1"; + type: RECT; + mouse_events: 1; + repeat_events: 1; + ignore_flags: ON_HOLD; + description { state: "default" 0.0; + color: 0 0 0 0; + } + } + part { name: "over2"; + mouse_events: 1; + repeat_events: 1; + description { state: "default" 0.0; + color: 0 0 0 0; + } + } + part { name: "disabler"; + type: RECT; + description { state: "default" 0.0; + color: 0 0 0 0; + visible: 0; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + } + programs { + program { name: "button_click"; + signal: "mouse,down,1"; + source: "over1"; + action: SIGNAL_EMIT "elm,action,press" ""; + after: "button_click_anim"; + } + program { name: "button_click_anim"; + action: STATE_SET "clicked" 0.0; + target: "button_image"; + target: "button_center_part"; + } + program { name: "button_unclick"; + signal: "mouse,up,1"; + source: "over2"; + action: SIGNAL_EMIT "elm,action,unpress" ""; + after: "button_unclick_anim"; + } + program { name: "button_unclick_anim"; + action: STATE_SET "default" 0.0; + target: "button_image"; + target: "button_center_part"; + } + program { name: "button_unclick2"; + signal: "mouse,clicked,1"; + source: "over1"; + action: SIGNAL_EMIT "elm,action,click" ""; + } + program { name: "disable"; + signal: "elm,state,disabled"; + source: "elm"; + action: STATE_SET "disabled" 0.0; + target: "disabler"; + target: "button_image"; + } + program { name: "enable"; + signal: "elm,state,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "disabler"; + target: "button_image"; + } + } + } +} diff --git a/edc/browser-macro.edc b/edc/browser-macro.edc new file mode 100755 index 00000000..e8c72de7 --- /dev/null +++ b/edc/browser-macro.edc @@ -0,0 +1,1487 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#define GENLIST_PART_BOTTOM_LINE_INC 199 199 199 255 +#define GENLIST_PART_BG_COLOR_INC 249 249 249 255 +#define GENLIST_PART_BG_SELECTED_COLOR_INC 50 65 74 180 +#define GENLIST_PART_TEXT_SELECTED_COLOR_INC 255 255 255 255 +#define GENLIST_PART_TEXT_COLOR_INC 0 0 0 255 + +#define FONT_BLD HelveticaNeueBld +#define FONT_MED HelveticaNeueMed +#define FONT_ROM HelveticaNeueRom +#define FONT_LIG HelveticaNeueLig + +#define PADDING(title, w, h, fixed_w, fixed_h, align_w, align_h, l, t, r, b, rel1_to, rel2_to) \ + part { name: title; \ + type: RECT; \ + scale: 1; \ + description { \ + state: "default" 0.0; \ + visible: 0; \ + min: w h; \ + max: w h; \ + fixed: fixed_w fixed_h; \ + align: align_w align_h; \ + rel1 { relative: l t; to: rel1_to; } \ + rel2 { relative: r b; to: rel2_to; } \ + } \ + } + + +#define BUTTON(button_name, normal_image, press_image, l, r, t, b) \ + group { name: "elm/button/base/browser/"#button_name; \ + images { \ + image: normal_image COMP; \ + image: press_image COMP; \ + } \ + styles { \ + style { name: #button_name"btn_textblock_style"; \ + base: "font=FONT_CONTENT font_size=30 align=center color=#4E4945 wrap=char"; \ + tag: "br" "\n"; \ + tag: "hilight" "+ font=FONT_CONTENT:style=Bold"; \ + tag: "b" "+ font=FONT_CONTENT:style=Bold"; \ + tag: "tab" "\t"; \ + } \ + } \ + parts { \ + part { name: "button_image"; \ + scale: 1; \ + mouse_events: 1; \ + effect: SOFT_SHADOW; \ + description { state: "default" 0.0; \ + image { \ + normal: normal_image; \ + border: l r t b; \ + } \ + } \ + description { state: "clicked" 0.0; \ + inherit: "default" 0.0; \ + image.normal: press_image; \ + } \ + description { state: "disabled" 0.0; \ + inherit: "default" 0.0; \ + image.normal: normal_image; \ + } \ + } \ + part { name: "elm.text"; \ + type: TEXTBLOCK; \ + effect: SHADOW; \ + mouse_events: 0; \ + scale: 1; \ + description { state: "default" 0.0; \ + visible: 0; \ + fixed: 1 1; \ + align: 0.5 0.5; \ + rel1 { relative: 0.1 0; to: "button_image"; } \ + rel2 { relative: 0.9 1; to: "button_image"; } \ + color: 255 255 255 255; \ + text { \ + style: #button_name"btn_textblock_style"; \ + min: 0 0; \ + max: 0 1; \ + } \ + } \ + description { state: "visible" 0.0; \ + inherit: "default" 0.0; \ + visible: 1; \ + min: 1 1; \ + } \ + description { state: "clicked" 0.0; \ + inherit: "default" 0.0; \ + visible: 1; \ + min: 1 1; \ + } \ + description { state: "disabled" 0.0; \ + inherit: "default" 0.0; \ + color: 0 0 0 128; \ + color3: 0 0 0 0; \ + } \ + description { state: "disabled_visible" 0.0; \ + inherit: "default" 0.0; \ + color: 0 0 0 128; \ + color3: 0 0 0 0; \ + visible: 1; \ + min: 1 1; \ + } \ + } \ + part { name: "over1"; \ + mouse_events: 0; \ + description { state: "default" 0.0; \ + rel2.relative: 1.0 0.5; \ + } \ + description { state: "disabled" 0.0; \ + inherit: "default" 0.0; \ + } \ + } \ + part { name: "over2"; \ + mouse_events: 1; \ + repeat_events: 1; \ + ignore_flags: ON_HOLD; \ + description { state: "default" 0.0; \ + } \ + description { state: "disabled" 0.0; \ + inherit: "default" 0.0; \ + visible: 0; \ + } \ + } \ + part { name: "over3"; \ + mouse_events: 1; \ + repeat_events: 1; \ + description { state: "default" 0.0; \ + color: 255 255 255 0; \ + } \ + description { state: "clicked" 0.0; \ + inherit: "default" 0.0; \ + visible: 1; \ + color: 255 255 255 0; \ + } \ + } \ + part { name: "disabler"; \ + type: RECT; \ + description { state: "default" 0.0; \ + color: 0 0 0 0; \ + visible: 0; \ + } \ + description { state: "disabled" 0.0; \ + inherit: "default" 0.0; \ + visible: 1; \ + } \ + } \ + } \ + programs { \ + program { name: "button_click"; \ + signal: "mouse,down,1"; \ + source: "over2"; \ + action: SIGNAL_EMIT "elm,action,press" ""; \ + after: "button_click_anim"; \ + } \ + program { name: "button_click_anim"; \ + action: STATE_SET "clicked" 0.0; \ + target: "button_image"; \ + target: "elm.text"; \ + } \ + program { name: "button_unclick"; \ + signal: "mouse,up,1"; \ + source: "over2"; \ + action: SIGNAL_EMIT "elm,action,unpress" ""; \ + after: "button_unclick_anim"; \ + } \ + program { name: "button_unclick_anim"; \ + action: STATE_SET "default" 0.0; \ + target: "button_image"; \ + action: STATE_SET "visible" 0.0; \ + target: "elm.text"; \ + } \ + program { name: "button_mouseout_clicked"; \ + signal: "mouse,out"; \ + source: "over2"; \ + script { \ + new st[31]; \ + new Float:vl; \ + get_state(PART:"elm.text", st, 30, vl); \ + if (!strcmp(st, "clicked")) \ + { \ + set_state(PART:"elm.text", "visible", 0.0); \ + set_state(PART:"button_image", "visible", 0.0); \ + } \ + } \ + } \ + program { name: "button_click2"; \ + signal: "mouse,down,1"; \ + source: "over3"; \ + action: STATE_SET "clicked" 0.0; \ + target: "over3"; \ + } \ + program { name: "button_unclick2"; \ + signal: "mouse,clicked,1"; \ + source: "over3"; \ + action: STATE_SET "default" 0.0; \ + target: "over3"; \ + } \ + program { name: "button_unclick3"; \ + signal: "mouse,clicked,1"; \ + source: "over2"; \ + action: SIGNAL_EMIT "elm,action,click" ""; \ + } \ + program { name: "text_show"; \ + signal: "elm,state,text,visible"; \ + source: "elm"; \ + action: STATE_SET "visible" 0.0; \ + target: "elm.text"; \ + } \ + program { name: "text_hide"; \ + signal: "elm,state,text,hidden"; \ + source: "elm"; \ + action: STATE_SET "default" 0.0; \ + target: "elm.text"; \ + } \ + program { name: "disable"; \ + signal: "elm,state,disabled"; \ + source: "elm"; \ + action: STATE_SET "disabled" 0.0; \ + target: "button_image"; \ + target: "over1"; \ + target: "over2"; \ + target: "disabler"; \ + after: "disable_text"; \ + } \ + program { name: "disable_text"; \ + script { \ + new st[31]; \ + new Float:vl; \ + get_state(PART:"elm.text", st, 30, vl); \ + if (!strcmp(st, "visible")) \ + set_state(PART:"elm.text", "disabled_visible", 0.0); \ + else \ + set_state(PART:"elm.text", "disabled", 0.0); \ + } \ + } \ + program { name: "enable"; \ + signal: "elm,state,enabled"; \ + source: "elm"; \ + action: STATE_SET "default" 0.0; \ + target: "button_image"; \ + target: "over1"; \ + target: "over2"; \ + target: "disabler"; \ + after: "enable_text"; \ + } \ + program { name: "enable_text"; \ + script { \ + new st[31]; \ + new Float:vl; \ + get_state(PART:"elm.text", st, 30, vl); \ + if (!strcmp(st, "disabled_visible")) \ + set_state(PART:"elm.text", "visible", 0.0); \ + else \ + set_state(PART:"elm.text", "default", 0.0); \ + } \ + } \ + } \ + } + +#define ZOOM_BUTTON(button_name, normal_image, press_image, disable_image, l, r, t, b) \ + group { name: "elm/button/base/browser/"#button_name; \ + images { \ + image: normal_image COMP; \ + image: press_image COMP; \ + image: disable_image COMP; \ + } \ + styles { \ + style { name: #button_name"btn_textblock_style"; \ + base: "font=FONT_CONTENT font_size=30 align=center color=#4E4945 wrap=char"; \ + tag: "br" "\n"; \ + tag: "hilight" "+ font=FONT_CONTENT:style=Bold"; \ + tag: "b" "+ font=FONT_CONTENT:style=Bold"; \ + tag: "tab" "\t"; \ + } \ + } \ + parts { \ + part { name: "button_image"; \ + scale: 1; \ + mouse_events: 1; \ + effect: SOFT_SHADOW; \ + description { state: "default" 0.0; \ + image { \ + normal: normal_image; \ + border: l r t b; \ + } \ + } \ + description { state: "clicked" 0.0; \ + inherit: "default" 0.0; \ + image.normal: press_image; \ + } \ + description { state: "disabled" 0.0; \ + inherit: "default" 0.0; \ + image.normal: disable_image; \ + } \ + } \ + part { name: "elm.text"; \ + type: TEXTBLOCK; \ + effect: SHADOW; \ + mouse_events: 0; \ + scale: 1; \ + description { state: "default" 0.0; \ + visible: 0; \ + fixed: 1 1; \ + align: 0.5 0.5; \ + rel1 { relative: 0.1 0; to: "button_image"; } \ + rel2 { relative: 0.9 1; to: "button_image"; } \ + color: 255 255 255 255; \ + text { \ + style: #button_name"btn_textblock_style"; \ + min: 0 0; \ + max: 0 1; \ + } \ + } \ + description { state: "visible" 0.0; \ + inherit: "default" 0.0; \ + visible: 1; \ + min: 1 1; \ + } \ + description { state: "clicked" 0.0; \ + inherit: "default" 0.0; \ + visible: 1; \ + min: 1 1; \ + } \ + description { state: "disabled" 0.0; \ + inherit: "default" 0.0; \ + color: 0 0 0 128; \ + color3: 0 0 0 0; \ + } \ + description { state: "disabled_visible" 0.0; \ + inherit: "default" 0.0; \ + color: 0 0 0 128; \ + color3: 0 0 0 0; \ + visible: 1; \ + min: 1 1; \ + } \ + } \ + part { name: "over1"; \ + mouse_events: 0; \ + description { state: "default" 0.0; \ + rel2.relative: 1.0 0.5; \ + } \ + description { state: "disabled" 0.0; \ + inherit: "default" 0.0; \ + } \ + } \ + part { name: "over2"; \ + mouse_events: 1; \ + repeat_events: 1; \ + ignore_flags: ON_HOLD; \ + description { state: "default" 0.0; \ + fixed: 1 1; \ + rel1 { relative: 0.0 0.0; to: "button_image"; } \ + rel2 { relative: 1.0 1.0; to: "button_image"; } \ + } \ + description { state: "disabled" 0.0; \ + inherit: "default" 0.0; \ + visible: 0; \ + } \ + } \ + part { name: "over3"; \ + mouse_events: 1; \ + repeat_events: 1; \ + description { state: "default" 0.0; \ + color: 255 255 255 0; \ + } \ + description { state: "clicked" 0.0; \ + inherit: "default" 0.0; \ + visible: 1; \ + color: 255 255 255 0; \ + } \ + } \ + part { name: "disabler"; \ + type: RECT; \ + description { state: "default" 0.0; \ + color: 0 0 0 0; \ + visible: 0; \ + } \ + description { state: "disabled" 0.0; \ + inherit: "default" 0.0; \ + visible: 1; \ + } \ + } \ + } \ + programs { \ + program { name: "button_click"; \ + signal: "mouse,down,1"; \ + source: "over2"; \ + action: SIGNAL_EMIT "elm,action,press" ""; \ + after: "button_click_anim"; \ + } \ + program { name: "button_click_anim"; \ + action: STATE_SET "clicked" 0.0; \ + target: "button_image"; \ + target: "elm.text"; \ + } \ + program { name: "button_unclick"; \ + signal: "mouse,up,1"; \ + source: "over2"; \ + action: SIGNAL_EMIT "elm,action,unpress" ""; \ + after: "button_unclick_anim"; \ + } \ + program { name: "button_unclick_anim"; \ + action: STATE_SET "default" 0.0; \ + target: "button_image"; \ + action: STATE_SET "visible" 0.0; \ + target: "elm.text"; \ + } \ + program { name: "button_mouseout_clicked"; \ + signal: "mouse,out"; \ + source: "over2"; \ + script { \ + new st[31]; \ + new Float:vl; \ + get_state(PART:"elm.text", st, 30, vl); \ + if (!strcmp(st, "clicked")) \ + { \ + set_state(PART:"elm.text", "visible", 0.0); \ + set_state(PART:"button_image", "visible", 0.0); \ + } \ + } \ + } \ + program { name: "button_click2"; \ + signal: "mouse,down,1"; \ + source: "over3"; \ + action: STATE_SET "clicked" 0.0; \ + target: "over3"; \ + } \ + program { name: "button_unclick2"; \ + signal: "mouse,clicked,1"; \ + source: "over3"; \ + action: STATE_SET "default" 0.0; \ + target: "over3"; \ + } \ + program { name: "button_unclick3"; \ + signal: "mouse,clicked,1"; \ + source: "over2"; \ + action: SIGNAL_EMIT "elm,action,click" ""; \ + } \ + program { name: "text_show"; \ + signal: "elm,state,text,visible"; \ + source: "elm"; \ + action: STATE_SET "visible" 0.0; \ + target: "elm.text"; \ + } \ + program { name: "text_hide"; \ + signal: "elm,state,text,hidden"; \ + source: "elm"; \ + action: STATE_SET "default" 0.0; \ + target: "elm.text"; \ + } \ + program { name: "disable"; \ + signal: "elm,state,disabled"; \ + source: "elm"; \ + action: STATE_SET "disabled" 0.0; \ + target: "button_image"; \ + target: "over1"; \ + target: "over2"; \ + target: "disabler"; \ + after: "disable_text"; \ + } \ + program { name: "disable_text"; \ + script { \ + new st[31]; \ + new Float:vl; \ + get_state(PART:"elm.text", st, 30, vl); \ + if (!strcmp(st, "visible")) \ + set_state(PART:"elm.text", "disabled_visible", 0.0); \ + else \ + set_state(PART:"elm.text", "disabled", 0.0); \ + } \ + } \ + program { name: "enable"; \ + signal: "elm,state,enabled"; \ + source: "elm"; \ + action: STATE_SET "default" 0.0; \ + target: "button_image"; \ + target: "over1"; \ + target: "over2"; \ + target: "disabler"; \ + after: "enable_text"; \ + } \ + program { name: "enable_text"; \ + script { \ + new st[31]; \ + new Float:vl; \ + get_state(PART:"elm.text", st, 30, vl); \ + if (!strcmp(st, "disabled_visible")) \ + set_state(PART:"elm.text", "visible", 0.0); \ + else \ + set_state(PART:"elm.text", "default", 0.0); \ + } \ + } \ + } \ + } + +#define TITLE_BUTTON(button_name, normal_image, press_image, l, r, t, b) \ + group { name: "elm/button/base/browser/"#button_name; \ + images { \ + image: normal_image COMP; \ + image: press_image COMP; \ + } \ + styles { \ + style { name: #button_name"btn_textblock_style"; \ + base: "font=FONT_CONTENT font_size=30 align=center color=#FFFFFF wrap=char"; \ + tag: "br" "\n"; \ + tag: "hilight" "+ font=FONT_CONTENT:style=Bold"; \ + tag: "b" "+ font=FONT_CONTENT:style=Bold"; \ + tag: "tab" "\t"; \ + } \ + } \ + parts { \ + part { name: "button_image"; \ + scale: 1; \ + mouse_events: 1; \ + effect: SOFT_SHADOW; \ + description { state: "default" 0.0; \ + image { \ + normal: normal_image; \ + border: l r t b; \ + } \ + } \ + description { state: "clicked" 0.0; \ + inherit: "default" 0.0; \ + image.normal: press_image; \ + } \ + description { state: "disabled" 0.0; \ + inherit: "default" 0.0; \ + image.normal: normal_image; \ + } \ + } \ + part { name: "elm.text"; \ + type: TEXTBLOCK; \ + effect: SHADOW; \ + mouse_events: 0; \ + scale: 1; \ + description { state: "default" 0.0; \ + visible: 0; \ + fixed: 1 1; \ + align: 0.5 0.5; \ + rel1 { relative: 0.1 0; to: "button_image"; } \ + rel2 { relative: 0.9 1; to: "button_image"; } \ + color: 255 255 255 255; \ + text { \ + style: #button_name"btn_textblock_style"; \ + min: 0 0; \ + max: 0 1; \ + } \ + } \ + description { state: "visible" 0.0; \ + inherit: "default" 0.0; \ + visible: 1; \ + min: 1 1; \ + } \ + description { state: "clicked" 0.0; \ + inherit: "default" 0.0; \ + visible: 1; \ + min: 1 1; \ + } \ + description { state: "disabled" 0.0; \ + inherit: "default" 0.0; \ + color: 0 0 0 128; \ + color3: 0 0 0 0; \ + } \ + description { state: "disabled_visible" 0.0; \ + inherit: "default" 0.0; \ + color: 0 0 0 128; \ + color3: 0 0 0 0; \ + visible: 1; \ + min: 1 1; \ + } \ + } \ + part { name: "over1"; \ + mouse_events: 0; \ + description { state: "default" 0.0; \ + rel2.relative: 1.0 0.5; \ + } \ + description { state: "disabled" 0.0; \ + inherit: "default" 0.0; \ + } \ + } \ + part { name: "over2"; \ + mouse_events: 1; \ + repeat_events: 1; \ + ignore_flags: ON_HOLD; \ + description { state: "default" 0.0; \ + } \ + description { state: "disabled" 0.0; \ + inherit: "default" 0.0; \ + visible: 0; \ + } \ + } \ + part { name: "over3"; \ + mouse_events: 1; \ + repeat_events: 1; \ + description { state: "default" 0.0; \ + color: 255 255 255 0; \ + } \ + description { state: "clicked" 0.0; \ + inherit: "default" 0.0; \ + visible: 1; \ + color: 255 255 255 0; \ + } \ + } \ + part { name: "disabler"; \ + type: RECT; \ + description { state: "default" 0.0; \ + color: 0 0 0 0; \ + visible: 0; \ + } \ + description { state: "disabled" 0.0; \ + inherit: "default" 0.0; \ + visible: 1; \ + } \ + } \ + } \ + programs { \ + program { name: "button_click"; \ + signal: "mouse,down,1"; \ + source: "over2"; \ + action: SIGNAL_EMIT "elm,action,press" ""; \ + after: "button_click_anim"; \ + } \ + program { name: "button_click_anim"; \ + action: STATE_SET "clicked" 0.0; \ + target: "button_image"; \ + target: "elm.text"; \ + } \ + program { name: "button_unclick"; \ + signal: "mouse,up,1"; \ + source: "over2"; \ + action: SIGNAL_EMIT "elm,action,unpress" ""; \ + after: "button_unclick_anim"; \ + } \ + program { name: "button_unclick_anim"; \ + action: STATE_SET "default" 0.0; \ + target: "button_image"; \ + action: STATE_SET "visible" 0.0; \ + target: "elm.text"; \ + } \ + program { name: "button_mouseout_clicked"; \ + signal: "mouse,out"; \ + source: "over2"; \ + script { \ + new st[31]; \ + new Float:vl; \ + get_state(PART:"elm.text", st, 30, vl); \ + if (!strcmp(st, "clicked")) \ + { \ + set_state(PART:"elm.text", "visible", 0.0); \ + set_state(PART:"button_image", "visible", 0.0); \ + } \ + } \ + } \ + program { name: "button_click2"; \ + signal: "mouse,down,1"; \ + source: "over3"; \ + action: STATE_SET "clicked" 0.0; \ + target: "over3"; \ + } \ + program { name: "button_unclick2"; \ + signal: "mouse,clicked,1"; \ + source: "over3"; \ + action: STATE_SET "default" 0.0; \ + target: "over3"; \ + } \ + program { name: "button_unclick3"; \ + signal: "mouse,clicked,1"; \ + source: "over2"; \ + action: SIGNAL_EMIT "elm,action,click" ""; \ + } \ + program { name: "text_show"; \ + signal: "elm,state,text,visible"; \ + source: "elm"; \ + action: STATE_SET "visible" 0.0; \ + target: "elm.text"; \ + } \ + program { name: "text_hide"; \ + signal: "elm,state,text,hidden"; \ + source: "elm"; \ + action: STATE_SET "default" 0.0; \ + target: "elm.text"; \ + } \ + program { name: "disable"; \ + signal: "elm,state,disabled"; \ + source: "elm"; \ + action: STATE_SET "disabled" 0.0; \ + target: "button_image"; \ + target: "over1"; \ + target: "over2"; \ + target: "disabler"; \ + after: "disable_text"; \ + } \ + program { name: "disable_text"; \ + script { \ + new st[31]; \ + new Float:vl; \ + get_state(PART:"elm.text", st, 30, vl); \ + if (!strcmp(st, "visible")) \ + set_state(PART:"elm.text", "disabled_visible", 0.0); \ + else \ + set_state(PART:"elm.text", "disabled", 0.0); \ + } \ + } \ + program { name: "enable"; \ + signal: "elm,state,enabled"; \ + source: "elm"; \ + action: STATE_SET "default" 0.0; \ + target: "button_image"; \ + target: "over1"; \ + target: "over2"; \ + target: "disabler"; \ + after: "enable_text"; \ + } \ + program { name: "enable_text"; \ + script { \ + new st[31]; \ + new Float:vl; \ + get_state(PART:"elm.text", st, 30, vl); \ + if (!strcmp(st, "disabled_visible")) \ + set_state(PART:"elm.text", "visible", 0.0); \ + else \ + set_state(PART:"elm.text", "default", 0.0); \ + } \ + } \ + } \ + } + +#define BUTTON_WITH_BG(button_name, normal_image, press_image, main_image, l, r, t, b, bg_w, bg_h, main_image_w, main_image_h) \ + group { name: "elm/button/base/browser/"#button_name; \ + images { \ + image: normal_image COMP; \ + image: press_image COMP; \ + image: main_image COMP; \ + } \ + styles { \ + style { name: #button_name"btn_textblock_style"; \ + base: "font=FONT_CONTENT font_size=21 align=center color=#000000 wrap=char"; \ + tag: "br" "\n"; \ + tag: "hilight" "+ font=FONT_CONTENT:style=Bold"; \ + tag: "b" "+ font=FONT_CONTENT:style=Bold"; \ + tag: "tab" "\t"; \ + } \ + } \ + parts { \ + part { name: "button_image"; \ + mouse_events: 1; \ + scale: 1; \ + effect: SOFT_SHADOW; \ + description { state: "default" 0.0; \ + align: 0.0 0.5; \ + min: bg_w bg_h; \ + max: bg_w bg_h; \ + fixed: 1 1; \ + image { \ + normal: normal_image; \ + border: l r t b; \ + } \ + } \ + description { state: "clicked" 0.0; \ + inherit: "default" 0.0; \ + image.normal: press_image; \ + } \ + description { state: "disabled" 0.0; \ + inherit: "default" 0.0; \ + image.normal: normal_image; \ + } \ + } \ + part { name: "main_image"; \ + mouse_events: 1; \ + scale: 1; \ + repeat_events: 1; \ + effect: SOFT_SHADOW; \ + description { state: "default" 0.0; \ + min: main_image_w main_image_h; \ + max: main_image_w main_image_h; \ + fixed: 1 1; \ + align: 0.5 0.5; \ + rel1 { relative: 0.0 0.0; to: "button_image"; } \ + rel2 { relative: 1.0 1.0; to: "button_image"; } \ + image { \ + normal: main_image; \ + } \ + } \ + } \ + part { name: "elm.text"; \ + type: TEXTBLOCK; \ + effect: SHADOW; \ + mouse_events: 0; \ + scale: 1; \ + description { state: "default" 0.0; \ + visible: 0; \ + fixed: 1 1; \ + align: 0.5 0.5; \ + rel1 { relative: 0.1 0; to: "button_image"; } \ + rel2 { relative: 0.9 1; to: "button_image"; } \ + color: 0 0 0 255; \ + text { \ + style: #button_name"btn_textblock_style"; \ + min: 0 0; \ + max: 0 1; \ + } \ + } \ + description { state: "visible" 0.0; \ + inherit: "default" 0.0; \ + visible: 1; \ + min: 1 1; \ + } \ + description { state: "clicked" 0.0; \ + inherit: "default" 0.0; \ + visible: 1; \ + min: 1 1; \ + } \ + description { state: "disabled" 0.0; \ + inherit: "default" 0.0; \ + color: 0 0 0 128; \ + color3: 0 0 0 0; \ + } \ + description { state: "disabled_visible" 0.0; \ + inherit: "default" 0.0; \ + color: 0 0 0 128; \ + color3: 0 0 0 0; \ + visible: 1; \ + min: 1 1; \ + } \ + } \ + part { name: "over1"; \ + mouse_events: 0; \ + description { state: "default" 0.0; \ + rel2.relative: 1.0 0.5; \ + } \ + description { state: "disabled" 0.0; \ + inherit: "default" 0.0; \ + } \ + } \ + part { name: "over2"; \ + mouse_events: 1; \ + repeat_events: 1; \ + ignore_flags: ON_HOLD; \ + description { state: "default" 0.0; \ + } \ + description { state: "disabled" 0.0; \ + inherit: "default" 0.0; \ + visible: 0; \ + } \ + } \ + part { name: "over3"; \ + mouse_events: 1; \ + repeat_events: 1; \ + description { state: "default" 0.0; \ + color: 255 255 255 0; \ + } \ + description { state: "clicked" 0.0; \ + inherit: "default" 0.0; \ + visible: 1; \ + color: 255 255 255 0; \ + } \ + } \ + part { name: "disabler"; \ + type: RECT; \ + description { state: "default" 0.0; \ + color: 0 0 0 0; \ + visible: 0; \ + } \ + description { state: "disabled" 0.0; \ + inherit: "default" 0.0; \ + visible: 1; \ + } \ + } \ + } \ + programs { \ + program { name: "button_click"; \ + signal: "mouse,down,1"; \ + source: "over2"; \ + action: SIGNAL_EMIT "elm,action,press" ""; \ + after: "button_click_anim"; \ + } \ + program { name: "button_click_anim"; \ + action: STATE_SET "clicked" 0.0; \ + target: "button_image"; \ + target: "elm.text"; \ + } \ + program { name: "button_unclick"; \ + signal: "mouse,up,1"; \ + source: "over2"; \ + action: SIGNAL_EMIT "elm,action,unpress" ""; \ + after: "button_unclick_anim"; \ + } \ + program { name: "button_unclick_anim"; \ + action: STATE_SET "default" 0.0; \ + target: "button_image"; \ + action: STATE_SET "visible" 0.0; \ + target: "elm.text"; \ + } \ + program { name: "button_mouseout_clicked"; \ + signal: "mouse,out"; \ + source: "over2"; \ + script { \ + new st[31]; \ + new Float:vl; \ + get_state(PART:"elm.text", st, 30, vl); \ + if (!strcmp(st, "clicked")) \ + { \ + set_state(PART:"elm.text", "visible", 0.0); \ + set_state(PART:"button_image", "visible", 0.0); \ + } \ + } \ + } \ + program { name: "button_click2"; \ + signal: "mouse,down,1"; \ + source: "over3"; \ + action: STATE_SET "clicked" 0.0; \ + target: "over3"; \ + } \ + program { name: "button_unclick2"; \ + signal: "mouse,clicked,1"; \ + source: "over3"; \ + action: STATE_SET "default" 0.0; \ + target: "over3"; \ + } \ + program { name: "button_unclick3"; \ + signal: "mouse,clicked,1"; \ + source: "over2"; \ + action: SIGNAL_EMIT "elm,action,click" ""; \ + } \ + program { name: "text_show"; \ + signal: "elm,state,text,visible"; \ + source: "elm"; \ + action: STATE_SET "visible" 0.0; \ + target: "elm.text"; \ + } \ + program { name: "text_hide"; \ + signal: "elm,state,text,hidden"; \ + source: "elm"; \ + action: STATE_SET "default" 0.0; \ + target: "elm.text"; \ + } \ + program { name: "disable"; \ + signal: "elm,state,disabled"; \ + source: "elm"; \ + action: STATE_SET "disabled" 0.0; \ + target: "button_image"; \ + target: "over1"; \ + target: "over2"; \ + target: "disabler"; \ + after: "disable_text"; \ + } \ + program { name: "disable_text"; \ + script { \ + new st[31]; \ + new Float:vl; \ + get_state(PART:"elm.text", st, 30, vl); \ + if (!strcmp(st, "visible")) \ + set_state(PART:"elm.text", "disabled_visible", 0.0); \ + else \ + set_state(PART:"elm.text", "disabled", 0.0); \ + } \ + } \ + program { name: "enable"; \ + signal: "elm,state,enabled"; \ + source: "elm"; \ + action: STATE_SET "default" 0.0; \ + target: "button_image"; \ + target: "over1"; \ + target: "over2"; \ + target: "disabler"; \ + after: "enable_text"; \ + } \ + program { name: "enable_text"; \ + script { \ + new st[31]; \ + new Float:vl; \ + get_state(PART:"elm.text", st, 30, vl); \ + if (!strcmp(st, "disabled_visible")) \ + set_state(PART:"elm.text", "visible", 0.0); \ + else \ + set_state(PART:"elm.text", "default", 0.0); \ + } \ + } \ + } \ + } + +#define BROWSER_GENLIST_PART_DISCLIP \ + part { name: "disclip"; \ + type: RECT; \ + description { state: "default" 0.0; \ + rel1.to: "base"; \ + rel2.to: "base"; \ + } \ + description { state: "disabled" 0.0; \ + inherit: "default" 0.0; \ + color: 255 255 255 64; \ + } \ + } + +#define BROWSER_GENLIST_TRANSPARENT_PART \ + part { name: "elm.between.layer"; \ + type: RECT; \ + clip_to: "disclip"; \ + mouse_events: 1; \ + description { state: "default" 0.0; \ + rel1.to: "base"; \ + rel2.to: "base"; \ + color: 0 0 0 0; \ + } \ + description { state: "repeat_events" 0.0; \ + inherit: "default" 0.0; \ + visible: 0; \ + } \ + } + +#define BROWSER_GENLIST_BASE_PART_BASE( param_item_height ) \ + part { name: "base"; \ + clip_to: "disclip"; \ + scale: 1; \ + description { state: "default" 0.0; \ + min: 0 param_item_height; \ + image.normal: "theme/00_sweep_list_bg.png"; \ + } \ + } + +#define BROWSER_GENLIST_BASE_PART_BOTTOM_LINE \ + part { name: "bottom_line"; \ + type: RECT; \ + clip_to: "disclip"; \ + mouse_events: 0; \ + description { state: "default" 0.0; \ + min: 0 1; \ + fixed: 0 1; \ + visible: 1; \ + color: 212 212 212 255; \ + rel1 { \ + relative: 0.0 1.0; \ + offset: 0 -1; \ + to: "base"; \ + } \ + rel2.to: "base"; \ + } \ + } + +#define BROWSER_GENLIST_BASE_PART_PADDING_LEFT( param_padding_size ) \ + part { name: "base.padding.left"; \ + type: RECT; \ + clip_to: "disclip"; \ + mouse_events: 0; \ + scale: 1; \ + description { state: "default" 0.0; \ + min: param_padding_size 0; \ + fixed: 1 0; \ + visible: 0; \ + rel1.to: "base"; \ + rel2 { \ + relative: 0 1; \ + to: "base"; \ + } \ + } \ + } + +#define BROWSER_GENLIST_BASE_PART_PADDING_RIGHT( param_padding_size ) \ + part { name: "base.padding.right"; \ + type: RECT; \ + clip_to: "disclip"; \ + mouse_events: 0; \ + scale: 1; \ + description { state: "default" 0.0; \ + min: param_padding_size 0; \ + fixed: 1 0; \ + visible: 0; \ + rel1 { \ + relative: 1 0; \ + to: "base"; \ + } \ + rel2.to: "base"; \ + } \ + } + +#define BROWSER_GENLIST_BASE_PART_PADDING_BOTTOM( param_padding_size ) \ + part { name: "base.padding.bottom"; \ + type: RECT; \ + clip_to: "disclip"; \ + mouse_events: 0; \ + scale: 1; \ + description { state: "default" 0.0; \ + min: 0 param_padding_size; \ + fixed: 0 1; \ + visible: 0; \ + align: 0.5 1; \ + rel1 { \ + relative: 0 1; \ + to: "base"; \ + } \ + rel2 { \ + relative: 1 1; \ + to: "base"; \ + } \ + } \ + } + +#define BROWSER_GENLIST_BASE_PART_TEXT \ + part { name: "elm.base.text"; \ + type: TEXT; \ + clip_to: "disclip"; \ + mouse_events: 0; \ + scale: 1; \ + description { state: "default" 0.0; \ + /* \ + min: 0 36; \ + */ \ + min: 0 54; \ + fixed: 0 1; \ + align: 0.5 0; \ + rel1 { \ + relative: 1 0; \ + to_x: "base.padding.left"; \ + to_y: "base"; \ + } \ + rel2 { \ + relative: 0 0; \ + to_x: "base.padding.right"; \ + to_y: "base"; \ + } \ + color: 255 255 255 255; \ + text { \ + font: "SLP:style=Roman"; \ + /* \ + size: 22; \ + */ \ + size: 33; \ + min: 0 1; \ + align: 0.5 0.5; \ + } \ + } \ + } + +#define BROWSER_GENLIST_BASE_PART_PADDING_CENTER_VERTICAL( param_padding_size ) \ + part { name: "base.padding.center.vertical"; \ + type: RECT; \ + clip_to: "disclip"; \ + mouse_events: 0; \ + scale: 1; \ + description { state: "default" 0.0; \ + min: param_padding_size 0; \ + fixed: 1 0; \ + visible: 0; \ + align: 0.5 0.5; \ + rel1 { \ + relative: 0.5 0; \ + to: "base"; \ + } \ + rel2 { \ + relative: 0.5 1; \ + to: "base"; \ + } \ + } \ + } + +#define BROWSER_GENLIST_BASE_PART_PADDING_CENTER_HORIZONTAL( param_padding_size ) \ + part { name: "base.padding.center.horizontal"; \ + type: RECT; \ + clip_to: "disclip"; \ + mouse_events: 0; \ + scale: 1; \ + description { state: "default" 0.0; \ + min: param_padding_size 0; \ + fixed: 0 1; \ + visible: 0; \ + align: 0.5 0.5; \ + rel1 { \ + relative: 0 0.5; \ + to: "base"; \ + } \ + rel2 { \ + relative: 1 0.5; \ + to: "base"; \ + } \ + } \ + } + +#define BROWSER_GENLIST_BASE_PART_BUTTON_1 \ + part { name: "elm.base.swallow.button1"; \ + type: SWALLOW; \ + clip_to: "disclip"; \ + description { state: "default" 0.0; \ + rel1 { \ + relative: 1 1; \ + to_x: "base.padding.left"; \ + to_y: "base.padding.center.horizontal"; \ + } \ + rel2 { \ + relative: 0 0; \ + to_x: "base.padding.center.vertical"; \ + to_y: "base.padding.bottom"; \ + } \ + } \ + } + +#define BROWSER_GENLIST_BASE_PART_BUTTON_2 \ + part { name: "elm.base.swallow.button2"; \ + type: SWALLOW; \ + clip_to: "disclip"; \ + description { state: "default" 0.0; \ + rel1 { \ + relative: 1 1; \ + to_x: "base.padding.center.vertical"; \ + to_y: "base.padding.center.horizontal"; \ + } \ + rel2 { \ + relative: 0 0; \ + to_x: "base.padding.right"; \ + to_y: "base.padding.bottom"; \ + } \ + } \ + } + +#define BROWSER_GENLIST_SLIDE_PART_BASE( param_item_height ) \ + part { name: "slide_base"; \ + clip_to: "disclip"; \ + type: RECT; \ + repeat_events: 1; \ + scale: 1; \ + description { state: "default" 0.0; \ + min: 0 param_item_height; \ + color: 246 245 237 255; \ + rel1.to: "base"; \ + rel2.to: "base"; \ + } \ + description { state: "hide" 0.0; \ + inherit: "default" 0.0; \ + rel1 { relative: 0.025 0.0; } \ + rel2 { relative: 1.025 1.0; } \ + } \ + description { state: "hide" 0.1; \ + inherit: "default" 0.0; \ + rel1 { relative: 0.13 0.0; } \ + rel2 { relative: 1.13 1.0; } \ + } \ + description { state: "hide" 0.2; \ + inherit: "default" 0.0; \ + rel1 { relative: 0.5 0.0; } \ + rel2 { relative: 1.5 1.0; } \ + } \ + description { state: "hide" 0.3; \ + inherit: "default" 0.0; \ + rel1 { relative: 1.0 0.0; } \ + rel2 { relative: 2.0 1.0; } \ + } \ + } + +#define BROWSER_GENLIST_SLIDE_PART_BOTTOM_LINE \ + part { name: "slide_bottom_line"; \ + type: RECT; \ + clip_to: "disclip"; \ + mouse_events: 0; \ + description { state: "default" 0.0; \ + min: 0 1; \ + fixed: 0 1; \ + visible: 1; \ + color: 212 212 212 255; \ + rel1 { \ + relative: 0.0 1.0; \ + offset: 0 -1; \ + to: "slide_base"; \ + } \ + rel2.to: "slide_base"; \ + } \ + } + +#define BROWSER_GENLIST_SLIDE_PART_PADDING_TOP( param_padding_size ) \ + part { name: "slide_base.padding.top"; \ + type: RECT; \ + clip_to: "disclip"; \ + mouse_events: 0; \ + scale: 1; \ + description { \ + state: "default" 0.0; \ + min: 0 param_padding_size; \ + fixed: 0 1; \ + visible: 0; \ + align: 0.5 0.0; \ + rel1 { \ + relative: 0 0; \ + to: "slide_base"; \ + } \ + rel2 { \ + relative: 1 0; \ + to: "slide_base"; \ + } \ + } \ + } + +#define BROWSER_GENLIST_SLIDE_PART_PADDING_BOTTOM( param_padding_size ) \ + part { name: "slide_base.padding.bottom"; \ + type: RECT; \ + clip_to: "disclip"; \ + mouse_events: 0; \ + scale: 1; \ + description { \ + state: "default" 0.0; \ + min: 0 param_padding_size; \ + fixed: 0 1; \ + visible: 0; \ + align: 0.5 1; \ + rel1 { \ + relative: 0 1; \ + to: "slide_base"; \ + } \ + rel2 { \ + relative: 1 1; \ + to: "slide_base"; \ + } \ + } \ + } + +#define BROWSER_GENLIST_SLIDE_PART_PADDING_LEFT( param_padding_size ) \ + part { name: "slide_base.padding.left"; \ + type: RECT; \ + scale: 1; \ + clip_to: "disclip"; \ + mouse_events: 0; \ + description { state: "default" 0.0; \ + min: param_padding_size 0; \ + fixed: 1 0; \ + visible: 0; \ + rel1.to: "slide_base"; \ + rel2 { \ + relative: 0 1; \ + to: "slide_base"; \ + } \ + align: 0.0 0.0; \ + } \ + } + +#define BROWSER_GENLIST_SLIDE_PART_PADDING_RIGHT( param_padding_size ) \ + part { name: "slide_base.padding.right"; \ + type: RECT; \ + scale: 1; \ + clip_to: "disclip"; \ + mouse_events: 0; \ + description { state: "default" 0.0; \ + min: param_padding_size 0; \ + fixed: 1 0; \ + visible: 0; \ + rel1 { \ + relative: 1 0; \ + to: "slide_base"; \ + } \ + rel2.to: "slide_base"; \ + align: 1.0 0.0; \ + } \ + } + +#define BEAT_GENLIST_PART_BASE( param_item_height ) \ + part { name: "base"; \ + type: RECT; \ + repeat_events: 1; \ + scale: 1; \ + description { state: "default" 0.0; \ + min: 0 param_item_height; \ + color: GENLIST_PART_BG_COLOR_INC; \ + } \ + } + +#define BEAT_GENLIST_PART_BG_IMAGE \ + part { name: "bg_image"; \ + type: RECT; \ + clip_to: "disclip"; \ + mouse_events: 0; \ + description { state: "default" 0.0; \ + visible: 0; \ + color: GENLIST_PART_BG_SELECTED_COLOR_INC; \ + } \ + description { state: "selected" 0.0; \ + inherit: "default" 0.0; \ + visible: 1; \ + } \ + } + +#define BEAT_GENLIST_PART_BOTTOM_LINE \ + part { name: "bottom_line"; \ + type: RECT; \ + clip_to: "disclip"; \ + mouse_events: 0; \ + description { state: "default" 0.0; \ + min: 0 1; \ + fixed: 0 1; \ + visible: 1; \ + color: GENLIST_PART_BOTTOM_LINE_INC; \ + rel1 { \ + relative: 0.0 1.0; \ + offset: 0 -1; \ + } \ + } \ + } + +#define BEAT_GENLIST_PART_PADDING_TOP( param_padding_size ) \ + part { name: "elm.padding.top"; \ + type: RECT; \ + scale: 1; \ + description { \ + state: "default" 0.0; \ + min: 0 param_padding_size; \ + fixed: 0 1; \ + visible: 0; \ + rel2.relative: 1.0 0.0; \ + align: 0.0 0.0; \ + } \ + } + +#define BEAT_GENLIST_PART_PADDING_BOTTOM( param_padding_size ) \ + part { name: "elm.padding.bottom"; \ + type: RECT; \ + scale: 1; \ + description { state: "default" 0.0; \ + min: 0 param_padding_size; \ + fixed: 0 1; \ + visible: 0; \ + rel1.relative: 0.0 1.0; \ + align: 0.0 1.0; \ + } \ + } + +#define BEAT_GENLIST_PART_PADDING_LEFT( param_padding_size ) \ + part { name: "elm.padding.left"; \ + type: RECT; \ + scale: 1; \ + description { state: "default" 0.0; \ + min: param_padding_size 0; \ + fixed: 1 0; \ + visible: 0; \ + rel2.relative: 0.0 1.0; \ + align: 0.0 0.0; \ + } \ + } + +#define BEAT_GENLIST_PART_PADDING_RIGHT( param_padding_size ) \ + part { name: "elm.padding.right"; \ + type: RECT; \ + scale: 1; \ + description { state: "default" 0.0; \ + min: param_padding_size 0; \ + fixed: 1 0; \ + visible: 0; \ + rel1.relative: 1.0 0.0; \ + align: 1.0 0.0; \ + } \ + } + +#define BEAT_GENLIST_PART_DISCLIP \ + part { name: "disclip"; \ + type: RECT; \ + description { state: "default" 0.0; \ + } \ + description { state: "disabled" 0.0; \ + inherit: "default" 0.0; \ + color: 255 255 255 64; \ + } \ + } + +#define BEAT_GENLIST_SELECT_ALL_PART_DISCLIP \ + part { name: "disclip"; \ + type: RECT; \ + description { state: "default" 0.0; \ + rel1.to: "base"; \ + rel2.to: "base"; \ + } \ + description { state: "disabled" 0.0; \ + inherit: "default" 0.0; \ + color: 255 255 255 64; \ + } \ + } + diff --git a/edc/browser-multi-window.edc b/edc/browser-multi-window.edc new file mode 100755 index 00000000..1638f492 --- /dev/null +++ b/edc/browser-multi-window.edc @@ -0,0 +1,641 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "browser-macro.edc" + +collections { + group { + name: "browser/browser-multi-window"; + images { + + } + parts { + /* For view change effect. */ + part { name: "rect.bg_clipper"; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + color: 255 255 255 0; + rel1 { relative: 0.0 0.0; to: "bg"; } + rel2 { relative: 1.0 1.0; to: "bg"; } + } + description { + state: "visible" 0.0; + color: 255 255 255 255; + rel1 { relative: 0.0 0.0; to: "bg"; } + rel2 { relative: 1.0 1.0; to: "bg"; } + } + } + part { name: "bg2"; + mouse_events: 1; + repeat_events: 0; + type: RECT; + scale: 1; + /* For view change effect. */ + clip_to: "rect.bg_clipper"; + description { + state: "default" 0.0; + align: 0.0 0.0; + visible: 1; + rel1 { relative: 0.0 0.0; } + rel2 { relative: 1.0 1.0; } + color: 0 0 0 0; + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + color: 0 0 0 180; + } + } + part { name: "bg"; + mouse_events: 1; + repeat_events: 0; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + align: 0.0 0.0; + visible: 1; + rel1 { relative: 0.0 0.0; } + rel2 { relative: 1.0 1.0; } + color: 0 0 0 0; + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + color: 0 0 0 0; + } + } + /* For view change effect. */ + part { name: "rect.scroller_clipper"; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + color: 255 255 255 255; + rel1 { relative: 0.0 0.0; to: "elm.swallow.scroller"; } + rel2 { relative: 1.0 1.0; to: "elm.swallow.scroller"; } + } + description { + state: "invisible" 0.0; + color: 255 255 255 0; + rel1 { relative: 0.0 0.0; to: "elm.swallow.scroller"; } + rel2 { relative: 1.0 1.0; to: "elm.swallow.scroller"; } + } + } + part { + name: "elm.swallow.scroller"; + type: SWALLOW; + mouse_events: 1; + scale: 1; + /* For view change effect. */ + clip_to: "rect.scroller_clipper"; + description { + state: "default" 0.0; + visible: 1; + fixed: 1 1; + align: 0.0 0.0; + rel1 { relative: 0.0 0.15; } + rel2 { relative: 1.0 0.85; } + } + description { + state: "invisible" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + /* For view change effect. */ + part { name: "rect.gengrid_clipper"; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + color: 255 255 255 0; + rel1 { relative: 0.0 0.0; to: "elm.swallow.gengrid"; } + rel2 { relative: 1.0 1.0; to: "elm.swallow.gengrid"; } + } + description { + state: "visible" 0.0; + color: 255 255 255 255; + rel1 { relative: 0.0 0.0; to: "elm.swallow.gengrid"; } + rel2 { relative: 1.0 1.0; to: "elm.swallow.gengrid"; } + } + } + part { + name: "elm.swallow.gengrid"; + type: SWALLOW; + mouse_events: 1; + scale: 1; + /* For view change effect. */ + clip_to: "rect.gengrid_clipper"; + description { + state: "default" 0.0; + visible: 0; + fixed: 1 1; + align: 0.0 0.0; + rel1 { relative: 0.0 0.0; } + rel2 { relative: 1.0 0.85; } + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part { + name: "elm.swallow.close_multi_window_button"; + type: SWALLOW; + mouse_events: 1; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + min: 210 69; + max: 210 69; + fixed: 1 1; + align: 1.0 1.0; + rel1 { relative: -0.05 0.98; to_x: "elm.swallow.view_change_button"; } + rel2 { relative: -0.05 0.98; to_x: "elm.swallow.view_change_button"; } + } + } + part { + name: "elm.swallow.view_change_button"; + type: SWALLOW; + mouse_events: 1; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + min: 210 69; + max: 210 69; + fixed: 1 1; + align: 0.5 1.0; + rel1 { relative: 0.5 0.98; } + rel2 { relative: 0.5 0.98; } + } + } + part { + name: "elm.swallow.new_window_button"; + type: SWALLOW; + mouse_events: 1; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + min: 210 69; + max: 210 69; + fixed: 1 1; + align: 0.0 1.0; + rel1 { relative: 1.05 0.98; to_x: "elm.swallow.view_change_button"; } + rel2 { relative: 1.05 0.98; to_x: "elm.swallow.view_change_button"; } + } + } + part { + name: "elm.title"; + type: TEXT; + mouse_events: 1; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + min: 0 60; + fixed: 0 1; + align: 0.5 1.0; + rel1 { relative: 0.0 0.0; to_x: "bg"; to_y: "elm.swallow.scroller"; } + rel2 { relative: 1.0 0.0; to_x: "bg"; to_y: "elm.swallow.scroller"; } + text { + font: FONT_ROM; + size: 33; + min: 0 0; + align: 0.5 1.0; + } + color: 255 255 255 255; + } + description { + state: "invisible" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + part { + name: "elm.url"; + type: TEXT; + mouse_events: 1; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + min: 0 50; + fixed: 0 1; + align: 0.5 0.0; + rel1 { relative: 0.0 1.0; to_x: "bg"; to_y: "elm.title"; } + rel2 { relative: 1.0 1.0; to_x: "bg"; to_y: "elm.title"; } + text { + font: FONT_ROM; + size: 30; + min: 0 0; + align: 0.5 1.0; + } + color: 255 255 255 255; + } + description { + state: "invisible" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + part { + name: "elm.swallow.page_control"; + type: SWALLOW; + mouse_events: 1; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + align: 0.5 0.6; + fixed: 0 1; + rel1 { relative: 0.0 0.0; to_x: "bg"; to_y: "bg"; } + rel2 { relative: 1.0 0.0; to_x: "bg"; to_y: "elm.title"; } + } + description { + state: "invisible" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + } + + programs { + program { name: "show,multi_window"; + signal: "show,multi_window,signal"; + action: STATE_SET "visible" 0.0; + target: "bg"; + } + program { name: "show,bg"; + signal: "show,bg,signal"; + transition: LINEAR 0.8; + action: STATE_SET "visible" 0.0; + target: "bg2"; + target: "rect.bg_clipper"; + } + program { name: "hide,multi_window"; + signal: "hide,multi_window,signal"; + transition: LINEAR 0.2; + action: STATE_SET "default" 0.0; + target: "bg"; + } + program { name: "show,grid_mode"; + signal: "show,grid_mode,signal"; + action: STATE_SET "invisible" 0.0; + transition: ACCELERATE 0.3; + target: "elm.swallow.scroller"; + target: "elm.title"; + target: "elm.url"; + target: "elm.swallow.page_control"; + target: "rect.scroller_clipper"; + } + program { name: "show,grid_mode,gengrid"; + signal: "show,grid_mode,signal"; + action: STATE_SET "visible" 0.0; + target: "elm.swallow.gengrid"; + } + program { name: "show,grid_mode,clipper"; + signal: "show,grid_mode,signal"; + action: STATE_SET "visible" 0.0; + transition: ACCELERATE 0.3; + target: "rect.gengrid_clipper"; + } + + program { name: "show,normal_mode"; + signal: "show,normal_mode,signal"; + action: STATE_SET "default" 0.0; + target: "elm.swallow.scroller"; + target: "elm.title"; + target: "elm.url"; + target: "elm.swallow.page_control"; + } + program { name: "show,normal_mode,clipper"; + signal: "show,normal_mode,signal"; + action: STATE_SET "default" 0.0; + transition: ACCELERATE 0.3; + target: "rect.scroller_clipper"; + } + program { name: "hide,grid_mode,clipper"; + signal: "show,normal_mode,signal"; + action: STATE_SET "default" 0.0; + transition: ACCELERATE 0.3; + target: "rect.gengrid_clipper"; + target: "elm.swallow.gengrid"; + after: "delete,gengrid"; + } + /* Send "delete,gengrid,signal" + * to delete gengrid after view change effect */ + program { name: "delete,gengrid"; + source: "elm.swallow.gengrid"; + action: SIGNAL_EMIT "delete,gengrid,signal" ""; + } + } + } + + group { + name: "browser/multi-window/item"; + images{ + image: "multi-window/I01_Btn_delete_01.png" COMP; + image: "multi-window/I01_Btn_delete_01_press.png" COMP; + } + parts { + part { name: "bg"; + mouse_events: 0; + scale: 1; + type: RECT; + description { + state: "default" 0.0; + visible: 1; + rel1 { relative: 0.0 0.0; } + rel2 { relative: 1.0 1.0; } + color: 0 0 0 0; + } + } + part { name: "rect.clipper"; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + color: 255 255 255 255; + rel1 { relative: 1.0 0.0; to_x: "padding,snapshot_left"; } + rel2 { relative: 0.0 1.0; to_x: "padding,snapshot_right"; } + } + description { + state: "grey" 0.0; + color: 255 255 255 125; + rel1 { relative: 1.0 0.0; to_x: "padding,snapshot_left"; } + rel2 { relative: 0.0 1.0; to_x: "padding,snapshot_right"; } + } + } + part { name: "elm.swallow.snapshot"; + type: SWALLOW; + mouse_events: 1; + repeat_events: 1; + scale: 1; + clip_to: "rect.clipper"; + description { + state: "default" 0.0; + visible: 1; + align: 0.0 0.5; + rel1 { relative: 1.0 0.0; to_x: "padding,snapshot_left"; } + rel2 { relative: 0.0 1.0; to_x: "padding,snapshot_right"; } + } + } + part { name: "padding,snapshot_left"; + type: RECT; + mouse_events: 0; + repeat_events: 0; + scale: 1; + description { + state: "default" 0.0; + min: 22 0; + fixed: 1 0; + visible: 0; + align: 0.0 0.5; + rel1 { relative: 0.0 0.0; to: "bg"; } + rel2 { relative: 0.0 1.0; to: "bg"; } + } + } + part { name: "padding,snapshot_right"; + type: RECT; + mouse_events: 0; + repeat_events: 0; + scale: 1; + description { + state: "default" 0.0; + min: 22 0; + fixed: 1 0; + visible: 0; + align: 1.0 0.5; + rel1 { relative: 1.0 0.0; to: "bg"; } + rel2 { relative: 1.0 1.0; to: "bg"; } + } + } + part { name: "elm.image.delete_window"; + type: IMAGE; + mouse_events: 1; + repeat_events: 0; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + min: 75 75; + max: 75 75; + fixed: 1 1; + align: 0.6 0.4; + rel1 { relative: 1.0 0.0; to: "elm.swallow.snapshot"; } + rel2 { relative: 1.0 0.0; to: "elm.swallow.snapshot"; } + image.normal: "multi-window/I01_Btn_delete_01.png"; + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + description { + state: "pressed" 0.0; + inherit: "default" 0.0; + visible: 1; + image.normal: "multi-window/I01_Btn_delete_01_press.png"; + } + } + } + programs { + program { name: "grey,snapshot"; + signal: "grey,snapshot,signal"; + action: STATE_SET "grey" 0.0; + transition: ACCELERATE 0.3; + target: "rect.clipper"; + } + program { name: "non_grey,snapshot"; + signal: "non_grey,snapshot,signal"; + action: STATE_SET "default" 0.0; + target: "rect.clipper"; + } + program { name: "show,delete_window_icon"; + signal: "show,delete_window_icon,signal"; + action: STATE_SET "visible" 0.0; + target: "elm.image.delete_window"; + } + program { name: "hide,delete_window_icon"; + signal: "hide,delete_window_icon,signal"; + action: STATE_SET "default" 0.0; + target: "elm.image.delete_window"; + } + program { + name: "delete_button_press"; + signal: "mouse,down,1"; + source: "elm.image.delete_window"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.image.delete_window", st, 30, vl); + + new st_1[31]; + new Float:vl_1; + get_state(PART:"rect.clipper", st_1, 30, vl_1); + + if (!strcmp(st, "visible") && !strcmp(st_1, "default")) + set_state(PART:"elm.image.delete_window", "pressed", 0.0); + } + } + program { + name: "delete_button_release"; + signal: "mouse,up,1"; + source: "elm.image.delete_window"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.image.delete_window", st, 30, vl); + + new st_1[31]; + new Float:vl_1; + get_state(PART:"rect.clipper", st_1, 30, vl_1); + + if (!strcmp(st, "pressed") && !strcmp(st_1, "default")) + set_state(PART:"elm.image.delete_window", "visible", 0.0); + } + } + } + } + group { + name: "browser/multi-window/grid_item"; + images{ + image: "multi-window/I01_Btn_delete_01.png" COMP; + image: "multi-window/I01_Btn_delete_01_press.png" COMP; + } + parts { + part { name: "bg"; + mouse_events: 1; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + fixed: 1 1; + rel1 { relative: 0.0 0.0; } + rel2 { relative: 1.0 1.0; } + color: 0 0 0 0; + } + } + part { name: "elm.swallow.snapshot"; + type: SWALLOW; + scale: 1; + mouse_events: 1; + repeat_events: 1; + description { + state: "default" 0.0; + visible: 1; + fixed: 1 1; + align: 0.0 0.0; + rel1 { relative: 0.0 0.0; to: bg; } + rel2 { relative: 1.0 1.0; to: bg; } + } + } + part { name: "delete_icon"; + type: IMAGE; + mouse_events: 1; + repeat_events: 0; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + min: 48 48; + max: 48 48; + fixed: 1 1; + align: 0.7 0.3; + rel1 { relative: 1.0 0.0; to: "elm.swallow.snapshot"; } + rel2 { relative: 1.0 0.0; to: "elm.swallow.snapshot"; } + image.normal: "multi-window/I01_Btn_delete_01.png"; + } + description { + state: "pressed" 0.0; + inherit: "default" 0.0; + visible: 1; + image.normal: "multi-window/I01_Btn_delete_01_press.png"; + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part { name: "delete_icon_click_area"; + type: RECT; + mouse_events: 1; + repeat_events: 0; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + align: 0.0 0.0; + rel1 { relative: -0.3 -0.3; to: "delete_icon"; } + rel2 { relative: 1.3 1.3; to: "delete_icon"; } + color: 0 0 0 0; + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + programs{ + program { name: "show,delete_icon"; + signal: "show,delete_icon,signal"; + action: STATE_SET "visible" 0.0; + target: "delete_icon"; + target: "delete_icon_click_area"; + } + program { name: "hide,delete_icon"; + signal: "hide,delete_icon,signal"; + action: STATE_SET "default" 0.0; + target: "delete_icon"; + target: "delete_icon_click_area"; + } + program { + name: "delete_button_press"; + signal: "mouse,down,1"; + source: "delete_icon_click_area"; + script { + new st[31]; + new Float:vl; + get_state(PART:"delete_icon", st, 30, vl); + if (!strcmp(st, "visible")) + set_state(PART:"delete_icon", "pressed", 0.0); + } + } + program { + name: "delete_button_release"; + signal: "mouse,up,1"; + source: "delete_icon_click_area"; + script { + new st[31]; + new Float:vl; + get_state(PART:"delete_icon", st, 30, vl); + if (!strcmp(st, "pressed")) + set_state(PART:"delete_icon", "visible", 0.0); + } + } + } + } + } +} diff --git a/edc/browser-naviframe.edc b/edc/browser-naviframe.edc new file mode 100755 index 00000000..5106f862 --- /dev/null +++ b/edc/browser-naviframe.edc @@ -0,0 +1,2129 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Apply new naviframe + +#define NAVIFRAME_TITLE_H_INC 0 + +#define NAVIFRAME_SEGMENT_TITLE_H_INC 136 + +#define NAVIFRAME_OH_OPENED_H_INC 150 + +#define NAVIFRAME_OH_CONTENT_H_INC 74 +#define NAVIFRAME_OH_PADDING_INC 16 +#define NAVIFRAME_OH_ARROW_SIZE_INC 19 12 +#define NAVIFRAME_OH_OPENED_DOUBLE_H_INC 196 +#define NAVIFRAME_PREV_BTN_W_INC 124 +#define NAVIFRAME_TITLE_FUNC_BTN_PADDING_W_INC 10 +#define NAVIFRAME_TITLE_FUNC_BTN_SIZE_INC 124 80 +#define NAVIFRAME_TEXT_PADDING_INC 144 +#define NAVIFRAME_TEXT_PADDING_MORE_BUTTON_INC 278 +#define NAVIFRAME_NO_BUTTON_ICON_PADDING_INC 52 +#define NAVIFRAME_TEXT_PADDING_ICON_VISIBLE_INC 186 +#define NAVIFRAME_TITLE_SEGMENT_H_INC 74 +#define NAVIFRAME_TITLE_SEGMENT_FONT_SIZE_INC 28 +#define NAVIFRAME_TITLE_SEGMENT_TEXT_H_INC 50 +#define NAVIFRAME_TITLE_FONT_SIZE_INC 36 +#define NAVIFRAME_ICON_SIZE_INC 32 32 +#define NAVIFRAME_ICON_PADDING_INC 16 0 +#define NAVIFRAME_CONTROLBAR_PADDING_INC 5 +//#define NAVIFRAME_CONTROLBAR_BG_COLOR_INC 37 48 54 255 // naviframe default +#define NAVIFRAME_CONTROLBAR_BG_COLOR_INC 31 31 31 255 // browser customize + +#define NAVIFRAME_TITLE_TEXT_COLOR_INC 249 249 249 255 // browser customize +#define NAVIFRAME_TITLE_BG_COLOR_INC 91 109 138 255 // browser customize + +//#define CONTROLBAR_SMALL_HEIGHT_INC 102 // naviframe default +#define CONTROLBAR_SMALL_HEIGHT_INC 114 // browser customize +#define NAVIFRAME_VIEW_TRANS_TIME 0.3 + +#define NAVIFRAME_TITLE_PREV_BTN_BG_SIZE_INC 144 + +collections { + group { name:"elm/naviframe/base/browser"; + parts { + part { name: "base"; + description { state: "default" 0.0; + } + } + } + } + group { name:"elm/naviframe/item/basic/browser"; + alias:"elm/naviframe/item/1line/browser"; + images { + image: "browser-view-images/naviframe_optionheader.png" COMP; // browser customize + image: "browser-view-images/naviframe_optionheader_arrow.png" COMP; // browser customize + } + script { + public oh_show = 0; //optionheader show/hide + public oh_close = 0; //optionheader close/open + public cbar_bg = 0; //Controlbar BG Show call count + public left_btn_visible = 0; //whether left btn is shown + public icon_visible = 0; //whether icon is shown + public right_btn_visible = 0; //whether right btn is shown + public more_btn_visible = 0; //whether more btn is shown + public large_padded_center_align = 0; //large padding based on button size for center align for 1/2 buttons. + } + parts { + part { name: "base"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + } + description { state: "left" 0.0; + inherit: "default" 0.0; + rel1.relative: -1.0 0.0; + rel2.relative: 0.0 1.0; + } + description { state: "right" 0.0; + inherit: "default" 0.0; + rel1.relative: 1.0 0.0; + rel2.relative: 2.0 1.0; + } + } + part { name: "title_bg"; + type: RECT; + scale: 1; + description { state: "default" 0.0; + min: 1 NAVIFRAME_TITLE_H_INC; + align: 0.0 0.0; + fixed: 0 1; + rel1 { relative: 0.0 0.0; to: "base"; } + rel2 { relative: 1.0 0.0; to: "base"; } + color: NAVIFRAME_TITLE_BG_COLOR_INC; + } + description { state: "hide" 0.0; + inherit: "default" 0.0; + min: 0 0; + max: 0 0; + fixed: 1 1; + } + } + part { name: "title_clip"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + rel1 { to: "title_bg"; } + rel2 { to: "title_bg"; } + } + } + // browser customize, change the visible order of content + part { name: "elm.swallow.content"; + type: SWALLOW; + scale: 1; + repeat_events: 0; + clip_to: "content_clip"; + description { state: "default" 0.0; + align: 0.0 0.0; +// rel1.relative: 0.0 1.0; // default naviframe + rel1.relative: 0.0 0.0; // browser customize + rel1.to_x: "base"; + rel1.to_y: "optionheader_bg"; + rel2.relative: 1.0 0.0; // default naviframe + rel2.to_x: "base"; + rel2.to_y: "controlbar_bg"; // default naviframe + } + } + part { name: "optionheader_bg"; + type: IMAGE; + scale: 1; + description { state: "default" 0.0; + min: 1 0; + align: 0.5 0; + fixed: 0 1; + rel1.to: "title_bg"; + rel1.relative: 0 1; + rel2.to: "title_bg"; + visible: 0; + image { normal: "browser-view-images/naviframe_optionheader.png"; + border: 0 0 4 0; + } + } + description { state: "show" 0.0; + inherit: "default" 0.0; + min: 1 NAVIFRAME_OH_OPENED_H_INC; + visible: 1; + } + description { state: "hide" 0.0; + inherit: "default" 0.0; + min: 0 0; + max: 0 0; + fixed: 1 1; + } + } + part { name: "optionheader_clip"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + rel1 { to: "optionheader_bg"; } + rel2 { to: "optionheader_bg"; } + } + } + part { name: "optionheader_top_padding"; + type: RECT; + scale: 1; + clip_to: "optionheader_clip"; + description { state: "default" 0.0; + min: 1 NAVIFRAME_OH_PADDING_INC; + rel1 { relative: 0.0 0.0; to: "optionheader_bg"; } + rel2 { relative: 1.0 0.0; to: "optionheader_bg"; } + fixed: 0 1; + align: 0.0 0.0; + visible: 0; + } + } + part { name: "optionheader"; + type: SWALLOW; + scale: 1; + clip_to: "optionheader_clip"; + description { state: "default" 0.0; +// min: 1 NAVIFRAME_OH_CONTENT_H_INC; // naviframe default + min: 1 NAVIFRAME_OH_OPENED_H_INC; // browser customize +// rel1 { relative: 0.0 1.0; to: "optionheader_top_padding"; } // naviframe default +// rel2 { relative: 1.0 1.0; to: "optionheader_top_padding"; } // naviframe default + rel1 { relative: 0.0 0.0; to: "optionheader_bg"; } // browser customize + rel2 { relative: 1.0 0.0; to: "optionheader_bg"; } // browser customize + fixed: 0 1; + align: 0.0 0.0; + } + } + part { name: "optionheader_bottom_padding"; + type: RECT; + scale: 1; + clip_to: "optionheader_clip"; + description { state: "default" 0.0; + min: 1 NAVIFRAME_OH_PADDING_INC; + rel1 { relative: 0.0 1.0; to: "optionheader"; } + fixed: 0 1; + align: 0.0 0.0; + visible: 0; + } + } + part { name: "content_clip"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + rel1.to: "elm.swallow.content"; + rel2.to: "elm.swallow.content"; + } + } + part { name: "padding_before_left_btn"; + type: RECT; + mouse_events: 0; + scale: 1; + clip_to: "title_clip"; + description { state: "default" 0.0; + min: NAVIFRAME_TITLE_FUNC_BTN_PADDING_W_INC 0; + fixed: 1 0; + align: 0.0 0.5; + rel1 { relative: 0.0 0.0; to: "title_bg"; } + rel2 { relative: 0.0 1.0; to: "title_bg"; } + visible: 0; + } + } + part { name: "padding_after_left_btn"; + type: RECT; + scale: 1; + clip_to: "title_clip"; + description { state: "default" 0.0; + min: NAVIFRAME_TITLE_FUNC_BTN_PADDING_W_INC 0; + fixed: 1 0; + align: 0 0.5; + rel1 { relative: 1.0 0.0; to: "title_left_btn"; } + rel2 { relative: 1.0 1.0; to: "title_left_btn"; } + visible: 0; + } + } + part { name: "padding_before_more_btn"; + type: RECT; + scale: 1; + clip_to: "title_clip"; + description { state: "default" 0.0; + min: NAVIFRAME_TITLE_FUNC_BTN_PADDING_W_INC 0; + fixed: 1 0; + align: 1.0 0.5; + rel1 { relative: 0.0 0.0; to: "title_more_btn"; } + rel2 { relative: 0.0 1.0; to: "title_more_btn"; } + visible: 0; + } + } + part { name: "padding_after_right_btn"; + type: RECT; + mouse_events: 0; + scale: 1; + clip_to: "title_clip"; + description { state: "default" 0.0; + min: NAVIFRAME_TITLE_FUNC_BTN_PADDING_W_INC 0; + fixed: 1 0; + align: 1.0 0.5; + rel1 { relative: 1.0 0.0; to: "title_bg"; } + rel2 { relative: 1.0 1.0; to: "title_bg"; } + visible: 0; + } + } + part { name: "padding_before_right_btn"; + type: RECT; + mouse_events: 0; + scale: 1; + clip_to: "title_clip"; + description { state: "default" 0.0; + min: 0 0; + fixed: 1 0; + align: 1.0 0.5; + rel1 { relative: 0.0 0.0; to: "title_right_btn"; } + rel2 { relative: 0.0 1.0; to: "title_right_btn"; } + visible: 0; + } + description { state: "right_and_more_button" 0.0; + inherit: "default" 0.0; + min: NAVIFRAME_TITLE_FUNC_BTN_PADDING_W_INC 0; + } + } + part { name: "padding_before_text"; + type: RECT; + scale: 1; + mouse_events: 0; + clip_to: "title_clip"; + description { state: "default" 0.0; + align: 1.0 0.5; + rel1 { relative: 0.0 0.0; to_x: "elm.text.title"; to_y: "title_bg"; } + rel2 { relative: 0.0 1.0; to_x: "elm.text.title"; to_y: "title_bg"; } + fixed: 1 0; + min: NAVIFRAME_ICON_PADDING_INC; + visible: 0; + } + } + part { name: "padding_center_text1"; + type: RECT; + scale: 1; + mouse_events: 0; + clip_to: "title_clip"; + description { state: "default" 0.0; + min: NAVIFRAME_TITLE_FUNC_BTN_PADDING_W_INC 0; + fixed: 1 0; + align: 0.0 0.0; + rel1 { relative: 0.0 0.0; to: "title_bg"; } + rel2 { relative: 0.0 1.0; to: "title_bg"; } + visible: 0; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + min: NAVIFRAME_TEXT_PADDING_INC 0; + } + description { state: "icon" 0.0; + inherit: "default" 0.0; + min: NAVIFRAME_NO_BUTTON_ICON_PADDING_INC 0; + } + description { state: "icon_left_button" 0.0; + inherit: "default" 0.0; + min: NAVIFRAME_TEXT_PADDING_ICON_VISIBLE_INC 0; + } + } + part { name: "padding_center_text2"; + type: RECT; + mouse_events: 0; + scale: 1; + clip_to: "title_clip"; + description { state: "default" 0.0; + min: NAVIFRAME_TITLE_FUNC_BTN_PADDING_W_INC 0; + fixed: 1 0; + align: 1.0 0.5; + rel1 { relative: 1.0 0.0; to: "title_bg"; } + rel2 { relative: 1.0 1.0; to: "title_bg"; } + visible: 0; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + min: NAVIFRAME_TEXT_PADDING_INC 0; + } + } + part { name: "elm.text.title"; + type: TEXT; + scale: 1; + clip_to: "title_clip"; + description { state: "default" 0.0; + text { font: "SLP:style=Medium"; + size: NAVIFRAME_TITLE_FONT_SIZE_INC; + min: 0 0; + max: 1 0; + align: 0.5 0.5; + } + color: NAVIFRAME_TITLE_TEXT_COLOR_INC; + align: 0.5 0.5; + fixed: 1 0; + rel1 { relative: 1.0 0.0; to: "padding_center_text1"; } + rel2 { relative: 0.0 1.0; to: "padding_center_text2"; } + } + description { state: "right_and_more_button" 0.0; + inherit: "default" 0.0; + rel1 { relative: 1.0 0.0; to: "padding_after_left_btn"; } + rel2 { relative: 0.0 1.0; to: "padding_before_more_btn"; } + } + } + part { name: "elm.swallow.icon"; + type: SWALLOW; + scale: 1; + clip_to: "title_clip"; + description { state: "default" 0.0; + max: NAVIFRAME_ICON_SIZE_INC; + fixed: 1 1; + rel1 { relative: 0.0 0.0; to: "padding_before_text"; } + rel2 { relative: 0.0 1.0; to: "padding_before_text"; } + aspect: 1.0 1.0; + aspect_preference: VERTICAL; + align: 1.0 0.5; + } + } + part { name: "click_event_area"; + ignore_flags: ON_HOLD; + repeat_events: 1; + description { state: "default" 0.0; + rel1 { to: "title_bg"; } + rel2 { to: "title_bg"; } + } + } + part { name: "title_left_btn"; + type: SWALLOW; + scale: 1; + clip_to: "title_clip"; + description { state: "default" 0.0; + max: NAVIFRAME_TITLE_FUNC_BTN_SIZE_INC; + fixed: 1 1; + align: 0 0.5; + rel1 { relative: 1.0 0.0; to: "padding_before_left_btn"; } + rel2 { relative: 1.0 1.0; to: "padding_before_left_btn"; } + } + } + part { name: "title_right_btn"; + type: SWALLOW; + scale: 1; + clip_to: "title_clip"; + description { state: "default" 0.0; + max: NAVIFRAME_TITLE_FUNC_BTN_SIZE_INC; + align: 1 0.5; + fixed: 1 1; + rel1 { relative: 0.0 0.0; to: "padding_after_right_btn"; } + rel2 { relative: 0.0 1.0; to: "padding_after_right_btn"; } + } + } + part { name: "title_more_btn"; + type: SWALLOW; + scale: 1; + clip_to: "title_clip"; + description { state: "default" 0.0; + max: NAVIFRAME_TITLE_FUNC_BTN_SIZE_INC; + fixed: 1 1; + align: 1 0.5; + rel1 { relative: 0.0 0.0; to: "padding_before_right_btn"; } + rel2 { relative: 0.0 1.0; to: "padding_before_right_btn"; } + } + } + part { name: "optionheader_arrow"; + type: IMAGE; + scale: 1; + description { state: "default" 0.0; + min: NAVIFRAME_OH_ARROW_SIZE_INC; + max: NAVIFRAME_OH_ARROW_SIZE_INC; + fixed: 1 1; +// align: 0.5 0; // naviframe default + align: 0.5 1.0; // browser customize +// rel1.to: "title_more_btn"; // naviframe default + rel1.to: "title_bg"; // browser customize + rel1.relative: 0 1; +// rel2.to: "title_more_btn"; // naviframe default + rel2.to: "title_bg"; // browser customize + rel2.relative: 1 1; + image { + normal: "browser-view-images/naviframe_optionheader_arrow.png"; + } + visible: 0; // naviframe default +// visible: 1; // browser customize + } + description { state: "show" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part { name: "controlbar_bg"; + type: RECT; + scale: 1; + description { state: "default" 0.0; + min: 0 0; + max: 999999 0; + fixed: 0 1; + align: 0.0 1.0; + visible: 0; + rel1 { to: "base"; } + rel2 { to: "base"; } + color: NAVIFRAME_CONTROLBAR_BG_COLOR_INC; + } + description { state: "show" 0.0; + inherit: "default" 0.0; + min: 0 CONTROLBAR_SMALL_HEIGHT_INC; + max: 999999 CONTROLBAR_SMALL_HEIGHT_INC; + visible: 1; + } + } + part { name: "controlbar_clip"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + rel1.to: "controlbar_bg"; + rel2.to: "controlbar_bg"; + } + } + part { name: "elm.prev_btn_bg"; + type: RECT; + scale: 1; + clip_to: "controlbar_clip"; + description { state: "default" 0.0; + min: 0 0; + fixed: 1 0; + align: 1.0 0.0; + rel1 { relative: 1.0 0.0; to: "controlbar_bg"; } + rel2.to: "controlbar_bg"; + visible: 0; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + min: NAVIFRAME_TITLE_PREV_BTN_BG_SIZE_INC 0; + } + } + part { name: "elm.swallow.prev_btn"; + type: SWALLOW; + scale: 1; + clip_to: "controlbar_clip"; + description { state: "default" 0.0; + fixed: 1 1; + align: 0.5 0.5; + rel1.to: "elm.prev_btn_bg"; + rel2.to: "elm.prev_btn_bg"; + } + } + part { name: "controlbar"; + type: SWALLOW; + scale: 1; + clip_to: "controlbar_clip"; + description { state: "default" 0.0; + fixed: 1 1; + rel1.to: "controlbar_bg"; + rel2 { relative: 0.0 1.0; to: "elm.prev_btn_bg"; } + } + } + } + programs { + program { name: "content_new_pushed"; + signal: "elm,state,new,pushed,internal"; + source: ""; + action: STATE_SET "default" 0.0; + target: "base"; + transition: DECELERATE NAVIFRAME_VIEW_TRANS_TIME; + after: "show_finished"; + } + program { name: "content_cur_pushed"; + signal: "elm,state,cur,pushed,internal"; + source: ""; + action: STATE_SET "left" 0.0; + target: "base"; + transition: DECELERATE NAVIFRAME_VIEW_TRANS_TIME; + after: "pushed_finished"; + } + program { name: "content_prev_popped"; + signal: "elm,state,prev,popped,internal"; + source: ""; + action: STATE_SET "default" 0.0; + target: "base"; + transition: DECELERATE NAVIFRAME_VIEW_TRANS_TIME; + after: "show_finished"; + } + program { name: "content_cur_popped"; + signal: "elm,state,cur,popped,internal"; + source: ""; + action: STATE_SET "right" 0.0; + target: "base"; + transition: DECELERATE NAVIFRAME_VIEW_TRANS_TIME; + after: "popped_finished"; + } + program { name: "cur_pushed"; + signal: "elm,state,cur,pushed"; + source: "elm"; + script { + set_state(PART:"base", "default", 0.0); + emit("elm,state,cur,pushed,internal", ""); + } + } + program { name: "new_pushed"; + signal: "elm,state,new,pushed"; + source: "elm"; + script { + set_state(PART:"base", "right", 0.0); + emit("elm,state,new,pushed,internal", ""); + } + } + program { name: "prev_popped"; + signal: "elm,state,prev,popped"; + source: "elm"; + script { + set_state(PART:"base", "left", 0.0); + emit("elm,state,prev,popped,internal", ""); + } + } + program { name: "cur_popped"; + signal: "elm,state,cur,popped"; + source: "elm"; + script { + set_state(PART:"base", "default", 0.0); + emit("elm,state,cur,popped,internal", ""); + } + } + program { name: "visible"; + signal: "elm,state,visible"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "base"; + } + program { name: "title_show"; + signal: "elm,state,title,show"; + source: "elm"; + script { + set_state(PART:"title_bg", "default", 0.0); + if (get_int(oh_show) == 1) { + if (get_int(oh_close) == 1) { + emit("elm,state,optionheader,instant_close", ""); + }else { + emit("elm,state,optionheader,instant_open", ""); + } + } + else + set_state(PART:"optionheader_bg", "default", 0.0); + } + } + program { name: "title_hide"; + signal: "elm,state,title,hide"; + source: "elm"; + action: STATE_SET "hide" 0.0; + target: "title_bg"; + target: "optionheader_bg"; + } + program { name: "prev_btn_show"; + signal: "elm,state,prev_btn,show"; + source: "elm"; + script { + emit("elm,state,controlbar_bg,show", "elm"); + set_state(PART:"elm.prev_btn_bg", "visible", 0.0); + } + } + program { name: "prev_btn_hide"; + signal: "elm,state,prev_btn,hide"; + source: "elm"; + script { + emit("elm,state,controlbar_bg,hide", "elm"); + set_state(PART:"elm.prev_btn_bg", "default", 0.0); + } + } + program { name: "left_btn_show"; + signal: "elm,state,title_left_btn,show"; + source: "elm"; + script { + set_int(left_btn_visible, 1); + if (get_int(icon_visible) == 1) + set_state(PART:"padding_center_text1", "icon_left_button", 0.0); + else + set_state(PART:"padding_center_text1", "visible", 0.0); + if ((get_int(more_btn_visible) == 1) && (get_int(right_btn_visible) == 1)) { + set_state(PART:"elm.text.title", "right_and_more_button", 0.0); + set_int(large_padded_center_align, 0); + } + else { + set_state(PART:"padding_center_text2", "visible", 0.0); + set_int(large_padded_center_align, 1); + } + } + } + program { name: "left_btn_hide"; + signal: "elm,state,title_left_btn,hide"; + source: "elm"; + script { + set_int(left_btn_visible, 0); + if ((get_int(more_btn_visible) == 0) && (get_int(right_btn_visible) == 0)) { + set_state(PART:"padding_center_text2", "default", 0.0); + set_int(large_padded_center_align, 0); + } + else { + set_state(PART:"padding_center_text2", "visible", 0.0); + set_int(large_padded_center_align, 1); + } + if ((get_int(large_padded_center_align) == 1) && (get_int(icon_visible) == 1)) + set_state(PART:"padding_center_text1", "icon_left_button", 0.0); + else if (get_int(large_padded_center_align) == 1) + set_state(PART:"padding_center_text1", "visible", 0.0); + else if (get_int(icon_visible) == 1) + set_state(PART:"padding_center_text1", "icon", 0.0); + else + set_state(PART:"padding_center_text1", "default", 0.0); + } + } + program { name: "right_btn_show"; + signal: "elm,state,title_right_btn,show"; + source: "elm"; + script { + set_int(right_btn_visible, 1); + if (get_int(more_btn_visible) == 1) { + set_state(PART:"elm.text.title", "right_and_more_button", 0.0); + set_state(PART:"padding_before_right_btn", "right_and_more_button", 0.0); + set_int(large_padded_center_align, 0); + } + else { + set_state(PART:"padding_center_text2", "visible", 0.0); + set_int(large_padded_center_align, 1); + } + if ((get_int(icon_visible) == 1) && ((get_int(left_btn_visible) == 1) || + (get_int(large_padded_center_align) == 1))) + set_state(PART:"padding_center_text1", "icon_left_button", 0.0); + else if ((get_int(left_btn_visible) == 1) || (get_int(large_padded_center_align) == 1)) + set_state(PART:"padding_center_text1", "visible", 0.0); + else if (get_int(icon_visible) == 1) + set_state(PART:"padding_center_text1", "icon", 0.0); + else + set_state(PART:"padding_center_text1", "default", 0.0); + } + } + program { name: "right_btn_hide"; + signal: "elm,state,title_right_btn,hide"; + source: "elm"; + script { + set_int(right_btn_visible, 0); + set_state(PART:"padding_before_right_btn", "default", 0.0); + if ((get_int(more_btn_visible) == 0) && (get_int(left_btn_visible) == 0)) { + set_state(PART:"padding_center_text2", "default", 0.0); + set_int(large_padded_center_align, 0); + } + else { + set_state(PART:"padding_center_text2", "visible", 0.0); + set_int(large_padded_center_align, 1); + } + if ((get_int(large_padded_center_align) == 1) && (get_int(icon_visible) == 1)) + set_state(PART:"padding_center_text1", "icon_left_button", 0.0); + else if (get_int(large_padded_center_align) == 1) + set_state(PART:"padding_center_text1", "visible", 0.0); + else if (get_int(icon_visible) == 1) + set_state(PART:"padding_center_text1", "icon", 0.0); + else + set_state(PART:"padding_center_text1", "default", 0.0); + } + } + program { name: "more_btn_show"; + signal: "elm,state,title_more_btn,show"; + source: "elm"; + script { + set_int(more_btn_visible, 1); + if (get_int(right_btn_visible) == 1) { + set_state(PART:"elm.text.title", "right_and_more_button", 0.0); + set_state(PART:"padding_before_right_btn", "right_and_more_button", 0.0); + set_int(large_padded_center_align, 0); + } + else { + set_state(PART:"padding_center_text2", "visible", 0.0); + set_int(large_padded_center_align, 1); + } + if ((get_int(icon_visible) == 1) && ((get_int(left_btn_visible) == 1) || + (get_int(large_padded_center_align) == 1))) + set_state(PART:"padding_center_text1", "icon_left_button", 0.0); + else if ((get_int(left_btn_visible) == 1) || (get_int(large_padded_center_align) == 1)) + set_state(PART:"padding_center_text1", "visible", 0.0); + else if (get_int(icon_visible) == 1) + set_state(PART:"padding_center_text1", "icon", 0.0); + else + set_state(PART:"padding_center_text1", "default", 0.0); + } + } + program { name: "more_btn_hide"; + signal: "elm,state,title_more_btn,hide"; + source: "elm"; + script { + set_int(more_btn_visible, 0); + set_state(PART:"padding_before_right_btn", "default", 0.0); + if ((get_int(right_btn_visible) == 0) && (get_int(left_btn_visible) == 0)) { + set_state(PART:"padding_center_text2", "default", 0.0); + set_int(large_padded_center_align, 0); + } + else { + set_state(PART:"padding_center_text2", "visible", 0.0); + set_int(large_padded_center_align, 1); + } + if ((get_int(large_padded_center_align) == 1) && (get_int(icon_visible) == 1)) + set_state(PART:"padding_center_text1", "icon_left_button", 0.0); + else if (get_int(large_padded_center_align) == 1) + set_state(PART:"padding_center_text1", "visible", 0.0); + else if (get_int(icon_visible) == 1) + set_state(PART:"padding_center_text1", "icon", 0.0); + else + set_state(PART:"padding_center_text1", "default", 0.0); + } + } + program { name: "icon_show"; + signal: "elm,state,elm.swallow.icon,show"; + source: "elm"; + script { + set_int(icon_visible, 1); + if ((get_int(large_padded_center_align) == 1) || (get_int(left_btn_visible) == 1)) + set_state(PART:"padding_center_text1", "icon_left_button", 0.0); + else + set_state(PART:"padding_center_text1", "icon", 0.0); + } + } + program { name: "icon_hide"; + signal: "elm,state,elm.swallow.icon,hide"; + source: "elm"; + script { + set_int(icon_visible, 0); + if ((get_int(large_padded_center_align) == 1) || (get_int(left_btn_visible) == 1)) + set_state(PART:"padding_center_text1", "visible", 0.0); + else + set_state(PART:"padding_center_text1", "default", 0.0); + } + } + program { name: "controlbar_show"; + signal: "elm,state,controlbar,show"; + source: "elm"; + script { + emit("elm,state,controlbar_bg,show", "elm"); + } + } + program { name: "controlbar_hide"; + signal: "elm,state,controlbar,hide"; + source: "elm"; + script { + emit("elm,state,controlbar_bg,hide", "elm"); + } + } + program { name: "controlbar_bg_show"; + signal: "elm,state,controlbar_bg,show"; + source: "elm"; + script { + set_state(PART:"controlbar_bg", "show", 0.0); + set_int(cbar_bg, get_int(cbar_bg) + 1); + } + } + program { name: "controlbar_bg_hide"; + signal: "elm,state,controlbar_bg,hide"; + source: "elm"; + script { + set_int(cbar_bg, get_int(cbar_bg) - 1); + if (get_int(cbar_bg) <= 0) + set_state(PART:"controlbar_bg", "default", 0.0); + } + } + program { name: "optionheader_show"; + signal: "elm,state,optionheader,show"; + source: "elm"; + script { + set_state(PART:"optionheader_bg", "show", 0.0); + set_state(PART:"optionheader_arrow", "show", 0.0); + set_int(oh_show, 1); + } + } + program { name: "optionheader_hide"; + signal: "elm,state,optionheader,hide"; + source: "elm"; + script { + set_state(PART:"optionheader_bg", "default", 0.0); + set_state(PART:"optionheader_arrow", "default", 0.0); + set_int(oh_show, 0); + } + } + program { name: "optionheader_open"; + signal: "elm,state,optionheader,open"; + source: ""; + action: STATE_SET "show" 0.0; + target: "optionheader_bg"; + target: "optionheader_arrow"; + transition: LINEAR 0.2; + after: "optionheader_open_set"; + } + program { name: "optionheader_close"; + signal: "elm,state,optionheader,close"; + source: ""; + action: STATE_SET "default" 0.0; + target: "optionheader_bg"; + target: "optionheader_arrow"; + transition: LINEAR 0.2; + after: "optionheader_close_set"; + } + program { name: "optionheader_instant_open"; + signal: "elm,state,optionheader,instant_open"; + source: ""; + action: STATE_SET "show" 0.0; + target: "optionheader_bg"; + target: "optionheader_arrow"; + after: "optionheader_open_set"; + } + program { name: "optionheader_instant_close"; + signal: "elm,state,optionheader,instant_close"; + source: ""; + action: STATE_SET "default" 0.0; + target: "optionheader_bg"; + target: "optionheader_arrow"; + after: "optionheader_close_set"; + } + program { name: "optionheader_close_set"; + signal: "elm,state,optionheader,close_set"; + source: ""; + script { + set_int(oh_close, 1); + } + } + program { name: "optionheader_open_set"; + signal: "elm,state,optionheader,open_set"; + source: ""; + script { + set_int(oh_close, 0); + } + } + program { name: "controlbar_open"; + signal: "elm,state,controlbar,open"; + source: ""; + action: STATE_SET "show" 0.0; + target: "controlbar_bg"; + transition: LINEAR 0.2; + } + program { name: "controlbar_close"; + signal: "elm,state,controlbar,close"; + source: ""; + action: STATE_SET "default" 0.0; + target: "controlbar_bg"; + transition: LINEAR 0.2; + } + program { name: "controlbar_instant_open"; + signal: "elm,state,controlbar,instant_open"; + source: ""; + script { + emit("elm,state,prev_btn,show", "elm"); + emit("elm,state,controlbar,show", "elm"); + } + } + program { name: "controlbar_instant_close"; + signal: "elm,state,controlbar,instant_close"; + source: ""; + script { + emit("elm,state,prev_btn,hide", "elm"); + emit("elm,state,controlbar,hide", "elm"); + } + } + program { name: "show_finished"; + action: SIGNAL_EMIT "elm,action,show,finished" ""; + } + program { name: "pushed_finished"; + action: SIGNAL_EMIT "elm,action,pushed,finished" ""; + } + program { name: "popped_finished"; + action: SIGNAL_EMIT "elm,action,popped,finished" ""; + } + program { + name: "title_clicked"; + signal: "mouse,clicked,1"; + source: "click_event_area"; + action: SIGNAL_EMIT "elm,action,title,clicked" ""; + } + } + } + + group { name:"elm/naviframe/item/browser_titlebar/default"; + alias:"elm/naviframe/item/1line/browser_titlebar"; + images { + image: "browser-view-images/naviframe_optionheader.png" COMP; // browser customize + image: "browser-view-images/naviframe_optionheader_arrow.png" COMP; // browser customize + } + script { + public oh_show = 0; //optionheader show/hide + public oh_close = 0; //optionheader close/open + public cbar_bg = 0; //Controlbar BG Show call count + public left_btn_visible = 0; //whether left btn is shown + public icon_visible = 0; //whether icon is shown + public right_btn_visible = 0; //whether right btn is shown + public more_btn_visible = 0; //whether more btn is shown + public large_padded_center_align = 0; //large padding based on button size for center align for 1/2 buttons. + } + parts { + part { name: "base"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + } + description { state: "left" 0.0; + inherit: "default" 0.0; + rel1.relative: -1.0 0.0; + rel2.relative: 0.0 1.0; + } + description { state: "right" 0.0; + inherit: "default" 0.0; + rel1.relative: 1.0 0.0; + rel2.relative: 2.0 1.0; + } + } + part { name: "title_bg"; + type: RECT; + scale: 1; + description { state: "default" 0.0; + min: 1 100; + align: 0.0 0.0; + fixed: 0 1; + rel1 { relative: 0.0 0.0; to: "base"; } + rel2 { relative: 1.0 0.0; to: "base"; } + color: NAVIFRAME_TITLE_BG_COLOR_INC; + } + description { state: "hide" 0.0; + inherit: "default" 0.0; + min: 0 0; + max: 0 0; + fixed: 1 1; + } + } + part { name: "title_clip"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + rel1 { to: "title_bg"; } + rel2 { to: "title_bg"; } + } + } + // browser customize, change the visible order of content + part { name: "elm.swallow.content"; + type: SWALLOW; + scale: 1; + repeat_events: 0; + clip_to: "content_clip"; + description { state: "default" 0.0; + align: 0.0 0.0; +// rel1.relative: 0.0 1.0; // default naviframe + rel1.relative: 0.0 0.0; // browser customize + rel1.to_x: "base"; + rel1.to_y: "optionheader_bg"; + rel2.relative: 1.0 0.0; // default naviframe + rel2.to_x: "base"; + rel2.to_y: "controlbar_bg"; // default naviframe + } + } + part { name: "optionheader_bg"; + type: IMAGE; + scale: 1; + description { state: "default" 0.0; + min: 1 0; + align: 0.5 0; + fixed: 0 1; + rel1.to: "title_bg"; + rel1.relative: 0 1; + rel2.to: "title_bg"; + visible: 0; + image { normal: "browser-view-images/naviframe_optionheader.png"; + border: 0 0 4 0; + } + } + description { state: "show" 0.0; + inherit: "default" 0.0; + min: 1 NAVIFRAME_OH_OPENED_H_INC; + visible: 1; + } + description { state: "hide" 0.0; + inherit: "default" 0.0; + min: 0 0; + max: 0 0; + fixed: 1 1; + } + } + part { name: "optionheader_clip"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + rel1 { to: "optionheader_bg"; } + rel2 { to: "optionheader_bg"; } + } + } + part { name: "optionheader_top_padding"; + type: RECT; + scale: 1; + clip_to: "optionheader_clip"; + description { state: "default" 0.0; + min: 1 NAVIFRAME_OH_PADDING_INC; + rel1 { relative: 0.0 0.0; to: "optionheader_bg"; } + rel2 { relative: 1.0 0.0; to: "optionheader_bg"; } + fixed: 0 1; + align: 0.0 0.0; + visible: 0; + } + } + part { name: "optionheader"; + type: SWALLOW; + scale: 1; + clip_to: "optionheader_clip"; + description { state: "default" 0.0; +// min: 1 NAVIFRAME_OH_CONTENT_H_INC; // naviframe default + min: 1 NAVIFRAME_OH_OPENED_H_INC; // browser customize +// rel1 { relative: 0.0 1.0; to: "optionheader_top_padding"; } // naviframe default +// rel2 { relative: 1.0 1.0; to: "optionheader_top_padding"; } // naviframe default + rel1 { relative: 0.0 0.0; to: "optionheader_bg"; } // browser customize + rel2 { relative: 1.0 0.0; to: "optionheader_bg"; } // browser customize + fixed: 0 1; + align: 0.0 0.0; + } + } + part { name: "optionheader.mid.padding"; + type: RECT; + scale: 1; + clip_to: "optionheader_clip"; + description { state: "default" 0.0; + min: 0 NAVIFRAME_OH_PADDING_INC; + rel1 { relative: 0.0 1.0; to: "optionheader"; } + rel2 { relative: 1.0 1.0; to: "optionheader"; } + fixed: 0 1; + align: 0.0 0.0; + visible: 0; + } + } + part { name: "optionheader2"; + type: SWALLOW; + scale: 1; + clip_to: "optionheader_clip"; + description { state: "default" 0.0; + min: 0 NAVIFRAME_OH_CONTENT_H_INC; + rel1 { relative: 0.0 1.0; to: "optionheader.mid.padding";} + rel2 { relative: 1.0 1.0; to: "optionheader.mid.padding";} + fixed: 0 1; + align: 0.0 0.0; + } + } + part { name: "optionheader.bottom.padding"; + type: RECT; + scale: 1; + clip_to: "optionheader_clip"; + description { state: "default" 0.0; + min: 0 NAVIFRAME_OH_PADDING_INC; + rel1 { relative: 0.0 1.0; to: "optionheader2"; } + rel2 { relative: 1.0 1.0; to: "optionheader2"; } + fixed: 0 1; + align: 0.0 0.0; + visible: 0; + } + } + part { name: "content_clip"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + rel1.to: "elm.swallow.content"; + rel2.to: "elm.swallow.content"; + } + } + part { name: "padding_before_left_btn"; + type: RECT; + mouse_events: 0; + scale: 1; + clip_to: "title_clip"; + description { state: "default" 0.0; + min: NAVIFRAME_TITLE_FUNC_BTN_PADDING_W_INC 0; + fixed: 1 0; + align: 0.0 0.5; + rel1 { relative: 0.0 0.0; to: "title_bg"; } + rel2 { relative: 0.0 1.0; to: "title_bg"; } + visible: 0; + } + } + part { name: "padding_after_left_btn"; + type: RECT; + scale: 1; + clip_to: "title_clip"; + description { state: "default" 0.0; + min: NAVIFRAME_TITLE_FUNC_BTN_PADDING_W_INC 0; + fixed: 1 0; + align: 0 0.5; + rel1 { relative: 1.0 0.0; to: "title_left_btn"; } + rel2 { relative: 1.0 1.0; to: "title_left_btn"; } + visible: 0; + } + } + part { name: "padding_before_more_btn"; + type: RECT; + scale: 1; + clip_to: "title_clip"; + description { state: "default" 0.0; + min: NAVIFRAME_TITLE_FUNC_BTN_PADDING_W_INC 0; + fixed: 1 0; + align: 1.0 0.5; + rel1 { relative: 0.0 0.0; to: "title_more_btn"; } + rel2 { relative: 0.0 1.0; to: "title_more_btn"; } + visible: 0; + } + } + part { name: "padding_after_right_btn"; + type: RECT; + mouse_events: 0; + scale: 1; + clip_to: "title_clip"; + description { state: "default" 0.0; + min: NAVIFRAME_TITLE_FUNC_BTN_PADDING_W_INC 0; + fixed: 1 0; + align: 1.0 0.5; + rel1 { relative: 1.0 0.0; to: "title_bg"; } + rel2 { relative: 1.0 1.0; to: "title_bg"; } + visible: 0; + } + } + part { name: "padding_before_right_btn"; + type: RECT; + mouse_events: 0; + scale: 1; + clip_to: "title_clip"; + description { state: "default" 0.0; + min: 0 0; + fixed: 1 0; + align: 1.0 0.5; + rel1 { relative: 0.0 0.0; to: "title_right_btn"; } + rel2 { relative: 0.0 1.0; to: "title_right_btn"; } + visible: 0; + } + description { state: "right_and_more_button" 0.0; + inherit: "default" 0.0; + min: NAVIFRAME_TITLE_FUNC_BTN_PADDING_W_INC 0; + } + } + part { name: "padding_before_text"; + type: RECT; + scale: 1; + mouse_events: 0; + clip_to: "title_clip"; + description { state: "default" 0.0; + align: 1.0 0.5; + rel1 { relative: 0.0 0.0; to_x: "elm.text.title"; to_y: "title_bg"; } + rel2 { relative: 0.0 1.0; to_x: "elm.text.title"; to_y: "title_bg"; } + fixed: 1 0; + min: NAVIFRAME_ICON_PADDING_INC; + visible: 0; + } + } + part { name: "padding_center_text1"; + type: RECT; + scale: 1; + mouse_events: 0; + clip_to: "title_clip"; + description { state: "default" 0.0; + min: NAVIFRAME_TITLE_FUNC_BTN_PADDING_W_INC 0; + fixed: 1 0; + align: 0.0 0.0; + rel1 { relative: 0.0 0.0; to: "title_bg"; } + rel2 { relative: 0.0 1.0; to: "title_bg"; } + visible: 0; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + min: NAVIFRAME_TEXT_PADDING_INC 0; + } + description { state: "icon" 0.0; + inherit: "default" 0.0; + min: NAVIFRAME_NO_BUTTON_ICON_PADDING_INC 0; + } + description { state: "icon_left_button" 0.0; + inherit: "default" 0.0; + min: NAVIFRAME_TEXT_PADDING_ICON_VISIBLE_INC 0; + } + } + part { name: "padding_center_text2"; + type: RECT; + mouse_events: 0; + scale: 1; + clip_to: "title_clip"; + description { state: "default" 0.0; + min: NAVIFRAME_TITLE_FUNC_BTN_PADDING_W_INC 0; + fixed: 1 0; + align: 1.0 0.5; + rel1 { relative: 1.0 0.0; to: "title_bg"; } + rel2 { relative: 1.0 1.0; to: "title_bg"; } + visible: 0; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + min: NAVIFRAME_TEXT_PADDING_INC 0; + } + } + part { name: "elm.text.title"; + type: TEXT; + scale: 1; + clip_to: "title_clip"; + description { state: "default" 0.0; + text { font: "SLP:style=Medium"; + size: NAVIFRAME_TITLE_FONT_SIZE_INC; + min: 0 0; + max: 1 0; + align: 0.5 0.5; + } + color: NAVIFRAME_TITLE_TEXT_COLOR_INC; + align: 0.5 0.5; + fixed: 1 0; + rel1 { relative: 1.0 0.0; to: "padding_center_text1"; } + rel2 { relative: 0.0 1.0; to: "padding_center_text2"; } + } + description { state: "right_and_more_button" 0.0; + inherit: "default" 0.0; + rel1 { relative: 1.0 0.0; to: "padding_after_left_btn"; } + rel2 { relative: 0.0 1.0; to: "padding_before_more_btn"; } + } + } + part { name: "elm.swallow.icon"; + type: SWALLOW; + scale: 1; + clip_to: "title_clip"; + description { state: "default" 0.0; + max: NAVIFRAME_ICON_SIZE_INC; + fixed: 1 1; + rel1 { relative: 0.0 0.0; to: "padding_before_text"; } + rel2 { relative: 0.0 1.0; to: "padding_before_text"; } + aspect: 1.0 1.0; + aspect_preference: VERTICAL; + align: 1.0 0.5; + } + } + part { name: "click_event_area"; + ignore_flags: ON_HOLD; + repeat_events: 1; + description { state: "default" 0.0; + rel1 { to: "title_bg"; } + rel2 { to: "title_bg"; } + } + } + part { name: "title_left_btn"; + type: SWALLOW; + scale: 1; + clip_to: "title_clip"; + description { state: "default" 0.0; + min: NAVIFRAME_TITLE_FUNC_BTN_SIZE_INC; + max: NAVIFRAME_TITLE_FUNC_BTN_SIZE_INC; + fixed: 1 1; + align: 0 0.5; + rel1 { relative: 1.0 0.0; to: "padding_before_left_btn"; } + rel2 { relative: 1.0 1.0; to: "padding_before_left_btn"; } + } + } + part { name: "title_right_btn"; + type: SWALLOW; + scale: 1; + clip_to: "title_clip"; + description { state: "default" 0.0; + min: NAVIFRAME_TITLE_FUNC_BTN_SIZE_INC; + max: NAVIFRAME_TITLE_FUNC_BTN_SIZE_INC; + align: 1 0.5; + fixed: 1 1; + rel1 { relative: 0.0 0.0; to: "padding_after_right_btn"; } + rel2 { relative: 0.0 1.0; to: "padding_after_right_btn"; } + } + } + part { name: "title_more_btn"; + type: SWALLOW; + scale: 1; + clip_to: "title_clip"; + description { state: "default" 0.0; + max: NAVIFRAME_TITLE_FUNC_BTN_SIZE_INC; + fixed: 1 0; + align: 1 0.5; + rel1 { relative: 0.0 0.0; to: "padding_before_right_btn"; } + rel2 { relative: 0.0 1.0; to: "padding_before_right_btn"; } + } + } + part { name: "optionheader_arrow"; + type: IMAGE; + scale: 1; + description { state: "default" 0.0; + min: NAVIFRAME_OH_ARROW_SIZE_INC; + max: NAVIFRAME_OH_ARROW_SIZE_INC; + fixed: 1 1; +// align: 0.5 0; // naviframe default + align: 0.5 1.0; // browser customize +// rel1.to: "elm.swallow.more_btn"; // naviframe default + rel1.to: "title_bg"; // browser customize + rel1.relative: 0 1; +// rel2.to: "elm.swallow.more_btn"; // naviframe default + rel2.to: "title_bg"; // browser customize + rel2.relative: 1 1; + image { + normal: "browser-view-images/naviframe_optionheader_arrow.png"; + } + visible: 0; // naviframe default +// visible: 1; // browser customize + } + description { state: "show" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part { name: "controlbar_bg"; + type: RECT; + scale: 1; + description { state: "default" 0.0; + min: 0 0; + max: 999999 0; + fixed: 0 1; + align: 0.0 1.0; + visible: 0; + rel1 { to: "base"; } + rel2 { to: "base"; } + color: NAVIFRAME_CONTROLBAR_BG_COLOR_INC; + } + description { state: "show" 0.0; + inherit: "default" 0.0; + min: 0 CONTROLBAR_SMALL_HEIGHT_INC; + max: 999999 CONTROLBAR_SMALL_HEIGHT_INC; + visible: 1; + } + } + part { name: "controlbar_clip"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + rel1 { to: "controlbar_bg"; } + rel2 { to: "controlbar_bg"; } + } + } + part { name: "elm.prev_btn_bg"; + type: RECT; + scale: 1; + clip_to: "controlbar_clip"; + description { state: "default" 0.0; + min: 0 0; + fixed: 1 0; + align: 1.0 0.0; + rel1 { relative: 1.0 0.0; to: "controlbar_bg"; } + rel2.to: "controlbar_bg"; + visible: 0; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + min: NAVIFRAME_TITLE_PREV_BTN_BG_SIZE_INC 0; + } + } + part { name: "elm.swallow.prev_btn"; + type: SWALLOW; + scale: 1; + clip_to: "controlbar_clip"; + description { state: "default" 0.0; + fixed: 1 1; + align: 0.5 0.5; + rel1.to: "elm.prev_btn_bg"; + rel2.to: "elm.prev_btn_bg"; + } + } + part { name: "controlbar"; + type: SWALLOW; + scale: 1; + clip_to: "controlbar_clip"; + description { state: "default" 0.0; + rel1.to: "controlbar_bg"; + rel2 { relative: 0.0 1.0; to: "elm.prev_btn_bg"; } + } + } + } + programs { + program { name: "content_new_pushed"; + signal: "elm,state,new,pushed,internal"; + source: ""; + action: STATE_SET "default" 0.0; + target: "base"; + transition: DECELERATE NAVIFRAME_VIEW_TRANS_TIME; + after: "show_finished"; + } + program { name: "content_cur_pushed"; + signal: "elm,state,cur,pushed,internal"; + source: ""; + action: STATE_SET "left" 0.0; + target: "base"; + transition: DECELERATE NAVIFRAME_VIEW_TRANS_TIME; + after: "pushed_finished"; + } + program { name: "content_prev_popped"; + signal: "elm,state,prev,popped,internal"; + source: ""; + action: STATE_SET "default" 0.0; + target: "base"; + transition: DECELERATE NAVIFRAME_VIEW_TRANS_TIME; + after: "show_finished"; + } + program { name: "content_cur_popped"; + signal: "elm,state,cur,popped,internal"; + source: ""; + action: STATE_SET "right" 0.0; + target: "base"; + transition: DECELERATE NAVIFRAME_VIEW_TRANS_TIME; + after: "popped_finished"; + } + program { name: "cur_pushed"; + signal: "elm,state,cur,pushed"; + source: "elm"; + script { + set_state(PART:"base", "default", 0.0); + emit("elm,state,cur,pushed,internal", ""); + } + } + program { name: "new_pushed"; + signal: "elm,state,new,pushed"; + source: "elm"; + script { + set_state(PART:"base", "right", 0.0); + emit("elm,state,new,pushed,internal", ""); + } + } + program { name: "prev_popped"; + signal: "elm,state,prev,popped"; + source: "elm"; + script { + set_state(PART:"base", "left", 0.0); + emit("elm,state,prev,popped,internal", ""); + } + } + program { name: "cur_popped"; + signal: "elm,state,cur,popped"; + source: "elm"; + script { + set_state(PART:"base", "default", 0.0); + emit("elm,state,cur,popped,internal", ""); + } + } + program { name: "visible"; + signal: "elm,state,visible"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "base"; + } + program { name: "title_show"; + signal: "elm,state,title,show"; + source: "elm"; + script { + set_state(PART:"title_bg", "default", 0.0); + if (get_int(oh_show) == 1) { + if (get_int(oh_close) == 1) { + emit("elm,state,optionheader,instant_close", ""); + }else { + emit("elm,state,optionheader,instant_open", ""); + } + } + else + set_state(PART:"optionheader_bg", "default", 0.0); + } + } + program { name: "title_hide"; + signal: "elm,state,title,hide"; + source: "elm"; + action: STATE_SET "hide" 0.0; + target: "title_bg"; + target: "optionheader_bg"; + } + program { name: "prev_btn_show"; + signal: "elm,state,prev_btn,show"; + source: "elm"; + script { + emit("elm,state,controlbar_bg,show", "elm"); + set_state(PART:"elm.prev_btn_bg", "visible", 0.0); + } + } + program { name: "prev_btn_hide"; + signal: "elm,state,prev_btn,hide"; + source: "elm"; + script { + emit("elm,state,controlbar_bg,hide", "elm"); + set_state(PART:"elm.prev_btn_bg", "default", 0.0); + } + } + program { name: "left_btn_show"; + signal: "elm,state,title_left_btn,show"; + source: "elm"; + script { + set_int(left_btn_visible, 1); + if (get_int(icon_visible) == 1) + set_state(PART:"padding_center_text1", "icon_left_button", 0.0); + else + set_state(PART:"padding_center_text1", "visible", 0.0); + if ((get_int(more_btn_visible) == 1) && (get_int(right_btn_visible) == 1)) { + set_state(PART:"elm.text.title", "right_and_more_button", 0.0); + set_int(large_padded_center_align, 0); + } + else { + set_state(PART:"padding_center_text2", "visible", 0.0); + set_int(large_padded_center_align, 1); + } + } + } + program { name: "left_btn_hide"; + signal: "elm,state,title_left_btn,hide"; + source: "elm"; + script { + set_int(left_btn_visible, 0); + if ((get_int(more_btn_visible) == 0) && (get_int(right_btn_visible) == 0)) { + set_state(PART:"padding_center_text2", "default", 0.0); + set_int(large_padded_center_align, 0); + } + else { + set_state(PART:"padding_center_text2", "visible", 0.0); + set_int(large_padded_center_align, 1); + } + if ((get_int(large_padded_center_align) == 1) && (get_int(icon_visible) == 1)) + set_state(PART:"padding_center_text1", "icon_left_button", 0.0); + else if (get_int(large_padded_center_align) == 1) + set_state(PART:"padding_center_text1", "visible", 0.0); + else if (get_int(icon_visible) == 1) + set_state(PART:"padding_center_text1", "icon", 0.0); + else + set_state(PART:"padding_center_text1", "default", 0.0); + } + } + program { name: "right_btn_show"; + signal: "elm,state,title_right_btn,show"; + source: "elm"; + script { + set_int(right_btn_visible, 1); + if (get_int(more_btn_visible) == 1) { + set_state(PART:"elm.text.title", "right_and_more_button", 0.0); + set_state(PART:"padding_before_right_btn", "right_and_more_button", 0.0); + set_int(large_padded_center_align, 0); + } + else { + set_state(PART:"padding_center_text2", "visible", 0.0); + set_int(large_padded_center_align, 1); + } + if ((get_int(icon_visible) == 1) && ((get_int(left_btn_visible) == 1) || + (get_int(large_padded_center_align) == 1))) + set_state(PART:"padding_center_text1", "icon_left_button", 0.0); + else if ((get_int(left_btn_visible) == 1) || (get_int(large_padded_center_align) == 1)) + set_state(PART:"padding_center_text1", "visible", 0.0); + else if (get_int(icon_visible) == 1) + set_state(PART:"padding_center_text1", "icon", 0.0); + else + set_state(PART:"padding_center_text1", "default", 0.0); + } + } + program { name: "right_btn_hide"; + signal: "elm,state,title_right_btn,hide"; + source: "elm"; + script { + set_int(right_btn_visible, 0); + set_state(PART:"padding_before_right_btn", "default", 0.0); + if ((get_int(more_btn_visible) == 0) && (get_int(left_btn_visible) == 0)) { + set_state(PART:"padding_center_text2", "default", 0.0); + set_int(large_padded_center_align, 0); + } + else { + set_state(PART:"padding_center_text2", "visible", 0.0); + set_int(large_padded_center_align, 1); + } + if ((get_int(large_padded_center_align) == 1) && (get_int(icon_visible) == 1)) + set_state(PART:"padding_center_text1", "icon_left_button", 0.0); + else if (get_int(large_padded_center_align) == 1) + set_state(PART:"padding_center_text1", "visible", 0.0); + else if (get_int(icon_visible) == 1) + set_state(PART:"padding_center_text1", "icon", 0.0); + else + set_state(PART:"padding_center_text1", "default", 0.0); + } + } + program { name: "more_btn_show"; + signal: "elm,state,title_more_btn,show"; + source: "elm"; + script { + set_int(more_btn_visible, 1); + if (get_int(right_btn_visible) == 1) { + set_state(PART:"elm.text.title", "right_and_more_button", 0.0); + set_state(PART:"padding_before_right_btn", "right_and_more_button", 0.0); + set_int(large_padded_center_align, 0); + } + else { + set_state(PART:"padding_center_text2", "visible", 0.0); + set_int(large_padded_center_align, 1); + } + if ((get_int(icon_visible) == 1) && ((get_int(left_btn_visible) == 1) || + (get_int(large_padded_center_align) == 1))) + set_state(PART:"padding_center_text1", "icon_left_button", 0.0); + else if ((get_int(left_btn_visible) == 1) || (get_int(large_padded_center_align) == 1)) + set_state(PART:"padding_center_text1", "visible", 0.0); + else if (get_int(icon_visible) == 1) + set_state(PART:"padding_center_text1", "icon", 0.0); + else + set_state(PART:"padding_center_text1", "default", 0.0); + } + } + program { name: "more_btn_hide"; + signal: "elm,state,title_more_btn,hide"; + source: "elm"; + script { + set_int(more_btn_visible, 0); + set_state(PART:"padding_before_right_btn", "default", 0.0); + if ((get_int(right_btn_visible) == 0) && (get_int(left_btn_visible) == 0)) { + set_state(PART:"padding_center_text2", "default", 0.0); + set_int(large_padded_center_align, 0); + } + else { + set_state(PART:"padding_center_text2", "visible", 0.0); + set_int(large_padded_center_align, 1); + } + if ((get_int(large_padded_center_align) == 1) && (get_int(icon_visible) == 1)) + set_state(PART:"padding_center_text1", "icon_left_button", 0.0); + else if (get_int(large_padded_center_align) == 1) + set_state(PART:"padding_center_text1", "visible", 0.0); + else if (get_int(icon_visible) == 1) + set_state(PART:"padding_center_text1", "icon", 0.0); + else + set_state(PART:"padding_center_text1", "default", 0.0); + } + } + program { name: "icon_show"; + signal: "elm,state,elm.swallow.icon,show"; + source: "elm"; + script { + set_int(icon_visible, 1); + if ((get_int(large_padded_center_align) == 1) || (get_int(left_btn_visible) == 1)) + set_state(PART:"padding_center_text1", "icon_left_button", 0.0); + else + set_state(PART:"padding_center_text1", "icon", 0.0); + } + } + program { name: "icon_hide"; + signal: "elm,state,elm.swallow.icon,hide"; + source: "elm"; + script { + set_int(icon_visible, 0); + if ((get_int(large_padded_center_align) == 1) || (get_int(left_btn_visible) == 1)) + set_state(PART:"padding_center_text1", "visible", 0.0); + else + set_state(PART:"padding_center_text1", "default", 0.0); + } + } + program { name: "controlbar_show"; + signal: "elm,state,controlbar,show"; + source: "elm"; + script { + emit("elm,state,controlbar_bg,show", "elm"); + } + } + program { name: "controlbar_hide"; + signal: "elm,state,controlbar,hide"; + source: "elm"; + script { + emit("elm,state,controlbar_bg,hide", "elm"); + } + } + program { name: "controlbar_bg_show"; + signal: "elm,state,controlbar_bg,show"; + source: "elm"; + script { + set_state(PART:"controlbar_bg", "show", 0.0); + set_int(cbar_bg, get_int(cbar_bg) + 1); + } + } + program { name: "controlbar_bg_hide"; + signal: "elm,state,controlbar_bg,hide"; + source: "elm"; + script { + set_int(cbar_bg, get_int(cbar_bg) - 1); + if (get_int(cbar_bg) <= 0) + set_state(PART:"controlbar_bg", "default", 0.0); + } + } + program { name: "optionheader_show"; + signal: "elm,state,optionheader,show"; + source: "elm"; + script { + set_state(PART:"optionheader_bg", "show", 0.0); + set_state(PART:"optionheader_arrow", "show", 0.0); + set_int(oh_show, 1); + } + } + program { name: "optionheader_hide"; + signal: "elm,state,optionheader,hide"; + source: "elm"; + script { + set_state(PART:"optionheader_bg", "default", 0.0); + set_state(PART:"optionheader_arrow", "default", 0.0); + set_int(oh_show, 0); + } + } + program { name: "optionheader_open"; + signal: "elm,state,optionheader,open"; + source: ""; + action: STATE_SET "show" 0.0; + target: "optionheader_bg"; + target: "optionheader_arrow"; + transition: LINEAR 0.2; + after: "optionheader_open_set"; + } + program { name: "optionheader_close"; + signal: "elm,state,optionheader,close"; + source: ""; + action: STATE_SET "default" 0.0; + target: "optionheader_bg"; + target: "optionheader_arrow"; + transition: LINEAR 0.2; + after: "optionheader_close_set"; + } + program { name: "optionheader_instant_open"; + signal: "elm,state,optionheader,instant_open"; + source: ""; + action: STATE_SET "show" 0.0; + target: "optionheader_bg"; + target: "optionheader_arrow"; + after: "optionheader_open_set"; + } + program { name: "optionheader_instant_close"; + signal: "elm,state,optionheader,instant_close"; + source: ""; + action: STATE_SET "default" 0.0; + target: "optionheader_bg"; + target: "optionheader_arrow"; + after: "optionheader_close_set"; + } + program { name: "optionheader_close_set"; + signal: "elm,state,optionheader,close_set"; + source: ""; + script { + set_int(oh_close, 1); + } + } + program { name: "optionheader_open_set"; + signal: "elm,state,optionheader,open_set"; + source: ""; + script { + set_int(oh_close, 0); + } + } + program { name: "controlbar_open"; + signal: "elm,state,controlbar,open"; + source: ""; + action: STATE_SET "show" 0.0; + target: "controlbar_bg"; + transition: LINEAR 0.2; + } + program { name: "controlbar_close"; + signal: "elm,state,controlbar,close"; + source: ""; + action: STATE_SET "default" 0.0; + target: "controlbar_bg"; + transition: LINEAR 0.2; + } + program { name: "controlbar_instant_open"; + signal: "elm,state,controlbar,instant_open"; + source: ""; + script { + emit("elm,state,prev_btn,show", "elm"); + emit("elm,state,controlbar,show", "elm"); + } + } + program { name: "controlbar_instant_close"; + signal: "elm,state,controlbar,instant_close"; + source: ""; + script { + emit("elm,state,prev_btn,hide", "elm"); + emit("elm,state,controlbar,hide", "elm"); + } + } + program { name: "show_finished"; + action: SIGNAL_EMIT "elm,action,show,finished" ""; + } + program { name: "pushed_finished"; + action: SIGNAL_EMIT "elm,action,pushed,finished" ""; + } + program { name: "popped_finished"; + action: SIGNAL_EMIT "elm,action,popped,finished" ""; + } + program { + name: "title_clicked"; + signal: "mouse,clicked,1"; + source: "click_event_area"; + action: SIGNAL_EMIT "elm,action,title,clicked" ""; + } + } + } + + group { name: "elm/naviframe/item/browser/tabbar/default"; + script { + public cbar_bg = 0; //Controlbar BG Show call count + } + parts { + part { name: "base"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + } + description { state: "left" 0.0; + inherit: "default" 0.0; + rel1.relative: -1.0 0.0; + rel2.relative: 0.0 1.0; + } + description { state: "right" 0.0; + inherit: "default" 0.0; + rel1.relative: 1.0 0.0; + rel2.relative: 2.0 1.0; + } + } + part { name: "elm.swallow.content"; + type: SWALLOW; + scale: 1; + repeat_events: 0; + clip_to: "content_clip"; + description { state: "default" 0.0; + align: 0.0 0.0; + rel1.relative: 0.0 0.0; + rel1.to: "base"; + rel2.relative: 1.0 0.0; + rel2.to_x: "base"; + rel2.to_y: "controlbar_bg"; + } + } + part { name: "content_clip"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + rel1.to: "elm.swallow.content"; + rel2.to: "elm.swallow.content"; + } + } + part { name: "controlbar_bg"; + type: RECT; + scale: 1; + description { state: "default" 0.0; + min: 0 0; + max: 999999 0; + fixed: 0 1; + align: 0.0 1.0; + visible: 0; + rel1 { to: "base"; } + rel2 { to: "base"; } + color: NAVIFRAME_CONTROLBAR_BG_COLOR_INC; + } + description { state: "show" 0.0; + inherit: "default" 0.0; + min: 0 CONTROLBAR_SMALL_HEIGHT_INC; + max: 999999 CONTROLBAR_SMALL_HEIGHT_INC; + visible: 1; + } + } + part { name: "controlbar_clip"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + rel1 { to: "controlbar_bg"; } + rel2 { to: "controlbar_bg"; } + } + } + part { name: "elm.prev_btn_bg"; + type: RECT; + scale: 1; + clip_to: "controlbar_clip"; + description { state: "default" 0.0; + min: 0 0; + fixed: 1 0; + align: 1.0 0.0; + rel1 { relative: 1.0 0.0; to: "controlbar_bg"; } + rel2.to: "controlbar_bg"; + visible: 0; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + min: NAVIFRAME_TITLE_PREV_BTN_BG_SIZE_INC 0; + } + } + part { name: "elm.swallow.prev_btn"; + type: SWALLOW; + scale: 1; + clip_to: "controlbar_clip"; + description { state: "default" 0.0; + fixed: 1 1; + align: 0.5 0.5; + rel1.to: "elm.prev_btn_bg"; + rel2.to: "elm.prev_btn_bg"; + } + } + part { name: "controlbar"; + type: SWALLOW; + scale: 1; + clip_to: "controlbar_clip"; + description { state: "default" 0.0; + rel1.to: "controlbar_bg"; + rel2 { relative: 0.0 1.0; to: "elm.prev_btn_bg"; } + } + } + } + programs { + program { name: "content_new_pushed"; + signal: "elm,state,new,pushed,internal"; + source: ""; + action: STATE_SET "default" 0.0; + target: "base"; + transition: DECELERATE NAVIFRAME_VIEW_TRANS_TIME; + after: "show_finished"; + } + program { name: "content_cur_pushed"; + signal: "elm,state,cur,pushed,internal"; + source: ""; + action: STATE_SET "left" 0.0; + target: "base"; + transition: DECELERATE NAVIFRAME_VIEW_TRANS_TIME; + after: "pushed_finished"; + } + program { name: "content_prev_popped"; + signal: "elm,state,prev,popped,internal"; + source: ""; + action: STATE_SET "default" 0.0; + target: "base"; + transition: DECELERATE NAVIFRAME_VIEW_TRANS_TIME; + after: "show_finished"; + } + program { name: "content_cur_popped"; + signal: "elm,state,cur,popped,internal"; + source: ""; + action: STATE_SET "right" 0.0; + target: "base"; + transition: DECELERATE NAVIFRAME_VIEW_TRANS_TIME; + after: "popped_finished"; + } + program { name: "cur_pushed"; + signal: "elm,state,cur,pushed"; + source: "elm"; + script { + set_state(PART:"base", "default", 0.0); + emit("elm,state,cur,pushed,internal", ""); + } + } + program { name: "new_pushed"; + signal: "elm,state,new,pushed"; + source: "elm"; + script { + set_state(PART:"base", "right", 0.0); + emit("elm,state,new,pushed,internal", ""); + } + } + program { name: "prev_popped"; + signal: "elm,state,prev,popped"; + source: "elm"; + script { + set_state(PART:"base", "left", 0.0); + emit("elm,state,prev,popped,internal", ""); + } + } + program { name: "cur_popped"; + signal: "elm,state,cur,popped"; + source: "elm"; + script { + set_state(PART:"base", "default", 0.0); + emit("elm,state,cur,popped,internal", ""); + } + } + program { name: "visible"; + signal: "elm,state,visible"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "base"; + } + program { name: "prev_btn_show"; + signal: "elm,state,prev_btn,show"; + source: "elm"; + script { + emit("elm,state,controlbar_bg,show", "elm"); + set_state(PART:"elm.prev_btn_bg", "visible", 0.0); + } + } + program { name: "prev_btn_hide"; + signal: "elm,state,prev_btn,hide"; + source: "elm"; + script { + emit("elm,state,controlbar_bg,hide", "elm"); + set_state(PART:"elm.prev_btn_bg", "default", 0.0); + } + } + program { name: "controlbar_show"; + signal: "elm,state,controlbar,show"; + source: "elm"; + action: STATE_SET "show" 0.0; + script { + emit("elm,state,controlbar_bg,show", "elm"); + } + } + program { name: "controlbar_hide"; + signal: "elm,state,controlbar,hide"; + source: "elm"; + script { + emit("elm,state,controlbar_bg,hide", "elm"); + } + } + program { name: "controlbar_bg_show"; + signal: "elm,state,controlbar_bg,show"; + source: "elm"; + script { + set_state(PART:"controlbar_bg", "show", 0.0); + set_int(cbar_bg, get_int(cbar_bg) + 1); + } + } + program { name: "controlbar_bg_hide"; + signal: "elm,state,controlbar_bg,hide"; + source: "elm"; + script { + set_int(cbar_bg, get_int(cbar_bg) - 1); + if (get_int(cbar_bg) <= 0) + set_state(PART:"controlbar_bg", "default", 0.0); + } + } + program { name: "controlbar_open"; + signal: "elm,state,controlbar,open"; + source: ""; + action: STATE_SET "show" 0.0; + target: "controlbar_bg"; + transition: LINEAR 0.2; + } + program { name: "controlbar_close"; + signal: "elm,state,controlbar,close"; + source: ""; + action: STATE_SET "default" 0.0; + target: "controlbar_bg"; + transition: LINEAR 0.2; + } + program { name: "controlbar_instant_open"; + signal: "elm,state,controlbar,instant_open"; + source: ""; + script { + emit("elm,state,prev_btn,show", "elm"); + emit("elm,state,controlbar,show", "elm"); + } + } + program { name: "controlbar_instant_close"; + signal: "elm,state,controlbar,instant_close"; + source: ""; + script { + emit("elm,state,prev_btn,hide", "elm"); + emit("elm,state,controlbar,hide", "elm"); + } + } + program { name: "show_finished"; + action: SIGNAL_EMIT "elm,action,show,finished" ""; + } + program { name: "pushed_finished"; + action: SIGNAL_EMIT "elm,action,pushed,finished" ""; + } + program { name: "popped_finished"; + action: SIGNAL_EMIT "elm,action,popped,finished" ""; + } + program { + name: "title_clicked"; + signal: "mouse,clicked,1"; + source: "click_event_area"; + action: SIGNAL_EMIT "elm,action,title,clicked" ""; + } + } + } +} + diff --git a/edc/browser-picker-layout.edc b/edc/browser-picker-layout.edc new file mode 100755 index 00000000..0a0c2313 --- /dev/null +++ b/edc/browser-picker-layout.edc @@ -0,0 +1,53 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "browser-macro.edc" + +collections { + group { + name: "picker_layout"; + parts { + part { + name: "bg"; + mouse_events: 1; + repeat_events: 1; + type: RECT; + description + { + state: "default" 0.0; + visible: 1; + rel1 { relative: 0.0 0.0; } + rel2 { relative: 1.0 1.0; } + color: 0 0 0 0; + } + } + part { + name: "elm.swallow.picker"; + type: SWALLOW; + mouse_events: 1; + description { + state: "default" 0.0; + visible: 1; + fixed: 1 1; + align: 0.0 0.0; + rel1 { relative: 0.0 0.5; to: bg; } + rel2 { relative: 1.0 1.0; to: bg; } + } + } + } + } +} + diff --git a/edc/browser-predictive-history.edc b/edc/browser-predictive-history.edc new file mode 100755 index 00000000..c9c2ee21 --- /dev/null +++ b/edc/browser-predictive-history.edc @@ -0,0 +1,448 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "browser-macro.edc" + +collections { + group { + name: "browser/predictive-history"; + parts { + part { name: "bg"; + mouse_events: 0; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + fixed: 1 0; + align: 0.0 0.0; + rel1 { relative: 0.0 0.0; } + rel2 { relative: 1.0 1.0; } + color: 0 0 0 255; + } + } + part { name: "elm.swallow.predictive_history_genlist"; + mouse_events: 1; + type: SWALLOW; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + fixed: 1 0; + align: 0.0 0.0; + rel1 { relative: 0.0 0.0; } + rel2 { relative: 1.0 1.0; } + } + } + } + } + + +#define GENLIST_PART_TEXT_SELECTED_COLOR_INC 255 255 255 255 + +#define BEAT_GENLIST_PART_BASE( param_item_height ) \ + part { name: "base"; \ + type: RECT; \ + repeat_events: 1; \ + scale: 1; \ + description { state: "default" 0.0; \ + min: 0 param_item_height; \ + color: 0 0 0 255; \ + } \ + } +#define BEAT_GENLIST_PART_BG_IMAGE \ + part { name: "bg_image"; \ + type: RECT; \ + clip_to: "disclip"; \ + mouse_events: 0; \ + description { state: "default" 0.0; \ + visible: 0; \ + color: GENLIST_PART_BG_SELECTED_COLOR_INC; \ + } \ + description { state: "selected" 0.0; \ + inherit: "default" 0.0; \ + visible: 1; \ + } \ + } +#define BEAT_GENLIST_PART_BOTTOM_LINE \ + part { name: "bottom_line"; \ + type: RECT; \ + clip_to: "disclip"; \ + mouse_events: 0; \ + description { state: "default" 0.0; \ + min: 0 1; \ + fixed: 0 1; \ + visible: 1; \ + color: 80 80 80 255; \ + rel1 { \ + relative: 0.0 1.0; \ + offset: 0 -1; \ + } \ + } \ + } +#define BEAT_GENLIST_PART_PADDING_LEFT( param_padding_size ) \ + part { name: "elm.padding.left"; \ + type: RECT; \ + scale: 1; \ + description { state: "default" 0.0; \ + min: param_padding_size 0; \ + fixed: 1 0; \ + visible: 0; \ + rel2.relative: 0.0 1.0; \ + align: 0.0 0.0; \ + } \ + } +#define BEAT_GENLIST_PART_PADDING_RIGHT( param_padding_size ) \ + part { name: "elm.padding.right"; \ + type: RECT; \ + scale: 1; \ + description { state: "default" 0.0; \ + min: param_padding_size 0; \ + fixed: 1 0; \ + visible: 0; \ + rel1.relative: 1.0 0.0; \ + align: 1.0 0.0; \ + } \ + } + + group { name: "elm/genlist/item/browser/1text/default"; + alias: "elm/genlist/item_odd/browser/1text/default"; + alias: "elm/genlist/item/browser/1line_textonly/default"; + alias: "elm/genlist/item_odd/browser/1line_textonly/default"; + alias: "elm/genlist/item_compress/browser/1line_textonly/default"; + alias: "elm/genlist/item_compress_odd/browser/1line_textonly/default"; + + data.item: "stacking" "above"; + data.item: "selectraise" "on"; + data.item: "texts" "elm.text"; + styles { + style { name: "text_style"; + base: "font=SLP:style=Roman font_size=40 color=#F9F9F9 wrap=char ellipsis=1.0"; + tag: "br" "\n"; + tag: "ps" "ps"; + tag: "tab" "\t"; + tag: "b" "+ font=SLP:style=Bold"; + tag: "match" "+ color=#008CD2FF"; + } + } + parts { + BEAT_GENLIST_PART_BASE( 90 ) + BEAT_GENLIST_PART_BG_IMAGE + BEAT_GENLIST_PART_BOTTOM_LINE + BEAT_GENLIST_PART_PADDING_LEFT( 15 ) + BEAT_GENLIST_PART_PADDING_RIGHT( 15 ) + part { name: "elm.text"; + clip_to: "disclip"; + type: TEXTBLOCK; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + fixed: 1 0; + rel1 { + relative: 1.0 0.2; + offset: 0 0; + to_x: "elm.padding.left"; + to_y: "base"; + } + rel2 { + relative: 0.0 1.0; + offset: 0 0; + to_x: "elm.padding.right"; + to_y: "base"; + } + text { + style: "text_style"; + } + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + color: GENLIST_PART_TEXT_SELECTED_COLOR_INC; + } + } + BEAT_GENLIST_PART_DISCLIP + } + programs { + // signal: elm,state,%s,active + // a "check" item named %s went active + // signal: elm,state,%s,passive + // a "check" item named %s went passive + // default is passive + program { name: "go_active"; + signal: "elm,state,selected"; + source: "elm"; + action: STATE_SET "selected" 0.0; + target: "bg_image"; + target: "elm.text"; + } + program { name: "go_passive"; + signal: "elm,state,unselected"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "bg_image"; + target: "elm.text"; + transition: LINEAR 0.1; + } + program { name: "go_disabled"; + signal: "elm,state,disabled"; + source: "elm"; + action: STATE_SET "disabled" 0.0; + target: "disclip"; + } + program { name: "go_enabled"; + signal: "elm,state,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "disclip"; + } + } + } + + group { name: "elm/genlist/item/browser/1text.1icon/default"; + alias: "elm/genlist/item_odd/browser/1text.1icon/default"; + alias: "elm/genlist/item_compress/browser/1text.1icon/default"; + alias: "elm/genlist/item_compress_odd/browser/1text.1icon/default"; + data.item: "stacking" "above"; + data.item: "selectraise" "on"; + data.item: "texts" "elm.text"; + data.item: "contents" "elm.icon"; + data.item: "renames" "elm.edit.rename"; + + parts { + BEAT_GENLIST_PART_BASE( 90 ) + BEAT_GENLIST_PART_BG_IMAGE + BEAT_GENLIST_PART_BOTTOM_LINE + BEAT_GENLIST_PART_PADDING_LEFT( 15 ) + BEAT_GENLIST_PART_PADDING_RIGHT( 15 ) + part { name: "elm.icon"; + clip_to: "disclip"; + type: SWALLOW; + scale: 1; + description { state: "default" 0.0; + fixed: 1 1; + min: 60 60; + max: 60 60; + rel1.to_x: "elm.padding.left"; + rel1.offset: 10 0; + rel2 { + relative: 0.0 1.0; + to_x: "elm.padding.left"; + } + align: 0.0 0.5; + } + } + part { name: "elm.padding.icon.left"; + clip_to: "disclip"; + type: RECT; + scale: 1; + description { state: "default" 0.0; + min: 10 0; + fixed: 1 0; + rel1.to_x: "elm.icon"; + rel2 { + relative: 0.0 1.0; + to_x: "elm.icon"; + } + align: 1.0 0.0; + visible: 0; + } + } + + part { name: "elm.text"; + clip_to: "disclip"; + type: TEXTBLOCK; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + fixed: 1 0; + rel1 { + relative: 1.0 0.0; + offset: 0 0; + to_x: "elm.icon"; + to_y: "base"; + } + rel2 { + relative: 0.0 1.0; + offset: 0 0; + to_x: "elm.padding.right"; + to_y: "base"; + } + text { + style: "text_style"; + } + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + color: GENLIST_PART_TEXT_SELECTED_COLOR_INC; + } + } + BEAT_GENLIST_PART_DISCLIP + } + programs { + program { name: "go_active"; + signal: "elm,state,selected"; + source: "elm"; + action: STATE_SET "selected" 0.0; + target: "bg_image"; + target: "elm.text"; + } + program { name: "go_passive"; + signal: "elm,state,unselected"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "bg_image"; + target: "elm.text"; + transition: LINEAR 0.1; + } + program { name: "go_disabled"; + signal: "elm,state,disabled"; + source: "elm"; + action: STATE_SET "disabled" 0.0; + target: "disclip"; + } + program { name: "go_enabled"; + signal: "elm,state,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "disclip"; + } + } + } + + group { name: "elm/genlist/item/browser/1text.1icon.2/default"; + alias: "elm/genlist/item_odd/browser/1text.1icon.2/default"; + alias: "elm/genlist/item_compress/browser/1text.1icon.2/default"; + alias: "elm/genlist/item_compress_odd/browser/1text.1icon.2/default"; + data.item: "stacking" "above"; + data.item: "selectraise" "on"; + data.item: "texts" "elm.text"; + data.item: "contents" "elm.icon"; + data.item: "renames" "elm.edit.rename"; + + parts { + BEAT_GENLIST_PART_BASE( 90 ) + BEAT_GENLIST_PART_BG_IMAGE + BEAT_GENLIST_PART_BOTTOM_LINE + BEAT_GENLIST_PART_PADDING_LEFT( 15 ) + BEAT_GENLIST_PART_PADDING_RIGHT( 15 ) + part { name: "elm.icon"; + clip_to: "disclip"; + type: SWALLOW; + scale: 1; + description { state: "default" 0.0; + fixed: 1 1; + min: 40 40; + max: 40 40; + rel1.to_x: "elm.padding.left"; + rel1.offset: 10 0; + rel2 { + relative: 0.0 1.0; + to_x: "elm.padding.left"; + } + align: 0.0 0.5; + } + } + part { name: "elm.padding.icon.left"; + clip_to: "disclip"; + type: RECT; + scale: 1; + description { state: "default" 0.0; + min: 10 0; + fixed: 1 0; + rel1.to_x: "elm.icon"; + rel2 { + relative: 0.0 1.0; + to_x: "elm.icon"; + } + align: 1.0 0.0; + visible: 0; + } + } + /* Customize, the globe icon is more smaller than search icon. */ + part { name: "elm.padding.text.left"; + clip_to: "disclip"; + type: RECT; + scale: 1; + description { state: "default" 0.0; + min: 20 0; + fixed: 1 0; + align: 0.0 0.0; + rel1 { relative: 1.0 0.0; to: "elm.icon"; } + rel2 { relative: 1.0 0.0; to: "elm.icon"; } + visible: 0; + } + } + part { name: "elm.text"; + clip_to: "disclip"; + type: TEXTBLOCK; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + fixed: 1 0; + rel1 { + relative: 1.0 0.0; + offset: 0 0; + /* Customize, the globe icon is more smaller than search icon. */ + to_x: "elm.padding.text.left"; + to_y: "base"; + } + rel2 { + relative: 0.0 1.0; + offset: 0 0; + to_x: "elm.padding.right"; + to_y: "base"; + } + text { + style: "text_style"; + } + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + color: GENLIST_PART_TEXT_SELECTED_COLOR_INC; + } + } + BEAT_GENLIST_PART_DISCLIP + } + programs { + program { name: "go_active"; + signal: "elm,state,selected"; + source: "elm"; + action: STATE_SET "selected" 0.0; + target: "bg_image"; + target: "elm.text"; + } + program { name: "go_passive"; + signal: "elm,state,unselected"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "bg_image"; + target: "elm.text"; + transition: LINEAR 0.1; + } + program { name: "go_disabled"; + signal: "elm,state,disabled"; + source: "elm"; + action: STATE_SET "disabled" 0.0; + target: "disclip"; + } + program { name: "go_enabled"; + signal: "elm,state,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "disclip"; + } + } + } +} diff --git a/edc/browser-settings.edc b/edc/browser-settings.edc new file mode 100755 index 00000000..1af3ee8b --- /dev/null +++ b/edc/browser-settings.edc @@ -0,0 +1,178 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "browser-macro.edc" + +collections { + group { + name: "edit_homepage_view"; + + parts { + part { + name: "bg"; + mouse_events: 0; + type: RECT; + description + { + state: "default" 0.0; + visible: 1; + rel1 { relative: 0.0 0.0; } + rel2 { relative: 1.0 1.0; } + color: 0 0 0 0; + } + } + part { + name: "elm.swallow.entry"; + type: SWALLOW; + mouse_events: 1; + description { + state: "default" 0.0; + visible: 1; + min: 0 80; + fixed: 0 1; + align: 0.0 0.0; + rel1 { relative: 0.0 0.0; to: bg; offset: 20 0; } + rel2 { relative: 1.0 0.0; to: bg; offset: -20 0; } + } + } + } + } + + group { name: "elm/genlist/item/browser-settings/select_all/default"; + alias: "elm/genlist/item_odd/browser-settings/select_all/default"; + alias: "elm/genlist/item_compress/browser-settings/select_all/default"; + alias: "elm/genlist/item_compress_odd/browser-settings/select_all/default"; + + data.item: "stacking" "above"; + data.item: "selectraise" "on"; + data.item: "texts" "elm.text"; + data.item: "contents" "elm.swallow.icon elm.swallow.end"; + parts { + BEAT_GENLIST_PART_BASE( 120 ) + + part { name: "bg"; + type: RECT; + clip_to: "disclip"; + mouse_events: 0; + description { state: "default" 0.0; + color: 52 74 85 255; + } + } + + BEAT_GENLIST_PART_BG_IMAGE + BEAT_GENLIST_PART_BOTTOM_LINE + BEAT_GENLIST_PART_PADDING_LEFT( 15 ) + BEAT_GENLIST_PART_PADDING_RIGHT( 22 ) + part { name: "elm.swallow.end"; + clip_to: "disclip"; + type: SWALLOW; + scale: 1; + description { state: "default" 0.0; + fixed: 1 0; + align: 1.0 0.5; + rel1.to_x: "elm.padding.right"; + rel2 { + relative: 0.0 1.0; + to_x: "elm.padding.right"; + } + } + } + part { name: "elm.text"; + clip_to: "disclip"; + type: TEXT; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + rel1 { + relative: 1.0 0.0; + offset: 30 0; + to_x: "elm.swallow.icon"; + } + rel2 { + to_x: "elm.swallow.end"; + relative: 0.0 1.0; + offset: 30 0; + } + color: 255 255 255 255; + text { + font: "SLP:style=Roman"; + size: 48; + min: 0 1; + align: 0.0 0.5; + } + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + color: 255 255 255 255; + } + } + part { name: "elm.swallow.icon"; + clip_to: "disclip"; + type: SWALLOW; + scale: 1; + description { state: "default" 0.0; + align: 0.0 0.5; + fixed: 1 1; + visible:1; + min: 63 63; + max: 63 63; + rel1 { + relative: 1.0 0.0; + to_x: "elm.padding.left"; + } + rel2.to_x: "elm.padding.left"; + } + } + + BEAT_GENLIST_SELECT_ALL_PART_DISCLIP + } + programs { + // signal: elm,state,%s,active + // a "check" item named %s went active + // signal: elm,state,%s,passive + // a "check" item named %s went passive + // default is passive + program { name: "go_active"; + signal: "elm,state,selected"; + source: "elm"; + action: STATE_SET "selected" 0.0; + target: "bg_image"; + target: "elm.text"; + } + program { name: "go_passive"; + signal: "elm,state,unselected"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "bg_image"; + target: "elm.text"; + transition: LINEAR 0.1; + } + program { name: "go_disabled"; + signal: "elm,state,disabled"; + source: "elm"; + action: STATE_SET "disabled" 0.0; + target: "disclip"; + } + program { name: "go_enabled"; + signal: "elm,state,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "disclip"; + } + } + } +} + diff --git a/edc/browser-view-control-bar.edc b/edc/browser-view-control-bar.edc new file mode 100755 index 00000000..37015f0b --- /dev/null +++ b/edc/browser-view-control-bar.edc @@ -0,0 +1,1755 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "browser-macro.edc" + +collections { +//////////////////////////////////////////////////////////////////////////////////////// +// controlbar +/////////////////////////////////////////////////////////////////////////////////////// + + +#define BUTTON_CONTROLBAR_ITEM_BUTTON_TEXT_SIZE_INC 28 +#define BUTTON_CONTROLBAR_ITEM_BUTTON_TEXTBLOCK_COLOR_INC "#f9f9f9" +#define BUTTON_CONTROLBAR_ITEM_BUTTON_ICON_SIZE_INC 56 56 +#define BUTTON_NAVIFRAME_DEFAULT_TEXT_COLOR_INC 249 249 249 255 +#define BUTTON_NAVIFRAME_FOCUSED_TEXT_COLOR_INC 249 249 249 255 + +#define ITEM_STATE_ENABLED 0 +#define ITEM_STATE_DISABLED 1 + +group { name: "elm/toolbar/base/browser/default"; + images { + image: "browser-view-images/controlbar/I01_toolbar_bg.png" COMP; + } + parts { + part { name: "base"; + mouse_events: 1; + description { state: "default" 0.0; + image.normal: "browser-view-images/controlbar/I01_toolbar_bg.png"; + } + } + part { name: "clipper"; + type: RECT; + mouse_events: 0; + description { + state: "default" 0.0; + rel1 { + to: "base"; + offset: 2 2; + } + rel2 { + to: "base"; + offset: -3 -3; + } + } + } + part { name: "elm.swallow.content"; + clip_to: "clipper"; + type: SWALLOW; + description { + state: "default" 0.0; + rel1.to: "clipper"; + rel2.to: "clipper"; + } + } + part { name: "event"; + type: RECT; + mouse_events: 1; + repeat_events: 1; + description { state: "default" 0.0; + color: 0 0 0 0; + } + } + } +} + +group { name: "elm/toolbar/item/browser/default"; + images { + image: "browser-view-images/controlbar/I01_toolbar_press.png" COMP; + } + styles{ + style { name: "toolbar_style"; + base: "font=SLP:style=Medium font_size="BUTTON_CONTROLBAR_ITEM_BUTTON_TEXT_SIZE_INC" align=center color="BUTTON_CONTROLBAR_ITEM_BUTTON_TEXTBLOCK_COLOR_INC" wrap=mixed ellipsis=1"; + tag: "br" "\n"; + tag: "ps" "ps"; + tag: "hilight" "+ font=SLP:style=Bold"; + tag: "b" "+ font=SLP:style=Bold"; + tag: "tab" "\t"; + } + } + + data.item: "transition_animation_on" "1"; + script { + public item_state = ITEM_STATE_ENABLED; + } + parts { + part { name: "bg"; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + color: 255 255 255 0; + rel1 { + relative: 1.0 1.0; + to: "padding_left_top"; + } + rel2 { + relative: 0.0 0.0; + to: "padding_right_bottom"; + } + image { + normal: "browser-view-images/controlbar/I01_toolbar_press.png"; + border: 3 3 3 3; + } + image.middle: SOLID; + fill.smooth: 0; + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + visible: 0; + color: 255 255 255 0; + } + } + part { name: "padding_left_top"; + type: RECT; + scale: 1; + mouse_events: 0; + description { state: "default" 0.0; + align: 0.0 0.0; + rel2.relative: 0.0 0.0; + min: 10 8; + fixed: 1 1; + visible: 1; + color: 0 0 0 0; + } + } + part { name: "padding_right_bottom"; + type: RECT; + scale: 1; + mouse_events: 0; + description { state: "default" 0.0; + align: 1.0 1.0; + rel1.relative: 1.0 1.0; + min: 10 5; + fixed: 1 1; + visible: 1; + color: 0 0 0 0; + } + } + part { + name: "icon_rect"; + type: RECT; + scale: 1; + mouse_events: 0; + description { state: "default" 0.0; + min: 0 0; + fixed: 0 1; + rel1 { + relative: 1.0 1.0; + to: "padding_left_top"; + } + rel2 { + relative: 0.0 1.0; + to_x: "padding_right_bottom"; + to_y: "padding_left_top"; + } + align: 0.5 0.0; + color: 0 0 0 0; + } + description { state: "visible" 0.0; + min: BUTTON_CONTROLBAR_ITEM_BUTTON_ICON_SIZE_INC; + fixed: 0 1; + rel1 { + relative: 1.0 1.0; + to: "padding_left_top"; + } + rel2 { + relative: 0.0 1.0; + to_x: "padding_right_bottom"; + to_y: "padding_left_top"; + } + align: 0.5 0.0; + color: 0 0 0 0; + } + description { state: "icononly" 0.0; + inherit: "default" 0.0; + } + } + part { name: "padding_after_icon"; + type: RECT; + scale: 1; + mouse_events: 0; + description { state: "default" 0.0; //when only icon or no icon is there + align: 0.0 0.0; + rel1 { + relative: 0.0 1.0; + to: "icon_rect"; + } + rel2.to: "icon_rect"; + fixed: 0 1; + min: 0 0; + color: 0 0 0 0; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + } + description { state: "icononly" 0.0; + inherit: "default" 0.0; + } + } + part { name: "padding_before_text"; + type: RECT; + scale: 1; + mouse_events: 0; + description { state: "default" 0.0; //when only icon or no icon is there + align: 0.5 1.0; + rel1 { + relative: 1.0 0.0; + to_x: "padding_left_top"; + to_y: "elm.text"; + } + rel2 { + relative: 0.0 0.0; + to_x: "padding_right_bottom"; + to_y: "elm.text"; + } + fixed: 0 1; + min: 0 0; + color: 0 0 0 0; + } + } + part { name: "elm.swallow.icon"; + type: SWALLOW; + scale: 1; + clip_to: "elm.icon.clipper"; + description { state: "default" 0.0; + visible: 0; + align: 0.5 0.0; + rel1 { + relative: 1.0 1.0; + to: "padding_left_top"; + } + rel2 { + relative: 0.0 1.0; + to_x: "padding_right_bottom"; + to_y: "padding_left_top"; + } + fixed: 0 1; + } + description { state: "visible" 0.0; + fixed: 0 1; + min: BUTTON_CONTROLBAR_ITEM_BUTTON_ICON_SIZE_INC; + max: BUTTON_CONTROLBAR_ITEM_BUTTON_ICON_SIZE_INC; + rel1 { + relative: 1.0 1.0; + to: "padding_left_top"; + } + rel2 { + relative: 0.0 0.0; + to_x: "padding_right_bottom"; + to_y: "padding_before_text"; + } + aspect: 1.0 1.0; + aspect_preference: HORIZONTAL; + } + description { state: "icononly" 0.0; + min: BUTTON_CONTROLBAR_ITEM_BUTTON_ICON_SIZE_INC; + max: BUTTON_CONTROLBAR_ITEM_BUTTON_ICON_SIZE_INC; + rel1 { + relative: 1.0 1.0; + to: "padding_left_top"; + } + rel2 { + relative: 0.0 0.0; + to: "padding_right_bottom"; + } + aspect: 1.0 1.0; + aspect_preference: HORIZONTAL; + } + } + part { name: "elm.swallow.icon_new"; + type: SWALLOW; + scale: 1; + clip_to: "elm.icon_new.clipper"; + description { state: "default" 0.0; + visible: 0; + align: 0.5 0.0; + rel1 { + relative: 1.0 1.0; + to: "padding_left_top"; + } + rel2 { + relative: 0.0 1.0; + to_x: "padding_right_bottom"; + to_y: "padding_left_top"; + } + fixed: 0 1; + } + description { state: "visible" 0.0; + fixed: 0 1; + min: BUTTON_CONTROLBAR_ITEM_BUTTON_ICON_SIZE_INC; + max: BUTTON_CONTROLBAR_ITEM_BUTTON_ICON_SIZE_INC; + rel1 { + relative: 1.0 1.0; + to: "padding_left_top"; + } + rel2 { + relative: 0.0 0.0; + to_x: "padding_right_bottom"; + to_y: "padding_before_text"; + } + aspect: 1.0 1.0; + aspect_preference: HORIZONTAL; + } + description { state: "icononly" 0.0; + min: BUTTON_CONTROLBAR_ITEM_BUTTON_ICON_SIZE_INC; + max: BUTTON_CONTROLBAR_ITEM_BUTTON_ICON_SIZE_INC; + rel1 { + relative: 1.0 1.0; + to: "padding_left_top"; + } + rel2 { + relative: 0.0 0.0; + to: "padding_right_bottom"; + } + aspect: 1.0 1.0; + aspect_preference: HORIZONTAL; + } + } + part { name: "elm.text"; + type: TEXTBLOCK; + mouse_events: 0; + scale: 1; + clip_to: "elm.text.clipper"; + description { state: "default" 0.0; + visible: 1; + rel1 { + relative: 1.0 1.0; + to_x: "padding_left_top"; + to_y: "padding_after_icon"; + } + rel2 { + relative: 0.0 0.0; + to: "padding_right_bottom"; + } + color: BUTTON_NAVIFRAME_DEFAULT_TEXT_COLOR_INC; + fixed: 1 1; + text { + style: "toolbar_style"; + min: 0 1; + max: 0 1; + } + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + description { state: "clicked" 0.0; + inherit: "default" 0.0; + visible: 1; + color: BUTTON_NAVIFRAME_FOCUSED_TEXT_COLOR_INC; + } + description { state: "focused" 0.0; + inherit: "default" 0.0; + visible: 1; + color: BUTTON_NAVIFRAME_FOCUSED_TEXT_COLOR_INC; + } + } + part { name: "elm.text_new"; + type: TEXTBLOCK; + mouse_events: 0; + scale: 1; + clip_to: "elm.text_new.clipper"; + description { state: "default" 0.0; + visible: 1; + rel1 { + relative: 1.0 1.0; + to_x: "padding_left_top"; + to_y: "padding_after_icon"; + } + rel2 { + relative: 0.0 0.0; + to: "padding_right_bottom"; + } + color: BUTTON_NAVIFRAME_DEFAULT_TEXT_COLOR_INC; + fixed: 1 1; + text { + style: "toolbar_style"; + min: 0 1; + max: 0 1; + } + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + description { state: "clicked" 0.0; + inherit: "default" 0.0; + visible: 1; + color: BUTTON_NAVIFRAME_FOCUSED_TEXT_COLOR_INC; + } + description { state: "focused" 0.0; + inherit: "default" 0.0; + visible: 1; + color: BUTTON_NAVIFRAME_FOCUSED_TEXT_COLOR_INC; + } + } + part { name: "elm.text.clipper"; + type: RECT; + description { state: "default" 0.0; + color: 255 255 255 255; + } + description { state: "animation" 0.0; + color: 255 255 255 0; + } + description { state: "disabled" 0.0; + color: 255 255 255 153; + } + } + part { name: "elm.text_new.clipper"; + type: RECT; + description { state: "default" 0.0; + color: 255 255 255 0; + } + description { state: "animation" 0.0; + color: 255 255 255 255; + } + } + part { name: "elm.icon.clipper"; + type: RECT; + description { state: "default" 0.0; + color: 255 255 255 255; + } + description { state: "animation" 0.0; + color: 255 255 255 0; + } + description { state: "disabled" 0.0; + color: 255 255 255 153; + } + } + part { name: "elm.icon_new.clipper"; + type: RECT; + description { state: "default" 0.0; + color: 255 255 255 0; + } + description { state: "animation" 0.0; + color: 255 255 255 255; + } + } + part { name: "event"; + type: RECT; + mouse_events: 1; + ignore_flags: ON_HOLD; + description { state: "default" 0.0; + color: 0 0 0 0; + } + } + part { name: "event2"; + type: RECT; + mouse_events: 1; + repeat_events: 1; + description { state: "default" 0.0; + color: 0 0 0 0; + } + } + } + programs { + program { name: "pressed"; + signal: "mouse,down,1"; + source: "event"; + script { + if (get_int(item_state) != ITEM_STATE_DISABLED) + set_state(PART:"bg", "selected", 0.0); + } + transition: LINEAR 0.2; + } + program { name: "unpressed"; + signal: "mouse,up,1"; + source: "event2"; + action: STATE_SET "default" 0.0; + target: "bg"; + transition: LINEAR 0.1; + } + program { name: "go"; + signal: "mouse,up,1"; + source: "event"; + action: SIGNAL_EMIT "elm,action,click" "elm"; + } + program { name: "mouse,in"; + signal: "mouse,in"; + source: "event"; + action: SIGNAL_EMIT "elm,mouse,in" "elm"; + } + program { name: "mouse,out"; + signal: "mouse,out"; + source: "event"; + action: SIGNAL_EMIT "elm,mouse,out" "elm"; + } + program { name: "disable"; + signal: "elm,state,disabled"; + source: "elm"; + action: STATE_SET "disabled" 0.0; + target: "bg"; + after: "disable_text"; + } + program { name: "disable_text"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.text", st, 30, vl); + if (!strcmp(st, "visible")) + { + set_state(PART:"elm.text", "disabled_visible", 0.0); + set_state(PART:"elm.text_new", "disabled_visible", 0.0); + } + else + { + set_state(PART:"elm.text", "disabled", 0.0); + set_state(PART:"elm.text_new", "disabled", 0.0); + } + set_state(PART:"elm.text.clipper", "disabled", 0.0); + set_state(PART:"elm.icon.clipper", "disabled", 0.0); + set_int(item_state, ITEM_STATE_DISABLED); + } + } + program { name: "enable"; + signal: "elm,state,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "bg"; + after: "enable_text"; + } + program { name: "enable_text"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.text", st, 30, vl); + if (!strcmp(st, "disabled_visible")) + { + set_state(PART:"elm.text", "visible", 0.0); + set_state(PART:"elm.text_new", "visible", 0.0); + } + else + { + set_state(PART:"elm.text", "default", 0.0); + set_state(PART:"elm.text_new", "default", 0.0); + } + set_state(PART:"elm.text.clipper", "default", 0.0); + set_state(PART:"elm.icon.clipper", "default", 0.0); + set_int(item_state, ITEM_STATE_ENABLED); + } + } + program { name: "label_set,animation,forward"; + signal: "elm,state,label_set,forward"; + source: "elm"; + after: "label_set,animation"; + } + program { name: "label_set,animation,backward"; + signal: "elm,state,label_set,backward"; + source: "elm"; + after: "label_set,animation"; + } + program { name: "label_set,animation"; + signal: "elm,state,label_set"; + source: "elm"; + action: STATE_SET "animation" 0.0; + target: "elm.text.clipper"; + target: "elm.text_new.clipper"; + transition: LINEAR 0.2; + after: "label_set,animation,done"; + } + program { name: "label_set,animation,done"; + action: SIGNAL_EMIT "elm,state,label_set,done" "elm"; + } + program { name: "label,reset"; + signal: "elm,state,label,reset"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.text.clipper"; + target: "elm.text_new.clipper"; + } + program { name: "icon_set,animation,forward"; + signal: "elm,state,icon_set,forward"; + source: "elm"; + after: "icon_set,animation"; + } + program { name: "icon_set,animation,backward"; + signal: "elm,state,icon_set,backward"; + source: "elm"; + after: "icon_set,animation"; + } + program { name: "icon_set,animation"; + signal: "elm,state,icon_set"; + source: "elm"; + action: STATE_SET "animation" 0.0; + target: "elm.icon.clipper"; + target: "elm.icon_new.clipper"; + transition: LINEAR 0.2; + after: "icon_set,animation,done"; + } + program { name: "icon_set,animation,done"; + action: SIGNAL_EMIT "elm,state,icon_set,done" "elm"; + } + program { name: "icon,reset"; + signal: "elm,state,icon,reset"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.icon.clipper"; + target: "elm.icon_new.clipper"; + } + program { name: "text_show"; + signal: "elm,state,text,visible"; + source: "elm"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.swallow.icon", st, 30, vl); + if (!strcmp(st, "icononly")) + { + set_state(PART:"elm.swallow.icon", "visible", 0.0); + set_state(PART:"icon_rect", "visible", 0.0); + set_state(PART:"padding_after_icon", "visible", 0.0); + } + set_state(PART:"elm.text", "visible", 0.0); + } + } + program { name: "text_hide"; + signal: "elm,state,text,hidden"; + source: "elm"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.swallow.icon", st, 30, vl); + if (!strcmp(st, "visible")) + { + set_state(PART:"elm.swallow.icon", "icononly", 0.0); + set_state(PART:"icon_rect", "icononly", 0.0); + set_state(PART:"padding_after_icon", "icononly", 0.0); + } + set_state(PART:"elm.text", "default", 0.0); + } + } + program { name: "icon_show"; + signal: "elm,state,icon,visible"; + source: "elm"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.text", st, 30, vl); + if (!strcmp(st, "visible")) + { + set_state(PART:"elm.swallow.icon", "visible", 0.0); + set_state(PART:"icon_rect", "visible", 0.0); + set_state(PART:"padding_after_icon", "visible", 0.0); + } + else + { + set_state(PART:"elm.swallow.icon", "icononly", 0.0); + set_state(PART:"icon_rect", "icononly", 0.0); + set_state(PART:"padding_after_icon", "icononly", 0.0); + } + } + } + } +} + +group { name: "elm/toolbar/item/browser/item_horizontal"; + inherit: "elm/toolbar/item/browser/default"; + script { + public item_state = ITEM_STATE_ENABLED; + } + parts { + part { name: "icon_rect"; + description { state: "default" 0.0; + fixed: 1 0; + align: 0.0 0.5; + } + description { state: "visible" 0.0; + fixed: 1 0; + rel2 { + relative: 1.0 0.0; + to_x: "padding_left_top"; + to_y: "padding_right_bottom"; + } + align: 0.0 0.5; + } + } + part { name: "padding_after_icon"; + description { state: "default" 0.0; //when only icon or no icon is there + rel1.relative: 1.0 0.0; + fixed: 1 1; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + min: 6 0; + } + } + part { name: "padding_before_text"; + description { state: "default" 0.0; //when only icon or no icon is there + align: 1.0 0.5; + rel1 { + relative: 0.0 1.0; + to_x: "elm.text"; + to_y: "padding_left_top"; + } + rel2 { + to_x: "elm.text"; + to_y: "padding_right_bottom"; + } + fixed: 1 0; + min: 6 0; + } + } + part { name: "elm.swallow.icon"; + description { state: "default" 0.0; + align: 0.0 0.5; + rel2 { + relative: 1.0 0.0; + to_x: "padding_left_top"; + to_y: "padding_right_bottom"; + } + fixed: 1 0; + } + description { state: "visible" 0.0; + fixed: 1 0; + align: 1.0 0.5; + rel1 { + relative: 0.0 1.0; + to_x: "padding_before_text"; + to_y: "padding_left_top"; + } + rel2 { + relative: 0.0 0.0; + to_x: "padding_before_text"; + to_y: "padding_right_bottom"; + } + aspect_preference: VERTICAL; + } + description { state: "icononly" 0.0; + aspect_preference: VERTICAL; + } + } + part { name: "elm.swallow.icon_new"; + description { state: "default" 0.0; + align: 0.0 0.5; + rel2 { + relative: 1.0 0.0; + to_x: "padding_left_top"; + to_y: "padding_right_bottom"; + } + fixed: 1 0; + } + description { state: "visible" 0.0; + fixed: 1 0; + align: 1.0 0.5; + rel1 { + relative: 0.0 1.0; + to_x: "padding_before_text"; + to_y: "padding_left_top"; + } + rel2 { + relative: 0.0 0.0; + to_x: "padding_before_text"; + to_y: "padding_right_bottom"; + } + aspect_preference: VERTICAL; + } + description { state: "icononly" 0.0; + aspect_preference: VERTICAL; + } + } + part { name: "elm.text"; + type: TEXTBLOCK; + description { state: "default" 0.0; + rel1 { + relative: 1.0 1.0; + to_x: "padding_after_icon"; + to_y: "padding_left_top"; + } + text { + style: "toolbar_style"; + min: 1 0; + max: 1 0; + } + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + description { state: "clicked" 0.0; + inherit: "default" 0.0; + visible: 1; + color: BUTTON_NAVIFRAME_FOCUSED_TEXT_COLOR_INC; + } + description { state: "focused" 0.0; + inherit: "default" 0.0; + visible: 1; + color: BUTTON_NAVIFRAME_FOCUSED_TEXT_COLOR_INC; + } + } + part { name: "elm.text_new"; + type: TEXTBLOCK; + description { state: "default" 0.0; + rel1 { + relative: 1.0 1.0; + to_x: "padding_after_icon"; + to_y: "padding_left_top"; + } + text { + style: "toolbar_style"; + min: 1 0; + max: 1 0; + } + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + description { state: "clicked" 0.0; + inherit: "default" 0.0; + visible: 1; + color: BUTTON_NAVIFRAME_FOCUSED_TEXT_COLOR_INC; + } + description { state: "focused" 0.0; + inherit: "default" 0.0; + visible: 1; + color: BUTTON_NAVIFRAME_FOCUSED_TEXT_COLOR_INC; + } + } + } +} + +group { name: "elm/toolbar/separator/browser/default"; + images { +// image: "separator_v.png" COMP; + } + parts { + part { name: "separator"; // separator group + description { state: "default" 0.0; +// min: 2 2; +// max: 2 9999; + min: 0 2; // browser customize + max: 0 9999; // browser customize + rel1.offset: 4 4; + rel2.offset: -5 -5; + image { +// normal: "separator_v.png"; + } + fill { + smooth: 0; + } + } + } + } +} + +group { name: "elm/toolbar/object/browser/default"; + parts { + part { name: "elm.swallow.object"; // object group + type: SWALLOW; + description { + state: "default" 0.0; + } + } + } +} + +group { name: "elm/toolbar/base/browser/tabbar"; + images { + image: "browser-view-images/controlbar/I01_tabbar_bg.png" COMP; + } + + parts { + part { name: "base"; + mouse_events: 1; + description { state: "default" 0.0; + image.normal: "browser-view-images/controlbar/I01_tabbar_bg.png"; + } + } + part { name: "clipper"; + type: RECT; + mouse_events: 0; + description { + state: "default" 0.0; + rel1 { + to: "base"; + offset: 2 2; + } + rel2 { + to: "base"; + offset: -3 -3; + } + } + } + part { name: "elm.swallow.content"; + clip_to: "clipper"; + type: SWALLOW; + description { + state: "default" 0.0; + rel1.to: "clipper"; + rel2.to: "clipper"; + } + } + part { name: "event"; + type: RECT; + mouse_events: 1; + repeat_events: 1; + description { state: "default" 0.0; + color: 0 0 0 0; + } + } + } +} + +group { name: "elm/toolbar/item/browser/tabbar"; + alias: "elm/toolbar/item/tabbar/browser/item_horizontal"; + images { + image: "browser-view-images/controlbar/I01_tabbar_focus.png" COMP; + } + + data.item: "transition_animation_on" "1"; + parts { + part { name: "bg"; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + color: 255 255 255 0; + image { + normal: "browser-view-images/controlbar/I01_tabbar_focus.png"; + } + image.middle: SOLID; + fill.smooth: 0; + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + visible: 0; + color: 255 255 255 0; + } + } + part { name: "padding_left_top"; + type: RECT; + scale: 1; + mouse_events: 0; + description { state: "default" 0.0; + align: 0.0 0.0; + rel2.relative: 0.0 0.0; + min: 10 8; + fixed: 1 1; + visible: 1; + color: 0 0 0 0; + } + } + part { name: "padding_right_bottom"; + type: RECT; + scale: 1; + mouse_events: 0; + description { state: "default" 0.0; + align: 1.0 1.0; + rel1.relative: 1.0 1.0; + min: 10 5; + fixed: 1 1; + visible: 1; + color: 0 0 0 0; + } + } + part { + name: "icon_rect"; + type: RECT; + scale: 1; + mouse_events: 0; + description { state: "default" 0.0; + min: 0 0; + fixed: 0 1; + rel1 { + relative: 1.0 1.0; + to: "padding_left_top"; + } + rel2 { + relative: 0.0 1.0; + to_x: "padding_right_bottom"; + to_y: "padding_left_top"; + } + align: 0.5 0.0; + color: 0 0 0 0; + } + description { state: "visible" 0.0; + min: BUTTON_CONTROLBAR_ITEM_BUTTON_ICON_SIZE_INC; + fixed: 0 1; + rel1 { + relative: 1.0 1.0; + to: "padding_left_top"; + } + rel2 { + relative: 0.0 1.0; + to_x: "padding_right_bottom"; + to_y: "padding_left_top"; + } + align: 0.5 0.0; + color: 0 0 0 0; + } + description { state: "icononly" 0.0; + inherit: "default" 0.0; + } + } + part { name: "padding_after_icon"; + type: RECT; + scale: 1; + mouse_events: 0; + description { state: "default" 0.0; //when only icon or no icon is there + align: 0.0 0.0; + rel1 { + relative: 0.0 1.0; + to: "icon_rect"; + } + rel2.to: "icon_rect"; + fixed: 0 1; + min: 0 0; + color: 0 0 0 0; + } + description { state: "visible" 0.0; + align: 0.0 0.0; + rel1 { + relative: 0.0 1.0; + to: "icon_rect"; + } + rel2.to: "icon_rect"; + fixed: 0 1; + min: 0 0; + color: 0 0 0 0; + } + description { state: "icononly" 0.0; + inherit: "default" 0.0; + } + } + part { name: "padding_before_text"; + type: RECT; + scale: 1; + mouse_events: 0; + description { state: "default" 0.0; //when only icon or no icon is there + align: 0.5 1.0; + rel1 { + relative: 1.0 0.0; + to_x: "padding_left_top"; + to_y: "elm.text"; + } + rel2 { + relative: 0.0 0.0; + to_x: "padding_right_bottom"; + to_y: "elm.text"; + } + fixed: 0 1; + min: 0 0; + color: 0 0 0 0; + } + } + part { name: "elm.swallow.icon"; + type: SWALLOW; + scale: 1; + clip_to: "elm.icon.clipper"; + description { state: "default" 0.0; + visible: 0; + align: 0.5 0.0; + rel1 { + relative: 1.0 1.0; + to: "padding_left_top"; + } + rel2 { + relative: 0.0 1.0; + to_x: "padding_right_bottom"; + to_y: "padding_left_top"; + } + fixed: 0 1; + } + description { state: "visible" 0.0; + fixed: 0 1; + min: BUTTON_CONTROLBAR_ITEM_BUTTON_ICON_SIZE_INC; + max: BUTTON_CONTROLBAR_ITEM_BUTTON_ICON_SIZE_INC; + rel1 { + relative: 1.0 1.0; + to: "padding_left_top"; + } + rel2 { + relative: 0.0 0.0; + to_x: "padding_right_bottom"; + to_y: "padding_before_text"; + } + aspect: 1.0 1.0; + aspect_preference: HORIZONTAL; + } + description { state: "icononly" 0.0; + min: BUTTON_CONTROLBAR_ITEM_BUTTON_ICON_SIZE_INC; + max: BUTTON_CONTROLBAR_ITEM_BUTTON_ICON_SIZE_INC; + rel1 { + relative: 1.0 1.0; + to: "padding_left_top"; + } + rel2 { + relative: 0.0 0.0; + to: "padding_right_bottom"; + } + aspect: 1.0 1.0; + aspect_preference: HORIZONTAL; + } + } + part { name: "elm.swallow.icon_new"; + type: SWALLOW; + scale: 1; + clip_to: "elm.icon_new.clipper"; + description { state: "default" 0.0; + visible: 0; + align: 0.5 0.0; + rel1 { + relative: 1.0 1.0; + to: "padding_left_top"; + } + rel2 { + relative: 0.0 1.0; + to_x: "padding_right_bottom"; + to_y: "padding_left_top"; + } + fixed: 0 1; + } + description { state: "visible" 0.0; + fixed: 0 1; + min: BUTTON_CONTROLBAR_ITEM_BUTTON_ICON_SIZE_INC; + max: BUTTON_CONTROLBAR_ITEM_BUTTON_ICON_SIZE_INC; + rel1 { + relative: 1.0 1.0; + to: "padding_left_top"; + } + rel2 { + relative: 0.0 0.0; + to_x: "padding_right_bottom"; + to_y: "padding_before_text"; + } + aspect: 1.0 1.0; + aspect_preference: HORIZONTAL; + } + description { state: "icononly" 0.0; + min: BUTTON_CONTROLBAR_ITEM_BUTTON_ICON_SIZE_INC; + max: BUTTON_CONTROLBAR_ITEM_BUTTON_ICON_SIZE_INC; + rel1 { + relative: 1.0 1.0; + to: "padding_left_top"; + } + rel2 { + relative: 0.0 0.0; + to: "padding_right_bottom"; + } + aspect: 1.0 1.0; + aspect_preference: HORIZONTAL; + } + } + part { name: "elm.text"; + type: TEXTBLOCK; + mouse_events: 0; + scale: 1; + clip_to: "elm.text.clipper"; + description { state: "default" 0.0; + visible: 1; + rel1 { + relative: 1.0 1.0; + to_x: "padding_left_top"; + to_y: "padding_after_icon"; + } + rel2 { + relative: 0.0 0.0; + to: "padding_right_bottom"; + } + color: BUTTON_NAVIFRAME_DEFAULT_TEXT_COLOR_INC; + fixed: 1 1; + text { + style: "toolbar_style"; + min: 0 1; + max: 0 1; + } + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + description { state: "clicked" 0.0; + inherit: "default" 0.0; + visible: 1; + color: BUTTON_NAVIFRAME_FOCUSED_TEXT_COLOR_INC; + } + description { state: "focused" 0.0; + inherit: "default" 0.0; + visible: 1; + color: BUTTON_NAVIFRAME_FOCUSED_TEXT_COLOR_INC; + } + } + part { name: "elm.text_new"; + type: TEXTBLOCK; + mouse_events: 0; + scale: 1; + clip_to: "elm.text_new.clipper"; + description { state: "default" 0.0; + visible: 1; + rel1 { + relative: 1.0 1.0; + to_x: "padding_left_top"; + to_y: "padding_after_icon"; + } + rel2 { + relative: 0.0 0.0; + to: "padding_right_bottom"; + } + color: BUTTON_NAVIFRAME_DEFAULT_TEXT_COLOR_INC; + fixed: 1 1; + text { + style: "toolbar_style"; + min: 0 1; + max: 0 1; + } + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + description { state: "clicked" 0.0; + inherit: "default" 0.0; + visible: 1; + color: BUTTON_NAVIFRAME_FOCUSED_TEXT_COLOR_INC; + } + description { state: "focused" 0.0; + inherit: "default" 0.0; + visible: 1; + color: BUTTON_NAVIFRAME_FOCUSED_TEXT_COLOR_INC; + } + } + part { name: "elm.text.clipper"; + type: RECT; + description { state: "default" 0.0; + color: 255 255 255 255; + } + description { state: "animation" 0.0; + color: 255 255 255 0; + } + description { state: "disabled" 0.0; + color: 255 255 255 153; + } + } + part { name: "elm.text_new.clipper"; + type: RECT; + description { state: "default" 0.0; + color: 255 255 255 0; + } + description { state: "animation" 0.0; + color: 255 255 255 255; + } + } + part { name: "elm.icon.clipper"; + type: RECT; + description { state: "default" 0.0; + color: 255 255 255 255; + } + description { state: "animation" 0.0; + color: 255 255 255 0; + } + description { state: "disabled" 0.0; + color: 255 255 255 153; + } + } + part { name: "elm.icon_new.clipper"; + type: RECT; + description { state: "default" 0.0; + color: 255 255 255 0; + } + description { state: "animation" 0.0; + color: 255 255 255 255; + } + } + part { name: "event"; + type: RECT; + mouse_events: 1; + ignore_flags: ON_HOLD; + description { state: "default" 0.0; + color: 0 0 0 0; + } + } + } + programs { + program { name: "go_active"; + signal: "elm,state,selected"; + source: "elm"; + action: STATE_SET "selected" 0.0; + target: "bg"; + transition: LINEAR 0.2; + } + program { name: "go_passive"; + signal: "elm,state,unselected"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "bg"; + transition: LINEAR 0.1; + }/* + program { name: "pressed"; + signal: "mouse,down,1"; + source: "event"; + action: STATE_SET "selected" 0.0; + target: "bg"; + target: "elm.text"; + target: "elm.text_new"; + transition: LINEAR 0.2; + } + program { name: "unpressed"; + signal: "mouse,up,1"; + source: "event"; + action: STATE_SET "default" 0.0; + target: "bg"; + target: "elm.text"; + target: "elm.text_new"; + transition: LINEAR 0.1; + }*/ + program { name: "go"; + signal: "mouse,up,1"; + source: "event"; + action: SIGNAL_EMIT "elm,action,click" "elm"; + } + program { name: "mouse,in"; + signal: "mouse,in"; + source: "event"; + action: SIGNAL_EMIT "elm,mouse,in" "elm"; + } + program { name: "mouse,out"; + signal: "mouse,out"; + source: "event"; + action: SIGNAL_EMIT "elm,mouse,out" "elm"; + } + program { name: "disable"; + signal: "elm,state,disabled"; + source: "elm"; + action: STATE_SET "disabled" 0.0; + target: "bg"; + after: "disable_text"; + } + program { name: "disable_text"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.text", st, 30, vl); + if (!strcmp(st, "visible")) + { + set_state(PART:"elm.text", "disabled_visible", 0.0); + set_state(PART:"elm.text_new", "disabled_visible", 0.0); + } + else + { + set_state(PART:"elm.text", "disabled", 0.0); + set_state(PART:"elm.text_new", "disabled", 0.0); + } + set_state(PART:"elm.text.clipper", "disabled", 0.0); + set_state(PART:"elm.icon.clipper", "disabled", 0.0); + } + } + program { name: "enable"; + signal: "elm,state,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "bg"; + after: "enable_text"; + } + program { name: "enable_text"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.text", st, 30, vl); + if (!strcmp(st, "disabled_visible")) + { + set_state(PART:"elm.text", "visible", 0.0); + set_state(PART:"elm.text_new", "visible", 0.0); + } + else + { + set_state(PART:"elm.text", "default", 0.0); + set_state(PART:"elm.text_new", "default", 0.0); + } + set_state(PART:"elm.text.clipper", "default", 0.0); + set_state(PART:"elm.icon.clipper", "default", 0.0); + } + } + program { name: "label_set,animation,forward"; + signal: "elm,state,label_set,forward"; + source: "elm"; + after: "label_set,animation"; + } + program { name: "label_set,animation,backward"; + signal: "elm,state,label_set,backward"; + source: "elm"; + after: "label_set,animation"; + } + program { name: "label_set,animation"; + signal: "elm,state,label_set"; + source: "elm"; + action: STATE_SET "animation" 0.0; + target: "elm.text.clipper"; + target: "elm.text_new.clipper"; + transition: LINEAR 0.2; + after: "label_set,animation,done"; + } + program { name: "label_set,animation,done"; + action: SIGNAL_EMIT "elm,state,label_set,done" "elm"; + } + program { name: "label,reset"; + signal: "elm,state,label,reset"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.text.clipper"; + target: "elm.text_new.clipper"; + } + program { name: "icon_set,animation,forward"; + signal: "elm,state,icon_set,forward"; + source: "elm"; + after: "icon_set,animation"; + } + program { name: "icon_set,animation,backward"; + signal: "elm,state,icon_set,backward"; + source: "elm"; + after: "icon_set,animation"; + } + program { name: "icon_set,animation"; + signal: "elm,state,icon_set"; + source: "elm"; + action: STATE_SET "animation" 0.0; + target: "elm.icon.clipper"; + target: "elm.icon_new.clipper"; + transition: LINEAR 0.2; + after: "icon_set,animation,done"; + } + program { name: "icon_set,animation,done"; + action: SIGNAL_EMIT "elm,state,icon_set,done" "elm"; + } + program { name: "icon,reset"; + signal: "elm,state,icon,reset"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.icon.clipper"; + target: "elm.icon_new.clipper"; + } + program { name: "text_show"; + signal: "elm,state,text,visible"; + source: "elm"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.swallow.icon", st, 30, vl); + if (!strcmp(st, "icononly")) + { + set_state(PART:"elm.swallow.icon", "visible", 0.0); + set_state(PART:"icon_rect", "visible", 0.0); + set_state(PART:"padding_after_icon", "visible", 0.0); + } + set_state(PART:"elm.text", "visible", 0.0); + } + } + program { name: "text_hide"; + signal: "elm,state,text,hidden"; + source: "elm"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.swallow.icon", st, 30, vl); + if (!strcmp(st, "visible")) + { + set_state(PART:"elm.swallow.icon", "icononly", 0.0); + set_state(PART:"icon_rect", "icononly", 0.0); + set_state(PART:"padding_after_icon", "icononly", 0.0); + } + set_state(PART:"elm.text", "default", 0.0); + } + } + program { name: "icon_show"; + signal: "elm,state,icon,visible"; + source: "elm"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.text", st, 30, vl); + if (!strcmp(st, "visible")) + { + set_state(PART:"elm.swallow.icon", "visible", 0.0); + set_state(PART:"icon_rect", "visible", 0.0); + set_state(PART:"padding_after_icon", "visible", 0.0); + } + else + { + set_state(PART:"elm.swallow.icon", "icononly", 0.0); + set_state(PART:"icon_rect", "icononly", 0.0); + set_state(PART:"padding_after_icon", "icononly", 0.0); + } + } + } + } +} + +group { name: "elm/toolbar/item/tabbar/browser/item_horizontal"; + inherit: "elm/toolbar/item/browser/tabbar"; + script { + public item_state = ITEM_STATE_ENABLED; + } + parts { + part { name: "icon_rect"; + description { state: "default" 0.0; + fixed: 1 0; + align: 0.0 0.5; + } + description { state: "visible" 0.0; + fixed: 1 0; + rel2 { + relative: 1.0 0.0; + to_x: "padding_left_top"; + to_y: "padding_right_bottom"; + } + align: 0.0 0.5; + } + } + part { name: "padding_after_icon"; + description { state: "default" 0.0; //when only icon or no icon is there + rel1.relative: 1.0 0.0; + fixed: 1 1; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + min: 6 0; + } + } + part { name: "padding_before_text"; + description { state: "default" 0.0; //when only icon or no icon is there + align: 1.0 0.5; + rel1 { + relative: 0.0 1.0; + to_x: "elm.text"; + to_y: "padding_left_top"; + } + rel2 { + to_x: "elm.text"; + to_y: "padding_right_bottom"; + } + fixed: 1 0; + min: 6 0; + } + } + part { name: "elm.swallow.icon"; + description { state: "default" 0.0; + align: 0.0 0.5; + rel2 { + relative: 1.0 0.0; + to_x: "padding_left_top"; + to_y: "padding_right_bottom"; + } + fixed: 1 0; + } + description { state: "visible" 0.0; + fixed: 1 0; + align: 1.0 0.5; + rel1 { + relative: 0.0 1.0; + to_x: "padding_before_text"; + to_y: "padding_left_top"; + } + rel2 { + relative: 0.0 0.0; + to_x: "padding_before_text"; + to_y: "padding_right_bottom"; + } + aspect_preference: VERTICAL; + } + description { state: "icononly" 0.0; + aspect_preference: VERTICAL; + } + } + part { name: "elm.swallow.icon_new"; + description { state: "default" 0.0; + align: 0.0 0.5; + rel2 { + relative: 1.0 0.0; + to_x: "padding_left_top"; + to_y: "padding_right_bottom"; + } + fixed: 1 0; + } + description { state: "visible" 0.0; + fixed: 1 0; + align: 1.0 0.5; + rel1 { + relative: 0.0 1.0; + to_x: "padding_before_text"; + to_y: "padding_left_top"; + } + rel2 { + relative: 0.0 0.0; + to_x: "padding_before_text"; + to_y: "padding_right_bottom"; + } + aspect_preference: VERTICAL; + } + description { state: "icononly" 0.0; + aspect_preference: VERTICAL; + } + } + part { name: "elm.text"; + type: TEXTBLOCK; + description { state: "default" 0.0; + rel1 { + relative: 1.0 1.0; + to_x: "padding_after_icon"; + to_y: "padding_left_top"; + } + text { + style: "toolbar_style"; + min: 1 0; + max: 1 0; + } + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + description { state: "clicked" 0.0; + inherit: "default" 0.0; + visible: 1; + color: BUTTON_NAVIFRAME_FOCUSED_TEXT_COLOR_INC; + } + description { state: "focused" 0.0; + inherit: "default" 0.0; + visible: 1; + color: BUTTON_NAVIFRAME_FOCUSED_TEXT_COLOR_INC; + } + } + part { name: "elm.text_new"; + type: TEXTBLOCK; + description { state: "default" 0.0; + rel1 { + relative: 1.0 1.0; + to_x: "padding_after_icon"; + to_y: "padding_left_top"; + } + text { + style: "toolbar_style"; + min: 1 0; + max: 1 0; + } + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + description { state: "clicked" 0.0; + inherit: "default" 0.0; + visible: 1; + color: BUTTON_NAVIFRAME_FOCUSED_TEXT_COLOR_INC; + } + description { state: "focused" 0.0; + inherit: "default" 0.0; + visible: 1; + color: BUTTON_NAVIFRAME_FOCUSED_TEXT_COLOR_INC; + } + } + } +} + +group { name: "elm/toolbar/base/browser/naviframe"; + parts { + part { name: "base"; + mouse_events: 1; + description { state: "default" 0.0; + color: 0 0 0 0; + } + } + part { name: "clipper"; + type: RECT; + mouse_events: 0; + description { + state: "default" 0.0; + rel1 { + to: "base"; + offset: 2 2; + } + rel2 { + to: "base"; + offset: -3 -3; + } + } + } + part { name: "elm.swallow.content"; + clip_to: "clipper"; + type: SWALLOW; + description { + state: "default" 0.0; + rel1.to: "clipper"; + rel2.to: "clipper"; + } + } + part { name: "event"; + type: RECT; + mouse_events: 1; + repeat_events: 1; + description { state: "default" 0.0; + color: 0 0 0 0; + } + } + } +} + +group { name: "elm/toolbar/object/browser/naviframe"; + parts { + part { name: "elm.swallow.object"; // object group + type: SWALLOW; + description { + state: "default" 0.0; + rel1.offset: 5 0; + rel2.offset: -6 -1; + } + } + } +} + +} diff --git a/edc/browser-view-find-word-layout.edc b/edc/browser-view-find-word-layout.edc new file mode 100755 index 00000000..c3a822d7 --- /dev/null +++ b/edc/browser-view-find-word-layout.edc @@ -0,0 +1,1400 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "browser-macro.edc" + +collections { +//////////////////////////////////////////////////////////////////////////////////////// +// editfield +//////////////////////////////////////////////////////////////////////////////////////// +#define EDITFIELD_TITLE_SIZE_INC 32 +//#define EDITFIELD_DEFAULT_MINH_INC 112 +// Customize - edit field height +#define EDITFIELD_DEFAULT_MINH_INC 72 +//#define EDITFIELD_DEFAULT_TOP1_SINGLE_INC 20 +// Customize - entry top margin +// Strangely - (Edit field entry is aligned to top a little, so make the top margin more then bottom) +#define EDITFIELD_DEFAULT_TOP1_SINGLE_INC 5 +#define EDITFIELD_DEFAULT_TOP1_MULTI_INC 45 +#define EDITFIELD_DEFAULT_TOP2_INC 6 +#define EDITFIELD_DEFAULT_LEFT1_INC 0 +#define EDITFIELD_DEFAULT_LEFT2_INC 0 +#define EDITFIELD_DEFAULT_LEFT3_INC 1 + +//#define EDITFIELD_DEFAULT_RIGHT1_ERASER_SHOW_INC 72 // browser customize +#define EDITFIELD_DEFAULT_RIGHT1_ERASER_SHOW_INC 150 // browser customize + +#define EDITFIELD_DEFAULT_RIGHT2_INC 10 // browser customize +//#define EDITFIELD_DEFAULT_BOTTOM1_SINGLE_INC 20 +// Customize - entry bottom margin +#define EDITFIELD_DEFAULT_BOTTOM1_SINGLE_INC 0 +#define EDITFIELD_DEFAULT_BOTTOM1_MULTI_INC 5 +#define EDITFIELD_DEFAULT_BOTTOM2_SINGLE_INC 32 +#define EDITFIELD_DEFAULT_BOTTOM2_MULTI_INC 6 +#define EDITFIELD_DEFAULT_BOTTOM3_SINGLE_INC 85 +#define EDITFIELD_DEFAULT_BOTTOM3_MULTI_INC 60 +#define EDITFIELD_TITLE_COLOR_INC 168 168 168 255 +#define EDITFIELD_GUIDE_TEXT_COLOR_INC 70 70 70 255 +#define ENTRY_TEXT_SIZE_INC 44 +// Customize - text color +//#define ENTRY_TEXT_COLOR_INC "#FFFFFF" +#define ENTRY_TEXT_COLOR_WHITE_INC "#FFFFFF" +#define ENTRY_TEXT_COLOR_BLACK_INC "#000000" + +#define EDITFIELD_DEFAULT_ERASER_MINW_INC 48 +#define EDITFIELD_DEFAULT_ERASER_MINH_INC 48 + + group { name: "elm/editfield/base/browser/find_word_entry/white-text"; + images { + image: "browser-view-images/url-layout/00_EditField_clear.png" COMP; + } + styles { + style { name: "editfield_content_singleline_white_text_style"; + base: "font=SLP:style=Roman font_size="ENTRY_TEXT_SIZE_INC" color="ENTRY_TEXT_COLOR_WHITE_INC" wrap=mixed ellipsis=1"; + tag: "br" "\n"; + tag: "ps" "ps"; + tag: "tab" "\t"; + tag: "em" "+ font=SLP:style=Oblique"; + tag: "b" "+ font=SLP:style=Bold"; + tag: "link" "+ color=#800 underline=on underline_color=#8008"; + tag: "hilight" "+ font=SLP:style=Bold"; + } + } + script { + public single_line = 0; + public set_single_line() { + set_int(single_line, 1); + } + public no_edit() { + if(get_int(single_line) == 1) { + set_state(PART:"elm.content.single", "no_edit", 0.0); + set_state(PART:"elm.swallow.content", "no_edit", 0.0); + } + else if(get_int(single_line) == 0) { + set_state(PART:"elm.content.single", "default", 0.0); + } + set_state(PART:"over", "default", 0.0); + set_state(PART:"top2", "default", 0.0); + } + } + parts { + part { + name: "base"; + type: RECT; + scale: 1; + ignore_flags: ON_HOLD; + description { + state: "default" 0.0; + min: 0 EDITFIELD_DEFAULT_MINH_INC; + color: 0 0 0 0; + } + } + part { + name: "top1"; + type: RECT; + scale: 1; + ignore_flags: ON_HOLD; + description { + state: "default" 0.0; + visible: 0; + min: 0 EDITFIELD_DEFAULT_TOP1_SINGLE_INC; + fixed: 1 1; + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 0.0; + align: 0.5 0; + } + description { + state: "elm.text.show" 0.0; + inherit: "default" 0.0; + min: 0 EDITFIELD_DEFAULT_TOP1_MULTI_INC; + } + } + part { + name: "top2"; + type: RECT; + scale: 1; + ignore_flags: ON_HOLD; + description { + state: "default" 0.0; + visible: 0; + min: 0 EDITFIELD_DEFAULT_TOP2_INC; + fixed: 1 1; + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 0.0; + align: 0.5 0; + } + description { + state: "edit" 0.0; + inherit: "default" 0.0; + } + } + part { + name: "left1"; + type: RECT; + scale: 1; + ignore_flags: ON_HOLD; + description { + state: "default" 0.0; + visible: 0; + min: EDITFIELD_DEFAULT_LEFT1_INC 0; + fixed: 1 1; + align: 0 0; + rel1.relative : 0.0 0.0; + rel2.relative : 0.0 1.0; + } + } + part { + name: "left2"; + type: RECT; + scale: 1; + ignore_flags: ON_HOLD; + description { + state: "default" 0.0; + visible: 0; + min: EDITFIELD_DEFAULT_LEFT2_INC 0; + fixed: 1 1; + align: 0 0; + rel1.relative : 0.0 0.0; + rel2.relative : 0.0 1.0; + } + } + part { + name: "right1"; + type: RECT; + scale: 1; + ignore_flags: ON_HOLD; + description { + state: "default" 0.0; + visible: 0; + min: EDITFIELD_DEFAULT_RIGHT1_ERASER_SHOW_INC 0; + fixed: 1 1; + align: 1 0; + rel1.relative : 1.0 0.0; + rel2.relative : 1.0 1.0; + } + } + part { + name: "right2"; + type: RECT; + scale: 1; + ignore_flags: ON_HOLD; + description { + state: "default" 0.0; + visible: 0; + min: EDITFIELD_DEFAULT_RIGHT2_INC 0; + fixed: 1 1; + align: 1 0; + rel1.relative : 1.0 0.0; + rel2.relative : 1.0 1.0; + } + } + part { + name: "bottom1"; + type: RECT; + scale: 1; + ignore_flags: ON_HOLD; + description { + state: "default" 0.0; + visible: 0; + min: 0 EDITFIELD_DEFAULT_BOTTOM1_SINGLE_INC; + fixed: 1 1; + align: 0 1; + rel1.relative: 0.0 1.0; + } + description { + state: "elm.text.show" 0.0; + inherit: "default" 0.0; + min: 0 EDITFIELD_DEFAULT_BOTTOM1_MULTI_INC; + } + } + part { + name: "bottom2"; + type: RECT; + scale: 1; + ignore_flags: ON_HOLD; + description { + state: "default" 0.0; + visible: 0; + min: 0 EDITFIELD_DEFAULT_BOTTOM2_SINGLE_INC; + fixed: 0 1; + rel1.relative: 0.0 1.0; + align: 0 1; + } + description { + state: "elm.text.show" 0.0; + inherit: "default" 0.0; + min: 0 EDITFIELD_DEFAULT_BOTTOM2_MULTI_INC; + } + } + part { + name: "bottom3"; + type: RECT; + scale: 1; + ignore_flags: ON_HOLD; + description { + state: "default" 0.0; + visible: 0; + min: 0 EDITFIELD_DEFAULT_BOTTOM3_SINGLE_INC; + fixed: 0 1; + rel1.relative: 0.0 1.0; + align: 0 1; + } + description { + state: "elm.text.show" 0.0; + inherit: "default" 0.0; + min: 0 EDITFIELD_DEFAULT_BOTTOM3_MULTI_INC; + } + } + part { + name: "elm.text"; + type: TEXT; + scale: 1; + ignore_flags: ON_HOLD; + description { + state: "default" 0.0; + visible: 0; + align: 0.0 0.0; + min: 0 34; + fixed: 1 1; + rel1 { + relative: 1.0 1.0; + to_x: "left2"; + to_y: "top2"; + } + rel2 { + relative: 1.0 1.0; + to_x: "left2"; + to_y: "top2"; + } + color: EDITFIELD_TITLE_COLOR_INC; + text { + font: "SLP:style=Medium"; + size: EDITFIELD_TITLE_SIZE_INC; + min: 1 1; + align: 0.0 0.0; + } + } + description { + state: "elm.text.show" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part { + name: "elm.guidetext"; + type: TEXT; + scale: 1; + ignore_flags: ON_HOLD; + description { + state: "default" 0.0; + align: 0.0 0.0; + fixed: 1 1; + rel1.to: "elm.swallow.content"; + rel2.to: "elm.swallow.content"; + color: EDITFIELD_GUIDE_TEXT_COLOR_INC; + text { + font: "SLP:style=Roman"; + size: ENTRY_TEXT_SIZE_INC; + min: 0 0; + align: 0.0 0.5; + } + } + description { + state: "hidden" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + part { + name: "elm.content.single"; + type: TEXTBLOCK; + scale: 1; + ignore_flags: ON_HOLD; + description { + state: "default" 0.0; + visible: 0; + fixed: 1 1; + rel1 { + to: "elm.swallow.content"; + offset: EDITFIELD_DEFAULT_LEFT3_INC 0; + } + rel2.to: "elm.swallow.content"; + text { + style: "editfield_content_singleline_white_text_style"; + min: 0 0; + max: 0 1; + } + } + description { + state: "no_edit" 0.0; + inherit: "default" 0.0; + visible: 1; + } + description { + state: "edit" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + part { + name: "elm.swallow.content"; + type: SWALLOW; + scale: 1; + ignore_flags: ON_HOLD; + description { + state: "default" 0.0; + min: 0 40; + rel1 { + relative : 1.0 1.0; + to_x: "left1"; + to_y: "top1"; + } + rel2 { + relative : 0.0 0.0; + to_x: "right1"; + to_y: "bottom1"; + } + align: 0.0 0.5; + } + description { + state: "no_edit" 0.0; + inherit: "default" 0.0; + visible: 0; + } + description { + state: "edit" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part { + name: "over"; + type: RECT; + scale: 1; + ignore_flags: ON_HOLD; + description { + state: "default" 0.0; + rel1.to: "base"; + rel2.to: "base"; + color: 0 0 0 0; + } + description { + state: "edit" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + part { + name: "eraser_image"; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + min: EDITFIELD_DEFAULT_ERASER_MINW_INC EDITFIELD_DEFAULT_ERASER_MINH_INC; + max: EDITFIELD_DEFAULT_ERASER_MINW_INC EDITFIELD_DEFAULT_ERASER_MINH_INC; // browser customize + fixed: 1 1; + align: 1.0 0.5; // browser customize + rel1 { + relative: 0.0 0.0; + to_x : "right2"; +// to_y : "bottom2"; // browser customize + } + rel2 { + relative: 0.0 1.0; + to_x : "right2"; +// to_y : "bottom2"; // browser customize + } + image { + normal: "browser-view-images/url-layout/00_EditField_clear.png"; + border: 10 10 10 10; + border_scale: 1; + } + } + description { + state: "elm.eraser.show" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part { + name: "eraser"; + mouse_events: 1; + ignore_flags: ON_HOLD; + description { + state: "default" 0.0; + visible: 0; + color: 0 0 0 0; + rel1 { + relative: 0.0 0.0; + to_x : "eraser_image"; + to_y : "bottom3"; + } + } + description { + state: "elm.eraser.show" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + } + programs { + program { + name: "guidetext_show"; + signal: "elm,state,guidetext,visible"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.guidetext"; + } + program { + name: "guidetext_hide"; + signal: "elm,state,guidetext,hidden"; + source: "elm"; + action: STATE_SET "hidden" 0.0; + target: "elm.guidetext"; + } + program { + name: "eraser_show"; + signal: "elm,state,eraser,show"; + source: "elm"; + action: STATE_SET "elm.eraser.show" 0.0; + target: "eraser_image"; + target: "eraser"; + } + program { + name: "eraser_hide"; + signal: "elm,state,eraser,hidden"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "eraser_image"; + target: "eraser"; + } + program { + name: "singleline_set"; + signal: "elm,state,text,singleline"; + source: "elm"; + script { + set_single_line(); + } + } + program { + name: "editing"; + signal: "elm,state,over,hide"; + source: "elm"; + action: STATE_SET "edit" 0.0; + target: "elm.swallow.content"; + target: "elm.content.single"; + target: "over"; + target: "top2"; + } + program { + name: "no_editing"; + signal: "elm,state,over,show"; + source: "elm"; + script { + no_edit(); + } + } + program { + name: "label_show"; + signal: "elm,state,text,visible"; + source: "elm"; + action: STATE_SET "elm.text.show" 0.0; + target: "elm.text"; + target: "top1"; + target: "bottom1"; + target: "bottom2"; + target: "bottom3"; + } + program { + name: "label_hide"; + signal: "elm,state,text,hidden"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.text"; + target: "top1"; + target: "bottom1"; + target: "bottom2"; + target: "bottom3"; + } + program { + name: "entry_show"; + signal: "elm,state,entry,show"; + source: "elm"; + action: STATE_SET "edit" 0.0; + target: "elm.swallow.content"; + } + } + } + + group { name: "elm/editfield/base/browser/find_word_entry/black-text"; + images { + image: "browser-view-images/url-layout/00_EditField_clear.png" COMP; + } + styles { + style { name: "editfield_content_singleline_black_text_style"; + base: "font=SLP:style=Roman font_size="ENTRY_TEXT_SIZE_INC" color="ENTRY_TEXT_COLOR_BLACK_INC" wrap=mixed ellipsis=1"; + tag: "br" "\n"; + tag: "ps" "ps"; + tag: "tab" "\t"; + tag: "em" "+ font=SLP:style=Oblique"; + tag: "b" "+ font=SLP:style=Bold"; + tag: "link" "+ color=#800 underline=on underline_color=#8008"; + tag: "hilight" "+ font=SLP:style=Bold"; + } + } + script { + public single_line = 0; + public set_single_line() { + set_int(single_line, 1); + } + public no_edit() { + if(get_int(single_line) == 1) { + set_state(PART:"elm.content.single", "no_edit", 0.0); + set_state(PART:"elm.swallow.content", "no_edit", 0.0); + } + else if(get_int(single_line) == 0) { + set_state(PART:"elm.content.single", "default", 0.0); + } + set_state(PART:"over", "default", 0.0); + set_state(PART:"top2", "default", 0.0); + } + } + parts { + part { + name: "base"; + type: RECT; + scale: 1; + ignore_flags: ON_HOLD; + description { + state: "default" 0.0; + min: 0 EDITFIELD_DEFAULT_MINH_INC; + color: 0 0 0 0; + } + } + part { + name: "top1"; + type: RECT; + scale: 1; + ignore_flags: ON_HOLD; + description { + state: "default" 0.0; + visible: 0; + min: 0 EDITFIELD_DEFAULT_TOP1_SINGLE_INC; + fixed: 1 1; + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 0.0; + align: 0.5 0; + } + description { + state: "elm.text.show" 0.0; + inherit: "default" 0.0; + min: 0 EDITFIELD_DEFAULT_TOP1_MULTI_INC; + } + } + part { + name: "top2"; + type: RECT; + scale: 1; + ignore_flags: ON_HOLD; + description { + state: "default" 0.0; + visible: 0; + min: 0 EDITFIELD_DEFAULT_TOP2_INC; + fixed: 1 1; + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 0.0; + align: 0.5 0; + } + description { + state: "edit" 0.0; + inherit: "default" 0.0; + } + } + part { + name: "left1"; + type: RECT; + scale: 1; + ignore_flags: ON_HOLD; + description { + state: "default" 0.0; + visible: 0; + min: EDITFIELD_DEFAULT_LEFT1_INC 0; + fixed: 1 1; + align: 0 0; + rel1.relative : 0.0 0.0; + rel2.relative : 0.0 1.0; + } + } + part { + name: "left2"; + type: RECT; + scale: 1; + ignore_flags: ON_HOLD; + description { + state: "default" 0.0; + visible: 0; + min: EDITFIELD_DEFAULT_LEFT2_INC 0; + fixed: 1 1; + align: 0 0; + rel1.relative : 0.0 0.0; + rel2.relative : 0.0 1.0; + } + } + part { + name: "right1"; + type: RECT; + scale: 1; + ignore_flags: ON_HOLD; + description { + state: "default" 0.0; + visible: 0; + min: EDITFIELD_DEFAULT_RIGHT1_ERASER_SHOW_INC 0; + fixed: 1 1; + align: 1 0; + rel1.relative : 1.0 0.0; + rel2.relative : 1.0 1.0; + } + } + part { + name: "right2"; + type: RECT; + scale: 1; + ignore_flags: ON_HOLD; + description { + state: "default" 0.0; + visible: 0; + min: EDITFIELD_DEFAULT_RIGHT2_INC 0; + fixed: 1 1; + align: 1 0; + rel1.relative : 1.0 0.0; + rel2.relative : 1.0 1.0; + } + } + part { + name: "bottom1"; + type: RECT; + scale: 1; + ignore_flags: ON_HOLD; + description { + state: "default" 0.0; + visible: 0; + min: 0 EDITFIELD_DEFAULT_BOTTOM1_SINGLE_INC; + fixed: 1 1; + align: 0 1; + rel1.relative: 0.0 1.0; + } + description { + state: "elm.text.show" 0.0; + inherit: "default" 0.0; + min: 0 EDITFIELD_DEFAULT_BOTTOM1_MULTI_INC; + } + } + part { + name: "bottom2"; + type: RECT; + scale: 1; + ignore_flags: ON_HOLD; + description { + state: "default" 0.0; + visible: 0; + min: 0 EDITFIELD_DEFAULT_BOTTOM2_SINGLE_INC; + fixed: 0 1; + rel1.relative: 0.0 1.0; + align: 0 1; + } + description { + state: "elm.text.show" 0.0; + inherit: "default" 0.0; + min: 0 EDITFIELD_DEFAULT_BOTTOM2_MULTI_INC; + } + } + part { + name: "bottom3"; + type: RECT; + scale: 1; + ignore_flags: ON_HOLD; + description { + state: "default" 0.0; + visible: 0; + min: 0 EDITFIELD_DEFAULT_BOTTOM3_SINGLE_INC; + fixed: 0 1; + rel1.relative: 0.0 1.0; + align: 0 1; + } + description { + state: "elm.text.show" 0.0; + inherit: "default" 0.0; + min: 0 EDITFIELD_DEFAULT_BOTTOM3_MULTI_INC; + } + } + part { + name: "elm.text"; + type: TEXT; + scale: 1; + ignore_flags: ON_HOLD; + description { + state: "default" 0.0; + visible: 0; + align: 0.0 0.0; + min: 0 34; + fixed: 1 1; + rel1 { + relative: 1.0 1.0; + to_x: "left2"; + to_y: "top2"; + } + rel2 { + relative: 1.0 1.0; + to_x: "left2"; + to_y: "top2"; + } + color: EDITFIELD_TITLE_COLOR_INC; + text { + font: "SLP:style=Medium"; + size: EDITFIELD_TITLE_SIZE_INC; + min: 1 1; + align: 0.0 0.0; + } + } + description { + state: "elm.text.show" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part { + name: "elm.guidetext"; + type: TEXT; + scale: 1; + ignore_flags: ON_HOLD; + description { + state: "default" 0.0; + align: 0.0 0.0; + fixed: 1 1; + rel1.to: "elm.swallow.content"; + rel2.to: "elm.swallow.content"; + color: EDITFIELD_GUIDE_TEXT_COLOR_INC; + text { + font: "SLP:style=Roman"; + size: ENTRY_TEXT_SIZE_INC; + min: 0 0; + align: 0.0 0.5; + } + } + description { + state: "hidden" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + part { + name: "elm.content.single"; + type: TEXTBLOCK; + scale: 1; + ignore_flags: ON_HOLD; + description { + state: "default" 0.0; + visible: 0; + fixed: 1 1; + rel1 { + to: "elm.swallow.content"; + offset: EDITFIELD_DEFAULT_LEFT3_INC 0; + } + rel2.to: "elm.swallow.content"; + text { + style: "editfield_content_singleline_black_text_style"; + min: 0 0; + max: 0 1; + } + } + description { + state: "no_edit" 0.0; + inherit: "default" 0.0; + visible: 1; + } + description { + state: "edit" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + part { + name: "elm.swallow.content"; + type: SWALLOW; + scale: 1; + ignore_flags: ON_HOLD; + description { + state: "default" 0.0; + min: 0 40; + rel1 { + relative : 1.0 1.0; + to_x: "left1"; + to_y: "top1"; + } + rel2 { + relative : 0.0 0.0; + to_x: "right1"; + to_y: "bottom1"; + } + align: 0.0 0.5; + } + description { + state: "no_edit" 0.0; + inherit: "default" 0.0; + visible: 0; + } + description { + state: "edit" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part { + name: "over"; + type: RECT; + scale: 1; + ignore_flags: ON_HOLD; + description { + state: "default" 0.0; + rel1.to: "base"; + rel2.to: "base"; + color: 0 0 0 0; + } + description { + state: "edit" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + part { + name: "eraser_image"; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + min: EDITFIELD_DEFAULT_ERASER_MINW_INC EDITFIELD_DEFAULT_ERASER_MINH_INC; + max: EDITFIELD_DEFAULT_ERASER_MINW_INC EDITFIELD_DEFAULT_ERASER_MINH_INC; // browser customize + fixed: 1 1; + align: 1.0 0.5; // browser customize + rel1 { + relative: 0.0 0.0; + to_x : "right2"; + // to_y : "bottom2"; // browser customize + } + rel2 { + relative: 0.0 1.0; + to_x : "right2"; + // to_y : "bottom2"; // browser customize + } + image { + normal: "browser-view-images/url-layout/00_EditField_clear.png"; + border: 10 10 10 10; + border_scale: 1; + } + } + description { + state: "elm.eraser.show" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part { + name: "eraser"; + mouse_events: 1; + ignore_flags: ON_HOLD; + description { + state: "default" 0.0; + visible: 0; + color: 0 0 0 0; + rel1 { + relative: 0.0 0.0; + to_x : "eraser_image"; + to_y : "bottom3"; + } + } + description { + state: "elm.eraser.show" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + } + programs { + program { + name: "guidetext_show"; + signal: "elm,state,guidetext,visible"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.guidetext"; + } + program { + name: "guidetext_hide"; + signal: "elm,state,guidetext,hidden"; + source: "elm"; + action: STATE_SET "hidden" 0.0; + target: "elm.guidetext"; + } + program { + name: "eraser_show"; + signal: "elm,state,eraser,show"; + source: "elm"; + action: STATE_SET "elm.eraser.show" 0.0; + target: "eraser_image"; + target: "eraser"; + } + program { + name: "eraser_hide"; + signal: "elm,state,eraser,hidden"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "eraser_image"; + target: "eraser"; + } + program { + name: "singleline_set"; + signal: "elm,state,text,singleline"; + source: "elm"; + script { + set_single_line(); + } + } + program { + name: "editing"; + signal: "elm,state,over,hide"; + source: "elm"; + action: STATE_SET "edit" 0.0; + target: "elm.swallow.content"; + target: "elm.content.single"; + target: "over"; + target: "top2"; + } + program { + name: "no_editing"; + signal: "elm,state,over,show"; + source: "elm"; + script { + no_edit(); + } + } + program { + name: "label_show"; + signal: "elm,state,text,visible"; + source: "elm"; + action: STATE_SET "elm.text.show" 0.0; + target: "elm.text"; + target: "top1"; + target: "bottom1"; + target: "bottom2"; + target: "bottom3"; + } + program { + name: "label_hide"; + signal: "elm,state,text,hidden"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.text"; + target: "top1"; + target: "bottom1"; + target: "bottom2"; + target: "bottom3"; + } + program { + name: "entry_show"; + signal: "elm,state,entry,show"; + source: "elm"; + action: STATE_SET "edit" 0.0; + target: "elm.swallow.content"; + } + } + } + +//////////////////////////////////////////////////////////////////////////////////////// +// url layout +//////////////////////////////////////////////////////////////////////////////////////// + group { + name: "browser-view/find_word_layout"; + images { + image: "browser-view-images/url-layout/naviframe_optionheader.png" COMP; + } + parts { + part { name: "backgournd"; + mouse_events: 1; + repeat_events: 0; + type: IMAGE; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + min: 0 150; + fixed: 0 1; + align: 0.0 0.0; + rel1 { relative: 0.0 0.0; } + rel2 { relative: 1.0 1.0; } + image { + normal: "browser-view-images/url-layout/naviframe_optionheader.png"; + border: 1 1 2 1; + border_scale: 1; + } + } + } + part { name: "bg"; + mouse_events: 1; + repeat_events: 0; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + min: 0 106; + align: 0.0 0.0; + rel1 { relative: 0.0 1.0; to: "title_text"; } + rel2 { relative: 1.0 1.0; } + color: 255 255 255 255; // white + } + } + part { + name: "navigationbar_bg"; + type: IMAGE; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; + align: 0.0 0.0; + rel1 { relative: 0.0 0.0; to: bg; } + rel2 { relative: 1.0 1.0; to: bg; } + image { + normal: "browser-view-images/url-layout/naviframe_optionheader.png"; + border: 1 1 2 1; + border_scale: 1; + } + } + } + part { + name: "title_text"; + type: TEXT; + scale: 1; + mouse_events: 0; + description { + state: "default" 0.0; + visible: 1; + fixed: 0 1; + min: 0 44; + align: 0.5 0.0; + rel1 {relative: 0.0 0.0;} + rel2 {relative: 1.0 0.0;} + text { font: FONT_ROM; + size: 34; + min: 0 0; + align: 0.5 1.0; + } + color: 255 255 255 255; + } + } + part { name: "padding,url,top"; + mouse_events: 0; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + min: 0 16; + fixed: 0 1; + align: 0.5 0.0; + rel1 { relative: 0.0 0.0; to: "bg"; } + rel2 { relative: 1.0 0.0; to: "bg"; } + } + } + part { name: "padding,url,left"; + mouse_events: 0; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + min: 16 0; + fixed: 1 0; + align: 0.0 0.5; + rel1 { relative: 0.0 0.0; to: "bg"; } + rel2 { relative: 0.0 1.0; to: "bg"; } + } + } + part { name: "padding,url,right"; + mouse_events: 0; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + min: 10 0; + fixed: 1 0; + align: 1.0 0.5; + rel1 { relative: 0.0 0.0; to: "elm.swallow.find_word_prev"; } + rel2 { relative: 0.0 1.0; to: "elm.swallow.find_word_prev"; } + } + } + part { + name: "elm.swallow.url"; + type: SWALLOW; + mouse_events: 1; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + min: 0 74; + fixed: 0 1; + align: 0.0 0.0; + rel1 { relative: 1.0 1.0; to_x: "padding,url,left"; to_y: "padding,url,top"; } + rel2 { relative: 0.0 1.0; to_x: "padding,url,right"; to_y: "padding,url,top"; } + } + } + part { name: "padding,index_text,right"; + mouse_events: 0; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + min: 60 0; + fixed: 1 0; + align: 1.0 0.5; + rel1 { relative: 1.0 0.0; to: "elm.swallow.url"; } + rel2 { relative: 1.0 1.0; to: "elm.swallow.url"; } + } + } + part { + name: "elm.index_text"; + type: TEXT; + scale: 1; + ignore_flags: ON_HOLD; + description { + state: "default" 0.0; + visible: 1; + min: 100 0; + fixed: 1 1; + align: 1.0 0.5; + rel1 { relative: 0.0 0.0; to_x: "padding,index_text,right"; to_y: "elm.swallow.url"; } + rel2 { relative: 0.0 1.0; to_x: "padding,index_text,right"; to_y: "elm.swallow.url"; } + color: 120 120 120 255; + text { + font: "SLP:style=Roman"; + size: 38; + min: 0 0; + align: 1.0 0.5; + } + } + } + part { + name: "elm.swallow.find_word_prev"; + type: SWALLOW; + mouse_events: 1; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + min: 74 74; + max: 74 74; + fixed: 1 1; + align: 1.0 0.5; + rel1 { relative: 0.0 0.0; to_x: "padding,find_word_next,left"; to_y: "navigationbar_bg"; } + rel2 { relative: 0.0 1.0; to_x: "padding,find_word_next,left"; to_y: "navigationbar_bg"; } + } + } + part { name: "padding,find_word_next,left"; + mouse_events: 0; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + min: 10 0; + fixed: 1 0; + align: 1.0 0.5; + rel1 { relative: 0.0 0.0; to_x: "elm.swallow.find_word_next"; to_y: "navigationbar_bg"; } + rel2 { relative: 0.0 1.0; to_x: "elm.swallow.find_word_next"; to_y: "navigationbar_bg"; } + } + } + part { + name: "elm.swallow.find_word_next"; + type: SWALLOW; + mouse_events: 1; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + min: 74 74; + max: 74 74; + fixed: 1 1; + align: 1.0 0.5; + rel1 { relative: 0.0 0.0; to_x: "padding,cancel,left"; to_y: "navigationbar_bg"; } + rel2 { relative: 0.0 1.0; to_x: "padding,cancel,left"; to_y: "navigationbar_bg"; } + } + } + part { name: "padding,cancel,left"; + mouse_events: 0; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + min: 10 0; + fixed: 1 0; + align: 1.0 0.5; + rel1 { relative: 0.0 0.0; to_x: "elm.swallow.cancel"; to_y: "navigationbar_bg"; } + rel2 { relative: 0.0 1.0; to_x: "elm.swallow.cancel"; to_y: "navigationbar_bg"; } + } + } + part { name: "padding,cancel,right"; + mouse_events: 0; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + min: 16 0; + fixed: 1 0; + align: 1.0 0.5; + rel1 { relative: 1.0 0.0; to: "navigationbar_bg"; } + rel2 { relative: 1.0 1.0; to: "navigationbar_bg"; } + } + } + part { + name: "elm.swallow.cancel"; + type: SWALLOW; + mouse_events: 1; + repeat_events: 0; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + min: 134 72; + max: 134 72; + fixed: 1 1; + align: 1.0 0.5; + rel1 { relative: 0.0 0.0; to_x: "padding,cancel,right"; to_y: "navigationbar_bg"; } + rel2 { relative: 0.0 1.0; to_x: "padding,cancel,right"; to_y: "navigationbar_bg"; } + } + } + } + } + + group { + name: "browser-view/find_word_editfield_layout"; + images { + image: "browser-view-images/url-layout/00_search_input_field_bg.png" COMP; + image: "browser-view-images/url-layout/00_search_input_field_bg_black.png" COMP; + image: "browser-view-images/url-layout/I01_icon_find_word.png" COMP; + } + + parts { + part { name: "bg"; + mouse_events: 0; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + fixed: 0 1; + rel1 { relative: 0.0 0.0; } + rel2 { relative: 1.0 1.0; } + color: 0 0 0 0; + } + } + part { + name: "bg_image"; + type: IMAGE; + scale: 1; + mouse_events: 0; + description { + state: "default" 0.0; + fixed: 0 1; + rel1 {relative: 0.0 0.0; } + rel2 {relative: 1.0 1.0; } + image.normal: "browser-view-images/url-layout/00_search_input_field_bg.png"; + image.border: 5 5 5 5; + } + description { + state: "black" 0.0; + inherit: "default" 0.0; + image.normal: "browser-view-images/url-layout/00_search_input_field_bg_black.png"; + image.border: 5 5 5 5; + } + } + part { name: "padding,find_word_image,left"; + mouse_events: 0; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + min: 16 0; + fixed: 1 0; + align: 0.0 0.5; + rel1 { relative: 0.0 0.0; to: "bg_image"; } + rel2 { relative: 0.0 1.0; to: "bg_image"; } + } + } + part { name: "elm.image.find_word"; + mouse_events: 0; + type: IMAGE; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + min: 42 42; + max: 42 42; + fixed: 1 1; + align: 0.0 0.5; + rel1 { relative: 1.0 0.0; to_x: "padding,find_word_image,left"; to_y: bg; } + rel2 { relative: 1.0 1.0; to_x: "padding,find_word_image,left"; to_y: bg; } + image.normal: "browser-view-images/url-layout/I01_icon_find_word.png"; + } + } + part { name: "padding,find_word_image,right"; + mouse_events: 0; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + min: 16 0; + fixed: 1 0; + align: 0.0 0.5; + rel1 { relative: 1.0 0.0; to_x: "elm.image.find_word"; to_y: bg; } + rel2 { relative: 1.0 1.0; to_x: "elm.image.find_word"; to_y: bg; } + } + } + part { name: "elm.swallow.entry"; + mouse_events: 1; + type: SWALLOW; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + align: 0.0 0.5; + rel1 { relative: 1.0 0.0; to_x: "padding,find_word_image,right"; to_y: bg; } + rel2 { relative: 1.0 1.0; to_x: "bg_image"; to_y: bg; } + } + } + } + programs { + program { name: "black_theme"; + signal: "black_theme,signal"; + action: STATE_SET "black" 0.0; + target: "bg_image"; + } + } + } +} diff --git a/edc/browser-view-main.edc b/edc/browser-view-main.edc new file mode 100755 index 00000000..43911526 --- /dev/null +++ b/edc/browser-view-main.edc @@ -0,0 +1,706 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* color define */ +#define BROWSER_COLOR_WHITE 255 255 255 255 + +/* image define */ +// grey bg color +#define BROWSER_IMAGE_CONTENT_BG "browser-view-images/41_browser_new_win_bg.png" + +#define BROWSER_WAITING_PROGRESS_SIZE 90 90 +#define BROWSER_FLOATING_BACKWARD_BUTTON_SIZE 120 124 +#define BROWSER_CONTROL_BAR_HEIGHT 114 + +collections { + group { + name: "browser/browser-view-main"; + images { + image: BROWSER_IMAGE_CONTENT_BG COMP; + } + parts { + part { name: "bg"; + mouse_events: 0; + scale: 1; + type: RECT; + description { + state: "default" 0.0; + visible: 1; + align: 0.0 0.0; + rel1 { relative: 0.0 0.0; } + rel2 { relative: 1.0 1.0; } + color: BROWSER_COLOR_WHITE; + } + } + part { + name: "contents_bg"; + type: IMAGE; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + align: 0.0 0.0; + rel1 { relative: 0.0 0.0; to: "bg"; } + rel2 { relative: 1.0 1.0; to: "bg"; } + image.normal: BROWSER_IMAGE_CONTENT_BG; + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part { + name: "elm.swallow.content"; + type: SWALLOW; + mouse_events: 1; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + align: 0.0 0.0; + rel1 { relative: 0.0 0.0; to: "contents_bg"; } + rel2 { relative: 1.0 0.0; to: "elm.swallow.control_bar"; } + } + } + part { + name: "elm.swallow.scissorbox"; + type: SWALLOW; + mouse_events: 1; + repeat_events: 0; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + align: 0.0 0.0; + rel1 { relative: 0.0 0.0; to: "elm.swallow.content"; } + rel2 { relative: 1.0 1.0; to: "elm.swallow.content"; } + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + /* ifdef ZOOM_BUTTON */ + part { + name: "elm.swallow.zoom_out_button"; + type: SWALLOW; + mouse_events: 1; + repeat_events: 0; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + min: 56 56; + max: 56 56; + fixed: 1 1; + align: 1.0 1.0; + rel1 { relative: 0.4 -0.5; to_y: "elm.swallow.control_bar"; } + rel2 { relative: 0.4 -0.5; to_y: "elm.swallow.control_bar"; } + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part { + name: "elm.swallow.zoom_in_button"; + type: SWALLOW; + mouse_events: 1; + repeat_events: 0; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + min: 56 56; + max: 56 56; + fixed: 1 1; + align: 0.0 1.0; + rel1 { relative: 0.6 -0.5; to_y: "elm.swallow.control_bar"; } + rel2 { relative: 0.6 -0.5; to_y: "elm.swallow.control_bar"; } + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + /* endif ZOOM_BUTTON */ + part { + name: "padding,url_layout"; // padding + type: RECT; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + min: 0 150; + fixed: 0 1; + align: 0.0 0.0; + rel1 { relative: 0.0 0.0; to: "contents_bg"; } + rel2 { relative: 1.0 0.0; to: "contents_bg"; } + color: 0 0 0 0; + } + } + part { + name: "elm.swallow.waiting_progress"; + type: SWALLOW; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + align: 0.5 0.5; + min: BROWSER_WAITING_PROGRESS_SIZE; + max: BROWSER_WAITING_PROGRESS_SIZE; + rel1 { relative: 0.0 0.0; to_x: contents_bg; to_y: "padding,url_layout"; } + rel2 { relative: 1.0 1.0; to: contents_bg; } + } + description { + state: "unvisible" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + part { + name: "most_visited_sites_bg"; + type: RECT; + mouse_events: 1; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + align: 0.0 0.0; + rel1 { relative: 0.0 0.0; to: "elm.swallow.most_visited_sites"; } + rel2 { relative: 1.0 1.0; to: "elm.swallow.most_visited_sites"; } + color: 255 255 255 255; + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part { + name: "padding,most_visited_sites_bottom"; + type: RECT; + mouse_events: 1; + repeat_events: 0; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + min: 0 BROWSER_CONTROL_BAR_HEIGHT; + align: 0.5 1.0; + rel1 { relative: 0.0 1.0; } + rel2 { relative: 1.0 1.0; } + } + } + part { + name: "elm.swallow.most_visited_sites"; + type: SWALLOW; + mouse_events: 1; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + align: 0.0 0.0; + rel1 { relative: 0.0 0.0; to: "elm.rect.content_dim"; } + rel2 { relative: 1.0 0.0; to: "padding,most_visited_sites_bottom"; } + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part { + name: "elm.rect.content_dim"; + type: RECT; + mouse_events: 1; + repeat_events: 0; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + align: 0.0 0.0; + rel1 { relative: 0.0 1.0; to_y: "padding,url_layout"; } + rel2 { relative: 1.0 1.0; } + color: 20 20 20 170; + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part { + name: "elm.swallow.most_visited"; + type: SWALLOW; + mouse_events: 1; + repeat_events: 0; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + align: 0.0 0.0; + rel1 { relative: 0.0 0.0; to: "elm.rect.content_dim"; } + rel2 { relative: 1.0 0.0; to: "elm.rect.content_dim"; } + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part { + name: "elm.swallow.control_bar"; + type: SWALLOW; + mouse_events: 1; + repeat_events: 0; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + min: 0 BROWSER_CONTROL_BAR_HEIGHT; + fixed: 0 1; + align: 0.5 1.0; + rel1 { relative: 0.0 1.0; } + rel2 { relative: 1.0 1.0; } + } + description { + state: "invisible" 0.0; + inherit: "default" 0.0; + align: 0.5 0.0; + rel1 { relative: 0.0 1.0; } + rel2 { relative: 1.0 1.0; } + } + } + part { + name: "elm.swallow.multi_window"; + type: SWALLOW; + mouse_events: 1; + repeat_events: 0; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + align: 0.0 0.0; + rel1 { relative: 0.0 0.0; to: "contents_bg"; } + rel2 { relative: 1.0 1.0; to: "contents_bg"; } + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + /* For change effect. */ + part { name: "rect.reader_layout"; + type: RECT; + mouse_events: 0; + repeat_events: 0; + scale: 1; + description { + state: "default" 0.0; + color: 255 255 255 0; + rel1 { relative: 0.0 0.0; to: "elm.swallow.reader"; } + rel2 { relative: 1.0 1.0; to: "elm.swallow.reader"; } + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + color: 255 255 255 255; + } + } + part { + name: "elm.swallow.reader"; + type: SWALLOW; + mouse_events: 1; + repeat_events: 0; + scale: 1; + /* For change effect. */ + clip_to: "rect.reader_layout"; + description { + state: "default" 0.0; + visible: 0; + align: 0.0 0.0; + rel1 { relative: 0.0 0.0; to: "contents_bg"; } + rel2 { relative: 1.0 1.0; to: "contents_bg"; } + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part { name: "elm.swallow.predictive_history"; + mouse_events: 1; + type: SWALLOW; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + rel1 { relative: 0.0 0.0; to: "elm.swallow.most_visited"; } + rel2 { relative: 1.0 1.0; } + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part { + /* In case of my sites guide text, dim the background of screen. */ + name: "elm.rect.screen_dim"; + type: RECT; + mouse_events: 1; + repeat_events: 0; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + align: 0.0 0.0; + rel1 { relative: 0.0 0.0; to: "elm.swallow.multi_window"; } + rel2 { relative: 1.0 1.0; to: "elm.swallow.multi_window"; } + color: 20 20 20 170; + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part { + name: "elm.swallow.mysites_guide"; + type: SWALLOW; + mouse_events: 1; + repeat_events: 0; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + min: 660 375; + max: 660 600; + fixed: 1 0; + align: 0.5 0.6; + rel1 { relative: 0.0 0.0; to: "elm.rect.screen_dim"; } + rel2 { relative: 1.0 1.0; to: "elm.rect.screen_dim"; } + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + } + programs { + ///////////////////////////// + // show / hide scissor box + ///////////////////////////// + program { name: "show,scissorbox"; + signal: "show,scissorbox,signal"; + action: STATE_SET "visible" 0.0; + target: "elm.swallow.scissorbox"; + } + program { name: "hide,scissorbox"; + signal: "hide,scissorbox,signal"; + action: STATE_SET "default" 0.0; + target: "elm.swallow.scissorbox"; + } + + /* ifdef ZOOM_BUTTON */ + ///////////////////////////// + // show / hide zoom buttons + ///////////////////////////// + program { name: "show,zoom_buttons"; + signal: "show,zoom_buttons,signal"; + action: STATE_SET "visible" 0.0; + target: "elm.swallow.zoom_out_button"; + target: "elm.swallow.zoom_in_button"; + } + program { name: "hide,zoom_buttons"; + signal: "hide,zoom_buttons,signal"; + action: STATE_SET "default" 0.0; + target: "elm.swallow.zoom_out_button"; + target: "elm.swallow.zoom_in_button"; + } + /* endif ZOOM_BUTTON */ + + ///////////////////////////// + // show / hide reader + ///////////////////////////// + program { name: "show,reader"; + signal: "show,reader,signal"; + action: STATE_SET "visible" 0.0; + target: "elm.swallow.reader"; + } + program { name: "show,reader,clipper"; + signal: "show,reader,signal"; + transition: ACCELERATE 0.5; + action: STATE_SET "visible" 0.0; + target: "rect.reader_layout"; + } + program { name: "hide,reader"; + signal: "hide,reader,signal"; + action: STATE_SET "default" 0.0; + target: "elm.swallow.reader"; + target: "rect.reader_layout"; + } + + ///////////////////////////// + // show / hide most visited sites + ///////////////////////////// + program { name: "show,most_visited_sites"; + signal: "show,most_visited_sites,signal"; + action: STATE_SET "visible" 0.0; + target: "elm.swallow.most_visited_sites"; + target: "most_visited_sites_bg"; + } + program { name: "hide,most_visited_sites"; + signal: "hide,most_visited_sites,signal"; + action: STATE_SET "default" 0.0; + target: "elm.swallow.most_visited_sites"; + target: "most_visited_sites_bg"; + } + + ///////////////////////////////////// + // show / hide most visited sites guide text + ///////////////////////////////////// + program { name: "show,most_visited_sites_guide_text"; + signal: "show,most_visited_sites_guide_text,signal"; + action: STATE_SET "visible" 0.0; + target: "elm.rect.screen_dim"; + target: "elm.swallow.mysites_guide"; + } + program { name: "hide,most_visited_sites_guide_text"; + signal: "hide,most_visited_sites_guide_text,signal"; + action: STATE_SET "default" 0.0; + target: "elm.rect.screen_dim"; + target: "elm.swallow.mysites_guide"; + } + + ///////////////////////////// + // url edit mode on/off + ///////////////////////////// + program { name: "edit,url,on"; + signal: "edit,url,on,signal"; + action: STATE_SET "visible" 0.0; + target: "elm.rect.content_dim"; + after: "show,most_visited"; + } + program { name: "edit,url,off"; + signal: "edit,url,off,signal"; + action: STATE_SET "default" 0.0; + target: "elm.rect.content_dim"; + after: "hide,most_visited"; + } + + ///////////////////////////// + // show / hide background dim + ///////////////////////////// + program { name: "dim,bg"; + signal: "dim,bg,signal"; + action: STATE_SET "visible" 0.0; + target: "elm.rect.content_dim"; + } + program { name: "undim,bg"; + signal: "undim,bg,signal"; + action: STATE_SET "default" 0.0; + target: "elm.rect.content_dim"; + } + + //////////////////////////////////// + // show / hide most visited swallow + //////////////////////////////////// + program { name: "show,most_visited"; + signal: "show,most_visited,signal"; + action: STATE_SET "visible" 0.0; + target: "elm.swallow.most_visited"; + } + program { name: "hide,most_visited"; + signal: "hide,most_visited,signal"; + action: STATE_SET "default" 0.0; + target: "elm.swallow.most_visited"; + } + + //////////////////////////////////// + // show / hide multiwindow swallow + //////////////////////////////////// + program { name: "show,multi_window"; + signal: "show,multi_window,signal"; + action: STATE_SET "visible" 0.0; + target: "elm.swallow.multi_window"; + } + program { name: "hide,multi_window"; + signal: "hide,multi_window,signal"; + action: STATE_SET "default" 0.0; + target: "elm.swallow.multi_window"; + } + + ///////////////////////////// + // control bar show / hide + ///////////////////////////// + program { name: "show,control_bar"; + signal: "show,control_bar,signal"; + transition: LINEAR 0.2; + action: STATE_SET "default" 0.0; + target: "elm.swallow.control_bar"; + } + program { name: "hide,control_bar"; + signal: "hide,control_bar,signal"; + transition: LINEAR 0.2; + action: STATE_SET "invisible" 0.0; + target: "elm.swallow.control_bar"; + } + program { name: "hide,control_bar,no_animation"; + signal: "hide,control_bar,no_animation,signal"; + action: STATE_SET "invisible" 0.0; + target: "elm.swallow.control_bar"; + } + program { name: "show,control_bar,no_animation"; + signal: "show,control_bar,no_animation,signal"; + action: STATE_SET "default" 0.0; + target: "elm.swallow.control_bar"; + } + ///////////////////////////////////////////////////// + // hide waiting progress bar / show grey background + ///////////////////////////////////////////////////// + program { name: "hide,waiting_progressbar"; + signal: "hide,waiting_progressbar,signal"; + action: STATE_SET "unvisible" 0.0; + target: "elm.swallow.waiting_progress"; + } + program { name: "show,grey_background"; + signal: "show,grey_background,signal"; + action: STATE_SET "visible" 0.0; + target: "contents_bg"; + } + program { name: "hide,grey_background"; + signal: "hide,grey_background,signal"; + action: STATE_SET "default" 0.0; + target: "contents_bg"; + } + + //////////////////////////////////// + // show / hide predictive history + //////////////////////////////////// + program { name: "hide,predictive_history"; + signal: "hide,predictive_history,signal"; + action: STATE_SET "default" 0.0; + target: "elm.swallow.predictive_history"; + } + program { name: "show,predictive_history"; + signal: "show,predictive_history,signal"; + action: STATE_SET "visible" 0.0; + target: "elm.swallow.predictive_history"; + } + } + } + + group { + name: "browser/browser-view-webview"; + parts { + part { name: "bg"; + mouse_events: 0; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + align: 0.0 0.0; + rel1 { relative: 0.0 0.0; } + /* The height of url bar layout is 65. */ + /* The webview size is content height + 65. */ + rel2 { relative: 1.0 1.0; } + color: 0 0 0 0; + } + } + part { + name: "elm.swallow.webview"; + type: SWALLOW; + mouse_events: 1; + repeat_events: 0; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + align: 0.0 0.0; + rel1 { relative: 0.0 0.0; to: "bg"; } + rel2 { relative: 1.0 1.0; to: "bg"; } + } + } + } + } + + group { name: "brightness_popup"; + parts{ + part { name: "elm.title"; + type: TEXT; + scale : 1; + description { state: "default" 0.0; +#ifdef WVGA_NBEAT // 480 * 800 + max: 80 16; +#else + max: 120 24; +#endif + text { + font: "SLP:style=Medium"; +#ifdef WVGA_NBEAT // 480 * 800 + size: 16; +#else + size: 24; +#endif + min: 0 0; + align: 0.5 0.0; + } + color: 108 108 108 255; + align: 0.5 0.0; + rel1 { + relative: 0.0 0.0; + to: "elm.swallow.content"; + } + rel2 { + relative: 1.0 0.0; + to: "elm.swallow.content"; + } + } + } + part{ name:"elm.swallow.content"; + type: SWALLOW; + scale : 1; + description { state: "default" 0.0; +#ifdef WVGA_NBEAT // 480 * 800 + min: 0 70; +#else + min: 0 105; +#endif + align: 0.5 0.5; + fixed: 1 0; + rel1 { + relative: 0.0 0.0; + } + rel2 { + relative: 1.0 1.0; + } + } + } + } + } +} diff --git a/edc/browser-view-progressbar.edc b/edc/browser-view-progressbar.edc new file mode 100755 index 00000000..7d7d7871 --- /dev/null +++ b/edc/browser-view-progressbar.edc @@ -0,0 +1,604 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "browser-macro.edc" + +collections { + group { name: "elm/progressbar/horizontal/browser/loading"; + images { + image: "browser-view-images/progressbar/00_search_input_field_bg_progress.png" COMP; + image: "browser-view-images/progressbar/progressbar.png" COMP; + } + parts { + part { name: "elm.padding.left"; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + min: 0 0; + fixed: 1 0; + rel1 { + relative: 0.0 0.0; + offset: 0 0; + } + rel2 { + relative: 0.0 1.0; + offset: 0 0; + } + color: 0 0 0 0; + align: 0.0 0.0; + } + } + part { name: "elm.padding.right"; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + min: 0 0; + fixed: 1 0; + rel1 { + relative: 1.0 0.0; + offset: 0 0; + } + rel2 { + relative: 1.0 1.0; + offset: 0 0; + } + color: 0 0 0 0; + align: 1.0 0.0; + } + } + part { name: "elm.background.progressbar"; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; + rel1 { + to_x: "elm.padding.left"; + relative: 1.0 0.0; + offset: 0 0; + } + rel2 { + to_x: "elm.padding.right"; + relative: 0.0 1.0; + offset: -1 -1; + } + } + } + part { name: "elm.swallow.bar"; + mouse_events: 0; + scale: 1; + type: SWALLOW; + description { + min: 48 0; + fixed: 1 0; + state: "default" 0.0; + rel1 { + to: "elm.background.progressbar"; + relative: 0.0 0.0; + } + rel2 { + to: "elm.background.progressbar"; + relative: 1.0 1.0; + } + } + } + part { name: "elm.swallow.content"; + type: SWALLOW; + scale: 1; + description { state: "default" 0.0; + visible: 0; + align: 0.0 0.5; + rel1 { + offset: 0 0; + to_y: "elm.background.progressbar"; + } + rel2 { + offset: 0 -1; + relative: 0.0 1.0; + to_y: "elm.background.progressbar"; + } + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + aspect: 1.0 1.0; + aspect_preference: VERTICAL; +#ifdef WVGA_NBEAT // 480 * 800 + rel2.offset: 4 -1; +#else + rel2.offset: 6 -1; +#endif + } + } + part { name: "elm.text"; + type: TEXT; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + visible: 0; + fixed: 1 1; + align: 0.0 0.5; + rel1.to_x: "elm.swallow.content"; + rel1.relative: 1.0 0.0; +#ifdef WVGA_NBEAT // 480 * 800 + rel1.offset: -1 4; +#else + rel1.offset: -1 6; +#endif + rel2.to_x: "elm.swallow.content"; + rel2.relative: 1.0 1.0; + rel2.offset: -1 -5; + color: 0 0 0 255; + text { + font: "SLP:style=Medium"; +#ifdef WVGA_NBEAT // 480 * 800 + size: 10; +#else + size: 15; +#endif + min: 0 0; + align: 0.0 0.5; + } + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 0; + text.min: 1 1; +#ifdef WVGA_NBEAT // 480 * 800 + rel1.offset: 0 4; + rel2.offset: 0 -5; +#else + rel1.offset: 0 6; + rel2.offset: 0 -7; +#endif + } + } + + part { name: "background"; + mouse_events: 0; + scale: 1; + clip_to: "elm.background.progressbar"; + description { + state: "default" 0.0; + rel1 { + to: "elm.swallow.bar"; + relative: 0.0 0.0; + } + rel2 { + to: "elm.swallow.bar"; + relative: 1.0 1.0; + offset: -1 -1; + } + } + } + + part { name: "elm.text.status"; + type: TEXT; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + fixed: 1 1; + visible: 0; + rel1 { + to: "background"; + relative: 0.5 0.5; + } + rel2 { + to: "background"; + relative: 0.5 0.5; + } + text { + font: "SLP:style=Medium"; +#ifdef WVGA_NBEAT // 480 * 800 + size: 10; +#else + size: 15; +#endif + min: 0 0; + align: 0.5 0.0; + } + color: 0 0 0 255; + } + description { state: "show" 0.0; + inherit: "default" 0.0; + visible: 0; + text.min: 1 1; + } + } + + part { name: "elm.progress.progressbar"; + mouse_events: 0; + scale: 1; + clip_to: "elm.background.progressbar"; + description { + state: "default" 0.0; + min: 0 0; + fixed: 1 1; + rel1 { + to: "elm.swallow.bar"; + relative: 0.0 0.0; + } + rel2 { + to_y: "elm.swallow.bar"; + to_x: "elm.cur.progressbar"; + offset: -1 -1; + } + image { + normal: "browser-view-images/progressbar/progressbar.png"; + border: 5 5 5 5; + } + } + description { + state: "invert" 0.0; + inherit: "default" 0.0; + rel1 { + to_y: "elm.swallow.bar"; + to_x: "elm.cur.progressbar"; + } + rel2 { + to: "elm.swallow.bar"; + relative: 1.0 1.0; + } + } + description { + state: "state_begin" 0.0; + inherit: "default" 0.0; + rel1 { + to: "elm.swallow.bar"; + relative: 0.0 0.0; + } + rel2 { + to: "elm.swallow.bar"; + relative: 0.1 1.0; + } + } + description { + state: "state_end" 0.0; + inherit: "default" 0.0; + rel1 { + to: "elm.swallow.bar"; + relative: 0.9 0.0; + } + rel2 { + to: "elm.swallow.bar"; + relative: 1.0 1.0; + } + } + } + part { name: "text-bar"; + type: TEXT; + mouse_events: 0; + scale: 1; + clip_to: "progress-rect"; + effect: SOFT_SHADOW; + scale: 0; + description { state: "default" 0.0; + align: 0.0 0.0; + fixed: 1 1; + visible: 0; + rel1.to: "elm.text.status"; + rel1.offset: -1 -1; + rel2.to: "elm.text.status"; + text { + text_source: "elm.text.status"; + font: "SLP:style=Medium"; +#ifdef WVGA_NBEAT // 480 * 800 + size: 10; +#else + size: 15; +#endif + min: 0 0; + align: 0.0 0.0; + } + color: 224 224 224 255; + color3: 0 0 0 64; + } + description { state: "show" 0.0; + inherit: "default" 0.0; + visible: 0; + text.min: 1 1; + } + } + part { name: "elm.cur.progressbar"; + mouse_events: 0; + scale: 1; + dragable { + confine: "background"; + x: 1 1 1; + y: 0 0 0; + } + description { state: "default" 0.0; +#ifdef WVGA_NBEAT // 480 * 800 + min: 0 28; +#else + min: 0 42; +#endif + fixed: 1 1; + visible: 0; + rel1 { + to: "background"; + relative: 0 0; + } + rel2.to: "background"; + } + } + part { name: "progress-rect"; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; + rel1.to: "elm.progress.progressbar"; + rel2.to: "elm.progress.progressbar"; + } + } + } + programs { + program { name: "label_show"; + signal: "elm,state,text,visible"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "elm.text"; + } + program { name: "label_hide"; + signal: "elm,state,text,hidden"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.text"; + } + program { name: "icon_show"; + signal: "elm,state,icon,visible"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "elm.swallow.content"; + } + program { name: "icon_hide"; + signal: "elm,state,icon,hidden"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.swallow.content"; + } + program { name: "units_show"; + signal: "elm,state,units,visible"; + source: "elm"; + action: STATE_SET "show" 0.0; + target: "text-bar"; + target: "elm.text.status"; + } + program { name: "units_hide"; + signal: "elm,state,units,hidden"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "text-bar"; + target: "elm.text.status"; + } + program { name: "slide_to_end"; + action: STATE_SET "state_end" 0.0; + transition: LINEAR 0.5; + target: "elm.progress.progressbar"; + after: "slide_to_begin"; + } + program { name: "slide_to_begin"; + signal: "elm,state,slide,begin"; + action: STATE_SET "state_begin" 0.0; + target: "elm.progress.progressbar"; + transition: LINEAR 0.5; + after: "slide_to_end"; + } + program { name: "start_pulse"; + signal: "elm,state,pulse,start"; + source: "elm"; + after: "slide_to_end"; + } + program { name: "stop_pulse"; + signal: "elm,state,pulse,stop"; + source: "elm"; + action: ACTION_STOP; + target: "slide_to_begin"; + target: "slide_to_end"; + target: "start_pulse"; + after: "state_pulse"; + } + program { name: "state_pulse"; + signal: "elm,state,pulse"; + source: "elm"; + action: STATE_SET "state_begin" 0.0; + target: "elm.progress.progressbar"; + after: "units_hide"; + } + program { name: "state_fraction"; + signal: "elm,state,fraction"; + source: "elm"; + action: ACTION_STOP; + target: "slide_to_begin"; + target: "slide_to_end"; + target: "start_pulse"; + action: STATE_SET "default" 0.0; + target: "elm.progress.progressbar"; + } + program { name: "set_invert_on"; + signal: "elm,state,inverted,on"; + source: "elm"; + action: STATE_SET "invert" 0.0; + target: "elm.progress.progressbar"; + } + program { name: "set_invert_off"; + signal: "elm,state,inverted,off"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.progress.progressbar"; + } + } + } + +/* The cpu consumption depends on the time delay of progress bar */ +#define PROGRESSING_DELAY 0.14 + group { name: "elm/progressbar/horizontal/browser/loading_wheel"; + images { + image: "browser-view-images/progressbar/processing_ani00.png" COMP; + image: "browser-view-images/progressbar/processing_ani01.png" COMP; + image: "browser-view-images/progressbar/processing_ani02.png" COMP; + image: "browser-view-images/progressbar/processing_ani03.png" COMP; + image: "browser-view-images/progressbar/processing_ani04.png" COMP; + image: "browser-view-images/progressbar/processing_ani05.png" COMP; + image: "browser-view-images/progressbar/processing_ani06.png" COMP; + image: "browser-view-images/progressbar/processing_ani07.png" COMP; + } + parts { + part { name: "elm.background.progressbar"; + mouse_events: 0; + scale: 1; + type: RECT; + description { + state: "default" 0.0; + } + } + part { name: "elm.swallow.bar"; + mouse_events: 0; + scale: 1; + type: SWALLOW; + description { state: "default" 0.0; + min: 0 0; + max: 0 0; + visible: 0; + } + } + part { name: "elm.swallow.content"; + type: SWALLOW; + scale: 1; + description { state: "default" 0.0; + min: 0 0; + max: 0 0; + visible: 0; + } + } + part { name: "background"; + mouse_events: 0; + scale: 1; + clip_to: "elm.background.progressbar"; + description { + state: "default" 0.0; +#ifdef WVGA_NBEAT // 480 * 800 + min: 40 40; + max: 60 60; +#else + min: 60 60; + max: 90 90; +#endif + visible: 1; + aspect: 1.0 1.0; + aspect_preference: BOTH; + image { + normal: "browser-view-images/progressbar/processing_ani00.png"; + } + } + description { state: "pulse" 0.0; + inherit: "default" 0.0; + image { + normal: "browser-view-images/progressbar/processing_ani00.png"; + } + } + description { state: "pulse" 0.01; + inherit: "default" 0.0; + image { + normal: "browser-view-images/progressbar/processing_ani01.png"; + } + } + description { state: "pulse" 0.02; + inherit: "default" 0.0; + image { + normal: "browser-view-images/progressbar/processing_ani02.png"; + } + } + description { state: "pulse" 0.03; + inherit: "default" 0.0; + image { + normal: "browser-view-images/progressbar/processing_ani03.png"; + } + } + description { state: "pulse" 0.04; + inherit: "default" 0.0; + image { + normal: "browser-view-images/progressbar/processing_ani04.png"; + } + } + description { state: "pulse" 0.05; + inherit: "default" 0.0; + image { + normal: "browser-view-images/progressbar/processing_ani05.png"; + } + } + description { state: "pulse" 0.06; + inherit: "default" 0.0; + image { + normal: "browser-view-images/progressbar/processing_ani06.png"; + } + } + description { state: "pulse" 0.07; + inherit: "default" 0.0; + image { + normal: "browser-view-images/progressbar/processing_ani07.png"; + } + } + } + } + script { + public pulse_state; + } + programs { + program { name: "continue_pulse"; + script { + new Float:state; + state = get_float(pulse_state); + set_state(PART:"background", "pulse", state); + state += 0.01; + if( state > 0.07 ) + state = 0.00; + set_float(pulse_state, state); + } + after: "delay"; + } + program { name: "delay"; + action: STATE_SET "pulse" 0.10; + target: "background"; + in: PROGRESSING_DELAY 0.0; + after: "continue_pulse"; + } + program { name: "start_pulse"; + signal: "elm,state,pulse,start"; + source: "elm"; + script { + set_float(pulse_state, 0.0); + } + after: "continue_pulse"; + } + program { name: "stop_pulse"; + signal: "elm,state,pulse,stop"; + source: "elm"; + action: ACTION_STOP; + target: "continue_pulse"; + target: "delay"; + target: "start_pulse"; + after: "init_pulse"; + } + program { name: "init_pulse"; + action: STATE_SET "default" 0.0; + target: "background"; + } + } + } +} + diff --git a/edc/browser-view-url-layout.edc b/edc/browser-view-url-layout.edc new file mode 100755 index 00000000..f89a6d1b --- /dev/null +++ b/edc/browser-view-url-layout.edc @@ -0,0 +1,1099 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "browser-macro.edc" + +collections { +//////////////////////////////////////////////////////////////////////////////////////// +// editfield +//////////////////////////////////////////////////////////////////////////////////////// +#define EDITFIELD_TITLE_SIZE_INC 32 +//#define EDITFIELD_DEFAULT_MINH_INC 112 +// Customize - edit field height +#define EDITFIELD_DEFAULT_MINH_INC 72 +//#define EDITFIELD_DEFAULT_TOP1_SINGLE_INC 20 +// Customize - entry top margin +// Strangely - (Edit field entry is aligned to top a little, so make the top margin more then bottom) +#define EDITFIELD_DEFAULT_TOP1_SINGLE_INC 5 +#define EDITFIELD_DEFAULT_TOP1_MULTI_INC 45 +#define EDITFIELD_DEFAULT_TOP2_INC 6 +#define EDITFIELD_DEFAULT_LEFT1_INC 0 +#define EDITFIELD_DEFAULT_LEFT2_INC 0 +#define EDITFIELD_DEFAULT_LEFT3_INC 1 + +#define EDITFIELD_DEFAULT_RIGHT1_ERASER_SHOW_INC 0 // browser customize + +// width of erase icon width and string witdh of "xx/xx" +#define EDITFIELD_DEFAULT_RIGHT1_ERASER_SHOW_INC_FOR_FIND_WORD (EDITFIELD_DEFAULT_ERASER_MINW_INC + 80) + +#define EDITFIELD_DEFAULT_RIGHT2_INC 10 // browser customize +//#define EDITFIELD_DEFAULT_BOTTOM1_SINGLE_INC 20 +// Customize - entry bottom margin +#define EDITFIELD_DEFAULT_BOTTOM1_SINGLE_INC 0 +#define EDITFIELD_DEFAULT_BOTTOM1_MULTI_INC 5 +#define EDITFIELD_DEFAULT_BOTTOM2_SINGLE_INC 38 +#define EDITFIELD_DEFAULT_BOTTOM2_MULTI_INC 6 +#define EDITFIELD_DEFAULT_BOTTOM3_SINGLE_INC 85 +#define EDITFIELD_DEFAULT_BOTTOM3_MULTI_INC 60 +#define EDITFIELD_TITLE_COLOR_INC 168 168 168 255 +#define EDITFIELD_GUIDE_TEXT_COLOR_INC 70 70 70 255 +#define ENTRY_TEXT_SIZE_INC 44 +// Customize - text color +//#define ENTRY_TEXT_COLOR_INC "#FFFFFF" +#define ENTRY_TEXT_COLOR_WHITE_INC "#FFFFFF" +#define ENTRY_TEXT_COLOR_BLACK_INC "#000000" + +#define EDITFIELD_DEFAULT_ERASER_MINW_INC 40 +#define EDITFIELD_DEFAULT_ERASER_MINH_INC 40 + +group { name: "elm/layout/browser-editfield/default"; + images { + image: "browser-view-images/url-layout/00_EditField_clear.png" COMP; + } + parts { + part { + name: "base"; + type: RECT; + scale: 1; + ignore_flags: ON_HOLD; + description { + state: "default" 0.0; + min: 0 EDITFIELD_DEFAULT_MINH_INC; + color: 0 0 0 0; + } + } + part { + name: "top1"; + type: RECT; + scale: 1; + ignore_flags: ON_HOLD; + description { + state: "default" 0.0; + visible: 0; + min: 0 EDITFIELD_DEFAULT_TOP1_SINGLE_INC; + fixed: 1 1; + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 0.0; + align: 0.5 0; + } + } + part { + name: "top2"; + type: RECT; + scale: 1; + ignore_flags: ON_HOLD; + description { + state: "default" 0.0; + visible: 0; + min: 0 EDITFIELD_DEFAULT_TOP2_INC; + fixed: 1 1; + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 0.0; + align: 0.5 0; + } + } + part { + name: "left1"; + type: RECT; + scale: 1; + ignore_flags: ON_HOLD; + description { + state: "default" 0.0; + visible: 0; + min: EDITFIELD_DEFAULT_LEFT1_INC 0; + fixed: 1 1; + align: 0 0; + rel1.relative : 0.0 0.0; + rel2.relative : 0.0 1.0; + } + } + part { + name: "left2"; + type: RECT; + scale: 1; + ignore_flags: ON_HOLD; + description { + state: "default" 0.0; + visible: 0; + min: EDITFIELD_DEFAULT_LEFT2_INC 0; + fixed: 1 1; + align: 0 0; + rel1.relative : 0.0 0.0; + rel2.relative : 0.0 1.0; + } + } + part { + name: "right1"; + type: RECT; + scale: 1; + ignore_flags: ON_HOLD; + description { + state: "default" 0.0; + visible: 0; + min: EDITFIELD_DEFAULT_RIGHT1_ERASER_SHOW_INC 0; + fixed: 1 1; + align: 1 0; + rel1.relative : 1.0 0.0; + rel2.relative : 1.0 1.0; + } + description { + state: "find_word" 0.0; + inherit: "default" 0.0; + min: EDITFIELD_DEFAULT_RIGHT1_ERASER_SHOW_INC_FOR_FIND_WORD 0; + } + } + part { + name: "right2"; + type: RECT; + scale: 1; + ignore_flags: ON_HOLD; + description { + state: "default" 0.0; + visible: 0; + min: EDITFIELD_DEFAULT_RIGHT2_INC 0; + fixed: 1 1; + align: 1 0; + rel1.relative : 1.0 0.0; + rel2.relative : 1.0 1.0; + } + } + part { + name: "bottom1"; + type: RECT; + scale: 1; + ignore_flags: ON_HOLD; + description { + state: "default" 0.0; + visible: 0; + min: 0 EDITFIELD_DEFAULT_BOTTOM1_SINGLE_INC; + fixed: 1 1; + align: 0 1; + rel1.relative: 0.0 1.0; + } + } + part { + name: "bottom2"; + type: RECT; + scale: 1; + ignore_flags: ON_HOLD; + description { + state: "default" 0.0; + visible: 0; + min: 0 EDITFIELD_DEFAULT_BOTTOM2_SINGLE_INC; + fixed: 0 1; + rel1.relative: 0.0 1.0; + align: 0 1; + } + } + part { + name: "bottom3"; + type: RECT; + scale: 1; + ignore_flags: ON_HOLD; + description { + state: "default" 0.0; + visible: 0; + min: 0 EDITFIELD_DEFAULT_BOTTOM3_SINGLE_INC; + fixed: 0 1; + rel1.relative: 0.0 1.0; + align: 0 1; + } + } + part { + name: "elm.guidetext"; + type: TEXT; + scale: 1; + ignore_flags: ON_HOLD; + description { + state: "default" 0.0; + align: 0.0 0.0; + fixed: 1 1; + rel1.to: "elm.swallow.content"; + rel2.to: "elm.swallow.content"; + color: EDITFIELD_GUIDE_TEXT_COLOR_INC; + text { + font: "SLP:style=Roman"; + size: ENTRY_TEXT_SIZE_INC; + min: 0 0; + align: 0.0 0.5; + } + } + description { + state: "hidden" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + part { + name: "elm.swallow.content"; + type: SWALLOW; + scale: 1; + ignore_flags: ON_HOLD; + description { + state: "default" 0.0; + min: 0 40; + rel1 { + relative : 1.0 1.0; + to_x: "left1"; + to_y: "top1"; + } + rel2 { + relative : 0.0 0.0; + to_x: "right1"; + to_y: "bottom1"; + } + align: 0.0 0.5; + } + } + part { + name: "eraser_image"; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + min: EDITFIELD_DEFAULT_ERASER_MINW_INC EDITFIELD_DEFAULT_ERASER_MINH_INC; + fixed: 1 1; + align: 1 0.5; + rel1 { + relative: 0.0 0.0; + to_x : "right2"; + to_y : "bottom2"; + } + rel2 { + relative: 0.0 0.0; + to_x : "right2"; + to_y : "bottom2"; + } + image { + normal: "browser-view-images/url-layout/00_EditField_clear.png"; + border: 10 10 10 10; + border_scale: 1; + } + } + description { + state: "elm.eraser.show" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part { + name: "eraser"; + mouse_events: 1; + ignore_flags: ON_HOLD; + description { + state: "default" 0.0; + visible: 0; + color: 0 0 0 0; + rel1 { + relative: 0.0 0.0; + to_x : "eraser_image"; + to_y : "bottom3"; + } + } + description { + state: "elm.eraser.show" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + } + programs { + program { + name: "find_word_editfield"; + signal: "find_word,signal"; + source: "elm"; + action: STATE_SET "find_word" 0.0; + target: "right1"; + } + program { + name: "guidetext_show"; + signal: "elm,state,guidetext,show"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.guidetext"; + } + program { + name: "guidetext_hide"; + signal: "elm,state,guidetext,hide"; + source: "elm"; + action: STATE_SET "hidden" 0.0; + target: "elm.guidetext"; + } + program { + name: "eraser_show"; + signal: "elm,state,eraser,show"; + source: "elm"; + action: STATE_SET "elm.eraser.show" 0.0; + target: "eraser_image"; + target: "eraser"; + } + program { + name: "eraser_hide"; + signal: "elm,state,eraser,hide"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "eraser_image"; + target: "eraser"; + } + program { + name: "eraser_clicked"; + signal: "mouse,clicked,1"; + source: "eraser"; + action: SIGNAL_EMIT "elm,eraser,clicked" "elm"; + } + } +} + +//////////////////////////////////////////////////////////////////////////////////////// +// url layout +//////////////////////////////////////////////////////////////////////////////////////// + group { + name: "browser/url_layout"; + images { + image: "browser-view-images/url-layout/naviframe_optionheader.png" COMP; + image: "browser-view-images/url-layout/I01_Icons_http.png" COMP; + } + parts { + part { name: "backgournd"; + mouse_events: 1; + repeat_events: 0; + type: IMAGE; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + min: 0 150; + fixed: 0 1; + align: 0.0 0.0; + rel1 { relative: 0.0 0.0; } + rel2 { relative: 1.0 1.0; } + image { + normal: "browser-view-images/url-layout/naviframe_optionheader.png"; + border: 1 1 2 1; + border_scale: 1; + } + } + } + part { name: "bg"; + mouse_events: 1; + repeat_events: 0; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + min: 0 106; + align: 0.0 0.0; + rel1 { relative: 0.0 1.0; to_y: "title_text"; } + rel2 { relative: 1.0 1.0; } + color: 255 255 255 255; // white + } + } + part { + name: "navigationbar_bg"; + type: IMAGE; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; + align: 0.0 0.0; + rel1 { relative: 0.0 0.0; to: bg; } + rel2 { relative: 1.0 1.0; to: bg; } + image { + normal: "browser-view-images/url-layout/naviframe_optionheader.png"; + border: 1 1 2 1; + border_scale: 1; + } + } + } + part { + name: "secure_icon"; + type: IMAGE; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + min: 0 0; + max: 0 0; + fixed: 1 1; + align: 1.0 0.5; + rel1 { relative: 0.0 0.0; to: "title_text"; } + rel2 { relative: 0.0 1.0; to: "title_text"; } + image { + normal: "browser-view-images/url-layout/I01_Icons_http.png"; + } + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + min: 30 30; + max: 30 30; + } + } + part { name: "padding,title_text,left"; + mouse_events: 0; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + min: 30 0; + fixed: 1 0; + align: 0.0 0.5; + rel1 { relative: 0.0 0.0; to_y: "title_text"; } + rel2 { relative: 0.0 1.0; to_y: "title_text"; } + } + } + part { name: "padding,title_text,right"; + mouse_events: 0; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + min: 30 0; + fixed: 1 0; + align: 1.0 0.5; + rel1 { relative: 1.0 0.0; to_y: "title_text"; } + rel2 { relative: 1.0 1.0; to_y: "title_text"; } + } + } + part { + name: "title_text"; + type: TEXT; + scale: 1; + mouse_events: 0; + description { + state: "default" 0.0; + visible: 1; + fixed: 0 1; + min: 0 44; + max: 999999 44; + align: 0.5 0.0; + text { font: FONT_ROM; + size: 34; + min: 0 0; + max: 1 0; + align: 0.5 1.0; + } + color: 255 255 255 255; + rel1 { relative: 1.0 0.0; to_x: "padding,title_text,left"; } + rel2 { relative: 0.0 1.0; to_x: "padding,title_text,right"; } + } + } + part { name: "padding,cancel,left"; + mouse_events: 0; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + min: 15 0; + fixed: 1 0; + align: 1.0 0.5; + rel1 { relative: 0.0 0.0; to: "elm.swallow.cancel"; } + rel2 { relative: 0.0 1.0; to: "elm.swallow.cancel"; } + } + } + part { name: "padding,url,top"; + mouse_events: 0; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + min: 0 16; + fixed: 0 1; + align: 0.5 0.0; + rel1 { relative: 0.0 0.0; to: "bg"; } + rel2 { relative: 1.0 0.0; to: "bg"; } + } + } + part { name: "padding,url,left"; + mouse_events: 0; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + min: 16 0; + fixed: 1 0; + align: 0.0 0.5; + rel1 { relative: 0.0 0.0; to: "bg"; } + rel2 { relative: 0.0 1.0; to: "bg"; } + } + } + part { + name: "elm.swallow.url"; + type: SWALLOW; + mouse_events: 1; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + min: 0 74; + fixed: 0 1; + align: 0.0 0.0; + rel1 { relative: 1.0 1.0; to_x: "padding,url,left"; to_y: "padding,url,top"; } + rel2 { relative: 0.0 1.0; to_x: "padding,reader_icon,left"; to_y: "padding,url,top"; } + } + description { + state: "edit_mode_state" 0.0; + inherit: "default" 0.0; + rel1 { relative: 1.0 1.0; to_x: "padding,url,left"; to_y: "padding,url,top"; } + rel2 { relative: 0.0 1.0; to_x: "padding,cancel,left"; to_y: "padding,url,top"; } + } + } + part { name: "padding,reader_icon,left"; + mouse_events: 0; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + min: 16 0; + fixed: 1 0; + align: 1.0 0.5; + rel1 { relative: 0.0 0.0; to_x: "elm.swallow.reader_icon"; to_y: "navigationbar_bg"; } + rel2 { relative: 0.0 1.0; to_x: "elm.swallow.reader_icon"; to_y: "navigationbar_bg"; } + } + } + part { + name: "elm.swallow.reader_icon"; + type: SWALLOW; + mouse_events: 1; + repeat_events: 0; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + min: 74 74; + max: 74 74; + fixed: 1 1; + align: 0.0 0.5; + rel1 { relative: 1.0 0.0; to: "navigationbar_bg"; } + rel2 { relative: 1.0 1.0; to: "navigationbar_bg"; } + } + description { + state: "show_reader_icon" 0.0; + inherit: "default" 0.0; + align: 1.0 0.5; + rel1 { relative: 0.0 0.0; to_x: "padding,cancel,right"; to_y: "navigationbar_bg"; } + rel2 { relative: 0.0 1.0; to_x: "padding,cancel,right"; to_y: "navigationbar_bg"; } + } + } + part { name: "padding,cancel,right"; + mouse_events: 0; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + min: 16 0; + fixed: 1 0; + align: 1.0 0.5; + rel1 { relative: 1.0 0.0; to: "navigationbar_bg"; } + rel2 { relative: 1.0 1.0; to: "navigationbar_bg"; } + } + } + part { + name: "elm.swallow.cancel"; + type: SWALLOW; + mouse_events: 1; + repeat_events: 0; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + min: 165 72; + max: 165 72; + fixed: 1 1; + align: 0.0 0.5; + rel1 { relative: 1.0 0.0; to_x: navigationbar_bg; to_y: "navigationbar_bg"; } + rel2 { relative: 1.0 1.0; to_x: navigationbar_bg; to_y: "navigationbar_bg"; } + } + description { + state: "edit_mode_state" 0.0; + inherit: "default" 0.0; + align: 1.0 0.5; + rel1 { relative: 0.0 0.0; to_x: "padding,cancel,right"; to_y: "navigationbar_bg"; } + rel2 { relative: 0.0 1.0; to_x: "padding,cancel,right"; to_y: "navigationbar_bg"; } + } + } + } + programs { + program { name: "show,secure_icon"; + signal: "show,secure_icon,signal"; + action: STATE_SET "visible" 0.0; + target: "secure_icon"; + } + program { name: "hide,secure_icon"; + signal: "hide,secure_icon,signal"; + action: STATE_SET "default" 0.0; + target: "secure_icon"; + } + program { name: "edit,url,on"; + signal: "edit,url,on,signal"; + action: STATE_SET "edit_mode_state" 0.0; + target: "elm.swallow.url"; + after: "cancel_button,show"; + } + program { name: "cancel_button,show"; + action: STATE_SET "edit_mode_state" 0.0; + transition: DECELERATE 0.5; + target: "elm.swallow.cancel"; + } + program { name: "show,reader_icon"; + signal: "show,reader_icon,signal"; + action: STATE_SET "show_reader_icon" 0.0; + transition: DECELERATE 0.5; + target: "elm.swallow.reader_icon"; + } + program { name: "hide,reader_icon"; + signal: "hide,reader_icon,signal"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.5; + target: "elm.swallow.reader_icon"; + } + program { name: "hide,reader_icon_no_ani"; + signal: "hide,reader_icon_no_ani,signal"; + action: STATE_SET "default" 0.0; + target: "elm.swallow.reader_icon"; + } + program { name: "edit,url,off"; + signal: "edit,url,off,signal"; + action: STATE_SET "default" 0.0; + transition: ACCELERATE 0.5; + target: "elm.swallow.url"; + target: "elm.swallow.cancel"; + } + } + } + + group { + name: "elm/browser/urlentry/default"; + images { + image: "browser-view-images/url-layout/00_search_input_field_bg.png" COMP; + image: "browser-view-images/url-layout/00_search_input_field_bg_black.png" COMP; + image: "browser-view-images/url-layout/41_browser_search_icon_refresh.png" COMP; + image: "browser-view-images/url-layout/icon_stop.png" COMP; + image: "icon/00_close_icon.png" COMP; + image: "browser-view-images/url-layout/I01_Icons_RSS.png" COMP; + } + + parts { + part { name: "bg"; + mouse_events: 0; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + fixed: 0 1; + rel1 { relative: 0.0 0.0; } + rel2 { relative: 1.0 1.0; } + color: 0 0 0 0; + } + } + part { + name: "bg_image"; + type: IMAGE; + scale: 1; + mouse_events: 0; + description { + state: "default" 0.0; + fixed: 0 1; + rel1 {relative: 0.0 0.0; offset: 0 0; } + rel2 {relative: 1.0 1.0; offset: 0 0; } + image.normal: "browser-view-images/url-layout/00_search_input_field_bg.png"; + image.border: 5 5 5 5; + } + description { + state: "black" 0.0; + inherit: "default" 0.0; + image.normal: "browser-view-images/url-layout/00_search_input_field_bg_black.png"; + image.border: 5 5 5 5; + } + } + part { + name: "elm.swallow.progressbar"; + type: SWALLOW; + scale: 1; + mouse_events: 0; + description { + state: "default" 0.0; + visible: 0; + } + description { + state: "loading_on" 0.0; + visible: 1; + rel1 {relative: 0.0 0.0; offset: 0 0; } + rel2 {relative: 1.0 1.0; offset: 0 0; } + } + } + PADDING("padding.favicon.left", 9, 0, 1, 0, 0.0, 0.5, + 0.0, 0.0, 0.0, 1.0, bg, bg) + PADDING("padding.favicon.right", 9, 0, 1, 0, 0.0, 0.5, + 1.0, 0.0, 1.0, 1.0, elm.swallow.favicon, elm.swallow.favicon) + part { name: "elm.swallow.favicon"; + mouse_events: 0; + type: SWALLOW; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + min: 0 45; + max: 0 45; + fixed: 1 1; + align: 0.0 0.5; + rel1 { relative: 1.0 0.0; to_x: padding.favicon.left; to_y: bg; } + rel2 { relative: 1.0 1.0; to_x: padding.favicon.left; to_y: bg; } + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + min: 45 45; + max: 45 45; + } + } + part { name: "elm.swallow.rss_icon"; + mouse_events: 0; + type: IMAGE; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + min: 0 45; + max: 0 45; + fixed: 1 1; + align: 0.0 0.5; + rel1 { relative: 1.0 0.0; to: "elm.swallow.favicon"; } + rel2 { relative: 1.0 1.0; to: "elm.swallow.favicon"; } + image.normal: "browser-view-images/url-layout/I01_Icons_RSS.png"; + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + min: 45 45; + max: 45 45; + } + } + PADDING("padding.progress.left", 9, 0, 1, 0, 1.0, 0.5, + 0.0, 0.0, 0.0, 1.0, elm.swallow.progress, elm.swallow.progress) + part { name: "elm.swallow.progress"; + mouse_events: 0; + type: SWALLOW; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + } + description { + state: "loading_on" 0.0; + visible: 1; + min: 60 60; + max: 60 60; + fixed: 1 1; + align: 1.0 0.5; + rel1 { relative: 0.0 0.0; to_x: elm.image.refresh_stop; to_y: bg; } + rel2 { relative: 0.0 1.0; to_x: elm.image.refresh_stop; to_y: bg; } + } + } + PADDING("padding.refreshstop.left", 9, 0, 1, 0, 1.0, 0.5, + 0.0, 0.0, 0.0, 1.0, elm.image.refresh_stop, elm.image.refresh_stop) + PADDING("padding.refreshstop.right", 9, 0, 1, 0, 1.0, 0.5, + 1.0, 0.0, 1.0, 1.0, bg, bg) + part { name: "elm.rect.refresh_stop"; + mouse_events: 1; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + min: 75 60; + max: 75 60; + fixed: 1 1; + align: 0.5 0.5; + rel1 { relative: 0.0 0.0; to: "elm.image.refresh_stop"; } + rel2 { relative: 1.0 1.0; to: "elm.image.refresh_stop"; } + color: 0 0 0 0; + } + } + part { name: "elm.image.refresh_stop"; + mouse_events: 0; + type: IMAGE; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + min: 45 45; + max: 45 45; + fixed: 1 1; + align: 1.0 0.5; + rel1 { relative: 0.0 0.0; to_x: padding.refreshstop.right; to_y: bg; } + rel2 { relative: 0.0 1.0; to_x: padding.refreshstop.right; to_y: bg; } + image.normal: "browser-view-images/url-layout/41_browser_search_icon_refresh.png"; + } + description { + state: "loading_on" 0.0; + inherit: "default" 0.0; + image.normal: "browser-view-images/url-layout/icon_stop.png"; + } + description { + state: "edit_url" 0.0; + inherit: "default" 0.0; + image.normal: "icon/00_close_icon.png"; + } + } + part { name: "padding,rss_icon,right"; + mouse_events: 0; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + min: 7 0; + fixed: 1 0; + align: 0.0 0.5; + rel1 { relative: 1.0 0.0; to: "elm.swallow.rss_icon"; } + rel2 { relative: 1.0 1.0; to: "elm.swallow.rss_icon"; } + } + } + part { name: "elm.swallow.entry"; + mouse_events: 1; + type: SWALLOW; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + align: 0.0 0.5; + rel1 { relative: 1.0 0.0; to_x: "padding,rss_icon,right"; to_y: bg; } + rel2 { relative: 0.0 1.0; to_x: padding.refreshstop.left; to_y: bg; } + } + description { + state: "loading_on" 0.0; + visible: 1; + rel1 { relative: 1.0 0.0; to_x: "padding,rss_icon,right"; to_y: bg; } + rel2 { relative: 0.0 1.0; to_x: padding.progress.left; to_y: bg; } + } + } + part { name: "block_entry"; + mouse_events: 1; + repeat_events: 0; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + align: 0.0 0.0; + rel1 { relative: 0.0 0.0; to: "elm.swallow.entry"; } + rel2 { relative: 1.0 1.0; to: "elm.swallow.entry"; } + color: 0 0 0 0; + } + description { + state: "block" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part { name: "padding,rss_icon,left_margin"; + mouse_events: 0; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + min: 45 0; + fixed: 1 0; + align: 1.0 0.5; + rel1 { relative: 0.0 0.0; to: "elm.swallow.rss_icon"; } + rel2 { relative: 0.0 1.0; to: "elm.swallow.rss_icon"; } + } + } + part { name: "padding,rss_icon,right_margin"; + mouse_events: 0; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + min: 45 0; + fixed: 1 0; + align: 0.0 0.5; + rel1 { relative: 1.0 0.0; to: "elm.swallow.rss_icon"; } + rel2 { relative: 1.0 1.0; to: "elm.swallow.rss_icon"; } + } + } + } + programs { + program { name: "disable_entry"; + signal: "disable_entry,signal"; + action: STATE_SET "block" 0.0; + target: "block_entry"; + } + program { name: "black_theme"; + signal: "black_theme,signal"; + action: STATE_SET "black" 0.0; + target: "bg_image"; + } + program { name: "rss_on"; + signal: "rss,on,signal"; + action: STATE_SET "visible" 0.0; + target: "elm.swallow.rss_icon"; + } + program { name: "rss_off"; + signal: "rss,off,signal"; + action: STATE_SET "default" 0.0; + target: "elm.swallow.rss_icon"; + } + program { name: "loading_on"; + signal: "loading,on,signal"; + action: STATE_SET "loading_on" 0.0; + target: "elm.swallow.progress"; + target: "elm.swallow.progressbar"; + target: "elm.image.refresh_stop"; + target: "elm.swallow.entry"; + } + program { name: "loading_off"; + signal: "loading,off,signal"; + action: STATE_SET "default" 0.0; + target: "elm.swallow.progress"; + target: "elm.swallow.progressbar"; + target: "elm.image.refresh_stop"; + target: "elm.swallow.entry"; + } + program { name: "refresh_stop"; + source: "elm.rect.refresh_stop"; + signal: "mouse,clicked,1"; + action: SIGNAL_EMIT "refresh_stop" "EDJ"; + } + program { name: "hide_progress"; + action: STATE_SET "default" 0.0; + target: "elm.swallow.progress"; + target: "elm.swallow.progressbar"; + target: "elm.swallow.entry"; + } + program { name: "edit,url,on"; + signal: "edit,url,on,signal"; + action: STATE_SET "edit_url" 0.0; + target: "elm.image.refresh_stop"; + after: "hide_progress"; + } + program { name: "edit,url,off"; + signal: "edit,url,off,signal"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.swallow.progress", st, 30, vl); + if (!strcmp(st, "loading_on")) + set_state(PART:"elm.image.refresh_stop", "loading_on", 0.0); + else + set_state(PART:"elm.image.refresh_stop", "default", 0.0); + } + } + program { name: "show,favicon"; + signal: "show,favicon,signal"; + action: STATE_SET "visible" 0.0; + target: "elm.swallow.favicon"; + } + program { name: "hide,favicon"; + signal: "hide,favicon,signal"; + action: STATE_SET "default" 0.0; + target: "elm.swallow.favicon"; + } + } + } + + group { + name: "browser-view/option_header"; + parts { + part { name: "elm.swallow.url_layout"; + mouse_events: 1; + type: SWALLOW; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + align: 0.0 0.0; + rel1 { relative: 0.0 0.0; } + rel2 { relative: 1.0 1.0; } + } + description { + state: "invisible" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + /* For change effect. */ + part { name: "rect.find_word_layout"; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + color: 255 255 255 0; + rel1 { relative: 0.0 0.0; to: "elm.swallow.find_word_layout"; } + rel2 { relative: 1.0 1.0; to: "elm.swallow.find_word_layout"; } + } + description { + state: "visible" 0.0; + color: 255 255 255 255; + rel1 { relative: 0.0 0.0; to: "elm.swallow.find_word_layout"; } + rel2 { relative: 1.0 1.0; to: "elm.swallow.find_word_layout"; } + } + } + part { name: "elm.swallow.find_word_layout"; + mouse_events: 1; + repeat_events: 0; + type: SWALLOW; + scale: 1; + /* For change effect. */ + clip_to: "rect.find_word_layout"; + description { + state: "default" 0.0; + visible: 0; + align: 0.0 0.0; + rel1 { relative: 0.0 0.0; } + rel2 { relative: 1.0 1.0; } + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + } + programs { + program { name: "show,find_word_layout,clipper"; + signal: "show,find_word_layout,signal"; + transition: ACCELERATE 0.3; + action: STATE_SET "visible" 0.0; + target: "rect.find_word_layout"; + target: "elm.swallow.find_word_layout"; + } + program { name: "hide,find_word_layout,clipper"; + signal: "hide,find_word_layout,signal"; + transition: ACCELERATE 0.3; + action: STATE_SET "default" 0.0; + target: "rect.find_word_layout"; + target: "elm.swallow.find_word_layout"; + } + } + } +} diff --git a/html/54_bg.jpg b/html/54_bg.jpg Binary files differnew file mode 100755 index 00000000..ac83a6ab --- /dev/null +++ b/html/54_bg.jpg diff --git a/html/54_bg.png b/html/54_bg.png Binary files differnew file mode 100755 index 00000000..8895344c --- /dev/null +++ b/html/54_bg.png diff --git a/html/EmbedInHtml.html b/html/EmbedInHtml.html new file mode 100755 index 00000000..3beb1d7b --- /dev/null +++ b/html/EmbedInHtml.html @@ -0,0 +1,25 @@ +<html> +<head> + + + <script type="text/javascript"> + var s = window.location.href; + var url = s.substring(s.indexOf("?") + 1, s.lastIndexOf("?")); + document.write("<title>" + unescape(url) + "</title>"); + </script> + + +</head> +<body > +<object width="100%" height="100%"> + + <script type="text/javascript"> + var s = window.location.href; + var url = s.substring(s.indexOf("?") + 1, s.lastIndexOf("?")); + var type = s.substring(s.lastIndexOf("?") + 1, s.length); + document.write("<embed width=\"100%\" height=\"100%\" src=\"" + unescape(url) + "\" type=\"" + unescape(type) + "\" />"); + </script> + +</object> +</body> +</html> diff --git a/html/default_page.html b/html/default_page.html new file mode 100755 index 00000000..86396fdd --- /dev/null +++ b/html/default_page.html @@ -0,0 +1,14 @@ +<html> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + <meta name="viewport" content="width=480, user-scalable=no"> + <title> Type URL for Web Surfing </title> +</head> +<body> + <br><br><br><br> + <center> + <img width=391 height=404 src="./logo.png" alt="" /> + <br><br> + </center> +</body> +</html> diff --git a/html/logo.png b/html/logo.png Binary files differnew file mode 100755 index 00000000..eb6918b2 --- /dev/null +++ b/html/logo.png diff --git a/html/notFoundPage.html b/html/notFoundPage.html new file mode 100755 index 00000000..afe1bf00 --- /dev/null +++ b/html/notFoundPage.html @@ -0,0 +1,32 @@ +<html> +<head><title>Page Not Found</title></head> + +<body bgcolor="white" text="black" text-align="left"> +<!--<body bgcolor="#4c4c4c" text="white" text-align="left">--> +<center> +<table> +<tr><td><h1>Page Not Found<br/></td></tr> +<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"> +<script type="text/javascript"> + function formatText(url){ //remove prefixes "http://" etc. and last "/" + var ret = url; + ret=ret.replace("http://", ""); + ret=ret.replace("ftp://", ""); + ret=ret.replace("https://", ""); + ret=ret.replace("sftp://", ""); + ret=ret.replace("file://", ""); + if (ret.charAt(ret.length-1)=="/") ret=ret.substring(0, ret.length-1); + return ret; + } + + var s = window.location.href; + var failingUrl = s.substring(s.indexOf("?") + 1, s.lastIndexOf("?")); + document.write("<p><tr><td><h2>URL: " + unescape(failingUrl) + "</h2></td></tr>"); + var errorDesc = s.substring(s.lastIndexOf("?") + 1, s.length); + document.write("<tr><td><h2>Error: " + unescape(errorDesc) + "</h2></td></tr>"); + document.write("<tr><td><h3>Google: <form method=\"get\" action=\"http://www.google.com/custom\"><input type=text name=\"q\" size=25 maxlength=100 value=\""+ formatText(unescape(failingUrl))+"\"> <input type=submit name=\"sa\" value=Search></form></h3></td></tr>"); +</script> +</table> +</h1> +</body> +</html> diff --git a/images/bookmarks/I01_Nocontents_Bookmarks.png b/images/bookmarks/I01_Nocontents_Bookmarks.png Binary files differnew file mode 100755 index 00000000..f944b88e --- /dev/null +++ b/images/bookmarks/I01_Nocontents_Bookmarks.png diff --git a/images/browser-view-images/00_winset_control_top_arrow.png b/images/browser-view-images/00_winset_control_top_arrow.png Binary files differnew file mode 100755 index 00000000..528d8e80 --- /dev/null +++ b/images/browser-view-images/00_winset_control_top_arrow.png diff --git a/images/browser-view-images/00_zoom_in.png b/images/browser-view-images/00_zoom_in.png Binary files differnew file mode 100755 index 00000000..3685b2cc --- /dev/null +++ b/images/browser-view-images/00_zoom_in.png diff --git a/images/browser-view-images/00_zoom_in_disable.png b/images/browser-view-images/00_zoom_in_disable.png Binary files differnew file mode 100755 index 00000000..d2d8402b --- /dev/null +++ b/images/browser-view-images/00_zoom_in_disable.png diff --git a/images/browser-view-images/00_zoom_in_press.png b/images/browser-view-images/00_zoom_in_press.png Binary files differnew file mode 100755 index 00000000..2eb645fb --- /dev/null +++ b/images/browser-view-images/00_zoom_in_press.png diff --git a/images/browser-view-images/00_zoom_out.png b/images/browser-view-images/00_zoom_out.png Binary files differnew file mode 100755 index 00000000..03e0e96f --- /dev/null +++ b/images/browser-view-images/00_zoom_out.png diff --git a/images/browser-view-images/00_zoom_out_disable.png b/images/browser-view-images/00_zoom_out_disable.png Binary files differnew file mode 100755 index 00000000..58788860 --- /dev/null +++ b/images/browser-view-images/00_zoom_out_disable.png diff --git a/images/browser-view-images/00_zoom_out_press.png b/images/browser-view-images/00_zoom_out_press.png Binary files differnew file mode 100755 index 00000000..7e29dc93 --- /dev/null +++ b/images/browser-view-images/00_zoom_out_press.png diff --git a/images/browser-view-images/41_browser_new_win_bg.png b/images/browser-view-images/41_browser_new_win_bg.png Binary files differnew file mode 100755 index 00000000..edfa1bb1 --- /dev/null +++ b/images/browser-view-images/41_browser_new_win_bg.png diff --git a/images/browser-view-images/I01_btn_back.png b/images/browser-view-images/I01_btn_back.png Binary files differnew file mode 100755 index 00000000..780e24e9 --- /dev/null +++ b/images/browser-view-images/I01_btn_back.png diff --git a/images/browser-view-images/I01_btn_prev.png b/images/browser-view-images/I01_btn_prev.png Binary files differnew file mode 100755 index 00000000..5256010e --- /dev/null +++ b/images/browser-view-images/I01_btn_prev.png diff --git a/images/browser-view-images/I01_btn_prev_press.png b/images/browser-view-images/I01_btn_prev_press.png Binary files differnew file mode 100755 index 00000000..f0bbe736 --- /dev/null +++ b/images/browser-view-images/I01_btn_prev_press.png diff --git a/images/browser-view-images/I01_control_top_arrow.png b/images/browser-view-images/I01_control_top_arrow.png Binary files differnew file mode 100755 index 00000000..1839b085 --- /dev/null +++ b/images/browser-view-images/I01_control_top_arrow.png diff --git a/images/browser-view-images/I01_title_bg.png b/images/browser-view-images/I01_title_bg.png Binary files differnew file mode 100755 index 00000000..019ffd51 --- /dev/null +++ b/images/browser-view-images/I01_title_bg.png diff --git a/images/browser-view-images/controlbar/00_winset_tabbar_press.png b/images/browser-view-images/controlbar/00_winset_tabbar_press.png Binary files differnew file mode 100755 index 00000000..da3b0e1d --- /dev/null +++ b/images/browser-view-images/controlbar/00_winset_tabbar_press.png diff --git a/images/browser-view-images/controlbar/00_winset_tabbar_press_left.png b/images/browser-view-images/controlbar/00_winset_tabbar_press_left.png Binary files differnew file mode 100755 index 00000000..bbbd3dd1 --- /dev/null +++ b/images/browser-view-images/controlbar/00_winset_tabbar_press_left.png diff --git a/images/browser-view-images/controlbar/00_winset_tabbar_press_right.png b/images/browser-view-images/controlbar/00_winset_tabbar_press_right.png Binary files differnew file mode 100755 index 00000000..a1e1d7a8 --- /dev/null +++ b/images/browser-view-images/controlbar/00_winset_tabbar_press_right.png diff --git a/images/browser-view-images/controlbar/I01_bookmark_tabbar_focus.png b/images/browser-view-images/controlbar/I01_bookmark_tabbar_focus.png Binary files differnew file mode 100755 index 00000000..8acf9ac9 --- /dev/null +++ b/images/browser-view-images/controlbar/I01_bookmark_tabbar_focus.png diff --git a/images/browser-view-images/controlbar/I01_bookmark_tabbar_focus_left.png b/images/browser-view-images/controlbar/I01_bookmark_tabbar_focus_left.png Binary files differnew file mode 100755 index 00000000..5cbe846a --- /dev/null +++ b/images/browser-view-images/controlbar/I01_bookmark_tabbar_focus_left.png diff --git a/images/browser-view-images/controlbar/I01_bookmark_tabbar_focus_right.png b/images/browser-view-images/controlbar/I01_bookmark_tabbar_focus_right.png Binary files differnew file mode 100755 index 00000000..47936f4a --- /dev/null +++ b/images/browser-view-images/controlbar/I01_bookmark_tabbar_focus_right.png diff --git a/images/browser-view-images/controlbar/I01_control_toolbar_press.png b/images/browser-view-images/controlbar/I01_control_toolbar_press.png Binary files differnew file mode 100755 index 00000000..98698f35 --- /dev/null +++ b/images/browser-view-images/controlbar/I01_control_toolbar_press.png diff --git a/images/browser-view-images/controlbar/I01_tabbar_bg.png b/images/browser-view-images/controlbar/I01_tabbar_bg.png Binary files differnew file mode 100755 index 00000000..57d42763 --- /dev/null +++ b/images/browser-view-images/controlbar/I01_tabbar_bg.png diff --git a/images/browser-view-images/controlbar/I01_tabbar_focus.png b/images/browser-view-images/controlbar/I01_tabbar_focus.png Binary files differnew file mode 100755 index 00000000..b40832b1 --- /dev/null +++ b/images/browser-view-images/controlbar/I01_tabbar_focus.png diff --git a/images/browser-view-images/controlbar/I01_toolbar_bg.png b/images/browser-view-images/controlbar/I01_toolbar_bg.png Binary files differnew file mode 100755 index 00000000..0f54e57a --- /dev/null +++ b/images/browser-view-images/controlbar/I01_toolbar_bg.png diff --git a/images/browser-view-images/controlbar/I01_toolbar_press.png b/images/browser-view-images/controlbar/I01_toolbar_press.png Binary files differnew file mode 100755 index 00000000..6921307e --- /dev/null +++ b/images/browser-view-images/controlbar/I01_toolbar_press.png diff --git a/images/browser-view-images/most-visited/41_browser_favicon_box_press.png b/images/browser-view-images/most-visited/41_browser_favicon_box_press.png Binary files differnew file mode 100755 index 00000000..929d5ab9 --- /dev/null +++ b/images/browser-view-images/most-visited/41_browser_favicon_box_press.png diff --git a/images/browser-view-images/most-visited/I01_Btn_delete.png b/images/browser-view-images/most-visited/I01_Btn_delete.png Binary files differnew file mode 100755 index 00000000..d43c501c --- /dev/null +++ b/images/browser-view-images/most-visited/I01_Btn_delete.png diff --git a/images/browser-view-images/most-visited/I01_favicon_bg.png b/images/browser-view-images/most-visited/I01_favicon_bg.png Binary files differnew file mode 100755 index 00000000..506c69e7 --- /dev/null +++ b/images/browser-view-images/most-visited/I01_favicon_bg.png diff --git a/images/browser-view-images/most-visited/I01_favicon_box.png b/images/browser-view-images/most-visited/I01_favicon_box.png Binary files differnew file mode 100755 index 00000000..d10d60cb --- /dev/null +++ b/images/browser-view-images/most-visited/I01_favicon_box.png diff --git a/images/browser-view-images/naviframe_optionheader.png b/images/browser-view-images/naviframe_optionheader.png Binary files differnew file mode 100755 index 00000000..f0e29fa6 --- /dev/null +++ b/images/browser-view-images/naviframe_optionheader.png diff --git a/images/browser-view-images/naviframe_optionheader_arrow.png b/images/browser-view-images/naviframe_optionheader_arrow.png Binary files differnew file mode 100755 index 00000000..da1d6a41 --- /dev/null +++ b/images/browser-view-images/naviframe_optionheader_arrow.png diff --git a/images/browser-view-images/progressbar/00_search_input_field_bg_progress.png b/images/browser-view-images/progressbar/00_search_input_field_bg_progress.png Binary files differnew file mode 100755 index 00000000..2074697e --- /dev/null +++ b/images/browser-view-images/progressbar/00_search_input_field_bg_progress.png diff --git a/images/browser-view-images/progressbar/processing_ani00.png b/images/browser-view-images/progressbar/processing_ani00.png Binary files differnew file mode 100755 index 00000000..0b316c3c --- /dev/null +++ b/images/browser-view-images/progressbar/processing_ani00.png diff --git a/images/browser-view-images/progressbar/processing_ani01.png b/images/browser-view-images/progressbar/processing_ani01.png Binary files differnew file mode 100755 index 00000000..732a6b81 --- /dev/null +++ b/images/browser-view-images/progressbar/processing_ani01.png diff --git a/images/browser-view-images/progressbar/processing_ani02.png b/images/browser-view-images/progressbar/processing_ani02.png Binary files differnew file mode 100755 index 00000000..f85d7dc3 --- /dev/null +++ b/images/browser-view-images/progressbar/processing_ani02.png diff --git a/images/browser-view-images/progressbar/processing_ani03.png b/images/browser-view-images/progressbar/processing_ani03.png Binary files differnew file mode 100755 index 00000000..697a2b54 --- /dev/null +++ b/images/browser-view-images/progressbar/processing_ani03.png diff --git a/images/browser-view-images/progressbar/processing_ani04.png b/images/browser-view-images/progressbar/processing_ani04.png Binary files differnew file mode 100755 index 00000000..a71b39ba --- /dev/null +++ b/images/browser-view-images/progressbar/processing_ani04.png diff --git a/images/browser-view-images/progressbar/processing_ani05.png b/images/browser-view-images/progressbar/processing_ani05.png Binary files differnew file mode 100755 index 00000000..8bda27ed --- /dev/null +++ b/images/browser-view-images/progressbar/processing_ani05.png diff --git a/images/browser-view-images/progressbar/processing_ani06.png b/images/browser-view-images/progressbar/processing_ani06.png Binary files differnew file mode 100755 index 00000000..68452196 --- /dev/null +++ b/images/browser-view-images/progressbar/processing_ani06.png diff --git a/images/browser-view-images/progressbar/processing_ani07.png b/images/browser-view-images/progressbar/processing_ani07.png Binary files differnew file mode 100755 index 00000000..331129b3 --- /dev/null +++ b/images/browser-view-images/progressbar/processing_ani07.png diff --git a/images/browser-view-images/progressbar/progressbar.png b/images/browser-view-images/progressbar/progressbar.png Binary files differnew file mode 100755 index 00000000..27ea9a46 --- /dev/null +++ b/images/browser-view-images/progressbar/progressbar.png diff --git a/images/browser-view-images/reader/I01_popup_bg.png b/images/browser-view-images/reader/I01_popup_bg.png Binary files differnew file mode 100755 index 00000000..fd2e1cd3 --- /dev/null +++ b/images/browser-view-images/reader/I01_popup_bg.png diff --git a/images/browser-view-images/reader/I01_popup_bottom_bg.png b/images/browser-view-images/reader/I01_popup_bottom_bg.png Binary files differnew file mode 100755 index 00000000..acd9cd2d --- /dev/null +++ b/images/browser-view-images/reader/I01_popup_bottom_bg.png diff --git a/images/browser-view-images/url-layout/00_EditField_clear.png b/images/browser-view-images/url-layout/00_EditField_clear.png Binary files differnew file mode 100755 index 00000000..79b89f18 --- /dev/null +++ b/images/browser-view-images/url-layout/00_EditField_clear.png diff --git a/images/browser-view-images/url-layout/00_search_input_field_bg.png b/images/browser-view-images/url-layout/00_search_input_field_bg.png Binary files differnew file mode 100755 index 00000000..e2051a3e --- /dev/null +++ b/images/browser-view-images/url-layout/00_search_input_field_bg.png diff --git a/images/browser-view-images/url-layout/00_search_input_field_bg_black.png b/images/browser-view-images/url-layout/00_search_input_field_bg_black.png Binary files differnew file mode 100755 index 00000000..e3d3264e --- /dev/null +++ b/images/browser-view-images/url-layout/00_search_input_field_bg_black.png diff --git a/images/browser-view-images/url-layout/41_browser_search_icon.png b/images/browser-view-images/url-layout/41_browser_search_icon.png Binary files differnew file mode 100755 index 00000000..6f1b07c2 --- /dev/null +++ b/images/browser-view-images/url-layout/41_browser_search_icon.png diff --git a/images/browser-view-images/url-layout/41_browser_search_icon_refresh.png b/images/browser-view-images/url-layout/41_browser_search_icon_refresh.png Binary files differnew file mode 100755 index 00000000..c93d36b2 --- /dev/null +++ b/images/browser-view-images/url-layout/41_browser_search_icon_refresh.png diff --git a/images/browser-view-images/url-layout/I01_Icons_RSS.png b/images/browser-view-images/url-layout/I01_Icons_RSS.png Binary files differnew file mode 100755 index 00000000..e72696cc --- /dev/null +++ b/images/browser-view-images/url-layout/I01_Icons_RSS.png diff --git a/images/browser-view-images/url-layout/I01_Icons_http.png b/images/browser-view-images/url-layout/I01_Icons_http.png Binary files differnew file mode 100755 index 00000000..852978c8 --- /dev/null +++ b/images/browser-view-images/url-layout/I01_Icons_http.png diff --git a/images/browser-view-images/url-layout/I01_control_top_bg.png b/images/browser-view-images/url-layout/I01_control_top_bg.png Binary files differnew file mode 100755 index 00000000..a9a20a8a --- /dev/null +++ b/images/browser-view-images/url-layout/I01_control_top_bg.png diff --git a/images/browser-view-images/url-layout/I01_icon_find_word.png b/images/browser-view-images/url-layout/I01_icon_find_word.png Binary files differnew file mode 100755 index 00000000..0054df59 --- /dev/null +++ b/images/browser-view-images/url-layout/I01_icon_find_word.png diff --git a/images/browser-view-images/url-layout/icon_stop.png b/images/browser-view-images/url-layout/icon_stop.png Binary files differnew file mode 100755 index 00000000..8051b66c --- /dev/null +++ b/images/browser-view-images/url-layout/icon_stop.png diff --git a/images/browser-view-images/url-layout/naviframe_optionheader.png b/images/browser-view-images/url-layout/naviframe_optionheader.png Binary files differnew file mode 100755 index 00000000..df8d29fc --- /dev/null +++ b/images/browser-view-images/url-layout/naviframe_optionheader.png diff --git a/images/browser-view-images/url-layout/rss.png b/images/browser-view-images/url-layout/rss.png Binary files differnew file mode 100755 index 00000000..9abe5d7d --- /dev/null +++ b/images/browser-view-images/url-layout/rss.png diff --git a/images/favicons/WebpageIcons.db b/images/favicons/WebpageIcons.db Binary files differnew file mode 100755 index 00000000..31a2a623 --- /dev/null +++ b/images/favicons/WebpageIcons.db diff --git a/images/favicons/WebpageIcons.db-journal b/images/favicons/WebpageIcons.db-journal Binary files differnew file mode 100755 index 00000000..b69a7f55 --- /dev/null +++ b/images/favicons/WebpageIcons.db-journal diff --git a/images/icon/00_close_icon.png b/images/icon/00_close_icon.png Binary files differnew file mode 100755 index 00000000..47d08e05 --- /dev/null +++ b/images/icon/00_close_icon.png diff --git a/images/icon/I01_Back_btn_normal.png b/images/icon/I01_Back_btn_normal.png Binary files differnew file mode 100755 index 00000000..cb7ca0bc --- /dev/null +++ b/images/icon/I01_Back_btn_normal.png diff --git a/images/icon/I01_Back_btn_press.png b/images/icon/I01_Back_btn_press.png Binary files differnew file mode 100755 index 00000000..7032b70f --- /dev/null +++ b/images/icon/I01_Back_btn_press.png diff --git a/images/icon/I01_Option_header_bt.png b/images/icon/I01_Option_header_bt.png Binary files differnew file mode 100755 index 00000000..51cd8e7c --- /dev/null +++ b/images/icon/I01_Option_header_bt.png diff --git a/images/icon/I01_Option_header_bt_dim.png b/images/icon/I01_Option_header_bt_dim.png Binary files differnew file mode 100755 index 00000000..075bbaa3 --- /dev/null +++ b/images/icon/I01_Option_header_bt_dim.png diff --git a/images/icon/I01_Option_header_bt_press.png b/images/icon/I01_Option_header_bt_press.png Binary files differnew file mode 100755 index 00000000..cbf3c70f --- /dev/null +++ b/images/icon/I01_Option_header_bt_press.png diff --git a/images/icon/I01_btn_back.png b/images/icon/I01_btn_back.png Binary files differnew file mode 100755 index 00000000..780e24e9 --- /dev/null +++ b/images/icon/I01_btn_back.png diff --git a/images/icon/I01_btn_normal.png b/images/icon/I01_btn_normal.png Binary files differnew file mode 100755 index 00000000..56c1a8a4 --- /dev/null +++ b/images/icon/I01_btn_normal.png diff --git a/images/icon/I01_btn_press.png b/images/icon/I01_btn_press.png Binary files differnew file mode 100755 index 00000000..fd3be6c2 --- /dev/null +++ b/images/icon/I01_btn_press.png diff --git a/images/icon/I01_button_04_press.png b/images/icon/I01_button_04_press.png Binary files differnew file mode 100755 index 00000000..e6916710 --- /dev/null +++ b/images/icon/I01_button_04_press.png diff --git a/images/icon/I01_control_btn_normal.png b/images/icon/I01_control_btn_normal.png Binary files differnew file mode 100755 index 00000000..c2e78f31 --- /dev/null +++ b/images/icon/I01_control_btn_normal.png diff --git a/images/icon/I01_controlbar_icon_favorite.png b/images/icon/I01_controlbar_icon_favorite.png Binary files differnew file mode 100755 index 00000000..38b86e98 --- /dev/null +++ b/images/icon/I01_controlbar_icon_favorite.png diff --git a/images/icon/I01_controlbar_icon_multiview.png b/images/icon/I01_controlbar_icon_multiview.png Binary files differnew file mode 100755 index 00000000..3b7e23e6 --- /dev/null +++ b/images/icon/I01_controlbar_icon_multiview.png diff --git a/images/icon/I01_fit_screen.png b/images/icon/I01_fit_screen.png Binary files differnew file mode 100755 index 00000000..666ba6cb --- /dev/null +++ b/images/icon/I01_fit_screen.png diff --git a/images/icon/I01_picker_arrow_left.png b/images/icon/I01_picker_arrow_left.png Binary files differnew file mode 100755 index 00000000..b47bd1de --- /dev/null +++ b/images/icon/I01_picker_arrow_left.png diff --git a/images/icon/I01_picker_arrow_right.png b/images/icon/I01_picker_arrow_right.png Binary files differnew file mode 100755 index 00000000..3692d2af --- /dev/null +++ b/images/icon/I01_picker_arrow_right.png diff --git a/images/icon/I01_title_btn.png b/images/icon/I01_title_btn.png Binary files differnew file mode 100755 index 00000000..10a253fb --- /dev/null +++ b/images/icon/I01_title_btn.png diff --git a/images/icon/I01_title_btn_press.png b/images/icon/I01_title_btn_press.png Binary files differnew file mode 100755 index 00000000..f40f1347 --- /dev/null +++ b/images/icon/I01_title_btn_press.png diff --git a/images/icon/I01_title_icon_multiview.png b/images/icon/I01_title_icon_multiview.png Binary files differnew file mode 100755 index 00000000..2d731eba --- /dev/null +++ b/images/icon/I01_title_icon_multiview.png diff --git a/images/icon/I01_title_icon_multiview_press.png b/images/icon/I01_title_icon_multiview_press.png Binary files differnew file mode 100755 index 00000000..325487a3 --- /dev/null +++ b/images/icon/I01_title_icon_multiview_press.png diff --git a/images/icon/backward_1.png b/images/icon/backward_1.png Binary files differnew file mode 100755 index 00000000..b6166d0e --- /dev/null +++ b/images/icon/backward_1.png diff --git a/images/icon/backward_2.png b/images/icon/backward_2.png Binary files differnew file mode 100755 index 00000000..9abfbafc --- /dev/null +++ b/images/icon/backward_2.png diff --git a/images/install/00_brightness_left.png b/images/install/00_brightness_left.png Binary files differnew file mode 100755 index 00000000..3f44b8f3 --- /dev/null +++ b/images/install/00_brightness_left.png diff --git a/images/install/00_brightness_right.png b/images/install/00_brightness_right.png Binary files differnew file mode 100755 index 00000000..06cf04fd --- /dev/null +++ b/images/install/00_brightness_right.png diff --git a/images/install/01_controlbar_icon_back.png b/images/install/01_controlbar_icon_back.png Binary files differnew file mode 100755 index 00000000..64dbf1b9 --- /dev/null +++ b/images/install/01_controlbar_icon_back.png diff --git a/images/install/01_controlbar_icon_compose.png b/images/install/01_controlbar_icon_compose.png Binary files differnew file mode 100755 index 00000000..20b71f7b --- /dev/null +++ b/images/install/01_controlbar_icon_compose.png diff --git a/images/install/01_controlbar_icon_create_folder.png b/images/install/01_controlbar_icon_create_folder.png Binary files differnew file mode 100755 index 00000000..d74811f0 --- /dev/null +++ b/images/install/01_controlbar_icon_create_folder.png diff --git a/images/install/01_controlbar_icon_delete.png b/images/install/01_controlbar_icon_delete.png Binary files differnew file mode 100755 index 00000000..faaa0d3d --- /dev/null +++ b/images/install/01_controlbar_icon_delete.png diff --git a/images/install/01_controlbar_icon_expand.png b/images/install/01_controlbar_icon_expand.png Binary files differnew file mode 100755 index 00000000..bf9b0de2 --- /dev/null +++ b/images/install/01_controlbar_icon_expand.png diff --git a/images/install/01_controlbar_icon_multiview.png b/images/install/01_controlbar_icon_multiview.png Binary files differnew file mode 100755 index 00000000..2d731eba --- /dev/null +++ b/images/install/01_controlbar_icon_multiview.png diff --git a/images/install/01_controlbar_icon_multiview_02.png b/images/install/01_controlbar_icon_multiview_02.png Binary files differnew file mode 100755 index 00000000..32ff6458 --- /dev/null +++ b/images/install/01_controlbar_icon_multiview_02.png diff --git a/images/install/01_controlbar_icon_multiview_03.png b/images/install/01_controlbar_icon_multiview_03.png Binary files differnew file mode 100755 index 00000000..8d749490 --- /dev/null +++ b/images/install/01_controlbar_icon_multiview_03.png diff --git a/images/install/01_controlbar_icon_multiview_04.png b/images/install/01_controlbar_icon_multiview_04.png Binary files differnew file mode 100755 index 00000000..66bc543b --- /dev/null +++ b/images/install/01_controlbar_icon_multiview_04.png diff --git a/images/install/01_controlbar_icon_multiview_05.png b/images/install/01_controlbar_icon_multiview_05.png Binary files differnew file mode 100755 index 00000000..f17bba08 --- /dev/null +++ b/images/install/01_controlbar_icon_multiview_05.png diff --git a/images/install/01_controlbar_icon_multiview_06.png b/images/install/01_controlbar_icon_multiview_06.png Binary files differnew file mode 100755 index 00000000..dce660ab --- /dev/null +++ b/images/install/01_controlbar_icon_multiview_06.png diff --git a/images/install/01_controlbar_icon_multiview_07.png b/images/install/01_controlbar_icon_multiview_07.png Binary files differnew file mode 100755 index 00000000..427f1716 --- /dev/null +++ b/images/install/01_controlbar_icon_multiview_07.png diff --git a/images/install/01_controlbar_icon_multiview_08.png b/images/install/01_controlbar_icon_multiview_08.png Binary files differnew file mode 100755 index 00000000..8c4467c3 --- /dev/null +++ b/images/install/01_controlbar_icon_multiview_08.png diff --git a/images/install/01_controlbar_icon_multiview_09.png b/images/install/01_controlbar_icon_multiview_09.png Binary files differnew file mode 100755 index 00000000..5a7719f3 --- /dev/null +++ b/images/install/01_controlbar_icon_multiview_09.png diff --git a/images/install/01_controlbar_icon_send.png b/images/install/01_controlbar_icon_send.png Binary files differnew file mode 100755 index 00000000..7855940f --- /dev/null +++ b/images/install/01_controlbar_icon_send.png diff --git a/images/install/01_controllbar_icon_close.png b/images/install/01_controllbar_icon_close.png Binary files differnew file mode 100755 index 00000000..91b04e56 --- /dev/null +++ b/images/install/01_controllbar_icon_close.png diff --git a/images/install/01_header_icon_add.png b/images/install/01_header_icon_add.png Binary files differnew file mode 100755 index 00000000..43c4984e --- /dev/null +++ b/images/install/01_header_icon_add.png diff --git a/images/install/01_header_icon_cancel.png b/images/install/01_header_icon_cancel.png Binary files differnew file mode 100755 index 00000000..4fb54c34 --- /dev/null +++ b/images/install/01_header_icon_cancel.png diff --git a/images/install/01_header_icon_delete.png b/images/install/01_header_icon_delete.png Binary files differnew file mode 100755 index 00000000..f02f45cb --- /dev/null +++ b/images/install/01_header_icon_delete.png diff --git a/images/install/01_header_icon_done.png b/images/install/01_header_icon_done.png Binary files differnew file mode 100755 index 00000000..d771640c --- /dev/null +++ b/images/install/01_header_icon_done.png diff --git a/images/install/01_header_icon_edit.png b/images/install/01_header_icon_edit.png Binary files differnew file mode 100755 index 00000000..ea2535d3 --- /dev/null +++ b/images/install/01_header_icon_edit.png diff --git a/images/install/01_header_icon_others.png b/images/install/01_header_icon_others.png Binary files differnew file mode 100755 index 00000000..4fc9dfa9 --- /dev/null +++ b/images/install/01_header_icon_others.png diff --git a/images/install/41_browser_search_icon.png b/images/install/41_browser_search_icon.png Binary files differnew file mode 100755 index 00000000..6f1b07c2 --- /dev/null +++ b/images/install/41_browser_search_icon.png diff --git a/images/install/I01_Icons_http.png b/images/install/I01_Icons_http.png Binary files differnew file mode 100755 index 00000000..852978c8 --- /dev/null +++ b/images/install/I01_Icons_http.png diff --git a/images/install/I01_controlbar_icon_Play.png b/images/install/I01_controlbar_icon_Play.png Binary files differnew file mode 100755 index 00000000..4a0505ee --- /dev/null +++ b/images/install/I01_controlbar_icon_Play.png diff --git a/images/install/I01_controlbar_icon_backward.png b/images/install/I01_controlbar_icon_backward.png Binary files differnew file mode 100755 index 00000000..066f51c9 --- /dev/null +++ b/images/install/I01_controlbar_icon_backward.png diff --git a/images/install/I01_controlbar_icon_bookmark.png b/images/install/I01_controlbar_icon_bookmark.png Binary files differnew file mode 100755 index 00000000..5a9f5227 --- /dev/null +++ b/images/install/I01_controlbar_icon_bookmark.png diff --git a/images/install/I01_controlbar_icon_create.png b/images/install/I01_controlbar_icon_create.png Binary files differnew file mode 100755 index 00000000..0dc11441 --- /dev/null +++ b/images/install/I01_controlbar_icon_create.png diff --git a/images/install/I01_controlbar_icon_more.png b/images/install/I01_controlbar_icon_more.png Binary files differnew file mode 100755 index 00000000..6e2fbd66 --- /dev/null +++ b/images/install/I01_controlbar_icon_more.png diff --git a/images/install/I01_icon_upper_folder.png b/images/install/I01_icon_upper_folder.png Binary files differnew file mode 100755 index 00000000..d8dd048e --- /dev/null +++ b/images/install/I01_icon_upper_folder.png diff --git a/images/install/I01_icon_upper_folder_press.png b/images/install/I01_icon_upper_folder_press.png Binary files differnew file mode 100755 index 00000000..c6a88539 --- /dev/null +++ b/images/install/I01_icon_upper_folder_press.png diff --git a/images/install/T01_CallerID_hold.png b/images/install/T01_CallerID_hold.png Binary files differnew file mode 100755 index 00000000..b31bc39a --- /dev/null +++ b/images/install/T01_CallerID_hold.png diff --git a/images/install/T01_CallerID_line_W.png b/images/install/T01_CallerID_line_W.png Binary files differnew file mode 100755 index 00000000..f436338d --- /dev/null +++ b/images/install/T01_CallerID_line_W.png diff --git a/images/install/T01_CallerID_line_W_press.png b/images/install/T01_CallerID_line_W_press.png Binary files differnew file mode 100755 index 00000000..2db81792 --- /dev/null +++ b/images/install/T01_CallerID_line_W_press.png diff --git a/images/install/T01_CallerID_line_h.png b/images/install/T01_CallerID_line_h.png Binary files differnew file mode 100755 index 00000000..587a6da8 --- /dev/null +++ b/images/install/T01_CallerID_line_h.png diff --git a/images/install/T01_CallerID_line_h_press.png b/images/install/T01_CallerID_line_h_press.png Binary files differnew file mode 100755 index 00000000..2bd8f824 --- /dev/null +++ b/images/install/T01_CallerID_line_h_press.png diff --git a/images/install/T01_CallerID_normal.png b/images/install/T01_CallerID_normal.png Binary files differnew file mode 100755 index 00000000..1787cdeb --- /dev/null +++ b/images/install/T01_CallerID_normal.png diff --git a/images/install/T01_CallerID_press.png b/images/install/T01_CallerID_press.png Binary files differnew file mode 100755 index 00000000..fc649331 --- /dev/null +++ b/images/install/T01_CallerID_press.png diff --git a/images/install/T01_btn_apps_close.png b/images/install/T01_btn_apps_close.png Binary files differnew file mode 100755 index 00000000..2a052193 --- /dev/null +++ b/images/install/T01_btn_apps_close.png diff --git a/images/install/T01_btn_optiontray.png b/images/install/T01_btn_optiontray.png Binary files differnew file mode 100755 index 00000000..acaf908b --- /dev/null +++ b/images/install/T01_btn_optiontray.png diff --git a/images/install/T01_control_icon_apps.png b/images/install/T01_control_icon_apps.png Binary files differnew file mode 100755 index 00000000..439a9fa0 --- /dev/null +++ b/images/install/T01_control_icon_apps.png diff --git a/images/install/download_invert.png b/images/install/download_invert.png Binary files differnew file mode 100755 index 00000000..c4e5338b --- /dev/null +++ b/images/install/download_invert.png diff --git a/images/install/faviconDefault.png b/images/install/faviconDefault.png Binary files differnew file mode 100755 index 00000000..ab6014b4 --- /dev/null +++ b/images/install/faviconDefault.png diff --git a/images/install/folder.png b/images/install/folder.png Binary files differnew file mode 100755 index 00000000..a82226c4 --- /dev/null +++ b/images/install/folder.png diff --git a/images/install/globe.png b/images/install/globe.png Binary files differnew file mode 100755 index 00000000..a1480738 --- /dev/null +++ b/images/install/globe.png diff --git a/images/install/lock.png b/images/install/lock.png Binary files differnew file mode 100755 index 00000000..edb21742 --- /dev/null +++ b/images/install/lock.png diff --git a/images/install/reader_invert.png b/images/install/reader_invert.png Binary files differnew file mode 100755 index 00000000..47699296 --- /dev/null +++ b/images/install/reader_invert.png diff --git a/images/install/rss_invert.png b/images/install/rss_invert.png Binary files differnew file mode 100755 index 00000000..f18e2aa0 --- /dev/null +++ b/images/install/rss_invert.png diff --git a/images/install/upOneLevel.png b/images/install/upOneLevel.png Binary files differnew file mode 100755 index 00000000..c3765223 --- /dev/null +++ b/images/install/upOneLevel.png diff --git a/images/multi-window/I01_Btn_delete_01.png b/images/multi-window/I01_Btn_delete_01.png Binary files differnew file mode 100755 index 00000000..3d60d761 --- /dev/null +++ b/images/multi-window/I01_Btn_delete_01.png diff --git a/images/multi-window/I01_Btn_delete_01_press.png b/images/multi-window/I01_Btn_delete_01_press.png Binary files differnew file mode 100755 index 00000000..8e5b4059 --- /dev/null +++ b/images/multi-window/I01_Btn_delete_01_press.png diff --git a/packaging/org.tizen.browser.spec b/packaging/org.tizen.browser.spec new file mode 100644 index 00000000..ef0ae2b8 --- /dev/null +++ b/packaging/org.tizen.browser.spec @@ -0,0 +1,307 @@ +%define appdir /opt/apps/org.tizen.browser + +Name: org.tizen.browser +Summary: webkit browser with EFL +Version: 0.1.14 +Release: 2 +Group: Applications +License: Flora Software License +Source0: %{name}-%{version}.tar.bz2 +#Patch0: change-float-abi.patch +Requires(post): /usr/bin/sqlite3 +BuildRequires: pkgconfig(appcore-efl) +BuildRequires: pkgconfig(gnutls) +BuildRequires: pkgconfig(appsvc) +BuildRequires: pkgconfig(db-util) +BuildRequires: pkgconfig(devman) +BuildRequires: pkgconfig(dlog) +BuildRequires: pkgconfig(ecore) +BuildRequires: pkgconfig(ecore-evas) +BuildRequires: pkgconfig(ecore-imf) +BuildRequires: pkgconfig(ecore-input) +BuildRequires: pkgconfig(ecore-x) +BuildRequires: pkgconfig(edbus) +BuildRequires: pkgconfig(edje) +BuildRequires: pkgconfig(eina) +BuildRequires: pkgconfig(elementary) +BuildRequires: pkgconfig(elm-webview) +BuildRequires: pkgconfig(evas) +BuildRequires: pkgconfig(ewebkit) +BuildRequires: pkgconfig(libsoup-2.4) +BuildRequires: pkgconfig(libssl) +BuildRequires: pkgconfig(libxml-2.0) +BuildRequires: pkgconfig(notification) +BuildRequires: pkgconfig(secure-storage) +BuildRequires: pkgconfig(sensor) +BuildRequires: pkgconfig(tapi) +BuildRequires: pkgconfig(ui-gadget) +BuildRequires: pkgconfig(utilX) +BuildRequires: pkgconfig(accounts-svc) +BuildRequires: pkgconfig(libsoup-2.4) +BuildRequires: pkgconfig(ewebkit) +BuildRequires: pkgconfig(syspopup-caller) +BuildRequires: pkgconfig(capi-web-url-download) +BuildRequires: pkgconfig(capi-appfw-app-manager) +BuildRequires: pkgconfig(capi-appfw-application) +BuildRequires: pkgconfig(devman_haptic) + +BuildRequires: cmake +BuildRequires: gettext-tools +BuildRequires: edje-tools + +%description +webkit browser with EFL. + + + +%prep +%setup -q +#%patch0 -p1 + +%build +export LDFLAGS+="-Wl,--rpath=%{appdir}/lib -Wl,--hash-style=both -Wl,--as-needed" +LDFLAGS="$LDFLAGS" +cmake . -DCMAKE_INSTALL_PREFIX=%{appdir} + +make %{?jobs:-j%jobs} + +%install +%make_install + +%post +# Change file owner +if [ ${USER} == "root" ] +then + # Change file owner + chown -R 5000:5000 /opt/apps/org.tizen.browser/data +fi + +### Bookmark ### +if [ ! -f /opt/dbspace/.internet_bookmark.db ]; +then + sqlite3 /opt/dbspace/.internet_bookmark.db 'PRAGMA journal_mode=PERSIST; + CREATE TABLE bookmarks(id INTEGER PRIMARY KEY AUTOINCREMENT, type INTEGER, parent INTEGER, address, title, creationdate, sequence INTEGER, updatedate, editable INTEGER, accesscount INTEGER, favicon BLOB, favicon_length INTEGER, favicon_w INTEGER, favicon_h INTEGER); + create index idx_bookmarks_on_parent_type on bookmarks(parent, type); + + insert into bookmarks (type, parent, title, creationdate, editable, sequence, accesscount) values(1, 0, "Bookmarks", DATETIME("now"), 0, 1, 0);' +fi + +##### History ###### +if [ ! -f /opt/dbspace/.browser-history.db ]; +then + sqlite3 /opt/dbspace/.browser-history.db 'PRAGMA journal_mode=PERSIST; + CREATE TABLE history(id INTEGER PRIMARY KEY AUTOINCREMENT, address, title, counter INTEGER, visitdate DATETIME, favicon BLOB, favicon_length INTEGER, favicon_w INTEGER, favicon_h INTEGER);' +fi + +mkdir -p /opt/apps/org.tizen.browser/data/db +##### Notification ##### +if [ ! -f /opt/apps/org.tizen.browser/data/db/.browser-notification.db ]; +then + sqlite3 /opt/apps/org.tizen.browser/data/db/.browser-notification.db 'PRAGMA journal_mode=PERSIST; + CREATE TABLE notification_table(id INTEGER PRIMARY KEY AUTOINCREMENT, notification INTEGER, title, body, url, iconURL, iconValidity INTEGER); + CREATE TABLE notification_permitted_domains(domain PRIMARY KEY);' +fi + +##### Password ###### +if [ ! -f /opt/apps/org.tizen.browser/data/db/.browser-credential.db ]; +then + sqlite3 /opt/apps/org.tizen.browser/data/db/.browser-credential.db 'PRAGMA journal_mode=PERSIST; + create table passwords(id integer primary key autoincrement, address, login, password)' +fi + +#### USER AGENTS ##### +#initDB +#rm /opt/apps/org.tizen.browser/data/db/.browser.db +# create db +#FILE = /opt/apps/org.tizen.browser/data/db/.browser.db +if [ ! -f /opt/apps/org.tizen.browser/data/db/.browser.db ]; +then + sqlite3 /opt/apps/org.tizen.browser/data/db/.browser.db 'PRAGMA journal_mode=PERSIST; + create table user_agents(name primary key, value)' + # mobile + sqlite3 /opt/apps/org.tizen.browser/data/db/.browser.db 'PRAGMA journal_mode=PERSIST; + insert into user_agents values("Galaxy S", "Mozilla/5.0 (Linux; U; Android 2.3.3; en-gb; GT-I9000 Build/GINGERBREAD) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1"); + insert into user_agents values("Galaxy S II", "Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; GT-I9100 Build/GINGERBREAD) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1"); + insert into user_agents values("SLP Galaxy", "Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; GT-I9500 Build/GINGERBREAD) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1"); + insert into user_agents values("Tizen", "Mozilla/5.0 (Linux; U; Tizen 1.0; en-us) AppleWebKit/534.46 (KHTML, like Gecko) Mobile Tizen Browser/1.0"); + insert into user_agents values("Galaxy Nexus", "Mozilla/5.0 (Linux; U; Android 4.0.1; en-us; Galaxy Nexus Build/ITL31) AppleWebkit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30"); + insert into user_agents values("Samsung", "Mozilla/5.0 (SAMSUNG; SAMSUNG-GT-I9200/1.0; U; Linux/SLP/2.0; ko-kr) AppleWebKit/534.4 (KHTML, like Gecko) Dolfin/2.0 Mobile"); + insert into user_agents values("Samsung Dolfin", "SAMSUNG-GT-S8500/S8500XXJD2 SHP/VPP/R5 Dolfin/2.0 Nextreaming SMM-MMS/1.2.0 profile/MIDP-2.1 configuration/CLDC-1.1"); + insert into user_agents values("Apple iPhone 3", "Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0 like Mac OS X; en-us) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/1A542a Safari/419.3"); + insert into user_agents values("Apple iPhone 4", "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_2_1 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Mobile/8C148 Safari/6533.18.5"); + insert into user_agents values("Apple iOS 5", "Mozilla/5.0 (iPhone; CPU iPhone OS 5_0 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.0.2 Mobile/9A5259f Safari/6533.18.5"); + insert into user_agents values("Android 2.1 (Nexus One)", "Mozilla/5.0 (Linux; U; Android 2.1; en-us; Nexus One Build/ERD62) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17"); + insert into user_agents values("Opera Mobi", "Opera/9.80 (Windows NT 6.1; Opera Mobi/49; U; en) Presto/2.4.18 Version/10.00"); + insert into user_agents values("Samsung Bada", "Mozilla/5.0 (SAMSUNG; SAMSUNG-GT-S8500/1.0; U; Bada/1.0; en-us) AppleWebKit/533.1 (KHTML, like Gecko) Dolfin/2.0 Mobile WVGA SMM-MMS/1.2.0 OPN-B"); + insert into user_agents values("Orange TV", "Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A543a Safari/419.3 OrangeAppliTV/2.3.9"); + insert into user_agents values("Chrome Browser for android", "Mozilla/5.0 (Linux; U; Android 4.0.1; ko-kr; Galaxy Nexus Build/ITL41F) AppleWebKit/535.7 (KHTML, like Gecko) CrMo/16.0.912.75 Mobile Safari/535.7"); + insert into user_agents values("Samsung Bada 2.0", "Mozilla/5.0 (SAMSUNG; SAMSUNG-GT-S8500/1.0; U; Bada/2.0; en-us) AppleWebKit/534.20 (KHTML, like Gecko) Mobile WVGA SMM-MMS/1.2.0 OPN-B Dolfin/3.0")' + + # desktop + sqlite3 /opt/apps/org.tizen.browser/data/db/.browser.db 'PRAGMA journal_mode=PERSIST; + insert into user_agents values("Samsung Desktop", "Mozilla/5.0 (U; Linux/SLP/2.0; ko-kr) AppleWebKit/533.1 (KHTML, like Gecko)"); + insert into user_agents values("Firefox 5", "Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20110706 Firefox/5.0 "); + insert into user_agents values("Firefox 5 Fennec(Mobile)", "Mozilla/5.0 (Android; Linux armv7l; rv:5.0) Gecko/20110615 Firefox/5.0 Fennec/5.0"); + insert into user_agents values("Safari 5.0", "Mozilla/5.0 (Windows; U; Windows NT 6.1; ja-JP) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16"); + insert into user_agents values("Google Chrome 13.0", "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.41 Safari/535.1"); + insert into user_agents values("Internet Explorer 9", "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)"); + insert into user_agents values("Galaxy Tab 10.1", "Mozilla/5.0 (Linux; U; Android 3.0.1; en-us; GT-P7100 Build/HRI83) AppleWebKit/534.13 (KHTML, like Gecko) Version/4.0 Safari/534.13"); + insert into user_agents values("iPad 2", "Mozilla/5.0(iPad; U; CPU OS 4_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8F191 Safari/6533.18.5")' +fi + +#init cookies DB +#rm /optpps/org.tizen.browser/data/db/dbspace/.browser-cookies.db +# create cookies db +#FILE = /opt/apps/org.tizen.browser/data/db/.browser-cookies.db + +if [ ! -f /opt/apps/org.tizen.browser/data/db/.browser-cookies.db ]; +then + sqlite3 /opt/apps/org.tizen.browser/data/db/.browser-cookies.db 'CREATE TABLE moz_cookies (id INTEGER PRIMARY KEY, name TEXT, value TEXT, host TEXT, path TEXT,expiry INTEGER, lastAccessed INTEGER, isSecure INTEGER, isHttpOnly INTEGER);' + #test cookie + #sqlite3 /opt/apps/org.tizen.browser/data/db/.browser-cookies.db 'INSERT INTO moz_cookies values(NULL, "cookies_name_test", "cookies_value_test", "www.cookies_test.com", "cookies_path_test", 2011, NULL, 1, 0);' +fi + +# Change db file owner & permission +if [ ${USER} == "root" ] +then + #chown root:root /opt/apps/org.tizen.browser/data/db + chown -R 5000:5000 /opt/apps/org.tizen.browser/data/db + chown :6002 /opt/apps/org.tizen.browser/data/db/.browser.db + chown :6002 /opt/apps/org.tizen.browser/data/db/.browser.db-journal + chown :6002 /opt/apps/org.tizen.browser/data/db/.browser-cookies.db + chown :6002 /opt/apps/org.tizen.browser/data/db/.browser-cookies.db-journal + chown :6002 /opt/dbspace/.browser-history.db + chown :6002 /opt/dbspace/.browser-history.db-journal + chown :6002 /opt/dbspace/.internet_bookmark.db + chown :6002 /opt/dbspace/.internet_bookmark.db-journal + chown :6002 /opt/apps/org.tizen.browser/data/db/.browser-credential.db + chown :6002 /opt/apps/org.tizen.browser/data/db/.browser-credential.db-journal + chown :6002 /opt/apps/org.tizen.browser/data/db/.browser-notification.db + chown :6002 /opt/apps/org.tizen.browser/data/db/.browser-notification.db-journal + chmod 660 /opt/apps/org.tizen.browser/data/db/.browser.db + chmod 660 /opt/apps/org.tizen.browser/data/db/.browser.db-journal + chmod 660 /opt/apps/org.tizen.browser/data/db/.browser-cookies.db + chmod 660 /opt/apps/org.tizen.browser/data/db/.browser-cookies.db-journal + chmod 666 /opt/dbspace/.browser-history.db + chmod 666 /opt/dbspace/.browser-history.db-journal + chmod 660 /opt/dbspace/.internet_bookmark.db + chmod 660 /opt/dbspace/.internet_bookmark.db-journal + chmod 660 /opt/apps/org.tizen.browser/data/db/.browser-credential.db + chmod 660 /opt/apps/org.tizen.browser/data/db/.browser-credential.db-journal + chmod 660 /opt/apps/org.tizen.browser/data/db/.browser-notification.db + chmod 660 /opt/apps/org.tizen.browser/data/db/.browser-notification.db-journal +fi + +################################################## +# set default vconf values +################################################## +if [ ${USER} == "root" ] +then + vconftool set -t bool db/browser/ShowMySitesGuide 1 -g 6514 + vconftool set -t string db/browser/Last/Url "" -g 6514 + vconftool set -t string db/browsersetting/LastVisitedUrl "" -g 6514 + vconftool set -t int db/browser/BrowserBrightnessLevel -1 -g 6514 +# Browser settings vconf values +# Set vconf values with -g/-u options + vconftool set -t string db/browsersetting/Homepage "Most visited sites" -g 6514 # "Most visited sites", "user set site", "Empty page" + vconftool set -t string db/browsersetting/HomepageMode "MOST_VISITED_SITES" -g 6514 + vconftool set -t string db/browsersetting/UserAgent "Tizen" -g 6514 + vconftool set -t string db/browsersetting/UserHomepage "www.tizen.org" -g 6514 # default site is www.tizen.org + vconftool set -t string db/browsersetting/DefaultViewLevel "Readable" -g 6514 # "Readable", "Fit to width" + vconftool set -t bool db/browsersetting/EnableLandscape 1 -g 6514 + vconftool set -t bool db/browsersetting/RunJavaScript 1 -g 6514 + vconftool set -t bool db/browsersetting/DisplayImages 1 -g 6514 + vconftool set -t bool db/browsersetting/BlockPopup 1 -g 6514 + vconftool set -t string db/browsersetting/AutoSaveIDPassword "Always ask" -g 6514 # "On", "Off" + vconftool set -t string db/browsersetting/SaveIDPassword "ALWAYS_ASK" -g 6514 # "On", "Off" + vconftool set -t string db/browsersetting/CustomUserAgent "" -g 6514 + # set default vconf value for reader + vconftool set -t bool db/browsersetting/RunReader 1 -g 6514 + vconftool set -t int db/browsersetting/FontSize 16 -g 6514 + # set default vconf value for plugins + vconftool set -t bool db/browsersetting/RunPlugins 1 -g 6514 + vconftool set -t bool db/browsersetting/RunFlash 0 -g 6514 + vconftool set -t bool db/browsersetting/PauseFlash 1 -g 6514 + # set search vconf + vconftool set -t string db/browsersetting/SearchEngine "Google" -g 6514 # "Google", "Yahoo", "Bing" + vconftool set -t string db/browsersetting/SearchUrl "http://www.google.com/m/search?q=" -g 6514 + vconftool set -t bool db/browsersetting/SearchCaseSensitive 0 -g 6514 + # privacy + vconftool set -t string db/browsersetting/CookieOption "Accept all" -g 6514 + vconftool set -t bool db/browsersetting/CookieOptionInt 1 -g 6514 + # performance + vconftool set -t bool db/browsersetting/FastRendering 1 -g 6514 + vconftool set -t bool db/browsersetting/LargeRenderingBuffer 1 -g 6514 + vconftool set -t bool db/browsersetting/AcceleratedComposition 1 -g 6514 + vconftool set -t bool db/browsersetting/SamsungAppsInstall 0 -g 6514 + vconftool set -t bool db/browsersetting/ExternalVideoPlayer 0 -g 6514 # if the AcceleratedComposition is 0, this must be 0 + vconftool set -t bool db/browsersetting/CompositedRenderLayerBorders 0 -g 6514 # if the AcceleratedComposition is 0, this must be 0 + vconftool set -t bool db/browsersetting/PhysicsEngine 0 -g 6514 + vconftool set -t bool db/browsersetting/RecordingSurface 0 -g 6514 + vconftool set -t bool db/browsersetting/RemoteWebInspector 0 -g 6514 + vconftool set -t bool db/browsersetting/DemoSetting 0 -g 6514 + vconftool set -t bool db/browsersetting/DemoMode 0 -g 6514 +else + vconftool set -t bool db/browser/ShowMySitesGuide 1 + vconftool set -t string db/browser/Last/Url "" + vconftool set -t string db/browsersetting/LastVisitedUrl "" + vconftool set -t int db/browser/BrowserBrightnessLevel -1 +# Browser settings vconf values +# Set without -g, -u options + vconftool set -t string db/browsersetting/Homepage "Recently visited site" # "Recently visited site", "user set site", "Empty page" + vconftool set -t string db/browsersetting/HomepageMode "MOST_VISITED_SITES" + vconftool set -t string db/browsersetting/UserHomepage "www.tizen.org" # default site is www.tizen.org + vconftool set -t string db/browsersetting/UserAgent "Tizen" + vconftool set -t string db/browsersetting/DefaultViewLevel "Readable" # "Readable", "Fit to width" + vconftool set -t bool db/browsersetting/EnableLandscape 1 + vconftool set -t bool db/browsersetting/RunJavaScript 1 + vconftool set -t bool db/browsersetting/DisplayImages 1 + vconftool set -t bool db/browsersetting/BlockPopup 1 + vconftool set -t string db/browsersetting/AutoSaveIDPassword "Always ask" # "On", "Off" + vconftool set -t string db/browsersetting/SaveIDPassword "ALWAYS_ASK" + vconftool set -t string db/browsersetting/CustomUserAgent "" + # set default vconf value for reader + vconftool set -t bool db/browsersetting/RunReader 1 + vconftool set -t int db/browsersetting/FontSize 16 + # set default vconf value for plugins + vconftool set -t bool db/browsersetting/RunPlugins 1 + vconftool set -t bool db/browsersetting/RunFlash 0 + # set search vconf + vconftool set -t string db/browsersetting/SearchEngine "Google" # "Google", "Yahoo", "Bing" + vconftool set -t string db/browsersetting/SearchUrl "http://www.google.com/m/search?q=" + vconftool set -t bool db/browsersetting/SearchCaseSensitive 0 + # privacy + vconftool set -t string db/browsersetting/CookieOption "Accept all" + vconftool set -t bool db/browsersetting/CookieOptionInt 1 + # performance + vconftool set -t bool db/browsersetting/FastRendering 1 + vconftool set -t bool db/browsersetting/LargeRenderingBuffer 1 + vconftool set -t bool db/browsersetting/AcceleratedComposition 1 + vconftool set -t bool db/browsersetting/SamsungAppsInstall 0 + vconftool set -t bool db/browsersetting/ExternalVideoPlayer 0 # if the AcceleratedComposition is 0, this must be 0 + vconftool set -t bool db/browsersetting/CompositedRenderLayerBorders 0 # if the AcceleratedComposition is 0, this must be 0 + vconftool set -t bool db/browsersetting/PhysicsEngine 0 + vconftool set -t bool db/browsersetting/RecordingSurface 0 + vconftool set -t bool db/browsersetting/RemoteWebInspector 0 + vconftool set -t bool db/browsersetting/DemoMode 0 + vconftool set -t bool db/browsersetting/DemoSetting 0 +fi + +%files +/opt/apps/org.tizen.browser/bin/browser +%dir %attr(-,inhouse,inhouse) /opt/apps/org.tizen.browser/data +%dir %attr(-,inhouse,inhouse) /opt/apps/org.tizen.browser/data/db +/opt/apps/org.tizen.browser/data/screenshots/default_0 +/opt/apps/org.tizen.browser/data/screenshots/default_1 +/opt/apps/org.tizen.browser/data/screenshots/default_2 +/opt/apps/org.tizen.browser/data/screenshots/default_3 +/opt/apps/org.tizen.browser/res/html/54_bg.png +/opt/apps/org.tizen.browser/res/html/EmbedInHtml.html +/opt/apps/org.tizen.browser/res/html/default_page.html +/opt/apps/org.tizen.browser/res/html/logo.png +/opt/apps/org.tizen.browser/res/html/notFoundPage.html +/opt/apps/org.tizen.browser/res/icons/default/small/org.tizen.browser.png +/opt/apps/org.tizen.browser/res/locale/*/*/browser.mo +/opt/apps/org.tizen.browser/res/images/* +/opt/apps/org.tizen.browser/res/edje/* +/opt/share/applications/* diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt new file mode 100755 index 00000000..3d2288f7 --- /dev/null +++ b/po/CMakeLists.txt @@ -0,0 +1,24 @@ +# for i18n + +SET(POFILES en.po ja_JP.po ko_KR.po zh_CN.po de_DE.po el_GR.po es_ES.po fr_FR.po it_IT.po nl_NL.po pt_PT.po ru_RU.po tr_TR.po zh_HK.po zh_TW.po) + +SET(MSGFMT "/usr/bin/msgfmt") + +FOREACH(pofile ${POFILES}) + SET(pofile ${CMAKE_CURRENT_SOURCE_DIR}/${pofile}) + MESSAGE("PO: ${pofile}") + GET_FILENAME_COMPONENT(absPofile ${pofile} ABSOLUTE) + GET_FILENAME_COMPONENT(lang ${absPofile} NAME_WE) + SET(moFile ${CMAKE_CURRENT_BINARY_DIR}/${lang}.mo) + ADD_CUSTOM_COMMAND( + OUTPUT ${moFile} + COMMAND ${MSGFMT} -o ${moFile} ${absPofile} + DEPENDS ${absPofile} + ) + INSTALL(FILES ${moFile} + DESTINATION ${LOCALE_DIR}/${lang}/LC_MESSAGES RENAME ${PROJECT_NAME}.mo) + SET(moFiles ${moFiles} ${moFile}) +ENDFOREACH(pofile) + +MESSAGE(".mo files: ${moFiles}") +ADD_CUSTOM_TARGET(po ALL DEPENDS ${moFiles}) diff --git a/po/POTFILES.in b/po/POTFILES.in new file mode 100755 index 00000000..0dc7146f --- /dev/null +++ b/po/POTFILES.in @@ -0,0 +1,6 @@ +# List of source files containing translatable strings. +src/AddToBookmarksView.cpp +src/BookmarksView.cpp +src/BrowserView.cpp +src/DownloadView.cpp +src/HistoryView.cpp diff --git a/po/de_DE.po b/po/de_DE.po new file mode 100755 index 00000000..a38c2cc7 --- /dev/null +++ b/po/de_DE.po @@ -0,0 +1,621 @@ +msgid "IDS_BR_POP_INSTALLATION_FAILED" +msgstr "Installation gescheitert" + +msgid "IDS_BR_BODY_NOTIFYING_ING" +msgstr "Benachrichtigung..." + +msgid "IDS_BR_BODY_PROCESSING_ING" +msgstr "Verarbeitung läuft ..." + +msgid "IDS_BR_BODY_PROCESSING_COMPLETED" +msgstr "Verarbeitung abgeschlossen" + +msgid "IDS_BR_SK_RETRY" +msgstr "Ern. vers." + +msgid "IDS_BR_HEADER_DOWNLOAD_MANAGER" +msgstr "Download-Manager" + +msgid "IDS_BR_POP_INVALIDDESCRIPTOR" +msgstr "Ungültiger Descriptor" + +msgid "IDS_BR_POP_UNABLE_TO_OPEN_FILE" +msgstr "Datei kann nicht geöffnet werden" + +msgid "IDS_BR_POP_DOWNLOAD_Q" +msgstr "Herunterladen?" + +msgid "IDS_BR_OPT_DELETE_SELECTED" +msgstr "Ausgewählt" + +msgid "IDS_BR_POP_DOWNLOAD_CANCELLED" +msgstr "Herunterladen abgebrochen" + +msgid "IDS_BR_BODY_CONTINUE_FROM_LAST_PAGE" +msgstr "Weiter von let. Seite" + +msgid "IDS_BR_BODY_PAGE" +msgstr "Seite" + +msgid "IDS_BR_OPT_DICTIONARY" +msgstr "Wörterbuch" + +msgid "IDS_BR_BODY_ABOUT_BROWSER" +msgstr "Browser-Info" + +msgid "IDS_BR_BODY_BROWSER_TYPE" +msgstr "Typ" + +msgid "IDS_BR_BODY_CERTIFICATE_ISSUER" +msgstr "Herausgeber" + +msgid "IDS_BR_BODY_DISPLAY_IMAGES" +msgstr "Bilder anzeigen" + +msgid "IDS_BR_BODY_DOWNLOAD" +msgstr "Herunterladen" + +msgid "IDS_BR_BODY_ENTER_URL" +msgstr "URL eingeben" + +msgid "IDS_BR_BODY_FOLDER" +msgstr "Ordner" + +msgid "IDS_BR_BODY_HOMEPAGE" +msgstr "Startseite" + +msgid "IDS_BR_BODY_LANDSCAPE_VIEW" +msgstr "Querformat" + +msgid "IDS_BR_BODY_NO_BOOKMARKS" +msgstr "Keine Favoriten" + +msgid "IDS_BR_BODY_NO_RESULTS_FOUND" +msgstr "Keine Ergebnisse gefunden" + +msgid "IDS_BR_BODY_OPTIONAL" +msgstr "Optional" + +msgid "IDS_BR_BODY_RSS" +msgstr "RSS" + +msgid "IDS_BR_BODY_RUN_FLASH" +msgstr "Flash ausführen" + +msgid "IDS_BR_BODY_RUN_JAVASCRIPT" +msgstr "JavaScript ausführen" + +msgid "IDS_BR_HEADER_COMMON_NAME_C" +msgstr "Allgemeiner Name:" + +msgid "IDS_BR_HEADER_ORGANIZATIONAL_UNIT_C" +msgstr "Organisationseinheit:" + +msgid "IDS_BR_HEADER_ORGANIZATION_C" +msgstr "Organisation:" + +msgid "IDS_BR_HEADER_USER_AGENT" +msgstr "Benutzer-Agent" + +msgid "IDS_BR_OPT_LAST_VIEWED_PAGE_ATNT" +msgstr "Last Viewed Page" + +msgid "IDS_BR_OPT_PREFERENCES" +msgstr "Benutzereinstellungen" + +msgid "IDS_BR_POP_ACTICATION_ERR" +msgstr "Aktivierungsfehler" + +msgid "IDS_BR_POP_ALREADY_RUNNING" +msgstr "Wird bereits ausgeführt" + +msgid "IDS_BR_POP_ERRORIMPLEMENTED" +msgstr "Nicht implementiert" + +msgid "IDS_BR_POP_HTTPERRAUTHFAILED" +msgstr "Authentifizierung fehlgeschlagen" + +msgid "IDS_BR_POP_OVERWRITE_Q" +msgstr "Überschreiben?" + +msgid "IDS_BR_POP_URL" +msgstr "URL" + +msgid "IDS_BR_TAB_HISTORY" +msgstr "Verlauf" + +msgid "IDS_BR_HEADER_DOWNLOAD_LIST" +msgstr "Download Liste" + +msgid "IDS_BR_POP_ALREADYINSTALLED" +msgstr "Bereits installiert" + +msgid "IDS_BR_POP_NOTIFYING" +msgstr "Benachrichtige..." + +msgid "IDS_BR_POP_NOTSUPPORT" +msgstr "Nicht unterstützter Inhalt" + +msgid "IDS_BR_POP_ERROR_C_UNABLE_TO_RESOLVE_HOST_NAME" +msgstr "Fehler: Hostname kann nicht aufgelöst werden." + +msgid "IDS_BR_POP_UNABLE_TO_REACH_PROXY" +msgstr "Proxy nicht erreichbar" + +msgid "IDS_BR_POP_NOSSLCERTI" +msgstr "Keine SSL-Zertifikate" + +msgid "IDS_BR_BODY_FILE_SIZE_EXCEEDS_MAXIMUM_UPLOAD_LIMIT" +msgstr "Dateigröße übersteigt maximale Upload-Grenze." + +msgid "IDS_BR_BODY_ENTER_NAME_C" +msgstr "Name eingeben:" + +msgid "IDS_BR_SK_NEXT" +msgstr "Weiter" + +msgid "IDS_BR_OPT_NEW_FOLDER" +msgstr "Neuer Ordner" + +msgid "IDS_BR_SK3_ADD_TO_BOOKMARKS" +msgstr "Zu Favoriten hzfg." + +msgid "IDS_BR_SK1_NEW_WINDOW" +msgstr "Neues Fenster" + +msgid "IDS_BR_BODY_URL" +msgstr "URL" + +msgid "IDS_BR_BODY_URL_C" +msgstr "URL:" + +msgid "IDS_BR_BODY_URL_NOT_AVAILABLE" +msgstr "URL nicht verfügbar" + +msgid "IDS_BR_BODY_URL_PS_NOT_AVAILABLE_IT_MIGHT_BE_DOWN_TEMPORARILY_OR_NO_LONGER_IN_USE" +msgstr "URL %s nicht verfügbar. Möglicherweise ist die Seite vorübergehend nicht erreichbar oder nicht mehr vorhanden." + +msgid "IDS_BR_HEADER_FOLDER" +msgstr "Ordner" + +msgid "IDS_BR_BODY_FOLDER_NAME" +msgstr "Ordnername" + +msgid "IDS_BR_BODY_FOLDER_NAME_ALREADY_IN_USE" +msgstr "Ordnername wird\nbereits verwendet" + +msgid "IDS_BR_BODY_NO_TITLE" +msgstr "Kein Titel" + +msgid "IDS_BR_HEADER_MULTI_WINDOW" +msgstr "Mehrfach-Fenster" + +msgid "IDS_BR_BODY_NO_HISTORIES" +msgstr "Keine Verläufe" + +msgid "IDS_BR_BODY_ADD_TO_BOOKMARKS" +msgstr "Zu Favoriten hinzufügen" + +msgid "IDS_BR_BODY_EDIT_BOOKMARK" +msgstr "Favorit bearbeiten" + +msgid "IDS_BR_BODY_FOLDER_NAME_C" +msgstr "Ordnername:" + +msgid "IDS_BR_OPT_SELECT_ALL" +msgstr "Alle auswählen" + +msgid "IDS_BR_OPT_DOWNLOAD_MANAGER" +msgstr "Download-Manager" + +msgid "IDS_BR_OPT_ADD_RSS_FEED" +msgstr "RSS-Feed hinzufügen" + +msgid "IDS_BR_OPT_ADD_RSS_FEEDS" +msgstr "RSS-Feeds hinzufügen" + +msgid "IDS_BR_OPT_SETTINGS" +msgstr "Einstellungen" + +msgid "IDS_BR_POP_ENTER_URL" +msgstr "URL eingeben" + +msgid "IDS_BR_BODY_AUTHPASSWORD" +msgstr "Passwort" + +msgid "IDS_BR_POP_INVALIDADDRESS" +msgstr "Ungültige Adresse" + +msgid "IDS_BR_POP_ALREADY_EXISTS_IN_DOWNLOAD_LIST" +msgstr "Besteht bereits in Download-Liste" + +msgid "IDS_BR_POP_ENTER_FOLDER_NAME" +msgstr "Ordnernamen eingeben" + +msgid "IDS_BR_POP_NO_PAGE" +msgstr "Keine Seite" + +msgid "IDS_BR_POP_NO_PAGES_BACKWARD" +msgstr "Keine Seiten zurück" + +msgid "IDS_BR_POP_NO_PAGES_FORWARD" +msgstr "Keine Seiten vorwärts" + +msgid "IDS_BR_POP_NO_PAGE_TO_RELOAD" +msgstr "Keine Seite zum erneuten Laden" + +msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED" +msgstr "Authentifizierung erforderlich" + +msgid "IDS_BR_POP_BOOKMARK_ALREADY_EXISTS" +msgstr "Lesezeichen ist bereits vorhanden." + +msgid "IDS_BR_POP_FOLDER_NAME_ALREADY_EXISTS" +msgstr "Ordnername bereits vorhanden" + +msgid "IDS_BR_POP_UNABLE_TO_SAVE_OBJECT_NOT_ENOUGH_SPACE_IN_CACHE" +msgstr "Objekt kann nicht gespeichert werden. Nicht genügend Cache verfügbar" + +msgid "IDS_BR_HEADER_SELECT_ITEMS" +msgstr "Elemente auswählen" + +msgid "IDS_BR_HEADER_CERTIFICATE_INFO" +msgstr "Zertifikatsinfo" + +msgid "IDS_BR_OPT_SHARE_VIA_EMAIL" +msgstr "Senden via E-Mail" + +msgid "IDS_BR_OPT_SHARE_VIA_MESSAGES" +msgstr "Senden via Nachricht" + +msgid "IDS_BR_OPT_SHARE_VIA" +msgstr "Senden via" + +msgid "IDS_BR_POP_UNABLE_TO_START_BROWSER" +msgstr "Browser kann nicht gestartet werden" + +msgid "IDS_BR_POP_NO_ADDRESS" +msgstr "Keine Adresse" + +msgid "IDS_BR_POP_NEVER_SHOW_AGAIN" +msgstr "Nicht erneut anzeigen" + +msgid "IDS_BR_POP_FILE_NAME_EMPTY" +msgstr "Dateiname leer" + +msgid "IDS_BR_SK3_CREATE_FOLDER" +msgstr "Ordner erstellen" + +msgid "IDS_BR_OPT_SELECTED" +msgstr "Ausgewählt" + +msgid "IDS_BR_OPT_SHARE" +msgstr "Senden via" + +msgid "IDS_BR_HEADER_RECENTLY_VISITED_PAGES" +msgstr "Kürzlich besuchte Seiten" + +msgid "IDS_BR_OPT_DISPLAY" +msgstr "Anzeige" + +msgid "IDS_BR_BODY_FIT_TO_WIDTH" +msgstr "An Breite anpassen" + +msgid "IDS_BR_BODY_READABLE" +msgstr "Lesbar" + +msgid "IDS_BR_BODY_PRIVACY" +msgstr "Datenschutz" + +msgid "IDS_BR_BODY_COOKIES" +msgstr "Cookies" + +msgid "IDS_BR_BODY_COOKIESACCEPTALL" +msgstr "Alle annehmen" + +msgid "IDS_BR_BODY_COOKIESPROMPT" +msgstr "Aufforderung" + +msgid "IDS_BR_HEADER_COOKIES" +msgstr "Cookies" + +msgid "IDS_BR_BODY_ACCEPT_COOKIES" +msgstr "Cookies akzeptieren" + +msgid "IDS_BR_OPT_ACCEPT_COOKIES" +msgstr "Cookies akzeptieren" + +msgid "IDS_BR_BODY_ACCEPT_ALL" +msgstr "Alle annehmen" + +msgid "IDS_BR_BODY_REJECT_ALL" +msgstr "Reject all" + +msgid "IDS_BR_BODY_AUTO_SAVE_ID_PASSWORD" +msgstr "ID/Passwort automatisch speichern" + +msgid "IDS_BR_BODY_ON" +msgstr "Ein" + +msgid "IDS_BR_BODY_OFF" +msgstr "Aus" + +msgid "IDS_BR_BODY_DEFAULT_STORAGE" +msgstr "Standardspeicher" + +msgid "IDS_BR_BODY_SEARCH" +msgstr "Suche" + +msgid "IDS_BR_BODY_SAVE_IMAGE" +msgstr "Bild speichern" + +msgid "IDS_BR_POP_LOW_BATTERY_UNABLE_TO_RUN_BROWSER" +msgstr "Schwacher Akku. Browser kann nicht ausgeführt werden" + +msgid "IDS_BR_BODY_FIND_WORD" +msgstr "Wort finden" + +msgid "IDS_BR_OPT_ADD_TO_HOME_SCREEN" +msgstr "Zu Startbildschirm hinzufügen" + +msgid "IDS_BR_OPT_ADD_TO_HOME_SCREEN_ABB" +msgstr "Zum Startbildschirm hzfg." + +msgid "IDS_BR_BODY_MOST_VISITED_SITES" +msgstr "Häufig besuchte Seiten" + +msgid "IDS_BR_OPT_SHARE_VIA_FACEBOOK" +msgstr "Über Facebook freigeben" + +msgid "IDS_BR_OPT_SHARE_VIA_TWITTER" +msgstr "Über Twitter freigeben" + +msgid "IDS_BR_SK3_CHANGE_VIEW" +msgstr "Ansicht ändern" + +msgid "IDS_BR_HEADER_SELECT_URLS" +msgstr "URLS auswählen" + +msgid "IDS_BR_POP_THIS_SITE_IS_ATTEMPTING_TO_OPEN_POP_UP_WINDOW" +msgstr "Diese Seite versucht, ein Pop-up-Fenster zu öffnen." + +msgid "IDS_BR_MBODY_BLOCK_POP_UP_WINDOWS" +msgstr "Pop-up-Fenster blockieren" + +msgid "IDS_BR_BODY_TEXT_READER" +msgstr "Text-Reader" + +msgid "IDS_BR_OPT_COPY_IMAGE" +msgstr "Bild kopieren" + +msgid "IDS_BR_OPT_SAVE_IMAGE" +msgstr "Bild speichern" + +msgid "IDS_BR_BODY_PLAY" +msgstr "Starten" + +msgid "IDS_BR_OPT_SELECT" +msgstr "Auswählen" + +msgid "IDS_BR_OPT_NAVIGATE_GO_BACKWARD" +msgstr "Zurückgehen" + +msgid "IDS_BR_OPT_NAVIGATE_GO_FORWARD" +msgstr "Weitergehen" + +msgid "IDS_BR_OPT_STOP" +msgstr "Stopp" + +msgid "IDS_BR_OPT_RELOAD" +msgstr "Neu laden" + +msgid "IDS_BR_OPT_PASTE" +msgstr "Einfügen" + +msgid "IDS_BR_BUTTON_MORE" +msgstr "Weitere" + +msgid "IDS_BR_POP_FAIL" +msgstr "Fehlgeschlagen" + +msgid "IDS_BR_BODY_OPEN_IN_NEW_WINDOW" +msgstr "In neu. Fenster öff." + +msgid "IDS_BR_OPT_VIEW_DOWNLOAD_LIST" +msgstr "Download-Liste anzeigen" + +msgid "IDS_BR_BODY_COPY_URL" +msgstr "URL kopieren" + +msgid "IDS_BR_BODY_COPY_URL_TO" +msgstr "URL kopieren in" + +msgid "IDS_BR_BODY_VIEW_IMAGE" +msgstr "Bild anzeigen" + +msgid "IDS_BR_BODY_PRIVACY_SETTINGS" +msgstr "Sicherheitseinstellungen" + +msgid "IDS_BR_BODY_CLEAR_CACHE" +msgstr "Cache leeren" + +msgid "IDS_BR_BODY_CLEAR_HISTORY" +msgstr "Verlauf löschen" + +msgid "IDS_BR_BODY_ENABLE_PLUG_INS" +msgstr "Plug-Ins aktivieren" + +msgid "IDS_BR_BODY_SELECT_SEARCH_ENGINE" +msgstr "Suchmaschine auswählen" + +msgid "IDS_BR_BODY_DELETE_SAVED_ID_PASSWORD" +msgstr "Gespeicherte(s) ID/Passwort löschen" + +msgid "IDS_BR_BODY_CLEAR_ALL_COOKIE_DATA" +msgstr "Alle Cookiedaten löschen" + +msgid "IDS_BR_BODY_UP" +msgstr "Hoch" + +msgid "IDS_BR_BODY_FONT_SIZE" +msgstr "Schriftgröße" + +msgid "IDS_BR_POP_DELETED" +msgstr "Gelöscht" + +msgid "IDS_BR_BODY_DEFAULT_VIEW" +msgstr "Standardansicht" + +msgid "IDS_BR_MBODY_PAGE_CONTENT_SETTINGS" +msgstr "Einstell. f. Seiteninhalt" + +msgid "IDS_BR_POP_CASE_SENSITIVE" +msgstr "Groß- und Kleinschreibung beachten" + +msgid "IDS_BR_BODY_PLUG_IN" +msgstr "Plug-In" + +msgid "IDS_BR_OPT_PLUGINS_LIST" +msgstr "Liste der Plug-ins" + +msgid "IDS_BR_HEADER_LOCAL_STORAGE" +msgstr "Lokaler Speicher" + +msgid "IDS_BR_BODY_DELETE_BROWSING_DATA" +msgstr "Browserdaten löschen" + +msgid "IDS_BR_BODY_LOADING_ING" +msgstr "Lade..." + +msgid "IDS_BR_HEADER_LOADING_ING" +msgstr "Lade..." + +msgid "IDS_BR_HEADER_ENTERURL" +msgstr "URL eingeben" + +msgid "IDS_BR_OPT_LOCK" +msgstr "Schützen" + +msgid "IDS_BR_OPT_UNLOCK" +msgstr "Freigeben" + +msgid "IDS_BR_BODY_MODIFY" +msgstr "Bearbeiten" + +msgid "IDS_BR_SK_PAGE_UP" +msgstr "Seite hoch" + +msgid "IDS_BR_SK_PAGE_DOWN" +msgstr "Seite runter" + +msgid "IDS_BR_BODY_DEVELOPER_MODE" +msgstr "Entwickler-Modus" + +msgid "IDS_BR_BODY_EMPTY" +msgstr "Leer" + +msgid "IDS_BR_BODY_CERTIFICATES" +msgstr "Zertifikate" + +msgid "IDS_BR_BODY_BOOKMARKS" +msgstr "Favoriten" + +msgid "IDS_BR_BODY_ENTER_NAME" +msgstr "Name eingeben" + +msgid "IDS_BR_BODY_NAME" +msgstr "Name" + +msgid "IDS_BR_OPT_SEND_VIA_EMAIL" +msgstr "Per E-Mail senden" + +msgid "IDS_BR_OPT_SEND_VIA_MESSAGE" +msgstr "Per Nachricht senden" + +msgid "IDS_BR_BODY_SETTINGS" +msgstr "Einstellungen" + +msgid "IDS_BR_BODY_AUTHUSERNAME" +msgstr "Benutzername" + +msgid "IDS_BR_POP_ALREADY_EXISTS" +msgstr "Bereits vorhanden" + +msgid "IDS_BR_POP_SAVED" +msgstr "Gespeichert" + +msgid "IDS_BR_POP_NOT_ENOUGH_MEMORY" +msgstr "Speicher voll" + +msgid "IDS_BR_POP_NETWORK_ERROR" +msgstr "Netzfehler" + +msgid "IDS_BR_BODY_ALWAYS_ASK" +msgstr "Immer fragen" + +msgid "IDS_BR_BODY_MEMORY_CARD" +msgstr "Speicherkarte" + +msgid "IDS_BR_BODY_PHONE" +msgstr "Telefon" + +msgid "IDS_BR_BODY_NO_ACCOUNTS_ABB" +msgstr "Keine Konten" + +msgid "IDS_BR_HEADER_ERROR_PAGE" +msgstr "Fehlerseite" + +msgid "IDS_BR_BODY_WEB_PAGE_TEMPORARILY_NOT_AVAILABLE" +msgstr "Webseite ist zur Zeit nicht verfügbar" + +msgid "IDS_BR_BODY_WEB_PAGE_NOT_AVAILABLE" +msgstr "Webseite nicht verfügbar" + +msgid "IDS_BR_BODY_FAILED_TO_LOAD_FRAMES" +msgstr "Frames können nicht geladen werden." + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_1" +msgstr "Während des Abrufens der Webseite %s ist folgender Fehler aufgetreten." + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_2" +msgstr "Webseite kann nicht abgerufen werden (Webseite kann vorübergehend abgestürzt sein oder eine neue URL haben)." + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_3" +msgstr "Unten finden Sie die wahrscheinlichste Ursache." + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_4" +msgstr "Netzwerkverbindung kann nicht normal hergestellt werden." + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_5" +msgstr "Webseiten-URL überprüfen" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_6" +msgstr "Webseite später erneut laden" + +msgid "IDS_BR_OPT_BOOKMARK" +msgstr "Lesezeichen" + +msgid "IDS_BR_BODY_TITLE" +msgstr "Titel" + +msgid "IDS_BR_BODY_ENTER_TITLE" +msgstr "Titel eingeben" + +msgid "IDS_BR_OPT_FOLDERS" +msgstr "Ordner" + +msgid "IDS_BR_OPT_ALLOW" +msgstr "Zulassen" + +msgid "IDS_BR_POP_REFUSE" +msgstr "Ablehnen" + +msgid "IDS_BR_POP_SECURITY_ERROR_C_UNTRUSTED_SERVER_CERTIFICATE" +msgstr "Sicherheitsfehler: Nicht vertrauenswürdiges Serverzertifikat" + +msgid "IDS_BR_POP_PD_ITEMS_SELECTED" +msgstr "%d Elemente ausgewählt" + +msgid "IDS_BR_POP_1_ITEM_SELECTED" +msgstr "1 Element ausgewählt" + diff --git a/po/el_GR.po b/po/el_GR.po new file mode 100755 index 00000000..72f46ca4 --- /dev/null +++ b/po/el_GR.po @@ -0,0 +1,621 @@ +msgid "IDS_BR_POP_INSTALLATION_FAILED" +msgstr "Αποτυχία εγκατάστασης" + +msgid "IDS_BR_BODY_NOTIFYING_ING" +msgstr "Ειδοποίηση..." + +msgid "IDS_BR_BODY_PROCESSING_ING" +msgstr "Επεξεργασία..." + +msgid "IDS_BR_BODY_PROCESSING_COMPLETED" +msgstr "Ολοκλήρωση επεξεργασίας" + +msgid "IDS_BR_SK_RETRY" +msgstr "Επανάληψη" + +msgid "IDS_BR_HEADER_DOWNLOAD_MANAGER" +msgstr "Διαχείριση λήψεων" + +msgid "IDS_BR_POP_INVALIDDESCRIPTOR" +msgstr "Μη έγκυρη περιγραφή" + +msgid "IDS_BR_POP_UNABLE_TO_OPEN_FILE" +msgstr "Δεν είναι δυνατό το άνοιγμα αρχείου" + +msgid "IDS_BR_POP_DOWNLOAD_Q" +msgstr "Λήψη;" + +msgid "IDS_BR_OPT_DELETE_SELECTED" +msgstr "Επιλεγμένο" + +msgid "IDS_BR_POP_DOWNLOAD_CANCELLED" +msgstr "Ακύρωση λήψης" + +msgid "IDS_BR_BODY_CONTINUE_FROM_LAST_PAGE" +msgstr "Συνέχ.από τελευτ. σελ." + +msgid "IDS_BR_BODY_PAGE" +msgstr "Σελίδα" + +msgid "IDS_BR_OPT_DICTIONARY" +msgstr "Λεξικό" + +msgid "IDS_BR_BODY_ABOUT_BROWSER" +msgstr "Πληροφορίες για το πρόγραμμα περιήγησης" + +msgid "IDS_BR_BODY_BROWSER_TYPE" +msgstr "Είδος" + +msgid "IDS_BR_BODY_CERTIFICATE_ISSUER" +msgstr "Εκδότης" + +msgid "IDS_BR_BODY_DISPLAY_IMAGES" +msgstr "Προβολή εικόνων" + +msgid "IDS_BR_BODY_DOWNLOAD" +msgstr "Λήψη" + +msgid "IDS_BR_BODY_ENTER_URL" +msgstr "Εισαγωγή URL" + +msgid "IDS_BR_BODY_FOLDER" +msgstr "Φάκελος" + +msgid "IDS_BR_BODY_HOMEPAGE" +msgstr "Αρχική σελίδα" + +msgid "IDS_BR_BODY_LANDSCAPE_VIEW" +msgstr "Οριζόντιος" + +msgid "IDS_BR_BODY_NO_BOOKMARKS" +msgstr "Κανένας σελιδοδείκτης" + +msgid "IDS_BR_BODY_NO_RESULTS_FOUND" +msgstr "Δεν βρέθηκαν αποτελέσματα" + +msgid "IDS_BR_BODY_OPTIONAL" +msgstr "Προαιρετικό" + +msgid "IDS_BR_BODY_RSS" +msgstr "RSS" + +msgid "IDS_BR_BODY_RUN_FLASH" +msgstr "Εκτέλεση Flash" + +msgid "IDS_BR_BODY_RUN_JAVASCRIPT" +msgstr "Εκτέλεση JavaScript" + +msgid "IDS_BR_HEADER_COMMON_NAME_C" +msgstr "Κοινό όνομα:" + +msgid "IDS_BR_HEADER_ORGANIZATIONAL_UNIT_C" +msgstr "Οργανωτική μονάδα:" + +msgid "IDS_BR_HEADER_ORGANIZATION_C" +msgstr "Οργανισμός:" + +msgid "IDS_BR_HEADER_USER_AGENT" +msgstr "Παράγοντας χρήστη" + +msgid "IDS_BR_OPT_LAST_VIEWED_PAGE_ATNT" +msgstr "Last Viewed Page" + +msgid "IDS_BR_OPT_PREFERENCES" +msgstr "Προτιμήσεις" + +msgid "IDS_BR_POP_ACTICATION_ERR" +msgstr "Σφάλμα ενεργοποίησης" + +msgid "IDS_BR_POP_ALREADY_RUNNING" +msgstr "Εκτελείται ήδη" + +msgid "IDS_BR_POP_ERRORIMPLEMENTED" +msgstr "Δεν υλοποιήθηκε" + +msgid "IDS_BR_POP_HTTPERRAUTHFAILED" +msgstr "Αποτυχία ελέγχου ταυτότητας" + +msgid "IDS_BR_POP_OVERWRITE_Q" +msgstr "Αντικατάσταση;" + +msgid "IDS_BR_POP_URL" +msgstr "URL" + +msgid "IDS_BR_TAB_HISTORY" +msgstr "Ιστορικό" + +msgid "IDS_BR_HEADER_DOWNLOAD_LIST" +msgstr "Λίστα λήψεων" + +msgid "IDS_BR_POP_ALREADYINSTALLED" +msgstr "Ήδη εγκατεστημένο" + +msgid "IDS_BR_POP_NOTIFYING" +msgstr "Ειδοποίηση..." + +msgid "IDS_BR_POP_NOTSUPPORT" +msgstr "Μη υποστηριζόμενο περιεχόμενο" + +msgid "IDS_BR_POP_ERROR_C_UNABLE_TO_RESOLVE_HOST_NAME" +msgstr "Σφάλμα: Δεν είναι δυνατή η επίλυση του ονόματος κεντρικού υπολογιστή" + +msgid "IDS_BR_POP_UNABLE_TO_REACH_PROXY" +msgstr "Δεν είναι δυνατή η επικοινωνία με το διακομιστή μεσολάβησης" + +msgid "IDS_BR_POP_NOSSLCERTI" +msgstr "Κανένα πιστοποιητικό SSL" + +msgid "IDS_BR_BODY_FILE_SIZE_EXCEEDS_MAXIMUM_UPLOAD_LIMIT" +msgstr "Το μέγεθος του αρχείου υπερβαίνει το μέγιστο όριο αποστολής" + +msgid "IDS_BR_BODY_ENTER_NAME_C" +msgstr "Εισαγάγετε όνομα:" + +msgid "IDS_BR_SK_NEXT" +msgstr "Επόμενο" + +msgid "IDS_BR_OPT_NEW_FOLDER" +msgstr "Νέος φάκελος" + +msgid "IDS_BR_SK3_ADD_TO_BOOKMARKS" +msgstr "Προσθ.στους σελιδ." + +msgid "IDS_BR_SK1_NEW_WINDOW" +msgstr "Νέο παράθυρο" + +msgid "IDS_BR_BODY_URL" +msgstr "URL" + +msgid "IDS_BR_BODY_URL_C" +msgstr "URL:" + +msgid "IDS_BR_BODY_URL_NOT_AVAILABLE" +msgstr "Μη διαθέσιμο URL" + +msgid "IDS_BR_BODY_URL_PS_NOT_AVAILABLE_IT_MIGHT_BE_DOWN_TEMPORARILY_OR_NO_LONGER_IN_USE" +msgstr "Το URL %s δεν είναι διαθέσιμο. Ίσως να είναι προσωρινά εκτός λειτουργίας ή δε χρησιμοποιείται πια" + +msgid "IDS_BR_HEADER_FOLDER" +msgstr "Φάκελος" + +msgid "IDS_BR_BODY_FOLDER_NAME" +msgstr "Όνομα φακέλου" + +msgid "IDS_BR_BODY_FOLDER_NAME_ALREADY_IN_USE" +msgstr "Το όνομα φακέλου υπάρχει ήδη" + +msgid "IDS_BR_BODY_NO_TITLE" +msgstr "Χωρίς τίτλο" + +msgid "IDS_BR_HEADER_MULTI_WINDOW" +msgstr "Παράθ. πολ. Χρ." + +msgid "IDS_BR_BODY_NO_HISTORIES" +msgstr "Κανένα ιστορικό" + +msgid "IDS_BR_BODY_ADD_TO_BOOKMARKS" +msgstr "Προσθήκη στους σελιδ/τες" + +msgid "IDS_BR_BODY_EDIT_BOOKMARK" +msgstr "Επεξεργασία σελιδοδείκτη" + +msgid "IDS_BR_BODY_FOLDER_NAME_C" +msgstr "Όνομα φακέλου:" + +msgid "IDS_BR_OPT_SELECT_ALL" +msgstr "Επιλογή όλων" + +msgid "IDS_BR_OPT_DOWNLOAD_MANAGER" +msgstr "Διαχείριση λήψεων" + +msgid "IDS_BR_OPT_ADD_RSS_FEED" +msgstr "Προσθήκη τροφοδοσίας RSS" + +msgid "IDS_BR_OPT_ADD_RSS_FEEDS" +msgstr "Προσθήκη τροφοδοσιών RSS" + +msgid "IDS_BR_OPT_SETTINGS" +msgstr "Ρυθμίσεις" + +msgid "IDS_BR_POP_ENTER_URL" +msgstr "Εισαγωγή URL" + +msgid "IDS_BR_BODY_AUTHPASSWORD" +msgstr "Κωδικός πρόσβασης" + +msgid "IDS_BR_POP_INVALIDADDRESS" +msgstr "Άκυρη διεύθυνση" + +msgid "IDS_BR_POP_ALREADY_EXISTS_IN_DOWNLOAD_LIST" +msgstr "Υπάρχει ήδη στη λίστα λήψεων" + +msgid "IDS_BR_POP_ENTER_FOLDER_NAME" +msgstr "Εισαγωγή ονόματος φακέλου" + +msgid "IDS_BR_POP_NO_PAGE" +msgstr "Καμία σελίδα" + +msgid "IDS_BR_POP_NO_PAGES_BACKWARD" +msgstr "Καμία προηγούμενη σελίδα" + +msgid "IDS_BR_POP_NO_PAGES_FORWARD" +msgstr "Καμία επόμενη σελίδα" + +msgid "IDS_BR_POP_NO_PAGE_TO_RELOAD" +msgstr "Καμία σελίδα προς επαναφόρτωση" + +msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED" +msgstr "Απαιτείται έλεγχος ταυτότητας" + +msgid "IDS_BR_POP_BOOKMARK_ALREADY_EXISTS" +msgstr "Ο σελιδοδείκτης υπάρχει ήδη" + +msgid "IDS_BR_POP_FOLDER_NAME_ALREADY_EXISTS" +msgstr "Το όνομα φακέλου υπάρχει ήδη" + +msgid "IDS_BR_POP_UNABLE_TO_SAVE_OBJECT_NOT_ENOUGH_SPACE_IN_CACHE" +msgstr "Δεν είναι δυνατή η αποθήκευση αντικειμένου. Ο χώρος της μνήμης cache δεν επαρκεί" + +msgid "IDS_BR_HEADER_SELECT_ITEMS" +msgstr "Επιλογή στοιχείων" + +msgid "IDS_BR_HEADER_CERTIFICATE_INFO" +msgstr "Πληροφορίες πιστοποιητικού" + +msgid "IDS_BR_OPT_SHARE_VIA_EMAIL" +msgstr "Κοινή χρήση μέσω email" + +msgid "IDS_BR_OPT_SHARE_VIA_MESSAGES" +msgstr "Κοινή χρήση μέσω μηνυμάτων" + +msgid "IDS_BR_OPT_SHARE_VIA" +msgstr "Κοινή χρήση μέσω" + +msgid "IDS_BR_POP_UNABLE_TO_START_BROWSER" +msgstr "Δεν είναι δυνατή η εκκίνηση του προγράμματος περιήγησης" + +msgid "IDS_BR_POP_NO_ADDRESS" +msgstr "Καμία διεύθυνση" + +msgid "IDS_BR_POP_NEVER_SHOW_AGAIN" +msgstr "Να μην εμφανιστεί ξανά" + +msgid "IDS_BR_POP_FILE_NAME_EMPTY" +msgstr "Κενό όνομα αρχείου" + +msgid "IDS_BR_SK3_CREATE_FOLDER" +msgstr "Δημ/ργία φακέλου" + +msgid "IDS_BR_OPT_SELECTED" +msgstr "Επιλεγμένο" + +msgid "IDS_BR_OPT_SHARE" +msgstr "Κοινόχρηστο" + +msgid "IDS_BR_HEADER_RECENTLY_VISITED_PAGES" +msgstr "Σελίδες που επισκεφθήκατε πρόσφατα" + +msgid "IDS_BR_OPT_DISPLAY" +msgstr "Οθόνη" + +msgid "IDS_BR_BODY_FIT_TO_WIDTH" +msgstr "Προσαρμογή κατά πλάτος" + +msgid "IDS_BR_BODY_READABLE" +msgstr "Για ανάγνωση" + +msgid "IDS_BR_BODY_PRIVACY" +msgstr "Απόρρητο" + +msgid "IDS_BR_BODY_COOKIES" +msgstr "Cookies" + +msgid "IDS_BR_BODY_COOKIESACCEPTALL" +msgstr "Αποδοχή όλων" + +msgid "IDS_BR_BODY_COOKIESPROMPT" +msgstr "Ερώτηση" + +msgid "IDS_BR_HEADER_COOKIES" +msgstr "Cookies" + +msgid "IDS_BR_BODY_ACCEPT_COOKIES" +msgstr "Αποδοχή των cookies" + +msgid "IDS_BR_OPT_ACCEPT_COOKIES" +msgstr "Αποδοχή των cookies" + +msgid "IDS_BR_BODY_ACCEPT_ALL" +msgstr "Αποδοχή όλων" + +msgid "IDS_BR_BODY_REJECT_ALL" +msgstr "Απόρριψη όλων" + +msgid "IDS_BR_BODY_AUTO_SAVE_ID_PASSWORD" +msgstr "Αυτόματη αποθήκευση αναγνωριστικού/κωδικού πρόσβασης" + +msgid "IDS_BR_BODY_ON" +msgstr "Ενεργό" + +msgid "IDS_BR_BODY_OFF" +msgstr "Ανενεργό" + +msgid "IDS_BR_BODY_DEFAULT_STORAGE" +msgstr "Προεπιλεγμένη αποθήκευση" + +msgid "IDS_BR_BODY_SEARCH" +msgstr "Αναζήτηση" + +msgid "IDS_BR_BODY_SAVE_IMAGE" +msgstr "Αποθήκευση εικόνας" + +msgid "IDS_BR_POP_LOW_BATTERY_UNABLE_TO_RUN_BROWSER" +msgstr "Χαμηλή μπαταρία. Δεν είναι δυνατή η εκτέλεση του προγράμματος περιήγησης" + +msgid "IDS_BR_BODY_FIND_WORD" +msgstr "Εύρεση λέξης" + +msgid "IDS_BR_OPT_ADD_TO_HOME_SCREEN" +msgstr "Προσθήκη στην Αρχική οθόνη" + +msgid "IDS_BR_OPT_ADD_TO_HOME_SCREEN_ABB" +msgstr "Προσθήκη στην αρχική οθόνη" + +msgid "IDS_BR_BODY_MOST_VISITED_SITES" +msgstr "Δημοφιλέστερες τοποθεσίες" + +msgid "IDS_BR_OPT_SHARE_VIA_FACEBOOK" +msgstr "Κοινή χρήση μέσω Facebook" + +msgid "IDS_BR_OPT_SHARE_VIA_TWITTER" +msgstr "Κοινή χρήση μέσω Twitter" + +msgid "IDS_BR_SK3_CHANGE_VIEW" +msgstr "Αλλαγή προβολής" + +msgid "IDS_BR_HEADER_SELECT_URLS" +msgstr "Επιλογή διευθύνσεων URL" + +msgid "IDS_BR_POP_THIS_SITE_IS_ATTEMPTING_TO_OPEN_POP_UP_WINDOW" +msgstr "Αυτή η τοποθεσία επιχειρεί να ανοίξει ένα αναδυόμενο παράθυρο" + +msgid "IDS_BR_MBODY_BLOCK_POP_UP_WINDOWS" +msgstr "Αποκλ. αναδυόμενων παραθ." + +msgid "IDS_BR_BODY_TEXT_READER" +msgstr "Πρόγραμμα ανάγνωσης κειμένου" + +msgid "IDS_BR_OPT_COPY_IMAGE" +msgstr "Αντιγραφή εικόνας" + +msgid "IDS_BR_OPT_SAVE_IMAGE" +msgstr "Αποθήκευση εικόνας" + +msgid "IDS_BR_BODY_PLAY" +msgstr "Αναπαραγωγή" + +msgid "IDS_BR_OPT_SELECT" +msgstr "Επιλογή" + +msgid "IDS_BR_OPT_NAVIGATE_GO_BACKWARD" +msgstr "Μετάβαση προς τα πίσω" + +msgid "IDS_BR_OPT_NAVIGATE_GO_FORWARD" +msgstr "Μετάβαση προς τα εμπρός" + +msgid "IDS_BR_OPT_STOP" +msgstr "Διακοπή" + +msgid "IDS_BR_OPT_RELOAD" +msgstr "Επαναφόρτιση" + +msgid "IDS_BR_OPT_PASTE" +msgstr "Επικόλληση" + +msgid "IDS_BR_BUTTON_MORE" +msgstr "Περισσότερα" + +msgid "IDS_BR_POP_FAIL" +msgstr "Αποτυχία" + +msgid "IDS_BR_BODY_OPEN_IN_NEW_WINDOW" +msgstr "Άνοιγ. σε νέο παράθ." + +msgid "IDS_BR_OPT_VIEW_DOWNLOAD_LIST" +msgstr "Προβολή λίστας λήψεων" + +msgid "IDS_BR_BODY_COPY_URL" +msgstr "Αντιγραφή URL" + +msgid "IDS_BR_BODY_COPY_URL_TO" +msgstr "Αντιγραφή URL σε" + +msgid "IDS_BR_BODY_VIEW_IMAGE" +msgstr "Προβολή εικόνας" + +msgid "IDS_BR_BODY_PRIVACY_SETTINGS" +msgstr "Ρυθμίσεις απόρρητου" + +msgid "IDS_BR_BODY_CLEAR_CACHE" +msgstr "Διαγραφή μνήμης cache" + +msgid "IDS_BR_BODY_CLEAR_HISTORY" +msgstr "Εκκαθάριση ιστορικού" + +msgid "IDS_BR_BODY_ENABLE_PLUG_INS" +msgstr "Ενεργοποίηση πρόσθετων" + +msgid "IDS_BR_BODY_SELECT_SEARCH_ENGINE" +msgstr "Επιλογή μηχανής αναζήτησης" + +msgid "IDS_BR_BODY_DELETE_SAVED_ID_PASSWORD" +msgstr "Διαγραφή αποθηκεμένου αναγνωριστικού/Κωδικού" + +msgid "IDS_BR_BODY_CLEAR_ALL_COOKIE_DATA" +msgstr "Διαγραφή όλων των δεδομένων cookie" + +msgid "IDS_BR_BODY_UP" +msgstr "Πάνω" + +msgid "IDS_BR_BODY_FONT_SIZE" +msgstr "Μέγεθος γραμματοσειράς" + +msgid "IDS_BR_POP_DELETED" +msgstr "Διαγράφηκε" + +msgid "IDS_BR_BODY_DEFAULT_VIEW" +msgstr "Προεπιλεγμένη προβολή" + +msgid "IDS_BR_MBODY_PAGE_CONTENT_SETTINGS" +msgstr "Ρυθμ. περιεχομένου σελ." + +msgid "IDS_BR_POP_CASE_SENSITIVE" +msgstr "Με διάκριση πεζών-κεφαλαίων" + +msgid "IDS_BR_BODY_PLUG_IN" +msgstr "Plug-in" + +msgid "IDS_BR_OPT_PLUGINS_LIST" +msgstr "Λίστα πρόσθετων" + +msgid "IDS_BR_HEADER_LOCAL_STORAGE" +msgstr "Τοπική αποθήκευση" + +msgid "IDS_BR_BODY_DELETE_BROWSING_DATA" +msgstr "Διαγραφή δεδομένων περιήγησης" + +msgid "IDS_BR_BODY_LOADING_ING" +msgstr "Φόρτωση..." + +msgid "IDS_BR_HEADER_LOADING_ING" +msgstr "Φόρτωση..." + +msgid "IDS_BR_HEADER_ENTERURL" +msgstr "Εισαγωγή URL" + +msgid "IDS_BR_OPT_LOCK" +msgstr "Κλείδωμα" + +msgid "IDS_BR_OPT_UNLOCK" +msgstr "Ξεκλείδωμα" + +msgid "IDS_BR_BODY_MODIFY" +msgstr "Τροποποίηση" + +msgid "IDS_BR_SK_PAGE_UP" +msgstr "Pageup" + +msgid "IDS_BR_SK_PAGE_DOWN" +msgstr "Pagedown" + +msgid "IDS_BR_BODY_DEVELOPER_MODE" +msgstr "Κατάσταση λειτουργίας προγραμματισμού" + +msgid "IDS_BR_BODY_EMPTY" +msgstr "Κενό" + +msgid "IDS_BR_BODY_CERTIFICATES" +msgstr "Πιστοποιητικά" + +msgid "IDS_BR_BODY_BOOKMARKS" +msgstr "Σελιδοδείκτες" + +msgid "IDS_BR_BODY_ENTER_NAME" +msgstr "Εισαγωγή ονόματος" + +msgid "IDS_BR_BODY_NAME" +msgstr "Όνομα" + +msgid "IDS_BR_OPT_SEND_VIA_EMAIL" +msgstr "Αποστολή μέσω email" + +msgid "IDS_BR_OPT_SEND_VIA_MESSAGE" +msgstr "Αποστολή μέσω μηνύματος" + +msgid "IDS_BR_BODY_SETTINGS" +msgstr "Ρυθμίσεις" + +msgid "IDS_BR_BODY_AUTHUSERNAME" +msgstr "Όνομα χρήστη" + +msgid "IDS_BR_POP_ALREADY_EXISTS" +msgstr "Υπάρχει ήδη" + +msgid "IDS_BR_POP_SAVED" +msgstr "Αποθηκεύτηκε" + +msgid "IDS_BR_POP_NOT_ENOUGH_MEMORY" +msgstr "Ανεπαρκής μνήμη" + +msgid "IDS_BR_POP_NETWORK_ERROR" +msgstr "Σφάλμα δικτύου" + +msgid "IDS_BR_BODY_ALWAYS_ASK" +msgstr "Να γίνεται πάντα ερώτηση" + +msgid "IDS_BR_BODY_MEMORY_CARD" +msgstr "Κάρτα μνήμης" + +msgid "IDS_BR_BODY_PHONE" +msgstr "Τηλέφωνο" + +msgid "IDS_BR_BODY_NO_ACCOUNTS_ABB" +msgstr "Δεν υπάρχουν λογαριασμοί" + +msgid "IDS_BR_HEADER_ERROR_PAGE" +msgstr "Σελίδα σφάλματος" + +msgid "IDS_BR_BODY_WEB_PAGE_TEMPORARILY_NOT_AVAILABLE" +msgstr "Η ιστοσελίδα δεν είναι διαθέσιμη προσωρινά" + +msgid "IDS_BR_BODY_WEB_PAGE_NOT_AVAILABLE" +msgstr "Η ιστοσελίδα δεν είναι διαθέσιμη" + +msgid "IDS_BR_BODY_FAILED_TO_LOAD_FRAMES" +msgstr "Η φόρτωση των πλαισίων απέτυχε" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_1" +msgstr "Προέκυψε το παρακάτω σφάλμα κατά την ανάκτηση της ιστοσελίδας %s." + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_2" +msgstr "Δεν είναι δυνατή η ανάκτηση της ιστοσελίδας. (Η ιστοσελίδα ενδέχεται να μην είναι διαθέσιμη προσωρινά ή να έχει μετακινηθεί σε νέα διεύθυνση URL)" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_3" +msgstr "Παρακάτω θα βρείτε την πιο πιθανή αιτία για αυτό" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_4" +msgstr "Η σύνδεση στο δίκτυο δεν έγινε κανονικά" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_5" +msgstr "Ελέγξτε τη διεύθυνση URL της ιστοσελίδας" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_6" +msgstr "Να γίνει επαναφόρτωση της ιστοσελίδας αργότερα" + +msgid "IDS_BR_OPT_BOOKMARK" +msgstr "Σελιδοδείκτης" + +msgid "IDS_BR_BODY_TITLE" +msgstr "Τίτλος" + +msgid "IDS_BR_BODY_ENTER_TITLE" +msgstr "Εισαγωγή τίτλου" + +msgid "IDS_BR_OPT_FOLDERS" +msgstr "Φάκελοι" + +msgid "IDS_BR_OPT_ALLOW" +msgstr "Να επιτρέπεται" + +msgid "IDS_BR_POP_REFUSE" +msgstr "Άρνηση" + +msgid "IDS_BR_POP_SECURITY_ERROR_C_UNTRUSTED_SERVER_CERTIFICATE" +msgstr "Σφάλμα ασφαλείας: Μη αξιόπιστο πιστοποιητικό διακομιστή" + +msgid "IDS_BR_POP_PD_ITEMS_SELECTED" +msgstr "Επιλέχθηκαν %d στοιχεία" + +msgid "IDS_BR_POP_1_ITEM_SELECTED" +msgstr "Επιλέχθηκε 1 στοιχείο" + diff --git a/po/en.po b/po/en.po new file mode 100755 index 00000000..271ad33f --- /dev/null +++ b/po/en.po @@ -0,0 +1,621 @@ +msgid "IDS_BR_POP_INSTALLATION_FAILED" +msgstr "Installation failed" + +msgid "IDS_BR_BODY_NOTIFYING_ING" +msgstr "Notifying..." + +msgid "IDS_BR_BODY_PROCESSING_ING" +msgstr "Processing..." + +msgid "IDS_BR_BODY_PROCESSING_COMPLETED" +msgstr "Processing completed" + +msgid "IDS_BR_SK_RETRY" +msgstr "Retry" + +msgid "IDS_BR_HEADER_DOWNLOAD_MANAGER" +msgstr "Download manager" + +msgid "IDS_BR_POP_INVALIDDESCRIPTOR" +msgstr "Invalid descriptor" + +msgid "IDS_BR_POP_UNABLE_TO_OPEN_FILE" +msgstr "Unable to open file" + +msgid "IDS_BR_POP_DOWNLOAD_Q" +msgstr "Download?" + +msgid "IDS_BR_OPT_DELETE_SELECTED" +msgstr "Selected" + +msgid "IDS_BR_POP_DOWNLOAD_CANCELLED" +msgstr "Download cancelled" + +msgid "IDS_BR_BODY_CONTINUE_FROM_LAST_PAGE" +msgstr "Continue from last page" + +msgid "IDS_BR_BODY_PAGE" +msgstr "Page" + +msgid "IDS_BR_OPT_DICTIONARY" +msgstr "Dictionary" + +msgid "IDS_BR_BODY_ABOUT_BROWSER" +msgstr "About browser" + +msgid "IDS_BR_BODY_BROWSER_TYPE" +msgstr "Type" + +msgid "IDS_BR_BODY_CERTIFICATE_ISSUER" +msgstr "Issuer" + +msgid "IDS_BR_BODY_DISPLAY_IMAGES" +msgstr "Display images" + +msgid "IDS_BR_BODY_DOWNLOAD" +msgstr "Download" + +msgid "IDS_BR_BODY_ENTER_URL" +msgstr "Enter URL" + +msgid "IDS_BR_BODY_FOLDER" +msgstr "Folder" + +msgid "IDS_BR_BODY_HOMEPAGE" +msgstr "Homepage" + +msgid "IDS_BR_BODY_LANDSCAPE_VIEW" +msgstr "Landscape view" + +msgid "IDS_BR_BODY_NO_BOOKMARKS" +msgstr "No bookmarks" + +msgid "IDS_BR_BODY_NO_RESULTS_FOUND" +msgstr "No results found" + +msgid "IDS_BR_BODY_OPTIONAL" +msgstr "Optional" + +msgid "IDS_BR_BODY_RSS" +msgstr "RSS" + +msgid "IDS_BR_BODY_RUN_FLASH" +msgstr "Run Flash" + +msgid "IDS_BR_BODY_RUN_JAVASCRIPT" +msgstr "Run JavaScript" + +msgid "IDS_BR_HEADER_COMMON_NAME_C" +msgstr "Common name:" + +msgid "IDS_BR_HEADER_ORGANIZATIONAL_UNIT_C" +msgstr "Organisational unit:" + +msgid "IDS_BR_HEADER_ORGANIZATION_C" +msgstr "Organisation:" + +msgid "IDS_BR_HEADER_USER_AGENT" +msgstr "User agent" + +msgid "IDS_BR_OPT_LAST_VIEWED_PAGE_ATNT" +msgstr "Last Viewed Page" + +msgid "IDS_BR_OPT_PREFERENCES" +msgstr "Preferences" + +msgid "IDS_BR_POP_ACTICATION_ERR" +msgstr "Activation error" + +msgid "IDS_BR_POP_ALREADY_RUNNING" +msgstr "Already running..." + +msgid "IDS_BR_POP_ERRORIMPLEMENTED" +msgstr "Not implemented" + +msgid "IDS_BR_POP_HTTPERRAUTHFAILED" +msgstr "Authentication failed" + +msgid "IDS_BR_POP_OVERWRITE_Q" +msgstr "Overwrite?" + +msgid "IDS_BR_POP_URL" +msgstr "URL" + +msgid "IDS_BR_TAB_HISTORY" +msgstr "History" + +msgid "IDS_BR_HEADER_DOWNLOAD_LIST" +msgstr "Download list" + +msgid "IDS_BR_POP_ALREADYINSTALLED" +msgstr "Already installed" + +msgid "IDS_BR_POP_NOTIFYING" +msgstr "Notifying..." + +msgid "IDS_BR_POP_NOTSUPPORT" +msgstr "Unsupported content" + +msgid "IDS_BR_POP_ERROR_C_UNABLE_TO_RESOLVE_HOST_NAME" +msgstr "Error: unable to resolve host name" + +msgid "IDS_BR_POP_UNABLE_TO_REACH_PROXY" +msgstr "Unable to reach proxy" + +msgid "IDS_BR_POP_NOSSLCERTI" +msgstr "No SSL certificates" + +msgid "IDS_BR_BODY_FILE_SIZE_EXCEEDS_MAXIMUM_UPLOAD_LIMIT" +msgstr "File size exceeds maximum upload limit" + +msgid "IDS_BR_BODY_ENTER_NAME_C" +msgstr "Enter name:" + +msgid "IDS_BR_SK_NEXT" +msgstr "Next" + +msgid "IDS_BR_OPT_NEW_FOLDER" +msgstr "New folder" + +msgid "IDS_BR_SK3_ADD_TO_BOOKMARKS" +msgstr "Add to Bookmarks" + +msgid "IDS_BR_SK1_NEW_WINDOW" +msgstr "New window" + +msgid "IDS_BR_BODY_URL" +msgstr "URL" + +msgid "IDS_BR_BODY_URL_C" +msgstr "URL:" + +msgid "IDS_BR_BODY_URL_NOT_AVAILABLE" +msgstr "URL not available" + +msgid "IDS_BR_BODY_URL_PS_NOT_AVAILABLE_IT_MIGHT_BE_DOWN_TEMPORARILY_OR_NO_LONGER_IN_USE" +msgstr "URL %s not available. It might be down temporarily or no longer in use" + +msgid "IDS_BR_HEADER_FOLDER" +msgstr "Folder" + +msgid "IDS_BR_BODY_FOLDER_NAME" +msgstr "Folder name" + +msgid "IDS_BR_BODY_FOLDER_NAME_ALREADY_IN_USE" +msgstr "Folder name already in use" + +msgid "IDS_BR_BODY_NO_TITLE" +msgstr "No title" + +msgid "IDS_BR_HEADER_MULTI_WINDOW" +msgstr "Multi window" + +msgid "IDS_BR_BODY_NO_HISTORIES" +msgstr "No histories" + +msgid "IDS_BR_BODY_ADD_TO_BOOKMARKS" +msgstr "Add to Bookmarks" + +msgid "IDS_BR_BODY_EDIT_BOOKMARK" +msgstr "Edit bookmark" + +msgid "IDS_BR_BODY_FOLDER_NAME_C" +msgstr "Folder name:" + +msgid "IDS_BR_OPT_SELECT_ALL" +msgstr "Select all" + +msgid "IDS_BR_OPT_DOWNLOAD_MANAGER" +msgstr "Download manager" + +msgid "IDS_BR_OPT_ADD_RSS_FEED" +msgstr "Add RSS feed" + +msgid "IDS_BR_OPT_ADD_RSS_FEEDS" +msgstr "Add RSS feeds" + +msgid "IDS_BR_OPT_SETTINGS" +msgstr "Settings" + +msgid "IDS_BR_POP_ENTER_URL" +msgstr "Enter URL" + +msgid "IDS_BR_BODY_AUTHPASSWORD" +msgstr "Password" + +msgid "IDS_BR_POP_INVALIDADDRESS" +msgstr "Invalid address" + +msgid "IDS_BR_POP_ALREADY_EXISTS_IN_DOWNLOAD_LIST" +msgstr "Already exists in download list" + +msgid "IDS_BR_POP_ENTER_FOLDER_NAME" +msgstr "Enter folder name" + +msgid "IDS_BR_POP_NO_PAGE" +msgstr "No page" + +msgid "IDS_BR_POP_NO_PAGES_BACKWARD" +msgstr "No pages backward" + +msgid "IDS_BR_POP_NO_PAGES_FORWARD" +msgstr "No pages forward" + +msgid "IDS_BR_POP_NO_PAGE_TO_RELOAD" +msgstr "No page to reload" + +msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED" +msgstr "Authentication required" + +msgid "IDS_BR_POP_BOOKMARK_ALREADY_EXISTS" +msgstr "Bookmark already exists" + +msgid "IDS_BR_POP_FOLDER_NAME_ALREADY_EXISTS" +msgstr "Folder name already exists" + +msgid "IDS_BR_POP_UNABLE_TO_SAVE_OBJECT_NOT_ENOUGH_SPACE_IN_CACHE" +msgstr "Unable to save object. Not enough space in cache" + +msgid "IDS_BR_HEADER_SELECT_ITEMS" +msgstr "Select items" + +msgid "IDS_BR_HEADER_CERTIFICATE_INFO" +msgstr "Certificate info" + +msgid "IDS_BR_OPT_SHARE_VIA_EMAIL" +msgstr "Share via Email" + +msgid "IDS_BR_OPT_SHARE_VIA_MESSAGES" +msgstr "Share via Messages" + +msgid "IDS_BR_OPT_SHARE_VIA" +msgstr "Share via" + +msgid "IDS_BR_POP_UNABLE_TO_START_BROWSER" +msgstr "Unable to start Browser" + +msgid "IDS_BR_POP_NO_ADDRESS" +msgstr "No address" + +msgid "IDS_BR_POP_NEVER_SHOW_AGAIN" +msgstr "Never show again" + +msgid "IDS_BR_POP_FILE_NAME_EMPTY" +msgstr "File name empty" + +msgid "IDS_BR_SK3_CREATE_FOLDER" +msgstr "Create folder" + +msgid "IDS_BR_OPT_SELECTED" +msgstr "Selected" + +msgid "IDS_BR_OPT_SHARE" +msgstr "Share" + +msgid "IDS_BR_HEADER_RECENTLY_VISITED_PAGES" +msgstr "Recently visited pages" + +msgid "IDS_BR_OPT_DISPLAY" +msgstr "Display" + +msgid "IDS_BR_BODY_FIT_TO_WIDTH" +msgstr "Fit to width" + +msgid "IDS_BR_BODY_READABLE" +msgstr "Readable" + +msgid "IDS_BR_BODY_PRIVACY" +msgstr "Privacy" + +msgid "IDS_BR_BODY_COOKIES" +msgstr "Cookies" + +msgid "IDS_BR_BODY_COOKIESACCEPTALL" +msgstr "Accept all" + +msgid "IDS_BR_BODY_COOKIESPROMPT" +msgstr "Prompt" + +msgid "IDS_BR_HEADER_COOKIES" +msgstr "Cookies" + +msgid "IDS_BR_BODY_ACCEPT_COOKIES" +msgstr "Accept cookies" + +msgid "IDS_BR_OPT_ACCEPT_COOKIES" +msgstr "Accept cookies" + +msgid "IDS_BR_BODY_ACCEPT_ALL" +msgstr "Accept all" + +msgid "IDS_BR_BODY_REJECT_ALL" +msgstr "Reject all" + +msgid "IDS_BR_BODY_AUTO_SAVE_ID_PASSWORD" +msgstr "Auto save ID/password" + +msgid "IDS_BR_BODY_ON" +msgstr "On" + +msgid "IDS_BR_BODY_OFF" +msgstr "Off" + +msgid "IDS_BR_BODY_DEFAULT_STORAGE" +msgstr "Default storage" + +msgid "IDS_BR_BODY_SEARCH" +msgstr "Search" + +msgid "IDS_BR_BODY_SAVE_IMAGE" +msgstr "Save image" + +msgid "IDS_BR_POP_LOW_BATTERY_UNABLE_TO_RUN_BROWSER" +msgstr "Low battery. Unable to run browser" + +msgid "IDS_BR_BODY_FIND_WORD" +msgstr "Find word" + +msgid "IDS_BR_OPT_ADD_TO_HOME_SCREEN" +msgstr "Add to home screen" + +msgid "IDS_BR_OPT_ADD_TO_HOME_SCREEN_ABB" +msgstr "Add to home screen" + +msgid "IDS_BR_BODY_MOST_VISITED_SITES" +msgstr "Most visited sites" + +msgid "IDS_BR_OPT_SHARE_VIA_FACEBOOK" +msgstr "Share via Facebook" + +msgid "IDS_BR_OPT_SHARE_VIA_TWITTER" +msgstr "Share via Twitter" + +msgid "IDS_BR_SK3_CHANGE_VIEW" +msgstr "Change view" + +msgid "IDS_BR_HEADER_SELECT_URLS" +msgstr "Select URLs" + +msgid "IDS_BR_POP_THIS_SITE_IS_ATTEMPTING_TO_OPEN_POP_UP_WINDOW" +msgstr "This site is attempting to open pop-up window" + +msgid "IDS_BR_MBODY_BLOCK_POP_UP_WINDOWS" +msgstr "Block pop-up windows" + +msgid "IDS_BR_BODY_TEXT_READER" +msgstr "Text reader" + +msgid "IDS_BR_OPT_COPY_IMAGE" +msgstr "Copy image" + +msgid "IDS_BR_OPT_SAVE_IMAGE" +msgstr "Save image" + +msgid "IDS_BR_BODY_PLAY" +msgstr "Play" + +msgid "IDS_BR_OPT_SELECT" +msgstr "Select" + +msgid "IDS_BR_OPT_NAVIGATE_GO_BACKWARD" +msgstr "Go backward" + +msgid "IDS_BR_OPT_NAVIGATE_GO_FORWARD" +msgstr "Go forward" + +msgid "IDS_BR_OPT_STOP" +msgstr "Stop" + +msgid "IDS_BR_OPT_RELOAD" +msgstr "Reload" + +msgid "IDS_BR_OPT_PASTE" +msgstr "Paste" + +msgid "IDS_BR_BUTTON_MORE" +msgstr "More" + +msgid "IDS_BR_POP_FAIL" +msgstr "Failed" + +msgid "IDS_BR_BODY_OPEN_IN_NEW_WINDOW" +msgstr "Open in new window" + +msgid "IDS_BR_OPT_VIEW_DOWNLOAD_LIST" +msgstr "View download list" + +msgid "IDS_BR_BODY_COPY_URL" +msgstr "Copy URL" + +msgid "IDS_BR_BODY_COPY_URL_TO" +msgstr "Copy URL to" + +msgid "IDS_BR_BODY_VIEW_IMAGE" +msgstr "View image" + +msgid "IDS_BR_BODY_PRIVACY_SETTINGS" +msgstr "Privacy settings" + +msgid "IDS_BR_BODY_CLEAR_CACHE" +msgstr "Clear cache" + +msgid "IDS_BR_BODY_CLEAR_HISTORY" +msgstr "Clear history" + +msgid "IDS_BR_BODY_ENABLE_PLUG_INS" +msgstr "Enable plug-ins" + +msgid "IDS_BR_BODY_SELECT_SEARCH_ENGINE" +msgstr "Select search engine" + +msgid "IDS_BR_BODY_DELETE_SAVED_ID_PASSWORD" +msgstr "Delete saved ID/password" + +msgid "IDS_BR_BODY_CLEAR_ALL_COOKIE_DATA" +msgstr "Clear all cookie data" + +msgid "IDS_BR_BODY_UP" +msgstr "Up" + +msgid "IDS_BR_BODY_FONT_SIZE" +msgstr "Font size" + +msgid "IDS_BR_POP_DELETED" +msgstr "Deleted" + +msgid "IDS_BR_BODY_DEFAULT_VIEW" +msgstr "Default view" + +msgid "IDS_BR_MBODY_PAGE_CONTENT_SETTINGS" +msgstr "Page content settings" + +msgid "IDS_BR_POP_CASE_SENSITIVE" +msgstr "Case-sensitive" + +msgid "IDS_BR_BODY_PLUG_IN" +msgstr "Plug-in" + +msgid "IDS_BR_OPT_PLUGINS_LIST" +msgstr "Plug-ins list" + +msgid "IDS_BR_HEADER_LOCAL_STORAGE" +msgstr "Local storage" + +msgid "IDS_BR_BODY_DELETE_BROWSING_DATA" +msgstr "Delete browsing data" + +msgid "IDS_BR_BODY_LOADING_ING" +msgstr "Loading..." + +msgid "IDS_BR_HEADER_LOADING_ING" +msgstr "Loading..." + +msgid "IDS_BR_HEADER_ENTERURL" +msgstr "Enter URL" + +msgid "IDS_BR_OPT_LOCK" +msgstr "Lock" + +msgid "IDS_BR_OPT_UNLOCK" +msgstr "Unlock" + +msgid "IDS_BR_BODY_MODIFY" +msgstr "Modify" + +msgid "IDS_BR_SK_PAGE_UP" +msgstr "Page up" + +msgid "IDS_BR_SK_PAGE_DOWN" +msgstr "Page down" + +msgid "IDS_BR_BODY_DEVELOPER_MODE" +msgstr "Developer mode" + +msgid "IDS_BR_BODY_EMPTY" +msgstr "Empty" + +msgid "IDS_BR_BODY_CERTIFICATES" +msgstr "Certificates" + +msgid "IDS_BR_BODY_BOOKMARKS" +msgstr "Bookmarks" + +msgid "IDS_BR_BODY_ENTER_NAME" +msgstr "Enter name" + +msgid "IDS_BR_BODY_NAME" +msgstr "Name" + +msgid "IDS_BR_OPT_SEND_VIA_EMAIL" +msgstr "Send via Email" + +msgid "IDS_BR_OPT_SEND_VIA_MESSAGE" +msgstr "Send via Message" + +msgid "IDS_BR_BODY_SETTINGS" +msgstr "Settings" + +msgid "IDS_BR_BODY_AUTHUSERNAME" +msgstr "Username" + +msgid "IDS_BR_POP_ALREADY_EXISTS" +msgstr "Already exists" + +msgid "IDS_BR_POP_SAVED" +msgstr "Saved" + +msgid "IDS_BR_POP_NOT_ENOUGH_MEMORY" +msgstr "Not enough memory" + +msgid "IDS_BR_POP_NETWORK_ERROR" +msgstr "Network error" + +msgid "IDS_BR_BODY_ALWAYS_ASK" +msgstr "Always ask" + +msgid "IDS_BR_BODY_MEMORY_CARD" +msgstr "Memory card" + +msgid "IDS_BR_BODY_PHONE" +msgstr "Phone" + +msgid "IDS_BR_BODY_NO_ACCOUNTS_ABB" +msgstr "No accounts" + +msgid "IDS_BR_HEADER_ERROR_PAGE" +msgstr "Error page" + +msgid "IDS_BR_BODY_WEB_PAGE_TEMPORARILY_NOT_AVAILABLE" +msgstr "Web page temporarily not available" + +msgid "IDS_BR_BODY_WEB_PAGE_NOT_AVAILABLE" +msgstr "Web page not available" + +msgid "IDS_BR_BODY_FAILED_TO_LOAD_FRAMES" +msgstr "Failed to load frames" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_1" +msgstr "While retrieving Web page %s, following error occurred." + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_2" +msgstr "Unable to retrieve Web page. (Web page might be temporarily down or have moved to new URL)" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_3" +msgstr "The most likely cause is given below" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_4" +msgstr "Network connection not established normally" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_5" +msgstr "Check Web page URL" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_6" +msgstr "Reload Web page later" + +msgid "IDS_BR_OPT_BOOKMARK" +msgstr "Bookmark" + +msgid "IDS_BR_BODY_TITLE" +msgstr "Title" + +msgid "IDS_BR_BODY_ENTER_TITLE" +msgstr "Enter title" + +msgid "IDS_BR_OPT_FOLDERS" +msgstr "Folders" + +msgid "IDS_BR_OPT_ALLOW" +msgstr "Allow" + +msgid "IDS_BR_POP_REFUSE" +msgstr "Refuse" + +msgid "IDS_BR_POP_SECURITY_ERROR_C_UNTRUSTED_SERVER_CERTIFICATE" +msgstr "Security Error: Untrusted server certificate" + +msgid "IDS_BR_POP_PD_ITEMS_SELECTED" +msgstr "%d items selected" + +msgid "IDS_BR_POP_1_ITEM_SELECTED" +msgstr "1 item selected" + diff --git a/po/es_ES.po b/po/es_ES.po new file mode 100755 index 00000000..c438dba2 --- /dev/null +++ b/po/es_ES.po @@ -0,0 +1,621 @@ +msgid "IDS_BR_POP_INSTALLATION_FAILED" +msgstr "Fallo en la instalación" + +msgid "IDS_BR_BODY_NOTIFYING_ING" +msgstr "Notificando..." + +msgid "IDS_BR_BODY_PROCESSING_ING" +msgstr "Procesando..." + +msgid "IDS_BR_BODY_PROCESSING_COMPLETED" +msgstr "Procesamiento finalizado" + +msgid "IDS_BR_SK_RETRY" +msgstr "Reint." + +msgid "IDS_BR_HEADER_DOWNLOAD_MANAGER" +msgstr "Administrador de descarga" + +msgid "IDS_BR_POP_INVALIDDESCRIPTOR" +msgstr "Descriptor no válido" + +msgid "IDS_BR_POP_UNABLE_TO_OPEN_FILE" +msgstr "No se puede abrir el archivo" + +msgid "IDS_BR_POP_DOWNLOAD_Q" +msgstr "¿Descargar?" + +msgid "IDS_BR_OPT_DELETE_SELECTED" +msgstr "Seleccionado" + +msgid "IDS_BR_POP_DOWNLOAD_CANCELLED" +msgstr "Descarga cancelada" + +msgid "IDS_BR_BODY_CONTINUE_FROM_LAST_PAGE" +msgstr "Cont desde última pág" + +msgid "IDS_BR_BODY_PAGE" +msgstr "Página" + +msgid "IDS_BR_OPT_DICTIONARY" +msgstr "Diccionario" + +msgid "IDS_BR_BODY_ABOUT_BROWSER" +msgstr "Acerca del navegador" + +msgid "IDS_BR_BODY_BROWSER_TYPE" +msgstr "Tipo" + +msgid "IDS_BR_BODY_CERTIFICATE_ISSUER" +msgstr "Emisor" + +msgid "IDS_BR_BODY_DISPLAY_IMAGES" +msgstr "Mostrar imágenes" + +msgid "IDS_BR_BODY_DOWNLOAD" +msgstr "Descargar" + +msgid "IDS_BR_BODY_ENTER_URL" +msgstr "Introducir URL" + +msgid "IDS_BR_BODY_FOLDER" +msgstr "Carpeta" + +msgid "IDS_BR_BODY_HOMEPAGE" +msgstr "Página de inicio" + +msgid "IDS_BR_BODY_LANDSCAPE_VIEW" +msgstr "Horizontal" + +msgid "IDS_BR_BODY_NO_BOOKMARKS" +msgstr "Ningún favorito" + +msgid "IDS_BR_BODY_NO_RESULTS_FOUND" +msgstr "No se han encontrado resultados" + +msgid "IDS_BR_BODY_OPTIONAL" +msgstr "Opcional" + +msgid "IDS_BR_BODY_RSS" +msgstr "RSS" + +msgid "IDS_BR_BODY_RUN_FLASH" +msgstr "Ejecutar Flash" + +msgid "IDS_BR_BODY_RUN_JAVASCRIPT" +msgstr "Ejecutar JavaScript" + +msgid "IDS_BR_HEADER_COMMON_NAME_C" +msgstr "Nombre común:" + +msgid "IDS_BR_HEADER_ORGANIZATIONAL_UNIT_C" +msgstr "Unidad organizativa:" + +msgid "IDS_BR_HEADER_ORGANIZATION_C" +msgstr "Organización:" + +msgid "IDS_BR_HEADER_USER_AGENT" +msgstr "Agente de usuario" + +msgid "IDS_BR_OPT_LAST_VIEWED_PAGE_ATNT" +msgstr "Última página visitada" + +msgid "IDS_BR_OPT_PREFERENCES" +msgstr "Preferencias" + +msgid "IDS_BR_POP_ACTICATION_ERR" +msgstr "Error de activación" + +msgid "IDS_BR_POP_ALREADY_RUNNING" +msgstr "Ya en ejecución" + +msgid "IDS_BR_POP_ERRORIMPLEMENTED" +msgstr "No implementado" + +msgid "IDS_BR_POP_HTTPERRAUTHFAILED" +msgstr "Error en la autenticación" + +msgid "IDS_BR_POP_OVERWRITE_Q" +msgstr "¿Sobrescribir?" + +msgid "IDS_BR_POP_URL" +msgstr "URL" + +msgid "IDS_BR_TAB_HISTORY" +msgstr "Historial" + +msgid "IDS_BR_HEADER_DOWNLOAD_LIST" +msgstr "Descargar lista" + +msgid "IDS_BR_POP_ALREADYINSTALLED" +msgstr "Ya instalada" + +msgid "IDS_BR_POP_NOTIFYING" +msgstr "Notificando..." + +msgid "IDS_BR_POP_NOTSUPPORT" +msgstr "Contenido no admitido" + +msgid "IDS_BR_POP_ERROR_C_UNABLE_TO_RESOLVE_HOST_NAME" +msgstr "Error: no se puede resolver el nombre de host" + +msgid "IDS_BR_POP_UNABLE_TO_REACH_PROXY" +msgstr "Imposible conectar con proxy" + +msgid "IDS_BR_POP_NOSSLCERTI" +msgstr "No hay certificados SSL" + +msgid "IDS_BR_BODY_FILE_SIZE_EXCEEDS_MAXIMUM_UPLOAD_LIMIT" +msgstr "El tamaño del archivo supera el límite de carga máximo" + +msgid "IDS_BR_BODY_ENTER_NAME_C" +msgstr "Introducir nombre.:" + +msgid "IDS_BR_SK_NEXT" +msgstr "Siguiente" + +msgid "IDS_BR_OPT_NEW_FOLDER" +msgstr "Nueva carpeta" + +msgid "IDS_BR_SK3_ADD_TO_BOOKMARKS" +msgstr "Añadir a Favoritos" + +msgid "IDS_BR_SK1_NEW_WINDOW" +msgstr "Nueva ventana" + +msgid "IDS_BR_BODY_URL" +msgstr "URL" + +msgid "IDS_BR_BODY_URL_C" +msgstr "URL:" + +msgid "IDS_BR_BODY_URL_NOT_AVAILABLE" +msgstr "URL no disponible" + +msgid "IDS_BR_BODY_URL_PS_NOT_AVAILABLE_IT_MIGHT_BE_DOWN_TEMPORARILY_OR_NO_LONGER_IN_USE" +msgstr "La URL %s no está disponible. Puede que se haya interrumpido temporalmente o que ya no esté operativa" + +msgid "IDS_BR_HEADER_FOLDER" +msgstr "Carpeta" + +msgid "IDS_BR_BODY_FOLDER_NAME" +msgstr "Nombre de carpeta" + +msgid "IDS_BR_BODY_FOLDER_NAME_ALREADY_IN_USE" +msgstr "El nombre de carpeta ya existe" + +msgid "IDS_BR_BODY_NO_TITLE" +msgstr "Sin título" + +msgid "IDS_BR_HEADER_MULTI_WINDOW" +msgstr "Ventana múltiple" + +msgid "IDS_BR_BODY_NO_HISTORIES" +msgstr "No hay historiales" + +msgid "IDS_BR_BODY_ADD_TO_BOOKMARKS" +msgstr "Añadir a Favoritos" + +msgid "IDS_BR_BODY_EDIT_BOOKMARK" +msgstr "Editar elemento favorito" + +msgid "IDS_BR_BODY_FOLDER_NAME_C" +msgstr "Nombre de carpeta:" + +msgid "IDS_BR_OPT_SELECT_ALL" +msgstr "Seleccionar todo" + +msgid "IDS_BR_OPT_DOWNLOAD_MANAGER" +msgstr "Administrador de descarga" + +msgid "IDS_BR_OPT_ADD_RSS_FEED" +msgstr "Añadir fuente RSS" + +msgid "IDS_BR_OPT_ADD_RSS_FEEDS" +msgstr "Añadir fuentes RSS" + +msgid "IDS_BR_OPT_SETTINGS" +msgstr "Ajustes" + +msgid "IDS_BR_POP_ENTER_URL" +msgstr "Introducir URL" + +msgid "IDS_BR_BODY_AUTHPASSWORD" +msgstr "Contraseña" + +msgid "IDS_BR_POP_INVALIDADDRESS" +msgstr "Dirección no válida" + +msgid "IDS_BR_POP_ALREADY_EXISTS_IN_DOWNLOAD_LIST" +msgstr "Ya existe en la lista de descargas" + +msgid "IDS_BR_POP_ENTER_FOLDER_NAME" +msgstr "Introduzca el nombre de la carpeta" + +msgid "IDS_BR_POP_NO_PAGE" +msgstr "Ninguna página" + +msgid "IDS_BR_POP_NO_PAGES_BACKWARD" +msgstr "No se puede retroceder más" + +msgid "IDS_BR_POP_NO_PAGES_FORWARD" +msgstr "No se puede avanzar más" + +msgid "IDS_BR_POP_NO_PAGE_TO_RELOAD" +msgstr "Ninguna página que volver a cargar" + +msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED" +msgstr "Autenticación necesaria" + +msgid "IDS_BR_POP_BOOKMARK_ALREADY_EXISTS" +msgstr "El favorito ya existe" + +msgid "IDS_BR_POP_FOLDER_NAME_ALREADY_EXISTS" +msgstr "El nombre de carpeta ya existe" + +msgid "IDS_BR_POP_UNABLE_TO_SAVE_OBJECT_NOT_ENOUGH_SPACE_IN_CACHE" +msgstr "No se puede guardar objeto. No hay suficiente espacio en la caché" + +msgid "IDS_BR_HEADER_SELECT_ITEMS" +msgstr "Seleccionar elementos" + +msgid "IDS_BR_HEADER_CERTIFICATE_INFO" +msgstr "Información de certificado" + +msgid "IDS_BR_OPT_SHARE_VIA_EMAIL" +msgstr "Compartir por correo electrónico" + +msgid "IDS_BR_OPT_SHARE_VIA_MESSAGES" +msgstr "Compartir mediante mensajes" + +msgid "IDS_BR_OPT_SHARE_VIA" +msgstr "Compartir" + +msgid "IDS_BR_POP_UNABLE_TO_START_BROWSER" +msgstr "No se puede iniciar el navegador" + +msgid "IDS_BR_POP_NO_ADDRESS" +msgstr "Sin dirección" + +msgid "IDS_BR_POP_NEVER_SHOW_AGAIN" +msgstr "No volver a mostrar" + +msgid "IDS_BR_POP_FILE_NAME_EMPTY" +msgstr "Nombre de archivo vacío" + +msgid "IDS_BR_SK3_CREATE_FOLDER" +msgstr "Crear carpeta" + +msgid "IDS_BR_OPT_SELECTED" +msgstr "Seleccionado" + +msgid "IDS_BR_OPT_SHARE" +msgstr "Compartir" + +msgid "IDS_BR_HEADER_RECENTLY_VISITED_PAGES" +msgstr "Páginas visitadas recientemente" + +msgid "IDS_BR_OPT_DISPLAY" +msgstr "Pantalla" + +msgid "IDS_BR_BODY_FIT_TO_WIDTH" +msgstr "Ajustar al ancho" + +msgid "IDS_BR_BODY_READABLE" +msgstr "Legible" + +msgid "IDS_BR_BODY_PRIVACY" +msgstr "Privacidad" + +msgid "IDS_BR_BODY_COOKIES" +msgstr "Cookies" + +msgid "IDS_BR_BODY_COOKIESACCEPTALL" +msgstr "Aceptar todo" + +msgid "IDS_BR_BODY_COOKIESPROMPT" +msgstr "Solicitud" + +msgid "IDS_BR_HEADER_COOKIES" +msgstr "Cookies" + +msgid "IDS_BR_BODY_ACCEPT_COOKIES" +msgstr "Aceptar cookies" + +msgid "IDS_BR_OPT_ACCEPT_COOKIES" +msgstr "Aceptar cookies" + +msgid "IDS_BR_BODY_ACCEPT_ALL" +msgstr "Aceptar todo" + +msgid "IDS_BR_BODY_REJECT_ALL" +msgstr "Rechazar todo" + +msgid "IDS_BR_BODY_AUTO_SAVE_ID_PASSWORD" +msgstr "Guardar automáticamente ID/contraseña" + +msgid "IDS_BR_BODY_ON" +msgstr "Activado" + +msgid "IDS_BR_BODY_OFF" +msgstr "Off" + +msgid "IDS_BR_BODY_DEFAULT_STORAGE" +msgstr "Almacenamiento por defecto" + +msgid "IDS_BR_BODY_SEARCH" +msgstr "Buscar" + +msgid "IDS_BR_BODY_SAVE_IMAGE" +msgstr "Guardar imagen" + +msgid "IDS_BR_POP_LOW_BATTERY_UNABLE_TO_RUN_BROWSER" +msgstr "Nivel de batería bajo. No se puede ejecutar el navegador" + +msgid "IDS_BR_BODY_FIND_WORD" +msgstr "Buscar palabra" + +msgid "IDS_BR_OPT_ADD_TO_HOME_SCREEN" +msgstr "Añadir a pantalla de inicio" + +msgid "IDS_BR_OPT_ADD_TO_HOME_SCREEN_ABB" +msgstr "Añadir a pantalla de inicio" + +msgid "IDS_BR_BODY_MOST_VISITED_SITES" +msgstr "Sitios más visitados" + +msgid "IDS_BR_OPT_SHARE_VIA_FACEBOOK" +msgstr "Compartir mediante Facebook" + +msgid "IDS_BR_OPT_SHARE_VIA_TWITTER" +msgstr "Compartir mediante Twitter" + +msgid "IDS_BR_SK3_CHANGE_VIEW" +msgstr "Cambiar vista" + +msgid "IDS_BR_HEADER_SELECT_URLS" +msgstr "Seleccionar URL" + +msgid "IDS_BR_POP_THIS_SITE_IS_ATTEMPTING_TO_OPEN_POP_UP_WINDOW" +msgstr "Este sitio está intentando abrir una ventana emergente" + +msgid "IDS_BR_MBODY_BLOCK_POP_UP_WINDOWS" +msgstr "Bloquear ventanas emerg." + +msgid "IDS_BR_BODY_TEXT_READER" +msgstr "Lector de texto" + +msgid "IDS_BR_OPT_COPY_IMAGE" +msgstr "Copiar imagen" + +msgid "IDS_BR_OPT_SAVE_IMAGE" +msgstr "Guardar imagen" + +msgid "IDS_BR_BODY_PLAY" +msgstr "Reproducir" + +msgid "IDS_BR_OPT_SELECT" +msgstr "Seleccionar" + +msgid "IDS_BR_OPT_NAVIGATE_GO_BACKWARD" +msgstr "Ir atrás" + +msgid "IDS_BR_OPT_NAVIGATE_GO_FORWARD" +msgstr "Ir adelante" + +msgid "IDS_BR_OPT_STOP" +msgstr "Detener" + +msgid "IDS_BR_OPT_RELOAD" +msgstr "Recargar" + +msgid "IDS_BR_OPT_PASTE" +msgstr "Pegar" + +msgid "IDS_BR_BUTTON_MORE" +msgstr "Más" + +msgid "IDS_BR_POP_FAIL" +msgstr "Error" + +msgid "IDS_BR_BODY_OPEN_IN_NEW_WINDOW" +msgstr "Abrir en nueva vent." + +msgid "IDS_BR_OPT_VIEW_DOWNLOAD_LIST" +msgstr "Ver lista de descargas" + +msgid "IDS_BR_BODY_COPY_URL" +msgstr "Copiar URL" + +msgid "IDS_BR_BODY_COPY_URL_TO" +msgstr "Copiar URL a" + +msgid "IDS_BR_BODY_VIEW_IMAGE" +msgstr "Ver imagen" + +msgid "IDS_BR_BODY_PRIVACY_SETTINGS" +msgstr "Ajustes de privacidad" + +msgid "IDS_BR_BODY_CLEAR_CACHE" +msgstr "Borrar caché" + +msgid "IDS_BR_BODY_CLEAR_HISTORY" +msgstr "Borrar historial" + +msgid "IDS_BR_BODY_ENABLE_PLUG_INS" +msgstr "Activar complementos" + +msgid "IDS_BR_BODY_SELECT_SEARCH_ENGINE" +msgstr "Seleccione el motor de búsqueda" + +msgid "IDS_BR_BODY_DELETE_SAVED_ID_PASSWORD" +msgstr "Eliminar contraseña/Id. guardados" + +msgid "IDS_BR_BODY_CLEAR_ALL_COOKIE_DATA" +msgstr "Borrar todos los datos de cookies" + +msgid "IDS_BR_BODY_UP" +msgstr "Arriba" + +msgid "IDS_BR_BODY_FONT_SIZE" +msgstr "Tamaño de fuente" + +msgid "IDS_BR_POP_DELETED" +msgstr "Eliminado" + +msgid "IDS_BR_BODY_DEFAULT_VIEW" +msgstr "Vista predeterminada" + +msgid "IDS_BR_MBODY_PAGE_CONTENT_SETTINGS" +msgstr "Ajuste. del cont. de pág." + +msgid "IDS_BR_POP_CASE_SENSITIVE" +msgstr "Distinción mayúsculas/minúsculas" + +msgid "IDS_BR_BODY_PLUG_IN" +msgstr "Complemento" + +msgid "IDS_BR_OPT_PLUGINS_LIST" +msgstr "Lista de complementos" + +msgid "IDS_BR_HEADER_LOCAL_STORAGE" +msgstr "Almacenamiento local" + +msgid "IDS_BR_BODY_DELETE_BROWSING_DATA" +msgstr "Eliminar datos de navegación" + +msgid "IDS_BR_BODY_LOADING_ING" +msgstr "Cargando..." + +msgid "IDS_BR_HEADER_LOADING_ING" +msgstr "Cargando..." + +msgid "IDS_BR_HEADER_ENTERURL" +msgstr "Introducir URL" + +msgid "IDS_BR_OPT_LOCK" +msgstr "Bloquear" + +msgid "IDS_BR_OPT_UNLOCK" +msgstr "Desbloquear" + +msgid "IDS_BR_BODY_MODIFY" +msgstr "Modificar" + +msgid "IDS_BR_SK_PAGE_UP" +msgstr "Pág. arriba" + +msgid "IDS_BR_SK_PAGE_DOWN" +msgstr "Pág. abajo" + +msgid "IDS_BR_BODY_DEVELOPER_MODE" +msgstr "Modo de desarrollador" + +msgid "IDS_BR_BODY_EMPTY" +msgstr "Vacío" + +msgid "IDS_BR_BODY_CERTIFICATES" +msgstr "Certificados" + +msgid "IDS_BR_BODY_BOOKMARKS" +msgstr "Favoritos" + +msgid "IDS_BR_BODY_ENTER_NAME" +msgstr "Introducir nombre" + +msgid "IDS_BR_BODY_NAME" +msgstr "Nombre" + +msgid "IDS_BR_OPT_SEND_VIA_EMAIL" +msgstr "Enviar por correo electrónico" + +msgid "IDS_BR_OPT_SEND_VIA_MESSAGE" +msgstr "Enviar vía mensaje" + +msgid "IDS_BR_BODY_SETTINGS" +msgstr "Ajustes" + +msgid "IDS_BR_BODY_AUTHUSERNAME" +msgstr "Nombre de usuario" + +msgid "IDS_BR_POP_ALREADY_EXISTS" +msgstr "Ya existe" + +msgid "IDS_BR_POP_SAVED" +msgstr "Guardado" + +msgid "IDS_BR_POP_NOT_ENOUGH_MEMORY" +msgstr "No hay suficiente memoria" + +msgid "IDS_BR_POP_NETWORK_ERROR" +msgstr "Error de red" + +msgid "IDS_BR_BODY_ALWAYS_ASK" +msgstr "Preguntar siempre" + +msgid "IDS_BR_BODY_MEMORY_CARD" +msgstr "Tarjeta de memoria" + +msgid "IDS_BR_BODY_PHONE" +msgstr "Teléfono" + +msgid "IDS_BR_BODY_NO_ACCOUNTS_ABB" +msgstr "Ninguna cuenta" + +msgid "IDS_BR_HEADER_ERROR_PAGE" +msgstr "Página de error" + +msgid "IDS_BR_BODY_WEB_PAGE_TEMPORARILY_NOT_AVAILABLE" +msgstr "La página web no está disponible temporalmente" + +msgid "IDS_BR_BODY_WEB_PAGE_NOT_AVAILABLE" +msgstr "Página web no disponible" + +msgid "IDS_BR_BODY_FAILED_TO_LOAD_FRAMES" +msgstr "Error al cargar marcos" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_1" +msgstr "Se ha producido el siguiente error al recuperar la página web %s." + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_2" +msgstr "No se puede recuperar la página web. (Puede que la página web esté inactiva de forma temporal o se haya movido a una nueva URL)" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_3" +msgstr "La causa más probable se incluye abajo" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_4" +msgstr "La conexión de red no se ha establecido con normalidad" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_5" +msgstr "Comprobar la URL de la página web" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_6" +msgstr "Volver a cargar la página web más tarde" + +msgid "IDS_BR_OPT_BOOKMARK" +msgstr "Favorito" + +msgid "IDS_BR_BODY_TITLE" +msgstr "Título" + +msgid "IDS_BR_BODY_ENTER_TITLE" +msgstr "Introducir título" + +msgid "IDS_BR_OPT_FOLDERS" +msgstr "Carpetas" + +msgid "IDS_BR_OPT_ALLOW" +msgstr "Permitir" + +msgid "IDS_BR_POP_REFUSE" +msgstr "Rechazar" + +msgid "IDS_BR_POP_SECURITY_ERROR_C_UNTRUSTED_SERVER_CERTIFICATE" +msgstr "Error de seguridad: certificado de servidor no fiable" + +msgid "IDS_BR_POP_PD_ITEMS_SELECTED" +msgstr "%d elementos seleccionados" + +msgid "IDS_BR_POP_1_ITEM_SELECTED" +msgstr "1 elemento seleccionado" + diff --git a/po/fr_FR.po b/po/fr_FR.po new file mode 100755 index 00000000..9cc290ee --- /dev/null +++ b/po/fr_FR.po @@ -0,0 +1,621 @@ +msgid "IDS_BR_POP_INSTALLATION_FAILED" +msgstr "Echec de l'installation" + +msgid "IDS_BR_BODY_NOTIFYING_ING" +msgstr "Notification..." + +msgid "IDS_BR_BODY_PROCESSING_ING" +msgstr "En cours..." + +msgid "IDS_BR_BODY_PROCESSING_COMPLETED" +msgstr "Traitement terminé" + +msgid "IDS_BR_SK_RETRY" +msgstr "Réessayer" + +msgid "IDS_BR_HEADER_DOWNLOAD_MANAGER" +msgstr "Gestionnaire de téléchargement" + +msgid "IDS_BR_POP_INVALIDDESCRIPTOR" +msgstr "Descripteur non valide" + +msgid "IDS_BR_POP_UNABLE_TO_OPEN_FILE" +msgstr "Impossible d'ouvrir le fichier" + +msgid "IDS_BR_POP_DOWNLOAD_Q" +msgstr "Télécharger ?" + +msgid "IDS_BR_OPT_DELETE_SELECTED" +msgstr "Sélectionné" + +msgid "IDS_BR_POP_DOWNLOAD_CANCELLED" +msgstr "Téléchargement annulé" + +msgid "IDS_BR_BODY_CONTINUE_FROM_LAST_PAGE" +msgstr "Dernière page" + +msgid "IDS_BR_BODY_PAGE" +msgstr "Page" + +msgid "IDS_BR_OPT_DICTIONARY" +msgstr "Dictionnaire" + +msgid "IDS_BR_BODY_ABOUT_BROWSER" +msgstr "A propos du navigateur" + +msgid "IDS_BR_BODY_BROWSER_TYPE" +msgstr "Type" + +msgid "IDS_BR_BODY_CERTIFICATE_ISSUER" +msgstr "Emetteur" + +msgid "IDS_BR_BODY_DISPLAY_IMAGES" +msgstr "Afficher les images" + +msgid "IDS_BR_BODY_DOWNLOAD" +msgstr "Télécharger" + +msgid "IDS_BR_BODY_ENTER_URL" +msgstr "Saisir une URL" + +msgid "IDS_BR_BODY_FOLDER" +msgstr "Dossier" + +msgid "IDS_BR_BODY_HOMEPAGE" +msgstr "Page d'accueil" + +msgid "IDS_BR_BODY_LANDSCAPE_VIEW" +msgstr "Paysage" + +msgid "IDS_BR_BODY_NO_BOOKMARKS" +msgstr "Aucun favori" + +msgid "IDS_BR_BODY_NO_RESULTS_FOUND" +msgstr "Aucun résultat trouvé" + +msgid "IDS_BR_BODY_OPTIONAL" +msgstr "Facultatif" + +msgid "IDS_BR_BODY_RSS" +msgstr "RSS" + +msgid "IDS_BR_BODY_RUN_FLASH" +msgstr "Exécuter Flash" + +msgid "IDS_BR_BODY_RUN_JAVASCRIPT" +msgstr "Exécuter JavaScript" + +msgid "IDS_BR_HEADER_COMMON_NAME_C" +msgstr "Nom commun :" + +msgid "IDS_BR_HEADER_ORGANIZATIONAL_UNIT_C" +msgstr "Unité organisation :" + +msgid "IDS_BR_HEADER_ORGANIZATION_C" +msgstr "Organisation :" + +msgid "IDS_BR_HEADER_USER_AGENT" +msgstr "Utilisateur téléphone" + +msgid "IDS_BR_OPT_LAST_VIEWED_PAGE_ATNT" +msgstr "Dernière page affichée" + +msgid "IDS_BR_OPT_PREFERENCES" +msgstr "Préférences" + +msgid "IDS_BR_POP_ACTICATION_ERR" +msgstr "Erreur d'activation" + +msgid "IDS_BR_POP_ALREADY_RUNNING" +msgstr "Déjà en cours d'exécution" + +msgid "IDS_BR_POP_ERRORIMPLEMENTED" +msgstr "Non implémenté" + +msgid "IDS_BR_POP_HTTPERRAUTHFAILED" +msgstr "Echec d'authentification" + +msgid "IDS_BR_POP_OVERWRITE_Q" +msgstr "Remplacer ?" + +msgid "IDS_BR_POP_URL" +msgstr "URL" + +msgid "IDS_BR_TAB_HISTORY" +msgstr "Historique" + +msgid "IDS_BR_HEADER_DOWNLOAD_LIST" +msgstr "Liste de téléchargement" + +msgid "IDS_BR_POP_ALREADYINSTALLED" +msgstr "Déjà installé" + +msgid "IDS_BR_POP_NOTIFYING" +msgstr "Notification..." + +msgid "IDS_BR_POP_NOTSUPPORT" +msgstr "Contenu non supporté" + +msgid "IDS_BR_POP_ERROR_C_UNABLE_TO_RESOLVE_HOST_NAME" +msgstr "Erreur : impossible de résoudre le nom d'hôte" + +msgid "IDS_BR_POP_UNABLE_TO_REACH_PROXY" +msgstr "Impossible d'atteindre le proxy" + +msgid "IDS_BR_POP_NOSSLCERTI" +msgstr "Aucun certificat SSL" + +msgid "IDS_BR_BODY_FILE_SIZE_EXCEEDS_MAXIMUM_UPLOAD_LIMIT" +msgstr "La taille du fichier dépasse la limite de chargement maximale" + +msgid "IDS_BR_BODY_ENTER_NAME_C" +msgstr "Saisir un nom :" + +msgid "IDS_BR_SK_NEXT" +msgstr "Suivant" + +msgid "IDS_BR_OPT_NEW_FOLDER" +msgstr "Nouveau dossier" + +msgid "IDS_BR_SK3_ADD_TO_BOOKMARKS" +msgstr "Ajouter aux favoris" + +msgid "IDS_BR_SK1_NEW_WINDOW" +msgstr "Nouvelle fenêtre" + +msgid "IDS_BR_BODY_URL" +msgstr "URL" + +msgid "IDS_BR_BODY_URL_C" +msgstr "URL :" + +msgid "IDS_BR_BODY_URL_NOT_AVAILABLE" +msgstr "URL indisponible" + +msgid "IDS_BR_BODY_URL_PS_NOT_AVAILABLE_IT_MIGHT_BE_DOWN_TEMPORARILY_OR_NO_LONGER_IN_USE" +msgstr "URL %s indisponible. Elle est peut-être en panne de manière temporaire ou elle n'est plus utilisée" + +msgid "IDS_BR_HEADER_FOLDER" +msgstr "Dossier" + +msgid "IDS_BR_BODY_FOLDER_NAME" +msgstr "Nom de dossier" + +msgid "IDS_BR_BODY_FOLDER_NAME_ALREADY_IN_USE" +msgstr "Nom de dossier déjà utilisé" + +msgid "IDS_BR_BODY_NO_TITLE" +msgstr "Sans titre" + +msgid "IDS_BR_HEADER_MULTI_WINDOW" +msgstr "Fenêtres" + +msgid "IDS_BR_BODY_NO_HISTORIES" +msgstr "Aucun historique" + +msgid "IDS_BR_BODY_ADD_TO_BOOKMARKS" +msgstr "Ajouter aux favoris" + +msgid "IDS_BR_BODY_EDIT_BOOKMARK" +msgstr "Modifier le favori" + +msgid "IDS_BR_BODY_FOLDER_NAME_C" +msgstr "Nom du dossier :" + +msgid "IDS_BR_OPT_SELECT_ALL" +msgstr "Sélect. tout" + +msgid "IDS_BR_OPT_DOWNLOAD_MANAGER" +msgstr "Gestionnaire de téléchargement" + +msgid "IDS_BR_OPT_ADD_RSS_FEED" +msgstr "Ajouter flux RSS" + +msgid "IDS_BR_OPT_ADD_RSS_FEEDS" +msgstr "Ajouter des flux RSS" + +msgid "IDS_BR_OPT_SETTINGS" +msgstr "Paramètres" + +msgid "IDS_BR_POP_ENTER_URL" +msgstr "Saisir une URL" + +msgid "IDS_BR_BODY_AUTHPASSWORD" +msgstr "Mot de passe" + +msgid "IDS_BR_POP_INVALIDADDRESS" +msgstr "Adresse non valide" + +msgid "IDS_BR_POP_ALREADY_EXISTS_IN_DOWNLOAD_LIST" +msgstr "Existe déjà dans la liste de téléchargement" + +msgid "IDS_BR_POP_ENTER_FOLDER_NAME" +msgstr "Entrer nom du dossier" + +msgid "IDS_BR_POP_NO_PAGE" +msgstr "Pas de page" + +msgid "IDS_BR_POP_NO_PAGES_BACKWARD" +msgstr "Aucune page précédente" + +msgid "IDS_BR_POP_NO_PAGES_FORWARD" +msgstr "Aucune page suivante" + +msgid "IDS_BR_POP_NO_PAGE_TO_RELOAD" +msgstr "Aucune page à recharger" + +msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED" +msgstr "Authentification obligatoire" + +msgid "IDS_BR_POP_BOOKMARK_ALREADY_EXISTS" +msgstr "Ce favori existe déjà" + +msgid "IDS_BR_POP_FOLDER_NAME_ALREADY_EXISTS" +msgstr "Nom de dossier déjà utilisé" + +msgid "IDS_BR_POP_UNABLE_TO_SAVE_OBJECT_NOT_ENOUGH_SPACE_IN_CACHE" +msgstr "Enregistrement de l'objet impossible. Espace insuffisant dans le cache" + +msgid "IDS_BR_HEADER_SELECT_ITEMS" +msgstr "Sélectionner éléments" + +msgid "IDS_BR_HEADER_CERTIFICATE_INFO" +msgstr "Infos sur le certificat" + +msgid "IDS_BR_OPT_SHARE_VIA_EMAIL" +msgstr "Partager par e-mail" + +msgid "IDS_BR_OPT_SHARE_VIA_MESSAGES" +msgstr "Partager par messages" + +msgid "IDS_BR_OPT_SHARE_VIA" +msgstr "Partager via" + +msgid "IDS_BR_POP_UNABLE_TO_START_BROWSER" +msgstr "Impossible de démarrer le navigateur" + +msgid "IDS_BR_POP_NO_ADDRESS" +msgstr "Aucune adresse" + +msgid "IDS_BR_POP_NEVER_SHOW_AGAIN" +msgstr "Ne plus afficher" + +msgid "IDS_BR_POP_FILE_NAME_EMPTY" +msgstr "Nom de fichier vide" + +msgid "IDS_BR_SK3_CREATE_FOLDER" +msgstr "Créer dossier" + +msgid "IDS_BR_OPT_SELECTED" +msgstr "Sélectionné" + +msgid "IDS_BR_OPT_SHARE" +msgstr "Partager" + +msgid "IDS_BR_HEADER_RECENTLY_VISITED_PAGES" +msgstr "Pages visitées récemment" + +msgid "IDS_BR_OPT_DISPLAY" +msgstr "Affichage" + +msgid "IDS_BR_BODY_FIT_TO_WIDTH" +msgstr "Ajuster selon largeur" + +msgid "IDS_BR_BODY_READABLE" +msgstr "Lisible" + +msgid "IDS_BR_BODY_PRIVACY" +msgstr "Confidentialité" + +msgid "IDS_BR_BODY_COOKIES" +msgstr "Cookies" + +msgid "IDS_BR_BODY_COOKIESACCEPTALL" +msgstr "Tout accepter" + +msgid "IDS_BR_BODY_COOKIESPROMPT" +msgstr "Demander" + +msgid "IDS_BR_HEADER_COOKIES" +msgstr "Cookies" + +msgid "IDS_BR_BODY_ACCEPT_COOKIES" +msgstr "Accepter les cookies" + +msgid "IDS_BR_OPT_ACCEPT_COOKIES" +msgstr "Accepter les cookies" + +msgid "IDS_BR_BODY_ACCEPT_ALL" +msgstr "Tout accepter" + +msgid "IDS_BR_BODY_REJECT_ALL" +msgstr "Tout refuser" + +msgid "IDS_BR_BODY_AUTO_SAVE_ID_PASSWORD" +msgstr "Enregistrer automatiquement ID/mot de passe" + +msgid "IDS_BR_BODY_ON" +msgstr "Activé" + +msgid "IDS_BR_BODY_OFF" +msgstr "Désactivé" + +msgid "IDS_BR_BODY_DEFAULT_STORAGE" +msgstr "Stockage par défaut" + +msgid "IDS_BR_BODY_SEARCH" +msgstr "Rechercher" + +msgid "IDS_BR_BODY_SAVE_IMAGE" +msgstr "Enregistrer image" + +msgid "IDS_BR_POP_LOW_BATTERY_UNABLE_TO_RUN_BROWSER" +msgstr "Batterie faible. Impossible d'exécuter le navigateur" + +msgid "IDS_BR_BODY_FIND_WORD" +msgstr "Rechercher mot" + +msgid "IDS_BR_OPT_ADD_TO_HOME_SCREEN" +msgstr "Ajouter à l'écran d'accueil" + +msgid "IDS_BR_OPT_ADD_TO_HOME_SCREEN_ABB" +msgstr "Ajouter à l'écran d'accueil" + +msgid "IDS_BR_BODY_MOST_VISITED_SITES" +msgstr "Sites les plus visités" + +msgid "IDS_BR_OPT_SHARE_VIA_FACEBOOK" +msgstr "Partager via Facebook" + +msgid "IDS_BR_OPT_SHARE_VIA_TWITTER" +msgstr "Partager via Twitter" + +msgid "IDS_BR_SK3_CHANGE_VIEW" +msgstr "Modif. affichage" + +msgid "IDS_BR_HEADER_SELECT_URLS" +msgstr "Sélectionner des URL" + +msgid "IDS_BR_POP_THIS_SITE_IS_ATTEMPTING_TO_OPEN_POP_UP_WINDOW" +msgstr "Ce site tente d'ouvrir une fenêtre pop-up" + +msgid "IDS_BR_MBODY_BLOCK_POP_UP_WINDOWS" +msgstr "Bloquer fenêtres pop-up" + +msgid "IDS_BR_BODY_TEXT_READER" +msgstr "Lecteur de texte" + +msgid "IDS_BR_OPT_COPY_IMAGE" +msgstr "Copier l'image" + +msgid "IDS_BR_OPT_SAVE_IMAGE" +msgstr "Enregistrer image" + +msgid "IDS_BR_BODY_PLAY" +msgstr "Lire" + +msgid "IDS_BR_OPT_SELECT" +msgstr "Sélectionner" + +msgid "IDS_BR_OPT_NAVIGATE_GO_BACKWARD" +msgstr "Page précédente" + +msgid "IDS_BR_OPT_NAVIGATE_GO_FORWARD" +msgstr "Page suivante" + +msgid "IDS_BR_OPT_STOP" +msgstr "Arrêt" + +msgid "IDS_BR_OPT_RELOAD" +msgstr "Recharger" + +msgid "IDS_BR_OPT_PASTE" +msgstr "Coller" + +msgid "IDS_BR_BUTTON_MORE" +msgstr "Plus d'applis" + +msgid "IDS_BR_POP_FAIL" +msgstr "Echec" + +msgid "IDS_BR_BODY_OPEN_IN_NEW_WINDOW" +msgstr "Ouvrir nouvelle fenêtre" + +msgid "IDS_BR_OPT_VIEW_DOWNLOAD_LIST" +msgstr "Afficher la liste de téléchargement" + +msgid "IDS_BR_BODY_COPY_URL" +msgstr "Copier l'URL" + +msgid "IDS_BR_BODY_COPY_URL_TO" +msgstr "Copier l'URL vers" + +msgid "IDS_BR_BODY_VIEW_IMAGE" +msgstr "Afficher image" + +msgid "IDS_BR_BODY_PRIVACY_SETTINGS" +msgstr "Paramètres de confidentialité" + +msgid "IDS_BR_BODY_CLEAR_CACHE" +msgstr "Vider le cache" + +msgid "IDS_BR_BODY_CLEAR_HISTORY" +msgstr "Effacer l'historique" + +msgid "IDS_BR_BODY_ENABLE_PLUG_INS" +msgstr "Activer les plug-ins" + +msgid "IDS_BR_BODY_SELECT_SEARCH_ENGINE" +msgstr "Sélectionner un moteur de recherche" + +msgid "IDS_BR_BODY_DELETE_SAVED_ID_PASSWORD" +msgstr "Supprimer ID/MDP enregistrés" + +msgid "IDS_BR_BODY_CLEAR_ALL_COOKIE_DATA" +msgstr "Supprimer tous les cookies" + +msgid "IDS_BR_BODY_UP" +msgstr "Haut" + +msgid "IDS_BR_BODY_FONT_SIZE" +msgstr "Taille de la police" + +msgid "IDS_BR_POP_DELETED" +msgstr "Supprimé" + +msgid "IDS_BR_BODY_DEFAULT_VIEW" +msgstr "Vue par défaut" + +msgid "IDS_BR_MBODY_PAGE_CONTENT_SETTINGS" +msgstr "Param. contenu des pages" + +msgid "IDS_BR_POP_CASE_SENSITIVE" +msgstr "Sensible à la casse" + +msgid "IDS_BR_BODY_PLUG_IN" +msgstr "Plug-in" + +msgid "IDS_BR_OPT_PLUGINS_LIST" +msgstr "Liste des plug-ins" + +msgid "IDS_BR_HEADER_LOCAL_STORAGE" +msgstr "Stockage local" + +msgid "IDS_BR_BODY_DELETE_BROWSING_DATA" +msgstr "Supprimer les données de navigation" + +msgid "IDS_BR_BODY_LOADING_ING" +msgstr "Chargement..." + +msgid "IDS_BR_HEADER_LOADING_ING" +msgstr "Chargement..." + +msgid "IDS_BR_HEADER_ENTERURL" +msgstr "Saisir une URL" + +msgid "IDS_BR_OPT_LOCK" +msgstr "Verrouiller" + +msgid "IDS_BR_OPT_UNLOCK" +msgstr "Déverrouiller" + +msgid "IDS_BR_BODY_MODIFY" +msgstr "Modifier" + +msgid "IDS_BR_SK_PAGE_UP" +msgstr "Précédente" + +msgid "IDS_BR_SK_PAGE_DOWN" +msgstr "Suivante" + +msgid "IDS_BR_BODY_DEVELOPER_MODE" +msgstr "Mode développeur" + +msgid "IDS_BR_BODY_EMPTY" +msgstr "Vide" + +msgid "IDS_BR_BODY_CERTIFICATES" +msgstr "Certificats" + +msgid "IDS_BR_BODY_BOOKMARKS" +msgstr "Favoris" + +msgid "IDS_BR_BODY_ENTER_NAME" +msgstr "Saisissez votre nom" + +msgid "IDS_BR_BODY_NAME" +msgstr "Nom" + +msgid "IDS_BR_OPT_SEND_VIA_EMAIL" +msgstr "Envoyer par e-mail" + +msgid "IDS_BR_OPT_SEND_VIA_MESSAGE" +msgstr "Envoyer par message" + +msgid "IDS_BR_BODY_SETTINGS" +msgstr "Paramètres" + +msgid "IDS_BR_BODY_AUTHUSERNAME" +msgstr "Nom d'utilisateur" + +msgid "IDS_BR_POP_ALREADY_EXISTS" +msgstr "Existe déjà" + +msgid "IDS_BR_POP_SAVED" +msgstr "Enregistré" + +msgid "IDS_BR_POP_NOT_ENOUGH_MEMORY" +msgstr "Mémoire insuffisante" + +msgid "IDS_BR_POP_NETWORK_ERROR" +msgstr "Erreur réseau" + +msgid "IDS_BR_BODY_ALWAYS_ASK" +msgstr "Toujours demander" + +msgid "IDS_BR_BODY_MEMORY_CARD" +msgstr "Carte mémoire" + +msgid "IDS_BR_BODY_PHONE" +msgstr "Téléphone" + +msgid "IDS_BR_BODY_NO_ACCOUNTS_ABB" +msgstr "Aucun compte" + +msgid "IDS_BR_HEADER_ERROR_PAGE" +msgstr "Page d'erreur" + +msgid "IDS_BR_BODY_WEB_PAGE_TEMPORARILY_NOT_AVAILABLE" +msgstr "Page Web temporairement indisponible" + +msgid "IDS_BR_BODY_WEB_PAGE_NOT_AVAILABLE" +msgstr "Page Web non disponible" + +msgid "IDS_BR_BODY_FAILED_TO_LOAD_FRAMES" +msgstr "Impossible de charger les images" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_1" +msgstr "Lors de la récupération de la page Web %s, l'erreur suivante s'est produite." + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_2" +msgstr "Impossible de récupérer la page Web. (La page Web est peut-être temporairement indisponible ou a été déplacée vers une autre URL)" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_3" +msgstr "La cause la plus probable est indiquée ci-dessous" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_4" +msgstr "Connexion réseau non établie normalement" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_5" +msgstr "Vérifier URL de la page Web" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_6" +msgstr "Recharger la page Web plus tard" + +msgid "IDS_BR_OPT_BOOKMARK" +msgstr "Favori" + +msgid "IDS_BR_BODY_TITLE" +msgstr "Titre" + +msgid "IDS_BR_BODY_ENTER_TITLE" +msgstr "Saisir un titre" + +msgid "IDS_BR_OPT_FOLDERS" +msgstr "Dossiers" + +msgid "IDS_BR_OPT_ALLOW" +msgstr "Autoriser" + +msgid "IDS_BR_POP_REFUSE" +msgstr "Refuser" + +msgid "IDS_BR_POP_SECURITY_ERROR_C_UNTRUSTED_SERVER_CERTIFICATE" +msgstr "Erreur de sécurité : certificat du serveur non sécurisé" + +msgid "IDS_BR_POP_PD_ITEMS_SELECTED" +msgstr "%d éléments sélectionnés" + +msgid "IDS_BR_POP_1_ITEM_SELECTED" +msgstr "1 élément sélectionné" + diff --git a/po/it_IT.po b/po/it_IT.po new file mode 100755 index 00000000..c859d15a --- /dev/null +++ b/po/it_IT.po @@ -0,0 +1,621 @@ +msgid "IDS_BR_POP_INSTALLATION_FAILED" +msgstr "Installazione fallita" + +msgid "IDS_BR_BODY_NOTIFYING_ING" +msgstr "Notifica in corso..." + +msgid "IDS_BR_BODY_PROCESSING_ING" +msgstr "Elaborazione..." + +msgid "IDS_BR_BODY_PROCESSING_COMPLETED" +msgstr "Elaborazione completata" + +msgid "IDS_BR_SK_RETRY" +msgstr "Riprova" + +msgid "IDS_BR_HEADER_DOWNLOAD_MANAGER" +msgstr "Gestione download" + +msgid "IDS_BR_POP_INVALIDDESCRIPTOR" +msgstr "Descrittore non valido" + +msgid "IDS_BR_POP_UNABLE_TO_OPEN_FILE" +msgstr "Impossibile aprire file" + +msgid "IDS_BR_POP_DOWNLOAD_Q" +msgstr "Scaricare?" + +msgid "IDS_BR_OPT_DELETE_SELECTED" +msgstr "Selezionato" + +msgid "IDS_BR_POP_DOWNLOAD_CANCELLED" +msgstr "Download annullato" + +msgid "IDS_BR_BODY_CONTINUE_FROM_LAST_PAGE" +msgstr "Continua da ult. pag." + +msgid "IDS_BR_BODY_PAGE" +msgstr "Pagina" + +msgid "IDS_BR_OPT_DICTIONARY" +msgstr "Dizionario" + +msgid "IDS_BR_BODY_ABOUT_BROWSER" +msgstr "Informazioni sul browser" + +msgid "IDS_BR_BODY_BROWSER_TYPE" +msgstr "Tipo" + +msgid "IDS_BR_BODY_CERTIFICATE_ISSUER" +msgstr "Emittente" + +msgid "IDS_BR_BODY_DISPLAY_IMAGES" +msgstr "Visualizza immagini" + +msgid "IDS_BR_BODY_DOWNLOAD" +msgstr "Download" + +msgid "IDS_BR_BODY_ENTER_URL" +msgstr "Inserisci URL" + +msgid "IDS_BR_BODY_FOLDER" +msgstr "Cartella" + +msgid "IDS_BR_BODY_HOMEPAGE" +msgstr "Homepage" + +msgid "IDS_BR_BODY_LANDSCAPE_VIEW" +msgstr "Orizzontale" + +msgid "IDS_BR_BODY_NO_BOOKMARKS" +msgstr "Nessun preferito" + +msgid "IDS_BR_BODY_NO_RESULTS_FOUND" +msgstr "Nessun risultato trovato" + +msgid "IDS_BR_BODY_OPTIONAL" +msgstr "Opzionale" + +msgid "IDS_BR_BODY_RSS" +msgstr "RSS" + +msgid "IDS_BR_BODY_RUN_FLASH" +msgstr "Esegui Flash" + +msgid "IDS_BR_BODY_RUN_JAVASCRIPT" +msgstr "Esegui JavaScript" + +msgid "IDS_BR_HEADER_COMMON_NAME_C" +msgstr "Nome comune:" + +msgid "IDS_BR_HEADER_ORGANIZATIONAL_UNIT_C" +msgstr "Unità organizzativa:" + +msgid "IDS_BR_HEADER_ORGANIZATION_C" +msgstr "Organizzazione:" + +msgid "IDS_BR_HEADER_USER_AGENT" +msgstr "Agente utente" + +msgid "IDS_BR_OPT_LAST_VIEWED_PAGE_ATNT" +msgstr "Last Viewed Page" + +msgid "IDS_BR_OPT_PREFERENCES" +msgstr "Preferenze" + +msgid "IDS_BR_POP_ACTICATION_ERR" +msgstr "Errore di attivazione" + +msgid "IDS_BR_POP_ALREADY_RUNNING" +msgstr "Già in esecuzione" + +msgid "IDS_BR_POP_ERRORIMPLEMENTED" +msgstr "Non implementato" + +msgid "IDS_BR_POP_HTTPERRAUTHFAILED" +msgstr "Autenticazione non riuscita" + +msgid "IDS_BR_POP_OVERWRITE_Q" +msgstr "Sovrascrivere?" + +msgid "IDS_BR_POP_URL" +msgstr "URL" + +msgid "IDS_BR_TAB_HISTORY" +msgstr "Cronologia" + +msgid "IDS_BR_HEADER_DOWNLOAD_LIST" +msgstr "Elenco download" + +msgid "IDS_BR_POP_ALREADYINSTALLED" +msgstr "Già installato" + +msgid "IDS_BR_POP_NOTIFYING" +msgstr "Notifica..." + +msgid "IDS_BR_POP_NOTSUPPORT" +msgstr "Contenuto non supportato" + +msgid "IDS_BR_POP_ERROR_C_UNABLE_TO_RESOLVE_HOST_NAME" +msgstr "Errore: impossibile risolvere nome host" + +msgid "IDS_BR_POP_UNABLE_TO_REACH_PROXY" +msgstr "Impossibile raggiungere proxy" + +msgid "IDS_BR_POP_NOSSLCERTI" +msgstr "Nessun certificato SSL" + +msgid "IDS_BR_BODY_FILE_SIZE_EXCEEDS_MAXIMUM_UPLOAD_LIMIT" +msgstr "Le dimensioni dei file superano il limite consentito per il caricamento" + +msgid "IDS_BR_BODY_ENTER_NAME_C" +msgstr "Inserisci nome:" + +msgid "IDS_BR_SK_NEXT" +msgstr "Avanti" + +msgid "IDS_BR_OPT_NEW_FOLDER" +msgstr "Nuova cartella" + +msgid "IDS_BR_SK3_ADD_TO_BOOKMARKS" +msgstr "Aggiungi a Preferiti" + +msgid "IDS_BR_SK1_NEW_WINDOW" +msgstr "Nuova finestra" + +msgid "IDS_BR_BODY_URL" +msgstr "URL" + +msgid "IDS_BR_BODY_URL_C" +msgstr "URL:" + +msgid "IDS_BR_BODY_URL_NOT_AVAILABLE" +msgstr "URL non disponibile" + +msgid "IDS_BR_BODY_URL_PS_NOT_AVAILABLE_IT_MIGHT_BE_DOWN_TEMPORARILY_OR_NO_LONGER_IN_USE" +msgstr "URL %s non disponibile. Potrebbe essere temporaneamente inattivo o non più in uso" + +msgid "IDS_BR_HEADER_FOLDER" +msgstr "Cartella" + +msgid "IDS_BR_BODY_FOLDER_NAME" +msgstr "Nome cartella" + +msgid "IDS_BR_BODY_FOLDER_NAME_ALREADY_IN_USE" +msgstr "Nome cartella già in uso" + +msgid "IDS_BR_BODY_NO_TITLE" +msgstr "Nessun titolo" + +msgid "IDS_BR_HEADER_MULTI_WINDOW" +msgstr "Fines. multipla" + +msgid "IDS_BR_BODY_NO_HISTORIES" +msgstr "Nessuna cronologia" + +msgid "IDS_BR_BODY_ADD_TO_BOOKMARKS" +msgstr "Aggiungi a Preferiti" + +msgid "IDS_BR_BODY_EDIT_BOOKMARK" +msgstr "Modifica preferito" + +msgid "IDS_BR_BODY_FOLDER_NAME_C" +msgstr "Nome cartella:" + +msgid "IDS_BR_OPT_SELECT_ALL" +msgstr "Seleziona tutto" + +msgid "IDS_BR_OPT_DOWNLOAD_MANAGER" +msgstr "Gestione download" + +msgid "IDS_BR_OPT_ADD_RSS_FEED" +msgstr "Aggiungi feed RSS" + +msgid "IDS_BR_OPT_ADD_RSS_FEEDS" +msgstr "Aggiungi feed RSS" + +msgid "IDS_BR_OPT_SETTINGS" +msgstr "Impostazioni" + +msgid "IDS_BR_POP_ENTER_URL" +msgstr "Inserisci URL" + +msgid "IDS_BR_BODY_AUTHPASSWORD" +msgstr "Password" + +msgid "IDS_BR_POP_INVALIDADDRESS" +msgstr "Indirizzo non valido" + +msgid "IDS_BR_POP_ALREADY_EXISTS_IN_DOWNLOAD_LIST" +msgstr "Già esistente nell'elenco download" + +msgid "IDS_BR_POP_ENTER_FOLDER_NAME" +msgstr "Specifica nome cartella" + +msgid "IDS_BR_POP_NO_PAGE" +msgstr "Nessuna pagina" + +msgid "IDS_BR_POP_NO_PAGES_BACKWARD" +msgstr "Nessuna pagina indietro" + +msgid "IDS_BR_POP_NO_PAGES_FORWARD" +msgstr "Nessuna pagina avanti" + +msgid "IDS_BR_POP_NO_PAGE_TO_RELOAD" +msgstr "Nessuna pagina da ricaricare" + +msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED" +msgstr "Autenticazione richiesta" + +msgid "IDS_BR_POP_BOOKMARK_ALREADY_EXISTS" +msgstr "Preferito già esistente" + +msgid "IDS_BR_POP_FOLDER_NAME_ALREADY_EXISTS" +msgstr "Nome cartella già esistente" + +msgid "IDS_BR_POP_UNABLE_TO_SAVE_OBJECT_NOT_ENOUGH_SPACE_IN_CACHE" +msgstr "Impossibile salvare oggetto. Spazio insufficiente nella cache" + +msgid "IDS_BR_HEADER_SELECT_ITEMS" +msgstr "Seleziona elementi" + +msgid "IDS_BR_HEADER_CERTIFICATE_INFO" +msgstr "Info certificato" + +msgid "IDS_BR_OPT_SHARE_VIA_EMAIL" +msgstr "Condividi con e-mail" + +msgid "IDS_BR_OPT_SHARE_VIA_MESSAGES" +msgstr "Condividi con Messaggi" + +msgid "IDS_BR_OPT_SHARE_VIA" +msgstr "Condividi con" + +msgid "IDS_BR_POP_UNABLE_TO_START_BROWSER" +msgstr "Impossibile avviare il browser" + +msgid "IDS_BR_POP_NO_ADDRESS" +msgstr "Nessun indirizzo" + +msgid "IDS_BR_POP_NEVER_SHOW_AGAIN" +msgstr "Non mostrare più" + +msgid "IDS_BR_POP_FILE_NAME_EMPTY" +msgstr "Nome file vuoto" + +msgid "IDS_BR_SK3_CREATE_FOLDER" +msgstr "Crea cartella" + +msgid "IDS_BR_OPT_SELECTED" +msgstr "Selezionato" + +msgid "IDS_BR_OPT_SHARE" +msgstr "Condividi" + +msgid "IDS_BR_HEADER_RECENTLY_VISITED_PAGES" +msgstr "Pagine visitate recentemente" + +msgid "IDS_BR_OPT_DISPLAY" +msgstr "Display" + +msgid "IDS_BR_BODY_FIT_TO_WIDTH" +msgstr "Adatta a larghezza" + +msgid "IDS_BR_BODY_READABLE" +msgstr "Leggibile" + +msgid "IDS_BR_BODY_PRIVACY" +msgstr "Privacy" + +msgid "IDS_BR_BODY_COOKIES" +msgstr "Cookie" + +msgid "IDS_BR_BODY_COOKIESACCEPTALL" +msgstr "Accetta tutti" + +msgid "IDS_BR_BODY_COOKIESPROMPT" +msgstr "Chiedi" + +msgid "IDS_BR_HEADER_COOKIES" +msgstr "Cookie" + +msgid "IDS_BR_BODY_ACCEPT_COOKIES" +msgstr "Accetta cookie" + +msgid "IDS_BR_OPT_ACCEPT_COOKIES" +msgstr "Accetta cookie" + +msgid "IDS_BR_BODY_ACCEPT_ALL" +msgstr "Accetta tutti" + +msgid "IDS_BR_BODY_REJECT_ALL" +msgstr "Rifiuta tutti" + +msgid "IDS_BR_BODY_AUTO_SAVE_ID_PASSWORD" +msgstr "Salva ID/password" + +msgid "IDS_BR_BODY_ON" +msgstr "Attivo" + +msgid "IDS_BR_BODY_OFF" +msgstr "Non attivo" + +msgid "IDS_BR_BODY_DEFAULT_STORAGE" +msgstr "Memoria predefinita" + +msgid "IDS_BR_BODY_SEARCH" +msgstr "Cerca" + +msgid "IDS_BR_BODY_SAVE_IMAGE" +msgstr "Salva immagine" + +msgid "IDS_BR_POP_LOW_BATTERY_UNABLE_TO_RUN_BROWSER" +msgstr "Batteria scarica. Impossibile eseguire browser" + +msgid "IDS_BR_BODY_FIND_WORD" +msgstr "Trova parola" + +msgid "IDS_BR_OPT_ADD_TO_HOME_SCREEN" +msgstr "Aggiungi a schermata iniziale" + +msgid "IDS_BR_OPT_ADD_TO_HOME_SCREEN_ABB" +msgstr "Aggiungi a schermata Home" + +msgid "IDS_BR_BODY_MOST_VISITED_SITES" +msgstr "Siti più visitati" + +msgid "IDS_BR_OPT_SHARE_VIA_FACEBOOK" +msgstr "Condividi con Facebook" + +msgid "IDS_BR_OPT_SHARE_VIA_TWITTER" +msgstr "Condividi con Twitter" + +msgid "IDS_BR_SK3_CHANGE_VIEW" +msgstr "Cambia vista" + +msgid "IDS_BR_HEADER_SELECT_URLS" +msgstr "Seleziona URL" + +msgid "IDS_BR_POP_THIS_SITE_IS_ATTEMPTING_TO_OPEN_POP_UP_WINDOW" +msgstr "Questo sito sta tentando di aprire un pop-up" + +msgid "IDS_BR_MBODY_BLOCK_POP_UP_WINDOWS" +msgstr "Blocco pop-up" + +msgid "IDS_BR_BODY_TEXT_READER" +msgstr "Lettore testo" + +msgid "IDS_BR_OPT_COPY_IMAGE" +msgstr "Copia immagine" + +msgid "IDS_BR_OPT_SAVE_IMAGE" +msgstr "Salva immagine" + +msgid "IDS_BR_BODY_PLAY" +msgstr "Riproduci" + +msgid "IDS_BR_OPT_SELECT" +msgstr "Seleziona" + +msgid "IDS_BR_OPT_NAVIGATE_GO_BACKWARD" +msgstr "Vai indietro" + +msgid "IDS_BR_OPT_NAVIGATE_GO_FORWARD" +msgstr "Vai avanti" + +msgid "IDS_BR_OPT_STOP" +msgstr "Interrompi" + +msgid "IDS_BR_OPT_RELOAD" +msgstr "Ricarica" + +msgid "IDS_BR_OPT_PASTE" +msgstr "Incolla" + +msgid "IDS_BR_BUTTON_MORE" +msgstr "Altro" + +msgid "IDS_BR_POP_FAIL" +msgstr "Errore" + +msgid "IDS_BR_BODY_OPEN_IN_NEW_WINDOW" +msgstr "Apri in nuova finestra" + +msgid "IDS_BR_OPT_VIEW_DOWNLOAD_LIST" +msgstr "Elenco download" + +msgid "IDS_BR_BODY_COPY_URL" +msgstr "Copia URL" + +msgid "IDS_BR_BODY_COPY_URL_TO" +msgstr "Copia URL in" + +msgid "IDS_BR_BODY_VIEW_IMAGE" +msgstr "Vedi immagine" + +msgid "IDS_BR_BODY_PRIVACY_SETTINGS" +msgstr "Impostazioni protezione" + +msgid "IDS_BR_BODY_CLEAR_CACHE" +msgstr "Svuota cache" + +msgid "IDS_BR_BODY_CLEAR_HISTORY" +msgstr "Cancella cronologia" + +msgid "IDS_BR_BODY_ENABLE_PLUG_INS" +msgstr "Attiva plug-in" + +msgid "IDS_BR_BODY_SELECT_SEARCH_ENGINE" +msgstr "Seleziona motore di ricerca" + +msgid "IDS_BR_BODY_DELETE_SAVED_ID_PASSWORD" +msgstr "Elimina ID/password salvati" + +msgid "IDS_BR_BODY_CLEAR_ALL_COOKIE_DATA" +msgstr "Cancella tutti i dati cookie" + +msgid "IDS_BR_BODY_UP" +msgstr "Su" + +msgid "IDS_BR_BODY_FONT_SIZE" +msgstr "Dimensioni carattere" + +msgid "IDS_BR_POP_DELETED" +msgstr "Eliminati" + +msgid "IDS_BR_BODY_DEFAULT_VIEW" +msgstr "Vista predefinita" + +msgid "IDS_BR_MBODY_PAGE_CONTENT_SETTINGS" +msgstr "Impost. contenuto pagina" + +msgid "IDS_BR_POP_CASE_SENSITIVE" +msgstr "Maiuscole/minuscole" + +msgid "IDS_BR_BODY_PLUG_IN" +msgstr "Plug-in" + +msgid "IDS_BR_OPT_PLUGINS_LIST" +msgstr "Elenco plugin" + +msgid "IDS_BR_HEADER_LOCAL_STORAGE" +msgstr "Memoria locale" + +msgid "IDS_BR_BODY_DELETE_BROWSING_DATA" +msgstr "Elimina dati navigazione" + +msgid "IDS_BR_BODY_LOADING_ING" +msgstr "Caricamento..." + +msgid "IDS_BR_HEADER_LOADING_ING" +msgstr "Caricamento..." + +msgid "IDS_BR_HEADER_ENTERURL" +msgstr "Inserisci URL" + +msgid "IDS_BR_OPT_LOCK" +msgstr "Blocca" + +msgid "IDS_BR_OPT_UNLOCK" +msgstr "Sblocca" + +msgid "IDS_BR_BODY_MODIFY" +msgstr "Modifica" + +msgid "IDS_BR_SK_PAGE_UP" +msgstr "Pagina su" + +msgid "IDS_BR_SK_PAGE_DOWN" +msgstr "Pagina giù" + +msgid "IDS_BR_BODY_DEVELOPER_MODE" +msgstr "Modalità sviluppatore" + +msgid "IDS_BR_BODY_EMPTY" +msgstr "Vuoto" + +msgid "IDS_BR_BODY_CERTIFICATES" +msgstr "Certificati" + +msgid "IDS_BR_BODY_BOOKMARKS" +msgstr "Preferiti" + +msgid "IDS_BR_BODY_ENTER_NAME" +msgstr "Inserisci nome" + +msgid "IDS_BR_BODY_NAME" +msgstr "Nome" + +msgid "IDS_BR_OPT_SEND_VIA_EMAIL" +msgstr "Invia tramite e-mail" + +msgid "IDS_BR_OPT_SEND_VIA_MESSAGE" +msgstr "Invia con messaggio" + +msgid "IDS_BR_BODY_SETTINGS" +msgstr "Impostazioni" + +msgid "IDS_BR_BODY_AUTHUSERNAME" +msgstr "Nome utente" + +msgid "IDS_BR_POP_ALREADY_EXISTS" +msgstr "Già esiste" + +msgid "IDS_BR_POP_SAVED" +msgstr "Salvato" + +msgid "IDS_BR_POP_NOT_ENOUGH_MEMORY" +msgstr "Memoria insufficiente" + +msgid "IDS_BR_POP_NETWORK_ERROR" +msgstr "Errore di rete" + +msgid "IDS_BR_BODY_ALWAYS_ASK" +msgstr "Chiedi sempre" + +msgid "IDS_BR_BODY_MEMORY_CARD" +msgstr "Scheda di memoria" + +msgid "IDS_BR_BODY_PHONE" +msgstr "Telefono" + +msgid "IDS_BR_BODY_NO_ACCOUNTS_ABB" +msgstr "Nessun account" + +msgid "IDS_BR_HEADER_ERROR_PAGE" +msgstr "Pagina di errore" + +msgid "IDS_BR_BODY_WEB_PAGE_TEMPORARILY_NOT_AVAILABLE" +msgstr "Pagina Web temporaneamente non disponibile" + +msgid "IDS_BR_BODY_WEB_PAGE_NOT_AVAILABLE" +msgstr "Pagina Web non disponibile" + +msgid "IDS_BR_BODY_FAILED_TO_LOAD_FRAMES" +msgstr "Impossibile caricare riquadri" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_1" +msgstr "Si è verificato il seguente errore durante il recupero della pagina Web %s." + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_2" +msgstr "Impossibile recuperare pagina Web. (Pagina temporaneamente non disponibile o spostata a un nuovo URL)" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_3" +msgstr "La causa più probabile è illustrata di seguito" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_4" +msgstr "Connessione di rete non stabilita regolarmente" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_5" +msgstr "Verificate URL pagina Web" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_6" +msgstr "Ricaricate pagina Web più tardi" + +msgid "IDS_BR_OPT_BOOKMARK" +msgstr "Preferito" + +msgid "IDS_BR_BODY_TITLE" +msgstr "Titolo" + +msgid "IDS_BR_BODY_ENTER_TITLE" +msgstr "Inserisci titolo" + +msgid "IDS_BR_OPT_FOLDERS" +msgstr "Cartelle" + +msgid "IDS_BR_OPT_ALLOW" +msgstr "Consenti" + +msgid "IDS_BR_POP_REFUSE" +msgstr "Rifiuta" + +msgid "IDS_BR_POP_SECURITY_ERROR_C_UNTRUSTED_SERVER_CERTIFICATE" +msgstr "Errore di protezione: certificato server non attendibile" + +msgid "IDS_BR_POP_PD_ITEMS_SELECTED" +msgstr "%d elementi selezionati" + +msgid "IDS_BR_POP_1_ITEM_SELECTED" +msgstr "1 elemento selezionato" + diff --git a/po/ja_JP.po b/po/ja_JP.po new file mode 100755 index 00000000..faf420d2 --- /dev/null +++ b/po/ja_JP.po @@ -0,0 +1,621 @@ +msgid "IDS_BR_POP_INSTALLATION_FAILED" +msgstr "インストールが失敗しました。" + +msgid "IDS_BR_BODY_NOTIFYING_ING" +msgstr "通知中..." + +msgid "IDS_BR_BODY_PROCESSING_ING" +msgstr "処理中..." + +msgid "IDS_BR_BODY_PROCESSING_COMPLETED" +msgstr "処理が完了しました" + +msgid "IDS_BR_SK_RETRY" +msgstr "再接続" + +msgid "IDS_BR_HEADER_DOWNLOAD_MANAGER" +msgstr "ダウンロードマネージャー" + +msgid "IDS_BR_POP_INVALIDDESCRIPTOR" +msgstr "識別子が無効です。" + +msgid "IDS_BR_POP_UNABLE_TO_OPEN_FILE" +msgstr "ファイルを開くことができません" + +msgid "IDS_BR_POP_DOWNLOAD_Q" +msgstr "ダウンロードしますか?" + +msgid "IDS_BR_OPT_DELETE_SELECTED" +msgstr "選択" + +msgid "IDS_BR_POP_DOWNLOAD_CANCELLED" +msgstr "ダウンロードを中止しました。" + +msgid "IDS_BR_BODY_CONTINUE_FROM_LAST_PAGE" +msgstr "最終ページから続ける" + +msgid "IDS_BR_BODY_PAGE" +msgstr "ページ" + +msgid "IDS_BR_OPT_DICTIONARY" +msgstr "辞書" + +msgid "IDS_BR_BODY_ABOUT_BROWSER" +msgstr "ブラウザについて" + +msgid "IDS_BR_BODY_BROWSER_TYPE" +msgstr "ファイルタイプ" + +msgid "IDS_BR_BODY_CERTIFICATE_ISSUER" +msgstr "発行者" + +msgid "IDS_BR_BODY_DISPLAY_IMAGES" +msgstr "画像表示" + +msgid "IDS_BR_BODY_DOWNLOAD" +msgstr "ダウンロード" + +msgid "IDS_BR_BODY_ENTER_URL" +msgstr "URL入力" + +msgid "IDS_BR_BODY_FOLDER" +msgstr "フォルダ" + +msgid "IDS_BR_BODY_HOMEPAGE" +msgstr "ホームページ" + +msgid "IDS_BR_BODY_LANDSCAPE_VIEW" +msgstr "風景" + +msgid "IDS_BR_BODY_NO_BOOKMARKS" +msgstr "ブックマークがありません。" + +msgid "IDS_BR_BODY_NO_RESULTS_FOUND" +msgstr "検索結果がありません。" + +msgid "IDS_BR_BODY_OPTIONAL" +msgstr "オプション" + +msgid "IDS_BR_BODY_RSS" +msgstr "RSS" + +msgid "IDS_BR_BODY_RUN_FLASH" +msgstr "Flashを実行" + +msgid "IDS_BR_BODY_RUN_JAVASCRIPT" +msgstr "JavaScriptを実行" + +msgid "IDS_BR_HEADER_COMMON_NAME_C" +msgstr "共通名:" + +msgid "IDS_BR_HEADER_ORGANIZATIONAL_UNIT_C" +msgstr "部門名:" + +msgid "IDS_BR_HEADER_ORGANIZATION_C" +msgstr "組織:" + +msgid "IDS_BR_HEADER_USER_AGENT" +msgstr "エージェントを利用します" + +msgid "IDS_BR_OPT_LAST_VIEWED_PAGE_ATNT" +msgstr "Last Viewed Page" + +msgid "IDS_BR_OPT_PREFERENCES" +msgstr "プレファレンス" + +msgid "IDS_BR_POP_ACTICATION_ERR" +msgstr "起動エラー" + +msgid "IDS_BR_POP_ALREADY_RUNNING" +msgstr "既に実行中..." + +msgid "IDS_BR_POP_ERRORIMPLEMENTED" +msgstr "実行されていません" + +msgid "IDS_BR_POP_HTTPERRAUTHFAILED" +msgstr "認証に失敗しました。" + +msgid "IDS_BR_POP_OVERWRITE_Q" +msgstr "上書きしますか?" + +msgid "IDS_BR_POP_URL" +msgstr "URL" + +msgid "IDS_BR_TAB_HISTORY" +msgstr "履歴" + +msgid "IDS_BR_HEADER_DOWNLOAD_LIST" +msgstr "ダウンロードリスト" + +msgid "IDS_BR_POP_ALREADYINSTALLED" +msgstr "既にインストールされています" + +msgid "IDS_BR_POP_NOTIFYING" +msgstr "通知中..." + +msgid "IDS_BR_POP_NOTSUPPORT" +msgstr "未対応のコンテンツです。" + +msgid "IDS_BR_POP_ERROR_C_UNABLE_TO_RESOLVE_HOST_NAME" +msgstr "エラー:ホスト名を解決できません" + +msgid "IDS_BR_POP_UNABLE_TO_REACH_PROXY" +msgstr "プロキシに達しませんでした" + +msgid "IDS_BR_POP_NOSSLCERTI" +msgstr "SSL証明書がありません" + +msgid "IDS_BR_BODY_FILE_SIZE_EXCEEDS_MAXIMUM_UPLOAD_LIMIT" +msgstr "ファイルサイズがアップロードの最大容量を超えています" + +msgid "IDS_BR_BODY_ENTER_NAME_C" +msgstr "名前を入力:" + +msgid "IDS_BR_SK_NEXT" +msgstr "次へ" + +msgid "IDS_BR_OPT_NEW_FOLDER" +msgstr "新規フォルダ" + +msgid "IDS_BR_SK3_ADD_TO_BOOKMARKS" +msgstr "ブックマークに追加" + +msgid "IDS_BR_SK1_NEW_WINDOW" +msgstr "新規ウィンドウ" + +msgid "IDS_BR_BODY_URL" +msgstr "URL" + +msgid "IDS_BR_BODY_URL_C" +msgstr "URL:" + +msgid "IDS_BR_BODY_URL_NOT_AVAILABLE" +msgstr "URLはご利用になれません" + +msgid "IDS_BR_BODY_URL_PS_NOT_AVAILABLE_IT_MIGHT_BE_DOWN_TEMPORARILY_OR_NO_LONGER_IN_USE" +msgstr "URL%sはご利用になれません。一時的に停止するか、使用されていない可能性があります" + +msgid "IDS_BR_HEADER_FOLDER" +msgstr "フォルダ" + +msgid "IDS_BR_BODY_FOLDER_NAME" +msgstr "フォルダ名" + +msgid "IDS_BR_BODY_FOLDER_NAME_ALREADY_IN_USE" +msgstr "フォルダ名は既に使用されています。" + +msgid "IDS_BR_BODY_NO_TITLE" +msgstr "件名なし" + +msgid "IDS_BR_HEADER_MULTI_WINDOW" +msgstr "複数のウィンドウ" + +msgid "IDS_BR_BODY_NO_HISTORIES" +msgstr "履歴がありません" + +msgid "IDS_BR_BODY_ADD_TO_BOOKMARKS" +msgstr "ブックマークに追加" + +msgid "IDS_BR_BODY_EDIT_BOOKMARK" +msgstr "ブックマークを編集" + +msgid "IDS_BR_BODY_FOLDER_NAME_C" +msgstr "フォルダ名:" + +msgid "IDS_BR_OPT_SELECT_ALL" +msgstr "全て選択" + +msgid "IDS_BR_OPT_DOWNLOAD_MANAGER" +msgstr "ダウンロードマネージャー" + +msgid "IDS_BR_OPT_ADD_RSS_FEED" +msgstr "RSSフィードを追加" + +msgid "IDS_BR_OPT_ADD_RSS_FEEDS" +msgstr "RSSフィードを追加" + +msgid "IDS_BR_OPT_SETTINGS" +msgstr "設定" + +msgid "IDS_BR_POP_ENTER_URL" +msgstr "URL入力" + +msgid "IDS_BR_BODY_AUTHPASSWORD" +msgstr "パスワード" + +msgid "IDS_BR_POP_INVALIDADDRESS" +msgstr "アドレスが正しくありません。" + +msgid "IDS_BR_POP_ALREADY_EXISTS_IN_DOWNLOAD_LIST" +msgstr "ダウンロードリストに既にあります" + +msgid "IDS_BR_POP_ENTER_FOLDER_NAME" +msgstr "フォルダ名を入力してください。" + +msgid "IDS_BR_POP_NO_PAGE" +msgstr "ページがありません" + +msgid "IDS_BR_POP_NO_PAGES_BACKWARD" +msgstr "戻るページがありません" + +msgid "IDS_BR_POP_NO_PAGES_FORWARD" +msgstr "進むページがありません" + +msgid "IDS_BR_POP_NO_PAGE_TO_RELOAD" +msgstr "再読込するページがありません" + +msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED" +msgstr "認証が必要です" + +msgid "IDS_BR_POP_BOOKMARK_ALREADY_EXISTS" +msgstr "ブックマークは既に存在します。" + +msgid "IDS_BR_POP_FOLDER_NAME_ALREADY_EXISTS" +msgstr "このフォルダ名は既に使用されています。" + +msgid "IDS_BR_POP_UNABLE_TO_SAVE_OBJECT_NOT_ENOUGH_SPACE_IN_CACHE" +msgstr "保存できません。キャッシュに十分な空き容量がありません" + +msgid "IDS_BR_HEADER_SELECT_ITEMS" +msgstr "アイテムを選択" + +msgid "IDS_BR_HEADER_CERTIFICATE_INFO" +msgstr "認証情報" + +msgid "IDS_BR_OPT_SHARE_VIA_EMAIL" +msgstr "Eメールで共有" + +msgid "IDS_BR_OPT_SHARE_VIA_MESSAGES" +msgstr "メッセージで共有" + +msgid "IDS_BR_OPT_SHARE_VIA" +msgstr "共有" + +msgid "IDS_BR_POP_UNABLE_TO_START_BROWSER" +msgstr "ブラウザを開始できません" + +msgid "IDS_BR_POP_NO_ADDRESS" +msgstr "アドレスはありません" + +msgid "IDS_BR_POP_NEVER_SHOW_AGAIN" +msgstr "今後表示しない" + +msgid "IDS_BR_POP_FILE_NAME_EMPTY" +msgstr "ファイル名が空白です。" + +msgid "IDS_BR_SK3_CREATE_FOLDER" +msgstr "フォルダ作成" + +msgid "IDS_BR_OPT_SELECTED" +msgstr "選択" + +msgid "IDS_BR_OPT_SHARE" +msgstr "共有" + +msgid "IDS_BR_HEADER_RECENTLY_VISITED_PAGES" +msgstr "最近見たページ" + +msgid "IDS_BR_OPT_DISPLAY" +msgstr "画面" + +msgid "IDS_BR_BODY_FIT_TO_WIDTH" +msgstr "幅に合わせる" + +msgid "IDS_BR_BODY_READABLE" +msgstr "判読可能" + +msgid "IDS_BR_BODY_PRIVACY" +msgstr "プライバシー" + +msgid "IDS_BR_BODY_COOKIES" +msgstr "Cookie設定" + +msgid "IDS_BR_BODY_COOKIESACCEPTALL" +msgstr "全て応答" + +msgid "IDS_BR_BODY_COOKIESPROMPT" +msgstr "プロンプト" + +msgid "IDS_BR_HEADER_COOKIES" +msgstr "Cookie設定" + +msgid "IDS_BR_BODY_ACCEPT_COOKIES" +msgstr "Cookieを許可" + +msgid "IDS_BR_OPT_ACCEPT_COOKIES" +msgstr "Cookieを許可" + +msgid "IDS_BR_BODY_ACCEPT_ALL" +msgstr "全て応答" + +msgid "IDS_BR_BODY_REJECT_ALL" +msgstr "全て拒否" + +msgid "IDS_BR_BODY_AUTO_SAVE_ID_PASSWORD" +msgstr "ID/パスワードの自動保存" + +msgid "IDS_BR_BODY_ON" +msgstr "ON" + +msgid "IDS_BR_BODY_OFF" +msgstr "OFF" + +msgid "IDS_BR_BODY_DEFAULT_STORAGE" +msgstr "保存先" + +msgid "IDS_BR_BODY_SEARCH" +msgstr "検索" + +msgid "IDS_BR_BODY_SAVE_IMAGE" +msgstr "画像を保存" + +msgid "IDS_BR_POP_LOW_BATTERY_UNABLE_TO_RUN_BROWSER" +msgstr "電池残量がありません。ブラウザを実行できません" + +msgid "IDS_BR_BODY_FIND_WORD" +msgstr "用語を検索" + +msgid "IDS_BR_OPT_ADD_TO_HOME_SCREEN" +msgstr "ホーム画面に追加" + +msgid "IDS_BR_OPT_ADD_TO_HOME_SCREEN_ABB" +msgstr "ホーム画面に追加" + +msgid "IDS_BR_BODY_MOST_VISITED_SITES" +msgstr "よく見るサイト" + +msgid "IDS_BR_OPT_SHARE_VIA_FACEBOOK" +msgstr "Facebookで共有" + +msgid "IDS_BR_OPT_SHARE_VIA_TWITTER" +msgstr "Twitterで共有" + +msgid "IDS_BR_SK3_CHANGE_VIEW" +msgstr "表示切替" + +msgid "IDS_BR_HEADER_SELECT_URLS" +msgstr "URL選択" + +msgid "IDS_BR_POP_THIS_SITE_IS_ATTEMPTING_TO_OPEN_POP_UP_WINDOW" +msgstr "このサイトはポップアップウィンドウを開こうとしています" + +msgid "IDS_BR_MBODY_BLOCK_POP_UP_WINDOWS" +msgstr "ポップアップウィンドウをブロック" + +msgid "IDS_BR_BODY_TEXT_READER" +msgstr "文字リーダー" + +msgid "IDS_BR_OPT_COPY_IMAGE" +msgstr "画像をコピー" + +msgid "IDS_BR_OPT_SAVE_IMAGE" +msgstr "画像を保存" + +msgid "IDS_BR_BODY_PLAY" +msgstr "再生" + +msgid "IDS_BR_OPT_SELECT" +msgstr "選択" + +msgid "IDS_BR_OPT_NAVIGATE_GO_BACKWARD" +msgstr "前のページへ" + +msgid "IDS_BR_OPT_NAVIGATE_GO_FORWARD" +msgstr "次のページへ" + +msgid "IDS_BR_OPT_STOP" +msgstr "停止" + +msgid "IDS_BR_OPT_RELOAD" +msgstr "再読み込み" + +msgid "IDS_BR_OPT_PASTE" +msgstr "貼り付け" + +msgid "IDS_BR_BUTTON_MORE" +msgstr "もっと見る" + +msgid "IDS_BR_POP_FAIL" +msgstr "失敗しました。" + +msgid "IDS_BR_BODY_OPEN_IN_NEW_WINDOW" +msgstr "新規ウィンドウで開く" + +msgid "IDS_BR_OPT_VIEW_DOWNLOAD_LIST" +msgstr "リスト表示ダウンロード" + +msgid "IDS_BR_BODY_COPY_URL" +msgstr "URLコピー" + +msgid "IDS_BR_BODY_COPY_URL_TO" +msgstr "URLをコピー" + +msgid "IDS_BR_BODY_VIEW_IMAGE" +msgstr "画像を表示" + +msgid "IDS_BR_BODY_PRIVACY_SETTINGS" +msgstr "プライバシー設定" + +msgid "IDS_BR_BODY_CLEAR_CACHE" +msgstr "キャッシュを消去" + +msgid "IDS_BR_BODY_CLEAR_HISTORY" +msgstr "履歴を消去" + +msgid "IDS_BR_BODY_ENABLE_PLUG_INS" +msgstr "プラグインを有効にする" + +msgid "IDS_BR_BODY_SELECT_SEARCH_ENGINE" +msgstr "検索エンジンを選択" + +msgid "IDS_BR_BODY_DELETE_SAVED_ID_PASSWORD" +msgstr "保存したID/パスワードを削除する" + +msgid "IDS_BR_BODY_CLEAR_ALL_COOKIE_DATA" +msgstr "Cookieを消去" + +msgid "IDS_BR_BODY_UP" +msgstr "上" + +msgid "IDS_BR_BODY_FONT_SIZE" +msgstr "文字サイズ" + +msgid "IDS_BR_POP_DELETED" +msgstr "削除しました。" + +msgid "IDS_BR_BODY_DEFAULT_VIEW" +msgstr "基本表示モード" + +msgid "IDS_BR_MBODY_PAGE_CONTENT_SETTINGS" +msgstr "ページコンテンツ設定" + +msgid "IDS_BR_POP_CASE_SENSITIVE" +msgstr "大文字と小文字を区別します" + +msgid "IDS_BR_BODY_PLUG_IN" +msgstr "プラグイン" + +msgid "IDS_BR_OPT_PLUGINS_LIST" +msgstr "プラグインのリスト" + +msgid "IDS_BR_HEADER_LOCAL_STORAGE" +msgstr "ローカルストレージ" + +msgid "IDS_BR_BODY_DELETE_BROWSING_DATA" +msgstr "参照データを削除" + +msgid "IDS_BR_BODY_LOADING_ING" +msgstr "読み込み中..." + +msgid "IDS_BR_HEADER_LOADING_ING" +msgstr "読み込み中..." + +msgid "IDS_BR_HEADER_ENTERURL" +msgstr "URL入力" + +msgid "IDS_BR_OPT_LOCK" +msgstr "保護" + +msgid "IDS_BR_OPT_UNLOCK" +msgstr "ロック解除" + +msgid "IDS_BR_BODY_MODIFY" +msgstr "変更" + +msgid "IDS_BR_SK_PAGE_UP" +msgstr "ページアップ" + +msgid "IDS_BR_SK_PAGE_DOWN" +msgstr "ページダウン" + +msgid "IDS_BR_BODY_DEVELOPER_MODE" +msgstr "開発者モード" + +msgid "IDS_BR_BODY_EMPTY" +msgstr "空き" + +msgid "IDS_BR_BODY_CERTIFICATES" +msgstr "証明書" + +msgid "IDS_BR_BODY_BOOKMARKS" +msgstr "ブックマーク" + +msgid "IDS_BR_BODY_ENTER_NAME" +msgstr "名前を入力してください。" + +msgid "IDS_BR_BODY_NAME" +msgstr "名前" + +msgid "IDS_BR_OPT_SEND_VIA_EMAIL" +msgstr "Eメール送信" + +msgid "IDS_BR_OPT_SEND_VIA_MESSAGE" +msgstr "メッセージ送信" + +msgid "IDS_BR_BODY_SETTINGS" +msgstr "設定" + +msgid "IDS_BR_BODY_AUTHUSERNAME" +msgstr "ユーザー名" + +msgid "IDS_BR_POP_ALREADY_EXISTS" +msgstr "既に登録されています。" + +msgid "IDS_BR_POP_SAVED" +msgstr "保存しました。" + +msgid "IDS_BR_POP_NOT_ENOUGH_MEMORY" +msgstr "メモリが不足しています。" + +msgid "IDS_BR_POP_NETWORK_ERROR" +msgstr "ネットワークエラーが発生しました。" + +msgid "IDS_BR_BODY_ALWAYS_ASK" +msgstr "毎回確認" + +msgid "IDS_BR_BODY_MEMORY_CARD" +msgstr "外部SDカード" + +msgid "IDS_BR_BODY_PHONE" +msgstr "本体" + +msgid "IDS_BR_BODY_NO_ACCOUNTS_ABB" +msgstr "アカウントがありません" + +msgid "IDS_BR_HEADER_ERROR_PAGE" +msgstr "エラーページ" + +msgid "IDS_BR_BODY_WEB_PAGE_TEMPORARILY_NOT_AVAILABLE" +msgstr "Webページが一時的に利用できません。" + +msgid "IDS_BR_BODY_WEB_PAGE_NOT_AVAILABLE" +msgstr "Webページを利用できません。" + +msgid "IDS_BR_BODY_FAILED_TO_LOAD_FRAMES" +msgstr "フレームの読み込み失敗" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_1" +msgstr "Webページ%sの取得中に以下のエラーが発生しました。" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_2" +msgstr "Webページを取得できません。(Webページが一時的にダウンしているか、新しいURLに移動しました)" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_3" +msgstr "最も考えられる原因は以下のとおりです。" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_4" +msgstr "ネットワーク接続を正常に確立できませんでした。" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_5" +msgstr "WebページのURLを確認してください。" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_6" +msgstr "Webページを後で再読み込みしてください。" + +msgid "IDS_BR_OPT_BOOKMARK" +msgstr "ブックマーク" + +msgid "IDS_BR_BODY_TITLE" +msgstr "タイトル" + +msgid "IDS_BR_BODY_ENTER_TITLE" +msgstr "タイトルを入力して下さい。" + +msgid "IDS_BR_OPT_FOLDERS" +msgstr "フォルダ" + +msgid "IDS_BR_OPT_ALLOW" +msgstr "許可" + +msgid "IDS_BR_POP_REFUSE" +msgstr "拒否" + +msgid "IDS_BR_POP_SECURITY_ERROR_C_UNTRUSTED_SERVER_CERTIFICATE" +msgstr "セキュリティエラー:信頼できないサーバー証明です。" + +msgid "IDS_BR_POP_PD_ITEMS_SELECTED" +msgstr "%d個のアイテムを選択" + +msgid "IDS_BR_POP_1_ITEM_SELECTED" +msgstr "1件のアイテムを選択" + diff --git a/po/ko_KR.po b/po/ko_KR.po new file mode 100755 index 00000000..8fc62608 --- /dev/null +++ b/po/ko_KR.po @@ -0,0 +1,621 @@ +msgid "IDS_BR_POP_INSTALLATION_FAILED" +msgstr "설치하지 못하였습니다" + +msgid "IDS_BR_BODY_NOTIFYING_ING" +msgstr "알림 준비 중..." + +msgid "IDS_BR_BODY_PROCESSING_ING" +msgstr "처리 중..." + +msgid "IDS_BR_BODY_PROCESSING_COMPLETED" +msgstr "완료되었습니다" + +msgid "IDS_BR_SK_RETRY" +msgstr "재시도" + +msgid "IDS_BR_HEADER_DOWNLOAD_MANAGER" +msgstr "다운로드 관리자" + +msgid "IDS_BR_POP_INVALIDDESCRIPTOR" +msgstr "설명이 바르지 않습니다" + +msgid "IDS_BR_POP_UNABLE_TO_OPEN_FILE" +msgstr "파일을 열 수 없습니다" + +msgid "IDS_BR_POP_DOWNLOAD_Q" +msgstr "다운로드할까요?" + +msgid "IDS_BR_OPT_DELETE_SELECTED" +msgstr "이 항목만" + +msgid "IDS_BR_POP_DOWNLOAD_CANCELLED" +msgstr "다운로드가 취소되었습니다" + +msgid "IDS_BR_BODY_CONTINUE_FROM_LAST_PAGE" +msgstr "마지막 페이지 계속 보기" + +msgid "IDS_BR_BODY_PAGE" +msgstr "페이지" + +msgid "IDS_BR_OPT_DICTIONARY" +msgstr "사전" + +msgid "IDS_BR_BODY_ABOUT_BROWSER" +msgstr "상세정보" + +msgid "IDS_BR_BODY_BROWSER_TYPE" +msgstr "종류" + +msgid "IDS_BR_BODY_CERTIFICATE_ISSUER" +msgstr "발행자" + +msgid "IDS_BR_BODY_DISPLAY_IMAGES" +msgstr "이미지 보기" + +msgid "IDS_BR_BODY_DOWNLOAD" +msgstr "다운로드" + +msgid "IDS_BR_BODY_ENTER_URL" +msgstr "URL을 입력하세요" + +msgid "IDS_BR_BODY_FOLDER" +msgstr "폴더" + +msgid "IDS_BR_BODY_HOMEPAGE" +msgstr "홈페이지" + +msgid "IDS_BR_BODY_LANDSCAPE_VIEW" +msgstr "가로 보기" + +msgid "IDS_BR_BODY_NO_BOOKMARKS" +msgstr "북마크가 없습니다" + +msgid "IDS_BR_BODY_NO_RESULTS_FOUND" +msgstr "검색 결과가 없습니다" + +msgid "IDS_BR_BODY_OPTIONAL" +msgstr "선택 사항입니다" + +msgid "IDS_BR_BODY_RSS" +msgstr "RSS" + +msgid "IDS_BR_BODY_RUN_FLASH" +msgstr "플래시 재생" + +msgid "IDS_BR_BODY_RUN_JAVASCRIPT" +msgstr "자바 스크립트 실행" + +msgid "IDS_BR_HEADER_COMMON_NAME_C" +msgstr "일반 이름:" + +msgid "IDS_BR_HEADER_ORGANIZATIONAL_UNIT_C" +msgstr "기관명:" + +msgid "IDS_BR_HEADER_ORGANIZATION_C" +msgstr "기관:" + +msgid "IDS_BR_HEADER_USER_AGENT" +msgstr "사용자 에이전트" + +msgid "IDS_BR_OPT_LAST_VIEWED_PAGE_ATNT" +msgstr "Last Viewed Page" + +msgid "IDS_BR_OPT_PREFERENCES" +msgstr "속성" + +msgid "IDS_BR_POP_ACTICATION_ERR" +msgstr "실행 오류가 발생하였습니다" + +msgid "IDS_BR_POP_ALREADY_RUNNING" +msgstr "실행 중..." + +msgid "IDS_BR_POP_ERRORIMPLEMENTED" +msgstr "서버에서 지원하지 않습니다" + +msgid "IDS_BR_POP_HTTPERRAUTHFAILED" +msgstr "인증에 실패하였습니다" + +msgid "IDS_BR_POP_OVERWRITE_Q" +msgstr "덮어쓸까요?" + +msgid "IDS_BR_POP_URL" +msgstr "URL" + +msgid "IDS_BR_TAB_HISTORY" +msgstr "기록" + +msgid "IDS_BR_HEADER_DOWNLOAD_LIST" +msgstr "다운로드 목록" + +msgid "IDS_BR_POP_ALREADYINSTALLED" +msgstr "설치되어 있습니다" + +msgid "IDS_BR_POP_NOTIFYING" +msgstr "알림 준비 중..." + +msgid "IDS_BR_POP_NOTSUPPORT" +msgstr "사용할 수 없는 컨텐츠입니다" + +msgid "IDS_BR_POP_ERROR_C_UNABLE_TO_RESOLVE_HOST_NAME" +msgstr "오류: 호스트 이름을 변환할 수 없습니다" + +msgid "IDS_BR_POP_UNABLE_TO_REACH_PROXY" +msgstr "프록시에 연결할 수 없습니다" + +msgid "IDS_BR_POP_NOSSLCERTI" +msgstr "SSL 인증서가 없습니다" + +msgid "IDS_BR_BODY_FILE_SIZE_EXCEEDS_MAXIMUM_UPLOAD_LIMIT" +msgstr "파일 크기가 최대 업로드 제한을 초과하였습니다" + +msgid "IDS_BR_BODY_ENTER_NAME_C" +msgstr "이름 입력:" + +msgid "IDS_BR_SK_NEXT" +msgstr "다음" + +msgid "IDS_BR_OPT_NEW_FOLDER" +msgstr "새 폴더" + +msgid "IDS_BR_SK3_ADD_TO_BOOKMARKS" +msgstr "북마크에 추가" + +msgid "IDS_BR_SK1_NEW_WINDOW" +msgstr "새 창" + +msgid "IDS_BR_BODY_URL" +msgstr "URL" + +msgid "IDS_BR_BODY_URL_C" +msgstr "URL:" + +msgid "IDS_BR_BODY_URL_NOT_AVAILABLE" +msgstr "사용할 수 없는 URL입니다" + +msgid "IDS_BR_BODY_URL_PS_NOT_AVAILABLE_IT_MIGHT_BE_DOWN_TEMPORARILY_OR_NO_LONGER_IN_USE" +msgstr "사용할 수 없는 URL입니다. 일시적으로 다운되었거나 더 이상 사용되지 않습니다" + +msgid "IDS_BR_HEADER_FOLDER" +msgstr "폴더" + +msgid "IDS_BR_BODY_FOLDER_NAME" +msgstr "폴더 이름" + +msgid "IDS_BR_BODY_FOLDER_NAME_ALREADY_IN_USE" +msgstr "사용 중인 이름입니다" + +msgid "IDS_BR_BODY_NO_TITLE" +msgstr "제목이 없습니다" + +msgid "IDS_BR_HEADER_MULTI_WINDOW" +msgstr "실행 창 보기" + +msgid "IDS_BR_BODY_NO_HISTORIES" +msgstr "기록이 없습니다" + +msgid "IDS_BR_BODY_ADD_TO_BOOKMARKS" +msgstr "북마크에 추가" + +msgid "IDS_BR_BODY_EDIT_BOOKMARK" +msgstr "북마크 편집" + +msgid "IDS_BR_BODY_FOLDER_NAME_C" +msgstr "폴더 이름:" + +msgid "IDS_BR_OPT_SELECT_ALL" +msgstr "모두 선택" + +msgid "IDS_BR_OPT_DOWNLOAD_MANAGER" +msgstr "다운로드 관리자" + +msgid "IDS_BR_OPT_ADD_RSS_FEED" +msgstr "RSS 피드 추가" + +msgid "IDS_BR_OPT_ADD_RSS_FEEDS" +msgstr "RSS 피드 추가" + +msgid "IDS_BR_OPT_SETTINGS" +msgstr "설정" + +msgid "IDS_BR_POP_ENTER_URL" +msgstr "URL을 입력하세요" + +msgid "IDS_BR_BODY_AUTHPASSWORD" +msgstr "비밀번호" + +msgid "IDS_BR_POP_INVALIDADDRESS" +msgstr "주소가 바르지 않습니다" + +msgid "IDS_BR_POP_ALREADY_EXISTS_IN_DOWNLOAD_LIST" +msgstr "다운로드 목록에 포함되어 있습니다" + +msgid "IDS_BR_POP_ENTER_FOLDER_NAME" +msgstr "폴더 이름을 입력하세요" + +msgid "IDS_BR_POP_NO_PAGE" +msgstr "페이지가 없습니다" + +msgid "IDS_BR_POP_NO_PAGES_BACKWARD" +msgstr "이전 페이지가 없습니다" + +msgid "IDS_BR_POP_NO_PAGES_FORWARD" +msgstr "다음 페이지가 없습니다" + +msgid "IDS_BR_POP_NO_PAGE_TO_RELOAD" +msgstr "표시할 페이지가 없습니다" + +msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED" +msgstr "인증이 필요합니다" + +msgid "IDS_BR_POP_BOOKMARK_ALREADY_EXISTS" +msgstr "이미 있는 북마크입니다" + +msgid "IDS_BR_POP_FOLDER_NAME_ALREADY_EXISTS" +msgstr "사용 중인 폴더 이름입니다" + +msgid "IDS_BR_POP_UNABLE_TO_SAVE_OBJECT_NOT_ENOUGH_SPACE_IN_CACHE" +msgstr "파일을 저장할 수 없습니다. 캐시에 저장 공간이 부족합니다" + +msgid "IDS_BR_HEADER_SELECT_ITEMS" +msgstr "항목 선택" + +msgid "IDS_BR_HEADER_CERTIFICATE_INFO" +msgstr "인증서 정보" + +msgid "IDS_BR_OPT_SHARE_VIA_EMAIL" +msgstr "이메일을 통해 공유" + +msgid "IDS_BR_OPT_SHARE_VIA_MESSAGES" +msgstr "메시지로 공유합니다" + +msgid "IDS_BR_OPT_SHARE_VIA" +msgstr "공유" + +msgid "IDS_BR_POP_UNABLE_TO_START_BROWSER" +msgstr "인터넷을 시작할 수 없습니다" + +msgid "IDS_BR_POP_NO_ADDRESS" +msgstr "저장된 주소가 없습니다" + +msgid "IDS_BR_POP_NEVER_SHOW_AGAIN" +msgstr "다시 표시하지 않기" + +msgid "IDS_BR_POP_FILE_NAME_EMPTY" +msgstr "파일 이름이 없습니다" + +msgid "IDS_BR_SK3_CREATE_FOLDER" +msgstr "폴더 추가" + +msgid "IDS_BR_OPT_SELECTED" +msgstr "이 항목만" + +msgid "IDS_BR_OPT_SHARE" +msgstr "공유" + +msgid "IDS_BR_HEADER_RECENTLY_VISITED_PAGES" +msgstr "최근 방문한 웹사이트" + +msgid "IDS_BR_OPT_DISPLAY" +msgstr "화면" + +msgid "IDS_BR_BODY_FIT_TO_WIDTH" +msgstr "너비에 맞추기" + +msgid "IDS_BR_BODY_READABLE" +msgstr "읽을 수 있는 크기" + +msgid "IDS_BR_BODY_PRIVACY" +msgstr "개인정보 보호" + +msgid "IDS_BR_BODY_COOKIES" +msgstr "쿠키" + +msgid "IDS_BR_BODY_COOKIESACCEPTALL" +msgstr "모두 허용" + +msgid "IDS_BR_BODY_COOKIESPROMPT" +msgstr "묻기" + +msgid "IDS_BR_HEADER_COOKIES" +msgstr "쿠키" + +msgid "IDS_BR_BODY_ACCEPT_COOKIES" +msgstr "쿠키 허용" + +msgid "IDS_BR_OPT_ACCEPT_COOKIES" +msgstr "쿠키 허용" + +msgid "IDS_BR_BODY_ACCEPT_ALL" +msgstr "모두 허용" + +msgid "IDS_BR_BODY_REJECT_ALL" +msgstr "모두 거부" + +msgid "IDS_BR_BODY_AUTO_SAVE_ID_PASSWORD" +msgstr "ID/비밀번호 자동 저장" + +msgid "IDS_BR_BODY_ON" +msgstr "켜기" + +msgid "IDS_BR_BODY_OFF" +msgstr "끄기" + +msgid "IDS_BR_BODY_DEFAULT_STORAGE" +msgstr "기본 저장 위치" + +msgid "IDS_BR_BODY_SEARCH" +msgstr "검색" + +msgid "IDS_BR_BODY_SAVE_IMAGE" +msgstr "이미지 저장" + +msgid "IDS_BR_POP_LOW_BATTERY_UNABLE_TO_RUN_BROWSER" +msgstr "배터리가 부족하여 인터넷을 실행할 수 없습니다" + +msgid "IDS_BR_BODY_FIND_WORD" +msgstr "단어 검색" + +msgid "IDS_BR_OPT_ADD_TO_HOME_SCREEN" +msgstr "홈 화면에 추가" + +msgid "IDS_BR_OPT_ADD_TO_HOME_SCREEN_ABB" +msgstr "홈 화면에 추가" + +msgid "IDS_BR_BODY_MOST_VISITED_SITES" +msgstr "자주 방문한 웹사이트" + +msgid "IDS_BR_OPT_SHARE_VIA_FACEBOOK" +msgstr "Facebook으로 공유" + +msgid "IDS_BR_OPT_SHARE_VIA_TWITTER" +msgstr "Twitter로 공유" + +msgid "IDS_BR_SK3_CHANGE_VIEW" +msgstr "보기 모드 변경" + +msgid "IDS_BR_HEADER_SELECT_URLS" +msgstr "URL 선택" + +msgid "IDS_BR_POP_THIS_SITE_IS_ATTEMPTING_TO_OPEN_POP_UP_WINDOW" +msgstr "이 웹사이트에서 팝업창을 열려고 합니다" + +msgid "IDS_BR_MBODY_BLOCK_POP_UP_WINDOWS" +msgstr "팝업 차단" + +msgid "IDS_BR_BODY_TEXT_READER" +msgstr "텍스트 판독" + +msgid "IDS_BR_OPT_COPY_IMAGE" +msgstr "이미지 복사" + +msgid "IDS_BR_OPT_SAVE_IMAGE" +msgstr "이미지 저장" + +msgid "IDS_BR_BODY_PLAY" +msgstr "재생" + +msgid "IDS_BR_OPT_SELECT" +msgstr "선택" + +msgid "IDS_BR_OPT_NAVIGATE_GO_BACKWARD" +msgstr "뒤로 이동" + +msgid "IDS_BR_OPT_NAVIGATE_GO_FORWARD" +msgstr "앞으로 이동" + +msgid "IDS_BR_OPT_STOP" +msgstr "중지" + +msgid "IDS_BR_OPT_RELOAD" +msgstr "새로고침" + +msgid "IDS_BR_OPT_PASTE" +msgstr "붙여넣기" + +msgid "IDS_BR_BUTTON_MORE" +msgstr "더보기" + +msgid "IDS_BR_POP_FAIL" +msgstr "실패하였습니다" + +msgid "IDS_BR_BODY_OPEN_IN_NEW_WINDOW" +msgstr "새 창에서 열기" + +msgid "IDS_BR_OPT_VIEW_DOWNLOAD_LIST" +msgstr "다운로드 목록 보기" + +msgid "IDS_BR_BODY_COPY_URL" +msgstr "URL 복사" + +msgid "IDS_BR_BODY_COPY_URL_TO" +msgstr "URL 복사" + +msgid "IDS_BR_BODY_VIEW_IMAGE" +msgstr "이미지 보기" + +msgid "IDS_BR_BODY_PRIVACY_SETTINGS" +msgstr "개인 정보 설정" + +msgid "IDS_BR_BODY_CLEAR_CACHE" +msgstr "캐시 삭제" + +msgid "IDS_BR_BODY_CLEAR_HISTORY" +msgstr "기록 삭제" + +msgid "IDS_BR_BODY_ENABLE_PLUG_INS" +msgstr "플러그인 사용" + +msgid "IDS_BR_BODY_SELECT_SEARCH_ENGINE" +msgstr "검색 엔진 선택" + +msgid "IDS_BR_BODY_DELETE_SAVED_ID_PASSWORD" +msgstr "저장된 ID/비밀번호 삭제" + +msgid "IDS_BR_BODY_CLEAR_ALL_COOKIE_DATA" +msgstr "모든 쿠키 삭제" + +msgid "IDS_BR_BODY_UP" +msgstr "상위" + +msgid "IDS_BR_BODY_FONT_SIZE" +msgstr "글자 크기" + +msgid "IDS_BR_POP_DELETED" +msgstr "삭제되었습니다" + +msgid "IDS_BR_BODY_DEFAULT_VIEW" +msgstr "기본 화면" + +msgid "IDS_BR_MBODY_PAGE_CONTENT_SETTINGS" +msgstr "페이지 컨텐츠 설정" + +msgid "IDS_BR_POP_CASE_SENSITIVE" +msgstr "대소문자 구분" + +msgid "IDS_BR_BODY_PLUG_IN" +msgstr "플러그인" + +msgid "IDS_BR_OPT_PLUGINS_LIST" +msgstr "플러그인 목록" + +msgid "IDS_BR_HEADER_LOCAL_STORAGE" +msgstr "저장 위치" + +msgid "IDS_BR_BODY_DELETE_BROWSING_DATA" +msgstr "인터넷 파일 삭제" + +msgid "IDS_BR_BODY_LOADING_ING" +msgstr "로딩 중..." + +msgid "IDS_BR_HEADER_LOADING_ING" +msgstr "로딩 중..." + +msgid "IDS_BR_HEADER_ENTERURL" +msgstr "URL을 입력하세요" + +msgid "IDS_BR_OPT_LOCK" +msgstr "잠금" + +msgid "IDS_BR_OPT_UNLOCK" +msgstr "잠금 해제" + +msgid "IDS_BR_BODY_MODIFY" +msgstr "변경" + +msgid "IDS_BR_SK_PAGE_UP" +msgstr "이전 페이지" + +msgid "IDS_BR_SK_PAGE_DOWN" +msgstr "다음 페이지" + +msgid "IDS_BR_BODY_DEVELOPER_MODE" +msgstr "개발자 모드" + +msgid "IDS_BR_BODY_EMPTY" +msgstr "비어 있음" + +msgid "IDS_BR_BODY_CERTIFICATES" +msgstr "인증서" + +msgid "IDS_BR_BODY_BOOKMARKS" +msgstr "북마크" + +msgid "IDS_BR_BODY_ENTER_NAME" +msgstr "이름을 입력하세요" + +msgid "IDS_BR_BODY_NAME" +msgstr "이름" + +msgid "IDS_BR_OPT_SEND_VIA_EMAIL" +msgstr "이메일로 전송" + +msgid "IDS_BR_OPT_SEND_VIA_MESSAGE" +msgstr "메시지로 전송" + +msgid "IDS_BR_BODY_SETTINGS" +msgstr "설정" + +msgid "IDS_BR_BODY_AUTHUSERNAME" +msgstr "사용자 이름" + +msgid "IDS_BR_POP_ALREADY_EXISTS" +msgstr "이미 저장되어 있습니다" + +msgid "IDS_BR_POP_SAVED" +msgstr "저장되었습니다" + +msgid "IDS_BR_POP_NOT_ENOUGH_MEMORY" +msgstr "메모리가 부족합니다" + +msgid "IDS_BR_POP_NETWORK_ERROR" +msgstr "네트워크 오류가 발생하였습니다" + +msgid "IDS_BR_BODY_ALWAYS_ASK" +msgstr "항상 묻기" + +msgid "IDS_BR_BODY_MEMORY_CARD" +msgstr "메모리 카드" + +msgid "IDS_BR_BODY_PHONE" +msgstr "휴대폰" + +msgid "IDS_BR_BODY_NO_ACCOUNTS_ABB" +msgstr "설정된 계정 없음" + +msgid "IDS_BR_HEADER_ERROR_PAGE" +msgstr "오류 페이지" + +msgid "IDS_BR_BODY_WEB_PAGE_TEMPORARILY_NOT_AVAILABLE" +msgstr "웹 페이지를 일시적으로 사용할 수 없습니다" + +msgid "IDS_BR_BODY_WEB_PAGE_NOT_AVAILABLE" +msgstr "웹 페이지에 연결할 수 없습니다" + +msgid "IDS_BR_BODY_FAILED_TO_LOAD_FRAMES" +msgstr "프레임을 불러오지 못하였습니다" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_1" +msgstr "웹 페이지 %s을(를) 가져오는 중에 다음 오류가 발생하였습니다." + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_2" +msgstr "웹 페이지를 가져올 수 없습니다(웹 페이지를 일시적으로 사용할 수 없거나 새로운 URL로 이동되었을 수 있습니다)" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_3" +msgstr "가능성이 높은 원인은 아래와 같습니다" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_4" +msgstr "네트워크에 연결할 수 없습니다" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_5" +msgstr "웹 페이지 URL 확인" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_6" +msgstr "나중에 웹 페이지 다시 불러오기" + +msgid "IDS_BR_OPT_BOOKMARK" +msgstr "북마크" + +msgid "IDS_BR_BODY_TITLE" +msgstr "제목" + +msgid "IDS_BR_BODY_ENTER_TITLE" +msgstr "제목을 입력하세요" + +msgid "IDS_BR_OPT_FOLDERS" +msgstr "폴더" + +msgid "IDS_BR_OPT_ALLOW" +msgstr "허용" + +msgid "IDS_BR_POP_REFUSE" +msgstr "거부" + +msgid "IDS_BR_POP_SECURITY_ERROR_C_UNTRUSTED_SERVER_CERTIFICATE" +msgstr "서버 인증서를 신뢰할 수 없습니다" + +msgid "IDS_BR_POP_PD_ITEMS_SELECTED" +msgstr "%d개의 항목이 선택되었습니다" + +msgid "IDS_BR_POP_1_ITEM_SELECTED" +msgstr "1개의 항목이 선택되었습니다" + diff --git a/po/nl_NL.po b/po/nl_NL.po new file mode 100755 index 00000000..128625d2 --- /dev/null +++ b/po/nl_NL.po @@ -0,0 +1,621 @@ +msgid "IDS_BR_POP_INSTALLATION_FAILED" +msgstr "Installatie mislukt" + +msgid "IDS_BR_BODY_NOTIFYING_ING" +msgstr "Melden..." + +msgid "IDS_BR_BODY_PROCESSING_ING" +msgstr "Verwerken..." + +msgid "IDS_BR_BODY_PROCESSING_COMPLETED" +msgstr "Verwerken voltooid" + +msgid "IDS_BR_SK_RETRY" +msgstr "Opnieuw" + +msgid "IDS_BR_HEADER_DOWNLOAD_MANAGER" +msgstr "Downloadmanager" + +msgid "IDS_BR_POP_INVALIDDESCRIPTOR" +msgstr "Ongeldige descriptor" + +msgid "IDS_BR_POP_UNABLE_TO_OPEN_FILE" +msgstr "Kan bestand niet openen" + +msgid "IDS_BR_POP_DOWNLOAD_Q" +msgstr "Downloaden?" + +msgid "IDS_BR_OPT_DELETE_SELECTED" +msgstr "Geselecteerd" + +msgid "IDS_BR_POP_DOWNLOAD_CANCELLED" +msgstr "Downloaden geannuleerd" + +msgid "IDS_BR_BODY_CONTINUE_FROM_LAST_PAGE" +msgstr "Verder na ltst pag" + +msgid "IDS_BR_BODY_PAGE" +msgstr "Pagina" + +msgid "IDS_BR_OPT_DICTIONARY" +msgstr "Woordenboek" + +msgid "IDS_BR_BODY_ABOUT_BROWSER" +msgstr "Browserinfo" + +msgid "IDS_BR_BODY_BROWSER_TYPE" +msgstr "Type" + +msgid "IDS_BR_BODY_CERTIFICATE_ISSUER" +msgstr "Uitgever" + +msgid "IDS_BR_BODY_DISPLAY_IMAGES" +msgstr "Afbeeldingen weergeven" + +msgid "IDS_BR_BODY_DOWNLOAD" +msgstr "Downloaden" + +msgid "IDS_BR_BODY_ENTER_URL" +msgstr "URL invoeren" + +msgid "IDS_BR_BODY_FOLDER" +msgstr "Map" + +msgid "IDS_BR_BODY_HOMEPAGE" +msgstr "Startpagina" + +msgid "IDS_BR_BODY_LANDSCAPE_VIEW" +msgstr "Liggend" + +msgid "IDS_BR_BODY_NO_BOOKMARKS" +msgstr "Geen favorieten" + +msgid "IDS_BR_BODY_NO_RESULTS_FOUND" +msgstr "Geen resultaten gevonden" + +msgid "IDS_BR_BODY_OPTIONAL" +msgstr "Optioneel" + +msgid "IDS_BR_BODY_RSS" +msgstr "RSS" + +msgid "IDS_BR_BODY_RUN_FLASH" +msgstr "Flash uitvoeren" + +msgid "IDS_BR_BODY_RUN_JAVASCRIPT" +msgstr "JavaScript uitvoeren" + +msgid "IDS_BR_HEADER_COMMON_NAME_C" +msgstr "Algemene naam:" + +msgid "IDS_BR_HEADER_ORGANIZATIONAL_UNIT_C" +msgstr "Organisatorische eenheid:" + +msgid "IDS_BR_HEADER_ORGANIZATION_C" +msgstr "Organisatie:" + +msgid "IDS_BR_HEADER_USER_AGENT" +msgstr "User-agent" + +msgid "IDS_BR_OPT_LAST_VIEWED_PAGE_ATNT" +msgstr "Last Viewed Page" + +msgid "IDS_BR_OPT_PREFERENCES" +msgstr "Voorkeuren" + +msgid "IDS_BR_POP_ACTICATION_ERR" +msgstr "Activeringsfout" + +msgid "IDS_BR_POP_ALREADY_RUNNING" +msgstr "Is al actief" + +msgid "IDS_BR_POP_ERRORIMPLEMENTED" +msgstr "Niet geīmplementeerd" + +msgid "IDS_BR_POP_HTTPERRAUTHFAILED" +msgstr "Verificatie mislukt" + +msgid "IDS_BR_POP_OVERWRITE_Q" +msgstr "Overschrijven?" + +msgid "IDS_BR_POP_URL" +msgstr "URL" + +msgid "IDS_BR_TAB_HISTORY" +msgstr "Geschiedenis" + +msgid "IDS_BR_HEADER_DOWNLOAD_LIST" +msgstr "Downloadlijst" + +msgid "IDS_BR_POP_ALREADYINSTALLED" +msgstr "Al geīnstalleerd" + +msgid "IDS_BR_POP_NOTIFYING" +msgstr "Melden..." + +msgid "IDS_BR_POP_NOTSUPPORT" +msgstr "Inhoud niet ondersteund" + +msgid "IDS_BR_POP_ERROR_C_UNABLE_TO_RESOLVE_HOST_NAME" +msgstr "Fout: kan hostnaam niet oplossen" + +msgid "IDS_BR_POP_UNABLE_TO_REACH_PROXY" +msgstr "Kan proxy niet bereiken" + +msgid "IDS_BR_POP_NOSSLCERTI" +msgstr "Geen SSL-certificaten" + +msgid "IDS_BR_BODY_FILE_SIZE_EXCEEDS_MAXIMUM_UPLOAD_LIMIT" +msgstr "Bestandsgrootte overschrijdt maximale uploadlimiet" + +msgid "IDS_BR_BODY_ENTER_NAME_C" +msgstr "Naam invoeren:" + +msgid "IDS_BR_SK_NEXT" +msgstr "Volgende" + +msgid "IDS_BR_OPT_NEW_FOLDER" +msgstr "Nieuwe map" + +msgid "IDS_BR_SK3_ADD_TO_BOOKMARKS" +msgstr "Toev. als favoriet" + +msgid "IDS_BR_SK1_NEW_WINDOW" +msgstr "Nieuw venster" + +msgid "IDS_BR_BODY_URL" +msgstr "URL" + +msgid "IDS_BR_BODY_URL_C" +msgstr "URL:" + +msgid "IDS_BR_BODY_URL_NOT_AVAILABLE" +msgstr "URL niet beschikbaar" + +msgid "IDS_BR_BODY_URL_PS_NOT_AVAILABLE_IT_MIGHT_BE_DOWN_TEMPORARILY_OR_NO_LONGER_IN_USE" +msgstr "URL %s niet beschikbaar. Deze is mogelijk tijdelijk uitgevallen of niet langer in gebruik" + +msgid "IDS_BR_HEADER_FOLDER" +msgstr "Map" + +msgid "IDS_BR_BODY_FOLDER_NAME" +msgstr "Mapnaam" + +msgid "IDS_BR_BODY_FOLDER_NAME_ALREADY_IN_USE" +msgstr "Mapnaam bestaat al" + +msgid "IDS_BR_BODY_NO_TITLE" +msgstr "Geen titel" + +msgid "IDS_BR_HEADER_MULTI_WINDOW" +msgstr "Meer vensters" + +msgid "IDS_BR_BODY_NO_HISTORIES" +msgstr "Geen geschiedenis" + +msgid "IDS_BR_BODY_ADD_TO_BOOKMARKS" +msgstr "Toevoegen aan Favorieten" + +msgid "IDS_BR_BODY_EDIT_BOOKMARK" +msgstr "Favoriet bewerken" + +msgid "IDS_BR_BODY_FOLDER_NAME_C" +msgstr "Mapnaam:" + +msgid "IDS_BR_OPT_SELECT_ALL" +msgstr "Alles selecteren" + +msgid "IDS_BR_OPT_DOWNLOAD_MANAGER" +msgstr "Downloadmanager" + +msgid "IDS_BR_OPT_ADD_RSS_FEED" +msgstr "RSS-feed toevoegen" + +msgid "IDS_BR_OPT_ADD_RSS_FEEDS" +msgstr "RSS-feeds toevoegen" + +msgid "IDS_BR_OPT_SETTINGS" +msgstr "Instellingen" + +msgid "IDS_BR_POP_ENTER_URL" +msgstr "URL invoeren" + +msgid "IDS_BR_BODY_AUTHPASSWORD" +msgstr "Wachtwoord" + +msgid "IDS_BR_POP_INVALIDADDRESS" +msgstr "Ongeldig adres" + +msgid "IDS_BR_POP_ALREADY_EXISTS_IN_DOWNLOAD_LIST" +msgstr "Bestaat al in downloadlijst" + +msgid "IDS_BR_POP_ENTER_FOLDER_NAME" +msgstr "Mapnaam invoeren" + +msgid "IDS_BR_POP_NO_PAGE" +msgstr "Geen pagina" + +msgid "IDS_BR_POP_NO_PAGES_BACKWARD" +msgstr "Geen vorige pagina's" + +msgid "IDS_BR_POP_NO_PAGES_FORWARD" +msgstr "Geen volgende pagina's" + +msgid "IDS_BR_POP_NO_PAGE_TO_RELOAD" +msgstr "Geen pagina opnieuw te laden" + +msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED" +msgstr "Verificatie vereist" + +msgid "IDS_BR_POP_BOOKMARK_ALREADY_EXISTS" +msgstr "Favoriet bestaat al" + +msgid "IDS_BR_POP_FOLDER_NAME_ALREADY_EXISTS" +msgstr "Mapnaam bestaat al" + +msgid "IDS_BR_POP_UNABLE_TO_SAVE_OBJECT_NOT_ENOUGH_SPACE_IN_CACHE" +msgstr "Kan object niet opslaan. Onvoldoende ruimte in cache" + +msgid "IDS_BR_HEADER_SELECT_ITEMS" +msgstr "Items selecteren" + +msgid "IDS_BR_HEADER_CERTIFICATE_INFO" +msgstr "Certificaatinfo" + +msgid "IDS_BR_OPT_SHARE_VIA_EMAIL" +msgstr "Delen via e-mail" + +msgid "IDS_BR_OPT_SHARE_VIA_MESSAGES" +msgstr "Delen via Berichten" + +msgid "IDS_BR_OPT_SHARE_VIA" +msgstr "Delen via" + +msgid "IDS_BR_POP_UNABLE_TO_START_BROWSER" +msgstr "Kan browser niet starten" + +msgid "IDS_BR_POP_NO_ADDRESS" +msgstr "Geen adres" + +msgid "IDS_BR_POP_NEVER_SHOW_AGAIN" +msgstr "Niet meer weergeven" + +msgid "IDS_BR_POP_FILE_NAME_EMPTY" +msgstr "Bestandsnaam leeg" + +msgid "IDS_BR_SK3_CREATE_FOLDER" +msgstr "Map maken" + +msgid "IDS_BR_OPT_SELECTED" +msgstr "Geselecteerd" + +msgid "IDS_BR_OPT_SHARE" +msgstr "Delen" + +msgid "IDS_BR_HEADER_RECENTLY_VISITED_PAGES" +msgstr "Onlangs bezochte pagina's" + +msgid "IDS_BR_OPT_DISPLAY" +msgstr "Display" + +msgid "IDS_BR_BODY_FIT_TO_WIDTH" +msgstr "Passend in breedte" + +msgid "IDS_BR_BODY_READABLE" +msgstr "Leesbaar" + +msgid "IDS_BR_BODY_PRIVACY" +msgstr "Privacy" + +msgid "IDS_BR_BODY_COOKIES" +msgstr "Cookies" + +msgid "IDS_BR_BODY_COOKIESACCEPTALL" +msgstr "Alles accepteren" + +msgid "IDS_BR_BODY_COOKIESPROMPT" +msgstr "Vragen" + +msgid "IDS_BR_HEADER_COOKIES" +msgstr "Cookies" + +msgid "IDS_BR_BODY_ACCEPT_COOKIES" +msgstr "Cookies accepteren" + +msgid "IDS_BR_OPT_ACCEPT_COOKIES" +msgstr "Cookies accepteren" + +msgid "IDS_BR_BODY_ACCEPT_ALL" +msgstr "Alles accepteren" + +msgid "IDS_BR_BODY_REJECT_ALL" +msgstr "Alles weigeren" + +msgid "IDS_BR_BODY_AUTO_SAVE_ID_PASSWORD" +msgstr "Gebruikersnaam/wachtwoord automatisch opslaan" + +msgid "IDS_BR_BODY_ON" +msgstr "Aan" + +msgid "IDS_BR_BODY_OFF" +msgstr "Uit" + +msgid "IDS_BR_BODY_DEFAULT_STORAGE" +msgstr "Standaardopslag" + +msgid "IDS_BR_BODY_SEARCH" +msgstr "Zoeken" + +msgid "IDS_BR_BODY_SAVE_IMAGE" +msgstr "Afbeelding opslaan" + +msgid "IDS_BR_POP_LOW_BATTERY_UNABLE_TO_RUN_BROWSER" +msgstr "Batterij bijna leeg. Kan browser niet starten" + +msgid "IDS_BR_BODY_FIND_WORD" +msgstr "Woord zoeken" + +msgid "IDS_BR_OPT_ADD_TO_HOME_SCREEN" +msgstr "Toevoegen aan startscherm" + +msgid "IDS_BR_OPT_ADD_TO_HOME_SCREEN_ABB" +msgstr "Toevoegen aan startscherm" + +msgid "IDS_BR_BODY_MOST_VISITED_SITES" +msgstr "Meest bezochte sites" + +msgid "IDS_BR_OPT_SHARE_VIA_FACEBOOK" +msgstr "Delen via Facebook" + +msgid "IDS_BR_OPT_SHARE_VIA_TWITTER" +msgstr "Delen via Twitter" + +msgid "IDS_BR_SK3_CHANGE_VIEW" +msgstr "Wijzig weergave" + +msgid "IDS_BR_HEADER_SELECT_URLS" +msgstr "URL´s selecteren" + +msgid "IDS_BR_POP_THIS_SITE_IS_ATTEMPTING_TO_OPEN_POP_UP_WINDOW" +msgstr "Deze site probeert een pop-upvenster te openen" + +msgid "IDS_BR_MBODY_BLOCK_POP_UP_WINDOWS" +msgstr "Pop-upvensters blokkeren" + +msgid "IDS_BR_BODY_TEXT_READER" +msgstr "Tekstlezer" + +msgid "IDS_BR_OPT_COPY_IMAGE" +msgstr "Afbeelding kopiëren" + +msgid "IDS_BR_OPT_SAVE_IMAGE" +msgstr "Afbeelding opslaan" + +msgid "IDS_BR_BODY_PLAY" +msgstr "Afspelen" + +msgid "IDS_BR_OPT_SELECT" +msgstr "Selecteren" + +msgid "IDS_BR_OPT_NAVIGATE_GO_BACKWARD" +msgstr "Ga terug" + +msgid "IDS_BR_OPT_NAVIGATE_GO_FORWARD" +msgstr "Ga vooruit" + +msgid "IDS_BR_OPT_STOP" +msgstr "Stoppen" + +msgid "IDS_BR_OPT_RELOAD" +msgstr "Opnieuw laden" + +msgid "IDS_BR_OPT_PASTE" +msgstr "Plakken" + +msgid "IDS_BR_BUTTON_MORE" +msgstr "Meer" + +msgid "IDS_BR_POP_FAIL" +msgstr "Mislukt" + +msgid "IDS_BR_BODY_OPEN_IN_NEW_WINDOW" +msgstr "In nieuw venster" + +msgid "IDS_BR_OPT_VIEW_DOWNLOAD_LIST" +msgstr "Gedownloade lijst tonen" + +msgid "IDS_BR_BODY_COPY_URL" +msgstr "URL kopiëren" + +msgid "IDS_BR_BODY_COPY_URL_TO" +msgstr "URL kopiëren naar" + +msgid "IDS_BR_BODY_VIEW_IMAGE" +msgstr "Afbeelding bekijken" + +msgid "IDS_BR_BODY_PRIVACY_SETTINGS" +msgstr "Privacy-instellingen" + +msgid "IDS_BR_BODY_CLEAR_CACHE" +msgstr "Buffer leegmaken" + +msgid "IDS_BR_BODY_CLEAR_HISTORY" +msgstr "Geschiedenis wissen" + +msgid "IDS_BR_BODY_ENABLE_PLUG_INS" +msgstr "Invoegtoepassingen activeren" + +msgid "IDS_BR_BODY_SELECT_SEARCH_ENGINE" +msgstr "Zoekmachine selecteren" + +msgid "IDS_BR_BODY_DELETE_SAVED_ID_PASSWORD" +msgstr "Opgeslagen gebruikersnaam/wachtwoord wissen" + +msgid "IDS_BR_BODY_CLEAR_ALL_COOKIE_DATA" +msgstr "Alle cookiegegevens wissen" + +msgid "IDS_BR_BODY_UP" +msgstr "Omhoog" + +msgid "IDS_BR_BODY_FONT_SIZE" +msgstr "Tekstgrootte" + +msgid "IDS_BR_POP_DELETED" +msgstr "Verwijderd" + +msgid "IDS_BR_BODY_DEFAULT_VIEW" +msgstr "Standaardweergave" + +msgid "IDS_BR_MBODY_PAGE_CONTENT_SETTINGS" +msgstr "Instellingen pagina-inhoud" + +msgid "IDS_BR_POP_CASE_SENSITIVE" +msgstr "Hoofdlettergevoelig" + +msgid "IDS_BR_BODY_PLUG_IN" +msgstr "Plug-in" + +msgid "IDS_BR_OPT_PLUGINS_LIST" +msgstr "Lijst met invoegtoepassingen" + +msgid "IDS_BR_HEADER_LOCAL_STORAGE" +msgstr "Lokale opslag" + +msgid "IDS_BR_BODY_DELETE_BROWSING_DATA" +msgstr "Surfgegevens verwijderen" + +msgid "IDS_BR_BODY_LOADING_ING" +msgstr "Laden..." + +msgid "IDS_BR_HEADER_LOADING_ING" +msgstr "Laden..." + +msgid "IDS_BR_HEADER_ENTERURL" +msgstr "URL invoeren" + +msgid "IDS_BR_OPT_LOCK" +msgstr "Vergrendelen" + +msgid "IDS_BR_OPT_UNLOCK" +msgstr "Ontgrendelen" + +msgid "IDS_BR_BODY_MODIFY" +msgstr "Wijzigen" + +msgid "IDS_BR_SK_PAGE_UP" +msgstr "Pag. omhoog" + +msgid "IDS_BR_SK_PAGE_DOWN" +msgstr "Pag. omlaag" + +msgid "IDS_BR_BODY_DEVELOPER_MODE" +msgstr "Ontwikkelaarstand" + +msgid "IDS_BR_BODY_EMPTY" +msgstr "Leeg" + +msgid "IDS_BR_BODY_CERTIFICATES" +msgstr "Certificaten" + +msgid "IDS_BR_BODY_BOOKMARKS" +msgstr "Favorieten" + +msgid "IDS_BR_BODY_ENTER_NAME" +msgstr "Naam invoeren" + +msgid "IDS_BR_BODY_NAME" +msgstr "Naam" + +msgid "IDS_BR_OPT_SEND_VIA_EMAIL" +msgstr "Verzenden via e-mail" + +msgid "IDS_BR_OPT_SEND_VIA_MESSAGE" +msgstr "Verzenden via bericht" + +msgid "IDS_BR_BODY_SETTINGS" +msgstr "Instellingen" + +msgid "IDS_BR_BODY_AUTHUSERNAME" +msgstr "Gebruikersnaam" + +msgid "IDS_BR_POP_ALREADY_EXISTS" +msgstr "Bestaat al" + +msgid "IDS_BR_POP_SAVED" +msgstr "Opgeslagen" + +msgid "IDS_BR_POP_NOT_ENOUGH_MEMORY" +msgstr "Onvoldoende geheugen" + +msgid "IDS_BR_POP_NETWORK_ERROR" +msgstr "Netwerkfout" + +msgid "IDS_BR_BODY_ALWAYS_ASK" +msgstr "Altijd vragen" + +msgid "IDS_BR_BODY_MEMORY_CARD" +msgstr "Geheugenkaart" + +msgid "IDS_BR_BODY_PHONE" +msgstr "Telefoon" + +msgid "IDS_BR_BODY_NO_ACCOUNTS_ABB" +msgstr "Geen accounts" + +msgid "IDS_BR_HEADER_ERROR_PAGE" +msgstr "Foutpagina" + +msgid "IDS_BR_BODY_WEB_PAGE_TEMPORARILY_NOT_AVAILABLE" +msgstr "Webpagina tijdelijk niet beschikbaar" + +msgid "IDS_BR_BODY_WEB_PAGE_NOT_AVAILABLE" +msgstr "Webpagina niet beschikbaar" + +msgid "IDS_BR_BODY_FAILED_TO_LOAD_FRAMES" +msgstr "Kan frames niet laden" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_1" +msgstr "De volgende fout is opgetreden bij het ophalen van webpagina %s." + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_2" +msgstr "Kan de webpagina niet ophalen. (Webpagina is mogelijk tijdelijk uitgeschakeld of naar een nieuwe URL verplaatst)" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_3" +msgstr "Hieronder wordt de meest waarschijnlijke oorzaak vermeld" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_4" +msgstr "Netwerkverbinding niet normaal tot stand gekomen" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_5" +msgstr "URL webpagina controleren" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_6" +msgstr "Webpagina later opnieuw laden" + +msgid "IDS_BR_OPT_BOOKMARK" +msgstr "Favorieten" + +msgid "IDS_BR_BODY_TITLE" +msgstr "Titel" + +msgid "IDS_BR_BODY_ENTER_TITLE" +msgstr "Titel invoeren" + +msgid "IDS_BR_OPT_FOLDERS" +msgstr "Mappen" + +msgid "IDS_BR_OPT_ALLOW" +msgstr "Toestaan" + +msgid "IDS_BR_POP_REFUSE" +msgstr "Weigeren" + +msgid "IDS_BR_POP_SECURITY_ERROR_C_UNTRUSTED_SERVER_CERTIFICATE" +msgstr "Beveiligingsfout: Servercertificaat niet vertrouwd" + +msgid "IDS_BR_POP_PD_ITEMS_SELECTED" +msgstr "%d items geselecteerd" + +msgid "IDS_BR_POP_1_ITEM_SELECTED" +msgstr "1 item geselecteerd" + diff --git a/po/pt_PT.po b/po/pt_PT.po new file mode 100755 index 00000000..62f9b893 --- /dev/null +++ b/po/pt_PT.po @@ -0,0 +1,621 @@ +msgid "IDS_BR_POP_INSTALLATION_FAILED" +msgstr "Instalação falhou" + +msgid "IDS_BR_BODY_NOTIFYING_ING" +msgstr "A notificar..." + +msgid "IDS_BR_BODY_PROCESSING_ING" +msgstr "A processar..." + +msgid "IDS_BR_BODY_PROCESSING_COMPLETED" +msgstr "Processamento concluído" + +msgid "IDS_BR_SK_RETRY" +msgstr "Repetir" + +msgid "IDS_BR_HEADER_DOWNLOAD_MANAGER" +msgstr "Gestor de transferências" + +msgid "IDS_BR_POP_INVALIDDESCRIPTOR" +msgstr "Descrição inválida" + +msgid "IDS_BR_POP_UNABLE_TO_OPEN_FILE" +msgstr "Impossível abrir ficheiro" + +msgid "IDS_BR_POP_DOWNLOAD_Q" +msgstr "Transferir?" + +msgid "IDS_BR_OPT_DELETE_SELECTED" +msgstr "Seleccionado" + +msgid "IDS_BR_POP_DOWNLOAD_CANCELLED" +msgstr "Transferência cancelada" + +msgid "IDS_BR_BODY_CONTINUE_FROM_LAST_PAGE" +msgstr "Continuar última pág." + +msgid "IDS_BR_BODY_PAGE" +msgstr "Página" + +msgid "IDS_BR_OPT_DICTIONARY" +msgstr "Dicionário" + +msgid "IDS_BR_BODY_ABOUT_BROWSER" +msgstr "Acerca do browser" + +msgid "IDS_BR_BODY_BROWSER_TYPE" +msgstr "Tipo" + +msgid "IDS_BR_BODY_CERTIFICATE_ISSUER" +msgstr "Emissor" + +msgid "IDS_BR_BODY_DISPLAY_IMAGES" +msgstr "Visualizar imagens" + +msgid "IDS_BR_BODY_DOWNLOAD" +msgstr "Transferir" + +msgid "IDS_BR_BODY_ENTER_URL" +msgstr "Introduzir URL" + +msgid "IDS_BR_BODY_FOLDER" +msgstr "Pasta" + +msgid "IDS_BR_BODY_HOMEPAGE" +msgstr "Página inicial" + +msgid "IDS_BR_BODY_LANDSCAPE_VIEW" +msgstr "Paisagem" + +msgid "IDS_BR_BODY_NO_BOOKMARKS" +msgstr "Nenhum favorito" + +msgid "IDS_BR_BODY_NO_RESULTS_FOUND" +msgstr "Nenhuns resultados encontrados" + +msgid "IDS_BR_BODY_OPTIONAL" +msgstr "Opcional" + +msgid "IDS_BR_BODY_RSS" +msgstr "RSS" + +msgid "IDS_BR_BODY_RUN_FLASH" +msgstr "Executar Flash" + +msgid "IDS_BR_BODY_RUN_JAVASCRIPT" +msgstr "Executar JavaScript" + +msgid "IDS_BR_HEADER_COMMON_NAME_C" +msgstr "Nome comum:" + +msgid "IDS_BR_HEADER_ORGANIZATIONAL_UNIT_C" +msgstr "Unidade organizacional:" + +msgid "IDS_BR_HEADER_ORGANIZATION_C" +msgstr "Organização:" + +msgid "IDS_BR_HEADER_USER_AGENT" +msgstr "Agente de utilizador" + +msgid "IDS_BR_OPT_LAST_VIEWED_PAGE_ATNT" +msgstr "Last Viewed Page" + +msgid "IDS_BR_OPT_PREFERENCES" +msgstr "Preferências" + +msgid "IDS_BR_POP_ACTICATION_ERR" +msgstr "Erro de activação" + +msgid "IDS_BR_POP_ALREADY_RUNNING" +msgstr "Já a ser executado" + +msgid "IDS_BR_POP_ERRORIMPLEMENTED" +msgstr "Não implementado" + +msgid "IDS_BR_POP_HTTPERRAUTHFAILED" +msgstr "Falha de autenticação" + +msgid "IDS_BR_POP_OVERWRITE_Q" +msgstr "Substituir?" + +msgid "IDS_BR_POP_URL" +msgstr "URL" + +msgid "IDS_BR_TAB_HISTORY" +msgstr "Histórico" + +msgid "IDS_BR_HEADER_DOWNLOAD_LIST" +msgstr "Lista de transferências" + +msgid "IDS_BR_POP_ALREADYINSTALLED" +msgstr "Já instalado" + +msgid "IDS_BR_POP_NOTIFYING" +msgstr "A notificar..." + +msgid "IDS_BR_POP_NOTSUPPORT" +msgstr "Conteúdo não suportado" + +msgid "IDS_BR_POP_ERROR_C_UNABLE_TO_RESOLVE_HOST_NAME" +msgstr "Erro: impossível resolver nome de anfitrião" + +msgid "IDS_BR_POP_UNABLE_TO_REACH_PROXY" +msgstr "Impossível alcançar proxy" + +msgid "IDS_BR_POP_NOSSLCERTI" +msgstr "Nenhum certificado SSL" + +msgid "IDS_BR_BODY_FILE_SIZE_EXCEEDS_MAXIMUM_UPLOAD_LIMIT" +msgstr "O tamanho do ficheiro excede o limite máximo de transferência" + +msgid "IDS_BR_BODY_ENTER_NAME_C" +msgstr "Introduzir nome:" + +msgid "IDS_BR_SK_NEXT" +msgstr "Seguinte" + +msgid "IDS_BR_OPT_NEW_FOLDER" +msgstr "Nova pasta" + +msgid "IDS_BR_SK3_ADD_TO_BOOKMARKS" +msgstr "Adic. aos Favoritos" + +msgid "IDS_BR_SK1_NEW_WINDOW" +msgstr "Nova janela" + +msgid "IDS_BR_BODY_URL" +msgstr "URL" + +msgid "IDS_BR_BODY_URL_C" +msgstr "URL :" + +msgid "IDS_BR_BODY_URL_NOT_AVAILABLE" +msgstr "URL indisponível" + +msgid "IDS_BR_BODY_URL_PS_NOT_AVAILABLE_IT_MIGHT_BE_DOWN_TEMPORARILY_OR_NO_LONGER_IN_USE" +msgstr "URL %s indisponível. Pode estar temporariamente em baixo ou já não estar a ser utilizado" + +msgid "IDS_BR_HEADER_FOLDER" +msgstr "Pasta" + +msgid "IDS_BR_BODY_FOLDER_NAME" +msgstr "Nome da pasta" + +msgid "IDS_BR_BODY_FOLDER_NAME_ALREADY_IN_USE" +msgstr "Nome da pasta já existente" + +msgid "IDS_BR_BODY_NO_TITLE" +msgstr "Sem título" + +msgid "IDS_BR_HEADER_MULTI_WINDOW" +msgstr "Multi janela" + +msgid "IDS_BR_BODY_NO_HISTORIES" +msgstr "Nenhuns históricos" + +msgid "IDS_BR_BODY_ADD_TO_BOOKMARKS" +msgstr "Adicionar aos Favoritos" + +msgid "IDS_BR_BODY_EDIT_BOOKMARK" +msgstr "Editar favoritos" + +msgid "IDS_BR_BODY_FOLDER_NAME_C" +msgstr "Nome da pasta:" + +msgid "IDS_BR_OPT_SELECT_ALL" +msgstr "Seleccionar tudo" + +msgid "IDS_BR_OPT_DOWNLOAD_MANAGER" +msgstr "Gestor de transferências" + +msgid "IDS_BR_OPT_ADD_RSS_FEED" +msgstr "Adicionar feed RSS" + +msgid "IDS_BR_OPT_ADD_RSS_FEEDS" +msgstr "Adicionar feeds RSS" + +msgid "IDS_BR_OPT_SETTINGS" +msgstr "Definições" + +msgid "IDS_BR_POP_ENTER_URL" +msgstr "Introduzir URL" + +msgid "IDS_BR_BODY_AUTHPASSWORD" +msgstr "Palavra-passe" + +msgid "IDS_BR_POP_INVALIDADDRESS" +msgstr "Endereço inválido" + +msgid "IDS_BR_POP_ALREADY_EXISTS_IN_DOWNLOAD_LIST" +msgstr "Já existe na lista de transferências" + +msgid "IDS_BR_POP_ENTER_FOLDER_NAME" +msgstr "Introduzir nome da pasta" + +msgid "IDS_BR_POP_NO_PAGE" +msgstr "Nenhuma página" + +msgid "IDS_BR_POP_NO_PAGES_BACKWARD" +msgstr "Nenhumas páginas para trás" + +msgid "IDS_BR_POP_NO_PAGES_FORWARD" +msgstr "Nenhumas páginas para a frente" + +msgid "IDS_BR_POP_NO_PAGE_TO_RELOAD" +msgstr "Nenhuma página para recarregar" + +msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED" +msgstr "Autenticação requerida" + +msgid "IDS_BR_POP_BOOKMARK_ALREADY_EXISTS" +msgstr "Favorito já existe" + +msgid "IDS_BR_POP_FOLDER_NAME_ALREADY_EXISTS" +msgstr "Nome de pasta já existente" + +msgid "IDS_BR_POP_UNABLE_TO_SAVE_OBJECT_NOT_ENOUGH_SPACE_IN_CACHE" +msgstr "Impossível guardar objecto. Espaço insuficiente na cache" + +msgid "IDS_BR_HEADER_SELECT_ITEMS" +msgstr "Seleccionar itens" + +msgid "IDS_BR_HEADER_CERTIFICATE_INFO" +msgstr "Info do certificado" + +msgid "IDS_BR_OPT_SHARE_VIA_EMAIL" +msgstr "Partilhar via e-mail" + +msgid "IDS_BR_OPT_SHARE_VIA_MESSAGES" +msgstr "Partilhar via Mensagens" + +msgid "IDS_BR_OPT_SHARE_VIA" +msgstr "Partilhar via" + +msgid "IDS_BR_POP_UNABLE_TO_START_BROWSER" +msgstr "Impossível iniciar o browser" + +msgid "IDS_BR_POP_NO_ADDRESS" +msgstr "Nenhum endereço" + +msgid "IDS_BR_POP_NEVER_SHOW_AGAIN" +msgstr "Nunca mais mostrar" + +msgid "IDS_BR_POP_FILE_NAME_EMPTY" +msgstr "Nome de ficheiro vazio" + +msgid "IDS_BR_SK3_CREATE_FOLDER" +msgstr "Criar pasta" + +msgid "IDS_BR_OPT_SELECTED" +msgstr "Seleccionado" + +msgid "IDS_BR_OPT_SHARE" +msgstr "Partilhar" + +msgid "IDS_BR_HEADER_RECENTLY_VISITED_PAGES" +msgstr "Páginas visitadas recentemente" + +msgid "IDS_BR_OPT_DISPLAY" +msgstr "Visor" + +msgid "IDS_BR_BODY_FIT_TO_WIDTH" +msgstr "Ajustar à largura" + +msgid "IDS_BR_BODY_READABLE" +msgstr "Legível" + +msgid "IDS_BR_BODY_PRIVACY" +msgstr "Privacidade" + +msgid "IDS_BR_BODY_COOKIES" +msgstr "Cookies" + +msgid "IDS_BR_BODY_COOKIESACCEPTALL" +msgstr "Aceitar tudo" + +msgid "IDS_BR_BODY_COOKIESPROMPT" +msgstr "Pedido" + +msgid "IDS_BR_HEADER_COOKIES" +msgstr "Cookies" + +msgid "IDS_BR_BODY_ACCEPT_COOKIES" +msgstr "Aceitar cookies" + +msgid "IDS_BR_OPT_ACCEPT_COOKIES" +msgstr "Aceitar cookies" + +msgid "IDS_BR_BODY_ACCEPT_ALL" +msgstr "Aceitar tudo" + +msgid "IDS_BR_BODY_REJECT_ALL" +msgstr "Rejeitar tudo" + +msgid "IDS_BR_BODY_AUTO_SAVE_ID_PASSWORD" +msgstr "Gravação automática de ID/palavra-passe" + +msgid "IDS_BR_BODY_ON" +msgstr "Ligar" + +msgid "IDS_BR_BODY_OFF" +msgstr "Desligar" + +msgid "IDS_BR_BODY_DEFAULT_STORAGE" +msgstr "Memória padrão" + +msgid "IDS_BR_BODY_SEARCH" +msgstr "Procurar" + +msgid "IDS_BR_BODY_SAVE_IMAGE" +msgstr "Guardar imagem" + +msgid "IDS_BR_POP_LOW_BATTERY_UNABLE_TO_RUN_BROWSER" +msgstr "Bateria fraca. Impossível executar o browser" + +msgid "IDS_BR_BODY_FIND_WORD" +msgstr "Encontrar palavra" + +msgid "IDS_BR_OPT_ADD_TO_HOME_SCREEN" +msgstr "Adic. ao ecrã principal" + +msgid "IDS_BR_OPT_ADD_TO_HOME_SCREEN_ABB" +msgstr "Adicionar ao ecrã principal" + +msgid "IDS_BR_BODY_MOST_VISITED_SITES" +msgstr "Sites mais visitados" + +msgid "IDS_BR_OPT_SHARE_VIA_FACEBOOK" +msgstr "Partilhar via Facebook" + +msgid "IDS_BR_OPT_SHARE_VIA_TWITTER" +msgstr "Partilhar via Twitter" + +msgid "IDS_BR_SK3_CHANGE_VIEW" +msgstr "Alterar vista" + +msgid "IDS_BR_HEADER_SELECT_URLS" +msgstr "Seleccionar URLs" + +msgid "IDS_BR_POP_THIS_SITE_IS_ATTEMPTING_TO_OPEN_POP_UP_WINDOW" +msgstr "Este site está a tentar abrir uma janela de contexto" + +msgid "IDS_BR_MBODY_BLOCK_POP_UP_WINDOWS" +msgstr "Bloquear janelas contexto" + +msgid "IDS_BR_BODY_TEXT_READER" +msgstr "Leitor de texto" + +msgid "IDS_BR_OPT_COPY_IMAGE" +msgstr "Copiar imagem" + +msgid "IDS_BR_OPT_SAVE_IMAGE" +msgstr "Guardar imagem" + +msgid "IDS_BR_BODY_PLAY" +msgstr "Reproduzir" + +msgid "IDS_BR_OPT_SELECT" +msgstr "Seleccionar" + +msgid "IDS_BR_OPT_NAVIGATE_GO_BACKWARD" +msgstr "Ir para trás" + +msgid "IDS_BR_OPT_NAVIGATE_GO_FORWARD" +msgstr "Ir para a frente" + +msgid "IDS_BR_OPT_STOP" +msgstr "Parar" + +msgid "IDS_BR_OPT_RELOAD" +msgstr "Recarregar" + +msgid "IDS_BR_OPT_PASTE" +msgstr "Colar" + +msgid "IDS_BR_BUTTON_MORE" +msgstr "Mais" + +msgid "IDS_BR_POP_FAIL" +msgstr "Falha" + +msgid "IDS_BR_BODY_OPEN_IN_NEW_WINDOW" +msgstr "Abrir em nova janela" + +msgid "IDS_BR_OPT_VIEW_DOWNLOAD_LIST" +msgstr "Ver lista de transferências" + +msgid "IDS_BR_BODY_COPY_URL" +msgstr "Copiar URL" + +msgid "IDS_BR_BODY_COPY_URL_TO" +msgstr "Copiar URL para" + +msgid "IDS_BR_BODY_VIEW_IMAGE" +msgstr "Ver imagem" + +msgid "IDS_BR_BODY_PRIVACY_SETTINGS" +msgstr "Definições de privacidade" + +msgid "IDS_BR_BODY_CLEAR_CACHE" +msgstr "Limpar cache" + +msgid "IDS_BR_BODY_CLEAR_HISTORY" +msgstr "Limpar histórico" + +msgid "IDS_BR_BODY_ENABLE_PLUG_INS" +msgstr "Activar plug-ins" + +msgid "IDS_BR_BODY_SELECT_SEARCH_ENGINE" +msgstr "Seleccionar motor de pesquisa" + +msgid "IDS_BR_BODY_DELETE_SAVED_ID_PASSWORD" +msgstr "Eliminar ID/Palavra-passe guardadas" + +msgid "IDS_BR_BODY_CLEAR_ALL_COOKIE_DATA" +msgstr "Limpar todos os dados de cookies" + +msgid "IDS_BR_BODY_UP" +msgstr "Para cima" + +msgid "IDS_BR_BODY_FONT_SIZE" +msgstr "Tamanho da fonte" + +msgid "IDS_BR_POP_DELETED" +msgstr "Eliminado" + +msgid "IDS_BR_BODY_DEFAULT_VIEW" +msgstr "Vista padrão" + +msgid "IDS_BR_MBODY_PAGE_CONTENT_SETTINGS" +msgstr "Def. conteúdo de página" + +msgid "IDS_BR_POP_CASE_SENSITIVE" +msgstr "Sensível a maiúsculas e minúsculas" + +msgid "IDS_BR_BODY_PLUG_IN" +msgstr "Plug in" + +msgid "IDS_BR_OPT_PLUGINS_LIST" +msgstr "Lista de plugins" + +msgid "IDS_BR_HEADER_LOCAL_STORAGE" +msgstr "Armazenamento local" + +msgid "IDS_BR_BODY_DELETE_BROWSING_DATA" +msgstr "Eliminar os dados do browser" + +msgid "IDS_BR_BODY_LOADING_ING" +msgstr "A carregar" + +msgid "IDS_BR_HEADER_LOADING_ING" +msgstr "A carregar" + +msgid "IDS_BR_HEADER_ENTERURL" +msgstr "Introduzir URL" + +msgid "IDS_BR_OPT_LOCK" +msgstr "Bloquear" + +msgid "IDS_BR_OPT_UNLOCK" +msgstr "Desbloquear" + +msgid "IDS_BR_BODY_MODIFY" +msgstr "Modificar" + +msgid "IDS_BR_SK_PAGE_UP" +msgstr "Pág. p/cima" + +msgid "IDS_BR_SK_PAGE_DOWN" +msgstr "Pág. p/baixo" + +msgid "IDS_BR_BODY_DEVELOPER_MODE" +msgstr "Modo de programador" + +msgid "IDS_BR_BODY_EMPTY" +msgstr "Vazio" + +msgid "IDS_BR_BODY_CERTIFICATES" +msgstr "Certificados" + +msgid "IDS_BR_BODY_BOOKMARKS" +msgstr "Favoritos" + +msgid "IDS_BR_BODY_ENTER_NAME" +msgstr "Introduzir nome" + +msgid "IDS_BR_BODY_NAME" +msgstr "Nome" + +msgid "IDS_BR_OPT_SEND_VIA_EMAIL" +msgstr "Enviar por e-mail" + +msgid "IDS_BR_OPT_SEND_VIA_MESSAGE" +msgstr "Enviar por mensagem" + +msgid "IDS_BR_BODY_SETTINGS" +msgstr "Definições" + +msgid "IDS_BR_BODY_AUTHUSERNAME" +msgstr "Nome de utilizador" + +msgid "IDS_BR_POP_ALREADY_EXISTS" +msgstr "Já existe" + +msgid "IDS_BR_POP_SAVED" +msgstr "Guardado" + +msgid "IDS_BR_POP_NOT_ENOUGH_MEMORY" +msgstr "Cartão SD cheio" + +msgid "IDS_BR_POP_NETWORK_ERROR" +msgstr "Erro da rede" + +msgid "IDS_BR_BODY_ALWAYS_ASK" +msgstr "Perguntar sempre" + +msgid "IDS_BR_BODY_MEMORY_CARD" +msgstr "Cartão de memória" + +msgid "IDS_BR_BODY_PHONE" +msgstr "Telefone" + +msgid "IDS_BR_BODY_NO_ACCOUNTS_ABB" +msgstr "Sem contas" + +msgid "IDS_BR_HEADER_ERROR_PAGE" +msgstr "Página com erro" + +msgid "IDS_BR_BODY_WEB_PAGE_TEMPORARILY_NOT_AVAILABLE" +msgstr "Página Web temporariamente indisponível" + +msgid "IDS_BR_BODY_WEB_PAGE_NOT_AVAILABLE" +msgstr "Página Web indisponível" + +msgid "IDS_BR_BODY_FAILED_TO_LOAD_FRAMES" +msgstr "Falha ao carregar blocos" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_1" +msgstr "Ao obter a página %s da Web, ocorreu o erro seguinte." + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_2" +msgstr "Impossível obter página Web. (A página Web pode estar temporariamente inacessível ou ter sido movida para um URL novo)" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_3" +msgstr "A causa mais provável é indicada abaixo" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_4" +msgstr "Ligação de rede não estabelecida normalmente" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_5" +msgstr "Verificar o URL da página Web" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_6" +msgstr "Recarregar página Web mais tarde" + +msgid "IDS_BR_OPT_BOOKMARK" +msgstr "Favorito" + +msgid "IDS_BR_BODY_TITLE" +msgstr "Título" + +msgid "IDS_BR_BODY_ENTER_TITLE" +msgstr "Introduzir título" + +msgid "IDS_BR_OPT_FOLDERS" +msgstr "Pastas" + +msgid "IDS_BR_OPT_ALLOW" +msgstr "Permitir" + +msgid "IDS_BR_POP_REFUSE" +msgstr "Recu." + +msgid "IDS_BR_POP_SECURITY_ERROR_C_UNTRUSTED_SERVER_CERTIFICATE" +msgstr "Erro de segurança: Certificado de servidor não fidedigno" + +msgid "IDS_BR_POP_PD_ITEMS_SELECTED" +msgstr "%d itens seleccionados" + +msgid "IDS_BR_POP_1_ITEM_SELECTED" +msgstr "1 item seleccionado" + diff --git a/po/ru_RU.po b/po/ru_RU.po new file mode 100755 index 00000000..964d60b6 --- /dev/null +++ b/po/ru_RU.po @@ -0,0 +1,621 @@ +msgid "IDS_BR_POP_INSTALLATION_FAILED" +msgstr "Сбой установки" + +msgid "IDS_BR_BODY_NOTIFYING_ING" +msgstr "Уведомление..." + +msgid "IDS_BR_BODY_PROCESSING_ING" +msgstr "Обработка..." + +msgid "IDS_BR_BODY_PROCESSING_COMPLETED" +msgstr "Обработка завершена" + +msgid "IDS_BR_SK_RETRY" +msgstr "Повтор" + +msgid "IDS_BR_HEADER_DOWNLOAD_MANAGER" +msgstr "Диспетчер загрузки" + +msgid "IDS_BR_POP_INVALIDDESCRIPTOR" +msgstr "Неверный дескриптор" + +msgid "IDS_BR_POP_UNABLE_TO_OPEN_FILE" +msgstr "Невозможно открыть файл" + +msgid "IDS_BR_POP_DOWNLOAD_Q" +msgstr "Загрузить?" + +msgid "IDS_BR_OPT_DELETE_SELECTED" +msgstr "Выбранное" + +msgid "IDS_BR_POP_DOWNLOAD_CANCELLED" +msgstr "Загрузка отменена" + +msgid "IDS_BR_BODY_CONTINUE_FROM_LAST_PAGE" +msgstr "С последней страницы" + +msgid "IDS_BR_BODY_PAGE" +msgstr "Страница" + +msgid "IDS_BR_OPT_DICTIONARY" +msgstr "Словарь" + +msgid "IDS_BR_BODY_ABOUT_BROWSER" +msgstr "О браузере" + +msgid "IDS_BR_BODY_BROWSER_TYPE" +msgstr "Тип" + +msgid "IDS_BR_BODY_CERTIFICATE_ISSUER" +msgstr "Выдан" + +msgid "IDS_BR_BODY_DISPLAY_IMAGES" +msgstr "Показывать картинки" + +msgid "IDS_BR_BODY_DOWNLOAD" +msgstr "Загрузить" + +msgid "IDS_BR_BODY_ENTER_URL" +msgstr "Введите URL-адрес" + +msgid "IDS_BR_BODY_FOLDER" +msgstr "Папка" + +msgid "IDS_BR_BODY_HOMEPAGE" +msgstr "Домашняя страница" + +msgid "IDS_BR_BODY_LANDSCAPE_VIEW" +msgstr "Пейзаж" + +msgid "IDS_BR_BODY_NO_BOOKMARKS" +msgstr "Нет закладок" + +msgid "IDS_BR_BODY_NO_RESULTS_FOUND" +msgstr "Ничего не найдено" + +msgid "IDS_BR_BODY_OPTIONAL" +msgstr "Выборочно" + +msgid "IDS_BR_BODY_RSS" +msgstr "RSS" + +msgid "IDS_BR_BODY_RUN_FLASH" +msgstr "Запускать Flash" + +msgid "IDS_BR_BODY_RUN_JAVASCRIPT" +msgstr "Выполнять JavaScript" + +msgid "IDS_BR_HEADER_COMMON_NAME_C" +msgstr "Имя:" + +msgid "IDS_BR_HEADER_ORGANIZATIONAL_UNIT_C" +msgstr "Подразделение:" + +msgid "IDS_BR_HEADER_ORGANIZATION_C" +msgstr "Организация:" + +msgid "IDS_BR_HEADER_USER_AGENT" +msgstr "Агент пользователя" + +msgid "IDS_BR_OPT_LAST_VIEWED_PAGE_ATNT" +msgstr "Last Viewed Page" + +msgid "IDS_BR_OPT_PREFERENCES" +msgstr "Параметры" + +msgid "IDS_BR_POP_ACTICATION_ERR" +msgstr "Ошибка активации" + +msgid "IDS_BR_POP_ALREADY_RUNNING" +msgstr "Уже запущено" + +msgid "IDS_BR_POP_ERRORIMPLEMENTED" +msgstr "Не реализовано" + +msgid "IDS_BR_POP_HTTPERRAUTHFAILED" +msgstr "Сбой проверки подлинности" + +msgid "IDS_BR_POP_OVERWRITE_Q" +msgstr "Перезаписать?" + +msgid "IDS_BR_POP_URL" +msgstr "URL" + +msgid "IDS_BR_TAB_HISTORY" +msgstr "Журнал" + +msgid "IDS_BR_HEADER_DOWNLOAD_LIST" +msgstr "Список загрузки" + +msgid "IDS_BR_POP_ALREADYINSTALLED" +msgstr "Уже установлено" + +msgid "IDS_BR_POP_NOTIFYING" +msgstr "Уведомление..." + +msgid "IDS_BR_POP_NOTSUPPORT" +msgstr "Содержимое не поддерживается" + +msgid "IDS_BR_POP_ERROR_C_UNABLE_TO_RESOLVE_HOST_NAME" +msgstr "Ошибка: не удалось преобразовать имя узла" + +msgid "IDS_BR_POP_UNABLE_TO_REACH_PROXY" +msgstr "Невозможно связаться с прокси-сервером" + +msgid "IDS_BR_POP_NOSSLCERTI" +msgstr "Нет сертификата SSL" + +msgid "IDS_BR_BODY_FILE_SIZE_EXCEEDS_MAXIMUM_UPLOAD_LIMIT" +msgstr "Размер файла превышает лимит загрузки" + +msgid "IDS_BR_BODY_ENTER_NAME_C" +msgstr "Введите имя:" + +msgid "IDS_BR_SK_NEXT" +msgstr "Далее" + +msgid "IDS_BR_OPT_NEW_FOLDER" +msgstr "Новая папка" + +msgid "IDS_BR_SK3_ADD_TO_BOOKMARKS" +msgstr "Добавить к закладкам" + +msgid "IDS_BR_SK1_NEW_WINDOW" +msgstr "Новое окно" + +msgid "IDS_BR_BODY_URL" +msgstr "URL" + +msgid "IDS_BR_BODY_URL_C" +msgstr "URL:" + +msgid "IDS_BR_BODY_URL_NOT_AVAILABLE" +msgstr "URL-адрес недоступен" + +msgid "IDS_BR_BODY_URL_PS_NOT_AVAILABLE_IT_MIGHT_BE_DOWN_TEMPORARILY_OR_NO_LONGER_IN_USE" +msgstr "URL-адрес %s недоступен. Возможно, он временно не работает или больше не используется" + +msgid "IDS_BR_HEADER_FOLDER" +msgstr "Папка" + +msgid "IDS_BR_BODY_FOLDER_NAME" +msgstr "Имя папки" + +msgid "IDS_BR_BODY_FOLDER_NAME_ALREADY_IN_USE" +msgstr "Имя папки уже существует" + +msgid "IDS_BR_BODY_NO_TITLE" +msgstr "Нет названия" + +msgid "IDS_BR_HEADER_MULTI_WINDOW" +msgstr "Несколько окон" + +msgid "IDS_BR_BODY_NO_HISTORIES" +msgstr "Нет журналов" + +msgid "IDS_BR_BODY_ADD_TO_BOOKMARKS" +msgstr "Добавить в Закладки" + +msgid "IDS_BR_BODY_EDIT_BOOKMARK" +msgstr "Редактировать закладку" + +msgid "IDS_BR_BODY_FOLDER_NAME_C" +msgstr "Имя папки:" + +msgid "IDS_BR_OPT_SELECT_ALL" +msgstr "Выбрать все" + +msgid "IDS_BR_OPT_DOWNLOAD_MANAGER" +msgstr "Диспетчер загрузки" + +msgid "IDS_BR_OPT_ADD_RSS_FEED" +msgstr "Добавить RSS-новость" + +msgid "IDS_BR_OPT_ADD_RSS_FEEDS" +msgstr "Добавить RSS-каналы" + +msgid "IDS_BR_OPT_SETTINGS" +msgstr "Настройки" + +msgid "IDS_BR_POP_ENTER_URL" +msgstr "Введите URL" + +msgid "IDS_BR_BODY_AUTHPASSWORD" +msgstr "Пароль" + +msgid "IDS_BR_POP_INVALIDADDRESS" +msgstr "Неверный адрес" + +msgid "IDS_BR_POP_ALREADY_EXISTS_IN_DOWNLOAD_LIST" +msgstr "Уже существует в списке загрузки" + +msgid "IDS_BR_POP_ENTER_FOLDER_NAME" +msgstr "Введите имя папки" + +msgid "IDS_BR_POP_NO_PAGE" +msgstr "Нет страницы" + +msgid "IDS_BR_POP_NO_PAGES_BACKWARD" +msgstr "Нет предыдущих страниц" + +msgid "IDS_BR_POP_NO_PAGES_FORWARD" +msgstr "Нет последующих страниц" + +msgid "IDS_BR_POP_NO_PAGE_TO_RELOAD" +msgstr "Нет страницы для повторной загрузки" + +msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED" +msgstr "Требуется проверка подлинности" + +msgid "IDS_BR_POP_BOOKMARK_ALREADY_EXISTS" +msgstr "Закладка уже существует" + +msgid "IDS_BR_POP_FOLDER_NAME_ALREADY_EXISTS" +msgstr "Имя папки уже существует" + +msgid "IDS_BR_POP_UNABLE_TO_SAVE_OBJECT_NOT_ENOUGH_SPACE_IN_CACHE" +msgstr "Невозможно сохранить объект. Недостаточно пространства в кэше" + +msgid "IDS_BR_HEADER_SELECT_ITEMS" +msgstr "Выберите элементы" + +msgid "IDS_BR_HEADER_CERTIFICATE_INFO" +msgstr "Информация о сертификате" + +msgid "IDS_BR_OPT_SHARE_VIA_EMAIL" +msgstr "Отправить по электронной почте" + +msgid "IDS_BR_OPT_SHARE_VIA_MESSAGES" +msgstr "Отправить с помощью сообщения" + +msgid "IDS_BR_OPT_SHARE_VIA" +msgstr "Отправить через" + +msgid "IDS_BR_POP_UNABLE_TO_START_BROWSER" +msgstr "Не удается запустить браузер" + +msgid "IDS_BR_POP_NO_ADDRESS" +msgstr "Нет адреса" + +msgid "IDS_BR_POP_NEVER_SHOW_AGAIN" +msgstr "Больше не показывать" + +msgid "IDS_BR_POP_FILE_NAME_EMPTY" +msgstr "Не указано имя файла" + +msgid "IDS_BR_SK3_CREATE_FOLDER" +msgstr "Создать папку" + +msgid "IDS_BR_OPT_SELECTED" +msgstr "Выбранное" + +msgid "IDS_BR_OPT_SHARE" +msgstr "Отправить" + +msgid "IDS_BR_HEADER_RECENTLY_VISITED_PAGES" +msgstr "Недавно посещенные страницы" + +msgid "IDS_BR_OPT_DISPLAY" +msgstr "Дисплей" + +msgid "IDS_BR_BODY_FIT_TO_WIDTH" +msgstr "По ширине" + +msgid "IDS_BR_BODY_READABLE" +msgstr "Для чтения" + +msgid "IDS_BR_BODY_PRIVACY" +msgstr "Конфиденциальность" + +msgid "IDS_BR_BODY_COOKIES" +msgstr "Файлы Cookie" + +msgid "IDS_BR_BODY_COOKIESACCEPTALL" +msgstr "Принимать все" + +msgid "IDS_BR_BODY_COOKIESPROMPT" +msgstr "Спрашивать" + +msgid "IDS_BR_HEADER_COOKIES" +msgstr "Файлы Cookie" + +msgid "IDS_BR_BODY_ACCEPT_COOKIES" +msgstr "Разрешить cookies" + +msgid "IDS_BR_OPT_ACCEPT_COOKIES" +msgstr "Разрешить cookies" + +msgid "IDS_BR_BODY_ACCEPT_ALL" +msgstr "Принимать все" + +msgid "IDS_BR_BODY_REJECT_ALL" +msgstr "Отклонять все" + +msgid "IDS_BR_BODY_AUTO_SAVE_ID_PASSWORD" +msgstr "Автоматическое сохранение идентификатора и пароля" + +msgid "IDS_BR_BODY_ON" +msgstr "Включено" + +msgid "IDS_BR_BODY_OFF" +msgstr "Выключено" + +msgid "IDS_BR_BODY_DEFAULT_STORAGE" +msgstr "Хранилище по умолчанию" + +msgid "IDS_BR_BODY_SEARCH" +msgstr "Поиск" + +msgid "IDS_BR_BODY_SAVE_IMAGE" +msgstr "Сохранить картинку" + +msgid "IDS_BR_POP_LOW_BATTERY_UNABLE_TO_RUN_BROWSER" +msgstr "Аккумулятор разряжен. Невозможно запустить браузер" + +msgid "IDS_BR_BODY_FIND_WORD" +msgstr "Поиск слова" + +msgid "IDS_BR_OPT_ADD_TO_HOME_SCREEN" +msgstr "Добавить на главный экран" + +msgid "IDS_BR_OPT_ADD_TO_HOME_SCREEN_ABB" +msgstr "Добавить на главный экран" + +msgid "IDS_BR_BODY_MOST_VISITED_SITES" +msgstr "Часто посещаемые сайты" + +msgid "IDS_BR_OPT_SHARE_VIA_FACEBOOK" +msgstr "Отправить в Facebook" + +msgid "IDS_BR_OPT_SHARE_VIA_TWITTER" +msgstr "Отправить в Twitter" + +msgid "IDS_BR_SK3_CHANGE_VIEW" +msgstr "Изменить вид" + +msgid "IDS_BR_HEADER_SELECT_URLS" +msgstr "Выберите URL-адреса" + +msgid "IDS_BR_POP_THIS_SITE_IS_ATTEMPTING_TO_OPEN_POP_UP_WINDOW" +msgstr "Этот сайт пытается открыть всплывающее окно" + +msgid "IDS_BR_MBODY_BLOCK_POP_UP_WINDOWS" +msgstr "Блокировать всплыв. окна" + +msgid "IDS_BR_BODY_TEXT_READER" +msgstr "Текст" + +msgid "IDS_BR_OPT_COPY_IMAGE" +msgstr "Копировать изображение" + +msgid "IDS_BR_OPT_SAVE_IMAGE" +msgstr "Сохранить картинку" + +msgid "IDS_BR_BODY_PLAY" +msgstr "Воспроизвести" + +msgid "IDS_BR_OPT_SELECT" +msgstr "Выбрать" + +msgid "IDS_BR_OPT_NAVIGATE_GO_BACKWARD" +msgstr "Назад" + +msgid "IDS_BR_OPT_NAVIGATE_GO_FORWARD" +msgstr "Вперед" + +msgid "IDS_BR_OPT_STOP" +msgstr "Стоп" + +msgid "IDS_BR_OPT_RELOAD" +msgstr "Обновить" + +msgid "IDS_BR_OPT_PASTE" +msgstr "Вставить" + +msgid "IDS_BR_BUTTON_MORE" +msgstr "Еще" + +msgid "IDS_BR_POP_FAIL" +msgstr "Сбой" + +msgid "IDS_BR_BODY_OPEN_IN_NEW_WINDOW" +msgstr "Открыть в новом окне" + +msgid "IDS_BR_OPT_VIEW_DOWNLOAD_LIST" +msgstr "Просмотр списка загрузок" + +msgid "IDS_BR_BODY_COPY_URL" +msgstr "Копировать URL" + +msgid "IDS_BR_BODY_COPY_URL_TO" +msgstr "Копировать URL" + +msgid "IDS_BR_BODY_VIEW_IMAGE" +msgstr "Просмотр картинки" + +msgid "IDS_BR_BODY_PRIVACY_SETTINGS" +msgstr "Настройки конфиденциальности" + +msgid "IDS_BR_BODY_CLEAR_CACHE" +msgstr "Очистить кэш" + +msgid "IDS_BR_BODY_CLEAR_HISTORY" +msgstr "Очистить журнал" + +msgid "IDS_BR_BODY_ENABLE_PLUG_INS" +msgstr "Разрешить плагины" + +msgid "IDS_BR_BODY_SELECT_SEARCH_ENGINE" +msgstr "Выбор поисковой системы" + +msgid "IDS_BR_BODY_DELETE_SAVED_ID_PASSWORD" +msgstr "Удалить логин/пароль" + +msgid "IDS_BR_BODY_CLEAR_ALL_COOKIE_DATA" +msgstr "Удалить cookies" + +msgid "IDS_BR_BODY_UP" +msgstr "Вверх" + +msgid "IDS_BR_BODY_FONT_SIZE" +msgstr "Размер шрифта" + +msgid "IDS_BR_POP_DELETED" +msgstr "Удалено" + +msgid "IDS_BR_BODY_DEFAULT_VIEW" +msgstr "По умолчанию" + +msgid "IDS_BR_MBODY_PAGE_CONTENT_SETTINGS" +msgstr "Параметры содерж.страницы" + +msgid "IDS_BR_POP_CASE_SENSITIVE" +msgstr "С учетом регистра" + +msgid "IDS_BR_BODY_PLUG_IN" +msgstr "Дополнительный модуль" + +msgid "IDS_BR_OPT_PLUGINS_LIST" +msgstr "Список подключаемых модулей" + +msgid "IDS_BR_HEADER_LOCAL_STORAGE" +msgstr "Локальное хранилище" + +msgid "IDS_BR_BODY_DELETE_BROWSING_DATA" +msgstr "Удалить данные браузера" + +msgid "IDS_BR_BODY_LOADING_ING" +msgstr "Загрузка..." + +msgid "IDS_BR_HEADER_LOADING_ING" +msgstr "Загрузка..." + +msgid "IDS_BR_HEADER_ENTERURL" +msgstr "Введите URL-адрес" + +msgid "IDS_BR_OPT_LOCK" +msgstr "Заблокировать" + +msgid "IDS_BR_OPT_UNLOCK" +msgstr "Разблокировать" + +msgid "IDS_BR_BODY_MODIFY" +msgstr "Изменить" + +msgid "IDS_BR_SK_PAGE_UP" +msgstr "Вверх" + +msgid "IDS_BR_SK_PAGE_DOWN" +msgstr "Вниз" + +msgid "IDS_BR_BODY_DEVELOPER_MODE" +msgstr "Режим разработчика" + +msgid "IDS_BR_BODY_EMPTY" +msgstr "Пусто" + +msgid "IDS_BR_BODY_CERTIFICATES" +msgstr "Сертификаты" + +msgid "IDS_BR_BODY_BOOKMARKS" +msgstr "Закладки" + +msgid "IDS_BR_BODY_ENTER_NAME" +msgstr "Введите имя" + +msgid "IDS_BR_BODY_NAME" +msgstr "Имя" + +msgid "IDS_BR_OPT_SEND_VIA_EMAIL" +msgstr "Отправить по E-mail" + +msgid "IDS_BR_OPT_SEND_VIA_MESSAGE" +msgstr "Отправить в сообщении" + +msgid "IDS_BR_BODY_SETTINGS" +msgstr "Настройки" + +msgid "IDS_BR_BODY_AUTHUSERNAME" +msgstr "Имя пользователя" + +msgid "IDS_BR_POP_ALREADY_EXISTS" +msgstr "Уже существует" + +msgid "IDS_BR_POP_SAVED" +msgstr "Соxранено" + +msgid "IDS_BR_POP_NOT_ENOUGH_MEMORY" +msgstr "Недостаточно памяти" + +msgid "IDS_BR_POP_NETWORK_ERROR" +msgstr "Ошибка сети" + +msgid "IDS_BR_BODY_ALWAYS_ASK" +msgstr "Всегда спрашивать" + +msgid "IDS_BR_BODY_MEMORY_CARD" +msgstr "Карта памяти" + +msgid "IDS_BR_BODY_PHONE" +msgstr "Телефон" + +msgid "IDS_BR_BODY_NO_ACCOUNTS_ABB" +msgstr "Нет учетных записей" + +msgid "IDS_BR_HEADER_ERROR_PAGE" +msgstr "Страница ошибки" + +msgid "IDS_BR_BODY_WEB_PAGE_TEMPORARILY_NOT_AVAILABLE" +msgstr "Веб-страница временно недоступна" + +msgid "IDS_BR_BODY_WEB_PAGE_NOT_AVAILABLE" +msgstr "Веб-страница недоступна" + +msgid "IDS_BR_BODY_FAILED_TO_LOAD_FRAMES" +msgstr "Сбой загрузки фреймов" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_1" +msgstr "При получении веб-страницы %s произошла следующая ошибка." + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_2" +msgstr "Невозможно получить веб-страницу. (Возможно, она временно не работает или перемещена на новый URL)" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_3" +msgstr "Ниже указана наиболее вероятная причина" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_4" +msgstr "Сетевое подключение установлено с ошибками" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_5" +msgstr "Проверьте URL веб-страницы" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_6" +msgstr "Перезагрузите веб-страницу позднее" + +msgid "IDS_BR_OPT_BOOKMARK" +msgstr "Закладка" + +msgid "IDS_BR_BODY_TITLE" +msgstr "Название" + +msgid "IDS_BR_BODY_ENTER_TITLE" +msgstr "Введите название" + +msgid "IDS_BR_OPT_FOLDERS" +msgstr "Папки" + +msgid "IDS_BR_OPT_ALLOW" +msgstr "Разрешить" + +msgid "IDS_BR_POP_REFUSE" +msgstr "Отказать" + +msgid "IDS_BR_POP_SECURITY_ERROR_C_UNTRUSTED_SERVER_CERTIFICATE" +msgstr "Ошибка защиты: не имеющий доверия сертификат сервера" + +msgid "IDS_BR_POP_PD_ITEMS_SELECTED" +msgstr "Выбрано элементов: %d" + +msgid "IDS_BR_POP_1_ITEM_SELECTED" +msgstr "Выбран 1 элемент" + diff --git a/po/tr_TR.po b/po/tr_TR.po new file mode 100755 index 00000000..892eb885 --- /dev/null +++ b/po/tr_TR.po @@ -0,0 +1,621 @@ +msgid "IDS_BR_POP_INSTALLATION_FAILED" +msgstr "Yükleme başarısız" + +msgid "IDS_BR_BODY_NOTIFYING_ING" +msgstr "Bildiriliyor..." + +msgid "IDS_BR_BODY_PROCESSING_ING" +msgstr "Uygulanıyor..." + +msgid "IDS_BR_BODY_PROCESSING_COMPLETED" +msgstr "İşlem tamamlandı" + +msgid "IDS_BR_SK_RETRY" +msgstr "Y.dene" + +msgid "IDS_BR_HEADER_DOWNLOAD_MANAGER" +msgstr "İndirme Yöneticisi" + +msgid "IDS_BR_POP_INVALIDDESCRIPTOR" +msgstr "Geçersiz Tanımlayıcı" + +msgid "IDS_BR_POP_UNABLE_TO_OPEN_FILE" +msgstr "Dosyayı açamıyor" + +msgid "IDS_BR_POP_DOWNLOAD_Q" +msgstr "Yüklensin mi?" + +msgid "IDS_BR_OPT_DELETE_SELECTED" +msgstr "Seçili" + +msgid "IDS_BR_POP_DOWNLOAD_CANCELLED" +msgstr "Yükleme iptal edildi" + +msgid "IDS_BR_BODY_CONTINUE_FROM_LAST_PAGE" +msgstr "Son syfdn devam et" + +msgid "IDS_BR_BODY_PAGE" +msgstr "Sayfa" + +msgid "IDS_BR_OPT_DICTIONARY" +msgstr "Sözlük" + +msgid "IDS_BR_BODY_ABOUT_BROWSER" +msgstr "Tarayıcı hakkında" + +msgid "IDS_BR_BODY_BROWSER_TYPE" +msgstr "Tür" + +msgid "IDS_BR_BODY_CERTIFICATE_ISSUER" +msgstr " Veren" + +msgid "IDS_BR_BODY_DISPLAY_IMAGES" +msgstr "Resimleri göster" + +msgid "IDS_BR_BODY_DOWNLOAD" +msgstr "İndir" + +msgid "IDS_BR_BODY_ENTER_URL" +msgstr "URL gir" + +msgid "IDS_BR_BODY_FOLDER" +msgstr "Klasör" + +msgid "IDS_BR_BODY_HOMEPAGE" +msgstr "Ana sayfa" + +msgid "IDS_BR_BODY_LANDSCAPE_VIEW" +msgstr "Yatay görünüm" + +msgid "IDS_BR_BODY_NO_BOOKMARKS" +msgstr "Yer imi yok" + +msgid "IDS_BR_BODY_NO_RESULTS_FOUND" +msgstr "Sonuç bulunamadı" + +msgid "IDS_BR_BODY_OPTIONAL" +msgstr "İsteğe bağlı" + +msgid "IDS_BR_BODY_RSS" +msgstr "RSS" + +msgid "IDS_BR_BODY_RUN_FLASH" +msgstr "Flash’ı Yürüt" + +msgid "IDS_BR_BODY_RUN_JAVASCRIPT" +msgstr "JavaScript'i çalıştır" + +msgid "IDS_BR_HEADER_COMMON_NAME_C" +msgstr "Ortak isim:" + +msgid "IDS_BR_HEADER_ORGANIZATIONAL_UNIT_C" +msgstr "Organizasyonel birim:" + +msgid "IDS_BR_HEADER_ORGANIZATION_C" +msgstr "Organizasyon:" + +msgid "IDS_BR_HEADER_USER_AGENT" +msgstr "User Agent" + +msgid "IDS_BR_OPT_LAST_VIEWED_PAGE_ATNT" +msgstr "Last Viewed Page" + +msgid "IDS_BR_OPT_PREFERENCES" +msgstr "Tercihler" + +msgid "IDS_BR_POP_ACTICATION_ERR" +msgstr "Etkinleştirme hatası" + +msgid "IDS_BR_POP_ALREADY_RUNNING" +msgstr "Zaten çalışıyor" + +msgid "IDS_BR_POP_ERRORIMPLEMENTED" +msgstr "Uygulanmadı" + +msgid "IDS_BR_POP_HTTPERRAUTHFAILED" +msgstr "Onay başarısız" + +msgid "IDS_BR_POP_OVERWRITE_Q" +msgstr "Üstüne yazdırılsın mı?" + +msgid "IDS_BR_POP_URL" +msgstr "URL" + +msgid "IDS_BR_TAB_HISTORY" +msgstr "Geçmiş" + +msgid "IDS_BR_HEADER_DOWNLOAD_LIST" +msgstr "İndirme listesi" + +msgid "IDS_BR_POP_ALREADYINSTALLED" +msgstr "Zaten yüklü" + +msgid "IDS_BR_POP_NOTIFYING" +msgstr "Bildiriliyor..." + +msgid "IDS_BR_POP_NOTSUPPORT" +msgstr "Desteklenmeyen içerik" + +msgid "IDS_BR_POP_ERROR_C_UNABLE_TO_RESOLVE_HOST_NAME" +msgstr "Hata: ana bilgisayar adı çözümlenemiyor" + +msgid "IDS_BR_POP_UNABLE_TO_REACH_PROXY" +msgstr "Proxy'ye ulaşılamıyor" + +msgid "IDS_BR_POP_NOSSLCERTI" +msgstr "SSL serttifikası yok" + +msgid "IDS_BR_BODY_FILE_SIZE_EXCEEDS_MAXIMUM_UPLOAD_LIMIT" +msgstr "Dosya boyutu maksimum yükleme sınırı aşıyor" + +msgid "IDS_BR_BODY_ENTER_NAME_C" +msgstr "Adı girin:" + +msgid "IDS_BR_SK_NEXT" +msgstr "İleri" + +msgid "IDS_BR_OPT_NEW_FOLDER" +msgstr "Yeni klasör" + +msgid "IDS_BR_SK3_ADD_TO_BOOKMARKS" +msgstr "Sık kullan. ekle" + +msgid "IDS_BR_SK1_NEW_WINDOW" +msgstr "Yeni pencere" + +msgid "IDS_BR_BODY_URL" +msgstr "URL" + +msgid "IDS_BR_BODY_URL_C" +msgstr "URL:" + +msgid "IDS_BR_BODY_URL_NOT_AVAILABLE" +msgstr "URL'ye erişilemiyor" + +msgid "IDS_BR_BODY_URL_PS_NOT_AVAILABLE_IT_MIGHT_BE_DOWN_TEMPORARILY_OR_NO_LONGER_IN_USE" +msgstr "URL %s erişilemiyor. Geçici olarak çalışmıyor veya artık kullanımda olmayabilir" + +msgid "IDS_BR_HEADER_FOLDER" +msgstr "Klasör" + +msgid "IDS_BR_BODY_FOLDER_NAME" +msgstr "Klasör adı" + +msgid "IDS_BR_BODY_FOLDER_NAME_ALREADY_IN_USE" +msgstr "Klasör adı zaten kullanılıyor" + +msgid "IDS_BR_BODY_NO_TITLE" +msgstr "Başlık yok" + +msgid "IDS_BR_HEADER_MULTI_WINDOW" +msgstr "Çoklu pencere" + +msgid "IDS_BR_BODY_NO_HISTORIES" +msgstr "Geçmiş yok" + +msgid "IDS_BR_BODY_ADD_TO_BOOKMARKS" +msgstr "Yer imlerine ekle" + +msgid "IDS_BR_BODY_EDIT_BOOKMARK" +msgstr "Yer imini düzelt" + +msgid "IDS_BR_BODY_FOLDER_NAME_C" +msgstr "Klasör adı:" + +msgid "IDS_BR_OPT_SELECT_ALL" +msgstr "Hepsini seç" + +msgid "IDS_BR_OPT_DOWNLOAD_MANAGER" +msgstr "İndirme Yöneticisi" + +msgid "IDS_BR_OPT_ADD_RSS_FEED" +msgstr "RSS kaynağı ekle" + +msgid "IDS_BR_OPT_ADD_RSS_FEEDS" +msgstr "RSS beslemesi ekle" + +msgid "IDS_BR_OPT_SETTINGS" +msgstr "Ayarlar" + +msgid "IDS_BR_POP_ENTER_URL" +msgstr "URL gir" + +msgid "IDS_BR_BODY_AUTHPASSWORD" +msgstr "Şifre" + +msgid "IDS_BR_POP_INVALIDADDRESS" +msgstr "Geçersiz adres" + +msgid "IDS_BR_POP_ALREADY_EXISTS_IN_DOWNLOAD_LIST" +msgstr "Zaten İndirme listesinde var" + +msgid "IDS_BR_POP_ENTER_FOLDER_NAME" +msgstr "Klasör adını girin" + +msgid "IDS_BR_POP_NO_PAGE" +msgstr "Sayfa yok" + +msgid "IDS_BR_POP_NO_PAGES_BACKWARD" +msgstr "Geriye doğru sayfa yok" + +msgid "IDS_BR_POP_NO_PAGES_FORWARD" +msgstr "İleriye doğru sayfa yok" + +msgid "IDS_BR_POP_NO_PAGE_TO_RELOAD" +msgstr "Yeniden yüklenecek sayfa yok" + +msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED" +msgstr "Kimlik denetimi gerekli" + +msgid "IDS_BR_POP_BOOKMARK_ALREADY_EXISTS" +msgstr "Yer imi zaten mevcut" + +msgid "IDS_BR_POP_FOLDER_NAME_ALREADY_EXISTS" +msgstr "Dosya adı zaten var" + +msgid "IDS_BR_POP_UNABLE_TO_SAVE_OBJECT_NOT_ENOUGH_SPACE_IN_CACHE" +msgstr "Nesne kaydedilemiyor. Ön bellekte yeterli alan yok" + +msgid "IDS_BR_HEADER_SELECT_ITEMS" +msgstr "Öğeleri seç" + +msgid "IDS_BR_HEADER_CERTIFICATE_INFO" +msgstr "Sertifika bilgisi" + +msgid "IDS_BR_OPT_SHARE_VIA_EMAIL" +msgstr "E-posta ile paylaş" + +msgid "IDS_BR_OPT_SHARE_VIA_MESSAGES" +msgstr "Mesajlar ile paylaş" + +msgid "IDS_BR_OPT_SHARE_VIA" +msgstr "Şununla paylaş" + +msgid "IDS_BR_POP_UNABLE_TO_START_BROWSER" +msgstr "Tarayıcı başlatılamıyor" + +msgid "IDS_BR_POP_NO_ADDRESS" +msgstr "Adres yok" + +msgid "IDS_BR_POP_NEVER_SHOW_AGAIN" +msgstr "Bir daha gösterme" + +msgid "IDS_BR_POP_FILE_NAME_EMPTY" +msgstr "Dosya adı yok" + +msgid "IDS_BR_SK3_CREATE_FOLDER" +msgstr "Klasör oluştur" + +msgid "IDS_BR_OPT_SELECTED" +msgstr "Seçili" + +msgid "IDS_BR_OPT_SHARE" +msgstr "Paylaşıma aç" + +msgid "IDS_BR_HEADER_RECENTLY_VISITED_PAGES" +msgstr "Yeni kapatılan sayfalar" + +msgid "IDS_BR_OPT_DISPLAY" +msgstr "Ekran" + +msgid "IDS_BR_BODY_FIT_TO_WIDTH" +msgstr "Genişliğe sığdır" + +msgid "IDS_BR_BODY_READABLE" +msgstr "Okunabilir" + +msgid "IDS_BR_BODY_PRIVACY" +msgstr "Gizlilik" + +msgid "IDS_BR_BODY_COOKIES" +msgstr "Tanımlama bilgileri" + +msgid "IDS_BR_BODY_COOKIESACCEPTALL" +msgstr "Tümünü kabul et" + +msgid "IDS_BR_BODY_COOKIESPROMPT" +msgstr "Her zaman sor" + +msgid "IDS_BR_HEADER_COOKIES" +msgstr "Tanımlama bilgileri" + +msgid "IDS_BR_BODY_ACCEPT_COOKIES" +msgstr "Çerezleri kabul et" + +msgid "IDS_BR_OPT_ACCEPT_COOKIES" +msgstr "Çerezleri kabul et" + +msgid "IDS_BR_BODY_ACCEPT_ALL" +msgstr "Tümünü kabul et" + +msgid "IDS_BR_BODY_REJECT_ALL" +msgstr "Tümünü reddet" + +msgid "IDS_BR_BODY_AUTO_SAVE_ID_PASSWORD" +msgstr "ID/parolayı otomatik kaydet" + +msgid "IDS_BR_BODY_ON" +msgstr "Açık" + +msgid "IDS_BR_BODY_OFF" +msgstr "Kapalı" + +msgid "IDS_BR_BODY_DEFAULT_STORAGE" +msgstr "Varsayılan depolama" + +msgid "IDS_BR_BODY_SEARCH" +msgstr "Akıllı Arama" + +msgid "IDS_BR_BODY_SAVE_IMAGE" +msgstr "Resmi kaydet" + +msgid "IDS_BR_POP_LOW_BATTERY_UNABLE_TO_RUN_BROWSER" +msgstr "Düşük pil. Tarayıcı başlatılamıyor" + +msgid "IDS_BR_BODY_FIND_WORD" +msgstr "Kelime bul" + +msgid "IDS_BR_OPT_ADD_TO_HOME_SCREEN" +msgstr "Ana ekrana ekle" + +msgid "IDS_BR_OPT_ADD_TO_HOME_SCREEN_ABB" +msgstr "Ana ekrana ekle" + +msgid "IDS_BR_BODY_MOST_VISITED_SITES" +msgstr "En çok ziyaret edilen siteler" + +msgid "IDS_BR_OPT_SHARE_VIA_FACEBOOK" +msgstr "Facebook ile paylaş" + +msgid "IDS_BR_OPT_SHARE_VIA_TWITTER" +msgstr "Twitter ile paylaş" + +msgid "IDS_BR_SK3_CHANGE_VIEW" +msgstr "Görünümü değiştir" + +msgid "IDS_BR_HEADER_SELECT_URLS" +msgstr "URL'leri seç" + +msgid "IDS_BR_POP_THIS_SITE_IS_ATTEMPTING_TO_OPEN_POP_UP_WINDOW" +msgstr "Bu site bir açılır pencere açmaya çalışıyor" + +msgid "IDS_BR_MBODY_BLOCK_POP_UP_WINDOWS" +msgstr "Açılır pencerelri engelle" + +msgid "IDS_BR_BODY_TEXT_READER" +msgstr "Metin okuyucu" + +msgid "IDS_BR_OPT_COPY_IMAGE" +msgstr "Resmi kopyala" + +msgid "IDS_BR_OPT_SAVE_IMAGE" +msgstr "Resmi kaydet" + +msgid "IDS_BR_BODY_PLAY" +msgstr "Çal" + +msgid "IDS_BR_OPT_SELECT" +msgstr "Seç" + +msgid "IDS_BR_OPT_NAVIGATE_GO_BACKWARD" +msgstr "Geri git" + +msgid "IDS_BR_OPT_NAVIGATE_GO_FORWARD" +msgstr "İleri git" + +msgid "IDS_BR_OPT_STOP" +msgstr "Durdur" + +msgid "IDS_BR_OPT_RELOAD" +msgstr "Yeniden yükle" + +msgid "IDS_BR_OPT_PASTE" +msgstr "Yapıştır" + +msgid "IDS_BR_BUTTON_MORE" +msgstr "Diğer" + +msgid "IDS_BR_POP_FAIL" +msgstr "Başarısız" + +msgid "IDS_BR_BODY_OPEN_IN_NEW_WINDOW" +msgstr "Yeni pencerede aç" + +msgid "IDS_BR_OPT_VIEW_DOWNLOAD_LIST" +msgstr "İndirme listesini göster" + +msgid "IDS_BR_BODY_COPY_URL" +msgstr "URL kopyala" + +msgid "IDS_BR_BODY_COPY_URL_TO" +msgstr "URL kopyala" + +msgid "IDS_BR_BODY_VIEW_IMAGE" +msgstr "Resmi görüntüle" + +msgid "IDS_BR_BODY_PRIVACY_SETTINGS" +msgstr "Gizlilik ayarları" + +msgid "IDS_BR_BODY_CLEAR_CACHE" +msgstr "Önbelleği sil" + +msgid "IDS_BR_BODY_CLEAR_HISTORY" +msgstr "Geçmişi sil" + +msgid "IDS_BR_BODY_ENABLE_PLUG_INS" +msgstr "Eklentileri etkinleştir" + +msgid "IDS_BR_BODY_SELECT_SEARCH_ENGINE" +msgstr "Arama motoru seçin" + +msgid "IDS_BR_BODY_DELETE_SAVED_ID_PASSWORD" +msgstr "Kayıtlı kullanıcı adı/şifre sil?" + +msgid "IDS_BR_BODY_CLEAR_ALL_COOKIE_DATA" +msgstr "Tüm çerez verilerini sil" + +msgid "IDS_BR_BODY_UP" +msgstr "Yukarı" + +msgid "IDS_BR_BODY_FONT_SIZE" +msgstr "Yazı tipi boyutu" + +msgid "IDS_BR_POP_DELETED" +msgstr "Silindi" + +msgid "IDS_BR_BODY_DEFAULT_VIEW" +msgstr "Varsayılan görünüm" + +msgid "IDS_BR_MBODY_PAGE_CONTENT_SETTINGS" +msgstr "Sayfa içeriği ayarları" + +msgid "IDS_BR_POP_CASE_SENSITIVE" +msgstr "Büyük-küçük harf duyarlı" + +msgid "IDS_BR_BODY_PLUG_IN" +msgstr "Takın" + +msgid "IDS_BR_OPT_PLUGINS_LIST" +msgstr "Eklentiler listesi" + +msgid "IDS_BR_HEADER_LOCAL_STORAGE" +msgstr "Yerel depolama" + +msgid "IDS_BR_BODY_DELETE_BROWSING_DATA" +msgstr "Taranan veriyi sil" + +msgid "IDS_BR_BODY_LOADING_ING" +msgstr "Yükleniyor..." + +msgid "IDS_BR_HEADER_LOADING_ING" +msgstr "Yükleniyor..." + +msgid "IDS_BR_HEADER_ENTERURL" +msgstr "URL gir" + +msgid "IDS_BR_OPT_LOCK" +msgstr "Kilitle" + +msgid "IDS_BR_OPT_UNLOCK" +msgstr "Kilit aç" + +msgid "IDS_BR_BODY_MODIFY" +msgstr "Değiştir" + +msgid "IDS_BR_SK_PAGE_UP" +msgstr "Sayfa yukarı" + +msgid "IDS_BR_SK_PAGE_DOWN" +msgstr "Sayfa aşağı" + +msgid "IDS_BR_BODY_DEVELOPER_MODE" +msgstr "Geliştirici modu" + +msgid "IDS_BR_BODY_EMPTY" +msgstr "Boş" + +msgid "IDS_BR_BODY_CERTIFICATES" +msgstr "Sertifikalar" + +msgid "IDS_BR_BODY_BOOKMARKS" +msgstr "Yer imleri" + +msgid "IDS_BR_BODY_ENTER_NAME" +msgstr "İsim girin" + +msgid "IDS_BR_BODY_NAME" +msgstr "İsim" + +msgid "IDS_BR_OPT_SEND_VIA_EMAIL" +msgstr "E-posta ile gönder" + +msgid "IDS_BR_OPT_SEND_VIA_MESSAGE" +msgstr "Mesaj ile gönder" + +msgid "IDS_BR_BODY_SETTINGS" +msgstr "Ayarlar" + +msgid "IDS_BR_BODY_AUTHUSERNAME" +msgstr "Kullanıcı adı" + +msgid "IDS_BR_POP_ALREADY_EXISTS" +msgstr "Zaten var" + +msgid "IDS_BR_POP_SAVED" +msgstr "Kaydedildi" + +msgid "IDS_BR_POP_NOT_ENOUGH_MEMORY" +msgstr "Yeterli hafıza yok" + +msgid "IDS_BR_POP_NETWORK_ERROR" +msgstr "Şebeke hatası" + +msgid "IDS_BR_BODY_ALWAYS_ASK" +msgstr "Her zaman sor" + +msgid "IDS_BR_BODY_MEMORY_CARD" +msgstr "Hafıza kartı" + +msgid "IDS_BR_BODY_PHONE" +msgstr "Telefon" + +msgid "IDS_BR_BODY_NO_ACCOUNTS_ABB" +msgstr "Hesap yok" + +msgid "IDS_BR_HEADER_ERROR_PAGE" +msgstr "Hata sayfası" + +msgid "IDS_BR_BODY_WEB_PAGE_TEMPORARILY_NOT_AVAILABLE" +msgstr "Web sayfası geçici olarak kullanılamıyor" + +msgid "IDS_BR_BODY_WEB_PAGE_NOT_AVAILABLE" +msgstr "Web sayfası kullanılamıyor" + +msgid "IDS_BR_BODY_FAILED_TO_LOAD_FRAMES" +msgstr "Çerçeveler yüklenemedi" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_1" +msgstr "Web sayfası %s alınırken, aşağıdaki hata oluştu." + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_2" +msgstr "Web sayfası alınamıyor. (Web sayfası geçici olarak çökmüş veya yeni URL'ye taşınmış olabilir)" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_3" +msgstr "En muhtemel neden aşağıda verilmiştir" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_4" +msgstr "Ağ bağlantısı normal olarak kurulamadı" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_5" +msgstr "Web sayfası URL'sini kontrol edin" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_6" +msgstr "Web sayfasını daha sonra tekrar yükle" + +msgid "IDS_BR_OPT_BOOKMARK" +msgstr "Yer imi" + +msgid "IDS_BR_BODY_TITLE" +msgstr "Başlık" + +msgid "IDS_BR_BODY_ENTER_TITLE" +msgstr "Başlık gir" + +msgid "IDS_BR_OPT_FOLDERS" +msgstr "Klasörler" + +msgid "IDS_BR_OPT_ALLOW" +msgstr "İzin ver" + +msgid "IDS_BR_POP_REFUSE" +msgstr "Reddet" + +msgid "IDS_BR_POP_SECURITY_ERROR_C_UNTRUSTED_SERVER_CERTIFICATE" +msgstr "Güvenlik Hatası: Güvenilmez sunucu sertifikası" + +msgid "IDS_BR_POP_PD_ITEMS_SELECTED" +msgstr "%d öğe seçildi" + +msgid "IDS_BR_POP_1_ITEM_SELECTED" +msgstr "1 öğe seçildi" + diff --git a/po/update-po.sh b/po/update-po.sh new file mode 100755 index 00000000..d12557ca --- /dev/null +++ b/po/update-po.sh @@ -0,0 +1,57 @@ +#!/bin/sh + +PACKAGE=browser +SRCROOT=.. +POTFILES=POTFILES.in + +#ALL_LINGUAS= am az be ca cs da de_DE el_GR en es_ES et fi fr_FR hr hu it_IT ja_JP ko_KR lv mk ml ms nb ne nl_NL pa pl pt_PT pt_BR ru_RU rw sk sl sr sr@Latn sv ta tr_TR uk vi zh_CN zh_TW +ALL_LINGUAS="en ja ko zh_CN" + +XGETTEXT=/usr/bin/xgettext +MSGMERGE=/usr/bin/msgmerge + +echo -n "Make ${PACKAGE}.pot " +if [ ! -e $POTFILES ] ; then + echo "$POTFILES not found" + exit 1 +fi + +$XGETTEXT --default-domain=${PACKAGE} --directory=${SRCROOT} \ + --add-comments --keyword=_ --keyword=N_ --files-from=$POTFILES \ +&& test ! -f ${PACKAGE}.po \ + || (rm -f ${PACKAGE}.pot && mv ${PACKAGE}.po ${PACKAGE}.pot) + +if [ $? -ne 0 ]; then + echo "error" + exit 1 +else + echo "done" +fi + +for LANG in $ALL_LINGUAS; do + echo "$LANG : " + + if [ ! -e $LANG.po ] ; then + sed 's/CHARSET/UTF-8/g' ${PACKAGE}.pot > ${LANG}.po + echo "${LANG}.po created" + else + if $MSGMERGE ${LANG}.po ${PACKAGE}.pot -o ${LANG}.new.po ; then + if cmp ${LANG}.po ${LANG}.new.po > /dev/null 2>&1; then + rm -f ${LANG}.new.po + else + if mv -f ${LANG}.new.po ${LANG}.po; then + echo "" + else + echo "msgmerge for $LANG.po failed: cannot move $LANG.new.po to $LANG.po" 1>&2 + rm -f ${LANG}.new.po + exit 1 + fi + fi + else + echo "msgmerge for $LANG failed!" + rm -f ${LANG}.new.po + fi + fi + echo "" +done + diff --git a/po/zh_CN.po b/po/zh_CN.po new file mode 100755 index 00000000..f3f58422 --- /dev/null +++ b/po/zh_CN.po @@ -0,0 +1,621 @@ +msgid "IDS_BR_POP_INSTALLATION_FAILED" +msgstr "安装失败" + +msgid "IDS_BR_BODY_NOTIFYING_ING" +msgstr "通知中..." + +msgid "IDS_BR_BODY_PROCESSING_ING" +msgstr "处理中..." + +msgid "IDS_BR_BODY_PROCESSING_COMPLETED" +msgstr "处理完成" + +msgid "IDS_BR_SK_RETRY" +msgstr "重试" + +msgid "IDS_BR_HEADER_DOWNLOAD_MANAGER" +msgstr "下载管理器" + +msgid "IDS_BR_POP_INVALIDDESCRIPTOR" +msgstr "描述符无效" + +msgid "IDS_BR_POP_UNABLE_TO_OPEN_FILE" +msgstr "无法打开文件" + +msgid "IDS_BR_POP_DOWNLOAD_Q" +msgstr "下载?" + +msgid "IDS_BR_OPT_DELETE_SELECTED" +msgstr "已选定" + +msgid "IDS_BR_POP_DOWNLOAD_CANCELLED" +msgstr "已取消下载" + +msgid "IDS_BR_BODY_CONTINUE_FROM_LAST_PAGE" +msgstr "从最后一页继续" + +msgid "IDS_BR_BODY_PAGE" +msgstr "页面" + +msgid "IDS_BR_OPT_DICTIONARY" +msgstr "字典" + +msgid "IDS_BR_BODY_ABOUT_BROWSER" +msgstr "关于浏览器" + +msgid "IDS_BR_BODY_BROWSER_TYPE" +msgstr "类型" + +msgid "IDS_BR_BODY_CERTIFICATE_ISSUER" +msgstr "发行者" + +msgid "IDS_BR_BODY_DISPLAY_IMAGES" +msgstr "显示图片" + +msgid "IDS_BR_BODY_DOWNLOAD" +msgstr "下载" + +msgid "IDS_BR_BODY_ENTER_URL" +msgstr "输入网址" + +msgid "IDS_BR_BODY_FOLDER" +msgstr "文件夹" + +msgid "IDS_BR_BODY_HOMEPAGE" +msgstr "主页" + +msgid "IDS_BR_BODY_LANDSCAPE_VIEW" +msgstr "横向显示" + +msgid "IDS_BR_BODY_NO_BOOKMARKS" +msgstr "无书签" + +msgid "IDS_BR_BODY_NO_RESULTS_FOUND" +msgstr "未找到结果" + +msgid "IDS_BR_BODY_OPTIONAL" +msgstr "可选的" + +msgid "IDS_BR_BODY_RSS" +msgstr "RSS" + +msgid "IDS_BR_BODY_RUN_FLASH" +msgstr "运行 Flash" + +msgid "IDS_BR_BODY_RUN_JAVASCRIPT" +msgstr "运行 Java 脚本" + +msgid "IDS_BR_HEADER_COMMON_NAME_C" +msgstr "公用名:" + +msgid "IDS_BR_HEADER_ORGANIZATIONAL_UNIT_C" +msgstr "组织单位:" + +msgid "IDS_BR_HEADER_ORGANIZATION_C" +msgstr "组织:" + +msgid "IDS_BR_HEADER_USER_AGENT" +msgstr "WAP UA" + +msgid "IDS_BR_OPT_LAST_VIEWED_PAGE_ATNT" +msgstr "Last Viewed Page" + +msgid "IDS_BR_OPT_PREFERENCES" +msgstr "参数选择" + +msgid "IDS_BR_POP_ACTICATION_ERR" +msgstr "激活失败" + +msgid "IDS_BR_POP_ALREADY_RUNNING" +msgstr "已运行..." + +msgid "IDS_BR_POP_ERRORIMPLEMENTED" +msgstr "不能执行" + +msgid "IDS_BR_POP_HTTPERRAUTHFAILED" +msgstr "验证失败" + +msgid "IDS_BR_POP_OVERWRITE_Q" +msgstr "覆盖?" + +msgid "IDS_BR_POP_URL" +msgstr "网址" + +msgid "IDS_BR_TAB_HISTORY" +msgstr "历史记录" + +msgid "IDS_BR_HEADER_DOWNLOAD_LIST" +msgstr "下载列表" + +msgid "IDS_BR_POP_ALREADYINSTALLED" +msgstr "已经安装" + +msgid "IDS_BR_POP_NOTIFYING" +msgstr "通知中..." + +msgid "IDS_BR_POP_NOTSUPPORT" +msgstr "不支持的内容" + +msgid "IDS_BR_POP_ERROR_C_UNABLE_TO_RESOLVE_HOST_NAME" +msgstr "错误:无法解决主机名称" + +msgid "IDS_BR_POP_UNABLE_TO_REACH_PROXY" +msgstr "无法到达代理" + +msgid "IDS_BR_POP_NOSSLCERTI" +msgstr "无 SSL 证书" + +msgid "IDS_BR_BODY_FILE_SIZE_EXCEEDS_MAXIMUM_UPLOAD_LIMIT" +msgstr "文件大小超过上传限制上限" + +msgid "IDS_BR_BODY_ENTER_NAME_C" +msgstr "输入名称:" + +msgid "IDS_BR_SK_NEXT" +msgstr "下一步" + +msgid "IDS_BR_OPT_NEW_FOLDER" +msgstr "新文件夹" + +msgid "IDS_BR_SK3_ADD_TO_BOOKMARKS" +msgstr "添加到书签" + +msgid "IDS_BR_SK1_NEW_WINDOW" +msgstr "新窗口" + +msgid "IDS_BR_BODY_URL" +msgstr "网址" + +msgid "IDS_BR_BODY_URL_C" +msgstr "网址:" + +msgid "IDS_BR_BODY_URL_NOT_AVAILABLE" +msgstr "URL不可用" + +msgid "IDS_BR_BODY_URL_PS_NOT_AVAILABLE_IT_MIGHT_BE_DOWN_TEMPORARILY_OR_NO_LONGER_IN_USE" +msgstr "URL %s不可用。它可能暂时不能使用或不能再使用了" + +msgid "IDS_BR_HEADER_FOLDER" +msgstr "文件夹" + +msgid "IDS_BR_BODY_FOLDER_NAME" +msgstr "文件夹名称" + +msgid "IDS_BR_BODY_FOLDER_NAME_ALREADY_IN_USE" +msgstr "文件夹名称已存在" + +msgid "IDS_BR_BODY_NO_TITLE" +msgstr "无标题" + +msgid "IDS_BR_HEADER_MULTI_WINDOW" +msgstr "多窗口" + +msgid "IDS_BR_BODY_NO_HISTORIES" +msgstr "没有历史记录" + +msgid "IDS_BR_BODY_ADD_TO_BOOKMARKS" +msgstr "添加到书签" + +msgid "IDS_BR_BODY_EDIT_BOOKMARK" +msgstr "编辑书签" + +msgid "IDS_BR_BODY_FOLDER_NAME_C" +msgstr "文件夹名称:" + +msgid "IDS_BR_OPT_SELECT_ALL" +msgstr "全选" + +msgid "IDS_BR_OPT_DOWNLOAD_MANAGER" +msgstr "下载管理器" + +msgid "IDS_BR_OPT_ADD_RSS_FEED" +msgstr "添加RSS源" + +msgid "IDS_BR_OPT_ADD_RSS_FEEDS" +msgstr "添加RSS订阅源" + +msgid "IDS_BR_OPT_SETTINGS" +msgstr "设定" + +msgid "IDS_BR_POP_ENTER_URL" +msgstr "输入网址" + +msgid "IDS_BR_BODY_AUTHPASSWORD" +msgstr "密码" + +msgid "IDS_BR_POP_INVALIDADDRESS" +msgstr "地址无效" + +msgid "IDS_BR_POP_ALREADY_EXISTS_IN_DOWNLOAD_LIST" +msgstr "下载列表中已存在" + +msgid "IDS_BR_POP_ENTER_FOLDER_NAME" +msgstr "输入文件夹名称" + +msgid "IDS_BR_POP_NO_PAGE" +msgstr "没有页" + +msgid "IDS_BR_POP_NO_PAGES_BACKWARD" +msgstr "无上一页" + +msgid "IDS_BR_POP_NO_PAGES_FORWARD" +msgstr "无下一页" + +msgid "IDS_BR_POP_NO_PAGE_TO_RELOAD" +msgstr "没有要重新加载的页面" + +msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED" +msgstr "需要认证" + +msgid "IDS_BR_POP_BOOKMARK_ALREADY_EXISTS" +msgstr "书签已存在" + +msgid "IDS_BR_POP_FOLDER_NAME_ALREADY_EXISTS" +msgstr "文件夹名称已经存在" + +msgid "IDS_BR_POP_UNABLE_TO_SAVE_OBJECT_NOT_ENOUGH_SPACE_IN_CACHE" +msgstr "无法保存目标。缓存空间不足" + +msgid "IDS_BR_HEADER_SELECT_ITEMS" +msgstr "选择项目" + +msgid "IDS_BR_HEADER_CERTIFICATE_INFO" +msgstr "证书信息" + +msgid "IDS_BR_OPT_SHARE_VIA_EMAIL" +msgstr "通过电子邮件共享" + +msgid "IDS_BR_OPT_SHARE_VIA_MESSAGES" +msgstr "通过信息共享" + +msgid "IDS_BR_OPT_SHARE_VIA" +msgstr "共享通过" + +msgid "IDS_BR_POP_UNABLE_TO_START_BROWSER" +msgstr "无法启动浏览器" + +msgid "IDS_BR_POP_NO_ADDRESS" +msgstr "无地址" + +msgid "IDS_BR_POP_NEVER_SHOW_AGAIN" +msgstr "永远不再显示" + +msgid "IDS_BR_POP_FILE_NAME_EMPTY" +msgstr "文件名空" + +msgid "IDS_BR_SK3_CREATE_FOLDER" +msgstr "新文件夹" + +msgid "IDS_BR_OPT_SELECTED" +msgstr "已选定" + +msgid "IDS_BR_OPT_SHARE" +msgstr "共享" + +msgid "IDS_BR_HEADER_RECENTLY_VISITED_PAGES" +msgstr "最近访问的页面" + +msgid "IDS_BR_OPT_DISPLAY" +msgstr "显示" + +msgid "IDS_BR_BODY_FIT_TO_WIDTH" +msgstr "适合宽度" + +msgid "IDS_BR_BODY_READABLE" +msgstr "方便阅读" + +msgid "IDS_BR_BODY_PRIVACY" +msgstr "隐私权" + +msgid "IDS_BR_BODY_COOKIES" +msgstr "Cookies" + +msgid "IDS_BR_BODY_COOKIESACCEPTALL" +msgstr "全部接受" + +msgid "IDS_BR_BODY_COOKIESPROMPT" +msgstr "提示" + +msgid "IDS_BR_HEADER_COOKIES" +msgstr "Cookies" + +msgid "IDS_BR_BODY_ACCEPT_COOKIES" +msgstr "接受 Cookies" + +msgid "IDS_BR_OPT_ACCEPT_COOKIES" +msgstr "接受 Cookies" + +msgid "IDS_BR_BODY_ACCEPT_ALL" +msgstr "全部接受" + +msgid "IDS_BR_BODY_REJECT_ALL" +msgstr "全部拒绝" + +msgid "IDS_BR_BODY_AUTO_SAVE_ID_PASSWORD" +msgstr "自动储存ID和密码" + +msgid "IDS_BR_BODY_ON" +msgstr "开" + +msgid "IDS_BR_BODY_OFF" +msgstr "关" + +msgid "IDS_BR_BODY_DEFAULT_STORAGE" +msgstr "默认存储器" + +msgid "IDS_BR_BODY_SEARCH" +msgstr "搜索" + +msgid "IDS_BR_BODY_SAVE_IMAGE" +msgstr "保存图像" + +msgid "IDS_BR_POP_LOW_BATTERY_UNABLE_TO_RUN_BROWSER" +msgstr "电池电量低。 无法运行浏览器" + +msgid "IDS_BR_BODY_FIND_WORD" +msgstr "查找文字" + +msgid "IDS_BR_OPT_ADD_TO_HOME_SCREEN" +msgstr "添加到主屏" + +msgid "IDS_BR_OPT_ADD_TO_HOME_SCREEN_ABB" +msgstr "添加到主屏幕" + +msgid "IDS_BR_BODY_MOST_VISITED_SITES" +msgstr "访问最多的站点" + +msgid "IDS_BR_OPT_SHARE_VIA_FACEBOOK" +msgstr "通过 Facebook 共享" + +msgid "IDS_BR_OPT_SHARE_VIA_TWITTER" +msgstr "通过 Twitter 共享" + +msgid "IDS_BR_SK3_CHANGE_VIEW" +msgstr "更改视图" + +msgid "IDS_BR_HEADER_SELECT_URLS" +msgstr "选择 URL" + +msgid "IDS_BR_POP_THIS_SITE_IS_ATTEMPTING_TO_OPEN_POP_UP_WINDOW" +msgstr "站点尝试打开弹出窗口" + +msgid "IDS_BR_MBODY_BLOCK_POP_UP_WINDOWS" +msgstr "阻止跳出窗口" + +msgid "IDS_BR_BODY_TEXT_READER" +msgstr "文本阅读器" + +msgid "IDS_BR_OPT_COPY_IMAGE" +msgstr "复制图像" + +msgid "IDS_BR_OPT_SAVE_IMAGE" +msgstr "保存图像" + +msgid "IDS_BR_BODY_PLAY" +msgstr "播放" + +msgid "IDS_BR_OPT_SELECT" +msgstr "选择" + +msgid "IDS_BR_OPT_NAVIGATE_GO_BACKWARD" +msgstr "后退" + +msgid "IDS_BR_OPT_NAVIGATE_GO_FORWARD" +msgstr "前进" + +msgid "IDS_BR_OPT_STOP" +msgstr "停止" + +msgid "IDS_BR_OPT_RELOAD" +msgstr "刷新" + +msgid "IDS_BR_OPT_PASTE" +msgstr "粘贴" + +msgid "IDS_BR_BUTTON_MORE" +msgstr "更多" + +msgid "IDS_BR_POP_FAIL" +msgstr "失败" + +msgid "IDS_BR_BODY_OPEN_IN_NEW_WINDOW" +msgstr "在新窗口中打开" + +msgid "IDS_BR_OPT_VIEW_DOWNLOAD_LIST" +msgstr "查看下载列表" + +msgid "IDS_BR_BODY_COPY_URL" +msgstr "复制网址" + +msgid "IDS_BR_BODY_COPY_URL_TO" +msgstr "复制网址到" + +msgid "IDS_BR_BODY_VIEW_IMAGE" +msgstr "查看图像" + +msgid "IDS_BR_BODY_PRIVACY_SETTINGS" +msgstr "隐私设定" + +msgid "IDS_BR_BODY_CLEAR_CACHE" +msgstr "清除缓存" + +msgid "IDS_BR_BODY_CLEAR_HISTORY" +msgstr "清除历史记录" + +msgid "IDS_BR_BODY_ENABLE_PLUG_INS" +msgstr "启动插件" + +msgid "IDS_BR_BODY_SELECT_SEARCH_ENGINE" +msgstr "选择搜索引擎" + +msgid "IDS_BR_BODY_DELETE_SAVED_ID_PASSWORD" +msgstr "删除储存的ID和密码" + +msgid "IDS_BR_BODY_CLEAR_ALL_COOKIE_DATA" +msgstr "清除所有 Cookie 数据" + +msgid "IDS_BR_BODY_UP" +msgstr "上" + +msgid "IDS_BR_BODY_FONT_SIZE" +msgstr "字体大小" + +msgid "IDS_BR_POP_DELETED" +msgstr "已删除" + +msgid "IDS_BR_BODY_DEFAULT_VIEW" +msgstr "默认视图" + +msgid "IDS_BR_MBODY_PAGE_CONTENT_SETTINGS" +msgstr "页面内容设置" + +msgid "IDS_BR_POP_CASE_SENSITIVE" +msgstr "区分大小写" + +msgid "IDS_BR_BODY_PLUG_IN" +msgstr "插入" + +msgid "IDS_BR_OPT_PLUGINS_LIST" +msgstr "插件列表" + +msgid "IDS_BR_HEADER_LOCAL_STORAGE" +msgstr "本地存储器" + +msgid "IDS_BR_BODY_DELETE_BROWSING_DATA" +msgstr "删除浏览数据" + +msgid "IDS_BR_BODY_LOADING_ING" +msgstr "载入中…" + +msgid "IDS_BR_HEADER_LOADING_ING" +msgstr "载入中…" + +msgid "IDS_BR_HEADER_ENTERURL" +msgstr "输入网址" + +msgid "IDS_BR_OPT_LOCK" +msgstr "锁定" + +msgid "IDS_BR_OPT_UNLOCK" +msgstr "解锁" + +msgid "IDS_BR_BODY_MODIFY" +msgstr "修改" + +msgid "IDS_BR_SK_PAGE_UP" +msgstr "上页" + +msgid "IDS_BR_SK_PAGE_DOWN" +msgstr "下页" + +msgid "IDS_BR_BODY_DEVELOPER_MODE" +msgstr "开发模式" + +msgid "IDS_BR_BODY_EMPTY" +msgstr "空白" + +msgid "IDS_BR_BODY_CERTIFICATES" +msgstr "证书" + +msgid "IDS_BR_BODY_BOOKMARKS" +msgstr "书签" + +msgid "IDS_BR_BODY_ENTER_NAME" +msgstr "名字不能为空" + +msgid "IDS_BR_BODY_NAME" +msgstr "名称" + +msgid "IDS_BR_OPT_SEND_VIA_EMAIL" +msgstr "通过电子邮件发送" + +msgid "IDS_BR_OPT_SEND_VIA_MESSAGE" +msgstr "通过信息发送" + +msgid "IDS_BR_BODY_SETTINGS" +msgstr "设定" + +msgid "IDS_BR_BODY_AUTHUSERNAME" +msgstr "用户名" + +msgid "IDS_BR_POP_ALREADY_EXISTS" +msgstr "已经存在" + +msgid "IDS_BR_POP_SAVED" +msgstr "已保存" + +msgid "IDS_BR_POP_NOT_ENOUGH_MEMORY" +msgstr "没有足够内存" + +msgid "IDS_BR_POP_NETWORK_ERROR" +msgstr "网络故障" + +msgid "IDS_BR_BODY_ALWAYS_ASK" +msgstr "总是询问" + +msgid "IDS_BR_BODY_MEMORY_CARD" +msgstr "存储卡" + +msgid "IDS_BR_BODY_PHONE" +msgstr "手机" + +msgid "IDS_BR_BODY_NO_ACCOUNTS_ABB" +msgstr "无帐户" + +msgid "IDS_BR_HEADER_ERROR_PAGE" +msgstr "错误页面" + +msgid "IDS_BR_BODY_WEB_PAGE_TEMPORARILY_NOT_AVAILABLE" +msgstr "网页临时不可用" + +msgid "IDS_BR_BODY_WEB_PAGE_NOT_AVAILABLE" +msgstr "网页不可用" + +msgid "IDS_BR_BODY_FAILED_TO_LOAD_FRAMES" +msgstr "加载帧失败" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_1" +msgstr "获取网页 %s 时发生以下错误" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_2" +msgstr "无法获取网页。(网页可能临时关闭或已移至新网址)" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_3" +msgstr "最可能的原因如下" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_4" +msgstr "网络连接未正常建立" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_5" +msgstr "检查网页网址" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_6" +msgstr "稍后重新加载网页" + +msgid "IDS_BR_OPT_BOOKMARK" +msgstr "书签" + +msgid "IDS_BR_BODY_TITLE" +msgstr "题目" + +msgid "IDS_BR_BODY_ENTER_TITLE" +msgstr "输入标题" + +msgid "IDS_BR_OPT_FOLDERS" +msgstr "文件夹" + +msgid "IDS_BR_OPT_ALLOW" +msgstr "允许" + +msgid "IDS_BR_POP_REFUSE" +msgstr "拒绝" + +msgid "IDS_BR_POP_SECURITY_ERROR_C_UNTRUSTED_SERVER_CERTIFICATE" +msgstr "安全错误: 不可信的服务器证书" + +msgid "IDS_BR_POP_PD_ITEMS_SELECTED" +msgstr "已选择%d个项目" + +msgid "IDS_BR_POP_1_ITEM_SELECTED" +msgstr "已选择1个项目" + diff --git a/po/zh_HK.po b/po/zh_HK.po new file mode 100755 index 00000000..0e9d79d4 --- /dev/null +++ b/po/zh_HK.po @@ -0,0 +1,621 @@ +msgid "IDS_BR_POP_INSTALLATION_FAILED" +msgstr "安裝失敗" + +msgid "IDS_BR_BODY_NOTIFYING_ING" +msgstr "正在通知..." + +msgid "IDS_BR_BODY_PROCESSING_ING" +msgstr "正在處理..." + +msgid "IDS_BR_BODY_PROCESSING_COMPLETED" +msgstr "處理完成" + +msgid "IDS_BR_SK_RETRY" +msgstr "重試" + +msgid "IDS_BR_HEADER_DOWNLOAD_MANAGER" +msgstr "下載管理員" + +msgid "IDS_BR_POP_INVALIDDESCRIPTOR" +msgstr "無效描述項" + +msgid "IDS_BR_POP_UNABLE_TO_OPEN_FILE" +msgstr "無法開啟檔案" + +msgid "IDS_BR_POP_DOWNLOAD_Q" +msgstr "要下載嗎?" + +msgid "IDS_BR_OPT_DELETE_SELECTED" +msgstr "已選擇" + +msgid "IDS_BR_POP_DOWNLOAD_CANCELLED" +msgstr "下載已取消" + +msgid "IDS_BR_BODY_CONTINUE_FROM_LAST_PAGE" +msgstr "從上一頁繼續" + +msgid "IDS_BR_BODY_PAGE" +msgstr "頁面" + +msgid "IDS_BR_OPT_DICTIONARY" +msgstr "字典" + +msgid "IDS_BR_BODY_ABOUT_BROWSER" +msgstr "關於瀏覽器" + +msgid "IDS_BR_BODY_BROWSER_TYPE" +msgstr "類型" + +msgid "IDS_BR_BODY_CERTIFICATE_ISSUER" +msgstr "簽發者" + +msgid "IDS_BR_BODY_DISPLAY_IMAGES" +msgstr "顯示圖像" + +msgid "IDS_BR_BODY_DOWNLOAD" +msgstr "下載" + +msgid "IDS_BR_BODY_ENTER_URL" +msgstr "輸入網址" + +msgid "IDS_BR_BODY_FOLDER" +msgstr "資料夾" + +msgid "IDS_BR_BODY_HOMEPAGE" +msgstr "首頁" + +msgid "IDS_BR_BODY_LANDSCAPE_VIEW" +msgstr "橫向檢視" + +msgid "IDS_BR_BODY_NO_BOOKMARKS" +msgstr "無書籤" + +msgid "IDS_BR_BODY_NO_RESULTS_FOUND" +msgstr "找不到結果" + +msgid "IDS_BR_BODY_OPTIONAL" +msgstr "可選" + +msgid "IDS_BR_BODY_RSS" +msgstr "RSS" + +msgid "IDS_BR_BODY_RUN_FLASH" +msgstr "執行 Flash" + +msgid "IDS_BR_BODY_RUN_JAVASCRIPT" +msgstr "執行 JavaScript" + +msgid "IDS_BR_HEADER_COMMON_NAME_C" +msgstr "一般名稱:" + +msgid "IDS_BR_HEADER_ORGANIZATIONAL_UNIT_C" +msgstr "機構單位:" + +msgid "IDS_BR_HEADER_ORGANIZATION_C" +msgstr "機構:" + +msgid "IDS_BR_HEADER_USER_AGENT" +msgstr "用戶代理" + +msgid "IDS_BR_OPT_LAST_VIEWED_PAGE_ATNT" +msgstr "Last Viewed Page" + +msgid "IDS_BR_OPT_PREFERENCES" +msgstr "偏好設定" + +msgid "IDS_BR_POP_ACTICATION_ERR" +msgstr "啟動錯誤" + +msgid "IDS_BR_POP_ALREADY_RUNNING" +msgstr "已在執行..." + +msgid "IDS_BR_POP_ERRORIMPLEMENTED" +msgstr "無執行" + +msgid "IDS_BR_POP_HTTPERRAUTHFAILED" +msgstr "認證失敗" + +msgid "IDS_BR_POP_OVERWRITE_Q" +msgstr "要覆蓋嗎?" + +msgid "IDS_BR_POP_URL" +msgstr "網址" + +msgid "IDS_BR_TAB_HISTORY" +msgstr "歷程記錄" + +msgid "IDS_BR_HEADER_DOWNLOAD_LIST" +msgstr "下載清單" + +msgid "IDS_BR_POP_ALREADYINSTALLED" +msgstr "已安裝" + +msgid "IDS_BR_POP_NOTIFYING" +msgstr "正在通知..." + +msgid "IDS_BR_POP_NOTSUPPORT" +msgstr "不支援的內容" + +msgid "IDS_BR_POP_ERROR_C_UNABLE_TO_RESOLVE_HOST_NAME" +msgstr "錯誤:無法分辨主機名稱" + +msgid "IDS_BR_POP_UNABLE_TO_REACH_PROXY" +msgstr "無法連接至代理" + +msgid "IDS_BR_POP_NOSSLCERTI" +msgstr "無 SSL 證書" + +msgid "IDS_BR_BODY_FILE_SIZE_EXCEEDS_MAXIMUM_UPLOAD_LIMIT" +msgstr "檔案大小超出最大上載限制" + +msgid "IDS_BR_BODY_ENTER_NAME_C" +msgstr "輸入名稱:" + +msgid "IDS_BR_SK_NEXT" +msgstr "下一個" + +msgid "IDS_BR_OPT_NEW_FOLDER" +msgstr "新資料夾" + +msgid "IDS_BR_SK3_ADD_TO_BOOKMARKS" +msgstr "加到書籤" + +msgid "IDS_BR_SK1_NEW_WINDOW" +msgstr "新視窗" + +msgid "IDS_BR_BODY_URL" +msgstr "網址" + +msgid "IDS_BR_BODY_URL_C" +msgstr "網址:" + +msgid "IDS_BR_BODY_URL_NOT_AVAILABLE" +msgstr "網址不可用" + +msgid "IDS_BR_BODY_URL_PS_NOT_AVAILABLE_IT_MIGHT_BE_DOWN_TEMPORARILY_OR_NO_LONGER_IN_USE" +msgstr "網址 %s 不可用。可能暫時無法使用或不能再使用" + +msgid "IDS_BR_HEADER_FOLDER" +msgstr "資料夾" + +msgid "IDS_BR_BODY_FOLDER_NAME" +msgstr "資料夾名稱" + +msgid "IDS_BR_BODY_FOLDER_NAME_ALREADY_IN_USE" +msgstr "資料夾名稱已被使用" + +msgid "IDS_BR_BODY_NO_TITLE" +msgstr "無標題" + +msgid "IDS_BR_HEADER_MULTI_WINDOW" +msgstr "多個視窗" + +msgid "IDS_BR_BODY_NO_HISTORIES" +msgstr "無歷史記錄" + +msgid "IDS_BR_BODY_ADD_TO_BOOKMARKS" +msgstr "加到書籤" + +msgid "IDS_BR_BODY_EDIT_BOOKMARK" +msgstr "編輯書籤" + +msgid "IDS_BR_BODY_FOLDER_NAME_C" +msgstr "資料夾名稱:" + +msgid "IDS_BR_OPT_SELECT_ALL" +msgstr "選擇全部" + +msgid "IDS_BR_OPT_DOWNLOAD_MANAGER" +msgstr "下載管理員" + +msgid "IDS_BR_OPT_ADD_RSS_FEED" +msgstr "加入 RSS Feed" + +msgid "IDS_BR_OPT_ADD_RSS_FEEDS" +msgstr "加入 RSS Feed" + +msgid "IDS_BR_OPT_SETTINGS" +msgstr "設定" + +msgid "IDS_BR_POP_ENTER_URL" +msgstr "輸入網址" + +msgid "IDS_BR_BODY_AUTHPASSWORD" +msgstr "密碼" + +msgid "IDS_BR_POP_INVALIDADDRESS" +msgstr "位址無效" + +msgid "IDS_BR_POP_ALREADY_EXISTS_IN_DOWNLOAD_LIST" +msgstr "已存在於下載清單中" + +msgid "IDS_BR_POP_ENTER_FOLDER_NAME" +msgstr "輸入資料夾名稱" + +msgid "IDS_BR_POP_NO_PAGE" +msgstr "無頁面" + +msgid "IDS_BR_POP_NO_PAGES_BACKWARD" +msgstr "無上一頁" + +msgid "IDS_BR_POP_NO_PAGES_FORWARD" +msgstr "無下一頁" + +msgid "IDS_BR_POP_NO_PAGE_TO_RELOAD" +msgstr "沒有要重新載入的頁面" + +msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED" +msgstr "需要認證" + +msgid "IDS_BR_POP_BOOKMARK_ALREADY_EXISTS" +msgstr "書籤已存在" + +msgid "IDS_BR_POP_FOLDER_NAME_ALREADY_EXISTS" +msgstr "資料夾名稱已存在" + +msgid "IDS_BR_POP_UNABLE_TO_SAVE_OBJECT_NOT_ENOUGH_SPACE_IN_CACHE" +msgstr "無法儲存對象。緩存空間不足" + +msgid "IDS_BR_HEADER_SELECT_ITEMS" +msgstr "選擇項目" + +msgid "IDS_BR_HEADER_CERTIFICATE_INFO" +msgstr "證書資料" + +msgid "IDS_BR_OPT_SHARE_VIA_EMAIL" +msgstr "透過電子郵件分享" + +msgid "IDS_BR_OPT_SHARE_VIA_MESSAGES" +msgstr "透過訊息共享" + +msgid "IDS_BR_OPT_SHARE_VIA" +msgstr "分享透過" + +msgid "IDS_BR_POP_UNABLE_TO_START_BROWSER" +msgstr "無法啟動瀏覽器" + +msgid "IDS_BR_POP_NO_ADDRESS" +msgstr "無地址" + +msgid "IDS_BR_POP_NEVER_SHOW_AGAIN" +msgstr "永不再顯示" + +msgid "IDS_BR_POP_FILE_NAME_EMPTY" +msgstr "無檔案名稱" + +msgid "IDS_BR_SK3_CREATE_FOLDER" +msgstr "建立資料夾" + +msgid "IDS_BR_OPT_SELECTED" +msgstr "已選擇" + +msgid "IDS_BR_OPT_SHARE" +msgstr "分享" + +msgid "IDS_BR_HEADER_RECENTLY_VISITED_PAGES" +msgstr "最近瀏覽的頁面" + +msgid "IDS_BR_OPT_DISPLAY" +msgstr "顯示" + +msgid "IDS_BR_BODY_FIT_TO_WIDTH" +msgstr "符合寬度" + +msgid "IDS_BR_BODY_READABLE" +msgstr "可讀取" + +msgid "IDS_BR_BODY_PRIVACY" +msgstr "私隱" + +msgid "IDS_BR_BODY_COOKIES" +msgstr "Cookies" + +msgid "IDS_BR_BODY_COOKIESACCEPTALL" +msgstr "全部接受" + +msgid "IDS_BR_BODY_COOKIESPROMPT" +msgstr "提示" + +msgid "IDS_BR_HEADER_COOKIES" +msgstr "Cookies" + +msgid "IDS_BR_BODY_ACCEPT_COOKIES" +msgstr "接受 Cookies" + +msgid "IDS_BR_OPT_ACCEPT_COOKIES" +msgstr "接受 Cookies" + +msgid "IDS_BR_BODY_ACCEPT_ALL" +msgstr "全部接受" + +msgid "IDS_BR_BODY_REJECT_ALL" +msgstr "全部拒絕" + +msgid "IDS_BR_BODY_AUTO_SAVE_ID_PASSWORD" +msgstr "自動儲存ID /密碼" + +msgid "IDS_BR_BODY_ON" +msgstr "開" + +msgid "IDS_BR_BODY_OFF" +msgstr "關" + +msgid "IDS_BR_BODY_DEFAULT_STORAGE" +msgstr "預設儲存裝置" + +msgid "IDS_BR_BODY_SEARCH" +msgstr "搜尋" + +msgid "IDS_BR_BODY_SAVE_IMAGE" +msgstr "儲存圖像" + +msgid "IDS_BR_POP_LOW_BATTERY_UNABLE_TO_RUN_BROWSER" +msgstr "電量不足。無法執行瀏覽器" + +msgid "IDS_BR_BODY_FIND_WORD" +msgstr "尋找字詞" + +msgid "IDS_BR_OPT_ADD_TO_HOME_SCREEN" +msgstr "加入至主螢幕" + +msgid "IDS_BR_OPT_ADD_TO_HOME_SCREEN_ABB" +msgstr "加入至主螢幕" + +msgid "IDS_BR_BODY_MOST_VISITED_SITES" +msgstr "最常瀏覽網站" + +msgid "IDS_BR_OPT_SHARE_VIA_FACEBOOK" +msgstr "透過 Facebook 分享" + +msgid "IDS_BR_OPT_SHARE_VIA_TWITTER" +msgstr "透過 Twitter 分享" + +msgid "IDS_BR_SK3_CHANGE_VIEW" +msgstr "更改檢視" + +msgid "IDS_BR_HEADER_SELECT_URLS" +msgstr "選擇網址" + +msgid "IDS_BR_POP_THIS_SITE_IS_ATTEMPTING_TO_OPEN_POP_UP_WINDOW" +msgstr "此網站正嘗試開啟一個彈出視窗" + +msgid "IDS_BR_MBODY_BLOCK_POP_UP_WINDOWS" +msgstr "封鎖彈出視窗" + +msgid "IDS_BR_BODY_TEXT_READER" +msgstr "文字閱讀器" + +msgid "IDS_BR_OPT_COPY_IMAGE" +msgstr "複製圖像" + +msgid "IDS_BR_OPT_SAVE_IMAGE" +msgstr "儲存圖像" + +msgid "IDS_BR_BODY_PLAY" +msgstr "播放" + +msgid "IDS_BR_OPT_SELECT" +msgstr "選擇" + +msgid "IDS_BR_OPT_NAVIGATE_GO_BACKWARD" +msgstr "轉至上一頁" + +msgid "IDS_BR_OPT_NAVIGATE_GO_FORWARD" +msgstr "轉至下一頁" + +msgid "IDS_BR_OPT_STOP" +msgstr "停止" + +msgid "IDS_BR_OPT_RELOAD" +msgstr "重新載入" + +msgid "IDS_BR_OPT_PASTE" +msgstr "貼上" + +msgid "IDS_BR_BUTTON_MORE" +msgstr "更多" + +msgid "IDS_BR_POP_FAIL" +msgstr "失敗" + +msgid "IDS_BR_BODY_OPEN_IN_NEW_WINDOW" +msgstr "在新視窗開啟" + +msgid "IDS_BR_OPT_VIEW_DOWNLOAD_LIST" +msgstr "檢視下載清單" + +msgid "IDS_BR_BODY_COPY_URL" +msgstr "複製網址" + +msgid "IDS_BR_BODY_COPY_URL_TO" +msgstr "複製網址到" + +msgid "IDS_BR_BODY_VIEW_IMAGE" +msgstr "檢視圖像" + +msgid "IDS_BR_BODY_PRIVACY_SETTINGS" +msgstr "私隱權設定" + +msgid "IDS_BR_BODY_CLEAR_CACHE" +msgstr "清除緩存" + +msgid "IDS_BR_BODY_CLEAR_HISTORY" +msgstr "清除歷程記錄" + +msgid "IDS_BR_BODY_ENABLE_PLUG_INS" +msgstr "啟用外掛程式" + +msgid "IDS_BR_BODY_SELECT_SEARCH_ENGINE" +msgstr "選擇搜尋引擎" + +msgid "IDS_BR_BODY_DELETE_SAVED_ID_PASSWORD" +msgstr "刪除已儲存的用戶名/密碼" + +msgid "IDS_BR_BODY_CLEAR_ALL_COOKIE_DATA" +msgstr "清除全部 Cookie 數據" + +msgid "IDS_BR_BODY_UP" +msgstr "上" + +msgid "IDS_BR_BODY_FONT_SIZE" +msgstr "字體大小" + +msgid "IDS_BR_POP_DELETED" +msgstr "已刪除" + +msgid "IDS_BR_BODY_DEFAULT_VIEW" +msgstr "預設檢視" + +msgid "IDS_BR_MBODY_PAGE_CONTENT_SETTINGS" +msgstr "頁面內容設定" + +msgid "IDS_BR_POP_CASE_SENSITIVE" +msgstr "符合大小寫" + +msgid "IDS_BR_BODY_PLUG_IN" +msgstr "外掛" + +msgid "IDS_BR_OPT_PLUGINS_LIST" +msgstr "外掛程式清單" + +msgid "IDS_BR_HEADER_LOCAL_STORAGE" +msgstr "本機儲存空間" + +msgid "IDS_BR_BODY_DELETE_BROWSING_DATA" +msgstr "刪除瀏覽數據" + +msgid "IDS_BR_BODY_LOADING_ING" +msgstr "正在載入..." + +msgid "IDS_BR_HEADER_LOADING_ING" +msgstr "正在載入..." + +msgid "IDS_BR_HEADER_ENTERURL" +msgstr "輸入網址" + +msgid "IDS_BR_OPT_LOCK" +msgstr "鎖定" + +msgid "IDS_BR_OPT_UNLOCK" +msgstr "解鎖" + +msgid "IDS_BR_BODY_MODIFY" +msgstr "修改" + +msgid "IDS_BR_SK_PAGE_UP" +msgstr "向上翻頁" + +msgid "IDS_BR_SK_PAGE_DOWN" +msgstr "向下翻頁" + +msgid "IDS_BR_BODY_DEVELOPER_MODE" +msgstr "開發人員模式" + +msgid "IDS_BR_BODY_EMPTY" +msgstr "空白" + +msgid "IDS_BR_BODY_CERTIFICATES" +msgstr "證書" + +msgid "IDS_BR_BODY_BOOKMARKS" +msgstr "書籤" + +msgid "IDS_BR_BODY_ENTER_NAME" +msgstr "輸入名稱" + +msgid "IDS_BR_BODY_NAME" +msgstr "名稱" + +msgid "IDS_BR_OPT_SEND_VIA_EMAIL" +msgstr "透過電子郵件發送" + +msgid "IDS_BR_OPT_SEND_VIA_MESSAGE" +msgstr "透過訊息發送" + +msgid "IDS_BR_BODY_SETTINGS" +msgstr "設定" + +msgid "IDS_BR_BODY_AUTHUSERNAME" +msgstr "用戶名稱" + +msgid "IDS_BR_POP_ALREADY_EXISTS" +msgstr "已存在" + +msgid "IDS_BR_POP_SAVED" +msgstr "已儲存" + +msgid "IDS_BR_POP_NOT_ENOUGH_MEMORY" +msgstr "記憶體不足" + +msgid "IDS_BR_POP_NETWORK_ERROR" +msgstr "網絡故障" + +msgid "IDS_BR_BODY_ALWAYS_ASK" +msgstr "總是詢問" + +msgid "IDS_BR_BODY_MEMORY_CARD" +msgstr "記憶卡" + +msgid "IDS_BR_BODY_PHONE" +msgstr "電話" + +msgid "IDS_BR_BODY_NO_ACCOUNTS_ABB" +msgstr "無帳戶" + +msgid "IDS_BR_HEADER_ERROR_PAGE" +msgstr "錯誤頁面" + +msgid "IDS_BR_BODY_WEB_PAGE_TEMPORARILY_NOT_AVAILABLE" +msgstr "網頁暫時不可用" + +msgid "IDS_BR_BODY_WEB_PAGE_NOT_AVAILABLE" +msgstr "網頁不可用" + +msgid "IDS_BR_BODY_FAILED_TO_LOAD_FRAMES" +msgstr "無法載入幀" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_1" +msgstr "取得網頁 %s 時,發生以下錯誤" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_2" +msgstr "無法取得網頁。(網頁可能暫時關閉或遷移至新的網址)" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_3" +msgstr "可能導致此問題的原因如下" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_4" +msgstr "網絡連接未正常建立" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_5" +msgstr "檢查網頁網址" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_6" +msgstr "稍後重新載入網頁" + +msgid "IDS_BR_OPT_BOOKMARK" +msgstr "書籤" + +msgid "IDS_BR_BODY_TITLE" +msgstr "標題" + +msgid "IDS_BR_BODY_ENTER_TITLE" +msgstr "輸入標題" + +msgid "IDS_BR_OPT_FOLDERS" +msgstr "資料夾" + +msgid "IDS_BR_OPT_ALLOW" +msgstr "允許" + +msgid "IDS_BR_POP_REFUSE" +msgstr "拒絕" + +msgid "IDS_BR_POP_SECURITY_ERROR_C_UNTRUSTED_SERVER_CERTIFICATE" +msgstr "安全性錯誤:不受信任的伺服器證書" + +msgid "IDS_BR_POP_PD_ITEMS_SELECTED" +msgstr "已選擇 %d 個項目" + +msgid "IDS_BR_POP_1_ITEM_SELECTED" +msgstr "已選擇 1 個項目" + diff --git a/po/zh_TW.po b/po/zh_TW.po new file mode 100755 index 00000000..b6451ee0 --- /dev/null +++ b/po/zh_TW.po @@ -0,0 +1,621 @@ +msgid "IDS_BR_POP_INSTALLATION_FAILED" +msgstr "安裝失敗" + +msgid "IDS_BR_BODY_NOTIFYING_ING" +msgstr "正在通知..." + +msgid "IDS_BR_BODY_PROCESSING_ING" +msgstr "正在處理..." + +msgid "IDS_BR_BODY_PROCESSING_COMPLETED" +msgstr "處理完成" + +msgid "IDS_BR_SK_RETRY" +msgstr "重試" + +msgid "IDS_BR_HEADER_DOWNLOAD_MANAGER" +msgstr "下載管理員" + +msgid "IDS_BR_POP_INVALIDDESCRIPTOR" +msgstr "描述元無效" + +msgid "IDS_BR_POP_UNABLE_TO_OPEN_FILE" +msgstr "無法開啟檔案" + +msgid "IDS_BR_POP_DOWNLOAD_Q" +msgstr "要下載嗎?" + +msgid "IDS_BR_OPT_DELETE_SELECTED" +msgstr "已選擇" + +msgid "IDS_BR_POP_DOWNLOAD_CANCELLED" +msgstr "下載已取消" + +msgid "IDS_BR_BODY_CONTINUE_FROM_LAST_PAGE" +msgstr "從上一頁繼續" + +msgid "IDS_BR_BODY_PAGE" +msgstr "頁面" + +msgid "IDS_BR_OPT_DICTIONARY" +msgstr "字典" + +msgid "IDS_BR_BODY_ABOUT_BROWSER" +msgstr "關於瀏覽器" + +msgid "IDS_BR_BODY_BROWSER_TYPE" +msgstr "類型" + +msgid "IDS_BR_BODY_CERTIFICATE_ISSUER" +msgstr "簽發者" + +msgid "IDS_BR_BODY_DISPLAY_IMAGES" +msgstr "顯示影像" + +msgid "IDS_BR_BODY_DOWNLOAD" +msgstr "下載" + +msgid "IDS_BR_BODY_ENTER_URL" +msgstr "輸入網址" + +msgid "IDS_BR_BODY_FOLDER" +msgstr "資料夾" + +msgid "IDS_BR_BODY_HOMEPAGE" +msgstr "首頁" + +msgid "IDS_BR_BODY_LANDSCAPE_VIEW" +msgstr "橫向檢視" + +msgid "IDS_BR_BODY_NO_BOOKMARKS" +msgstr "無書籤" + +msgid "IDS_BR_BODY_NO_RESULTS_FOUND" +msgstr "找不到結果" + +msgid "IDS_BR_BODY_OPTIONAL" +msgstr "可選" + +msgid "IDS_BR_BODY_RSS" +msgstr "RSS" + +msgid "IDS_BR_BODY_RUN_FLASH" +msgstr "執行 Flash" + +msgid "IDS_BR_BODY_RUN_JAVASCRIPT" +msgstr "執行 JavaScript" + +msgid "IDS_BR_HEADER_COMMON_NAME_C" +msgstr "一般名稱:" + +msgid "IDS_BR_HEADER_ORGANIZATIONAL_UNIT_C" +msgstr "組織單位:" + +msgid "IDS_BR_HEADER_ORGANIZATION_C" +msgstr "組織:" + +msgid "IDS_BR_HEADER_USER_AGENT" +msgstr "使用者代理" + +msgid "IDS_BR_OPT_LAST_VIEWED_PAGE_ATNT" +msgstr "Last Viewed Page" + +msgid "IDS_BR_OPT_PREFERENCES" +msgstr "喜好設定" + +msgid "IDS_BR_POP_ACTICATION_ERR" +msgstr "啟動錯誤" + +msgid "IDS_BR_POP_ALREADY_RUNNING" +msgstr "已正在執行..." + +msgid "IDS_BR_POP_ERRORIMPLEMENTED" +msgstr "尚未實作" + +msgid "IDS_BR_POP_HTTPERRAUTHFAILED" +msgstr "驗證失敗" + +msgid "IDS_BR_POP_OVERWRITE_Q" +msgstr "覆寫?" + +msgid "IDS_BR_POP_URL" +msgstr "URL" + +msgid "IDS_BR_TAB_HISTORY" +msgstr "歷程記錄" + +msgid "IDS_BR_HEADER_DOWNLOAD_LIST" +msgstr "下載清單" + +msgid "IDS_BR_POP_ALREADYINSTALLED" +msgstr "已經安裝" + +msgid "IDS_BR_POP_NOTIFYING" +msgstr "正在通知..." + +msgid "IDS_BR_POP_NOTSUPPORT" +msgstr "不支援的內容" + +msgid "IDS_BR_POP_ERROR_C_UNABLE_TO_RESOLVE_HOST_NAME" +msgstr "錯誤:無法分辨主機名稱" + +msgid "IDS_BR_POP_UNABLE_TO_REACH_PROXY" +msgstr "無法連接至 Proxy" + +msgid "IDS_BR_POP_NOSSLCERTI" +msgstr "無 SSL 憑證" + +msgid "IDS_BR_BODY_FILE_SIZE_EXCEEDS_MAXIMUM_UPLOAD_LIMIT" +msgstr "檔案大小超過上傳容量最大限制" + +msgid "IDS_BR_BODY_ENTER_NAME_C" +msgstr "輸入名稱:" + +msgid "IDS_BR_SK_NEXT" +msgstr "下一個" + +msgid "IDS_BR_OPT_NEW_FOLDER" +msgstr "新資料夾" + +msgid "IDS_BR_SK3_ADD_TO_BOOKMARKS" +msgstr "加至書籤" + +msgid "IDS_BR_SK1_NEW_WINDOW" +msgstr "新視窗" + +msgid "IDS_BR_BODY_URL" +msgstr "URL" + +msgid "IDS_BR_BODY_URL_C" +msgstr "URL:" + +msgid "IDS_BR_BODY_URL_NOT_AVAILABLE" +msgstr "網址不可用" + +msgid "IDS_BR_BODY_URL_PS_NOT_AVAILABLE_IT_MIGHT_BE_DOWN_TEMPORARILY_OR_NO_LONGER_IN_USE" +msgstr "網址 %s 不可用。可能暫時無法使用或不再可用" + +msgid "IDS_BR_HEADER_FOLDER" +msgstr "資料夾" + +msgid "IDS_BR_BODY_FOLDER_NAME" +msgstr "資料夾名稱" + +msgid "IDS_BR_BODY_FOLDER_NAME_ALREADY_IN_USE" +msgstr "資料夾名稱已被使用" + +msgid "IDS_BR_BODY_NO_TITLE" +msgstr "無標題" + +msgid "IDS_BR_HEADER_MULTI_WINDOW" +msgstr "多個視窗" + +msgid "IDS_BR_BODY_NO_HISTORIES" +msgstr "無歷史記錄" + +msgid "IDS_BR_BODY_ADD_TO_BOOKMARKS" +msgstr "加至書籤" + +msgid "IDS_BR_BODY_EDIT_BOOKMARK" +msgstr "編輯書籤" + +msgid "IDS_BR_BODY_FOLDER_NAME_C" +msgstr "資料夾名稱:" + +msgid "IDS_BR_OPT_SELECT_ALL" +msgstr "全選" + +msgid "IDS_BR_OPT_DOWNLOAD_MANAGER" +msgstr "下載管理員" + +msgid "IDS_BR_OPT_ADD_RSS_FEED" +msgstr "加入RSS 摘要" + +msgid "IDS_BR_OPT_ADD_RSS_FEEDS" +msgstr "增加RSS" + +msgid "IDS_BR_OPT_SETTINGS" +msgstr "設定" + +msgid "IDS_BR_POP_ENTER_URL" +msgstr "輸入 URL" + +msgid "IDS_BR_BODY_AUTHPASSWORD" +msgstr "密碼" + +msgid "IDS_BR_POP_INVALIDADDRESS" +msgstr "地址無效" + +msgid "IDS_BR_POP_ALREADY_EXISTS_IN_DOWNLOAD_LIST" +msgstr "已存在於下載清單中" + +msgid "IDS_BR_POP_ENTER_FOLDER_NAME" +msgstr "輸入資料夾名稱" + +msgid "IDS_BR_POP_NO_PAGE" +msgstr "無頁面" + +msgid "IDS_BR_POP_NO_PAGES_BACKWARD" +msgstr "無上一頁" + +msgid "IDS_BR_POP_NO_PAGES_FORWARD" +msgstr "無下一頁" + +msgid "IDS_BR_POP_NO_PAGE_TO_RELOAD" +msgstr "無頁面可重新載入" + +msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED" +msgstr "需要驗證" + +msgid "IDS_BR_POP_BOOKMARK_ALREADY_EXISTS" +msgstr "書籤已存在" + +msgid "IDS_BR_POP_FOLDER_NAME_ALREADY_EXISTS" +msgstr "資料夾名稱已存在" + +msgid "IDS_BR_POP_UNABLE_TO_SAVE_OBJECT_NOT_ENOUGH_SPACE_IN_CACHE" +msgstr "無法儲存物件。暫存空間不足" + +msgid "IDS_BR_HEADER_SELECT_ITEMS" +msgstr "選擇項目" + +msgid "IDS_BR_HEADER_CERTIFICATE_INFO" +msgstr "憑證資訊" + +msgid "IDS_BR_OPT_SHARE_VIA_EMAIL" +msgstr "透過電子郵件分享" + +msgid "IDS_BR_OPT_SHARE_VIA_MESSAGES" +msgstr "經由訊息分享" + +msgid "IDS_BR_OPT_SHARE_VIA" +msgstr "分享經由" + +msgid "IDS_BR_POP_UNABLE_TO_START_BROWSER" +msgstr "無法啟動瀏覽器" + +msgid "IDS_BR_POP_NO_ADDRESS" +msgstr "無地址" + +msgid "IDS_BR_POP_NEVER_SHOW_AGAIN" +msgstr "不再顯示" + +msgid "IDS_BR_POP_FILE_NAME_EMPTY" +msgstr "檔案名稱為空" + +msgid "IDS_BR_SK3_CREATE_FOLDER" +msgstr "建立資料夾" + +msgid "IDS_BR_OPT_SELECTED" +msgstr "已選擇" + +msgid "IDS_BR_OPT_SHARE" +msgstr "分享" + +msgid "IDS_BR_HEADER_RECENTLY_VISITED_PAGES" +msgstr "最近瀏覽的網頁" + +msgid "IDS_BR_OPT_DISPLAY" +msgstr "顯示" + +msgid "IDS_BR_BODY_FIT_TO_WIDTH" +msgstr "符合寬度" + +msgid "IDS_BR_BODY_READABLE" +msgstr "可讀取" + +msgid "IDS_BR_BODY_PRIVACY" +msgstr "隱私設定" + +msgid "IDS_BR_BODY_COOKIES" +msgstr "Cookies" + +msgid "IDS_BR_BODY_COOKIESACCEPTALL" +msgstr "全部接受" + +msgid "IDS_BR_BODY_COOKIESPROMPT" +msgstr "提示" + +msgid "IDS_BR_HEADER_COOKIES" +msgstr "Cookies" + +msgid "IDS_BR_BODY_ACCEPT_COOKIES" +msgstr "接受 Cookie" + +msgid "IDS_BR_OPT_ACCEPT_COOKIES" +msgstr "接受 Cookie" + +msgid "IDS_BR_BODY_ACCEPT_ALL" +msgstr "全部接受" + +msgid "IDS_BR_BODY_REJECT_ALL" +msgstr "全部拒絕" + +msgid "IDS_BR_BODY_AUTO_SAVE_ID_PASSWORD" +msgstr "自動儲存ID /密碼" + +msgid "IDS_BR_BODY_ON" +msgstr "開啟" + +msgid "IDS_BR_BODY_OFF" +msgstr "關閉" + +msgid "IDS_BR_BODY_DEFAULT_STORAGE" +msgstr "預設儲存裝置" + +msgid "IDS_BR_BODY_SEARCH" +msgstr "搜尋" + +msgid "IDS_BR_BODY_SAVE_IMAGE" +msgstr "儲存圖像" + +msgid "IDS_BR_POP_LOW_BATTERY_UNABLE_TO_RUN_BROWSER" +msgstr "電量不足。無法執行瀏覽器" + +msgid "IDS_BR_BODY_FIND_WORD" +msgstr "尋找文字" + +msgid "IDS_BR_OPT_ADD_TO_HOME_SCREEN" +msgstr "增加到主畫面" + +msgid "IDS_BR_OPT_ADD_TO_HOME_SCREEN_ABB" +msgstr "新增至主畫面" + +msgid "IDS_BR_BODY_MOST_VISITED_SITES" +msgstr "訪客最多的網站" + +msgid "IDS_BR_OPT_SHARE_VIA_FACEBOOK" +msgstr "透過 Facebook 分享" + +msgid "IDS_BR_OPT_SHARE_VIA_TWITTER" +msgstr "透過 Twitter 分享" + +msgid "IDS_BR_SK3_CHANGE_VIEW" +msgstr "更改檢視" + +msgid "IDS_BR_HEADER_SELECT_URLS" +msgstr "選擇網址" + +msgid "IDS_BR_POP_THIS_SITE_IS_ATTEMPTING_TO_OPEN_POP_UP_WINDOW" +msgstr "此網頁正嘗試開啟彈出式視窗" + +msgid "IDS_BR_MBODY_BLOCK_POP_UP_WINDOWS" +msgstr "攔阻彈出視窗" + +msgid "IDS_BR_BODY_TEXT_READER" +msgstr "文本閱讀器" + +msgid "IDS_BR_OPT_COPY_IMAGE" +msgstr "複製圖像" + +msgid "IDS_BR_OPT_SAVE_IMAGE" +msgstr "儲存圖像" + +msgid "IDS_BR_BODY_PLAY" +msgstr "播放" + +msgid "IDS_BR_OPT_SELECT" +msgstr "選擇" + +msgid "IDS_BR_OPT_NAVIGATE_GO_BACKWARD" +msgstr "往後" + +msgid "IDS_BR_OPT_NAVIGATE_GO_FORWARD" +msgstr "往前" + +msgid "IDS_BR_OPT_STOP" +msgstr "停止" + +msgid "IDS_BR_OPT_RELOAD" +msgstr "重新載入" + +msgid "IDS_BR_OPT_PASTE" +msgstr "貼上" + +msgid "IDS_BR_BUTTON_MORE" +msgstr "更多" + +msgid "IDS_BR_POP_FAIL" +msgstr "失敗" + +msgid "IDS_BR_BODY_OPEN_IN_NEW_WINDOW" +msgstr "在新視窗開啟" + +msgid "IDS_BR_OPT_VIEW_DOWNLOAD_LIST" +msgstr "檢視下載清單" + +msgid "IDS_BR_BODY_COPY_URL" +msgstr "複製 URL" + +msgid "IDS_BR_BODY_COPY_URL_TO" +msgstr "複製 URL 到" + +msgid "IDS_BR_BODY_VIEW_IMAGE" +msgstr "檢視圖像" + +msgid "IDS_BR_BODY_PRIVACY_SETTINGS" +msgstr "隱私設定" + +msgid "IDS_BR_BODY_CLEAR_CACHE" +msgstr "清除快取" + +msgid "IDS_BR_BODY_CLEAR_HISTORY" +msgstr "清除記錄" + +msgid "IDS_BR_BODY_ENABLE_PLUG_INS" +msgstr "啟用外掛程式" + +msgid "IDS_BR_BODY_SELECT_SEARCH_ENGINE" +msgstr "設定搜尋引擎" + +msgid "IDS_BR_BODY_DELETE_SAVED_ID_PASSWORD" +msgstr "刪除儲存的帳號/密碼" + +msgid "IDS_BR_BODY_CLEAR_ALL_COOKIE_DATA" +msgstr "清除所有 Cookie 資料" + +msgid "IDS_BR_BODY_UP" +msgstr "上" + +msgid "IDS_BR_BODY_FONT_SIZE" +msgstr "字型大小" + +msgid "IDS_BR_POP_DELETED" +msgstr "已刪除" + +msgid "IDS_BR_BODY_DEFAULT_VIEW" +msgstr "預設檢視" + +msgid "IDS_BR_MBODY_PAGE_CONTENT_SETTINGS" +msgstr "頁面內容設置" + +msgid "IDS_BR_POP_CASE_SENSITIVE" +msgstr "區分大小寫" + +msgid "IDS_BR_BODY_PLUG_IN" +msgstr "外掛" + +msgid "IDS_BR_OPT_PLUGINS_LIST" +msgstr "外掛程式清單" + +msgid "IDS_BR_HEADER_LOCAL_STORAGE" +msgstr "本機儲存裝置" + +msgid "IDS_BR_BODY_DELETE_BROWSING_DATA" +msgstr "刪除瀏覽數據" + +msgid "IDS_BR_BODY_LOADING_ING" +msgstr "正在載入..." + +msgid "IDS_BR_HEADER_LOADING_ING" +msgstr "正在載入..." + +msgid "IDS_BR_HEADER_ENTERURL" +msgstr "輸入網址" + +msgid "IDS_BR_OPT_LOCK" +msgstr "鎖定" + +msgid "IDS_BR_OPT_UNLOCK" +msgstr "解鎖" + +msgid "IDS_BR_BODY_MODIFY" +msgstr "修改" + +msgid "IDS_BR_SK_PAGE_UP" +msgstr "上一頁" + +msgid "IDS_BR_SK_PAGE_DOWN" +msgstr "下一頁" + +msgid "IDS_BR_BODY_DEVELOPER_MODE" +msgstr "程式開發人員模式" + +msgid "IDS_BR_BODY_EMPTY" +msgstr "空白" + +msgid "IDS_BR_BODY_CERTIFICATES" +msgstr "憑證" + +msgid "IDS_BR_BODY_BOOKMARKS" +msgstr "書籤" + +msgid "IDS_BR_BODY_ENTER_NAME" +msgstr "輸入名稱" + +msgid "IDS_BR_BODY_NAME" +msgstr "名稱" + +msgid "IDS_BR_OPT_SEND_VIA_EMAIL" +msgstr "透過電子郵件傳送" + +msgid "IDS_BR_OPT_SEND_VIA_MESSAGE" +msgstr "透過訊息傳送" + +msgid "IDS_BR_BODY_SETTINGS" +msgstr "設定" + +msgid "IDS_BR_BODY_AUTHUSERNAME" +msgstr "使用者名稱" + +msgid "IDS_BR_POP_ALREADY_EXISTS" +msgstr "已存在" + +msgid "IDS_BR_POP_SAVED" +msgstr "已儲存" + +msgid "IDS_BR_POP_NOT_ENOUGH_MEMORY" +msgstr "記憶體不足" + +msgid "IDS_BR_POP_NETWORK_ERROR" +msgstr "網路錯誤" + +msgid "IDS_BR_BODY_ALWAYS_ASK" +msgstr "每次詢問" + +msgid "IDS_BR_BODY_MEMORY_CARD" +msgstr "記憶卡" + +msgid "IDS_BR_BODY_PHONE" +msgstr "電話" + +msgid "IDS_BR_BODY_NO_ACCOUNTS_ABB" +msgstr "無帳號" + +msgid "IDS_BR_HEADER_ERROR_PAGE" +msgstr "錯誤頁面" + +msgid "IDS_BR_BODY_WEB_PAGE_TEMPORARILY_NOT_AVAILABLE" +msgstr "網頁暫時不可用" + +msgid "IDS_BR_BODY_WEB_PAGE_NOT_AVAILABLE" +msgstr "網頁不可用" + +msgid "IDS_BR_BODY_FAILED_TO_LOAD_FRAMES" +msgstr "無法載入框架" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_1" +msgstr "取得網頁 %s 時,發生以下錯誤" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_2" +msgstr "無法取得網頁。(網頁可能暫時關閉或遷移至新的網址)" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_3" +msgstr "可能導致此問題的原因如下" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_4" +msgstr "網路連接未正常建立" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_5" +msgstr "檢查網頁網址" + +msgid "IDS_BR_BODY_LOAD_FAILED_MSG_6" +msgstr "稍候重新載入網頁" + +msgid "IDS_BR_OPT_BOOKMARK" +msgstr "書籤" + +msgid "IDS_BR_BODY_TITLE" +msgstr "標題" + +msgid "IDS_BR_BODY_ENTER_TITLE" +msgstr "輸入標題" + +msgid "IDS_BR_OPT_FOLDERS" +msgstr "資料夾" + +msgid "IDS_BR_OPT_ALLOW" +msgstr "允許" + +msgid "IDS_BR_POP_REFUSE" +msgstr "拒絕" + +msgid "IDS_BR_POP_SECURITY_ERROR_C_UNTRUSTED_SERVER_CERTIFICATE" +msgstr "安全性錯誤:不受信任的伺服器憑證" + +msgid "IDS_BR_POP_PD_ITEMS_SELECTED" +msgstr "已選擇 %d 項目" + +msgid "IDS_BR_POP_1_ITEM_SELECTED" +msgstr "已選擇 1 項目" + diff --git a/resource/default_0 b/resource/default_0 Binary files differnew file mode 100755 index 00000000..e89d759d --- /dev/null +++ b/resource/default_0 diff --git a/resource/default_1 b/resource/default_1 Binary files differnew file mode 100755 index 00000000..cbf16f7b --- /dev/null +++ b/resource/default_1 diff --git a/resource/default_2 b/resource/default_2 Binary files differnew file mode 100755 index 00000000..ffa670b4 --- /dev/null +++ b/resource/default_2 diff --git a/resource/default_3 b/resource/default_3 Binary files differnew file mode 100755 index 00000000..7fca2454 --- /dev/null +++ b/resource/default_3 diff --git a/resource/org.tizen.browser.desktop.in b/resource/org.tizen.browser.desktop.in new file mode 100755 index 00000000..4a171a74 --- /dev/null +++ b/resource/org.tizen.browser.desktop.in @@ -0,0 +1,29 @@ +Name=Internet +Name[en_US]=Internet +Name[nl_NL]=Internet +Name[de_DE]=Internet +Name[zh_HK]=互聯網 +Name[zh_CN]=互联网 +Name[ru_RU]=Интернет +Name[ko_KR]=인터넷 +Name[zh_TW]=網際網路 +Name[ja_JP]=インターネット +Name[es_ES]=Navegador +Name[el_GR]=Internet +Name[it_IT]=Internet +Name[tr_TR]=Internet +Name[pt_PT]=Internet +Name[fr_RF]=Internet +Type=Application +Exec=${PREFIX}/bin/browser +Icon=org.tizen.browser.png +Comment=Browser +MimeType=application/x-shockwave-flash; image/svg+xml; text/html; http.uri; file.uri; application/xml +Version=1.0 +X-TIZEN-BaseLayoutWidth=720 +X-TIZEN-BaseLayoutHeight=1280 +X-TIZEN-IsHorizontalScale=1 +X-TIZEN-TaskManage=True +X-TIZEN-Multiple=False +X-TIZEN-Removable=False +X-TIZEN-SVC=http://tizen.org/appsvc/operation/view|http|NULL,http://tizen.org/appsvc/operation/view|https|NULL,http://tizen.org/appsvc/operation/view|file|NULL,http://tizen.org/appsvc/operation/view|NULL|application/x-shockwave-flash,http://tizen.org/appsvc/operation/view|NULL|image/svg+xml,http://tizen.org/appsvc/operation/view|NULL|text/html,http://tizen.org/appsvc/operation/view|NULL|application/xml diff --git a/resource/org.tizen.browser.png b/resource/org.tizen.browser.png Binary files differnew file mode 100755 index 00000000..d844acae --- /dev/null +++ b/resource/org.tizen.browser.png diff --git a/src/browser-bookmark/browser-add-to-bookmark-view.cpp b/src/browser-bookmark/browser-add-to-bookmark-view.cpp new file mode 100755 index 00000000..76d157e7 --- /dev/null +++ b/src/browser-bookmark/browser-add-to-bookmark-view.cpp @@ -0,0 +1,539 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "browser-add-to-bookmark-view.h" +#include "browser-bookmark-db.h" +#include "browser-bookmark-view.h" +#include "browser-view.h" +#include "browser-select-folder-view.h" + +Browser_Add_To_Bookmark_View::Browser_Add_To_Bookmark_View(string title, string url, + Eina_Bool is_edit_mode, int current_folder_id) +: + m_genlist(NULL) + ,m_conformant(NULL) + ,m_title_cancel_button(NULL) + ,m_title_done_button(NULL) + ,m_title_edit_field(NULL) + ,m_url_edit_field(NULL) + ,m_is_edit_mode(is_edit_mode) + ,m_folder_id_to_save(current_folder_id) + ,m_current_folder_id(current_folder_id) + ,m_navi_it(NULL) +{ + BROWSER_LOGD("[%s]", __func__); + m_title = title; + m_url = url; +} + +Browser_Add_To_Bookmark_View::~Browser_Add_To_Bookmark_View(void) +{ + BROWSER_LOGD("[%s]", __func__); + + /* If browser view -> add to bookmark, then back to browser view. */ + if (!m_data_manager->is_in_view_stack(BR_BOOKMARK_VIEW)) + m_data_manager->destroy_bookmark_db(); + + evas_object_smart_callback_del(m_navi_bar, "transition,finished", __naviframe_pop_finished_cb); +} + +Eina_Bool Browser_Add_To_Bookmark_View::init(void) +{ + BROWSER_LOGD("[%s]", __func__); + + /* If the bookmark view is in view stack, bookmark view -> edit bookmark item. */ + /* Otherwise, this case is browser view -> add to bookmark, then create the bookmar db */ + if (!m_data_manager->is_in_view_stack(BR_BOOKMARK_VIEW)) { + if (!m_data_manager->create_bookmark_db()) { + BROWSER_LOGE("m_data_manager->create_bookmark_db() failed"); + return EINA_FALSE; + } + } + + return _create_main_layout(); +} + +void Browser_Add_To_Bookmark_View::return_to_add_to_bookmark_view(int changed_folder_id) +{ + BROWSER_LOGD("[%s]", __func__); + + /* If changed_folder_id is -1, just cancel the folder view. */ + if (changed_folder_id != -1) { + m_folder_id_to_save = changed_folder_id; + Elm_Object_Item *folder_it = elm_genlist_last_item_get(m_genlist); + if (folder_it) + elm_genlist_item_update(folder_it); + } +} + + +void Browser_Add_To_Bookmark_View::__title_entry_changed_cb(void *data, Evas_Object *obj, void *eventInfo) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_Add_To_Bookmark_View *add_to_bookmark_view = (Browser_Add_To_Bookmark_View *)data; + const char *title = elm_entry_entry_get(br_elm_editfield_entry_get(add_to_bookmark_view->m_title_edit_field)); + const char *url = elm_entry_entry_get(br_elm_editfield_entry_get(add_to_bookmark_view->m_url_edit_field)); + + Eina_Bool only_has_space = EINA_FALSE; + int space_count = 0; + if (title && strlen(title)) { + for (int i = 0 ; i < strlen(title) ; i++) { + if (title[i] == ' ') + space_count++; + } + if (space_count == strlen(title)) + only_has_space = EINA_TRUE; + } + + space_count = 0; + if (url && strlen(url)) { + for (int i = 0 ; i < strlen(url) ; i++) { + if (url[i] == ' ') + space_count++; + } + if (space_count == strlen(url)) + only_has_space = EINA_TRUE; + } + + char *text = elm_entry_markup_to_utf8(elm_entry_entry_get(obj)); + if (!text || strlen(text) == 0 || !title || strlen(title) == 0 + || !url || strlen(url) == 0 || only_has_space) + elm_object_disabled_set(add_to_bookmark_view->m_title_done_button, EINA_TRUE); + else + elm_object_disabled_set(add_to_bookmark_view->m_title_done_button, EINA_FALSE); + + if (text) + free(text); +} + +char *Browser_Add_To_Bookmark_View::__genlist_label_get_cb(void *data, Evas_Object *obj, const char *part) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data || !part) + return NULL; + + if (!strncmp(part, "elm.text.1", strlen("elm.text.1"))) { + Browser_Add_To_Bookmark_View *add_to_bookmark_view = (Browser_Add_To_Bookmark_View *)data; + Browser_Bookmark_DB *bookmark_db = m_data_manager->get_bookmark_db(); + int folder_id = add_to_bookmark_view->m_folder_id_to_save; + + if (add_to_bookmark_view->m_folder_id_to_save == BROWSER_BOOKMARK_MAIN_FOLDER_ID) + return strdup(BR_STRING_BOOKMARKS); + else { + string default_folder_name = bookmark_db->get_folder_name_by_id(folder_id); + return strdup(default_folder_name.c_str()); + } + } else if (!strncmp(part, "elm.text.2", strlen("elm.text.2"))) + return strdup(BR_STRING_FOLDER); + + return NULL; +} + +Evas_Object *Browser_Add_To_Bookmark_View::__genlist_icon_get_cb(void *data, Evas_Object *obj, const char *part) +{ + BROWSER_LOGD("[%s]", part); + if (!data || !part) + return NULL; + + genlist_item_param *param = (genlist_item_param *)data; + field_type type = param->type; + Browser_Add_To_Bookmark_View *add_to_bookmark_view = param->add_to_bookmark_view; + string title = add_to_bookmark_view->m_title; + string url = add_to_bookmark_view->m_url; + + if (!strncmp(part, "elm.icon", strlen("elm.icon"))) { + if (type == TITLE_EDIT_FIELD) { + add_to_bookmark_view->m_title_edit_field = br_elm_editfield_add(obj, EINA_TRUE); + if (!add_to_bookmark_view->m_title_edit_field) + return NULL; + br_elm_editfield_entry_single_line_set(add_to_bookmark_view->m_title_edit_field, EINA_TRUE); + br_elm_editfield_guide_text_set(add_to_bookmark_view->m_title_edit_field, BR_STRING_CLICK_HERE); + br_elm_editfield_label_set(add_to_bookmark_view->m_title_edit_field, BR_STRING_TITLE); + + evas_object_smart_callback_add(br_elm_editfield_entry_get(add_to_bookmark_view->m_title_edit_field), + "changed", __title_entry_changed_cb, add_to_bookmark_view); + + if (!add_to_bookmark_view->m_input_title.empty()) { + elm_entry_entry_set(br_elm_editfield_entry_get(add_to_bookmark_view->m_title_edit_field), + add_to_bookmark_view->m_input_title.c_str()); + add_to_bookmark_view->m_input_title.clear(); + } else { + char *mark_up = elm_entry_utf8_to_markup(title.c_str()); + if (!mark_up) { + BROWSER_LOGE("elm_entry_utf8_to_markup failed"); + return NULL; + } + elm_entry_entry_set(br_elm_editfield_entry_get(add_to_bookmark_view->m_title_edit_field), mark_up); + + if (mark_up) + free(mark_up); + } + + return add_to_bookmark_view->m_title_edit_field; + } else { + add_to_bookmark_view->m_url_edit_field = br_elm_editfield_add(obj, EINA_TRUE); + if (!add_to_bookmark_view->m_url_edit_field) + return NULL; + br_elm_editfield_entry_single_line_set(add_to_bookmark_view->m_url_edit_field, EINA_TRUE); + br_elm_editfield_label_set(add_to_bookmark_view->m_url_edit_field, BR_STRING_URL); + elm_entry_input_panel_layout_set(br_elm_editfield_entry_get(add_to_bookmark_view->m_url_edit_field), + ELM_INPUT_PANEL_LAYOUT_URL); + + evas_object_smart_callback_add(br_elm_editfield_entry_get(add_to_bookmark_view->m_url_edit_field), + "changed", __title_entry_changed_cb, add_to_bookmark_view); + + if (!add_to_bookmark_view->m_input_url.empty()) { + elm_entry_entry_set(br_elm_editfield_entry_get(add_to_bookmark_view->m_url_edit_field), + add_to_bookmark_view->m_input_url.c_str()); + add_to_bookmark_view->m_input_url.clear(); + } else { + char *mark_up = elm_entry_utf8_to_markup(url.c_str()); + if (!mark_up) { + BROWSER_LOGE("elm_entry_utf8_to_markup failed"); + return NULL; + } + elm_entry_entry_set(br_elm_editfield_entry_get(add_to_bookmark_view->m_url_edit_field), mark_up); + if (mark_up) + free(mark_up); + } + + return add_to_bookmark_view->m_url_edit_field; + } + } + + return NULL; +} + +Evas_Object *Browser_Add_To_Bookmark_View::_create_content_genlist(void) +{ + BROWSER_LOGD("[%s]", __func__); + Evas_Object *genlist = elm_genlist_add(m_conformant); + if (!genlist) { + BROWSER_LOGE("elm_genlist_add failed"); + return NULL; + } + + m_edit_field_item_class.item_style = "dialogue/1icon"; + m_edit_field_item_class.func.text_get = NULL; + m_edit_field_item_class.func.content_get = __genlist_icon_get_cb; + m_edit_field_item_class.func.state_get = NULL; + m_edit_field_item_class.func.del = NULL; + + m_title_param.type = TITLE_EDIT_FIELD; + m_title_param.add_to_bookmark_view = this; + elm_genlist_item_append(genlist, &m_edit_field_item_class, &m_title_param, NULL, + ELM_GENLIST_ITEM_NONE, NULL, NULL); + + m_seperator_item_class.item_style = "dialogue/seperator"; + m_seperator_item_class.func.text_get = NULL; + m_seperator_item_class.func.del = NULL; + m_seperator_item_class.func.content_get = NULL; + m_seperator_item_class.func.state_get = NULL; + Elm_Object_Item *it = elm_genlist_item_append(genlist, &m_seperator_item_class, NULL, NULL, + ELM_GENLIST_ITEM_NONE, NULL, NULL); + elm_genlist_item_select_mode_set(it, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY); + + m_url_param.type = URL_EDIT_FIELD; + m_url_param.add_to_bookmark_view = this; + elm_genlist_item_append(genlist, &m_edit_field_item_class, &m_url_param, NULL, + ELM_GENLIST_ITEM_NONE, NULL, NULL); + + it = elm_genlist_item_append(genlist, &m_seperator_item_class, NULL, NULL, + ELM_GENLIST_ITEM_NONE, NULL, NULL); + + elm_genlist_item_select_mode_set(it, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY); + + m_folder_item_class.item_style = "dialogue/2text.2"; + m_folder_item_class.func.text_get = __genlist_label_get_cb; + m_folder_item_class.func.content_get = NULL; + m_folder_item_class.func.state_get = NULL; + m_folder_item_class.func.del = NULL; + + elm_genlist_item_append(genlist, &m_folder_item_class, this, NULL, ELM_GENLIST_ITEM_NONE, + _select_folder_clicked_cb, this); + + evas_object_show(genlist); + + return genlist; +} + +void Browser_Add_To_Bookmark_View::_select_folder_clicked_cb(void *data, Evas_Object *obj, void *eventInfo) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_Add_To_Bookmark_View *add_to_bookmark_view = (Browser_Add_To_Bookmark_View *)data; + if (!m_data_manager->create_select_folder_view(add_to_bookmark_view->m_current_folder_id)) { + BROWSER_LOGE("m_data_manager->create_select_folder_view failed"); + return; + } + + if (!m_data_manager->get_select_folder_view()->init()) { + BROWSER_LOGE("get_select_folder_view()->init failed"); + m_data_manager->destroy_select_folder_view(); + } + + Elm_Object_Item *it = elm_genlist_selected_item_get(obj); + elm_genlist_item_selected_set(it, EINA_FALSE); + + add_to_bookmark_view->m_input_title = std::string(elm_entry_entry_get(br_elm_editfield_entry_get(add_to_bookmark_view->m_title_edit_field))); + add_to_bookmark_view->m_input_url = std::string(elm_entry_entry_get(br_elm_editfield_entry_get(add_to_bookmark_view->m_url_edit_field))); +} + +void Browser_Add_To_Bookmark_View::__cancel_button_clicked_cb(void *data, Evas_Object *obj, void *eventInfo) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_Add_To_Bookmark_View *add_to_bookmark_view = (Browser_Add_To_Bookmark_View *)data; + Evas_Object *navi_bar = add_to_bookmark_view->m_navi_bar; + + if (elm_naviframe_bottom_item_get(navi_bar) != elm_naviframe_top_item_get(navi_bar)) + elm_naviframe_item_pop(navi_bar); + + if (m_data_manager->is_in_view_stack(BR_ADD_TO_BOOKMARK_VIEW)) { + /* Set the title if enter the add to bookmark while loading. */ + m_data_manager->get_browser_view()->return_to_browser_view(); + } + + if (m_data_manager->is_in_view_stack(BR_BOOKMARK_VIEW) && m_data_manager->get_bookmark_view()) + /* boomark view -> edit one bookmark item, then cancel. */ + m_data_manager->get_bookmark_view()->return_to_bookmark_view(); +} + +/* bookmark -> edit -> edit each bookmark item then bookmark edit view -> done */ +Eina_Bool Browser_Add_To_Bookmark_View::_modify_bookmark_item(const char *title, const char *url) +{ + int bookmark_id = 0; + int ret = EINA_TRUE; + Browser_Bookmark_DB *bookmark_db = m_data_manager->get_bookmark_db(); + ret = bookmark_db->get_bookmark_id_by_title_url(m_current_folder_id, m_title.c_str(), m_url.c_str(), &bookmark_id); + if (!ret) + return EINA_FALSE; + ret = bookmark_db->modify_bookmark(bookmark_id, m_folder_id_to_save, title, url); + if (!ret) + return EINA_FALSE; + + Browser_Bookmark_DB::bookmark_item *item = NULL; + + Browser_Bookmark_View *bookmark_view = m_data_manager->get_bookmark_view(); + Elm_Object_Item *bookmark_edit_it = bookmark_view->m_current_genlist_item_to_edit; + item = (Browser_Bookmark_DB::bookmark_item *)elm_object_item_data_get(bookmark_edit_it); + + item->title = title; + item->url = url; + elm_object_item_data_set(bookmark_edit_it, item); + + if (m_current_folder_id != m_folder_id_to_save) { + if (m_folder_id_to_save == BROWSER_BOOKMARK_MAIN_FOLDER_ID) { + /* If the bookmark item in sub folder is moved to main folder, + * remove it from sub folder and append it to main folder. */ + for(int i = 0 ; i < bookmark_view->m_sub_folder_list.size() ; i++) { + if (bookmark_view->m_sub_folder_list[i] == item) { + bookmark_view->m_sub_folder_list.erase(bookmark_view->m_sub_folder_list.begin() + i); + break; + } + } + + /* If the bookmark is empty page, destroy the empty layout to show the bookmark list. */ + if (bookmark_view->m_main_folder_list.size() == 0) + bookmark_view->_show_empty_content_layout(EINA_TRUE); + else + bookmark_view->_show_empty_content_layout(EINA_FALSE); + } else if (m_current_folder_id == BROWSER_BOOKMARK_MAIN_FOLDER_ID) { + /* Move one bookmark item from main folder to sub folder. */ + for(int i = 0 ; i < bookmark_view->m_main_folder_list.size() ; i++) { + if (bookmark_view->m_main_folder_list[i] == item) { + delete bookmark_view->m_main_folder_list[i]; + bookmark_view->m_main_folder_list.erase(bookmark_view->m_main_folder_list.begin() + i); + break; + } + } + } else { + /* If the bookmark item in sub folder is moved to another sub folder, + * just remove the item from the genlist and delete the malloced item.*/ + for(int i = 0 ; i < bookmark_view->m_sub_folder_list.size() ; i++) { + if (bookmark_view->m_sub_folder_list[i] == item) { + delete item; + bookmark_view->m_sub_folder_list.erase(bookmark_view->m_sub_folder_list.begin() + i); + break; + } + } + } + + elm_object_item_del(bookmark_edit_it); + } + + return EINA_TRUE; +} + +Eina_Bool Browser_Add_To_Bookmark_View::_save_bookmark_item(const char *title, const char *url) +{ + BROWSER_LOGD("[%s]", __func__); + return m_data_manager->get_bookmark_db()->save_bookmark(m_folder_id_to_save, title, url); +} + +void Browser_Add_To_Bookmark_View::__done_button_clicked_cb(void *data, Evas_Object *obj, void *eventInfo) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_Add_To_Bookmark_View *add_to_bookmark_view = (Browser_Add_To_Bookmark_View *)data; + Evas_Object *navi_bar = add_to_bookmark_view->m_navi_bar; + Evas_Object *url_edit_field_entry = br_elm_editfield_entry_get(add_to_bookmark_view->m_url_edit_field); + char *url = elm_entry_markup_to_utf8(elm_entry_entry_get(url_edit_field_entry)); + Evas_Object *title_edit_field_entry = br_elm_editfield_entry_get(add_to_bookmark_view->m_title_edit_field); + char *title = elm_entry_markup_to_utf8(elm_entry_entry_get(title_edit_field_entry)); + + if (!url || strlen(url) == 0) { + add_to_bookmark_view->show_msg_popup(BR_STRING_ENTER_URL); + return; + } + if (!title || strlen(title) == 0) { + add_to_bookmark_view->show_msg_popup(BR_STRING_ENTER_TITLE); + return; + } + + add_to_bookmark_view->_done_button_clicked(title, url); + + if (url) + free(url); + if (title) + free(title); +} + +void Browser_Add_To_Bookmark_View::_done_button_clicked(const char *title, const char* url) +{ + Browser_Bookmark_DB *bookmark_db = m_data_manager->get_bookmark_db(); + Eina_Bool is_duplicate = bookmark_db->is_duplicated(m_folder_id_to_save, title, url); + if (!is_duplicate) { + if (bookmark_db->is_full()) { + show_msg_popup(BR_STRING_WARNING, + BR_STRING_WARNING_OVER_BOOKMARK_LIMIT, 5); + return; + } else { + int ret = EINA_TRUE; + if (!m_is_edit_mode) + ret = _save_bookmark_item(title, url); + else + ret = _modify_bookmark_item(title, url); + + if (!ret) { + show_msg_popup(BR_STRING_FAILED); + return; + } else { + if (elm_naviframe_bottom_item_get(m_navi_bar) != elm_naviframe_top_item_get(m_navi_bar)) + elm_naviframe_item_pop(m_navi_bar); + + if (!m_data_manager->is_in_view_stack(BR_BOOKMARK_VIEW)) { + + m_data_manager->get_browser_view()->return_to_browser_view(); + m_data_manager->get_browser_view()->show_notify_popup(BR_STRING_SAVED, 3); + } else { + int added_bookmark_id = -1; + bookmark_db->get_bookmark_id_by_title_url(m_folder_id_to_save, title, + url, &added_bookmark_id); + BROWSER_LOGD("added_bookmark_id=%d", added_bookmark_id); + /* History view -> slide one item -> add to bookmark, then done. */ + m_data_manager->get_bookmark_view()->return_to_bookmark_view(added_bookmark_id); + + m_data_manager->get_browser_view()->show_notify_popup(BR_STRING_SAVED, 3, EINA_TRUE); + } + } + } + } else + show_msg_popup(BR_STRING_ALREADY_EXISTS); +} + +void Browser_Add_To_Bookmark_View::__naviframe_pop_finished_cb(void *data , Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_Add_To_Bookmark_View *add_to_bookmark_view = (Browser_Add_To_Bookmark_View *)data; + Elm_Object_Item *it = (Elm_Object_Item *)event_info; + + if (add_to_bookmark_view->m_navi_it != elm_naviframe_top_item_get(m_navi_bar)) + return; + + m_data_manager->destroy_select_folder_view(); +} + +Eina_Bool Browser_Add_To_Bookmark_View::_create_main_layout(void) +{ + BROWSER_LOGD("[%s]", __func__); + elm_win_conformant_set(m_win, EINA_TRUE); + m_conformant = elm_conformant_add(m_win); + if (!m_conformant) { + BROWSER_LOGE("elm_conformant_add failed"); + return EINA_FALSE; + } + elm_object_style_set(m_conformant, "internal_layout"); + evas_object_size_hint_weight_set(m_conformant, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_show(m_conformant); + + m_genlist = _create_content_genlist(); + if (!m_genlist) { + BROWSER_LOGE("_create_content_genlist failed"); + return EINA_FALSE; + } + + elm_object_content_set(m_conformant, m_genlist); + if (m_is_edit_mode) + m_navi_it = elm_naviframe_item_push(m_navi_bar, BR_STRING_EDIT_BOOKMARK, NULL, + NULL, m_conformant, "browser_titlebar"); + else + m_navi_it = elm_naviframe_item_push(m_navi_bar, BR_STRING_ADD_TO_BOOKMARKS, NULL, + NULL, m_conformant, "browser_titlebar"); + + elm_object_item_part_content_set(m_navi_it, ELM_NAVIFRAME_ITEM_PREV_BTN, NULL); + + evas_object_smart_callback_add(m_navi_bar, "transition,finished", __naviframe_pop_finished_cb, this); + + m_title_cancel_button = elm_button_add(m_conformant); + if (!m_title_cancel_button) { + BROWSER_LOGE("elm_button_add failed!"); + return EINA_FALSE; + } + elm_object_style_set(m_title_cancel_button, "browser/title_button"); + elm_object_text_set(m_title_cancel_button, BR_STRING_CANCEL); + evas_object_smart_callback_add(m_title_cancel_button, "clicked", __cancel_button_clicked_cb, this); + + elm_object_item_part_content_set(m_navi_it, ELM_NAVIFRAME_ITEM_TITLE_LEFT_BTN, m_title_cancel_button); + evas_object_show(m_title_cancel_button); + + m_title_done_button = elm_button_add(m_conformant); + if (!m_title_done_button) { + BROWSER_LOGE("elm_button_add failed!"); + return EINA_FALSE; + } + elm_object_style_set(m_title_done_button, "browser/title_button"); + elm_object_text_set(m_title_done_button, BR_STRING_DONE); + evas_object_smart_callback_add(m_title_done_button, "clicked", __done_button_clicked_cb, this); + + elm_object_item_part_content_set(m_navi_it, ELM_NAVIFRAME_ITEM_TITLE_RIGHT_BTN, m_title_done_button); + evas_object_show(m_title_done_button); + + return EINA_TRUE; +} + diff --git a/src/browser-bookmark/browser-add-to-bookmark-view.h b/src/browser-bookmark/browser-add-to-bookmark-view.h new file mode 100755 index 00000000..010db88d --- /dev/null +++ b/src/browser-bookmark/browser-add-to-bookmark-view.h @@ -0,0 +1,87 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef BROWSER_ADD_TO_BOOKMARK_VIEW_H +#define BROWSER_ADD_TO_BOOKMARK_VIEW_H + +#include "browser-common-view.h" +#include "browser-config.h" + +class Browser_Add_To_Bookmark_View : public Browser_Common_View { +public: + Browser_Add_To_Bookmark_View(string title, string url, + Eina_Bool is_edit_mode = EINA_FALSE, int current_folder_id = BROWSER_BOOKMARK_MAIN_FOLDER_ID); + ~Browser_Add_To_Bookmark_View(void); + + Eina_Bool init(void); + + void return_to_add_to_bookmark_view(int changed_folder_id); +private: + typedef enum _field_type{ + TITLE_EDIT_FIELD = 0, + URL_EDIT_FIELD, + UNKOWN_FIELD + } field_type; + + typedef struct _genlist_item_param { + field_type type; + Browser_Add_To_Bookmark_View *add_to_bookmark_view; + } genlist_item_param; + + Eina_Bool _create_main_layout(void); + Evas_Object *_create_content_genlist(void); + Eina_Bool _save_bookmark_item(const char *title, const char *url); + Eina_Bool _modify_bookmark_item(const char *title, const char *url); + + void _done_button_clicked(const char *title, const char* url); + + /* genlist data callback functions */ + static char *__genlist_label_get_cb(void *data, Evas_Object *obj, const char *part); + static Evas_Object *__genlist_icon_get_cb(void *data, Evas_Object *obj, const char *part); + + /* elementary event callback functions */ + static void __cancel_button_clicked_cb(void *data, Evas_Object *obj, void *event_info); + static void __done_button_clicked_cb(void *data, Evas_Object *obj, void *event_info); + static void _select_folder_clicked_cb(void *data, Evas_Object *obj, void *event_info); + static void __title_entry_changed_cb(void *data, Evas_Object *obj, void *event_info); + static void __naviframe_pop_finished_cb(void *data , Evas_Object *obj, void *event_info); + + Elm_Genlist_Item_Class m_edit_field_item_class; + Elm_Genlist_Item_Class m_seperator_item_class; + Elm_Genlist_Item_Class m_folder_item_class; + genlist_item_param m_title_param; + genlist_item_param m_url_param; + + Evas_Object *m_genlist; + Evas_Object *m_conformant; + Evas_Object *m_title_cancel_button; + Evas_Object *m_title_done_button; + Evas_Object *m_title_edit_field; + Evas_Object *m_url_edit_field; + + string m_title; + string m_url; + Eina_Bool m_is_edit_mode; + int m_folder_id_to_save; + int m_current_folder_id; + + Elm_Object_Item* m_navi_it; + + std::string m_input_title; + std::string m_input_url; +}; +#endif /* BROWSER_ADD_TO_BOOKMARK_VIEW_H */ + diff --git a/src/browser-bookmark/browser-bookmark-view.cpp b/src/browser-bookmark/browser-bookmark-view.cpp new file mode 100755 index 00000000..7c07da4b --- /dev/null +++ b/src/browser-bookmark/browser-bookmark-view.cpp @@ -0,0 +1,2128 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "browser-add-to-bookmark-view.h" +#include "browser-bookmark-db.h" +#include "browser-bookmark-view.h" +#include "browser-history-layout.h" +#include "browser-new-folder-view.h" +#include "browser-string.h" +#include "browser-view.h" + +#define UPPER_FOLDER_ICON_SIZE (64 * elm_scale_get()) + +Browser_Bookmark_View::Browser_Bookmark_View(void) +: m_back_button(NULL) + ,m_top_control_bar(NULL) + ,m_conformant(NULL) + ,m_content_layout(NULL) + ,m_genlist_content_layout(NULL) + ,m_genlist_content_box(NULL) + ,m_main_folder_genlist(NULL) + ,m_sub_folder_genlist(NULL) + ,m_main_layout(NULL) + ,m_upper_folder_list(NULL) + ,m_upper_folder_icon(NULL) + ,m_view_mode(BOOKMARK_VIEW) + ,m_edit_mode_select_all_layout(NULL) + ,m_edit_mode_select_all_check_button(NULL) + ,m_current_folder_id(BROWSER_BOOKMARK_MAIN_FOLDER_ID) + ,m_no_contents(NULL) + ,m_current_genlist_item_to_edit(NULL) + ,m_sub_folder_conformant(NULL) + ,m_processing_popup_timer(NULL) + ,m_processing_progress_bar(NULL) + ,m_processed_it(NULL) + ,m_processed_count(0) + ,m_total_item_count(0) + ,m_processing_popup(NULL) + ,m_processing_popup_layout(NULL) + ,m_select_all_check_value(EINA_FALSE) + ,m_bottom_control_bar(NULL) + ,m_bookmark_delete_controlbar_item(NULL) + ,m_bookmark_edit_controlbar_item(NULL) + ,m_create_folder_controlbar_item(NULL) + ,m_navi_it(NULL) + ,m_delete_confirm_popup(NULL) + ,m_rename_edit_field(NULL) +{ + BROWSER_LOGD("[%s]", __func__); + m_current_bookmark_navigationbar_title = ""; +} + +Browser_Bookmark_View::~Browser_Bookmark_View(void) +{ + BROWSER_LOGD("[%s]", __func__); + hide_notify_popup(); + + for(int i = 0 ; i < m_sub_folder_list.size() ; i++ ) { + if (m_sub_folder_list[i]) + delete m_sub_folder_list[i]; + } + m_sub_folder_list.clear(); + + for(int i = 0 ; i < m_main_folder_list.size() ; i++ ) { + if (m_main_folder_list[i]) + delete m_main_folder_list[i]; + } + m_main_folder_list.clear(); + + m_data_manager->destroy_bookmark_db(); + + evas_object_smart_callback_del(m_navi_bar, "transition,finished", __naviframe_pop_finished_cb); + + if (m_delete_confirm_popup) + evas_object_del(m_delete_confirm_popup); +} + +Eina_Bool Browser_Bookmark_View::init(void) +{ + BROWSER_LOGD("[%s]", __func__); + if (!m_data_manager->create_bookmark_db()) { + BROWSER_LOGE("m_data_manager->create_bookmark_db failed"); + return EINA_FALSE; + } + + return _create_main_layout(); +} + +void Browser_Bookmark_View::return_to_bookmark_view(int added_bookmark_id) +{ + BROWSER_LOGD("added_bookmark_id = %d", added_bookmark_id); + if (m_view_mode == BOOKMARK_VIEW) { + /* In case that bookmark view -> Edit bookmark item, then return to bookmark view. */ + if (elm_genlist_decorate_mode_get(_get_current_folder_genlist())) { + int delete_item_count = 0; + int editable_item_count = 0; + Elm_Object_Item *it = elm_genlist_first_item_get(_get_current_folder_genlist()); + while(it) { + Browser_Bookmark_DB::bookmark_item *item = NULL; + item = (Browser_Bookmark_DB::bookmark_item *)elm_object_item_data_get(it); + if (item->is_editable) + editable_item_count++; + if (item->is_delete) + delete_item_count++; + it = elm_genlist_item_next_get(it); + } + + if (editable_item_count == delete_item_count) + elm_check_state_set(m_edit_mode_select_all_check_button, EINA_TRUE); + else + elm_check_state_set(m_edit_mode_select_all_check_button, EINA_FALSE); + + if (delete_item_count == 0) + elm_object_item_disabled_set(m_bookmark_delete_controlbar_item, EINA_TRUE); + } + + int size = _get_current_folder_item_list().size(); + if (size == 0) + _show_empty_content_layout(EINA_TRUE); + else + _show_empty_content_layout(EINA_FALSE); + } else { + if (!m_data_manager->get_history_layout()) + return; + } + + /* boomark view -> history -> add to bookmark by slide button, then done. */ + if (added_bookmark_id != -1) { + Browser_Bookmark_DB::bookmark_item *item = m_data_manager->get_bookmark_db()->get_bookmark_item_by_id(added_bookmark_id); + if (!item) { + BROWSER_LOGE("get_bookmark_item_by_id failed"); + return; + } + + Elm_Object_Item *it = elm_genlist_first_item_get(_get_current_folder_genlist()); + while (it) { + Browser_Bookmark_DB::bookmark_item *exist_item = NULL; + exist_item = (Browser_Bookmark_DB::bookmark_item *)elm_object_item_data_get(it); + if (exist_item->id == added_bookmark_id) { + exist_item->url = item->url; + exist_item->title = item->title; + exist_item->parent = item->parent; + elm_genlist_item_update(it); + return; + } + it = elm_genlist_item_next_get(it); + } + + if (m_current_folder_id == item->parent) { + /* If the saved bookmark item is in the current folder, just add it to current folder. */ + Evas_Object *genlist = NULL; + if (item->parent == BROWSER_BOOKMARK_MAIN_FOLDER_ID) + genlist = m_main_folder_genlist; + else + genlist = m_sub_folder_genlist; + + item->user_data_1 = (void *)this; + item->user_data_2 = (void *)elm_genlist_item_append(genlist, &m_bookmark_genlist_item_class, + item, NULL, ELM_GENLIST_ITEM_NONE, + __bookmark_item_clicked_cb, this); + + if (item->parent == BROWSER_BOOKMARK_MAIN_FOLDER_ID) + m_main_folder_list.push_back(item); + else + m_sub_folder_list.push_back(item); + } else if (m_current_folder_id != BROWSER_BOOKMARK_MAIN_FOLDER_ID + && item->parent == BROWSER_BOOKMARK_MAIN_FOLDER_ID){ + /* If the current folder is sub folder but the saved folder is main folder, + * add the saved bookmark item to main folder. */ + item->user_data_1 = (void *)this; + item->user_data_2 = (void *)elm_genlist_item_append(m_main_folder_genlist, &m_bookmark_genlist_item_class, + item, NULL, ELM_GENLIST_ITEM_NONE, + __bookmark_item_clicked_cb, this); + m_main_folder_list.push_back(item); + } + + /* If the bookmark is empty page, destroy the empty layout to show the bookmark list. */ + if (_get_current_folder_item_list().size() == 0) + _show_empty_content_layout(EINA_TRUE); + else + _show_empty_content_layout(EINA_FALSE); + } +} + +void Browser_Bookmark_View::__back_button_clicked_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_Bookmark_View *bookmark_view = (Browser_Bookmark_View *)data; + Evas_Object *navi_bar = bookmark_view->m_navi_bar; + + if (elm_naviframe_bottom_item_get(navi_bar) != elm_naviframe_top_item_get(navi_bar)) + elm_naviframe_item_pop(navi_bar); + + /* Set the title if enter the add to bookmark while loading. */ + m_data_manager->get_browser_view()->return_to_browser_view(); +} + +void Browser_Bookmark_View::__edit_controlbar_item_clicked_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_Bookmark_View *bookmark_view = (Browser_Bookmark_View *)data; + Browser_History_Layout *history_layout = m_data_manager->get_history_layout(); + + if (bookmark_view->m_view_mode == BOOKMARK_VIEW) { + if (!elm_genlist_decorate_mode_get(bookmark_view->_get_current_folder_genlist())) + /* Edit bookmark */ + bookmark_view->_set_edit_mode(EINA_TRUE); + else { + if (bookmark_view->m_rename_edit_field) { + Browser_Bookmark_DB::bookmark_item *item = NULL; + item = (Browser_Bookmark_DB::bookmark_item *)evas_object_data_get(bookmark_view->m_rename_edit_field, "item"); + Evas_Object *edit_field_entry = br_elm_editfield_entry_get(bookmark_view->m_rename_edit_field); + elm_entry_entry_set(edit_field_entry, item->title.c_str()); + } + + /* Cancel Edit bookmark */ + bookmark_view->_set_edit_mode(EINA_FALSE); + } + } else if (history_layout) { + if (!elm_genlist_decorate_mode_get(history_layout->m_history_genlist)) { + /* Delete history */ + history_layout->_set_edit_mode(EINA_TRUE); + } else { + /* Cancel Delete bookmark */ + history_layout->_set_edit_mode(EINA_FALSE); + } + } + + if (bookmark_view->m_rename_edit_field) + elm_object_focus_set(bookmark_view->m_rename_edit_field, EINA_FALSE); +} + +void Browser_Bookmark_View::__delete_controlbar_item_clicked_cb(void *data, Evas_Object *obj, void *event_info) +{ + if (!data) + return; + + Browser_Bookmark_View *bookmark_view = (Browser_Bookmark_View *)data; + Browser_History_Layout *history_layout = m_data_manager->get_history_layout(); + + if (bookmark_view->m_view_mode == BOOKMARK_VIEW) { + if (elm_genlist_decorate_mode_get(bookmark_view->_get_current_folder_genlist())) { + /* Delete bookmark */ + Evas_Object *ok_button = bookmark_view->_show_delete_confirm_popup(); + if (ok_button) + evas_object_smart_callback_add(ok_button, "clicked", + __delete_confirm_response_by_edit_mode_cb, bookmark_view); + + } + } else { + if (history_layout && elm_genlist_decorate_mode_get(history_layout->m_history_genlist)) { + /* Delete bookmark */ + Evas_Object *ok_button = history_layout->_show_delete_confirm_popup(); + if (ok_button) + evas_object_smart_callback_add(ok_button, "clicked", + Browser_History_Layout::__delete_confirm_response_by_edit_mode_cb, + history_layout); + } + } +} + +void Browser_Bookmark_View::_delete_bookmark_item_from_folder_list(Browser_Bookmark_DB::bookmark_item *item) +{ + if (m_current_folder_id == BROWSER_BOOKMARK_MAIN_FOLDER_ID) { + for(int index = 0 ; index < m_main_folder_list.size() ; index++) { + if (m_main_folder_list[index] == item) { + delete m_main_folder_list[index]; + m_main_folder_list.erase(m_main_folder_list.begin() + index); + } + } + } else { + for(int index = 0 ; index < m_sub_folder_list.size() ; index++) { + if (m_sub_folder_list[index] == item) { + delete m_sub_folder_list[index]; + m_sub_folder_list.erase(m_sub_folder_list.begin() + index); + } + } + } +} + +void Browser_Bookmark_View::_delete_selected_bookmark(void) +{ + BROWSER_LOGD("[%s]", __func__); + Browser_Bookmark_DB *bookmark_db = m_data_manager->get_bookmark_db(); + Eina_List *delete_item_list = NULL; + Elm_Object_Item *it = elm_genlist_first_item_get(_get_current_folder_genlist()); + int remain_count = 0; + while(it) { + Browser_Bookmark_DB::bookmark_item *item = NULL; + item = (Browser_Bookmark_DB::bookmark_item *)elm_object_item_data_get(it); + if (item->is_delete) + delete_item_list = eina_list_append(delete_item_list, it); + else + remain_count++; + it = elm_genlist_item_next_get(it); + } + + int count = eina_list_count(delete_item_list); + + if (count >= BROWSER_BOOKMARK_PROCESS_BLOCK_COUNT) { + /* If delete more than 100 items, show the processing popup. */ + _show_delete_processing_popup(); + } else { + for (int i = 0; i < count; i++) { + it = (Elm_Object_Item *)eina_list_data_get(delete_item_list); + Browser_Bookmark_DB::bookmark_item *item = NULL; + Eina_Bool ret = EINA_TRUE; + item = (Browser_Bookmark_DB::bookmark_item *)elm_object_item_data_get(it); + if (item->is_folder) { + int folder_id = 0; + ret = bookmark_db->get_folder_id(m_current_folder_id, item->title.c_str(), &folder_id); + if (!ret) { + BROWSER_LOGE("bookmark_db->get_folder_id failed"); + return; + } + ret = bookmark_db->delete_folder(folder_id); + if (!ret) { + BROWSER_LOGE("bookmark_db->delete_folder failed"); + return; + } + } else { + ret = bookmark_db->delete_bookmark(item->id); + if (!ret) { + BROWSER_LOGE("bookmark_db->delete_bookmark failed"); + return; + } + } + delete_item_list = eina_list_next(delete_item_list); + + _delete_bookmark_item_from_folder_list(item); + + elm_object_item_del(it); + } + eina_list_free(delete_item_list); + + elm_check_state_set(m_edit_mode_select_all_check_button, EINA_FALSE); + + if (remain_count == 0) + _show_empty_content_layout(EINA_TRUE); + + show_notify_popup(BR_STRING_DELETED, 3, EINA_TRUE); + } +} + +void Browser_Bookmark_View::__edit_mode_item_check_changed_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + Browser_Bookmark_DB::bookmark_item *item = (Browser_Bookmark_DB::bookmark_item *)data; + Browser_Bookmark_View *bookmark_view = (Browser_Bookmark_View *)(item->user_data_1); + int delete_item_count = 0; + int editable_item_count = 0; + + Elm_Object_Item *it = elm_genlist_first_item_get(bookmark_view->_get_current_folder_genlist()); + while(it) { + Browser_Bookmark_DB::bookmark_item *item = NULL; + item = (Browser_Bookmark_DB::bookmark_item *)elm_object_item_data_get(it); + if (item->is_editable) + editable_item_count++; + if (item->is_delete) + delete_item_count++; + it = elm_genlist_item_next_get(it); + } + + if (editable_item_count == delete_item_count) + elm_check_state_set(bookmark_view->m_edit_mode_select_all_check_button, EINA_TRUE); + else + elm_check_state_set(bookmark_view->m_edit_mode_select_all_check_button, EINA_FALSE); + + bookmark_view->_show_selection_info(); +} + +void Browser_Bookmark_View::_show_delete_processing_popup(void) +{ + BROWSER_LOGD("[%s]", __func__); + if (m_processing_popup) + evas_object_del(m_processing_popup); + + m_processing_popup = elm_popup_add(m_main_layout); + if (!m_processing_popup) { + BROWSER_LOGE("elm_popup_add failed"); + return; + } + + if (m_processing_popup_layout) + evas_object_del(m_processing_popup_layout); + m_processing_popup_layout = elm_layout_add(m_processing_popup); + if (!m_processing_popup_layout) { + BROWSER_LOGE("elm_layout_add failed"); + return; + } + if (!elm_layout_file_set(m_processing_popup_layout, BROWSER_EDJE_DIR"/browser-bookmark-view.edj", + "browser/popup_center_progressview")) { + BROWSER_LOGE("elm_layout_file_set failed"); + return; + } + evas_object_size_hint_weight_set(m_processing_popup_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + + m_processing_progress_bar = elm_progressbar_add(m_processing_popup); + elm_object_style_set(m_processing_progress_bar, "list_progress"); + elm_progressbar_horizontal_set(m_processing_progress_bar, EINA_TRUE); + evas_object_size_hint_align_set(m_processing_progress_bar, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_size_hint_weight_set(m_processing_progress_bar, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_progressbar_value_set(m_processing_progress_bar, 0.0); + + if (m_processing_popup_timer) + ecore_timer_del(m_processing_popup_timer); + + m_processed_count = 0; + m_processed_it = elm_genlist_last_item_get(_get_current_folder_genlist()); + + Elm_Object_Item *it = elm_genlist_first_item_get(_get_current_folder_genlist()); + m_total_item_count = 0; + while(it) { + Browser_Bookmark_DB::bookmark_item *item = NULL; + item = (Browser_Bookmark_DB::bookmark_item *)elm_object_item_data_get(it); + if (item) { + if(item->is_editable && item->is_delete) + m_total_item_count++; + } + it = elm_genlist_item_next_get(it); + } + + m_processing_popup_timer = ecore_timer_add(0.1, __delete_processing_popup_timer_cb, this); + evas_object_show(m_processing_progress_bar); + + elm_object_part_content_set(m_processing_popup_layout, "elm.swallow.content", m_processing_progress_bar); + edje_object_part_text_set(elm_layout_edje_get(m_processing_popup_layout), "elm.title", BR_STRING_PROCESSING); + edje_object_part_text_set(elm_layout_edje_get(m_processing_popup_layout), "elm.text.left", ""); + edje_object_part_text_set(elm_layout_edje_get(m_processing_popup_layout), "elm.text.right", ""); + + elm_object_content_set(m_processing_popup, m_processing_popup_layout); + + Evas_Object *cancel_button = elm_button_add(m_processing_popup); + elm_object_text_set(cancel_button, BR_STRING_CANCEL); + elm_object_part_content_set(m_processing_popup, "button1", cancel_button); + evas_object_smart_callback_add(cancel_button, "clicked", __delete_processing_popup_response_cb, this); + + evas_object_show(m_processing_popup); +} + +Eina_Bool Browser_Bookmark_View::__delete_processing_popup_timer_cb(void *data) +{ + if (!data) + return ECORE_CALLBACK_CANCEL; + + Browser_Bookmark_View *bookmark_view = (Browser_Bookmark_View *)data; + Evas_Object* progress_bar = bookmark_view->m_processing_progress_bar; + + Eina_Bool check_value = bookmark_view->m_select_all_check_value; + + double value = elm_progressbar_value_get(progress_bar); + if (value >= 1.0) { + __delete_processing_popup_response_cb(bookmark_view, NULL, NULL); + + bookmark_view->m_processing_popup_timer = NULL; + bookmark_view->show_notify_popup(BR_STRING_DELETED, 3, EINA_TRUE); + + return ECORE_CALLBACK_CANCEL; + } + + while(bookmark_view->m_processed_it) { + Browser_Bookmark_DB::bookmark_item *item = NULL; + item = (Browser_Bookmark_DB::bookmark_item *)elm_object_item_data_get(bookmark_view->m_processed_it); + if (item) { + if(item->is_editable && item->is_delete) { + Browser_Bookmark_DB *bookmark_db = m_data_manager->get_bookmark_db(); + int ret = EINA_TRUE; + if (item->is_folder) { + int folder_id = 0; + ret = bookmark_db->get_folder_id(bookmark_view->m_current_folder_id, + item->title.c_str(), &folder_id); + if (!ret) { + BROWSER_LOGE("bookmark_db->get_folder_id failed"); + return ECORE_CALLBACK_CANCEL; + } + ret = bookmark_db->delete_folder(folder_id); + if (!ret) { + BROWSER_LOGE("bookmark_db->delete_folder failed"); + return ECORE_CALLBACK_CANCEL; + } + } else { + ret = bookmark_db->delete_bookmark(item->id); + if (!ret) { + BROWSER_LOGE("bookmark_db->delete_bookmark failed"); + return ECORE_CALLBACK_CANCEL; + } + } + bookmark_view->_delete_bookmark_item_from_folder_list(item); + bookmark_view->m_processed_count++; + Elm_Object_Item *it = bookmark_view->m_processed_it; + bookmark_view->m_processed_it = elm_genlist_item_prev_get(bookmark_view->m_processed_it); + elm_object_item_del(it); + } else + bookmark_view->m_processed_it = elm_genlist_item_prev_get(bookmark_view->m_processed_it); + } else + bookmark_view->m_processed_it = elm_genlist_item_prev_get(bookmark_view->m_processed_it); + + if (bookmark_view->m_processed_count % 5 == 0) + break; + } + + elm_progressbar_value_set(bookmark_view->m_processing_progress_bar, + (float)((float)bookmark_view->m_processed_count / (float)bookmark_view->m_total_item_count)); + + char progress_text[20] = {0, }; + snprintf(progress_text, sizeof(progress_text) - 1, "%d / %d", + bookmark_view->m_processed_count, bookmark_view->m_total_item_count); + + edje_object_part_text_set(elm_layout_edje_get(bookmark_view->m_processing_popup_layout), + "elm.text.right", progress_text); + + return ECORE_CALLBACK_RENEW; +} + +void Browser_Bookmark_View::_show_select_processing_popup(void) +{ + BROWSER_LOGD("[%s]", __func__); + if (m_processing_popup) + evas_object_del(m_processing_popup); + + m_processing_popup = elm_popup_add(m_main_layout); + if (!m_processing_popup) { + BROWSER_LOGE("elm_popup_add failed"); + return; + } + + if (m_processing_popup_layout) + evas_object_del(m_processing_popup_layout); + m_processing_popup_layout = elm_layout_add(m_processing_popup); + if (!m_processing_popup_layout) { + BROWSER_LOGE("elm_layout_add failed"); + return; + } + if (!elm_layout_file_set(m_processing_popup_layout, BROWSER_EDJE_DIR"/browser-bookmark-view.edj", + "browser/popup_center_progressview")) { + BROWSER_LOGE("elm_layout_file_set failed"); + return; + } + evas_object_size_hint_weight_set(m_processing_popup_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + + m_processing_progress_bar = elm_progressbar_add(m_processing_popup); + elm_object_style_set(m_processing_progress_bar, "list_progress"); + elm_progressbar_horizontal_set(m_processing_progress_bar, EINA_TRUE); + evas_object_size_hint_align_set(m_processing_progress_bar, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_size_hint_weight_set(m_processing_progress_bar, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_progressbar_value_set(m_processing_progress_bar, 0.0); + + if (m_processing_popup_timer) + ecore_timer_del(m_processing_popup_timer); + + m_processed_count = 0; + m_processed_it = elm_genlist_first_item_get(_get_current_folder_genlist()); + + Elm_Object_Item *it = elm_genlist_first_item_get(_get_current_folder_genlist()); + m_total_item_count = 0; + while(it) { + Browser_Bookmark_DB::bookmark_item *item = NULL; + item = (Browser_Bookmark_DB::bookmark_item *)elm_object_item_data_get(it); + if (item) { + if(item->is_editable) + m_total_item_count++; + } + it = elm_genlist_item_next_get(it); + } + + m_processing_popup_timer = ecore_timer_add(0.1, __select_processing_popup_timer_cb, this); + evas_object_show(m_processing_progress_bar); + + elm_object_part_content_set(m_processing_popup_layout, "elm.swallow.content", m_processing_progress_bar); + edje_object_part_text_set(elm_layout_edje_get(m_processing_popup_layout), "elm.title", BR_STRING_PROCESSING); + edje_object_part_text_set(elm_layout_edje_get(m_processing_popup_layout), "elm.text.left", ""); + edje_object_part_text_set(elm_layout_edje_get(m_processing_popup_layout), "elm.text.right", ""); + + elm_object_content_set(m_processing_popup, m_processing_popup_layout); + + Evas_Object *cancel_button = elm_button_add(m_processing_popup); + elm_object_text_set(cancel_button, BR_STRING_CANCEL); + elm_object_part_content_set(m_processing_popup, "button1", cancel_button); + evas_object_smart_callback_add(cancel_button, "clicked", __select_processing_popup_response_cb, this); + + evas_object_show(m_processing_popup); + + Eina_Bool check_value = elm_check_state_get(m_edit_mode_select_all_check_button); + m_select_all_check_value = check_value; + + if (check_value) + elm_check_state_set(m_edit_mode_select_all_check_button, !check_value); +} + +Eina_Bool Browser_Bookmark_View::__select_processing_popup_timer_cb(void *data) +{ + if (!data) + return ECORE_CALLBACK_CANCEL; + + Browser_Bookmark_View *bookmark_view = (Browser_Bookmark_View *)data; + Evas_Object* progress_bar = bookmark_view->m_processing_progress_bar; + + Eina_Bool check_value = bookmark_view->m_select_all_check_value; + + double value = elm_progressbar_value_get(progress_bar); + if (value >= 1.0) { + __select_processing_popup_response_cb(bookmark_view, NULL, NULL); + + bookmark_view->m_processing_popup_timer = NULL; + elm_check_state_set(bookmark_view->m_edit_mode_select_all_check_button, !check_value); + bookmark_view->_show_selection_info(); + + return ECORE_CALLBACK_CANCEL; + } + + while(bookmark_view->m_processed_it) { + Browser_Bookmark_DB::bookmark_item *item = NULL; + item = (Browser_Bookmark_DB::bookmark_item *)elm_object_item_data_get(bookmark_view->m_processed_it); + if (item) { + if(item->is_editable) { + item->is_delete = !check_value; + elm_genlist_item_update(bookmark_view->m_processed_it); + bookmark_view->m_processed_count++; + } + } + bookmark_view->m_processed_it = elm_genlist_item_next_get(bookmark_view->m_processed_it); + + if (bookmark_view->m_processed_count % 30 == 0) + break; + } + + elm_progressbar_value_set(bookmark_view->m_processing_progress_bar, + (float)((float)bookmark_view->m_processed_count / (float)bookmark_view->m_total_item_count)); + + char progress_text[20] = {0, }; + snprintf(progress_text, sizeof(progress_text) - 1, "%d / %d", + bookmark_view->m_processed_count, bookmark_view->m_total_item_count); + + edje_object_part_text_set(elm_layout_edje_get(bookmark_view->m_processing_popup_layout), + "elm.text.right", progress_text); + + return ECORE_CALLBACK_RENEW; +} + +void Browser_Bookmark_View::__delete_processing_popup_response_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_Bookmark_View *bookmark_view = (Browser_Bookmark_View *)data; + + bookmark_view->m_processing_progress_bar = NULL; + bookmark_view->m_processed_it = NULL; + + evas_object_del(bookmark_view->m_processing_popup); + + if (bookmark_view->m_processing_popup_timer) { + ecore_timer_del(bookmark_view->m_processing_popup_timer); + bookmark_view->m_processing_popup_timer = NULL; + } + + bookmark_view->show_notify_popup(BR_STRING_DELETED, 3, EINA_TRUE); + + vector<Browser_Bookmark_DB::bookmark_item *> item_list = bookmark_view->_get_current_folder_item_list(); + if (item_list.size() == 0) + bookmark_view->_show_empty_content_layout(EINA_TRUE); + } + +void Browser_Bookmark_View::__select_processing_popup_response_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_Bookmark_View *bookmark_view = (Browser_Bookmark_View *)data; + + evas_object_del(bookmark_view->m_processing_popup); + bookmark_view->m_processing_progress_bar = NULL; + bookmark_view->m_processed_it = NULL; + + if (bookmark_view->m_processing_popup_timer) { + ecore_timer_del(bookmark_view->m_processing_popup_timer); + bookmark_view->m_processing_popup_timer = NULL; + } + + Elm_Object_Item *it = elm_genlist_first_item_get(bookmark_view->_get_current_folder_genlist()); + int check_count = 0; + while(it) { + Browser_Bookmark_DB::bookmark_item *item = NULL; + item = (Browser_Bookmark_DB::bookmark_item *)elm_object_item_data_get(it); + if (item) { + if(item->is_editable && item->is_delete) + check_count++; + } + it = elm_genlist_item_next_get(it); + } + + if (check_count) + elm_object_item_disabled_set(bookmark_view->m_bookmark_delete_controlbar_item, EINA_FALSE); + else + elm_object_item_disabled_set(bookmark_view->m_bookmark_delete_controlbar_item, EINA_TRUE); +} + +void Browser_Bookmark_View::__edit_mode_select_all_clicked_cb(void *data, Evas *evas, Evas_Object *obj, void *event_info) +{ + if (!data) + return; + + Browser_Bookmark_View *bookmark_view = (Browser_Bookmark_View *)data; + int item_count = bookmark_view->_get_current_folder_item_list().size(); + BROWSER_LOGD("item_count=%d", item_count); + + if (item_count >= BROWSER_BOOKMARK_PROCESS_BLOCK_COUNT) + bookmark_view->_show_select_processing_popup(); + else { + Eina_Bool value = elm_check_state_get(bookmark_view->m_edit_mode_select_all_check_button); + elm_check_state_set(bookmark_view->m_edit_mode_select_all_check_button, !value); + + Elm_Object_Item *it = elm_genlist_first_item_get(bookmark_view->_get_current_folder_genlist()); + while(it) { + Browser_Bookmark_DB::bookmark_item *item = NULL; + item = (Browser_Bookmark_DB::bookmark_item *)elm_object_item_data_get(it); + if (item) { + if(item->is_editable) { + item->is_delete = !value; + elm_genlist_item_update(it); + } + } + it = elm_genlist_item_next_get(it); + } + + bookmark_view->_show_selection_info(); + } +} + +void Browser_Bookmark_View::__edit_mode_select_all_check_changed_cb(void *data, + Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_Bookmark_View *bookmark_view = (Browser_Bookmark_View *)data; + int item_count = bookmark_view->_get_current_folder_item_list().size(); + BROWSER_LOGD("item_count=%d", item_count); + Eina_Bool value = elm_check_state_get(obj); + + if (item_count >= BROWSER_BOOKMARK_PROCESS_BLOCK_COUNT) { + /* Workaround to share the same code with __edit_mode_select_all_clicked_cb */ + elm_check_state_set(obj, !value); + bookmark_view->_show_select_processing_popup(); + } else { + Elm_Object_Item *it = elm_genlist_first_item_get(bookmark_view->_get_current_folder_genlist()); + while(it) { + Browser_Bookmark_DB::bookmark_item *item = (Browser_Bookmark_DB::bookmark_item *)elm_object_item_data_get(it); + if (item) { + if(item->is_editable) { + item->is_delete = value; + elm_genlist_item_update(it); + } + } + it = elm_genlist_item_next_get(it); + } + + bookmark_view->_show_selection_info(); + } +} + +void Browser_Bookmark_View::_show_selection_info(void) +{ + BROWSER_LOGD("[%s]", __func__); + int editable_item_count = 0; + int editable_folder_count = 0; + + Elm_Object_Item *it = elm_genlist_first_item_get(_get_current_folder_genlist()); + while(it) { + Browser_Bookmark_DB::bookmark_item *item = NULL; + item = (Browser_Bookmark_DB::bookmark_item *)elm_object_item_data_get(it); + if (item->is_delete) { + if (item->is_folder) + editable_folder_count++; + else + editable_item_count++; + } + it = elm_genlist_item_next_get(it); + } + + if (editable_folder_count == 0 && editable_item_count == 0) { + elm_object_item_disabled_set(m_bookmark_delete_controlbar_item, EINA_TRUE); + hide_notify_popup(); + return; + } else + elm_object_item_disabled_set(m_bookmark_delete_controlbar_item, EINA_FALSE); + + if (editable_folder_count + editable_item_count == 1) { + show_notify_popup(BR_STRING_ONE_ITEM_SELECTED, 0, EINA_TRUE); + } else if (editable_folder_count + editable_item_count > 1) { + char *small_popup_text = NULL; + int string_len = strlen(BR_STRING_ITEMS_SELECTED) + 4; /* 4 : reserved for maximun count */ + + small_popup_text = (char *)malloc(string_len * sizeof(char)); + memset(small_popup_text, 0x00, string_len); + + snprintf(small_popup_text, string_len, BR_STRING_ITEMS_SELECTED, editable_folder_count + editable_item_count); + show_notify_popup(small_popup_text, 0, EINA_TRUE); + + if (small_popup_text) + free(small_popup_text); + small_popup_text = 0x00; + } +} + +void Browser_Bookmark_View::_set_edit_mode(Eina_Bool edit_mode) +{ + BROWSER_LOGD("[%s]", __func__); + hide_notify_popup(); + + if (edit_mode) { + elm_object_style_set(m_bg, "edit_mode"); + + m_edit_mode_select_all_layout = elm_layout_add(m_genlist_content_box); + if (!m_edit_mode_select_all_layout) { + BROWSER_LOGE("elm_layout_add failed"); + return; + } + elm_layout_theme_set(m_edit_mode_select_all_layout, "genlist", "item", "select_all/default"); + evas_object_size_hint_weight_set(m_edit_mode_select_all_layout, EVAS_HINT_EXPAND, EVAS_HINT_FILL); + evas_object_size_hint_align_set(m_edit_mode_select_all_layout, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_event_callback_add(m_edit_mode_select_all_layout, EVAS_CALLBACK_MOUSE_DOWN, + __edit_mode_select_all_clicked_cb, this); + m_edit_mode_select_all_check_button = elm_check_add(m_edit_mode_select_all_layout); + if (!m_edit_mode_select_all_check_button) { + BROWSER_LOGE("elm_layout_add failed"); + return; + } + evas_object_smart_callback_add(m_edit_mode_select_all_check_button, "changed", + __edit_mode_select_all_check_changed_cb, this); + evas_object_propagate_events_set(m_edit_mode_select_all_check_button, EINA_FALSE); + + elm_object_part_content_set(m_edit_mode_select_all_layout, "elm.icon", m_edit_mode_select_all_check_button); + elm_object_text_set(m_edit_mode_select_all_layout, BR_STRING_SELECT_ALL); + + elm_box_pack_start(m_genlist_content_box, m_edit_mode_select_all_layout); + evas_object_show(m_edit_mode_select_all_layout); + + Elm_Object_Item *it = NULL; + Browser_Bookmark_DB::bookmark_item *item = NULL; + it = elm_genlist_first_item_get(_get_current_folder_genlist()); + while(it) { + item = (Browser_Bookmark_DB::bookmark_item *)elm_object_item_data_get(it); + if (!item->is_editable) + elm_object_item_disabled_set(it, EINA_TRUE); + + it = elm_genlist_item_next_get(it); + } + elm_genlist_reorder_mode_set(_get_current_folder_genlist(), EINA_TRUE); + elm_genlist_decorate_mode_set(_get_current_folder_genlist(), EINA_TRUE); + elm_genlist_select_mode_set(_get_current_folder_genlist(), ELM_OBJECT_SELECT_MODE_ALWAYS); + + _set_navigationbar_title(BR_STRING_SELECT_ITEMS); + + if (m_current_folder_id != BROWSER_BOOKMARK_MAIN_FOLDER_ID) { + edje_object_signal_emit(elm_layout_edje_get(m_genlist_content_layout), + "hide,upper_folder,signal", ""); + evas_object_hide(m_upper_folder_list); + } + + if (!_set_controlbar_type(BOOKMARK_VIEW_EDIT_MODE)) + BROWSER_LOGE("_set_controlbar_type(BOOKMARK_VIEW_DEFAULT) failed"); + }else { + elm_object_style_set(m_bg, "default"); + + if (m_edit_mode_select_all_check_button) { + evas_object_del(m_edit_mode_select_all_check_button); + m_edit_mode_select_all_check_button = NULL; + } + if (m_edit_mode_select_all_layout) { + elm_box_unpack(m_genlist_content_box, m_edit_mode_select_all_layout); + evas_object_del(m_edit_mode_select_all_layout); + m_edit_mode_select_all_layout = NULL; + } + + Elm_Object_Item *it = NULL; + Browser_Bookmark_DB::bookmark_item *item = NULL; + it = elm_genlist_first_item_get(_get_current_folder_genlist()); + while(it) { + item = (Browser_Bookmark_DB::bookmark_item *)elm_object_item_data_get(it); + if (!item->is_editable) + elm_object_item_disabled_set(it, EINA_FALSE); + item->is_delete = EINA_FALSE; + it = elm_genlist_item_next_get(it); + } + elm_genlist_decorate_mode_set(_get_current_folder_genlist(), EINA_FALSE); + elm_genlist_reorder_mode_set(_get_current_folder_genlist(), EINA_FALSE); + + elm_genlist_select_mode_set(_get_current_folder_genlist(), ELM_OBJECT_SELECT_MODE_DEFAULT); + + _set_navigationbar_title(BR_STRING_BOOKMARKS); + + if (m_current_folder_id != BROWSER_BOOKMARK_MAIN_FOLDER_ID) { + edje_object_signal_emit(elm_layout_edje_get(m_genlist_content_layout), + "show,upper_folder,signal", ""); + evas_object_show(m_upper_folder_list); + } + + if (!_set_controlbar_type(BOOKMARK_VIEW_DEFAULT)) + BROWSER_LOGE("_set_controlbar_type(BOOKMARK_VIEW_DEFAULT) failed"); + } +} + +void Browser_Bookmark_View::_set_view_mode(view_mode mode) +{ + BROWSER_LOGD("mode=%d", mode); + Evas_Object *history_layout = NULL; + if (m_data_manager->get_history_layout()) + history_layout = m_data_manager->get_history_layout()->get_main_layout(); + + m_view_mode = mode; + if (mode == HISTORY_VIEW) { + if (history_layout) { + elm_object_part_content_set(m_main_layout, "elm.swallow.content1", history_layout); + evas_object_show(history_layout); + } + + edje_object_signal_emit(elm_layout_edje_get(m_main_layout), "show,content1,signal", ""); + + _set_navigationbar_title(BR_STRING_HISTORY); + + if (elm_genlist_decorate_mode_get(m_data_manager->get_history_layout()->m_history_genlist)) { + if (!_set_controlbar_type(HISTORY_VIEW_EDIT_MODE)) + BROWSER_LOGE("_set_controlbar_type HISTORY_VIEW_EDIT_MODE failed"); + } else { + if (!_set_controlbar_type(HISTORY_VIEW_DEFAULT)) + BROWSER_LOGE("_set_controlbar_type HISTORY_VIEW_DEFAULT failed"); + } + } else if (mode == BOOKMARK_VIEW){ + if (history_layout) + evas_object_hide(history_layout); + edje_object_signal_emit(elm_layout_edje_get(m_main_layout), "show,content0,signal", ""); + + if (m_current_folder_id == BROWSER_BOOKMARK_MAIN_FOLDER_ID) + _set_navigationbar_title(BR_STRING_BOOKMARKS); + else { + _set_navigationbar_title(m_current_bookmark_navigationbar_title.c_str()); + } + + if (elm_genlist_decorate_mode_get(_get_current_folder_genlist())) { + if (!_set_controlbar_type(BOOKMARK_VIEW_EDIT_MODE)) + BROWSER_LOGE("_set_controlbar_type BOOKMARK_VIEW_EDIT_MODE failed"); + } else { + if (!_set_controlbar_type(BOOKMARK_VIEW_DEFAULT)) + BROWSER_LOGE("_set_controlbar_type BOOKMARK_VIEW_DEFAULT failed"); + } + } +} + +void Browser_Bookmark_View::__controlbar_tab_changed_cb(void *data, Evas_Object *obj, void *event_info) +{ + if (!data) + return; + + Browser_Bookmark_View *bookmark_view = (Browser_Bookmark_View *)data; + Elm_Object_Item *selected_item = elm_toolbar_selected_item_get(obj); + Elm_Object_Item *history_item = elm_toolbar_last_item_get(obj); + if (!selected_item) { + BROWSER_LOGD("no item selected"); + return; + } + + if (selected_item == history_item) { + BROWSER_LOGD("tab history"); + /* history selected */ + if (!m_data_manager->get_history_layout()) { + if (!m_data_manager->create_history_layout()) { + BROWSER_LOGE("m_data_manager->create_history_layout() failed"); + return; + } + + if (!m_data_manager->get_history_layout()->init()) { + BROWSER_LOGE("get_history_layout()->init() failed"); + return; + } + } + + bookmark_view->hide_notify_popup(); + bookmark_view->_set_view_mode(HISTORY_VIEW); + + } else { + BROWSER_LOGD("tab bookmark"); + if (m_data_manager->get_history_layout()) { + m_data_manager->get_history_layout()->hide_notify_popup(); + bookmark_view->_set_view_mode(BOOKMARK_VIEW); + } + } +} + +/* bookmark -> edit(left option button -> edit button of each bookmark item. */ +void Browser_Bookmark_View::__edit_bookmark_item_button_clicked_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + Browser_Bookmark_DB::bookmark_item *item = (Browser_Bookmark_DB::bookmark_item *)data; + Browser_Bookmark_View *bookmark_view = (Browser_Bookmark_View *)(item->user_data_1); + + /* Pass the selected genlist item as parameter when bookmark -> Edit item + because of increase performance. */ + bookmark_view->m_current_genlist_item_to_edit = (Elm_Object_Item *)(item->user_data_2); + + elm_check_state_set(bookmark_view->m_edit_mode_select_all_check_button, EINA_FALSE); + + bookmark_view->hide_notify_popup(); + + bookmark_view->_set_edit_mode(EINA_FALSE); + + if (!m_data_manager->create_edit_bookmark_view(item->title, item->url, + bookmark_view->m_current_folder_id)) { + BROWSER_LOGE("create_edit_bookmark_view failed"); + return; + } + + if (!m_data_manager->get_edit_bookmark_view()->init()) { + BROWSER_LOGE("get_edit_bookmark_view()->init() failed"); + m_data_manager->destroy_edit_bookmark_view(); + return; + } +} + +void Browser_Bookmark_View::__rename_folder_button_clicked_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + Browser_Bookmark_DB::bookmark_item *item = (Browser_Bookmark_DB::bookmark_item *)data; + Browser_Bookmark_View *bookmark_view = (Browser_Bookmark_View *)(item->user_data_1); + Elm_Object_Item *it = (Elm_Object_Item *)(item->user_data_2); + elm_genlist_item_flip_set(it, EINA_TRUE); + + elm_genlist_item_select_mode_set(it, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY); + + evas_object_data_set(bookmark_view->_get_current_folder_genlist(), "selected_it", it); +} + +void Browser_Bookmark_View::__rename_folder_entry_enter_key_cb(void *data, Evas_Object *obj, + void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Evas_Object *rename_edit_field = (Evas_Object *)data; + elm_object_focus_set(rename_edit_field, EINA_FALSE); +} + +void Browser_Bookmark_View::__rename_folder_unfocus_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_Bookmark_DB::bookmark_item *item = (Browser_Bookmark_DB::bookmark_item *)data; + Browser_Bookmark_View *bookmark_view = (Browser_Bookmark_View *)item->user_data_1; + + Evas_Object *genlist = bookmark_view->_get_current_folder_genlist(); + + Evas_Object *edit_field_entry = obj; + char *markup_text = elm_entry_markup_to_utf8(elm_entry_entry_get(edit_field_entry)); + char *text = bookmark_view->_trim(markup_text); + if (!text) { + BROWSER_LOGE("elm_entry_markup_to_utf8 failed"); + return; + } + Elm_Object_Item *it = (Elm_Object_Item *)evas_object_data_get(genlist, "selected_it"); + + Eina_Bool only_has_space = EINA_FALSE; + int space_count = 0; + if (text && strlen(text)) { + for (int i = 0 ; i < strlen(text) ; i++) { + if (text[i] == ' ') + space_count++; + } + if (space_count == strlen(text)) + only_has_space = EINA_TRUE; + } + + if (!text || strlen(text) == 0 || only_has_space) { + bookmark_view->show_msg_popup(BR_STRING_EMPTY_FOLDER_NAME); + elm_entry_entry_set(edit_field_entry, item->title.c_str()); + } else { + if (!m_data_manager->get_bookmark_db()->is_duplicated(text)) { + item->title = text; + m_data_manager->get_bookmark_db()->modify_bookmark_title(item->id, text); + } else { + if (elm_genlist_decorate_mode_get(bookmark_view->_get_current_folder_genlist())) + bookmark_view->show_msg_popup(BR_STRING_ALREADY_EXISTS); + std::string folder_name = m_data_manager->get_bookmark_db()->get_folder_name_by_id(item->id); + elm_entry_entry_set(edit_field_entry, folder_name.c_str()); + } + } + elm_genlist_item_flip_set(it, EINA_FALSE); + + elm_genlist_item_select_mode_set(it, ELM_OBJECT_SELECT_MODE_DEFAULT); + + bookmark_view->m_rename_edit_field = NULL; + + free(markup_text); +} + +void Browser_Bookmark_View::__drag_genlist_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); +} + +char *Browser_Bookmark_View::__genlist_label_get_cb(void *data, Evas_Object *obj, const char *part) +{ + BROWSER_LOGD("part=%s", part); + if (!data) + return NULL; + + Browser_Bookmark_DB::bookmark_item *item = (Browser_Bookmark_DB::bookmark_item *)data; + std::string title = item->title; + std::string url = item->url; + + + if (part && strlen(part) > 0) { + if (!strncmp(part,"elm.text", strlen("elm.text")) + || !strncmp(part, "elm.base.text", strlen("elm.base.text"))) { + if (!title.empty() && title.length() > 0) + return strdup(title.c_str()); + else + return NULL; + } else if (!strncmp(part, "elm.text.sub", strlen("elm.text.sub"))) { + if (!url.empty() && url.length() > 0) + return strdup(url.c_str()); + else + return NULL; + } + } + + return NULL; +} + +Evas_Object *Browser_Bookmark_View::__genlist_icon_get_cb(void *data, Evas_Object *obj, const char *part) +{ + BROWSER_LOGD("[%s]", __func__); + Browser_Bookmark_DB::bookmark_item *item = (Browser_Bookmark_DB::bookmark_item *)data; + if (!data) + return NULL; + + Browser_Bookmark_View *bookmark_view = (Browser_Bookmark_View *)item->user_data_1; + + if (part && strlen(part) > 0) { + if (!strncmp(part, "elm.icon", strlen("elm.icon"))) { + if (item->is_folder) { + Evas_Object *folder_icon = elm_icon_add(obj); + if (!elm_icon_file_set(folder_icon, BROWSER_IMAGE_DIR"/folder.png", NULL)) { + BROWSER_LOGE("elm_icon_file_set is failed.\n"); + return NULL; + } + evas_object_size_hint_aspect_set(folder_icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); + return folder_icon; + } else { + Evas_Object *favicon = NULL; + favicon = m_data_manager->get_browser_view()->get_favicon(item->url.c_str()); + if (favicon) + return favicon; + else { + Evas_Object *default_icon = elm_icon_add(obj); + if (!default_icon) + return NULL; + if (!elm_icon_file_set(default_icon, BROWSER_IMAGE_DIR"/faviconDefault.png", NULL)) { + BROWSER_LOGE("elm_icon_file_set is failed.\n"); + return NULL; + } + evas_object_size_hint_aspect_set(default_icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); + return default_icon; + } + } + } + + if (elm_genlist_decorate_mode_get(obj)) { + if (!strncmp(part, "elm.edit.icon.1", strlen("elm.edit.icon.1"))) { + Evas_Object *check_button = elm_check_add(obj); + if (!check_button) { + BROWSER_LOGE("elm_check_add is failed.\n"); + return NULL; + } + evas_object_propagate_events_set(check_button, EINA_FALSE); + + if (!item->is_editable) + elm_object_disabled_set(check_button, EINA_TRUE); + + elm_check_state_pointer_set(check_button, &item->is_delete); + evas_object_smart_callback_add(check_button, "changed", + __edit_mode_item_check_changed_cb, item); + return check_button; + } else if (!strncmp(part, "elm.edit.icon.2", strlen("elm.edit.icon.2"))) { + Evas_Object *button = elm_button_add(obj); + if (!button) { + BROWSER_LOGE("elm_button_add is failed.\n"); + return NULL; + } + evas_object_propagate_events_set(button, EINA_FALSE); + + if (!item->is_editable) + elm_object_disabled_set(button, EINA_TRUE); + if (item->is_folder) { + elm_object_style_set(button, "rename"); + evas_object_smart_callback_add(button, "clicked", + __rename_folder_button_clicked_cb, item); + } else { + elm_object_style_set(button, "reveal"); + evas_object_smart_callback_add(button, "clicked", + __edit_bookmark_item_button_clicked_cb, item); + } + return button; + } else if (!strncmp(part, "elm.flip.content", strlen("elm.flip.content"))) { + Evas_Object *edit_field = br_elm_editfield_add(obj); + br_elm_editfield_entry_single_line_set(edit_field, EINA_TRUE); + br_elm_editfield_eraser_set(edit_field, EINA_TRUE); + + bookmark_view->m_rename_edit_field = edit_field; + evas_object_data_set(bookmark_view->m_rename_edit_field, "item", item); + + Evas_Object *edit_field_entry = br_elm_editfield_entry_get(edit_field); + elm_entry_entry_set(edit_field_entry, item->title.c_str()); + elm_entry_cursor_end_set(edit_field_entry); + + evas_object_smart_callback_add(edit_field_entry, "unfocused", + __rename_folder_unfocus_cb, data); + evas_object_smart_callback_add(edit_field_entry, "activated", + __rename_folder_entry_enter_key_cb, edit_field); + + ecore_idler_add(__set_focus_editfield_idler_cb, edit_field); + + return edit_field; + } + } + } + + return NULL; +} + +Eina_Bool Browser_Bookmark_View::_is_empty_folder(string folder_name) +{ + BROWSER_LOGD("[%s]", __func__); + Browser_Bookmark_DB *bookmark_db = m_data_manager->get_bookmark_db(); + int folder_id; + Eina_Bool ret = bookmark_db->get_folder_id(BROWSER_BOOKMARK_MAIN_FOLDER_ID, folder_name.c_str(), &folder_id); + if (!ret) { + BROWSER_LOGE("get_folder_id is failed."); + return EINA_FALSE; + } + + vector<Browser_Bookmark_DB::bookmark_item *> bookmark_list; + ret = bookmark_db->get_bookmark_list(bookmark_list, folder_id); + if (!ret) { + BROWSER_LOGE("get_bookmark_list failed"); + return EINA_FALSE; + } + + int count = bookmark_list.size(); + + for(int i = 0 ; i < bookmark_list.size() ; i++ ) { + if (bookmark_list[i]) + delete bookmark_list[i]; + } + bookmark_list.clear(); + + if(count) + return EINA_FALSE; + else + return EINA_TRUE; +} + + +void Browser_Bookmark_View::__cancel_confirm_response_by_slide_button_cb(void *data, Evas_Object *obj, + void *event_info) +{ + BROWSER_LOGD("event_info = %d", (int)event_info); + + if (!data) + return; + + Evas_Object *popup = (Evas_Object *)data; + + evas_object_del(popup); +} + +void Browser_Bookmark_View::__delete_confirm_response_by_edit_mode_cb(void *data, Evas_Object *obj, + void *event_info) +{ + BROWSER_LOGD("event_info = %d", (int)event_info); + + if (!data) + return; + + Browser_Bookmark_View *bookmark_view = (Browser_Bookmark_View *)data; + + if (bookmark_view->m_delete_confirm_popup) { + evas_object_del(bookmark_view->m_delete_confirm_popup); + bookmark_view->m_delete_confirm_popup = NULL; + } + + bookmark_view->_delete_selected_bookmark(); + + bookmark_view->_set_edit_mode(EINA_FALSE); +} + +Evas_Object *Browser_Bookmark_View::_show_delete_confirm_popup(void) +{ + BROWSER_LOGD("[%s]", __func__); + + m_delete_confirm_popup = elm_popup_add(m_navi_bar); + if (!m_delete_confirm_popup) { + BROWSER_LOGE("elm_popup_add failed"); + return NULL; + } + + evas_object_size_hint_weight_set(m_delete_confirm_popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_object_text_set(m_delete_confirm_popup, BR_STRING_DELETE_Q); + + Evas_Object *ok_button = elm_button_add(m_delete_confirm_popup); + elm_object_text_set(ok_button, BR_STRING_YES); + elm_object_part_content_set(m_delete_confirm_popup, "button1", ok_button); + + Evas_Object *cancel_button = elm_button_add(m_delete_confirm_popup); + elm_object_text_set(cancel_button, BR_STRING_NO); + elm_object_part_content_set(m_delete_confirm_popup, "button2", cancel_button); + + evas_object_smart_callback_add(cancel_button, "clicked", __cancel_confirm_response_by_slide_button_cb, + m_delete_confirm_popup); + + evas_object_show(m_delete_confirm_popup); + + return ok_button; +} + +void Browser_Bookmark_View::__genlist_move_cb(void *data, Evas_Object *obj, void *event_info) +{ + Elm_Object_Item *it = (Elm_Object_Item *)event_info; + + BROWSER_LOGD("moved it = %d", it); + + Browser_Bookmark_DB::bookmark_item *item = (Browser_Bookmark_DB::bookmark_item *)elm_object_item_data_get(it); + Elm_Object_Item *next_it = elm_genlist_item_next_get(it); + Browser_Bookmark_DB::bookmark_item *next_item = NULL; + + if (next_it) + next_item = (Browser_Bookmark_DB::bookmark_item *)elm_object_item_data_get(next_it); + + Browser_Bookmark_View *bookmark_view = (Browser_Bookmark_View *)(item->user_data_1); + + Elm_Object_Item *index_it = NULL; + Browser_Bookmark_DB::bookmark_item *test_item = NULL; + it = elm_genlist_first_item_get(obj); + while (index_it) { + test_item = (Browser_Bookmark_DB::bookmark_item *)elm_object_item_data_get(index_it); + BROWSER_LOGD("title=%s, order index=%d", test_item->title.c_str(), test_item->order_index); + index_it = elm_genlist_item_next_get(index_it); + } + + if (next_item && (item->order_index < next_item->order_index)) + /* move down */ + bookmark_view->_reorder_bookmark_item(item->order_index, EINA_TRUE); + else + /* move up */ + bookmark_view->_reorder_bookmark_item(item->order_index, EINA_FALSE); +} + +void Browser_Bookmark_View::_reorder_bookmark_item(int order_index, Eina_Bool is_move_down) +{ + BROWSER_LOGD("[%s]", __func__); + Browser_Bookmark_DB *bookmark_db = m_data_manager->get_bookmark_db(); + + Elm_Object_Item *it = NULL; + Elm_Object_Item *next_it = NULL; + Browser_Bookmark_DB::bookmark_item *item = NULL; + Browser_Bookmark_DB::bookmark_item *next_item = NULL; + Eina_Bool ret = EINA_TRUE; + int index = order_index; + + if (is_move_down) { + it = elm_genlist_first_item_get(_get_current_folder_genlist()); + while(it) { + item = (Browser_Bookmark_DB::bookmark_item *)elm_object_item_data_get(it); + if (item->order_index > index) { + ret = bookmark_db->modify_bookmark_order_index(item->id, m_current_folder_id, index); + if (!ret) + BROWSER_LOGD("modify_bookmark_order_index failed"); + int temp = item->order_index; + item->order_index = index; + index = temp; + elm_object_item_data_set(it, item); + } else if (item->order_index == order_index) { + ret = bookmark_db->modify_bookmark_order_index(item->id, m_current_folder_id, index); + item->order_index = index; + elm_object_item_data_set(it, item); + if (!ret) + BROWSER_LOGD("modify_bookmark_order_index failed"); + break; + } + it = elm_genlist_item_next_get(it); + } + } else { + index = order_index; + it = elm_genlist_last_item_get(_get_current_folder_genlist()); + while(it) { + item = (Browser_Bookmark_DB::bookmark_item *)elm_object_item_data_get(it); + if (item->order_index < index) { + ret = bookmark_db->modify_bookmark_order_index(item->id, m_current_folder_id, index); + if (!ret) + BROWSER_LOGD("modify_bookmark_order_index failed"); + int temp = item->order_index; + item->order_index = index; + index = temp; + elm_object_item_data_set(it, item); + } else if (item->order_index == order_index) { + ret = bookmark_db->modify_bookmark_order_index(item->id, m_current_folder_id, index); + item->order_index = index; + elm_object_item_data_set(it, item); + if (!ret) + BROWSER_LOGD("modify_bookmark_order_index failed"); + break; + } + it = elm_genlist_item_prev_get(it); + } + } +} + +void Browser_Bookmark_View::history_item_clicked(const char *url) +{ + BROWSER_LOGD("[%s]", __func__); + + if (m_data_manager->get_browser_view()) + m_data_manager->get_browser_view()->load_url(url); + + if (elm_naviframe_bottom_item_get(m_navi_bar) != elm_naviframe_top_item_get(m_navi_bar)) + elm_naviframe_item_pop(m_navi_bar); +} + +void Browser_Bookmark_View::__bookmark_item_clicked_cb(void *data, Evas_Object *obj, void *eventInfo) +{ + Browser_Bookmark_View *bookmark_view = (Browser_Bookmark_View *)data; + if (!data) + return; + + Elm_Object_Item *seleted_item = elm_genlist_selected_item_get(obj); + Browser_Bookmark_DB::bookmark_item *item = NULL; + item = (Browser_Bookmark_DB::bookmark_item *)elm_object_item_data_get(seleted_item); + + if (!elm_genlist_decorate_mode_get(obj)) { + if (!item->is_folder) { + std::string url = std::string(item->url.c_str()); + + if (m_data_manager->get_browser_view()) + m_data_manager->get_browser_view()->load_url(url.c_str()); + + if (elm_naviframe_bottom_item_get(bookmark_view->m_navi_bar) + != elm_naviframe_top_item_get(bookmark_view->m_navi_bar)) + elm_naviframe_item_pop(bookmark_view->m_navi_bar); + } else + bookmark_view->_go_to_sub_foler(item->title.c_str()); + } else { + Elm_Object_Item *it = elm_genlist_selected_item_get(obj); + Browser_Bookmark_DB::bookmark_item *item = NULL; + item = (Browser_Bookmark_DB::bookmark_item *)elm_object_item_data_get(it); + if (item && item->is_editable) { + item->is_delete = !(item->is_delete); + elm_genlist_item_update(it); + } + + int delete_item_count = 0; + int editable_item_count = 0; + it = elm_genlist_first_item_get(bookmark_view->_get_current_folder_genlist()); + while(it) { + if (item->is_editable) + editable_item_count++; + item = (Browser_Bookmark_DB::bookmark_item *)elm_object_item_data_get(it); + if (item->is_delete) + delete_item_count++; + it = elm_genlist_item_next_get(it); + } + + if (editable_item_count == delete_item_count) + elm_check_state_set(bookmark_view->m_edit_mode_select_all_check_button, EINA_TRUE); + else + elm_check_state_set(bookmark_view->m_edit_mode_select_all_check_button, EINA_FALSE); + + bookmark_view->_show_selection_info(); + } + + elm_genlist_item_selected_set(seleted_item, EINA_FALSE); +} + +void Browser_Bookmark_View::__upper_folder_clicked_cb(void *data, Evas_Object *obj, void *eventInfo) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_Bookmark_View *bookmark_view = (Browser_Bookmark_View *)data; + bookmark_view->_go_up_to_main_folder(); + + bookmark_view->_set_navigationbar_title(BR_STRING_BOOKMARKS); +} + +Evas_Object *Browser_Bookmark_View::_get_current_folder_genlist(void) +{ + if (m_current_folder_id == BROWSER_BOOKMARK_MAIN_FOLDER_ID) + return m_main_folder_genlist; + else + return m_sub_folder_genlist; +} + +/* This just returns the copy of item list instance. + * Just refer to read. Do not modify(insert or delete) the contents of this return value. + * It doesn't modify the actual m_main_folder_list, m_sub_folder_list contents. */ +vector<Browser_Bookmark_DB::bookmark_item *> Browser_Bookmark_View::_get_current_folder_item_list(void) +{ + if (m_current_folder_id == BROWSER_BOOKMARK_MAIN_FOLDER_ID) + return m_main_folder_list; + else + return m_sub_folder_list; +} + +void Browser_Bookmark_View::_show_empty_content_layout(Eina_Bool is_empty) +{ + BROWSER_LOGD("is_empty=%d", is_empty); + if (m_view_mode == BOOKMARK_VIEW) { + if (!_set_controlbar_type(BOOKMARK_VIEW_DEFAULT)) + BROWSER_LOGE("_set_controlbar_type(BOOKMARK_VIEW_DEFAULT) failed"); + } + + if (is_empty) { + if (m_edit_mode_select_all_check_button) { + evas_object_del(m_edit_mode_select_all_check_button); + m_edit_mode_select_all_check_button = NULL; + } + if (m_edit_mode_select_all_layout) { + elm_box_unpack(m_genlist_content_box, m_edit_mode_select_all_layout); + evas_object_del(m_edit_mode_select_all_layout); + m_edit_mode_select_all_layout = NULL; + } + + if (m_no_contents) { + evas_object_del(m_no_contents); + m_no_contents = NULL; + } + + m_no_contents = elm_layout_add(m_main_layout); + if (!m_no_contents) { + BROWSER_LOGE("elm_layout_add failed"); + } + elm_layout_theme_set(m_no_contents, "layout", "no_bookmark", "full"); + elm_object_part_text_set (m_no_contents, "elm.text", BR_STRING_NO_BOOKMARKS); + evas_object_size_hint_weight_set(m_no_contents, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(m_no_contents, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_object_part_content_set(m_genlist_content_layout, "elm.swallow.no_content", m_no_contents); + edje_object_signal_emit(elm_layout_edje_get(m_genlist_content_layout), "hide,content_box,signal", ""); + evas_object_show(m_no_contents); + + elm_object_item_disabled_set(m_bookmark_edit_controlbar_item, EINA_TRUE); + }else { + if (m_no_contents) { + elm_object_part_content_unset(m_genlist_content_layout, "elm.swallow.no_content"); + evas_object_del(m_no_contents); + m_no_contents = NULL; + edje_object_signal_emit(elm_layout_edje_get(m_genlist_content_layout), + "show,content_box,signal", ""); + } + + elm_object_item_disabled_set(m_bookmark_edit_controlbar_item, EINA_FALSE); + } +} + +void Browser_Bookmark_View::_go_up_to_main_folder(void) +{ + BROWSER_LOGD("[%s]", __func__); + + m_current_folder_id = BROWSER_BOOKMARK_MAIN_FOLDER_ID; + + elm_box_unpack(m_genlist_content_box, m_sub_folder_conformant); + elm_box_pack_end(m_genlist_content_box, m_conformant); + evas_object_show(m_conformant); + + edje_object_signal_emit(elm_layout_edje_get(m_genlist_content_layout), "hide,upper_folder,signal", ""); + + Elm_Object_Item *top_it = elm_naviframe_top_item_get(m_navi_bar); + elm_object_item_signal_emit(top_it, ELM_NAVIFRAME_ITEM_SIGNAL_OPTIONHEADER_INSTANT_OPEN); + evas_object_data_set(m_navi_bar, "visible", (void *)EINA_TRUE); + + for(int i = 0 ; i < m_sub_folder_list.size() ; i++) { + if (m_sub_folder_list[i]) { + delete m_sub_folder_list[i]; + m_sub_folder_list.erase(m_sub_folder_list.begin() + i); + } + } + m_sub_folder_list.clear(); + + if (m_upper_folder_icon) { + evas_object_del(m_upper_folder_icon); + m_upper_folder_icon = NULL; + } + if (m_upper_folder_list) { + evas_object_del(m_upper_folder_list); + m_upper_folder_list = NULL; + } + if (m_sub_folder_genlist) { + evas_object_del(m_sub_folder_genlist); + m_sub_folder_genlist = NULL; + } + if (m_sub_folder_conformant) { + evas_object_del(m_sub_folder_conformant); + m_sub_folder_conformant = NULL; + } + + if (m_main_folder_list.size() == 0) + _show_empty_content_layout(EINA_TRUE); + else + _show_empty_content_layout(EINA_FALSE); + + elm_object_item_disabled_set(m_create_folder_controlbar_item, EINA_FALSE); +} + +void Browser_Bookmark_View::_go_to_sub_foler(const char *folder_name) +{ + int folder_id; + string navigationbar_title = folder_name; + Eina_Bool ret = m_data_manager->get_bookmark_db()->get_folder_id(BROWSER_BOOKMARK_MAIN_FOLDER_ID, + folder_name, &folder_id); + if (!ret) { + BROWSER_LOGE("get_folder_id is failed."); + return; + } + + m_sub_folder_genlist = _create_sub_folder_genlist(folder_id); + if (!m_sub_folder_genlist) { + BROWSER_LOGD("_create_sub_folder_genlist failed"); + return; + } + + m_current_bookmark_navigationbar_title = navigationbar_title.c_str(); + _set_navigationbar_title(navigationbar_title.c_str()); + + elm_object_item_disabled_set(m_create_folder_controlbar_item, EINA_TRUE); + + if (!m_sub_folder_list.size()) + elm_object_item_disabled_set(m_bookmark_edit_controlbar_item, EINA_TRUE); +} + +void Browser_Bookmark_View::_set_navigationbar_title(const char *title) +{ + BROWSER_LOGD("title=[%s]", title); + Elm_Object_Item *top_it = elm_naviframe_top_item_get(m_navi_bar); + if (elm_object_item_content_get(top_it) == m_main_layout) + elm_object_item_text_set(top_it, title); +} + +Evas_Object *Browser_Bookmark_View::_create_sub_folder_genlist(int folder_id) +{ + BROWSER_LOGD("[%s]", __func__); + Evas_Object *genlist = elm_genlist_add(m_main_layout); + if (genlist) { + elm_box_unpack(m_genlist_content_box, m_conformant); + evas_object_hide(m_conformant); + + m_sub_folder_conformant = elm_conformant_add(m_main_layout); + if (!m_sub_folder_conformant) { + BROWSER_LOGE("elm_conformant_add failed"); + return EINA_FALSE; + } + elm_object_style_set(m_sub_folder_conformant, "internal_layout"); + evas_object_size_hint_weight_set(m_sub_folder_conformant, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(m_sub_folder_conformant, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_show(m_sub_folder_conformant); + elm_box_pack_end(m_genlist_content_box, m_sub_folder_conformant); + + m_current_folder_id = folder_id; + + evas_object_size_hint_weight_set(genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(genlist, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_genlist_block_count_set(genlist, BROWSER_BOOKMARK_GENLIST_BLOCK_COUNT); + elm_genlist_homogeneous_set(genlist, EINA_TRUE); + + evas_object_smart_callback_add(genlist, "moved", __genlist_move_cb, this); + + elm_object_content_set(m_sub_folder_conformant, genlist); + evas_object_show(genlist); + + m_upper_folder_list = elm_list_add(m_main_layout); + if (m_upper_folder_list) { + elm_list_bounce_set(m_upper_folder_list, EINA_FALSE, EINA_FALSE); + evas_object_size_hint_weight_set(m_upper_folder_list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(m_upper_folder_list, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_show(m_upper_folder_list); + elm_object_part_content_set(m_genlist_content_layout, "elm.swallow.upperlist", m_upper_folder_list); + m_upper_folder_icon = elm_icon_add(m_upper_folder_list); + if (!m_upper_folder_icon) { + BROWSER_LOGE("elm_icon_add failed"); + return NULL; + } + if (!elm_icon_file_set(m_upper_folder_icon, BROWSER_IMAGE_DIR"/I01_icon_upper_folder.png", NULL)) + BROWSER_LOGE("elm_icon_file_set is failed. [%s]"); + + evas_object_size_hint_min_set(m_upper_folder_icon, UPPER_FOLDER_ICON_SIZE, UPPER_FOLDER_ICON_SIZE); + evas_object_resize(m_upper_folder_icon, UPPER_FOLDER_ICON_SIZE, UPPER_FOLDER_ICON_SIZE); + elm_list_item_append(m_upper_folder_list, BR_STRING_BOOKMARKS, m_upper_folder_icon, + NULL, __upper_folder_clicked_cb, this); + evas_object_show(m_upper_folder_icon); + edje_object_signal_emit(elm_layout_edje_get(m_genlist_content_layout), "show,upper_folder,signal", ""); + + Elm_Object_Item *top_it = elm_naviframe_top_item_get(m_navi_bar); + elm_object_item_signal_emit(top_it, ELM_NAVIFRAME_ITEM_SIGNAL_OPTIONHEADER_INSTANT_CLOSE); + evas_object_data_set(m_navi_bar, "visible", (void *)EINA_FALSE); + } + + /* Fill bookmark list */ + Eina_Bool ret = m_data_manager->get_bookmark_db()->get_bookmark_list(m_sub_folder_list, + m_current_folder_id); + if (!ret) { + return NULL; + BROWSER_LOGE("get_bookmark_list failed"); + } + + int size = m_sub_folder_list.size(); + BROWSER_LOGD("bookmark count=%d", size); + for (int i = 0 ; i < size ; i++ ) { + m_sub_folder_list[i]->user_data_1 = (void *)this; + m_sub_folder_list[i]->user_data_2 = (void *)elm_genlist_item_append(genlist, + &m_bookmark_genlist_item_class, m_sub_folder_list[i], NULL, + ELM_GENLIST_ITEM_NONE, __bookmark_item_clicked_cb, this); + } + + if (size == 0) + _show_empty_content_layout(EINA_TRUE); + else + _show_empty_content_layout(EINA_FALSE); + } + + return genlist; +} + +Evas_Object *Browser_Bookmark_View::_create_main_folder_genlist(void) +{ + BROWSER_LOGD("[%s]", __func__); + Evas_Object *genlist = elm_genlist_add(m_main_layout); + if (genlist) { + m_current_folder_id = BROWSER_BOOKMARK_MAIN_FOLDER_ID; + + evas_object_size_hint_weight_set(genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(genlist, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_genlist_block_count_set(genlist, BROWSER_BOOKMARK_GENLIST_BLOCK_COUNT); + elm_genlist_homogeneous_set(genlist, EINA_TRUE); + + evas_object_smart_callback_add(genlist, "moved", __genlist_move_cb, this); + + m_bookmark_genlist_item_class.item_style = "1text.1icon.2"; + m_bookmark_genlist_item_class.decorate_item_style = "mode/slide3"; + m_bookmark_genlist_item_class.decorate_all_item_style = "edit_default"; + m_bookmark_genlist_item_class.func.text_get = __genlist_label_get_cb; + m_bookmark_genlist_item_class.func.content_get = __genlist_icon_get_cb; + m_bookmark_genlist_item_class.func.state_get = NULL; + m_bookmark_genlist_item_class.func.del = NULL; +// m_bookmark_genlist_item_class.func.moved = __genlist_move_cb; + + evas_object_show(genlist); + + /* Fill bookmark list */ + Eina_Bool ret = m_data_manager->get_bookmark_db()->get_bookmark_list(m_main_folder_list, + m_current_folder_id); + if (!ret) { + return NULL; + BROWSER_LOGE("get_bookmark_list failed"); + } + + int size = m_main_folder_list.size(); + BROWSER_LOGD("bookmark count=%d", size); + for (int i = 0 ; i < size ; i++ ) { + m_main_folder_list[i]->user_data_1 = (void *)this; + m_main_folder_list[i]->user_data_2 = (void *)elm_genlist_item_append(genlist, + &m_bookmark_genlist_item_class, m_main_folder_list[i], NULL, + ELM_GENLIST_ITEM_NONE, __bookmark_item_clicked_cb, this); + } + } + + return genlist; +} + +void Browser_Bookmark_View::__create_folder_button(void *data, Evas_Object *obj, void *event_info) +{ + if (!data) + return; + Browser_Bookmark_View *bookmark_view = (Browser_Bookmark_View *)data; + + /* New folder */ + if (!m_data_manager->create_new_folder_view()) { + BROWSER_LOGE("create_new_folder_view failed"); + return; + } + + if (!m_data_manager->get_new_folder_view()->init()) { + BROWSER_LOGE("get_new_folder_view()->init() failed"); + m_data_manager->destroy_new_folder_view(); + return; + } +} + +void Browser_Bookmark_View::__add_to_bookmark_cb(void *data, Evas_Object *obj, void *event_info) +{ + if (!data) + return; + Browser_Bookmark_View *bookmark_view = (Browser_Bookmark_View *)data; + if (!m_data_manager->create_add_to_bookmark_view(m_data_manager->get_browser_view()->get_title(), + m_data_manager->get_browser_view()->get_url(), bookmark_view->m_current_folder_id)) { + BROWSER_LOGE("m_data_manager->create_add_to_bookmark_view failed"); + return; + } + + if (!m_data_manager->get_add_to_bookmark_view()->init()) + m_data_manager->destroy_add_to_bookmark_view(); +} + +Eina_Bool Browser_Bookmark_View::_set_controlbar_type(controlbar_type type) +{ + if (m_bottom_control_bar) + evas_object_del(m_bottom_control_bar); + + m_bookmark_delete_controlbar_item = NULL; + m_create_folder_controlbar_item = NULL; + + if (type == BOOKMARK_VIEW_DEFAULT) { + elm_object_style_set(m_bg, "default"); + + Elm_Object_Item *navi_it = elm_naviframe_top_item_get(m_navi_bar); + + m_back_button = elm_button_add(m_main_layout); + if (!m_back_button) { + BROWSER_LOGE("elm_button_add failed"); + return EINA_FALSE; + } + elm_object_style_set(m_back_button, "browser/bookmark_controlbar_back"); + evas_object_smart_callback_add(m_back_button, "clicked", __back_button_clicked_cb, this); + evas_object_show(m_back_button); + elm_object_item_part_content_set(navi_it, ELM_NAVIFRAME_ITEM_PREV_BTN, m_back_button); + + m_bottom_control_bar = elm_toolbar_add(m_main_layout); + if (!m_bottom_control_bar) { + BROWSER_LOGE("elm_toolbar_add failed"); + return EINA_TRUE; + } + elm_object_style_set(m_bottom_control_bar, "browser/default"); + elm_toolbar_shrink_mode_set(m_bottom_control_bar, ELM_TOOLBAR_SHRINK_EXPAND); + + m_create_folder_controlbar_item = elm_toolbar_item_append(m_bottom_control_bar, + BROWSER_IMAGE_DIR"/I01_controlbar_icon_create.png", + NULL, __add_to_bookmark_cb, this); + m_bookmark_edit_controlbar_item = elm_toolbar_item_append(m_bottom_control_bar, + BROWSER_IMAGE_DIR"/01_controlbar_icon_compose.png", NULL, + __edit_controlbar_item_clicked_cb, this); + m_create_folder_controlbar_item = elm_toolbar_item_append(m_bottom_control_bar, + BROWSER_IMAGE_DIR"/01_controlbar_icon_create_folder.png", + NULL, __create_folder_button, this); + evas_object_show(m_bottom_control_bar); + + if (m_current_folder_id != BROWSER_BOOKMARK_MAIN_FOLDER_ID) + elm_object_item_disabled_set(m_create_folder_controlbar_item, EINA_TRUE); + + if (!_get_current_folder_item_list().size()) + elm_object_item_disabled_set(m_bookmark_edit_controlbar_item, EINA_TRUE); + + elm_object_item_part_content_set(navi_it, ELM_NAVIFRAME_ITEM_CONTROLBAR, m_bottom_control_bar); + } else if (type == BOOKMARK_VIEW_EDIT_MODE || type == HISTORY_VIEW_EDIT_MODE) { + elm_object_style_set(m_bg, "edit_mode"); + + Elm_Object_Item *navi_it = elm_naviframe_top_item_get(m_navi_bar); + elm_object_item_part_content_set(navi_it, ELM_NAVIFRAME_ITEM_PREV_BTN, NULL); + + m_bottom_control_bar = elm_toolbar_add(m_main_layout); + if (!m_bottom_control_bar) { + BROWSER_LOGE("elm_toolbar_add failed"); + return EINA_FALSE; + } + elm_object_style_set(m_bottom_control_bar, "browser/default"); + elm_toolbar_shrink_mode_set(m_bottom_control_bar, ELM_TOOLBAR_SHRINK_EXPAND); + + Elm_Object_Item *empty_item = elm_toolbar_item_append(m_bottom_control_bar, NULL, NULL, NULL, NULL); + elm_object_item_disabled_set(empty_item, EINA_TRUE); + + elm_toolbar_item_append(m_bottom_control_bar, BROWSER_IMAGE_DIR"/01_controllbar_icon_close.png", NULL, + __edit_controlbar_item_clicked_cb, this); + + empty_item = elm_toolbar_item_append(m_bottom_control_bar, NULL, NULL, NULL, NULL); + elm_object_item_disabled_set(empty_item, EINA_TRUE); + m_bookmark_delete_controlbar_item = elm_toolbar_item_append(m_bottom_control_bar, + BROWSER_IMAGE_DIR"/01_controlbar_icon_delete.png", + NULL, __delete_controlbar_item_clicked_cb, this); + + if (type == BOOKMARK_VIEW_EDIT_MODE) { + int delete_item_count = 0; + Elm_Object_Item *it = elm_genlist_first_item_get(_get_current_folder_genlist()); + while(it) { + Browser_Bookmark_DB::bookmark_item *item = NULL; + item = (Browser_Bookmark_DB::bookmark_item *)elm_object_item_data_get(it); + if (item->is_delete) + delete_item_count++; + it = elm_genlist_item_next_get(it); + } + + if (delete_item_count) + elm_object_item_disabled_set(m_bookmark_delete_controlbar_item, EINA_FALSE); + else + elm_object_item_disabled_set(m_bookmark_delete_controlbar_item, EINA_TRUE); + } else { + int delete_item_count = 0; + Elm_Object_Item *it = elm_genlist_first_item_get(m_data_manager->get_history_layout()->m_history_genlist); + while(it) { + Browser_History_DB::history_item *item = NULL; + item = (Browser_History_DB::history_item *)elm_object_item_data_get(it); + + /* Ignore the date label. */ + if (elm_genlist_item_select_mode_get(it) != ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY) { + if (item->is_delete) + delete_item_count++; + } + it = elm_genlist_item_next_get(it); + } + if (delete_item_count) + elm_object_item_disabled_set(m_bookmark_delete_controlbar_item, EINA_FALSE); + else + elm_object_item_disabled_set(m_bookmark_delete_controlbar_item, EINA_TRUE); + } + + evas_object_show(m_bottom_control_bar); + elm_object_item_part_content_set(navi_it, ELM_NAVIFRAME_ITEM_CONTROLBAR, m_bottom_control_bar); + } else if (type == HISTORY_VIEW_DEFAULT) { + elm_object_style_set(m_bg, "default"); + + Elm_Object_Item *navi_it = elm_naviframe_top_item_get(m_navi_bar); + + m_back_button = elm_button_add(m_main_layout); + if (!m_back_button) { + BROWSER_LOGE("elm_button_add failed"); + return EINA_FALSE; + } + elm_object_style_set(m_back_button, "browser/bookmark_controlbar_back"); + evas_object_smart_callback_add(m_back_button, "clicked", __back_button_clicked_cb, this); + evas_object_show(m_back_button); + elm_object_item_part_content_set(navi_it, ELM_NAVIFRAME_ITEM_PREV_BTN, m_back_button); + + m_bottom_control_bar = elm_toolbar_add(m_main_layout); + if (!m_bottom_control_bar) { + BROWSER_LOGE("elm_toolbar_add failed"); + return EINA_TRUE; + } + elm_object_style_set(m_bottom_control_bar, "browser/default"); + elm_toolbar_shrink_mode_set(m_bottom_control_bar, ELM_TOOLBAR_SHRINK_EXPAND); + + Elm_Object_Item *empty_item = elm_toolbar_item_append(m_bottom_control_bar, NULL, NULL, NULL, NULL); + elm_object_item_disabled_set(empty_item, EINA_TRUE); + + m_bookmark_edit_controlbar_item = elm_toolbar_item_append(m_bottom_control_bar, + BROWSER_IMAGE_DIR"/01_controlbar_icon_compose.png", NULL, + __edit_controlbar_item_clicked_cb, this); + + empty_item = elm_toolbar_item_append(m_bottom_control_bar, NULL, NULL, NULL, NULL); + elm_object_item_disabled_set(empty_item, EINA_TRUE); + + Browser_History_Layout *history_layout = m_data_manager->get_history_layout(); + if (history_layout) { + if (!history_layout->m_history_list.size()) + elm_object_item_disabled_set(m_bookmark_edit_controlbar_item, EINA_TRUE); + else + elm_object_item_disabled_set(m_bookmark_edit_controlbar_item, EINA_FALSE); + } + + evas_object_show(m_bottom_control_bar); + + elm_object_item_part_content_set(navi_it, ELM_NAVIFRAME_ITEM_CONTROLBAR, m_bottom_control_bar); + } + + elm_object_focus_allow_set(m_bottom_control_bar, EINA_FALSE); + + return EINA_TRUE; +} + +void Browser_Bookmark_View::__naviframe_pop_finished_cb(void *data , Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_Bookmark_View *bookmark_view = (Browser_Bookmark_View *)data; + Elm_Object_Item *it = (Elm_Object_Item *)event_info; + + if (bookmark_view->m_navi_it != elm_naviframe_top_item_get(m_navi_bar)) + return; + + /* Bookmark view -> Edit one bookmark item, then cancel. */ + m_data_manager->destroy_edit_bookmark_view(); + + /* History view -> slide one item -> add to bookmark, then done. */ + m_data_manager->destroy_add_to_bookmark_view(); + + m_data_manager->destroy_new_folder_view(); +} + +Eina_Bool Browser_Bookmark_View::_create_main_layout(void) +{ + BROWSER_LOGD("[%s]", __func__); + m_main_layout = elm_layout_add(m_navi_bar); + if (!m_main_layout) { + BROWSER_LOGE("elm_layout_add failed"); + return EINA_FALSE; + } + if (!elm_layout_file_set(m_main_layout, BROWSER_EDJE_DIR"/browser-bookmark-view.edj", + "bookmark/main_layout")) { + BROWSER_LOGE("elm_layout_file_set failed"); + return EINA_FALSE; + } + + elm_win_conformant_set(m_win, EINA_TRUE); + m_conformant = elm_conformant_add(m_main_layout); + if (!m_conformant) { + BROWSER_LOGE("elm_conformant_add failed"); + return EINA_FALSE; + } + elm_object_style_set(m_conformant, "internal_layout"); + evas_object_size_hint_weight_set(m_conformant, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(m_conformant, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_show(m_conformant); + + elm_object_style_set(m_bg, "default"); + + m_genlist_content_layout = elm_layout_add(m_main_layout); + if (!m_genlist_content_layout) { + BROWSER_LOGE("elm_layout_add failed"); + return EINA_FALSE; + } + if (!elm_layout_file_set(m_genlist_content_layout, BROWSER_EDJE_DIR"/browser-bookmark-view.edj", + "bookmark/content_layout")) { + BROWSER_LOGE("elm_layout_file_set failed"); + return EINA_FALSE; + } + evas_object_size_hint_weight_set(m_genlist_content_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_show(m_genlist_content_layout); + edje_object_signal_emit(elm_layout_edje_get(m_genlist_content_layout), "show,content_box,signal", ""); + + m_genlist_content_box = elm_box_add(m_genlist_content_layout); + if (!m_genlist_content_box) { + BROWSER_LOGE("elm_box_add failed"); + return EINA_FALSE; + } + evas_object_size_hint_weight_set(m_genlist_content_box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_show(m_genlist_content_box); + elm_object_part_content_set(m_genlist_content_layout, "elm.swallow.content_box", m_genlist_content_box); + elm_box_pack_end(m_genlist_content_box, m_conformant); + + m_main_folder_genlist = _create_main_folder_genlist(); + if (!m_main_folder_genlist) { + BROWSER_LOGE("_create_main_folder_genlist failed"); + return EINA_FALSE; + } + + elm_object_content_set(m_conformant, m_main_folder_genlist); + + m_back_button = elm_button_add(m_main_layout); + if (!m_back_button) { + BROWSER_LOGE("elm_button_add failed"); + return EINA_FALSE; + } + elm_object_style_set(m_back_button, "browser/bookmark_controlbar_back"); + evas_object_smart_callback_add(m_back_button, "clicked", __back_button_clicked_cb, this); + evas_object_show(m_back_button); + + elm_object_part_content_set(m_main_layout, "elm.swallow.content", m_genlist_content_layout); + + m_top_control_bar = elm_toolbar_add(m_main_layout); + if (!m_top_control_bar) { + BROWSER_LOGE("elm_toolbar_add failed"); + return EINA_FALSE; + } + elm_object_style_set(m_top_control_bar, "browser/tabbar"); + + elm_toolbar_shrink_mode_set(m_top_control_bar, ELM_TOOLBAR_SHRINK_EXPAND); + + elm_object_part_content_set(m_main_layout, "elm.swallow.tabbar", m_top_control_bar); + + Elm_Object_Item *bookmark_tab_item = elm_toolbar_item_append(m_top_control_bar, NULL, + BR_STRING_BOOKMARKS, __controlbar_tab_changed_cb, this); + elm_toolbar_item_append(m_top_control_bar, NULL, BR_STRING_HISTORY, __controlbar_tab_changed_cb, this); + + elm_toolbar_select_mode_set(m_top_control_bar, ELM_OBJECT_SELECT_MODE_ALWAYS); + elm_toolbar_item_selected_set(bookmark_tab_item, EINA_TRUE); + + evas_object_show(m_top_control_bar); + + m_navi_it = elm_naviframe_item_push(m_navi_bar, NULL, m_back_button, NULL, + m_main_layout, "browser/tabbar"); + + evas_object_smart_callback_add(m_navi_bar, "transition,finished", __naviframe_pop_finished_cb, this); + + int size = m_main_folder_list.size(); + if (size == 0) + _show_empty_content_layout(EINA_TRUE); + else + _show_empty_content_layout(EINA_FALSE); + + return EINA_TRUE; +} + diff --git a/src/browser-bookmark/browser-bookmark-view.h b/src/browser-bookmark/browser-bookmark-view.h new file mode 100755 index 00000000..f8c4b2be --- /dev/null +++ b/src/browser-bookmark/browser-bookmark-view.h @@ -0,0 +1,153 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef BROWSER_BOOKMARK_VIEW_H +#define BROWSER_BOOKMARK_VIEW_H + +#include "browser-bookmark-db.h" +#include "browser-common-view.h" +#include "browser-config.h" + +class Browser_Bookmark_DB; + +class Browser_Bookmark_View : public Browser_Common_View { + friend class Browser_History_Layout; + friend class Browser_Add_To_Bookmark_View; + friend class Browser_New_Folder_View; +public: + Browser_Bookmark_View(void); + ~Browser_Bookmark_View(void); + + Eina_Bool init(void); + void return_to_bookmark_view(int added_bookmark_id = -1); +protected: + void history_item_clicked(const char *url); +private: + typedef enum _view_mode { + BOOKMARK_VIEW = 0, + HISTORY_VIEW + } view_mode; + + typedef enum _controlbar_type { + BOOKMARK_VIEW_DEFAULT = 0, + BOOKMARK_VIEW_EDIT_MODE, + HISTORY_VIEW_DEFAULT, + HISTORY_VIEW_EDIT_MODE + } controlbar_type; + + Eina_Bool _create_main_layout(void); + Evas_Object *_create_main_folder_genlist(void); + Evas_Object *_create_sub_folder_genlist(int folder_id); + void _go_to_sub_foler(const char *folder_name); + void _go_up_to_main_folder(void); + void _set_navigationbar_title(const char *title); + void _set_view_mode(view_mode mode); + void _set_edit_mode(Eina_Bool edit_mode); + void _show_selection_info(void); + void _delete_selected_bookmark(void); + void _show_empty_content_layout(Eina_Bool is_empty); + void _reorder_bookmark_item(int order_index, Eina_Bool is_move_down); + Eina_Bool _is_empty_folder(string folder_name); + Evas_Object *_get_current_folder_genlist(void); + void _delete_bookmark_item_from_folder_list(Browser_Bookmark_DB::bookmark_item *item); + vector<Browser_Bookmark_DB::bookmark_item *> _get_current_folder_item_list(void); + void _show_select_processing_popup(void); + void _show_delete_processing_popup(void); + Evas_Object *_show_delete_confirm_popup(void); + Eina_Bool _set_controlbar_type(controlbar_type type); + + /* ecore timer callback functions */ + static Eina_Bool __select_processing_popup_timer_cb(void *data); + static Eina_Bool __delete_processing_popup_timer_cb(void *data); + + /* evas object event callback functions. */ + static void __edit_mode_select_all_clicked_cb(void *data, Evas *evas, Evas_Object *obj, void *event_info); + + /* elementary event callback functions. */ + static void __select_processing_popup_response_cb(void *data, Evas_Object *obj, void *event_info); + static void __delete_processing_popup_response_cb(void *data, Evas_Object *obj, void *event_info); + static void __edit_bookmark_item_button_clicked_cb(void *data, Evas_Object *obj, void *event_info); + static void __rename_folder_unfocus_cb(void *data, Evas_Object *obj, void *event_info); + static void __rename_folder_entry_enter_key_cb(void *data, Evas_Object *obj, void *event_info); + static void __rename_folder_button_clicked_cb(void *data, Evas_Object *obj, void *event_info); + static void __edit_mode_item_check_changed_cb(void *data, Evas_Object *obj, void *event_info); + static void __edit_mode_select_all_check_changed_cb(void *data, Evas_Object *obj, void *event_info); + static void __upper_folder_clicked_cb(void *data, Evas_Object *obj, void *eventInfo); + static void __drag_genlist_cb(void *data, Evas_Object *obj, void *event_info); + static void __back_button_clicked_cb(void *data, Evas_Object *obj, void *event_info); + static void __edit_controlbar_item_clicked_cb(void *data, Evas_Object *obj, void *event_info); + static void __controlbar_tab_changed_cb(void *data, Evas_Object *obj, void *event_info); + static void __bookmark_item_clicked_cb(void *data, Evas_Object *obj, void *eventInfo); + static void __cancel_confirm_response_by_slide_button_cb(void *data, Evas_Object *obj, void *event_info); + static void __delete_confirm_response_by_edit_mode_cb(void *data, Evas_Object *obj, void *event_info); + static void __create_folder_button(void *data, Evas_Object *obj, void *event_info); + static void __delete_controlbar_item_clicked_cb(void *data, Evas_Object *obj, void *event_info); + static void __add_to_bookmark_cb(void *data, Evas_Object *obj, void *event_info); + static void __naviframe_pop_finished_cb(void *data , Evas_Object *obj, void *event_info); + + /* genlist callback functions. */ + static char *__genlist_label_get_cb(void *data, Evas_Object *obj, const char *part); + static Evas_Object *__genlist_icon_get_cb(void *data, Evas_Object *obj, const char *part); + static void __genlist_move_cb(void *data, Evas_Object *obj, void *event_info); + + Evas_Object *m_conformant; + Evas_Object *m_main_folder_genlist; + Evas_Object *m_sub_folder_conformant; + Evas_Object *m_sub_folder_genlist; + Evas_Object *m_content_layout; + Evas_Object *m_main_layout; + Evas_Object *m_genlist_content_layout; + Evas_Object *m_genlist_content_box; + Evas_Object *m_top_control_bar; + Evas_Object *m_bottom_control_bar; + Evas_Object *m_back_button; + Evas_Object *m_upper_folder_list; + Evas_Object *m_upper_folder_icon; + Evas_Object *m_edit_mode_select_all_layout; + Evas_Object *m_edit_mode_select_all_check_button; + Evas_Object *m_no_contents; + Evas_Object *m_rename_edit_field; + + Elm_Object_Item *m_bookmark_delete_controlbar_item; + Elm_Object_Item *m_bookmark_edit_controlbar_item; + Elm_Object_Item *m_create_folder_controlbar_item; + + Elm_Genlist_Item_Class m_bookmark_genlist_item_class; + Elm_Genlist_Item_Class m_folder_genlist_item_class; + + vector<Browser_Bookmark_DB::bookmark_item *> m_main_folder_list; + vector<Browser_Bookmark_DB::bookmark_item *> m_sub_folder_list; + + view_mode m_view_mode; + int m_current_folder_id; + string m_current_bookmark_navigationbar_title; + Elm_Object_Item *m_current_genlist_item_to_edit; + + /* For select all processing popup. */ + Evas_Object *m_processing_progress_bar; + Ecore_Timer *m_processing_popup_timer; + Elm_Object_Item *m_processed_it; + int m_processed_count; + int m_total_item_count; + Evas_Object *m_processing_popup; + Evas_Object *m_processing_popup_layout; + Eina_Bool m_select_all_check_value; + Elm_Object_Item *m_navi_it; + + Evas_Object *m_delete_confirm_popup; +}; +#endif /* BROWSER_BOOKMARK_VIEW_H */ + diff --git a/src/browser-bookmark/browser-new-folder-view.cpp b/src/browser-bookmark/browser-new-folder-view.cpp new file mode 100755 index 00000000..af1d94c1 --- /dev/null +++ b/src/browser-bookmark/browser-new-folder-view.cpp @@ -0,0 +1,297 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "browser-bookmark-db.h" +#include "browser-bookmark-view.h" +#include "browser-new-folder-view.h" +#include "browser-select-folder-view.h" + +Browser_New_Folder_View::Browser_New_Folder_View(void) +: + m_genlist(NULL) + ,m_conformant(NULL) + ,m_save_button(NULL) + ,m_cancel_button(NULL) + ,m_folder_name_edit_field(NULL) + ,m_navi_it(NULL) +{ + BROWSER_LOGD("[%s]", __func__); +} + +Browser_New_Folder_View::~Browser_New_Folder_View(void) +{ + BROWSER_LOGD("[%s]", __func__); + evas_object_smart_callback_del(m_navi_bar, "transition,finished", __naviframe_pop_finished_cb); +} + +Eina_Bool Browser_New_Folder_View::init(void) +{ + BROWSER_LOGD("[%s]", __func__); + + m_folder_name = _get_default_new_folder_name(); + return _create_main_layout(); +} + +void Browser_New_Folder_View::__cancel_button_clicked_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_New_Folder_View *new_folder_view = (Browser_New_Folder_View *)data; + + if (elm_naviframe_bottom_item_get(new_folder_view->m_navi_bar) + != elm_naviframe_top_item_get(new_folder_view->m_navi_bar)) + elm_naviframe_item_pop(new_folder_view->m_navi_bar); +} + +void Browser_New_Folder_View::__save_button_clicked_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_New_Folder_View *new_folder_view = (Browser_New_Folder_View *)data; + Evas_Object *edit_field = new_folder_view->m_folder_name_edit_field; + const char *input_text = elm_entry_entry_get(br_elm_editfield_entry_get(edit_field)); + + char *utf8_text = elm_entry_markup_to_utf8(input_text); + if (!utf8_text) { + BROWSER_LOGD("elm_entry_markup_to_utf8 failed"); + return; + } + + const char *folder_name = new_folder_view->_trim(utf8_text); + + if (!folder_name || strlen(folder_name) == 0) { + new_folder_view->show_msg_popup(BR_STRING_EMPTY_FOLDER_NAME); + BROWSER_LOGD("new_folder_view->m_folder_name.c_str() = [%s]", new_folder_view->m_folder_name.c_str()); + elm_entry_entry_set(br_elm_editfield_entry_get(edit_field), new_folder_view->m_folder_name.c_str()); + free(utf8_text); + return; + } else { + if (!new_folder_view->_create_new_folder(folder_name)) { + BROWSER_LOGD("_create_new_folder failed"); + free(utf8_text); + return; + } + } + + free(utf8_text); + + if (elm_naviframe_bottom_item_get(m_navi_bar) != elm_naviframe_top_item_get(m_navi_bar)) + elm_naviframe_item_pop(m_navi_bar); + + if (m_data_manager->is_in_view_stack(BR_SELECT_FOLDER_VIEW)) { + /* Add to bookmark -> Folder select -> New folder, then Done. */ + m_data_manager->get_select_folder_view()->return_to_select_folder_view(); + } + + Browser_Bookmark_View *bookmark_view = m_data_manager->get_bookmark_view(); + + if (m_data_manager->is_in_view_stack(BR_BOOKMARK_VIEW) + && !m_data_manager->is_in_view_stack(BR_SELECT_FOLDER_VIEW)) + bookmark_view->return_to_bookmark_view(); +} + +Eina_Bool Browser_New_Folder_View::_create_new_folder(const char *folder_name) +{ + BROWSER_LOGD("folder_name=[%s]", folder_name); + + Browser_Bookmark_DB *bookmark_db = m_data_manager->get_bookmark_db(); + Browser_Bookmark_View *bookmark_view = m_data_manager->get_bookmark_view(); + + if (bookmark_db->is_duplicated(folder_name)) { + show_msg_popup(BR_STRING_ALREADY_EXISTS); + return EINA_FALSE; + } + else if (bookmark_db->is_full()) { + show_msg_popup(BR_STRING_WARNING, BR_STRING_WARNING_OVER_BOOKMARK_LIMIT, 3); + return EINA_FALSE; + } + else { + Eina_Bool ret = bookmark_db->save_folder(folder_name); + if (!ret) + BROWSER_LOGD("bookmark_db->save_folder failed"); + } + + if (m_data_manager->is_in_view_stack(BR_BOOKMARK_VIEW)) { + /* If new folder is created, append the folder item to the main bookmark list. */ + vector<Browser_Bookmark_DB::bookmark_item *> folder_list; + bookmark_db->get_folder_list(folder_list); + for(int i = 0 ; i < folder_list.size() ; i++) { + if (!strcmp(folder_list[i]->title.c_str(), folder_name)) { + folder_list[i]->user_data_1 = (void *)bookmark_view; + bookmark_view->m_main_folder_list.push_back(folder_list[i]); + folder_list[i]->user_data_2 = (void *)elm_genlist_item_append(bookmark_view->m_main_folder_genlist, + &(bookmark_view->m_bookmark_genlist_item_class), folder_list[i], NULL, + ELM_GENLIST_ITEM_NONE, bookmark_view->__bookmark_item_clicked_cb, bookmark_view); + + break; + } + } + + for(int i = 0 ; i < folder_list.size() ; i++) { + if (folder_list[i] && strcmp(folder_list[i]->title.c_str(), folder_name)) + delete folder_list[i]; + } + + } + + return EINA_TRUE; +} + +void Browser_New_Folder_View::__title_entry_changed_cb(void *data, Evas_Object *obj, void *event_info) +{ + Browser_New_Folder_View *new_folder_view = (Browser_New_Folder_View *)data; + const char *title = elm_entry_entry_get(br_elm_editfield_entry_get(new_folder_view->m_folder_name_edit_field)); + + Eina_Bool only_has_space = EINA_FALSE; + int space_count = 0; + if (title && strlen(title)) { + for (int i = 0 ; i < strlen(title) ; i++) { + if (title[i] == ' ') + space_count++; + } + if (space_count == strlen(title)) + only_has_space = EINA_TRUE; + } + + if (!title || strlen(title) == 0 || only_has_space) + elm_object_disabled_set(new_folder_view->m_save_button, EINA_TRUE); + else + elm_object_disabled_set(new_folder_view->m_save_button, EINA_FALSE); +} + +Evas_Object *Browser_New_Folder_View::__genlist_icon_get_cb(void *data, Evas_Object *obj, const char *part) +{ + if (!data) + return NULL; + + Browser_New_Folder_View *new_folder_view = (Browser_New_Folder_View *)data; + + if (!strncmp(part, "elm.icon", strlen("elm.icon"))) { + new_folder_view->m_folder_name_edit_field = br_elm_editfield_add(obj, EINA_TRUE); + if (!new_folder_view->m_folder_name_edit_field) { + BROWSER_LOGE("elm_editfield_add failed"); + return NULL; + } + br_elm_editfield_entry_single_line_set(new_folder_view->m_folder_name_edit_field, EINA_TRUE); + br_elm_editfield_label_set(new_folder_view->m_folder_name_edit_field, BR_STRING_TITLE); + br_elm_editfield_guide_text_set(new_folder_view->m_folder_name_edit_field, BR_STRING_CLICK_HERE); + elm_entry_entry_set(br_elm_editfield_entry_get(new_folder_view->m_folder_name_edit_field), + new_folder_view->m_folder_name.c_str()); + + evas_object_smart_callback_add(br_elm_editfield_entry_get(new_folder_view->m_folder_name_edit_field), + "changed", __title_entry_changed_cb, new_folder_view); + + ecore_idler_add(new_folder_view->__set_focus_editfield_idler_cb, new_folder_view->m_folder_name_edit_field); + return new_folder_view->m_folder_name_edit_field; + } + + return NULL; +} + +string Browser_New_Folder_View::_get_default_new_folder_name(void) +{ + BROWSER_LOGD("[%s]", __func__); + int untitled_folder_count = 0; + Eina_Bool ret = m_data_manager->get_bookmark_db()->get_untitled_folder_count(&untitled_folder_count); + if (!ret) { + BROWSER_LOGD("get_untitled_folder_count failed"); + return std::string(""); + } + + char buf[32] = {0, }; + snprintf(buf, sizeof(buf), "Folder_%02d", untitled_folder_count); + + return std::string(buf); +} + +void Browser_New_Folder_View::__naviframe_pop_finished_cb(void *data , Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_New_Folder_View *new_folder_view = (Browser_New_Folder_View *)data; + Elm_Object_Item *it = (Elm_Object_Item *)event_info; + + if (new_folder_view->m_navi_it != elm_naviframe_top_item_get(m_navi_bar)) + return; +} + +Eina_Bool Browser_New_Folder_View::_create_main_layout(void) +{ + BROWSER_LOGD("[%s]", __func__); + elm_win_conformant_set(m_win, EINA_TRUE); + + m_conformant = elm_conformant_add(m_win); + if (!m_conformant) { + BROWSER_LOGE("elm_conformant_add failed"); + return EINA_FALSE; + } + elm_object_style_set(m_conformant, "internal_layout"); + evas_object_size_hint_align_set(m_conformant, EVAS_HINT_FILL, EVAS_HINT_FILL); + + m_genlist = elm_genlist_add(m_conformant); + if (!m_genlist) { + BROWSER_LOGE("elm_genlist_add failed"); + return EINA_FALSE; + } + + m_item_class.item_style = "1icon"; + m_item_class.func.text_get = NULL; + m_item_class.func.content_get = __genlist_icon_get_cb; + m_item_class.func.state_get = NULL; + m_item_class.func.del = NULL; + + elm_genlist_item_append(m_genlist, &m_item_class, this, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL); + evas_object_show(m_genlist); + elm_object_content_set(m_conformant, m_genlist); + + m_navi_it = elm_naviframe_item_push(m_navi_bar, BR_STRING_CREATE_FOLDER, NULL, NULL, + m_conformant, "browser_titlebar"); + + evas_object_smart_callback_add(m_navi_bar, "transition,finished", __naviframe_pop_finished_cb, this); + + elm_object_item_part_content_set(m_navi_it, ELM_NAVIFRAME_ITEM_PREV_BTN, NULL); + + m_save_button = elm_button_add(m_conformant); + if (!m_save_button) { + BROWSER_LOGE("elm_button_add failed"); + return EINA_FALSE; + } + elm_object_style_set(m_save_button, "browser/title_button"); + elm_object_text_set(m_save_button, BR_STRING_DONE); + evas_object_show(m_save_button); + evas_object_smart_callback_add(m_save_button, "clicked", __save_button_clicked_cb, this); + elm_object_item_part_content_set(m_navi_it, ELM_NAVIFRAME_ITEM_TITLE_RIGHT_BTN, m_save_button); + + m_cancel_button = elm_button_add(m_conformant); + if (!m_cancel_button) { + BROWSER_LOGE("elm_button_add failed"); + return EINA_FALSE; + } + elm_object_style_set(m_cancel_button, "browser/title_button"); + elm_object_text_set(m_cancel_button, BR_STRING_CANCEL); + evas_object_show(m_cancel_button); + evas_object_smart_callback_add(m_cancel_button, "clicked", __cancel_button_clicked_cb, this); + elm_object_item_part_content_set(m_navi_it, ELM_NAVIFRAME_ITEM_TITLE_LEFT_BTN, m_cancel_button); + + return EINA_TRUE; +} + diff --git a/src/browser-bookmark/browser-new-folder-view.h b/src/browser-bookmark/browser-new-folder-view.h new file mode 100755 index 00000000..22caea08 --- /dev/null +++ b/src/browser-bookmark/browser-new-folder-view.h @@ -0,0 +1,56 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef BROWSER_NEW_FOLDER_VIEW_H +#define BROWSER_NEW_FOLDER_VIEW_H + +#include "browser-common-view.h" +#include "browser-config.h" + +class Browser_New_Folder_View : public Browser_Common_View { +public: + Browser_New_Folder_View(void); + ~Browser_New_Folder_View(void); + + Eina_Bool init(void); +private: + Eina_Bool _create_main_layout(void); + Eina_Bool _create_new_folder(const char *folder_name); + string _get_default_new_folder_name(void); + + /* Elementary event callback functions */ + static void __cancel_button_clicked_cb(void *data, Evas_Object *obj, void *event_info); + static void __save_button_clicked_cb(void *data, Evas_Object *obj, void *event_info); + static void __title_entry_changed_cb(void *data, Evas_Object *obj, void *event_info); + static void __naviframe_pop_finished_cb(void *data , Evas_Object *obj, void *event_info); + + /* genlist event callback functions */ + static Evas_Object *__genlist_icon_get_cb(void *data, Evas_Object *obj, const char *part); + + Evas_Object *m_genlist; + Evas_Object *m_conformant; + Evas_Object *m_save_button; + Evas_Object *m_cancel_button; + Evas_Object *m_folder_name_edit_field; + + Elm_Genlist_Item_Class m_item_class; + Elm_Object_Item *m_navi_it; + + string m_folder_name; +}; + +#endif /* BROWSER_NEW_FOLDER_VIEW_H */ + diff --git a/src/browser-bookmark/browser-select-folder-view.cpp b/src/browser-bookmark/browser-select-folder-view.cpp new file mode 100755 index 00000000..0c78b098 --- /dev/null +++ b/src/browser-bookmark/browser-select-folder-view.cpp @@ -0,0 +1,285 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "browser-add-to-bookmark-view.h" +#include "browser-bookmark-db.h" +#include "browser-new-folder-view.h" +#include "browser-select-folder-view.h" + +Browser_Select_Folder_View::Browser_Select_Folder_View(int current_folder_id) +: + m_list(NULL) + ,m_conformant(NULL) + ,m_bottom_control_bar(NULL) + ,m_content_layout(NULL) + ,m_current_folder_id(current_folder_id) + ,m_main_folder_item(NULL) + ,m_cancel_button(NULL) + ,m_done_button(NULL) + ,m_navi_it(NULL) +{ + BROWSER_LOGD("[%s]", __func__); +} + +Browser_Select_Folder_View::~Browser_Select_Folder_View(void) +{ + BROWSER_LOGD("[%s]", __func__); + + if (m_main_folder_item) + delete m_main_folder_item; + + for(int i = 0 ; i < m_folder_list.size() ; i++ ) { + if (m_folder_list[i]) + delete m_folder_list[i]; + } + m_folder_list.clear(); + + evas_object_smart_callback_del(m_navi_bar, "transition,finished", __naviframe_pop_finished_cb); +} + +Eina_Bool Browser_Select_Folder_View::init(void) +{ + BROWSER_LOGD("[%s]", __func__); + + return _create_main_layout(); +} + +void Browser_Select_Folder_View::return_to_select_folder_view(void) +{ + BROWSER_LOGD("[%s]", __func__); + + _fill_folder_list(); +} + +void Browser_Select_Folder_View::__folder_item_selected_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + Elm_Object_Item *it = (Elm_Object_Item *)elm_list_selected_item_get(obj); + if (!it || !data) + return; + + Browser_Bookmark_DB::bookmark_item *item = (Browser_Bookmark_DB::bookmark_item *)elm_object_item_data_get(it); + Evas_Object *group_radio_button = (Evas_Object *)data; + Browser_Select_Folder_View *select_folder_view = (Browser_Select_Folder_View *)(item->user_data_1); + int index = item->user_data_3; + elm_radio_value_set(group_radio_button, index); + + select_folder_view->m_current_folder_id = item->id; + + elm_list_item_selected_set(it, EINA_FALSE); +} + +void Browser_Select_Folder_View::_fill_folder_list(void) +{ + BROWSER_LOGD("[%s]", __func__); + for(int i = 0 ; i < m_folder_list.size() ; i++ ) { + if (m_folder_list[i]) + delete m_folder_list[i]; + } + + m_folder_list.clear(); + elm_list_clear(m_list); + + Evas_Object *radio_group_button = elm_radio_add(m_list); + if (!radio_group_button) { + BROWSER_LOGE("elm_list_add failed"); + return; + } + + m_main_folder_item = new(nothrow) Browser_Bookmark_DB::bookmark_item; + if (!m_main_folder_item) { + BROWSER_LOGE("new Browser_Bookmark_DB::bookmark_item failed"); + return; + } + + int index = 0; + elm_radio_state_value_set(radio_group_button, EINA_FALSE); + + m_main_folder_item->id = BROWSER_BOOKMARK_MAIN_FOLDER_ID; + m_main_folder_item->title = std::string(BR_STRING_BOOKMARKS); + m_main_folder_item->user_data_1 = this; + m_main_folder_item->user_data_3 = index; + elm_list_item_append(m_list, BR_STRING_BOOKMARKS, radio_group_button, NULL, NULL, (void *)m_main_folder_item); + + elm_radio_value_set(radio_group_button, index); + + if (m_data_manager->get_bookmark_db()->get_folder_list(m_folder_list)) { + BROWSER_LOGE("m_folder_list.size()=%d", m_folder_list.size()); + for (int i = 0 ; i < m_folder_list.size() ; i++) { + Evas_Object *radio_button = elm_radio_add(m_list); + if (!radio_button) { + BROWSER_LOGE("elm_radio_add failed"); + return; + } + m_folder_list[i]->user_data_1 = this; + + /* The default main bookmark folder's index is already counted. So increase the index by 1. */ + elm_radio_state_value_set(radio_button, i + 1); + m_folder_list[i]->user_data_3 = i + 1; + + elm_list_item_append(m_list, m_folder_list[i]->title.c_str(), radio_button, + NULL, NULL, (void*)m_folder_list[i]); + elm_radio_group_add(radio_button, radio_group_button); + + if (m_current_folder_id == m_folder_list[i]->id) + elm_radio_value_set(radio_group_button, i + 1); + } + } + + evas_object_smart_callback_add(m_list, "selected", __folder_item_selected_cb, radio_group_button); + elm_list_go(m_list); +} + +void Browser_Select_Folder_View::__new_folder_clicked_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_Select_Folder_View *select_folder_view = (Browser_Select_Folder_View *)data; + + if (!m_data_manager->create_new_folder_view()) { + BROWSER_LOGE("create_new_folder_view failed"); + return; + } + + if (!m_data_manager->get_new_folder_view()->init()) { + BROWSER_LOGE("get_new_folder_view()->init() failed"); + m_data_manager->destroy_new_folder_view(); + return; + } +} + +void Browser_Select_Folder_View::__cancel_button_clicked_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + Browser_Select_Folder_View *select_folder_view = (Browser_Select_Folder_View *)data; + + if (elm_naviframe_bottom_item_get(select_folder_view->m_navi_bar) + != elm_naviframe_top_item_get(select_folder_view->m_navi_bar)) + elm_naviframe_item_pop(select_folder_view->m_navi_bar); +} + +void Browser_Select_Folder_View::__done_button_clicked_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + + if (!data) + return; + + Browser_Select_Folder_View *select_folder_view = (Browser_Select_Folder_View *)data; + int selected_folder_id = select_folder_view->m_current_folder_id; + + if (elm_naviframe_bottom_item_get(select_folder_view->m_navi_bar) + != elm_naviframe_top_item_get(select_folder_view->m_navi_bar)) + elm_naviframe_item_pop(select_folder_view->m_navi_bar); + + if (m_data_manager->get_edit_bookmark_view()) + m_data_manager->get_edit_bookmark_view()->return_to_add_to_bookmark_view(selected_folder_id); + else if (m_data_manager->get_add_to_bookmark_view()) + m_data_manager->get_add_to_bookmark_view()->return_to_add_to_bookmark_view(selected_folder_id); +} + +void Browser_Select_Folder_View::__naviframe_pop_finished_cb(void *data , Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_Select_Folder_View *select_folder_view = (Browser_Select_Folder_View *)data; + Elm_Object_Item *it = (Elm_Object_Item *)event_info; + + if (select_folder_view->m_navi_it != elm_naviframe_top_item_get(m_navi_bar)) + return; + + m_data_manager->destroy_new_folder_view(); +} + +Eina_Bool Browser_Select_Folder_View::_create_main_layout(void) +{ + BROWSER_LOGD("[%s]", __func__); + + m_content_layout = elm_layout_add(m_navi_bar); + if (!m_content_layout) { + BROWSER_LOGE("elm_layout_add failed"); + return EINA_FALSE; + } + if (!elm_layout_file_set(m_content_layout, BROWSER_EDJE_DIR"/browser-bookmark-view.edj", + "bookmark/bookmark-folder-view-layout")) { + BROWSER_LOGE("elm_layout_file_set failed"); + return EINA_FALSE; + } + evas_object_size_hint_weight_set(m_content_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + + m_list = elm_list_add(m_content_layout); + if (!m_list) { + BROWSER_LOGE("_create_folder_list failed"); + return EINA_FALSE; + } + elm_list_mode_set(m_list, ELM_LIST_COMPRESS); + evas_object_size_hint_weight_set(m_list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(m_list, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_show(m_list); + elm_object_part_content_set(m_content_layout, "elm.swallow.folderlist", m_list); + + _fill_folder_list(); + + m_bottom_control_bar = elm_toolbar_add(m_content_layout); + if (!m_bottom_control_bar) { + BROWSER_LOGE("elm_toolbar_add failed"); + return EINA_FALSE; + } + elm_object_style_set(m_bottom_control_bar, "browser/default"); + elm_toolbar_shrink_mode_set(m_bottom_control_bar, ELM_TOOLBAR_SHRINK_EXPAND); + + evas_object_show(m_bottom_control_bar); + + elm_toolbar_item_append(m_bottom_control_bar, NULL, BR_STRING_CREATE_FOLDER, __new_folder_clicked_cb, this); + elm_object_part_content_set(m_content_layout, "elm.swallow.controlbar", m_bottom_control_bar); + evas_object_show(m_content_layout); + + m_navi_it = elm_naviframe_item_push(m_navi_bar, BR_STRING_FOLDER, NULL, NULL, m_content_layout, "browser_titlebar"); + elm_object_item_part_content_set(m_navi_it, ELM_NAVIFRAME_ITEM_PREV_BTN, NULL); + + evas_object_smart_callback_add(m_navi_bar, "transition,finished", __naviframe_pop_finished_cb, this); + + m_cancel_button = elm_button_add(m_content_layout); + if (!m_cancel_button) { + BROWSER_LOGE("elm_button_add failed"); + return EINA_FALSE; + } + elm_object_style_set(m_cancel_button, "browser/title_button"); + elm_object_text_set(m_cancel_button, BR_STRING_CANCEL); + evas_object_show(m_cancel_button); + evas_object_smart_callback_add(m_cancel_button, "clicked", __cancel_button_clicked_cb, this); + elm_object_item_part_content_set(m_navi_it, ELM_NAVIFRAME_ITEM_TITLE_LEFT_BTN, m_cancel_button); + + m_done_button = elm_button_add(m_content_layout); + if (!m_done_button) { + BROWSER_LOGE("elm_button_add failed"); + return EINA_FALSE; + } + elm_object_style_set(m_done_button, "browser/title_button"); + elm_object_text_set(m_done_button, BR_STRING_DONE); + evas_object_show(m_done_button); + evas_object_smart_callback_add(m_done_button, "clicked", __done_button_clicked_cb, this); + elm_object_item_part_content_set(m_navi_it, ELM_NAVIFRAME_ITEM_TITLE_RIGHT_BTN, m_done_button); + + return EINA_TRUE; +} + diff --git a/src/browser-bookmark/browser-select-folder-view.h b/src/browser-bookmark/browser-select-folder-view.h new file mode 100755 index 00000000..bf4bc596 --- /dev/null +++ b/src/browser-bookmark/browser-select-folder-view.h @@ -0,0 +1,55 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef BROWSER_SELECT_FOLDER_VIEW_H +#define BROWSER_SELECT_FOLDER_VIEW_H + +#include "browser-common-view.h" +#include "browser-config.h" + +class Browser_Select_Folder_View : public Browser_Common_View { +public: + Browser_Select_Folder_View(int current_folder_id); + ~Browser_Select_Folder_View(void); + + Eina_Bool init(void); + void return_to_select_folder_view(void); +private: + Eina_Bool _create_main_layout(void); + void _fill_folder_list(void); + + /* Elementary event callback functions */ + static void __folder_item_selected_cb(void *data, Evas_Object *obj, void *event_info); + static void __new_folder_clicked_cb(void *data, Evas_Object *obj, void *event_info); + static void __cancel_button_clicked_cb(void *data, Evas_Object *obj, void *event_info); + static void __done_button_clicked_cb(void *data, Evas_Object *obj, void *event_info); + static void __naviframe_pop_finished_cb(void *data , Evas_Object *obj, void *event_info); + + Evas_Object *m_list; + Evas_Object *m_content_layout; + Evas_Object *m_conformant; + Evas_Object *m_bottom_control_bar; + Evas_Object *m_cancel_button; + Evas_Object *m_done_button; + Elm_Object_Item *m_navi_it; + + int m_current_folder_id; + vector<Browser_Bookmark_DB::bookmark_item *> m_folder_list; + Browser_Bookmark_DB::bookmark_item *m_main_folder_item; +}; + +#endif /* BROWSER_SELECT_FOLDER_VIEW_H */ + diff --git a/src/browser-class.cpp b/src/browser-class.cpp new file mode 100755 index 00000000..339f6992 --- /dev/null +++ b/src/browser-class.cpp @@ -0,0 +1,991 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "browser-authentication-manager.h" +#include "browser-certificate-manager.h" +#include "browser-class.h" +#include "browser-context-menu.h" +#include "browser-download-manager.h" +#include "browser-exscheme-handler.h" +#include "browser-find-word.h" +#include "browser-multi-window-view.h" +#include "browser-network-manager.h" +#include "browser-notification-manager.h" +#include "browser-picker-handler.h" +#include "browser-user-agent-db.h" +#include "browser-view.h" +#include "browser-window.h" + +Browser_Class::Browser_Class(Evas_Object *win, Evas_Object *navi_bar, Evas_Object *bg, Evas_Object *layout) +: + m_win(win) + ,m_navi_bar(navi_bar) + ,m_bg(bg) + ,m_layout(layout) + ,m_browser_view(NULL) + ,m_focused_window(NULL) + ,m_user_agent_db(NULL) + ,m_download_manager(NULL) + ,m_clean_up_windows_timer(NULL) + ,m_authentication_manager(NULL) + ,m_certificate_manager(NULL) + ,m_notification_manager(NULL) + ,m_network_manager(NULL) +{ + m_window_list.clear(); + BROWSER_LOGD("[%s]", __func__); +} + +Browser_Class::~Browser_Class(void) +{ + BROWSER_LOGD("[%s]", __func__); + if (m_browser_view) + delete m_browser_view; + if (m_user_agent_db) + delete m_user_agent_db; + if (m_download_manager) + delete m_download_manager; + if (m_authentication_manager) + delete m_authentication_manager; + if (m_certificate_manager) + delete m_certificate_manager; + if (m_notification_manager) + delete m_notification_manager; + if (m_network_manager) + delete m_network_manager; + + for (int i = 0 ; i < m_window_list.size() ; i++) { + if (m_window_list[i]) + delete m_window_list[i]; + m_window_list.erase(m_window_list.begin() + i); + } + + if (m_clean_up_windows_timer) + ecore_timer_del(m_clean_up_windows_timer); + + if (!ewk_cache_dump()) + BROWSER_LOGE("ewk_cache_dump failed"); + + ewk_shutdown(); +} + +Eina_Bool Browser_Class::init(void) +{ + BROWSER_LOGD("[%s]", __func__); + ewk_init(); + + m_user_agent_db = new(nothrow) Browser_User_Agent_DB; + if (!m_user_agent_db) { + BROWSER_LOGE("new Browser_User_Agent_DB failed"); + return EINA_FALSE; + } + + m_browser_view = new(nothrow) Browser_View(m_win, m_navi_bar, m_bg, m_layout, this); + /* Create browser view layout */ + if (m_browser_view) { + if (!m_browser_view->init()) { + BROWSER_LOGE("m_browser_view->init failed"); + return EINA_FALSE; + } + } else + return EINA_FALSE; + + m_download_manager = new(nothrow) Browser_Download_Manager(m_navi_bar, m_browser_view); + if (!m_download_manager) { + BROWSER_LOGE("new Browser_Policy_Decision_Maker failed"); + return EINA_FALSE; + } + + m_authentication_manager = new(nothrow) Browser_Authetication_Manager; + if (!m_authentication_manager) { + BROWSER_LOGE("new Browser_Authetication_Manager failed"); + return EINA_FALSE; + } + m_authentication_manager->init(); + + m_certificate_manager = new(nothrow) Browser_Certificate_Manager; + if (!m_certificate_manager) { + BROWSER_LOGE("new Browser_Certificate_Manager failed"); + return EINA_FALSE; + } + if (!m_certificate_manager->init()) { + BROWSER_LOGE("m_certificate_manager->init failed"); + delete m_certificate_manager; + m_certificate_manager = NULL; + return EINA_FALSE; + } + + m_notification_manager = new(nothrow) Browser_Notification_Manager; + if (!m_notification_manager) { + BROWSER_LOGE("new Browser_Notification_Manager failed"); + return EINA_FALSE; + } + + m_network_manager = new(nothrow) Browser_Network_Manager; + if (!m_network_manager) { + BROWSER_LOGE("new Browser_Network_Manager failed"); + return EINA_FALSE; + } + + if (!_set_ewk_view_options_listener()) { + BROWSER_LOGE("_set_ewk_view_options_listener failed"); + return EINA_FALSE; + } + + if (!ewk_settings_icon_database_path_set(DATABASE_DIR)) { + BROWSER_LOGE("ewk_settings_icon_database_path_set failed"); + return EINA_FALSE; + } + + if (!ewk_cache_init(WEBKIT_SOUP_CACHE_DIR, EINA_FALSE)) { + BROWSER_LOGE("ewk_cache_init failed"); + return EINA_FALSE; + } + if (!ewk_cache_load()) { + BROWSER_LOGE("ewk_cache_load failed"); + return EINA_FALSE; + } + + if (!ewk_cookies_file_set(DATABASE_DIR"/"COOKIES_DATABASENAME)) { + BROWSER_LOGE("ewk_cookies_file_set failed"); + return EINA_FALSE; + } + + return EINA_TRUE; +} + +void Browser_Class::__vconf_changed_cb(keynode_t *keynode, void *data) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_Class *browser = (Browser_Class *)data; + char *key = vconf_keynode_get_name(keynode); + if (!key || strlen(key) == 0) { + BROWSER_LOGD("vconf_keynode_get_name failed"); + return; + } + + if (!strncmp(key, USERAGENT_KEY, strlen(USERAGENT_KEY))) { + for (int i = 0 ; i < browser->m_window_list.size() ; i++) { + if (browser->m_window_list[i]->m_ewk_view) { + if (!browser->_set_user_agent(browser->m_window_list[i]->m_ewk_view)) + BROWSER_LOGE("_set_user_agent failed"); + } + } + } else if (!strncmp(key, DEFAULT_VIEW_LEVEL_KEY, strlen(DEFAULT_VIEW_LEVEL_KEY))) { + char *default_level = vconf_get_str(DEFAULT_VIEW_LEVEL_KEY); + for (int i = 0 ; i < browser->m_window_list.size() ; i++) { + if (default_level && browser->m_window_list[i]->m_ewk_view) { + if (!strncmp(default_level, FIT_TO_WIDTH, strlen(FIT_TO_WIDTH))) + elm_webview_auto_fitting_set(browser->m_window_list[i]->m_ewk_view, EINA_TRUE); + else + elm_webview_auto_fitting_set(browser->m_window_list[i]->m_ewk_view, EINA_FALSE); + } + } + if (default_level) + free(default_level); + } else if (!strncmp(key, RUN_JAVASCRIPT_KEY, strlen(RUN_JAVASCRIPT_KEY))) { + int run_javascript = 1; + if (vconf_get_bool(RUN_JAVASCRIPT_KEY, &run_javascript) < 0) + BROWSER_LOGE("Can not get [%s] value.\n", RUN_JAVASCRIPT_KEY); + for (int i = 0 ; i < browser->m_window_list.size() ; i++) { + if (browser->m_window_list[i]->m_ewk_view) { + Evas_Object *webkit = elm_webview_webkit_get(browser->m_window_list[i]->m_ewk_view); + if (run_javascript) { + if (!ewk_view_setting_enable_scripts_set(webkit, EINA_TRUE)) + BROWSER_LOGE("ewk_view_setting_enable_scripts_set failed"); + } else { + if (!ewk_view_setting_enable_scripts_set(webkit, EINA_FALSE)) + BROWSER_LOGE("ewk_view_setting_enable_scripts_set failed"); + } + } + } + } else if (!strncmp(key, DISPLAY_IMAGES_KEY, strlen(DISPLAY_IMAGES_KEY))) { + int display_images = 1; + if (vconf_get_bool(DISPLAY_IMAGES_KEY, &display_images) < 0) + BROWSER_LOGE("Can not get [%s] value.\n", DISPLAY_IMAGES_KEY); + for (int i = 0 ; i < browser->m_window_list.size() ; i++) { + if (browser->m_window_list[i]->m_ewk_view) { + Evas_Object *webkit = elm_webview_webkit_get(browser->m_window_list[i]->m_ewk_view); + if (display_images) { + if (!ewk_view_setting_auto_load_images_set(webkit, EINA_TRUE)) + BROWSER_LOGE("ewk_view_setting_auto_load_images_set failed"); + } else { + if (!ewk_view_setting_auto_load_images_set(webkit, EINA_FALSE)) + BROWSER_LOGE("ewk_view_setting_auto_load_images_set failed"); + } + } + } + } else if (!strncmp(key, BLOCK_POPUP_KEY, strlen(BLOCK_POPUP_KEY))) { + int block_popup = 1; + if (vconf_get_bool(BLOCK_POPUP_KEY, &block_popup) < 0) + BROWSER_LOGE("Can not get [%s] value.\n", BLOCK_POPUP_KEY); + for (int i = 0 ; i < browser->m_window_list.size() ; i++) { + if (browser->m_window_list[i]->m_ewk_view) { + Evas_Object *webkit = elm_webview_webkit_get(browser->m_window_list[i]->m_ewk_view); + if (block_popup) { + if (!ewk_view_setting_scripts_window_open_set(webkit, EINA_FALSE)) + BROWSER_LOGE("ewk_view_setting_scripts_window_open_set failed"); + } else { + if (!ewk_view_setting_scripts_window_open_set(webkit, EINA_TRUE)) + BROWSER_LOGE("ewk_view_setting_scripts_window_open_set failed"); + } + } + } + } else if (!strncmp(key, ACCEPT_COOKIES_KEY, strlen(ACCEPT_COOKIES_KEY))) { + int accept_cookies = 1; + if (vconf_get_bool(ACCEPT_COOKIES_KEY, &accept_cookies) < 0) + BROWSER_LOGE("Can not get [%s] value.\n", ACCEPT_COOKIES_KEY); + if (accept_cookies) + ewk_cookies_policy_set(EWK_COOKIE_JAR_ACCEPT_ALWAYS); + else + ewk_cookies_policy_set(EWK_COOKIE_JAR_ACCEPT_NEVER); + } else if (!strncmp(key, RUN_PLUGINS_KEY, strlen(RUN_PLUGINS_KEY))) { + int run_plugins = 1; + if (vconf_get_bool(RUN_PLUGINS_KEY, &run_plugins) < 0) + BROWSER_LOGE("Can not get [%s] value.\n", RUN_PLUGINS_KEY); + + for (int i = 0 ; i < browser->m_window_list.size() ; i++) { + if (browser->m_window_list[i]->m_ewk_view) { + Evas_Object *webkit = elm_webview_webkit_get(browser->m_window_list[i]->m_ewk_view); + if (run_plugins) { + if (!ewk_view_setting_enable_plugins_set(webkit, EINA_TRUE)) + BROWSER_LOGE("ewk_view_setting_enable_plugins_set failed"); + if (!ewk_view_setting_enable_specified_plugin_set(webkit, + EINA_TRUE, BROWSER_FLASH_MIME_TYPE)) { + BROWSER_LOGE("ewk_view_setting_enable_specified_plugin_set failed"); + } + } else { + if (!ewk_view_setting_enable_plugins_set(webkit, EINA_FALSE)) + BROWSER_LOGE("ewk_view_setting_enable_plugins_set failed"); + if (!ewk_view_setting_enable_specified_plugin_set(webkit, + EINA_FALSE, BROWSER_FLASH_MIME_TYPE)) { + BROWSER_LOGE("ewk_view_setting_enable_specified_plugin_set failed"); + } + } + } + } + }else if (!strncmp(key, ACCELERATED_COMPOSITION_KEY, strlen(ACCELERATED_COMPOSITION_KEY))) { + BROWSER_LOGD("ACCELERATED_COMPOSITION_KEY"); + int accelerated_composition = 1; + if (vconf_get_bool(ACCELERATED_COMPOSITION_KEY, &accelerated_composition) < 0) + BROWSER_LOGE("Can not get [%s] value.\n", ACCELERATED_COMPOSITION_KEY); + + int external_video_player = 0; + if (vconf_get_bool(EXTERNAL_VIDEO_PLAYER_KEY, &external_video_player) < 0) + BROWSER_LOGE("Can not get [%s] value.\n", EXTERNAL_VIDEO_PLAYER_KEY); + + for (int i = 0 ; i < browser->m_window_list.size() ; i++) { + if (browser->m_window_list[i]->m_ewk_view) { + Evas_Object *webkit = elm_webview_webkit_get(browser->m_window_list[i]->m_ewk_view); + if (accelerated_composition) { + if (!ewk_view_setting_accelerated_compositing_enable_set(webkit, EINA_TRUE)) + BROWSER_LOGE("ewk_view_setting_accelerated_compositing_enable_set failed"); + if (external_video_player) { + if (!ewk_view_setting_html5video_external_player_enable_set(webkit, EINA_TRUE)) + BROWSER_LOGE("ewk_view_setting_html5video_external_player_enable_set failed"); + } else { + if (!ewk_view_setting_html5video_external_player_enable_set(webkit, EINA_FALSE)) + BROWSER_LOGE("ewk_view_setting_html5video_external_player_enable_set failed"); + } + } else { + if (!ewk_view_setting_accelerated_compositing_enable_set(webkit, EINA_FALSE)) + BROWSER_LOGE("ewk_view_setting_accelerated_compositing_enable_set failed"); + if (!ewk_view_setting_html5video_external_player_enable_set(webkit, EINA_TRUE)) + BROWSER_LOGE("ewk_view_setting_html5video_external_player_enable_set failed"); + } + } + } + }else if (!strncmp(key, EXTERNAL_VIDEO_PLAYER_KEY, strlen(EXTERNAL_VIDEO_PLAYER_KEY))) { + int external_video_player = 0; + if (vconf_get_bool(EXTERNAL_VIDEO_PLAYER_KEY, &external_video_player) < 0) + BROWSER_LOGE("Can not get [%s] value.\n", EXTERNAL_VIDEO_PLAYER_KEY); + + for (int i = 0 ; i < browser->m_window_list.size() ; i++) { + if (browser->m_window_list[i]->m_ewk_view) { + Evas_Object *webkit = elm_webview_webkit_get(browser->m_window_list[i]->m_ewk_view); + if (external_video_player) { + if (!ewk_view_setting_html5video_external_player_enable_set(webkit, EINA_TRUE)) + BROWSER_LOGE("ewk_view_setting_html5video_external_player_enable_set failed"); + } else { + if (!ewk_view_setting_html5video_external_player_enable_set(webkit, EINA_FALSE)) + BROWSER_LOGE("ewk_view_setting_html5video_external_player_enable_set failed"); + } + } + } + } + +} + +Eina_Bool Browser_Class::_set_ewk_view_options_listener(void) +{ + BROWSER_LOGD("[%s]", __func__); + if (vconf_notify_key_changed(USERAGENT_KEY, __vconf_changed_cb, this) < 0) { + BROWSER_LOGE("user agent vconf_notify_key_changed failed"); + return EINA_FALSE; + } + if (vconf_notify_key_changed(DEFAULT_VIEW_LEVEL_KEY, __vconf_changed_cb, this) < 0) { + BROWSER_LOGE("default view level vconf_notify_key_changed failed"); + return EINA_FALSE; + } + if (vconf_notify_key_changed(RUN_JAVASCRIPT_KEY, __vconf_changed_cb, this) < 0) { + BROWSER_LOGE("run javascript level vconf_notify_key_changed failed"); + return EINA_FALSE; + } + if (vconf_notify_key_changed(DISPLAY_IMAGES_KEY, __vconf_changed_cb, this) < 0) { + BROWSER_LOGE("display images level vconf_notify_key_changed failed"); + return EINA_FALSE; + } + if (vconf_notify_key_changed(BLOCK_POPUP_KEY, __vconf_changed_cb, this) < 0) { + BROWSER_LOGE("BLOCK_POPUP_KEY vconf_notify_key_changed failed"); + return EINA_FALSE; + } + if (vconf_notify_key_changed(ACCEPT_COOKIES_KEY, __vconf_changed_cb, this) < 0) { + BROWSER_LOGE("ACCEPT_COOKIES_KEY vconf_notify_key_changed failed"); + return EINA_FALSE; + } + if (vconf_notify_key_changed(RUN_PLUGINS_KEY, __vconf_changed_cb, this) < 0) { + BROWSER_LOGE("RUN_PLUGINS_KEY vconf_notify_key_changed failed"); + return EINA_FALSE; + } + if (vconf_notify_key_changed(ACCELERATED_COMPOSITION_KEY, __vconf_changed_cb, this) < 0) { + BROWSER_LOGE("ACCELERATED_COMPOSITION_KEY vconf_notify_key_changed failed"); + return EINA_FALSE; + } + if (vconf_notify_key_changed(EXTERNAL_VIDEO_PLAYER_KEY, __vconf_changed_cb, this) < 0) { + BROWSER_LOGE("EXTERNAL_VIDEO_PLAYER_KEY vconf_notify_key_changed failed"); + return EINA_FALSE; + } + + return EINA_TRUE; +} + +Eina_Bool Browser_Class::_set_ewk_view_options(Evas_Object *ewk_view) +{ + BROWSER_LOGD("[%s]", __func__); + + if (!_set_user_agent(ewk_view)) + BROWSER_LOGE("_set_user_agent failed"); + + char *default_level = vconf_get_str(DEFAULT_VIEW_LEVEL_KEY); + if (default_level) { + if (!strncmp(default_level, FIT_TO_WIDTH, strlen(FIT_TO_WIDTH))) + elm_webview_auto_fitting_set(ewk_view, EINA_TRUE); + else + elm_webview_auto_fitting_set(ewk_view, EINA_FALSE); + + free(default_level); + } + + int run_javascript = 1; + if (vconf_get_bool(RUN_JAVASCRIPT_KEY, &run_javascript) < 0) + BROWSER_LOGE("Can not get [%s] value.\n", RUN_JAVASCRIPT_KEY); + Evas_Object *webkit = elm_webview_webkit_get(ewk_view); + if (run_javascript) { + if (!ewk_view_setting_enable_scripts_set(webkit, EINA_TRUE)) + BROWSER_LOGE("ewk_view_setting_enable_scripts_set failed"); + } else { + if (!ewk_view_setting_enable_scripts_set(webkit, EINA_FALSE)) + BROWSER_LOGE("ewk_view_setting_enable_scripts_set failed"); + } + + int display_images = 1; + if (vconf_get_bool(DISPLAY_IMAGES_KEY, &display_images) < 0) + BROWSER_LOGE("Can not get [%s] value.\n", DISPLAY_IMAGES_KEY); + if (display_images) { + if (!ewk_view_setting_auto_load_images_set(webkit, EINA_TRUE)) + BROWSER_LOGE("ewk_view_setting_auto_load_images_set failed"); + } else { + if (!ewk_view_setting_auto_load_images_set(webkit, EINA_FALSE)) + BROWSER_LOGE("ewk_view_setting_auto_load_images_set failed"); + } + + int block_popup = 1; + if (vconf_get_bool(BLOCK_POPUP_KEY, &block_popup) < 0) + BROWSER_LOGE("Can not get [%s] value.\n", BLOCK_POPUP_KEY); + if (block_popup) { + if (!ewk_view_setting_scripts_window_open_set(webkit, EINA_FALSE)) + BROWSER_LOGE("ewk_view_setting_scripts_window_open_set failed"); + } else { + if (!ewk_view_setting_scripts_window_open_set(webkit, EINA_TRUE)) + BROWSER_LOGE("ewk_view_setting_auto_load_images_set failed"); + } + + int accept_cookies = 1; + if (vconf_get_bool(ACCEPT_COOKIES_KEY, &accept_cookies) < 0) + BROWSER_LOGE("Can not get [%s] value.\n", ACCEPT_COOKIES_KEY); + if (accept_cookies) + ewk_cookies_policy_set(EWK_COOKIE_JAR_ACCEPT_ALWAYS); + else + ewk_cookies_policy_set(EWK_COOKIE_JAR_ACCEPT_NEVER); + + int run_plugins = 1; + if (vconf_get_bool(RUN_PLUGINS_KEY, &run_plugins) < 0) + BROWSER_LOGE("Can not get [%s] value.\n", RUN_PLUGINS_KEY); + if (run_plugins) { + if (!ewk_view_setting_enable_plugins_set(webkit, EINA_TRUE)) + BROWSER_LOGE("ewk_view_setting_enable_plugins_set failed"); + if (!ewk_view_setting_enable_specified_plugin_set(webkit, + EINA_TRUE, BROWSER_FLASH_MIME_TYPE)) { + BROWSER_LOGE("ewk_view_setting_enable_specified_plugin_set failed"); + } + } else { + if (!ewk_view_setting_enable_plugins_set(webkit, EINA_FALSE)) + BROWSER_LOGE("ewk_view_setting_enable_plugins_set failed"); + if (!ewk_view_setting_enable_specified_plugin_set(webkit, + EINA_FALSE, BROWSER_FLASH_MIME_TYPE)) { + BROWSER_LOGE("ewk_view_setting_enable_specified_plugin_set failed"); + } + } + int accelerated_composition = 1; + if (vconf_get_bool(ACCELERATED_COMPOSITION_KEY, &accelerated_composition) < 0) + BROWSER_LOGE("Can not get [%s] value.\n", ACCELERATED_COMPOSITION_KEY); + if (accelerated_composition) { + if (!ewk_view_setting_accelerated_compositing_enable_set(webkit, EINA_TRUE)) + BROWSER_LOGE("ewk_view_setting_accelerated_compositing_enable_set failed"); +/* if (!ewk_view_setting_html5video_external_player_enable_set(webkit, EINA_FALSE)) { + BROWSER_LOGE("ewk_view_setting_html5video_external_player_enable_set failed"); + } + */ + } else { + if (!ewk_view_setting_accelerated_compositing_enable_set(webkit, EINA_FALSE)) + BROWSER_LOGE("ewk_view_setting_accelerated_compositing_enable_set failed"); + if (!ewk_view_setting_html5video_external_player_enable_set(webkit, EINA_TRUE)) { + BROWSER_LOGE("ewk_view_setting_html5video_external_player_enable_set failed"); + } + } + + int external_video_player = 1; + if (vconf_get_bool(EXTERNAL_VIDEO_PLAYER_KEY, &external_video_player) < 0) + BROWSER_LOGE("Can not get [%s] value.\n", EXTERNAL_VIDEO_PLAYER_KEY); + if (external_video_player) { + if (!ewk_view_setting_html5video_external_player_enable_set(webkit, EINA_TRUE)) + BROWSER_LOGE("ewk_view_setting_html5video_external_player_enable_set failed"); + } else { + if (!ewk_view_setting_html5video_external_player_enable_set(webkit, EINA_FALSE)) + BROWSER_LOGE("ewk_view_setting_html5video_external_player_enable_set failed"); + } + elm_webview_enable_default_context_menu_set(ewk_view, EINA_TRUE); + elm_webview_auto_suspend_set(ewk_view, EINA_TRUE); + elm_webview_use_mouse_down_delay_set(ewk_view, EINA_TRUE); + elm_webview_show_ime_on_autofocus_set(ewk_view, EINA_FALSE); + + ewk_view_visibility_state_set(webkit, EWK_PAGE_VISIBILITY_STATE_VISIBLE, EINA_TRUE); + + if (!ewk_view_setting_geolocation_set(webkit, EINA_TRUE)) { + BROWSER_LOGE("ewk_view_setting_geolocation_set failed"); + return EINA_FALSE; + } + if (!ewk_view_setting_enable_frame_flattening_set(webkit, EINA_TRUE)) { + BROWSER_LOGE("ewk_view_setting_enable_frame_flattening_set failed"); + return EINA_FALSE; + } + if (!ewk_view_setting_local_storage_database_path_set(webkit, DATABASE_DIR)) { + BROWSER_LOGE("ewk_view_setting_local_storage_database_path_set failed"); + return EINA_FALSE; + } + if (!ewk_view_setting_enable_onscroll_event_suppression_set(webkit, EINA_TRUE)) { + BROWSER_LOGE("ewk_view_setting_enable_onscroll_event_suppression_set failed"); + return EINA_FALSE; + } + if (!_set_http_accepted_language_header(ewk_view)) { + BROWSER_LOGE("_set_http_accepted_language_header failed"); + return EINA_FALSE; + } + + m_browser_view->m_exscheme_handler->init(m_browser_view, ewk_view); + + if (!m_network_manager->init(m_browser_view, ewk_view)) { + BROWSER_LOGE("m_network_manager->init failed"); + return EINA_FALSE; + } + + /* If not debug mode, set the default setting. */ + if (!ewk_view_setting_recording_surface_enable_set(webkit, EINA_FALSE)) + BROWSER_LOGE("ewk_view_setting_recording_surface_enable_set failed"); + if (!ewk_view_setting_accelerated_compositing_enable_set(webkit, EINA_TRUE)) + BROWSER_LOGE("ewk_view_setting_accelerated_compositing_enable_set failed"); + if (!ewk_view_setting_html5video_external_player_enable_set(webkit, EINA_TRUE)) + BROWSER_LOGE("ewk_view_setting_html5video_external_player_enable_set failed"); + if (!ewk_view_setting_layer_borders_enable_set(webkit, EINA_FALSE)) + BROWSER_LOGE("ewk_view_setting_layer_borders_enable_set failed"); + + Ewk_Tile_Unused_Cache *unused_cache = ewk_view_tiled_unused_cache_get(webkit); + if (unused_cache) + ewk_tile_unused_cache_max_set(unused_cache, BACKING_STORE_CACHE_SIZE); + + return EINA_TRUE; +} + +Eina_Bool Browser_Class::_set_http_accepted_language_header(Evas_Object *ewk_view) +{ + BROWSER_LOGD("[%s]", __func__); + + char *system_language_locale = NULL; + char system_language[3] = {0,}; + Evas_Object *webkit = NULL; + + webkit = elm_webview_webkit_get(ewk_view); + system_language_locale = vconf_get_str("db/menu_widget/language"); + BROWSER_LOGD("system language and locale is [%s]\n", system_language_locale); + if (!system_language_locale) { + BROWSER_LOGD("Failed to get system_language, set as English"); + strncpy(system_language, "en", 2); /* Copy language set as english */ + } else { + /* Copy language set from system using 2byte, ex)ko */ + strncpy(system_language, system_language_locale, 2); + } + + if (system_language_locale) + free(system_language_locale); + + if (!ewk_view_setting_custom_header_add(webkit, "Accept-Language", system_language)) { + BROWSER_LOGD("ewk_view_setting_custom_header_add is failed"); + return EINA_FALSE; + } + + return EINA_TRUE; +} + +void Browser_Class::ewk_view_deinit(Evas_Object *ewk_view) +{ + BROWSER_LOGD("[%s]", __func__); + + evas_object_smart_callback_del(ewk_view, "edge,top", Browser_View::__ewk_view_edge_top_cb); + + Evas_Object *webkit = elm_webview_webkit_get(ewk_view); + evas_object_event_callback_del(webkit, EVAS_CALLBACK_MOUSE_MOVE, Browser_View::__ewk_view_mouse_move_cb); + evas_object_event_callback_del(webkit, EVAS_CALLBACK_MOUSE_DOWN, Browser_View::__ewk_view_mouse_down_cb); + evas_object_event_callback_del(webkit, EVAS_CALLBACK_MOUSE_UP, Browser_View::__ewk_view_mouse_up_cb); + evas_object_event_callback_del(webkit, EVAS_CALLBACK_MOUSE_UP, Browser_View::__ewk_view_multi_down_cb); + + evas_object_smart_callback_del(webkit, "uri,changed", Browser_View::__uri_changed_cb); + evas_object_smart_callback_del(webkit, "load,started", Browser_View::__load_started_cb); + evas_object_smart_callback_del(webkit, "load,progress", Browser_View::__load_progress_cb); + evas_object_smart_callback_del(webkit, "load,finished", Browser_View::__load_finished_cb); + evas_object_smart_callback_del(ewk_view_frame_main_get(webkit), "load,nonemptylayout,finished", + Browser_View::__load_nonempty_layout_finished_cb); + evas_object_smart_callback_del(webkit, "create,webview", Browser_View::__create_webview_cb); + evas_object_smart_callback_del(webkit, "window,close", Browser_View::__window_close_cb); + + evas_object_smart_callback_del(ewk_view_frame_main_get(webkit), "html,boundary,reached", + Browser_View::__html_boundary_reached_cb); + evas_object_smart_callback_del(webkit, "html5video,request", Browser_View::__html5_video_request_cb); + evas_object_smart_callback_del(webkit, "vibrator,vibrate", Browser_View::__vibrator_vibrate_cb); + evas_object_smart_callback_del(webkit, "vibrator,cancel", Browser_View::__vibrator_cancel_cb); + + m_browser_view->suspend_webview(ewk_view); + + m_download_manager->deinit(); + m_notification_manager->deinit(); + + m_browser_view->deinit_personal_data_manager(); + + m_browser_view->m_picker_handler->deinit(); + + m_browser_view->m_context_menu->deinit(); +} + +void Browser_Class::ewk_view_init(Evas_Object *ewk_view) +{ + BROWSER_LOGD("[%s]", __func__); + + ewk_view_deinit(ewk_view); + + evas_object_smart_callback_add(ewk_view, "edge,top", + Browser_View::__ewk_view_edge_top_cb, m_browser_view); + + Evas_Object *webkit = elm_webview_webkit_get(ewk_view); + evas_object_event_callback_add(webkit, EVAS_CALLBACK_MOUSE_MOVE, + Browser_View::__ewk_view_mouse_move_cb, m_browser_view); + evas_object_event_callback_add(webkit, EVAS_CALLBACK_MOUSE_DOWN, + Browser_View::__ewk_view_mouse_down_cb, m_browser_view); + evas_object_event_callback_add(webkit, EVAS_CALLBACK_MOUSE_UP, + Browser_View::__ewk_view_mouse_up_cb, m_browser_view); + evas_object_event_callback_add(webkit, EVAS_CALLBACK_MULTI_DOWN, + Browser_View::__ewk_view_multi_down_cb, m_browser_view); + + evas_object_smart_callback_add(webkit, "uri,changed", Browser_View::__uri_changed_cb, m_browser_view); + evas_object_smart_callback_add(webkit, "load,started", Browser_View::__load_started_cb, m_browser_view); + evas_object_smart_callback_add(webkit, "load,progress", Browser_View::__load_progress_cb, m_browser_view); + evas_object_smart_callback_add(webkit, "load,finished", Browser_View::__load_finished_cb, m_browser_view); + evas_object_smart_callback_add(ewk_view_frame_main_get(webkit), "load,nonemptylayout,finished", + Browser_View::__load_nonempty_layout_finished_cb, m_browser_view); + evas_object_smart_callback_add(webkit, "create,webview", Browser_View::__create_webview_cb, m_browser_view); + evas_object_smart_callback_add(webkit, "window,close", Browser_View::__window_close_cb, m_browser_view); + evas_object_smart_callback_add(ewk_view_frame_main_get(webkit), "html,boundary,reached", + Browser_View::__html_boundary_reached_cb, m_browser_view); + evas_object_smart_callback_add(webkit, "html5video,request", + Browser_View::__html5_video_request_cb, m_browser_view); + evas_object_smart_callback_add(webkit, "vibrator,vibrate", Browser_View::__vibrator_vibrate_cb, NULL); + evas_object_smart_callback_add(webkit, "vibrator,cancel", Browser_View::__vibrator_cancel_cb, NULL); + + m_browser_view->resume_webview(ewk_view); + + m_download_manager->init(ewk_view); + m_notification_manager->init(ewk_view); + + m_browser_view->init_personal_data_manager(ewk_view); + m_browser_view->m_picker_handler->init(ewk_view); + + if (!m_browser_view->m_context_menu->init(ewk_view)) + BROWSER_LOGE("m_context_menu->init failed"); +} + +std::string Browser_Class::get_user_agent(void) +{ + BROWSER_LOGD("[%s]", __func__); + char *user_agent_title = vconf_get_str(USERAGENT_KEY); + if (!user_agent_title) { + BROWSER_LOGE("vconf_get_str(USERAGENT_KEY) failed."); + user_agent_title = strdup(BROWSER_DEFAULT_USER_AGENT_TITLE); + if (!user_agent_title) { + BROWSER_LOGE("strdup(BROWSER_DEFAULT_USER_AGENT_TITLE) failed."); + return std::string(); + } + } + + char *user_agent = NULL; + if (!m_user_agent_db->get_user_agent(user_agent_title, user_agent)) { + BROWSER_LOGE("m_user_agent_db->get_user_agent failed"); + } + + if (user_agent_title) + free(user_agent_title); + + if (user_agent) { + std::string return_string = std::string(user_agent); + free(user_agent); + return return_string; + } else + return std::string(); +} + +Eina_Bool Browser_Class::_set_user_agent(Evas_Object *ewk_view) +{ + BROWSER_LOGD("[%s]", __func__); + + char *user_agent_title = vconf_get_str(USERAGENT_KEY); + if (!user_agent_title) { + BROWSER_LOGE("vconf_get_str(USERAGENT_KEY) failed."); + user_agent_title = strdup("Tizen"); + if (!user_agent_title) { + BROWSER_LOGE("strdup(BROWSER_DEFAULT_USER_AGENT_TITLE) failed."); + return EINA_FALSE; + } + } +#define TIZEN_USER_AGENT "Mozilla/5.0 (Linux; U; Tizen 1.0; en-us) AppleWebKit/534.46 (KHTML, like Gecko) Mobile Tizen Browser/1.0" +#define CHROME_USER_AGENT "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.16 (KHTML, like Gecko) Chrome/18.0.1003.1 Safari/535.16" +#define FIREFOX_USER_AGENT "Mozilla/5.0 (Windows NT 6.1; rv:9.0.1) Gecko/20100101 Firefox/9.0.1" + if (!strncmp(user_agent_title, "Firefox", strlen("Firefox"))) { + if (!ewk_view_setting_user_agent_set(elm_webview_webkit_get(ewk_view), FIREFOX_USER_AGENT)); + BROWSER_LOGE("ewk_view_setting_user_agent_set failed"); + } else if (!strncmp(user_agent_title, "Chrome", strlen("Chrome"))) { + if (!ewk_view_setting_user_agent_set(elm_webview_webkit_get(ewk_view), CHROME_USER_AGENT)); + BROWSER_LOGE("ewk_view_setting_user_agent_set failed"); + } else { + if (!ewk_view_setting_user_agent_set(elm_webview_webkit_get(ewk_view), TIZEN_USER_AGENT)); + BROWSER_LOGE("ewk_view_setting_user_agent_set failed"); + } + + return EINA_TRUE; +} + +void Browser_Class::set_focused_window(Browser_Window *window, Eina_Bool show_most_visited_sites) +{ + if (m_focused_window == window || !window) + return; + + if (m_focused_window) { + if (m_focused_window->m_favicon) + evas_object_hide(m_focused_window->m_favicon); + if (m_focused_window->m_option_header_favicon) + evas_object_hide(m_focused_window->m_option_header_favicon); + if (m_focused_window->m_ewk_view) { + ewk_view_deinit(m_focused_window->m_ewk_view); + evas_object_hide(m_focused_window->m_ewk_view); + } + } + + m_focused_window = window; + + /* If the ewk view is deleted because of unused case.(etc. low memory) + * create the ewk view and load url. */ + if (!m_focused_window->m_ewk_view) { + int index = 0; + for (index = 0 ; index < m_window_list.size() ; index++) { + if (m_focused_window == m_window_list[index]) + break; + } + + if (m_focused_window != create_deleted_window(index)) + BROWSER_LOGD("create_deleted_window failed"); + + /* Workaround. + * If launch the browser by aul, the grey bg is displayed shortly. */ + edje_object_signal_emit(elm_layout_edje_get(m_browser_view->m_main_layout), + "hide,grey_background,signal", ""); + + ewk_view_init(m_focused_window->m_ewk_view); + + m_browser_view->set_focused_window(m_focused_window, show_most_visited_sites); + m_browser_view->load_url(m_focused_window->m_url.c_str()); + } else { + ewk_view_init(m_focused_window->m_ewk_view); + m_browser_view->set_focused_window(m_focused_window, show_most_visited_sites); + } +} + +void Browser_Class::change_order(std::vector<Browser_Window *> window_list) +{ + BROWSER_LOGD("[%s]", __func__); + m_window_list.clear(); + m_window_list = window_list; +} + +void Browser_Class::delete_window(Browser_Window *delete_window, Browser_Window *parent) +{ + BROWSER_LOGD("[%s]", __func__); + + int index = 0; + for (index = 0 ; index < m_window_list.size() ; index++) { + if (delete_window == m_window_list[index]) + break; + } + + for (int i = 0 ; i < m_window_list.size() ; i++) { + if (delete_window == m_window_list[i]->m_parent) + m_window_list[i]->m_parent = NULL; + } + + if (parent) + set_focused_window(parent, EINA_FALSE); + + delete m_window_list[index]; + m_window_list.erase(m_window_list.begin() + index); + + m_browser_view->_set_multi_window_controlbar_text(m_window_list.size()); +} + +void Browser_Class::delete_window(Browser_Window *window) +{ + BROWSER_LOGD("[%s]", __func__); + + int index = 0; + for (index = 0 ; index < m_window_list.size() ; index++) { + if (window == m_window_list[index]) + break; + } + + if (window == m_focused_window) { + if (index == 0) + set_focused_window(m_window_list[index + 1]); + else + set_focused_window(m_window_list[index - 1]); + } + + for (int i = 0 ; i < m_window_list.size() ; i++) { + if (window == m_window_list[i]->m_parent) + m_window_list[i]->m_parent = NULL; + } + + delete m_window_list[index]; + m_window_list.erase(m_window_list.begin() + index); + + m_browser_view->_set_multi_window_controlbar_text(m_window_list.size()); +} + +/* This destroy all windows except current focused window. + * However, keep the snapshot and url, title. */ +void Browser_Class::clean_up_windows(void) +{ + BROWSER_LOGD("[%s]", __func__); + + if (m_browser_view->m_data_manager->is_in_view_stack(BR_MULTI_WINDOW_VIEW)) { + BROWSER_LOGD("close multi window"); + m_browser_view->m_data_manager->get_multi_window_view()->close_multi_window(); + } + + for (int i = 0 ; i < m_window_list.size() ; i++) { + if (m_focused_window != m_window_list[i]) { + m_window_list[i]->m_url = m_browser_view->get_url(m_window_list[i]); + m_window_list[i]->m_title = m_browser_view->get_title(m_window_list[i]); + BROWSER_LOGD("delete [%d:%s] window,", i, m_window_list[i]->m_url.c_str()); + + if (m_window_list[i]->m_favicon) + evas_object_hide(m_window_list[i]->m_favicon); + if (m_window_list[i]->m_option_header_favicon) + evas_object_hide(m_window_list[i]->m_option_header_favicon); + + if (m_window_list[i]->m_ewk_view) { + evas_object_del(m_window_list[i]->m_ewk_view); + m_window_list[i]->m_ewk_view = NULL; + } + } + } + + /* Clear memory cache to reduce memory usage in case of low memory. */ + /* To do */ +// m_browser_view->show_msg_popup("This is a test message. Low memory - clean up windows.", 5); +} + +Browser_Window *Browser_Class::create_deleted_window(int index) +{ + if (m_window_list[index]->m_ewk_view == NULL) { + m_window_list[index]->m_ewk_view = elm_webview_add(m_win, EINA_TRUE); + + if (!m_window_list[index]->m_ewk_view) { + BROWSER_LOGE("ewk_view_add failed"); + return NULL; + } + + evas_object_color_set(m_window_list[index]->m_ewk_view, 255, 255, 255, 255); + /* The webview is locked initially. */ + elm_webview_vertical_panning_hold_set(m_window_list[index]->m_ewk_view, EINA_TRUE); + + evas_object_size_hint_weight_set(m_window_list[index]->m_ewk_view, + EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(m_window_list[index]->m_ewk_view, + EVAS_HINT_FILL, EVAS_HINT_FILL); + + if (!_set_ewk_view_options(m_window_list[index]->m_ewk_view)) + BROWSER_LOGE("_set_ewk_view_options failed"); + + return m_window_list[index]; + } + + return NULL; +} + +Browser_Window *Browser_Class::create_new_window(Eina_Bool created_by_user) +{ + BROWSER_LOGD("[%s]", __func__); + Browser_Window *window = new(nothrow) Browser_Window; + if (!window) { + BROWSER_LOGE("new Browser_Window failed"); + return NULL; + } + + window->m_ewk_view = elm_webview_add(m_win, EINA_TRUE); + + if (!window->m_ewk_view) { + BROWSER_LOGE("ewk_view_add failed"); + return NULL; + } + + evas_object_color_set(window->m_ewk_view, 255, 255, 255, 255); + if (created_by_user) + window->m_created_by_user = created_by_user; + + elm_webview_vertical_panning_hold_set(window->m_ewk_view, EINA_TRUE); + elm_object_focus_allow_set(window->m_ewk_view, EINA_FALSE); + + evas_object_size_hint_weight_set(window->m_ewk_view, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(window->m_ewk_view, EVAS_HINT_FILL, EVAS_HINT_FILL); + + if (!_set_ewk_view_options(window->m_ewk_view)) + BROWSER_LOGE("_set_ewk_view_options failed"); + + m_window_list.push_back(window); + + /* Workaround. + * If launch the browser by aul, the grey bg is displayed shortly. */ + edje_object_signal_emit(elm_layout_edje_get(m_browser_view->m_main_layout), + "hide,grey_background,signal", ""); + return window; +} + +Eina_Bool Browser_Class::launch(const char *url, Eina_Bool new_window_flag) +{ + BROWSER_LOGD("url=[%s], new_window=%d", url, new_window_flag); + + m_browser_view->delete_non_user_created_windows(); + + if (new_window_flag && m_window_list.size() >= BROWSER_MULTI_WINDOW_MAX_COUNT) + /* If the multi window is max, delete the first one in case of new window. */ + delete_window(m_window_list[0]); + + if (m_window_list.size() == 0 || new_window_flag) { + Browser_Window *new_window = NULL; + /* If browser is launched for the first time, create the first window. */ + if (m_window_list.size() == 0) + new_window = create_new_window(EINA_TRUE); + else + new_window = create_new_window(EINA_FALSE); + + if (!new_window) { + BROWSER_LOGD("create_new_window failed"); + return EINA_FALSE; + } + + set_focused_window(new_window); + } + + if (m_window_list.size()) + m_browser_view->launch(url); + + return EINA_TRUE; +} + +Eina_Bool Browser_Class::__clean_up_windows_timer_cb(void *data) +{ + if (!data) + return ECORE_CALLBACK_CANCEL; + + BROWSER_LOGD("[%s]", __func__); + + Browser_Class *browser = (Browser_Class *)data; + browser->m_clean_up_windows_timer = NULL; + + browser->clean_up_windows(); + return ECORE_CALLBACK_CANCEL; +} + +void Browser_Class::pause(void) +{ + BROWSER_LOGD("[%s]", __func__); + m_browser_view->pause(); + + if (m_clean_up_windows_timer) + ecore_timer_del(m_clean_up_windows_timer); + m_clean_up_windows_timer = ecore_timer_add(BROWSER_CLEAN_UP_WINDOWS_TIMEOUT, + __clean_up_windows_timer_cb, this); +} + +void Browser_Class::resume(void) +{ + BROWSER_LOGD("[%s]", __func__); + m_browser_view->resume(); + + if (m_clean_up_windows_timer) { + ecore_timer_del(m_clean_up_windows_timer); + m_clean_up_windows_timer = NULL; + } +} + +void Browser_Class::reset(void) +{ + BROWSER_LOGD("[%s]", __func__); + if (m_clean_up_windows_timer) { + ecore_timer_del(m_clean_up_windows_timer); + m_clean_up_windows_timer = NULL; + } + + m_browser_view->reset(); +} + diff --git a/src/browser-class.h b/src/browser-class.h new file mode 100755 index 00000000..ed2e4f7d --- /dev/null +++ b/src/browser-class.h @@ -0,0 +1,84 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef BROWSER_CLASS_H +#define BROWSER_CLASS_H + +#include "browser-config.h" + +class Browser_Authetication_Manager; +class Browser_Certificate_Manager; +class Browser_Download_Manager; +class Browser_Network_Manager; +class Browser_Notification_Manager; +class Browser_User_Agent_DB; +class Browser_View; +class Browser_Window; + +class Browser_Class { +public: + Browser_Class(Evas_Object *win, Evas_Object *navi_bar, Evas_Object *bg, Evas_Object *layout); + ~Browser_Class(void); + + Eina_Bool init(void); + Eina_Bool launch(const char *url, Eina_Bool new_window = EINA_FALSE); + + Browser_Window *create_new_window(Eina_Bool created_by_user = EINA_FALSE); + void delete_window(Browser_Window *delete_window, Browser_Window *parent); + void delete_window(Browser_Window *window); + void change_order(std::vector<Browser_Window *> window_list); + std::vector<Browser_Window *> get_window_list(void) { return m_window_list; } + void set_focused_window(Browser_Window *window, Eina_Bool show_most_visited_sites = EINA_TRUE); + void pause(void); + void resume(void); + void reset(void); + void ewk_view_init(Evas_Object *ewk_view); + void ewk_view_deinit(Evas_Object *ewk_view); + std::string get_user_agent(void); + void clean_up_windows(void); + Browser_Window *create_deleted_window(int index); + Browser_Certificate_Manager *get_certificate_manager(void) { return m_certificate_manager; } +private: + Eina_Bool _set_ewk_view_options(Evas_Object *ewk_view); + Eina_Bool _set_http_accepted_language_header(Evas_Object *ewk_view); + Eina_Bool _set_ewk_view_options_listener(void); + Eina_Bool _set_user_agent(Evas_Object *ewk_view); + + /* vconf changed callback functions */ + static void __vconf_changed_cb(keynode_t *keynode, void *data); + + /* Ecore timer callback functions */ + static Eina_Bool __clean_up_windows_timer_cb(void *data); + + Evas_Object *m_win; + Evas_Object *m_navi_bar; + Evas_Object *m_bg; + Evas_Object *m_layout; + + Browser_View *m_browser_view; + Browser_Window *m_focused_window; + Browser_User_Agent_DB *m_user_agent_db; + Browser_Download_Manager *m_download_manager; + Browser_Authetication_Manager *m_authentication_manager; + Browser_Certificate_Manager *m_certificate_manager; + Browser_Notification_Manager *m_notification_manager; + Browser_Network_Manager *m_network_manager; + + std::vector<Browser_Window *> m_window_list; + Ecore_Timer *m_clean_up_windows_timer; +}; +#endif /* BROWSER_CLASS_H */ + diff --git a/src/browser-common-view.cpp b/src/browser-common-view.cpp new file mode 100755 index 00000000..b9d6061f --- /dev/null +++ b/src/browser-common-view.cpp @@ -0,0 +1,419 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "browser-class.h" +#include "browser-common-view.h" +#include "browser-view.h" +#include "browser-window.h" + +Browser_Data_Manager *Browser_Common_View::m_data_manager; +Evas_Object *Browser_Common_View::m_win; +Evas_Object *Browser_Common_View::m_navi_bar; +Evas_Object *Browser_Common_View::m_bg; +Evas_Object *Browser_Common_View::m_layout; +Browser_Class *Browser_Common_View::m_browser; + +Browser_Common_View::Browser_Common_View(void) +: + m_selection_info(NULL) + ,m_selection_info_layout(NULL) + ,m_popup(NULL) + ,m_ug(NULL) + ,m_share_popup(NULL) + ,m_share_list(NULL) +{ + BROWSER_LOGD("[%s]", __func__); +} + +Browser_Common_View::~Browser_Common_View(void) +{ + BROWSER_LOGD("[%s]", __func__); + if (m_selection_info_layout) { + evas_object_del(m_selection_info_layout); + m_selection_info_layout = NULL; + } + if (m_selection_info) { + evas_object_del(m_selection_info); + m_selection_info = NULL; + } + if (m_popup) { + evas_object_del(m_popup); + m_popup = NULL; + } + if (m_share_popup) { + evas_object_del(m_share_popup); + m_share_popup = NULL; + } + if (m_share_list) { + evas_object_del(m_share_list); + m_share_list = NULL; + } + if (m_ug) { + ug_destroy(m_ug); + m_ug = NULL; + } + + m_sns_path_list.clear(); + m_sns_name_list.clear(); + m_sns_icon_list.clear(); +} + +void Browser_Common_View::show_msg_popup(const char *msg, int timeout) +{ + BROWSER_LOGD("[%s]", __func__); + if (m_popup) { + evas_object_del(m_popup); + m_popup = NULL; + } + + m_popup = elm_popup_add(m_navi_bar); + evas_object_size_hint_weight_set(m_popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_object_text_set(m_popup, msg); + elm_popup_timeout_set(m_popup, timeout); + evas_object_show(m_popup); +} + +void Browser_Common_View::show_msg_popup(const char *title, const char *msg, int timeout) +{ + BROWSER_LOGD("[%s]", __func__); + if (m_popup) { + evas_object_del(m_popup); + m_popup = NULL; + } + + m_popup = elm_popup_add(m_navi_bar); + evas_object_size_hint_weight_set(m_popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_object_part_text_set(m_popup, "title,text", title); + elm_object_text_set(m_popup, msg); + elm_popup_timeout_set(m_popup, timeout); + evas_object_show(m_popup); +} + +void Browser_Common_View::hide_notify_popup(void) +{ + if (m_selection_info_layout) { + evas_object_del(m_selection_info_layout); + m_selection_info_layout = NULL; + } + + if (m_selection_info) { + evas_object_del(m_selection_info); + m_selection_info = NULL; + } +} + +void Browser_Common_View::show_notify_popup(const char *msg, int timeout, Eina_Bool has_control_bar) +{ + if (m_selection_info_layout) { + evas_object_del(m_selection_info_layout); + m_selection_info_layout = NULL; + } + + if (m_selection_info) { + evas_object_del(m_selection_info); + m_selection_info = NULL; + } + + int angle = 0; + m_selection_info = elm_notify_add(m_navi_bar); + if (!m_selection_info) { + BROWSER_LOGD("elm_notify_add failed"); + return; + } + elm_notify_orient_set(m_selection_info, ELM_NOTIFY_ORIENT_BOTTOM); + evas_object_size_hint_weight_set(m_selection_info, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(m_selection_info, EVAS_HINT_FILL, EVAS_HINT_FILL); + m_selection_info_layout = elm_layout_add(m_selection_info); + if (!m_selection_info_layout) { + BROWSER_LOGD("elm_layout_add failed"); + return; + } + evas_object_size_hint_weight_set(m_selection_info_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(m_selection_info_layout, EVAS_HINT_FILL, EVAS_HINT_FILL); + + elm_object_content_set(m_selection_info, m_selection_info_layout); + + if (has_control_bar) { + if(angle == 0 || angle == 180) + elm_layout_theme_set(m_selection_info_layout, "standard", "selectioninfo", + "vertical/bottom_64"); + else + elm_layout_theme_set(m_selection_info_layout, "standard", "selectioninfo", + "horizontal/bottom_64"); + } else { + if(angle == 0 || angle == 180) + elm_layout_theme_set(m_selection_info_layout, "standard", "selectioninfo", + "vertical/bottom_12"); + else + elm_layout_theme_set(m_selection_info_layout, "standard", "selectioninfo", + "horizontal/bottom_12"); + } + edje_object_part_text_set(elm_layout_edje_get(m_selection_info_layout), "elm.text", msg); + + if (timeout) + elm_notify_timeout_set(m_selection_info, timeout); + + evas_object_show(m_selection_info); +} + +Eina_Bool Browser_Common_View::show_modal_popup(const char *msg) +{ + BROWSER_LOGD("msg = [%s]", msg); + FILE *pipe = NULL; + + std::string source_string = std::string(MODAL_LAUNCHER_BIN_PATH) + std::string(" ") + + std::string(MODAL_LAUNCHER_BUNDLE_TYPE) + std::string(" confirm "); + + std::string msg_string = std::string("\"") + std::string(msg) + std::string("\""); + + string::size_type pos = string::npos; + while ((pos = msg_string.find("\n")) != string::npos) + msg_string.replace(pos, strlen("\n"), std::string("<br>")); + + source_string = source_string + std::string(MODAL_LAUNCHER_BUNDLE_MESSAGE) + std::string(" ") + msg_string; + BROWSER_LOGD("source_string = [%s]", source_string.c_str()); + + if (!(pipe = popen(source_string.c_str(), "r"))) { + BROWSER_LOGE("popen filed"); + return EINA_FALSE; + } + + char read_buffer[MODAL_MSG_MAX_BUFFER] = {0, }; + while (fgets(read_buffer, MODAL_MSG_MAX_BUFFER, pipe)) { + if (!strncmp(read_buffer, MODAL_LAUNCHER_RESULT_KEYWORD, + strlen(MODAL_LAUNCHER_RESULT_KEYWORD))) { + BROWSER_LOGD("modal keyword found."); + return EINA_TRUE; + } + } + + return EINA_FALSE; +} + +/* Capture snapshot with current focused ewk view. */ +Evas_Object *Browser_Common_View::_capture_snapshot(Browser_Window *window, float scale) +{ + BROWSER_LOGD("[%s]", __func__); + int focused_ewk_view_w = 0; + int focused_ewk_view_h = 0; + evas_object_geometry_get(window->m_ewk_view, NULL, NULL, + &focused_ewk_view_w, &focused_ewk_view_h); + + Evas_Object *snapshot_image = NULL; + snapshot_image = evas_object_rectangle_add(evas_object_evas_get(m_navi_bar)); + if (!snapshot_image) { + BROWSER_LOGE("evas_object_rectangle_add failed"); + return NULL; + } + evas_object_size_hint_min_set(snapshot_image, (int)(focused_ewk_view_w * scale), + (int)(focused_ewk_view_h * scale)); + evas_object_resize(snapshot_image, (int)(focused_ewk_view_w * scale), + (int)(focused_ewk_view_h * scale)); + evas_object_color_set(snapshot_image, 255, 255, 255, 255); + + return snapshot_image; +} + +Eina_Bool Browser_Common_View::_launch_streaming_player(const char *url, const char *cookie) +{ + BROWSER_LOGD("%s", __func__); + if (!url || strlen(url) == 0) { + BROWSER_LOGE("url is empty"); + return EINA_FALSE; + } + + bool is_running = false; + if (app_manager_is_running(SEC_VT_CALL, &is_running) < 0) { + BROWSER_LOGE("Fail to get app running information\n"); + return EINA_FALSE; + } + if (is_running) { + BROWSER_LOGE("video-call is running......\n"); + show_msg_popup(BR_STRING_WARNING_VIDEO_PLAYER); + return EINA_FALSE; + } + + service_h service_handle = NULL; + + if (service_create(&service_handle) < 0) { + BROWSER_LOGE("Fail to create service handle"); + return EINA_FALSE; + } + + if (!service_handle) { + BROWSER_LOGE("service handle is NULL"); + return EINA_FALSE; + } + + BROWSER_LOGD("url=[%s]", url); + if (service_add_extra_data(service_handle, "path", url) < 0) { + BROWSER_LOGE("Fail to set extra data"); + service_destroy(service_handle); + return EINA_FALSE; + } + + if (cookie && strlen(cookie)) { + if (service_add_extra_data(service_handle, "cookie", cookie) < 0) { + BROWSER_LOGE("Fail to set extra data"); + service_destroy(service_handle); + return EINA_FALSE; + } + } + + if (service_set_package(service_handle,SEC_STREAMING_PLAYER) < 0) { + BROWSER_LOGE("Fail to set package"); + service_destroy(service_handle); + return EINA_FALSE; + } + + if (service_send_launch_request(service_handle, NULL, NULL) < 0) { + BROWSER_LOGE("Fail to launch service operation"); + service_destroy(service_handle); + return EINA_FALSE; + } + + service_destroy(service_handle); + + return EINA_TRUE; +} + +char *Browser_Common_View::_trim(char *str) +{ + char *pos_bos = str; + + while(*pos_bos == ' ') + pos_bos++; + + char *pos_eos = pos_bos + strlen(pos_bos) - 1; + + while((pos_eos >= str) && (*pos_eos == ' ')) { + *pos_eos = '\0'; + pos_eos--; + } + + return pos_bos; +} + +std::string Browser_Common_View::get_domain_name(const char *url) +{ + if (!url || !strcmp(url, "")) + return std::string(); + + std::string domain_name = url; + + /* replacing multiple "/" in a row with one "/" */ + size_t pos = domain_name.find("//"); + while (pos != std::string::npos) { + domain_name.erase(pos, 1); + pos = domain_name.find("//"); + } + + /* cut "xxx:/" prefix */ + pos = domain_name.find(":/"); + if (pos != std::string::npos) { + /* ":/" length */ + domain_name = domain_name.substr(pos + 2); + } + + /* cut behind "/" */ + pos = domain_name.find("/"); + if (pos != std::string::npos) + domain_name = domain_name.substr(0, pos); + + return domain_name; +} + +Eina_Bool Browser_Common_View::is_landscape(void) +{ + /* The appcore_get_rotation_state fail in U1 HD target, temporary code. */ + int window_w = 0; + int window_h = 0; + evas_object_geometry_get(m_win, NULL, NULL, &window_w, &window_h); + if (window_w < window_h) { + BROWSER_LOGD("portrait"); + return EINA_FALSE; + } else { + BROWSER_LOGD("landscape"); + return EINA_TRUE; + } +} + +/* set focus to edit field idler callback to show ime. */ +Eina_Bool Browser_Common_View::__set_focus_editfield_idler_cb(void *edit_field) +{ + BROWSER_LOGD("[%s]", __func__); + if (!edit_field) + return ECORE_CALLBACK_CANCEL; + elm_object_focus_set((Evas_Object *)edit_field, EINA_TRUE); + elm_object_signal_emit((Evas_Object *)edit_field, "clicked", "elm"); + + Evas_Object *entry = br_elm_editfield_entry_get((Evas_Object *)edit_field); + elm_entry_cursor_end_set(entry); + + return ECORE_CALLBACK_CANCEL; +} + +Eina_Bool Browser_Common_View::_has_url_sheme(const char *url) +{ + if (url && strlen(url) + && (strstr(url, BROWSER_URL_SCHEME_CHECK) || strstr(url, BROWSER_MAIL_TO_SCHEME) + || strstr(url, BROWSER_TEL_SCHEME) || strstr(url, BROWSER_YOUTUBE_SCHEME))) + return EINA_TRUE; + else + return EINA_FALSE; +} + +void Browser_Common_View::__ug_layout_cb(struct ui_gadget *ug, enum ug_mode mode, void *priv) +{ + BROWSER_LOGD("[%s]", __func__); + if (!priv || !ug) + return; + + Browser_Common_View *common_view = (Browser_Common_View *)priv; + Evas_Object *base = (Evas_Object*)ug_get_layout(ug); + if (!base) + return; + + common_view->m_ug = ug; + + Evas_Object *win = (Evas_Object *)ug_get_window(); + + switch (mode) { + case UG_MODE_FULLVIEW: + evas_object_size_hint_weight_set(base, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_win_resize_object_add(win, base); + evas_object_show(base); + break; + default: + break; + } +} + +void Browser_Common_View::__ug_result_cb(struct ui_gadget *ug, bundle *result, void *priv) +{ + if (!priv || !ug) + return; +} + +void Browser_Common_View::__ug_destroy_cb(struct ui_gadget *ug, void *priv) +{ + if (!priv || !ug) + return; + + if (ug_destroy(ug)) + BROWSER_LOGD("ug_destroy is failed.\n"); +} + diff --git a/src/browser-common-view.h b/src/browser-common-view.h new file mode 100755 index 00000000..0d66635f --- /dev/null +++ b/src/browser-common-view.h @@ -0,0 +1,81 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef BROWSER_COMMON_VIEW_H +#define BROWSER_COMMON_VIEW_H + +#include "browser-config.h" +#include "browser-data-manager.h" +#include "browser-utility.h" + +class Browser_Data_Manager; +class Browser_Class; +class Browser_Window; + +class Browser_Common_View { +public: + Browser_Common_View(void); + ~Browser_Common_View(void); + + virtual Eina_Bool init(void) = 0; + + Eina_Bool is_landscape(void); + Browser_Data_Manager *get_data_manager(void) { return m_data_manager; } + Browser_Class *get_browser(void) { return m_browser; } + void show_msg_popup(const char *msg, int timeout = 3); + void show_msg_popup(const char *title, const char *msg, int timeout); + void show_notify_popup(const char *msg, int timeout = 0, Eina_Bool has_control_bar = EINA_FALSE); + void hide_notify_popup(void); + std::string get_domain_name(const char *url); + Eina_Bool show_modal_popup(const char *msg); +protected: + Evas_Object *_capture_snapshot(Browser_Window *window, float scale); + void _set_navigationbar_title(const char *title); + Eina_Bool _has_url_sheme(const char *url); + Eina_Bool _launch_streaming_player(const char *url, const char *cookie = NULL); + + + /* set focus to edit field idler callback to show ime. */ + static Eina_Bool __set_focus_editfield_idler_cb(void *edit_field); + + char *_trim(char *str); + /* For ug effect. */ + static void __ug_layout_cb(struct ui_gadget *ug, enum ug_mode mode, void *priv); + static void __ug_result_cb(struct ui_gadget *ug, bundle *result, void *priv); + static void __ug_destroy_cb(struct ui_gadget *ug, void *priv); + + static Browser_Data_Manager *m_data_manager; + static Evas_Object *m_win; + static Evas_Object *m_navi_bar; + static Evas_Object *m_bg; + static Evas_Object *m_layout; + static Browser_Class *m_browser; + + std::vector<std::string> m_sns_name_list; + std::vector<std::string> m_sns_path_list; + std::vector<Evas_Object *> m_sns_icon_list; +private: + Evas_Object *m_popup; + Evas_Object *m_selection_info; + Evas_Object *m_selection_info_layout; + Evas_Object *m_share_popup; + Evas_Object *m_share_list; + std::string m_share_url; + + struct ui_gadget *m_ug; +}; +#endif /* BROWSER_COMMON_VIEW_H */ + diff --git a/src/browser-data-manager.cpp b/src/browser-data-manager.cpp new file mode 100755 index 00000000..9776a9bc --- /dev/null +++ b/src/browser-data-manager.cpp @@ -0,0 +1,327 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "browser-add-to-bookmark-view.h" +#include "browser-bookmark-db.h" +#include "browser-bookmark-view.h" +#include "browser-config.h" +#include "browser-data-manager.h" +#include "browser-history-db.h" +#include "browser-history-layout.h" +#include "browser-multi-window-view.h" +#include "browser-new-folder-view.h" +#include "browser-select-folder-view.h" +#include "browser-view.h" + +Browser_Data_Manager::Browser_Data_Manager(void) +: + m_browser_view(NULL) + ,m_bookmark_view(NULL) + ,m_add_to_bookmark_view(NULL) + ,m_edit_bookmark_view(NULL) + ,m_new_folder_view(NULL) + ,m_select_folder_view(NULL) + ,m_history_layout(NULL) + ,m_multi_window_view(NULL) + ,m_bookmark_db(NULL) + ,m_history_db(NULL) + ,m_stack_status(0) +{ + BROWSER_LOGD("[%s]", __func__); +} + +Browser_Data_Manager::~Browser_Data_Manager(void) +{ + BROWSER_LOGD("[%s]", __func__); + if (m_bookmark_view) { + delete m_bookmark_view; + m_bookmark_view = NULL; + } + if (m_add_to_bookmark_view) { + delete m_add_to_bookmark_view; + m_add_to_bookmark_view = NULL; + } + if (m_edit_bookmark_view) { + delete m_edit_bookmark_view; + m_edit_bookmark_view = NULL; + } + if (m_new_folder_view) { + delete m_new_folder_view; + m_new_folder_view = NULL; + } + if (m_select_folder_view) { + delete m_select_folder_view; + m_select_folder_view = NULL; + } + if (m_history_layout) { + delete m_history_layout; + m_history_layout = NULL; + } + if (m_bookmark_db) { + delete m_bookmark_db; + m_bookmark_db = NULL; + } + if (m_history_db) { + delete m_history_db; + m_history_db = NULL; + } + if (m_multi_window_view) { + delete m_multi_window_view; + m_multi_window_view = NULL; + } +} + + +Eina_Bool Browser_Data_Manager::is_in_view_stack(view_stack_status view) +{ + BROWSER_LOGD("m_stack_status = %d, view = %d, m_stack_status & view = %d", + m_stack_status, view, m_stack_status & view); + + if (m_stack_status & view) + return EINA_TRUE; + else + return EINA_FALSE; +} + +void Browser_Data_Manager::set_browser_view(Browser_View *browser_view) +{ + BROWSER_LOGD("[%s]", __func__); + m_browser_view = browser_view; + m_stack_status = m_stack_status | BR_BROWSER_VIEW; +} + +Browser_Bookmark_View *Browser_Data_Manager::create_bookmark_view(void) +{ + BROWSER_LOGD("[%s]", __func__); + if (m_bookmark_view) + destroy_bookmark_view(); + + m_bookmark_view = new(nothrow) Browser_Bookmark_View; + if (!m_bookmark_view) + BROWSER_LOGE("new Browser_Bookmark_View failed"); + else + m_stack_status = m_stack_status | BR_BOOKMARK_VIEW; + + return m_bookmark_view; +} + +void Browser_Data_Manager::destroy_bookmark_view(void) +{ + BROWSER_LOGD("[%s]", __func__); + if (m_bookmark_view) { + delete m_bookmark_view; + m_bookmark_view = NULL; + m_stack_status = m_stack_status - BR_BOOKMARK_VIEW; + } +} + +Browser_Bookmark_DB *Browser_Data_Manager::create_bookmark_db(void) +{ + BROWSER_LOGD("[%s]", __func__); + if (m_bookmark_db) + destroy_bookmark_db(); + + m_bookmark_db = new(nothrow) Browser_Bookmark_DB; + if (!m_bookmark_db) + BROWSER_LOGE("new Browser_Bookmark_DB failed"); + + return m_bookmark_db; +} + +void Browser_Data_Manager::destroy_bookmark_db(void) +{ + BROWSER_LOGD("[%s]", __func__); + if (m_bookmark_db) { + delete m_bookmark_db; + m_bookmark_db = NULL; + } +} + +Browser_Add_To_Bookmark_View *Browser_Data_Manager::create_add_to_bookmark_view(string title, + string url, int current_folder_id) +{ + BROWSER_LOGD("[%s]", __func__); + if (m_add_to_bookmark_view) + destroy_add_to_bookmark_view(); + + m_add_to_bookmark_view = new(nothrow) Browser_Add_To_Bookmark_View(title, url, + EINA_FALSE, current_folder_id); + if (!m_add_to_bookmark_view) + BROWSER_LOGE("new Browser_Add_To_Bookmark_View failed"); + else + m_stack_status = m_stack_status | BR_ADD_TO_BOOKMARK_VIEW; + + return m_add_to_bookmark_view; +} + +void Browser_Data_Manager::destroy_add_to_bookmark_view(void) +{ + BROWSER_LOGD("[%s]", __func__); + if (m_add_to_bookmark_view) { + delete m_add_to_bookmark_view; + m_add_to_bookmark_view = NULL; + m_stack_status = m_stack_status - BR_ADD_TO_BOOKMARK_VIEW; + } +} + +Browser_Add_To_Bookmark_View *Browser_Data_Manager::create_edit_bookmark_view(string title, + string url, int current_folder_id) +{ + BROWSER_LOGD("[%s]", __func__); + if (m_edit_bookmark_view) + destroy_edit_bookmark_view(); + + m_edit_bookmark_view = new(nothrow) Browser_Add_To_Bookmark_View(title, url, + EINA_TRUE, current_folder_id); + if (!m_edit_bookmark_view) + BROWSER_LOGE("new Browser_Add_To_Bookmark_View failed"); + else + m_stack_status = m_stack_status | BR_EDIT_BOOKMARK_VIEW; + + return m_edit_bookmark_view; +} + +void Browser_Data_Manager::destroy_edit_bookmark_view(void) +{ + BROWSER_LOGD("[%s]", __func__); + if (m_edit_bookmark_view) { + delete m_edit_bookmark_view; + m_edit_bookmark_view = NULL; + m_stack_status = m_stack_status - BR_EDIT_BOOKMARK_VIEW; + } +} + +Browser_New_Folder_View *Browser_Data_Manager::create_new_folder_view(void) +{ + BROWSER_LOGD("[%s]", __func__); + if (m_new_folder_view) + destroy_new_folder_view(); + + m_new_folder_view = new(nothrow) Browser_New_Folder_View; + if (!m_new_folder_view) + BROWSER_LOGE("new Browser_New_Folder_View failed"); + else + m_stack_status = m_stack_status | BR_NEW_FOLDER_VIEW; + + return m_new_folder_view; +} + +void Browser_Data_Manager::destroy_new_folder_view(void) +{ + BROWSER_LOGD("[%s]", __func__); + if (m_new_folder_view) { + delete m_new_folder_view; + m_new_folder_view = NULL; + m_stack_status = m_stack_status - BR_NEW_FOLDER_VIEW; + } +} + +/* 'current_folder_id' is used to mark the current folder radio button in select folder view. */ +Browser_Select_Folder_View *Browser_Data_Manager::create_select_folder_view(int current_folder_id) +{ + BROWSER_LOGD("[%s]", __func__); + if (m_select_folder_view) + destroy_select_folder_view(); + + m_select_folder_view = new(nothrow) Browser_Select_Folder_View(current_folder_id); + if (!m_select_folder_view) + BROWSER_LOGE("new Browser_Select_Folder_View failed"); + else + m_stack_status = m_stack_status | BR_SELECT_FOLDER_VIEW; + + return m_select_folder_view; +} + +void Browser_Data_Manager::destroy_select_folder_view(void) +{ + BROWSER_LOGD("[%s]", __func__); + if (m_select_folder_view) { + delete m_select_folder_view; + m_select_folder_view = NULL; + m_stack_status = m_stack_status - BR_SELECT_FOLDER_VIEW; + } +} + +Browser_Multi_Window_View* Browser_Data_Manager::create_multi_window_view(void) +{ + BROWSER_LOGD("[%s]", __func__); + if (m_multi_window_view) + destroy_multi_window_view(); + + m_multi_window_view = new(nothrow) Browser_Multi_Window_View; + if (!m_multi_window_view) { + BROWSER_LOGE("new Browser_Multi_Window_View failed"); + return NULL; + } else + m_stack_status = m_stack_status | BR_MULTI_WINDOW_VIEW; + + return m_multi_window_view; +} + +void Browser_Data_Manager::destroy_multi_window_view(void) +{ + BROWSER_LOGD("[%s]", __func__); + if (m_multi_window_view) { + delete m_multi_window_view; + m_multi_window_view = NULL; + m_stack_status = m_stack_status - BR_MULTI_WINDOW_VIEW; + } +} + +Browser_History_Layout *Browser_Data_Manager::create_history_layout(void) +{ + BROWSER_LOGD("[%s]", __func__); + if (m_history_layout) + destroy_history_layout(); + + m_history_layout = new(nothrow) Browser_History_Layout; + if (!m_history_layout) + BROWSER_LOGE("new Browser_History_Layout failed"); + + return m_history_layout; +} + +void Browser_Data_Manager::destroy_history_layout(void) +{ + BROWSER_LOGD("[%s]", __func__); + if (m_history_layout) { + delete m_history_layout; + m_history_layout = NULL; + } +} + +Browser_History_DB *Browser_Data_Manager::create_history_db(void) +{ + BROWSER_LOGD("[%s]", __func__); + if (m_history_db) + destroy_history_db(); + + m_history_db = new(nothrow) Browser_History_DB; + if (!m_history_db) + BROWSER_LOGE("new Browser_History_DB failed"); + + return m_history_db; +} + +void Browser_Data_Manager::destroy_history_db(void) +{ + BROWSER_LOGD("[%s]", __func__); + if (m_history_db) { + delete m_history_db; + m_history_db = NULL; + } +} + diff --git a/src/browser-data-manager.h b/src/browser-data-manager.h new file mode 100755 index 00000000..60ac0fdb --- /dev/null +++ b/src/browser-data-manager.h @@ -0,0 +1,114 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef BROWSER_DATA_MANAGER_H +#define BROWSER_DATA_MANAGER_H + +using namespace std; + +#include "browser-config.h" + +typedef enum _view_stack_status { + BR_BROWSER_VIEW = 1, + BR_BOOKMARK_VIEW = 1 << 1, + BR_ADD_TO_BOOKMARK_VIEW = 1 << 2, + BR_EDIT_BOOKMARK_VIEW = 1 << 3, + BR_NEW_FOLDER_VIEW = 1 << 4, + BR_SELECT_FOLDER_VIEW = 1 << 5, + BR_MULTI_WINDOW_VIEW = 1 << 6, + ADD_TO_MOST_VISITED_SITES_VIEW = 1 << 7 +} view_stack_status; + +class Browser_Add_To_Bookmark_View; +class Browser_Bookmark_DB; +class Browser_Bookmark_View; +class Browser_History_DB; +class Browser_History_Layout; +class Browser_Multi_Window_View; +class Browser_New_Folder_View; +class Browser_Select_Folder_View; +class Browser_View; + +class Browser_Data_Manager { +public: + Browser_Data_Manager(void); + ~Browser_Data_Manager(void); + + /* Must be. + * When create some view, it should be created by create_xxx method of Browser_Data_Manager. + * When leave that view (using elm_navigationbar_pop), the destroy_xxx method also called. + * The create_xxx, destroy_xxx methods control the view stack. + */ + Eina_Bool is_in_view_stack(view_stack_status view); + + Browser_View *get_browser_view(void) { return m_browser_view; } + void set_browser_view(Browser_View *browser_view); + + Browser_Bookmark_View *get_bookmark_view(void) { return m_bookmark_view; } + Browser_Bookmark_View *create_bookmark_view(void); + void destroy_bookmark_view(void); + + Browser_Bookmark_DB *get_bookmark_db(void) { return m_bookmark_db; } + Browser_Bookmark_DB *create_bookmark_db(void); + void destroy_bookmark_db(void); + + Browser_Add_To_Bookmark_View *get_add_to_bookmark_view(void) { return m_add_to_bookmark_view; } + Browser_Add_To_Bookmark_View *create_add_to_bookmark_view(string title, + string url, int current_folder_id = BROWSER_BOOKMARK_MAIN_FOLDER_ID); + void destroy_add_to_bookmark_view(void); + + Browser_Add_To_Bookmark_View *get_edit_bookmark_view(void) { return m_edit_bookmark_view; } + Browser_Add_To_Bookmark_View *create_edit_bookmark_view(string title, + string url, int current_folder_id = BROWSER_BOOKMARK_MAIN_FOLDER_ID); + void destroy_edit_bookmark_view(void); + + Browser_New_Folder_View *get_new_folder_view(void) { return m_new_folder_view; } + Browser_New_Folder_View *create_new_folder_view(void); + void destroy_new_folder_view(void); + + Browser_Select_Folder_View *get_select_folder_view(void) { return m_select_folder_view; } + Browser_Select_Folder_View *create_select_folder_view(int current_folder_id); + void destroy_select_folder_view(void); + + Browser_Multi_Window_View *get_multi_window_view(void) { return m_multi_window_view; } + Browser_Multi_Window_View *create_multi_window_view(void); + void destroy_multi_window_view(void); + + Browser_History_Layout *get_history_layout(void) { return m_history_layout; } + Browser_History_Layout *create_history_layout(void); + void destroy_history_layout(void); + + Browser_History_DB *get_history_db(void) { return m_history_db; } + Browser_History_DB *create_history_db(void); + void destroy_history_db(void); +private: + Browser_View *m_browser_view; + Browser_Bookmark_View *m_bookmark_view; + Browser_Add_To_Bookmark_View *m_add_to_bookmark_view; + Browser_Add_To_Bookmark_View *m_edit_bookmark_view; + Browser_New_Folder_View *m_new_folder_view; + Browser_Select_Folder_View *m_select_folder_view; + Browser_History_Layout *m_history_layout; + Browser_Multi_Window_View *m_multi_window_view; + + Browser_Bookmark_DB *m_bookmark_db; + Browser_History_DB *m_history_db; + + unsigned int m_stack_status; +}; + +#endif /* BROWSER_DATA_MANAGER_H */ + diff --git a/src/browser-extension/browser-download-manager.cpp b/src/browser-extension/browser-download-manager.cpp new file mode 100755 index 00000000..f9c1524a --- /dev/null +++ b/src/browser-extension/browser-download-manager.cpp @@ -0,0 +1,358 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include <ail.h> + +#include "browser-class.h" +#include "browser-common-view.h" +#include "browser-download-manager.h" +#include <url_download.h> + +Browser_Download_Manager::Browser_Download_Manager(Evas_Object *navi_bar, Browser_View *browser_view) +: + m_webview(NULL) + ,m_list_popup(NULL) + ,m_app_list(NULL) + ,m_navi_bar(navi_bar) + ,m_browser_view(browser_view) +{ + BROWSER_LOGD("[%s]", __func__); +} + +Browser_Download_Manager::~Browser_Download_Manager(void) +{ + BROWSER_LOGD("[%s]", __func__); + if(m_list_popup) { + evas_object_del(m_list_popup); + m_list_popup = NULL; + } +} + +void Browser_Download_Manager::init(Evas_Object *webview) +{ + BROWSER_LOGD("[%s]", __func__); + + m_webview = webview; + + Evas_Object *webkit = elm_webview_webkit_get(m_webview); + deinit(); + evas_object_smart_callback_add(webkit, "download,request", __download_request_cb, this); +} + +void Browser_Download_Manager::deinit(void) +{ + BROWSER_LOGD("[%s]", __func__); + + Evas_Object *webkit = elm_webview_webkit_get(m_webview); + evas_object_smart_callback_del(webkit, "download,request", __download_request_cb); +} + +void Browser_Download_Manager::pause(void) +{ + if (m_list_popup) + __popup_response_cb(this, NULL, NULL); +} + +void Browser_Download_Manager::__download_request_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_Download_Manager *download_manager = (Browser_Download_Manager *)data; + if (event_info) + download_manager->_request_download((Ewk_Download *)event_info); +} + +void Browser_Download_Manager::_request_download(Ewk_Download *download_info) +{ + string extension_name; + string ambiguous_mime1 = "text/plain"; + string ambiguous_mime2 = "application/octet-stream"; + int ret = 0; + char buff[256] = {0,}; + + m_cookies.clear(); + m_url.clear(); + m_default_player_pkg_name.clear(); + + if (!download_info->url) { + BROWSER_LOGE("download url is null"); + return; + } + + string content_type; + if (download_info->mime_type) + content_type = string(download_info->mime_type); + + m_url = string(download_info->url); + if (download_info->user_param) + m_cookies = string(download_info->user_param); + + if (content_type.empty()) { + BROWSER_LOGD("Download linked file from cotent menu"); + if (!_launch_download_app()) + BROWSER_LOGE("_launch_download_app failed"); + return; + } + BROWSER_LOGD("mime type [%s]", content_type.c_str()); + /* If mime is ambiguous mime or not. If it is, get extension name from url */ + if (content_type.compare(ambiguous_mime1) == 0 + || content_type.compare(ambiguous_mime2) == 0) { + extension_name = _get_extension_name_from_url(m_url); + } + /* If mime is ambiguous and extension name is existed, + * decide streaming player according to extension name from url + * 1. mp4, 3gp : streaming video player case + * 2. mp3 : streaming music player case + * 3. otherewise : download app case + */ + if (!extension_name.empty()) { + BROWSER_LOGD("extension name from url [%s]", extension_name.c_str()); + if (extension_name.compare("mp4") == 0 || extension_name.compare("3gp") == 0) { + m_default_player_pkg_name = SEC_VIDEO_PLAYER; + if (!_show_app_list_popup()) + BROWSER_LOGE("_show_app_list_popup failed"); + } else if (extension_name.compare("mp3") == 0) { + m_default_player_pkg_name = SEC_MUSIC_PLAYER; + if (!_show_app_list_popup()) + BROWSER_LOGE("_show_app_list_popup failed"); + } else { + if (!_launch_download_app()) + BROWSER_LOGE("_launch_download_app failed"); + } + return; + } + /* If the default player is registered at AUL db, show list popup with the name of it */ + ret = aul_get_defapp_from_mime(content_type.c_str(), buff, (sizeof(buff)-1)); + if (ret == AUL_R_OK) { + m_default_player_pkg_name = buff; + BROWSER_LOGD("default app [%s]", m_default_player_pkg_name.c_str()); + } else { + BROWSER_LOGE("Fail to get default app"); + } + + /* Call streaming player app only if the default player is samsung music player or samsung video plyaer + * Otherwiser, call download app + */ + if (!m_default_player_pkg_name.empty() && (m_default_player_pkg_name.compare(SEC_VIDEO_PLAYER) == 0 || + m_default_player_pkg_name.compare(SEC_MUSIC_PLAYER) == 0)) { + if (!_show_app_list_popup()) + BROWSER_LOGE("_show_app_list_popup failed"); + } else { + if (!_launch_download_app()) + BROWSER_LOGE("_launch_download_app failed"); + } +} + +Eina_Bool Browser_Download_Manager::_launch_download_app(void) +{ + service_h service_handle = NULL; + BROWSER_LOGD("%s", __func__); + if (!m_url.empty()) { + + if (service_create(&service_handle) < 0) { + BROWSER_LOGE("Fail to create service handle"); + return EINA_FALSE; + } + + if (!service_handle) { + BROWSER_LOGE("service handle is NULL"); + return EINA_FALSE; + } + + if (service_set_operation(service_handle, SERVICE_OPERATION_DOWNLOAD) < 0) { + BROWSER_LOGE("Fail to set service operation"); + service_destroy(service_handle); + return EINA_FALSE; + } + + if (service_set_uri(service_handle, m_url.c_str()) < 0) { + BROWSER_LOGE("Fail to set uri"); + service_destroy(service_handle); + return EINA_FALSE; + } + if (!m_cookies.empty()) { + if (service_add_extra_data(service_handle, "cookie", m_cookies.c_str()) < 0) { + BROWSER_LOGE("Fail to set extra data"); + service_destroy(service_handle); + return EINA_FALSE; + } + } + + if (service_send_launch_request(service_handle, NULL, NULL) < 0) { + BROWSER_LOGE("Fail to launch service operation"); + service_destroy(service_handle); + return EINA_FALSE; + } + service_destroy(service_handle); + + return EINA_TRUE; + } + + return EINA_FALSE; +} + +Eina_Bool Browser_Download_Manager::_call_streaming_player(void) +{ + if (!_launch_streaming_player(m_url.c_str(), m_cookies.c_str())) { + BROWSER_LOGE("_launch_streaming_player failed"); + return EINA_FALSE; + } + + return EINA_TRUE; +} + +string Browser_Download_Manager::_get_extension_name_from_url(string& url) +{ + string ext; + size_t pos = 0; + + if(url.empty()) { + BROWSER_LOGE("url is NULL"); + return string(); + } + pos = url.find_last_of("/"); + + if (pos != string::npos) { + string tmp; + tmp = url.substr(pos + 1); + pos = tmp.find_last_of("."); + if (pos != string::npos) { + string tmp2; + size_t end = 0; + tmp2 = tmp.substr(pos+1); + pos = tmp2.find_last_of("?"); + if (pos != string::npos) + ext = tmp2.substr(0, pos - 1); + else + ext = tmp2; + } + } + BROWSER_LOGD("extension name[%s]\n",ext.c_str()); + return ext; +} + +const char *Browser_Download_Manager::_get_app_name_from_pkg_name(string& pkg_name) +{ + ail_appinfo_h handle; + ail_error_e ret; + string app_name; + char *str = NULL; + + ret = ail_package_get_appinfo(pkg_name.c_str(), &handle); + if (ret != AIL_ERROR_OK) { + return NULL; + } + + ret = ail_appinfo_get_str(handle, AIL_PROP_NAME_STR, &str); + if (ret != AIL_ERROR_OK) { + return NULL; + } + app_name = (const char*) str; + BROWSER_LOGD("pkg's name[%s]pkg[%s]\n",app_name.c_str(),pkg_name.c_str()); + + ret = ail_package_destroy_appinfo(handle); + if (ret != AIL_ERROR_OK) + return NULL; + + return app_name.c_str(); +} + +void Browser_Download_Manager::__player_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("%s", __func__); + if (!data) + return; + + Browser_Download_Manager *download_manager = (Browser_Download_Manager *)data; + + if (!download_manager->_call_streaming_player()) + BROWSER_LOGE("_call_streaming_player failed"); + + __popup_response_cb(download_manager, NULL, NULL); +} + +void Browser_Download_Manager::__internet_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("%s", __func__); + if (!data) + return; + + Browser_Download_Manager *download_manager = (Browser_Download_Manager *)data; + + if (!download_manager->_launch_download_app()) + BROWSER_LOGE("_launch_download_app failed"); + + __popup_response_cb(download_manager, NULL, NULL); +} + +Eina_Bool Browser_Download_Manager::_show_app_list_popup(void) +{ + if (m_url.empty()) { + BROWSER_LOGE("url is empty"); + return EINA_FALSE; + } + + m_list_popup = elm_popup_add(m_navi_bar); + if (!m_list_popup) { + BROWSER_LOGE("elm_popup_add failed"); + return EINA_FALSE; + } + elm_object_style_set(m_list_popup, "menustyle"); + elm_object_part_text_set(m_list_popup, "title,text", BR_STRING_TITLE_SELECT_AN_ACTION); + evas_object_size_hint_weight_set(m_list_popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + + m_app_list = elm_list_add(m_list_popup); + if (!m_app_list) { + BROWSER_LOGE("elm_list_add failed"); + return EINA_FALSE; + } + evas_object_size_hint_weight_set(m_app_list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(m_app_list, EVAS_HINT_FILL, EVAS_HINT_FILL); + + const char *app_name = _get_app_name_from_pkg_name(m_default_player_pkg_name); + if (app_name && strlen(app_name)) + elm_list_item_append(m_app_list, app_name, NULL, NULL, __player_cb, this); + + elm_list_item_append(m_app_list, BR_STRING_INTERNET, NULL, NULL, __internet_cb, this); + evas_object_show(m_app_list); + + elm_object_content_set(m_list_popup, m_app_list); + evas_object_show(m_list_popup); + + Evas_Object *cancel_button = elm_button_add(m_list_popup); + elm_object_text_set(cancel_button, BR_STRING_CLOSE); + elm_object_part_content_set(m_list_popup, "button1", cancel_button); + evas_object_smart_callback_add(cancel_button, "clicked", __popup_response_cb, this); +} + +void Browser_Download_Manager::__popup_response_cb(void* data, Evas_Object* obj, + void* event_info) +{ + BROWSER_LOGD("%s", __func__); + + if (!data) + return; + + Browser_Download_Manager *download_manager = (Browser_Download_Manager *)data; + + if (download_manager->m_list_popup) { + evas_object_del(download_manager->m_list_popup); + download_manager->m_list_popup = NULL; + } +} + diff --git a/src/browser-extension/browser-download-manager.h b/src/browser-extension/browser-download-manager.h new file mode 100755 index 00000000..31087e40 --- /dev/null +++ b/src/browser-extension/browser-download-manager.h @@ -0,0 +1,65 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef BROWSER_POLICY_DECISION_MAKER_H +#define BROWSER_POLICY_DECISION_MAKER_H + +#include "browser-config.h" +#include "browser-view.h" + +#include <string> + +using namespace std; + +class Browser_Common_View; + +class Browser_Download_Manager : public Browser_Common_View { +public: + Browser_Download_Manager(Evas_Object *navi_bar, Browser_View *browser_view); + ~Browser_Download_Manager(void); + + Eina_Bool init(void) {} + + void init(Evas_Object *webview); + void deinit(void); + void pause(void); +private: + /* Elementary event callback functions */ + static void __popup_response_cb(void *data, Evas_Object *obj, void *event_info); + static void __player_cb(void *data, Evas_Object *obj, void *event_info); + static void __internet_cb(void *data, Evas_Object *obj, void *event_info); + + static void __download_request_cb(void *data, Evas_Object *obj, void *event_info); + + void _request_download(Ewk_Download *download_info); + Eina_Bool _launch_download_app(void); + Eina_Bool _call_streaming_player(void); + string _get_extension_name_from_url(string &url); + Eina_Bool _show_app_list_popup(void); + const char *_get_app_name_from_pkg_name(string& pkg_name); + + Evas_Object *m_webview; + Evas_Object *m_navi_bar; + Evas_Object *m_list_popup; + Evas_Object *m_app_list; + Browser_View *m_browser_view; + + string m_url; + string m_cookies; + string m_default_player_pkg_name; +}; +#endif /* BROWSER_POLICY_DECISION_MAKER_H */ + diff --git a/src/browser-extension/browser-exscheme-handler.cpp b/src/browser-extension/browser-exscheme-handler.cpp new file mode 100755 index 00000000..e70dd2b7 --- /dev/null +++ b/src/browser-extension/browser-exscheme-handler.cpp @@ -0,0 +1,225 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include <ail.h> + +#include "browser-common-view.h" +#include "browser-exscheme-handler.h" +#include "browser-view.h" + +Browser_View *Browser_Exscheme_Handler::m_browser_view = NULL; +Evas_Object *Browser_Exscheme_Handler::m_confirm_popup = NULL; +Evas_Object *Browser_Exscheme_Handler::m_webview = NULL; +std::string Browser_Exscheme_Handler::m_excheme_url; +Browser_Exscheme_Handler Browser_Exscheme_Handler::m_excheme_handler; + +Browser_Exscheme_Handler::Browser_Exscheme_Handler(void) +{ + BROWSER_LOGD("[%s]", __func__); +} + +Browser_Exscheme_Handler::~Browser_Exscheme_Handler(void) +{ + BROWSER_LOGD("[%s]", __func__); + if (m_confirm_popup) + evas_object_del(m_confirm_popup); +} + +void Browser_Exscheme_Handler::init(Browser_View *browser_view, Evas_Object *webview) +{ + BROWSER_LOGD("[%s]", __func__); + m_browser_view = browser_view; + m_webview = webview; + + elm_webview_scheme_callback_set(webview, "rtsp", __rtsp_cb); + elm_webview_scheme_callback_set(webview, "mailto", __mail_to_cb); + elm_webview_scheme_callback_set(webview, "sms", __sms_cb); + elm_webview_scheme_callback_set(webview, "mms", __mms_cb); + elm_webview_scheme_callback_set(webview, "daumtv", __daum_tv_cb); +} + +Eina_Bool Browser_Exscheme_Handler::__daum_tv_cb(Evas_Object *webview, const char *uri) +{ + BROWSER_LOGD("[%s]", __func__); + if (!uri || !strlen(uri)) + return EINA_FALSE; + + if (strlen(uri) <= strlen(BROWSER_DAUM_TV_SCHEME)) + return EINA_FALSE; + + std::string uri_string = std::string(uri); + if (!_launch_daum_tv(uri_string)) + BROWSER_LOGE("_launch_daum_tv failed"); + +} + +Eina_Bool Browser_Exscheme_Handler::__mms_cb(Evas_Object *webview, const char *uri) +{ + BROWSER_LOGD("[%s]", __func__); + if (!uri || !strlen(uri)) + return EINA_FALSE; + + /* Same with sms */ + return __sms_cb(webview, uri); +} + +Eina_Bool Browser_Exscheme_Handler::__sms_cb(Evas_Object *webview, const char *uri) +{ + BROWSER_LOGD("[%s]", __func__); + if (!uri || strlen(uri) <= strlen(BROWSER_SMS_SCHEME)) + return EINA_FALSE; + + int scheme_length = strlen(BROWSER_SMS_SCHEME); + char *body = NULL; + if (body = strstr((char *)uri, "?body=")) { + body = body + strlen("?body="); + BROWSER_LOGD("body=[%s]", body); + } + + char *number = NULL; + if ((number = strstr((char *)uri, ",")) || (number = strstr((char *)uri, "?"))) + *number = '\0'; + + number = (char *)uri + strlen(BROWSER_SMS_SCHEME); + BROWSER_LOGD("number=[%s]", number); + + struct ug_cbs cbs = {0, }; + cbs.layout_cb = __ug_layout_cb; + cbs.result_cb = NULL;//__ug_result_cb; + cbs.destroy_cb = __ug_destroy_cb; + cbs.priv = (void *)(&m_excheme_handler); + + bundle *b = bundle_create(); + if (b == NULL) { + BROWSER_LOGE("fail to create bundle."); + return EINA_FALSE; + } + + if (number) { + if (bundle_add(b, "TO", number)) { + BROWSER_LOGE("bundle_add is failed."); + bundle_free(b); + free(body); + return EINA_FALSE; + } + } + if (body) { + if (bundle_add(b, "BODY", body)) { + BROWSER_LOGE("bundle_add is failed."); + bundle_free(b); + free(body); + return EINA_FALSE; + } + } + + if (!ug_create(NULL, "msg-composer-efl", UG_MODE_FULLVIEW, b, &cbs)) + BROWSER_LOGE("ug_create is failed."); + + if (bundle_free(b)) + BROWSER_LOGE("bundle_free is failed."); + + return EINA_FALSE; +} + +Eina_Bool Browser_Exscheme_Handler::__mail_to_cb(Evas_Object *webview, const char *uri) +{ + BROWSER_LOGD("[%s]", __func__); + if (!uri || !strlen(uri)) + return EINA_FALSE; + + if (strlen(uri) <= strlen(BROWSER_MAIL_TO_SCHEME)) + return EINA_FALSE; + + std::string uri_string = std::string(uri); + + service_h service_handle = NULL; + + if (service_create(&service_handle) < 0) { + BROWSER_LOGE("Fail to create service handle"); + return EINA_FALSE; + } + + if (!service_handle) { + BROWSER_LOGE("service handle is NULL"); + return EINA_FALSE; + } + + if (service_set_operation(service_handle, SERVICE_OPERATION_SEND) < 0) { + BROWSER_LOGE("Fail to set service operation"); + service_destroy(service_handle); + return EINA_FALSE; + } + + if (service_set_uri(service_handle, uri_string.c_str() + strlen("mailto:")) < 0) { + BROWSER_LOGE("Fail to set uri"); + service_destroy(service_handle); + return EINA_FALSE; + } + + if (service_set_package(service_handle, SEC_EMAIL) < 0) { + BROWSER_LOGE("Fail to set package"); + service_destroy(service_handle); + return EINA_FALSE; + } + + if (service_send_launch_request(service_handle, NULL, NULL) < 0) { + BROWSER_LOGE("Fail to launch service operation : org.tizen.email"); + service_destroy(service_handle); + return EINA_FALSE; + } + + service_destroy(service_handle); + + return EINA_TRUE; +} + +Eina_Bool Browser_Exscheme_Handler::__rtsp_cb(Evas_Object *webview, const char *uri) +{ + BROWSER_LOGD("[%s]", __func__); + if (!uri || !strlen(uri)) + return EINA_FALSE; + + if (strlen(uri) <= strlen(BROWSER_RTSP_SCHEME)) + return EINA_FALSE; + + std::string uri_string = std::string(uri); + if (!m_excheme_handler._launch_streaming_player(uri_string.c_str())) + BROWSER_LOGE("_launch_streaming_player failed"); +} + +Eina_Bool Browser_Exscheme_Handler::_launch_daum_tv(std::string uri) +{ + BROWSER_LOGD("[%s]", __func__); + + if (!uri.empty()) { + string converted_url = uri; + if (converted_url.find(BROWSER_DAUM_TV_SCHEME) != string::npos) { + int pos = converted_url.find(BROWSER_DAUM_TV_SCHEME); + converted_url.replace(pos, strlen(BROWSER_DAUM_TV_SCHEME), + BROWSER_HTTP_SCHEME); + } + + if (!m_excheme_handler._launch_streaming_player(converted_url.c_str())) { + BROWSER_LOGE("_launch_streaming_player failed"); + return EINA_FALSE; + } + + return EINA_TRUE; + } + + return EINA_FALSE; +} + diff --git a/src/browser-extension/browser-exscheme-handler.h b/src/browser-extension/browser-exscheme-handler.h new file mode 100755 index 00000000..5e737851 --- /dev/null +++ b/src/browser-extension/browser-exscheme-handler.h @@ -0,0 +1,58 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef BROWSER_EXSCHEME_HANDLER_H +#define BROWSER_EXSCHEME_HANDLER_H + +#include "browser-config.h" +#include "browser-view.h" + +#include <string> + +using namespace std; + +class Browser_Common_View; +class Browser_View; +class Browser_Exscheme_Handler : public Browser_Common_View { +public: + Browser_Exscheme_Handler(void); + ~Browser_Exscheme_Handler(void); + + Eina_Bool init(void) {} + void init(Browser_View *browser_view, Evas_Object *webview); + + typedef enum _call_type { + VOICE_CALL, + VIDEO_CALL, + CALL_UNKNOWN + } call_type; +private: + static Eina_Bool _launch_daum_tv(std::string uri); + + static Eina_Bool __daum_tv_cb(Evas_Object *webview, const char *uri); + static Eina_Bool __sms_cb(Evas_Object *webview, const char *uri); + static Eina_Bool __mms_cb(Evas_Object *webview, const char *uri); + static Eina_Bool __mail_to_cb(Evas_Object *webview, const char *uri); + static Eina_Bool __rtsp_cb(Evas_Object *webview, const char *uri); + + static Browser_View *m_browser_view; + static Evas_Object *m_confirm_popup; + static Evas_Object *m_webview; + static std::string m_excheme_url; + static Browser_Exscheme_Handler m_excheme_handler; +}; +#endif /* BROWSER_EXSCHEME_HANDLER_H */ + diff --git a/src/browser-extension/browser-find-word.cpp b/src/browser-extension/browser-find-word.cpp new file mode 100755 index 00000000..2287c357 --- /dev/null +++ b/src/browser-extension/browser-find-word.cpp @@ -0,0 +1,298 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "browser-find-word.h" + +Browser_Find_Word::Browser_Find_Word(Browser_View *browser_view) +: m_find_word_index(0) + ,m_find_word_max_count(0) + ,m_webview(NULL) + ,m_find_word_entry_layout(NULL) + ,m_find_word_edit_field(NULL) + ,m_find_word_cancel_button(NULL) + ,m_find_word_prev_button(NULL) + ,m_find_word_next_button(NULL) + ,m_option_header_find_word_layout(NULL) + ,m_browser_view(browser_view) +{ + BROWSER_LOGD("[%s]", __func__); + if (!_create_layout()) + BROWSER_LOGE("_create_layout failed"); +} + +Browser_Find_Word::~Browser_Find_Word(void) +{ + BROWSER_LOGD("[%s]", __func__); + if (m_find_word_entry_layout) + evas_object_del(m_find_word_entry_layout); + if (m_find_word_edit_field) + evas_object_del(m_find_word_edit_field); + if (m_find_word_cancel_button) + evas_object_del(m_find_word_cancel_button); + if (m_find_word_prev_button) + evas_object_del(m_find_word_prev_button); + if (m_find_word_next_button) + evas_object_del(m_find_word_next_button); + if (m_option_header_find_word_layout) + evas_object_del(m_option_header_find_word_layout); +} + +void Browser_Find_Word::init(Evas_Object *webview) +{ + BROWSER_LOGD("[%s]", __func__); + m_webview = webview; + Evas_Object *find_word_edit_field_entry = br_elm_editfield_entry_get(m_find_word_edit_field); + elm_entry_entry_set(find_word_edit_field_entry, ""); + + elm_object_focus_set(m_find_word_edit_field, EINA_TRUE); + + edje_object_part_text_set(elm_layout_edje_get(m_option_header_find_word_layout), "elm.index_text", "0/0"); +} + +void Browser_Find_Word::deinit(void) +{ + BROWSER_LOGD("[%s]", __func__); + Evas_Object *webkit = elm_webview_webkit_get(m_webview); + ewk_view_text_matches_unmark_all(webkit); +} + +void Browser_Find_Word::find_word(const char *word, Find_Word_Direction direction) +{ + BROWSER_LOGD("word to find=[%s]", word); + + Evas_Object *webkit = elm_webview_webkit_get(m_webview); + + ewk_view_text_matches_unmark_all(webkit); + m_find_word_max_count = ewk_view_text_matches_mark(webkit, word, + EINA_FALSE, EINA_TRUE, 0); + + if (m_prev_searched_word.empty() || strcmp(m_prev_searched_word.c_str(), word)) + m_find_word_index = 0; + + m_prev_searched_word = std::string(word); + + if (direction == BROWSER_FIND_WORD_FORWARD) { + if (ewk_view_text_search(elm_webview_webkit_get(m_webview), + word, EINA_FALSE, EINA_TRUE, EINA_TRUE)) { + m_find_word_index++; + if (m_find_word_index > m_find_word_max_count) + m_find_word_index = 1; + } + } else { + if (ewk_view_text_search(elm_webview_webkit_get(m_webview), + word, EINA_FALSE, EINA_FALSE, EINA_TRUE)) { + m_find_word_index--; + if (m_find_word_index <= 0) + m_find_word_index = m_find_word_max_count; + } + } + + char index_text[100] = {0, }; + if (m_find_word_max_count < 100) + sprintf(index_text, "%d/%d", m_find_word_index, m_find_word_max_count); + else + sprintf(index_text, "%d/-", m_find_word_index); + + _update_find_word_index_text(index_text); +} + +void Browser_Find_Word::_update_find_word_index_text(const char *index_text) +{ + BROWSER_LOGD("[%s]", __func__); + + edje_object_part_text_set(elm_layout_edje_get(m_option_header_find_word_layout), "elm.index_text", index_text); +} + +void Browser_Find_Word::__find_word_entry_enter_key_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_Find_Word *find_word = (Browser_Find_Word *)data; + Evas_Object *edit_field_entry = br_elm_editfield_entry_get(find_word->m_find_word_edit_field); + const char *word_to_find = elm_entry_entry_get(edit_field_entry); + if (!word_to_find || !strlen(word_to_find)) + return; + + find_word->find_word(word_to_find, Browser_Find_Word::BROWSER_FIND_WORD_FORWARD); + + elm_object_focus_set(edit_field_entry, EINA_FALSE); + BROWSER_LOGD("find_word=[%s]", word_to_find); +} + +Eina_Bool Browser_Find_Word::_create_layout(void) +{ + BROWSER_LOGD("[%s]", __func__); + m_option_header_find_word_layout = elm_layout_add(m_browser_view->m_navi_bar); + if (!m_option_header_find_word_layout) { + BROWSER_LOGE("elm_layout_add failed"); + return EINA_FALSE; + } + if (!elm_layout_file_set(m_option_header_find_word_layout, BROWSER_EDJE_DIR"/browser-view-find-word-layout.edj", + "browser-view/find_word_layout")) { + BROWSER_LOGE("Can not set layout theme[browser-view/find_word_layout]\n"); + return EINA_FALSE; + } + evas_object_size_hint_weight_set(m_option_header_find_word_layout, EVAS_HINT_EXPAND, 0.0); + evas_object_size_hint_align_set(m_option_header_find_word_layout, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_show(m_option_header_find_word_layout); + + /* create url entry layout in url layout */ + m_find_word_entry_layout = elm_layout_add(m_browser_view->m_navi_bar); + if (!m_find_word_entry_layout) { + BROWSER_LOGE("elm_layout_add failed"); + return EINA_FALSE; + } + if (!elm_layout_file_set(m_find_word_entry_layout, BROWSER_EDJE_DIR"/browser-view-find-word-layout.edj", + "browser-view/find_word_editfield_layout")) { + BROWSER_LOGE("browser-view/find_word_editfield_layout failed"); + return EINA_FALSE; + } + elm_object_part_content_set(m_option_header_find_word_layout, "elm.swallow.url", m_find_word_entry_layout); + evas_object_show(m_find_word_entry_layout); + + edje_object_part_text_set(elm_layout_edje_get(m_option_header_find_word_layout), "title_text", BR_STRING_FIND_WORD); + + m_find_word_edit_field = br_elm_url_editfield_add(m_browser_view->m_navi_bar); + if (!m_find_word_edit_field) { + BROWSER_LOGE("elm_editfield_add failed"); + return EINA_FALSE; + } + + elm_object_part_content_set(m_find_word_entry_layout, "elm.swallow.entry", m_find_word_edit_field); + evas_object_show(m_find_word_edit_field); + + edje_object_signal_emit(elm_layout_edje_get(m_find_word_edit_field), "find_word,signal", "elm"); + + br_elm_editfield_entry_single_line_set(m_find_word_edit_field, EINA_TRUE); + br_elm_editfield_eraser_set(m_find_word_edit_field, EINA_TRUE); + + elm_object_signal_callback_add(m_find_word_edit_field, "elm,eraser,clicked", "elm", + __find_word_erase_button_clicked_cb, this); + + Evas_Object *find_word_edit_field_entry = br_elm_editfield_entry_get(m_find_word_edit_field); + elm_entry_entry_set(find_word_edit_field_entry, ""); + evas_object_smart_callback_add(find_word_edit_field_entry, "activated", __find_word_entry_enter_key_cb, this); + elm_entry_input_panel_layout_set(find_word_edit_field_entry, ELM_INPUT_PANEL_LAYOUT_NORMAL); + ecore_imf_context_input_panel_event_callback_add((Ecore_IMF_Context *)elm_entry_imf_context_get(find_word_edit_field_entry), + ECORE_IMF_INPUT_PANEL_STATE_EVENT, __find_word_entry_imf_event_cb, this); + evas_object_show(m_find_word_edit_field); + + m_find_word_cancel_button = elm_button_add(m_browser_view->m_navi_bar); + if (!m_find_word_cancel_button) { + BROWSER_LOGE("elm_button_add failed"); + return EINA_FALSE; + } + elm_object_style_set(m_find_word_cancel_button, "text_only/style2"); + elm_object_text_set(m_find_word_cancel_button, BR_STRING_CANCEL); + elm_object_part_content_set(m_option_header_find_word_layout, "elm.swallow.cancel", m_find_word_cancel_button); + evas_object_show(m_find_word_cancel_button); + + evas_object_smart_callback_add(m_find_word_cancel_button, "clicked", __find_word_cancel_button_clicked_cb, this); + + m_find_word_prev_button = elm_button_add(m_browser_view->m_navi_bar); + if (!m_find_word_prev_button) { + BROWSER_LOGE("elm_button_add failed"); + return EINA_FALSE; + } + elm_object_style_set(m_find_word_prev_button, "browser/find_word_prev"); + elm_object_part_content_set(m_option_header_find_word_layout, "elm.swallow.find_word_prev", m_find_word_prev_button); + evas_object_show(m_find_word_prev_button); + evas_object_smart_callback_add(m_find_word_prev_button, "clicked", __find_word_prev_button_clicked_cb, this); + + m_find_word_next_button = elm_button_add(m_browser_view->m_navi_bar); + if (!m_find_word_next_button) { + BROWSER_LOGE("elm_button_add failed"); + return EINA_FALSE; + } + elm_object_style_set(m_find_word_next_button, "browser/find_word_next"); + elm_object_part_content_set(m_option_header_find_word_layout, "elm.swallow.find_word_next", m_find_word_next_button); + evas_object_show(m_find_word_next_button); + evas_object_smart_callback_add(m_find_word_next_button, "clicked", __find_word_next_button_clicked_cb, this); + + const char *current_theme = elm_theme_get(NULL); + if (current_theme && strstr(current_theme, "white")) { + } else { + edje_object_signal_emit(elm_layout_edje_get(m_find_word_entry_layout), + "black_theme,signal", ""); + } + + return EINA_TRUE; +} + +void Browser_Find_Word::__find_word_cancel_button_clicked_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_Find_Word *find_word = (Browser_Find_Word *)data; + find_word->m_browser_view->_set_edit_mode(BR_NO_EDIT_MODE); +} + +void Browser_Find_Word::__find_word_prev_button_clicked_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_Find_Word *find_word = (Browser_Find_Word *)data; + Evas_Object *edit_field_entry = br_elm_editfield_entry_get(find_word->m_find_word_edit_field); + const char *word_to_find = elm_entry_entry_get(edit_field_entry); + if (!word_to_find || !strlen(word_to_find)) + return; + + find_word->find_word(word_to_find, Browser_Find_Word::BROWSER_FIND_WORD_BACKWARD); +} + +void Browser_Find_Word::__find_word_next_button_clicked_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_Find_Word *find_word = (Browser_Find_Word *)data; + Evas_Object *edit_field_entry = br_elm_editfield_entry_get(find_word->m_find_word_edit_field); + const char *word_to_find = elm_entry_entry_get(edit_field_entry); + if (!word_to_find || !strlen(word_to_find)) + return; + + find_word->find_word(word_to_find, Browser_Find_Word::BROWSER_FIND_WORD_FORWARD); +} + +void Browser_Find_Word::__find_word_entry_imf_event_cb(void *data, Ecore_IMF_Context *ctx, int value) +{ + BROWSER_LOGD("value=%d", value); + if (!data) + return; + + Browser_Find_Word *find_word = (Browser_Find_Word *)data; + if (value == ECORE_IMF_INPUT_PANEL_STATE_HIDE) { + Evas_Object *find_word_editfield_entry = br_elm_editfield_entry_get(find_word->m_find_word_edit_field); + elm_object_focus_set(find_word_editfield_entry, EINA_FALSE); + } +} + +void Browser_Find_Word::__find_word_erase_button_clicked_cb(void *data, Evas_Object *obj, + const char *emission, const char *source) +{ + BROWSER_LOGD("[%s]", __func__); + Browser_Find_Word *find_word = (Browser_Find_Word *)data; + edje_object_part_text_set(elm_layout_edje_get(find_word->m_option_header_find_word_layout), "elm.index_text", "0/0"); + Evas_Object *webkit = elm_webview_webkit_get(find_word->m_webview); + ewk_view_text_matches_unmark_all(webkit); +} diff --git a/src/browser-extension/browser-find-word.h b/src/browser-extension/browser-find-word.h new file mode 100755 index 00000000..06e70445 --- /dev/null +++ b/src/browser-extension/browser-find-word.h @@ -0,0 +1,69 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef BROWSER_FIND_WORD_H +#define BROWSER_FIND_WORD_H + +#include "browser-config.h" +#include "browser-view.h" + +#include <string> + +using namespace std; + +class Browser_Find_Word { +public: + Browser_Find_Word(Browser_View *browser_view); + ~Browser_Find_Word(void); + + typedef enum _Find_Word_Direction { + BROWSER_FIND_WORD_FORWARD, + BROWSER_FIND_WORD_BACKWARD + } Find_Word_Direction; + + void find_word(const char *word, Find_Word_Direction direction); + Evas_Object *get_layout(void) { return m_option_header_find_word_layout; } + void init(Evas_Object *webview); + void deinit(void); +private: + Eina_Bool _create_layout(void); + + static void __find_word_entry_imf_event_cb(void *data, Ecore_IMF_Context *ctx, int value); + static void __find_word_entry_enter_key_cb(void *data, Evas_Object *obj, void *event_info); + static void __find_word_cancel_button_clicked_cb(void *data, Evas_Object *obj, void *event_info); + static void __find_word_prev_button_clicked_cb(void *data, Evas_Object *obj, void *event_info); + static void __find_word_next_button_clicked_cb(void *data, Evas_Object *obj, void *event_info); + static void __find_word_erase_button_clicked_cb(void *data, Evas_Object *obj, + const char *emission, const char *source); + void _update_find_word_index_text(const char *index_text); + + int m_find_word_index; + int m_find_word_max_count; + Evas_Object *m_webview; + Browser_View *m_browser_view; + + Evas_Object *m_find_word_entry_layout; + Evas_Object *m_find_word_edit_field; + Evas_Object *m_find_word_cancel_button; + Evas_Object *m_find_word_prev_button; + Evas_Object *m_find_word_next_button; + Evas_Object *m_option_header_find_word_layout; + + std::string m_prev_searched_word; +}; + +#endif /* BROWSER_FIND_WORD_H */ + diff --git a/src/browser-extension/browser-notification-manager.cpp b/src/browser-extension/browser-notification-manager.cpp new file mode 100755 index 00000000..1bfa531b --- /dev/null +++ b/src/browser-extension/browser-notification-manager.cpp @@ -0,0 +1,483 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "browser-notification-db.h" +#include "browser-notification-manager.h" + +#include <libsoup/soup.h> +#include <fcntl.h> + +Browser_Notification_Manager::Browser_Notification_Manager(void) +: m_webview(NULL) + ,m_notification_db(NULL) + ,m_confirm_popup(NULL) + ,m_is_notification_cb_registered(EINA_FALSE) + ,m_noti_id(0) +{ + BROWSER_LOGD("[%s]", __func__); + m_notification_db = new(nothrow) Browser_Notification_DB; + if (!m_notification_db) + BROWSER_LOGE("new(nothrow) Browser_Notification_DB failed"); +} + +Browser_Notification_Manager::~Browser_Notification_Manager(void) +{ + BROWSER_LOGD("[%s]", __func__); + if (m_confirm_popup) + evas_object_del(m_confirm_popup); + if (m_notification_db) + delete m_notification_db; +} + +void Browser_Notification_Manager::init(Evas_Object *webview) +{ + BROWSER_LOGD("[%s]", __func__); + deinit(); + + m_webview = webview; + + Evas_Object *webkit = elm_webview_webkit_get(m_webview); + evas_object_smart_callback_add(webkit, "notification,contents,show", + __notification_contents_show_cb, this); + evas_object_smart_callback_add(webkit, "notification,contents,cancel", + __notification_contents_cancel_cb, this); + evas_object_smart_callback_add(webkit, "notification,contents,requestPermission", + __notification_contents_request_permission_cb, this); +} + +void Browser_Notification_Manager::deinit(void) +{ + BROWSER_LOGD("[%s]", __func__); + if (!m_webview) + return; + + m_is_notification_cb_registered = EINA_FALSE; + + Evas_Object *webkit = elm_webview_webkit_get(m_webview); + evas_object_smart_callback_del(webkit, "notification,contents,show", + __notification_contents_show_cb); + evas_object_smart_callback_del(webkit, "notification,contents,cancel", + __notification_contents_cancel_cb); + evas_object_smart_callback_del(webkit, "notification,contents,requestPermission", + __notification_contents_request_permission_cb); +} + + +Eina_Bool Browser_Notification_Manager::_register_notification(Ewk_Notification *ewk_notification) +{ + BROWSER_LOGD("[%s]", __func__); + if (!m_notification_db) { + BROWSER_LOGE("m_notification_db is null"); + return EINA_FALSE; + } + + int notification_id = -1; + if (!m_notification_db->save_notification(ewk_notification, notification_id)) + BROWSER_LOGE("save_notification failed"); + if (notification_id < 0) { + BROWSER_LOGE("invalid notification id"); + return EINA_FALSE; + } + + _download_icon(notification_id, ewk_notification->iconURL); + + return EINA_TRUE; +} + +void Browser_Notification_Manager::_download_icon(int noti_id, const char *icon_url) +{ + BROWSER_LOGD("[%s]", __func__); + SoupSession *soup_session = NULL; + SoupMessage *soup_msg = NULL; + SoupMessageHeaders *headers = NULL; + + soup_session = soup_session_async_new(); + g_object_set(soup_session, SOUP_SESSION_TIMEOUT, 15, NULL); + soup_msg = soup_message_new("GET", icon_url); + headers = soup_msg->request_headers; + +/* It seems that the user agent setting code is unncessary. */ +/* + soup_message_headers_append(headers, "User-Agent", + "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.27 Safari/525.13"); +*/ + m_noti_id = noti_id; + soup_session_queue_message(soup_session, soup_msg, __http_finished_cb, (void *)this); +} + +void Browser_Notification_Manager::__http_finished_cb(SoupSession *session, + SoupMessage *msg, gpointer data) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_Notification_Manager *notification_manager = NULL; + notification_manager = (Browser_Notification_Manager *)data; + + SoupBuffer *body = soup_message_body_flatten(msg->response_body); + + int noti_id = notification_manager->m_noti_id; + + int fd; + int write_len = 0; + char icon_path[256] = {0, }; + sprintf(icon_path, WEBKIT_SOUP_CACHE_DIR"%d.ico", noti_id); + unlink(icon_path); + + if (!body->data || body->length <= 0) { + soup_buffer_free(body); + if (!notification_manager->_finalize_download_icon(noti_id, EINA_FALSE)) + BROWSER_LOGE("_finalize_download_icon failed"); + return; + } + if ((fd = open(icon_path, O_CREAT | O_WRONLY, S_IRUSR|S_IWUSR | S_IRGRP | S_IROTH)) < 0) { + soup_buffer_free(body); + if (!notification_manager->_finalize_download_icon(noti_id, EINA_FALSE)) + BROWSER_LOGE("_finalize_download_icon failed"); + return; + } + + write_len = write(fd, body->data, body->length); + close(fd); + + soup_buffer_free(body); + + if (write_len != body->length) { + unlink(icon_path); + if (!notification_manager->_finalize_download_icon(noti_id, EINA_FALSE)) + BROWSER_LOGE("_finalize_download_icon failed"); + return; + } + + if (!notification_manager->_finalize_download_icon(noti_id, EINA_TRUE)) + BROWSER_LOGE("_finalize_download_icon failed"); +} + +Eina_Bool Browser_Notification_Manager::_print_grouping_list(void) +{ + BROWSER_LOGD("[%s]", __func__); + notification_list_h noti_list = NULL; + notification_list_h noti_list_head = NULL; + notification_list_h noti_detail_list = NULL; + notification_list_h noti_detail_list_head = NULL; + notification_h noti = NULL; + notification_error_e noti_err = NOTIFICATION_ERROR_NONE; + char *caller_pkgname = NULL; + char *title = NULL; + int group_id = -1; + int priv_id = -1; + int count = 0; + + noti_err = notification_get_grouping_list(NOTIFICATION_TYPE_NOTI, -1, ¬i_list); + if (noti_err != NOTIFICATION_ERROR_NONE) { + BROWSER_LOGD("Fail to notification_get_grouping_list : %d\n", noti_err); + return EINA_FALSE; + } + + noti_list_head = noti_list; + + while (noti_list != NULL) { + noti = notification_list_get_data(noti_list); + BROWSER_LOGD("================================================================\n"); + notification_get_pkgname(noti, &caller_pkgname); + notification_get_id(noti, &group_id, &priv_id); + notification_get_count(NOTIFICATION_TYPE_NOTI, caller_pkgname, group_id, priv_id, &count); + BROWSER_LOGD("caller pkgname : %s, group_id : %d, priv_id : %d, count : %d\n", + caller_pkgname, group_id, priv_id, count); + notification_get_detail_list(caller_pkgname, group_id, priv_id, -1, ¬i_detail_list); + noti_detail_list_head = noti_detail_list; + int i = 0; + while (noti_detail_list != NULL) { + i++; + noti = notification_list_get_data(noti_detail_list); + + notification_get_title(noti, &title, NULL); + notification_get_id(noti, &group_id, &priv_id); + BROWSER_LOGD("\t%d) %s (G:%d, P:%d)\n", i, title, group_id, priv_id); + + noti_detail_list = notification_list_get_next(noti_detail_list); + } + notification_free_list(noti_detail_list_head); + noti_list = notification_list_get_next(noti_list); + } + + notification_free_list(noti_list_head); + + return EINA_TRUE; +} + +Eina_Bool Browser_Notification_Manager::_finalize_download_icon(int noti_id, Eina_Bool set_image) +{ + BROWSER_LOGD("[%s]", __func__); + if (!m_notification_db) { + BROWSER_LOGE("m_notification_db is null"); + return EINA_FALSE; + } + + notification_h noti_h = NULL; + notification_error_e error = NOTIFICATION_ERROR_NONE; + bundle *b = NULL; + int priv_id = 0; + + if (!_print_grouping_list()) + BROWSER_LOGE("_print_grouping_list failed"); + + noti_h = notification_new(NOTIFICATION_TYPE_NOTI, + NOTIFICATION_GROUP_ID_NONE, noti_id); + if (!noti_h) { + BROWSER_LOGE("notification_new failed"); + return EINA_FALSE; + } + + std::string title; + if (!m_notification_db->get_title_by_id(noti_id, title)) { + BROWSER_LOGE("get_title_by_id failed"); + return EINA_FALSE; + } + if (title.empty()) { + BROWSER_LOGE("title is empty"); + return EINA_FALSE; + } + + BROWSER_LOGD("title=[%s]", title.c_str()); + error = notification_set_text(noti_h, NOTIFICATION_TEXT_TYPE_TITLE, title.c_str(), NULL, + NOTIFICATION_VARIABLE_TYPE_NONE); + if (error != NOTIFICATION_ERROR_NONE) { + BROWSER_LOGD("Fail to set title [%d]\n", error); + notification_free(noti_h); + return EINA_FALSE; + } + + std::string msg_body; + if (!m_notification_db->get_body_by_id(noti_id, msg_body)) { + BROWSER_LOGD("get_body_by_id failed\n"); + return EINA_FALSE; + } + if (msg_body.empty()) { + BROWSER_LOGE("msg_body is empty"); + return EINA_FALSE; + } + BROWSER_LOGD("msg_body=[%s]", msg_body.c_str()); + error = notification_set_text(noti_h, NOTIFICATION_TEXT_TYPE_CONTENT, msg_body.c_str(), + NULL, NOTIFICATION_VARIABLE_TYPE_NONE); + if (error != NOTIFICATION_ERROR_NONE) { + BROWSER_LOGD("Fail to set content. [%d]\n", error); + notification_free(noti_h); + return EINA_FALSE; + } + + char icon_path[512] = {0, }; + if (set_image) { + sprintf(icon_path, WEBKIT_SOUP_CACHE_DIR"%d.ico", noti_id); + error = notification_set_image(noti_h, NOTIFICATION_IMAGE_TYPE_ICON, icon_path); + if (error != NOTIFICATION_ERROR_NONE) { + BROWSER_LOGD("Fail to set icon. [%d]\n", error); + return EINA_FALSE; + } + } + + error = notification_insert(noti_h, &priv_id); + if (error != NOTIFICATION_ERROR_NONE) { + BROWSER_LOGD("Fail to insert [%d]\n", error); + notification_free(noti_h); + return EINA_FALSE; + } + BROWSER_LOGD("Notification inserted successfully: priv id [%d], noti_id [%d]\n", priv_id, noti_id); + + if (!_print_grouping_list()) + BROWSER_LOGE("_print_grouping_list failed"); + + if (!m_is_notification_cb_registered) + if (notification_resister_changed_cb(__notification_changed_cb, this) + == NOTIFICATION_ERROR_NONE) + m_is_notification_cb_registered = EINA_TRUE; + + if (noti_h) { + error = notification_free(noti_h); + if (error != NOTIFICATION_ERROR_NONE) + BROWSER_LOGD("Fail to free noti data [%d]\n", error); + noti_h = NULL; + } + + if (set_image) { + if (!m_notification_db->update_icon_validity(noti_id)) + BROWSER_LOGE("update_icon_validity failed"); + } + + return EINA_TRUE; +} + +void Browser_Notification_Manager::__notification_changed_cb(void *data, notification_type_e type) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_Notification_Manager *notification_manager = (Browser_Notification_Manager *)data; + + if (type == NOTIFICATION_TYPE_NOTI) + BROWSER_LOGD("notificationChangedCb called [type: NOTI]\n"); + else if (type == NOTIFICATION_TYPE_ONGOING) + BROWSER_LOGD("notificationChangedCb called [type: ONGOING]\n"); + else if (type == NOTIFICATION_TYPE_NONE) + BROWSER_LOGD("notificationChangedCb called [type: NONE]\n"); + else + BROWSER_LOGD("notificationChangedCb called [type: unknown]\n"); + + int count = -1; + notification_error_e error = NOTIFICATION_ERROR_NONE; + + error = notification_get_count(NOTIFICATION_TYPE_NONE, NULL, + NOTIFICATION_GROUP_ID_NONE, NOTIFICATION_PRIV_ID_NONE, &count); + + if (error == NOTIFICATION_ERROR_NONE) + BROWSER_LOGD("Notification count : %d\n", count); + else + BROWSER_LOGD("notification_get_count error\n"); + + if (count > 0) + return; + + if (!notification_manager->m_notification_db->delete_notifications()) + BROWSER_LOGE("delete_notifications failed"); + + if (notification_manager->m_is_notification_cb_registered) { + if (notification_unresister_changed_cb(__notification_changed_cb) == NOTIFICATION_ERROR_NONE) + notification_manager->m_is_notification_cb_registered = EINA_FALSE; + } +} + +void Browser_Notification_Manager::__notification_contents_show_cb(void *data, + Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data || !event_info) + return; + + Browser_Notification_Manager *notification_manager = NULL; + notification_manager = (Browser_Notification_Manager *)data; + Ewk_Notification *ewk_notification = (Ewk_Notification *)event_info; + Evas_Object *webkit = elm_webview_webkit_get(notification_manager->m_webview); + + if (!ewk_notification->iconURL || !ewk_notification->title || !ewk_notification->body) { + BROWSER_LOGE("ewk_notification member is null"); + return; + } + + if (!notification_manager->_register_notification(ewk_notification)) + BROWSER_LOGE("_register_notification failed"); + + ewk_view_notification_displayed(webkit, ewk_notification); +} + +void Browser_Notification_Manager::__notification_contents_cancel_cb(void *data, + Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); +} + +void Browser_Notification_Manager::__notification_contents_request_permission_cb(void *data, + Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data || !event_info) + return; + + Browser_Notification_Manager *notification_manager = NULL; + notification_manager = (Browser_Notification_Manager *)data; + if (!notification_manager->m_notification_db) { + BROWSER_LOGE("m_notification_db is null"); + return; + } + + char *domain = (char *)event_info; + BROWSER_LOGD("domain(%s)", domain); + + if (notification_manager->m_notification_db->has_domain(domain)) { + Evas_Object *webkit = elm_webview_webkit_get(notification_manager->m_webview); + ewk_view_notification_allowed_set(webkit, EINA_TRUE, domain); + BROWSER_LOGD("notification_manager->m_notification_db->has_domain() returns TRUE"); + return; + } else { + BROWSER_LOGD("notification_manager->m_notification_db->has_domain() returns FALSE"); + } + + if (notification_manager->m_confirm_popup) + evas_object_del(notification_manager->m_confirm_popup); + notification_manager->m_confirm_popup = elm_popup_add(notification_manager->m_webview); + if (!notification_manager->m_confirm_popup) { + BROWSER_LOGE("elm_popup_add failed"); + return; + } + evas_object_size_hint_weight_set(notification_manager->m_confirm_popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_object_part_text_set(notification_manager->m_confirm_popup, BR_STRING_PERMISSION_CHECK, "elm.text"); + elm_object_text_set(notification_manager->m_confirm_popup, BR_STRING_WEB_NOTIFICATION_Q); + + notification_manager->m_domain_to_save = std::string(domain); + + Evas_Object *ok_button = elm_button_add(notification_manager->m_confirm_popup); + elm_object_text_set(ok_button, BR_STRING_YES); + elm_object_part_content_set(notification_manager->m_confirm_popup, "button1", ok_button); + evas_object_smart_callback_add(ok_button, "clicked", __confirm_popup_response_cb, notification_manager); + + Evas_Object *cancel_button = elm_button_add(notification_manager->m_confirm_popup); + elm_object_text_set(cancel_button, BR_STRING_NO); + elm_object_part_content_set(notification_manager->m_confirm_popup, "button2", cancel_button); + evas_object_smart_callback_add(cancel_button, "clicked", __confirm_popup_cancel_cb, notification_manager); + + evas_object_show(notification_manager->m_confirm_popup); +} + +void Browser_Notification_Manager::__confirm_popup_response_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_Notification_Manager *notification_manager = NULL; + notification_manager = (Browser_Notification_Manager *)data; + + if (!notification_manager->m_notification_db->save_domain(notification_manager->m_domain_to_save.c_str())) + BROWSER_LOGE("save_domain failed"); + + Evas_Object *webkit = elm_webview_webkit_get(notification_manager->m_webview); + ewk_view_notification_allowed_set(webkit, EINA_TRUE, notification_manager->m_domain_to_save.c_str()); + + if (notification_manager->m_confirm_popup != NULL) { + evas_object_del(notification_manager->m_confirm_popup); + notification_manager->m_confirm_popup = NULL; + } +} + +void Browser_Notification_Manager::__confirm_popup_cancel_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_Notification_Manager *notification_manager = NULL; + notification_manager = (Browser_Notification_Manager *)data; + + Evas_Object *webkit = elm_webview_webkit_get(notification_manager->m_webview); + ewk_view_notification_allowed_set(webkit, EINA_FALSE, notification_manager->m_domain_to_save.c_str()); + + if (notification_manager->m_confirm_popup != NULL) { + evas_object_del(notification_manager->m_confirm_popup); + notification_manager->m_confirm_popup = NULL; + } +} + diff --git a/src/browser-extension/browser-notification-manager.h b/src/browser-extension/browser-notification-manager.h new file mode 100755 index 00000000..fc8c3b97 --- /dev/null +++ b/src/browser-extension/browser-notification-manager.h @@ -0,0 +1,61 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef BROWSER_NOTIFICATION_MANAGER_H +#define BROWSER_NOTIFICATION_MANAGER_H + +#include "browser-config.h" + +#include <notification.h> + +using namespace std; + +class Browser_Notification_DB; +class Browser_Notification_Manager { +public: + Browser_Notification_Manager(void); + ~Browser_Notification_Manager(void); + + void init(Evas_Object *webview); + void deinit(void); +private: + Eina_Bool _register_notification(Ewk_Notification *ewk_notification); + void _download_icon(int noti_id, const char *icon_url); + Eina_Bool _print_grouping_list(void); + Eina_Bool _finalize_download_icon(int noti_id, Eina_Bool set_image); + + static void __http_finished_cb(SoupSession *session, SoupMessage *msg, gpointer data); + static void __notification_changed_cb(void *data, notification_type_e type); + static void __confirm_popup_response_cb(void *data, Evas_Object *obj, void *event_info); + static void __confirm_popup_cancel_cb(void *data, Evas_Object *obj, void *event_info); + + static void __notification_contents_show_cb(void *data, + Evas_Object *obj, void *event_info); + static void __notification_contents_cancel_cb(void *data, + Evas_Object *obj, void *event_info); + static void __notification_contents_request_permission_cb(void *data, + Evas_Object *obj, void *event_info); + + Evas_Object *m_webview; + Evas_Object *m_confirm_popup; + Browser_Notification_DB *m_notification_db; + Eina_Bool m_is_notification_cb_registered; + std::string m_domain_to_save; + int m_noti_id; +}; + +#endif /* BROWSER_NOTIFICATION_MANAGER_H */ + diff --git a/src/browser-extension/browser-picker-handler.cpp b/src/browser-extension/browser-picker-handler.cpp new file mode 100755 index 00000000..af052b10 --- /dev/null +++ b/src/browser-extension/browser-picker-handler.cpp @@ -0,0 +1,517 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "browser-picker-handler.h" +#include "browser-view.h" + +#include <ui-gadget.h> + +Browser_Picker_Handler::Browser_Picker_Handler(Browser_View *browser_view) +: m_browser_view(browser_view) + ,m_webview(NULL) + ,m_picker_ug(NULL) + ,m_picker_layout(NULL) +{ + BROWSER_LOGD("[%s]", __func__); +} + +Browser_Picker_Handler::~Browser_Picker_Handler(void) +{ + BROWSER_LOGD("[%s]", __func__); + _destroy_options(); + + if (m_picker_layout) { + elm_object_part_content_unset(m_picker_layout, "elm.swallow.picker"); + evas_object_del(m_picker_layout); + } + + if (m_picker_ug) { + ug_destroy(m_picker_ug); + m_picker_ug = NULL; + } +} + +void Browser_Picker_Handler::destroy_picker_layout(void) +{ + BROWSER_LOGD("[%s]", __func__); + _destroy_options(); + + if (m_picker_layout) { + elm_object_part_content_unset(m_picker_layout, "elm.swallow.picker"); + evas_object_del(m_picker_layout); + } + + if (m_picker_ug) { + ug_destroy(m_picker_ug); + m_picker_ug = NULL; + } +} + +void Browser_Picker_Handler::init(Evas_Object *webview) +{ + BROWSER_LOGD("[%s]", __func__); + deinit(); + + m_webview = webview; + memset(&m_selected_info, 0x00, sizeof(selected_info)); + + Evas_Object *webkit = elm_webview_webkit_get(m_webview); + evas_object_smart_callback_add(webkit, "one,single,tap", __one_single_tap_cb, this); + evas_object_smart_callback_add(webkit, "inputmethod,changed", __input_method_changed_cb, this); +} + +void Browser_Picker_Handler::deinit(void) +{ + BROWSER_LOGD("[%s]", __func__); + if (m_webview) { + Evas_Object *webkit = elm_webview_webkit_get(m_webview); + + _destroy_options(); + + if (m_picker_layout) { + elm_object_part_content_unset(m_picker_layout, "elm.swallow.picker"); + evas_object_del(m_picker_layout); + } + + if (m_picker_ug) { + ug_destroy(m_picker_ug); + m_picker_ug = NULL; + } + + evas_object_smart_callback_del(webkit, "one,single,tap", __one_single_tap_cb); + evas_object_event_callback_del(m_win, EVAS_CALLBACK_RESIZE, __win_resize_cb); + evas_object_smart_callback_del(webkit, "inputmethod,changed", __input_method_changed_cb); + } +} + +void Browser_Picker_Handler::_destroy_options(void) +{ + BROWSER_LOGD("[%s]", __func__); + for (int i = 0 ; i < m_selected_info.option_number ; i++) { + if (m_selected_info.option_list[i]) { + free(m_selected_info.option_list[i]); + m_selected_info.option_list[i] = NULL; + } + } + + memset(&m_selected_info, 0x00, sizeof(selected_info)); +} + +Eina_Bool Browser_Picker_Handler::_show_picker(void) +{ + BROWSER_LOGD("[%s]", __func__); + + if (m_picker_ug) { + ug_destroy(m_picker_ug); + m_picker_ug = NULL; + } + + bundle *b = NULL; + struct ug_cbs cbs = {0,}; + b = bundle_create(); + if (!b) { + BROWSER_LOGE("bundle_create failed"); + return EINA_FALSE; + } + + char bundle_buf[100] = {0, }; + sprintf(bundle_buf, "%d", m_selected_info.option_number); + if (bundle_add(b, "Count", bundle_buf)) { + BROWSER_LOGE("bundle_add failed"); + bundle_free(b); + return EINA_FALSE; + } + + char item_title[100] = {0, }; + for (int i = 0 ; i < m_selected_info.option_number ; i++) { + sprintf(item_title, "%d", i); + if (bundle_add(b, item_title, m_selected_info.option_list[i])) { + BROWSER_LOGE("bundle_add failed"); + bundle_free(b); + return EINA_FALSE; + } + } + + cbs.layout_cb = __picker_layout_cb; + cbs.result_cb = __picker_result_cb; + cbs.destroy_cb = __picker_destroy_cb; + cbs.priv = (void *)this; + + m_picker_ug = ug_create(NULL, "picker-efl", UG_MODE_FRAMEVIEW, b, &cbs); + if (!m_picker_ug) { + BROWSER_LOGE("ug_create failed"); + return EINA_FALSE; + } + bundle_free(b); + + Evas_Object *webkit = elm_webview_webkit_get(m_webview); + evas_object_smart_callback_call(webkit, "make,select,visible", (void*)(&m_selected_info.rect)); + + evas_object_event_callback_del(m_win, EVAS_CALLBACK_RESIZE, __win_resize_cb); + evas_object_event_callback_add(m_win, EVAS_CALLBACK_RESIZE, __win_resize_cb, this); + + bundle *option_bundle = NULL; + option_bundle = bundle_create(); + if (!option_bundle) { + BROWSER_LOGE("bundle_create failed"); + return EINA_FALSE; + } + + BROWSER_LOGD("prev=%d, next=%d", m_selected_info.is_prev, m_selected_info.is_next); + if (!m_selected_info.is_prev) { + if (bundle_add(option_bundle, "PrevButton", "Disable")) { + BROWSER_LOGE("bundle_add is failed."); + bundle_free(option_bundle); + return EINA_FALSE; + } + } + if (!m_selected_info.is_next) { + if (bundle_add(option_bundle, "NextButton", "Disable")) { + BROWSER_LOGE("bundle_add is failed."); + bundle_free(option_bundle); + return EINA_FALSE; + } + } + if (m_picker_ug) { + if (ug_send_message(m_picker_ug, option_bundle)) + BROWSER_LOGE("ug_send_message is failed.\n"); + } + bundle_free(option_bundle); + + return EINA_TRUE; +} + +void Browser_Picker_Handler::__win_resize_cb(void* data, Evas* evas, Evas_Object* obj, void* ev) +{ + if (!data) + return; + + Browser_Picker_Handler *picker_handler = (Browser_Picker_Handler *)data; + + int window_w = 0; + int window_h = 0; + evas_object_geometry_get(m_win, NULL, NULL, &window_w, &window_h); + BROWSER_LOGD("window w=%d, h=%d", window_w, window_h); + evas_object_resize(picker_handler->m_picker_layout, window_w, window_h); +} + +void Browser_Picker_Handler::__picker_layout_cb(struct ui_gadget *ug, enum ug_mode mode, void *priv) +{ + BROWSER_LOGD("[%s]", __func__); + if (!ug || !priv) + return; + + Browser_Picker_Handler *picker_handler = (Browser_Picker_Handler *)priv; + + if (picker_handler->m_picker_layout) { + elm_object_part_content_unset(picker_handler->m_picker_layout, "elm.swallow.picker"); + evas_object_del(picker_handler->m_picker_layout); + } + + picker_handler->m_picker_layout = elm_layout_add(m_navi_bar); + if (!picker_handler->m_picker_layout) { + BROWSER_LOGE("elm_layout_add"); + return; + } + elm_object_focus_allow_set(picker_handler->m_picker_layout, EINA_FALSE); + + if (!elm_layout_file_set(picker_handler->m_picker_layout, BROWSER_EDJE_DIR"/browser-picker-layout.edj", + "picker_layout")) { + BROWSER_LOGE("elm_layout_file_set failed"); + return; + } + evas_object_size_hint_weight_set(picker_handler->m_picker_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + + int window_w = 0; + int window_h = 0; + evas_object_geometry_get(m_win, NULL, NULL, &window_w, &window_h); + + evas_object_resize(picker_handler->m_picker_layout, window_w, window_h); + evas_object_move(picker_handler->m_picker_layout, 0, 0); + evas_object_show(picker_handler->m_picker_layout); + + Evas_Object *base = (Evas_Object *)ug_get_layout(ug); + if (!base) { + BROWSER_LOGE("base is null"); + return; + } + + switch (mode) { + case UG_MODE_FRAMEVIEW: + elm_object_part_content_set(picker_handler->m_picker_layout, "elm.swallow.picker", base); + break; + default: + break; + } +} + +Eina_Bool Browser_Picker_Handler::_move_to_next_node(Eina_Bool is_next_node) +{ + BROWSER_LOGD("[%s]", __func__); + + _destroy_options(); + + Evas_Object *webkit = elm_webview_webkit_get(m_webview); + if (is_next_node) { + m_selected_info.option_list = ewk_view_dropdown_get_next_options(webkit, + &m_selected_info.option_number, + &m_selected_info.current_option_index, + &m_selected_info.rect, + &m_selected_info.is_prev, + &m_selected_info.is_next); + } else { + m_selected_info.option_list = ewk_view_dropdown_get_prev_options(webkit, + &m_selected_info.option_number, + &m_selected_info.current_option_index, + &m_selected_info.rect, + &m_selected_info.is_prev, + &m_selected_info.is_next); + } + + bundle *b = bundle_create(); + if (!b) { + BROWSER_LOGE("bundle_create failed"); + return EINA_FALSE; + } + + if (bundle_add(b, "Command", "Refill")) { + BROWSER_LOGE("bundle_add failed"); + bundle_free(b); + return EINA_FALSE; + } + char bundle_buf[100] = {0, }; + sprintf(bundle_buf, "%d", m_selected_info.option_number); + if (bundle_add(b, "Count", bundle_buf)) { + BROWSER_LOGE("bundle_add failed"); + bundle_free(b); + return EINA_FALSE; + } + + BROWSER_LOGD("prev=%d, next=%d", m_selected_info.is_prev, m_selected_info.is_next); + if (!m_selected_info.is_prev) { + if (bundle_add(b, "PrevButton", "Disable")) { + BROWSER_LOGE("bundle_add is failed."); + bundle_free(b); + return EINA_FALSE; + } + } else { + if (bundle_add(b, "PrevButton", "Enable")) { + BROWSER_LOGE("bundle_add is failed."); + bundle_free(b); + return EINA_FALSE; + } + } + + if (!m_selected_info.is_next) { + if (bundle_add(b, "NextButton", "Disable")) { + BROWSER_LOGE("bundle_add is failed."); + bundle_free(b); + return EINA_FALSE; + } + } else { + if (bundle_add(b, "NextButton", "Enable")) { + BROWSER_LOGE("bundle_add is failed."); + bundle_free(b); + return EINA_FALSE; + } + } + + char item_title[100] = {0, }; + for (int i = 0 ; i < m_selected_info.option_number ; i++) { + sprintf(item_title, "%d", i); + if (bundle_add(b, item_title, m_selected_info.option_list[i])) { + BROWSER_LOGE("bundle_add failed"); + bundle_free(b); + return EINA_FALSE; + } + } + + if (m_picker_ug) { + if (ug_send_message(m_picker_ug, b)) + BROWSER_LOGE("ug_send_message is failed.\n"); + } + + bundle_free(b); + + evas_object_smart_callback_call(webkit, "make,select,visible", (void*)(&m_selected_info.rect)); +} + +void Browser_Picker_Handler::__picker_result_cb(struct ui_gadget *ug, bundle *result, void *priv) +{ + BROWSER_LOGD("[%s]", __func__); + if (!ug || !priv || !result) + return; + + Browser_Picker_Handler *picker_handler = (Browser_Picker_Handler *)priv; + const char *response = bundle_get_val(result, "Result"); + if (response) { + if (!strncmp(response, "Success", strlen("Success"))) + picker_handler->__picker_destroy_cb(ug, priv); + else if (!strncmp(response, "Prev", strlen("Prev"))) + picker_handler->_move_to_next_node(EINA_FALSE); + else if (!strncmp(response, "Next", strlen("Next"))) + picker_handler->_move_to_next_node(EINA_TRUE); + } + + const char *index = bundle_get_val(result, "Index"); + if (index) { + Evas_Object *webkit = elm_webview_webkit_get(picker_handler->m_webview); + if (atoi(index)) { + if (!ewk_page_dropdown_set_current_index(webkit, atoi(index))) + BROWSER_LOGE("ewk_page_dropdown_set_current_index is failed.\n"); + } + } +} + +void Browser_Picker_Handler::__picker_destroy_cb(struct ui_gadget *ug, void *priv) +{ + BROWSER_LOGD("[%s]", __func__); + if (!ug || !priv) + return; + + Browser_Picker_Handler *picker_handler = (Browser_Picker_Handler *)priv; + + if (ug_destroy(ug)) + BROWSER_LOGE("ug_destroy is failed.\n"); + + picker_handler->m_picker_ug = NULL; + + elm_object_part_content_unset(picker_handler->m_picker_layout, "elm.swallow.picker"); + evas_object_del(picker_handler->m_picker_layout); + picker_handler->m_picker_layout = NULL; +} + +void Browser_Picker_Handler::__one_single_tap_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data || !event_info) + return; + + Evas_Point *position = (Evas_Point *)event_info; + Browser_Picker_Handler *picker_handler = (Browser_Picker_Handler *)data; + Evas_Object *webkit = elm_webview_webkit_get(picker_handler->m_webview); + double zoom_rate = 1.0f; + int webview_y = 0; + evas_object_geometry_get(webkit, NULL, &webview_y, NULL, NULL); + + picker_handler->_destroy_options(); + + if (ewk_view_zoom_cairo_scaling_get(webkit) == EINA_TRUE) + zoom_rate = ewk_view_zoom_get(webkit); + + picker_handler->m_selected_info.clicked_x = position->x / zoom_rate; + picker_handler->m_selected_info.clicked_y = (position->y - webview_y) / zoom_rate; + + picker_handler->m_selected_info.option_list = ewk_page_dropdown_get_options(webkit, + picker_handler->m_selected_info.clicked_x, + picker_handler->m_selected_info.clicked_y, + &picker_handler->m_selected_info.option_number, + &picker_handler->m_selected_info.current_option_index, + &picker_handler->m_selected_info.rect, + &picker_handler->m_selected_info.is_prev, + &picker_handler->m_selected_info.is_next); + + if (picker_handler->m_selected_info.option_list) { + if (!picker_handler->_show_picker()) + BROWSER_LOGE("_show_picker failed"); + } +} + +void Browser_Picker_Handler::__input_method_changed_cb(void *data, Evas_Object *obj, void *event_info) +{ + if (!data) + return; + + Browser_Picker_Handler *picker_handler = (Browser_Picker_Handler *)data; + Evas_Object *webkit = elm_webview_webkit_get(picker_handler->m_webview); + int imh_type = ewk_view_imh_get(obj); + BROWSER_LOGD("imh_type = %d", imh_type); + if (imh_type == EWK_IMH_DATE) { + const char *current_date = ewk_view_focused_input_element_value_get(webkit); + BROWSER_LOGD("current_date=[%s]", current_date); + + if (!picker_handler->_show_calendar_picker(current_date, INPUT_TYPE_DATE)) + BROWSER_LOGE("_show_calendar_picker failed"); + + if (current_date) + free((char *)current_date); + } else if (imh_type == EWK_IMH_TIME) { + /* To do. */ + } +} + +Eina_Bool Browser_Picker_Handler::_show_calendar_picker(const char *date, input_type type) +{ + BROWSER_LOGD("date=[%s], type=%d", date, type); + + if (m_picker_ug) { + ug_destroy(m_picker_ug); + m_picker_ug = NULL; + } + + bundle *b = NULL; + struct ug_cbs cbs = {0,}; + b = bundle_create(); + if (!b) { + BROWSER_LOGE("bundle_create failed"); + return EINA_FALSE; + } + + if (bundle_add(b, "date", date)) { + BROWSER_LOGE("bundle_add failed"); + bundle_free(b); + return EINA_FALSE; + } + + cbs.layout_cb = __picker_layout_cb; + cbs.destroy_cb = __picker_destroy_cb; + if (type == INPUT_TYPE_DATE) + cbs.result_cb = __calendar_picker_date_result_cb; + cbs.priv = (void *)this; + + m_picker_ug = ug_create(NULL, "calendar-picker-efl", UG_MODE_FRAMEVIEW, b, &cbs); + if (!m_picker_ug) { + BROWSER_LOGE("ug_create failed"); + return EINA_FALSE; + } + bundle_free(b); + + return EINA_TRUE; +} + +void Browser_Picker_Handler::__calendar_picker_date_result_cb(struct ui_gadget *ug, + bundle *result, void *priv) +{ + BROWSER_LOGD("[%s]", __func__); + if (!ug || !priv || !result) + return; + + Browser_Picker_Handler *picker_handler = (Browser_Picker_Handler *)priv; + const char *value = bundle_get_val(result, "Result"); + if (value) { + if (!strncmp(value, "Done", strlen("Done"))) { + picker_handler->__picker_destroy_cb(ug, priv); + return; + } + } + const char *date = bundle_get_val(result, "Date"); + if (date) { + Evas_Object *webkit = elm_webview_webkit_get(picker_handler->m_webview); + if (!ewk_view_focused_input_element_value_set(webkit, date)) + BROWSER_LOGE("ewk_view_focused_input_element_value_set failed"); + } +} + diff --git a/src/browser-extension/browser-picker-handler.h b/src/browser-extension/browser-picker-handler.h new file mode 100755 index 00000000..dfcd3057 --- /dev/null +++ b/src/browser-extension/browser-picker-handler.h @@ -0,0 +1,77 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef BROWSER_PICKER_HANDLER_H +#define BROWSER_PICKER_HANDLER_H + +#include "browser-common-view.h" +#include "browser-config.h" + +class Browser_View; +class Browser_Picker_Handler : public Browser_Common_View { +public: + Browser_Picker_Handler(Browser_View *browser_view); + ~Browser_Picker_Handler(void); + + Eina_Bool init(void) {} + + void init(Evas_Object *webview); + void deinit(void); + + void destroy_picker_layout(void); + + typedef enum _input_type { + INPUT_TYPE_DATE, + INPUT_TYPE_DATE_TIME, + INPUT_TYPE_DATE_TIME_LOCAL, + INPUT_TYPE_UNKNOWN + } input_type; +private: + typedef struct _selected_info { + int clicked_x; + int clicked_y; + int option_number; + int current_option_index; + char **option_list; + Eina_Rectangle rect; + bool is_prev; + bool is_next; + } selected_info; + + void _destroy_options(void); + Eina_Bool _show_picker(void); + Eina_Bool _show_calendar_picker(const char *date, input_type type); + Eina_Bool _move_to_next_node(Eina_Bool is_next_node); + + static void __one_single_tap_cb(void *data, Evas_Object *obj, void *event_info); + static void __input_method_changed_cb(void *data, Evas_Object *obj, void *event_info); + static void __win_resize_cb(void* data, Evas* evas, Evas_Object* obj, void* ev); + + static void __picker_layout_cb(struct ui_gadget *ug, enum ug_mode mode, void *priv); + static void __picker_result_cb(struct ui_gadget *ug, bundle *result, void *priv); + static void __picker_destroy_cb(struct ui_gadget *ug, void *priv); + static void __calendar_picker_date_result_cb(struct ui_gadget *ug, bundle *result, void *priv); + + Browser_View *m_browser_view; + Evas_Object *m_webview; + Evas_Object *m_picker_layout; + selected_info m_selected_info; + + struct ui_gadget *m_picker_ug; +}; + +#endif /* BROWSER_PICKER_HANDLER_H */ + diff --git a/src/browser-history/browser-history-layout.cpp b/src/browser-history/browser-history-layout.cpp new file mode 100755 index 00000000..8e2581b4 --- /dev/null +++ b/src/browser-history/browser-history-layout.cpp @@ -0,0 +1,1397 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "browser-add-to-bookmark-view.h" +#include "browser-view.h" +#include "browser-history-layout.h" + +Date::Date() : day(0), month(0), year(0) {} + +Date::Date(Date &date) +{ + this->day = date.day; + this->month = date.month; + this->year = date.year; +} + +void Date::operator=(Date &date) +{ + this->day = date.day; + this->month = date.month; + this->year = date.year; +} + +bool Date::operator==(Date &date) +{ + return (this->day == date.day && this->month == date.month && this->year == date.year); +} + +bool Date::operator!=(Date &date) +{ + return (this->day != date.day || this->month != date.month || this->year != date.year); +} + +Browser_History_Layout::Browser_History_Layout(void) +: m_history_genlist(NULL) + ,m_edit_mode_select_all_layout(NULL) + ,m_edit_mode_select_all_check_button(NULL) + ,m_content_box(NULL) + ,m_no_history_label(NULL) + ,m_processing_popup_timer(NULL) + ,m_processed_it(NULL) + ,m_processed_count(0) + ,m_total_item_count(0) + ,m_processing_popup(NULL) + ,m_processing_popup_layout(NULL) + ,m_processing_progress_bar(NULL) + ,m_select_all_check_value(EINA_FALSE) + ,m_searchbar_layout(NULL) + ,m_searched_history_genlist(NULL) + ,m_no_content_search_result(NULL) + ,m_searchbar(NULL) + ,m_delete_confirm_popup(NULL) +{ + BROWSER_LOGD("[%s]", __func__); +} + +Browser_History_Layout::~Browser_History_Layout(void) +{ + BROWSER_LOGD("[%s]", __func__); + hide_notify_popup(); + + for(int i = 0 ; i < m_history_list.size() ; i++ ) { + if (m_history_list[i]) + delete m_history_list[i]; + } + m_history_list.clear(); + + for(int i = 0 ; i < m_history_date_label_list.size() ; i++ ) { + if (m_history_date_label_list[i]) + free(m_history_date_label_list[i]); + } + m_history_date_label_list.clear(); + + for(int i = 0 ; i < m_searched_history_date_label_list.size() ; i++ ) { + if (m_searched_history_date_label_list[i]) + free(m_searched_history_date_label_list[i]); + } + m_searched_history_date_label_list.clear(); + + for(int i = 0 ; i < m_searched_history_item_list.size() ; i++ ) { + if (m_searched_history_item_list[i]) + delete m_searched_history_item_list[i]; + } + m_searched_history_item_list.clear(); + + if (m_delete_confirm_popup) + evas_object_del(m_delete_confirm_popup); +} + +Eina_Bool Browser_History_Layout::init(void) +{ + BROWSER_LOGD("[%s]", __func__); + return _create_main_layout(); +} + +Eina_Bool Browser_History_Layout::_show_searched_history(const char *search_text) +{ + BROWSER_LOGD("search_text = [%s]", search_text); + + for(int i = 0 ; i < m_searched_history_item_list.size() ; i++ ) { + if (m_searched_history_item_list[i]) + delete m_searched_history_item_list[i]; + } + m_searched_history_item_list.clear(); + + for(int i = 0 ; i < m_searched_history_date_label_list.size() ; i++ ) { + if (m_searched_history_date_label_list[i]) + free(m_searched_history_date_label_list[i]); + } + m_searched_history_date_label_list.clear(); + + if (!search_text || !strlen(search_text)) { + if (m_searched_history_genlist || m_no_content_search_result) { + elm_box_unpack_all(m_content_box); + elm_box_pack_start(m_content_box, m_history_genlist); + evas_object_show(m_history_genlist); + + if (m_searched_history_genlist) { + evas_object_del(m_searched_history_genlist); + m_searched_history_genlist = NULL; + } + + if (m_no_content_search_result) { + evas_object_del(m_no_content_search_result); + m_no_content_search_result = NULL; + } + + if (m_history_list.size() == 0) { + if (m_no_history_label) { + elm_box_unpack_all(m_content_box); + elm_box_pack_start(m_content_box, m_no_history_label); + } + } + + return EINA_TRUE; + } + } + + Elm_Object_Item *it = elm_genlist_first_item_get(m_history_genlist); + while (it) { + Browser_History_DB::history_item *item = NULL; + item = (Browser_History_DB::history_item *)elm_object_item_data_get(it); + if (item && elm_genlist_item_select_mode_get(it) != ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY) { + if (item->url.find(search_text) != string::npos || item->title.find(search_text) != string::npos) { + Browser_History_DB::history_item *searched_item = NULL; + searched_item = new(nothrow) Browser_History_DB::history_item; + searched_item->id = item->id; + searched_item->url = item->url; + searched_item->title = item->title; + searched_item->date = item->date; + searched_item->is_delete = item->is_delete; + searched_item->user_data = item->user_data; + m_searched_history_item_list.push_back(searched_item); + } + } + it = elm_genlist_item_next_get(it); + } + + if (m_searched_history_item_list.size()) { + if (m_no_content_search_result) { + evas_object_del(m_no_content_search_result); + m_no_content_search_result = NULL; + } + + if (!m_searched_history_genlist) { + m_searched_history_genlist = _create_history_genlist(); + if (!m_searched_history_genlist) { + BROWSER_LOGE("_create_history_genlist failed"); + return EINA_FALSE; + } + } + + elm_genlist_clear(m_searched_history_genlist); + + Date date; + Date last_date; + for(int i = 0 ; i < m_searched_history_item_list.size() ; i++) { + sscanf(m_searched_history_item_list[i]->date.c_str(), "%d-%d-%d", &date.year, &date.month, &date.day); + m_searched_history_item_list[i]->user_data = (void *)this; + if (last_date != date) { + last_date = date; + char *labe_item = strdup(m_searched_history_item_list[i]->date.c_str()); + if (!labe_item) { + BROWSER_LOGE("strdup failed"); + return EINA_FALSE; + } + m_searched_history_date_label_list.push_back(labe_item); + it = elm_genlist_item_append(m_searched_history_genlist, &m_history_group_title_class, + labe_item, NULL, ELM_GENLIST_ITEM_GROUP, NULL, NULL); + + elm_genlist_item_select_mode_set(it, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY); + } + elm_genlist_item_append(m_searched_history_genlist, &m_history_genlist_item_class, + m_searched_history_item_list[i], it, ELM_GENLIST_ITEM_NONE, + __history_item_clicked_cb, this); + } + + elm_box_unpack_all(m_content_box); + evas_object_hide(m_history_genlist); + elm_box_pack_start(m_content_box, m_searched_history_genlist); + evas_object_show(m_searched_history_genlist); + } else { + BROWSER_LOGD("show no content"); + if (m_no_content_search_result) + evas_object_del(m_no_content_search_result); + m_no_content_search_result = elm_layout_add(m_content_box); + if (!m_no_content_search_result) { + BROWSER_LOGE("elm_layout_add failed"); + return EINA_FALSE; + } + elm_layout_theme_set(m_no_content_search_result, "layout", "nocontents", "search"); + elm_object_part_text_set(m_no_content_search_result, "elm.text", BR_STRING_NO_SEARCH_RESULT); + evas_object_size_hint_weight_set(m_no_content_search_result, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(m_no_content_search_result, EVAS_HINT_FILL, EVAS_HINT_FILL); + + if (m_searched_history_genlist) { + evas_object_del(m_searched_history_genlist); + m_searched_history_genlist = NULL; + } + + elm_box_unpack_all(m_content_box); + evas_object_hide(m_history_genlist); + elm_box_pack_start(m_content_box, m_no_content_search_result); + evas_object_show(m_no_content_search_result); + } + + return EINA_TRUE; +} + +void Browser_History_Layout::__search_delay_changed_cb(void *data, Evas_Object *obj, void *event_info) +{ + const char *search_text = elm_entry_entry_get(obj); + BROWSER_LOGD("search_text=[%s]", search_text); + + if (!data || !search_text) + return; + + char *utf8_text = elm_entry_markup_to_utf8(search_text); + if (!utf8_text) + return; + + Browser_History_Layout *history_layout = (Browser_History_Layout *)data; + if (!history_layout->_show_searched_history(utf8_text)) + BROWSER_LOGE("_show_searched_history failed"); + + free(utf8_text); +} + +void Browser_History_Layout::_enable_searchbar_layout(Eina_Bool enable) +{ + if (enable) { + elm_layout_theme_set(m_searchbar_layout, "layout", "application", "searchbar_base"); + + if (!m_searchbar) { + m_searchbar = br_elm_searchbar_add(m_searchbar_layout); + if (!m_searchbar) + BROWSER_LOGD("br_elm_searchbar_add failed"); + } + + elm_object_part_content_set(m_searchbar_layout, "searchbar", m_searchbar); + evas_object_show(m_searchbar); + + elm_object_signal_emit(m_searchbar_layout, "elm,state,show,searchbar", "elm"); + + Evas_Object *searchbar_entry = br_elm_searchbar_entry_get(m_searchbar); + elm_entry_input_panel_layout_set(searchbar_entry, ELM_INPUT_PANEL_LAYOUT_URL); + + evas_object_smart_callback_add(searchbar_entry, "changed", __search_delay_changed_cb, this); + } else { + for(int i = 0 ; i < m_searched_history_item_list.size() ; i++ ) { + if (m_searched_history_item_list[i]) + delete m_searched_history_item_list[i]; + } + m_searched_history_item_list.clear(); + + for(int i = 0 ; i < m_searched_history_date_label_list.size() ; i++ ) { + if (m_searched_history_date_label_list[i]) + free(m_searched_history_date_label_list[i]); + } + m_searched_history_date_label_list.clear(); + + if (m_searched_history_genlist || m_no_content_search_result) { + elm_box_unpack_all(m_content_box); + elm_box_pack_start(m_content_box, m_history_genlist); + evas_object_show(m_history_genlist); + + if (m_searched_history_genlist) { + evas_object_del(m_searched_history_genlist); + m_searched_history_genlist = NULL; + } + + if (m_no_content_search_result) { + evas_object_del(m_no_content_search_result); + m_no_content_search_result = NULL; + } + } + + if (m_searchbar) { + elm_object_part_content_unset(m_searchbar_layout, "searchbar"); + evas_object_hide(m_searchbar); + } + + Evas_Object *searchbar_entry = br_elm_searchbar_entry_get(m_searchbar); + evas_object_smart_callback_del(searchbar_entry, "changed", __search_delay_changed_cb); + + elm_layout_theme_set(m_searchbar_layout, "layout", "application", "noindicator"); + } +} + +void Browser_History_Layout::_set_edit_mode(Eina_Bool edit_mode) +{ + BROWSER_LOGD("[%s]", __func__); + Browser_Bookmark_View *bookmark_view = m_data_manager->get_bookmark_view(); + + hide_notify_popup(); + + _enable_searchbar_layout(!edit_mode); + + if (edit_mode) { + elm_object_style_set(m_bg, "edit_mode"); + + m_edit_mode_select_all_layout = elm_layout_add(m_content_box); + if (!m_edit_mode_select_all_layout) { + BROWSER_LOGE("elm_layout_add failed"); + return; + } + elm_layout_theme_set(m_edit_mode_select_all_layout, "genlist", "item", "select_all/default"); + evas_object_size_hint_weight_set(m_edit_mode_select_all_layout, EVAS_HINT_EXPAND, EVAS_HINT_FILL); + evas_object_size_hint_align_set(m_edit_mode_select_all_layout, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_event_callback_add(m_edit_mode_select_all_layout, EVAS_CALLBACK_MOUSE_DOWN, + __edit_mode_select_all_clicked_cb, this); + + m_edit_mode_select_all_check_button = elm_check_add(m_edit_mode_select_all_layout); + if (!m_edit_mode_select_all_check_button) { + BROWSER_LOGE("elm_layout_add failed"); + return; + } + evas_object_smart_callback_add(m_edit_mode_select_all_check_button, "changed", + __edit_mode_select_all_check_changed_cb, this); + evas_object_propagate_events_set(m_edit_mode_select_all_check_button, EINA_FALSE); + + elm_object_part_content_set(m_edit_mode_select_all_layout, "elm.icon", m_edit_mode_select_all_check_button); + elm_object_text_set(m_edit_mode_select_all_layout, BR_STRING_SELECT_ALL); + + elm_box_pack_start(m_content_box, m_edit_mode_select_all_layout); + evas_object_show(m_edit_mode_select_all_layout); + + elm_genlist_decorate_mode_set(m_history_genlist, EINA_TRUE); + elm_genlist_select_mode_set(m_history_genlist, ELM_OBJECT_SELECT_MODE_ALWAYS); + + bookmark_view->_set_navigationbar_title(BR_STRING_SELECT_HISTORIES); + + if (!bookmark_view->_set_controlbar_type(Browser_Bookmark_View::HISTORY_VIEW_EDIT_MODE)) + BROWSER_LOGE("_set_controlbar_type HISTORY_VIEW_EDIT_MODE failed"); + } else { + if (m_edit_mode_select_all_layout) { + elm_box_unpack(m_content_box, m_edit_mode_select_all_layout); + evas_object_del(m_edit_mode_select_all_layout); + m_edit_mode_select_all_layout = NULL; + } + if (m_edit_mode_select_all_check_button) { + evas_object_del(m_edit_mode_select_all_check_button); + m_edit_mode_select_all_check_button = NULL; + } + if (m_no_history_label) { + evas_object_del(m_no_history_label); + m_no_history_label = NULL; + } + + Browser_Bookmark_View *bookmark_view = m_data_manager->get_bookmark_view(); + if (!bookmark_view->_set_controlbar_type(Browser_Bookmark_View::HISTORY_VIEW_DEFAULT)) + BROWSER_LOGE("_set_controlbar_type failed"); + + Elm_Object_Item *it = NULL; + Browser_History_DB::history_item *item = NULL; + it = elm_genlist_first_item_get(m_history_genlist); + while(it) { + item = (Browser_History_DB::history_item *)elm_object_item_data_get(it); + item->is_delete = EINA_FALSE; + it = elm_genlist_item_next_get(it); + } + + elm_object_style_set(m_bg, "default"); + elm_genlist_decorate_mode_set(m_history_genlist, EINA_FALSE); + elm_genlist_select_mode_set(m_history_genlist, ELM_OBJECT_SELECT_MODE_DEFAULT); + + bookmark_view->_set_navigationbar_title(BR_STRING_HISTORY); + + if (m_history_list.size() == 0) { + elm_box_unpack_all(m_content_box); + elm_genlist_clear(m_history_genlist); + evas_object_hide(m_history_genlist); + + if (m_edit_mode_select_all_layout) { + evas_object_del(m_edit_mode_select_all_layout); + m_edit_mode_select_all_layout = NULL; + } + if (m_edit_mode_select_all_check_button) { + evas_object_del(m_edit_mode_select_all_check_button); + m_edit_mode_select_all_check_button = NULL; + } + + m_no_history_label = elm_label_add(m_searchbar_layout); + if (!m_no_history_label) { + BROWSER_LOGE("elm_label_add failed"); + return; + } + + std::string text = std::string("<color='#646464'>") + std::string(BR_STRING_NO_HISTORY); + elm_object_text_set(m_no_history_label, text.c_str()); + evas_object_show(m_no_history_label); + elm_box_pack_start(m_content_box, m_no_history_label); + + elm_object_item_disabled_set(bookmark_view->m_bookmark_edit_controlbar_item, EINA_TRUE); + } + } +} + +void Browser_History_Layout::_show_selection_info(void) +{ + BROWSER_LOGD("[%s]", __func__); + Elm_Object_Item *it = elm_genlist_first_item_get(m_history_genlist); + int selected_count = 0; + int total_count = 0; + while(it) { + Browser_History_DB::history_item *item = NULL; + item = (Browser_History_DB::history_item *)elm_object_item_data_get(it); + if (item && elm_genlist_item_select_mode_get(it) != ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY) { + if (item->is_delete) + selected_count++; + total_count++; + } + it = elm_genlist_item_next_get(it); + } + + if (selected_count == 0) { + elm_object_item_disabled_set(m_data_manager->get_bookmark_view()->m_bookmark_delete_controlbar_item, EINA_TRUE); + hide_notify_popup(); + return; + } else + elm_object_item_disabled_set(m_data_manager->get_bookmark_view()->m_bookmark_delete_controlbar_item, EINA_FALSE); + + if (selected_count == 1) { + show_notify_popup(BR_STRING_ONE_ITEM_SELECTED, 0, EINA_TRUE); + } else if (selected_count > 1) { + char *small_popup_text = NULL; + int string_len = strlen(BR_STRING_ITEMS_SELECTED) + 4; + + small_popup_text = (char *)malloc(string_len * sizeof(char)); + memset(small_popup_text, 0x00, string_len); + + snprintf(small_popup_text, string_len, BR_STRING_ITEMS_SELECTED, selected_count); + show_notify_popup(small_popup_text, 0, EINA_TRUE); + + if (small_popup_text) + free(small_popup_text); + small_popup_text = 0x00; + } +} + +void Browser_History_Layout::_show_delete_processing_popup(void) +{ + BROWSER_LOGD("[%s]", __func__); + if (m_processing_popup) + evas_object_del(m_processing_popup); + + m_processing_popup = elm_popup_add(m_searchbar_layout); + if (!m_processing_popup) { + BROWSER_LOGE("elm_popup_add failed"); + return; + } + + if (m_processing_popup_layout) + evas_object_del(m_processing_popup_layout); + m_processing_popup_layout = elm_layout_add(m_processing_popup); + if (!m_processing_popup_layout) { + BROWSER_LOGE("elm_layout_add failed"); + return; + } + if (!elm_layout_file_set(m_processing_popup_layout, BROWSER_EDJE_DIR"/browser-bookmark-view.edj", + "browser/popup_center_progressview")) { + BROWSER_LOGE("elm_layout_file_set failed"); + return; + } + evas_object_size_hint_weight_set(m_processing_popup_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + + m_processing_progress_bar = elm_progressbar_add(m_processing_popup); + elm_object_style_set(m_processing_progress_bar, "list_progress"); + elm_progressbar_horizontal_set(m_processing_progress_bar, EINA_TRUE); + evas_object_size_hint_align_set(m_processing_progress_bar, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_size_hint_weight_set(m_processing_progress_bar, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_progressbar_value_set(m_processing_progress_bar, 0.0); + + if (m_processing_popup_timer) + ecore_timer_del(m_processing_popup_timer); + + m_processed_count = 0; + m_processed_it = elm_genlist_last_item_get(m_history_genlist); + + Elm_Object_Item *it = elm_genlist_first_item_get(m_history_genlist); + m_total_item_count = 0; + while (it) { + Browser_History_DB::history_item *item = NULL; + item = (Browser_History_DB::history_item *)elm_object_item_data_get(it); + if (item && elm_genlist_item_select_mode_get(it) != ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY) { + if(item->is_delete) + m_total_item_count++; + } + it = elm_genlist_item_next_get(it); + } + + m_processing_popup_timer = ecore_timer_add(0.3, __delete_processing_popup_timer_cb, this); + evas_object_show(m_processing_progress_bar); + + elm_object_part_content_set(m_processing_popup_layout, "elm.swallow.content", m_processing_progress_bar); + edje_object_part_text_set(elm_layout_edje_get(m_processing_popup_layout), "elm.title", BR_STRING_PROCESSING); + edje_object_part_text_set(elm_layout_edje_get(m_processing_popup_layout), "elm.text.left", ""); + edje_object_part_text_set(elm_layout_edje_get(m_processing_popup_layout), "elm.text.right", ""); + + elm_object_content_set(m_processing_popup, m_processing_popup_layout); + + Evas_Object *cancel_button = elm_button_add(m_processing_popup); + if (!cancel_button) { + BROWSER_LOGE("elm_button_add failed"); + return; + } + elm_object_text_set(cancel_button, BR_STRING_CANCEL); + elm_object_part_content_set(m_processing_popup, "button1", cancel_button); + evas_object_smart_callback_add(cancel_button, "clicked", __delete_processing_popup_response_cb, this); + + evas_object_show(m_processing_popup); +} + +void Browser_History_Layout::__delete_processing_popup_response_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_History_Layout *history_layout = (Browser_History_Layout *)data; + + evas_object_del(history_layout->m_processing_popup); + + history_layout->m_processing_progress_bar = NULL; + history_layout->m_processed_it = NULL; + + if (history_layout->m_processing_popup_timer) { + ecore_timer_del(history_layout->m_processing_popup_timer); + history_layout->m_processing_popup_timer = NULL; + } + + history_layout->show_notify_popup(BR_STRING_DELETED, 3, EINA_TRUE); + + if (history_layout->m_history_list.size() == 0) { + elm_box_unpack_all(history_layout->m_content_box); + elm_genlist_clear(history_layout->m_history_genlist); + evas_object_hide(history_layout->m_history_genlist); + + if (history_layout->m_edit_mode_select_all_layout) { + evas_object_del(history_layout->m_edit_mode_select_all_layout); + history_layout->m_edit_mode_select_all_layout = NULL; + } + if (history_layout->m_edit_mode_select_all_check_button) { + evas_object_del(history_layout->m_edit_mode_select_all_check_button); + history_layout->m_edit_mode_select_all_check_button = NULL; + } + + history_layout->m_no_history_label = elm_label_add(history_layout->m_searchbar_layout); + if (!history_layout->m_no_history_label) { + BROWSER_LOGE("elm_label_add failed"); + return; + } + + std::string text = std::string("<color='#646464'>") + std::string(BR_STRING_NO_HISTORY); + elm_object_text_set(history_layout->m_no_history_label, text.c_str()); + evas_object_show(history_layout->m_no_history_label); + elm_box_pack_start(history_layout->m_content_box, history_layout->m_no_history_label); + + Browser_Bookmark_View *bookmark_view = m_data_manager->get_bookmark_view(); + if (!bookmark_view->_set_controlbar_type(Browser_Bookmark_View::HISTORY_VIEW_DEFAULT)) + BROWSER_LOGE("_set_controlbar_type failed"); + + elm_object_item_disabled_set(bookmark_view->m_bookmark_edit_controlbar_item, EINA_TRUE); + } +} + +Eina_Bool Browser_History_Layout::__delete_processing_popup_timer_cb(void *data) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return ECORE_CALLBACK_CANCEL; + + Browser_History_Layout *history_layout = (Browser_History_Layout *)data; + Evas_Object* progress_bar = history_layout->m_processing_progress_bar; + + Eina_Bool check_value = history_layout->m_select_all_check_value; + + double value = elm_progressbar_value_get(progress_bar); + if (value >= 1.0) { + __delete_processing_popup_response_cb(history_layout, NULL, NULL); + + history_layout->m_processing_popup_timer = NULL; + history_layout->show_notify_popup(BR_STRING_DELETED, 3, EINA_TRUE); + + return ECORE_CALLBACK_CANCEL; + } + + while (history_layout->m_processed_it) { + Browser_History_DB::history_item *item = NULL; + item = (Browser_History_DB::history_item *)elm_object_item_data_get(history_layout->m_processed_it); + if (item) { + if(item->is_delete + && elm_genlist_item_select_mode_get(history_layout->m_processed_it) != ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY) { + Eina_Bool ret = m_data_manager->get_history_db()->delete_history(item->id); + for(int index = 0 ; index < history_layout->m_history_list.size() ; index++) { + if (history_layout->m_history_list[index]->id == item->id) { + delete history_layout->m_history_list[index]; + history_layout->m_history_list.erase(history_layout->m_history_list.begin() + index); + } + } + + history_layout->m_processed_count++; + Elm_Object_Item *it = history_layout->m_processed_it; + history_layout->m_processed_it = elm_genlist_item_prev_get(history_layout->m_processed_it); + elm_object_item_del(it); + elm_genlist_realized_items_update(history_layout->m_history_genlist); + } else + history_layout->m_processed_it = elm_genlist_item_prev_get(history_layout->m_processed_it); + } else + history_layout->m_processed_it = elm_genlist_item_prev_get(history_layout->m_processed_it); + + if (history_layout->m_processed_count % 20 == 0) + break; + } + + elm_progressbar_value_set(history_layout->m_processing_progress_bar, + (float)((float)history_layout->m_processed_count / (float)history_layout->m_total_item_count)); + + char progress_text[20] = {0, }; + snprintf(progress_text, sizeof(progress_text) - 1, "%d / %d", + history_layout->m_processed_count, history_layout->m_total_item_count); + + edje_object_part_text_set(elm_layout_edje_get(history_layout->m_processing_popup_layout), + "elm.text.right", progress_text); + + return ECORE_CALLBACK_RENEW; +} + +void Browser_History_Layout::_show_select_processing_popup(void) +{ + BROWSER_LOGD("[%s]", __func__); + if (m_processing_popup) + evas_object_del(m_processing_popup); + + m_processing_popup = elm_popup_add(m_searchbar_layout); + if (!m_processing_popup) { + BROWSER_LOGE("elm_popup_add failed"); + return; + } + + if (m_processing_popup_layout) + evas_object_del(m_processing_popup_layout); + m_processing_popup_layout = elm_layout_add(m_processing_popup); + if (!m_processing_popup_layout) { + BROWSER_LOGE("elm_layout_add failed"); + return; + } + if (!elm_layout_file_set(m_processing_popup_layout, BROWSER_EDJE_DIR"/browser-bookmark-view.edj", + "browser/popup_center_progressview")) { + BROWSER_LOGE("elm_layout_file_set failed"); + return; + } + evas_object_size_hint_weight_set(m_processing_popup_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + + m_processing_progress_bar = elm_progressbar_add(m_processing_popup); + elm_object_style_set(m_processing_progress_bar, "list_progress"); + elm_progressbar_horizontal_set(m_processing_progress_bar, EINA_TRUE); + evas_object_size_hint_align_set(m_processing_progress_bar, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_size_hint_weight_set(m_processing_progress_bar, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_progressbar_value_set(m_processing_progress_bar, 0.0); + + if (m_processing_popup_timer) + ecore_timer_del(m_processing_popup_timer); + + m_processed_count = 0; + m_processed_it = elm_genlist_first_item_get(m_history_genlist); + + m_processing_popup_timer = ecore_timer_add(0.1, __select_processing_popup_timer_cb, this); + evas_object_show(m_processing_progress_bar); + + elm_object_part_content_set(m_processing_popup_layout, "elm.swallow.content", m_processing_progress_bar); + edje_object_part_text_set(elm_layout_edje_get(m_processing_popup_layout), "elm.title", BR_STRING_PROCESSING); + edje_object_part_text_set(elm_layout_edje_get(m_processing_popup_layout), "elm.text.left", ""); + edje_object_part_text_set(elm_layout_edje_get(m_processing_popup_layout), "elm.text.right", ""); + + elm_object_content_set(m_processing_popup, m_processing_popup_layout); + + Evas_Object *cancel_button = elm_button_add(m_processing_popup); + if (!cancel_button) { + BROWSER_LOGE("elm_button_add failed"); + return; + } + elm_object_text_set(cancel_button, BR_STRING_CANCEL); + elm_object_part_content_set(m_processing_popup, "button1", cancel_button); + evas_object_smart_callback_add(cancel_button, "clicked", __select_processing_popup_response_cb, this); + + evas_object_show(m_processing_popup); + + Eina_Bool check_value = elm_check_state_get(m_edit_mode_select_all_check_button); + m_select_all_check_value = check_value; + + if (check_value) + elm_check_state_set(m_edit_mode_select_all_check_button, !check_value); +} + +void Browser_History_Layout::__select_processing_popup_response_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_History_Layout *history_layout = (Browser_History_Layout *)data; + + evas_object_del(history_layout->m_processing_popup); + + history_layout->m_processing_progress_bar = NULL; + history_layout->m_processed_it = NULL; + + if (history_layout->m_processing_popup_timer) { + ecore_timer_del(history_layout->m_processing_popup_timer); + history_layout->m_processing_popup_timer = NULL; + } + + Elm_Object_Item *it = elm_genlist_first_item_get(history_layout->m_history_genlist); + int check_count = 0; + while (it) { + Browser_History_DB::history_item *item = NULL; + item = (Browser_History_DB::history_item *)elm_object_item_data_get(it); + if (item) { + if(item->is_delete && elm_genlist_item_select_mode_get(it) != ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY) + check_count++; + } + it = elm_genlist_item_next_get(it); + } + + history_layout->_delete_date_only_label_genlist_item(); + + if (check_count) + elm_object_item_disabled_set(m_data_manager->get_bookmark_view()->m_bookmark_delete_controlbar_item, EINA_FALSE); + else + elm_object_item_disabled_set(m_data_manager->get_bookmark_view()->m_bookmark_delete_controlbar_item, EINA_TRUE); +} + +Eina_Bool Browser_History_Layout::__select_processing_popup_timer_cb(void *data) +{ + if (!data) + return ECORE_CALLBACK_CANCEL; + + Browser_History_Layout *history_layout = (Browser_History_Layout *)data; + Evas_Object* progress_bar = history_layout->m_processing_progress_bar; + + Eina_Bool check_value = history_layout->m_select_all_check_value; + + double value = elm_progressbar_value_get(progress_bar); + if (value >= 1.0) { + __select_processing_popup_response_cb(history_layout, NULL, NULL); + + history_layout->m_processing_popup_timer = NULL; + elm_check_state_set(history_layout->m_edit_mode_select_all_check_button, !check_value); + history_layout->_show_selection_info(); + + return ECORE_CALLBACK_CANCEL; + } + + while (history_layout->m_processed_it) { + Browser_History_DB::history_item *item = NULL; + item = (Browser_History_DB::history_item *)elm_object_item_data_get(history_layout->m_processed_it); + if (item && (elm_genlist_item_select_mode_get(history_layout->m_processed_it) != ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY)) { + item->is_delete = !check_value; + elm_genlist_item_update(history_layout->m_processed_it); + history_layout->m_processed_count++; + } + history_layout->m_processed_it = elm_genlist_item_next_get(history_layout->m_processed_it); + + if (history_layout->m_processed_count % 30 == 0) + break; + } + + elm_progressbar_value_set(history_layout->m_processing_progress_bar, + (float)((float)history_layout->m_processed_count / (float)(history_layout->m_history_list.size()))); + + char progress_text[20] = {0, }; + snprintf(progress_text, sizeof(progress_text) - 1, "%d / %d", + history_layout->m_processed_count, history_layout->m_history_list.size()); + + edje_object_part_text_set(elm_layout_edje_get(history_layout->m_processing_popup_layout), + "elm.text.right", progress_text); + + return ECORE_CALLBACK_RENEW; +} + +void Browser_History_Layout::__edit_mode_select_all_check_changed_cb(void *data, + Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_History_Layout *history_layout = (Browser_History_Layout *)data; + Eina_Bool value = elm_check_state_get(obj); + + if (history_layout->m_history_list.size() >= BROWSER_BOOKMARK_PROCESS_BLOCK_COUNT) { + elm_check_state_set(obj, !value); + history_layout->_show_select_processing_popup(); + } else { + Elm_Object_Item *it = elm_genlist_first_item_get(history_layout->m_history_genlist); + while (it) { + Browser_History_DB::history_item *item = NULL; + item = (Browser_History_DB::history_item *)elm_object_item_data_get(it); + if (item) { + if (elm_genlist_item_select_mode_get(it) != ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY) { + item->is_delete = value; + elm_genlist_item_update(it); + } + } + it = elm_genlist_item_next_get(it); + } + + history_layout->_show_selection_info(); + } +} + +void Browser_History_Layout::__edit_mode_select_all_clicked_cb(void *data, Evas *evas, + Evas_Object *obj, void *event_info) +{ + if (!data) + return; + + Browser_History_Layout *history_layout = (Browser_History_Layout *)data; + + if (history_layout->m_history_list.size() >= BROWSER_BOOKMARK_PROCESS_BLOCK_COUNT) { + history_layout->_show_select_processing_popup(); + } else { + Eina_Bool value = elm_check_state_get(history_layout->m_edit_mode_select_all_check_button); + elm_check_state_set(history_layout->m_edit_mode_select_all_check_button, !value); + + Elm_Object_Item *it = elm_genlist_first_item_get(history_layout->m_history_genlist); + while (it) { + Browser_History_DB::history_item *item = NULL; + item = (Browser_History_DB::history_item *)elm_object_item_data_get(it); + if (item) { + /* Ignore the date label. */ + if (elm_genlist_item_select_mode_get(it) != ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY) { + item->is_delete = !value; + elm_genlist_item_update(it); + } + } + it = elm_genlist_item_next_get(it); + } + + history_layout->_show_selection_info(); + } +} + +void Browser_History_Layout::__history_item_clicked_cb(void *data, Evas_Object *obj, void *eventInfo) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_History_Layout *history_layout = (Browser_History_Layout *)data; + + Elm_Object_Item *seleted_item = elm_genlist_selected_item_get(obj); + Elm_Object_Item *index_item = elm_genlist_first_item_get(obj); + int index = 0; + + if (!elm_genlist_decorate_mode_get(obj)) { + /* calculate the index of the selected item */ + while (index_item != seleted_item) { + /* Do not count date label item */ + if (elm_genlist_item_select_mode_get(index_item) != ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY) + index++; + + index_item = elm_genlist_item_next_get(index_item); + } + + const char *selected_url = NULL; + if (history_layout->m_searched_history_genlist == obj) + selected_url = history_layout->m_searched_history_item_list[index]->url.c_str(); + else + selected_url = history_layout->m_history_list[index]->url.c_str(); + + m_data_manager->get_bookmark_view()->history_item_clicked(selected_url); + } else { + Browser_History_DB::history_item *item = NULL; + item = (Browser_History_DB::history_item *)elm_object_item_data_get(seleted_item); + if (item && elm_genlist_item_select_mode_get(seleted_item) != ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY) { + item->is_delete = !(item->is_delete); + elm_genlist_item_update(seleted_item); + } + elm_genlist_item_selected_set(seleted_item, EINA_FALSE); + + int selected_count = 0; + int total_count = 0; + Elm_Object_Item *it = elm_genlist_first_item_get(history_layout->m_history_genlist); + while(it) { + item = (Browser_History_DB::history_item *)elm_object_item_data_get(it); + if (elm_genlist_item_select_mode_get(it) != ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY) { + if (item->is_delete) + selected_count++; + total_count++; + } + it = elm_genlist_item_next_get(it); + } + + if (selected_count == total_count) + elm_check_state_set(history_layout->m_edit_mode_select_all_check_button, EINA_TRUE); + else + elm_check_state_set(history_layout->m_edit_mode_select_all_check_button, EINA_FALSE); + + history_layout->_show_selection_info(); + } +} + +void Browser_History_Layout::_delete_selected_history(void) +{ + BROWSER_LOGD("[%s]", __func__); + + Elm_Object_Item *it = elm_genlist_first_item_get(m_history_genlist); + int delete_item_count = 0; + Browser_History_DB::history_item *item = NULL; + while (it) { + item = (Browser_History_DB::history_item *)elm_object_item_data_get(it); + if ((elm_genlist_item_select_mode_get(it) != ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY) && item->is_delete) { + delete_item_count++; + } + it = elm_genlist_item_next_get(it); + } + + if (delete_item_count >= BROWSER_BOOKMARK_PROCESS_BLOCK_COUNT) { + _show_delete_processing_popup(); + } else { + Eina_List *delete_item_list = NULL; + it = elm_genlist_first_item_get(m_history_genlist); + int remain_count = 0; + Browser_History_DB::history_item *item = NULL; + + while (it) { + item = (Browser_History_DB::history_item *)elm_object_item_data_get(it); + if (elm_genlist_item_select_mode_get(it) != ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY) { + if (item->is_delete) + delete_item_list = eina_list_append(delete_item_list, it); + else + remain_count++; + } + it = elm_genlist_item_next_get(it); + } + + int count = eina_list_count(delete_item_list); + for (int i = 0; i < count; i++) { + it = (Elm_Object_Item *)eina_list_data_get(delete_item_list); + item = (Browser_History_DB::history_item *)elm_object_item_data_get(it); + /* Delete history item */ + Eina_Bool ret = m_data_manager->get_history_db()->delete_history(item->id); + if (!ret) + BROWSER_LOGD("history [%s] delete failed", item->title.c_str()); + + delete_item_list = eina_list_next(delete_item_list); + + for(int index = 0 ; index < m_history_list.size() ; index++) { + if (m_history_list[index]->id == item->id) { + delete m_history_list[index]; + m_history_list.erase(m_history_list.begin() + index); + } + } + + elm_object_item_del(it); + } + eina_list_free(delete_item_list); + + elm_check_state_set(m_edit_mode_select_all_check_button, EINA_FALSE); + + _delete_date_only_label_genlist_item(); + + if (remain_count == 0) { + elm_box_unpack_all(m_content_box); + elm_genlist_clear(m_history_genlist); + evas_object_hide(m_history_genlist); + + if (m_edit_mode_select_all_layout) { + evas_object_del(m_edit_mode_select_all_layout); + m_edit_mode_select_all_layout = NULL; + } + if (m_edit_mode_select_all_check_button) { + evas_object_del(m_edit_mode_select_all_check_button); + m_edit_mode_select_all_check_button = NULL; + } + + m_no_history_label = elm_label_add(m_searchbar_layout); + if (!m_no_history_label) { + BROWSER_LOGE("elm_label_add failed"); + return; + } + + std::string text = std::string("<color='#646464'>") + std::string(BR_STRING_NO_HISTORY); + elm_object_text_set(m_no_history_label, text.c_str()); + evas_object_show(m_no_history_label); + elm_box_pack_start(m_content_box, m_no_history_label); + + Browser_Bookmark_View *bookmark_view = m_data_manager->get_bookmark_view(); + if (!bookmark_view->_set_controlbar_type(Browser_Bookmark_View::HISTORY_VIEW_DEFAULT)) + BROWSER_LOGE("_set_controlbar_type failed"); + + elm_object_item_disabled_set(bookmark_view->m_bookmark_edit_controlbar_item, EINA_TRUE); + } + + show_notify_popup(BR_STRING_DELETED, 3, EINA_TRUE); + } +} + +void Browser_History_Layout::_reload_history_genlist(void) +{ + Elm_Object_Item *it = NULL; + while (it = elm_genlist_first_item_get(m_history_genlist)) + elm_object_item_del(it); + + for(int i = 0 ; i < m_history_list.size() ; i++ ) { + if (m_history_list[i]) + delete m_history_list[i]; + } + elm_box_unpack_all(m_content_box); + m_history_list.clear(); + + for(int i = 0 ; i < m_history_date_label_list.size() ; i++ ) { + if (m_history_date_label_list[i]) + free(m_history_date_label_list[i]); + } + m_history_date_label_list.clear(); + + Eina_Bool ret = m_data_manager->get_history_db()->get_history_list(m_history_list); + if (!ret) + BROWSER_LOGE("get_history_list failed"); + + unsigned int history_count = m_history_list.size(); + BROWSER_LOGD("history_count=%d", history_count); + + Date date; + for(int i = 0 ; i < history_count; i++) { + sscanf(m_history_list[i]->date.c_str(), "%d-%d-%d", &date.year, &date.month, &date.day); + m_history_list[i]->user_data = (void *)this; + if (m_last_date != date) { + m_last_date = date; + char *labe_item = strdup(m_history_list[i]->date.c_str()); + if (!labe_item) { + BROWSER_LOGE("strdup failed"); + return; + } + m_history_date_label_list.push_back(labe_item); + it = elm_genlist_item_append(m_history_genlist, &m_history_group_title_class, + labe_item, NULL, ELM_GENLIST_ITEM_GROUP, NULL, NULL); + + elm_genlist_item_select_mode_set(it, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY); + } + elm_genlist_item_append(m_history_genlist, &m_history_genlist_item_class, m_history_list[i], it, + ELM_GENLIST_ITEM_NONE, __history_item_clicked_cb, this); + } + + if (m_no_history_label) { + evas_object_del(m_no_history_label); + m_no_history_label = NULL; + } + + if (m_edit_mode_select_all_check_button) { + evas_object_del(m_edit_mode_select_all_check_button); + m_edit_mode_select_all_check_button = NULL; + } + + if (m_edit_mode_select_all_layout) { + evas_object_del(m_edit_mode_select_all_layout); + m_edit_mode_select_all_layout = NULL; + } + + if (m_history_list.size() == 0) { + evas_object_hide(m_history_genlist); + + m_no_history_label = elm_label_add(m_searchbar_layout); + if (!m_no_history_label) { + BROWSER_LOGE("elm_label_add failed"); + return; + } + + std::string text = std::string("<color='#646464'>") + std::string(BR_STRING_NO_HISTORY); + elm_object_text_set(m_no_history_label, text.c_str()); + evas_object_show(m_no_history_label); + elm_box_pack_start(m_content_box, m_no_history_label); + + Browser_Bookmark_View *bookmark_view = m_data_manager->get_bookmark_view(); + if (!bookmark_view->_set_controlbar_type(Browser_Bookmark_View::HISTORY_VIEW_DEFAULT)) + BROWSER_LOGE("_set_controlbar_type failed"); + elm_object_item_disabled_set(bookmark_view->m_bookmark_edit_controlbar_item, EINA_TRUE); + } else { + elm_box_pack_start(m_content_box, m_history_genlist); + evas_object_show(m_history_genlist); + + Browser_Bookmark_View *bookmark_view = m_data_manager->get_bookmark_view(); + elm_object_item_disabled_set(bookmark_view->m_bookmark_edit_controlbar_item, EINA_FALSE); + } +} + +Eina_Bool Browser_History_Layout::_create_main_layout(void) +{ + BROWSER_LOGD("[%s]", __func__); + elm_object_style_set(m_bg, "default"); + + m_searchbar_layout = elm_layout_add(m_navi_bar); + if (!m_searchbar_layout) { + BROWSER_LOGE("elm_layout_add failed"); + return EINA_FALSE; + } + + _enable_searchbar_layout(EINA_TRUE); + + evas_object_show(m_searchbar_layout); + + m_content_box = elm_box_add(m_searchbar_layout); + if (!m_content_box) { + BROWSER_LOGE("elm_box_add failed"); + return EINA_FALSE; + } + + m_history_genlist = _create_history_genlist(); + if (!m_history_genlist) { + BROWSER_LOGE("_create_history_genlist failed"); + return EINA_FALSE; + } + + m_history_genlist_item_class.item_style = "2text.1icon.4"; + m_history_genlist_item_class.decorate_all_item_style = "edit_default"; + m_history_genlist_item_class.func.text_get = __genlist_label_get_cb; + m_history_genlist_item_class.func.content_get = __genlist_icon_get_cb; + m_history_genlist_item_class.func.state_get = NULL; + m_history_genlist_item_class.func.del = NULL; + + m_history_group_title_class.item_style = "grouptitle"; + m_history_group_title_class.func.text_get = __genlist_date_label_get_cb; + m_history_group_title_class.func.content_get = NULL; + m_history_group_title_class.func.state_get = NULL; + m_history_group_title_class.func.del = NULL; + + _reload_history_genlist(); + + evas_object_show(m_content_box); + elm_object_part_content_set(m_searchbar_layout, "elm.swallow.content", m_content_box); + + return EINA_TRUE; +} + +Evas_Object *Browser_History_Layout::_show_delete_confirm_popup(void) +{ + BROWSER_LOGD("[%s]", __func__); + + m_delete_confirm_popup = elm_popup_add(m_navi_bar); + if (!m_delete_confirm_popup) { + BROWSER_LOGE("elm_popup_add failed"); + return NULL; + } + + evas_object_size_hint_weight_set(m_delete_confirm_popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_object_text_set(m_delete_confirm_popup, BR_STRING_DELETE_Q); + + Evas_Object *ok_button = elm_button_add(m_delete_confirm_popup); + elm_object_text_set(ok_button, BR_STRING_YES); + elm_object_part_content_set(m_delete_confirm_popup, "button1", ok_button); + + Evas_Object *cancel_button = elm_button_add(m_delete_confirm_popup); + elm_object_text_set(cancel_button, BR_STRING_NO); + elm_object_part_content_set(m_delete_confirm_popup, "button2", cancel_button); + evas_object_smart_callback_add(cancel_button, "clicked", __cancel_confirm_response_by_slide_button_cb, + m_delete_confirm_popup); + + evas_object_show(m_delete_confirm_popup); + + return ok_button; +} +char *Browser_History_Layout::__genlist_label_get_cb(void *data, Evas_Object *obj, const char *part) +{ + if (!data) + return NULL; + + Browser_History_DB::history_item *item = (Browser_History_DB::history_item *)data; + if (!item) + return NULL; + + char *mark_up = NULL; + + if (!strncmp(part, "elm.text.1", strlen("elm.text.1")) + || !strncmp(part, "elm.base.text", strlen("elm.base.text"))) + { + mark_up = elm_entry_utf8_to_markup(item->title.c_str()); + return mark_up; + } else if (!strncmp(part, "elm.text.2", strlen("elm.text.2"))) { + mark_up = elm_entry_utf8_to_markup(item->url.c_str()); + return mark_up; + } + + return NULL; +} + +char *Browser_History_Layout::__genlist_date_label_get_cb(void *data, Evas_Object *obj, const char *part) +{ + if (!data) + return NULL; + + char *date_label = (char *)data; + + if (!strncmp(part, "elm.text", strlen("elm.text"))) { + Date date; + char buffer[BROWSER_MAX_DATE_LEN] = {0, }; + + sscanf(date_label, "%d-%d-%d", + &date.year, &date.month, &date.day); +// BROWSER_LOGD("%d %d %d\n", date.day, date.month, date.year); + time_t raw_time; + struct tm *time_info; + time(&raw_time); + time_info = localtime(&raw_time); + int day_gap = -1; +// BROWSER_LOGD("\ncurrent time : %d %d %d\n", time_info->tm_mday, (time_info->tm_mon+1), (time_info->tm_year+1900)); + if (time_info->tm_year == date.year -1900 && time_info->tm_mon == date.month - 1) + day_gap = time_info->tm_mday - date.day; + else { + time_info->tm_year = date.year - 1900; + time_info->tm_mon = date.month - 1; + } + time_info->tm_mday = date.day; + mktime(time_info); + + if (day_gap == 0) + strftime (buffer, BROWSER_MAX_DATE_LEN, "Today (%a, %b %d %Y)", time_info); + else if (day_gap == 1) + strftime (buffer, 40, "Yesterday (%a, %b %d %Y)", time_info); + else + strftime (buffer, 40, "%a, %b %d %Y", time_info); + return strdup(buffer); + } + return NULL; +} + +void Browser_History_Layout::__delete_confirm_response_by_edit_mode_cb(void *data, Evas_Object *obj, + void *event_info) +{ + BROWSER_LOGD("event_info = %d", (int)event_info); + + if (!data) + return; + + Browser_History_Layout *history_layout = (Browser_History_Layout *)data; + + if (history_layout->m_delete_confirm_popup) { + evas_object_del(history_layout->m_delete_confirm_popup); + history_layout->m_delete_confirm_popup = NULL; + } + + history_layout->_delete_selected_history(); + + history_layout->_set_edit_mode(EINA_FALSE); +} +void Browser_History_Layout::__cancel_confirm_response_by_slide_button_cb(void *data, Evas_Object *obj, + void *event_info) +{ + BROWSER_LOGD("event_info = %d", (int)event_info); + + if (!data) + return; + + Evas_Object *popup = (Evas_Object *)data; + evas_object_del(popup); +} + +void Browser_History_Layout::_delete_date_only_label_genlist_item(void) +{ + BROWSER_LOGD("[%s]", __func__); + + Elm_Object_Item *it = elm_genlist_first_item_get(m_history_genlist); + /* Remove date only label item */ + while (it) { + if (elm_genlist_item_select_mode_get(it) == ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY) { + Elm_Object_Item *tmp_it = elm_genlist_item_next_get(it); + if (!tmp_it || elm_genlist_item_select_mode_get(tmp_it) == ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY) { + tmp_it = it; + it = elm_genlist_item_next_get(it); + elm_object_item_del(tmp_it); + continue; + } + } + it = elm_genlist_item_next_get(it); + } +} + +Evas_Object *Browser_History_Layout::__genlist_icon_get_cb(void *data, Evas_Object *obj, const char *part) +{ + if (!data || !part) + return NULL; + + Browser_History_DB::history_item *item = (Browser_History_DB::history_item *)data; + Browser_History_Layout *history_layout = (Browser_History_Layout *)item->user_data; + if (!history_layout) + return NULL; + + if (!strncmp(part, "elm.icon", strlen("elm.icon"))) { + Evas_Object *favicon = NULL; + favicon = m_data_manager->get_browser_view()->get_favicon(item->url.c_str()); + if (favicon) + return favicon; + else { + Evas_Object *default_favicon = elm_icon_add(obj); + if (!default_favicon) { + BROWSER_LOGE("elm_icon_add is failed"); + return NULL; + } + elm_icon_file_set(default_favicon, BROWSER_IMAGE_DIR"/faviconDefault.png", NULL); + evas_object_size_hint_aspect_set(default_favicon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); + return default_favicon; + } + } else if (!strncmp(part, "elm.edit.icon.1", strlen("elm.edit.icon.1"))) { + if (elm_genlist_decorate_mode_get(obj)) { + Evas_Object *check_button = elm_check_add(obj); + if (!check_button) { + BROWSER_LOGE("elm_check_add is failed"); + return NULL; + } + elm_check_state_pointer_set(check_button, &(item->is_delete)); + elm_check_state_set(check_button, item->is_delete); + evas_object_smart_callback_add(check_button, "changed", __edit_mode_item_check_changed_cb, item); + return check_button; + } + } + + return NULL; +} + +void Browser_History_Layout::__edit_mode_item_check_changed_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + Browser_History_DB::history_item *item = (Browser_History_DB::history_item *)data; + Browser_History_Layout *history_layout = (Browser_History_Layout *)(item->user_data); + int selected_count = 0; + int total_count = 0; + Elm_Object_Item *it = elm_genlist_first_item_get(history_layout->m_history_genlist); + while(it) { + Browser_History_DB::history_item *item = NULL; + item = (Browser_History_DB::history_item *)elm_object_item_data_get(it); + + /* Ignore the date label. */ + if (elm_genlist_item_select_mode_get(it) != ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY) { + total_count++; + if (item->is_delete) + selected_count++; + } + it = elm_genlist_item_next_get(it); + } + + if (total_count == selected_count) + elm_check_state_set(history_layout->m_edit_mode_select_all_check_button, EINA_TRUE); + else + elm_check_state_set(history_layout->m_edit_mode_select_all_check_button, EINA_FALSE); + + history_layout->_show_selection_info(); +} + +Evas_Object *Browser_History_Layout::_create_history_genlist(void) +{ + BROWSER_LOGD("[%s]", __func__); + Evas_Object *genlist = elm_genlist_add(m_searchbar_layout); + if (genlist) { + evas_object_size_hint_weight_set(genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(genlist, EVAS_HINT_FILL, EVAS_HINT_FILL); + } + + return genlist; +} + diff --git a/src/browser-history/browser-history-layout.h b/src/browser-history/browser-history-layout.h new file mode 100755 index 00000000..c024a0a8 --- /dev/null +++ b/src/browser-history/browser-history-layout.h @@ -0,0 +1,122 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef BROWSER_HISTORY_LAYOUT_H +#define BROWSER_HISTORY_LAYOUT_H + +#include "browser-common-view.h" +#include "browser-config.h" +#include "browser-history-db.h" +#include "browser-bookmark-view.h" + +class Date { +public: + int year; + int month; + int day; + + Date(); + Date(Date &date); + void operator=(Date &date); + bool operator==(Date &date); + bool operator!=(Date &date); +}; + +class Browser_History_Layout : public Browser_Common_View { + friend class Browser_Bookmark_View; +public: + Browser_History_Layout(void); + ~Browser_History_Layout(void); + + Eina_Bool init(void); + Evas_Object *get_main_layout(void) { return m_searchbar_layout; } +protected: + void _set_edit_mode(Eina_Bool edit_mode); + +private: + typedef struct _history_date_param { + Date date; + Browser_History_Layout *history_layout; + } history_date_param; + + Eina_Bool _create_main_layout(void); + Evas_Object *_create_history_genlist(void); + void _reload_history_genlist(void); + void _show_selection_info(void); + void _delete_selected_history(void); + Evas_Object *_show_delete_confirm_popup(void); + void _show_select_processing_popup(void); + void _show_delete_processing_popup(void); + void _enable_searchbar_layout(Eina_Bool enable); + Eina_Bool _show_searched_history(const char *search_text); + void _delete_date_only_label_genlist_item(void); + + /* elementary event callback functions. */ + static void __history_item_clicked_cb(void *data, Evas_Object *obj, void *eventInfo); + static void __edit_mode_item_check_changed_cb(void *data, Evas_Object *obj, void *event_info); + static void __edit_mode_select_all_check_changed_cb(void *data, Evas_Object *obj, void *event_info); + static void __delete_confirm_response_by_edit_mode_cb(void *data, Evas_Object *obj, void *event_info); + static void __cancel_confirm_response_by_slide_button_cb(void *data, Evas_Object *obj, void *event_info); + static void __select_processing_popup_response_cb(void *data, Evas_Object *obj, void *event_info); + static void __delete_processing_popup_response_cb(void *data, Evas_Object *obj, void *event_info); + static void __search_delay_changed_cb(void *data, Evas_Object *obj, void *event_info); + + /* evas object event callback functions */ + static void __edit_mode_select_all_clicked_cb(void *data, Evas *evas, Evas_Object *obj, void *event_info); + + /* genlist callback functions. */ + static char *__genlist_label_get_cb(void *data, Evas_Object *obj, const char *part); + static char *__genlist_date_label_get_cb(void *data, Evas_Object *obj, const char *part); + static Evas_Object *__genlist_icon_get_cb(void *data, Evas_Object *obj, const char *part); + + /* ecore timer callback functions */ + static Eina_Bool __select_processing_popup_timer_cb(void *data); + static Eina_Bool __delete_processing_popup_timer_cb(void *data); + + history_date_param m_date_param; + Elm_Genlist_Item_Class m_history_genlist_item_class; + Elm_Genlist_Item_Class m_history_group_title_class; + + Evas_Object *m_searchbar_layout; + Evas_Object *m_searchbar; + Evas_Object *m_history_genlist; + Evas_Object *m_searched_history_genlist; + Evas_Object *m_no_content_search_result; + Evas_Object *m_content_box; + Evas_Object *m_edit_mode_select_all_layout; + Evas_Object *m_edit_mode_select_all_check_button; + Evas_Object *m_no_history_label; + + vector<Browser_History_DB::history_item *> m_history_list; + vector<char *> m_history_date_label_list; + vector<Browser_History_DB::history_item *> m_searched_history_item_list; + vector<char *> m_searched_history_date_label_list; + Date m_last_date; + + /* For select all processing popup. */ + Evas_Object *m_processing_progress_bar; + Ecore_Timer *m_processing_popup_timer; + Elm_Object_Item *m_processed_it; + int m_processed_count; + Evas_Object *m_processing_popup; + Evas_Object *m_processing_popup_layout; + Eina_Bool m_select_all_check_value; + int m_total_item_count; + + Evas_Object *m_delete_confirm_popup; +}; +#endif /* BROWSER_HISTORY_LAYOUT_H */ + diff --git a/src/browser-main.cpp b/src/browser-main.cpp new file mode 100755 index 00000000..dd2d53c6 --- /dev/null +++ b/src/browser-main.cpp @@ -0,0 +1,459 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +extern "C" { +#include <ITapiSat.h> +} + +#include <sys/utsname.h> + +#include "browser-class.h" +#include "browser-config.h" + +using namespace std; + +struct browser_data { + Evas_Object *main_win; + Evas_Object *bg; + Evas_Object *main_layout; + Evas_Object *navi_bar; + Elm_Theme *browser_theme; + + Browser_Class *browser_instance; +}; + +static void __br_set_env(void) +{ + /* enable gl */ + if (!getenv("ELM_ENGINE")) { + if (setenv("ELM_ENGINE", "gl", 1)) + BROWSER_LOGD("ELM_ENGINE's value is overwrited"); + } + + /* set image cache suze */ + if (setenv("ELM_IMAGE_CACHE", "0", 1)) + BROWSER_LOGD("ELM_IMAGE_CACHE is set to 1MB"); + + /* This is because of showing navigation bar more quickly. */ + if (setenv("ELM_BRING_IN_SCROLL_FRICTION", "0.2", 1)) + BROWSER_LOGD("ELM_BRING_IN_SCROLL_FRICTION is set"); + + if (setenv("ELM_PAGE_SCROLL_FRICTION", "0.4", 1)) + BROWSER_LOGD("ELM_PAGE_SCROLL_FRICTION is set"); + + if (setenv("ELM_THUMBSCROLL_BOUNCE_FRICTION", "0.2", 1)) + BROWSER_LOGD("ELM_THUMBSCROLL_BOUNCE_FRICTION is set"); +} + +static void __br_destroy(void *data) +{ + BROWSER_LOGD("[%s]", __func__); + elm_exit(); +} + +static void __main_win_del_cb(void *data, Evas_Object *obj, void *event) +{ + BROWSER_LOGD("<< window delete callback [%d]>>", appcore_measure_time()); +} + +static Evas_Object *__create_main_win(void *app_data) +{ + Evas_Object *window = elm_win_add(NULL, BROWSER_PACKAGE_NAME, ELM_WIN_BASIC); + if (window) { + int w; + int h; + elm_win_title_set(window, BROWSER_PACKAGE_NAME); + elm_win_borderless_set(window, EINA_TRUE); + elm_win_conformant_set(window, EINA_TRUE); + evas_object_smart_callback_add(window, "delete,request", + __main_win_del_cb, app_data); + ecore_x_window_size_get(ecore_x_window_root_first_get(), + &w, &h); + evas_object_resize(window, w, h); + elm_win_indicator_mode_set(window, ELM_WIN_INDICATOR_SHOW); + evas_object_show(window); + } + + return window; +} + +static Evas_Object *__create_bg(Evas_Object *win) +{ + Evas_Object *bg; + bg = elm_bg_add(win); + if (!bg) + return NULL; + + evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_win_resize_object_add(win, bg); + evas_object_show(bg); + + return bg; +} + +static Evas_Object *__create_main_layout(Evas_Object *win) +{ + Evas_Object *layout; + layout = elm_layout_add(win); + if (!layout) + return NULL; + + if (!elm_layout_theme_set(layout, "layout", "application", "default")) + BROWSER_LOGE("elm_layout_theme_set is failed.\n"); + + evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_win_resize_object_add(win, layout); + edje_object_signal_emit(elm_layout_edje_get(layout), "elm,state,show,indicator", "elm"); + evas_object_show(layout); + + return layout; +} + +static Evas_Object *__create_navi_bar(void *app_data) +{ + BROWSER_LOGD("[%s]", __func__); + Evas_Object *navi_bar; + struct browser_data *ad = (struct browser_data *)app_data; + navi_bar = elm_naviframe_add(ad->main_layout); + if (navi_bar) { + elm_object_theme_set(navi_bar, ad->browser_theme); + elm_object_style_set(navi_bar, "browser"); + elm_object_part_content_set(ad->main_layout, "elm.swallow.content", navi_bar); + evas_object_show(navi_bar); + } + + return navi_bar; +} + +static Eina_Bool __process_app_service(bundle *b, void *app_data) +{ + BROWSER_LOGD("[%s]", __func__); + struct browser_data *ad = (struct browser_data *)app_data; + + const char *operation = appsvc_get_operation(b); + const char *request_uri = appsvc_get_uri(b); + const char *request_mime_type = appsvc_get_mime(b); + + if (!operation && !request_uri && !request_mime_type) { + BROWSER_LOGD("Not app svc"); + return EINA_FALSE; + } + + BROWSER_LOGD("operation[%s], request_uri[%s], request_mime_type[%s]", operation, request_uri, request_mime_type); + + std::string full_path; + + if (request_mime_type) { + if (!strncmp(request_mime_type, "http.uri", strlen("http.uri")) + || !strncmp(request_mime_type, "file.uri", strlen("file.uri"))) { + if (request_uri) + full_path = std::string(request_uri); + } else if (!strncmp(request_mime_type, "application/x-shockwave-flash", strlen("application/x-shockwave-flash")) + || !strncmp(request_mime_type, "image/svg+xml", strlen("image/svg+xml")) + || !strncmp(request_mime_type, "text/html", strlen("text/html")) + || !strncmp(request_mime_type, "application/xml", strlen("application/xml"))) { + if (request_uri) + full_path = "file://" + std::string(request_uri); + } + } else if (request_uri) { + full_path = std::string(request_uri); + } + + BROWSER_LOGD("url=[%s]", full_path.c_str()); + + if (ad->main_win) + elm_win_activate(ad->main_win); + + ad->browser_instance->launch(full_path.c_str(), EINA_TRUE); + + return EINA_TRUE; +} + +static void __br_load_url(bundle *b, void *app_data) +{ + BROWSER_LOGD("[%s]", __func__); + struct browser_data *ad = (struct browser_data *)app_data; + + if (__process_app_service(b, app_data)) { + BROWSER_LOGD("app service"); + return; + } + + std::string full_path; + const char *mime_type = bundle_get_val(b, AUL_K_MIME_TYPE); + const char *content_url = bundle_get_val(b, AUL_K_MIME_CONTENT); + const char *search_keyword = bundle_get_val(b, "search_keyword"); + const char *goto_url = bundle_get_val(b, "goto_url"); + const char *url = bundle_get_val(b, "url"); + if (mime_type && content_url) { + BROWSER_LOGD("mime type=[%s], url=[%s]", mime_type, content_url); + if (!strcmp(mime_type, "http.uri") || !strcmp(mime_type, "file.uri")) { + full_path = content_url; + } else if (!strcmp(mime_type, "application/x-shockwave-flash") + || !strcmp(mime_type, "image/svg+xml") + || !strcmp(mime_type, "text/html") + || !strcmp(mime_type, "application/xml")) { + full_path = "file://" + std::string(content_url); + } + } else if (search_keyword) { + BROWSER_LOGD("search_keyword=[%s]", search_keyword); + if (search_keyword) { + char *search_url = vconf_get_str(SEARCHURL_KEY); + if (search_url) { + full_path = std::string(search_url) + std::string(search_keyword); + free(search_url); + } + } + } else if (goto_url || url) { + BROWSER_LOGD("goto_url=[%s], url=[%s]", goto_url, url); + if (goto_url) + full_path = goto_url; + else + full_path = url; + } + BROWSER_LOGD("url=[%s]", full_path.c_str()); + + if (ad->main_win) + elm_win_activate(ad->main_win); + + ad->browser_instance->launch(full_path.c_str(), EINA_TRUE); +} + +static Eina_Bool __br_keydown_event(void *data, int type, void *event) +{ + BROWSER_LOGD("[%s]", __func__); + Ecore_Event_Key *ev = (Ecore_Event_Key *)event; + + if (!strcmp(ev->keyname, KEY_END)) { + __br_destroy(data); + } + + return EXIT_FAILURE; +} + +static int __br_lang_changed_cb(void *data) +{ + BROWSER_LOGD("[%s]", __func__); + /* To do */ + return 0; +} + +static int __br_low_memory_cb(void* data) +{ + BROWSER_LOGD("[%s]", __func__); + /* To do */ + struct browser_data *ad = (struct browser_data *)data; + + if (ad && ad->browser_instance) + ad->browser_instance->clean_up_windows(); + + return 0; +} + +static void __br_register_system_event(void *app_data) +{ + struct browser_data *ad = (struct browser_data *)app_data; + + /* add system event callback */ + if (0 != appcore_set_event_callback(APPCORE_EVENT_LANG_CHANGE, __br_lang_changed_cb, ad)) + BROWSER_LOGE("appcore_set_event_callback is failed.\n"); + + if (0 != appcore_set_event_callback(APPCORE_EVENT_LOW_MEMORY, __br_low_memory_cb, ad)) + BROWSER_LOGE("appcore_set_event_callback is failed.\n"); + + ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, __br_keydown_event, ad); +} + +static int __br_app_create(void *app_data) +{ + BROWSER_LOGD("<< theme extenstion [%d]>>", appcore_measure_time()); + struct browser_data *ad = (struct browser_data *)app_data; + + ad->browser_theme = elm_theme_new(); + elm_theme_ref_set(ad->browser_theme, NULL); + elm_theme_extension_add(ad->browser_theme, BROWSER_NAVIFRAME_THEME); + elm_theme_extension_add(ad->browser_theme, BROWSER_CONTROLBAR_THEME); + elm_theme_extension_add(ad->browser_theme, BROWSER_BUTTON_THEME); + elm_theme_extension_add(ad->browser_theme, BROWSER_PROGRESSBAR_THEME); + elm_theme_extension_add(ad->browser_theme, BROWSER_URL_LAYOUT_THEME); + elm_theme_extension_add(ad->browser_theme, BROWSER_PREDICTIVE_HISTORY_THEME); + elm_theme_extension_add(ad->browser_theme, BROWSER_SETTINGS_THEME); + elm_theme_extension_add(ad->browser_theme, BROWSER_MOST_VISITED_SITES_THEME); + elm_theme_extension_add(ad->browser_theme, BROWSER_MOST_VISITED_THEME); + elm_theme_extension_add(ad->browser_theme, BROWSER_BOOKMARK_THEME); + elm_theme_extension_add(ad->browser_theme, BROWSER_FIND_WORD_LAYOUT_THEME); + + BROWSER_LOGD("<< create main window [%d]>>", appcore_measure_time()); + ad->main_win = __create_main_win(ad); + if (!ad->main_win) { + BROWSER_LOGE("fail to create window"); + return -1; + } + + BROWSER_LOGD("<< create background [%d]>>", appcore_measure_time()); + ad->bg = __create_bg(ad->main_win); + if (!ad->bg) { + BROWSER_LOGE("fail to create bg"); + return -1; + } + + BROWSER_LOGD("<< create layout main [%d]>>", appcore_measure_time()); + ad->main_layout = __create_main_layout(ad->main_win); + if (!ad->main_layout) { + BROWSER_LOGE("fail to create main layout"); + return -1; + } + + ad->navi_bar = __create_navi_bar(ad); + if (!ad->navi_bar) { + BROWSER_LOGE("fail to create navi bar"); + return -1; + } + + /* create browser instance & init */ + ad->browser_instance = new(nothrow) Browser_Class(ad->main_win, ad->navi_bar, ad->bg, ad->main_layout); + if (!ad->browser_instance) { + BROWSER_LOGE("fail to Browser_Class"); + return -1; + } + if (ad->browser_instance->init() == EINA_FALSE) { + BROWSER_LOGE("fail to browser init"); + return -1; + } + + /* init internationalization */ + int ret = appcore_set_i18n(BROWSER_PACKAGE_NAME, BROWSER_LOCALE_DIR); + if (ret) { + BROWSER_LOGE("fail to appcore_set_i18n"); + return -1; + } + + __br_register_system_event(ad); + + return 0; +} + +/* GCF test requirement */ +static void __send_termination_event_to_tapi(void) +{ + BROWSER_LOGD("[%s]", __func__); + int ret = TAPI_API_SUCCESS; + int request_id = -1; + TelSatEventDownloadReqInfo_t event_data; + event_data.eventDownloadType = TAPI_EVENT_SAT_DW_TYPE_BROWSER_TERMINATION; + event_data.u.browserTerminationEventReqInfo.browserTerminationCause = TAPI_SAT_BROWSER_TERMINATED_BY_USER; + + tel_init(); + tel_register_app_name((char*)"org.tizen.browser"); + tel_download_sat_event(&event_data, &request_id); + if(ret != TAPI_API_SUCCESS && ret != TAPI_API_SAT_EVENT_NOT_REQUIRED_BY_USIM) + BROWSER_LOGE("failed to tel_download_sat_event"); + + tel_deinit(); +} + +static int __br_app_terminate(void *app_data) +{ + BROWSER_LOGD("[%s]", __func__); + struct browser_data *ad = (struct browser_data *)app_data; + + elm_theme_extension_del(ad->browser_theme, BROWSER_NAVIFRAME_THEME); + elm_theme_extension_del(ad->browser_theme, BROWSER_CONTROLBAR_THEME); + elm_theme_extension_del(ad->browser_theme, BROWSER_BUTTON_THEME); + elm_theme_extension_del(ad->browser_theme, BROWSER_URL_LAYOUT_THEME); + elm_theme_extension_del(ad->browser_theme, BROWSER_PROGRESSBAR_THEME); + elm_theme_extension_del(ad->browser_theme, BROWSER_PREDICTIVE_HISTORY_THEME); + elm_theme_extension_del(ad->browser_theme, BROWSER_SETTINGS_THEME); + elm_theme_extension_del(ad->browser_theme, BROWSER_MOST_VISITED_SITES_THEME); + elm_theme_extension_del(ad->browser_theme, BROWSER_MOST_VISITED_THEME); + elm_theme_extension_del(ad->browser_theme, BROWSER_BOOKMARK_THEME); + elm_theme_extension_del(ad->browser_theme, BROWSER_FIND_WORD_LAYOUT_THEME); + elm_theme_free(ad->browser_theme); + + /* GCF test requirement */ + __send_termination_event_to_tapi(); + + if (ad->main_win); + evas_object_del(ad->main_win); + + if (ad->browser_instance) + delete ad->browser_instance; + + BROWSER_LOGD("<< __br_app_terminate ends [%d]>>", appcore_measure_time()); + return 0; +} + +static int __br_app_pause(void *app_data) +{ + BROWSER_LOGD("[%s]", __func__); + struct browser_data *ad = (struct browser_data *)app_data; + + if (!ad || !ad->browser_instance) + return 0; + + ad->browser_instance->pause(); + + return 0; +} + +static int __br_app_resume(void *app_data) +{ + BROWSER_LOGD("[%s]", __func__); + struct browser_data *ad = (struct browser_data *)app_data; + + if (!ad || !ad->browser_instance) + return 0; + + ad->browser_instance->resume(); + + return 0; +} + +static int __br_app_reset(bundle *b, void *app_data) +{ + struct browser_data *ad = (struct browser_data *)app_data; + BROWSER_LOGD("[%s]", __func__); + ad->browser_instance->reset(); + + __br_load_url(b, app_data); + + return 0; +} + +int main(int argc, char *argv[]) +{ + __br_set_env(); + + appcore_measure_start(); + + struct appcore_ops ops; + + ops.create = __br_app_create; + ops.terminate = __br_app_terminate; + ops.pause = __br_app_pause; + ops.resume = __br_app_resume; + ops.reset = __br_app_reset; + + struct browser_data ad; + memset(&ad, 0x0, sizeof(struct browser_data)); + + ops.data = &ad; + + int ret = appcore_efl_main(BROWSER_PACKAGE_NAME, &argc, &argv, &ops); + + return ret; +} + diff --git a/src/browser-multi-window/browser-multi-window-view.cpp b/src/browser-multi-window/browser-multi-window-view.cpp new file mode 100755 index 00000000..af41f279 --- /dev/null +++ b/src/browser-multi-window/browser-multi-window-view.cpp @@ -0,0 +1,1925 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "browser-class.h" +#include "browser-multi-window-view.h" +#include "browser-view.h" +#include "browser-window.h" + +Browser_Multi_Window_View::Browser_Multi_Window_View(void) +: + m_main_layout(NULL) + ,m_zoom_transit(NULL) + ,m_zoom_effect_image(NULL) + ,m_flip_effect_image(NULL) + ,m_zoom_move_transit(NULL) + ,m_scroll_move_transit(NULL) + ,m_scroller(NULL) + ,m_item_box(NULL) + ,m_close_multi_window_button(NULL) + ,m_new_window_button(NULL) + ,m_view_change_button(NULL) + ,m_dummy_front_item_layout(NULL) + ,m_dummy_end_item_layout(NULL) + ,m_dummy_front_item_snapshot(NULL) + ,m_dummy_end_item_snapshot(NULL) + ,m_select_item_index(0) + ,m_current_position_index(0) + ,m_page_control(NULL) + ,m_gengrid(NULL) + ,m_is_reodering(EINA_FALSE) + ,m_zoom_out_effect_idler(NULL) +{ + BROWSER_LOGD("[%s]", __func__); + memset(m_index_items, 0x00, sizeof(Elm_Object_Item *) * BROWSER_MULTI_WINDOW_MAX_COUNT); +} + +Browser_Multi_Window_View::~Browser_Multi_Window_View(void) +{ + BROWSER_LOGD("[%s]", __func__); + if (m_main_layout) { + evas_object_del(m_main_layout); + m_main_layout = NULL; + } + if (m_scroller) { + evas_object_del(m_scroller); + m_scroller = NULL; + } + if (m_item_box) { + evas_object_del(m_item_box); + m_item_box = NULL; + } + if (m_close_multi_window_button) { + evas_object_del(m_close_multi_window_button); + m_close_multi_window_button = NULL; + } + if (m_new_window_button) { + evas_object_del(m_new_window_button); + m_new_window_button = NULL; + } + if (m_dummy_front_item_layout) { + evas_object_del(m_dummy_front_item_layout); + m_dummy_front_item_layout = NULL; + } + if (m_dummy_end_item_layout) { + evas_object_del(m_dummy_end_item_layout); + m_dummy_end_item_layout = NULL; + } + if (m_dummy_front_item_snapshot) { + evas_object_del(m_dummy_front_item_snapshot); + m_dummy_front_item_snapshot = NULL; + } + if (m_dummy_end_item_snapshot) { + evas_object_del(m_dummy_end_item_snapshot); + m_dummy_end_item_snapshot = NULL; + } + if (m_page_control) { + evas_object_del(m_page_control); + m_page_control = NULL; + } + if (m_zoom_transit) { + elm_transit_del(m_zoom_transit); + m_zoom_transit = NULL; + } + if (m_zoom_effect_image) { + evas_object_del(m_zoom_effect_image); + m_zoom_effect_image = NULL; + } + if (m_flip_effect_image) { + evas_object_del(m_flip_effect_image); + m_flip_effect_image = NULL; + } + if (m_view_change_button) { + evas_object_del(m_view_change_button); + m_view_change_button = NULL; + } + if (m_zoom_move_transit) { + elm_transit_del(m_zoom_move_transit); + m_zoom_move_transit = NULL; + } + if (m_scroll_move_transit) { + elm_transit_del(m_scroll_move_transit); + m_scroll_move_transit = NULL; + } + if (m_zoom_out_effect_idler) { + ecore_idler_del(m_zoom_out_effect_idler); + m_zoom_out_effect_idler = NULL; + } + for (int i = 0 ; i < m_item_list.size() ; i++) { + if (m_item_list[i]) + evas_object_del(m_item_list[i]); + } + m_item_list.clear(); + + if (m_gengrid) { + evas_object_del(m_gengrid); + m_gengrid = NULL; + } +} + +Eina_Bool Browser_Multi_Window_View::init(void) +{ + BROWSER_LOGD("[%s]", __func__); + + if (!_create_main_layout()) { + BROWSER_LOGD("_create_main_layout failed"); + return EINA_FALSE; + } + + return EINA_TRUE; +} + +void Browser_Multi_Window_View::__zoom_out_finished_cb(void *data, Elm_Transit *transit) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_Multi_Window_View *multi_window_view = (Browser_Multi_Window_View *)data; + + if (!multi_window_view->m_zoom_transit) + return; + + multi_window_view->m_zoom_transit = NULL; + multi_window_view->m_zoom_move_transit = NULL; + + if (multi_window_view->m_zoom_effect_image) { + evas_object_del(multi_window_view->m_zoom_effect_image); + multi_window_view->m_zoom_effect_image = NULL; + } + if (multi_window_view->m_flip_effect_image) { + evas_object_del(multi_window_view->m_flip_effect_image); + multi_window_view->m_flip_effect_image = NULL; + } + + multi_window_view->__zoom_out_finished(); +} + +void Browser_Multi_Window_View::__zoom_out_finished(void) +{ + BROWSER_LOGD("[%s]", __func__); + int scroll_size = _get_scroll_page_size(); + int scroller_y = 0; + int scroller_w = 0; + int scroller_h = 0; + elm_scroller_region_get(m_scroller, NULL, &scroller_y, &scroller_w, &scroller_h); + elm_scroller_region_show(m_scroller, scroll_size * m_current_position_index, + scroller_y, scroller_w, scroller_h); + + for (int i = 0 ; i < m_item_list.size() ; i++) + evas_object_show(m_item_list[i]); + + Browser_View *browser_view = m_data_manager->get_browser_view(); + const char *title = browser_view->get_title().c_str(); + const char *url = browser_view->get_url().c_str(); + + if (!title || strlen(title) == 0) { + edje_object_part_text_set(elm_layout_edje_get(m_main_layout), "elm.title", BR_STRING_EMPTY_PAGE); + edje_object_part_text_set(elm_layout_edje_get(m_main_layout), "elm.url", ""); + } else { + edje_object_part_text_set(elm_layout_edje_get(m_main_layout), "elm.title", title); + edje_object_part_text_set(elm_layout_edje_get(m_main_layout), "elm.url", url); + } + + _show_grey_effect(); +} + +void Browser_Multi_Window_View::__zoom_in_finished_cb(void *data, Elm_Transit *transit) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_Multi_Window_View *multi_window_view = (Browser_Multi_Window_View *)data; + + if (!multi_window_view->m_zoom_transit) + return; + + multi_window_view->m_zoom_transit = NULL; + multi_window_view->m_zoom_move_transit = NULL; + + if (multi_window_view->m_zoom_effect_image) { + evas_object_del(multi_window_view->m_zoom_effect_image); + multi_window_view->m_zoom_effect_image = NULL; + } + if (multi_window_view->m_flip_effect_image) { + evas_object_del(multi_window_view->m_flip_effect_image); + multi_window_view->m_flip_effect_image = NULL; + } + + std::vector<Browser_Window *> window_list = m_browser->get_window_list(); + if (!window_list[multi_window_view->m_select_item_index]->m_ewk_view) { + Browser_Window *deleted_window = NULL; + deleted_window = m_browser->create_deleted_window(multi_window_view->m_select_item_index); + if (deleted_window) { + BROWSER_LOGD("************ deleted_window=%d", deleted_window); + for (int i = 0 ; i < window_list.size(); i++) + BROWSER_LOGD("************ window[%d]=%d", i, window_list[i]); + Browser_View *browser_view = m_data_manager->get_browser_view(); + m_browser->set_focused_window(deleted_window); + BROWSER_LOGD("*** load url=[%s]", deleted_window->m_url.c_str()); + browser_view->load_url(deleted_window->m_url.c_str()); + } + } else + m_browser->set_focused_window(window_list[multi_window_view->m_select_item_index]); + + __close_multi_window_button_clicked_cb(multi_window_view, NULL, NULL); +} + +/* zoom in effect when user selects mult window item. */ +Eina_Bool Browser_Multi_Window_View::_show_zoom_in_effect(Evas_Object *item) +{ + BROWSER_LOGD("[%s]", __func__); + if (m_zoom_transit) { + BROWSER_LOGE("transition is already running"); + return EINA_FALSE; + } + Browser_Window *focused_window = m_data_manager->get_browser_view()->m_focused_window; + + int ewk_view_current_y = 0; + evas_object_geometry_get(focused_window->m_ewk_view, NULL, &ewk_view_current_y, NULL, NULL); + + int index = 0; + for (index = 0 ; index < m_item_list.size() ; index++) { + if (m_item_list[index] == item) + break; + } + + evas_object_hide(item); + + /* Destroy most visited sites little eariler because of blinking issue. */ + Browser_View *browser_view = m_data_manager->get_browser_view(); + std::vector<Browser_Window *> window_list = m_browser->get_window_list(); + + int webview_x = 0; + int webview_y = 0; + int webview_w = 0; + int webview_h = 0; + evas_object_geometry_get(focused_window->m_ewk_view, &webview_x, &webview_y, + &webview_w, &webview_h); + + int snapshot_x = 0; + int snapshot_y = 0; + int snapshot_w = 0; + int snapshot_h = 0; + if (!is_landscape()) + evas_object_geometry_get(window_list[index]->m_portrait_snapshot_image, + &snapshot_x, &snapshot_y, &snapshot_w, &snapshot_h); + else + evas_object_geometry_get(window_list[index]->m_landscape_snapshot_image, + &snapshot_x, &snapshot_y, &snapshot_w, &snapshot_h); + + if (!window_list[index]->m_ewk_view || browser_view->get_url(window_list[index]).empty()) { + m_zoom_effect_image = evas_object_rectangle_add(evas_object_evas_get(m_navi_bar)); + if (!m_zoom_effect_image) { + BROWSER_LOGE("evas_object_rectangle_add failed"); + return EINA_FALSE; + } + evas_object_resize(m_zoom_effect_image, snapshot_w, snapshot_h); + evas_object_color_set(m_zoom_effect_image, 255, 255, 255, 255); + + m_flip_effect_image = evas_object_rectangle_add(evas_object_evas_get(m_navi_bar)); + if (!m_flip_effect_image) { + BROWSER_LOGE("evas_object_rectangle_add failed"); + return EINA_FALSE; + } + evas_object_resize(m_flip_effect_image, webview_w, webview_h); + evas_object_color_set(m_flip_effect_image, 255, 255, 255, 255); + } else { + m_zoom_effect_image = _capture_snapshot(window_list[index], + BROWSER_MULTI_WINDOW_ITEM_RATIO); + if (!m_zoom_effect_image) { + BROWSER_LOGE("_capture_snapshot failed"); + return EINA_FALSE; + } + + m_flip_effect_image = _capture_snapshot(window_list[index], 1.0); + if (!m_flip_effect_image) { + BROWSER_LOGE("_capture_snapshot failed"); + return EINA_FALSE; + } + } + evas_object_move(m_flip_effect_image, webview_x, webview_y); + + evas_object_move(m_zoom_effect_image, snapshot_x, snapshot_y); + evas_object_show(m_zoom_effect_image); + + /* m_zoom_effect_image is only for zoom out effect for the first time. */ + m_zoom_transit = elm_transit_add(); + if (!m_zoom_transit) { + BROWSER_LOGE("elm_transit_add failed"); + return EINA_FALSE; + } + /* Block event durring animation. */ + elm_transit_event_enabled_set(m_zoom_transit, EINA_TRUE); + + m_select_item_index = index; + + /* Without this code, the url is empty shortly when create deleted-window in multi window. */ + if (browser_view->get_url().empty() && !browser_view->m_focused_window->m_url.empty()) + browser_view->_set_url_entry(window_list[m_select_item_index]->m_url.c_str(), EINA_FALSE); + else + browser_view->_set_url_entry(browser_view->get_url(window_list[m_select_item_index]).c_str(), EINA_FALSE); + + elm_transit_object_add(m_zoom_transit, m_zoom_effect_image); + elm_transit_object_add(m_zoom_transit, m_flip_effect_image); + elm_transit_tween_mode_set(m_zoom_transit, ELM_TRANSIT_TWEEN_MODE_SINUSOIDAL); + elm_transit_objects_final_state_keep_set(m_zoom_transit, EINA_FALSE); + elm_transit_effect_resizable_flip_add(m_zoom_transit, ELM_TRANSIT_EFFECT_FLIP_AXIS_Y, EINA_TRUE); + elm_transit_duration_set(m_zoom_transit, 0.8); + elm_transit_del_cb_set(m_zoom_transit, __zoom_in_finished_cb, this); + elm_transit_go(m_zoom_transit); + + /* If the url bar in browser scroller is being displayed, + * the zoom animation should be move up because of the url bar gap. + * So add translation effect as well. */ + m_zoom_move_transit = elm_transit_add(); + if (!m_zoom_move_transit) { + BROWSER_LOGE("elm_transit_add failed"); + return EINA_FALSE; + } + /* Block event durring animation. */ + elm_transit_event_enabled_set(m_zoom_move_transit, EINA_TRUE); + + int browser_scroller_y = 0; + int url_layout_h = 0; + elm_scroller_region_get(browser_view->m_scroller, NULL, &browser_scroller_y, NULL, NULL); + evas_object_geometry_get(browser_view->m_url_layout, NULL, NULL, NULL, &url_layout_h); + + int scroller_y = 0; + evas_object_geometry_get(browser_view->m_scroller, NULL, &scroller_y, NULL, NULL); + + if (browser_scroller_y > url_layout_h) + browser_scroller_y = url_layout_h; + + elm_transit_object_add(m_zoom_move_transit, m_zoom_effect_image); + elm_transit_object_add(m_zoom_move_transit, m_flip_effect_image); + elm_transit_tween_mode_set(m_zoom_move_transit, ELM_TRANSIT_TWEEN_MODE_SINUSOIDAL); + elm_transit_objects_final_state_keep_set(m_zoom_move_transit, EINA_FALSE); + + elm_transit_effect_translation_add(m_zoom_move_transit, 0, 0, 0, + (url_layout_h - browser_scroller_y - scroller_y - (6 * elm_scale_get()))); + + elm_transit_duration_set(m_zoom_move_transit, 0.8); + elm_transit_go(m_zoom_move_transit); + + return EINA_TRUE; +} + +/* zoom out effect for the first time when user excutes multi window. */ +Eina_Bool Browser_Multi_Window_View::_show_zoom_out_effect(void) +{ + BROWSER_LOGD("[%s]", __func__); + Browser_Window *focused_window = m_data_manager->get_browser_view()->m_focused_window; + + int ewk_view_current_x = 0; + int ewk_view_current_y = 0; + int ewk_view_current_w = 0; + int ewk_view_current_h = 0; + evas_object_geometry_get(focused_window->m_ewk_view, &ewk_view_current_x, &ewk_view_current_y, + &ewk_view_current_w, &ewk_view_current_h); + + Browser_View *browser_view = m_data_manager->get_browser_view(); + + /* m_zoom_effect_image is only for zoom out effect for the first time. */ + m_zoom_transit = elm_transit_add(); + if (!m_zoom_transit) { + BROWSER_LOGE("elm_transit_add failed"); + return EINA_FALSE; + } + /* Block event durring animation. */ + elm_transit_event_enabled_set(m_zoom_transit, EINA_TRUE); + + int snapshot_w = 0; + int snapshot_h = 0; + evas_object_geometry_get(m_zoom_effect_image, NULL, NULL, &snapshot_w, &snapshot_h); + evas_object_move(m_zoom_effect_image, ewk_view_current_x, ewk_view_current_y); + + evas_object_show(m_zoom_effect_image); + + int current_snapshot_x = 0; + int current_snapshot_y = 0; + int current_snapshot_w = 0; + int current_snapshot_h = 0; + std::vector<Browser_Window *> window_list = m_browser->get_window_list(); + if (!is_landscape()) + evas_object_geometry_get(window_list[0]->m_portrait_snapshot_image, + ¤t_snapshot_x, ¤t_snapshot_y, ¤t_snapshot_w, ¤t_snapshot_h); + else + evas_object_geometry_get(window_list[0]->m_landscape_snapshot_image, + ¤t_snapshot_x, ¤t_snapshot_y, ¤t_snapshot_w, ¤t_snapshot_h); + + evas_object_move(m_flip_effect_image, current_snapshot_x, current_snapshot_y); + + BROWSER_LOGD("current_snapshot_x=%d, current_snapshot_y=%d", current_snapshot_x, current_snapshot_y); + BROWSER_LOGD("current_snapshot_w=%d, current_snapshot_h=%d", current_snapshot_w, current_snapshot_h); + + elm_transit_object_add(m_zoom_transit, m_zoom_effect_image); + elm_transit_object_add(m_zoom_transit, m_flip_effect_image); + elm_transit_tween_mode_set(m_zoom_transit, ELM_TRANSIT_TWEEN_MODE_SINUSOIDAL); + elm_transit_objects_final_state_keep_set(m_zoom_transit, EINA_FALSE); +// elm_transit_effect_zoom_add(m_zoom_transit, 1.0, BROWSER_MULTI_WINDOW_ITEM_RATIO); + elm_transit_effect_resizable_flip_add(m_zoom_transit, ELM_TRANSIT_EFFECT_FLIP_AXIS_Y, EINA_TRUE); + + elm_transit_duration_set(m_zoom_transit, 0.8); + elm_transit_del_cb_set(m_zoom_transit, __zoom_out_finished_cb, this); + elm_transit_go(m_zoom_transit); + + /* If the url bar in browser scroller is being displayed, + * the zoom animation should be move up because of the url bar gap. + * So add translation effect as well. */ + m_zoom_move_transit = elm_transit_add(); + if (!m_zoom_move_transit) { + BROWSER_LOGE("elm_transit_add failed"); + return EINA_FALSE; + } + /* Block event durring animation. */ + elm_transit_event_enabled_set(m_zoom_move_transit, EINA_TRUE); + + elm_transit_object_add(m_zoom_move_transit, m_zoom_effect_image); + elm_transit_object_add(m_zoom_move_transit, m_flip_effect_image); + elm_transit_tween_mode_set(m_zoom_move_transit, ELM_TRANSIT_TWEEN_MODE_SINUSOIDAL); + elm_transit_objects_final_state_keep_set(m_zoom_move_transit, EINA_FALSE); + + int browser_scroller_y = 0; + int url_layout_h = 0; + elm_scroller_region_get(browser_view->m_scroller, NULL, &browser_scroller_y, NULL, NULL); + evas_object_geometry_get(browser_view->m_url_layout, NULL, NULL, NULL, &url_layout_h); + + int scroller_y = 0; + evas_object_geometry_get(browser_view->m_scroller, NULL, &scroller_y, NULL, NULL); + + if (browser_scroller_y > url_layout_h) + browser_scroller_y = url_layout_h; + + /* 4 * elm_scale_get() is to make the effect layout more smoothly. */ + elm_transit_effect_translation_add(m_zoom_move_transit, 0, 0, 0, + (url_layout_h - browser_scroller_y - scroller_y - (6 * elm_scale_get())) * (-1)); + + elm_transit_duration_set(m_zoom_move_transit, 0.8); + elm_transit_go(m_zoom_move_transit); + + return EINA_TRUE; +} + +void Browser_Multi_Window_View::_set_multi_window_mode(Eina_Bool is_multi_window) +{ + BROWSER_LOGD("[%s]", __func__); + Browser_View *browser_view = m_data_manager->get_browser_view(); + + if (is_multi_window) { + /* The dimming background is done by + * edje_object_signal_emit(elm_layout_edje_get(browser_view->m_main_layout), + "show,multi_window,signal", ""); + * Move above code to __fill_multi_window_items_idler_cb */ + + elm_object_part_content_set(browser_view->m_main_layout, + "elm.swallow.multi_window", m_main_layout); + + /* Dim the multi window background. */ + edje_object_signal_emit(elm_layout_edje_get(m_main_layout), + "show,multi_window,signal", ""); + + /* Unset navigationbar title object to hide the title bar arrow. */ + browser_view->unset_navigationbar_title_object(EINA_TRUE); + } else { + /* Hide dim the multi window background. */ + edje_object_signal_emit(elm_layout_edje_get(m_main_layout), + "hide,multi_window,signal", ""); + /* Unset multi window layout from browser view. */ + elm_object_part_content_unset(browser_view->m_main_layout, + "elm.swallow.multi_window"); + /* Hide the swallow of multi window in browser main layout. */ + edje_object_signal_emit(elm_layout_edje_get(browser_view->m_main_layout), + "hide,multi_window,signal", ""); + + /* Set navigationbar title object to show the title bar arrow. */ + browser_view->unset_navigationbar_title_object(EINA_FALSE); + + /* Without this code, the url is empty shortly when create deleted-window in multi window. */ + if (browser_view->get_url().empty() && !browser_view->m_focused_window->m_url.empty()) + browser_view->_set_url_entry(browser_view->m_focused_window->m_url.c_str()); + else + browser_view->_set_url_entry(browser_view->get_url().c_str()); + browser_view->_set_controlbar_back_forward_status(); + } +} + +void Browser_Multi_Window_View::__snapshot_clicked_cb(void *data, Evas_Object *obj, + const char *emission, const char *source) +{ + if (!data) + return; + + BROWSER_LOGD("[%s]", __func__); + Browser_Multi_Window_View *multi_window_view = (Browser_Multi_Window_View *)data; + + if (multi_window_view->m_scroll_move_transit) { + BROWSER_LOGE("new window transit is running"); + return; + } + + multi_window_view->_snapshot_clicked(obj); +} + +void Browser_Multi_Window_View::_snapshot_clicked(Evas_Object *layout_edje) +{ + int index = 0; + for (index = 0 ; index < m_item_list.size() ; index++) { + if (elm_layout_edje_get(m_item_list[index]) == layout_edje) + break; + } + BROWSER_LOGD("m_current_position_index = %d, selected index = %d", m_current_position_index, index); + + if (m_current_position_index != index) + return; + + std::vector<Browser_Window *> window_list = m_browser->get_window_list(); + if (!window_list[index]->m_ewk_view) { + /* Workaround, the grey bg is displayed shortly when create deleted window. */ + Browser_View *browser_view = m_data_manager->get_browser_view(); + edje_object_signal_emit(elm_layout_edje_get(browser_view->m_main_layout), + "hide,grey_background,signal", ""); + } + + if (!_show_zoom_in_effect(m_item_list[index])) { + BROWSER_LOGE("_show_zoom_in_effect failed"); + return; + } +} + +void Browser_Multi_Window_View::__delete_window_icon_clicked_cb(void *data, Evas_Object *obj, + const char *emission, const char *source) +{ + if (!data) + return; + + BROWSER_LOGD("[%s]", __func__); + Browser_Multi_Window_View *multi_window_view = (Browser_Multi_Window_View *)data; + multi_window_view->__delete_window_icon_clicked(obj); +} + +void Browser_Multi_Window_View::__delete_window_icon_clicked(Evas_Object *layout_edje) +{ + int index = 0; + for (index = 0 ; index < m_item_list.size() ; index++) { + if (elm_layout_edje_get(m_item_list[index]) == layout_edje) + break; + } + BROWSER_LOGD("selected index = %d", index); + + if (index != m_current_position_index) + return; + + evas_object_hide(m_item_list[index]); + + if (m_item_list.size() == 2) { + /* In case of the muti window is 2, when delete a window, hide the delete icon. */ + for (int i = 0 ; i < m_item_list.size() ; i++) + edje_object_signal_emit(elm_layout_edje_get(m_item_list[i]), + "hide,delete_window_icon,signal", ""); + } + + if (!_show_delete_window_scroll_effect()) + BROWSER_LOGE("_show_delete_window_scroll_effect failed"); +} + +void Browser_Multi_Window_View::__delete_window_scroll_finished_cb(void *data, + Elm_Transit *transit) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_Multi_Window_View *multi_window_view = (Browser_Multi_Window_View *)data; + + if (!multi_window_view->m_scroll_move_transit) + return; + + multi_window_view->m_scroll_move_transit = NULL; + + multi_window_view->_delete_window_scroll_finished(); +} + +void Browser_Multi_Window_View::_delete_window_scroll_finished(void) +{ + BROWSER_LOGD("[%s]", __func__); + elm_box_unpack(m_item_box, m_item_list[m_current_position_index]); + evas_object_del(m_item_list[m_current_position_index]); + m_item_list.erase(m_item_list.begin() + m_current_position_index); + + std::vector<Browser_Window *> window_list = m_browser->get_window_list(); + + m_browser->delete_window(window_list[m_current_position_index]); + + BROWSER_LOGD("window_list.size() = %d", m_browser->get_window_list().size()); + if (m_current_position_index == m_browser->get_window_list().size()) + m_current_position_index = m_current_position_index - 1; + + if (m_page_control) { + elm_object_part_content_unset(m_main_layout, "elm.swallow.page_control"); + evas_object_del(m_page_control); + } + + m_page_control = elm_index_add(m_navi_bar); + if (!m_page_control) { + BROWSER_LOGD("elm_page_control_add failed"); + return; + } + elm_object_style_set(m_page_control, "pagecontrol"); + elm_index_horizontal_set(m_page_control, EINA_TRUE); + elm_index_autohide_disabled_set(m_page_control, EINA_TRUE); + + memset(m_index_items, 0x00, sizeof(Elm_Object_Item *) * BROWSER_MULTI_WINDOW_MAX_COUNT); + + Elm_Object_Item *index_it = NULL; + for (int i = 0 ; i < m_browser->get_window_list().size() ; i++) { + char number[5] = {0, }; + sprintf(number, "%d", i + 1); + + if (m_current_position_index == i) { + m_index_items[i] = index_it = elm_index_item_append(m_page_control, number, __index_selected_cb, this); + } else { + m_index_items[i] = elm_index_item_append(m_page_control, number, __index_selected_cb, this); + } + } + + elm_index_level_go(m_page_control, m_current_position_index); + elm_index_item_selected_set(index_it, EINA_TRUE); + + elm_object_part_content_set(m_main_layout, "elm.swallow.page_control", m_page_control); + evas_object_show(m_page_control); + + Browser_View *browser_view = m_data_manager->get_browser_view(); + + BROWSER_LOGD("m_current_position_index = %d", m_current_position_index); + + window_list = m_browser->get_window_list(); + const char *title = browser_view->get_title(window_list[m_current_position_index]).c_str(); + const char *url = browser_view->get_url(window_list[m_current_position_index]).c_str(); + if (!title || strlen(title) == 0) { + edje_object_part_text_set(elm_layout_edje_get(m_main_layout), "elm.title", BR_STRING_EMPTY_PAGE); + edje_object_part_text_set(elm_layout_edje_get(m_main_layout), "elm.url", ""); + } else { + edje_object_part_text_set(elm_layout_edje_get(m_main_layout), "elm.title", title); + edje_object_part_text_set(elm_layout_edje_get(m_main_layout), "elm.url", url); + } + + if (BROWSER_MULTI_WINDOW_MAX_COUNT > window_list.size()) + elm_object_disabled_set(m_new_window_button, EINA_FALSE); + + _show_grey_effect(); +} + +void Browser_Multi_Window_View::_show_grey_effect(void) +{ + BROWSER_LOGD("[%s]", __func__); + for (int i = 0 ; i < m_item_list.size() ; i++) { + if (i == m_current_position_index) + edje_object_signal_emit(elm_layout_edje_get(m_item_list[i]), + "non_grey,snapshot,signal", ""); + else + edje_object_signal_emit(elm_layout_edje_get(m_item_list[i]), + "grey,snapshot,signal", ""); + } +} + +Eina_Bool Browser_Multi_Window_View::_show_delete_window_scroll_effect(void) +{ + BROWSER_LOGD("[%s]", __func__); + int scroll_size = _get_scroll_page_size(); + + m_scroll_move_transit = elm_transit_add(); + if (!m_scroll_move_transit) { + BROWSER_LOGE("elm_transit_add failed"); + return EINA_FALSE; + } + /* Block event durring animation. */ + elm_transit_event_enabled_set(m_scroll_move_transit, EINA_TRUE); + + if (m_current_position_index != m_item_list.size() - 1) { + /* If the deleted multi window item is not the last one. */ + for (int i = m_current_position_index + 1 ; i < m_item_list.size() ; i++) + elm_transit_object_add(m_scroll_move_transit, m_item_list[i]); + elm_transit_effect_translation_add(m_scroll_move_transit, 0, 0, scroll_size * (-1), 0); + } else { + elm_transit_object_add(m_scroll_move_transit, m_item_box); + elm_transit_effect_translation_add(m_scroll_move_transit, 0, 0, scroll_size, 0); + } + + elm_transit_tween_mode_set(m_scroll_move_transit, ELM_TRANSIT_TWEEN_MODE_SINUSOIDAL); + elm_transit_objects_final_state_keep_set(m_scroll_move_transit, EINA_TRUE); + elm_transit_del_cb_set(m_scroll_move_transit, __delete_window_scroll_finished_cb, this); + elm_transit_duration_set(m_scroll_move_transit, 0.7); + elm_transit_go(m_scroll_move_transit); + + return EINA_TRUE; +} + +Eina_Bool Browser_Multi_Window_View::_fill_multi_window_items(void) +{ + BROWSER_LOGD("[%s]", __func__); + int ewk_view_current_w = 0; + int ewk_view_current_h = 0; + evas_object_geometry_get(m_data_manager->get_browser_view()->m_focused_window->m_ewk_view, + NULL, NULL, &ewk_view_current_w, &ewk_view_current_h); + + m_dummy_front_item_layout = elm_layout_add(m_item_box); + if (!m_dummy_front_item_layout) { + BROWSER_LOGE("elm_layout_add failed"); + return EINA_FALSE; + } + if (!elm_layout_file_set(m_dummy_front_item_layout, BROWSER_EDJE_DIR"/browser-multi-window.edj", + "browser/multi-window/item")) + BROWSER_LOGE("elm_layout_file_set failed"); + evas_object_size_hint_weight_set(m_dummy_front_item_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(m_dummy_front_item_layout, 0.5, 0.5); + m_dummy_front_item_snapshot = elm_icon_add(m_dummy_front_item_layout); + if (!m_dummy_front_item_snapshot) { + BROWSER_LOGE("elm_icon_add failed"); + return EINA_FALSE; + } + int empty_item_width = 0; + int padding = 22 * elm_scale_get(); + int snapshot_width = ewk_view_current_w * BROWSER_MULTI_WINDOW_ITEM_RATIO; + int snapshot_height = ewk_view_current_h * BROWSER_MULTI_WINDOW_ITEM_RATIO; + + empty_item_width = (ewk_view_current_w - snapshot_width)/2 - padding; + + int scroll_size = _get_scroll_page_size(); + + float page_relative = (float)((float)scroll_size/(float)ewk_view_current_w); + elm_scroller_page_relative_set(m_scroller, page_relative, page_relative); + + evas_object_size_hint_min_set(m_dummy_front_item_snapshot, empty_item_width, snapshot_height); + evas_object_resize(m_dummy_front_item_snapshot, empty_item_width, snapshot_height); + elm_object_part_content_set(m_dummy_front_item_layout, "elm.swallow.snapshot", + m_dummy_front_item_snapshot); + elm_box_pack_end(m_item_box, m_dummy_front_item_snapshot); + + std::vector<Browser_Window *> window_list = m_browser->get_window_list(); + BROWSER_LOGD("window_list.size()=%d", window_list.size()); + for (int i = 0 ; i < window_list.size() ; i++) { + Evas_Object *item = elm_layout_add(m_navi_bar); + if (!item) { + BROWSER_LOGE("elm_layout_add failed"); + return EINA_FALSE; + } + if (!elm_layout_file_set(item, BROWSER_EDJE_DIR"/browser-multi-window.edj", + "browser/multi-window/item")) { + BROWSER_LOGE("elm_layout_file_set failed"); + return EINA_FALSE; + } + evas_object_size_hint_weight_set(item, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(item, 0.5, 0.5); + + Evas_Object *snapshot_image = NULL; + if (!is_landscape()) + snapshot_image = window_list[i]->m_portrait_snapshot_image; + else + snapshot_image = window_list[i]->m_landscape_snapshot_image; + + elm_object_part_content_set(item, "elm.swallow.snapshot", snapshot_image); + + edje_object_signal_callback_add(elm_layout_edje_get(item), "mouse,clicked,1", + "elm.swallow.snapshot", __snapshot_clicked_cb, this); + + edje_object_signal_callback_add(elm_layout_edje_get(item), "mouse,clicked,1", + "elm.image.delete_window", __delete_window_icon_clicked_cb, this); + + if (window_list.size() > 1) + edje_object_signal_emit(elm_layout_edje_get(item), + "show,delete_window_icon,signal", ""); + + elm_box_pack_end(m_item_box, item); + + m_item_list.push_back(item); + } + + m_dummy_end_item_layout = elm_layout_add(m_item_box); + if (!m_dummy_end_item_layout) { + BROWSER_LOGE("elm_layout_add failed"); + return EINA_FALSE; + } + if (!elm_layout_file_set(m_dummy_end_item_layout, BROWSER_EDJE_DIR"/browser-multi-window.edj", + "browser/multi-window/item")) + BROWSER_LOGE("elm_layout_file_set failed"); + evas_object_size_hint_weight_set(m_dummy_end_item_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(m_dummy_end_item_layout, 0.5, 0.5); + m_dummy_end_item_snapshot = elm_icon_add(m_dummy_end_item_layout); + if (!m_dummy_end_item_snapshot) { + BROWSER_LOGE("elm_icon_add failed"); + return EINA_FALSE; + } + evas_object_size_hint_min_set(m_dummy_end_item_snapshot, empty_item_width, snapshot_height); + evas_object_resize(m_dummy_end_item_snapshot, empty_item_width, snapshot_height); + elm_object_part_content_set(m_dummy_end_item_layout, "elm.swallow.snapshot", + m_dummy_end_item_snapshot); + elm_box_pack_end(m_item_box, m_dummy_end_item_snapshot); + + return EINA_TRUE; +} + +void Browser_Multi_Window_View::close_multi_window(void) +{ + BROWSER_LOGD("[%s]", __func__); + __close_multi_window_button_clicked_cb(this, NULL, NULL); +} + +void Browser_Multi_Window_View::__close_multi_window_button_clicked_cb(void *data, + Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_Multi_Window_View *multi_window_view = (Browser_Multi_Window_View *)data; + + if (multi_window_view->m_zoom_transit || multi_window_view->m_zoom_move_transit + || multi_window_view->m_scroll_move_transit) { + BROWSER_LOGE("transit animation is running"); + return; + } + + std::vector<Browser_Window *> window_list = m_browser->get_window_list(); + + for (int i = 0 ; i < multi_window_view->m_item_list.size() ; i++) { + /* The multi window item will be deleted, + * So unset the snapshot image from item layout. + * The snapshot is kept. */ + elm_object_part_content_unset(multi_window_view->m_item_list[i], + "elm.swallow.snapshot"); + + if (window_list[i]->m_landscape_snapshot_image) { + evas_object_hide(window_list[i]->m_landscape_snapshot_image); + } + if (window_list[i]->m_portrait_snapshot_image) { + evas_object_hide(window_list[i]->m_portrait_snapshot_image); + } + } + + multi_window_view->_set_multi_window_mode(EINA_FALSE); + + m_data_manager->destroy_multi_window_view(); + + Browser_View *browser_view = m_data_manager->get_browser_view(); + browser_view->_set_multi_window_controlbar_text(window_list.size()); + /* Set the title if enter the multi window while loading. */ + browser_view->return_to_browser_view(); + + browser_view->resume_webview(browser_view->m_focused_window->m_ewk_view); +} + +void Browser_Multi_Window_View::__new_window_scroll_finished_cb(void *data, + Elm_Transit *transit) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_Multi_Window_View *multi_window_view = (Browser_Multi_Window_View *)data; + + if (!multi_window_view->m_scroll_move_transit) + return; + + multi_window_view->m_scroll_move_transit = NULL; + + if (!multi_window_view->_show_zoom_in_new_window_effect()) + BROWSER_LOGE("_show_zoom_in_new_window_effect failed"); +} + +void Browser_Multi_Window_View::__new_window_zoom_in_finished_cb(void *data, + Elm_Transit *transit) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_Multi_Window_View *multi_window_view = (Browser_Multi_Window_View *)data; + + if (!multi_window_view->m_zoom_transit) + return; + + /* window_list[window_list.size() - 1] is new created window. */ + std::vector<Browser_Window *> window_list = m_browser->get_window_list(); + m_browser->set_focused_window(window_list[window_list.size() - 1]); + + multi_window_view->m_zoom_transit = NULL; + + if (multi_window_view->m_zoom_effect_image) { + evas_object_del(multi_window_view->m_zoom_effect_image); + multi_window_view->m_zoom_effect_image = NULL; + } + if (multi_window_view->m_flip_effect_image) { + evas_object_del(multi_window_view->m_flip_effect_image); + multi_window_view->m_flip_effect_image = NULL; + } + + __close_multi_window_button_clicked_cb(multi_window_view, NULL, NULL); + + Browser_View *browser_view = m_data_manager->get_browser_view(); + browser_view->load_url(BROWSER_MOST_VISITED_SITES_URL); +} + +Eina_Bool Browser_Multi_Window_View::_show_zoom_in_new_window_effect(void) +{ + BROWSER_LOGD("[%s]", __func__); + if (!m_browser->create_new_window(EINA_TRUE)) { + BROWSER_LOGD("create_new_window failed"); + return EINA_FALSE; + } + + std::vector<Browser_Window *> window_list = m_browser->get_window_list(); + + m_zoom_effect_image = evas_object_rectangle_add(evas_object_evas_get(m_navi_bar)); + if (!m_zoom_effect_image) { + BROWSER_LOGE("evas_object_rectangle_add failed"); + return EINA_FALSE; + } + + m_flip_effect_image = evas_object_rectangle_add(evas_object_evas_get(m_navi_bar)); + if (!m_flip_effect_image) { + BROWSER_LOGE("evas_object_rectangle_add failed"); + return EINA_FALSE; + } + + int webview_x = 0; + int webview_y = 0; + int webview_w = 0; + int webview_h = 0; + Browser_View *browser_view = m_data_manager->get_browser_view(); + evas_object_geometry_get(browser_view->m_focused_window->m_ewk_view, &webview_x, &webview_y, + &webview_w, &webview_h); + + evas_object_resize(m_flip_effect_image, webview_w, webview_h); + evas_object_color_set(m_flip_effect_image, 255, 255, 255, 255); + evas_object_move(m_flip_effect_image, webview_x, webview_y); + + int snapshot_x = 0; + int snapshot_y = 0; + int snapshot_w = 0; + int snapshot_h = 0; + int scroll_size = _get_scroll_page_size(); + + if (!is_landscape()) + evas_object_geometry_get(window_list[m_item_list.size() - 1]->m_portrait_snapshot_image, + &snapshot_x, &snapshot_y, &snapshot_w, &snapshot_h); + else + evas_object_geometry_get(window_list[m_item_list.size() - 1]->m_landscape_snapshot_image, + &snapshot_x, &snapshot_y, &snapshot_w, &snapshot_h); + + evas_object_resize(m_zoom_effect_image, snapshot_w, snapshot_h); + evas_object_color_set(m_zoom_effect_image, 255, 255, 255, 255); + evas_object_move(m_zoom_effect_image, snapshot_x + scroll_size, snapshot_y); + evas_object_show(m_zoom_effect_image); + + /* m_zoom_effect_image is only for zoom out effect for the first time. */ + m_zoom_transit = elm_transit_add(); + if (!m_zoom_transit) { + BROWSER_LOGE("elm_transit_add failed"); + return EINA_FALSE; + } + /* Block event durring animation. */ + elm_transit_event_enabled_set(m_zoom_transit, EINA_TRUE); + + elm_transit_object_add(m_zoom_transit, m_zoom_effect_image); + elm_transit_object_add(m_zoom_transit, m_flip_effect_image); + elm_transit_tween_mode_set(m_zoom_transit, ELM_TRANSIT_TWEEN_MODE_SINUSOIDAL); + elm_transit_objects_final_state_keep_set(m_zoom_transit, EINA_FALSE); + elm_transit_effect_resizable_flip_add(m_zoom_transit, ELM_TRANSIT_EFFECT_FLIP_AXIS_Y, EINA_TRUE); + elm_transit_duration_set(m_zoom_transit, 0.8); + elm_transit_del_cb_set(m_zoom_transit, __new_window_zoom_in_finished_cb, this); + elm_transit_go(m_zoom_transit); + + /* window_list[window_list.size() - 1] is new created window. */ +// m_browser->set_focused_window(window_list[window_list.size() - 1]); + + return EINA_TRUE; +} + +Eina_Bool Browser_Multi_Window_View::_show_new_window_scroll_effect(void) +{ + BROWSER_LOGD("[%s]", __func__); + + int gap_to_end = m_item_list.size() - m_current_position_index; + int scroll_size = _get_scroll_page_size(); + + m_scroll_move_transit = elm_transit_add(); + if (!m_scroll_move_transit) { + BROWSER_LOGE("elm_transit_add failed"); + return EINA_FALSE; + } + /* Block event durring animation. */ + elm_transit_event_enabled_set(m_scroll_move_transit, EINA_TRUE); + + elm_transit_object_add(m_scroll_move_transit, m_item_box); + elm_transit_tween_mode_set(m_scroll_move_transit, ELM_TRANSIT_TWEEN_MODE_SINUSOIDAL); + elm_transit_objects_final_state_keep_set(m_scroll_move_transit, EINA_TRUE); + elm_transit_effect_translation_add(m_scroll_move_transit, 0, 0, + (scroll_size * gap_to_end) * (-1), 0); + elm_transit_del_cb_set(m_scroll_move_transit, __new_window_scroll_finished_cb, this); + + if (_is_grid_mode()) + elm_transit_duration_set(m_scroll_move_transit, 0.1); + else + elm_transit_duration_set(m_scroll_move_transit, 0.7); + elm_transit_go(m_scroll_move_transit); + + return EINA_TRUE; +} + +void Browser_Multi_Window_View::__new_window_button_clicked_cb(void *data, + Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_Multi_Window_View *multi_window_view = (Browser_Multi_Window_View *)data; + if (multi_window_view->m_scroll_move_transit || multi_window_view->m_zoom_transit) { + BROWSER_LOGE("animation is running"); + return; + } + + multi_window_view->_show_new_window_scroll_effect(); + + /* The new window & close button can be clicked while the new window animation. + * So delete the event callback during new window animation. */ + evas_object_smart_callback_del(multi_window_view->m_new_window_button, "clicked", + __new_window_button_clicked_cb); + evas_object_smart_callback_del(multi_window_view->m_close_multi_window_button, "clicked", + __close_multi_window_button_clicked_cb); + + /* clear url entry filed when click new window button. */ + Browser_View *browser_view = m_data_manager->get_browser_view(); + browser_view->_set_url_entry(""); + edje_object_signal_emit(elm_layout_edje_get(browser_view->m_url_entry_layout), "hide,favicon,signal", ""); + edje_object_signal_emit(elm_layout_edje_get(browser_view->m_option_header_url_entry_layout), + "hide,favicon,signal", ""); + browser_view->_set_navigationbar_title(""); +} + +void Browser_Multi_Window_View::__scroller_animation_stop_cb(void *data, + Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + Browser_Multi_Window_View *multi_window_view = (Browser_Multi_Window_View *)data; + multi_window_view->_scroller_animation_stop(); +} + +int Browser_Multi_Window_View::_get_scroll_page_size(void) +{ + BROWSER_LOGD("[%s]", __func__); + + int snapshot_w = 0; + std::vector<Browser_Window *> window_list = m_browser->get_window_list(); + + if (!is_landscape()) + evas_object_geometry_get(window_list[m_current_position_index]->m_portrait_snapshot_image, + NULL, NULL, &snapshot_w, NULL); + else + evas_object_geometry_get(window_list[m_current_position_index]->m_landscape_snapshot_image, + NULL, NULL, &snapshot_w, NULL); + + int padding = 22 * elm_scale_get(); + + int scroll_size = snapshot_w + (padding * 2); + + return scroll_size; +} + +void Browser_Multi_Window_View::_scroller_animation_stop(void) +{ + int scroller_x = 0; + elm_scroller_region_get(m_scroller, &scroller_x, NULL, NULL, NULL); + + int padding = 22 * elm_scale_get(); + int scroll_size = _get_scroll_page_size(); + + /* Workaround. + * the scroll size is 337 or 338. It seems that the gap of floating operation. + * So decrease the scroll_size by padding. */ + m_current_position_index = scroller_x / (scroll_size - padding); + BROWSER_LOGD("scroller_x = %d, scroll_size = %d, m_current_position_index = %d", + scroller_x, scroll_size, m_current_position_index); + + Browser_View *browser_view = m_data_manager->get_browser_view(); + std::vector<Browser_Window *> window_list = m_browser->get_window_list(); + + if ( m_current_position_index + 1 > window_list.size()) + m_current_position_index = window_list.size() - 1; + + if (!window_list[m_current_position_index]->m_ewk_view) { + std::string title_string = window_list[m_current_position_index]->m_title; + std::string url_string = window_list[m_current_position_index]->m_url; + if (title_string.empty()) { + edje_object_part_text_set(elm_layout_edje_get(m_main_layout), "elm.title", BR_STRING_EMPTY_PAGE); + edje_object_part_text_set(elm_layout_edje_get(m_main_layout), "elm.url", ""); + } else { + edje_object_part_text_set(elm_layout_edje_get(m_main_layout), "elm.title", title_string.c_str()); + edje_object_part_text_set(elm_layout_edje_get(m_main_layout), "elm.url", url_string.c_str()); + } + } else if (!window_list[m_current_position_index]->m_title.empty()) { + /* If the ewk view is deleted because of unused case(etc. low memory), + * and it is re-created, then set the title. */ + edje_object_part_text_set(elm_layout_edje_get(m_main_layout), "elm.title", + window_list[m_current_position_index]->m_title.c_str()); + edje_object_part_text_set(elm_layout_edje_get(m_main_layout), "elm.url", + window_list[m_current_position_index]->m_url.c_str()); + } else { + std::string title = browser_view->get_title(window_list[m_current_position_index]); + std::string url = browser_view->get_url(window_list[m_current_position_index]); + if (title.empty()) { + edje_object_part_text_set(elm_layout_edje_get(m_main_layout), "elm.title", BR_STRING_EMPTY_PAGE); + edje_object_part_text_set(elm_layout_edje_get(m_main_layout), "elm.url", ""); + } else { + std::string title_string = std::string(title); + std::string url_string = std::string(url); + edje_object_part_text_set(elm_layout_edje_get(m_main_layout), "elm.title", title_string.c_str()); + edje_object_part_text_set(elm_layout_edje_get(m_main_layout), "elm.url", url_string.c_str()); + } + } + + elm_index_level_go(m_page_control, m_current_position_index); + + if (m_index_items[m_current_position_index]) + elm_index_item_selected_set(m_index_items[m_current_position_index], EINA_TRUE); + BROWSER_LOGD("elm_index_level_go, m_current_position_index = %d", m_current_position_index); + + _show_grey_effect(); +} + +Eina_Bool Browser_Multi_Window_View::_is_grid_mode(void) +{ + BROWSER_LOGD("[%s]", __func__); + const char* state = edje_object_part_state_get(elm_layout_edje_get(m_main_layout), + "elm.swallow.scroller", NULL); + if (state && !strncmp(state, "default", strlen("default"))) + return EINA_FALSE; + else + return EINA_TRUE; +} + +/* zoom in effect when user selects mult window item. */ +Eina_Bool Browser_Multi_Window_View::_show_grid_mode_zoom_in_effect(int index) +{ + BROWSER_LOGD("[%s]", __func__); + Browser_Window *focused_window = m_data_manager->get_browser_view()->m_focused_window; + + std::vector<Browser_Window *> window_list = m_browser->get_window_list(); + Elm_Object_Item *gengrid_item = elm_gengrid_first_item_get(m_gengrid); + for (int i = 1 ; i < window_list.size() ; i++) { + if (index + 1 == i) + break; + gengrid_item = elm_gengrid_item_next_get(gengrid_item); + } + + const Evas_Object *snapshot_layout = elm_object_item_part_content_get(gengrid_item, "elm.swallow.content"); + + int snapshot_x = 0; + int snapshot_y = 0; + int snapshot_w = 0; + int snapshot_h = 0; + evas_object_geometry_get(snapshot_layout, &snapshot_x, &snapshot_y, &snapshot_w, &snapshot_h); + + evas_object_hide((Evas_Object *)snapshot_layout); + + int current_ewk_view_x = 0; + int current_ewk_view_y = 0; + int current_ewk_view_w = 0; + int current_ewk_view_h = 0; + Browser_View *browser_view = m_data_manager->get_browser_view(); + evas_object_geometry_get(browser_view->m_focused_window->m_ewk_view, ¤t_ewk_view_x, ¤t_ewk_view_y, + ¤t_ewk_view_w, ¤t_ewk_view_h); + + int to_x = (current_ewk_view_w - snapshot_w) / 2 - snapshot_x; + int to_y = (current_ewk_view_h - snapshot_h) / 2 - snapshot_y + current_ewk_view_y; + + BROWSER_LOGD("snapshot_x = %d, snapshot_y= %d, snapshot_w = %d, snapshot_h=%d, ", snapshot_x, snapshot_y, snapshot_w, snapshot_h); + + if (window_list[index]->m_ewk_view == NULL) { + m_zoom_effect_image = evas_object_rectangle_add(evas_object_evas_get(m_navi_bar)); + if (!m_zoom_effect_image) { + BROWSER_LOGE("evas_object_rectangle_add failed"); + return EINA_FALSE; + } + evas_object_resize(m_zoom_effect_image, snapshot_w, snapshot_h); + evas_object_color_set(m_zoom_effect_image, 255, 255, 255, 255); + + m_flip_effect_image = evas_object_rectangle_add(evas_object_evas_get(m_navi_bar)); + if (!m_flip_effect_image) { + BROWSER_LOGE("evas_object_rectangle_add failed"); + return EINA_FALSE; + } + evas_object_resize(m_flip_effect_image, current_ewk_view_w, current_ewk_view_h); + evas_object_color_set(m_flip_effect_image, 255, 255, 255, 255); + } else { + m_zoom_effect_image = _capture_snapshot(window_list[index], + (float)((float)snapshot_w / (float)current_ewk_view_w)); + if (!m_zoom_effect_image) { + BROWSER_LOGE("_capture_snapshot failed"); + return EINA_FALSE; + } + + m_flip_effect_image = _capture_snapshot(window_list[index], 1.0); + if (!m_flip_effect_image) { + BROWSER_LOGE("_capture_snapshot failed"); + return EINA_FALSE; + } + } + evas_object_move(m_flip_effect_image, current_ewk_view_x, current_ewk_view_y); + + evas_object_move(m_zoom_effect_image, snapshot_x, snapshot_y); + evas_object_show(m_zoom_effect_image); + + /* m_zoom_effect_image is only for zoom out effect for the first time. */ + m_zoom_transit = elm_transit_add(); + if (!m_zoom_transit) { + BROWSER_LOGE("elm_transit_add failed"); + return EINA_FALSE; + } + /* Block event durring animation. */ + elm_transit_event_enabled_set(m_zoom_transit, EINA_TRUE); + + m_select_item_index = index; + + elm_transit_object_add(m_zoom_transit, m_zoom_effect_image); + elm_transit_object_add(m_zoom_transit, m_flip_effect_image); + elm_transit_tween_mode_set(m_zoom_transit, ELM_TRANSIT_TWEEN_MODE_SINUSOIDAL); + elm_transit_objects_final_state_keep_set(m_zoom_transit, EINA_FALSE); + elm_transit_effect_resizable_flip_add(m_zoom_transit, ELM_TRANSIT_EFFECT_FLIP_AXIS_Y, EINA_TRUE); + elm_transit_duration_set(m_zoom_transit, 0.8); + elm_transit_del_cb_set(m_zoom_transit, __zoom_in_finished_cb, this); + elm_transit_go(m_zoom_transit); + + /* If the url bar in browser scroller is being displayed, + * the zoom animation should be move up because of the url bar gap. + * So add translation effect as well. */ + m_zoom_move_transit = elm_transit_add(); + if (!m_zoom_move_transit) { + BROWSER_LOGE("elm_transit_add failed"); + return EINA_FALSE; + } + /* Block event durring animation. */ + elm_transit_event_enabled_set(m_zoom_move_transit, EINA_TRUE); + + elm_transit_object_add(m_zoom_move_transit, m_zoom_effect_image); + elm_transit_object_add(m_zoom_move_transit, m_flip_effect_image); + elm_transit_tween_mode_set(m_zoom_move_transit, ELM_TRANSIT_TWEEN_MODE_SINUSOIDAL); + elm_transit_objects_final_state_keep_set(m_zoom_move_transit, EINA_FALSE); + + BROWSER_LOGD("to_x = %d, to_y = %d", to_x, to_y); + elm_transit_effect_translation_add(m_zoom_move_transit, 0, 0, to_x, to_y); + + elm_transit_duration_set(m_zoom_move_transit, 0.8); + elm_transit_go(m_zoom_move_transit); + + return EINA_TRUE; +} + +Eina_Bool Browser_Multi_Window_View::__delete_window_icon_grid_mode(int index) +{ + BROWSER_LOGD("[%s]", __func__); + std::vector<Browser_Window *> window_list = m_browser->get_window_list(); + Elm_Object_Item *gengrid_item = elm_gengrid_first_item_get(m_gengrid); + for (int i = 1 ; i < window_list.size() ; i++) { + if (index + 1 == i) + break; + gengrid_item = elm_gengrid_item_next_get(gengrid_item); + } + elm_object_item_del(gengrid_item); + + m_current_position_index = index; + + _delete_window_scroll_finished(); + + if (m_item_list.size() == 1) { + /* In case of the muti window is 1, hide the delete icon in normal mode. */ + edje_object_signal_emit(elm_layout_edje_get(m_item_list[0]), + "hide,delete_window_icon,signal", ""); + } + + if (!_create_gengrid()) { + BROWSER_LOGE("_create_gengrid failed"); + return EINA_FALSE; + } + + return EINA_TRUE; +} + +void Browser_Multi_Window_View::__delete_window_icon_grid_mode_clicked_cb(void *data, + Evas_Object *obj, const char *emission, const char *source) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + gengrid_callback_param *param = (gengrid_callback_param *)data; + Browser_Multi_Window_View *multi_window_view = NULL; + multi_window_view = (Browser_Multi_Window_View *)(param->multi_window_view); + + if (multi_window_view->m_is_reodering) { + BROWSER_LOGD("reodering mode"); + multi_window_view->m_is_reodering = EINA_FALSE; + return; + } + + int index = param->index; + multi_window_view->__delete_window_icon_grid_mode(index); +} + +void Browser_Multi_Window_View::__snapshot_grid_mode_clicked_cb(void *data, + Evas_Object *obj, const char *emission, const char *source) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + gengrid_callback_param *param = (gengrid_callback_param *)data; + Browser_Multi_Window_View *multi_window_view = NULL; + multi_window_view = (Browser_Multi_Window_View *)(param->multi_window_view); + if (multi_window_view->m_is_reodering) { + BROWSER_LOGD("reodering mode"); + multi_window_view->m_is_reodering = EINA_FALSE; + return; + } + if (multi_window_view->m_zoom_transit) { + BROWSER_LOGD("zoom transit is running"); + return; + } + + int index = param->index; + + if (!multi_window_view->_show_grid_mode_zoom_in_effect(index)) + BROWSER_LOGE("_show_grid_mode_zoom_in_effect failed"); +} + +Evas_Object *Browser_Multi_Window_View::_get_gengrid_icon_cb(void *data, + Evas_Object *obj, const char *part) +{ + if (!data) + return NULL; + + gengrid_callback_param *param = (gengrid_callback_param *)data; + Browser_Multi_Window_View *multi_window_view = NULL; + multi_window_view = (Browser_Multi_Window_View *)(param->multi_window_view); + int index = param->index; + + if (!strncmp(part, "elm.swallow.icon", strlen("elm.swallow.icon"))) { + Evas_Object *snapshot_image = evas_object_image_add(evas_object_evas_get(obj)); + if (!snapshot_image) { + BROWSER_LOGE("evas_object_image_add failed"); + return NULL; + } + std::vector<Browser_Window *> window_list = m_browser->get_window_list(); + int snapshot_w = 0; + int snapshot_h = 0; + if (!multi_window_view->is_landscape()) { + evas_object_image_source_set(snapshot_image, window_list[index]->m_portrait_snapshot_image); + evas_object_geometry_get(window_list[index]->m_portrait_snapshot_image, NULL, NULL, + &snapshot_w, &snapshot_h); + BROWSER_LOGD("portrait, snapshot_w=%d, snapshot_h=%d", snapshot_w, snapshot_h); + } + else { + evas_object_image_source_set(snapshot_image, window_list[index]->m_landscape_snapshot_image); + evas_object_geometry_get(window_list[index]->m_landscape_snapshot_image, NULL, NULL, + &snapshot_w, &snapshot_h); + BROWSER_LOGD("landscape, snapshot_w=%d, snapshot_h=%d", snapshot_w, snapshot_h); + } + + int item_w = 0; + int item_h = 0; + elm_gengrid_item_size_get(multi_window_view->m_gengrid, &item_w, &item_h); + evas_object_image_fill_set(snapshot_image, 0, 0, item_w, item_h); + + Evas_Object *grid_item_layout = elm_layout_add(obj); + if (!grid_item_layout) { + BROWSER_LOGE("grid_item_layout failed"); + return NULL; + } + if (!elm_layout_file_set(grid_item_layout, BROWSER_EDJE_DIR"/browser-multi-window.edj", + "browser/multi-window/grid_item")) + BROWSER_LOGE("elm_layout_file_set failed"); + + if (window_list.size() > 1) + edje_object_signal_emit(elm_layout_edje_get(grid_item_layout), + "show,delete_icon,signal", ""); + + evas_object_size_hint_weight_set(grid_item_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(grid_item_layout, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_object_part_content_set(grid_item_layout, "elm.swallow.snapshot", snapshot_image); + evas_object_show(snapshot_image); + evas_object_show(grid_item_layout); + + edje_object_signal_callback_add(elm_layout_edje_get(grid_item_layout), "mouse,clicked,1", + "delete_icon_click_area", __delete_window_icon_grid_mode_clicked_cb, data); + edje_object_signal_callback_add(elm_layout_edje_get(grid_item_layout), "mouse,up,1", + "elm.swallow.snapshot", __snapshot_grid_mode_clicked_cb, data); + + return grid_item_layout; + } + + return NULL; +} + +void Browser_Multi_Window_View::__gengrid_item_longpress_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + + if (!data) + return; + + Browser_Multi_Window_View *multi_window_view = (Browser_Multi_Window_View *)data; + multi_window_view->m_is_reodering = EINA_TRUE; +} + +Eina_Bool Browser_Multi_Window_View::_reorder_windows(void) +{ + BROWSER_LOGD("[%s]", __func__); + std::vector<Browser_Window *> window_list = m_browser->get_window_list(); + std::vector<Browser_Window *> reodered_list; + std::vector<Evas_Object *> reodered_item = m_item_list; + reodered_list.clear(); + reodered_item.clear(); + + Elm_Object_Item *it = elm_gengrid_first_item_get(m_gengrid); + for (int i = 0 ; i < window_list.size() ; i++) { + if (!it) + break; + gengrid_callback_param *it_data = (gengrid_callback_param *)elm_object_item_data_get(it); + BROWSER_LOGD("i=[%d], index=[%d]", i, it_data->index); + + reodered_list.push_back(window_list[it_data->index]); + reodered_item.push_back(m_item_list[it_data->index]); + + it_data->index = i; + + it = elm_gengrid_item_next_get(it); + } + + /* Reoder the browser class windows. */ + m_browser->change_order(reodered_list); + + /* Reoder the multi window normal mode items. */ + m_item_list.clear(); + m_item_list = reodered_item; + + /* Reoder the multi window normal mode items. */ + elm_box_unpack_all(m_item_box); + elm_box_pack_end(m_item_box, m_dummy_front_item_snapshot); + for (int i = 0 ; i < m_item_list.size() ; i++) + elm_box_pack_end(m_item_box, m_item_list[i]); + elm_box_pack_end(m_item_box, m_dummy_end_item_snapshot); + + evas_object_smart_callback_call(m_scroller, "scroll,anim,stop", NULL); + + return EINA_TRUE; +} + +void Browser_Multi_Window_View::__gengrid_item_moved_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + + if (!data) + return; + + Browser_Multi_Window_View *multi_window_view = (Browser_Multi_Window_View *)data; + if (!multi_window_view->_reorder_windows()) + BROWSER_LOGE("_reorder_windows failed"); +} + +Eina_Bool Browser_Multi_Window_View::_create_gengrid(void) +{ + if (m_gengrid) + evas_object_del(m_gengrid); + + m_gengrid = elm_gengrid_add(m_navi_bar); + if (!m_gengrid) { + BROWSER_LOGE("elm_gengrid_add failed"); + return EINA_FALSE; + } + std::vector<Browser_Window *> window_list = m_browser->get_window_list(); + + elm_object_part_content_set(m_main_layout, "elm.swallow.gengrid", m_gengrid); + + int window_w = 0; + evas_object_geometry_get(m_win, NULL, NULL, &window_w, NULL); + + int gengrid_area_h = 0; + edje_object_part_geometry_get(elm_layout_edje_get(m_main_layout), "elm.swallow.gengrid", + NULL, NULL, NULL, &gengrid_area_h); + + elm_gengrid_item_size_set(m_gengrid, window_w / 3, gengrid_area_h / 3); + elm_gengrid_horizontal_set(m_gengrid, EINA_FALSE); + elm_gengrid_bounce_set(m_gengrid, EINA_FALSE, EINA_FALSE); + elm_gengrid_multi_select_set(m_gengrid, EINA_FALSE); + elm_gengrid_select_mode_set(m_gengrid, ELM_OBJECT_SELECT_MODE_NONE); + elm_gengrid_align_set(m_gengrid, 0.0, 0.0); + elm_gengrid_reorder_mode_set(m_gengrid, EINA_TRUE); + evas_object_show(m_gengrid); + + evas_object_smart_callback_add(m_gengrid, "moved", __gengrid_item_moved_cb, this); + evas_object_smart_callback_add(m_gengrid, "longpressed", __gengrid_item_longpress_cb, this); + + m_gengrid_item_class.item_style = "default_grid"; + m_gengrid_item_class.func.text_get = NULL; + m_gengrid_item_class.func.content_get = _get_gengrid_icon_cb; + m_gengrid_item_class.func.state_get = NULL; + m_gengrid_item_class.func.del = NULL; + + for (int i = 0 ; i < window_list.size() ; i++ ) { + m_callback_param[i].multi_window_view = this; + m_callback_param[i].index = i; + elm_gengrid_item_append(m_gengrid, &m_gengrid_item_class, &m_callback_param[i], NULL, NULL); + } + + return EINA_TRUE; +} + +void Browser_Multi_Window_View::__view_change_button_clicked_cb(void *data, + Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_Multi_Window_View *multi_window_view = (Browser_Multi_Window_View *)data; + if (!multi_window_view->_is_grid_mode()) { + if (!multi_window_view->_create_gengrid()) { + BROWSER_LOGE("_create_gengrid failed"); + return; + } + edje_object_signal_emit(elm_layout_edje_get(multi_window_view->m_main_layout), + "show,grid_mode,signal", ""); + } else { + /* To sync grid mode, if the window is deleted or reodered at grid mode. */ + evas_object_smart_callback_call(multi_window_view->m_scroller, "scroll,anim,stop", NULL); + + edje_object_signal_emit(elm_layout_edje_get(multi_window_view->m_main_layout), + "show,normal_mode,signal", ""); + } +} + +void Browser_Multi_Window_View::__delete_gengrid_cb(void *data, + Evas_Object *obj, const char *emission, const char *source) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_Multi_Window_View *multi_window_view = (Browser_Multi_Window_View *)data; + if (multi_window_view->m_gengrid) { + evas_object_del(multi_window_view->m_gengrid); + multi_window_view->m_gengrid = NULL; + } +} + +Eina_Bool Browser_Multi_Window_View::__zoom_out_effect_idler_cb(void *data) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return ECORE_CALLBACK_CANCEL; + + Browser_Multi_Window_View *multi_window_view = (Browser_Multi_Window_View *)data; + multi_window_view->m_zoom_out_effect_idler = NULL; + + /* zoom out effect for the first time when user excutes multi window. */ + if (!multi_window_view->_show_zoom_out_effect()) { + BROWSER_LOGD("_show_zoom_out_effect failed"); + return ECORE_CALLBACK_CANCEL; + } + + edje_object_signal_emit(elm_layout_edje_get(multi_window_view->m_main_layout), + "show,bg,signal", ""); + + return ECORE_CALLBACK_CANCEL; +} + +void Browser_Multi_Window_View::__index_selected_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + Browser_Multi_Window_View *multi_window_view = (Browser_Multi_Window_View *)data; + Elm_Object_Item *selected_it = (Elm_Object_Item *)event_info; + int index = atoi(elm_index_item_letter_get(selected_it)); + BROWSER_LOGD("selected index = %d, multi_window_view->m_current_position_index = %d", + index, multi_window_view->m_current_position_index); + + if (multi_window_view->m_current_position_index == index - 1 || index - 1 < 0) + return; + + multi_window_view->m_current_position_index = index - 1; + + int scroll_size = multi_window_view->_get_scroll_page_size(); + int scroller_y = 0; + int scroller_w = 0; + int scroller_h = 0; + BROWSER_LOGD("multi_window_view->m_current_position_index = %d, scroll_size=%d", + multi_window_view->m_current_position_index, scroll_size); + elm_scroller_region_get(multi_window_view->m_scroller, NULL, &scroller_y, &scroller_w, &scroller_h); + elm_scroller_region_bring_in(multi_window_view->m_scroller, scroll_size * multi_window_view->m_current_position_index, + scroller_y, scroller_w, scroller_h); +} + +Eina_Bool Browser_Multi_Window_View::_create_main_layout(void) +{ + BROWSER_LOGD("[%s]", __func__); + Browser_View *browser_view = m_data_manager->get_browser_view(); + + /* m_zoom_effect_image is only for zoom out effect for the first time. */ + Browser_Window *focused_window = m_data_manager->get_browser_view()->m_focused_window; + if (browser_view->get_url(focused_window).empty()) { + m_zoom_effect_image = evas_object_rectangle_add(evas_object_evas_get(m_navi_bar)); + if (!m_zoom_effect_image) { + BROWSER_LOGE("evas_object_rectangle_add failed"); + return EINA_FALSE; + } + int focused_ewk_view_w = 0; + int focused_ewk_view_h = 0; + evas_object_geometry_get(browser_view->m_focused_window->m_ewk_view, NULL, NULL, + &focused_ewk_view_w, &focused_ewk_view_h); + + evas_object_size_hint_min_set(m_zoom_effect_image, focused_ewk_view_w, focused_ewk_view_h); + evas_object_resize(m_zoom_effect_image, focused_ewk_view_w, focused_ewk_view_h); + evas_object_color_set(m_zoom_effect_image, 255, 255, 255, 255); + + m_flip_effect_image = evas_object_rectangle_add(evas_object_evas_get(m_navi_bar)); + if (!m_flip_effect_image) { + BROWSER_LOGE("evas_object_rectangle_add failed"); + return EINA_FALSE; + } + + evas_object_size_hint_min_set(m_flip_effect_image, + (int)(focused_ewk_view_w * BROWSER_MULTI_WINDOW_ITEM_RATIO), + (int)(focused_ewk_view_h * BROWSER_MULTI_WINDOW_ITEM_RATIO)); + evas_object_resize(m_flip_effect_image, + (int)(focused_ewk_view_w * BROWSER_MULTI_WINDOW_ITEM_RATIO), + (int)(focused_ewk_view_h * BROWSER_MULTI_WINDOW_ITEM_RATIO)); + + evas_object_color_set(m_flip_effect_image, 255, 255, 255, 255); + } else { + m_zoom_effect_image = _capture_snapshot(focused_window, 1.0); + m_flip_effect_image = _capture_snapshot(focused_window, BROWSER_MULTI_WINDOW_ITEM_RATIO); + } + + if (!m_zoom_effect_image || !m_flip_effect_image) { + BROWSER_LOGD("_capture_snapshot failed"); + return EINA_FALSE; + } + + Evas_Object *snapshot_image = NULL; + if (browser_view->get_url(focused_window).empty()) { + snapshot_image = evas_object_rectangle_add(evas_object_evas_get(m_navi_bar)); + if (!snapshot_image) { + BROWSER_LOGE("evas_object_rectangle_add failed"); + return EINA_FALSE; + } + int focused_ewk_view_w = 0; + int focused_ewk_view_h = 0; + evas_object_geometry_get(browser_view->m_focused_window->m_ewk_view, NULL, NULL, + &focused_ewk_view_w, &focused_ewk_view_h); + + evas_object_size_hint_min_set(snapshot_image, (int)(focused_ewk_view_w * BROWSER_MULTI_WINDOW_ITEM_RATIO), + (int)(focused_ewk_view_h * BROWSER_MULTI_WINDOW_ITEM_RATIO)); + evas_object_resize(snapshot_image, (int)(focused_ewk_view_w * BROWSER_MULTI_WINDOW_ITEM_RATIO), + (int)(focused_ewk_view_h * BROWSER_MULTI_WINDOW_ITEM_RATIO)); + evas_object_color_set(snapshot_image, 255, 255, 255, 255); + } else { + snapshot_image = _capture_snapshot(focused_window, BROWSER_MULTI_WINDOW_ITEM_RATIO); + } + + if (!snapshot_image) { + BROWSER_LOGE("_capture_snapshot failed"); + return EINA_FALSE; + } + + m_main_layout = elm_layout_add(browser_view->m_navi_bar); + if (!m_main_layout) { + BROWSER_LOGE("elm_layout_add failed"); + return EINA_FALSE; + } + if (!elm_layout_file_set(m_main_layout, BROWSER_EDJE_DIR"/browser-multi-window.edj", + "browser/browser-multi-window")) { + BROWSER_LOGE("elm_layout_file_set failed"); + return EINA_FALSE; + } + evas_object_show(m_main_layout); + + m_scroller = elm_scroller_add(m_navi_bar); + if (!m_scroller) { + BROWSER_LOGD("elm_scroller_add failed"); + return EINA_FALSE; + } + evas_object_size_hint_weight_set(m_scroller, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(m_scroller, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_scroller_bounce_set(m_scroller, EINA_TRUE, EINA_FALSE); + + elm_object_part_content_set(m_main_layout, "elm.swallow.scroller", m_scroller); + elm_scroller_policy_set(m_scroller, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF); + evas_object_show(m_scroller); + + /* After change normal mode -> gengrid mode, delete the gengrid after view change effect in __delete_gengrid_cb. */ + edje_object_signal_callback_add(elm_layout_edje_get(m_main_layout), "delete,gengrid,signal", + "*", __delete_gengrid_cb, this); + + evas_object_smart_callback_add(m_scroller, "scroll,anim,stop", __scroller_animation_stop_cb, this); + evas_object_smart_callback_add(m_scroller, "edge,left", __scroller_animation_stop_cb, this); + evas_object_smart_callback_add(m_scroller, "edge,right", __scroller_animation_stop_cb, this); + + m_item_box = elm_box_add(m_navi_bar); + if (!m_item_box) { + BROWSER_LOGD("elm_box_add failed"); + return EINA_FALSE; + } + evas_object_size_hint_weight_set(m_item_box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(m_item_box, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_box_horizontal_set(m_item_box, EINA_TRUE); + elm_object_content_set(m_scroller, m_item_box); + evas_object_show(m_item_box); + + m_close_multi_window_button = elm_button_add(m_navi_bar); + if (!m_close_multi_window_button) { + BROWSER_LOGD("elm_button_add failed"); + return EINA_FALSE; + } + elm_object_style_set(m_close_multi_window_button, "text_only/style2"); + elm_object_text_set(m_close_multi_window_button, BR_STRING_CLOSE); + elm_object_part_content_set(m_main_layout, "elm.swallow.close_multi_window_button", + m_close_multi_window_button); + evas_object_smart_callback_add(m_close_multi_window_button, "clicked", + __close_multi_window_button_clicked_cb, this); + evas_object_show(m_close_multi_window_button); + + m_view_change_button = elm_button_add(m_navi_bar); + if (!m_view_change_button) { + BROWSER_LOGD("elm_button_add failed"); + return EINA_FALSE; + } + elm_object_style_set(m_view_change_button, "text_only/style2"); + elm_object_text_set(m_view_change_button, BR_STRING_VIEW_CHANGE); + elm_object_part_content_set(m_main_layout, "elm.swallow.view_change_button", + m_view_change_button); + evas_object_smart_callback_add(m_view_change_button, "clicked", + __view_change_button_clicked_cb, this); + evas_object_show(m_view_change_button); + + m_new_window_button = elm_button_add(m_navi_bar); + if (!m_new_window_button) { + BROWSER_LOGD("elm_button_add failed"); + return EINA_FALSE; + } + elm_object_style_set(m_new_window_button, "text_only/style2"); + elm_object_text_set(m_new_window_button, BR_STRING_NEW_WINDOW); + elm_object_part_content_set(m_main_layout, "elm.swallow.new_window_button", + m_new_window_button); + evas_object_smart_callback_add(m_new_window_button, "clicked", + __new_window_button_clicked_cb, this); + evas_object_show(m_new_window_button); + + int index = 0; + std::vector<Browser_Window *> window_list = m_browser->get_window_list(); + for (index = 0 ; index < window_list.size() ; index++) { + if (window_list[index] == m_data_manager->get_browser_view()->m_focused_window) + break; + } + m_current_position_index = index; + + m_page_control = elm_index_add(m_navi_bar); + if (!m_page_control) { + BROWSER_LOGD("elm_page_control_add failed"); + return EINA_FALSE; + } + elm_object_style_set(m_page_control, "pagecontrol"); + elm_index_horizontal_set(m_page_control, EINA_TRUE); + elm_index_autohide_disabled_set(m_page_control, EINA_TRUE); + + memset(m_index_items, 0x00, sizeof(Elm_Object_Item *) * BROWSER_MULTI_WINDOW_MAX_COUNT); + + Elm_Object_Item *index_it = NULL; + for (int i = 0 ; i < window_list.size() ; i++) { + char number[5] = {0, }; + sprintf(number, "%d", i + 1); + + if (m_current_position_index == i) + m_index_items[i] = index_it = elm_index_item_append(m_page_control, number, __index_selected_cb, this); + else + m_index_items[i] = elm_index_item_append(m_page_control, number, __index_selected_cb, this); + } + + elm_index_level_go(m_page_control, m_current_position_index); + elm_index_item_selected_set(index_it, EINA_TRUE); + + elm_object_part_content_set(m_main_layout, "elm.swallow.page_control", m_page_control); + evas_object_show(m_page_control); + + if (BROWSER_MULTI_WINDOW_MAX_COUNT <= window_list.size()) + elm_object_disabled_set(m_new_window_button, EINA_TRUE); + + _set_multi_window_mode(EINA_TRUE); + + if (!is_landscape()) { + /* Portrait mode */ + if (browser_view->m_focused_window->m_portrait_snapshot_image) + evas_object_del(browser_view->m_focused_window->m_portrait_snapshot_image); + browser_view->m_focused_window->m_portrait_snapshot_image = snapshot_image; + + for (int i = 0 ; i < window_list.size() ; i++) { + /* Focused window is already captured above. So skip it. */ + if ((window_list[i] != browser_view->m_focused_window) + && !(window_list[i]->m_portrait_snapshot_image)) { + Evas_Object *snapshot_image = NULL; + if (window_list[i]->m_ewk_view == NULL || browser_view->get_url(window_list[i]).empty()) { + snapshot_image = evas_object_rectangle_add(evas_object_evas_get(m_navi_bar)); + if (!snapshot_image) { + BROWSER_LOGE("evas_object_rectangle_add failed"); + return EINA_FALSE; + } + int focused_ewk_view_w = 0; + int focused_ewk_view_h = 0; + evas_object_geometry_get(browser_view->m_focused_window->m_ewk_view, NULL, NULL, + &focused_ewk_view_w, &focused_ewk_view_h); + + evas_object_size_hint_min_set(snapshot_image, (int)(focused_ewk_view_w * BROWSER_MULTI_WINDOW_ITEM_RATIO), + (int)(focused_ewk_view_h * BROWSER_MULTI_WINDOW_ITEM_RATIO)); + evas_object_resize(snapshot_image, (int)(focused_ewk_view_w * BROWSER_MULTI_WINDOW_ITEM_RATIO), + (int)(focused_ewk_view_h * BROWSER_MULTI_WINDOW_ITEM_RATIO)); + evas_object_color_set(snapshot_image, 255, 255, 255, 255); + } else { + snapshot_image = _capture_snapshot(window_list[i], + BROWSER_MULTI_WINDOW_ITEM_RATIO); + if (!snapshot_image) { + BROWSER_LOGD("_capture_snapshot failed"); + return EINA_FALSE; + } + } + window_list[i]->m_portrait_snapshot_image = snapshot_image; + } + } + } else { + /* Landscape mode */ + if (browser_view->m_focused_window->m_landscape_snapshot_image) + evas_object_del(browser_view->m_focused_window->m_landscape_snapshot_image); + browser_view->m_focused_window->m_landscape_snapshot_image = snapshot_image; + + for (int i = 0 ; i < window_list.size() ; i++) { + /* Focused window is already captured above. So skip it. */ + if ((window_list[i] != browser_view->m_focused_window) + && !(window_list[i]->m_landscape_snapshot_image)) { + Evas_Object *snapshot_image = NULL; + if (!window_list[i]->m_ewk_view || browser_view->get_url(window_list[i]).empty()) { + snapshot_image = evas_object_rectangle_add(evas_object_evas_get(m_navi_bar)); + if (!snapshot_image) { + BROWSER_LOGE("evas_object_rectangle_add failed"); + return EINA_FALSE; + } + int focused_ewk_view_w = 0; + int focused_ewk_view_h = 0; + evas_object_geometry_get(browser_view->m_focused_window->m_ewk_view, NULL, NULL, + &focused_ewk_view_w, &focused_ewk_view_h); + + evas_object_size_hint_min_set(snapshot_image, (int)(focused_ewk_view_w * BROWSER_MULTI_WINDOW_ITEM_RATIO), + (int)(focused_ewk_view_h * BROWSER_MULTI_WINDOW_ITEM_RATIO)); + evas_object_resize(snapshot_image, (int)(focused_ewk_view_w * BROWSER_MULTI_WINDOW_ITEM_RATIO), + (int)(focused_ewk_view_h * BROWSER_MULTI_WINDOW_ITEM_RATIO)); + evas_object_color_set(snapshot_image, 255, 255, 255, 255); + } else { + snapshot_image = _capture_snapshot(window_list[i], + BROWSER_MULTI_WINDOW_ITEM_RATIO); + if (!snapshot_image) { + BROWSER_LOGD("_capture_snapshot failed"); + return EINA_FALSE; + } + } + window_list[i]->m_landscape_snapshot_image = snapshot_image; + } + } + } + + if (!_fill_multi_window_items()) { + BROWSER_LOGD("_fill_multi_window_items failed"); + return EINA_FALSE; + } + + edje_object_signal_emit(elm_layout_edje_get(browser_view->m_main_layout), + "show,multi_window,signal", ""); + + /* Give zoom out effect in idler because the effect is not smooth. */ + m_zoom_out_effect_idler = ecore_idler_add(__zoom_out_effect_idler_cb, this); + + return EINA_TRUE; +} + diff --git a/src/browser-multi-window/browser-multi-window-view.h b/src/browser-multi-window/browser-multi-window-view.h new file mode 100755 index 00000000..90735161 --- /dev/null +++ b/src/browser-multi-window/browser-multi-window-view.h @@ -0,0 +1,130 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef BROWSER_MULTI_WINDOW_VIEW_H +#define BROWSER_MULTI_WINDOW_VIEW_H + +#include "browser-common-view.h" +#include "browser-config.h" + +class Browser_Window; + +class Browser_Multi_Window_View : public Browser_Common_View { +public: + Browser_Multi_Window_View(void); + ~Browser_Multi_Window_View(void); + + Eina_Bool init(void); + void close_multi_window(void); + + typedef struct _gengrid_callback_param { + void *multi_window_view; + int index; + } gengrid_callback_param; +private: + Eina_Bool _create_main_layout(void); + Eina_Bool _show_zoom_out_effect(void); + Eina_Bool _show_zoom_in_effect(Evas_Object *item); + Eina_Bool _show_new_window_scroll_effect(void); + Eina_Bool _show_zoom_in_new_window_effect(void); + Eina_Bool _show_delete_window_scroll_effect(void); + void _set_multi_window_mode(Eina_Bool is_multi_window); + Eina_Bool _fill_multi_window_items(void); + void _snapshot_clicked(Evas_Object *layout_edje); + void __zoom_out_finished(void); + void _scroller_animation_stop(void); + int _get_scroll_page_size(void); + void __delete_window_icon_clicked(Evas_Object *layout_edje); + void _delete_window_scroll_finished(void); + Eina_Bool _is_grid_mode(void); + Eina_Bool _create_gengrid(void); + Eina_Bool _show_grid_mode_zoom_in_effect(int index); + Eina_Bool __delete_window_icon_grid_mode(int index); + Eina_Bool _reorder_windows(void); + void _show_grey_effect(void); + + /* gengrid event callback functions */ + static Evas_Object *_get_gengrid_icon_cb(void *data, Evas_Object *obj, const char *part); + + /* elementary event callback functions */ + static void __close_multi_window_button_clicked_cb(void *data, + Evas_Object *obj, void *event_info); + static void __new_window_button_clicked_cb(void *data, Evas_Object *obj, + void *event_info); + static void __view_change_button_clicked_cb(void *data, Evas_Object *obj, + void *event_info); + static void __scroller_animation_stop_cb(void *data, Evas_Object *obj, + void *event_info); + static void __gengrid_item_moved_cb(void *data, Evas_Object *obj, void *event_info); + static void __gengrid_item_longpress_cb(void *data, Evas_Object *obj, void *event_info); + static void __index_selected_cb(void *data, Evas_Object *obj, void *event_info); + + /* transit del callback functions */ + static void __zoom_in_finished_cb(void *data, Elm_Transit *transit); + static void __zoom_out_finished_cb(void *data, Elm_Transit *transit); + static void __new_window_zoom_in_finished_cb(void *data, Elm_Transit *transit); + static void __delete_window_scroll_finished_cb(void *data, Elm_Transit *transit); + static void __new_window_scroll_finished_cb(void *data, Elm_Transit *transit); + + /* edje event callback functions */ + static void __snapshot_clicked_cb(void *data, Evas_Object *obj, + const char *emission, const char *source); + static void __delete_window_icon_clicked_cb(void *data, Evas_Object *obj, + const char *emission, const char *source); + static void __delete_window_icon_grid_mode_clicked_cb(void *data, Evas_Object *obj, + const char *emission, const char *source); + static void __snapshot_grid_mode_clicked_cb(void *data, Evas_Object *obj, + const char *emission, const char *source); + static void __delete_gengrid_cb(void *data, Evas_Object *obj, const char *emission, + const char *source); + + /* Ecore idler callback functions */ + static Eina_Bool __zoom_out_effect_idler_cb(void *data); + + Evas_Object *m_main_layout; + Evas_Object *m_scroller; + Evas_Object *m_item_box; + Evas_Object *m_zoom_effect_image; + Evas_Object *m_flip_effect_image; + Evas_Object *m_close_multi_window_button; + Evas_Object *m_new_window_button; + Evas_Object *m_view_change_button; + Elm_Transit *m_zoom_transit; + Elm_Transit *m_zoom_move_transit; + Elm_Transit *m_scroll_move_transit; + + Evas_Object *m_dummy_front_item_layout; + Evas_Object *m_dummy_front_item_snapshot; + Evas_Object *m_dummy_end_item_layout; + Evas_Object *m_dummy_end_item_snapshot; + + Evas_Object *m_page_control; + + int m_select_item_index; + int m_current_position_index; + std::vector<Evas_Object *> m_item_list; + + Evas_Object *m_gengrid; + Elm_Gengrid_Item_Class m_gengrid_item_class; + gengrid_callback_param m_callback_param[BROWSER_MULTI_WINDOW_MAX_COUNT]; + + Eina_Bool m_is_reodering; + Ecore_Idler *m_zoom_out_effect_idler; + + Elm_Object_Item *m_index_items[BROWSER_MULTI_WINDOW_MAX_COUNT]; +}; +#endif /* BROWSER_MULTI_WINDOW_VIEW_H */ + diff --git a/src/browser-security/browser-authentication-manager.cpp b/src/browser-security/browser-authentication-manager.cpp new file mode 100755 index 00000000..9693f71e --- /dev/null +++ b/src/browser-security/browser-authentication-manager.cpp @@ -0,0 +1,174 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "browser-authentication-manager.h" + +Evas_Object *Browser_Authetication_Manager::m_popup; +Evas_Object *Browser_Authetication_Manager::m_user_name_edit_field; +Evas_Object *Browser_Authetication_Manager::m_password_edit_field; + +Browser_Authetication_Manager::Browser_Authetication_Manager(void) +{ + BROWSER_LOGD("[%s]", __func__); +} + +Browser_Authetication_Manager::~Browser_Authetication_Manager(void) +{ + BROWSER_LOGD("[%s]", __func__); + if (m_popup) + evas_object_del(m_popup); + if (m_user_name_edit_field) + evas_object_del(m_user_name_edit_field); + if (m_password_edit_field) + evas_object_del(m_password_edit_field); +} + +Eina_Bool Browser_Authetication_Manager::init(void) +{ + BROWSER_LOGD("[%s]", __func__); + + /* Why this callback doesn't support user data? !!! */ + ewk_auth_show_dialog_callback_set(__show_auth_dialog_cb); + + return EINA_TRUE; +} + +void Browser_Authetication_Manager::__show_auth_dialog_cb(const char* msg, const char* uri, void* data) +{ + BROWSER_LOGD("[%s]", __func__); + + m_popup = elm_popup_add(m_navi_bar); + if (!m_popup) { + BROWSER_LOGE("elm_popup_add failed"); + return; + } + + evas_object_size_hint_weight_set(m_popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_popup_orient_set(m_popup, ELM_POPUP_ORIENT_TOP); + elm_object_part_text_set(m_popup, msg, "elm.text"); + + Evas_Object *ok_button = elm_button_add(m_popup); + elm_object_text_set(ok_button, "OK"); + elm_object_part_content_set(m_popup, "button1", ok_button); + evas_object_smart_callback_add(ok_button, "clicked", __popup_reponse_cb, data); + + Evas_Object *cancel_button = elm_button_add(m_popup); + elm_object_text_set(cancel_button, "Cancel"); + elm_object_part_content_set(m_popup, "button2", cancel_button); + evas_object_smart_callback_add(cancel_button, "clicked", __popup_cancel_cb, data); + + Evas_Object *content_box = elm_box_add(m_popup); + if (!content_box) { + BROWSER_LOGE("elm_box_add failed"); + return; + } + evas_object_size_hint_weight_set(content_box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(content_box, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_show(content_box); + + m_user_name_edit_field = br_elm_editfield_add(m_popup); + if (!m_user_name_edit_field) { + BROWSER_LOGE("elm_editfield_add failed"); + return; + } + br_elm_editfield_guide_text_set(m_user_name_edit_field, BR_STRING_USER_NAME); + evas_object_size_hint_weight_set(m_user_name_edit_field, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(m_user_name_edit_field, EVAS_HINT_FILL, EVAS_HINT_FILL); + br_elm_editfield_entry_single_line_set(m_user_name_edit_field, EINA_TRUE); + evas_object_show(m_user_name_edit_field); + elm_box_pack_end(content_box, m_user_name_edit_field); + + m_password_edit_field = br_elm_editfield_add(m_popup); + if (!m_password_edit_field) { + BROWSER_LOGE("elm_editfield_add failed"); + return; + } + br_elm_editfield_guide_text_set(m_password_edit_field, BR_STRING_PASSWORD); + evas_object_size_hint_weight_set(m_password_edit_field, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(m_password_edit_field, EVAS_HINT_FILL, EVAS_HINT_FILL); + br_elm_editfield_entry_single_line_set(m_password_edit_field, EINA_TRUE); + elm_entry_password_set(br_elm_editfield_entry_get(m_password_edit_field), EINA_TRUE); + evas_object_show(m_password_edit_field); + elm_box_pack_end(content_box, m_password_edit_field); + + elm_object_content_set(m_popup, content_box); + + evas_object_show(m_popup); + + elm_object_focus_set(m_user_name_edit_field, EINA_TRUE); +} + +void Browser_Authetication_Manager::__popup_reponse_cb(void* data, Evas_Object* obj, void* event_info) +{ + BROWSER_LOGD("[%s]", __func__); + char *user_name = NULL; + char *password = NULL; + + user_name = strdup(elm_entry_entry_get(br_elm_editfield_entry_get(m_user_name_edit_field))); + password = strdup(elm_entry_entry_get(br_elm_editfield_entry_get(m_password_edit_field))); + + BROWSER_LOGD("user_name=[%s], passwrd=[%s]", user_name, password); + ewk_auth_credentials_set(user_name, password, data); + + Ecore_IMF_Context *ic = (Ecore_IMF_Context *)elm_entry_imf_context_get(br_elm_editfield_entry_get(m_user_name_edit_field)); + if (!ic) + ic = (Ecore_IMF_Context *)elm_entry_imf_context_get(br_elm_editfield_entry_get(m_password_edit_field)); + if (ic) + ecore_imf_context_input_panel_hide(ic); + + if (m_popup) { + evas_object_del(m_popup); + m_popup = NULL; + } + if (m_user_name_edit_field) { + evas_object_del(m_user_name_edit_field); + m_user_name_edit_field = NULL; + } + if (m_password_edit_field) { + evas_object_del(m_password_edit_field); + m_password_edit_field = NULL; + } + + if (user_name) + free(user_name); + if (password) + free(password); +} + +void Browser_Authetication_Manager::__popup_cancel_cb(void* data, Evas_Object* obj, void* event_info) +{ + BROWSER_LOGD("[%s]", __func__); + + Ecore_IMF_Context *ic = (Ecore_IMF_Context *)elm_entry_imf_context_get(br_elm_editfield_entry_get(m_user_name_edit_field)); + if (!ic) + ic = (Ecore_IMF_Context *)elm_entry_imf_context_get(br_elm_editfield_entry_get(m_password_edit_field)); + if (ic) + ecore_imf_context_input_panel_hide(ic); + + if (m_popup) { + evas_object_del(m_popup); + m_popup = NULL; + } + if (m_user_name_edit_field) { + evas_object_del(m_user_name_edit_field); + m_user_name_edit_field = NULL; + } + if (m_password_edit_field) { + evas_object_del(m_password_edit_field); + m_password_edit_field = NULL; + } +} + diff --git a/src/browser-security/browser-authentication-manager.h b/src/browser-security/browser-authentication-manager.h new file mode 100755 index 00000000..639e69b1 --- /dev/null +++ b/src/browser-security/browser-authentication-manager.h @@ -0,0 +1,44 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef BROWSER_PERSONAL_DATA_MANAGER_H +#define BROWSER_PERSONAL_DATA_MANAGER_H + +#include "browser-common-view.h" +#include "browser-config.h" + +#include <string> + +using namespace std; + +class Browser_Authetication_Manager : public Browser_Common_View { +public: + Browser_Authetication_Manager(void); + ~Browser_Authetication_Manager(void); + + Eina_Bool init(void); +private: + static void __show_auth_dialog_cb(const char *msg, const char *uri, void *data); + static void __popup_reponse_cb(void* data, Evas_Object* obj, void* event_info); + static void __popup_cancel_cb(void* data, Evas_Object* obj, void* event_info); + + static Evas_Object *m_popup; + static Evas_Object *m_user_name_edit_field; + static Evas_Object *m_password_edit_field; +}; + +#endif /* BROWSER_PERSONAL_DATA_MANAGER_H */ + diff --git a/src/browser-security/browser-certificate-manager.cpp b/src/browser-security/browser-certificate-manager.cpp new file mode 100755 index 00000000..b6d321a1 --- /dev/null +++ b/src/browser-security/browser-certificate-manager.cpp @@ -0,0 +1,263 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include <cstdio> +#include <ctime> +#include <dirent.h> +#include <fstream> +#include <iostream> + +#include "browser-class.h" +#include "browser-certificate-manager.h" +#include "browser-view.h" +#include "browser-window.h" + +Browser_Certificate_Manager::Browser_Certificate_Manager(void) +: m_certificate_list(NULL) + ,m_certificate(NULL) +{ + BROWSER_LOGD("[%s]", __func__); +} + +Browser_Certificate_Manager::~Browser_Certificate_Manager(void) +{ + BROWSER_LOGD("[%s]", __func__); + if (m_certificate) { + delete [] m_certificate->data; + delete m_certificate; + m_certificate = NULL; + } + + _destroy_certificate_list(); + + remove(CERTIFICATES_TMP_FILE); +} + +Eina_Bool Browser_Certificate_Manager::init(void) +{ + BROWSER_LOGD("[%s]", __func__); + + if (!_create_crt_file(CERTIFICATES_DIR, CERTIFICATES_TMP_FILE)) { + BROWSER_LOGE("_create_crt_file failed"); + return EINA_FALSE; + } + + ewk_set_certificate_file(CERTIFICATES_TMP_FILE); + ewk_set_certificate_confirmation_callback(__certificate_confirm_cb); + + return EINA_TRUE; +} + +void Browser_Certificate_Manager::reset_certificate(void) +{ + BROWSER_LOGD("[%s]", __func__); + _destroy_certificate_list(); +} + +Eina_Bool Browser_Certificate_Manager::__certificate_confirm_cb(Eina_Bool is_trused, const char *uri, + char *certificate_source, int error) +{ + BROWSER_LOGD("[%s]", __func__); + + std::string domain = m_data_manager->get_browser_view()->get_domain_name(uri); + BROWSER_LOGD("domain=[%s], error=%d", domain.c_str(), error); + + Evas_Object *webview = m_data_manager->get_browser_view()->get_focused_webview(); + Evas_Object *webkit = elm_webview_webkit_get(webview); + + Browser_Certificate_Manager *certificate_manager = NULL; + certificate_manager = m_browser->get_certificate_manager(); + gnutls_datum_t *certificate = certificate_manager->_create_certificate(certificate_source); + if (!certificate) + BROWSER_LOGE("_create_certificate failed"); + + std::string error_string; + if (error & UNKNOWN_CA) { + /* SS_UNKNOWN_CERTIFICATE_AUTHORITY */ + error_string = "Unknown certificate authority"; + } else if (error & BAD_IDENTITY) { + error_string = "Certificate : Bad-Identity"; + } else if (error & NOT_ACTIVATED) { + error_string = "Certificate is not activated"; + } else if (error & EXPIRED) { + /* SS_CERTIFICATE_EXPIRED */ + error_string = "Certificate expired"; + } else if (error & REVOKED) { + /* SS_CERTIFICATE_REVOKED */ + error_string = "Certificate revoked"; + } else if (error & INSECURE) { + error_string = "Certificate insecured"; + } else if (error & GENERIC_ERROR) { + /* SS_CERTIFICATE_ERROR */ + error_string = "Certificate error"; + } + + if (certificate) + certificate_manager->_print_certificate(certificate); + + if (!error_string.empty()) { + ewk_view_suspend_request(webkit); + + if (!certificate_manager->show_modal_popup(error_string.c_str())) + BROWSER_LOGE("show_modal_popup failed"); + + ewk_view_resume_request(webkit); + } + + if (certificate) + delete certificate; + + return EINA_TRUE; +} + +void Browser_Certificate_Manager::_destroy_certificate_list(void) +{ + BROWSER_LOGD("[%s]", __func__); + void *item_data = NULL; + EINA_LIST_FREE(m_certificate_list, item_data) { + if (item_data) { + gnutls_datum_t *certificate_item = (gnutls_datum_t *)item_data; + delete [] certificate_item->data; + delete certificate_item; + } + } +} + +static int _pem_file_selector(const struct dirent *dir_entity) +{ + BROWSER_LOGD("[%s]", __func__); + if (!dir_entity->d_name) + return 0; + + int len = strlen(dir_entity->d_name); + if (len < 4) + return 0; + + if (strncmp(dir_entity->d_name + (len - 4), ".pem", 4 ) == 0) + return 1; + + return 0; +} + +Eina_Bool Browser_Certificate_Manager::_create_crt_file(const char *dir_path, const char *des_file_path) +{ + BROWSER_LOGD("[%s]", __func__); + struct dirent **name_list = NULL; + int result = scandir(dir_path, &name_list, _pem_file_selector, alphasort); + if (result < 0) + return EINA_FALSE; + + ofstream dest_file(des_file_path); + dest_file.seekp (0, ios::end); + std::string line; + + if (!dest_file.is_open()) + return EINA_FALSE; + + while (result--) { + std::string full_patch = std::string(dir_path) + std::string(name_list[result]->d_name); + ifstream src_file(full_patch.c_str()); + if( src_file.is_open()) { + while (!src_file.eof()) { + getline(src_file, line); + dest_file << line; + if (!src_file.eof()) + dest_file << std::endl; + } + src_file.close(); + } + + free(name_list[result]); + } + + free(name_list); + dest_file.close(); + + return EINA_TRUE; +} + +void Browser_Certificate_Manager::_print_certificate(const gnutls_datum_t *certificate) +{ + BROWSER_LOGD("[%s]", __func__); + gnutls_datum_t cinfo; + gnutls_x509_crt_t cert; + + gnutls_x509_crt_init(&cert); + gnutls_x509_crt_import(cert, certificate, GNUTLS_X509_FMT_DER); + + int ret = gnutls_x509_crt_print(cert, GNUTLS_CRT_PRINT_ONELINE, &cinfo); + if (!ret) { + BROWSER_LOGD ("%s", cinfo.data); + gnutls_free (cinfo.data); + } +} + +gnutls_datum_t *Browser_Certificate_Manager::_create_certificate(char *certificate_source) +{ + BROWSER_LOGD("[%s]", __func__); + if (!certificate_source || !strlen(certificate_source)) { + BROWSER_LOGE("certificate_source is null"); + return NULL; + } + + gnutls_datum_t *certificate = new(nothrow) gnutls_datum_t; + if (!certificate) { + BROWSER_LOGE("new(nothrow) gnutls_datum_t failed"); + return NULL; + } + certificate->size = strlen(certificate_source); + certificate->data = new(nothrow) unsigned char[certificate->size]; + if (!certificate->data) { + BROWSER_LOGE("new(nothrow) failed"); + return NULL; + } + memcpy(certificate->data, certificate_source, certificate->size); + + return certificate; +} + +Eina_Bool Browser_Certificate_Manager::_create_certificate_list(Eina_List *certificate_list) +{ + BROWSER_LOGD("[%s]", __func__); + if (!certificate_list) { + BROWSER_LOGE("certificate_list failed"); + return EINA_FALSE; + } + + const gnutls_datum_t *certificate; + Eina_List *list = NULL; + void *item_data = NULL; + + EINA_LIST_FOREACH(certificate_list, list, item_data) { + certificate = reinterpret_cast<const gnutls_datum_t *>(item_data); + gnutls_datum_t *certificate_item = new(nothrow) gnutls_datum_t; + if (!certificate_item) { + BROWSER_LOGE("new gnutls_datum_t failed"); + return EINA_FALSE; + } + certificate_item->size = certificate->size; + certificate_item->data = new(nothrow) unsigned char[certificate_item->size]; + if (!certificate_item->data) { + BROWSER_LOGE("new unsigned char failed"); + return EINA_FALSE; + } + memcpy(certificate_item->data, certificate->data, certificate_item->size); + + m_certificate_list = eina_list_append(m_certificate_list, certificate_item); + } + + return EINA_TRUE; +} diff --git a/src/browser-security/browser-certificate-manager.h b/src/browser-security/browser-certificate-manager.h new file mode 100755 index 00000000..296079a6 --- /dev/null +++ b/src/browser-security/browser-certificate-manager.h @@ -0,0 +1,62 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef BROWSER_CERTIFICATE_MANAGER_H +#define BROWSER_CERTIFICATE_MANAGER_H + +#include <gnutls/gnutls.h> +#include <gnutls/x509.h> +#include <string> + +#include "browser-common-view.h" +#include "browser-config.h" + +using namespace std; + +class Browser_Certificate_Manager : public Browser_Common_View { +public: + Browser_Certificate_Manager(void); + ~Browser_Certificate_Manager(void); + + Eina_Bool init(void); + void reset_certificate(void); + + typedef enum { + UNKNOWN_CA = (1 << 0), + BAD_IDENTITY = (1 << 1), + NOT_ACTIVATED = (1 << 2), + EXPIRED = (1 << 3), + REVOKED = (1 << 4), + INSECURE = (1 << 5), + GENERIC_ERROR = (1 << 6), + VALIDATE_ALL = 0x007f + } certificate_error_code; +private: + void _destroy_certificate_list(void); + Eina_Bool _create_crt_file(const char *dir_path, const char *des_file_path); + Eina_Bool _create_certificate_list(Eina_List *certificate_list); + gnutls_datum_t *_create_certificate(char *certificate_source); + void _print_certificate(const gnutls_datum_t *certificate); + + static Eina_Bool __certificate_confirm_cb(Eina_Bool is_trused, const char *uri, + char *certificate_source, int error); + + Eina_List *m_certificate_list; + gnutls_datum_t* m_certificate; +}; + +#endif /* BROWSER_CERTIFICATE_MANAGER_H */ + diff --git a/src/browser-security/browser-personal-data-manager.cpp b/src/browser-security/browser-personal-data-manager.cpp new file mode 100755 index 00000000..fc0ab0c9 --- /dev/null +++ b/src/browser-security/browser-personal-data-manager.cpp @@ -0,0 +1,180 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "browser-personal-data-manager.h" + +Browser_Personal_Data_Manager::Browser_Personal_Data_Manager(void) +: m_webview(NULL) + ,m_popup(NULL) +{ + BROWSER_LOGD("[%s]", __func__); + + m_personal_data_db = new(nothrow) Browser_Personal_Data_DB; + if (!m_personal_data_db) { + BROWSER_LOGE("new Browser_Personal_Data_DB failed"); + } +} + +Browser_Personal_Data_Manager::~Browser_Personal_Data_Manager(void) +{ + BROWSER_LOGD("[%s]", __func__); + if (m_popup) + evas_object_del(m_popup); + + if (m_personal_data_db) + delete m_personal_data_db; +} + +Eina_Bool Browser_Personal_Data_Manager::clear_personal_data(void) +{ + BROWSER_LOGD("[%s]", __func__); + if (m_personal_data_db) { + return m_personal_data_db->clear_personal_data(); + } + + return EINA_FALSE; +} + +personal_data_save_mode Browser_Personal_Data_Manager::_get_save_mode(void) +{ + BROWSER_LOGD("[%s]", __func__); + char *save_mode = vconf_get_str(AUTO_SAVE_ID_PASSWORD_KEY); + if (!save_mode) { + BROWSER_LOGE("vconf_get_str failed"); + return SAVE_PERSONAL_DATA_ALWAYS_ASK; + } + + personal_data_save_mode mode; + if (!strncmp(save_mode, ALWAYS_ASK, strlen(ALWAYS_ASK))) { + BROWSER_LOGD("SAVE_PERSONAL_DATA_ALWAYS_ASK"); + mode = SAVE_PERSONAL_DATA_ALWAYS_ASK; + } else if (!strncmp(save_mode, ALWAYS_ON, strlen(ALWAYS_ON))) { + BROWSER_LOGD("SAVE_PERSONAL_DATA_ON"); + mode = SAVE_PERSONAL_DATA_ON; + } else { + BROWSER_LOGD("SAVE_PERSONAL_DATA_OFF"); + mode = SAVE_PERSONAL_DATA_OFF; + } + + free(save_mode); + + return mode; +} + +Eina_Bool Browser_Personal_Data_Manager::set_personal_data(const char *url) +{ + if (_get_save_mode() == SAVE_PERSONAL_DATA_OFF || !m_personal_data_db) { + BROWSER_LOGE("SAVE_PERSONAL_DATA_OFF"); + return EINA_FALSE; + } + + std::string user_name; + std::string password; + std::string domain = get_domain_name(url); + if (!m_personal_data_db->get_personal_data(user_name, password, domain)) { + BROWSER_LOGE("get_personal_data failed"); + return EINA_FALSE; + } + + Evas_Object *webkit = elm_webview_webkit_get(m_webview); + if (!ewk_view_autofill_personal_data(webkit, user_name.c_str(), password.c_str())) + BROWSER_LOGE("ewk_view_autofill_personal_data failed"); +} + +Eina_Bool Browser_Personal_Data_Manager::_save_personal_data(std::string user_name, + std::string password, std::string url) +{ + BROWSER_LOGD("[%s]", __func__); + if (m_personal_data_db) + return m_personal_data_db->save_personal_data(url, user_name, password); + + return EINA_FALSE; +} + +int Browser_Personal_Data_Manager::_show_ask_confirm_popup(void) +{ + BROWSER_LOGD("[%s]", __func__); + if (m_popup) + evas_object_del(m_popup); + + m_popup = elm_popup_add(m_navi_bar); + if (!m_popup) { + BROWSER_LOGE("elm_popup_add failed"); + return 1; + } + + evas_object_size_hint_weight_set(m_popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + + std::string confirm_msg = std::string("Remember private data?"); + elm_object_text_set(m_popup, confirm_msg.c_str()); + + evas_object_show(m_popup); + + evas_object_focus_set(m_popup, EINA_TRUE); + + return 1; +} + +void Browser_Personal_Data_Manager::__submit_clicked_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_Personal_Data_Manager *manager = (Browser_Personal_Data_Manager *)data; + const char **personal_data = (const char **)event_info; + std::string user_name = personal_data[0]; + std::string password = personal_data[1]; + std::string url = manager->get_domain_name(personal_data[2]); + BROWSER_LOGD("user_name=[%s], password=[%s], url=[%s]", user_name.c_str(), password.c_str(), url.c_str()); + + personal_data_save_mode save_mode = manager->_get_save_mode(); + if (save_mode == SAVE_PERSONAL_DATA_OFF) { + BROWSER_LOGD("SAVE_PERSONAL_DATA_OFF"); + return; + } else if (save_mode == SAVE_PERSONAL_DATA_ON) { + BROWSER_LOGD("SAVE_PERSONAL_DATA_ON"); + if (!manager->_save_personal_data(user_name, password, url)) + BROWSER_LOGE("_save_personal_data failed"); + } else { + if (!manager->_save_personal_data(user_name, password, url)) + BROWSER_LOGE("_save_personal_data failed"); + evas_object_del(manager->m_popup); + manager->m_popup = NULL; + } +} + +void Browser_Personal_Data_Manager::init(Evas_Object *webview) +{ + BROWSER_LOGD("[%s]", __func__); + deinit(); + + m_webview = webview; + Evas_Object *webkit = elm_webview_webkit_get(m_webview); + evas_object_smart_callback_add(ewk_view_frame_main_get(webkit), + "submit,clicked", __submit_clicked_cb, this); +} + +void Browser_Personal_Data_Manager::deinit(void) +{ + BROWSER_LOGD("[%s]", __func__); + if (m_webview) { + Evas_Object *webkit = elm_webview_webkit_get(m_webview); + evas_object_smart_callback_del(ewk_view_frame_main_get(webkit), + "submit,clicked", __submit_clicked_cb); + } +} + diff --git a/src/browser-security/browser-personal-data-manager.h b/src/browser-security/browser-personal-data-manager.h new file mode 100755 index 00000000..64be0ce8 --- /dev/null +++ b/src/browser-security/browser-personal-data-manager.h @@ -0,0 +1,60 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef BROWSER_PERSONAL_DATA_MANAGER_H +#define BROWSER_PERSONAL_DATA_MANAGER_H + +#include "browser-common-view.h" +#include "browser-personal-data-db.h" + +#include <string> + +using namespace std; + +typedef enum _personal_data_save_mode { + SAVE_PERSONAL_DATA_ALWAYS_ASK, + SAVE_PERSONAL_DATA_ON, + SAVE_PERSONAL_DATA_OFF, +} personal_data_save_mode; + +class Browser_Personal_Data_Manager : public Browser_Common_View { +public: + Browser_Personal_Data_Manager(void); + ~Browser_Personal_Data_Manager(void); + + Eina_Bool init(void) {} + + void init(Evas_Object *webview); + void deinit(void); + + Eina_Bool clear_personal_data(void); + Eina_Bool set_personal_data(const char *url); +private: + personal_data_save_mode _get_save_mode(void); + Eina_Bool _save_personal_data(std::string user_name, + std::string password, std::string url); + int _show_ask_confirm_popup(void); + + /* Elementary event callback functions */ + static void __submit_clicked_cb(void *data, Evas_Object *obj, void *event_info); + + Evas_Object *m_webview; + Browser_Personal_Data_DB *m_personal_data_db; + Evas_Object *m_popup; +}; + +#endif /* BROWSER_PERSONAL_DATA_MANAGER_H */ + diff --git a/src/browser-settings/browser-settings-accelerated-composition.cpp b/src/browser-settings/browser-settings-accelerated-composition.cpp new file mode 100755 index 00000000..928d246d --- /dev/null +++ b/src/browser-settings/browser-settings-accelerated-composition.cpp @@ -0,0 +1,259 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "browser-settings-accelerated-composition.h" + +Browser_Settings_Accelerated_Composition::Browser_Settings_Accelerated_Composition(Browser_Settings_Main_View *main_view) +: + m_genlist(NULL) + ,m_back_button(NULL) + ,m_accelerated_composition_check_button(NULL) + ,m_external_video_player_check_button(NULL) + ,m_main_view(main_view) +{ + BROWSER_LOGD("[%s]", __func__); +} + +Browser_Settings_Accelerated_Composition::~Browser_Settings_Accelerated_Composition(void) +{ + BROWSER_LOGD("[%s]", __func__); +} + +Eina_Bool Browser_Settings_Accelerated_Composition::init(void) +{ + BROWSER_LOGD("[%s]", __func__); + + if (!_create_main_layout()) { + BROWSER_LOGE("_create_main_layout failed"); + return EINA_FALSE; + } + + return EINA_TRUE; +} + +void Browser_Settings_Accelerated_Composition::__accelerated_composition_check_button_changed_cb(void *data, + Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_Settings_Accelerated_Composition *acceleration_composition_view = (Browser_Settings_Accelerated_Composition *)data; + + const char *key = ACCELERATED_COMPOSITION_KEY; + Eina_Bool state = elm_check_state_get(obj); + + if (vconf_set_bool(key, state) != 0) + BROWSER_LOGE("Key: [%s], FAILED\n", key); + + if(!state) { + /* Accelerated composition OFF, external video ON. external Video buttons must be disabled. CompositedRenderLayerBorders must be disabled.*/ + elm_check_state_set(acceleration_composition_view->m_external_video_player_check_button, state); + if(vconf_set_bool(EXTERNAL_VIDEO_PLAYER_KEY, 1)!=0) + BROWSER_LOGE("Key: %s, FAILED\n", EXTERNAL_VIDEO_PLAYER_KEY); + elm_check_state_set(acceleration_composition_view->m_external_video_player_check_button, EINA_TRUE); + elm_object_disabled_set(acceleration_composition_view->m_external_video_player_check_button, EINA_TRUE); + elm_object_item_disabled_set(acceleration_composition_view->m_accelerated_external_video_player_callback_data.it, EINA_TRUE); + } else { + /* Accelerated composition ON , external video OFF */ + elm_object_disabled_set(acceleration_composition_view->m_external_video_player_check_button, EINA_FALSE); + elm_object_item_disabled_set(acceleration_composition_view->m_accelerated_external_video_player_callback_data.it, EINA_FALSE); + } +} + +void Browser_Settings_Accelerated_Composition::__external_video_player_check_button_changed_cb(void *data, + Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_Settings_Accelerated_Composition *acceleration_composition_view = (Browser_Settings_Accelerated_Composition *)data; + + const char *key = EXTERNAL_VIDEO_PLAYER_KEY; + Eina_Bool state = elm_check_state_get(obj); + if (vconf_set_bool(key, state) != 0) + BROWSER_LOGE("Key: [%s], FAILED\n", key); +} +Evas_Object *Browser_Settings_Accelerated_Composition::__genlist_icon_get(void *data, + Evas_Object *obj, const char *part) +{ + if (!data) + return NULL; + + genlist_callback_data *callback_data = (genlist_callback_data *)data; + Browser_Settings_Accelerated_Composition::menu_type type = callback_data->type; + Browser_Settings_Accelerated_Composition *acceleration_composition_view = (Browser_Settings_Accelerated_Composition *)callback_data->user_data; + + if (type == BR_ACCELERATED_COMPOSITION) { + if (!strncmp(part, "elm.icon", strlen("elm.icon"))) { + acceleration_composition_view->m_accelerated_composition_check_button = elm_check_add(obj); + if (!acceleration_composition_view->m_accelerated_composition_check_button) { + BROWSER_LOGD("elm_check_add failed"); + return NULL; + } + elm_object_style_set(acceleration_composition_view->m_accelerated_composition_check_button, "on&off"); + evas_object_propagate_events_set(acceleration_composition_view->m_accelerated_composition_check_button, EINA_FALSE); + + int accelerated_composition = 1; + if (vconf_get_bool(ACCELERATED_COMPOSITION_KEY, &accelerated_composition) < 0) + BROWSER_LOGE("vconf_get_bool failed"); + elm_check_state_set(acceleration_composition_view->m_accelerated_composition_check_button, accelerated_composition); + evas_object_smart_callback_add(acceleration_composition_view->m_accelerated_composition_check_button, "changed", + __accelerated_composition_check_button_changed_cb, acceleration_composition_view); + return acceleration_composition_view->m_accelerated_composition_check_button; + } + } + else if (type == BR_EXTERNAL_VIDEO_PLAYER) { + if (!strncmp(part, "elm.icon", strlen("elm.icon"))) { + acceleration_composition_view->m_external_video_player_check_button = elm_check_add(obj); + if (!acceleration_composition_view->m_external_video_player_check_button) { + BROWSER_LOGD("elm_check_add failed"); + return NULL; + } + elm_object_style_set(acceleration_composition_view->m_external_video_player_check_button, "on&off"); + evas_object_propagate_events_set(acceleration_composition_view->m_external_video_player_check_button, EINA_FALSE); + + int external_video_player = 1; + if (vconf_get_bool(EXTERNAL_VIDEO_PLAYER_KEY, &external_video_player) < 0) + BROWSER_LOGE("vconf_get_bool failed"); + elm_check_state_set(acceleration_composition_view->m_external_video_player_check_button, external_video_player); + evas_object_smart_callback_add(acceleration_composition_view->m_external_video_player_check_button, "changed", + __external_video_player_check_button_changed_cb, acceleration_composition_view); + return acceleration_composition_view->m_external_video_player_check_button; + } + } + + return NULL; +} + +char *Browser_Settings_Accelerated_Composition::__genlist_label_get(void *data, + Evas_Object *obj, const char *part) +{ + if (!data) + return NULL; + + genlist_callback_data *callback_data = (genlist_callback_data *)data; + Browser_Settings_Accelerated_Composition::menu_type type = callback_data->type; + if(type == BR_ACCELERATED_COMPOSITION) { + if (!strncmp(part, "elm.text", strlen("elm.text"))) { + return strdup(_("Accelerated composition")); + } + } + else if(type == BR_EXTERNAL_VIDEO_PLAYER) { + if (!strncmp(part, "elm.text", strlen("elm.text"))) { + return strdup(_("External video player")); + } + } +} + +void Browser_Settings_Accelerated_Composition::__item_selected_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + genlist_callback_data *callback_data = (genlist_callback_data *)data; + Browser_Settings_Accelerated_Composition::menu_type type = callback_data->type; + Browser_Settings_Accelerated_Composition *acceleration_composition_view = (Browser_Settings_Accelerated_Composition *)callback_data->user_data; + + if (type == BR_ACCELERATED_COMPOSITION) { + int value = elm_check_state_get(acceleration_composition_view->m_accelerated_composition_check_button); + elm_check_state_set(acceleration_composition_view->m_accelerated_composition_check_button, !value); + + __accelerated_composition_check_button_changed_cb(acceleration_composition_view, acceleration_composition_view->m_accelerated_composition_check_button, NULL); + + elm_genlist_item_selected_set(acceleration_composition_view->m_accelerated_composition_callback_data.it, EINA_FALSE); + } + else if (type == BR_EXTERNAL_VIDEO_PLAYER) { + int value = elm_check_state_get(acceleration_composition_view->m_external_video_player_check_button); + elm_check_state_set(acceleration_composition_view->m_external_video_player_check_button, !value); + + __external_video_player_check_button_changed_cb(acceleration_composition_view, acceleration_composition_view->m_external_video_player_check_button, NULL); + + elm_genlist_item_selected_set(acceleration_composition_view->m_accelerated_external_video_player_callback_data.it, EINA_FALSE); + } +} + +void Browser_Settings_Accelerated_Composition::__back_button_clicked_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + + if (elm_naviframe_bottom_item_get(m_navi_bar) + != elm_naviframe_top_item_get(m_navi_bar)) + elm_naviframe_item_pop(m_navi_bar); +} + +Eina_Bool Browser_Settings_Accelerated_Composition::_create_main_layout(void) +{ + BROWSER_LOGD("[%s]", __func__); + + m_genlist = elm_genlist_add(m_navi_bar); + if (!m_genlist) { + BROWSER_LOGE("elm_genlist_add failed"); + return EINA_FALSE; + } + + m_seperator_item_class.item_style = "dialogue/seperator"; + m_seperator_item_class.func.text_get = NULL; + m_seperator_item_class.func.content_get = NULL; + m_seperator_item_class.func.del = NULL; + m_seperator_item_class.func.state_get = NULL; + + Elm_Object_Item *it = elm_genlist_item_append(m_genlist, &m_seperator_item_class, + NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL); + elm_genlist_item_select_mode_set(it, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY); + + m_1_text_1_icon_item_class.item_style = "dialogue/1text.1icon"; + m_1_text_1_icon_item_class.func.text_get = __genlist_label_get; + m_1_text_1_icon_item_class.func.content_get = __genlist_icon_get; + m_1_text_1_icon_item_class.func.del = NULL; + m_1_text_1_icon_item_class.func.state_get = NULL; + + m_accelerated_composition_callback_data.type = BR_ACCELERATED_COMPOSITION; + m_accelerated_composition_callback_data.user_data = this; + m_accelerated_composition_callback_data.it = elm_genlist_item_append(m_genlist, &m_1_text_1_icon_item_class, &m_accelerated_composition_callback_data, + NULL, ELM_GENLIST_ITEM_NONE, __item_selected_cb, &m_accelerated_composition_callback_data); + + m_accelerated_external_video_player_callback_data.type = BR_EXTERNAL_VIDEO_PLAYER; + m_accelerated_external_video_player_callback_data.user_data = this; + m_accelerated_external_video_player_callback_data.it = elm_genlist_item_append(m_genlist, &m_1_text_1_icon_item_class, &m_accelerated_external_video_player_callback_data, + NULL, ELM_GENLIST_ITEM_NONE, __item_selected_cb, &m_accelerated_external_video_player_callback_data); + + int acceleratedComposition = 1; + if(vconf_get_bool(ACCELERATED_COMPOSITION_KEY, &acceleratedComposition) < 0) + BROWSER_LOGE("Can not get [%s] value.\n", __func__, ACCELERATED_COMPOSITION_KEY); + + if(!acceleratedComposition) + elm_object_item_disabled_set(m_accelerated_external_video_player_callback_data.it, EINA_TRUE); + + evas_object_show(m_genlist); + + m_back_button = elm_button_add(m_navi_bar); + if (!m_back_button) { + BROWSER_LOGE("elm_button_add failed"); + return EINA_FALSE; + } + elm_object_style_set(m_back_button, "browser/bookmark_controlbar_back"); + evas_object_show(m_back_button); + evas_object_smart_callback_add(m_back_button, "clicked", __back_button_clicked_cb, this); + + Elm_Object_Item *navi_it = elm_naviframe_item_push(m_navi_bar, _("Accelerated composition"), + m_back_button, NULL, m_genlist, "browser_titlebar"); + + return EINA_TRUE; +} + diff --git a/src/browser-settings/browser-settings-accelerated-composition.h b/src/browser-settings/browser-settings-accelerated-composition.h new file mode 100755 index 00000000..690fbf1f --- /dev/null +++ b/src/browser-settings/browser-settings-accelerated-composition.h @@ -0,0 +1,71 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef BROWSER_SETTINGS_ACCELERATED_COMPOSITION_H +#define BROWSER_SETTINGS_ACCELERATED_COMPOSITION_H + +#include "browser-common-view.h" +#include "browser-config.h" +#include "browser-settings-main-view.h" + +class Browser_Settings_Accelerated_Composition : public Browser_Common_View { +public: + Browser_Settings_Accelerated_Composition(Browser_Settings_Main_View *main_view); + ~Browser_Settings_Accelerated_Composition(void); + + Eina_Bool init(void); + + typedef enum _menu_type { + BR_ACCELERATED_COMPOSITION, + BR_EXTERNAL_VIDEO_PLAYER, + BR_UNKOWN + } menu_type; +private: + typedef struct _genlist_callback_data { + menu_type type; + void *user_data; + Elm_Object_Item *it; + } genlist_callback_data; + + Eina_Bool _create_main_layout(void); + + /* genlist callback functions */ + static Evas_Object *__genlist_icon_get(void *data, Evas_Object *obj, const char *part); + static char *__genlist_label_get(void *data, Evas_Object *obj, const char *part); + + /* Elementary event callback functions */ + static void __item_selected_cb(void *data, Evas_Object *obj, void *event_info); + static void __back_button_clicked_cb(void *data, Evas_Object *obj, void *event_info); + static void __accelerated_composition_check_button_changed_cb(void *data, + Evas_Object *obj, void *event_info); + static void __external_video_player_check_button_changed_cb(void *data, + Evas_Object *obj, void *event_info); + + Evas_Object *m_genlist; + Evas_Object *m_back_button; + Evas_Object *m_accelerated_composition_check_button; + Evas_Object *m_external_video_player_check_button; + + Elm_Genlist_Item_Class m_seperator_item_class; + Elm_Genlist_Item_Class m_1_text_1_icon_item_class; + + genlist_callback_data m_accelerated_composition_callback_data; + genlist_callback_data m_accelerated_external_video_player_callback_data; + Browser_Settings_Main_View *m_main_view; +}; + +#endif /* BROWSER_SETTINGS_ACCELERATED_COMPOSITION_H */ + diff --git a/src/browser-settings/browser-settings-class.cpp b/src/browser-settings/browser-settings-class.cpp new file mode 100755 index 00000000..54ecc770 --- /dev/null +++ b/src/browser-settings/browser-settings-class.cpp @@ -0,0 +1,50 @@ +/*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "browser-settings-class.h"
+#include "browser-settings-main-view.h"
+
+Browser_Settings_Class::Browser_Settings_Class(void)
+:
+ m_settings_main_view(NULL)
+{
+ BROWSER_LOGD("[%s]", __func__);
+}
+
+Browser_Settings_Class::~Browser_Settings_Class(void)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ if (m_settings_main_view)
+ delete m_settings_main_view;
+}
+
+Eina_Bool Browser_Settings_Class::init(void)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ m_settings_main_view = new(nothrow) Browser_Settings_Main_View;
+ if (!m_settings_main_view) {
+ BROWSER_LOGE("new Browser_Settings_Main_View failed");
+ return EINA_FALSE;
+ }
+
+ if (!m_settings_main_view->init()) {
+ BROWSER_LOGE("m_settings_main_view->init() failed");
+ return EINA_FALSE;
+ }
+
+ return EINA_TRUE;
+}
+
diff --git a/src/browser-settings/browser-settings-class.h b/src/browser-settings/browser-settings-class.h new file mode 100755 index 00000000..7862c127 --- /dev/null +++ b/src/browser-settings/browser-settings-class.h @@ -0,0 +1,35 @@ +/*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef BROWSER_SETTINGS_CLASS_H
+#define BROWSER_SETTINGS_CLASS_H
+
+#include "browser-config.h"
+
+class Browser_Settings_Main_View;
+
+class Browser_Settings_Class {
+public:
+ Browser_Settings_Class(void);
+ ~Browser_Settings_Class(void);
+
+ Eina_Bool init(void);
+private:
+ Browser_Settings_Main_View *m_settings_main_view;
+};
+
+#endif /* BROWSER_SETTINGS_CLASS_H */
+
diff --git a/src/browser-settings/browser-settings-clear-data-view.cpp b/src/browser-settings/browser-settings-clear-data-view.cpp new file mode 100755 index 00000000..77a0f261 --- /dev/null +++ b/src/browser-settings/browser-settings-clear-data-view.cpp @@ -0,0 +1,508 @@ +/*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "browser-class.h"
+#include "browser-data-manager.h"
+#include "browser-history-db.h"
+#include "browser-personal-data-manager.h"
+#include "browser-settings-clear-data-view.h"
+#include "browser-view.h"
+
+Browser_Settings_Clear_Data_View::Browser_Settings_Clear_Data_View(Browser_Settings_Main_View *main_view)
+:
+ m_main_view(main_view)
+ ,m_genlist(NULL)
+ ,m_select_all_check_box(NULL)
+ ,m_history_check_box(NULL)
+ ,m_cache_check_box(NULL)
+ ,m_cookie_check_box(NULL)
+ ,m_saved_id_password_check_box(NULL)
+ ,m_select_all_layout(NULL)
+ ,m_content_box(NULL)
+ ,m_back_button(NULL)
+ ,m_bottom_control_bar(NULL)
+ ,m_delete_controlbar_item(NULL)
+ ,m_delete_confirm_popup(NULL)
+{
+ BROWSER_LOGD("[%s]", __func__);
+}
+
+Browser_Settings_Clear_Data_View::~Browser_Settings_Clear_Data_View(void)
+{
+ BROWSER_LOGD("[%s]", __func__);
+
+ hide_notify_popup();
+}
+
+Eina_Bool Browser_Settings_Clear_Data_View::init(void)
+{
+ return _create_main_layout();
+}
+
+void Browser_Settings_Clear_Data_View::__cancel_button_clicked_cb(void *data,
+ Evas_Object *obj, void *event_info)
+{
+ BROWSER_LOGD("[%s]", __func__);
+
+ if (elm_naviframe_bottom_item_get(m_navi_bar) != elm_naviframe_top_item_get(m_navi_bar))
+ elm_naviframe_item_pop(m_navi_bar);
+}
+
+void Browser_Settings_Clear_Data_View::_delete_private_data(void)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ if (elm_check_state_get(m_history_check_box)) {
+ /* Clear history */
+ if (!m_data_manager->get_history_db()->clear_history())
+ BROWSER_LOGE("get_history_db()->clear_history() failed");
+ }
+ if (elm_check_state_get(m_cache_check_box)) {
+ /* Clear cache */
+ if (!ewk_cache_clear())
+ BROWSER_LOGE("ewk_cache_clear failed");
+ }
+ if (elm_check_state_get(m_cookie_check_box)) {
+ /* Clear cookie */
+ ewk_cookies_clear();
+ }
+ if (elm_check_state_get(m_saved_id_password_check_box)) {
+ /* Clear saved id & password */
+ if (!m_data_manager->get_browser_view()->get_personal_data_manager()->clear_personal_data())
+ BROWSER_LOGE("clear_personal_data failed");
+ }
+}
+
+void Browser_Settings_Clear_Data_View::__delete_confirm_response_cb(void *data, Evas_Object *obj,
+ void *event_info)
+{
+ BROWSER_LOGD("event_info = %d", (int)event_info);
+
+ if (!data)
+ return;
+
+ Browser_Settings_Clear_Data_View *clear_data_view = (Browser_Settings_Clear_Data_View *)data;
+
+ evas_object_del(clear_data_view->m_delete_confirm_popup);
+
+ clear_data_view->_delete_private_data();
+ clear_data_view->show_notify_popup(BR_STRING_DELETED, 3, EINA_TRUE);
+
+ if (elm_naviframe_bottom_item_get(clear_data_view->m_navi_bar)
+ != elm_naviframe_top_item_get(clear_data_view->m_navi_bar))
+ elm_naviframe_item_pop(clear_data_view->m_navi_bar);
+ }
+
+void Browser_Settings_Clear_Data_View::__cancel_confirm_response_cb(void *data, Evas_Object *obj,
+ void *event_info)
+{
+ BROWSER_LOGD("event_info = %d", (int)event_info);
+
+ if (!data)
+ return;
+
+ Browser_Settings_Clear_Data_View *clear_data_view = (Browser_Settings_Clear_Data_View *)data;
+
+ evas_object_del(clear_data_view->m_delete_confirm_popup);
+}
+
+Evas_Object *Browser_Settings_Clear_Data_View::_show_delete_confirm_popup(void)
+{
+ BROWSER_LOGD("[%s]", __func__);
+
+ m_delete_confirm_popup = elm_popup_add(m_content_box);
+ if (!m_delete_confirm_popup) {
+ BROWSER_LOGE("elm_popup_add failed");
+ return NULL;
+ }
+
+ evas_object_size_hint_weight_set(m_delete_confirm_popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_object_text_set(m_delete_confirm_popup, BR_STRING_DELETE_Q);
+
+ Evas_Object *ok_button = elm_button_add(m_delete_confirm_popup);
+ if (!ok_button) {
+ BROWSER_LOGE("elm_button_add failed");
+ return NULL;
+ }
+ elm_object_text_set(ok_button, BR_STRING_YES);
+ elm_object_part_content_set(m_delete_confirm_popup, "button1", ok_button);
+ evas_object_smart_callback_add(ok_button, "clicked", __delete_confirm_response_cb, this);
+
+ Evas_Object *cancel_button = elm_button_add(m_delete_confirm_popup);
+ elm_object_text_set(cancel_button, BR_STRING_NO);
+ elm_object_part_content_set(m_delete_confirm_popup, "button2", cancel_button);
+ evas_object_smart_callback_add(cancel_button, "clicked", __cancel_confirm_response_cb, this);
+
+ return m_delete_confirm_popup;
+}
+
+void Browser_Settings_Clear_Data_View::__delete_button_clicked_cb(void *data,
+ Evas_Object *obj, void *event_info)
+{
+ BROWSER_LOGD("[%s]", __func__);
+
+ Browser_Settings_Clear_Data_View *clear_data_view = NULL;
+ clear_data_view = (Browser_Settings_Clear_Data_View *)data;
+
+ Evas_Object *popup = clear_data_view->_show_delete_confirm_popup();
+
+ evas_object_show(popup);
+}
+
+char *Browser_Settings_Clear_Data_View::__genlist_label_get(void *data,
+ Evas_Object *obj, const char *part)
+{
+ if (!data)
+ return NULL;
+
+ genlist_callback_data *callback_data = (genlist_callback_data *)data;
+ Browser_Settings_Clear_Data_View *clear_data_view = NULL;
+ clear_data_view = (Browser_Settings_Clear_Data_View *)callback_data->user_data;
+ menu_type type = callback_data->type;
+
+ if (type == BR_CLEAR_HISTORY) {
+ if (!strncmp(part, "elm.text", strlen("elm.text")))
+ return strdup(BR_STRING_HISTORY);
+ } else if (type == BR_CLEAR_CACHE) {
+ if (!strncmp(part, "elm.text", strlen("elm.text")))
+ return strdup(BR_STRING_CACHE);
+ } else if (type == BR_CLEAR_COOKIE) {
+ if (!strncmp(part, "elm.text", strlen("elm.text")))
+ return strdup(BR_STRING_COOKIE);
+ } else if (type == BR_CLEAR_SAVED_ID_PASSWORD) {
+ if (!strncmp(part, "elm.text", strlen("elm.text")))
+ return strdup(BR_STRING_SAVED_ID_PASSWORD);
+ }
+
+ return NULL;
+}
+
+void Browser_Settings_Clear_Data_View::__item_check_changed_cb(void* data, Evas_Object* obj,
+ void* event_info)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ if (!data)
+ return;
+
+ Browser_Settings_Clear_Data_View *clear_data_view = NULL;
+ clear_data_view = (Browser_Settings_Clear_Data_View *)data;
+
+ int selected_item_count = elm_check_state_get(clear_data_view->m_history_check_box)
+ + elm_check_state_get(clear_data_view->m_cache_check_box)
+ + elm_check_state_get(clear_data_view->m_cookie_check_box)
+ + elm_check_state_get(clear_data_view->m_saved_id_password_check_box);
+
+ clear_data_view->hide_notify_popup();
+
+ if (selected_item_count) {
+ if (selected_item_count == 4)
+ elm_check_state_set(clear_data_view->m_select_all_check_box, EINA_TRUE);
+ else
+ elm_check_state_set(clear_data_view->m_select_all_check_box, EINA_FALSE);
+
+ if (selected_item_count == 1) {
+ clear_data_view->show_notify_popup(BR_STRING_ONE_ITEM_SELECTED, 0, EINA_TRUE);
+ } else {
+ char *small_popup_text = NULL;
+ int string_len = strlen(BR_STRING_ITEMS_SELECTED) + 4; /* 4 : reserved for maximun count */
+
+ small_popup_text = (char *)malloc(string_len * sizeof(char));
+ memset(small_popup_text, 0x00, string_len);
+
+ snprintf(small_popup_text, string_len, BR_STRING_ITEMS_SELECTED, selected_item_count);
+ clear_data_view->show_notify_popup(small_popup_text, 0, EINA_TRUE);
+
+ if (small_popup_text)
+ free(small_popup_text);
+ small_popup_text = 0x00;
+ }
+ } else
+ elm_check_state_set(clear_data_view->m_select_all_check_box, EINA_FALSE);
+
+ if (elm_check_state_get(clear_data_view->m_history_check_box)
+ || elm_check_state_get(clear_data_view->m_cache_check_box)
+ || elm_check_state_get(clear_data_view->m_cookie_check_box)
+ || elm_check_state_get(clear_data_view->m_saved_id_password_check_box))
+ elm_object_item_disabled_set(clear_data_view->m_delete_controlbar_item, EINA_FALSE);
+ else
+ elm_object_item_disabled_set(clear_data_view->m_delete_controlbar_item, EINA_TRUE);
+}
+
+void Browser_Settings_Clear_Data_View::__select_all_changed_cb(void* data, Evas_Object* obj,
+ void* event_info)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ if (!data)
+ return;
+
+ Browser_Settings_Clear_Data_View *clear_data_view = NULL;
+ clear_data_view = (Browser_Settings_Clear_Data_View *)data;
+
+ Eina_Bool check_value = elm_check_state_get(obj);
+ elm_check_state_set(clear_data_view->m_history_check_box, check_value);
+ elm_check_state_set(clear_data_view->m_cache_check_box, check_value);
+ elm_check_state_set(clear_data_view->m_cookie_check_box, check_value);
+ elm_check_state_set(clear_data_view->m_saved_id_password_check_box, check_value);
+
+ clear_data_view->hide_notify_popup();
+
+ if (check_value) {
+ char *small_popup_text = NULL;
+ int string_len = strlen(BR_STRING_ITEMS_SELECTED) + 4; /* 4 : reserved for maximun count */
+
+ small_popup_text = (char *)malloc(string_len * sizeof(char));
+ memset(small_popup_text, 0x00, string_len);
+
+ snprintf(small_popup_text, string_len, BR_STRING_ITEMS_SELECTED, 4);
+ clear_data_view->show_notify_popup(small_popup_text, 0, EINA_TRUE);
+
+ if (small_popup_text)
+ free(small_popup_text);
+ small_popup_text = 0x00;
+ elm_object_item_disabled_set(clear_data_view->m_delete_controlbar_item, EINA_FALSE);
+ } else
+ elm_object_item_disabled_set(clear_data_view->m_delete_controlbar_item, EINA_TRUE);
+}
+
+Evas_Object *Browser_Settings_Clear_Data_View::__genlist_icon_get(void *data,
+ Evas_Object *obj, const char *part)
+{
+ if (!data)
+ return NULL;
+
+ genlist_callback_data *callback_data = (genlist_callback_data *)data; + Browser_Settings_Clear_Data_View *clear_data_view = NULL;
+ clear_data_view = (Browser_Settings_Clear_Data_View *)callback_data->user_data;
+ menu_type type = callback_data->type;
+
+ if (type == BR_CLEAR_HISTORY) {
+ if(!strncmp(part, "elm.edit.icon.1", strlen("elm.edit.icon.1"))) {
+ clear_data_view->m_history_check_box = elm_check_add(obj);
+ if (clear_data_view->m_history_check_box) {
+ evas_object_smart_callback_add(clear_data_view->m_history_check_box,
+ "changed", __item_check_changed_cb, clear_data_view);
+ evas_object_propagate_events_set(clear_data_view->m_history_check_box, EINA_FALSE);
+ }
+ return clear_data_view->m_history_check_box;
+ }
+ } else if (type == BR_CLEAR_CACHE) {
+ if(!strncmp(part, "elm.edit.icon.1", strlen("elm.edit.icon.1"))) {
+ clear_data_view->m_cache_check_box = elm_check_add(obj);
+ if (clear_data_view->m_cache_check_box) {
+ evas_object_smart_callback_add(clear_data_view->m_cache_check_box,
+ "changed", __item_check_changed_cb, clear_data_view);
+ evas_object_propagate_events_set(clear_data_view->m_cache_check_box, EINA_FALSE);
+ }
+ return clear_data_view->m_cache_check_box;
+ }
+ } else if (type == BR_CLEAR_COOKIE) {
+ if(!strncmp(part, "elm.edit.icon.1", strlen("elm.edit.icon.1"))) {
+ clear_data_view->m_cookie_check_box = elm_check_add(obj);
+ if (clear_data_view->m_cookie_check_box) {
+ evas_object_smart_callback_add(clear_data_view->m_cookie_check_box,
+ "changed", __item_check_changed_cb, clear_data_view);
+ evas_object_propagate_events_set(clear_data_view->m_cookie_check_box, EINA_FALSE);
+ }
+ return clear_data_view->m_cookie_check_box;
+ }
+ } else if (type == BR_CLEAR_SAVED_ID_PASSWORD) {
+ if(!strncmp(part, "elm.edit.icon.1", strlen("elm.edit.icon.1"))) {
+ clear_data_view->m_saved_id_password_check_box = elm_check_add(obj);
+ if (clear_data_view->m_saved_id_password_check_box) {
+ evas_object_smart_callback_add(clear_data_view->m_saved_id_password_check_box,
+ "changed", __item_check_changed_cb, clear_data_view);
+ evas_object_propagate_events_set(clear_data_view->m_saved_id_password_check_box, EINA_FALSE);
+ }
+ return clear_data_view->m_saved_id_password_check_box;
+ }
+ }
+
+ return NULL;
+}
+
+void Browser_Settings_Clear_Data_View::__select_all_layout_mouse_down_cb(void *data, Evas *evas,
+ Evas_Object *obj, void *event_info)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ if (!data)
+ return;
+
+ Browser_Settings_Clear_Data_View *clear_data_view = (Browser_Settings_Clear_Data_View *)data;
+
+ elm_check_state_set(clear_data_view->m_select_all_check_box,
+ !elm_check_state_get(clear_data_view->m_select_all_check_box));
+ __select_all_changed_cb(clear_data_view, clear_data_view->m_select_all_check_box, NULL);
+}
+
+void Browser_Settings_Clear_Data_View::__genlist_item_selected_cb(void *data, Evas_Object *obj,
+ void *event_info)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ if (!data)
+ return;
+
+ genlist_callback_data *callback_data = (genlist_callback_data *)data;
+ Browser_Settings_Clear_Data_View *clear_data_view = NULL; + clear_data_view = (Browser_Settings_Clear_Data_View *)callback_data->user_data;
+ menu_type type = callback_data->type;
+
+ if (type == BR_CLEAR_HISTORY)
+ elm_check_state_set(clear_data_view->m_history_check_box,
+ !elm_check_state_get(clear_data_view->m_history_check_box)); + else if (type == BR_CLEAR_CACHE)
+ elm_check_state_set(clear_data_view->m_cache_check_box,
+ !elm_check_state_get(clear_data_view->m_cache_check_box));
+ else if (type == BR_CLEAR_COOKIE)
+ elm_check_state_set(clear_data_view->m_cookie_check_box,
+ !elm_check_state_get(clear_data_view->m_cookie_check_box));
+ else if (type == BR_CLEAR_SAVED_ID_PASSWORD)
+ elm_check_state_set(clear_data_view->m_saved_id_password_check_box,
+ !elm_check_state_get(clear_data_view->m_saved_id_password_check_box));
+
+ __item_check_changed_cb(clear_data_view, NULL, NULL);
+
+ elm_genlist_item_selected_set(callback_data->it, EINA_FALSE);
+}
+
+Evas_Object *Browser_Settings_Clear_Data_View::_create_genlist(void)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ Evas_Object *genlist = elm_genlist_add(m_content_box);
+ if (!genlist) {
+ BROWSER_LOGE("elm_genlist_add failed");
+ return NULL;
+ }
+ evas_object_size_hint_weight_set(genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(genlist, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+ m_1text_item_class.item_style = "1text";
+ m_1text_item_class.decorate_all_item_style = "edit_default";
+ m_1text_item_class.func.del = NULL;
+ m_1text_item_class.func.state_get = NULL;
+ m_1text_item_class.func.text_get = __genlist_label_get;
+ m_1text_item_class.func.content_get = __genlist_icon_get;
+
+ m_clear_history_item_callback_data.type = BR_CLEAR_HISTORY;
+ m_clear_history_item_callback_data.user_data = this;
+ m_clear_history_item_callback_data.it = elm_genlist_item_append(genlist, &m_1text_item_class,
+ &m_clear_history_item_callback_data, NULL, ELM_GENLIST_ITEM_NONE,
+ __genlist_item_selected_cb, &m_clear_history_item_callback_data);
+
+ m_clear_cache_item_callback_data.type = BR_CLEAR_CACHE;
+ m_clear_cache_item_callback_data.user_data = this;
+ m_clear_cache_item_callback_data.it = elm_genlist_item_append(genlist, &m_1text_item_class,
+ &m_clear_cache_item_callback_data, NULL, ELM_GENLIST_ITEM_NONE,
+ __genlist_item_selected_cb, &m_clear_cache_item_callback_data);
+
+ m_clear_cookie_item_callback_data.type = BR_CLEAR_COOKIE;
+ m_clear_cookie_item_callback_data.user_data = this;
+ m_clear_cookie_item_callback_data.it = elm_genlist_item_append(genlist, &m_1text_item_class,
+ &m_clear_cookie_item_callback_data, NULL, ELM_GENLIST_ITEM_NONE,
+ __genlist_item_selected_cb, &m_clear_cookie_item_callback_data);
+
+ m_clear_saved_id_password_item_callback_data.type = BR_CLEAR_SAVED_ID_PASSWORD;
+ m_clear_saved_id_password_item_callback_data.user_data = this;
+ m_clear_saved_id_password_item_callback_data.it = elm_genlist_item_append(genlist, &m_1text_item_class,
+ &m_clear_saved_id_password_item_callback_data, NULL, ELM_GENLIST_ITEM_NONE,
+ __genlist_item_selected_cb, &m_clear_saved_id_password_item_callback_data);
+
+ return genlist;
+}
+
+Eina_Bool Browser_Settings_Clear_Data_View::_create_main_layout(void)
+{
+ m_content_box = elm_box_add(m_navi_bar);
+ if (!m_content_box) {
+ BROWSER_LOGE("elm_box_add failed");
+ return EINA_FALSE;
+ }
+ evas_object_size_hint_weight_set(m_content_box, EVAS_HINT_EXPAND, EVAS_HINT_FILL);
+ evas_object_size_hint_align_set(m_content_box, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(m_content_box);
+
+ m_genlist = _create_genlist();
+ if (!m_genlist) {
+ BROWSER_LOGE("_create_genlist failed");
+ return EINA_FALSE;
+ }
+ evas_object_show(m_genlist);
+
+ m_select_all_layout = elm_layout_add(m_content_box);
+ if (!m_select_all_layout) {
+ BROWSER_LOGE("elm_layout_add failed");
+ return EINA_FALSE;
+ }
+ elm_layout_theme_set(m_select_all_layout, "genlist", "item", "select_all/default");
+ evas_object_size_hint_weight_set(m_select_all_layout, EVAS_HINT_EXPAND, EVAS_HINT_FILL);
+ evas_object_size_hint_align_set(m_select_all_layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+ evas_object_event_callback_add(m_select_all_layout, EVAS_CALLBACK_MOUSE_DOWN,
+ __select_all_layout_mouse_down_cb, this);
+ evas_object_show(m_select_all_layout);
+
+ m_select_all_check_box = elm_check_add(m_select_all_layout);
+ if (!m_select_all_check_box) {
+ BROWSER_LOGE("elm_check_add failed");
+ return EINA_FALSE;
+ }
+ evas_object_smart_callback_add(m_select_all_check_box,
+ "changed", __select_all_changed_cb, this);
+ evas_object_propagate_events_set(m_select_all_check_box, EINA_FALSE);
+ evas_object_show(m_select_all_check_box);
+
+ elm_object_part_content_set(m_select_all_layout, "elm.icon", m_select_all_check_box);
+ elm_object_text_set(m_select_all_layout, BR_STRING_SELECT_ALL);
+
+ elm_box_pack_end(m_content_box, m_select_all_layout);
+ elm_box_pack_end(m_content_box, m_genlist);
+
+ elm_genlist_decorate_mode_set(m_genlist, EINA_TRUE);
+
+ m_back_button = elm_button_add(m_content_box);
+ if (!m_back_button) {
+ BROWSER_LOGE("elm_button_add failed");
+ return EINA_FALSE;
+ }
+ elm_object_style_set(m_back_button, "browser/bookmark_controlbar_back");
+ evas_object_show(m_back_button);
+ evas_object_smart_callback_add(m_back_button, "clicked", __cancel_button_clicked_cb, this);
+
+ Elm_Object_Item *navi_it = elm_naviframe_item_push(m_navi_bar, BR_STRING_CLEAR_PRIVATE_DATA,
+ m_back_button, NULL, m_content_box, "browser_titlebar");
+
+ m_bottom_control_bar = elm_toolbar_add(m_content_box);
+ if (!m_bottom_control_bar) {
+ BROWSER_LOGE("elm_toolbar_add failed");
+ return EINA_FALSE;
+ }
+ elm_object_style_set(m_bottom_control_bar, "browser/default");
+ elm_toolbar_shrink_mode_set(m_bottom_control_bar, ELM_TOOLBAR_SHRINK_EXPAND);
+
+ Elm_Object_Item *empty_item = elm_toolbar_item_append(m_bottom_control_bar, NULL, NULL, NULL, NULL);
+ elm_object_item_disabled_set(empty_item, EINA_TRUE);
+
+ m_delete_controlbar_item = elm_toolbar_item_append(m_bottom_control_bar,
+ BROWSER_IMAGE_DIR"/01_controlbar_icon_delete.png", NULL,
+ __delete_button_clicked_cb, this);
+ elm_object_item_disabled_set(m_delete_controlbar_item, EINA_TRUE);
+
+ empty_item = elm_toolbar_item_append(m_bottom_control_bar, NULL, NULL, NULL, NULL);
+ elm_object_item_disabled_set(empty_item, EINA_TRUE);
+ evas_object_show(m_bottom_control_bar);
+ elm_object_item_part_content_set(navi_it, ELM_NAVIFRAME_ITEM_CONTROLBAR, m_bottom_control_bar);
+
+ return EINA_TRUE;
+}
+
diff --git a/src/browser-settings/browser-settings-clear-data-view.h b/src/browser-settings/browser-settings-clear-data-view.h new file mode 100755 index 00000000..a0ea8e46 --- /dev/null +++ b/src/browser-settings/browser-settings-clear-data-view.h @@ -0,0 +1,96 @@ +/*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef BROWSER_SETTINGS_CLEAR_DATA_VIEW_H
+#define BROWSER_SETTINGS_CLEAR_DATA_VIEW_H
+
+#include "browser-common-view.h"
+#include "browser-config.h"
+#include "browser-settings-main-view.h"
+
+class Browser_Settings_Clear_Data_View : public Browser_Common_View {
+public:
+ typedef enum _menu_type
+ {
+ BR_SELECT_ALL = 0,
+ BR_CLEAR_HISTORY,
+ BR_CLEAR_CACHE,
+ BR_CLEAR_COOKIE,
+ BR_CLEAR_SAVED_ID_PASSWORD,
+ BR_MENU_UNKNOWN
+ }menu_type;
+
+ Browser_Settings_Clear_Data_View(Browser_Settings_Main_View *main_view);
+ ~Browser_Settings_Clear_Data_View(void);
+
+ Eina_Bool init(void);
+private:
+ typedef struct _genlist_callback_data {
+ menu_type type;
+ void *user_data;
+ Elm_Object_Item *it;
+ } genlist_callback_data;
+
+ Eina_Bool _create_main_layout(void);
+ Evas_Object *_create_genlist(void);
+ Evas_Object *_show_delete_confirm_popup(void);
+ void _delete_private_data(void);
+
+ /* Elementary event callback functions */
+ static void __cancel_button_clicked_cb(void *data, Evas_Object *obj, void *event_info); + static void __delete_button_clicked_cb(void *data, Evas_Object *obj, void *event_info);
+ static void __select_all_changed_cb(void *data, Evas_Object *obj, void *event_info);
+ static void __item_check_changed_cb(void *data, Evas_Object *obj, void *event_info);
+ static void __genlist_item_selected_cb(void *data, Evas_Object *obj, void *event_info);
+ static void __delete_confirm_response_cb(void *data, Evas_Object *obj, void *event_info);
+ static void __cancel_confirm_response_cb(void *data, Evas_Object *obj, void *event_info);
+
+ /* genlist event callback functions */
+ static char *__genlist_label_get(void *data, Evas_Object *obj, const char *part);
+ static Evas_Object *__genlist_icon_get(void *data, Evas_Object *obj, const char *part);
+
+ /* Evas object event callback functions */
+ static void __select_all_layout_mouse_down_cb(void *data, Evas *evas,
+ Evas_Object *obj, void *event_info);
+
+ Evas_Object *m_genlist;
+ Evas_Object *m_back_button;
+ Evas_Object *m_delete_button;
+ Evas_Object *m_bottom_control_bar;
+ Elm_Object_Item *m_delete_controlbar_item;
+
+ Evas_Object *m_select_all_check_box;
+ Evas_Object *m_history_check_box;
+ Evas_Object *m_cache_check_box;
+ Evas_Object *m_cookie_check_box;
+ Evas_Object *m_saved_id_password_check_box;
+
+ Evas_Object *m_select_all_layout;
+ Evas_Object *m_content_box;
+
+ Evas_Object *m_delete_confirm_popup;
+
+ Elm_Genlist_Item_Class m_1text_item_class;
+ genlist_callback_data m_clear_history_item_callback_data;
+ genlist_callback_data m_clear_cache_item_callback_data;
+ genlist_callback_data m_clear_cookie_item_callback_data;
+ genlist_callback_data m_clear_saved_id_password_item_callback_data;
+
+ Browser_Settings_Main_View *m_main_view;
+};
+
+#endif /* BROWSER_SETTINGS_CLEAR_DATA_VIEW_H */
+
diff --git a/src/browser-settings/browser-settings-edit-homepage-view.cpp b/src/browser-settings/browser-settings-edit-homepage-view.cpp new file mode 100755 index 00000000..b099340f --- /dev/null +++ b/src/browser-settings/browser-settings-edit-homepage-view.cpp @@ -0,0 +1,184 @@ +/*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "browser-settings-class.h"
+#include "browser-settings-edit-homepage-view.h"
+
+Browser_Settings_Edit_Homepage_View::Browser_Settings_Edit_Homepage_View(Browser_Settings_Main_View *main_view)
+:
+ m_main_view(main_view)
+ ,m_content_layout(NULL)
+ ,m_edit_field(NULL)
+ ,m_done_button(NULL)
+ ,m_cancel_button(NULL)
+{
+ BROWSER_LOGD("[%s]", __func__);
+}
+
+Browser_Settings_Edit_Homepage_View::~Browser_Settings_Edit_Homepage_View(void)
+{
+ BROWSER_LOGD("[%s]", __func__);
+}
+
+void Browser_Settings_Edit_Homepage_View::__back_button_clicked_cb(void *data,
+ Evas_Object *obj, void *event_info)
+{
+ BROWSER_LOGD("[%s]", __func__);
+
+ if (elm_naviframe_bottom_item_get(m_navi_bar)
+ != elm_naviframe_top_item_get(m_navi_bar))
+ elm_naviframe_item_pop(m_navi_bar);
+}
+
+void Browser_Settings_Edit_Homepage_View::__done_button_clicked_cb(void *data,
+ Evas_Object *obj, void *event_info)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ if (!data)
+ return;
+
+ Browser_Settings_Edit_Homepage_View *edit_homepage_view = NULL;
+ edit_homepage_view = (Browser_Settings_Edit_Homepage_View *)data;
+
+ Evas_Object *entry = br_elm_editfield_entry_get(edit_homepage_view->m_edit_field);
+ char *homepage = elm_entry_markup_to_utf8(elm_entry_entry_get(entry));
+ if (homepage) {
+ vconf_set_str(USER_HOMEPAGE_KEY, homepage);
+ vconf_set_str(HOMEPAGE_KEY, USER_HOMEPAGE);
+ free(homepage);
+ }
+
+ if (elm_naviframe_bottom_item_get(m_navi_bar)
+ != elm_naviframe_top_item_get(m_navi_bar))
+ elm_naviframe_item_pop(m_navi_bar);
+}
+
+void Browser_Settings_Edit_Homepage_View::__cancel_button_clicked_cb(void *data,
+ Evas_Object *obj, void *event_info)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ if (elm_naviframe_bottom_item_get(m_navi_bar)
+ != elm_naviframe_top_item_get(m_navi_bar))
+ elm_naviframe_item_pop(m_navi_bar);
+}
+
+Eina_Bool Browser_Settings_Edit_Homepage_View::init(void)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ return _create_main_layout();
+}
+
+void Browser_Settings_Edit_Homepage_View::__edit_field_changed_cb(void *data,
+ Evas_Object *obj, void *event_info)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ if (!data)
+ return;
+ Browser_Settings_Edit_Homepage_View *edit_homepage_view = NULL;
+ edit_homepage_view = (Browser_Settings_Edit_Homepage_View *)data;
+
+ const char *url = elm_entry_entry_get(obj);
+ if (!url || !strlen(url)) {
+ elm_object_disabled_set(edit_homepage_view->m_done_button, EINA_TRUE);
+ return;
+ }
+
+ Eina_Bool only_has_space = EINA_FALSE; + int space_count = 0;
+ for (int i = 0 ; i < strlen(url) ; i++) {
+ if (url[i] == ' ')
+ space_count++;
+ }
+ if (space_count == strlen(url))
+ only_has_space = EINA_TRUE;
+
+ if (only_has_space) {
+ elm_object_disabled_set(edit_homepage_view->m_done_button, EINA_TRUE);
+ return;
+ }
+
+ elm_object_disabled_set(edit_homepage_view->m_done_button, EINA_FALSE);
+}
+
+Eina_Bool Browser_Settings_Edit_Homepage_View::_create_main_layout(void)
+{
+ BROWSER_LOGD("[%s]", __func__);
+
+ m_content_layout = elm_layout_add(m_navi_bar);
+ if (!m_content_layout) {
+ BROWSER_LOGE("elm_layout_add failed");
+ return EINA_FALSE;
+ }
+ if (!elm_layout_file_set(m_content_layout, BROWSER_EDJE_DIR"/browser-settings.edj",
+ "edit_homepage_view")) {
+ BROWSER_LOGE("elm_layout_file_set failed"); + return EINA_FALSE; + }
+ evas_object_show(m_content_layout);
+
+ m_edit_field = br_elm_editfield_add(m_content_layout, EINA_TRUE);
+ if (!m_edit_field) {
+ BROWSER_LOGE("elm_editfield_add failed");
+ return EINA_FALSE;
+ }
+ br_elm_editfield_entry_single_line_set(m_edit_field, EINA_TRUE);
+ br_elm_editfield_label_set(m_edit_field, BR_STRING_URL);
+ elm_object_part_content_set(m_content_layout, "elm.swallow.entry", m_edit_field);
+
+ char *homepage = vconf_get_str(USER_HOMEPAGE_KEY);
+ Evas_Object *entry = br_elm_editfield_entry_get(m_edit_field);
+ if (homepage) {
+ elm_entry_entry_set(entry, homepage);
+ free(homepage);
+ }
+ elm_entry_input_panel_layout_set(entry, ELM_INPUT_PANEL_LAYOUT_URL);
+ evas_object_size_hint_weight_set(m_edit_field, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(m_edit_field, 1, 0.5);
+ elm_entry_cursor_end_set(entry);
+ + evas_object_show(m_edit_field);
+ elm_object_focus_set(m_edit_field, EINA_TRUE);
+ evas_object_smart_callback_add(entry, "changed", __edit_field_changed_cb, this);
+
+ Elm_Object_Item *navi_it = elm_naviframe_item_push(m_navi_bar, BR_STRING_HOMEPAGE,
+ NULL, NULL, m_content_layout, "browser_titlebar");
+ elm_object_item_part_content_set(navi_it, ELM_NAVIFRAME_ITEM_PREV_BTN, NULL);
+
+ m_done_button = elm_button_add(m_content_layout);
+ if (!m_done_button) {
+ BROWSER_LOGE("elm_button_add failed");
+ return EINA_FALSE;
+ }
+ elm_object_style_set(m_done_button, "browser/title_button");
+ elm_object_text_set(m_done_button, BR_STRING_DONE);
+ evas_object_show(m_done_button);
+ evas_object_smart_callback_add(m_done_button, "clicked", __done_button_clicked_cb, this);
+ elm_object_item_part_content_set(navi_it, ELM_NAVIFRAME_ITEM_TITLE_RIGHT_BTN, m_done_button);
+
+ m_cancel_button = elm_button_add(m_content_layout);
+ if (!m_cancel_button) {
+ BROWSER_LOGE("elm_button_add failed");
+ return EINA_FALSE;
+ }
+ elm_object_style_set(m_cancel_button, "browser/title_button");
+ elm_object_text_set(m_cancel_button, BR_STRING_CANCEL);
+ evas_object_show(m_cancel_button);
+ evas_object_smart_callback_add(m_cancel_button, "clicked", __cancel_button_clicked_cb, this);
+ elm_object_item_part_content_set(navi_it, ELM_NAVIFRAME_ITEM_TITLE_LEFT_BTN, m_cancel_button);
+
+ return EINA_TRUE;
+}
+
diff --git a/src/browser-settings/browser-settings-edit-homepage-view.h b/src/browser-settings/browser-settings-edit-homepage-view.h new file mode 100755 index 00000000..abb8d6d0 --- /dev/null +++ b/src/browser-settings/browser-settings-edit-homepage-view.h @@ -0,0 +1,48 @@ +/*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef BROWSER_SETTINGS_EDIT_HOMEPAGE_H
+#define BROWSER_SETTINGS_EDIT_HOMEPAGE_H
+
+#include "browser-common-view.h"
+#include "browser-config.h"
+#include "browser-settings-main-view.h"
+
+class Browser_Settings_Edit_Homepage_View : public Browser_Common_View {
+public:
+ Browser_Settings_Edit_Homepage_View(Browser_Settings_Main_View *main_view);
+ ~Browser_Settings_Edit_Homepage_View(void);
+
+ Eina_Bool init(void);
+private:
+ Eina_Bool _create_main_layout(void);
+
+ /* elementary event callback functions */
+ static void __back_button_clicked_cb(void *data, Evas_Object *obj, void *event_info);
+ static void __done_button_clicked_cb(void *data, Evas_Object *obj, void *event_info);
+ static void __cancel_button_clicked_cb(void *data, Evas_Object *obj, void *event_info);
+ static void __edit_field_changed_cb(void *data, Evas_Object *obj, void *event_info);
+
+ Evas_Object *m_content_layout;
+ Evas_Object *m_edit_field;
+ Evas_Object *m_done_button;
+ Evas_Object *m_cancel_button;
+
+ Browser_Settings_Main_View *m_main_view;
+};
+
+#endif /* BROWSER_SETTINGS_EDIT_HOMEPAGE_H */
+
diff --git a/src/browser-settings/browser-settings-main-view.cpp b/src/browser-settings/browser-settings-main-view.cpp new file mode 100755 index 00000000..e36a811e --- /dev/null +++ b/src/browser-settings/browser-settings-main-view.cpp @@ -0,0 +1,1299 @@ +/*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "browser-view.h"
+#include "browser-data-manager.h"
+#include "browser-settings-clear-data-view.h"
+#include "browser-settings-edit-homepage-view.h"
+#include "browser-settings-main-view.h"
+#include "browser-settings-plugin-view.h"
+
+#include "browser-settings-accelerated-composition.h"
+#include "browser-settings-user-agent-view.h"
+
+Browser_Settings_Main_View::Browser_Settings_Main_View(void)
+:
+ m_genlist(NULL)
+ ,m_back_button(NULL)
+ ,m_homepage_radio_group(NULL)
+ ,m_edit_homepage_view(NULL)
+ ,m_default_view_level_radio_group(NULL)
+ ,m_auto_save_id_pass_radio_group(NULL)
+ ,m_run_javascript_check(NULL)
+ ,m_display_images_check(NULL)
+ ,m_accept_cookies_check(NULL)
+ ,m_clear_data_view(NULL)
+ ,m_default_storage_radio_group(NULL)
+ ,m_default_storage_mmc_radio_button(NULL)
+ ,m_plugin_view(NULL)
+ ,m_block_popup_check(NULL)
+ ,m_user_agent_view(NULL)
+ ,m_reset_confirm_popup(NULL)
+ ,m_navi_it(NULL)
+{
+ BROWSER_LOGD("[%s]", __func__);
+}
+
+Browser_Settings_Main_View::~Browser_Settings_Main_View(void)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ if (vconf_ignore_key_changed(VCONFKEY_SYSMAN_MMC_STATUS, __mmc_key_changed_cb) < 0)
+ BROWSER_LOGE("[%s]vconf_ignore_key_changed failed", VCONFKEY_SYSMAN_MMC_STATUS);
+
+ if (m_edit_homepage_view) {
+ delete m_edit_homepage_view;
+ m_edit_homepage_view = NULL;
+ } + if (m_clear_data_view) {
+ delete m_clear_data_view;
+ m_clear_data_view = NULL;
+ }
+ if (m_plugin_view) {
+ delete m_plugin_view;
+ m_plugin_view = NULL;
+ }
+ if (m_user_agent_view) {
+ delete m_user_agent_view;
+ m_user_agent_view = NULL;
+ }
+ evas_object_smart_callback_del(m_navi_bar, "transition,finished", __naviframe_pop_finished_cb);
+}
+
+Eina_Bool Browser_Settings_Main_View::init(void)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ return _create_main_layout();
+}
+
+void Browser_Settings_Main_View::__back_button_clicked_cb(void *data, Evas_Object* obj,
+ void* event_info)
+{
+ BROWSER_LOGD("[%s]", __func__);
+
+ if (elm_naviframe_bottom_item_get(m_navi_bar) != elm_naviframe_top_item_get(m_navi_bar))
+ elm_naviframe_item_pop(m_navi_bar);
+
+ m_data_manager->get_browser_view()->return_to_browser_view();
+}
+
+void Browser_Settings_Main_View::__naviframe_pop_finished_cb(void *data , Evas_Object *obj, void *event_info)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ if (!data)
+ return;
+
+ Browser_Settings_Main_View *main_view = (Browser_Settings_Main_View *)data;
+ Elm_Object_Item *it = (Elm_Object_Item *)event_info;
+
+ if (main_view->m_navi_it != elm_naviframe_top_item_get(m_navi_bar))
+ return;
+
+ if (main_view->m_edit_homepage_view) {
+ delete main_view->m_edit_homepage_view;
+ main_view->m_edit_homepage_view = NULL;
+
+ /* If back from edit user homepage, update the url string. */
+ char* homepage = vconf_get_str(HOMEPAGE_KEY);
+ if (homepage) {
+ if (!strncmp(homepage, USER_HOMEPAGE,
+ strlen(USER_HOMEPAGE)))
+ elm_radio_value_set(main_view->m_homepage_radio_group, 2);
+
+ free(homepage);
+
+ elm_genlist_realized_items_update(main_view->m_genlist);
+ }
+ }
+
+ if (main_view->m_clear_data_view) {
+ delete main_view->m_clear_data_view;
+ main_view->m_clear_data_view = NULL;
+ }
+ if (main_view->m_plugin_view) {
+ delete main_view->m_plugin_view;
+ main_view->m_plugin_view = NULL;
+ }
+ if (main_view->m_user_agent_view) {
+ delete main_view->m_user_agent_view;
+ main_view->m_user_agent_view = NULL;
+ }
+}
+
+Eina_Bool Browser_Settings_Main_View::_create_main_layout(void)
+{
+ BROWSER_LOGD("[%s]", __func__);
+
+ m_genlist = _create_content_genlist();
+ if (!m_genlist) {
+ BROWSER_LOGE("_create_content_genlist failed");
+ return EINA_FALSE;
+ }
+
+ evas_object_show(m_genlist);
+
+ m_back_button = elm_button_add(m_genlist);
+ if (!m_back_button) {
+ BROWSER_LOGE("elm_button_add failed");
+ return EINA_FALSE;
+ }
+ elm_object_style_set(m_back_button, "browser/bookmark_controlbar_back");
+ evas_object_show(m_back_button);
+ evas_object_smart_callback_add(m_back_button, "clicked", __back_button_clicked_cb, this);
+
+ m_homepage_radio_group = elm_radio_add(m_genlist);
+ if (!m_homepage_radio_group) {
+ BROWSER_LOGE("elm_radio_add failed.");
+ return EINA_FALSE;
+ }
+ elm_radio_state_value_set(m_homepage_radio_group, -1);
+
+ m_default_view_level_radio_group = elm_radio_add(m_genlist);
+ if (!m_default_view_level_radio_group) {
+ BROWSER_LOGE("elm_radio_add failed.");
+ return EINA_FALSE;
+ }
+ elm_radio_state_value_set(m_default_view_level_radio_group, -1);
+
+ m_auto_save_id_pass_radio_group = elm_radio_add(m_genlist);
+ if (!m_auto_save_id_pass_radio_group) {
+ BROWSER_LOGE("elm_radio_add failed.");
+ return EINA_FALSE;
+ }
+ elm_radio_state_value_set(m_auto_save_id_pass_radio_group, -1);
+
+ m_default_storage_radio_group = elm_radio_add(m_genlist);
+ if (!m_default_storage_radio_group) {
+ BROWSER_LOGE("elm_radio_add failed.");
+ return EINA_FALSE;
+ }
+ elm_radio_state_value_set(m_default_storage_radio_group, -1);
+
+ m_navi_it = elm_naviframe_item_push(m_navi_bar, BR_STRING_INTERNET,
+ m_back_button, NULL, m_genlist, "browser_titlebar");
+
+ evas_object_smart_callback_add(m_navi_bar, "transition,finished", __naviframe_pop_finished_cb, this);
+
+ return EINA_TRUE;
+}
+
+Evas_Object *Browser_Settings_Main_View::__genlist_icon_get(void *data, Evas_Object *obj, const char *part)
+{
+ if (!data)
+ return NULL;
+
+ genlist_callback_data *callback_data = (genlist_callback_data *)data;
+ Browser_Settings_Main_View::menu_type type = callback_data->type;
+ Browser_Settings_Main_View *main_view = (Browser_Settings_Main_View *)(callback_data->user_data);
+
+ if (type == BR_HOMEPAGE_SUBMENU_MOST_VISITED_SITES
+ || type == BR_HOMEPAGE_SUBMENU_RECENTLY_VISITED_SITE
+ || type == BR_HOMEPAGE_SUBMENU_USER_HOMEPAGE) {
+ if (!strncmp(part, "elm.icon", strlen("elm.icon"))) {
+ Evas_Object *radio_button = elm_radio_add(obj);
+ if (radio_button) {
+ if (type == BR_HOMEPAGE_SUBMENU_MOST_VISITED_SITES)
+ elm_radio_state_value_set(radio_button, 0);
+ else if (type == BR_HOMEPAGE_SUBMENU_RECENTLY_VISITED_SITE)
+ elm_radio_state_value_set(radio_button, 1);
+ else if (type == BR_HOMEPAGE_SUBMENU_USER_HOMEPAGE)
+ elm_radio_state_value_set(radio_button, 2);
+
+ elm_radio_group_add(radio_button, main_view->m_homepage_radio_group);
+ evas_object_propagate_events_set(radio_button, EINA_FALSE);
+
+ evas_object_smart_callback_add(radio_button, "changed",
+ __homepage_sub_item_clicked_cb, data);
+
+ char* homepage = vconf_get_str(HOMEPAGE_KEY);
+ if (!homepage) {
+ vconf_set_str(HOMEPAGE_KEY, MOST_VISITED_SITES);
+ homepage = strdup(MOST_VISITED_SITES);
+ }
+
+ if (!homepage) {
+ BROWSER_LOGE("strdup failed");
+ return NULL;
+ }
+
+ if (!strncmp(homepage, MOST_VISITED_SITES,
+ strlen(MOST_VISITED_SITES)))
+ elm_radio_value_set(main_view->m_homepage_radio_group, 0);
+ else if (!strncmp(homepage, RECENTLY_VISITED_SITE,
+ strlen(RECENTLY_VISITED_SITE)))
+ elm_radio_value_set(main_view->m_homepage_radio_group, 1);
+ else if (!strncmp(homepage, USER_HOMEPAGE,
+ strlen(USER_HOMEPAGE)))
+ elm_radio_value_set(main_view->m_homepage_radio_group, 2);
+ else
+ elm_radio_value_set(main_view->m_homepage_radio_group, 3);
+
+ free(homepage); + }
+
+ return radio_button;
+ }
+ } else if (type == BR_DISPLAY_SUBMENU_FIT_TO_WIDTH
+ || type == BR_DISPLAY_SUBMENU_READABLE) {
+ if (!strncmp(part, "elm.icon", strlen("elm.icon"))) {
+ Evas_Object *radio_button = elm_radio_add(obj);
+ if (radio_button) {
+ if (type == BR_DISPLAY_SUBMENU_FIT_TO_WIDTH)
+ elm_radio_state_value_set(radio_button, 0);
+ else
+ elm_radio_state_value_set(radio_button, 1);
+
+ elm_radio_group_add(radio_button, main_view->m_default_view_level_radio_group);
+
+ char *view_level = vconf_get_str(DEFAULT_VIEW_LEVEL_KEY);
+ if (!view_level) {
+ vconf_set_str(DEFAULT_VIEW_LEVEL_KEY, READABLE);
+ view_level = strdup(BR_STRING_READABLE);
+ }
+ if (!view_level) {
+ BROWSER_LOGE("strdup failed");
+ return NULL;
+ }
+
+ if (!strncmp(view_level, FIT_TO_WIDTH, strlen(FIT_TO_WIDTH)))
+ elm_radio_value_set(main_view->m_default_view_level_radio_group, 0);
+ else
+ elm_radio_value_set(main_view->m_default_view_level_radio_group, 1);
+
+ free(view_level);
+ }
+
+ return radio_button;
+ }
+ } else if (type == BR_CONTENT_MENU_RUN_JAVASCRIPT) {
+ if (!strncmp(part, "elm.icon", strlen("elm.icon"))) {
+ main_view->m_run_javascript_check = elm_check_add(obj);
+ if (main_view->m_run_javascript_check) {
+ elm_object_style_set(main_view->m_run_javascript_check, "on&off");
+ evas_object_smart_callback_add(main_view->m_run_javascript_check, "changed",
+ __run_javascript_check_changed_cb, main_view->m_run_javascript_check);
+
+ int run_javascript = 1;
+ if (vconf_get_bool(RUN_JAVASCRIPT_KEY, &run_javascript) < 0)
+ BROWSER_LOGE("Can not get [%s] value.\n", RUN_JAVASCRIPT_KEY);
+
+ elm_check_state_set(main_view->m_run_javascript_check, run_javascript);
+ evas_object_propagate_events_set(main_view->m_run_javascript_check, EINA_FALSE);
+ }
+ return main_view->m_run_javascript_check;
+ }
+ } else if (type == BR_CONTENT_MENU_DISPLAY_IMAGES) {
+ if (!strncmp(part, "elm.icon", strlen("elm.icon"))) {
+ main_view->m_display_images_check = elm_check_add(obj);
+ if (main_view->m_display_images_check) {
+ elm_object_style_set(main_view->m_display_images_check, "on&off");
+ evas_object_smart_callback_add(main_view->m_display_images_check, "changed",
+ __display_images_check_changed_cb, main_view->m_display_images_check);
+
+ int display_images = 1;
+ if (vconf_get_bool(DISPLAY_IMAGES_KEY, &display_images) < 0)
+ BROWSER_LOGE("Can not get [%s] value.\n", DISPLAY_IMAGES_KEY);
+
+ elm_check_state_set(main_view->m_display_images_check, display_images);
+ evas_object_propagate_events_set(main_view->m_display_images_check, EINA_FALSE);
+ }
+ return main_view->m_display_images_check;
+ }
+ } else if (type == BR_CONTENT_MENU_BLOCK_POPUP) {
+ if (!strncmp(part, "elm.icon", strlen("elm.icon"))) {
+ main_view->m_block_popup_check = elm_check_add(obj);
+ if (main_view->m_block_popup_check) {
+ elm_object_style_set(main_view->m_block_popup_check, "on&off");
+ evas_object_smart_callback_add(main_view->m_block_popup_check, "changed",
+ __block_popup_check_changed_cb, main_view->m_block_popup_check);
+
+ int block_popup = 1;
+ if (vconf_get_bool(BLOCK_POPUP_KEY, &block_popup) < 0)
+ BROWSER_LOGE("Can not get [%s] value.\n", BLOCK_POPUP_KEY);
+
+ elm_check_state_set(main_view->m_block_popup_check, block_popup);
+ evas_object_propagate_events_set(main_view->m_block_popup_check, EINA_FALSE);
+ }
+ return main_view->m_block_popup_check;
+ }
+ } else if (type == BR_PRIVACY_MENU_ACCEPT_COOKIES) {
+ if (!strncmp(part, "elm.icon", strlen("elm.icon"))) {
+ main_view->m_accept_cookies_check = elm_check_add(obj);
+ if (main_view->m_accept_cookies_check) {
+ elm_object_style_set(main_view->m_accept_cookies_check, "on&off");
+ evas_object_smart_callback_add(main_view->m_accept_cookies_check, "changed",
+ __accept_cookies_check_changed_cb, main_view->m_accept_cookies_check);
+
+ int accept_cookies = 1;
+ if (vconf_get_bool(ACCEPT_COOKIES_KEY, &accept_cookies) < 0)
+ BROWSER_LOGE("Can not get [%s] value.\n", ACCEPT_COOKIES_KEY);
+
+ elm_check_state_set(main_view->m_accept_cookies_check, accept_cookies);
+ evas_object_propagate_events_set(main_view->m_accept_cookies_check, EINA_FALSE);
+ }
+ return main_view->m_accept_cookies_check;
+ }
+ } else if (type == BR_PRIVACY_SUBMENU_ALWAYS_ASK
+ || type == BR_PRIVACY_SUBMENU_ALWAYS_ON
+ || type == BR_PRIVACY_SUBMENU_ALWAYS_OFF) {
+ if (!strncmp(part, "elm.icon", strlen("elm.icon"))) {
+ Evas_Object *radio_button = elm_radio_add(obj);
+ if (radio_button) {
+ if (type == BR_PRIVACY_SUBMENU_ALWAYS_ASK)
+ elm_radio_state_value_set(radio_button, 0);
+ else if (type == BR_PRIVACY_SUBMENU_ALWAYS_ON)
+ elm_radio_state_value_set(radio_button, 1);
+ else if (type == BR_PRIVACY_SUBMENU_ALWAYS_OFF)
+ elm_radio_state_value_set(radio_button, 2);
+
+ elm_radio_group_add(radio_button, main_view->m_auto_save_id_pass_radio_group);
+
+ char* auto_save = vconf_get_str(AUTO_SAVE_ID_PASSWORD_KEY);
+ if (!auto_save) {
+ vconf_set_str(AUTO_SAVE_ID_PASSWORD_KEY, ALWAYS_ASK);
+ auto_save = strdup(ALWAYS_ASK);
+ }
+
+ if (!auto_save) {
+ BROWSER_LOGE("strdup failed");
+ return NULL;
+ }
+
+ if (!strncmp(auto_save, ALWAYS_ASK, strlen(ALWAYS_ASK)))
+ elm_radio_value_set(main_view->m_auto_save_id_pass_radio_group, 0);
+ else if (!strncmp(auto_save, ALWAYS_ON, strlen(ALWAYS_ON)))
+ elm_radio_value_set(main_view->m_auto_save_id_pass_radio_group, 1);
+ else
+ elm_radio_value_set(main_view->m_homepage_radio_group, 2);
+
+ free(auto_save);
+ }
+
+ return radio_button;
+ }
+ } else if (type == BR_STORAGE_SUBMENU_PHONE + || type == BR_STORAGE_SUBMENU_MEMORY_CARD) {
+ if (!strncmp(part, "elm.icon", strlen("elm.icon"))) {
+ Evas_Object *radio_button = elm_radio_add(obj);
+ if (radio_button) {
+ if (type == BR_STORAGE_SUBMENU_PHONE)
+ elm_radio_state_value_set(radio_button, 0);
+ else {
+ main_view->m_default_storage_mmc_radio_button = radio_button;
+ elm_radio_state_value_set(radio_button, 1);
+ }
+
+ elm_radio_group_add(radio_button, main_view->m_default_storage_radio_group);
+
+ int current_storage = SETTING_DEF_MEMORY_PHONE;
+ if(vconf_get_int(VCONFKEY_SETAPPL_DEFAULT_MEM_WAP_INT, ¤t_storage) < 0)
+ {
+ vconf_set_int(VCONFKEY_SETAPPL_DEFAULT_MEM_WAP_INT, SETTING_DEF_MEMORY_PHONE);
+ current_storage = SETTING_DEF_MEMORY_PHONE;
+ }
+ int mmc = VCONFKEY_SYSMAN_MMC_MOUNTED;
+ if (vconf_get_int(VCONFKEY_SYSMAN_MMC_STATUS, &mmc) < 0) {
+ BROWSER_LOGE("[%s]vconf_get_int failed", VCONFKEY_SYSMAN_MMC_STATUS);
+ mmc = SETTING_DEF_MEMORY_MMC;
+ }
+ if (mmc == VCONFKEY_SYSMAN_MMC_MOUNTED)
+ elm_object_disabled_set(main_view->m_default_storage_mmc_radio_button, EINA_FALSE);
+ else
+ elm_object_disabled_set(main_view->m_default_storage_mmc_radio_button, EINA_TRUE);
+
+ if (current_storage == SETTING_DEF_MEMORY_PHONE)
+ elm_radio_value_set(main_view->m_default_storage_radio_group, 0);
+ else if (current_storage == SETTING_DEF_MEMORY_MMC) {
+ if (mmc == VCONFKEY_SYSMAN_MMC_MOUNTED)
+ elm_radio_value_set(main_view->m_default_storage_radio_group, 1);
+ else
+ elm_radio_value_set(main_view->m_default_storage_radio_group, 0);
+ }
+ }
+ return radio_button;
+ }
+ }
+
+ return NULL;
+}
+
+void Browser_Settings_Main_View::__run_javascript_check_changed_cb(void *data,
+ Evas_Object *obj, void *event_info)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ const char *key = RUN_JAVASCRIPT_KEY;
+ Eina_Bool state = elm_check_state_get((Evas_Object*)data);
+ if (vconf_set_bool(key, state) != 0)
+ SLOGE("Key: %s, FAILED", key);
+}
+
+void Browser_Settings_Main_View::__display_images_check_changed_cb(void *data,
+ Evas_Object *obj, void *event_info)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ const char *key = DISPLAY_IMAGES_KEY;
+ Eina_Bool state = elm_check_state_get((Evas_Object*)data);
+ if (vconf_set_bool(key, state) != 0)
+ SLOGE("Key: %s, FAILED", key);
+}
+
+void Browser_Settings_Main_View::__block_popup_check_changed_cb(void *data,
+ Evas_Object *obj, void *event_info)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ const char *key = BLOCK_POPUP_KEY;
+ Eina_Bool state = elm_check_state_get((Evas_Object*)data);
+ if (vconf_set_bool(key, state) != 0)
+ SLOGE("Key: %s, FAILED", key);
+}
+
+void Browser_Settings_Main_View::__accept_cookies_check_changed_cb(void *data,
+ Evas_Object *obj, void *event_info)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ const char *key = ACCEPT_COOKIES_KEY;
+ Eina_Bool state = elm_check_state_get((Evas_Object*)data);
+ if (vconf_set_bool(key, state) != 0)
+ SLOGE("Key: %s, FAILED", key);
+}
+
+char *Browser_Settings_Main_View::__genlist_label_get(void *data, Evas_Object *obj, const char *part)
+{ + if (!data)
+ return NULL;
+
+ genlist_callback_data *callback_data = (genlist_callback_data *)data;
+ Browser_Settings_Main_View::menu_type type = callback_data->type;
+ Browser_Settings_Main_View *main_view = (Browser_Settings_Main_View *)(callback_data->user_data);
+
+ if (type == BR_HOMEPAGE_TITLE) {
+ if (!strncmp(part, "elm.text", strlen("elm.text")))
+ return strdup(BR_STRING_HOMEPAGE);
+ } else if (type == BR_HOMEPAGE_MENU) {
+ if (!strncmp(part, "elm.text.1", strlen("elm.text.1")))
+ return strdup(BR_STRING_HOMEPAGE);
+ else if (!strncmp(part, "elm.text.2", strlen("elm.text.2"))) {
+ char *homepage = vconf_get_str(HOMEPAGE_KEY);
+ BROWSER_LOGD("homepage = %s", homepage);
+ if (homepage) {
+ if (!strncmp(homepage, MOST_VISITED_SITES, strlen(MOST_VISITED_SITES))) {
+ free(homepage);
+ return strdup(BR_STRING_EMPTY_PAGE);
+ } else if (!strncmp(homepage, RECENTLY_VISITED_SITE,
+ strlen(RECENTLY_VISITED_SITE))) {
+ free(homepage);
+ return strdup(BR_STRING_RECENTLY_VISITED_SITE);
+ } else {
+ free(homepage);
+ return strdup(BR_STRING_USER_HOMEPAGE);
+ }
+ }
+ return NULL;
+ }
+ } else if (type == BR_HOMEPAGE_SUBMENU_MOST_VISITED_SITES) {
+ if (!strncmp(part, "elm.text", strlen("elm.text")))
+ return strdup(BR_STRING_EMPTY_PAGE);
+ } else if (type == BR_HOMEPAGE_SUBMENU_RECENTLY_VISITED_SITE) {
+ if (!strncmp(part, "elm.text", strlen("elm.text")))
+ return strdup(BR_STRING_RECENTLY_VISITED_SITE);
+ } else if (type == BR_HOMEPAGE_SUBMENU_USER_HOMEPAGE) {
+ if (!strncmp(part, "elm.text", strlen("elm.text")))
+ return vconf_get_str(USER_HOMEPAGE_KEY);
+ } else if (type == BR_DISPLAY_TITLE) {
+ if (!strncmp(part, "elm.text", strlen("elm.text")))
+ return strdup(BR_STRING_DISPLAY);
+ } else if (type == BR_DISPLAY_MENU_DEFAULT_VIEW_LEVEL) {
+ if (!strncmp(part, "elm.text.1", strlen("elm.text.1")))
+ return strdup(BR_STRING_DEFAULT_VIEW_LEVEL);
+ else if (!strncmp(part, "elm.text.2", strlen("elm.text.2"))) {
+ char *view_level = vconf_get_str(DEFAULT_VIEW_LEVEL_KEY);
+ if (view_level) {
+ if (!strncmp(view_level, FIT_TO_WIDTH, strlen(FIT_TO_WIDTH))) {
+ free(view_level);
+ return strdup(BR_STRING_FIT_TO_WIDTH);
+ } else {
+ free(view_level);
+ return strdup(BR_STRING_READABLE);
+ }
+ }
+ return NULL;
+ }
+ } else if (type == BR_DISPLAY_SUBMENU_FIT_TO_WIDTH) {
+ if (!strncmp(part, "elm.text", strlen("elm.text")))
+ return strdup(BR_STRING_FIT_TO_WIDTH);
+ } else if (type == BR_DISPLAY_SUBMENU_READABLE) {
+ if (!strncmp(part, "elm.text", strlen("elm.text")))
+ return strdup(BR_STRING_READABLE);
+ } else if (type == BR_CONTENT_TITLE) {
+ if (!strncmp(part, "elm.text", strlen("elm.text")))
+ return strdup(BR_STRING_CONTENT);
+ } else if (type == BR_CONTENT_MENU_RUN_JAVASCRIPT) {
+ if (!strncmp(part, "elm.text", strlen("elm.text")))
+ return strdup(BR_STRING_RUN_JAVASCRIPT);
+ } else if (type == BR_CONTENT_MENU_DISPLAY_IMAGES) {
+ if (!strncmp(part, "elm.text", strlen("elm.text")))
+ return strdup(BR_STRING_DISPLAY_IMAGES);
+ } else if (type == BR_CONTENT_MENU_BLOCK_POPUP) {
+ if (!strncmp(part, "elm.text", strlen("elm.text")))
+ return strdup(BR_STRING_BLOCK_POPUP);
+ } else if (type == BR_PRIVACY_TITLE) {
+ if (!strncmp(part, "elm.text", strlen("elm.text")))
+ return strdup(BR_STRING_PRIVACY);
+ } else if (type == BR_PRIVACY_MENU_ACCEPT_COOKIES) {
+ if (!strncmp(part, "elm.text", strlen("elm.text")))
+ return strdup(BR_STRING_ACCEPT_COOKIES);
+ } else if (type == BR_PRIVACY_MENU_AUTOSAVE_ID_PASSWORD) {
+ if (!strncmp(part, "elm.text.1", strlen("elm.text.1")))
+ return strdup(BR_STRING_AUTO_SAVE_ID_PASSWORD);
+ else if (!strncmp(part, "elm.text.2", strlen("elm.text.2"))) {
+ char *auto_save = vconf_get_str(AUTO_SAVE_ID_PASSWORD_KEY);
+ BROWSER_LOGD("auto_save = %s", auto_save);
+ if (auto_save) {
+ if (!strncmp(auto_save, ALWAYS_ASK, strlen(ALWAYS_ASK))) {
+ free(auto_save);
+ return strdup(BR_STRING_ALWAYS_ASK);
+ } else if (!strncmp(auto_save, ALWAYS_ON, strlen(ALWAYS_ON))) {
+ free(auto_save);
+ return strdup(BR_STRING_ON);
+ } else {
+ free(auto_save);
+ return strdup(BR_STRING_OFF);
+ }
+ }
+ return NULL;
+ }
+ } else if (type == BR_PRIVACY_SUBMENU_ALWAYS_ASK) {
+ if (!strncmp(part, "elm.text", strlen("elm.text")))
+ return strdup(BR_STRING_ALWAYS_ASK);
+ } else if (type == BR_PRIVACY_SUBMENU_ALWAYS_ON) {
+ if (!strncmp(part, "elm.text", strlen("elm.text")))
+ return strdup(BR_STRING_ON);
+ } else if (type == BR_PRIVACY_SUBMENU_ALWAYS_OFF) {
+ if (!strncmp(part, "elm.text", strlen("elm.text")))
+ return strdup(BR_STRING_OFF);
+ } else if (type == BR_PRIVACY_MENU_CLEAR_PRIVATE_DATA) {
+ if (!strncmp(part, "elm.text", strlen("elm.text")))
+ return strdup(BR_STRING_CLEAR_PRIVATE_DATA);
+ } else if (type == BR_DEBUG_TITLE) {
+ if (!strncmp(part, "elm.text", strlen("elm.text")))
+ return strdup(BR_STRING_DEBUG);
+ } else if (type == BR_MENU_USER_AGENT) {
+ if (!strncmp(part, "elm.text", strlen("elm.text")))
+ return strdup(BR_STRING_USER_AGENT);
+ } else if (type == BR_STORAGE_TITLE) {
+ if (!strncmp(part, "elm.text", strlen("elm.text")))
+ return strdup(BR_STRING_STORAGE);
+ } else if (type == BR_STORAGE_MENU_DEFAULT_STORAGE) {
+ if (!strncmp(part, "elm.text.1", strlen("elm.text.1")))
+ return strdup(BR_STRING_DEFAULT_STORAGE);
+ else if (!strncmp(part, "elm.text.2", strlen("elm.text.2"))) {
+ int current_storage = SETTING_DEF_MEMORY_PHONE;
+ if(vconf_get_int(VCONFKEY_SETAPPL_DEFAULT_MEM_WAP_INT, ¤t_storage) < 0) {
+ BROWSER_LOGE("[%s]vconf_get_int failed", VCONFKEY_SETAPPL_DEFAULT_MEM_WAP_INT);
+ return strdup(BR_STRING_PHONE);
+ }
+ if (current_storage == SETTING_DEF_MEMORY_PHONE)
+ return strdup(BR_STRING_PHONE);
+ else {
+ int mmc = VCONFKEY_SYSMAN_MMC_MOUNTED;
+ if (vconf_get_int(VCONFKEY_SYSMAN_MMC_STATUS, &mmc) < 0) {
+ BROWSER_LOGE("[%s]vconf_get_int failed", VCONFKEY_SYSMAN_MMC_STATUS);
+ return strdup(BR_STRING_MEMORY_CARD);
+ }
+ if (mmc == VCONFKEY_SYSMAN_MMC_MOUNTED)
+ return strdup(BR_STRING_MEMORY_CARD);
+ else
+ return strdup(BR_STRING_PHONE);
+ }
+ }
+ } else if (type == BR_STORAGE_SUBMENU_PHONE) {
+ if (!strncmp(part, "elm.text", strlen("elm.text")))
+ return strdup(BR_STRING_PHONE);
+ } else if (type == BR_STORAGE_SUBMENU_MEMORY_CARD) {
+ if (!strncmp(part, "elm.text", strlen("elm.text")))
+ return strdup(BR_STRING_MEMORY_CARD);
+ } else if (type == BR_MENU_PLUGINS) {
+ if (!strncmp(part, "elm.text", strlen("elm.text")))
+ return strdup(BR_STRING_PLUGINS);
+ } else if (type == BR_MENU_ACCELERATED_COMPOSITION) {
+ if (!strncmp(part, "elm.text", strlen("elm.text")))
+ return strdup("Accelerated composition");
+ } else if (type == BR_MENU_RESET_TO_DEFAULT) {
+ if (!strncmp(part, "elm.text", strlen("elm.text")))
+ return strdup(BR_STRING_RESET_TO_DEFAULT);
+ }
+
+ return NULL;
+}
+
+void Browser_Settings_Main_View::__homepage_sub_item_clicked_cb(void *data, Evas_Object *obj,
+ void *event_info)
+{
+ if (!data)
+ return;
+
+ genlist_callback_data *callback_data = (genlist_callback_data *)data;
+ Browser_Settings_Main_View::menu_type type = callback_data->type;
+ Browser_Settings_Main_View *main_view = (Browser_Settings_Main_View *)(callback_data->user_data);
+
+ int radio_value = 0;
+ if (type == BR_HOMEPAGE_SUBMENU_MOST_VISITED_SITES)
+ radio_value = 0;
+ else if (type == BR_HOMEPAGE_SUBMENU_RECENTLY_VISITED_SITE)
+ radio_value = 1;
+ else if (type == BR_HOMEPAGE_SUBMENU_USER_HOMEPAGE)
+ radio_value = 2;
+
+ elm_radio_value_set(main_view->m_homepage_radio_group, radio_value);
+
+ if (radio_value == 0)
+ vconf_set_str(HOMEPAGE_KEY, MOST_VISITED_SITES);
+ else if (radio_value == 1)
+ vconf_set_str(HOMEPAGE_KEY, RECENTLY_VISITED_SITE);
+ else if (radio_value == 2) {
+ main_view->m_edit_homepage_view = new(nothrow) Browser_Settings_Edit_Homepage_View(main_view);
+ if (!main_view->m_edit_homepage_view) {
+ BROWSER_LOGE("new Browser_Settings_Edit_Homepage_View failed");
+ return;
+ }
+ if (!main_view->m_edit_homepage_view->init()) {
+ BROWSER_LOGE("m_edit_homepage_view failed");
+ delete main_view->m_edit_homepage_view;
+ main_view->m_edit_homepage_view = NULL;
+ }
+ }
+ elm_genlist_item_update(main_view->m_homepage_item_callback_data.it);
+
+ elm_genlist_item_selected_set(callback_data->it, EINA_FALSE);
+}
+
+void Browser_Settings_Main_View::__default_view_level_sub_item_clicked_cb(void *data,
+ Evas_Object *obj, void *event_info)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ if (!data)
+ return;
+ genlist_callback_data *callback_data = (genlist_callback_data *)data;
+ Browser_Settings_Main_View::menu_type type = callback_data->type;
+ Browser_Settings_Main_View *main_view = (Browser_Settings_Main_View *)(callback_data->user_data);
+
+ int radio_value = 0;
+ if (type == BR_DISPLAY_SUBMENU_FIT_TO_WIDTH)
+ radio_value = 0;
+ else if (type == BR_DISPLAY_SUBMENU_READABLE)
+ radio_value = 1;
+
+ if (elm_radio_value_get(main_view->m_default_view_level_radio_group) != radio_value) {
+ elm_radio_value_set(main_view->m_default_view_level_radio_group, radio_value);
+ if (radio_value == 0)
+ vconf_set_str(DEFAULT_VIEW_LEVEL_KEY, FIT_TO_WIDTH);
+ else
+ vconf_set_str(DEFAULT_VIEW_LEVEL_KEY, READABLE);
+
+ elm_genlist_item_update(main_view->m_defailt_view_level_item_callback_data.it);
+ }
+
+ elm_genlist_item_selected_set(callback_data->it, EINA_FALSE);
+}
+
+void Browser_Settings_Main_View::__auto_save_id_pass_sub_item_clicked_cb(void *data,
+ Evas_Object *obj, void *event_info)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ if (!data)
+ return;
+ genlist_callback_data *callback_data = (genlist_callback_data *)data;
+ Browser_Settings_Main_View::menu_type type = callback_data->type;
+ Browser_Settings_Main_View *main_view = (Browser_Settings_Main_View *)(callback_data->user_data);
+
+ int radio_value = 0;
+ if (type == BR_PRIVACY_SUBMENU_ALWAYS_ASK)
+ radio_value = 0;
+ else if (type == BR_PRIVACY_SUBMENU_ALWAYS_ON)
+ radio_value = 1;
+ else if (type == BR_PRIVACY_SUBMENU_ALWAYS_OFF)
+ radio_value = 2;
+
+ if (elm_radio_value_get(main_view->m_auto_save_id_pass_radio_group) != radio_value) {
+ elm_radio_value_set(main_view->m_auto_save_id_pass_radio_group, radio_value);
+ if (radio_value == 0)
+ vconf_set_str(AUTO_SAVE_ID_PASSWORD_KEY, ALWAYS_ASK);
+ else if (radio_value == 1)
+ vconf_set_str(AUTO_SAVE_ID_PASSWORD_KEY, ALWAYS_ON);
+ else if (radio_value == 2)
+ vconf_set_str(AUTO_SAVE_ID_PASSWORD_KEY, ALWAYS_OFF);
+
+ elm_genlist_item_update(main_view->m_auto_save_item_callback_data.it);
+ }
+
+ elm_genlist_item_selected_set(callback_data->it, EINA_FALSE);
+}
+
+void Browser_Settings_Main_View::__default_storage_sub_item_clicked_cb(void *data,
+ Evas_Object *obj, void *event_info)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ if (!data)
+ return;
+ genlist_callback_data *callback_data = (genlist_callback_data *)data;
+ Browser_Settings_Main_View::menu_type type = callback_data->type;
+ Browser_Settings_Main_View *main_view = (Browser_Settings_Main_View *)(callback_data->user_data);
+
+ int radio_value = 0;
+ if (type == BR_STORAGE_SUBMENU_PHONE)
+ radio_value = 0;
+ else
+ radio_value = 1;
+
+ if (elm_radio_value_get(main_view->m_default_storage_radio_group) != radio_value) {
+ elm_radio_value_set(main_view->m_default_storage_radio_group, radio_value);
+ if (radio_value == 0) {
+ if (vconf_set_int(VCONFKEY_SETAPPL_DEFAULT_MEM_WAP_INT, SETTING_DEF_MEMORY_PHONE) < 0)
+ BROWSER_LOGE("[%s]vconf_set_int failed", VCONFKEY_SETAPPL_DEFAULT_MEM_WAP_INT);
+ }
+ else if (radio_value == 1
+ && elm_object_disabled_get(main_view->m_default_storage_mmc_radio_button) == EINA_FALSE)
+ if (vconf_set_int(VCONFKEY_SETAPPL_DEFAULT_MEM_WAP_INT, SETTING_DEF_MEMORY_MMC) < 0)
+ BROWSER_LOGE("[%s]vconf_set_int failed", VCONFKEY_SETAPPL_DEFAULT_MEM_WAP_INT);
+
+ elm_genlist_item_update(main_view->m_default_storage_item_callback_data.it);
+ }
+
+ elm_genlist_item_selected_set(callback_data->it, EINA_FALSE);
+}
+
+void Browser_Settings_Main_View::__expandable_icon_clicked_cb(void *data, Evas_Object *obj,
+ void *event_info)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ if (!data)
+ return;
+
+ genlist_callback_data *callback_data = (genlist_callback_data *)data;
+ Browser_Settings_Main_View::menu_type type = callback_data->type;
+ Browser_Settings_Main_View *main_view = (Browser_Settings_Main_View *)(callback_data->user_data);
+ Elm_Object_Item *it = callback_data->it;
+
+ Evas_Object *genlist = elm_object_item_widget_get(it);
+ Eina_Bool is_expanded = elm_genlist_item_expanded_get(it);
+ if (is_expanded) {
+ elm_genlist_item_expanded_set(it, EINA_FALSE);
+ elm_genlist_item_subitems_clear(it);
+
+ main_view->m_user_homepage_item_callback_data.it = NULL;
+ } else {
+ elm_genlist_item_expanded_set(it, EINA_TRUE);
+ if (it == main_view->m_homepage_item_callback_data.it) {
+ /* If homepage menu. */
+ main_view->m_most_visited_item_callback_data.type = BR_HOMEPAGE_SUBMENU_MOST_VISITED_SITES;
+ main_view->m_most_visited_item_callback_data.user_data = main_view;
+ main_view->m_most_visited_item_callback_data.it = elm_genlist_item_append(genlist, &(main_view->m_radio_text_item_class),
+ &(main_view->m_most_visited_item_callback_data), it,
+ ELM_GENLIST_ITEM_NONE, __homepage_sub_item_clicked_cb,
+ &(main_view->m_most_visited_item_callback_data));
+
+ main_view->m_recently_visited_item_callback_data.type = BR_HOMEPAGE_SUBMENU_RECENTLY_VISITED_SITE;
+ main_view->m_recently_visited_item_callback_data.user_data = main_view;
+ main_view->m_recently_visited_item_callback_data.it = elm_genlist_item_append(genlist, &(main_view->m_radio_text_item_class),
+ &(main_view->m_recently_visited_item_callback_data), it,
+ ELM_GENLIST_ITEM_NONE, __homepage_sub_item_clicked_cb,
+ &(main_view->m_recently_visited_item_callback_data));
+
+ main_view->m_user_homepage_item_callback_data.type = BR_HOMEPAGE_SUBMENU_USER_HOMEPAGE;
+ main_view->m_user_homepage_item_callback_data.user_data = main_view;
+ main_view->m_user_homepage_item_callback_data.it = elm_genlist_item_append(genlist, &(main_view->m_radio_text_item_class),
+ &(main_view->m_user_homepage_item_callback_data), it,
+ ELM_GENLIST_ITEM_NONE, __homepage_sub_item_clicked_cb,
+ &(main_view->m_user_homepage_item_callback_data));
+ } else if (it == main_view->m_defailt_view_level_item_callback_data.it) {
+ main_view->m_fit_to_width_item_callback_data.type = BR_DISPLAY_SUBMENU_FIT_TO_WIDTH;
+ main_view->m_fit_to_width_item_callback_data.user_data = main_view;
+ main_view->m_fit_to_width_item_callback_data.it = elm_genlist_item_append(genlist, &(main_view->m_radio_text_item_class),
+ &(main_view->m_fit_to_width_item_callback_data), it,
+ ELM_GENLIST_ITEM_NONE, __default_view_level_sub_item_clicked_cb,
+ &(main_view->m_fit_to_width_item_callback_data));
+
+ main_view->m_readable_item_callback_data.type = BR_DISPLAY_SUBMENU_READABLE;
+ main_view->m_readable_item_callback_data.user_data = main_view;
+ main_view->m_readable_item_callback_data.it = elm_genlist_item_append(genlist, &(main_view->m_radio_text_item_class),
+ &(main_view->m_readable_item_callback_data), it,
+ ELM_GENLIST_ITEM_NONE, __default_view_level_sub_item_clicked_cb,
+ &(main_view->m_readable_item_callback_data));
+ } else if (it == main_view->m_auto_save_item_callback_data.it) {
+ main_view->m_auto_save_always_ask_item_callback_data.type = BR_PRIVACY_SUBMENU_ALWAYS_ASK;
+ main_view->m_auto_save_always_ask_item_callback_data.user_data = main_view;
+ main_view->m_auto_save_always_ask_item_callback_data.it = elm_genlist_item_append(genlist, &(main_view->m_radio_text_item_class),
+ &(main_view->m_auto_save_always_ask_item_callback_data), it,
+ ELM_GENLIST_ITEM_NONE, __auto_save_id_pass_sub_item_clicked_cb,
+ &(main_view->m_auto_save_always_ask_item_callback_data));
+
+ main_view->m_auto_save_always_on_item_callback_data.type = BR_PRIVACY_SUBMENU_ALWAYS_ON;
+ main_view->m_auto_save_always_on_item_callback_data.user_data = main_view;
+ main_view->m_auto_save_always_on_item_callback_data.it = elm_genlist_item_append(genlist, &(main_view->m_radio_text_item_class),
+ &(main_view->m_auto_save_always_on_item_callback_data), it,
+ ELM_GENLIST_ITEM_NONE, __auto_save_id_pass_sub_item_clicked_cb,
+ &(main_view->m_auto_save_always_on_item_callback_data));
+
+ main_view->m_auto_save_always_off_item_callback_data.type = BR_PRIVACY_SUBMENU_ALWAYS_OFF;
+ main_view->m_auto_save_always_off_item_callback_data.user_data = main_view;
+ main_view->m_auto_save_always_off_item_callback_data.it = elm_genlist_item_append(genlist, &(main_view->m_radio_text_item_class),
+ &(main_view->m_auto_save_always_off_item_callback_data), it,
+ ELM_GENLIST_ITEM_NONE, __auto_save_id_pass_sub_item_clicked_cb,
+ &(main_view->m_auto_save_always_off_item_callback_data));
+ } else if (it == main_view->m_default_storage_item_callback_data.it) {
+ main_view->m_default_storage_phone_item_callback_data.type = BR_STORAGE_SUBMENU_PHONE;
+ main_view->m_default_storage_phone_item_callback_data.user_data = main_view;
+ main_view->m_default_storage_phone_item_callback_data.it = elm_genlist_item_append(genlist, &(main_view->m_radio_text_item_class),
+ &(main_view->m_default_storage_phone_item_callback_data), it,
+ ELM_GENLIST_ITEM_NONE, __default_storage_sub_item_clicked_cb,
+ &(main_view->m_default_storage_phone_item_callback_data));
+ main_view->m_default_storage_mmc_item_callback_data.type = BR_STORAGE_SUBMENU_MEMORY_CARD;
+ main_view->m_default_storage_mmc_item_callback_data.user_data = main_view;
+ main_view->m_default_storage_mmc_item_callback_data.it = elm_genlist_item_append(genlist, &(main_view->m_radio_text_item_class),
+ &(main_view->m_default_storage_mmc_item_callback_data), it,
+ ELM_GENLIST_ITEM_NONE, __default_storage_sub_item_clicked_cb,
+ &(main_view->m_default_storage_mmc_item_callback_data));
+
+ int mmc = VCONFKEY_SYSMAN_MMC_MOUNTED;
+ if (vconf_get_int(VCONFKEY_SYSMAN_MMC_STATUS, &mmc) < 0) {
+ BROWSER_LOGE("[%s]vconf_get_int failed", VCONFKEY_SYSMAN_MMC_STATUS);
+ mmc = SETTING_DEF_MEMORY_MMC;
+ }
+ if (mmc == VCONFKEY_SYSMAN_MMC_MOUNTED)
+ elm_object_item_disabled_set(main_view->m_default_storage_mmc_item_callback_data.it, EINA_FALSE);
+ else
+ elm_object_item_disabled_set(main_view->m_default_storage_mmc_item_callback_data.it, EINA_TRUE);
+ }
+ }
+
+ elm_genlist_item_selected_set(it, EINA_FALSE);
+}
+
+void Browser_Settings_Main_View::__on_off_check_clicked_cb(void *data, Evas_Object *obj,
+ void *event_info)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ if (!data)
+ return;
+
+ genlist_callback_data *callback_data = (genlist_callback_data *)data;
+ Browser_Settings_Main_View::menu_type type = callback_data->type;
+ Browser_Settings_Main_View *main_view = (Browser_Settings_Main_View *)(callback_data->user_data);
+
+ Eina_Bool state = EINA_TRUE;
+ if (type == BR_CONTENT_MENU_RUN_JAVASCRIPT) {
+ state = elm_check_state_get(main_view->m_run_javascript_check);
+ elm_check_state_set(main_view->m_run_javascript_check, !state);
+ __run_javascript_check_changed_cb(main_view->m_run_javascript_check, NULL, NULL);
+ } else if (type == BR_CONTENT_MENU_DISPLAY_IMAGES) {
+ state = elm_check_state_get(main_view->m_display_images_check);
+ elm_check_state_set(main_view->m_display_images_check, !state);
+ __display_images_check_changed_cb(main_view->m_display_images_check, NULL, NULL);
+ } else if (type == BR_CONTENT_MENU_BLOCK_POPUP) {
+ state = elm_check_state_get(main_view->m_block_popup_check);
+ elm_check_state_set(main_view->m_block_popup_check, !state);
+ __block_popup_check_changed_cb(main_view->m_block_popup_check, NULL, NULL);
+ } else if (type == BR_PRIVACY_MENU_ACCEPT_COOKIES) {
+ state = elm_check_state_get(main_view->m_accept_cookies_check);
+ elm_check_state_set(main_view->m_accept_cookies_check, !state);
+ __accept_cookies_check_changed_cb(main_view->m_accept_cookies_check, NULL, NULL);
+ }
+ elm_genlist_item_selected_set(callback_data->it, EINA_FALSE);
+}
+
+Eina_Bool Browser_Settings_Main_View::_call_user_agent(void)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ if (m_user_agent_view)
+ delete m_user_agent_view;
+ m_user_agent_view = new(nothrow) Browser_Settings_User_Agent_View(this);
+ if (!m_user_agent_view) {
+ BROWSER_LOGE("new Browser_Settings_User_Agent_View failed");
+ return EINA_FALSE;
+ }
+ if (!m_user_agent_view->init()) {
+ BROWSER_LOGE("m_user_agent_view->init failed");
+ return EINA_FALSE;
+ }
+
+ return EINA_TRUE;
+}
+
+void Browser_Settings_Main_View::__genlist_item_clicked_cb(void *data, Evas_Object *obj,
+ void *event_info)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ if (!data)
+ return;
+
+ genlist_callback_data *callback_data = (genlist_callback_data *)data;
+ Browser_Settings_Main_View::menu_type type = callback_data->type;
+ Browser_Settings_Main_View *main_view = (Browser_Settings_Main_View *)(callback_data->user_data);
+
+ if (type == BR_PRIVACY_MENU_CLEAR_PRIVATE_DATA) {
+ main_view->m_clear_data_view = new(nothrow) Browser_Settings_Clear_Data_View(main_view);
+ if (!main_view->m_clear_data_view) {
+ BROWSER_LOGE("new Browser_Settings_Clear_Data_View failed");
+ return;
+ }
+ if (!main_view->m_clear_data_view->init()) {
+ BROWSER_LOGE("m_clear_data_view->init failed");
+ delete main_view->m_clear_data_view;
+ main_view->m_clear_data_view = NULL;
+ return;
+ }
+ } else if (type == BR_MENU_USER_AGENT) {
+ if (!main_view->_call_user_agent())
+ BROWSER_LOGE("_call_user_agent failed");
+ }
+ else if (type == BR_MENU_PLUGINS) {
+ main_view->m_plugin_view = new(nothrow) Browser_Settings_Plugin_View(main_view);
+ if (!main_view->m_plugin_view) {
+ BROWSER_LOGE("new Browser_Settings_Plugin_View failed");
+ return;
+ }
+ if (!main_view->m_plugin_view->init()) {
+ BROWSER_LOGE("m_plugin_view->init failed");
+ delete main_view->m_plugin_view;
+ main_view->m_plugin_view = NULL;
+ return;
+ }
+ }
+ else if (type == BR_MENU_ACCELERATED_COMPOSITION) {
+ main_view->m_accelerated_composition_view = new(nothrow) Browser_Settings_Accelerated_Composition(main_view);
+ if (!main_view->m_accelerated_composition_view) {
+ BROWSER_LOGE("new Browser_Settings_Accelerated_Composition failed");
+ return;
+ }
+ if (!main_view->m_accelerated_composition_view->init()) {
+ BROWSER_LOGE("m_accelerated_composition_view->init failed");
+ delete main_view->m_accelerated_composition_view;
+ main_view->m_accelerated_composition_view = NULL;
+ return;
+ }
+ } else if (type == BR_MENU_RESET_TO_DEFAULT) {
+ main_view->_show_reset_confirm_popup();
+ }
+
+ elm_genlist_item_selected_set(callback_data->it, EINA_FALSE);
+}
+
+void Browser_Settings_Main_View::_reset_settings(void)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ if (vconf_set_str(HOMEPAGE_KEY, MOST_VISITED_SITES) < 0)
+ BROWSER_LOGE("vconf_set_str(HOMEPAGE_KEY, MOST_VISITED_SITES) failed");
+ if (vconf_set_str(USER_HOMEPAGE_KEY, BROWSER_DEFAULT_USER_HOMEPAGE) < 0)
+ BROWSER_LOGE("vconf_set_str(USER_HOMEPAGE_KEY, BROWSER_DEFAULT_USER_HOMEPAGE) failed");
+ if (vconf_set_str(DEFAULT_VIEW_LEVEL_KEY, READABLE) < 0)
+ BROWSER_LOGE("vconf_set_str(DEFAULT_VIEW_LEVEL_KEY, READABLE) failed");
+ if (vconf_set_bool(RUN_JAVASCRIPT_KEY, 1) < 0)
+ BROWSER_LOGE("vconf_set_bool(RUN_JAVASCRIPT_KEY, 1) failed");
+ if (vconf_set_bool(DISPLAY_IMAGES_KEY, 1) < 0)
+ BROWSER_LOGE("vconf_set_bool(DISPLAY_IMAGES_KEY, 1) failed");
+ if (vconf_set_bool(BLOCK_POPUP_KEY, 1) < 0)
+ BROWSER_LOGE("vconf_set_bool(BLOCK_POPUP_KEY, 1) failed");
+ if (vconf_set_bool(ACCEPT_COOKIES_KEY, 1) < 0)
+ BROWSER_LOGE("vconf_set_bool(ACCEPT_COOKIES_KEY, 1) failed");
+ if (vconf_set_str(AUTO_SAVE_ID_PASSWORD_KEY, ALWAYS_ASK) < 0)
+ BROWSER_LOGE("vconf_set_str(AUTO_SAVE_ID_PASSWORD_KEY, ALWAYS_ASK) failed");
+ if (vconf_set_int(VCONFKEY_SETAPPL_DEFAULT_MEM_WAP_INT, SETTING_DEF_MEMORY_PHONE) < 0)
+ BROWSER_LOGE("vconf_set_int(VCONFKEY_SETAPPL_DEFAULT_MEM_WAP_INT, SETTING_DEF_MEMORY_PHONE) failed");
+ if (vconf_set_bool(RUN_PLUGINS_KEY, 1) < 0)
+ BROWSER_LOGE("vconf_set_bool(RUN_PLUGINS_KEY, 1) failed");
+ if (vconf_set_bool(RUN_FLASH_KEY, 0) < 0)
+ BROWSER_LOGE("vconf_set_bool(RUN_FLASH_KEY, 0) failed");
+ if (vconf_set_bool(PAUSE_FLASH_KEY, 1) < 0)
+ BROWSER_LOGE("vconf_set_bool(PAUSE_FLASH_KEY, 1) failed");
+
+ if (vconf_set_str(USERAGENT_KEY, DEFAULT_USER_AGENT_STRING) < 0)
+ BROWSER_LOGE("vconf_set_str(USERAGENT_KEY, DEFAULT_USER_AGENT_STRING) failed");
+
+ elm_genlist_realized_items_update(m_genlist);
+}
+
+void Browser_Settings_Main_View::__reset_confirm_response_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ if (!data)
+ return;
+
+ Browser_Settings_Main_View *main_view = (Browser_Settings_Main_View *)data;
+ if (main_view->m_reset_confirm_popup) {
+ evas_object_del(main_view->m_reset_confirm_popup);
+ main_view->m_reset_confirm_popup = NULL;
+ }
+
+ main_view->_reset_settings();
+}
+
+void Browser_Settings_Main_View::__cancel_confirm_response_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ if (!data)
+ return;
+
+ Browser_Settings_Main_View *main_view = (Browser_Settings_Main_View *)data;
+ if (main_view->m_reset_confirm_popup) {
+ evas_object_del(main_view->m_reset_confirm_popup);
+ main_view->m_reset_confirm_popup = NULL;
+ }
+}
+
+Eina_Bool Browser_Settings_Main_View::_show_reset_confirm_popup(void)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ if (m_reset_confirm_popup)
+ evas_object_del(m_reset_confirm_popup);
+
+ m_reset_confirm_popup = elm_popup_add(m_genlist);
+ if (!m_reset_confirm_popup) {
+ BROWSER_LOGE("elm_popup_add failed");
+ return EINA_FALSE;
+ }
+
+ evas_object_size_hint_weight_set(m_reset_confirm_popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+
+ std::string confirm_msg = std::string(BR_STRING_RESET_TO_DEFAULT) + std::string("?");
+ elm_object_text_set(m_reset_confirm_popup, confirm_msg.c_str());
+
+ Evas_Object *ok_button = elm_button_add(m_reset_confirm_popup);
+ if (!ok_button) {
+ BROWSER_LOGE("elm_button_add failed");
+ return EINA_FALSE;
+ }
+ elm_object_text_set(ok_button, BR_STRING_YES);
+ elm_object_part_content_set(m_reset_confirm_popup, "button1", ok_button);
+ evas_object_smart_callback_add(ok_button, "clicked", __reset_confirm_response_cb, this);
+
+ Evas_Object *cancel_button = elm_button_add(m_reset_confirm_popup);
+ elm_object_text_set(cancel_button, BR_STRING_NO);
+ elm_object_part_content_set(m_reset_confirm_popup, "button2", cancel_button);
+ evas_object_smart_callback_add(cancel_button, "clicked", __cancel_confirm_response_cb, this);
+
+ evas_object_show(m_reset_confirm_popup);
+
+ return EINA_TRUE;
+}
+
+void Browser_Settings_Main_View::__mmc_key_changed_cb(keynode_t *keynode, void *data)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ if (!data)
+ return;
+ Browser_Settings_Main_View *main_view = (Browser_Settings_Main_View *)data;
+ int mmc = VCONFKEY_SYSMAN_MMC_MOUNTED;
+ if (!vconf_get_int(VCONFKEY_SYSMAN_MMC_STATUS, &mmc) < 0) {
+ BROWSER_LOGE("[%s] vconf_get_int failed");
+ mmc = VCONFKEY_SYSMAN_MMC_MOUNTED;
+ }
+ if (mmc == VCONFKEY_SYSMAN_MMC_MOUNTED) {
+ elm_object_disabled_set(main_view->m_default_storage_mmc_radio_button, EINA_FALSE);
+ elm_object_item_disabled_set(main_view->m_default_storage_mmc_item_callback_data.it, EINA_FALSE);
+ } else {
+ elm_radio_value_set(main_view->m_default_storage_radio_group, 0);
+ elm_object_disabled_set(main_view->m_default_storage_mmc_radio_button, EINA_TRUE);
+ elm_object_item_disabled_set(main_view->m_default_storage_mmc_item_callback_data.it, EINA_TRUE);
+ }
+
+ if (mmc != VCONFKEY_SYSMAN_MMC_MOUNTED) {
+ if (vconf_set_int(VCONFKEY_SETAPPL_DEFAULT_MEM_WAP_INT, SETTING_DEF_MEMORY_PHONE) < 0)
+ BROWSER_LOGE("[%s]vconf_set_int failed", VCONFKEY_SETAPPL_DEFAULT_MEM_WAP_INT);
+ elm_genlist_item_update(main_view->m_default_storage_item_callback_data.it);
+ }
+}
+
+Evas_Object *Browser_Settings_Main_View::_create_content_genlist(void)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ Evas_Object *genlist = NULL;
+
+ genlist = elm_genlist_add(m_navi_bar);
+ if (!genlist) {
+ BROWSER_LOGE("elm_genlist_add failed");
+ return NULL;
+ }
+
+ m_radio_text_item_class.item_style = "dialogue/1text.1icon/expandable2";
+ m_radio_text_item_class.func.text_get = __genlist_label_get;
+ m_radio_text_item_class.func.content_get = __genlist_icon_get;
+ m_radio_text_item_class.func.state_get = NULL;
+ m_radio_text_item_class.func.del = NULL;
+
+ m_category_title_item_class.item_style = "dialogue/title";
+ m_category_title_item_class.func.text_get = __genlist_label_get;
+ m_category_title_item_class.func.content_get = NULL;
+ m_category_title_item_class.func.del = NULL;
+ m_category_title_item_class.func.state_get = NULL;
+
+ /* Homepage */
+ m_homepage_title_callback_data.type = BR_HOMEPAGE_TITLE;
+ m_homepage_title_callback_data.user_data = this;
+ m_homepage_title_callback_data.it = elm_genlist_item_append(genlist, &m_category_title_item_class,
+ &m_homepage_title_callback_data, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
+
+ elm_genlist_item_select_mode_set(m_homepage_title_callback_data.it, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
+
+ m_2_text_item_class.item_style = "dialogue/2text.3/expandable";
+ m_2_text_item_class.func.text_get = __genlist_label_get;
+ m_2_text_item_class.func.content_get = NULL;
+ m_2_text_item_class.func.del = NULL;
+ m_2_text_item_class.func.state_get = NULL;
+
+ m_homepage_item_callback_data.type = BR_HOMEPAGE_MENU;
+ m_homepage_item_callback_data.user_data = this;
+ m_homepage_item_callback_data.it = elm_genlist_item_append(genlist, &m_2_text_item_class,
+ &m_homepage_item_callback_data, NULL, ELM_GENLIST_ITEM_TREE,
+ __expandable_icon_clicked_cb, &m_homepage_item_callback_data);
+
+ /* Display - Default view level */
+ m_display_title_callback_data.type = BR_DISPLAY_TITLE;
+ m_display_title_callback_data.user_data = this;
+ m_display_title_callback_data.it = elm_genlist_item_append(genlist, &m_category_title_item_class,
+ &m_display_title_callback_data, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
+
+ elm_genlist_item_select_mode_set(m_display_title_callback_data.it, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
+
+ m_defailt_view_level_item_callback_data.type = BR_DISPLAY_MENU_DEFAULT_VIEW_LEVEL;
+ m_defailt_view_level_item_callback_data.user_data = this;
+ m_defailt_view_level_item_callback_data.it = elm_genlist_item_append(genlist, &m_2_text_item_class,
+ &m_defailt_view_level_item_callback_data, NULL, ELM_GENLIST_ITEM_TREE,
+ __expandable_icon_clicked_cb, &m_defailt_view_level_item_callback_data);
+
+ /* Content - Run JavaScript / Display Images */
+ m_content_title_callback_data.type = BR_CONTENT_TITLE;
+ m_content_title_callback_data.user_data = this;
+ m_content_title_callback_data.it = elm_genlist_item_append(genlist, &m_category_title_item_class,
+ &m_content_title_callback_data, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
+
+ elm_genlist_item_select_mode_set(m_content_title_callback_data.it, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
+
+ m_1_text_1_icon_item_class.item_style = "dialogue/1text.1icon";
+ m_1_text_1_icon_item_class.func.text_get = __genlist_label_get;
+ m_1_text_1_icon_item_class.func.content_get = __genlist_icon_get;
+ m_1_text_1_icon_item_class.func.state_get = NULL;
+ m_1_text_1_icon_item_class.func.del = NULL;
+
+ m_run_javascript_item_callback_data.type = BR_CONTENT_MENU_RUN_JAVASCRIPT;
+ m_run_javascript_item_callback_data.user_data = this;
+ m_run_javascript_item_callback_data.it = elm_genlist_item_append(genlist, &m_1_text_1_icon_item_class,
+ &m_run_javascript_item_callback_data, NULL, ELM_GENLIST_ITEM_NONE,
+ __on_off_check_clicked_cb, &m_run_javascript_item_callback_data);
+
+ m_display_images_item_callback_data.type = BR_CONTENT_MENU_DISPLAY_IMAGES;
+ m_display_images_item_callback_data.user_data = this;
+ m_display_images_item_callback_data.it = elm_genlist_item_append(genlist, &m_1_text_1_icon_item_class,
+ &m_display_images_item_callback_data, NULL, ELM_GENLIST_ITEM_NONE,
+ __on_off_check_clicked_cb, &m_display_images_item_callback_data);
+
+ m_block_popup_item_callback_data.type = BR_CONTENT_MENU_BLOCK_POPUP;
+ m_block_popup_item_callback_data.user_data = this;
+ m_block_popup_item_callback_data.it = elm_genlist_item_append(genlist, &m_1_text_1_icon_item_class,
+ &m_block_popup_item_callback_data, NULL, ELM_GENLIST_ITEM_NONE,
+ __on_off_check_clicked_cb, &m_block_popup_item_callback_data);
+
+ /* Privacy - Accept cookies / Auto save ID, password / Clear private data */
+ m_privacy_title_callback_data.type = BR_PRIVACY_TITLE;
+ m_privacy_title_callback_data.user_data = this;
+ m_privacy_title_callback_data.it = elm_genlist_item_append(genlist, &m_category_title_item_class,
+ &m_privacy_title_callback_data, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
+
+ elm_genlist_item_select_mode_set(m_privacy_title_callback_data.it, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
+
+ m_accept_cookies_item_callback_data.type = BR_PRIVACY_MENU_ACCEPT_COOKIES;
+ m_accept_cookies_item_callback_data.user_data = this;
+ m_accept_cookies_item_callback_data.it = elm_genlist_item_append(genlist, &m_1_text_1_icon_item_class,
+ &m_accept_cookies_item_callback_data, NULL, ELM_GENLIST_ITEM_NONE,
+ __on_off_check_clicked_cb, &m_accept_cookies_item_callback_data);
+
+ m_auto_save_item_callback_data.type = BR_PRIVACY_MENU_AUTOSAVE_ID_PASSWORD;
+ m_auto_save_item_callback_data.user_data = this;
+ m_auto_save_item_callback_data.it = elm_genlist_item_append(genlist, &m_2_text_item_class,
+ &m_auto_save_item_callback_data, NULL, ELM_GENLIST_ITEM_TREE,
+ __expandable_icon_clicked_cb, &m_auto_save_item_callback_data);
+
+ m_1_text_item_class.item_style = "dialogue/1text";
+ m_1_text_item_class.func.text_get = __genlist_label_get;
+ m_1_text_item_class.func.content_get = NULL;
+ m_1_text_item_class.func.state_get = NULL;
+ m_1_text_item_class.func.del = NULL;
+
+ m_clear_private_data_item_callback_data.type = BR_PRIVACY_MENU_CLEAR_PRIVATE_DATA;
+ m_clear_private_data_item_callback_data.user_data = this;
+ m_clear_private_data_item_callback_data.it = elm_genlist_item_append(genlist, &m_1_text_item_class,
+ &m_clear_private_data_item_callback_data, NULL, ELM_GENLIST_ITEM_NONE,
+ __genlist_item_clicked_cb, &m_clear_private_data_item_callback_data);
+
+ /* Storage */
+ m_storage_title_callback_data.type = BR_STORAGE_TITLE;
+ m_storage_title_callback_data.user_data = this;
+ m_storage_title_callback_data.it = elm_genlist_item_append(genlist, &m_category_title_item_class,
+ &m_storage_title_callback_data, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
+
+ elm_genlist_item_select_mode_set(m_storage_title_callback_data.it, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
+
+ m_default_storage_item_callback_data.type = BR_STORAGE_MENU_DEFAULT_STORAGE;
+ m_default_storage_item_callback_data.user_data = this;
+ m_default_storage_item_callback_data.it = elm_genlist_item_append(genlist, &m_2_text_item_class,
+ &m_default_storage_item_callback_data, NULL, ELM_GENLIST_ITEM_TREE,
+ __expandable_icon_clicked_cb, &m_default_storage_item_callback_data);
+
+ if (vconf_notify_key_changed(VCONFKEY_SYSMAN_MMC_STATUS, __mmc_key_changed_cb, this) < 0)
+ BROWSER_LOGE("[%s]vconf_notify_key_changed failed", VCONFKEY_SYSMAN_MMC_STATUS);
+
+ /* Others */
+ m_seperator_item_class.item_style = "dialogue/seperator";
+ m_seperator_item_class.func.text_get = NULL;
+ m_seperator_item_class.func.content_get = NULL;
+ m_seperator_item_class.func.state_get = NULL;
+ m_seperator_item_class.func.del = NULL;
+ Elm_Object_Item *it = elm_genlist_item_append(genlist, &m_seperator_item_class,
+ NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
+
+ elm_genlist_item_select_mode_set(it, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
+
+ m_plugins_item_callback_data.type = BR_MENU_PLUGINS;
+ m_plugins_item_callback_data.user_data = this;
+ m_plugins_item_callback_data.it = elm_genlist_item_append(genlist, &m_1_text_item_class,
+ &m_plugins_item_callback_data, NULL, ELM_GENLIST_ITEM_NONE,
+ __genlist_item_clicked_cb, &m_plugins_item_callback_data);
+
+ m_reset_item_callback_data.type = BR_MENU_RESET_TO_DEFAULT;
+ m_reset_item_callback_data.user_data = this;
+ m_reset_item_callback_data.it = elm_genlist_item_append(genlist, &m_1_text_item_class,
+ &m_reset_item_callback_data, NULL, ELM_GENLIST_ITEM_NONE,
+ __genlist_item_clicked_cb, &m_reset_item_callback_data);
+
+ /* Debug */
+ m_debug_title_callback_data.type = BR_DEBUG_TITLE;
+ m_debug_title_callback_data.user_data = this;
+ m_debug_title_callback_data.it = elm_genlist_item_append(genlist, &m_category_title_item_class,
+ &m_debug_title_callback_data, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
+
+ elm_genlist_item_select_mode_set(m_debug_title_callback_data.it, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
+
+ m_user_agent_item_callback_data.type = BR_MENU_USER_AGENT;
+ m_user_agent_item_callback_data.user_data = this;
+ m_user_agent_item_callback_data.it = elm_genlist_item_append(genlist, &m_1_text_item_class,
+ &m_user_agent_item_callback_data, NULL, ELM_GENLIST_ITEM_NONE,
+ __genlist_item_clicked_cb, &m_user_agent_item_callback_data);
+ m_accelerated_composition_item_callback_data.type = BR_MENU_ACCELERATED_COMPOSITION;
+ m_accelerated_composition_item_callback_data.user_data = this;
+ m_accelerated_composition_item_callback_data.it = elm_genlist_item_append(genlist, &m_1_text_item_class,
+ &m_accelerated_composition_item_callback_data, NULL, ELM_GENLIST_ITEM_NONE,
+ __genlist_item_clicked_cb, &m_accelerated_composition_item_callback_data);
+ return genlist;
+}
+
diff --git a/src/browser-settings/browser-settings-main-view.h b/src/browser-settings/browser-settings-main-view.h new file mode 100755 index 00000000..131262da --- /dev/null +++ b/src/browser-settings/browser-settings-main-view.h @@ -0,0 +1,201 @@ +/*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef BROWSER_SETTINGS_MAIN_VIEW_H
+#define BROWSER_SETTINGS_MAIN_VIEW_H
+
+#include "browser-config.h"
+#include "browser-common-view.h"
+
+class Browser_Settings_Edit_Homepage_View;
+class Browser_Settings_Clear_Data_View;
+class Browser_Settings_Plugin_View;
+
+class Browser_Settings_Accelerated_Composition;
+class Browser_Settings_User_Agent_View;
+
+class Browser_Settings_Main_View : public Browser_Common_View {
+public:
+ typedef enum _menu_type
+ {
+ BR_HOMEPAGE_TITLE = 0,
+ BR_HOMEPAGE_MENU,
+ BR_HOMEPAGE_SUBMENU_MOST_VISITED_SITES,
+ BR_HOMEPAGE_SUBMENU_RECENTLY_VISITED_SITE,
+ BR_HOMEPAGE_SUBMENU_USER_HOMEPAGE,
+ BR_HOMEPAGE_SUBMENU_EMPTY_PAGE,
+ BR_DISPLAY_TITLE = 10,
+ BR_DISPLAY_MENU_DEFAULT_VIEW_LEVEL,
+ BR_DISPLAY_SUBMENU_FIT_TO_WIDTH,
+ BR_DISPLAY_SUBMENU_READABLE,
+ BR_DISPLAY_SUBMENU_LANDSCAPE_VIEW,
+ BR_CONTENT_TITLE = 20,
+ BR_CONTENT_MENU_RUN_JAVASCRIPT,
+ BR_CONTENT_MENU_DISPLAY_IMAGES,
+ BR_CONTENT_MENU_BLOCK_POPUP,
+ BR_PRIVACY_TITLE = 30,
+ BR_PRIVACY_MENU_ACCEPT_COOKIES,
+ BR_PRIVACY_MENU_AUTOSAVE_ID_PASSWORD,
+ BR_PRIVACY_SUBMENU_ALWAYS_ASK,
+ BR_PRIVACY_SUBMENU_ALWAYS_ON,
+ BR_PRIVACY_SUBMENU_ALWAYS_OFF,
+ BR_PRIVACY_MENU_CLEAR_PRIVATE_DATA,
+ BR_STORAGE_TITLE = 40,
+ BR_STORAGE_MENU_DEFAULT_STORAGE,
+ BR_STORAGE_SUBMENU_PHONE,
+ BR_STORAGE_SUBMENU_MEMORY_CARD,
+ BR_SEARCH_TITLE = 50,
+ BR_SEARCH_MENU_SEARCH_ENGINE,
+ BR_SEARCH_SUBMENU_GOOGLE,
+ BR_SEARCH_SUBMENU_YAHOO,
+ BR_SEARCH_SUBMENU_NAVER,
+ BR_SEARCH_MENU_CASE_SENSITIVE,
+ BR_MENU_READER = 60,
+ BR_MENU_PLUGINS,
+ BR_MENU_CERTIFICATES,
+ BR_MENU_ABOUT_BROWSER,
+ BR_MENU_RESET_TO_DEFAULT,
+ BR_DEBUG_TITLE = 70,
+ BR_MENU_DEBUG_MODE,
+ BR_MENU_USER_AGENT,
+ BR_MENU_ACCELERATED_COMPOSITION,
+ BR_MENU_UNKNOWN
+ }menu_type;
+ + Browser_Settings_Main_View(void);
+ ~Browser_Settings_Main_View(void);
+
+ Eina_Bool init(void);
+ Evas_Object *get_genlist(void) { return m_genlist; }
+private:
+ typedef struct _genlist_callback_data {
+ menu_type type;
+ void *user_data;
+ Elm_Object_Item *it;
+ } genlist_callback_data;
+
+ Eina_Bool _create_main_layout(void);
+ Evas_Object *_create_content_genlist(void);
+ Eina_Bool _call_user_agent(void);
+ Eina_Bool _show_reset_confirm_popup(void);
+ void _reset_settings(void);
+
+ /* genlist callback functions */
+ static Evas_Object *__genlist_icon_get(void *data, Evas_Object *obj, const char *part);
+ static char *__genlist_label_get(void *data, Evas_Object *obj, const char *part);
+
+ /* vconf changed callback functions */
+ static void __mmc_key_changed_cb(keynode_t *keynode, void *data);
+
+ /* elementary event callback functions */
+ static void __back_button_clicked_cb(void *data, Evas_Object* obj,
+ void* event_info);
+ static void __expandable_icon_clicked_cb(void *data, Evas_Object *obj,
+ void *event_info);
+ static void __on_off_check_clicked_cb(void *data, Evas_Object *obj,
+ void *event_info);
+ static void __homepage_sub_item_clicked_cb(void *data, Evas_Object *obj,
+ void *event_info);
+ static void __default_view_level_sub_item_clicked_cb(void *data,
+ Evas_Object *obj, void *event_info);
+ static void __auto_save_id_pass_sub_item_clicked_cb(void *data,
+ Evas_Object *obj, void *event_info);
+ static void __default_storage_sub_item_clicked_cb(void *data,
+ Evas_Object *obj, void *event_info);
+ static void __run_javascript_check_changed_cb(void *data,
+ Evas_Object *obj, void *event_info);
+ static void __display_images_check_changed_cb(void *data,
+ Evas_Object *obj, void *event_info);
+ static void __block_popup_check_changed_cb(void *data,
+ Evas_Object *obj, void *event_info);
+ static void __accept_cookies_check_changed_cb(void *data,
+ Evas_Object *obj, void *event_info);
+ static void __genlist_item_clicked_cb(void *data, Evas_Object *obj, void *event_info);
+ static void __reset_confirm_response_cb(void *data, Evas_Object *obj, void *event_info);
+ static void __cancel_confirm_response_cb(void *data, Evas_Object *obj, void *event_info);
+ static void __naviframe_pop_finished_cb(void *data , Evas_Object *obj, void *event_info);
+
+ Evas_Object *m_genlist;
+ Evas_Object *m_back_button;
+ Elm_Genlist_Item_Class m_category_title_item_class;
+ Elm_Genlist_Item_Class m_2_text_item_class;
+ Elm_Genlist_Item_Class m_1_text_1_icon_item_class;
+ Elm_Genlist_Item_Class m_1_text_item_class;
+ Elm_Genlist_Item_Class m_radio_text_item_class;
+ Elm_Genlist_Item_Class m_seperator_item_class;
+
+ /* Homepage */
+ genlist_callback_data m_homepage_title_callback_data;
+ genlist_callback_data m_homepage_item_callback_data;
+ genlist_callback_data m_most_visited_item_callback_data;
+ genlist_callback_data m_recently_visited_item_callback_data;
+ genlist_callback_data m_user_homepage_item_callback_data;
+ /* Display */
+ genlist_callback_data m_display_title_callback_data;
+ genlist_callback_data m_defailt_view_level_item_callback_data;
+ genlist_callback_data m_fit_to_width_item_callback_data;
+ genlist_callback_data m_readable_item_callback_data;
+ /* Content */
+ genlist_callback_data m_content_title_callback_data;
+ genlist_callback_data m_run_javascript_item_callback_data;
+ genlist_callback_data m_display_images_item_callback_data;
+ genlist_callback_data m_block_popup_item_callback_data;
+ /* Privacy */
+ genlist_callback_data m_privacy_title_callback_data;
+ genlist_callback_data m_accept_cookies_item_callback_data;
+ genlist_callback_data m_auto_save_item_callback_data;
+ genlist_callback_data m_auto_save_always_ask_item_callback_data;
+ genlist_callback_data m_auto_save_always_on_item_callback_data;
+ genlist_callback_data m_auto_save_always_off_item_callback_data;
+ genlist_callback_data m_clear_private_data_item_callback_data;
+
+ /* Storage */
+ genlist_callback_data m_storage_title_callback_data;
+ genlist_callback_data m_default_storage_item_callback_data;
+ genlist_callback_data m_default_storage_phone_item_callback_data;
+ genlist_callback_data m_default_storage_mmc_item_callback_data;
+
+ /* Others */
+ genlist_callback_data m_plugins_item_callback_data;
+ genlist_callback_data m_reset_item_callback_data;
+
+ /* Debug */
+ genlist_callback_data m_debug_title_callback_data; + genlist_callback_data m_user_agent_item_callback_data;
+ genlist_callback_data m_accelerated_composition_item_callback_data;
+ Evas_Object *m_homepage_radio_group;
+ Evas_Object *m_default_view_level_radio_group;
+ Evas_Object *m_auto_save_id_pass_radio_group;
+ Evas_Object *m_default_storage_radio_group;
+ Evas_Object *m_default_storage_mmc_radio_button;
+ Evas_Object *m_run_javascript_check;
+ Evas_Object *m_display_images_check;
+ Evas_Object *m_block_popup_check;
+ Evas_Object *m_accept_cookies_check;
+
+ Evas_Object *m_reset_confirm_popup;
+ Elm_Object_Item *m_navi_it;
+
+ Browser_Settings_Edit_Homepage_View *m_edit_homepage_view;
+ Browser_Settings_Clear_Data_View *m_clear_data_view;
+ Browser_Settings_Plugin_View *m_plugin_view;
+ Browser_Settings_Accelerated_Composition *m_accelerated_composition_view;
+
+ Browser_Settings_User_Agent_View *m_user_agent_view;
+};
+
+#endif /* BROWSER_SETTINGS_MAIN_VIEW_H */
+
diff --git a/src/browser-settings/browser-settings-plugin-view.cpp b/src/browser-settings/browser-settings-plugin-view.cpp new file mode 100755 index 00000000..98d59aa1 --- /dev/null +++ b/src/browser-settings/browser-settings-plugin-view.cpp @@ -0,0 +1,184 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "browser-settings-plugin-view.h" + +Browser_Settings_Plugin_View::Browser_Settings_Plugin_View(Browser_Settings_Main_View *main_view) +: + m_genlist(NULL) + ,m_back_button(NULL) + ,m_run_plugins_check_button(NULL) + ,m_main_view(main_view) +{ + BROWSER_LOGD("[%s]", __func__); +} + +Browser_Settings_Plugin_View::~Browser_Settings_Plugin_View(void) +{ + BROWSER_LOGD("[%s]", __func__); +} + +Eina_Bool Browser_Settings_Plugin_View::init(void) +{ + BROWSER_LOGD("[%s]", __func__); + + if (!_create_main_layout()) { + BROWSER_LOGE("_create_main_layout failed"); + return EINA_FALSE; + } + + return EINA_TRUE; +} + +void Browser_Settings_Plugin_View::__run_plugins_check_button_changed_cb(void *data, + Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_Settings_Plugin_View *plugin_view = (Browser_Settings_Plugin_View *)data; + + const char *key = RUN_PLUGINS_KEY; + Eina_Bool state = elm_check_state_get(obj); + if (vconf_set_bool(key, state) != 0) + BROWSER_LOGE("Key: [%s], FAILED\n", key); +} + +Evas_Object *Browser_Settings_Plugin_View::__genlist_icon_get(void *data, + Evas_Object *obj, const char *part) +{ + if (!data) + return NULL; + + genlist_callback_data *callback_data = (genlist_callback_data *)data; + Browser_Settings_Plugin_View::menu_type type = callback_data->type; + Browser_Settings_Plugin_View *plugin_view = (Browser_Settings_Plugin_View *)callback_data->user_data; + if (type == BR_RUN_PLUGINS) { + if (!strncmp(part, "elm.icon", strlen("elm.icon"))) { + plugin_view->m_run_plugins_check_button = elm_check_add(obj); + if (!plugin_view->m_run_plugins_check_button) { + BROWSER_LOGD("elm_check_add failed"); + return NULL; + } + elm_object_style_set(plugin_view->m_run_plugins_check_button, "on&off"); + evas_object_propagate_events_set(plugin_view->m_run_plugins_check_button, EINA_FALSE); + + int run_plugins = 1; + if (vconf_get_bool(RUN_PLUGINS_KEY, &run_plugins) < 0) + BROWSER_LOGE("vconf_get_bool failed"); + elm_check_state_set(plugin_view->m_run_plugins_check_button, run_plugins); + evas_object_smart_callback_add(plugin_view->m_run_plugins_check_button, "changed", + __run_plugins_check_button_changed_cb, plugin_view); + return plugin_view->m_run_plugins_check_button; + } + } + + return NULL; +} + +char *Browser_Settings_Plugin_View::__genlist_label_get(void *data, + Evas_Object *obj, const char *part) +{ + if (!data) + return NULL; + + genlist_callback_data *callback_data = (genlist_callback_data *)data; + Browser_Settings_Plugin_View::menu_type type = callback_data->type; + if (type == BR_RUN_PLUGINS) { + if (!strncmp(part, "elm.text", strlen("elm.text"))) { + return strdup(BR_STRING_ENABLE_PLUGINS); + } + } +} + +void Browser_Settings_Plugin_View::__item_selected_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + genlist_callback_data *callback_data = (genlist_callback_data *)data; + Browser_Settings_Plugin_View::menu_type type = callback_data->type; + Browser_Settings_Plugin_View *plugin_view = (Browser_Settings_Plugin_View *)callback_data->user_data; + + if (type == BR_RUN_PLUGINS) { + int value = elm_check_state_get(plugin_view->m_run_plugins_check_button); + elm_check_state_set(plugin_view->m_run_plugins_check_button, !value); + + __run_plugins_check_button_changed_cb(plugin_view, plugin_view->m_run_plugins_check_button, NULL); + + elm_genlist_item_selected_set(plugin_view->m_run_plugins_callback_data.it, EINA_FALSE); + } +} + +void Browser_Settings_Plugin_View::__back_button_clicked_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + + if (elm_naviframe_bottom_item_get(m_navi_bar) + != elm_naviframe_top_item_get(m_navi_bar)) + elm_naviframe_item_pop(m_navi_bar); +} + +Eina_Bool Browser_Settings_Plugin_View::_create_main_layout(void) +{ + BROWSER_LOGD("[%s]", __func__); + + m_genlist = elm_genlist_add(m_navi_bar); + if (!m_genlist) { + BROWSER_LOGE("elm_genlist_add failed"); + return EINA_FALSE; + } + + m_seperator_item_class.item_style = "dialogue/seperator"; + m_seperator_item_class.func.text_get = NULL; + m_seperator_item_class.func.content_get = NULL; + m_seperator_item_class.func.del = NULL; + m_seperator_item_class.func.state_get = NULL; + + Elm_Object_Item *it = elm_genlist_item_append(m_genlist, &m_seperator_item_class, + NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL); + elm_genlist_item_select_mode_set(it, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY); + + m_1_text_1_icon_item_class.item_style = "dialogue/1text.1icon"; + m_1_text_1_icon_item_class.func.text_get = __genlist_label_get; + m_1_text_1_icon_item_class.func.content_get = __genlist_icon_get; + m_1_text_1_icon_item_class.func.del = NULL; + m_1_text_1_icon_item_class.func.state_get = NULL; + + m_run_plugins_callback_data.type = BR_RUN_PLUGINS; + m_run_plugins_callback_data.user_data = this; + m_run_plugins_callback_data.it = elm_genlist_item_append(m_genlist, &m_1_text_1_icon_item_class, &m_run_plugins_callback_data, + NULL, ELM_GENLIST_ITEM_NONE, __item_selected_cb, &m_run_plugins_callback_data); + + evas_object_show(m_genlist); + + m_back_button = elm_button_add(m_genlist); + if (!m_back_button) { + BROWSER_LOGE("elm_button_add failed"); + return EINA_FALSE; + } + elm_object_style_set(m_back_button, "browser/bookmark_controlbar_back"); + evas_object_show(m_back_button); + evas_object_smart_callback_add(m_back_button, "clicked", __back_button_clicked_cb, this); + + Elm_Object_Item *navi_it = elm_naviframe_item_push(m_navi_bar, BR_STRING_PLUGINS, + m_back_button, NULL, m_genlist, "browser_titlebar"); + + return EINA_TRUE; +} + diff --git a/src/browser-settings/browser-settings-plugin-view.h b/src/browser-settings/browser-settings-plugin-view.h new file mode 100755 index 00000000..3b0c19fa --- /dev/null +++ b/src/browser-settings/browser-settings-plugin-view.h @@ -0,0 +1,66 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef BROWSER_SETTINGS_PLUGIN_VIEW_H +#define BROWSER_SETTINGS_PLUGIN_VIEW_H + +#include "browser-common-view.h" +#include "browser-config.h" +#include "browser-settings-main-view.h" + +class Browser_Settings_Plugin_View : public Browser_Common_View { +public: + Browser_Settings_Plugin_View(Browser_Settings_Main_View *main_view); + ~Browser_Settings_Plugin_View(void); + + Eina_Bool init(void); + + typedef enum _menu_type { + BR_RUN_PLUGINS, + BR_UNKOWN + } menu_type; +private: + typedef struct _genlist_callback_data { + menu_type type; + void *user_data; + Elm_Object_Item *it; + } genlist_callback_data; + + Eina_Bool _create_main_layout(void); + + /* genlist callback functions */ + static Evas_Object *__genlist_icon_get(void *data, Evas_Object *obj, const char *part); + static char *__genlist_label_get(void *data, Evas_Object *obj, const char *part); + + /* Elementary event callback functions */ + static void __item_selected_cb(void *data, Evas_Object *obj, void *event_info); + static void __back_button_clicked_cb(void *data, Evas_Object *obj, void *event_info); + static void __run_plugins_check_button_changed_cb(void *data, + Evas_Object *obj, void *event_info); + + Evas_Object *m_genlist; + Evas_Object *m_back_button; + Evas_Object *m_run_plugins_check_button; + + Elm_Genlist_Item_Class m_seperator_item_class; + Elm_Genlist_Item_Class m_1_text_1_icon_item_class; + + genlist_callback_data m_run_plugins_callback_data; + Browser_Settings_Main_View *m_main_view; +}; + +#endif /* BROWSER_SETTINGS_PLUGIN_VIEW_H */ + diff --git a/src/browser-settings/browser-settings-user-agent-view.cpp b/src/browser-settings/browser-settings-user-agent-view.cpp new file mode 100755 index 00000000..c8759bd7 --- /dev/null +++ b/src/browser-settings/browser-settings-user-agent-view.cpp @@ -0,0 +1,273 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "browser-settings-main-view.h" +#include "browser-settings-user-agent-view.h" + +Browser_Settings_User_Agent_View::Browser_Settings_User_Agent_View(Browser_Settings_Main_View *main_view) +: m_main_view(main_view) + ,m_back_button(NULL) + ,m_genlist(NULL) + ,m_tizen_checkbox(NULL) + ,m_chrome_checkbox(NULL) + ,m_firefox_checkbox(NULL) +{ + BROWSER_LOGD("[%s]", __func__); +} + +Browser_Settings_User_Agent_View::~Browser_Settings_User_Agent_View(void) +{ + BROWSER_LOGD("[%s]", __func__); +} + +Eina_Bool Browser_Settings_User_Agent_View::init(void) +{ + BROWSER_LOGD("[%s]", __func__); + + if (!_create_main_layout()) { + BROWSER_LOGE("_create_main_layout failed"); + return EINA_FALSE; + } + + return EINA_TRUE; +} + +void Browser_Settings_User_Agent_View::__back_button_clicked_cb(void *data, + Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + + if (elm_naviframe_bottom_item_get(m_navi_bar) + != elm_naviframe_top_item_get(m_navi_bar)) + elm_naviframe_item_pop(m_navi_bar); +} + +char *Browser_Settings_User_Agent_View::__genlist_label_get_cb(void *data, + Evas_Object *obj, const char *part) +{ + genlist_callback_data *callback_data = (genlist_callback_data *)data; + Browser_Settings_User_Agent_View::user_agent_type type = callback_data->type; + + if (!strncmp(part, "elm.text", strlen("elm.text"))) { + if (type == TIZEN) + return strdup("Tizen"); + else if (type == CHROME) + return strdup("Chrome"); + else if (type == FIREFOX) + return strdup("Firefox"); + } + + return NULL; +} + +Evas_Object *Browser_Settings_User_Agent_View::__genlist_icon_get_cb(void *data, + Evas_Object *obj, const char *part) +{ + genlist_callback_data *callback_data = (genlist_callback_data *)data; + Browser_Settings_User_Agent_View *user_agent_view = NULL; + user_agent_view = (Browser_Settings_User_Agent_View *)(callback_data->user_data); + Browser_Settings_User_Agent_View::user_agent_type type = callback_data->type; + + if (!strncmp(part, "elm.icon", strlen("elm.icon"))) { + if (type == TIZEN) { + user_agent_view->m_tizen_checkbox = elm_check_add(obj); + if (!user_agent_view->m_tizen_checkbox) { + BROWSER_LOGE("elm_check_add failed"); + return NULL; + } + char *user_agent = vconf_get_str(USERAGENT_KEY); + if (user_agent) { + if (!strncmp(user_agent, "Tizen", strlen("Tizen"))) + elm_check_state_set(user_agent_view->m_tizen_checkbox, EINA_TRUE); + + free(user_agent); + } + + evas_object_propagate_events_set(user_agent_view->m_tizen_checkbox, EINA_FALSE); + evas_object_smart_callback_add(user_agent_view->m_tizen_checkbox, "changed", + __check_changed_cb, callback_data); + + return user_agent_view->m_tizen_checkbox; + } else if (type == CHROME) { + user_agent_view->m_chrome_checkbox = elm_check_add(obj); + if (!user_agent_view->m_chrome_checkbox) { + BROWSER_LOGE("elm_check_add failed"); + return NULL; + } + char *user_agent = vconf_get_str(USERAGENT_KEY); + if (user_agent) { + if (!strncmp(user_agent, "Chrome", strlen("Chrome"))) + elm_check_state_set(user_agent_view->m_chrome_checkbox, EINA_TRUE); + + free(user_agent); + } + + evas_object_propagate_events_set(user_agent_view->m_chrome_checkbox, EINA_FALSE); + evas_object_smart_callback_add(user_agent_view->m_chrome_checkbox, "changed", + __check_changed_cb, callback_data); + + return user_agent_view->m_chrome_checkbox; + }else if (type == FIREFOX) { + user_agent_view->m_firefox_checkbox = elm_check_add(obj); + if (!user_agent_view->m_firefox_checkbox) { + BROWSER_LOGE("elm_check_add failed"); + return NULL; + } + char *user_agent = vconf_get_str(USERAGENT_KEY); + if (user_agent) { + if (!strncmp(user_agent, "Firefox", strlen("Firefox"))) + elm_check_state_set(user_agent_view->m_firefox_checkbox, EINA_TRUE); + + free(user_agent); + } + + evas_object_propagate_events_set(user_agent_view->m_firefox_checkbox, EINA_FALSE); + evas_object_smart_callback_add(user_agent_view->m_firefox_checkbox, "changed", + __check_changed_cb, callback_data); + + return user_agent_view->m_firefox_checkbox; + } + } + + return NULL; +} + +void Browser_Settings_User_Agent_View::__check_changed_cb( void *data, + Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + genlist_callback_data *callback_data = (genlist_callback_data *)data; + Browser_Settings_User_Agent_View *user_agent_view = NULL; + user_agent_view = (Browser_Settings_User_Agent_View *)(callback_data->user_data); + Browser_Settings_User_Agent_View::user_agent_type type = callback_data->type; + + const char *key = USERAGENT_KEY; + Eina_Bool state = elm_check_state_get(obj); + if (state) { + if (type == TIZEN) { + elm_check_state_set(user_agent_view->m_tizen_checkbox, EINA_TRUE); + elm_check_state_set(user_agent_view->m_chrome_checkbox, EINA_FALSE); + elm_check_state_set(user_agent_view->m_firefox_checkbox, EINA_FALSE); + if (vconf_set_str(USERAGENT_KEY, "Tizen") < 0) + BROWSER_LOGE("vconf_set_str failed"); + } else if (type == CHROME){ + elm_check_state_set(user_agent_view->m_tizen_checkbox, EINA_FALSE); + elm_check_state_set(user_agent_view->m_chrome_checkbox, EINA_TRUE); + elm_check_state_set(user_agent_view->m_firefox_checkbox, EINA_FALSE); + if (vconf_set_str(USERAGENT_KEY, "Chrome") < 0) + BROWSER_LOGE("vconf_set_str failed"); + } else { + elm_check_state_set(user_agent_view->m_tizen_checkbox, EINA_FALSE); + elm_check_state_set(user_agent_view->m_chrome_checkbox, EINA_FALSE); + elm_check_state_set(user_agent_view->m_firefox_checkbox, EINA_TRUE); + if (vconf_set_str(USERAGENT_KEY, "Firefox") < 0) + BROWSER_LOGE("vconf_set_str failed"); + } + } else { + if (type == TIZEN) { + if (!elm_check_state_get(user_agent_view->m_chrome_checkbox)) + elm_check_state_set(user_agent_view->m_tizen_checkbox, EINA_TRUE); + } else { + if (!elm_check_state_get(user_agent_view->m_tizen_checkbox)) + elm_check_state_set(user_agent_view->m_chrome_checkbox, EINA_TRUE); + } + } +} + +void Browser_Settings_User_Agent_View::__item_selected_cb(void *data, + Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + genlist_callback_data *callback_data = (genlist_callback_data *)data; + Browser_Settings_User_Agent_View *user_agent_view = NULL; + user_agent_view = (Browser_Settings_User_Agent_View *)(callback_data->user_data); + Browser_Settings_User_Agent_View::user_agent_type type = callback_data->type; + + if (type == TIZEN) { + elm_check_state_set(user_agent_view->m_tizen_checkbox, EINA_TRUE); + elm_check_state_set(user_agent_view->m_chrome_checkbox, EINA_FALSE); + elm_check_state_set(user_agent_view->m_firefox_checkbox, EINA_FALSE); + if (vconf_set_str(USERAGENT_KEY, "Tizen") < 0) + BROWSER_LOGE("vconf_set_str failed"); + } else if(type == CHROME){ + elm_check_state_set(user_agent_view->m_tizen_checkbox, EINA_FALSE); + elm_check_state_set(user_agent_view->m_chrome_checkbox, EINA_TRUE); + elm_check_state_set(user_agent_view->m_firefox_checkbox, EINA_FALSE); + if (vconf_set_str(USERAGENT_KEY, "Chrome") < 0) + BROWSER_LOGE("vconf_set_str failed"); + } else { + elm_check_state_set(user_agent_view->m_tizen_checkbox, EINA_FALSE); + elm_check_state_set(user_agent_view->m_chrome_checkbox, EINA_FALSE); + elm_check_state_set(user_agent_view->m_firefox_checkbox, EINA_TRUE); + if (vconf_set_str(USERAGENT_KEY, "Firefox") < 0) + BROWSER_LOGE("vconf_set_str failed"); + } + + elm_genlist_item_selected_set(callback_data->it, EINA_FALSE); +} + +Eina_Bool Browser_Settings_User_Agent_View::_create_main_layout(void) +{ + BROWSER_LOGD("[%s]", __func__); + + m_genlist = elm_genlist_add(m_navi_bar); + if (!m_genlist) { + BROWSER_LOGE("elm_genlist_add failed"); + return EINA_FALSE; + } + evas_object_size_hint_weight_set(m_genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(m_genlist, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_show(m_genlist); + + m_1_text_1_icon_item_class.item_style = "1text.1icon.2"; + m_1_text_1_icon_item_class.func.text_get = __genlist_label_get_cb; + m_1_text_1_icon_item_class.func.content_get = __genlist_icon_get_cb; + m_1_text_1_icon_item_class.func.state_get = NULL; + m_1_text_1_icon_item_class.func.del = NULL; + + m_tizen_item_callback_data.type = TIZEN; + m_tizen_item_callback_data.user_data = this; + m_tizen_item_callback_data.it = elm_genlist_item_append(m_genlist, &m_1_text_1_icon_item_class, + &m_tizen_item_callback_data, NULL, ELM_GENLIST_ITEM_NONE, + __item_selected_cb, &m_tizen_item_callback_data); + + m_chrome_item_callback_data.type = CHROME; + m_chrome_item_callback_data.user_data = this; + m_chrome_item_callback_data.it = elm_genlist_item_append(m_genlist, &m_1_text_1_icon_item_class, + &m_chrome_item_callback_data, NULL, ELM_GENLIST_ITEM_NONE, + __item_selected_cb, &m_chrome_item_callback_data); + + m_firefox_item_callback_data.type = FIREFOX; + m_firefox_item_callback_data.user_data = this; + m_firefox_item_callback_data.it = elm_genlist_item_append(m_genlist, &m_1_text_1_icon_item_class, + &m_firefox_item_callback_data, NULL, ELM_GENLIST_ITEM_NONE, + __item_selected_cb, &m_firefox_item_callback_data); + + m_back_button = elm_button_add(m_genlist); + if (!m_back_button) { + BROWSER_LOGE("elm_button_add failed"); + return EINA_FALSE; + } + elm_object_style_set(m_back_button, "browser/bookmark_controlbar_back"); + evas_object_show(m_back_button); + evas_object_smart_callback_add(m_back_button, "clicked", __back_button_clicked_cb, this); + + Elm_Object_Item *navi_it = elm_naviframe_item_push(m_navi_bar, "User Agent", + m_back_button, NULL, m_genlist, "browser_titlebar"); + + return EINA_TRUE; +} + diff --git a/src/browser-settings/browser-settings-user-agent-view.h b/src/browser-settings/browser-settings-user-agent-view.h new file mode 100755 index 00000000..260f21d2 --- /dev/null +++ b/src/browser-settings/browser-settings-user-agent-view.h @@ -0,0 +1,69 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef BROWSER_SETTINGS_USER_AGENT_VIEW_H +#define BROWSER_SETTINGS_USER_AGENT_VIEW_H + +#include "browser-common-view.h" +#include "browser-config.h" + +class Browser_Settings_Main_View; +class Browser_Settings_User_Agent_View : public Browser_Common_View { +public: + Browser_Settings_User_Agent_View(Browser_Settings_Main_View *main_view); + ~Browser_Settings_User_Agent_View(void); + + Eina_Bool init(void); + + typedef enum _user_agent_type { + TIZEN, + CHROME, + FIREFOX, + UNKNOWN + } user_agent_type; +private: + typedef struct _genlist_callback_data { + user_agent_type type; + void *user_data; + Elm_Object_Item *it; + } genlist_callback_data; + + Eina_Bool _create_main_layout(void); + + /* Elementary event callback functions */ + static void __back_button_clicked_cb(void *data, Evas_Object *obj, void *event_info); + + static char *__genlist_label_get_cb(void *data, Evas_Object *obj, const char *part); + static Evas_Object *__genlist_icon_get_cb(void *data, Evas_Object *obj, const char *part); + static void __check_changed_cb( void *data, Evas_Object *obj, void *event_info); + static void __item_selected_cb(void *data, Evas_Object *obj, void *event_info); + + Browser_Settings_Main_View *m_main_view; + Evas_Object *m_back_button; + Evas_Object *m_genlist; + Evas_Object *m_tizen_checkbox; + Evas_Object *m_chrome_checkbox; + Evas_Object *m_firefox_checkbox; + + genlist_callback_data m_tizen_item_callback_data; + genlist_callback_data m_chrome_item_callback_data; + genlist_callback_data m_firefox_item_callback_data; + + Elm_Genlist_Item_Class m_1_text_1_icon_item_class; +}; + +#endif /* BROWSER_SETTINGS_ABOUT_BROWSER_H */ + diff --git a/src/browser-utility.cpp b/src/browser-utility.cpp new file mode 100755 index 00000000..e679dba6 --- /dev/null +++ b/src/browser-utility.cpp @@ -0,0 +1,300 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +extern "C" { +#include <Elementary.h> +} + +#include "browser-utility.h" + +static void __changed_cb(void *data, Evas_Object *obj, void *event_info) +{ + Evas_Object *layout = (Evas_Object *)data; + + void *erase = evas_object_data_get(layout, "eraser"); + BROWSER_LOGD("erase = %d", erase); + if (!erase) + return; + + if (elm_object_focus_get(layout)) { + if (elm_entry_is_empty(obj)) + elm_object_signal_emit(layout, "elm,state,eraser,hide", "elm"); + else + elm_object_signal_emit(layout, "elm,state,eraser,show", "elm"); + } +} + +static void __focused_cb(void *data, Evas_Object *obj, void *event_info) +{ + Evas_Object *layout = (Evas_Object *)data; + + void *erase = evas_object_data_get(layout, "eraser"); + BROWSER_LOGD("erase = %d", erase); + + if (!elm_entry_is_empty(obj) && erase) + elm_object_signal_emit(layout, "elm,state,eraser,show", "elm"); + + elm_object_signal_emit(layout, "elm,state,guidetext,hide", "elm"); +} + +static void __unfocused_cb(void *data, Evas_Object *obj, void *event_info) +{ + Evas_Object *layout = (Evas_Object *)data; + + if (elm_entry_is_empty(obj)) + elm_object_signal_emit(layout, "elm,state,guidetext,show", "elm"); + + elm_object_signal_emit(layout, "elm,state,eraser,hide", "elm"); +} + +static void __url_entry_focused_cb(void *data, Evas_Object *obj, void *event_info) +{ + Evas_Object *layout = (Evas_Object *)data; + + void *erase = evas_object_data_get(layout, "eraser"); + BROWSER_LOGD("erase = %d", erase); + + if (!elm_entry_is_empty(obj) && erase) + elm_object_signal_emit(layout, "elm,state,eraser,show", "elm"); + + elm_object_signal_emit(layout, "elm,state,guidetext,hide", "elm"); + + int *cursor_position = (int *)evas_object_data_get(obj, "cursor_position"); + BROWSER_LOGD("cursor_position = %d", cursor_position); + elm_entry_cursor_pos_set(obj, (int)cursor_position); +} + +static void __url_entry_unfocused_cb(void *data, Evas_Object *obj, void *event_info) +{ + Evas_Object *layout = (Evas_Object *)data; + + if (elm_entry_is_empty(obj)) + elm_object_signal_emit(layout, "elm,state,guidetext,show", "elm"); + + elm_object_signal_emit(layout, "elm,state,eraser,hide", "elm"); + + evas_object_data_set(obj, "cursor_position", (void *)elm_entry_cursor_pos_get(obj)); + + BROWSER_LOGD("cursor_position = %d", elm_entry_cursor_pos_get(obj)); +} + +static void __eraser_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source) +{ + Evas_Object *entry = (Evas_Object *)data; + elm_entry_entry_set(entry, ""); +} + +Evas_Object *br_elm_url_editfield_add(Evas_Object *parent) +{ + Evas_Object *layout = elm_layout_add(parent); + + elm_layout_theme_set(layout, "layout", "browser-editfield", "default"); + + Evas_Object *entry = elm_entry_add(parent); + elm_object_part_content_set(layout, "elm.swallow.content", entry); + + evas_object_smart_callback_add(entry, "changed", __changed_cb, layout); + evas_object_smart_callback_add(entry, "focused", __url_entry_focused_cb, layout); + evas_object_smart_callback_add(entry, "unfocused", __url_entry_unfocused_cb, layout); + elm_object_signal_callback_add(layout, "elm,eraser,clicked", "elm", + __eraser_clicked_cb, entry); + + return layout; +} + +Evas_Object *br_elm_editfield_add(Evas_Object *parent, Eina_Bool title) +{ + Evas_Object *layout = elm_layout_add(parent); + if (title) + elm_layout_theme_set(layout, "layout", "editfield", "title"); + else + elm_layout_theme_set(layout, "layout", "editfield", "default"); + + Evas_Object *entry = elm_entry_add(parent); + elm_object_part_content_set(layout, "elm.swallow.content", entry); + + elm_object_signal_emit(layout, "elm,state,guidetext,hide", "elm"); + evas_object_data_set(layout, "eraser", (void *)EINA_TRUE); + + evas_object_smart_callback_add(entry, "changed", __changed_cb, layout); + evas_object_smart_callback_add(entry, "focused", __focused_cb, layout); + evas_object_smart_callback_add(entry, "unfocused", __unfocused_cb, layout); + elm_object_signal_callback_add(layout, "elm,eraser,clicked", "elm", + __eraser_clicked_cb, entry); + + return layout; +} + +void br_elm_editfield_label_set(Evas_Object *obj, const char *label) +{ + elm_object_part_text_set(obj, "elm.text", label); +} + +Evas_Object *br_elm_editfield_entry_get(Evas_Object *obj) +{ + return elm_object_part_content_get(obj, "elm.swallow.content"); +} + +void br_elm_editfield_guide_text_set(Evas_Object *obj, const char *text) +{ + elm_object_part_text_set(obj, "elm.guidetext", text); +} + +void br_elm_editfield_entry_single_line_set(Evas_Object *obj, Eina_Bool single_line) +{ + Evas_Object *entry = br_elm_editfield_entry_get(obj); + elm_entry_single_line_set(entry, EINA_TRUE); + elm_entry_scrollable_set(entry, EINA_TRUE); +} + +void br_elm_editfield_eraser_set(Evas_Object *obj, Eina_Bool visible) +{ + evas_object_data_set(obj, "eraser", (void *)visible); + + if (visible) + elm_object_signal_emit(obj, "elm,state,eraser,show", "elm"); + else + elm_object_signal_emit(obj, "elm,state,eraser,hide", "elm"); +} + + +static void __searchbar_changed_cb(void *data, Evas_Object *obj, void *event_info) +{ + Evas_Object *layout = (Evas_Object *)data; + + if (elm_object_focus_get(layout)) { + if (elm_entry_is_empty(obj)) + elm_object_signal_emit(layout, "elm,state,eraser,hide", "elm"); + else + elm_object_signal_emit(layout, "elm,state,eraser,show", "elm"); + } +} + +static void __searchbar_focused_cb(void *data, Evas_Object *obj, void *event_info) +{ + Evas_Object *layout = (Evas_Object *)data; + + if (!elm_entry_is_empty(obj)) + elm_object_signal_emit(layout, "elm,state,eraser,show", "elm"); + + elm_object_signal_emit(layout, "elm,state,guidetext,hide", "elm"); + elm_object_signal_emit(layout, "cancel,in", ""); +} + +static void __searchbar_unfocused_cb(void *data, Evas_Object *obj, void *event_info) +{ + Evas_Object *layout = (Evas_Object *)data; + + if (elm_entry_is_empty(obj)) + elm_object_signal_emit(layout, "elm,state,guidetext,show", "elm"); + elm_object_signal_emit(layout, "elm,state,eraser,hide", "elm"); +} + +static void __searchbar_eraser_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source) +{ + Evas_Object *entry = (Evas_Object *)data; + + elm_entry_entry_set(entry, ""); +} + +static void __searchbar_bg_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source) +{ + Evas_Object *entry = (Evas_Object *)data; + + elm_object_focus_set(entry, EINA_TRUE); +} + +static void __searchbar_cancel_clicked_cb(void *data, Evas_Object *obj, void *event_info) +{ + Evas_Object *searchbar_layout = (Evas_Object *)data; + Evas_Object *entry = elm_object_part_content_get(searchbar_layout, "elm.swallow.content"); + const char* text; + evas_object_hide(obj); + elm_object_signal_emit(searchbar_layout, "cancel,out", ""); + + text = elm_entry_entry_get(entry); + if (text != NULL && strlen(text) > 0) + elm_entry_entry_set(entry, NULL); + + elm_object_focus_set(entry, EINA_FALSE); +} + +static void __search_entry_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source) +{ + Evas_Object *entry = (Evas_Object *)data; + if (!elm_object_focus_allow_get(entry)) { + elm_object_focus_allow_set(entry, EINA_TRUE); + elm_object_focus_set(entry, EINA_TRUE); + } +} + +Evas_Object *br_elm_searchbar_add(Evas_Object *parent) +{ + Evas_Object *searchbar_layout = elm_layout_add(parent); + elm_layout_theme_set(searchbar_layout, "layout", "searchbar", "cancel_button"); + Evas_Object *entry = elm_entry_add(searchbar_layout); + elm_entry_scrollable_set(entry, EINA_TRUE); + elm_entry_single_line_set(entry, EINA_TRUE); + elm_object_part_content_set(searchbar_layout, "elm.swallow.content", entry); + elm_object_part_text_set(searchbar_layout, "elm.guidetext", BR_STRING_SEARCH); + + /* Workaround + * When tab history view, the search entry has focus automatically. + * So the keypad is shown. So give focus manually. */ + edje_object_signal_callback_add(elm_layout_edje_get(searchbar_layout), + "mouse,clicked,1", "elm.swallow.content", __search_entry_clicked_cb, entry); + + elm_object_focus_allow_set(entry, EINA_FALSE); + + Evas_Object *cancel_button = elm_button_add(searchbar_layout); + elm_object_part_content_set(searchbar_layout, "button_cancel", cancel_button); + elm_object_style_set(cancel_button, "searchbar/default"); + elm_object_text_set(cancel_button, BR_STRING_CANCEL); + evas_object_smart_callback_add(cancel_button, "clicked", __searchbar_cancel_clicked_cb, searchbar_layout); + + evas_object_smart_callback_add(entry, "changed", __searchbar_changed_cb, searchbar_layout); + evas_object_smart_callback_add(entry, "focused", __searchbar_focused_cb, searchbar_layout); + evas_object_smart_callback_add(entry, "unfocused", __searchbar_unfocused_cb, searchbar_layout); + elm_object_signal_callback_add(searchbar_layout, "elm,eraser,clicked", "elm", + __searchbar_eraser_clicked_cb, entry); + elm_object_signal_callback_add(searchbar_layout, "elm,bg,clicked", "elm", __searchbar_bg_clicked_cb, entry); + + return searchbar_layout; +} + +void br_elm_searchbar_text_set(Evas_Object *obj, const char *text) +{ + Evas_Object *entry = elm_object_part_content_get(obj, "elm.swallow.content"); + elm_object_text_set(entry, text); +} + +char *br_elm_searchbar_text_get(Evas_Object *obj) +{ + Evas_Object *entry = elm_object_part_content_get(obj, "elm.swallow.content"); + const char *text = elm_object_text_get(entry); + BROWSER_LOGD("search entry text=[%s]", text); + + if (text && strlen(text)) + return strdup(text); + else + return NULL; +} + +Evas_Object *br_elm_searchbar_entry_get(Evas_Object *obj) +{ + return elm_object_part_content_get(obj, "elm.swallow.content"); +} + diff --git a/src/browser-utility.h b/src/browser-utility.h new file mode 100755 index 00000000..6267c45f --- /dev/null +++ b/src/browser-utility.h @@ -0,0 +1,51 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef BROWSER_UTILITY_H +#define BROWSER_UTILITY_H + +#include "browser-config.h" + +#ifdef __cplusplus +extern "C" { +#endif + +Evas_Object *br_elm_url_editfield_add(Evas_Object *parent); + +Evas_Object *br_elm_editfield_add(Evas_Object *parent, Eina_Bool title = EINA_FALSE); + +void br_elm_editfield_label_set(Evas_Object *obj, const char *label); + +Evas_Object *br_elm_editfield_entry_get(Evas_Object *obj); + +void br_elm_editfield_guide_text_set(Evas_Object *obj, const char *text); + +void br_elm_editfield_entry_single_line_set(Evas_Object *obj, Eina_Bool single_line); + +void br_elm_editfield_eraser_set(Evas_Object *obj, Eina_Bool visible); + +Evas_Object *br_elm_searchbar_add(Evas_Object *parent); +void br_elm_searchbar_text_set(Evas_Object *obj, const char *text); +char *br_elm_searchbar_text_get(Evas_Object *obj); +Evas_Object *br_elm_searchbar_entry_get(Evas_Object *obj); + + +#ifdef __cplusplus +} +#endif + +#endif /* SCISSORBOX_H*/ + diff --git a/src/browser-view/browser-context-menu.cpp b/src/browser-view/browser-context-menu.cpp new file mode 100755 index 00000000..81fc3365 --- /dev/null +++ b/src/browser-view/browser-context-menu.cpp @@ -0,0 +1,567 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "browser-context-menu.h" +#include "browser-view.h" +#include "browser-window.h" + +#define BROWSER_CONTEXT_MENU_MARGIN (60 * elm_scale_get()) + +Browser_Context_Menu::Browser_Context_Menu(Evas_Object *naviframe, Browser_View *browser_view) +: m_naviframe(naviframe) + ,m_browser_view(browser_view) + ,m_webview(NULL) + ,m_context_popup(NULL) + ,m_context_menu_data(NULL) + ,m_for_reader_view(EINA_FALSE) + ,m_current_context_menu_item(NULL) +{ + BROWSER_LOGD("[%s]", __func__); +} + +Browser_Context_Menu::~Browser_Context_Menu(void) +{ + BROWSER_LOGD("[%s]", __func__); + destroy_context_popup(); +} + +Eina_Bool Browser_Context_Menu::init(Evas_Object *webview, Eina_Bool reader_view) +{ + BROWSER_LOGD("[%s]", __func__); + if (!webview) { + BROWSER_LOGE("webview is null"); + return EINA_FALSE; + } + + m_webview = webview; + m_for_reader_view = reader_view; + + deinit(); + + Evas_Object *webkit = elm_webview_webkit_get(m_webview); + + evas_object_smart_callback_add(webkit, "webview,contextmenu,new", __context_menu_new_cb, this); + evas_object_smart_callback_add(webkit, "webview,contextmenu,show", __context_menu_show_cb, this); + evas_object_smart_callback_add(webkit, "webview,contextmenu,move", __context_menu_move_cb, this); + evas_object_smart_callback_add(webkit, "webview,contextmenu,hide", __context_menu_hide_cb, this); + evas_object_smart_callback_add(webkit, "webview,contextmenu,del", __context_menu_del_cb, this); + evas_object_smart_callback_add(webkit, "contextmenu,customize", __context_menu_customize_cb, this); + evas_object_smart_callback_add(webkit, "contextmenu,save,as", __context_menu_save_as_cb, this); + if (!reader_view) { + evas_object_smart_callback_add(webkit, "magnifier,shown", __magnifier_shown_cb, this); + evas_object_smart_callback_add(webkit, "magnifier,hidden", __magnifier_hidden_cb, this); + } + + return EINA_TRUE; +} + +void Browser_Context_Menu::deinit(void) +{ + BROWSER_LOGD("[%s]", __func__); + Evas_Object *webkit = elm_webview_webkit_get(m_webview); + evas_object_smart_callback_del(webkit, "webview,contextmenu,new", __context_menu_new_cb); + evas_object_smart_callback_del(webkit, "webview,contextmenu,show", __context_menu_show_cb); + evas_object_smart_callback_del(webkit, "webview,contextmenu,move", __context_menu_move_cb); + evas_object_smart_callback_del(webkit, "webview,contextmenu,hide", __context_menu_hide_cb); + evas_object_smart_callback_del(webkit, "webview,contextmenu,del", __context_menu_del_cb); + evas_object_smart_callback_del(webkit, "contextmenu,customize", __context_menu_customize_cb); + evas_object_smart_callback_del(webkit, "contextmenu,save,as", __context_menu_save_as_cb); + evas_object_smart_callback_del(webkit, "magnifier,shown", __magnifier_shown_cb); + evas_object_smart_callback_del(webkit, "magnifier,hidden", __magnifier_hidden_cb); + +} + +void Browser_Context_Menu::__magnifier_shown_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_Context_Menu *context_menu = (Browser_Context_Menu *)data; + elm_object_scroll_freeze_pop(context_menu->m_browser_view->m_scroller); + elm_object_scroll_freeze_push(context_menu->m_browser_view->m_scroller); +} + +void Browser_Context_Menu::__magnifier_hidden_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_Context_Menu *context_menu = (Browser_Context_Menu *)data; + elm_object_scroll_freeze_pop(context_menu->m_browser_view->m_scroller); +} + +void Browser_Context_Menu::__context_menu_new_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data || !event_info) { + BROWSER_LOGE("data or event_info is null"); + return; + } + + Browser_Context_Menu *context_menu = (Browser_Context_Menu *)data; + context_menu->m_context_menu_data = (Elm_WebView_Context_Menu_Data *)event_info; + + context_menu->destroy_context_popup(); + + context_menu->m_context_popup = elm_ctxpopup_add(context_menu->m_naviframe); + if (!context_menu->m_context_popup) { + BROWSER_LOGE("elm_ctxpopup_add failed"); + return; + } + evas_object_size_hint_weight_set(context_menu->m_context_popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); +} + +void Browser_Context_Menu::__context_menu_show_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_Context_Menu *context_menu = (Browser_Context_Menu *)data; + if (!context_menu->m_context_popup) { + BROWSER_LOGE("context_menu->m_context_popup is null"); + return; + } + + evas_object_move(context_menu->m_context_popup, + context_menu->m_context_menu_data->mouse_down_event.canvas.x, + context_menu->m_context_menu_data->mouse_down_event.canvas.y - BROWSER_CONTEXT_MENU_MARGIN); + evas_object_show(context_menu->m_context_popup); + + const char *context_popup_style = elm_object_style_get(context_menu->m_context_popup); + if (context_popup_style && strlen(context_popup_style)) { + /* If context popup is normal style(not copy & paste style), + * give focus to context popup to hide the imf. */ + if (strncmp(context_popup_style, "extended/entry/pass_event", strlen("extended/entry/pass_event"))) + evas_object_focus_set(context_menu->m_context_popup, EINA_TRUE); + } +} + +void Browser_Context_Menu::__context_menu_move_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data || !event_info) + return; + + Browser_Context_Menu *context_menu = (Browser_Context_Menu *)data; + if (!context_menu->m_context_popup) + return; + + Evas_Point *position = (Evas_Point *)event_info; + evas_object_move(context_menu->m_context_popup, position->x, position->y - BROWSER_CONTEXT_MENU_MARGIN); + evas_object_show(context_menu->m_context_popup); +} + +void Browser_Context_Menu::__context_menu_hide_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_Context_Menu *context_menu = (Browser_Context_Menu *)data; + if (!context_menu->m_context_popup) + return; + + evas_object_hide(context_menu->m_context_popup); +} + +void Browser_Context_Menu::__context_menu_del_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_Context_Menu *context_menu = (Browser_Context_Menu *)data; + if (!context_menu->m_context_popup) + return; + + evas_object_del(context_menu->m_context_popup); + context_menu->m_context_popup = NULL; +} + +std::string Browser_Context_Menu::_get_context_menu_item_text(Ewk_Context_Menu_Action action) +{ + switch(action) { + case EWK_CONTEXT_MENU_ITEM_TAG_OPEN_LINK_IN_NEW_WINDOW: + return std::string(BR_STRING_CTXMENU_OPEN_LINK_IN_NEW_WINDOW); + case EWK_CONTEXT_MENU_ITEM_TAG_DOWNLOAD_LINK_TO_DISK: + return std::string(BR_STRING_CTXMENU_DOWNLOAD_LINKED_FILE); + case EWK_CONTEXT_MENU_ITEM_TAG_COPY_LINK_TO_CLIPBOARD: + return std::string(BR_STRING_CTXMENU_COPY_LINK_LOCATION); + case EWK_CONTEXT_MENU_ITEM_TAG_OPEN_IMAGE_IN_NEW_WINDOW: + return std::string(BR_STRING_CTXMENU_OPEN_IMAGE_IN_NEW_WINDOW); + case EWK_CONTEXT_MENU_ITEM_TAG_DOWNLOAD_IMAGE_TO_DISK: + return std::string(BR_STRING_CTXMENU_SAVE_IMAGE); + case EWK_CONTEXT_MENU_ITEM_TAG_COPY_IMAGE_TO_CLIPBOARD: + return std::string(BR_STRING_CTXMENU_COPY_IMAGE); + case EWK_CONTEXT_MENU_ITEM_TAG_OPEN_FRAME_IN_NEW_WINDOW: + return std::string(BR_STRING_CTXMENU_OPEN_FRAME_IN_NEW_WINDOW); + case EWK_CONTEXT_MENU_ITEM_TAG_COPY: + return std::string(BR_STRING_CTXMENU_COPY); + case EWK_CONTEXT_MENU_ITEM_TAG_GO_BACK: + return std::string(BR_STRING_CTXMENU_GO_BACK); + case EWK_CONTEXT_MENU_ITEM_TAG_GO_FORWARD: + return std::string(BR_STRING_CTXMENU_GO_FORWARD); + case EWK_CONTEXT_MENU_ITEM_TAG_STOP: + return std::string(BR_STRING_CTXMENU_STOP); + case EWK_CONTEXT_MENU_ITEM_TAG_RELOAD: + return std::string(BR_STRING_CTXMENU_RELOAD); + case EWK_CONTEXT_MENU_ITEM_TAG_CUT: + return std::string(BR_STRING_CTXMENU_CUT); + case EWK_CONTEXT_MENU_ITEM_TAG_PASTE: + return std::string(BR_STRING_CTXMENU_PASTE); + case EWK_CONTEXT_MENU_ITEM_TAG_NO_GUESSES_FOUND: + return std::string(BR_STRING_CTXMENU_NO_GUESS_FOUND); + case EWK_CONTEXT_MENU_ITEM_TAG_IGNORE_SPELLING: + return std::string(BR_STRING_CTXMENU_IGNORE_SPELLING); + case EWK_CONTEXT_MENU_ITEM_TAG_LEARN_SPELLING: + return std::string(BR_STRING_CTXMENU_LEARN_SPELLING); + case EWK_CONTEXT_MENU_ITEM_TAG_SEARCH_IN_SPOTLIGHT: + return std::string(BR_STRING_CTXMENU_SEARCH_IN_SPOTLIGHT); + case EWK_CONTEXT_MENU_ITEM_TAG_SEARCH_WEB: + return std::string(BR_STRING_CTXMENU_SEARCH_THE_WEB); + case EWK_CONTEXT_MENU_ITEM_TAG_LOOK_UP_IN_DICTIONARY: + return std::string(BR_STRING_CTXMENU_LOCK_UP_IN_DIRECTORY); + case EWK_CONTEXT_MENU_ITEM_TAG_OTHER: + case EWK_CONTEXT_MENU_ITEM_TAG_SPELLING_GUESS: + case EWK_CONTEXT_MENU_ITEM_TAG_OPEN_WITH_DEFAULT_APPLICATION: + case EWK_CONTEXT_MENU_ITEM_PDFACTUAL_SIZE: + case EWK_CONTEXT_MENU_ITEM_PDFZOOM_IN: + case EWK_CONTEXT_MENU_ITEM_PDFZOOM_OUT: + case EWK_CONTEXT_MENU_ITEM_PDFAUTO_SIZE: + case EWK_CONTEXT_MENU_ITEM_PDFSINGLE_PAGE: + case EWK_CONTEXT_MENU_ITEM_PDFCONTINUOUS: + case EWK_CONTEXT_MENU_ITEM_PDFNEXT_PAGE: + case EWK_CONTEXT_MENU_ITEM_PDFPREVIOUS_PAGE: + case EWK_CONTEXT_MENU_ITEM_TAG_SHOW_SPELLING_PANEL: + case EWK_CONTEXT_MENU_ITEM_TAG_WRITING_DIRECTION_MENU: + case EWK_CONTEXT_MENU_ITEM_TAG_DEFAULT_DIRECTION: + case EWK_CONTEXT_MENU_ITEM_TAG_LEFT_TO_RIGHT: + case EWK_CONTEXT_MENU_ITEM_TAG_RIGHT_TO_LEFT: + case EWK_CONTEXT_MENU_ITEM_TAG_PDFSINGLE_PAGE_SCROLLING: + case EWK_CONTEXT_MENU_ITEM_TAG_PDFFACING_PAGES_SCROLLING: + case EWK_CONTEXT_MENU_ITEM_TAG_TEXT_DIRECTION_MENU: + case EWK_CONTEXT_MENU_ITEM_TAG_TEXT_DIRECTION_DEFAULT: + case EWK_CONTEXT_MENU_ITEM_TAG_TEXT_DIRECTION_LEFT_TO_RIGHT: + case EWK_CONTEXT_MENU_ITEM_TAG_TEXT_DIRECTION_RIGHT_TO_LEFT: + case EWK_CONTEXT_MENU_ITEM_BASE_CUSTOM_TAG: + case EWK_CONTEXT_MENU_ITEM_CUSTOM_TAG_NO_ACTION: + case EWK_CONTEXT_MENU_ITEM_LAST_CUSTOM_TAG: + case EWK_CONTEXT_MENU_ITEM_BASE_APPLICATION_TAG: + /* Not spport yet */ + return std::string(); + case EWK_CONTEXT_MENU_ITEM_TAG_OPEN_LINK: + return std::string(BR_STRING_CTXMENU_OPEN_LINK); + case EWK_CONTEXT_MENU_ITEM_TAG_IGNORE_GRAMMAR: + return std::string(BR_STRING_CTXMENU_IGNORE_GRAMMAR); + case EWK_CONTEXT_MENU_ITEM_TAG_SPELLING_MENU: + return std::string(BR_STRING_CTXMENU_SPELLING_AND_GRAMMAR); + case EWK_CONTEXT_MENU_ITEM_TAG_CHECK_SPELLING: + return std::string(BR_STRING_CTXMENU_CHECK_DOCUMENT_NOW); + case EWK_CONTEXT_MENU_ITEM_TAG_CHECK_SPELLING_WHILE_TYPING: + return std::string(BR_STRING_CTXMENU_CHECK_SPELLING_WHILE_TYPEING); + case EWK_CONTEXT_MENU_ITEM_TAG_CHECK_GRAMMAR_WITH_SPELLING: + return std::string(BR_STRING_CTXMENU_CHECK_GRAMMAR_WITH_SPELLING); + case EWK_CONTEXT_MENU_ITEM_TAG_FONT_MENU: + return std::string(BR_STRING_CTXMENU_FONT); + case EWK_CONTEXT_MENU_ITEM_TAG_SHOW_FONTS: + return std::string(BR_STRING_CTXMENU_SHOW_FONTS); + case EWK_CONTEXT_MENU_ITEM_TAG_BOLD: + return std::string(BR_STRING_CTXMENU_BOLD); + case EWK_CONTEXT_MENU_ITEM_TAG_ITALIC: + return std::string(BR_STRING_CTXMENU_ITALIC); + case EWK_CONTEXT_MENU_ITEM_TAG_UNDERLINE: + return std::string(BR_STRING_CTXMENU_UNDERLINE); + case EWK_CONTEXT_MENU_ITEM_TAG_OUTLINE: + return std::string(BR_STRING_CTXMENU_OUTLINE); + case EWK_CONTEXT_MENU_ITEM_TAG_STYLES: + return std::string(BR_STRING_CTXMENU_STYLE); + case EWK_CONTEXT_MENU_ITEM_TAG_SHOW_COLORS: + return std::string(BR_STRING_CTXMENU_SHOW_COLORS); + case EWK_CONTEXT_MENU_ITEM_TAG_SPEECH_MENU: + return std::string(BR_STRING_CTXMENU_SPEECH); + case EWK_CONTEXT_MENU_ITEM_TAG_START_SPEAKING: + return std::string(BR_STRING_CTXMENU_START_SPEAKING); + case EWK_CONTEXT_MENU_ITEM_TAG_STOP_SPEAKING: + return std::string(BR_STRING_CTXMENU_STOP_SPEAKING); + case EWK_CONTEXT_MENU_ITEM_TAG_SEND_VIA_EMAIL: + return std::string(BR_STRING_CTXMENU_SEND_IMAGE_VIA_EMAIL); + case EWK_CONTEXT_MENU_ITEM_TAG_SEND_VIA_MESSAGE: + return std::string(BR_STRING_CTXMENU_SEND_IMAGE_VIA_MESSAGE); + case EWK_CONTEXT_MENU_ITEM_TAG_COPY_IMAGE_LOCATION_TO_CLIPBOARD: + return std::string(BR_STRING_CTXMENU_COPY_IMAGE_LOCATION); + case EWK_CONTEXT_MENU_ITEM_OPEN_MEDIA_IN_NEW_WINDOW: + return std::string(BR_STRING_CTXMENU_OPEN_MEDIA_IN_NEW_WINDOW); + case EWK_CONTEXT_MENU_ITEM_TAG_COPY_MEDIA_LINK_TO_CLIPBOARD: + return std::string(BR_STRING_CTXMENU_COPY_MEDIA); + case EWK_CONTEXT_MENU_ITEM_TAG_TOGGLE_MEDIA_CONTROLS: + return std::string(BR_STRING_CTXMENU_TOGGLE_MEDIA_CONTOLS); + case EWK_CONTEXT_MENU_ITEM_TAG_TOGGLE_MEDIA_LOOP: + return std::string(BR_STRING_CTXMENU_TOGGLE_MEDIA_LOOP_PLAYBACK); + case EWK_CONTEXT_MENU_ITEM_TAG_ENTER_VIDEO_FULLSCREEN: + return std::string(BR_STRING_CTXMENU_SWITCH_VIDEO_TO_FUUL_SCREEN); + case EWK_CONTEXT_MENU_ITEM_TAG_MEDIA_PLAY_PAUSE: + return std::string(BR_STRING_CTXMENU_PAUSE); + case EWK_CONTEXT_MENU_ITEM_TAG_MEDIA_MUTE: + return std::string(BR_STRING_CTXMENU_MUTE); + case EWK_CONTEXT_MENU_ITEM_TAG_SELECT_ALL: + return std::string(BR_STRING_CTXMENU_SELECT_ALL); + case EWK_CONTEXT_MENU_ITEM_TAG_SELECT_WORD: + return std::string(BR_STRING_CTXMENU_SELECT); + default: + return std::string(); + } +} + +void Browser_Context_Menu::destroy_context_popup(void) +{ + BROWSER_LOGD("[%s]", __func__); + for(int i = 0 ; i < m_param_list.size() ; i++) { + if (m_param_list[i]) + free(m_param_list[i]); + } + m_param_list.clear(); + + if (m_context_popup) { + evas_object_del(m_context_popup); + m_context_popup = NULL; + } +} + +void Browser_Context_Menu::__context_menu_customize_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data || !event_info) + return; + + Browser_Context_Menu *context_menu = (Browser_Context_Menu *)data; + if (!context_menu->m_context_popup) + return; + + Eina_List *menu_list = (Eina_List *)event_info; + + Eina_List *list = NULL; + void *item_data = NULL; + Ewk_Context_Menu_Item *menu_item = NULL; + + if (!context_menu->m_context_menu_data->is_text_selection) { + BROWSER_LOGD("text is not selected"); + EINA_LIST_FOREACH(menu_list, list, item_data) { + menu_item = (Ewk_Context_Menu_Item *)item_data; + if (ewk_context_menu_item_enabled_get(menu_item) + && ewk_context_menu_item_type_get(menu_item) == EWK_ACTION_TYPE) { + Ewk_Context_Menu_Action action = ewk_context_menu_item_action_get(menu_item); + if (action == EWK_CONTEXT_MENU_ITEM_TAG_COPY + || action == EWK_CONTEXT_MENU_ITEM_TAG_RELOAD + || action == EWK_CONTEXT_MENU_ITEM_TAG_SEARCH_WEB + || action == EWK_CONTEXT_MENU_ITEM_TAG_OPEN_LINK + || action == EWK_CONTEXT_MENU_ITEM_TAG_COPY_LINK_TO_CLIPBOARD) + continue; + if (action == EWK_CONTEXT_MENU_ITEM_TAG_SEND_VIA_EMAIL + || action == EWK_CONTEXT_MENU_ITEM_TAG_SEND_VIA_MESSAGE) + continue; + + if (context_menu->m_for_reader_view) { + if (action == EWK_CONTEXT_MENU_ITEM_TAG_OPEN_LINK_IN_NEW_WINDOW + || action == EWK_CONTEXT_MENU_ITEM_TAG_OPEN_IMAGE_IN_NEW_WINDOW) + continue; + } + + std::string menu_text = context_menu->_get_context_menu_item_text(action); + if (!menu_text.empty()) { + context_popup_item_callback_param *param = NULL; + param = (context_popup_item_callback_param *)malloc(sizeof(context_popup_item_callback_param)); + if (!param) { + BROWSER_LOGE("malloc failed"); + return; + } + context_menu->m_current_context_menu_item = param->menu_item = (Ewk_Context_Menu_Item *)item_data; + param->user_data = context_menu; + context_menu->m_param_list.push_back(param); + BROWSER_LOGD("apend item=[%s]", menu_text.c_str()); + elm_ctxpopup_item_append(context_menu->m_context_popup, menu_text.c_str(), + NULL, __context_menu_item_selected_cb, param); + } + if (action == EWK_CONTEXT_MENU_ITEM_TAG_PASTE) { + BROWSER_LOGD("apend item=[%s]", BR_STRING_CTXMENU_MORE); + elm_ctxpopup_item_append(context_menu->m_context_popup, BR_STRING_CTXMENU_MORE, + NULL, __context_menu_paste_more_item_selected_cb, context_menu); + } + } + } + evas_object_smart_callback_del(context_menu->m_context_popup, "dismissed", + __context_popup_dismissed_cb); + evas_object_smart_callback_add(context_menu->m_context_popup, "dismissed", + __context_popup_dismissed_cb, context_menu); + } else { + BROWSER_LOGD("text is selected"); + if (!(context_menu->m_context_menu_data->hit_test_result_context & EWK_HIT_TEST_RESULT_CONTEXT_IMAGE)) { + /* If not on image, context popup is copy & paste style. */ + elm_object_style_set(context_menu->m_context_popup, "extended/entry/pass_event"); + elm_ctxpopup_horizontal_set(context_menu->m_context_popup, EINA_TRUE); + elm_ctxpopup_direction_priority_set(context_menu->m_context_popup, + ELM_CTXPOPUP_DIRECTION_UP, ELM_CTXPOPUP_DIRECTION_UP, + ELM_CTXPOPUP_DIRECTION_UP, ELM_CTXPOPUP_DIRECTION_UP); + } + + Eina_Bool search_menu = EINA_FALSE; + EINA_LIST_FOREACH(menu_list, list, item_data) { + menu_item = (Ewk_Context_Menu_Item *)item_data; + if (ewk_context_menu_item_enabled_get(menu_item) + && ewk_context_menu_item_type_get(menu_item) == EWK_ACTION_TYPE) { + Ewk_Context_Menu_Action action = ewk_context_menu_item_action_get(menu_item); + /* EWK_CONTEXT_MENU_ITEM_TAG_SEARCH_WEB is shown when WebKit decides that selected content + * is a word - whitespace characters only selections are ignored */ + if (action == EWK_CONTEXT_MENU_ITEM_TAG_SEARCH_WEB) + search_menu = EINA_TRUE; + /* if we call context menu on image in editable (is_text_selection = TRUE) we should + * only show context menu related to image, otherwise... */ + if (context_menu->m_context_menu_data->hit_test_result_context + & EWK_HIT_TEST_RESULT_CONTEXT_IMAGE) { + if (action != EWK_CONTEXT_MENU_ITEM_TAG_COPY_IMAGE_TO_CLIPBOARD + && action != EWK_CONTEXT_MENU_ITEM_TAG_DOWNLOAD_IMAGE_TO_DISK + && action != EWK_CONTEXT_MENU_ITEM_TAG_SEND_VIA_EMAIL + && action != EWK_CONTEXT_MENU_ITEM_TAG_SEND_VIA_MESSAGE + && action != EWK_CONTEXT_MENU_ITEM_TAG_COPY_IMAGE_LOCATION_TO_CLIPBOARD) + continue; + } else { + if (action != EWK_CONTEXT_MENU_ITEM_TAG_COPY + && action != EWK_CONTEXT_MENU_ITEM_TAG_CUT + && action != EWK_CONTEXT_MENU_ITEM_TAG_PASTE + && action != EWK_CONTEXT_MENU_ITEM_TAG_SELECT_ALL + && action != EWK_CONTEXT_MENU_ITEM_TAG_SELECT_WORD) + continue; + } + + if (action == EWK_CONTEXT_MENU_ITEM_TAG_COPY_LINK_TO_CLIPBOARD) + continue; + + if (action == EWK_CONTEXT_MENU_ITEM_TAG_SEND_VIA_EMAIL + || action == EWK_CONTEXT_MENU_ITEM_TAG_SEND_VIA_MESSAGE) + continue; + + if (context_menu->m_for_reader_view) { + if (action == EWK_CONTEXT_MENU_ITEM_TAG_OPEN_LINK_IN_NEW_WINDOW + || action == EWK_CONTEXT_MENU_ITEM_TAG_OPEN_IMAGE_IN_NEW_WINDOW) + continue; + } + + std::string menu_text = context_menu->_get_context_menu_item_text(action); + if (!menu_text.empty()) { + context_popup_item_callback_param *param = NULL; + param = (context_popup_item_callback_param *)malloc(sizeof(context_popup_item_callback_param)); + if (!param) { + BROWSER_LOGE("malloc failed"); + return; + } + context_menu->m_current_context_menu_item = param->menu_item = (Ewk_Context_Menu_Item *)item_data; + param->user_data = context_menu; + context_menu->m_param_list.push_back(param); + BROWSER_LOGD("apend item=[%s]", menu_text.c_str()); + elm_ctxpopup_item_append(context_menu->m_context_popup, menu_text.c_str(), + NULL, __context_menu_item_selected_cb, param); + } + if (action == EWK_CONTEXT_MENU_ITEM_TAG_PASTE) { + BROWSER_LOGD("apend item=[%s]", BR_STRING_CTXMENU_MORE); + elm_ctxpopup_item_append(context_menu->m_context_popup, BR_STRING_CTXMENU_MORE, + NULL, __context_menu_paste_more_item_selected_cb, context_menu); + } + } + } + + elm_object_tree_focus_allow_set(context_menu->m_context_popup, EINA_TRUE); + if (context_menu->m_context_menu_data->hit_test_result_context & EWK_HIT_TEST_RESULT_CONTEXT_IMAGE) { + evas_object_smart_callback_del(context_menu->m_context_popup, "dismissed", + __context_popup_dismissed_cb); + evas_object_smart_callback_add(context_menu->m_context_popup, "dismissed", + __context_popup_dismissed_cb, context_menu); + } + } +} + +void Browser_Context_Menu::__context_popup_dismissed_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_Context_Menu *context_menu = (Browser_Context_Menu *)data; + context_menu->destroy_context_popup(); +} + +void Browser_Context_Menu::__context_menu_paste_more_item_selected_cb(void *data, + Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_Context_Menu *context_menu = (Browser_Context_Menu *)data; + Evas_Object *webview = context_menu->m_webview; + elm_webview_cbhm_run(webview); + elm_webview_context_menu_item_selected(webview, NULL); + + context_menu->destroy_context_popup(); +} + +void Browser_Context_Menu::__context_menu_item_selected_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + context_popup_item_callback_param *param = (context_popup_item_callback_param *)data; + Browser_Context_Menu *context_menu = (Browser_Context_Menu *)(param->user_data); + Ewk_Context_Menu_Item *menu_item = param->menu_item; + if (!menu_item) + return; + + context_menu->destroy_context_popup(); + + Evas_Object *webview = context_menu->m_webview; + elm_webview_context_menu_item_selected(webview, menu_item); +} + +void Browser_Context_Menu::__context_menu_save_as_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + Browser_Context_Menu *context_menu = (Browser_Context_Menu *)data; + + const char *image_file_name = (const char *)event_info; + if (!image_file_name || !strlen(image_file_name)) { + BROWSER_LOGE("image file name is empty"); + return; + } + + BROWSER_LOGD("image file name=[%s]", image_file_name); + + if (!context_menu->m_current_context_menu_item) { + BROWSER_LOGE("context_menu->m_current_context_menu_item is null"); + return; + } + Ewk_Context_Menu *ewk_context_menu = ewk_context_menu_item_parent_get(context_menu->m_current_context_menu_item); + + int result = ewk_context_menu_cached_image_save(ewk_context_menu, image_file_name); + if (!result) + context_menu->m_browser_view->show_notify_popup(BR_STRING_SAVED, 2, EINA_TRUE); + + context_menu->destroy_context_popup(); +} + diff --git a/src/browser-view/browser-context-menu.h b/src/browser-view/browser-context-menu.h new file mode 100755 index 00000000..734c13f7 --- /dev/null +++ b/src/browser-view/browser-context-menu.h @@ -0,0 +1,68 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef BROWSER_CONTEXT_MENU_H +#define BROWSER_CONTEXT_MENU_H + +#include "browser-config.h" + +class Browser_View; +class Browser_Context_Menu { +public: + Browser_Context_Menu(Evas_Object *naviframe, Browser_View *browser_view); + ~Browser_Context_Menu(void); + + Eina_Bool init(Evas_Object *webview, Eina_Bool reader_view = EINA_FALSE); + void deinit(void); + + void destroy_context_popup(void); + + typedef struct _context_popup_item_callback_param { + Ewk_Context_Menu_Item *menu_item; + void *user_data; + } context_popup_item_callback_param; +private: + /* evas object smart callback functions */ + static void __context_menu_new_cb(void *data, Evas_Object *obj, void *event_info); + static void __context_menu_show_cb(void *data, Evas_Object *obj, void *event_info); + static void __context_menu_move_cb(void *data, Evas_Object *obj, void *event_info); + static void __context_menu_hide_cb(void *data, Evas_Object *obj, void *event_info); + static void __context_menu_del_cb(void *data, Evas_Object *obj, void *event_info); + static void __context_menu_customize_cb(void *data, Evas_Object *obj, void *event_info); + static void __context_menu_save_as_cb(void *data, Evas_Object *obj, void *event_info); + static void __magnifier_shown_cb(void *data, Evas_Object *obj, void *event_info); + static void __magnifier_hidden_cb(void *data, Evas_Object *obj, void *event_info); + + static void __context_menu_item_selected_cb(void *data, Evas_Object *obj, void *event_info); + static void __context_menu_paste_more_item_selected_cb(void *data, Evas_Object *obj, void *event_info); + static void __context_popup_dismissed_cb(void *data, Evas_Object *obj, void *event_info); + + std::string _get_context_menu_item_text(Ewk_Context_Menu_Action action); + + Evas_Object *m_naviframe; + Evas_Object *m_webview; + Evas_Object *m_context_popup; + Elm_WebView_Context_Menu_Data *m_context_menu_data; + Eina_Bool m_for_reader_view; + + Browser_View *m_browser_view; + + std::vector<context_popup_item_callback_param *> m_param_list; + + Ewk_Context_Menu_Item *m_current_context_menu_item; +}; +#endif /* BROWSER_CONTEXT_MENU_H */ + diff --git a/src/browser-view/browser-predictive-history.cpp b/src/browser-view/browser-predictive-history.cpp new file mode 100755 index 00000000..09d30b1d --- /dev/null +++ b/src/browser-view/browser-predictive-history.cpp @@ -0,0 +1,210 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "browser-history-db.h" +#include "browser-predictive-history.h" +#include "browser-view.h" + +Browser_Predictive_History::Browser_Predictive_History(Evas_Object *navi_bar, Browser_History_DB *history_db, + Browser_View *browser_view) +: + m_navi_bar(navi_bar) + ,m_history_db(history_db) + ,m_browser_view(browser_view) + ,m_genlist(NULL) + ,m_main_layout(NULL) +{ + BROWSER_LOGD("[%s]", __func__); + + memset(m_param, 0x00, sizeof(genlist_callback_param) * BROWSER_PREDICTIVE_HISTORY_COUNT); +} + +Browser_Predictive_History::~Browser_Predictive_History(void) +{ + BROWSER_LOGD("[%s]", __func__); + edje_object_signal_emit(elm_layout_edje_get(m_browser_view->m_main_layout), + "hide,predictive_history,signal", ""); + if (m_main_layout) + evas_object_del(m_main_layout); +} + +char *Browser_Predictive_History::__genlist_predictive_history_get(void *data, + Evas_Object *obj, const char *part) +{ + if (!part || !data) + return NULL; + + std::string url = *((std::string *)data); + if(!strncmp(part, "elm.text", strlen("elm.text"))) + return strdup(url.c_str()); + + return NULL; +} + +Evas_Object *Browser_Predictive_History::__genlist_history_icon_get_cb(void *data, + Evas_Object *obj, const char *part) +{ + if (part && strlen(part) > 0) { + if (!strncmp(part, "elm.icon", strlen("elm.icon"))) { + Evas_Object *globe_icon = elm_icon_add(obj); + if (!elm_icon_file_set(globe_icon, BROWSER_IMAGE_DIR"/globe.png", NULL)) { + BROWSER_LOGE("elm_icon_file_set is failed.\n"); + return NULL; + } + + evas_object_size_hint_aspect_set(globe_icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); + return globe_icon; + } + } + + return NULL; +} + +void Browser_Predictive_History::__genlist_scrolled_cb(void *data, Evas_Object *obj, + void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_Predictive_History *predictive_history = (Browser_Predictive_History *)data; + + predictive_history->m_browser_view->set_edit_mode(BR_URL_ENTRY_EDIT_MODE_WITH_NO_IMF); + + elm_object_focus_allow_set(predictive_history->m_genlist, EINA_TRUE); + elm_object_focus_set(predictive_history->m_genlist, EINA_TRUE); +} + +Evas_Object *Browser_Predictive_History::create_predictive_history_layout(void) +{ + BROWSER_LOGD("[%s]", __func__); + + m_main_layout = elm_layout_add(m_navi_bar); + if (!m_main_layout) { + BROWSER_LOGE("elm_layout_add failed"); + return NULL; + } + if (!elm_layout_file_set(m_main_layout, BROWSER_EDJE_DIR"/browser-predictive-history.edj", + "browser/predictive-history")) { + BROWSER_LOGE("elm_layout_file_set failed"); + return NULL; + } + + evas_object_show(m_main_layout); + + m_genlist = elm_genlist_add(m_navi_bar); + if (!m_genlist) { + BROWSER_LOGE("elm_genlist_add failed"); + return NULL; + } + + memset(&m_item_class, 0x00, sizeof(m_item_class)); + m_item_class.item_style = "browser/1text.1icon.2"; + m_item_class.func.text_get = __genlist_predictive_history_get; + m_item_class.func.content_get = __genlist_history_icon_get_cb; + m_item_class.func.state_get = NULL; + m_item_class.func.del = NULL; + + elm_object_part_content_set(m_main_layout, "elm.swallow.predictive_history_genlist", m_genlist); + + evas_object_smart_callback_add(m_genlist, "drag,stop", __genlist_scrolled_cb, this); + evas_object_show(m_genlist); + + /* Do not allow focus to genlist because if the genlist has focus, + * the keypad is hided automatically when user touch the genlist. */ + elm_object_focus_allow_set(m_genlist, EINA_FALSE); + + return m_main_layout; +} + +Eina_Bool Browser_Predictive_History::__load_uri_idler_cb(void *data) +{ + BROWSER_LOGD("[%s]", __func__); + + if (!data) + return ECORE_CALLBACK_CANCEL; + Browser_Predictive_History *predictive_history = (Browser_Predictive_History *)data; + predictive_history->m_browser_view->load_url(predictive_history->m_uri_to_load.c_str()); + + /* Workaround, give focus to option header cancel button to hide imf. */ + elm_object_focus_set(m_data_manager->get_browser_view()->m_option_header_cancel_button, EINA_TRUE); + + return ECORE_CALLBACK_CANCEL; +} + + +void Browser_Predictive_History::__predictive_history_item_clicked_cb(void *data, Evas_Object *obj, + void *event_info) +{ + if (!data) + return; + genlist_callback_param *param = (genlist_callback_param *)data; + Browser_Predictive_History *predictive_history = param->predictive_history; + int index = param->index; + BROWSER_LOGD("selected url=[%s]", predictive_history->m_history_list[index].c_str()); + + /* Remove the <match>, </match> tag. */ + std::string source_string = predictive_history->m_history_list[index]; + string::size_type pos = string::npos; + if((pos = source_string.find("<match>")) != string::npos) + source_string.replace(pos, strlen("<match>"), std::string("")); + + if((pos = source_string.find("</match>")) != string::npos) + source_string.replace(pos, strlen("</match>"), std::string("")); + + BROWSER_LOGD("source_string=[%s]", source_string.c_str()); + + Evas_Object *edit_field_entry = br_elm_editfield_entry_get(predictive_history->m_browser_view->_get_activated_url_entry()); + /* Becaue of predictive hisotry. */ + evas_object_smart_callback_del(edit_field_entry, "changed", Browser_View::__url_entry_changed_cb); + + predictive_history->m_uri_to_load = source_string; + + ecore_idler_add(__load_uri_idler_cb, predictive_history); +} + +void Browser_Predictive_History::url_changed(const char *url) +{ + m_history_list.clear(); + m_history_db->get_history_list_by_partial_url(url, BROWSER_PREDICTIVE_HISTORY_COUNT, m_history_list); + elm_genlist_clear(m_genlist); + memset(m_param, 0x00, sizeof(genlist_callback_param) * BROWSER_PREDICTIVE_HISTORY_COUNT); + + for (int i = 0 ; i < m_history_list.size() ; i++) { + /* Remove 'http://' prefix. */ + if (!strncmp(m_history_list[i].c_str(), BROWSER_HTTP_SCHEME, strlen(BROWSER_HTTP_SCHEME))) + m_history_list[i] = m_history_list[i].substr(strlen(BROWSER_HTTP_SCHEME)); + + /* mark matched words with match tag. + * The <match> tag is defined in browser-predictive-history.edc */ + int pos = m_history_list[i].find(url); + m_history_list[i] = m_history_list[i].substr(0, pos) + std::string("<match>") + std::string(url) + + std::string("</match>") + m_history_list[i].substr(pos + strlen(url)); + + m_param[i].predictive_history = this; + m_param[i].index = i; + elm_genlist_item_append(m_genlist, &m_item_class, &m_history_list[i], NULL, ELM_GENLIST_ITEM_NONE, + __predictive_history_item_clicked_cb, &m_param[i]); + } + + if (url && strlen(url)) + edje_object_signal_emit(elm_layout_edje_get(m_browser_view->m_main_layout), + "show,predictive_history,signal", ""); + else + edje_object_signal_emit(elm_layout_edje_get(m_browser_view->m_main_layout), + "hide,predictive_history,signal", ""); +} + diff --git a/src/browser-view/browser-predictive-history.h b/src/browser-view/browser-predictive-history.h new file mode 100755 index 00000000..cfa291c2 --- /dev/null +++ b/src/browser-view/browser-predictive-history.h @@ -0,0 +1,67 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef BROWSER_PREDICTIVE_HISTORY_H +#define BROWSER_PREDICTIVE_HISTORY_H + +#include "browser-config.h" +#include "browser-common-view.h" + +class Browser_History_DB; +class Browser_View; + +class Browser_Predictive_History : public Browser_Common_View { +public: + Browser_Predictive_History(Evas_Object *navi_bar, Browser_History_DB *history_db, + Browser_View *browser_view); + ~Browser_Predictive_History(void); + + Evas_Object *create_predictive_history_layout(void); + void url_changed(const char *url); + + Eina_Bool init(void) {} +private: + typedef struct _genlist_callback_param{ + Browser_Predictive_History *predictive_history; + int index; + } genlist_callback_param; + + static Eina_Bool __load_uri_idler_cb(void *data); + /* genlist callback functions */ + static char *__genlist_predictive_history_get(void *data, + Evas_Object *obj, const char *part); + static Evas_Object *__genlist_history_icon_get_cb(void *data, + Evas_Object *obj, const char *part); + + /* elementary event callback functions */ + static void __predictive_history_item_clicked_cb(void *data, Evas_Object *obj, void *event_info); + static void __genlist_scrolled_cb(void *data, Evas_Object *obj, void *event_info); + + Evas_Object *m_navi_bar; + Browser_History_DB *m_history_db; + Browser_View *m_browser_view; + + Evas_Object *m_main_layout; + Evas_Object *m_genlist; + Elm_Genlist_Item_Class m_item_class; + + std::vector<std::string> m_history_list; + genlist_callback_param m_param[BROWSER_PREDICTIVE_HISTORY_COUNT]; + + std::string m_uri_to_load; +}; +#endif /* BROWSER_PREDICTIVE_HISTORY_H */ + diff --git a/src/browser-view/browser-view.cpp b/src/browser-view/browser-view.cpp new file mode 100755 index 00000000..1e946b3e --- /dev/null +++ b/src/browser-view/browser-view.cpp @@ -0,0 +1,3067 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "browser-add-to-bookmark-view.h" +#include "browser-bookmark-view.h" +#include "browser-certificate-manager.h" +#include "browser-class.h" +#include "browser-context-menu.h" +#include "browser-exscheme-handler.h" +#include "browser-history-db.h" +#include "browser-find-word.h" +#include "browser-multi-window-view.h" +#include "browser-personal-data-manager.h" +#include "browser-picker-handler.h" +#include "browser-predictive-history.h" +#include "browser-settings-class.h" +#include "browser-string.h" +#include "browser-view.h" +#include "browser-window.h" +#include <devman.h> +#include <url_download.h> + +Browser_View::Browser_View(Evas_Object *win, Evas_Object *navi_bar, + Evas_Object *bg, Evas_Object *layout, Browser_Class *browser) +: + m_main_layout(NULL) + ,m_scroller(NULL) + ,m_content_box(NULL) + ,m_dummy_loading_progressbar(NULL) + ,m_conformant(NULL) + ,m_url_layout(NULL) + ,m_url_entry_layout(NULL) + ,m_url_edit_field(NULL) + ,m_url_progressbar(NULL) + ,m_url_progresswheel(NULL) + ,m_cancel_button(NULL) + ,m_control_bar(NULL) + ,m_backward_button(NULL) + ,m_forward_button(NULL) + ,m_add_bookmark_button(NULL) + ,m_more_button(NULL) + ,m_option_header_url_layout(NULL) + ,m_option_header_layout(NULL) + ,m_option_header_url_entry_layout(NULL) + ,m_option_header_cancel_button(NULL) + ,m_option_header_url_progressbar(NULL) + ,m_option_header_url_progresswheel(NULL) + ,m_edit_mode(BR_NO_EDIT_MODE) + ,m_homepage_mode(BR_START_MODE_UNKOWN) + ,m_scroller_region_y(0) + ,m_is_scrolling(EINA_FALSE) + ,m_focused_window(NULL) + ,m_more_context_popup(NULL) + ,m_predictive_history(NULL) + ,m_new_window_transit(NULL) + ,m_created_new_window(NULL) + ,m_browser_settings(NULL) + ,m_navi_it(NULL) + ,m_find_word(NULL) + ,m_is_scroll_up(EINA_FALSE) + ,m_is_multi_touch(EINA_FALSE) + ,m_context_menu(NULL) + ,m_exscheme_handler(NULL) + ,m_personal_data_manager(NULL) + ,m_picker_handler(NULL) + ,m_share_controlbar_button(NULL) + ,m_add_to_home_control_bar(NULL) + ,m_multi_window_button(NULL) + ,m_zoom_in_button(NULL) + ,m_zoom_out_button(NULL) + ,m_zoom_button_timer(NULL) +{ + BROWSER_LOGD("[%s]", __func__); + m_win = win; + m_navi_bar = navi_bar; + m_bg = bg; + m_layout = layout; + m_browser = browser; +} + +Browser_View::~Browser_View() +{ + BROWSER_LOGD("[%s]", __func__); + if (m_title_back_button) + evas_object_del(m_title_back_button); + + ug_destroy_all(); + + if (vconf_set_str(LAST_VISITED_URL_KEY, m_last_visited_url.c_str()) != 0) + BROWSER_LOGE("vconf_set_str failed"); + + m_data_manager->destroy_history_db(); + + if (m_data_manager) { + delete m_data_manager; + m_data_manager = NULL; + } + if (m_predictive_history) { + delete m_predictive_history; + m_predictive_history = NULL; + } + if (m_new_window_transit) { + elm_transit_del(m_new_window_transit); + m_new_window_transit = NULL; + } + if (m_browser_settings) { + delete m_browser_settings; + m_browser_settings = NULL; + } + if (m_find_word) { + delete m_find_word; + m_find_word = NULL; + } + if (m_context_menu) { + delete m_context_menu; + m_context_menu = NULL; + } + if (m_exscheme_handler) { + delete m_exscheme_handler; + m_exscheme_handler = NULL; + } + if (m_personal_data_manager) { + delete m_personal_data_manager; + m_personal_data_manager = NULL; + } + if (m_picker_handler) { + delete m_picker_handler; + m_picker_handler = NULL; + } +} + +Eina_Bool Browser_View::init(void) +{ + BROWSER_LOGD("[%s]", __func__); + /* set homepage from homepage vconf */ + _set_homepage_mode(); + + m_data_manager = new(nothrow) Browser_Data_Manager; + if (!m_data_manager) { + BROWSER_LOGE("new Browser_Data_Manager failed"); + return EINA_FALSE; + } + + m_data_manager->set_browser_view(this); + + if (!m_data_manager->create_history_db()) { + BROWSER_LOGE("m_data_manager->create_history_db failed"); + return EINA_FALSE; + } + m_find_word = new(nothrow) Browser_Find_Word(this); + if (!m_find_word) { + BROWSER_LOGE("new Browser_Find_Word failed"); + return EINA_FALSE; + } + + m_context_menu = new(nothrow) Browser_Context_Menu(m_navi_bar, this); + if (!m_context_menu) { + BROWSER_LOGE("new Browser_Context_Menu failed"); + return EINA_FALSE; + } + + m_exscheme_handler = new(nothrow) Browser_Exscheme_Handler(); + if (!m_exscheme_handler) { + BROWSER_LOGE("new Browser_Exscheme_Handler failed"); + return EINA_FALSE; + } + m_personal_data_manager = new(nothrow) Browser_Personal_Data_Manager(); + if (!m_personal_data_manager) { + BROWSER_LOGE("new Browser_Personal_Data_Manager failed"); + return EINA_FALSE; + } + m_picker_handler = new(nothrow) Browser_Picker_Handler(this); + if (!m_picker_handler) { + BROWSER_LOGE("new Browser_Picker_Handler failed"); + return EINA_FALSE; + } + UG_INIT_EFL(m_win, UG_OPT_INDICATOR_ENABLE); + + char *last_url = vconf_get_str(LAST_VISITED_URL_KEY); + if (last_url) { + m_last_visited_url = std::string(last_url); + free(last_url); + } + + /* create brower view layout */ + return _create_main_layout(); +} + +void Browser_View::stop_and_reload(void) +{ + BROWSER_LOGD("[%s]_is_loading=%d", __func__, _is_loading()); + if (_is_loading()) { + _stop_loading(); + _reload(); + } +} + +Evas_Object *Browser_View::get_focused_webview(void) +{ + return m_focused_window->m_ewk_view; +} + +Eina_Bool Browser_View::_activate_url_entry_idler_cb(void *data) +{ + Browser_View* instance = (Browser_View*)data; + + instance->__url_entry_clicked_cb(instance, NULL, NULL, NULL); + return ECORE_CALLBACK_CANCEL; +} +void Browser_View::launch(const char *url) +{ + /* Destroy all other views except browser view. */ + _pop_other_views(); + + /*Workaround. + * When keypad is running via url entry, if browser goes to background by home key. + * Then relaunch the browser by aul. The webpage is loading but the keypad is still running. + * So give focus to cancel button not to invoke the keypad. */ + elm_object_focus_set(m_cancel_button, EINA_TRUE); + + if (url && strlen(url)) { + load_url(url); + } else if (m_homepage_mode == BR_START_MODE_MOST_VISITED_SITES){ + load_url(BROWSER_MOST_VISITED_SITES_URL); + ecore_idler_add(_activate_url_entry_idler_cb, this); + } else if (m_homepage_mode == BR_START_MODE_RECENTLY_VISITED_SITE) { + char *homepage = vconf_get_str(LAST_VISITED_URL_KEY); + if (homepage) { + load_url(homepage); + free(homepage); + } else + load_url(BROWSER_MOST_VISITED_SITES_URL); + } else if (m_homepage_mode == BR_START_MODE_CUSTOMIZED_URL) { + char *user_homepage = vconf_get_str(USER_HOMEPAGE_KEY); + if (user_homepage) { + load_url(user_homepage); + free(user_homepage); + } else + load_url(BROWSER_MOST_VISITED_SITES_URL); + } +} + +void Browser_View::return_to_browser_view(Eina_Bool saved_most_visited_sites_item) +{ + BROWSER_LOGD("[%s]", __func__); + + if (!_is_loading()) { + if (get_title().empty()) + _set_navigationbar_title(get_url().c_str()); + else + _set_navigationbar_title(get_title().c_str()); + } + + _set_secure_icon(); + +} + +void Browser_View::init_personal_data_manager(Evas_Object *webview) +{ + BROWSER_LOGD("[%s]", __func__); + m_personal_data_manager->init(webview); +} + +void Browser_View::deinit_personal_data_manager(void) +{ + BROWSER_LOGD("[%s]", __func__); + m_personal_data_manager->deinit(); +} + +void Browser_View::_pop_other_views(void) +{ + BROWSER_LOGD("[%s]", __func__); + _destroy_more_context_popup(); + + /* if browser is runing background behind ug which browser invoked, + destroy the previous ug and show the browser view. */ + ug_destroy_all(); + + /* If multi-window is running, destroy it to show browser view. */ + if (m_data_manager->is_in_view_stack(BR_MULTI_WINDOW_VIEW)) + m_data_manager->get_multi_window_view()->close_multi_window(); + + /* Pop all other views except browser view. */ + elm_naviframe_item_pop_to(m_navi_it); + +} + +/* set homepage from homepage vconf */ +void Browser_View::_set_homepage_mode(void) +{ + char *homepage = vconf_get_str(HOMEPAGE_KEY); + BROWSER_LOGD("homepage=[%s]", homepage); + + if (!homepage) { + BROWSER_LOGE("homepage is null"); + m_homepage_mode = BR_START_MODE_MOST_VISITED_SITES; + return; + } + + if (!strncmp(homepage, MOST_VISITED_SITES, + strlen(MOST_VISITED_SITES))) + m_homepage_mode = BR_START_MODE_MOST_VISITED_SITES; + else if (!strncmp(homepage, RECENTLY_VISITED_SITE, + strlen(RECENTLY_VISITED_SITE))) + m_homepage_mode = BR_START_MODE_RECENTLY_VISITED_SITE; + else + m_homepage_mode = BR_START_MODE_CUSTOMIZED_URL; + + free(homepage); + BROWSER_LOGD("m_homepage_mode=%d", m_homepage_mode); +} + +void Browser_View::__new_window_transit_finished_cb(void *data, Elm_Transit *transit) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_View *browser_view = (Browser_View *)data; + if (!browser_view->m_new_window_transit) + return; + + browser_view->m_new_window_transit = NULL; + browser_view->m_browser->set_focused_window(browser_view->m_created_new_window, EINA_FALSE); + browser_view->m_created_new_window = NULL; +} + +Eina_Bool Browser_View::_show_new_window_effect(Evas_Object *current_ewk_view, + Evas_Object *new_ewk_view) +{ + BROWSER_LOGD("[%s]", __func__); + m_new_window_transit = elm_transit_add(); + if (!m_new_window_transit) { + BROWSER_LOGE("elm_transit_add failed"); + return EINA_FALSE; + } + int scroller_x = 0; + int scroller_w = 0; + int scroller_h = 0; + elm_scroller_region_get(m_scroller, &scroller_x, NULL, &scroller_w, &scroller_h); + elm_scroller_region_show(m_scroller ,scroller_x, 0, scroller_w, scroller_h); + + /* Block event durring animation. */ + elm_transit_event_enabled_set(m_new_window_transit, EINA_TRUE); + + int url_layout_h = 0; + int url_layout_y = 0; + evas_object_geometry_get(m_url_layout, NULL, &url_layout_y, NULL, &url_layout_h); + + int current_ewk_view_x = 0; + int current_ewk_view_w = 0; + int current_ewk_view_h = 0; + evas_object_geometry_get(current_ewk_view, ¤t_ewk_view_x, NULL, + ¤t_ewk_view_w, ¤t_ewk_view_h); + + evas_object_resize(new_ewk_view, current_ewk_view_w, current_ewk_view_h - url_layout_h); + evas_object_move(new_ewk_view, current_ewk_view_x + current_ewk_view_w, url_layout_y + url_layout_h); + evas_object_show(new_ewk_view); + + elm_transit_object_add(m_new_window_transit, current_ewk_view); + elm_transit_object_add(m_new_window_transit, new_ewk_view); + elm_transit_tween_mode_set(m_new_window_transit, ELM_TRANSIT_TWEEN_MODE_SINUSOIDAL); + elm_transit_objects_final_state_keep_set(m_new_window_transit, EINA_FALSE); + elm_transit_effect_translation_add(m_new_window_transit, 0, 0, (-1) * current_ewk_view_w, 0); + elm_transit_del_cb_set(m_new_window_transit, __new_window_transit_finished_cb, this); + elm_transit_duration_set(m_new_window_transit, 0.3); + elm_transit_go(m_new_window_transit); + + return EINA_TRUE; +} + +Evas_Object *Browser_View::get_favicon(const char *url) +{ + if (!url || !strlen(url)) + return NULL; + + Evas_Object *favicon = ewk_settings_icon_database_icon_object_add(url, evas_object_evas_get(m_win)); + return favicon; +} + +Eina_Bool Browser_View::_set_favicon(void) +{ + BROWSER_LOGD("[%s]", __func__); + + if (m_edit_mode == BR_URL_ENTRY_EDIT_MODE + || m_edit_mode == BR_URL_ENTRY_EDIT_MODE_WITH_NO_IMF) { + BROWSER_LOGD("Edit mode"); + return EINA_FALSE; + } + + if (get_url().empty()) + return EINA_FALSE; + + double progress = ewk_view_load_progress_get(elm_webview_webkit_get(m_focused_window->m_ewk_view)); + if (progress < 1.0f && progress > 0.05f) { + BROWSER_LOGD("loadin status"); + return EINA_FALSE; + } + + Evas_Object *favicon = ewk_settings_icon_database_icon_object_add(get_url().c_str(), + evas_object_evas_get(m_win)); + Evas_Object *option_header_favicon = ewk_settings_icon_database_icon_object_add(get_url().c_str(), + evas_object_evas_get(m_win)); + if (favicon) { + if (m_focused_window->m_favicon) + evas_object_del(m_focused_window->m_favicon); + + m_focused_window->m_favicon = favicon; + } else { + Evas_Object *default_icon = elm_icon_add(m_focused_window->m_ewk_view); + if (!default_icon) { + BROWSER_LOGE("elm_icon_add is failed."); + return EINA_FALSE; + } + if (!elm_icon_file_set(default_icon, BROWSER_IMAGE_DIR"/faviconDefault.png", NULL)) { + BROWSER_LOGE("elm_icon_file_set is failed."); + return EINA_FALSE; + } + evas_object_size_hint_aspect_set(default_icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); + if (m_focused_window->m_favicon) + evas_object_del(m_focused_window->m_favicon); + + m_focused_window->m_favicon = default_icon; + } + + if (option_header_favicon) { + if (m_focused_window->m_option_header_favicon) + evas_object_del(m_focused_window->m_option_header_favicon); + + m_focused_window->m_option_header_favicon = option_header_favicon; + } else { + Evas_Object *default_icon = elm_icon_add(m_focused_window->m_ewk_view); + if (!default_icon) { + BROWSER_LOGE("elm_icon_add is failed."); + return EINA_FALSE; + } + if (!elm_icon_file_set(default_icon, BROWSER_IMAGE_DIR"/faviconDefault.png", NULL)) { + BROWSER_LOGE("elm_icon_file_set is failed."); + return EINA_FALSE; + } + evas_object_size_hint_aspect_set(default_icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); + if (m_focused_window->m_option_header_favicon) + evas_object_del(m_focused_window->m_option_header_favicon); + + m_focused_window->m_option_header_favicon = default_icon; + } + + if (elm_object_part_content_get(m_url_entry_layout, "elm.swallow.favicon")) + elm_object_part_content_unset(m_url_entry_layout, "elm.swallow.favicon"); + if (elm_object_part_content_get(m_option_header_url_entry_layout, + "elm.swallow.favicon")) + elm_object_part_content_unset(m_option_header_url_entry_layout, + "elm.swallow.favicon"); + + elm_object_part_content_set(m_url_entry_layout, "elm.swallow.favicon", + m_focused_window->m_favicon); + elm_object_part_content_set(m_option_header_url_entry_layout, "elm.swallow.favicon", + m_focused_window->m_option_header_favicon); + + edje_object_signal_emit(elm_layout_edje_get(m_url_entry_layout), + "show,favicon,signal", ""); + edje_object_signal_emit(elm_layout_edje_get(m_option_header_url_entry_layout), + "show,favicon,signal", ""); + return EINA_TRUE; +} + +Eina_Bool Browser_View::__close_window_idler_cb(void *data) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return ECORE_CALLBACK_CANCEL; + + Browser_View *browser_view = (Browser_View *)data; + Browser_Class *browser = browser_view->m_browser; + + if (browser_view->m_focused_window->m_parent) + browser->delete_window(browser_view->m_focused_window, + browser_view->m_focused_window->m_parent); + else + browser->delete_window(browser_view->m_focused_window); + + return ECORE_CALLBACK_CANCEL; +} + +void Browser_View::__html_boundary_reached_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_View *browser_view = (Browser_View *)data; + browser_view->show_msg_popup(BR_STRING_MSG_BOUNDARY_LACK_OF_SPACE_TO_SAVE_HTML); +} + +void Browser_View::__window_close_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_View *browser_view = (Browser_View *)data; + Browser_Class *browser = browser_view->m_browser; + + /* The window should be deleted by idler. The webkit recommands to delete by idler. */ + ecore_idler_add(__close_window_idler_cb, browser_view); +} + +/* + * navigation_action type : + * WEBKIT_WEB_NAVIGATION_REASON_LINK_CLICKED, + * WEBKIT_WEB_NAVIGATION_REASON_FORM_SUBMITTED, + * WEBKIT_WEB_NAVIGATION_REASON_BACK_FORWARD, + * WEBKIT_WEB_NAVIGATION_REASON_RELOAD, + * WEBKIT_WEB_NAVIGATION_REASON_FORM_RESUBMITTED, + * WEBKIT_WEB_NAVIGATION_REASON_OTHER, +*/ +void Browser_View::__create_webview_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_View *browser_view = (Browser_View *)data; + Browser_Class *browser = browser_view->m_browser; + + std::vector<Browser_Window *> window_list = browser->get_window_list(); + if (window_list.size() >= BROWSER_MULTI_WINDOW_MAX_COUNT) { + /* If the multi window is max, delete the first one. */ + if (browser_view->m_focused_window != window_list[0]) + browser->delete_window(window_list[0]); + else + browser->delete_window(window_list[BROWSER_MULTI_WINDOW_MAX_COUNT - 1]); + } + + Elm_WebView_Create_Webview_Data *create_webview_data = (Elm_WebView_Create_Webview_Data *)event_info; + if (create_webview_data->navigation_action == 5 && create_webview_data->javascript) { + int block_popup = 1; + const char *msg = BR_STRING_DISPLAY_POPUP_Q; + if (vconf_get_bool(BLOCK_POPUP_KEY, &block_popup) < 0) + BROWSER_LOGE("vconf_get_bool BLOCK_POPUP_KEY failed"); + if (!block_popup) { + if (!browser_view->show_modal_popup(msg)) + return; + } + } + + browser_view->m_created_new_window = browser->create_new_window(); + if (!browser_view->m_created_new_window) { + BROWSER_LOGE("create_new_window failed"); + return; + } + /* initialize the created webview first to connect ewk event callback functions such as load start, progress etc. */ + browser->ewk_view_init(browser_view->m_created_new_window->m_ewk_view); + + /* Set the caller window. */ + browser_view->m_created_new_window->m_parent = browser_view->m_focused_window; + + /* Destroy previous multi window item snapshot. + * This is because the snapshot of multi window item can't be captured in this case. */ + if (browser_view->m_focused_window->m_landscape_snapshot_image) { + evas_object_del(browser_view->m_focused_window->m_landscape_snapshot_image); + browser_view->m_focused_window->m_landscape_snapshot_image = NULL; + } + if (browser_view->m_focused_window->m_portrait_snapshot_image) { + evas_object_del(browser_view->m_focused_window->m_portrait_snapshot_image); + browser_view->m_focused_window->m_portrait_snapshot_image = NULL; + } + + create_webview_data->webview = elm_webview_webkit_get(browser_view->m_created_new_window->m_ewk_view); + + if (!browser_view->_show_new_window_effect(browser_view->m_focused_window->m_ewk_view, + browser_view->m_created_new_window->m_ewk_view)) + BROWSER_LOGE("_show_new_window_effect failed"); +} + +void Browser_View::_navigationbar_visible_set_signal(Eina_Bool visible) +{ + BROWSER_LOGD("visible=%d", visible); + + if (visible && m_data_manager->is_in_view_stack(BR_MULTI_WINDOW_VIEW)) + return; + + if (m_navi_it != elm_naviframe_top_item_get(m_navi_bar)) + return; + + evas_object_data_set(m_navi_bar, "visible", (Eina_Bool *)visible); + + Elm_Object_Item *top_it = elm_naviframe_top_item_get(m_navi_bar); + + if (visible) + elm_object_item_signal_emit(top_it, ELM_NAVIFRAME_ITEM_SIGNAL_OPTIONHEADER_INSTANT_OPEN); + else + elm_object_item_signal_emit(top_it, ELM_NAVIFRAME_ITEM_SIGNAL_OPTIONHEADER_INSTANT_CLOSE); +} + +void Browser_View::_navigationbar_visible_set(Eina_Bool visible) +{ + if (visible && m_data_manager->is_in_view_stack(BR_MULTI_WINDOW_VIEW)) + return; + + if (m_navi_it != elm_naviframe_top_item_get(m_navi_bar)) + return; + + evas_object_data_set(m_navi_bar, "visible", (Eina_Bool *)visible); + + Elm_Object_Item *top_it = elm_naviframe_top_item_get(m_navi_bar); + if (visible) + elm_object_item_signal_emit(top_it, ELM_NAVIFRAME_ITEM_SIGNAL_OPTIONHEADER_OPEN); + else + elm_object_item_signal_emit(top_it, ELM_NAVIFRAME_ITEM_SIGNAL_OPTIONHEADER_CLOSE); +} + +Eina_Bool Browser_View::_navigationbar_visible_get(void) +{ + Eina_Bool* visible = (Eina_Bool *)evas_object_data_get(m_navi_bar, "visible"); + BROWSER_LOGD("visible = %d", visible); + if (visible == (Eina_Bool *)EINA_TRUE) + return EINA_TRUE; + else + return EINA_FALSE; +} + +void Browser_View::_load_start(void) +{ + BROWSER_LOGD("[%s]", __func__); + + if (m_dummy_loading_progressbar) { + elm_object_part_content_unset(m_main_layout, "elm.swallow.waiting_progress"); + evas_object_del(m_dummy_loading_progressbar); + m_dummy_loading_progressbar = NULL; + edje_object_signal_emit(elm_layout_edje_get(m_main_layout), + "hide,waiting_progressbar,signal", ""); + } + + if (!m_data_manager->is_in_view_stack(BR_MULTI_WINDOW_VIEW)) + _set_navigationbar_title(BR_STRING_LOADING); + + edje_object_signal_emit(elm_layout_edje_get(m_url_entry_layout), "loading,on,signal", ""); + edje_object_signal_emit(elm_layout_edje_get(m_option_header_url_entry_layout), + "loading,on,signal", ""); + + _navigationbar_visible_set_signal(EINA_TRUE); + + /* Hide the secure lock icon in title bar. */ + elm_object_item_part_content_set(m_navi_it, ELM_NAVIFRAME_ITEM_ICON, NULL); + + /* Destroy & hide favicon when load start. */ + edje_object_signal_emit(elm_layout_edje_get(m_url_entry_layout), + "hide,favicon,signal", ""); + edje_object_signal_emit(elm_layout_edje_get(m_option_header_url_entry_layout), + "hide,favicon,signal", ""); + if (elm_object_part_content_get(m_url_entry_layout, "elm.swallow.favicon")) + elm_object_part_content_unset(m_url_entry_layout, "elm.swallow.favicon"); + if (elm_object_part_content_get(m_option_header_url_entry_layout, + "elm.swallow.favicon")) + elm_object_part_content_unset(m_option_header_url_entry_layout, + "elm.swallow.favicon"); + + if (m_focused_window->m_favicon) { + evas_object_del(m_focused_window->m_favicon); + m_focused_window->m_favicon = NULL; + } + if (m_focused_window->m_option_header_favicon) { + evas_object_del(m_focused_window->m_option_header_favicon); + m_focused_window->m_option_header_favicon = NULL; + } + + if (_get_edit_mode() != BR_NO_EDIT_MODE) + _set_edit_mode(BR_NO_EDIT_MODE); + /* For deleted window because of unused case like low memory. */ + m_focused_window->m_url.clear(); + m_focused_window->m_title.clear(); + + m_browser->get_certificate_manager()->reset_certificate(); + + m_picker_handler->destroy_picker_layout(); +} + +void Browser_View::__uri_changed_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_View *browser_view = (Browser_View *)data; + if (browser_view->_get_edit_mode() != BR_NO_EDIT_MODE) + return; + const char *uri = (const char *)event_info; + browser_view->_set_url_entry(uri); + + /* Workaround, give focus to option header cancel button to hide imf. */ + elm_object_focus_set(browser_view->m_option_header_cancel_button, EINA_TRUE); +} + +void Browser_View::__load_started_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_View *browser_view = (Browser_View *)data; + + Evas_Object *url_progressbar = browser_view->m_url_progressbar; + Evas_Object *progressbar_wheel = browser_view->m_url_progresswheel; + Evas_Object *option_header_url_progressbar = browser_view->m_option_header_url_progressbar; + Evas_Object *option_header_progressbar_wheel = browser_view->m_option_header_url_progresswheel; + + double progress = ewk_view_load_progress_get(elm_webview_webkit_get(browser_view->m_focused_window->m_ewk_view)); + if (progress <= 0.0f) + progress = 0.05f; + elm_progressbar_pulse(progressbar_wheel, EINA_TRUE); + elm_progressbar_pulse(option_header_progressbar_wheel, EINA_TRUE); + + elm_progressbar_value_set(url_progressbar, progress); + elm_progressbar_value_set(option_header_url_progressbar, progress); + + browser_view->_load_start(); +} + +void Browser_View::__load_finished_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_View *browser_view = (Browser_View *)data; + Evas_Object *progressbar_wheel = browser_view->m_url_progresswheel; + Evas_Object *option_header_progressbar_wheel = browser_view->m_option_header_url_progresswheel; + + elm_progressbar_pulse(progressbar_wheel, EINA_FALSE); + elm_progressbar_pulse(option_header_progressbar_wheel, EINA_FALSE); + + if (browser_view->m_edit_mode != BR_URL_ENTRY_EDIT_MODE + && browser_view->m_edit_mode != BR_URL_ENTRY_EDIT_MODE_WITH_NO_IMF) { + /* change the url layout for normal mode. (change the reload icon etc) */ + edje_object_signal_emit(elm_layout_edje_get(browser_view->m_url_entry_layout), + "loading,off,signal", ""); + edje_object_signal_emit(elm_layout_edje_get(browser_view->m_option_header_url_entry_layout), + "loading,off,signal", ""); + } + + if (!m_data_manager->is_in_view_stack(BR_MULTI_WINDOW_VIEW)) { + if (browser_view->get_title().empty()) + browser_view->_set_navigationbar_title(browser_view->get_url().c_str()); + else + browser_view->_set_navigationbar_title(browser_view->get_title().c_str()); + } + + browser_view->_set_secure_icon(); + if (!browser_view->_set_favicon()) + BROWSER_LOGE("_set_favicon failed"); + + browser_view->_load_finished(); +} + +void Browser_View::__load_progress_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_View *browser_view = (Browser_View *)data; + + Evas_Object *url_progressbar = browser_view->m_url_progressbar; + Evas_Object *option_header_url_progressbar = browser_view->m_option_header_url_progressbar; + + double progress = *((double *)event_info); + BROWSER_LOGD("progress=%f", progress); + elm_progressbar_value_set(url_progressbar, progress); + elm_progressbar_value_set(option_header_url_progressbar, progress); +} + +void Browser_View::__load_nonempty_layout_finished_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_View *browser_view = (Browser_View *)data; + + /* If the first content is displayed, hide the url layout in browser scroller like safari. */ + int scroller_x = 0; + int scroller_w = 0; + int scroller_h = 0; + elm_scroller_region_get(browser_view->m_scroller, &scroller_x, NULL, &scroller_w, &scroller_h); + elm_scroller_region_show(browser_view->m_scroller ,scroller_x, 0, + scroller_w, scroller_h); +} + +void Browser_View::__html5_video_request_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data || !event_info) + return; + + Browser_View *browser_view = (Browser_View *)data; + html5_video_data *video_data = (html5_video_data *)event_info; + + if (!browser_view->_call_html5_video_streaming_player(video_data->path, video_data->cookie)) + BROWSER_LOGE("_call_html5_video_streaming_player"); +} + +void Browser_View::__vibrator_vibrate_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + + int device_handle = 0; + int ret_val = 0; + const long vibration_time = *((const long *)event_info); + + BROWSER_LOGD("__vibrator_vibrate_cb : play time is [%ld]", vibration_time); + + device_handle = device_haptic_open(DEV_IDX_0, 0); + + if (device_handle < 0) { + BROWSER_LOGD("Failed to get handle ID of vibration device"); + return; + } + + ret_val = device_haptic_play_monotone(device_handle, vibration_time); + if (ret_val != 0) + BROWSER_LOGD("Failed to play vibration"); + + ret_val = device_haptic_close(device_handle); + if (ret_val != 0) + BROWSER_LOGD("Failed to withdraw vibration handle"); +} + +void Browser_View::__vibrator_cancel_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + + int device_handle = 0; + int ret_val = 0; + + device_handle = device_haptic_open(DEV_IDX_0, 0); + + if (device_handle < 0) { + BROWSER_LOGD("Failed to get handle ID of vibration device"); + return; + } + + ret_val = device_haptic_stop_play(device_handle); + if (ret_val != 0) + BROWSER_LOGD("Failed to stop vibration"); + + ret_val = device_haptic_close(device_handle); + if (ret_val != 0) + BROWSER_LOGD("Failed to withdraw vibration handle"); +} + +Eina_Bool Browser_View::_call_html5_video_streaming_player(const char *url, const char *cookie) +{ + BROWSER_LOGD("[%s]", __func__); + if (!url || !strlen(url)) { + BROWSER_LOGE("url is null"); + return EINA_FALSE; + } + + bool is_running = false; + if (app_manager_is_running(SEC_VT_CALL, &is_running)) { + BROWSER_LOGE("Fail to get app running information\n"); + return EINA_FALSE; + } + + if (is_running) { + BROWSER_LOGE("org.tizen.vtmain is running......\n"); + show_msg_popup(BR_STRING_WARNING_VIDEO_PLAYER); + return EINA_FALSE; + } + + service_h service_handle = NULL; + + if (service_create(&service_handle) < 0) { + BROWSER_LOGE("Fail to create service handle"); + return EINA_FALSE; + } + + if (!service_handle) { + BROWSER_LOGE("service handle is NULL"); + return EINA_FALSE; + } + + if (service_set_uri(service_handle, url) < 0) { + BROWSER_LOGE("Fail to set uri"); + service_destroy(service_handle); + return EINA_FALSE; + } + + if (cookie && strlen(cookie)) { + if (service_add_extra_data(service_handle, "cookie", cookie) < 0) { + BROWSER_LOGE("Fail to set extra data as cookie"); + service_destroy(service_handle); + return EINA_FALSE; + } + } + + if (service_set_package(service_handle, SEC_STREAMING_PLAYER) < 0) { + BROWSER_LOGE("Fail to create service_set_package as org.tizen.video-player"); + return EINA_FALSE; + } + + if (service_send_launch_request(service_handle, NULL, NULL) < 0) { + BROWSER_LOGE("Fail to launch service operation"); + service_destroy(service_handle); + return EINA_FALSE; + } + + service_destroy(service_handle); + + return EINA_TRUE; +} + +void Browser_View::_set_secure_icon(void) +{ + std::string url = get_url(); + BROWSER_LOGD("url=[%s]", url.c_str()); + + if (url.c_str() && url.length()) { + if (!strncmp(url.c_str(), BROWSER_HTTPS_SCHEME, strlen(BROWSER_HTTPS_SCHEME))) { + edje_object_signal_emit(elm_layout_edje_get(m_url_layout), + "show,secure_icon,signal", ""); + edje_object_signal_emit(elm_layout_edje_get(m_option_header_url_layout), + "show,secure_icon,signal", ""); + return; + } + } + + edje_object_signal_emit(elm_layout_edje_get(m_url_layout), "hide,secure_icon,signal", ""); + edje_object_signal_emit(elm_layout_edje_get(m_option_header_url_layout), + "hide,secure_icon,signal", ""); +} + +void Browser_View::_load_finished(void) +{ + BROWSER_LOGD("[%s]", __func__); + + /* enable or disable back,forward controlbar buttons */ + _set_controlbar_back_forward_status(); + + _set_secure_icon(); + if (!_set_favicon()) + BROWSER_LOGE("_set_favicon failed"); + + /* Add current url to history */ + Eina_Bool is_full = EINA_FALSE; + + /* Save last visited url to save this when browser exits. */ + m_last_visited_url = get_url(); + + if (m_data_manager->get_history_db()) { + m_data_manager->get_history_db()->save_history(m_last_visited_url.c_str(), + get_title().c_str(), &is_full); + if (is_full) + BROWSER_LOGE("history is full, delete the first one"); + } + + if (!m_personal_data_manager->set_personal_data(get_url().c_str())) + BROWSER_LOGE("set_personal_data failed"); + + _hide_scroller_url_layout(); +} + +void Browser_View::_hide_scroller_url_layout(void) +{ + BROWSER_LOGD("[%s]", __func__); + + if (_get_edit_mode() != BR_NO_EDIT_MODE) + return; + + _navigationbar_visible_set_signal(EINA_FALSE); + + int browser_scroller_x = 0; + int browser_scroller_w = 0; + int browser_scroller_h = 0; + elm_scroller_region_get(m_scroller, &browser_scroller_x, NULL, + &browser_scroller_w, &browser_scroller_h); + + int url_layout_h = 0; + evas_object_geometry_get(m_url_layout, NULL, NULL, NULL, &url_layout_h); + elm_scroller_region_show(m_scroller, browser_scroller_x, url_layout_h, + browser_scroller_w, browser_scroller_h); +} + +void Browser_View::__ewk_view_mouse_down_cb(void* data, Evas* evas, Evas_Object* obj, void* ev) +{ + if (!data) + return; + + Browser_View *browser_view = (Browser_View *)data; + Evas_Event_Mouse_Down event = *(Evas_Event_Mouse_Down *)ev; + Evas_Object *main_layout = browser_view->m_main_layout; + Evas_Object *ewk_view = browser_view->m_focused_window->m_ewk_view; + + if (!browser_view->_is_loading() && browser_view->_get_edit_mode() != BR_FIND_WORD_MODE) + browser_view->_navigationbar_visible_set(EINA_FALSE); + + browser_view->m_is_scrolling = EINA_TRUE; + + Evas_Object *webkit = elm_webview_webkit_get(browser_view->m_focused_window->m_ewk_view); + float max_zoom_rate = ewk_view_zoom_range_max_get(webkit); + float min_zoom_rate = ewk_view_zoom_range_min_get(webkit); + float current_zoom_rate = ewk_view_zoom_get(webkit); + + Eina_Bool can_zoom_in = EINA_TRUE; + Eina_Bool can_zoom_out = EINA_TRUE; + if (current_zoom_rate >= max_zoom_rate) + can_zoom_in = EINA_FALSE; + if (current_zoom_rate <= min_zoom_rate) + can_zoom_out = EINA_FALSE; + if (can_zoom_in || can_zoom_out) { + if (browser_view->m_zoom_button_timer) + ecore_timer_del(browser_view->m_zoom_button_timer); + browser_view->m_zoom_button_timer = ecore_timer_add(3, __zoom_button_timeout_cb, browser_view); + edje_object_signal_emit(elm_layout_edje_get(browser_view->m_main_layout), "show,zoom_buttons,signal", ""); + } + + if (!can_zoom_in) + elm_object_disabled_set(browser_view->m_zoom_in_button ,EINA_TRUE); + else + elm_object_disabled_set(browser_view->m_zoom_in_button ,EINA_FALSE); + + if (!can_zoom_out) + elm_object_disabled_set(browser_view->m_zoom_out_button ,EINA_TRUE); + else + elm_object_disabled_set(browser_view->m_zoom_out_button ,EINA_FALSE); +} + +void Browser_View::__ewk_view_multi_down_cb(void *data, Evas *evas, Evas_Object *obj, void *ev) +{ + if (!data) + return; + + Browser_View *browser_view = (Browser_View *)data; + browser_view->m_is_multi_touch = EINA_TRUE; + browser_view->_enable_webview_scroll(); +} + +void Browser_View::__ewk_view_mouse_up_cb(void *data, Evas *evas, Evas_Object *obj, void *ev) +{ + if (!data) + return; + + Browser_View *browser_view = (Browser_View *)data; + + browser_view->m_is_multi_touch = EINA_FALSE; + browser_view->m_is_scrolling = EINA_FALSE; +} + +void Browser_View::__ewk_view_edge_top_cb(void *data, Evas_Object *obj, void *event_info) +{ + if (!data) + return; + Browser_View *browser_view = (Browser_View *)data; + + int browser_scroller_x = 0; + int browser_scroller_y = 0; + int browser_scroller_w = 0; + int browser_scroller_h = 0; + elm_scroller_region_get(browser_view->m_scroller, &browser_scroller_x, &browser_scroller_y, + &browser_scroller_w, &browser_scroller_h); + + int url_layout_h = 0; + evas_object_geometry_get(browser_view->m_url_layout, NULL, NULL, NULL, &url_layout_h); + + if (browser_scroller_y < url_layout_h) + return; + + if (browser_view->m_is_scroll_up) + return; + + BROWSER_LOGD("[%s]", __func__); + browser_view->_enable_browser_scroller_scroll(); + + /* If user do flicking the mouse with scroll up, bring in the browser scroller to y=0. */ + if (!browser_view->m_is_scrolling && !browser_view->m_is_scroll_up) { + BROWSER_LOGD("<< elm_scroller_region_bring_in >>"); + elm_scroller_region_bring_in(browser_view->m_scroller, browser_scroller_x, 0, + browser_scroller_w, browser_scroller_h); + } +} + +void Browser_View::__scroller_edge_bottom_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + Browser_View *browser_view = (Browser_View *)data; + browser_view->_enable_webview_scroll(); +} + +void Browser_View::__ewk_view_mouse_move_cb(void *data, Evas *evas, Evas_Object *obj, void *ev) +{ + if (!data) + return; + + Evas_Event_Mouse_Move *point = (Evas_Event_Mouse_Move *)ev; + + Browser_View *browser_view = (Browser_View *)data; + if (point->cur.output.y < point->prev.output.y) { + browser_view->m_is_scroll_up = EINA_TRUE; + __ewk_view_scroll_down_cb(data, NULL, NULL); + } else { + browser_view->m_is_scroll_up = EINA_FALSE; + /* scroll up */ + __ewk_view_scroll_up_cb(data, NULL, NULL); + } +} + +void Browser_View::__ewk_view_scroll_down_cb(void *data, Evas_Object *obj, void *event_info) +{ + if (!data) + return; + Browser_View *browser_view = (Browser_View *)data; + + int browser_scroller_y = 0; + int url_layout_h = 0; + elm_scroller_region_get(browser_view->m_scroller, NULL, &browser_scroller_y, NULL, NULL); + evas_object_geometry_get(browser_view->m_url_layout, NULL, NULL, NULL, &url_layout_h); + + if (browser_scroller_y < url_layout_h) + browser_view->_enable_browser_scroller_scroll(); + else + browser_view->_enable_webview_scroll(); +} + +void Browser_View::__ewk_view_scroll_up_cb(void *data, Evas_Object *obj, void *event_info) +{ + if (!data) + return; + + Browser_View *browser_view = (Browser_View *)data; + + int frame_position_y = 0; + Evas_Object *webkit = elm_webview_webkit_get(browser_view->m_focused_window->m_ewk_view); + Evas_Object *frame = ewk_view_frame_main_get(webkit); + ewk_frame_scroll_pos_get(frame, NULL, &frame_position_y); + + int browser_scroller_y = 0; + elm_scroller_region_get(browser_view->m_scroller, NULL, &browser_scroller_y, NULL, NULL); + + if (frame_position_y == 0 && browser_scroller_y) + browser_view->_enable_browser_scroller_scroll(); + else + browser_view->_enable_webview_scroll(); +} + +void Browser_View::_set_navigationbar_title(const char *title) +{ + BROWSER_LOGD("title=[%s]", title); + edje_object_part_text_set(elm_layout_edje_get(m_url_layout), + "title_text", title); + edje_object_part_text_set(elm_layout_edje_get(m_option_header_url_layout), + "title_text", title); +} + + +void Browser_View::_set_url_entry(const char *url, Eina_Bool set_secrue_icon) +{ + BROWSER_LOGD("url=[%s]", url); + if (url && strlen(url)) { + std::string url_without_http_scheme; + if (strstr(url, BROWSER_HTTP_SCHEME) && strlen(url) > strlen(BROWSER_HTTP_SCHEME)) + url_without_http_scheme = std::string(url + strlen(BROWSER_HTTP_SCHEME)); + else + url_without_http_scheme = std::string(url); + + char *mark_up_url = elm_entry_utf8_to_markup(url_without_http_scheme.c_str()); + if (mark_up_url) { + Evas_Object *entry = br_elm_editfield_entry_get(m_url_edit_field); + elm_entry_entry_set(entry, mark_up_url); + entry = br_elm_editfield_entry_get(m_option_header_url_edit_field); + elm_entry_entry_set(entry, mark_up_url); + free(mark_up_url); + } + } else { + Evas_Object *entry = br_elm_editfield_entry_get(m_url_edit_field); + elm_entry_entry_set(entry, BROWSER_MOST_VISITED_SITES_URL); + entry = br_elm_editfield_entry_get(m_option_header_url_edit_field); + elm_entry_entry_set(entry, BROWSER_MOST_VISITED_SITES_URL); + } + + if (set_secrue_icon) + _set_secure_icon(); +} + +void Browser_View::_stop_loading(void) +{ + BROWSER_LOGD("[%s]", __func__); + if (m_focused_window->m_ewk_view) { + if (!ewk_view_stop(elm_webview_webkit_get(m_focused_window->m_ewk_view))) + BROWSER_LOGE("ewk_view_stop failed.\n"); + } +} + +void Browser_View::_reload(void) +{ + BROWSER_LOGD("[%s]", __func__); + if (m_focused_window->m_ewk_view) { + if (!ewk_view_reload_full(elm_webview_webkit_get(m_focused_window->m_ewk_view))) + BROWSER_LOGE("ewk_view_reload_full failed.\n"); + } +} + +void Browser_View::set_focused_window(Browser_Window *window, Eina_Bool show_most_visited_sites) +{ + BROWSER_LOGD("[%s]", __func__); + if (m_focused_window && m_focused_window->m_ewk_view) { + evas_object_hide(m_focused_window->m_ewk_view); + } + + if (m_focused_window && m_focused_window->m_favicon) { + if (elm_object_part_content_get(m_url_entry_layout, "elm.swallow.favicon")) + elm_object_part_content_unset(m_url_entry_layout, "elm.swallow.favicon"); + + evas_object_hide(m_focused_window->m_favicon); + } + if (m_focused_window && m_focused_window->m_option_header_favicon) { + if (elm_object_part_content_get(m_option_header_url_entry_layout, "elm.swallow.favicon")) + elm_object_part_content_unset(m_option_header_url_entry_layout, "elm.swallow.favicon"); + + evas_object_hide(m_focused_window->m_option_header_favicon); + } + + m_focused_window = window; + + elm_box_unpack_all(m_content_box); + + elm_box_pack_end(m_content_box, m_focused_window->m_ewk_view); + elm_box_pack_start(m_content_box, m_url_layout); + + evas_object_show(m_focused_window->m_ewk_view); + /* Workaround. + * The webview layout is not resized whenever repack to content box. + * So resize the webview layout whenever repack. */ + ecore_idler_add(__webview_layout_resize_idler_cb, this); + + if (!_is_loading()) { + edje_object_signal_emit(elm_layout_edje_get(m_url_entry_layout), "loading,off,signal", ""); + edje_object_signal_emit(elm_layout_edje_get(m_option_header_url_entry_layout), + "loading,off,signal", ""); + elm_progressbar_pulse(m_url_progresswheel, EINA_FALSE); + elm_progressbar_pulse(m_option_header_url_progresswheel, EINA_FALSE); + } + + /* show or hide favicon in url layout. */ + if (m_focused_window->m_favicon) { + if (elm_object_part_content_get(m_url_entry_layout, "elm.swallow.favicon")) + elm_object_part_content_unset(m_url_entry_layout, "elm.swallow.favicon"); + + elm_object_part_content_set(m_url_entry_layout, "elm.swallow.favicon", + m_focused_window->m_favicon); + edje_object_signal_emit(elm_layout_edje_get(m_url_entry_layout), + "show,favicon,signal", ""); + evas_object_show(m_focused_window->m_favicon); + } else { + edje_object_signal_emit(elm_layout_edje_get(m_url_entry_layout), + "hide,favicon,signal", ""); + } + + /* show or hide favicon in option header url layout. */ + if (m_focused_window->m_option_header_favicon) { + if (elm_object_part_content_get(m_option_header_url_entry_layout, "elm.swallow.favicon")) + elm_object_part_content_unset(m_option_header_url_entry_layout, "elm.swallow.favicon"); + + elm_object_part_content_set(m_option_header_url_entry_layout, "elm.swallow.favicon", + m_focused_window->m_option_header_favicon); + edje_object_signal_emit(elm_layout_edje_get(m_option_header_url_entry_layout), + "show,favicon,signal", ""); + evas_object_show(m_focused_window->m_option_header_favicon); + } else { + edje_object_signal_emit(elm_layout_edje_get(m_option_header_url_entry_layout), + "hide,favicon,signal", ""); + } + + std::vector<Browser_Window *> window_list = m_browser->get_window_list(); + _set_multi_window_controlbar_text(window_list.size()); + + if (!_set_favicon()) + BROWSER_LOGE("_set_favicon failed"); + + /* Without this code, the url is empty shortly when create deleted-window in multi window. */ + if (get_url().empty() && !m_focused_window->m_url.empty()) + _set_url_entry(m_focused_window->m_url.c_str()); + else + _set_url_entry(get_url().c_str()); +} + +void Browser_View::load_url(const char *url) +{ + BROWSER_LOGD("[%s]url=[%s]", __func__, url); + if (!url || !strlen(url)) { + edje_object_signal_emit(elm_layout_edje_get(m_main_layout), + "show,control_bar,no_animation,signal", ""); + + if (m_dummy_loading_progressbar) { + elm_object_part_content_unset(m_main_layout, "elm.swallow.waiting_progress"); + evas_object_del(m_dummy_loading_progressbar); + m_dummy_loading_progressbar = NULL; + edje_object_signal_emit(elm_layout_edje_get(m_main_layout), + "hide,waiting_progressbar,signal", ""); + } + + ecore_idler_add(_activate_url_entry_idler_cb, this); + return; + } + + Evas_Object *edit_field_entry = br_elm_editfield_entry_get(_get_activated_url_entry()); + evas_object_smart_callback_del(edit_field_entry, "changed", __url_entry_changed_cb); + + std::string full_url; + if (_has_url_sheme(url)) + full_url = url; + else + full_url = std::string(BROWSER_HTTP_SCHEME) + std::string(url); + + BROWSER_LOGD("full_url = [%s]", full_url.c_str()); + + _set_url_entry(full_url.c_str()); + + elm_webview_uri_set(m_focused_window->m_ewk_view, full_url.c_str()); + } + +string Browser_View::get_title(Browser_Window *window) +{ + BROWSER_LOGD("[%s]", __func__); + string title = ""; + + if (!window->m_ewk_view && !window->m_title.empty()) + return window->m_title; + + if (!window->m_ewk_view) + return title; + + Evas_Object *webkit = elm_webview_webkit_get(window->m_ewk_view); + Evas_Object *main_frame = ewk_view_frame_main_get(webkit); + if (main_frame) { + const char *frame_title = ewk_frame_title_get(main_frame); + if (frame_title) + title = std::string(frame_title); + } + + return title; +} + +string Browser_View::get_title(void) +{ + BROWSER_LOGD("[%s]", __func__); + string title = ""; + + Evas_Object *webkit = elm_webview_webkit_get(m_focused_window->m_ewk_view); + Evas_Object *main_frame = ewk_view_frame_main_get(webkit); + if (main_frame) { + const char *frame_title = ewk_frame_title_get(main_frame); + if (frame_title) + title = std::string(frame_title); + } + + BROWSER_LOGD("m_focused_window->m_title=[%s]", m_focused_window->m_title.c_str()); + if (title.empty() && !m_focused_window->m_title.empty()) + return m_focused_window->m_title; + else + return title; +} + +string Browser_View::get_url(Browser_Window *window) +{ + BROWSER_LOGD("[%s]", __func__); + string url = ""; + + if (!window->m_ewk_view && !window->m_url.empty()) + return window->m_url; + + if (!window->m_ewk_view) + return url; + + Evas_Object *webkit = elm_webview_webkit_get(window->m_ewk_view); + Evas_Object *main_frame = ewk_view_frame_main_get(webkit); + if (main_frame) { + const char *frame_url = ewk_frame_uri_get(main_frame); + if (frame_url) + url = std::string(frame_url); + } + + return url; +} + +string Browser_View::get_url(void) +{ + BROWSER_LOGD("[%s]", __func__); + string url = ""; + + Evas_Object *webkit = elm_webview_webkit_get(m_focused_window->m_ewk_view); + Evas_Object *main_frame = ewk_view_frame_main_get(webkit); + if (main_frame) { + const char *frame_url = ewk_frame_uri_get(main_frame); + if (frame_url) + url = std::string(frame_url); + } + return url; +} + +/* If multi window is running, unset the navigation title object, + * else set the navigation title object to show title object arrow. */ +void Browser_View::unset_navigationbar_title_object(Eina_Bool is_unset) +{ + BROWSER_LOGD("[%s] is_unset =%d", __func__, is_unset); + Elm_Object_Item *top_it = elm_naviframe_top_item_get(m_navi_bar); + if (is_unset) { + _navigationbar_visible_set_signal(EINA_FALSE); + elm_object_item_part_content_unset(top_it, ELM_NAVIFRAME_ITEM_OPTIONHEADER); + evas_object_hide(m_option_header_layout); + } else { + Evas_Object *title_object = NULL; + title_object = elm_object_item_part_content_get(top_it, ELM_NAVIFRAME_ITEM_OPTIONHEADER); + if (!title_object) { + elm_object_item_part_content_set(top_it, ELM_NAVIFRAME_ITEM_OPTIONHEADER, + m_option_header_layout); + evas_object_show(m_option_header_layout); + } + + _navigationbar_visible_set_signal(EINA_FALSE); + } +} + +void Browser_View::__go_to_bookmark_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_View *browser_view = (Browser_View *)data; + browser_view->suspend_webview(browser_view->m_focused_window->m_ewk_view); + if (!m_data_manager->create_bookmark_view()) { + BROWSER_LOGE("m_data_manager->create_bookmark_view failed"); + return; + } + + if (!m_data_manager->get_bookmark_view()->init()) { + BROWSER_LOGE("m_data_manager->get_bookmark_view()->init failed"); + m_data_manager->destroy_bookmark_view(); + } + + browser_view->m_context_menu->destroy_context_popup(); + browser_view->_destroy_more_context_popup(); +} + +void Browser_View::__backward_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_View *browser_view = (Browser_View *)data; + __title_back_button_clicked_cb(data, obj, event_info); + browser_view->_destroy_more_context_popup(); + browser_view->m_context_menu->destroy_context_popup(); +} + +void Browser_View::__forward_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_View *browser_view = (Browser_View *)data; + browser_view->_destroy_more_context_popup(); + if (browser_view->m_focused_window->m_ewk_view) { + Evas_Object *webkit = elm_webview_webkit_get(browser_view->m_focused_window->m_ewk_view); + if (ewk_view_forward_possible(webkit)) { + if (!ewk_view_forward(webkit)) + BROWSER_LOGE("ewk_view_forward failed"); + } + } +} + +void Browser_View::__expand_option_header_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_View *browser_view = (Browser_View *)data; + + browser_view->_navigationbar_title_clicked(); +} + +void Browser_View::__add_bookmark_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_View *browser_view = (Browser_View *)data; + + if (!m_data_manager->create_add_to_bookmark_view(browser_view->get_title(), browser_view->get_url())) { + BROWSER_LOGE("m_data_manager->create_add_to_bookmark_view failed"); + return; + } + + if (!m_data_manager->get_add_to_bookmark_view()->init()) + m_data_manager->destroy_add_to_bookmark_view(); +} + +void Browser_View::__multi_window_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + + Browser_View *browser_view = (Browser_View *)data; + + browser_view->m_context_menu->destroy_context_popup(); + browser_view->_destroy_more_context_popup(); + + if (m_data_manager->is_in_view_stack(BR_MULTI_WINDOW_VIEW)) { + BROWSER_LOGD("close multi window"); + m_data_manager->get_multi_window_view()->close_multi_window(); + return; + } + + if (browser_view->_is_loading()) + browser_view->_stop_loading(); + + if (!m_data_manager->create_multi_window_view()) { + BROWSER_LOGE("m_data_manager->create_multi_window_view failed"); + return; + } + + if (!m_data_manager->get_multi_window_view()->init()) { + m_data_manager->destroy_multi_window_view(); + BROWSER_LOGE("get_multi_window_view()->init failed"); + return; + } + + browser_view->suspend_webview(browser_view->m_focused_window->m_ewk_view); + + browser_view->_navigationbar_visible_set_signal(EINA_FALSE); + + /* Hide the secure lock icon in title bar. */ + Elm_Object_Item *top_it = elm_naviframe_top_item_get(m_navi_bar); + elm_object_item_part_content_set(top_it, ELM_NAVIFRAME_ITEM_ICON, NULL); + + if (browser_view->_get_edit_mode() != BR_NO_EDIT_MODE) + browser_view->_set_edit_mode(BR_NO_EDIT_MODE); +} + +Eina_Bool Browser_View::_call_internet_settings(void) +{ + BROWSER_LOGD("[%s]", __func__); + + m_browser_settings = new(nothrow) Browser_Settings_Class; + if (!m_browser_settings) { + BROWSER_LOGE("new Browser_Settings_Class failed"); + return EINA_FALSE; + } + if (!m_browser_settings->init()) { + BROWSER_LOGE("m_browser_settings->init failed"); + delete m_browser_settings; + m_browser_settings = NULL; + + return EINA_FALSE; + } + return EINA_TRUE; +} + +void Browser_View::__internet_settings_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_View *browser_view = (Browser_View *)data; + browser_view->_destroy_more_context_popup(); + + if (!browser_view->_call_internet_settings()) + BROWSER_LOGE("_call_internet_settings failed"); +} + +void Browser_View::__find_word_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_View *browser_view = (Browser_View *)data; + browser_view->_destroy_more_context_popup(); + + if (browser_view->_get_edit_mode() == BR_FIND_WORD_MODE) + return; + + /* find word layout is only in naviframe optino header. + * So expand the option header to show find word layout. */ + browser_view->_navigationbar_visible_set_signal(EINA_TRUE); + + browser_view->_set_edit_mode(BR_FIND_WORD_MODE); + + browser_view->m_find_word->init(browser_view->m_focused_window->m_ewk_view); + +} + +Eina_Bool Browser_View::_call_download_manager(void) +{ + service_h service_handle = NULL; + BROWSER_LOGD("[%s]", __func__); + + if (service_create(&service_handle) < 0) { + BROWSER_LOGE("Fail to create service handle"); + return EINA_FALSE; + } + + if (!service_handle) { + BROWSER_LOGE("service handle is NULL"); + return EINA_FALSE; + } + + if (service_set_operation(service_handle, SERVICE_OPERATION_DOWNLOAD) < 0) { + BROWSER_LOGE("Fail to set service operation"); + service_destroy(service_handle); + return EINA_FALSE; + } + + if (service_add_extra_data(service_handle, "mode", "view") < 0) { + BROWSER_LOGE("Fail to set extra data"); + service_destroy(service_handle); + return EINA_FALSE; + } + + if (service_send_launch_request(service_handle, NULL, NULL) < 0) { + BROWSER_LOGE("Fail to launch service operation"); + service_destroy(service_handle); + return EINA_FALSE; + } + + service_destroy(service_handle); + + return EINA_TRUE; +} + +void Browser_View::__download_manager_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_View *browser_view = (Browser_View *)data; + browser_view->_destroy_more_context_popup(); + + if (!browser_view->_call_download_manager()) + BROWSER_LOGE("_call_download_manager failed"); +} + +void Browser_View::_destroy_more_context_popup(void) +{ + if (m_more_context_popup) { + evas_object_del(m_more_context_popup); + m_more_context_popup = NULL; + } +} + +void Browser_View::__more_context_popup_dismissed_cb(void *data, Evas_Object *obj, + void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_View *browser_view = (Browser_View *)data; + browser_view->_destroy_more_context_popup(); +} + +Eina_Bool Browser_View::_show_more_context_popup(void) +{ + BROWSER_LOGD("[%s]", __func__); + + _destroy_more_context_popup(); + + m_more_context_popup = elm_ctxpopup_add(m_win); + if (!m_more_context_popup) { + BROWSER_LOGE("elm_ctxpopup_add failed"); + return EINA_FALSE; + } + evas_object_size_hint_weight_set(m_more_context_popup, EVAS_HINT_EXPAND, + EVAS_HINT_EXPAND); + evas_object_smart_callback_add(m_more_context_popup, "dismissed", + __more_context_popup_dismissed_cb, this); + + Elm_Object_Item *sub_menu = elm_ctxpopup_item_append(m_more_context_popup, + BR_STRING_FORWARD, NULL, __forward_cb, this); + if (get_url().empty()) + elm_object_item_disabled_set(sub_menu, EINA_TRUE); + else { + Evas_Object *webkit = elm_webview_webkit_get(m_focused_window->m_ewk_view); + if (!ewk_view_forward_possible(webkit)) + elm_object_item_disabled_set(sub_menu, EINA_TRUE); + } + + elm_ctxpopup_item_append(m_more_context_popup, BR_STRING_DOWNLOAD_MANAGER, NULL, + __download_manager_cb, this); + + sub_menu = elm_ctxpopup_item_append(m_more_context_popup, BR_STRING_FIND_WORD, NULL, + __find_word_cb, this); + if (get_url().empty() + || _get_edit_mode() == BR_FIND_WORD_MODE) + elm_object_item_disabled_set(sub_menu, EINA_TRUE); + + elm_ctxpopup_item_append(m_more_context_popup, BR_STRING_SETTINGS, NULL, + __internet_settings_cb, this); + + elm_ctxpopup_hover_parent_set(m_more_context_popup, m_navi_bar); + + Evas_Coord navibar_width = 0; + Evas_Coord navibar_height = 0; + evas_object_geometry_get(m_navi_bar, NULL, NULL, &navibar_width, &navibar_height); + + evas_object_move(m_more_context_popup, BROWSER_MORE_CTX_POPUP_MARGIN * 7, + navibar_height - BROWSER_MORE_CTX_POPUP_MARGIN); + evas_object_show(m_more_context_popup); + + return EINA_TRUE; +} + +void Browser_View::__more_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_View *browser_view = (Browser_View *)data; + + browser_view->m_context_menu->destroy_context_popup(); + + if (browser_view->m_more_context_popup == NULL) { + if (!browser_view->_show_more_context_popup()) + BROWSER_LOGE("_show_more_context_popup failed"); + } else { + browser_view->_destroy_more_context_popup(); + } +} + +void Browser_View::_set_controlbar_back_forward_status(void) +{ + BROWSER_LOGD("[%s]", __func__); + Evas_Object *ewk_view = m_focused_window->m_ewk_view; + if (!ewk_view) + return; + + if (get_url().empty()) + elm_object_item_disabled_set(m_share_controlbar_button, EINA_TRUE); + else + elm_object_item_disabled_set(m_share_controlbar_button, EINA_FALSE); +} + +void Browser_View::_set_multi_window_controlbar_text(int count) +{ + BROWSER_LOGD("[%s]", __func__); + if (count == 1) { + elm_toolbar_item_icon_set(m_multi_window_button, BROWSER_IMAGE_DIR"/01_controlbar_icon_multiview.png"); + } else { + char icon_path[100] = {0, }; + snprintf(icon_path, sizeof(icon_path) - 1, "%s/01_controlbar_icon_multiview_0%d.png", BROWSER_IMAGE_DIR, count); + elm_toolbar_item_icon_set(m_multi_window_button, icon_path); + } +} + +Evas_Object *Browser_View::_create_control_bar(void) +{ + BROWSER_LOGD("[%s]", __func__); + Evas_Object *control_bar; + control_bar = elm_toolbar_add(m_navi_bar); + if (control_bar) { + elm_object_style_set(control_bar, "browser/default"); + + elm_toolbar_shrink_mode_set(control_bar, ELM_TOOLBAR_SHRINK_EXPAND); + + m_more_button = elm_toolbar_item_append(control_bar, + BROWSER_IMAGE_DIR"/I01_controlbar_icon_more.png", NULL, __more_cb, this); + if (!m_more_button) { + BROWSER_LOGE("elm_toolbar_item_append failed"); + return NULL; + } + + m_multi_window_button = elm_toolbar_item_append(control_bar, + BROWSER_IMAGE_DIR"/01_controlbar_icon_multiview.png", NULL, __multi_window_cb, this); + elm_toolbar_item_append(control_bar, BROWSER_IMAGE_DIR"/I01_controlbar_icon_bookmark.png", + NULL, __go_to_bookmark_cb, this); + + + m_backward_button = elm_toolbar_item_append(control_bar, + BROWSER_IMAGE_DIR"/01_controlbar_icon_back.png", NULL, __backward_cb, this); + if (!m_backward_button) { + BROWSER_LOGE("elm_toolbar_item_append failed"); + return NULL; + } + + evas_object_show(control_bar); + } + + return control_bar; +} + +/* +* Create two same url layouts similar with other browsers like android & safari. +* The one(by _create_url_layout) is in the browser scroller and +* the other(by _create_option_header_url_layout) is in the navigation bar option header. +*/ +Evas_Object *Browser_View::_create_option_header_url_layout(void) +{ + BROWSER_LOGD("[%s]", __func__); + Evas_Object *url_layout; + url_layout = elm_layout_add(m_navi_bar); + if (url_layout) { + if (!elm_layout_file_set(url_layout, BROWSER_EDJE_DIR"/browser-view-url-layout.edj", + "browser/url_layout")) { + BROWSER_LOGE("Can not set layout theme[browser/url_layout]\n"); + return NULL; + } + evas_object_size_hint_weight_set(url_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(url_layout, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_show(url_layout); + + m_option_header_url_entry_layout = elm_layout_add(m_navi_bar); + if (!m_option_header_url_entry_layout) { + BROWSER_LOGE("elm_layout_add failed"); + return NULL; + } + if (!elm_layout_file_set(m_option_header_url_entry_layout, BROWSER_EDJE_DIR"/browser-view-url-layout.edj", + "elm/browser/urlentry/default")) { + BROWSER_LOGE("Can not set layout theme[browser, urlentry, default]\n"); + return NULL; + } + elm_object_part_content_set(url_layout, "elm.swallow.url", m_option_header_url_entry_layout); + edje_object_signal_callback_add(elm_layout_edje_get(m_option_header_url_entry_layout), + "mouse,clicked,1", "elm.swallow.entry", __url_entry_clicked_cb, this); + + edje_object_signal_callback_add(elm_layout_edje_get(m_option_header_url_entry_layout), + "refresh_stop", "*", __refresh_button_clicked_cb, this); + + evas_object_show(m_option_header_url_entry_layout); + + m_option_header_url_edit_field = br_elm_url_editfield_add(m_navi_bar); + if (!m_option_header_url_edit_field) { + BROWSER_LOGE("elm_editfield_add failed"); + return NULL; + } + + elm_object_part_content_set(m_option_header_url_entry_layout, "elm.swallow.entry", m_option_header_url_edit_field); + br_elm_editfield_entry_single_line_set(m_option_header_url_edit_field, EINA_TRUE); + br_elm_editfield_eraser_set(m_option_header_url_edit_field, EINA_FALSE); + + Evas_Object *edit_field_entry = br_elm_editfield_entry_get(m_option_header_url_edit_field); + elm_entry_input_panel_layout_set(edit_field_entry, ELM_INPUT_PANEL_LAYOUT_URL); + ecore_imf_context_input_panel_event_callback_add((Ecore_IMF_Context *)elm_entry_imf_context_get(edit_field_entry), + ECORE_IMF_INPUT_PANEL_STATE_EVENT, __url_entry_imf_event_cb, this); + + evas_object_smart_callback_add(edit_field_entry, "activated", __url_entry_enter_key_cb, this); + evas_event_callback_add(evas_object_evas_get(m_option_header_url_edit_field), EVAS_CALLBACK_CANVAS_FOCUS_OUT, + __url_entry_focus_out_cb, this); + evas_object_show(m_option_header_url_edit_field); + + m_option_header_url_progressbar = elm_progressbar_add(m_navi_bar); + if (!m_option_header_url_progressbar) { + BROWSER_LOGE("elm_progressbar_add failed"); + return NULL; + } + elm_object_style_set(m_option_header_url_progressbar, "browser/loading"); + elm_object_part_content_set(m_option_header_url_entry_layout, "elm.swallow.progressbar", m_option_header_url_progressbar); + elm_progressbar_value_set(m_option_header_url_progressbar, 0); + evas_object_show(m_option_header_url_progressbar); + + m_option_header_url_progresswheel = elm_progressbar_add(m_navi_bar); + if (!m_option_header_url_progresswheel) { + BROWSER_LOGE("elm_progressbar_add failed"); + return NULL; + } + elm_object_style_set(m_option_header_url_progresswheel, "browser/loading_wheel"); + elm_progressbar_pulse(m_option_header_url_progresswheel, EINA_FALSE); + elm_object_part_content_set(m_option_header_url_entry_layout, "elm.swallow.progress", m_option_header_url_progresswheel); + evas_object_show(m_option_header_url_progresswheel); + + m_option_header_cancel_button = elm_button_add(m_navi_bar); + if (!m_option_header_cancel_button) { + BROWSER_LOGE("elm_button_add failed"); + return NULL; + } + evas_object_size_hint_weight_set(m_option_header_cancel_button, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(m_option_header_cancel_button, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_object_style_set(m_option_header_cancel_button, "text_only/style2"); + elm_object_text_set(m_option_header_cancel_button, BR_STRING_CANCEL); + elm_object_part_content_set(url_layout, "elm.swallow.cancel", m_option_header_cancel_button); + evas_object_smart_callback_add(m_option_header_cancel_button, "clicked", __cancel_button_clicked_cb, this); + evas_object_show(m_option_header_cancel_button); + + /* for jump to top. */ + evas_object_event_callback_add(url_layout, EVAS_CALLBACK_MOUSE_DOWN, __option_header_url_layout_mouse_down_cb, this); + } + + return url_layout; +} + +Evas_Object *Browser_View::_get_activated_url_entry(void) +{ + /* The edit field in option header url layout is only valid for edit. + * If the edit field in browser scroller can have focus, there is so many focus issue. + * So just make the edit field in option header editable. */ + return m_option_header_url_edit_field; +} + +void Browser_View::__url_entry_imf_event_cb(void *data, Ecore_IMF_Context *ctx, int value) +{ + BROWSER_LOGD("value=%d", value); + if (!data) + return; + + Browser_View *browser_view = (Browser_View *)data; + if (value == ECORE_IMF_INPUT_PANEL_STATE_HIDE) { + Evas_Object *edit_field_entry; + edit_field_entry = br_elm_editfield_entry_get(browser_view->_get_activated_url_entry()); + elm_object_focus_set(edit_field_entry, EINA_FALSE); + + if (browser_view->m_edit_mode != BR_URL_ENTRY_EDIT_MODE_WITH_NO_IMF + && browser_view->m_edit_mode != BR_FIND_WORD_MODE) + browser_view->_set_edit_mode(BR_NO_EDIT_MODE); + + browser_view->_set_url_entry(browser_view->get_url().c_str()); + } else if (value == ECORE_IMF_INPUT_PANEL_STATE_SHOW) + /* If the focus of url entry is set automatically, the keypad is also displayed automatically. */ + /* eg. At url edit mode, lock the screen -> then unlock, the url entry will get focus. */ + /* The keypad is also invoked, so set the edit mode. */ + browser_view->_set_edit_mode(BR_URL_ENTRY_EDIT_MODE); +} + +void Browser_View::__url_entry_focus_out_cb(void *data, Evas *e, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_View *browser_view = (Browser_View *)data; + Evas_Object *edit_field_entry; + edit_field_entry = br_elm_editfield_entry_get(browser_view->_get_activated_url_entry()); + + Ecore_IMF_Context *ic = (Ecore_IMF_Context *)elm_entry_imf_context_get(edit_field_entry); + if (!ic) + return; + + ecore_imf_context_input_panel_hide(ic); + + if (browser_view->m_edit_mode != BR_FIND_WORD_MODE) + browser_view->_set_edit_mode(BR_NO_EDIT_MODE); +} + +void Browser_View::_set_edit_mode(edit_mode mode) +{ + BROWSER_LOGD("mode = %d", mode); + + if (m_edit_mode == mode) + return; + + m_context_menu->destroy_context_popup(); + m_picker_handler->destroy_picker_layout(); + + if (mode == BR_URL_ENTRY_EDIT_MODE || mode == BR_FIND_WORD_MODE + || mode == BR_URL_ENTRY_EDIT_MODE_WITH_NO_IMF) { + /* If edit mode, lock the browser scroller */ + _enable_webview_scroll(); + + /* Make the browser scroller region y = 0 to show url bar all at edit mode. */ + int scroller_x = 0; + int scroller_w = 0; + int scroller_h = 0; + elm_scroller_region_get(m_scroller, &scroller_x, NULL, &scroller_w, &scroller_h); + elm_scroller_region_show(m_scroller ,scroller_x, 0, scroller_w, scroller_h); + } + + if (mode == BR_URL_ENTRY_EDIT_MODE) { + /* change layout of url layout for edit mode. */ + edje_object_signal_emit(elm_layout_edje_get(m_url_layout), "edit,url,on,signal", ""); + edje_object_signal_emit(elm_layout_edje_get(m_option_header_url_layout), + "edit,url,on,signal", ""); + + /* change refresh icon in url entry for edit mode. */ + edje_object_signal_emit(elm_layout_edje_get(m_url_entry_layout), "edit,url,on,signal", ""); + edje_object_signal_emit(elm_layout_edje_get(m_option_header_url_entry_layout), + "edit,url,on,signal", ""); + + edje_object_signal_emit(elm_layout_edje_get(m_url_entry_layout), "hide,favicon,signal", ""); + edje_object_signal_emit(elm_layout_edje_get(m_option_header_url_entry_layout), + "hide,favicon,signal", ""); + + edje_object_signal_emit(elm_layout_edje_get(m_url_entry_layout), "rss,off,signal", ""); + edje_object_signal_emit(elm_layout_edje_get(m_option_header_url_entry_layout), + "rss,off,signal", ""); + + /* change the browser main view layout for edit mode. + * Display content dim*/ + edje_object_signal_emit(elm_layout_edje_get(m_main_layout), + "edit,url,on,signal", ""); + if (m_predictive_history) + delete m_predictive_history; + m_predictive_history = new(nothrow) Browser_Predictive_History(m_navi_bar, + m_data_manager->get_history_db(), this); + if (!m_predictive_history) { + BROWSER_LOGE("new Browser_Predictive_History failed"); + return; + } + Evas_Object *predictive_history_layout = m_predictive_history->create_predictive_history_layout(); + if (!predictive_history_layout) { + BROWSER_LOGE("create_predictive_history_layout failed"); + delete m_predictive_history; + m_predictive_history = NULL; + return; + } + + /* Becaue of predictive hisotry. */ + Evas_Object *edit_field_entry = br_elm_editfield_entry_get(_get_activated_url_entry()); + evas_object_smart_callback_del(edit_field_entry, "changed", __url_entry_changed_cb); + evas_object_smart_callback_add(edit_field_entry, "changed", __url_entry_changed_cb, this); + + elm_object_part_content_set(m_main_layout, "elm.swallow.predictive_history", predictive_history_layout); + } else if (mode == BR_NO_EDIT_MODE || mode == BR_URL_ENTRY_EDIT_MODE_WITH_NO_IMF) { + if (m_edit_mode == BR_FIND_WORD_MODE) { + edje_object_signal_emit(elm_layout_edje_get(m_option_header_layout), "hide,find_word_layout,signal", ""); + m_find_word->deinit(); + } else { + /* change layout of url layout for normal mode. */ + edje_object_signal_emit(elm_layout_edje_get(m_url_layout), "edit,url,off,signal", ""); + edje_object_signal_emit(elm_layout_edje_get(m_option_header_url_layout), + "edit,url,off,signal", ""); + + /* change refresh icon in url entry for normal mode. */ + edje_object_signal_emit(elm_layout_edje_get(m_url_entry_layout), "edit,url,off,signal", ""); + edje_object_signal_emit(elm_layout_edje_get(m_option_header_url_entry_layout), + "edit,url,off,signal", ""); + + if (m_focused_window->m_favicon) + edje_object_signal_emit(elm_layout_edje_get(m_url_entry_layout), + "show,favicon,signal", ""); + if (m_focused_window->m_option_header_favicon) + edje_object_signal_emit(elm_layout_edje_get(m_option_header_url_entry_layout), + "show,favicon,signal", ""); + + /* change the browser main view layout for normal mode. + * Hide content dim */ + edje_object_signal_emit(elm_layout_edje_get(m_main_layout), + "edit,url,off,signal", ""); + + if (_is_loading()) { + edje_object_signal_emit(elm_layout_edje_get(m_url_entry_layout), "loading,on,signal", ""); + edje_object_signal_emit(elm_layout_edje_get(m_option_header_url_entry_layout), + "loading,on,signal", ""); + } + + Evas_Object *edit_field_entry = br_elm_editfield_entry_get(_get_activated_url_entry()); + /* Becaue of predictive hisotry. */ + evas_object_smart_callback_del(edit_field_entry, "changed", __url_entry_changed_cb); + edje_object_signal_emit(elm_layout_edje_get(m_main_layout), "hide,predictive_history,signal", ""); + elm_object_part_content_unset(m_main_layout, "elm.swallow.predictive_history"); + if (m_predictive_history) { + delete m_predictive_history; + m_predictive_history = NULL; + } + } + } else if (mode == BR_FIND_WORD_MODE) { + edje_object_signal_emit(elm_layout_edje_get(m_option_header_layout), "show,find_word_layout,signal", ""); + } + + m_edit_mode = mode; + + /* To show favicon, if click url entry while loading, then cancel case. */ + _set_favicon(); +} + +void Browser_View::__url_entry_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_View *browser_view = (Browser_View *)data; + + if (browser_view->_is_loading()) + browser_view->_stop_loading(); + + if (!browser_view->_navigationbar_visible_get()) { + /* The edit field in option header is only for edit url. */ + browser_view->_navigationbar_visible_set_signal(EINA_TRUE); + } + + edit_mode mode = browser_view->_get_edit_mode(); + + browser_view->_set_edit_mode(BR_URL_ENTRY_EDIT_MODE); + + if (mode == BR_NO_EDIT_MODE) { + elm_object_focus_set(browser_view->m_option_header_url_edit_field, EINA_TRUE); + + Evas_Object *entry = br_elm_editfield_entry_get(browser_view->m_option_header_url_edit_field); + elm_entry_cursor_end_set(entry); + } +} + +Eina_Bool Browser_View::_is_option_header_expanded(void) +{ + return _navigationbar_visible_get(); +} + +void Browser_View::__cancel_button_clicked_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_View *browser_view = (Browser_View *)data; + Evas_Object *ewk_view = browser_view->m_focused_window->m_ewk_view; + if (!ewk_view) + return; + + browser_view->_set_edit_mode(BR_NO_EDIT_MODE); + + browser_view->_set_url_entry(browser_view->get_url().c_str()); +} + +void Browser_View::__refresh_button_clicked_cb(void *data, Evas_Object *obj, + const char *emission, const char *source) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_View *browser_view = (Browser_View *)data; + if (browser_view->_get_edit_mode() == BR_URL_ENTRY_EDIT_MODE) { + elm_entry_entry_set(br_elm_editfield_entry_get(browser_view->m_url_edit_field), ""); + elm_entry_entry_set(br_elm_editfield_entry_get(browser_view->m_option_header_url_edit_field), ""); + } else if(browser_view->_is_loading()) + browser_view->_stop_loading(); + else + browser_view->_reload(); +} + +void Browser_View::__url_entry_enter_key_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_View *browser_view = (Browser_View *)data; + Evas_Object *ewk_view = browser_view->m_focused_window->m_ewk_view; + Evas_Object *edit_field_entry; + edit_field_entry = br_elm_editfield_entry_get(browser_view->_get_activated_url_entry()); + + /* Workaround. + * Give focus to option header cancel button to hide imf. */ + elm_object_focus_set(browser_view->m_option_header_cancel_button, EINA_TRUE); + + char *url = elm_entry_markup_to_utf8(elm_entry_entry_get(edit_field_entry)); + BROWSER_LOGD("input url = [%s]", url); + + if (url && strlen(url)) { + browser_view->load_url(url); + free(url); + } +} + +void Browser_View::__url_entry_changed_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + Browser_View *browser_view = (Browser_View *)data; + + Evas_Object *entry = br_elm_editfield_entry_get(browser_view->_get_activated_url_entry()); + const char *input_text = elm_entry_entry_get(entry); + BROWSER_LOGD("[%s]", input_text); + if (browser_view->m_predictive_history) + browser_view->m_predictive_history->url_changed(input_text); +} + +void Browser_View::__url_layout_mouse_down_cb(void *data, Evas* evas, Evas_Object *obj, + void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_View *browser_view = (Browser_View *)data; + edit_mode mode = browser_view->_get_edit_mode(); + if (mode == BR_URL_ENTRY_EDIT_MODE || mode == BR_FIND_WORD_MODE + || mode == BR_URL_ENTRY_EDIT_MODE_WITH_NO_IMF) { + BROWSER_LOGD("<< lock browser scroller >>"); + elm_object_scroll_freeze_pop(browser_view->m_scroller); + elm_object_scroll_freeze_push(browser_view->m_scroller); + } +} + +void Browser_View::__option_header_url_layout_mouse_down_cb(void *data, Evas* evas, Evas_Object *obj, + void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + Evas_Event_Mouse_Down event = *(Evas_Event_Mouse_Down *)event_info; + Browser_View *browser_view = (Browser_View *)data; + + int jump_y = 0; + evas_object_geometry_get(browser_view->m_option_header_cancel_button, NULL, &jump_y, + NULL, NULL); + if (event.output.y < jump_y) + browser_view->_jump_to_top(); +} + +Evas_Object *Browser_View::_create_url_layout(void) +{ + BROWSER_LOGD("[%s]", __func__); + Evas_Object *url_layout; + url_layout = elm_layout_add(m_navi_bar); + if (url_layout) { + if (!elm_layout_file_set(url_layout, BROWSER_EDJE_DIR"/browser-view-url-layout.edj", + "browser/url_layout")) { + BROWSER_LOGE("Can not set layout theme[browser/url_layout]\n"); + return NULL; + } + evas_object_size_hint_weight_set(url_layout, EVAS_HINT_EXPAND, 0.0); + evas_object_size_hint_align_set(url_layout, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_show(url_layout); + + /* create url entry layout in url layout */ + m_url_entry_layout = elm_layout_add(m_navi_bar); + if (!m_url_entry_layout) { + BROWSER_LOGE("elm_layout_add failed"); + return NULL; + } + if (!elm_layout_file_set(m_url_entry_layout, BROWSER_EDJE_DIR"/browser-view-url-layout.edj", + "elm/browser/urlentry/default")) { + BROWSER_LOGE("Can not set layout theme[browser, urlentry, default]\n"); + return NULL; + } + elm_object_part_content_set(url_layout, "elm.swallow.url", m_url_entry_layout); + evas_object_show(m_url_entry_layout); + + m_url_edit_field = br_elm_url_editfield_add(m_navi_bar); + if (!m_url_edit_field) { + BROWSER_LOGE("elm_editfield_add failed"); + return NULL; + } + elm_object_part_content_set(m_url_entry_layout, "elm.swallow.entry", m_url_edit_field); + br_elm_editfield_entry_single_line_set(m_url_edit_field, EINA_TRUE); + br_elm_editfield_eraser_set(m_url_edit_field, EINA_FALSE); + + Evas_Object *edit_field_entry = br_elm_editfield_entry_get(m_url_edit_field); + elm_entry_editable_set(edit_field_entry, EINA_FALSE); + /* The edit field in browser scroller is only for display. + * The edit url is only supported in option header url entry. */ + elm_object_focus_allow_set(m_url_edit_field, EINA_FALSE); + elm_object_focus_allow_set(edit_field_entry, EINA_FALSE); + elm_entry_input_panel_enabled_set(edit_field_entry, EINA_FALSE); + evas_object_show(m_url_edit_field); + + edje_object_signal_emit(elm_layout_edje_get(m_url_entry_layout), "disable_entry,signal", ""); + edje_object_signal_callback_add(elm_layout_edje_get(m_url_entry_layout), "mouse,clicked,1", "block_entry", + __url_entry_clicked_cb, this); + + edje_object_signal_callback_add(elm_layout_edje_get(m_url_entry_layout), "refresh_stop", "*", + __refresh_button_clicked_cb, this); + + m_url_progressbar = elm_progressbar_add(m_navi_bar); + if (!m_url_progressbar) { + BROWSER_LOGE("elm_progressbar_add failed"); + return NULL; + } + elm_object_style_set(m_url_progressbar, "browser/loading"); + elm_object_part_content_set(m_url_entry_layout, "elm.swallow.progressbar", m_url_progressbar); + elm_progressbar_value_set(m_url_progressbar, 0); + evas_object_show(m_url_progressbar); + + m_url_progresswheel = elm_progressbar_add(m_navi_bar); + if (!m_url_progresswheel) { + BROWSER_LOGE("elm_progressbar_add failed"); + return NULL; + } + elm_object_style_set(m_url_progresswheel, "browser/loading_wheel"); + elm_progressbar_pulse(m_url_progresswheel, EINA_FALSE); + elm_object_part_content_set(m_url_entry_layout, "elm.swallow.progress", m_url_progresswheel); + evas_object_show(m_url_progresswheel); + + m_cancel_button = elm_button_add(m_navi_bar); + if (!m_cancel_button) { + BROWSER_LOGE("elm_button_add failed"); + return NULL; + } + evas_object_size_hint_weight_set(m_cancel_button, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(m_cancel_button, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_object_style_set(m_cancel_button, "text_only/style2"); + elm_object_text_set(m_cancel_button, BR_STRING_CANCEL); + elm_object_part_content_set(url_layout, "elm.swallow.cancel", m_cancel_button); + evas_object_smart_callback_add(m_cancel_button, "clicked", __cancel_button_clicked_cb, this); + evas_object_show(m_cancel_button); + + /* Workaround. + * When edit mode, if scroll down on url layout in browser view, + * the browser can be scrolled even though scroll locked. + * So, lock the browser scroller whenever touch on it if edit mode. + */ + evas_object_event_callback_add(url_layout, EVAS_CALLBACK_MOUSE_DOWN, __url_layout_mouse_down_cb, this); + } + + return url_layout; +} + +Eina_Bool Browser_View::_search_keyword_from_search_engine(const char *keyword) +{ + BROWSER_LOGD("[%s]", __func__); + if (!keyword || !strlen(keyword)) { + BROWSER_LOGE("keyword is null"); + return EINA_FALSE; + } + + Eina_Bool only_has_space = EINA_FALSE; + int space_count = 0; + for (int i = 0 ; i < strlen(keyword) ; i++) { + if (keyword[i] == ' ') + space_count++; + } + if (space_count == strlen(keyword)) + only_has_space = EINA_TRUE; + + if (only_has_space) { + BROWSER_LOGE("keyword has only spaces"); + return EINA_FALSE; + } + + char *search_engine = vconf_get_str(BROWSER_SEARCH_ENGINE_KEY); + if (!search_engine) { + search_engine = strdup(BROWSER_GOOGLE); + if (!search_engine) { + BROWSER_LOGE("strdup failed"); + return EINA_FALSE; + } + } + + std::string search_url_prefix; + if (!strncmp(search_engine, BROWSER_GOOGLE, strlen(BROWSER_GOOGLE))) + search_url_prefix = std::string(BROWSER_SEARCH_URL_GOOGLE); + else if (!strncmp(search_engine, BROWSER_YAHOO, strlen(BROWSER_YAHOO))) + search_url_prefix = std::string(BROWSER_SEARCH_URL_YAHOO); + + if (search_url_prefix.empty()) { + BROWSER_LOGE("search_url_prefix is empty"); + return EINA_FALSE; + } + + std::string search_url = search_url_prefix + std::string(keyword); + load_url(search_url.c_str()); + + return EINA_TRUE; +} + +void Browser_View::_enable_browser_scroller_scroll(void) +{ + if (!elm_webview_vertical_panning_hold_get(m_focused_window->m_ewk_view) + && !m_is_multi_touch && !_is_loading() + && !elm_webview_fixed_position_get(m_focused_window->m_ewk_view)) { + BROWSER_LOGD("<< unlock browser scroller, lock ewk view >>"); + elm_object_scroll_freeze_pop(m_scroller); + elm_webview_vertical_panning_hold_set(m_focused_window->m_ewk_view, EINA_TRUE); + } +} + +void Browser_View::_enable_webview_scroll(void) +{ +// if (elm_webview_vertical_panning_hold_get(m_focused_window->m_ewk_view)) + { +// BROWSER_LOGD("<< lock browser scroller, unlock ewk view >>"); + elm_object_scroll_freeze_pop(m_scroller); + elm_object_scroll_freeze_push(m_scroller); + elm_webview_vertical_panning_hold_set(m_focused_window->m_ewk_view, EINA_FALSE); + } +} + +void Browser_View::_navigationbar_title_clicked(void) +{ + BROWSER_LOGD("[%s]", __func__); + Elm_Object_Item *top_it = elm_naviframe_top_item_get(m_navi_bar); + Evas_Object *content = elm_object_item_content_get(top_it); + if (content != m_main_layout) + return; + + if (m_data_manager->is_in_view_stack(BR_MULTI_WINDOW_VIEW) + || m_edit_mode != BR_NO_EDIT_MODE) + return; + + int scroller_x = 0; + int scroller_y = 0; + int scroller_w = 0; + int scroller_h = 0; + elm_scroller_region_get(m_scroller, &scroller_x, &scroller_y, &scroller_w, &scroller_h); + + if (scroller_y == 0) { + /* scroller is on top, the url bar in scroller is fully being displayed. + * Then, just show/hide the tool bar. */ + const char* state = edje_object_part_state_get(elm_layout_edje_get(m_main_layout), + "elm.swallow.control_bar", NULL); + if(state && !strncmp(state, "default", strlen("default"))) + edje_object_signal_emit(elm_layout_edje_get(m_main_layout), "show,control_bar,signal", ""); + else { + int url_layout_h = 0; + evas_object_geometry_get(m_url_layout, NULL, NULL, NULL, &url_layout_h); + elm_scroller_region_bring_in(m_scroller ,scroller_x, url_layout_h, scroller_w, scroller_h); + } + } else { + if (_is_loading()) { + } else { + Eina_Bool visible = _navigationbar_visible_get(); + _navigationbar_visible_set(!visible); + } + } +} + +void Browser_View::_jump_to_top(void) +{ + BROWSER_LOGD("[%s]", __func__); + Elm_Object_Item *top_it = elm_naviframe_top_item_get(m_navi_bar); + Evas_Object *content = elm_object_item_content_get(top_it); + if (content != m_main_layout) + return; + + if (m_data_manager->is_in_view_stack(BR_MULTI_WINDOW_VIEW) + || m_edit_mode != BR_NO_EDIT_MODE) + return; + + int browser_scroller_x = 0; + int browser_scroller_w = 0; + int browser_scroller_h = 0; + elm_scroller_region_get(m_scroller, &browser_scroller_x, NULL, + &browser_scroller_w, &browser_scroller_h); + elm_scroller_region_show(m_scroller, browser_scroller_x, 0, browser_scroller_w, browser_scroller_h); + + Evas_Object *webkit = elm_webview_webkit_get(m_focused_window->m_ewk_view); + int frame_x = 0; + int frame_y = 0; + if (!ewk_frame_scroll_pos_get(ewk_view_frame_main_get(webkit), &frame_x, &frame_y)) + BROWSER_LOGE("_scroll_pos_get is failed.\n"); + if (!ewk_frame_scroll_set(ewk_view_frame_main_get(webkit), frame_x, 0)) + BROWSER_LOGE("ewk_frame_scroll_set is failed.\n"); +} + +void Browser_View::delete_non_user_created_windows(void) +{ + BROWSER_LOGD("[%s]", __func__); + /* Delete no-backward history window. */ + std::vector<Browser_Window *> window_list = m_browser->get_window_list(); + int window_count = window_list.size(); + + if (window_count <= 1) + return; + + Browser_Window *focusable_window = NULL; + int i = 0; + for (i = 0 ; i < window_count ; i++) { + if (window_list[i]->m_ewk_view && window_list[i]->m_created_by_user == EINA_TRUE) { + focusable_window = window_list[i]; + break; + } + } + + if (!focusable_window) + focusable_window = window_list[0]; + + for (i = 0 ; i < window_count ; i++) { + BROWSER_LOGD("focusable_window = %d, window[%d]=%d", focusable_window, i, window_list[i]); + if (window_list[i]->m_ewk_view + &&!ewk_view_back_possible(elm_webview_webkit_get(window_list[i]->m_ewk_view)) + && window_list[i] != focusable_window + && window_list[i]->m_created_by_user == EINA_FALSE) { + BROWSER_LOGD("delete window index=[%d]", i); + m_browser->set_focused_window(focusable_window); + m_browser->delete_window(window_list[i]); + + /* Set title & url with the focused window. */ + _set_navigationbar_title(get_title().c_str()); + _set_url_entry(get_url().c_str()); + _set_controlbar_back_forward_status(); + if (!_set_favicon()) + BROWSER_LOGE("_set_favicon failed"); + } + } +} + +void Browser_View::__title_back_button_clicked_cb(void *data , Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + if (m_data_manager->is_in_view_stack(BR_MULTI_WINDOW_VIEW)) { + BROWSER_LOGD("close multi window"); + m_data_manager->get_multi_window_view()->close_multi_window(); + return; + } + + Browser_View *browser_view = (Browser_View *)data; + + if (browser_view->m_focused_window->m_ewk_view + && ewk_view_back_possible(elm_webview_webkit_get(browser_view->m_focused_window->m_ewk_view))) { + if (!ewk_view_back(elm_webview_webkit_get(browser_view->m_focused_window->m_ewk_view))) + BROWSER_LOGE("ewk_view_back failed"); + } else + { + if (browser_view->m_focused_window->m_parent) { + /* Save current window pointer to delete later. */ + Browser_Window *delete_window = browser_view->m_focused_window; + browser_view->m_browser->set_focused_window(browser_view->m_focused_window->m_parent); + browser_view->m_browser->delete_window(delete_window); + + /* Set title & url with the focused window. */ + browser_view->_set_navigationbar_title(browser_view->get_title().c_str()); + browser_view->_set_url_entry(browser_view->get_url().c_str()); + browser_view->_set_controlbar_back_forward_status(); + if (!browser_view->_set_favicon()) + BROWSER_LOGE("_set_favicon failed"); + } else { + elm_win_lower(browser_view->m_win); + + browser_view->delete_non_user_created_windows(); + } + } +} + +void Browser_View::__scroller_scroll_cb(void *data, Evas_Object *obj, void *event_info) +{ + if (!data) + return; + + Browser_View *browser_view = (Browser_View *)data; + + int browser_scroller_x = 0; + int browser_scroller_y = 0; + int browser_scroller_w = 0; + int browser_scroller_h = 0; + elm_scroller_region_get(browser_view->m_scroller, &browser_scroller_x, &browser_scroller_y, + &browser_scroller_w, &browser_scroller_h); + + int url_layout_h = 0; + evas_object_geometry_get(browser_view->m_url_layout, NULL, NULL, NULL, &url_layout_h); + + /* Workaround. + * If user scrolls up/down near the url bar edge, the movement of scroller is not smooth. + * It's because the browser scroller region y is also bouncing. + * So if the scroller region y is bigger than the height of url bar(65 pixel), + * make the region y to url bar height by force. */ + if (browser_scroller_y > url_layout_h) { + BROWSER_LOGE("== elm_scroller_region_show / hide url bar =="); + elm_scroller_region_show(browser_view->m_scroller, browser_scroller_x, url_layout_h, + browser_scroller_w, browser_scroller_h); + } +} + +Eina_Bool Browser_View::_is_loading(void) +{ + if (!m_focused_window || !m_focused_window->m_ewk_view) + return EINA_FALSE; + + Evas_Object *webkit = elm_webview_webkit_get(m_focused_window->m_ewk_view); + if (!webkit) { + BROWSER_LOGE("elm_webview_webkit_get is failed\n"); + return EINA_FALSE; + } + double progress = ewk_view_load_progress_get(webkit); + + if (progress == 1.0f || progress < 0.05f) + return EINA_FALSE; + else + return EINA_TRUE; +} + +void Browser_View::suspend_webview(Evas_Object *webview) +{ + BROWSER_LOGD("[%s]", __func__); + + Evas_Object *webkit = elm_webview_webkit_get(webview); + ewk_view_visibility_state_set(webkit, EWK_PAGE_VISIBILITY_STATE_VISIBLE, EINA_FALSE); + ewk_view_pause_or_resume_plugins(webkit, EINA_TRUE); + ewk_view_pause_or_resume_video_audio(webkit, EINA_TRUE); + ewk_view_javascript_suspend(webkit); + ewk_view_disable_render(webkit); + ewk_view_suspend_request(webkit); +} + +void Browser_View::resume_webview(Evas_Object *webview) +{ + BROWSER_LOGD("[%s]", __func__); + + if (m_data_manager->is_in_view_stack(BR_MULTI_WINDOW_VIEW)) + return; + + Evas_Object *webkit = elm_webview_webkit_get(webview); + ewk_view_visibility_state_set(webkit, EWK_PAGE_VISIBILITY_STATE_VISIBLE, EINA_TRUE); + ewk_view_pause_or_resume_plugins(webkit, EINA_FALSE); + ewk_view_pause_or_resume_video_audio(webkit, EINA_FALSE); + ewk_view_javascript_resume(webkit); + ewk_view_enable_render(webkit); + ewk_view_resume_request(webkit); +} + +void Browser_View::pause(void) +{ + BROWSER_LOGD("[%s]", __func__); + if (_is_loading()) { + /* Because the progress wheel in url bar has about 15% cpu consumption. + * So, pause the animation when browser goes to background. It's nonsense!*/ + if (m_option_header_url_progresswheel) + elm_progressbar_pulse(m_option_header_url_progresswheel, EINA_FALSE); + if (m_url_progresswheel) + elm_progressbar_pulse(m_url_progresswheel, EINA_FALSE); + } + + ug_pause(); + + suspend_webview(m_focused_window->m_ewk_view); +} + +void Browser_View::resume(void) +{ + BROWSER_LOGD("[%s]", __func__); + if (_is_loading()) { + /* Because the progress wheel in url bar has about 15% cpu consumption. + * So, pause the animation when browser goes to background. It's nonsense! */ + if (m_option_header_url_progresswheel) + elm_progressbar_pulse(m_option_header_url_progresswheel, EINA_TRUE); + if (m_url_progresswheel) + elm_progressbar_pulse(m_url_progresswheel, EINA_TRUE); + } + + ug_resume(); + + resume_webview(m_focused_window->m_ewk_view); +} + +void Browser_View::reset(void) +{ + BROWSER_LOGD("[%s]", __func__); + if (m_focused_window && m_focused_window->m_ewk_view) + resume(); +} + +Eina_Bool Browser_View::__webview_layout_resize_idler_cb(void *data) +{ + BROWSER_LOGD("\n"); + if (!data) + return ECORE_CALLBACK_CANCEL; + + Browser_View *browser_view = (Browser_View *)data; + + int content_w = 0; + int content_h = 0; + edje_object_part_geometry_get(elm_layout_edje_get(browser_view->m_main_layout), + "elm.swallow.content", NULL, NULL, &content_w, &content_h); + evas_object_size_hint_min_set(browser_view->m_focused_window->m_ewk_view, + content_w, content_h); + evas_object_resize(browser_view->m_focused_window->m_ewk_view, + content_w, content_h); + + /* + * For the first time, the background color is white initially. + * If the background is not displayed yet, show the grey background. + * This code is executed only one time at launching time. + */ + const char* state = edje_object_part_state_get(elm_layout_edje_get(browser_view->m_main_layout), + "contents_bg", NULL); + if(state && !strncmp(state, "default", strlen("default"))) + edje_object_signal_emit(elm_layout_edje_get(browser_view->m_main_layout), + "show,grey_background,signal", ""); + + return ECORE_CALLBACK_CANCEL; +} + +Eina_Bool Browser_View::__scroller_bring_in_idler_cb(void *data) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return ECORE_CALLBACK_CANCEL; + Browser_View *browser_view = (Browser_View *)data; + + int url_layout_h = 0; + evas_object_geometry_get(browser_view->m_url_layout, NULL, NULL, NULL, &url_layout_h); + + BROWSER_LOGD("<< elm_scroller_region_bring_in , url_layout_h=%d >>", url_layout_h); + int browser_scroller_x = 0; + int browser_scroller_w = 0; + int browser_scroller_h = 0; + elm_scroller_region_get(browser_view->m_scroller, &browser_scroller_x, NULL, + &browser_scroller_w, &browser_scroller_h); + elm_scroller_region_show(browser_view->m_scroller, browser_scroller_x, url_layout_h, + browser_scroller_w, browser_scroller_h); + + return ECORE_CALLBACK_CANCEL; +} + +/* Workaround. + * If user invokes the keypad via input field or url entry, resize the webview. + * The only scroller resize is called when the keypad is launched. + * Other elements like layout, conformant resize event doesn't come. */ +void Browser_View::__scoller_resize_cb(void* data, Evas* evas, Evas_Object* obj, void* ev) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_View *browser_view = (Browser_View *)data; + + int scroller_w = 0; + int scroller_h = 0; + evas_object_geometry_get(browser_view->m_scroller, NULL, NULL, &scroller_w, &scroller_h); + if (browser_view->m_focused_window && browser_view->m_focused_window->m_ewk_view) { + evas_object_size_hint_min_set(browser_view->m_focused_window->m_ewk_view, + scroller_w, scroller_h); + evas_object_resize(browser_view->m_focused_window->m_ewk_view, + scroller_w, scroller_h); + } + + Evas_Object *edit_field_entry; + edit_field_entry = br_elm_editfield_entry_get(browser_view->_get_activated_url_entry()); + Ecore_IMF_Context *ic = (Ecore_IMF_Context *)elm_entry_imf_context_get(edit_field_entry); + /* If the keypad from webkit is invoked in landscape mode, the visible viewport is too narrow. + * So, hide the url bar in browser scroller by bring in. + * The direct bring in call doesn't work, so do it by idler. */ + if (ic && browser_view->is_landscape()) { + Ecore_IMF_Input_Panel_State imf_state = ecore_imf_context_input_panel_state_get(ic); + /* Strangley, The state of webkit's imf is show-state even if the ic is url entry. + * However, this is good for browser without webkit's ic get API. */ + if (imf_state == ECORE_IMF_INPUT_PANEL_STATE_SHOW) { + browser_view->_enable_browser_scroller_scroll(); + ecore_idler_add(__scroller_bring_in_idler_cb, browser_view); + } + } +} + +Eina_Bool Browser_View::__zoom_button_timeout_cb(void *data) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return ECORE_CALLBACK_CANCEL; + + Browser_View *browser_view = (Browser_View *)data; + browser_view->m_zoom_button_timer = NULL; + + edje_object_signal_emit(elm_layout_edje_get(browser_view->m_main_layout), "hide,zoom_buttons,signal", ""); + + return ECORE_CALLBACK_CANCEL; +} + +void Browser_View::__zoom_out_clicked_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_View *browser_view = (Browser_View *)data; + + Evas_Object *webkit = elm_webview_webkit_get(browser_view->m_focused_window->m_ewk_view); + float current_zoom_rate = ewk_view_zoom_get(webkit); + ewk_view_zoom_set(webkit, current_zoom_rate - 0.5f, 0, 0); + + if (browser_view->m_zoom_button_timer) + ecore_timer_del(browser_view->m_zoom_button_timer); + browser_view->m_zoom_button_timer = ecore_timer_add(3, __zoom_button_timeout_cb, browser_view); + + current_zoom_rate = ewk_view_zoom_get(webkit); + float max_zoom_rate = ewk_view_zoom_range_max_get(webkit); + float min_zoom_rate = ewk_view_zoom_range_min_get(webkit); + + Eina_Bool can_zoom_in = EINA_TRUE; + Eina_Bool can_zoom_out = EINA_TRUE; + if (current_zoom_rate >= max_zoom_rate) + can_zoom_in = EINA_FALSE; + if (current_zoom_rate <= min_zoom_rate) + can_zoom_out = EINA_FALSE; + + if (!can_zoom_in) + elm_object_disabled_set(browser_view->m_zoom_in_button ,EINA_TRUE); + else + elm_object_disabled_set(browser_view->m_zoom_in_button ,EINA_FALSE); + + if (!can_zoom_out) + elm_object_disabled_set(browser_view->m_zoom_out_button ,EINA_TRUE); + else + elm_object_disabled_set(browser_view->m_zoom_out_button ,EINA_FALSE); +} + +void Browser_View::__zoom_in_clicked_cb(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_View *browser_view = (Browser_View *)data; + + Evas_Object *webkit = elm_webview_webkit_get(browser_view->m_focused_window->m_ewk_view); + float current_zoom_rate = ewk_view_zoom_get(webkit); + ewk_view_zoom_set(webkit, current_zoom_rate + 0.5f, 0, 0); + + if (browser_view->m_zoom_button_timer) + ecore_timer_del(browser_view->m_zoom_button_timer); + browser_view->m_zoom_button_timer = ecore_timer_add(3, __zoom_button_timeout_cb, browser_view); + + current_zoom_rate = ewk_view_zoom_get(webkit); + float max_zoom_rate = ewk_view_zoom_range_max_get(webkit); + float min_zoom_rate = ewk_view_zoom_range_min_get(webkit); + + Eina_Bool can_zoom_in = EINA_TRUE; + Eina_Bool can_zoom_out = EINA_TRUE; + if (current_zoom_rate >= max_zoom_rate) + can_zoom_in = EINA_FALSE; + if (current_zoom_rate <= min_zoom_rate) + can_zoom_out = EINA_FALSE; + + if (!can_zoom_in) + elm_object_disabled_set(browser_view->m_zoom_in_button ,EINA_TRUE); + else + elm_object_disabled_set(browser_view->m_zoom_in_button ,EINA_FALSE); + + if (!can_zoom_out) + elm_object_disabled_set(browser_view->m_zoom_out_button ,EINA_TRUE); + else + elm_object_disabled_set(browser_view->m_zoom_out_button ,EINA_FALSE); +} + +Eina_Bool Browser_View::_create_zoom_buttons(void) +{ + BROWSER_LOGD("[%s]", __func__); + m_zoom_out_button = elm_button_add(m_navi_bar); + if (!m_zoom_out_button) { + BROWSER_LOGE("elm_button_add failed"); + return EINA_FALSE; + } + elm_object_style_set(m_zoom_out_button, "browser/zoom_out"); + elm_object_part_content_set(m_main_layout, "elm.swallow.zoom_out_button", m_zoom_out_button); + evas_object_smart_callback_add(m_zoom_out_button, "clicked", __zoom_out_clicked_cb, this); + evas_object_show(m_zoom_out_button); + + m_zoom_in_button = elm_button_add(m_navi_bar); + if (!m_zoom_in_button) { + BROWSER_LOGE("elm_button_add failed"); + return EINA_FALSE; + } + + elm_object_style_set(m_zoom_in_button, "browser/zoom_in"); + elm_object_part_content_set(m_main_layout, "elm.swallow.zoom_in_button", m_zoom_in_button); + evas_object_smart_callback_add(m_zoom_in_button, "clicked", __zoom_in_clicked_cb, this); + evas_object_show(m_zoom_in_button); + + return EINA_TRUE; +} +void Browser_View::__naviframe_pop_finished_cb(void *data , Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_View *browser_view = (Browser_View *)data; + Elm_Object_Item *it = (Elm_Object_Item *)event_info; + + if (browser_view->m_navi_it != elm_naviframe_top_item_get(m_navi_bar)) { + browser_view->suspend_webview(browser_view->m_focused_window->m_ewk_view); + return; + } + + m_data_manager->destroy_bookmark_view(); + m_data_manager->destroy_history_layout(); + /* Add to bookmark, then cancel. */ + m_data_manager->destroy_add_to_bookmark_view(); + + /* If return from browser settings. */ + if (browser_view->m_browser_settings) { + delete browser_view->m_browser_settings; + browser_view->m_browser_settings = NULL; + } + + browser_view->resume_webview(browser_view->m_focused_window->m_ewk_view); +} + +void Browser_View::__dim_area_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_View *browser_view = (Browser_View *)data; + + elm_object_focus_set(m_data_manager->get_browser_view()->m_option_header_cancel_button, EINA_TRUE); +} + +Eina_Bool Browser_View::_create_main_layout(void) +{ + BROWSER_LOGD("[%s]", __func__); + m_main_layout = elm_layout_add(m_navi_bar); + if (!m_main_layout) { + BROWSER_LOGE("elm_layout_add failed!"); + return EINA_FALSE; + } + + if (!elm_layout_file_set(m_main_layout, BROWSER_EDJE_DIR"/browser-view-main.edj", + "browser/browser-view-main")) { + BROWSER_LOGE("elm_layout_file_set failed", BROWSER_EDJE_DIR); + return EINA_FALSE; + } + + evas_object_size_hint_weight_set(m_main_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(m_main_layout, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_show(m_main_layout); + + m_title_back_button = elm_button_add(m_navi_bar); + if (!m_title_back_button) { + BROWSER_LOGE("elm_button_add failed!"); + return EINA_FALSE; + } + evas_object_smart_callback_add(m_title_back_button, "clicked", __title_back_button_clicked_cb, this); + + m_navi_it = elm_naviframe_item_push(m_navi_bar, "", NULL, NULL, m_main_layout, NULL); + + evas_object_smart_callback_add(m_navi_bar, "transition,finished", __naviframe_pop_finished_cb, this); + + elm_object_style_set(m_title_back_button, "browser/title_back"); + elm_object_item_part_content_set(m_navi_it, ELM_NAVIFRAME_ITEM_TITLE_LEFT_BTN, m_title_back_button); + + evas_object_show(m_title_back_button); + evas_object_show(m_navi_bar); + + m_scroller = elm_scroller_add(m_navi_bar); + if (!m_scroller) { + BROWSER_LOGE("elm_scroller_add failed!"); + return EINA_FALSE; + } + /* Do not propagate event to scroller's ancestor */ + /* not to call unnecessary other callbacks. */ + evas_object_propagate_events_set(m_scroller, EINA_FALSE); + + /* Do not use scroller's scrollbar, use webview's scrollbar instead */ + elm_scroller_policy_set(m_scroller, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF); + evas_object_size_hint_align_set(m_scroller, EVAS_HINT_FILL, 0.0); + evas_object_size_hint_weight_set(m_scroller, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + + elm_scroller_bounce_set(m_scroller, EINA_FALSE, EINA_FALSE); + + evas_object_show(m_scroller); + + evas_object_smart_callback_add(m_scroller, "scroll", __scroller_scroll_cb, this); + evas_object_event_callback_add(m_scroller, EVAS_CALLBACK_RESIZE, __scoller_resize_cb, this); + evas_object_smart_callback_add(m_scroller, "edge,bottom", __scroller_edge_bottom_cb, this); + + /* create content box which contains navigation layout & webview */ + m_content_box = elm_box_add(m_main_layout); + if (!m_content_box) { + BROWSER_LOGE("elm_box_add failed!"); + return EINA_FALSE; + } + + elm_box_horizontal_set(m_content_box, EINA_FALSE); + evas_object_size_hint_weight_set(m_content_box, EVAS_HINT_EXPAND, 0.0); + evas_object_size_hint_align_set(m_content_box, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_object_content_set(m_scroller, m_content_box); + evas_object_show(m_content_box); + + /* create dummy loading progress bar which is displayed at launching time shortly */ + m_dummy_loading_progressbar = elm_progressbar_add(m_navi_bar); + if (!m_dummy_loading_progressbar) { + BROWSER_LOGE("elm_progressbar_add failed!"); + return EINA_FALSE; + } + + elm_object_style_set(m_dummy_loading_progressbar, "browser/loading_wheel"); + elm_progressbar_pulse(m_dummy_loading_progressbar, EINA_TRUE); + evas_object_size_hint_weight_set(m_dummy_loading_progressbar, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(m_dummy_loading_progressbar, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_object_part_content_set(m_main_layout, "elm.swallow.waiting_progress", m_dummy_loading_progressbar); + evas_object_show(m_dummy_loading_progressbar); + + /* create conformant */ + elm_win_conformant_set(m_win, EINA_TRUE); + m_conformant = elm_conformant_add(m_main_layout); + if (!m_conformant) { + BROWSER_LOGE("elm_conformant_add failed!"); + return EINA_FALSE; + } + + elm_object_style_set(m_conformant, "internal_layout"); + evas_object_size_hint_weight_set(m_conformant, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(m_conformant, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_object_content_set(m_conformant, m_scroller); + elm_object_part_content_set(m_main_layout, "elm.swallow.content", m_conformant); + evas_object_show(m_conformant); + + m_url_layout = _create_url_layout(); + if (!m_url_layout) { + BROWSER_LOGE("_create_url_layout failed!"); + return EINA_FALSE; + } + elm_box_pack_start(m_content_box, m_url_layout); + + m_control_bar = _create_control_bar(); + if (!m_control_bar) { + BROWSER_LOGE("_create_control_bar failed!"); + return EINA_FALSE; + } + elm_object_part_content_set(m_main_layout, "elm.swallow.control_bar", m_control_bar); + + m_option_header_url_layout = _create_option_header_url_layout(); + if (!m_option_header_url_layout) { + BROWSER_LOGE("_create_option_header_url_layout failed!"); + return EINA_FALSE; + } + + m_option_header_layout = elm_layout_add(m_navi_bar); + if (!m_option_header_layout) { + BROWSER_LOGE("elm_layout_add failed!"); + return EINA_FALSE; + } + if (!elm_layout_file_set(m_option_header_layout, BROWSER_EDJE_DIR"/browser-view-url-layout.edj", + "browser-view/option_header")) { + BROWSER_LOGE("Can not set layout theme[browser/url_layout]\n"); + return EINA_FALSE; + } + evas_object_size_hint_weight_set(m_option_header_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(m_option_header_layout, EVAS_HINT_FILL, EVAS_HINT_FILL); + + elm_object_part_content_set(m_option_header_layout, "elm.swallow.url_layout", m_option_header_url_layout); + evas_object_show(m_option_header_layout); + + Evas_Object *find_word_layout = m_find_word->get_layout(); + if (!find_word_layout) { + BROWSER_LOGE("_create_find_word_layout failed"); + return EINA_FALSE; + } + elm_object_part_content_set(m_option_header_layout, "elm.swallow.find_word_layout", find_word_layout); + + elm_object_item_part_content_set(m_navi_it, ELM_NAVIFRAME_ITEM_OPTIONHEADER, m_option_header_layout); + _navigationbar_visible_set_signal(EINA_FALSE); + + if (!_create_zoom_buttons()) { + BROWSER_LOGE("_create_zoom_buttons failed"); + return EINA_FALSE; + } + + edje_object_signal_callback_add(elm_layout_edje_get(m_main_layout), + "mouse,clicked,1", "elm.rect.content_dim", __dim_area_clicked_cb, this); + + const char *current_theme = elm_theme_get(NULL); + if (current_theme && strstr(current_theme, "white")) { + } else { + edje_object_signal_emit(elm_layout_edje_get(m_url_entry_layout), "black_theme,signal", ""); + edje_object_signal_emit(elm_layout_edje_get(m_option_header_url_entry_layout), + "black_theme,signal", ""); + } + + return EINA_TRUE; +} + diff --git a/src/browser-view/browser-view.h b/src/browser-view/browser-view.h new file mode 100755 index 00000000..23e0330f --- /dev/null +++ b/src/browser-view/browser-view.h @@ -0,0 +1,288 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef BROWSER_VIEW_H +#define BROWSER_VIEW_H + +#include "browser-common-view.h" +#include "browser-config.h" +class Browser_Bookmark_DB; +class Browser_Class; +class Browser_Context_Menu; +class Browser_Exscheme_Handler; +class Browser_Find_Word; +class Browser_Multi_Window_View; +class Browser_Personal_Data_Manager; +class Browser_Picker_Handler; +class Browser_Predictive_History; +class Browser_Settings_Class; +class Browser_Window; + +/* edit mode state check */ +typedef enum _edit_mode { + BR_NO_EDIT_MODE = 0, + BR_URL_ENTRY_EDIT_MODE, + BR_URL_ENTRY_EDIT_MODE_WITH_NO_IMF, + BR_FIND_WORD_MODE +} edit_mode; + +class Browser_View : public Browser_Common_View { + friend class Browser_Class; + friend class Browser_Context_Menu; + friend class Browser_Find_Word; + friend class Browser_Multi_Window_View; + friend class Browser_Predictive_History; +public: + Browser_View(Evas_Object *win, Evas_Object *navi_bar, Evas_Object *bg, + Evas_Object *layout, Browser_Class *browser); + ~Browser_View(void); + + Eina_Bool init(void); + void launch(const char *url); + void set_focused_window(Browser_Window *window, Eina_Bool show_most_visited_sites = EINA_TRUE); + Browser_Window *get_focused_window(void) { return m_focused_window; } + Evas_Object *get_focused_webview(void); + void load_url(const char *url); + string get_title(Browser_Window *window); + string get_title(void); + string get_url(void); + string get_url(Browser_Window *window); + void return_to_browser_view(Eina_Bool saved_most_visited_sites_item = EINA_FALSE); + void unset_navigationbar_title_object(Eina_Bool is_unset); + + void pause(void); + void resume(void); + void reset(void); + + void suspend_webview(Evas_Object *webview); + void resume_webview(Evas_Object *webview); + + void set_edit_mode(edit_mode mode) { m_edit_mode = mode; } + Evas_Object *get_favicon(const char *url); + void delete_non_user_created_windows(void); + void init_personal_data_manager(Evas_Object *webview); + void deinit_personal_data_manager(void); + Browser_Personal_Data_Manager *get_personal_data_manager(void) { return m_personal_data_manager; } + + void stop_and_reload(void); + + typedef struct _html5_video_data { + const char* path; + const char* cookie; + } html5_video_data; +private: + typedef enum _homepage_mode { + BR_START_MODE_MOST_VISITED_SITES = 0, + BR_START_MODE_RECENTLY_VISITED_SITE, + BR_START_MODE_CUSTOMIZED_URL, + BR_START_MODE_EMPTY_PAGE, + BR_START_MODE_UNKOWN + } homepage_mode; + + /* ewk view event callback functions. */ + static void __uri_changed_cb(void *data, Evas_Object *obj, void *event_info); + static void __load_started_cb(void *data, Evas_Object *obj, void *event_info); + static void __load_progress_cb(void *data, Evas_Object *obj, void *event_info); + static void __load_finished_cb(void *data, Evas_Object *obj, void *event_info); + static void __load_nonempty_layout_finished_cb(void *data, Evas_Object *obj, void *event_info); + static void __create_webview_cb(void *data, Evas_Object *obj, void *event_info); + static void __window_close_cb(void *data, Evas_Object *obj, void *event_info); + static void __html_boundary_reached_cb(void *data, Evas_Object *obj, void *event_info); + static void __html5_video_request_cb(void *data, Evas_Object *obj, void *event_info); + static void __vibrator_vibrate_cb(void *data, Evas_Object *obj, void *event_info); + static void __vibrator_cancel_cb(void *data, Evas_Object *obj, void *event_info); + + /* imf event callback functions */ + static void __url_entry_imf_event_cb(void *data, Ecore_IMF_Context *ctx, int value); + + /* edje object event callback functions */ + static void __url_entry_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source); + static void __refresh_button_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source); + + /* evas event callback functions */ + static void __url_entry_focus_out_cb(void *data, Evas *e, void *event_info); + + /* ewk view evas object event callback functions */ + static void __ewk_view_mouse_down_cb(void *data, Evas *evas, Evas_Object *obj, void *ev); + static void __ewk_view_mouse_up_cb(void *data, Evas *evas, Evas_Object *obj, void *ev); + static void __ewk_view_multi_down_cb(void *data, Evas *evas, Evas_Object *obj, void *ev); + static void __ewk_view_mouse_move_cb(void *data, Evas *evas, Evas_Object *obj, void *ev); + static void __scroller_edge_bottom_cb(void *data, Evas_Object *obj, void *event_info); + + /* idler callback functions */ + static Eina_Bool __webview_layout_resize_idler_cb(void *data); + static Eina_Bool __close_window_idler_cb(void *data); + static Eina_Bool __scroller_bring_in_idler_cb(void *data); + + /* evas object smart callback functions */ + static void __ewk_view_edge_top_cb(void *data, Evas_Object *obj, void *event_info); + static void __ewk_view_scroll_down_cb(void *data, Evas_Object *obj, void *event_info); + static void __ewk_view_scroll_up_cb(void *data, Evas_Object *obj, void *event_info); + + static void __scoller_resize_cb(void* data, Evas* evas, Evas_Object* obj, void* ev); + static void __url_layout_mouse_down_cb(void *data, Evas* evas, Evas_Object *obj, + void *event_info); + + /* elementary event callback functions */ + static void __title_back_button_clicked_cb(void *data , Evas_Object *obj, void *event_info); + static void __url_entry_enter_key_cb(void *data, Evas_Object *obj, void *event_info); + static void __cancel_button_clicked_cb(void *data, Evas_Object *obj, void *event_info); + static void __go_to_bookmark_cb(void *data, Evas_Object *obj, void *event_info); + static void __backward_cb(void *data, Evas_Object *obj, void *event_info); + static void __forward_cb(void *data, Evas_Object *obj, void *event_info); + static void __add_to_home_cb(void *data, Evas_Object *obj, void *event_info); + static void __add_bookmark_cb(void *data, Evas_Object *obj, void *event_info); + static void __multi_window_cb(void *data, Evas_Object *obj, void *event_info); + static void __more_cb(void *data, Evas_Object *obj, void *event_info); + static void __scroller_scroll_cb(void *data, Evas_Object *obj, void *event_info); + static void __download_manager_cb(void *data, Evas_Object *obj, void *event_info); + static void __more_context_popup_dismissed_cb(void *data, Evas_Object *obj, + void *event_info); + static void __url_entry_changed_cb(void *data, Evas_Object *obj, void *event_info); + static void __internet_settings_cb(void *data, Evas_Object *obj, void *event_info); + static void __find_word_cb(void *data, Evas_Object *obj, void *event_info); + + static void __zoom_in_clicked_cb(void *data, Evas_Object *obj, void *event_info); + static void __zoom_out_clicked_cb(void *data, Evas_Object *obj, void *event_info); + static Eina_Bool __zoom_button_timeout_cb(void *data); + Eina_Bool _create_zoom_buttons(void); + + static void __expand_option_header_cb(void *data, Evas_Object *obj, void *event_info); + static void __share_cb(void *data, Evas_Object *obj, void *event_info); + static void __option_header_url_layout_mouse_down_cb(void *data, Evas* evas, + Evas_Object *obj, void *event_info); + static void __add_to_home_cancel_cb(void *data, Evas_Object *obj, void *event_info); + static void __add_to_home_done_cb(void *data, Evas_Object *obj, void *event_info); + static void __add_to_send_cb(void *data, Evas_Object *obj, void *event_info); + static void __naviframe_pop_finished_cb(void *data , Evas_Object *obj, void *event_info); + static void __dim_area_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source); + + /* elm transit callback functions */ + static void __new_window_transit_finished_cb(void *data, Elm_Transit *transit); + + /* normal member functions */ + Eina_Bool _create_main_layout(void); + Evas_Object *_create_url_layout(void); + Evas_Object *_create_option_header_url_layout(void); + Evas_Object *_create_control_bar(void); + Eina_Bool _show_more_context_popup(void); + void _stop_loading(void); + void _reload(void); + void _set_navigationbar_title(const char *title); + void _set_url_entry(const char *url, Eina_Bool set_secrue_icon = EINA_TRUE); + Eina_Bool _is_option_header_expanded(void); + void _set_controlbar_back_forward_status(void); + void _navigationbar_title_clicked(void); + void _load_start(void); + void _load_finished(void); + void _set_multi_window_controlbar_text(int count); + /* get activated url entry, if the option header is expanded, return url entry in option header */ + Evas_Object *_get_activated_url_entry(void); + void _set_edit_mode(edit_mode mode); + edit_mode _get_edit_mode(void) { return m_edit_mode; } + homepage_mode _get_homepage_mode(void) { return m_homepage_mode; } + /* set homepage from homepage vconf */ + void _set_homepage_mode(void); + void _set_secure_icon(void); + Eina_Bool _set_favicon(void); + Eina_Bool _call_download_manager(void); + Eina_Bool _call_internet_settings(void); + void _pop_other_views(void); + Eina_Bool _show_new_window_effect(Evas_Object *current_ewk_view, + Evas_Object *new_ewk_view); + Eina_Bool _is_loading(void); + Eina_Bool _search_keyword_from_search_engine(const char *keyword); + Eina_Bool _call_html5_video_streaming_player(const char *url, const char *cookie); + void _destroy_more_context_popup(void); + void _enable_browser_scroller_scroll(void); + void _enable_webview_scroll(void); + void _navigationbar_visible_set_signal(Eina_Bool visible); + void _navigationbar_visible_set(Eina_Bool visible); + Eina_Bool _navigationbar_visible_get(void); + Evas_Object *_create_add_to_home_control_bar(void); + + void _jump_to_top(void); + void _hide_scroller_url_layout(void); + static Eina_Bool _activate_url_entry_idler_cb(void *data); + + Evas_Object *m_main_layout; + Evas_Object *m_scroller; + Evas_Object *m_content_box; + Evas_Object *m_dummy_loading_progressbar; + Evas_Object *m_conformant; + Evas_Object *m_title_back_button; + + /* url layout member variables */ + Evas_Object *m_url_layout; + Evas_Object *m_url_entry_layout; + Evas_Object *m_url_edit_field; + Evas_Object *m_cancel_button; + Evas_Object *m_url_progressbar; + Evas_Object *m_url_progresswheel; + + Evas_Object *m_option_header_layout; + /* url layout which is inserted to navigation bar option header member variables */ + Evas_Object *m_option_header_url_layout; + Evas_Object *m_option_header_url_entry_layout; + Evas_Object *m_option_header_url_edit_field; + Evas_Object *m_option_header_cancel_button; + Evas_Object *m_option_header_url_progressbar; + Evas_Object *m_option_header_url_progresswheel; + + /* control bar member variables */ + Evas_Object *m_control_bar; + Elm_Object_Item *m_backward_button; + Elm_Object_Item *m_forward_button; + Elm_Object_Item *m_add_bookmark_button; + Elm_Object_Item *m_more_button; + Elm_Object_Item *m_multi_window_button; + Elm_Object_Item *m_share_controlbar_button; + + Evas_Object *m_add_to_home_control_bar; + + /* state check */ + edit_mode m_edit_mode; + homepage_mode m_homepage_mode; + + Browser_Window *m_focused_window; + Eina_Bool m_is_scrolling; + int m_scroller_region_y; + Evas_Object *m_more_context_popup; + Browser_Predictive_History *m_predictive_history; + Browser_Settings_Class *m_browser_settings; + + Elm_Transit *m_new_window_transit; + Browser_Window *m_created_new_window; + + std::string m_last_visited_url; + + Elm_Object_Item *m_navi_it; + Browser_Find_Word *m_find_word; + + Eina_Bool m_is_scroll_up; + Eina_Bool m_is_multi_touch; + + Browser_Context_Menu *m_context_menu; + Browser_Exscheme_Handler *m_exscheme_handler; + Browser_Personal_Data_Manager *m_personal_data_manager; + Browser_Picker_Handler *m_picker_handler; + + Evas_Object *m_zoom_in_button; + Evas_Object *m_zoom_out_button; + Ecore_Timer *m_zoom_button_timer; +}; +#endif /* BROWSER_VIEW_H */ + diff --git a/src/browser-window.cpp b/src/browser-window.cpp new file mode 100755 index 00000000..7b50915c --- /dev/null +++ b/src/browser-window.cpp @@ -0,0 +1,46 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "browser-window.h" + +Browser_Window::Browser_Window(void) +: + m_ewk_view(NULL) + ,m_portrait_snapshot_image(NULL) + ,m_landscape_snapshot_image(NULL) + ,m_parent(NULL) + ,m_favicon(NULL) + ,m_option_header_favicon(NULL) + ,m_created_by_user(EINA_FALSE) +{ + BROWSER_LOGD("[%s]", __func__); +} + +Browser_Window::~Browser_Window(void) +{ + BROWSER_LOGD("[%s]", __func__); + if (m_ewk_view) + evas_object_del(m_ewk_view); + if (m_portrait_snapshot_image) + evas_object_del(m_portrait_snapshot_image); + if (m_landscape_snapshot_image) + evas_object_del(m_landscape_snapshot_image); + if (m_favicon) + evas_object_del(m_favicon); + if (m_option_header_favicon) + evas_object_del(m_option_header_favicon); +} + diff --git a/src/browser-window.h b/src/browser-window.h new file mode 100755 index 00000000..f09fbbec --- /dev/null +++ b/src/browser-window.h @@ -0,0 +1,47 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef BROWSER_WINODW_H +#define BROWSER_WINODW_H + +#include "browser-config.h" +#include <cairo.h> + +class Browser_Window { +public: + Browser_Window(void); + ~Browser_Window(void); + + /* Caution : m_ewk_view can be null even though the Browser_Window is not null. + * Because the m_ewk_view is destroyed and assigned to null after Browser_Class::clean_up_windows. + * So The null check is necessary at every usage. */ + Evas_Object *m_ewk_view; + + Evas_Object *m_portrait_snapshot_image; + Evas_Object *m_landscape_snapshot_image; + + /* m_parent is a Browser_Window which invoke itself by javascript etc. */ + Browser_Window *m_parent; + Evas_Object *m_favicon; + Evas_Object *m_option_header_favicon; + Eina_Bool m_created_by_user; + /* The url & title are only valid when the window is deleted + * because of unused case. (etc. low memory) */ + std::string m_url; + std::string m_title; +}; +#endif /* BROWSER_WINODW_H */ + diff --git a/src/data-network/browser-network-manager.cpp b/src/data-network/browser-network-manager.cpp new file mode 100755 index 00000000..449eef99 --- /dev/null +++ b/src/data-network/browser-network-manager.cpp @@ -0,0 +1,121 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "browser-view.h" +#include "browser-network-manager.h" + +Browser_Network_Manager::Browser_Network_Manager(void) +: m_browser_view(NULL) +{ + BROWSER_LOGD("[%s]", __func__); + int network_status = 0; + if (vconf_get_int(VCONFKEY_NETWORK_STATUS, &network_status) < 0) { + BROWSER_LOGE("vconf_get_int failed"); + } + + if (network_status == VCONFKEY_NETWORK_OFF) + ewk_network_state_notifier_online_set(EINA_FALSE); + else + ewk_network_state_notifier_online_set(EINA_TRUE); + + char *proxy = vconf_get_str(VCONFKEY_NETWORK_PROXY); + if (!proxy || !strlen(proxy) || strstr(proxy, "0.0.0.0")) { + BROWSER_LOGE("proxy address is null"); + ewk_network_proxy_uri_set(NULL); + } else { + ewk_network_proxy_uri_set(proxy); + } + + if (proxy) + free(proxy); + + if (vconf_notify_key_changed(VCONFKEY_NETWORK_CONFIGURATION_CHANGE_IND, + __network_changed_ind_cb, this) < 0) { + BROWSER_LOGE("vconf_notify_key_changed failed"); + } +} + +Browser_Network_Manager::~Browser_Network_Manager(void) +{ + BROWSER_LOGD("[%s]", __func__); + if (vconf_ignore_key_changed(VCONFKEY_NETWORK_CONFIGURATION_CHANGE_IND, + __network_changed_ind_cb) < 0) + BROWSER_LOGE("vconf_ignore_key_changed failed"); +} + +Eina_Bool Browser_Network_Manager::init(Browser_View *browser_view, Evas_Object *webview) +{ + BROWSER_LOGD("[%s]", __func__); + + m_browser_view = browser_view; + + elm_webview_scheme_callback_set(webview, "http", __connection_cb); + elm_webview_scheme_callback_set(webview, "https", __connection_cb); + + return EINA_TRUE; +} + +Eina_Bool Browser_Network_Manager::__connection_cb(Evas_Object *webview, const char *uri) +{ + BROWSER_LOGD("[%s]", __func__); + + int network_status = 0; + if (vconf_get_int(VCONFKEY_NETWORK_STATUS, &network_status) < 0) { + BROWSER_LOGE("vconf_get_int failed"); + return EINA_FALSE; + } + + return EINA_TRUE; +} + +void Browser_Network_Manager::__network_changed_ind_cb(keynode_t *keynode, void *data) +{ + BROWSER_LOGD("[%s]", __func__); + if (!data) + return; + + Browser_Network_Manager *network_manager = (Browser_Network_Manager *)data; + + int network_status = 0; + if (vconf_get_int(VCONFKEY_NETWORK_STATUS, &network_status) < 0) { + BROWSER_LOGE("vconf_get_int failed"); + return; + } + + if (network_status == VCONFKEY_NETWORK_OFF) { + BROWSER_LOGD("network off"); + ewk_network_state_notifier_online_set(EINA_FALSE); + return; + } else { + BROWSER_LOGD("network on"); + ewk_network_state_notifier_online_set(EINA_TRUE); + } + + char *proxy = vconf_get_str(VCONFKEY_NETWORK_PROXY); + if (!proxy || !strlen(proxy) || strstr(proxy, "0.0.0.0")) { + BROWSER_LOGD("proxy is null"); + ewk_network_proxy_uri_set(NULL); + } else { + BROWSER_LOGD("proxy = %s", proxy); + ewk_network_proxy_uri_set(proxy); + } + + if (proxy) + free(proxy); + + network_manager->m_browser_view->stop_and_reload(); +} + diff --git a/src/data-network/browser-network-manager.h b/src/data-network/browser-network-manager.h new file mode 100755 index 00000000..ca1f87f9 --- /dev/null +++ b/src/data-network/browser-network-manager.h @@ -0,0 +1,36 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef BROWSER_NETWORK_MANAGER_H +#define BROWSER_NETWORK_MANAGER_H + +#include "browser-config.h" + +class Browser_View; +class Browser_Network_Manager { +public: + Browser_Network_Manager(void); + ~Browser_Network_Manager(void); + + Eina_Bool init(Browser_View *browser_view, Evas_Object *webview); +private: + static void __network_changed_ind_cb(keynode_t *keynode, void *data); + static Eina_Bool __connection_cb(Evas_Object *webview, const char *uri); + + Browser_View *m_browser_view; +}; +#endif /* BROWSER_NETWORK_MANAGER_H */ + diff --git a/src/database/browser-bookmark-db.cpp b/src/database/browser-bookmark-db.cpp new file mode 100755 index 00000000..2cc775d2 --- /dev/null +++ b/src/database/browser-bookmark-db.cpp @@ -0,0 +1,901 @@ +/*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using namespace std;
+
+#include "browser-bookmark-db.h"
+
+#define BOOKMARK_NORMAL 0
+#define BOOKMARK_FOLDER 1
+
+sqlite3* Browser_Bookmark_DB::m_db_descriptor = NULL;
+
+Browser_Bookmark_DB::Browser_Bookmark_DB(void)
+{
+ BROWSER_LOGD("[%s]", __func__);
+}
+
+Browser_Bookmark_DB::~Browser_Bookmark_DB(void)
+{
+ BROWSER_LOGD("[%s]", __func__);
+}
+
+Eina_Bool Browser_Bookmark_DB::_open_db(void)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ int error = db_util_open(BROWSER_BOOKMARK_DB_PATH, &m_db_descriptor, DB_UTIL_REGISTER_HOOK_METHOD);
+ if (error != SQLITE_OK) {
+ db_util_close(m_db_descriptor);
+ m_db_descriptor = NULL;
+ return EINA_FALSE;
+ }
+
+ return EINA_TRUE;
+}
+
+Eina_Bool Browser_Bookmark_DB::_close_db(void)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ if (m_db_descriptor)
+ {
+ int error = db_util_close(m_db_descriptor);
+ if (error != SQLITE_OK) {
+ BROWSER_LOGE("db_util_close error");
+ m_db_descriptor = NULL;
+ return EINA_FALSE;
+ }
+ m_db_descriptor = NULL;
+ }
+
+ return EINA_TRUE;
+}
+
+Eina_Bool Browser_Bookmark_DB::_get_last_index(int folder_id, int *last_index)
+{
+ if (_open_db() == EINA_FALSE)
+ return EINA_FALSE;
+
+ std::string query = "select sequence from bookmarks where parent=? order by sequence desc";
+
+ sqlite3_stmt *sqlite3_stmt = NULL;
+ int error = sqlite3_prepare_v2(m_db_descriptor, query.c_str(), -1, &sqlite3_stmt, NULL);
+ if (error != SQLITE_OK) {
+ BROWSER_LOGD("SQL error=%d", error);
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+ return EINA_FALSE;
+ }
+
+ if (sqlite3_bind_int(sqlite3_stmt, 1, folder_id) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_bind_int is failed.\n");
+
+ if ((error = sqlite3_step(sqlite3_stmt)) == SQLITE_ROW || error == SQLITE_DONE)
+ *last_index = sqlite3_column_int(sqlite3_stmt, 0);
+ else
+ BROWSER_LOGE("sqlite3_step is failed. error=%d\n", error);
+
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+
+ if (_close_db() == EINA_FALSE)
+ BROWSER_LOGE("_close_db is failed.");
+
+ return (error == SQLITE_DONE || error == SQLITE_ROW);
+}
+
+Eina_Bool Browser_Bookmark_DB::delete_bookmark(int bookmark_id)
+{
+ if (_open_db() == EINA_FALSE)
+ return EINA_FALSE;
+
+ sqlite3_stmt *sqlite3_stmt = NULL;
+ int error = sqlite3_prepare_v2(m_db_descriptor, "delete from bookmarks where id=?",
+ -1, &sqlite3_stmt, NULL);
+ if (error != SQLITE_OK) {
+ BROWSER_LOGD("SQL error=%d", error);
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+ return EINA_FALSE;
+ }
+
+ if (sqlite3_bind_int(sqlite3_stmt, 1, bookmark_id) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_bind_int is failed.\n");
+
+ error = sqlite3_step(sqlite3_stmt);
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+
+ if (error != SQLITE_OK && error != SQLITE_DONE) {
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+ return EINA_FALSE;
+ }
+
+ if (_close_db() == EINA_FALSE)
+ BROWSER_LOGE("_close_db is failed.");
+
+ return (error == SQLITE_DONE);
+}
+
+Eina_Bool Browser_Bookmark_DB::delete_folder(int folder_id)
+{
+ delete_bookmark(folder_id);
+
+ if (_open_db() == EINA_FALSE)
+ return EINA_FALSE;
+
+ sqlite3_stmt *sqlite3_stmt = NULL;
+ int error = sqlite3_prepare_v2(m_db_descriptor, "select id, type from bookmarks where parent=?",
+ -1, &sqlite3_stmt, NULL);
+ if (error != SQLITE_OK) {
+ BROWSER_LOGD("SQL error=%d", error);
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+ return EINA_FALSE;
+ }
+
+ if (sqlite3_bind_int(sqlite3_stmt, 1, folder_id) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_bind_int is failed.\n");
+
+ std::vector<bookmark_item_type> item_type;
+ while ((error = sqlite3_step(sqlite3_stmt)) == SQLITE_ROW) {
+ bookmark_item_type type;
+ type.id = sqlite3_column_int(sqlite3_stmt, 0);
+ type.is_folder = (sqlite3_column_int(sqlite3_stmt, 1) == BOOKMARK_FOLDER);
+ item_type.push_back(type);
+ }
+
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+
+ _close_db();
+
+ for (std::vector<bookmark_item_type>::iterator iter = item_type.begin()
+ ; iter != item_type.end() ; iter++) {
+ if(iter->is_folder)
+ delete_folder(iter->id);
+ else
+ delete_bookmark(iter->id);
+ }
+
+ return EINA_TRUE;
+}
+
+Eina_Bool Browser_Bookmark_DB::get_bookmark_id_by_title_url(int folder_id, const char *title,
+ const char *url, int *bookmark_id)
+{
+ if (_open_db() == EINA_FALSE)
+ return EINA_FALSE;
+
+ sqlite3_stmt *sqlite3_stmt = NULL;
+ int error = sqlite3_prepare_v2(m_db_descriptor, "select id from bookmarks where parent=? and title=?",
+ -1, &sqlite3_stmt, NULL);
+ if (error != SQLITE_OK) {
+ BROWSER_LOGD("SQL error=%d", error);
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+ return EINA_FALSE;
+ }
+
+ if (sqlite3_bind_int(sqlite3_stmt, 1, folder_id) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_bind_int is failed.\n");
+ if (sqlite3_bind_text(sqlite3_stmt, 2, title, -1, NULL) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_bind_text is failed.\n");
+
+ error = sqlite3_step(sqlite3_stmt);
+ if (error != SQLITE_ROW) {
+ BROWSER_LOGD("SQL error=%d", error);
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+ return EINA_FALSE;
+ }
+
+ *bookmark_id = sqlite3_column_int(sqlite3_stmt, 0);
+
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+
+ _close_db();
+
+ return (error == SQLITE_ROW);
+}
+
+Eina_Bool Browser_Bookmark_DB::save_folder(const char* folder_name)
+{
+ int last_index = 0;
+ Eina_Bool get_last_index_result = EINA_TRUE;
+ if (!_get_last_index(BROWSER_BOOKMARK_MAIN_FOLDER_ID, &last_index)) {
+ BROWSER_LOGE("_get_last_index failed.\n");
+ get_last_index_result = EINA_FALSE;
+ }
+
+ if (_open_db() == EINA_FALSE)
+ return EINA_FALSE;
+
+ sqlite3_stmt *sqlite3_stmt = NULL;
+ int error = sqlite3_prepare_v2(m_db_descriptor, "insert into bookmarks (type, parent, title, creationdate, sequence, updatedate, editable) values (?, ?, ?, DATETIME('now'), ?, DATETIME('now'), 1)",
+ -1, &sqlite3_stmt, NULL);
+ if (error != SQLITE_OK) {
+ BROWSER_LOGD("SQL error=%d", error);
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+ return EINA_FALSE;
+ }
+
+ if (sqlite3_bind_int(sqlite3_stmt, 1, 1) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_bind_int is failed.\n");
+ if (sqlite3_bind_int(sqlite3_stmt, 2, BROWSER_BOOKMARK_MAIN_FOLDER_ID) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_bind_int is failed.\n");
+ if (sqlite3_bind_text(sqlite3_stmt, 3, folder_name, -1, NULL) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_bind_text is failed.\n");
+
+ if (get_last_index_result) {
+ if (sqlite3_bind_int(sqlite3_stmt, 4, last_index + 1) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_bind_int is failed.\n");
+ } else {
+ if (sqlite3_bind_int(sqlite3_stmt, 4, 1) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_bind_int is failed.\n");
+ }
+
+ error = sqlite3_step(sqlite3_stmt);
+
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+
+ _close_db();
+
+ return (error == SQLITE_DONE);
+}
+
+Eina_Bool Browser_Bookmark_DB::save_bookmark(int folder_id, const char* title, const char* url)
+{
+ if (!title || !url)
+ return EINA_FALSE;
+
+ int last_index = 0;
+ Eina_Bool get_last_index_result = EINA_TRUE;
+ if (!_get_last_index(folder_id, &last_index)) {
+ BROWSER_LOGE("_get_last_index failed.\n");
+ get_last_index_result = EINA_FALSE;
+ }
+
+ if (_open_db() == EINA_FALSE)
+ return EINA_FALSE;
+
+ sqlite3_stmt *sqlite3_stmt = NULL;
+ int error = sqlite3_prepare_v2(m_db_descriptor, "insert into bookmarks (type, parent, address, title, creationdate, sequence, updatedate, editable) values (?, ?, ?, ?, DATETIME('now'), ?, DATETIME('now'), 1)",
+ -1, &sqlite3_stmt, NULL);
+ if (error != SQLITE_OK) {
+ BROWSER_LOGD("SQL error=%d", error);
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+ return EINA_FALSE;
+ }
+
+ std::string title_to_save = "";
+ std::string url_to_save = "";
+
+ title_to_save = title;
+ if (title_to_save.size() >= BROWSER_MAX_TITLE_LEN)
+ title_to_save.resize(BROWSER_MAX_TITLE_LEN - 1);
+ url_to_save = url;
+ if (url_to_save.size() >= BROWSER_MAX_URL_LEN)
+ url_to_save.resize(BROWSER_MAX_URL_LEN - 1);
+
+ if (sqlite3_bind_int(sqlite3_stmt, 1, 0) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_bind_int is failed.\n");
+ if (sqlite3_bind_int(sqlite3_stmt, 2, folder_id) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_bind_int is failed.\n");
+ if (sqlite3_bind_text(sqlite3_stmt, 3, url_to_save.c_str(), -1, NULL) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_bind_text is failed.\n");
+ if (sqlite3_bind_text(sqlite3_stmt, 4, title_to_save.c_str(), -1, NULL) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_bind_text is failed.\n");
+
+ if (get_last_index_result) {
+ if (sqlite3_bind_int(sqlite3_stmt, 5, last_index + 1) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_bind_int is failed.\n");
+ }
+ else {
+ if (sqlite3_bind_int(sqlite3_stmt, 5, 1) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_bind_int is failed.\n");
+ }
+
+ error = sqlite3_step(sqlite3_stmt);
+
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+
+ if (_close_db() == EINA_FALSE)
+ BROWSER_LOGE("_close_db is failed.");
+
+ return (error == SQLITE_DONE);
+}
+
+Eina_Bool Browser_Bookmark_DB::is_full(void)
+{
+ unsigned count = 0;
+
+ if (_open_db() == EINA_FALSE)
+ return EINA_FALSE;
+
+ sqlite3_stmt *sqlite3_stmt = NULL;
+ int error = sqlite3_prepare_v2(m_db_descriptor, "select count(*) from bookmarks", -1, &sqlite3_stmt, NULL);
+ if (error != SQLITE_OK) {
+ BROWSER_LOGD("SQL error=%d", error);
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+ return EINA_FALSE;
+ }
+
+ error = sqlite3_step(sqlite3_stmt);
+ if (error != SQLITE_ROW) {
+ BROWSER_LOGD("SQL error=%d", error);
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+ return EINA_FALSE;
+ }
+
+ count = sqlite3_column_int(sqlite3_stmt, 0);
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK) {
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+ return EINA_FALSE;
+ }
+
+ if (count >= BROWSER_BOOKMARK_COUNT_LIMIT)
+ return EINA_TRUE;
+
+ return EINA_FALSE;
+}
+
+Eina_Bool Browser_Bookmark_DB::is_duplicated(int folder_id, const char* title, const char* url)
+{
+ if (_open_db() == EINA_FALSE)
+ return EINA_FALSE;
+
+ sqlite3_stmt *sqlite3_stmt = NULL;
+ int error = sqlite3_prepare_v2(m_db_descriptor, "select id from bookmarks where parent=? and title=?",
+ -1, &sqlite3_stmt, NULL);
+ if (error != SQLITE_OK) {
+ BROWSER_LOGD("SQL error=%d", error);
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+ return EINA_FALSE;
+ }
+
+ if (sqlite3_bind_int(sqlite3_stmt, 1, folder_id) != SQLITE_OK) {
+ BROWSER_LOGE("sqlite3_bind_int is failed.\n");
+ return EINA_FALSE;
+ }
+
+ if (sqlite3_bind_text(sqlite3_stmt, 2, title, -1, NULL) != SQLITE_OK) {
+ BROWSER_LOGE("sqlite3_bind_text is failed.\n");
+ return EINA_FALSE;
+ }
+
+ error = sqlite3_step(sqlite3_stmt);
+
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+
+ if (_close_db() == EINA_FALSE)
+ BROWSER_LOGE("_close_db is failed.");
+
+ if (error == SQLITE_ROW)
+ return EINA_TRUE;
+
+ return EINA_FALSE;
+}
+
+Eina_Bool Browser_Bookmark_DB::is_duplicated(const char *folder_name)
+{
+ if (_open_db() == EINA_FALSE)
+ return EINA_FALSE;
+
+ sqlite3_stmt *sqlite3_stmt = NULL;
+ int error = sqlite3_prepare_v2( m_db_descriptor, "select id from bookmarks where type=1 and parent=1 and title=?",
+ -1, &sqlite3_stmt, NULL);
+ if (error != SQLITE_OK) {
+ BROWSER_LOGD("SQL error=%d", error);
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+ return EINA_FALSE;
+ }
+
+
+ if (sqlite3_bind_text(sqlite3_stmt, 1, folder_name, -1, NULL) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_bind_text is failed.\n");
+
+ error = sqlite3_step(sqlite3_stmt);
+
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+
+ _close_db();
+
+ return (error == SQLITE_ROW);
+}
+
+std::string Browser_Bookmark_DB::get_folder_name_by_id(const int folder_id)
+{
+ if (_open_db() == EINA_FALSE)
+ return EINA_FALSE;
+
+ sqlite3_stmt *sqlite3_stmt = NULL;
+ std::string folder_name = "";
+
+ int error = sqlite3_prepare_v2(m_db_descriptor, "select title from bookmarks where type=1 and id=?",
+ -1, &sqlite3_stmt, NULL);
+
+ if (error != SQLITE_OK) {
+ BROWSER_LOGD("SQL error=%d", error);
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+ return folder_name;
+ }
+
+ if (sqlite3_bind_int(sqlite3_stmt, 1, folder_id) != SQLITE_OK) {
+ BROWSER_LOGE("sqlite3_bind_int is failed.\n");
+ return folder_name;
+ }
+
+ error = sqlite3_step(sqlite3_stmt);
+
+ if (error == SQLITE_ROW)
+ folder_name = reinterpret_cast<const char *>(sqlite3_column_text(sqlite3_stmt,0));
+
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+
+ if (_close_db() == EINA_FALSE)
+ BROWSER_LOGE("_close_db is failed.");
+
+ return folder_name;
+}
+
+Eina_Bool Browser_Bookmark_DB::get_folder_id(int current_folder_id, const char *folder_name, int *folder_id)
+{
+ if (folder_name == NULL || strlen(folder_name) <= 0) {
+ BROWSER_LOGE("folder name is invalid.\n");
+ }
+
+ if (_open_db() == EINA_FALSE)
+ return EINA_FALSE;
+
+ sqlite3_stmt *sqlite3_stmt = NULL;
+ int error = sqlite3_prepare_v2(m_db_descriptor, "select id from bookmarks where type=1 and parent=? and title=?",
+ -1, &sqlite3_stmt, NULL);
+ if (error != SQLITE_OK) {
+ BROWSER_LOGD("SQL error=%d", error);
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+ return EINA_FALSE;
+ }
+
+
+ // binding values
+ if (sqlite3_bind_int(sqlite3_stmt, 1, current_folder_id) != SQLITE_OK) {
+ BROWSER_LOGE("sqlite3_bind_int is failed.\n");
+ return EINA_FALSE;
+ }
+ if (sqlite3_bind_text(sqlite3_stmt, 2, folder_name, -1, NULL) != SQLITE_OK) {
+ BROWSER_LOGE("sqlite3_bind_text is failed.\n");
+ return EINA_FALSE;
+ }
+
+ // checking if a bookmark exists
+ error = sqlite3_step(sqlite3_stmt);
+
+ *folder_id = BROWSER_BOOKMARK_MAIN_FOLDER_ID; //just in case
+
+ if (error == SQLITE_ROW || error == SQLITE_DONE)
+ *folder_id = sqlite3_column_int(sqlite3_stmt, 0);
+
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+
+ if (_close_db() == EINA_FALSE) {
+ BROWSER_LOGE("_close_db is failed.");
+ return EINA_FALSE;
+ }
+
+ return (error == SQLITE_DONE || error == SQLITE_ROW);
+}
+
+Eina_Bool Browser_Bookmark_DB::modify_bookmark(int bookmark_id, int folder_id, const char *title, const char *url)
+{
+ BROWSER_LOGD("[%s]", __func__);
+
+ int last_index = 0;
+ Eina_Bool get_last_index_result = EINA_TRUE;
+ if (!_get_last_index(folder_id, &last_index)) {
+ BROWSER_LOGE("_get_last_index failed.\n");
+ get_last_index_result = EINA_FALSE;
+ }
+
+ if (_open_db() == EINA_FALSE)
+ return EINA_FALSE;
+
+ sqlite3_stmt *sqlite3_stmt = NULL;
+ int error = sqlite3_prepare_v2(m_db_descriptor, "update bookmarks set title=?, address=?, parent=?, updatedate=DATETIME('now'), sequence=? where id=?",
+ -1, &sqlite3_stmt, NULL);
+ if (error != SQLITE_OK) {
+ BROWSER_LOGD("SQL error=%d", error);
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+ return EINA_FALSE;
+ }
+
+ if (sqlite3_bind_text(sqlite3_stmt, 1, title, -1, NULL) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_bind_text is failed.\n");
+ if (sqlite3_bind_text(sqlite3_stmt, 2, url, -1, NULL) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_bind_text is failed.\n");
+ if (sqlite3_bind_int(sqlite3_stmt, 3, folder_id) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_bind_int is failed.\n");
+
+ if (get_last_index_result) {
+ if (sqlite3_bind_int(sqlite3_stmt, 4, last_index + 1) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_bind_int is failed.\n");
+ } else {
+ if (sqlite3_bind_int(sqlite3_stmt, 4, 1) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_bind_int is failed.\n");
+ }
+
+ if (sqlite3_bind_int(sqlite3_stmt, 5, bookmark_id) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_bind_int is failed.\n");
+
+ error = sqlite3_step(sqlite3_stmt);
+
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+
+ _close_db();
+
+ return (error == SQLITE_DONE);
+}
+
+Eina_Bool Browser_Bookmark_DB::modify_bookmark_title(int bookmark_id, const char *title)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ if (_open_db() == EINA_FALSE)
+ return EINA_FALSE;
+
+ sqlite3_stmt *sqlite3_stmt = NULL;
+ int error = sqlite3_prepare_v2(m_db_descriptor, "update bookmarks set title=?, updatedate=DATETIME('now') where id=?",
+ -1, &sqlite3_stmt, NULL);
+ if (error != SQLITE_OK) {
+ BROWSER_LOGD("SQL error=%d", error);
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+ return EINA_FALSE;
+ }
+ if (sqlite3_bind_text(sqlite3_stmt, 1, title, -1, NULL) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_bind_text is failed.\n");
+
+ if (sqlite3_bind_int(sqlite3_stmt, 2, bookmark_id) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_bind_int is failed.\n");
+
+ error = sqlite3_step(sqlite3_stmt);
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+
+ if (_close_db() == EINA_FALSE) {
+ BROWSER_LOGE("_close_db is failed.");
+ return EINA_FALSE;
+ }
+
+ return (error == SQLITE_DONE);
+}
+
+Eina_Bool Browser_Bookmark_DB::modify_bookmark_order_index(int bookmark_id, int folder_id, int order_index)
+{
+ if (_open_db() == EINA_FALSE)
+ return EINA_FALSE;
+
+ sqlite3_stmt *sqlite3_stmt = NULL;
+ int error = sqlite3_prepare_v2(m_db_descriptor, "update bookmarks set sequence=? where parent=? and id=?",
+ -1, &sqlite3_stmt, NULL);
+ if (error != SQLITE_OK) {
+ BROWSER_LOGD("SQL error=%d", error);
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+ return EINA_FALSE;
+ }
+
+ if (sqlite3_bind_int(sqlite3_stmt, 1, order_index) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_bind_int is failed.\n");
+
+ if (sqlite3_bind_int(sqlite3_stmt, 2, folder_id) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_bind_int is failed.\n");
+
+ if (sqlite3_bind_int(sqlite3_stmt, 3, bookmark_id) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_bind_int is failed.\n");
+
+ error = sqlite3_step(sqlite3_stmt);
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+
+ _close_db();
+
+ return (error == SQLITE_DONE);
+}
+
+Eina_Bool Browser_Bookmark_DB::get_untitled_folder_count(int *count)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ if (_open_db() == EINA_FALSE)
+ return EINA_FALSE;
+
+ sqlite3_stmt *sqlite3_stmt = NULL;
+ std::string statement = "select title from bookmarks where type=1 and title like '%Folder_%' order by length(title), title";
+ int error = sqlite3_prepare_v2(m_db_descriptor, statement.c_str(), -1, &sqlite3_stmt, NULL);
+ if (error != SQLITE_OK) {
+ BROWSER_LOGD("SQL error=%d", error);
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+ return EINA_FALSE;
+ }
+
+ std::string title;
+ std::string title_from_db;
+ char *buf = "Folder_";
+ for (int i = 1; ; i++) {
+ *count = i;
+ error = sqlite3_step(sqlite3_stmt);
+ if (error == SQLITE_ROW) {
+ title = buf;
+ title_from_db = reinterpret_cast<const char *>(sqlite3_column_text(sqlite3_stmt,0));
+ if (strncmp(title_from_db.c_str(), title.c_str(), title.length()))
+ break;
+ } else
+ break;
+ }
+
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+
+ _close_db();
+
+ return (error == SQLITE_DONE || error == SQLITE_ROW);
+}
+
+Browser_Bookmark_DB::bookmark_item *Browser_Bookmark_DB::get_bookmark_item_by_id(int bookmark_id)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ if (_open_db() == EINA_FALSE) {
+ BROWSER_LOGE("open failed");
+ return NULL;
+ }
+ sqlite3_stmt *sqlite3_stmt = NULL;
+ int error = sqlite3_prepare_v2(m_db_descriptor, "select type,parent,address,title,sequence,editable from bookmarks where id=?",
+ -1, &sqlite3_stmt, NULL);
+ if (error != SQLITE_OK) {
+ BROWSER_LOGD("SQL error=%d", error);
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+ return NULL;
+ }
+ if (sqlite3_bind_int(sqlite3_stmt, 1, bookmark_id) != SQLITE_OK) {
+ BROWSER_LOGE("sqlite3_bind_int is failed.\n");
+ return NULL;
+ }
+
+ bookmark_item *item = NULL;
+ if ((error = sqlite3_step(sqlite3_stmt)) == SQLITE_ROW) {
+ item = new(nothrow) bookmark_item;
+ if (!item) {
+ BROWSER_LOGE("bookmark_item new is failed.\n");
+ return NULL;
+ }
+
+ item->id = bookmark_id;
+ if (sqlite3_column_int(sqlite3_stmt, 0) == BOOKMARK_NORMAL)
+ item->is_folder = EINA_FALSE;
+ else
+ item->is_folder = EINA_TRUE;
+
+ if (!item->is_folder) {
+ const char* url = reinterpret_cast<const char *>(sqlite3_column_text(sqlite3_stmt, 2));
+ if (url && strlen(url) > 0)
+ item->url = url;
+ else
+ item->url = "";
+ }
+
+ item->parent = sqlite3_column_int(sqlite3_stmt, 1);
+
+ const char* title = reinterpret_cast<const char *>(sqlite3_column_text(sqlite3_stmt, 3));
+ if (title && strlen(title) > 0)
+ item->title = title;
+ else
+ item->title = "";
+
+ item->order_index = sqlite3_column_int(sqlite3_stmt, 4);
+ item->is_editable = EINA_TRUE;//sqlite3_column_int(sqlite3_stmt, 5);
+
+ item->is_delete = EINA_FALSE;
+ item->user_data_1 = NULL;
+ item->user_data_2 = NULL;
+ item->user_data_3 = 0;
+ }
+
+ error = sqlite3_finalize(sqlite3_stmt);
+ if (error != SQLITE_OK)
+ {
+ BROWSER_LOGE("sqlite3_finalize is failed. (%d)", error);
+ return NULL;
+ }
+
+ if (_close_db() == EINA_FALSE) {
+ BROWSER_LOGE("_close_db is failed.");
+ return NULL;
+ }
+
+ return item;
+}
+
+Eina_Bool Browser_Bookmark_DB::get_bookmark_list(std::vector<bookmark_item *> &list, int folder_id)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ if (_open_db() == EINA_FALSE) {
+ BROWSER_LOGE("open failed");
+ return EINA_FALSE;
+ }
+
+ sqlite3_stmt *sqlite3_stmt = NULL;
+ int error = sqlite3_prepare_v2(m_db_descriptor, "select id,type,parent,address,title,sequence,editable from bookmarks where parent=? order by sequence",
+ -1,&sqlite3_stmt,NULL);
+ if (error != SQLITE_OK) {
+ BROWSER_LOGD("SQL error=%d", error);
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+ return EINA_FALSE;
+ }
+ if (sqlite3_bind_int(sqlite3_stmt, 1, folder_id) != SQLITE_OK) {
+ BROWSER_LOGE("sqlite3_bind_int is failed.\n");
+ return EINA_FALSE;
+ }
+
+ bookmark_item *item;
+ while ((error = sqlite3_step(sqlite3_stmt)) == SQLITE_ROW) {
+ item = new(nothrow) bookmark_item;
+ if (!item) {
+ BROWSER_LOGE("bookmark_item new is failed.\n");
+ return EINA_FALSE;
+ }
+
+ item->id = sqlite3_column_int(sqlite3_stmt, 0);
+ if (sqlite3_column_int(sqlite3_stmt, 1) == BOOKMARK_NORMAL)
+ item->is_folder = EINA_FALSE;
+ else
+ item->is_folder = EINA_TRUE;
+
+ if (!item->is_folder) {
+ const char* url = reinterpret_cast<const char *>(sqlite3_column_text(sqlite3_stmt, 3));
+ if (url && strlen(url) > 0)
+ item->url = url;
+ else
+ item->url = "";
+ }
+
+ item->parent = sqlite3_column_int(sqlite3_stmt, 2);
+
+ const char* title = reinterpret_cast<const char *>(sqlite3_column_text(sqlite3_stmt, 4));
+ if (title && strlen(title) > 0)
+ item->title = title;
+ else
+ item->title = "";
+
+ item->order_index = sqlite3_column_int(sqlite3_stmt, 5);
+ item->is_editable = EINA_TRUE;//sqlite3_column_int(sqlite3_stmt, 6);
+
+ item->is_delete = EINA_FALSE;
+ item->user_data_1 = NULL;
+ item->user_data_2 = NULL;
+ item->user_data_3 = 0;
+ list.push_back(item);
+ }
+
+ error = sqlite3_finalize(sqlite3_stmt);
+ if (error != SQLITE_OK)
+ {
+ BROWSER_LOGE("sqlite3_finalize is failed. (%d)", error);
+ return EINA_FALSE;
+ }
+
+ if (_close_db() == EINA_FALSE) {
+ BROWSER_LOGE("_close_db is failed.");
+ return EINA_FALSE;
+ }
+
+ return EINA_TRUE;
+}
+
+Eina_Bool Browser_Bookmark_DB::get_folder_list(std::vector<bookmark_item *> &list)
+{
+ if (_open_db() == EINA_FALSE)
+ return EINA_FALSE;
+
+ sqlite3_stmt *sqlite3_stmt = NULL;
+ int error = sqlite3_prepare_v2(m_db_descriptor, "select id,type,parent,address,title,sequence from bookmarks where type=1 and parent=? order by sequence",
+ -1, &sqlite3_stmt, NULL);
+ if (error != SQLITE_OK) {
+ BROWSER_LOGD("SQL error=%d", error);
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+ return EINA_FALSE;
+ }
+
+ if (sqlite3_bind_int(sqlite3_stmt, 1, BROWSER_BOOKMARK_MAIN_FOLDER_ID) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_bind_int is failed.\n");
+
+ bookmark_item *item;
+ while ((error = sqlite3_step(sqlite3_stmt)) == SQLITE_ROW)
+ {
+ item = new(nothrow) bookmark_item;
+ if (!item) {
+ BROWSER_LOGE("bookmark_item new is failed.\n");
+ return EINA_FALSE;
+ }
+
+ item->id = sqlite3_column_int(sqlite3_stmt, 0);
+ item->is_folder = sqlite3_column_int(sqlite3_stmt, 1) == BOOKMARK_NORMAL ? EINA_FALSE : EINA_TRUE;
+ item->parent = sqlite3_column_int(sqlite3_stmt, 2);
+ item->title = "";
+
+ const char* title = reinterpret_cast<const char *>(sqlite3_column_text(sqlite3_stmt, 4));
+ if (title && strlen(title)>0)
+ item->title = title;
+ else
+ item->title = "";
+ item->order_index = sqlite3_column_int(sqlite3_stmt, 5);
+ item->is_editable = EINA_TRUE;
+ item->is_delete = EINA_FALSE;
+
+ list.push_back(item);
+ }
+
+ error = sqlite3_finalize(sqlite3_stmt);
+ if (error != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed. (%d)\n", error);
+
+ _close_db();
+
+ return (error == SQLITE_DONE || error == SQLITE_OK);
+}
+
+
diff --git a/src/database/browser-bookmark-db.h b/src/database/browser-bookmark-db.h new file mode 100755 index 00000000..08dc0f86 --- /dev/null +++ b/src/database/browser-bookmark-db.h @@ -0,0 +1,80 @@ +/*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef BROWSER_BOOKMARK_DB_H
+#define BROWSER_BOOKMARK_DB_H
+
+#include "browser-config.h"
+
+extern "C" {
+#include "db-util.h"
+}
+
+#include <iostream>
+#include <string>
+#include <vector>
+
+class Browser_Bookmark_DB {
+public:
+ struct bookmark_item {
+ int id;
+ std::string url;
+ std::string title;
+ Eina_Bool is_folder;
+ int parent;
+ int order_index;
+ Eina_Bool is_editable;
+ Eina_Bool is_delete;
+ void *user_data_1;
+ void *user_data_2;
+ int user_data_3;
+ };
+
+ struct bookmark_item_type {
+ int id;
+ bool is_folder;
+ };
+
+ Browser_Bookmark_DB();
+ ~Browser_Bookmark_DB();
+
+ Eina_Bool get_bookmark_list(std::vector<bookmark_item *> &list, int folder_id);
+ Eina_Bool get_folder_list(std::vector<bookmark_item *> &list);
+ Eina_Bool get_folder_id(int current_folder_id, const char *folder_name, int *folder_id);
+ std::string get_folder_name_by_id(const int folder_id);
+ Eina_Bool get_bookmark_id_by_title_url(int folder_id, const char *title, const char *url, int *bookmark_id);
+ bookmark_item *get_bookmark_item_by_id(int bookmark_id);
+ Eina_Bool get_untitled_folder_count(int *count);
+ Eina_Bool is_duplicated(int folder_id, const char *title, const char *url);
+ Eina_Bool is_duplicated(const char *folder_name);
+ Eina_Bool is_full(void);
+ Eina_Bool save_bookmark(int folder_id, const char *title, const char *url);
+ Eina_Bool save_folder(const char *folder_name);
+ Eina_Bool delete_bookmark(int bookmark_id);
+ Eina_Bool delete_folder(int folder_id);
+ Eina_Bool modify_bookmark_title(int bookmark_id, const char *title);
+ Eina_Bool modify_bookmark(int bookmark_id, int folder_id, const char *title, const char *url);
+ Eina_Bool modify_bookmark_order_index(int bookmark_id, int folder_id, int order_index);
+private:
+ Eina_Bool _open_db(void);
+ Eina_Bool _close_db(void);
+ Eina_Bool _get_last_index(int folder_id, int *last_index);
+
+ static sqlite3* m_db_descriptor;
+};
+
+#endif /* BROWSER_BOOKMARK_DB_H */
+
diff --git a/src/database/browser-history-db.cpp b/src/database/browser-history-db.cpp new file mode 100755 index 00000000..d61ac600 --- /dev/null +++ b/src/database/browser-history-db.cpp @@ -0,0 +1,482 @@ +/*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using namespace std;
+
+#include "browser-history-db.h"
+
+sqlite3* Browser_History_DB::m_db_descriptor = NULL;
+
+Browser_History_DB::Browser_History_DB(void)
+{
+ BROWSER_LOGD("[%s]", __func__);
+}
+
+Browser_History_DB::~Browser_History_DB(void)
+{
+ BROWSER_LOGD("[%s]", __func__);
+}
+
+Eina_Bool Browser_History_DB::_open_db(void)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ int error = db_util_open(BROWSER_HISTORY_DB_PATH, &m_db_descriptor, DB_UTIL_REGISTER_HOOK_METHOD);
+ if (error != SQLITE_OK) {
+ db_util_close(m_db_descriptor);
+ m_db_descriptor = NULL;
+ return EINA_FALSE;
+ }
+
+ return EINA_TRUE;
+}
+
+Eina_Bool Browser_History_DB::_close_db(void)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ if (m_db_descriptor)
+ {
+ int error = db_util_close(m_db_descriptor);
+ if (error != SQLITE_OK) {
+ BROWSER_LOGE("db_util_close error");
+ m_db_descriptor = NULL;
+ return EINA_FALSE;
+ }
+ m_db_descriptor = NULL;
+ }
+
+ return EINA_TRUE;
+}
+
+Eina_Bool Browser_History_DB::save_history(const char *url, const char *title, Eina_Bool *is_full)
+{
+ if (url == NULL || title == NULL || strlen(url) == 0 || strlen(title) == 0)
+ return EINA_FALSE;
+
+ if (_open_db() == EINA_FALSE)
+ return EINA_FALSE;
+
+ sqlite3_stmt *sqlite3_stmt = NULL;
+ int error = sqlite3_prepare_v2(m_db_descriptor, "select counter from history where address=?",
+ -1, &sqlite3_stmt, NULL);
+ if (error != SQLITE_OK) {
+ BROWSER_LOGD("SQL error=%d", error);
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+ return EINA_FALSE;
+ }
+
+ error = sqlite3_bind_text(sqlite3_stmt, 1, url, -1, NULL);
+ if (error != SQLITE_OK) {
+ BROWSER_LOGD("SQL error=%d", error);
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+ return EINA_FALSE;
+ }
+
+ error = sqlite3_step(sqlite3_stmt);
+ if (error == SQLITE_ROW) {
+ int count = sqlite3_column_int(sqlite3_stmt, 0);
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK) {
+ _close_db();
+ return EINA_FALSE;
+ }
+
+ error = sqlite3_prepare_v2(m_db_descriptor, "update history set counter=?, title=?, visitdate=DATETIME('now') where address=?",
+ -1, &sqlite3_stmt, NULL);
+ if (error != SQLITE_OK) {
+ BROWSER_LOGD("SQL error=%d", error);
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+ return EINA_FALSE;
+ }
+
+ if (sqlite3_bind_int(sqlite3_stmt, 1, count + 1) != SQLITE_OK) {
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+ return EINA_FALSE;
+ }
+
+ if (sqlite3_bind_text(sqlite3_stmt, 2, title, -1, NULL) != SQLITE_OK) {
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+ return EINA_FALSE;
+ }
+
+ if (sqlite3_bind_text(sqlite3_stmt, 3, url, -1, NULL) != SQLITE_OK) {
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+ return EINA_FALSE;
+ }
+
+ error = sqlite3_step(sqlite3_stmt);
+ } else {
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK) {
+ _close_db();
+ return EINA_FALSE;
+ }
+
+ error = sqlite3_prepare_v2(m_db_descriptor, "select count(*) from history", -1, &sqlite3_stmt, NULL);
+ if (error != SQLITE_OK) {
+ BROWSER_LOGD("SQL error=%d", error);
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+ return EINA_FALSE;
+ }
+
+ error = sqlite3_step(sqlite3_stmt);
+ if (error != SQLITE_ROW) {
+ BROWSER_LOGD("SQL error=%d", error);
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+ return EINA_FALSE;
+ }
+
+ unsigned history_count = sqlite3_column_int(sqlite3_stmt, 0);
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK) {
+ _close_db();
+ return EINA_FALSE;
+ }
+
+ if (history_count >= BROWSER_HISTORY_COUNT_LIMIT) {
+ string delete_query = "delete from history where id = (select min(id) from history)";
+ if (history_count > BROWSER_HISTORY_COUNT_LIMIT) {
+ unsigned delete_count = history_count - BROWSER_HISTORY_COUNT_LIMIT + 1;
+ char text[128] = {0, };
+ sprintf(text, "delete from history where id in (select id from history limit %d)", delete_count);
+ delete_query = text;
+ }
+
+ error = sqlite3_prepare_v2(m_db_descriptor, delete_query.c_str(), -1, &sqlite3_stmt, NULL);
+ if (error != SQLITE_OK) {
+ BROWSER_LOGD("SQL error=%d", error);
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+ return EINA_FALSE;
+ }
+
+ error = sqlite3_step(sqlite3_stmt);
+ if (error != SQLITE_DONE) {
+ BROWSER_LOGD("SQL error=%d", error);
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+ return EINA_FALSE;
+ }
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK) {
+ _close_db();
+ return EINA_FALSE;
+ }
+ }
+
+ const string insert_url(url);
+ const string insert_title(title);
+
+ const string statement = "insert into history (address, title, counter, visitdate) values('" + insert_url
+ + "','" + insert_title + "', 0, DATETIME('now'))";
+ error = sqlite3_prepare_v2(m_db_descriptor, statement.c_str(), -1, &sqlite3_stmt, NULL);
+ if (error != SQLITE_OK) {
+ BROWSER_LOGD("SQL error=%d", error);
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+ return EINA_FALSE;
+ }
+
+ error = sqlite3_step(sqlite3_stmt);
+
+ if (error == SQLITE_FULL)
+ *is_full = EINA_TRUE;
+ else
+ *is_full = EINA_FALSE;
+ }
+
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK) {
+ _close_db();
+ return EINA_FALSE;
+ }
+
+ _close_db();
+
+ return (error == SQLITE_DONE);
+}
+
+Eina_Bool Browser_History_DB::delete_history(const char *url)
+{
+ if (!url || strlen(url) == 0) {
+ BROWSER_LOGE("url is empty");
+ return EINA_FALSE;
+ }
+
+ if (_open_db() == EINA_FALSE)
+ return EINA_FALSE;
+
+ sqlite3_stmt *sqlite3_stmt = NULL;
+ int error = sqlite3_prepare_v2(m_db_descriptor, "delete from history where address=?",
+ -1, &sqlite3_stmt, NULL);
+ if (error != SQLITE_OK) {
+ BROWSER_LOGD("SQL error=%d", error);
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+ return EINA_FALSE;
+ }
+
+ if (sqlite3_bind_text(sqlite3_stmt, 1, url, -1, NULL) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_bind_text is failed.");
+
+ error = sqlite3_step(sqlite3_stmt);
+ if (error != SQLITE_OK && error != SQLITE_DONE) {
+ BROWSER_LOGD("SQL error=%d", error);
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+ return EINA_FALSE;
+ }
+
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+
+ _close_db();
+
+ return EINA_TRUE;
+}
+
+Eina_Bool Browser_History_DB::delete_history(int history_id)
+{
+ if (_open_db() == EINA_FALSE)
+ return EINA_FALSE;
+
+ sqlite3_stmt *sqlite3_stmt = NULL;
+ int error = sqlite3_prepare_v2(m_db_descriptor, "delete from history where id=?",
+ -1, &sqlite3_stmt, NULL);
+ if (error != SQLITE_OK) {
+ BROWSER_LOGD("SQL error=%d", error);
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+ return EINA_FALSE;
+ }
+
+ if (sqlite3_bind_int(sqlite3_stmt, 1, history_id) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_bind_int is failed.\n");
+ error = sqlite3_step(sqlite3_stmt);
+ if (error != SQLITE_OK && error != SQLITE_DONE) {
+ BROWSER_LOGD("SQL error=%d", error);
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+ return EINA_FALSE;
+ }
+
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+
+ _close_db();
+
+ return EINA_TRUE;
+}
+
+Eina_Bool Browser_History_DB::get_most_visited_list(vector<most_visited_item> &list)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ if (_open_db() == EINA_FALSE)
+ return EINA_FALSE;
+
+ sqlite3_stmt *sqlite3_stmt = NULL;
+
+ int error = sqlite3_prepare_v2(m_db_descriptor, "select address, title from history order by counter desc limit "BROWSER_MOST_VISITED_COUNT_TEXT,
+ -1, &sqlite3_stmt, NULL);
+ if (error != SQLITE_OK) {
+ BROWSER_LOGD("SQL error=%d", error);
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+ return EINA_FALSE;
+ }
+
+
+ most_visited_item item;
+ while ((error = sqlite3_step(sqlite3_stmt)) == SQLITE_ROW) {
+ item.url = reinterpret_cast<const char *>(sqlite3_column_text(sqlite3_stmt, 0));
+ item.title = reinterpret_cast<const char *>(sqlite3_column_text(sqlite3_stmt, 1));
+
+ list.push_back(item);
+ }
+
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+
+ _close_db();
+
+ return (error == SQLITE_DONE || error == SQLITE_ROW);
+}
+
+Eina_Bool Browser_History_DB::get_history_list_by_partial_url(const char *url, int count, std::vector<std::string> &list)
+{
+ if (!url || strlen(url) == 0) {
+ BROWSER_LOGE("partial_url is empty");
+ return EINA_FALSE;
+ }
+
+ if (_open_db() == EINA_FALSE)
+ return EINA_FALSE;
+
+ sqlite3_stmt *sqlite3_stmt = NULL;
+ std::string query = "select address, counter from history where address like '%" + std::string(url) + "%'";
+
+ int error = sqlite3_prepare_v2(m_db_descriptor, query.c_str(), -1, &sqlite3_stmt, NULL);
+ if (error != SQLITE_OK) {
+ BROWSER_LOGD("SQL error=%d", error);
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+ return EINA_FALSE;
+ }
+
+ int i;
+ for (i = 0; i < count; i++) {
+ error = sqlite3_step(sqlite3_stmt);
+ if (error == SQLITE_ROW) {
+ std::string mark_up = std::string(reinterpret_cast<const char *>(sqlite3_column_text(sqlite3_stmt, 0)));
+ size_t index = mark_up.find(BROWSER_HTTP_SCHEME);
+ if(index == 0) {
+ index = mark_up.find(url, strlen(BROWSER_HTTP_SCHEME));
+ if(index == -1)
+ continue;
+ }
+
+ index = mark_up.find(BROWSER_HTTPS_SCHEME);
+ if(index == 0) {
+ index = mark_up.find(url, strlen(BROWSER_HTTPS_SCHEME));
+ if(index == -1)
+ continue;
+ }
+ + list.push_back(std::string(reinterpret_cast<const char *>(sqlite3_column_text(sqlite3_stmt, 0))));
+ } else
+ break;
+ }
+
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ + _close_db();
+
+ if (error == SQLITE_DONE || error == SQLITE_ROW)
+ return EINA_TRUE;
+ else
+ return EINA_FALSE;
+}
+
+Eina_Bool Browser_History_DB::get_history_list(vector<history_item*> &list)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ if (_open_db() == EINA_FALSE)
+ return EINA_FALSE;
+
+ sqlite3_stmt *sqlite3_stmt = NULL;
+ int error = sqlite3_prepare_v2(m_db_descriptor, "select id, address, title, visitdate from history order by visitdate desc",
+ -1, &sqlite3_stmt, NULL);
+ if (error != SQLITE_OK) {
+ BROWSER_LOGD("SQL error=%d", error);
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+ return EINA_FALSE;
+ }
+
+ history_item *item;
+ while(1) {
+ error = sqlite3_step(sqlite3_stmt);
+ if (error == SQLITE_ROW) {
+ item = new(nothrow) history_item;
+ if (!item) {
+ BROWSER_LOGD("new history_item is failed");
+ return EINA_FALSE;
+ }
+ const char* id = reinterpret_cast<const char *>(sqlite3_column_text(sqlite3_stmt, 0));
+ if (id && strlen(id))
+ item->id = atoi(id);
+ else
+ item->id = 0;
+
+ const char* url = reinterpret_cast<const char *>(sqlite3_column_text(sqlite3_stmt, 1));
+ if (url && strlen(url))
+ item->url = url;
+ else
+ item->url = "";
+
+ const char* title = reinterpret_cast<const char *>(sqlite3_column_text(sqlite3_stmt, 2));
+ if (title && strlen(title))
+ item->title = title;
+ else
+ item->title = "";
+
+ const char* date = reinterpret_cast<const char *>(sqlite3_column_text(sqlite3_stmt, 3));
+ if (date && strlen(date))
+ item->date = date;
+ else
+ item->date = "";
+
+ item->user_data = NULL;
+ item->is_delete = EINA_FALSE;
+
+ list.push_back(item);
+ } else
+ break;
+ }
+
+ BROWSER_LOGD("SQL error: %d", error);\
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+ if (error == SQLITE_DONE || error == SQLITE_ROW)
+ return EINA_TRUE;
+ else
+ return EINA_FALSE;
+}
+
+Eina_Bool Browser_History_DB::clear_history(void)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ if (_open_db() == EINA_FALSE)
+ return EINA_FALSE;
+
+ sqlite3_stmt *sqlite3_stmt = NULL;
+ int error = sqlite3_prepare_v2(m_db_descriptor, "delete from history", -1, &sqlite3_stmt, NULL);
+ if (error != SQLITE_OK) {
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ }
+
+ error = sqlite3_step(sqlite3_stmt);
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+ if (error == SQLITE_DONE || error == SQLITE_ROW)
+ return EINA_TRUE;
+ else
+ return EINA_FALSE;
+}
diff --git a/src/database/browser-history-db.h b/src/database/browser-history-db.h new file mode 100755 index 00000000..c4cd3722 --- /dev/null +++ b/src/database/browser-history-db.h @@ -0,0 +1,64 @@ +/*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef BROWSER_HISTORY_DB_H
+#define BROWSER_HISTORY_DB_H
+
+#include "browser-config.h"
+
+extern "C" {
+#include "db-util.h"
+}
+
+#include <iostream>
+#include <string>
+#include <vector>
+
+class Browser_History_DB {
+public:
+ struct history_item {
+ int id;
+ std::string url;
+ std::string title;
+ std::string date;
+ Eina_Bool is_delete;
+
+ void *user_data;
+ };
+ struct most_visited_item {
+ std::string url;
+ std::string title;
+ };
+
+ Browser_History_DB();
+ ~Browser_History_DB();
+
+ Eina_Bool get_history_list(std::vector<history_item*> &list);
+ Eina_Bool get_history_list_by_partial_url(const char *url, int count, std::vector<std::string> &list);
+ Eina_Bool get_most_visited_list(std::vector<most_visited_item> &list);
+ Eina_Bool save_history(const char *url, const char *title, Eina_Bool *is_full);
+ Eina_Bool delete_history(int history_id);
+ Eina_Bool delete_history(const char *url);
+ Eina_Bool clear_history(void);
+private:
+ Eina_Bool _open_db(void);
+ Eina_Bool _close_db(void);
+
+ static sqlite3* m_db_descriptor;
+};
+
+#endif /* BROWSER_HISTORY_DB_H */
+
diff --git a/src/database/browser-notification-db.cpp b/src/database/browser-notification-db.cpp new file mode 100755 index 00000000..b1ac98b7 --- /dev/null +++ b/src/database/browser-notification-db.cpp @@ -0,0 +1,312 @@ +/*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+using namespace std;
+
+#include "browser-notification-db.h"
+
+sqlite3* Browser_Notification_DB::m_db_descriptor = NULL;
+
+Browser_Notification_DB::Browser_Notification_DB(void)
+{
+ BROWSER_LOGD("[%s]", __func__);
+}
+
+Browser_Notification_DB::~Browser_Notification_DB(void)
+{
+ BROWSER_LOGD("[%s]", __func__);
+}
+
+Eina_Bool Browser_Notification_DB::_open_db(void)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ int error = db_util_open(BROWSER_NOTIFICATION_DB_PATH, &m_db_descriptor, DB_UTIL_REGISTER_HOOK_METHOD);
+ if (error != SQLITE_OK) {
+ BROWSER_LOGE("db_util_open error");
+ db_util_close(m_db_descriptor);
+ m_db_descriptor = NULL;
+ return EINA_FALSE;
+ }
+
+ return EINA_TRUE;
+}
+
+Eina_Bool Browser_Notification_DB::_close_db(void)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ if (m_db_descriptor)
+ {
+ int error = db_util_close(m_db_descriptor);
+ if (error != SQLITE_OK) {
+ BROWSER_LOGE("db_util_close error");
+ m_db_descriptor = NULL;
+ return EINA_FALSE;
+ }
+ m_db_descriptor = NULL;
+ }
+
+ return EINA_TRUE;
+}
+
+Eina_Bool Browser_Notification_DB::save_domain(const char *domain)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ if (!domain || strlen(domain) == 0)
+ return EINA_FALSE;
+
+ if (_open_db() == EINA_FALSE)
+ return EINA_FALSE;
+
+ sqlite3_stmt *stmt = NULL;
+ int error = sqlite3_prepare_v2(m_db_descriptor,
+ "insert into notification_permitted_domains (domain) values (?)", -1, &stmt, NULL);
+ if (error != SQLITE_OK) {
+ BROWSER_LOGD("SQL error=%d", error);
+ if (sqlite3_finalize(stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+ return EINA_FALSE;
+ }
+
+ if (sqlite3_bind_text(stmt, 1, domain, -1, NULL) != SQLITE_OK) + BROWSER_LOGE("sqlite3_bind_text is failed.\n");
+ error = sqlite3_step(stmt);
+
+ if (sqlite3_finalize(stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+
+ return (error == SQLITE_DONE);
+}
+
+Eina_Bool Browser_Notification_DB::has_domain(const char *domain)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ if (!domain || strlen(domain) == 0)
+ return EINA_FALSE;
+
+ if (_open_db() == EINA_FALSE)
+ return EINA_FALSE;
+
+ sqlite3_stmt *stmt = NULL;
+ int error = sqlite3_prepare_v2(m_db_descriptor,
+ "select count(*) from notification_permitted_domains where domain=?", -1, &stmt, NULL);
+ if (error != SQLITE_OK) {
+ BROWSER_LOGD("SQL error=%d", error);
+ if (sqlite3_finalize(stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+ return EINA_FALSE;
+ }
+
+ if (sqlite3_bind_text(stmt, 1, domain, -1, NULL) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_bind_text is failed.\n");
+ error = sqlite3_step(stmt);
+ if (error != SQLITE_ROW) {
+ BROWSER_LOGD("SQL error=%d", error);
+ if (sqlite3_finalize(stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+ return EINA_FALSE;
+ }
+ if (0 < (sqlite3_column_int(stmt, 0))) {
+ if (sqlite3_finalize(stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+ return EINA_TRUE;
+ }
+
+ if (sqlite3_finalize(stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+
+ return EINA_FALSE;
+}
+
+Eina_Bool Browser_Notification_DB::save_notification(Ewk_Notification *ewk_notification, int ¬i_id)
+{
+ if (!ewk_notification) {
+ BROWSER_LOGE("ewk_notification null");
+ return EINA_FALSE;
+ }
+
+ if (_open_db() == EINA_FALSE)
+ return EINA_FALSE;
+
+ sqlite3_stmt *stmt = NULL;
+ int error = sqlite3_prepare_v2(m_db_descriptor,
+ "insert into notification_table (notification, title, body, url, iconURL, iconValidity) values (?, ?, ?, ?, ?, ?)",
+ -1, &stmt, NULL);
+ if (error != SQLITE_OK) {
+ BROWSER_LOGD("SQL error=%d", error);
+ if (sqlite3_finalize(stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+ return EINA_FALSE;
+ }
+
+ if (sqlite3_bind_int(stmt, 1, (int)ewk_notification->notification) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_bind_int is failed.\n");
+ if (sqlite3_bind_text(stmt, 2, ewk_notification->title, -1, NULL) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_bind_text is failed.\n");
+ if (sqlite3_bind_text(stmt, 3, ewk_notification->body, -1, NULL) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_bind_text is failed.\n");
+ if (sqlite3_bind_text(stmt, 4, ewk_notification->url, -1, NULL) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_bind_text is failed.\n");
+ if (sqlite3_bind_text(stmt, 5, ewk_notification->iconURL, -1, NULL) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_bind_text is failed.\n");
+ if (sqlite3_bind_int(stmt, 6, (int)0) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_bind_int is failed.\n");
+
+ error = sqlite3_step(stmt);
+ noti_id = sqlite3_last_insert_rowid(m_db_descriptor);
+ if (sqlite3_finalize(stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+
+ if (error != SQLITE_DONE)
+ return EINA_FALSE;
+
+ return EINA_TRUE;
+}
+
+Eina_Bool Browser_Notification_DB::get_title_by_id(int id, std::string &title)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ if (_open_db() == EINA_FALSE)
+ return EINA_FALSE;
+
+ sqlite3_stmt *stmt = NULL;
+ int error = sqlite3_prepare_v2(m_db_descriptor,
+ "select title from notification_table where id=?", -1, &stmt, NULL);
+ if (error != SQLITE_OK) {
+ BROWSER_LOGD("SQL error=%d", error);
+ if (sqlite3_finalize(stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+ return EINA_FALSE;
+ }
+ if (sqlite3_bind_int(stmt, 1, id) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_bind_text is failed.\n");
+ error = sqlite3_step(stmt);
+ if (error != SQLITE_ROW) {
+ BROWSER_LOGD("SQL error=%d", error);
+ if (sqlite3_finalize(stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+ return EINA_FALSE;
+ }
+
+ title = std::string(reinterpret_cast<const char *>(sqlite3_column_text(stmt, 0)));
+
+
+ if (sqlite3_finalize(stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+
+ return EINA_TRUE;
+}
+
+Eina_Bool Browser_Notification_DB::get_body_by_id(int id, std::string &body)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ if (_open_db() == EINA_FALSE)
+ return EINA_FALSE;
+
+ sqlite3_stmt *stmt = NULL;
+ int error = sqlite3_prepare_v2(m_db_descriptor,
+ "select body from notification_table where id=?", -1, &stmt, NULL);
+ if (error != SQLITE_OK) {
+ BROWSER_LOGD("SQL error=%d", error);
+ if (sqlite3_finalize(stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+ return EINA_FALSE;
+ }
+ if (sqlite3_bind_int(stmt, 1, id) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_bind_text is failed.\n");
+ error = sqlite3_step(stmt);
+ if (error != SQLITE_ROW) {
+ BROWSER_LOGD("SQL error=%d", error);
+ if (sqlite3_finalize(stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+ return EINA_FALSE;
+ }
+
+ body = std::string(reinterpret_cast<const char *>(sqlite3_column_text(stmt, 0)));
+ if (sqlite3_finalize(stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+
+ return EINA_TRUE;
+}
+
+Eina_Bool Browser_Notification_DB::update_icon_validity(int noti_id)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ if (_open_db() == EINA_FALSE)
+ return EINA_FALSE;
+
+ sqlite3_stmt *stmt = NULL;
+ int error = sqlite3_prepare_v2(m_db_descriptor,
+ "update notification_table set iconValidity=? where id=?",
+ -1, &stmt, NULL);
+ if (error != SQLITE_OK) {
+ BROWSER_LOGD("SQL error=%d", error);
+ if (sqlite3_finalize(stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+ return EINA_FALSE;
+ }
+
+ if (sqlite3_bind_int(stmt, 1, (int)1) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_bind_text is failed.\n");
+ if (sqlite3_bind_int(stmt, 2, noti_id) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_bind_text is failed.\n");
+
+ error = sqlite3_step(stmt);
+
+ if (sqlite3_finalize(stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+
+ return EINA_TRUE;
+}
+
+Eina_Bool Browser_Notification_DB::delete_notifications(void)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ if (_open_db() == EINA_FALSE)
+ return EINA_FALSE;
+
+ sqlite3_stmt *stmt = NULL;
+ int error = sqlite3_prepare_v2(m_db_descriptor, "delete from notification_table",
+ -1, &stmt, NULL);
+ if (error != SQLITE_OK) {
+ BROWSER_LOGD("\nSQL error: %d", error);
+ if (sqlite3_finalize(stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+ return EINA_FALSE;
+ }
+ error = sqlite3_step(stmt);
+
+ if (sqlite3_finalize(stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+
+ return EINA_TRUE;
+}
diff --git a/src/database/browser-notification-db.h b/src/database/browser-notification-db.h new file mode 100755 index 00000000..9f5e070f --- /dev/null +++ b/src/database/browser-notification-db.h @@ -0,0 +1,50 @@ +/*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef BROWSER_NOTIFICATION_DB_H
+#define BROWSER_NOTIFICATION_DB_H
+
+#include "browser-config.h"
+
+extern "C" {
+#include "db-util.h"
+}
+
+#include <iostream>
+#include <string>
+#include <vector>
+
+class Browser_Notification_DB {
+public:
+ Browser_Notification_DB(void);
+ ~Browser_Notification_DB(void);
+
+ Eina_Bool save_domain(const char *domain);
+ Eina_Bool has_domain(const char *domain);
+ Eina_Bool save_notification(Ewk_Notification *ewk_notification, int ¬i_id);
+ Eina_Bool get_title_by_id(int id, std::string &title);
+ Eina_Bool get_body_by_id(int id, std::string &body);
+ Eina_Bool update_icon_validity(int noti_id);
+ Eina_Bool delete_notifications(void);
+private:
+ Eina_Bool _open_db(void);
+ Eina_Bool _close_db(void);
+ + static sqlite3* m_db_descriptor;
+};
+
+#endif /* BROWSER_NOTIFICATION_DB_H */
+
diff --git a/src/database/browser-personal-data-db.cpp b/src/database/browser-personal-data-db.cpp new file mode 100755 index 00000000..74dcbeab --- /dev/null +++ b/src/database/browser-personal-data-db.cpp @@ -0,0 +1,241 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +using namespace std; + +#include "browser-personal-data-db.h" + +sqlite3* Browser_Personal_Data_DB::m_db_descriptor = NULL; + +Browser_Personal_Data_DB::Browser_Personal_Data_DB(void) +{ + BROWSER_LOGD("[%s]", __func__); +} + +Browser_Personal_Data_DB::~Browser_Personal_Data_DB(void) +{ + BROWSER_LOGD("[%s]", __func__); +} + +Eina_Bool Browser_Personal_Data_DB::_open_db(void) +{ + BROWSER_LOGD("[%s]", __func__); + int error = db_util_open(BROWSER_PERSONAL_DATA_DB_PATH, &m_db_descriptor, DB_UTIL_REGISTER_HOOK_METHOD); + if (error != SQLITE_OK) { + db_util_close(m_db_descriptor); + m_db_descriptor = NULL; + return EINA_FALSE; + } + + return EINA_TRUE; +} + +Eina_Bool Browser_Personal_Data_DB::_close_db(void) +{ + BROWSER_LOGD("[%s]", __func__); + if (m_db_descriptor) + { + int error = db_util_close(m_db_descriptor); + if (error != SQLITE_OK) { + BROWSER_LOGE("db_util_close error"); + m_db_descriptor = NULL; + return EINA_FALSE; + } + m_db_descriptor = NULL; + } + + return EINA_TRUE; +} + +Eina_Bool Browser_Personal_Data_DB::save_personal_data(std::string url, std::string login, std::string password) +{ + if (url.empty() || login.empty()) { + BROWSER_LOGE("url or value is empty"); + return EINA_FALSE; + } + + BROWSER_LOGD("url=[%s], login=[%s], password=[%s]", url.c_str(), login.c_str(), password.c_str()); + + if (_open_db() == EINA_FALSE) + return EINA_FALSE; + + sqlite3_stmt *sqlite3_stmt = NULL; + int error = sqlite3_prepare_v2(m_db_descriptor, "select id, login, password from passwords where address=?", + -1, &sqlite3_stmt, NULL); + if (error != SQLITE_OK) { + BROWSER_LOGD("SQL error=%d", error); + if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK) + BROWSER_LOGE("sqlite3_finalize is failed.\n"); + _close_db(); + return EINA_FALSE; + } + if (sqlite3_bind_text(sqlite3_stmt, 1, url.c_str(), -1, NULL) != SQLITE_OK) + BROWSER_LOGE("sqlite3_bind_text is failed.\n"); + + std::string current_login; + std::string current_password; + + int id = 0; + error = sqlite3_step(sqlite3_stmt); + if (error == SQLITE_ROW) { + id = sqlite3_column_int(sqlite3_stmt, 0); + current_login = reinterpret_cast<const char *>(sqlite3_column_text(sqlite3_stmt, 1)); + current_password = reinterpret_cast<const char *>(sqlite3_column_text(sqlite3_stmt, 2)); + } + + if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK) + BROWSER_LOGE("sqlite3_finalize is failed.\n"); + + if (id == 0) { + /* url doesn't exist */ + error = sqlite3_prepare_v2(m_db_descriptor, "insert into passwords(login, password, address) values(?,?,?)", + -1, &sqlite3_stmt, NULL); + if (error != SQLITE_OK) { + BROWSER_LOGD("SQL error=%d", error); + if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK) + BROWSER_LOGE("sqlite3_finalize is failed.\n"); + _close_db(); + return EINA_FALSE; + } + + if (sqlite3_bind_text(sqlite3_stmt, 1, login.c_str(), -1, NULL) != SQLITE_OK) + BROWSER_LOGE("sqlite3_bind_text is failed.\n"); + if (sqlite3_bind_text(sqlite3_stmt, 2, password.c_str(), -1, NULL) != SQLITE_OK) + BROWSER_LOGE("sqlite3_bind_text is failed.\n"); + if (sqlite3_bind_text(sqlite3_stmt, 3, url.c_str(), -1, NULL) != SQLITE_OK) + + error = sqlite3_step(sqlite3_stmt); + if (error != SQLITE_DONE) { + BROWSER_LOGD("SQL error=%d", error); + if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK) + BROWSER_LOGE("sqlite3_finalize is failed.\n"); + _close_db(); + return EINA_FALSE; + } + } else { + /* url exists, update username and password */ + if (strcmp(login.c_str(), current_login.c_str()) || strcmp(password.c_str(), current_password.c_str())) { + error = sqlite3_prepare_v2(m_db_descriptor, "update passwords set login=?, password=? where id=?", + -1, &sqlite3_stmt, NULL); + if (error != SQLITE_OK) { + BROWSER_LOGD("SQL error=%d", error); + if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK) + BROWSER_LOGE("sqlite3_finalize is failed.\n"); + _close_db(); + return EINA_FALSE; + } + + if (sqlite3_bind_text(sqlite3_stmt, 1, login.c_str(), -1, NULL) != SQLITE_OK) + BROWSER_LOGE("sqlite3_bind_text is failed.\n"); + if (sqlite3_bind_text(sqlite3_stmt, 2, password.c_str(), -1, NULL) != SQLITE_OK) + BROWSER_LOGE("sqlite3_bind_text is failed.\n"); + if (sqlite3_bind_int(sqlite3_stmt, 3, id) != SQLITE_OK) + + error = sqlite3_step(sqlite3_stmt); + if (error != SQLITE_DONE) { + BROWSER_LOGD("SQL error=%d", error); + if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK) + BROWSER_LOGE("sqlite3_finalize is failed.\n"); + _close_db(); + return EINA_FALSE; + } + } + } + + if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK) { + _close_db(); + return EINA_FALSE; + } + + _close_db(); + + return EINA_TRUE; +} + +Eina_Bool Browser_Personal_Data_DB::get_personal_data(std::string &login, std::string &password, const std::string &url) +{ + BROWSER_LOGD("url=[%s]", url.c_str()); + if (url.empty()) { + BROWSER_LOGE("url is empty"); + return EINA_FALSE; + } + + if (_open_db() == EINA_FALSE) + return EINA_FALSE; + + sqlite3_stmt *stmt = NULL; + int error = sqlite3_prepare_v2(m_db_descriptor, "select login, password from passwords where address=?", + -1, &stmt, NULL); + if (error != SQLITE_OK) { + BROWSER_LOGD("SQL error=%d", error); + if (sqlite3_finalize(stmt) != SQLITE_OK) + BROWSER_LOGE("sqlite3_finalize is failed.\n"); + _close_db(); + return EINA_FALSE; + } + if (sqlite3_bind_text(stmt, 1, url.c_str(), -1, NULL) != SQLITE_OK) + BROWSER_LOGE("sqlite3_bind_text is failed.\n"); + + Eina_Bool personal_data_found = EINA_FALSE; + error = sqlite3_step(stmt); + if (error == SQLITE_ROW) { + login = std::string(reinterpret_cast<const char *>(sqlite3_column_text(stmt, 0))); + password = std::string(reinterpret_cast<const char *> (sqlite3_column_text(stmt, 1))); + personal_data_found = EINA_TRUE; + BROWSER_LOGD("Personal data: %s : %s\n", login.c_str(), password.c_str()); + } + + + error = sqlite3_finalize(stmt); + + _close_db(); + + return personal_data_found; +} + +Eina_Bool Browser_Personal_Data_DB::clear_personal_data(void) +{ + if (_open_db() == EINA_FALSE) + return EINA_FALSE; + + sqlite3_stmt *sqlite3_stmt = NULL; + int error = sqlite3_prepare_v2(m_db_descriptor, "delete from passwords", -1, &sqlite3_stmt ,NULL); + + if (error != SQLITE_OK) { + BROWSER_LOGD("SQL error=%d", error); + if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK) + BROWSER_LOGE("sqlite3_finalize is failed.\n"); + _close_db(); + return EINA_FALSE; + } + + error = sqlite3_step(sqlite3_stmt); + if (error != SQLITE_DONE) { + BROWSER_LOGD("SQL error=%d", error); + if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK) + BROWSER_LOGE("sqlite3_finalize is failed.\n"); + _close_db(); + return EINA_FALSE; + } + + if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK) + BROWSER_LOGE("sqlite3_finalize is failed.\n"); + + _close_db(); + + return EINA_TRUE; +} + diff --git a/src/database/browser-personal-data-db.h b/src/database/browser-personal-data-db.h new file mode 100755 index 00000000..b9634885 --- /dev/null +++ b/src/database/browser-personal-data-db.h @@ -0,0 +1,56 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef BROWSER_PERSONAL_DATA_DB +#define BROWSER_PERSONAL_DATA_DB + +#include "browser-config.h" + +extern "C" { +#include "db-util.h" +} + +#include <string> +#include <vector> + +using namespace std; + +class Browser_Personal_Data_DB { +public: + struct personal_data { + std::string identifier; + std::string name; + std::string type; + std::string value; + std::string form_id; + std::string form_name; + }; + + Browser_Personal_Data_DB(void); + ~Browser_Personal_Data_DB(void); + + Eina_Bool save_personal_data(std::string url, std::string login, std::string password); + Eina_Bool get_personal_data(std::string &login, std::string &password, const std::string &url); + Eina_Bool clear_personal_data(void); + +private: + Eina_Bool _open_db(void); + Eina_Bool _close_db(void); + + static sqlite3* m_db_descriptor; +}; + +#endif /* BROWSER_PERSONAL_DATA_DB */ diff --git a/src/database/browser-user-agent-db.cpp b/src/database/browser-user-agent-db.cpp new file mode 100755 index 00000000..bc2069d9 --- /dev/null +++ b/src/database/browser-user-agent-db.cpp @@ -0,0 +1,101 @@ +/*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using namespace std;
+
+#include "browser-user-agent-db.h"
+
+sqlite3* Browser_User_Agent_DB::m_db_descriptor = NULL;
+
+Browser_User_Agent_DB::Browser_User_Agent_DB(void)
+{
+ BROWSER_LOGD("[%s]", __func__);
+}
+
+Browser_User_Agent_DB::~Browser_User_Agent_DB(void)
+{
+ BROWSER_LOGD("[%s]", __func__);
+}
+
+Eina_Bool Browser_User_Agent_DB::_open_db(void)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ int error = db_util_open(BROWSER_USER_AGENT_DB_PATH, &m_db_descriptor, DB_UTIL_REGISTER_HOOK_METHOD);
+ if (error != SQLITE_OK) {
+ db_util_close(m_db_descriptor);
+ m_db_descriptor = NULL;
+ return EINA_FALSE;
+ }
+
+ return EINA_TRUE;
+}
+
+Eina_Bool Browser_User_Agent_DB::_close_db(void)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ if (m_db_descriptor)
+ {
+ int error = db_util_close(m_db_descriptor);
+ if (error != SQLITE_OK) {
+ BROWSER_LOGE("db_util_close error");
+ m_db_descriptor = NULL;
+ return EINA_FALSE;
+ }
+ m_db_descriptor = NULL;
+ }
+
+ return EINA_TRUE;
+}
+
+Eina_Bool Browser_User_Agent_DB::get_user_agent(const char *title, char *&user_agent)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ if (_open_db() == EINA_FALSE)
+ return EINA_FALSE;
+
+ sqlite3_stmt *sqlite3_stmt = NULL;
+ int error = sqlite3_prepare_v2(m_db_descriptor, "select value from user_agents where name=?",
+ -1, &sqlite3_stmt, NULL);
+ if (error != SQLITE_OK) {
+ BROWSER_LOGD("SQL error=%d", error);
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+ _close_db();
+ return EINA_FALSE;
+ }
+
+ if (sqlite3_bind_text(sqlite3_stmt, 1, title, -1, NULL) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_bind_text is failed.\n");
+
+ error = sqlite3_step(sqlite3_stmt);
+
+ string value;
+ if (error == SQLITE_ROW)
+ value = reinterpret_cast<const char*>(sqlite3_column_text(sqlite3_stmt, 0));
+
+ if (sqlite3_finalize(sqlite3_stmt) != SQLITE_OK)
+ BROWSER_LOGE("sqlite3_finalize is failed.\n");
+
+ if (!value.empty())
+ user_agent = strdup(value.c_str());
+ else
+ user_agent = NULL;
+
+ _close_db();
+
+ return (error == SQLITE_DONE || error == SQLITE_ROW);
+}
+
diff --git a/src/database/browser-user-agent-db.h b/src/database/browser-user-agent-db.h new file mode 100755 index 00000000..5900f638 --- /dev/null +++ b/src/database/browser-user-agent-db.h @@ -0,0 +1,44 @@ +/*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef BROWSER_USER_AGENT_DB_H
+#define BROWSER_USER_AGENT_DB_H
+
+#include "browser-config.h"
+
+extern "C" {
+#include "db-util.h"
+}
+
+#include <iostream>
+#include <string>
+#include <vector>
+
+class Browser_User_Agent_DB {
+public:
+ Browser_User_Agent_DB();
+ ~Browser_User_Agent_DB();
+
+ Eina_Bool get_user_agent(const char *title, char *&user_agent);
+private:
+ Eina_Bool _open_db(void);
+ Eina_Bool _close_db(void);
+ + static sqlite3* m_db_descriptor;
+};
+
+#endif /* BROWSER_USER_AGENT_DB_H */
+
diff --git a/src/include/browser-config.h b/src/include/browser-config.h new file mode 100755 index 00000000..0e2fbf24 --- /dev/null +++ b/src/include/browser-config.h @@ -0,0 +1,233 @@ +/*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef BROWSER_CONFIG_H
+#define BROWSER_CONFIG_H
+
+#include <appcore-efl.h>
+#include <appsvc.h>
+#include <app_service.h>
+#include <app_manager.h>
+#include <aul.h>
+#include <bundle.h>
+#include <cairo.h>
+#include <dirent.h>
+#include <gio/gio.h>
+#include <glib.h>
+#include <glib-object.h>
+#include <libsoup/soup.h>
+#include <malloc.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <ui-gadget.h>
+#include <unistd.h>
+#include <utilX.h>
+#include <vconf.h>
+#include <Elementary.h>
+#include <Elementary_webview.h>
+#include <Ecore.h>
+#include <Ecore_IMF.h>
+#include <Ecore_X.h>
+#include <Evas.h>
+#include <EWebKit.h>
+#include <devman_haptic.h>
+
+#include <cstdio>
+#include <ewk_main.h>
+#include <fstream>
+#include <sstream>
+#include <iostream>
+#include <map>
+#include <set>
+#include <string>
+#include <vector>
+
+#include "browser-dlog.h"
+#include "browser-string.h"
+
+#define BROWSER_PACKAGE_NAME "browser"
+#define BROWSER_EDJE_DIR "/opt/apps/org.tizen.browser/res/edje"
+#define BROWSER_LOCALE_DIR "/opt/apps/org.tizen.browser/res/locale"
+#define BROWSER_IMAGE_DIR "/opt/apps/org.tizen.browser/res/images"
+
+#define BROWSER_URL_SCHEME_CHECK "://"
+#define BROWSER_HTTP_SCHEME "http://"
+#define BROWSER_HTTPS_SCHEME "https://"
+#define BROWSER_FILE_SCHEME "file://"
+#define BROWSER_RTSP_SCHEME "rtsp://"
+#define BROWSER_MAIL_TO_SCHEME "mailto:"
+#define BROWSER_TEL_SCHEME "tel:"
+#define BROWSER_SMS_SCHEME "sms:"
+#define BROWSER_VTEL_SCHEME "vtel:"
+#define BROWSER_WTAI_SCHEME "wtai://"
+#define BROWSER_DAUM_TV_SCHEME "daumtv://"
+#define BROWSER_YOUTUBE_SCHEME "vnd.youtube"
+
+#define BROWSER_DEFAULT_USER_HOMEPAGE "www.tizen.org"
+
+/* browser extension theme. */
+#define BROWSER_BUTTON_THEME BROWSER_EDJE_DIR"/browser-define.edj"
+#define BROWSER_NAVIFRAME_THEME BROWSER_EDJE_DIR"/browser-naviframe.edj"
+#define BROWSER_CONTROLBAR_THEME BROWSER_EDJE_DIR"/browser-view-control-bar.edj"
+#define BROWSER_URL_LAYOUT_THEME BROWSER_EDJE_DIR"/browser-view-url-layout.edj"
+#define BROWSER_PROGRESSBAR_THEME BROWSER_EDJE_DIR"/browser-view-progressbar.edj"
+#define BROWSER_PREDICTIVE_HISTORY_THEME BROWSER_EDJE_DIR"/browser-predictive-history.edj"
+#define BROWSER_SETTINGS_THEME BROWSER_EDJE_DIR"/browser-settings.edj"
+#define BROWSER_BOOKMARK_THEME BROWSER_EDJE_DIR"/browser-bookmark-view.edj"
+#define BROWSER_MOST_VISITED_SITES_THEME BROWSER_EDJE_DIR"/most-visited-sites.edj"
+#define BROWSER_MOST_VISITED_THEME BROWSER_EDJE_DIR"/browser-most-visited.edj"
+#define BROWSER_FIND_WORD_LAYOUT_THEME BROWSER_EDJE_DIR"/browser-view-find-word-layout.edj"
+
+/* browser vconf path */
+#define BROWSER_VCONF_PREFIX "db/browser/"
+#define BROWSER_SETTING_VCONF_PREFIX "db/browsersetting/"
+#define SHOW_MY_SITES_GUIDE BROWSER_VCONF_PREFIX"ShowMySitesGuide"
+#define BROWSER_BRIGHTNESS_LEVEL_KEY BROWSER_VCONF_PREFIX"BrowserBrightnessLevel"
+#define LAST_VISITED_URL_KEY BROWSER_SETTING_VCONF_PREFIX"LastVisitedUrl"
+//#define USERAGENT_KEY BROWSER_VCONF_PREFIX"UserAgent"
+
+/* "db/browsersetting/UserAgent" should be installed in browser with Tizen open.
+ * Because the user agent ug is not available with Tizen open. */
+#define USERAGENT_KEY BROWSER_SETTING_VCONF_PREFIX"UserAgent"
+
+#define DEFAULT_USER_AGENT_STRING "Tizen"
+
+#define HOMEPAGE_KEY BROWSER_SETTING_VCONF_PREFIX"HomepageMode"
+#define USER_HOMEPAGE_KEY BROWSER_SETTING_VCONF_PREFIX"UserHomepage"
+#define SEARCHURL_KEY BROWSER_VCONF_PREFIX"SearchUrl"
+#define DEFAULT_VIEW_LEVEL_KEY BROWSER_SETTING_VCONF_PREFIX"DefaultViewLevel"
+#define RUN_JAVASCRIPT_KEY BROWSER_SETTING_VCONF_PREFIX"RunJavaScript"
+#define DISPLAY_IMAGES_KEY BROWSER_SETTING_VCONF_PREFIX"DisplayImages"
+#define BLOCK_POPUP_KEY BROWSER_SETTING_VCONF_PREFIX"BlockPopup"
+#define ACCEPT_COOKIES_KEY BROWSER_SETTING_VCONF_PREFIX"CookieOptionInt"
+#define AUTO_SAVE_ID_PASSWORD_KEY BROWSER_SETTING_VCONF_PREFIX"SaveIDPassword"
+
+#define RUN_READER_KEY BROWSER_SETTING_VCONF_PREFIX"RunReader"
+#define READER_FONT_SIZE_KEY BROWSER_SETTING_VCONF_PREFIX"FontSize"
+
+#define RUN_PLUGINS_KEY BROWSER_SETTING_VCONF_PREFIX"RunPlugins"
+#define RUN_FLASH_KEY BROWSER_SETTING_VCONF_PREFIX"RunFlash"
+#define PAUSE_FLASH_KEY BROWSER_SETTING_VCONF_PREFIX"PauseFlash"
+#define ACCELERATED_COMPOSITION_KEY BROWSER_SETTING_VCONF_PREFIX"AcceleratedComposition"
+#define EXTERNAL_VIDEO_PLAYER_KEY BROWSER_SETTING_VCONF_PREFIX"ExternalVideoPlayer"
+#define BROWSER_FLASH_MIME_TYPE "application/x-shockwave-flash"
+
+#define BACKING_STORE_CACHE_SIZE 42000000 /* 42 MB */
+
+#define BROWSER_READER_DEFAULT_FONT_SIZE 16
+#define BROWSER_READER_MIN_FONT_SIZE 10
+#define BROWSER_READER_MAX_FONT_SIZE 30
+
+#define BROWSER_DEFAULT_BRIGHTNESS_LEVEL 7
+
+#define MODAL_MSG_MAX_BUFFER 1024
+#define MODAL_LAUNCHER_BIN_PATH "/usr/bin/modal_launcher"
+#define MODAL_LAUNCHER_BUNDLE_TYPE "type"
+#define MODAL_LAUNCHER_BUNDLE_MESSAGE "message"
+#define MODAL_LAUNCHER_RESULT_KEYWORD "MODAL_RESULT"
+
+/* ID to save to vconf for browser settings */
+#define MOST_VISITED_SITES "MOST_VISITED_SITES"
+#define RECENTLY_VISITED_SITE "RECENTLY_VISITED_SITE"
+#define USER_HOMEPAGE "USER_HOMEPAGE"
+#define FIT_TO_WIDTH "FIT_TO_WIDTH"
+#define READABLE "READABLE"
+#define ALWAYS_ASK "ALWAYS_ASK"
+#define ALWAYS_ON "ON"
+#define ALWAYS_OFF "OFF"
+
+#define GOOGLE_SEARCH_QUERY "http://www.google.com/m/search?q="
+
+/* size definition */
+#define BROWSER_MORE_CTX_POPUP_MARGIN (10 * elm_scale_get())
+
+/* bookmark definition */
+#define BROWSER_BOOKMARK_DB_PATH "/opt/dbspace/.internet_bookmark.db"
+#define BROWSER_BOOKMARK_GENLIST_BLOCK_COUNT 50
+#define BROWSER_BOOKMARK_MAIN_FOLDER_ID 1
+#define BROWSER_BOOKMARK_COUNT_LIMIT 1000
+#define BROWSER_MAX_TITLE_LEN 1024
+#define BROWSER_MAX_URL_LEN 2048
+#define BROWSER_BOOKMARK_PROCESS_BLOCK_COUNT 100
+
+/* history definition */
+#define BROWSER_HISTORY_DB_PATH "/opt/dbspace/.browser-history.db"
+#define BROWSER_HISTORY_COUNT_LIMIT 1000
+#define BROWSER_MAX_DATE_LEN 40
+#define BROWSER_PREDICTIVE_HISTORY_COUNT 2
+
+/* personal data definition */
+#define BROWSER_PERSONAL_DATA_DB_PATH "/opt/apps/org.tizen.browser/data/db/.browser-credential.db"
+
+/* multi window definition */
+#define BROWSER_MULTI_WINDOW_MAX_COUNT 9
+#define BROWSER_MULTI_WINDOW_ITEM_RATIO 0.60f
+
+#define BROWSER_USER_AGENT_DB_PATH "/opt/apps/org.tizen.browser/data/db/.browser.db"
+#define BROWSER_DEFAULT_USER_AGENT_TITLE "Tizen"
+
+#define BROWSER_NOTIFICATION_DB_PATH "/opt/apps/org.tizen.browser/data/db/.browser-notification.db"
+
+/* Most visited definition */
+#define BROWSER_MOST_VISITED_COUNT_TEXT "3"
+
+/* Speed dial definition */
+#define BROWSER_MOST_VISITED_SITES_DB_PATH "/opt/apps/org.tizen.browser/data/db/.browser-speeddial.db"
+#define BROWSER_MOST_VISITED_SITES_SCREEN_SHOT_DIR "/opt/apps/org.tizen.browser/data/screenshots/"
+#define BROWSER_MOST_VISITED_SITES_ITEM_MAX 9
+#define BROWSER_MOST_VISITED_SITES_URL ""
+#define DEFAULT_ICON_PREFIX "default_"
+
+#define BROWSER_FAVICON_DB_PATH "/opt/apps/org.tizen.browser/data/db/WebpageIcons.db"
+
+#define BROWSER_CLEAN_UP_WINDOWS_TIMEOUT (60 * 30) // 30 min
+
+/* To do. */
+#define BROWSER_SEARCH_URL_GOOGLE "http://www.google.com/m/search?q="
+#define BROWSER_SEARCH_URL_YAHOO "http://search.yahoo.com/search?p="
+#define BROWSER_SEARCH_URL_BING "http://www.bing.com/search?q="
+#define BROWSER_SEARCH_ENGINE_KEY BROWSER_SETTING_VCONF_PREFIX"SearchEngine"
+#define BROWSER_GOOGLE "Google"
+#define BROWSER_YAHOO "Yahoo"
+#define BROWSER_BING "Bing"
+
+#define SEC_DOWNLOAD_APP "org.tizen.download-provider"
+#define SEC_STREAMING_PLAYER "org.tizen.video-player"
+#define SEC_VIDEO_PLAYER SEC_STREAMING_PLAYER
+#define SEC_MUSIC_PLAYER "org.tizen.music-player"
+#define SEC_VT_CALL "org.tizen.vtmain"
+#define SEC_MESSAGE "org.tizen.message"
+#define SEC_EMAIL "org.tizen.email"
+
+#define ELM_NAVIFRAME_ITEM_CONTENT "default"
+#define ELM_NAVIFRAME_ITEM_CONTROLBAR "controlbar"
+#define ELM_NAVIFRAME_ITEM_ICON "icon"
+#define ELM_NAVIFRAME_ITEM_OPTIONHEADER "optionheader"
+#define ELM_NAVIFRAME_ITEM_OPTIONHEADER2 "optionheader2"
+
+#define ELM_NAVIFRAME_ITEM_SIGNAL_CONTROLBAR_CLOSE "elm,state,controlbar,close", ""
+#define ELM_NAVIFRAME_ITEM_SIGNAL_OPTIONHEADER_CLOSE "elm,state,optionheader,close", ""
+#define ELM_NAVIFRAME_ITEM_SIGNAL_OPTIONHEADER_INSTANT_CLOSE "elm,state,optionheader,instant_close", ""
+#define ELM_NAVIFRAME_ITEM_SIGNAL_OPTIONHEADER_INSTANT_OPEN "elm,state,optionheader,instant_open", ""
+#define ELM_NAVIFRAME_ITEM_SIGNAL_OPTIONHEADER_OPEN "elm,state,optionheader,open", ""
+#define ELM_NAVIFRAME_ITEM_TITLE_LABEL "title"
+#define ELM_NAVIFRAME_ITEM_TITLE_LEFT_BTN "title_left_btn"
+#define ELM_NAVIFRAME_ITEM_TITLE_MORE_BTN "title_more_btn"
+#define ELM_NAVIFRAME_ITEM_TITLE_RIGHT_BTN "title_right_btn"
+#define ELM_NAVIFRAME_ITEM_PREV_BTN "prev_btn"
+
+#endif /* BROWSER_CONFIG_H */
+
diff --git a/src/include/browser-dlog.h b/src/include/browser-dlog.h new file mode 100755 index 00000000..50ab2e1b --- /dev/null +++ b/src/include/browser-dlog.h @@ -0,0 +1,76 @@ +/*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef BROWSER_DLOG_H
+#define BROWSER_DLOG_H
+
+#include <dlog.h>
+
+#define BROWSER_LOGD(fmt, args...) LOGD("[%s: %s: %d] "fmt, (rindex(__FILE__, '/') ? rindex(__FILE__, '/') + 1 : __FILE__), __FUNCTION__, __LINE__, ##args)
+#define BROWSER_LOGI(fmt, args...) LOGI("[%s: %s: %d] "fmt, (rindex(__FILE__, '/') ? rindex(__FILE__, '/') + 1 : __FILE__), __FUNCTION__, __LINE__, ##args)
+#define BROWSER_LOGW(fmt, args...) LOGW("[%s: %s: %d] "fmt, (rindex(__FILE__, '/') ? rindex(__FILE__, '/') + 1 : __FILE__), __FUNCTION__, __LINE__, ##args)
+#define BROWSER_LOGE(fmt, args...) LOGE("[%s: %s: %d] "fmt, (rindex(__FILE__, '/') ? rindex(__FILE__, '/') + 1 : __FILE__), __FUNCTION__, __LINE__, ##args)
+#define BROWSER_LOGE_IF(cond, fmt, args...) LOGE_IF(cond, "[%s: %s: %d] "fmt, (rindex(__FILE__, '/') ? rindex(__FILE__, '/') + 1 : __FILE__), __FUNCTION__, __LINE__, ##args)
+
+#if defined(BROWSER_MEMALLOC_ABORT_ON)
+#define new new(nothrow)
+#define RET_NEWALLOC_FAILED(expr) do {\
+ if ((expr) == NULL) {\
+ BROWSER_LOGE("[%s: %s: %d] [Error] NULL returned!- blue screen is launched!",\
+ (rindex(__FILE__, '/') ? rindex(__FILE__, '/') + 1 : __FILE__), __FUNCTION__, __LINE__);\
+ abort();\
+ return;\
+ }\
+} while (0)
+#else
+#define RET_NEWALLOC_FAILED(expr) do {\
+ if ((expr) == NULL) {\
+ BROWSER_LOGE("[%s: %s: %d] [Error] NULL returned!- blue screen is launched!",\
+ (rindex(__FILE__, '/') ? rindex(__FILE__, '/') + 1 : __FILE__), __FUNCTION__, __LINE__);\
+ return;\
+ }\
+} while (0)
+#endif
+
+#if defined(BROWSER_MEMALLOC_ABORT_ON)
+#define RETV_NEWALLOC_FAILED(expr,val) do {\
+ if ((expr) == NULL) {\
+ BROWSER_LOGE("[%s: %s: %d] [Error] NULL returned!- blue screen is launched!",\
+ (rindex(__FILE__, '/') ? rindex(__FILE__, '/') + 1 : __FILE__), __FUNCTION__, __LINE__);\
+ abort();\
+ return (val);\
+ }\
+} while (0)
+#else
+#define RETV_NEWALLOC_FAILED(expr,val) do {\
+ if ((expr) == NULL) {\
+ BROWSER_LOGE("[%s: %s: %d] [Error] NULL returned!- blue screen is launched!",\
+ (rindex(__FILE__, '/') ? rindex(__FILE__, '/') + 1 : __FILE__), __FUNCTION__, __LINE__);\
+ return (val);\
+ }\
+} while (0)
+#endif
+
+#define RET_PARAM_INVALID(expr) do {\
+ if ((expr) == NULL) {\
+ BROWSER_LOGE("[%s: %s: %d]invalid parameter!", (rindex(__FILE__, '/') ? rindex(__FILE__, '/') + 1 : __FILE__), __FUNCTION__,\
+ __LINE__);\
+ return;\
+ }\
+} while (0)
+
+#endif /* BROWSER_DLOG_H */
+
diff --git a/src/include/browser-string.h b/src/include/browser-string.h new file mode 100755 index 00000000..b1ae7c5f --- /dev/null +++ b/src/include/browser-string.h @@ -0,0 +1,226 @@ +/*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef BROWSER_STRING_H
+#define BROWSER_STRING_H
+
+#include "browser-dlog.h"
+
+/* browser string define for translation */
+#define BR_STRING_MOST_VISITED_SITES _("IDS_BR_BODY_MOST_VISITED_SITES")
+#define BR_STRING_RECENTLY_VISITED_SITE _("IDS_BR_HEADER_RECENTLY_VISITED_PAGES")
+#define BR_STRING_USER_HOMEPAGE _("User homepage")
+#define BR_STRING_EMPTY_PAGE _("Empty page")
+#define BR_STRING_OK dgettext("sys_string", "IDS_COM_SK_OK")
+#define BR_STRING_EDIT dgettext("sys_string", "IDS_COM_SK_EDIT")
+#define BR_STRING_YES dgettext("sys_string", "IDS_COM_SK_YES")
+#define BR_STRING_NO dgettext("sys_string", "IDS_COM_SK_NO")
+#define BR_STRING_BACK dgettext("sys_string", "IDS_COM_BODY_BACK")
+#define BR_STRING_CANCEL dgettext("sys_string", "IDS_COM_SK_CANCEL")
+#define BR_STRING_SAVE dgettext("sys_string", "IDS_COM_SK_SAVE")
+#define BR_STRING_DONE dgettext("sys_string", "IDS_COM_SK_DONE")
+#define BR_STRING_DELETE dgettext("sys_string", "IDS_COM_SK_DELETE")
+#define BR_STRING_SEARCH "Search"
+#define BR_STRING_DELETED _("IDS_BR_POP_DELETED")
+#define BR_STRING_DELETE_Q dgettext("sys_string", "IDS_COM_POP_DELETE_Q")
+#define BR_STRING_CLOSE dgettext("sys_string", "IDS_COM_POP_CLOSE")
+#define BR_STRING_VIEW_CHANGE _("IDS_BR_SK3_CHANGE_VIEW")
+#define BR_STRING_NEW_WINDOW _("IDS_BR_SK1_NEW_WINDOW")
+#define BR_STRING_CREATE_FOLDER _("IDS_BR_SK3_CREATE_FOLDER")
+#define BR_STRING_MULTI_WINDOW _("IDS_BR_HEADER_MULTI_WINDOW")
+#define BR_STRING_FOLDER _("IDS_BR_HEADER_FOLDER")
+#define BR_STRING_BOOKMARKS _("IDS_BR_BODY_BOOKMARKS")
+#define BR_STRING_BOOKMARK _("IDS_BR_OPT_BOOKMARK")
+#define BR_STRING_HISTORY _("IDS_BR_TAB_HISTORY")
+#define BR_STRING_HISTORIES "Histories"
+#define BR_STRING_LOADING _("IDS_BR_HEADER_LOADING_ING")
+#define BR_STRING_ADD_TO_BOOKMARKS _("IDS_BR_SK3_ADD_TO_BOOKMARKS")
+#define BR_STRING_EDIT_BOOKMARK _("IDS_BR_BODY_EDIT_BOOKMARK")
+#define BR_STRING_TITLE _("IDS_BR_BODY_TITLE")
+#define BR_STRING_CLICK_HERE "Please click here"
+#define BR_STRING_URL _("IDS_BR_BODY_URL")
+#define BR_STRING_ENTER_URL _("IDS_BR_POP_ENTER_URL")
+#define BR_STRING_ENTER_TITLE _("IDS_BR_BODY_ENTER_TITLE")
+#define BR_STRING_WARNING dgettext("sys_string", "IDS_COM_POP_WARNING")
+#define BR_STRING_ERROR dgettext("sys_string", "IDS_COM_POP_ERROR")
+#define BR_STRING_FAILED _("IDS_BR_POP_FAIL")
+#define BR_STRING_SELECTED _("IDS_BR_OPT_SELECTED")
+#define BR_STRING_SELECT_ALL _("IDS_BR_OPT_SELECT_ALL")
+#define BR_STRING_SELECT_ITEMS _("IDS_BR_HEADER_SELECT_ITEMS")
+#define BR_STRING_SELECT_HISTORIES "Select histories"
+#define BR_STRING_WARNING_OVER_BOOKMARK_LIMIT "It's reached maximum number of bookmark items, please delete it before adding"
+#define BR_STRING_ALREADY_EXISTS _("IDS_BR_POP_ALREADY_EXISTS")
+#define BR_STRING_FOLDERS _("IDS_BR_OPT_FOLDERS")
+#define BR_STRING_EMPTY_FOLDER_NAME _("IDS_BR_POP_ENTER_FOLDER_NAME")
+#define BR_STRING_EMPTY_FOLDER "Empty folder"
+#define BR_STRING_NO_BOOKMARKS _("IDS_BR_BODY_NO_BOOKMARKS")
+#define BR_STRING_NO_HISTORY _("IDS_BR_BODY_NO_HISTORIES")
+#define BR_STRING_PROCESSING dgettext("sys_string", "IDS_COM_POP_PROCESSING")
+#define BR_STRING_MOST_VISITED_GUIDE_TEXT "Offer 3 thumbnails of most visited sites to let you access to each site easily"
+#define BR_STRING_SHARE_VIA_MESSAGE _("IDS_BR_OPT_SHARE_VIA_MESSAGES")
+#define BR_STRING_SHARE_VIA_EMAIL _("IDS_BR_OPT_SHARE_VIA_EMAIL")
+#define BR_STRING_SHARE_VIA_FACEBOOK _("IDS_BR_OPT_SHARE_VIA_FACEBOOK")
+#define BR_STRING_SHARE_VIA_TWITTER _("IDS_BR_OPT_SHARE_VIA_TWITTER")
+#define BR_STRING_SHARE_VIA_NFC _("Share via NFC")
+#define BR_STRING_SHARE_VIA _("IDS_BR_OPT_SHARE_VIA")
+#define BR_STRING_MESSAGES dgettext("sys_string", "IDS_COM_BODY_MESSAGES")
+#define BR_STRING_EMAIL dgettext("sys_string", "IDS_COM_BODY_EMAIL")
+#define BR_STRING_NFC "NFC" //dgettext("sys_string", "IDS_COM_BODY_NFC")
+#define BR_STRING_DOWNLOAD_MANAGER _("IDS_BR_OPT_DOWNLOAD_MANAGER")
+#define BR_STRING_BRIGHTNESS dgettext("sys_string", "IDS_COM_OPT_BRIGHTNESS")
+#define BR_STRING_FIND_WORD _("IDS_BR_BODY_FIND_WORD")
+#define BR_STRING_SETTINGS _("IDS_BR_BODY_SETTINGS")
+#define BR_STRING_UNLOCK _("IDS_BR_OPT_UNLOCK")
+#define BR_STRING_LOCK _("IDS_BR_OPT_LOCK")
+#define BR_STRING_MODIFY _("IDS_BR_BODY_MODIFY")
+#define BR_STRING_SAVED _("IDS_BR_POP_SAVED")
+#define BR_STRING_ADD_TO_MOST_VISITED_SITES "Add to Most visited sites"
+#define BR_STRING_MY_SITES_GUIDE_TEXT "You can add, delete, pin or unpin each item of \"My sites\" by doing a long press. <br>You can also reorder items of \"My sites\" by drag and drop."
+#define BR_STRING_MY_SITES_NEVER_SHOW_TEXT "Never show this again."
+#define BR_STRING_WARNING_VIDEO_PLAYER "Can not launch video-player while video-call is running."
+#define BR_STRING_TITLE_SELECT_AN_ACTION _("Select an action")
+#define BR_STRING_NETWORK_ERROR _("IDS_BR_POP_NETWORK_ERROR") +#define BR_STRING_SHARE dgettext("sys_string", "IDS_COM_BUTTON_SHARE")
+#define BR_STRING_NO_SEARCH_RESULT "No search result"
+#define BR_STRING_NO_URL_TO_POST _("There is no URL to post")
+#define BR_STRING_REQUEST_LOCATION " is requesting your current location."
+#define BR_STRING_ALLOW _("IDS_BR_OPT_ALLOW")
+#define BR_STRING_REFUSE _("IDS_BR_POP_REFUSE")
+#define BR_STRING_ADD_RSS_FEED _("IDS_BR_OPT_ADD_RSS_FEED")
+#define BR_STRING_FORWARD _("IDS_BR_OPT_NAVIGATE_GO_FORWARD")
+#define BR_STRING_ADD_TO_HOME _("IDS_BR_OPT_ADD_TO_HOME_SCREEN_ABB")
+
+/* browser settings string */
+#define BR_STRING_HOMEPAGE _("IDS_BR_BODY_HOMEPAGE")
+#define BR_STRING_INTERNET dgettext("sys_string", "IDS_COM_BODY_INTERNET")
+#define BR_STRING_DISPLAY _("IDS_BR_OPT_DISPLAY")
+#define BR_STRING_DEFAULT_VIEW_LEVEL _("IDS_BR_BODY_DEFAULT_VIEW")
+#define BR_STRING_READABLE _("IDS_BR_BODY_READABLE")
+#define BR_STRING_FIT_TO_WIDTH _("IDS_BR_BODY_FIT_TO_WIDTH")
+#define BR_STRING_CONTENT _("IDS_BR_MBODY_PAGE_CONTENT_SETTINGS")
+#define BR_STRING_RUN_JAVASCRIPT _("IDS_BR_BODY_RUN_JAVASCRIPT")
+#define BR_STRING_DISPLAY_IMAGES _("IDS_BR_BODY_DISPLAY_IMAGES")
+#define BR_STRING_BLOCK_POPUP _("IDS_BR_MBODY_BLOCK_POP_UP_WINDOWS")
+#define BR_STRING_PRIVACY _("IDS_BR_BODY_PRIVACY")
+#define BR_STRING_ACCEPT_COOKIES _("IDS_BR_BODY_COOKIES")
+#define BR_STRING_AUTO_SAVE_ID_PASSWORD _("IDS_BR_BODY_AUTO_SAVE_ID_PASSWORD")
+#define BR_STRING_ALWAYS_ASK _("IDS_BR_BODY_ALWAYS_ASK")
+#define BR_STRING_ON dgettext("sys_string", "IDS_COM_BODY_ON")
+#define BR_STRING_OFF dgettext("sys_string", "IDS_COM_BODY_OFF")
+#define BR_STRING_CLEAR_PRIVATE_DATA _("IDS_BR_BODY_DELETE_BROWSING_DATA")
+#define BR_STRING_CACHE _("IDS_BR_BODY_CLEAR_CACHE")
+#define BR_STRING_COOKIE _("IDS_BR_BODY_CLEAR_ALL_COOKIE_DATA")
+#define BR_STRING_SAVED_ID_PASSWORD _("IDS_BR_BODY_AUTO_SAVE_ID_PASSWORD")
+#define BR_STRING_ITEMS_SELECTED _("IDS_BR_POP_PD_ITEMS_SELECTED")
+#define BR_STRING_ONE_ITEM_SELECTED _("IDS_BR_POP_1_ITEM_SELECTED")
+#define BR_STRING_DEBUG _("IDS_BR_BODY_DEVELOPER_MODE")
+#define BR_STRING_USER_AGENT _("IDS_BR_HEADER_USER_AGENT")
+
+#define BR_STRING_STORAGE _("IDS_BR_HEADER_LOCAL_STORAGE")
+#define BR_STRING_DEFAULT_STORAGE _("IDS_BR_BODY_DEFAULT_STORAGE")
+#define BR_STRING_PHONE _("IDS_BR_BODY_PHONE")
+#define BR_STRING_MEMORY_CARD _("IDS_BR_BODY_MEMORY_CARD")
+#define BR_STRING_READER _("IDS_BR_BODY_TEXT_READER")
+#define BR_STRING_RUN_READER "Run Reader"
+#define BR_STRING_FONT_SIZE _("IDS_BR_BODY_FONT_SIZE")
+#define BR_STRING_ABOUT_BROWSER _("IDS_BR_BODY_ABOUT_BROWSER")
+#define BR_STRING_PLUGINS _("IDS_BR_BODY_PLUG_IN")
+#define BR_STRING_ENABLE_PLUGINS _("IDS_BR_BODY_ENABLE_PLUG_INS")
+#define BR_STRING_RUN_FLASH _("IDS_BR_BODY_RUN_FLASH")
+#define BR_STRING_PAUSE_FLASH_AT_PANNING _("Pause flash at panning")
+#define BR_STRING_RESET_TO_DEFAULT "Reset to default"
+
+/* waring message */
+#define BR_STRING_MSG_BOUNDARY_LACK_OF_SPACE_TO_SAVE_HTML _("Not enough space to save a html file")
+#define BR_STRING_AUTH_REQUIRED _("IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED")
+#define BR_STRING_USER_NAME _("IDS_BR_BODY_AUTHUSERNAME")
+#define BR_STRING_PASSWORD _("IDS_BR_BODY_AUTHPASSWORD")
+
+#define BR_STRING_DISPLAY_POPUP_Q _("This site is attempting to open pop-up window. Show pop-up?")
+#define BR_STRING_PERMISSION_CHECK "Permission check"
+#define BR_STRING_WEB_NOTIFICATION_Q _("Do you want to receive web notification?")
+
+/* browser context menu */
+#define BR_STRING_CTXMENU_OPEN_LINK_IN_NEW_WINDOW _("IDS_BR_BODY_OPEN_IN_NEW_WINDOW")//"Open link in new window"
+#define BR_STRING_CTXMENU_DOWNLOAD_LINKED_FILE _("IDS_BR_BODY_DOWNLOAD")//"Download linked file"
+#define BR_STRING_CTXMENU_COPY_LINK_LOCATION _("IDS_BR_BODY_COPY_URL")//"Copy link location"
+#define BR_STRING_CTXMENU_OPEN_IMAGE_IN_NEW_WINDOW _("IDS_BR_BODY_VIEW_IMAGE")//"Open image in new window"
+#define BR_STRING_CTXMENU_OPEN_MEDIA_IN_NEW_WINDOW _("IDS_BR_BODY_PLAY")//"Open media in new window"
+#define BR_STRING_CTXMENU_COPY_IMAGE_LOCATION _("IDS_BR_BODY_COPY_URL")//"Copy image location"
+#define BR_STRING_CTXMENU_SAVE_IMAGE_AS _("Save image as")
+#define BR_STRING_CTXMENU_COPY_IMAGE _("IDS_BR_OPT_COPY_IMAGE")
+#define BR_STRING_CTXMENU_SAVE_IMAGE _("IDS_BR_OPT_SAVE_IMAGE")
+#define BR_STRING_CTXMENU_COPY_MEDIA dgettext("sys_string", "IDS_COM_BODY_COPY")
+#define BR_STRING_CTXMENU_SEND_IMAGE_VIA_EMAIL _("IDS_BR_OPT_SEND_VIA_EMAIL")//"Send image via email"
+#define BR_STRING_CTXMENU_SEND_IMAGE_VIA_MESSAGE _("IDS_BR_OPT_SEND_VIA_MESSAGE")//"Send image via message"
+#define BR_STRING_CTXMENU_OPEN_VIDEO_IN_NEW_WINDOW _("Open video in new window")
+#define BR_STRING_CTXMENU_OPEN_AUDIO_IN_NEW_WINDOW _("Open audio in new window")
+#define BR_STRING_CTXMENU_COPY_VIDEO_LINK_LOCATION _("IDS_BR_BODY_COPY_URL")//"Copy video link location"
+#define BR_STRING_CTXMENU_COPY_AUDIO_LINK_LOCATION _("IDS_BR_BODY_COPY_URL")//"Copy audio link location"
+#define BR_STRING_CTXMENU_TOGGLE_MEDIA_CONTOLS _("Toggle media controls")
+#define BR_STRING_CTXMENU_TOGGLE_MEDIA_LOOP_PLAYBACK _("Toggle media loop playback")
+#define BR_STRING_CTXMENU_SWITCH_VIDEO_TO_FUUL_SCREEN _("Switch video to fullscreen")
+#define BR_STRING_CTXMENU_PLAY _("IDS_BR_BODY_PLAY")
+#define BR_STRING_CTXMENU_PAUSE dgettext("sys_string", "IDS_COM_BODY_PAUSE")
+#define BR_STRING_CTXMENU_MUTE dgettext("sys_string", "IDS_COM_BODY_MUTE")
+#define BR_STRING_CTXMENU_OPEN_FRAME_IN_NEW_WINDOW _("Open frame in new window")
+#define BR_STRING_CTXMENU_MORE _("IDS_BR_BUTTON_MORE")
+#define BR_STRING_CTXMENU_COPY dgettext("sys_string", "IDS_COM_BODY_COPY")
+#define BR_STRING_CTXMENU_SEARCH dgettext("sys_string", "IDS_COM_BODY_SEARCH")
+#define BR_STRING_CTXMENU_SHARE dgettext("sys_string", "IDS_COM_BUTTON_SHARE")
+#define BR_STRING_CTXMENU_DELETE dgettext("sys_string", "IDS_COM_BODY_DELETE")
+#define BR_STRING_CTXMENU_SELECT_ALL _("IDS_BR_OPT_SELECT_ALL")
+#define BR_STRING_CTXMENU_SELECT _("IDS_BR_OPT_SELECT")
+#define BR_STRING_CTXMENU_INSERT_UNICODE_CON_CHAR _("Insert unicode control character")
+#define BR_STRING_CTXMENU_INPUT_METHOD _("Input methods")
+#define BR_STRING_CTXMENU_GO_BACK _("IDS_BR_OPT_NAVIGATE_GO_BACKWARD")
+#define BR_STRING_CTXMENU_GO_FORWARD _("IDS_BR_OPT_NAVIGATE_GO_FORWARD")
+#define BR_STRING_CTXMENU_STOP _("IDS_BR_OPT_STOP")
+#define BR_STRING_CTXMENU_RELOAD _("IDS_BR_OPT_RELOAD")
+#define BR_STRING_CTXMENU_CUT _("Cut")
+#define BR_STRING_CTXMENU_PASTE _("IDS_BR_OPT_PASTE")
+#define BR_STRING_CTXMENU_NO_GUESS_FOUND _("No guesses found")
+#define BR_STRING_CTXMENU_IGNORE_SPELLING _("Ignore spelling")
+#define BR_STRING_CTXMENU_LEARN_SPELLING _("Learn spelling")
+#define BR_STRING_CTXMENU_SEARCH_THE_WEB _("Search the Web")
+#define BR_STRING_CTXMENU_SEARCH_IN_SPOTLIGHT _("Search in Spotlight")
+#define BR_STRING_CTXMENU_LOCK_UP_IN_DIRECTORY _("Look up in dictionary")
+#define BR_STRING_CTXMENU_OPEN_LINK _("IDS_BR_OPT_OPEN_URL")//"Open link"
+#define BR_STRING_CTXMENU_IGNORE_GRAMMAR _("Ignore grammar")
+#define BR_STRING_CTXMENU_SPELLING_AND_GRAMMAR _("Spelling and grammar")
+#define BR_STRING_CTXMENU_SHOW_SPELLING_AND_GRAMMAR _("Show spelling and grammar")
+#define BR_STRING_CTXMENU_HIDE_SPELLING_AND_GRAMMAR _("Hide spelling and grammar")
+#define BR_STRING_CTXMENU_CHECK_DOCUMENT_NOW _("Check document now")
+#define BR_STRING_CTXMENU_CHECK_SPELLING_WHILE_TYPEING _("Check spelling while _Typing")
+#define BR_STRING_CTXMENU_CHECK_GRAMMAR_WITH_SPELLING _("Check grammar with spelling")
+#define BR_STRING_CTXMENU_SHOW_FONTS _("Show fonts")
+#define BR_STRING_CTXMENU_FONT _("Font")
+#define BR_STRING_CTXMENU_BOLD _("Bold")
+#define BR_STRING_CTXMENU_ITALIC _("Italic")
+#define BR_STRING_CTXMENU_OUTLINE _("Outline")
+#define BR_STRING_CTXMENU_UNDERLINE _("Underline")
+#define BR_STRING_CTXMENU_SHOW_COLORS _("Show colors")
+#define BR_STRING_CTXMENU_OUTLINE _("Outline")
+#define BR_STRING_CTXMENU_STYLE _("Style")
+#define BR_STRING_CTXMENU_INPECT_ELEMENT _("Inspect element")
+#define BR_STRING_CTXMENU_MISSING_PLUGIN _("missing plugin")
+#define BR_STRING_CTXMENU_PLUGIN_CRASHED _("plugin crashed")
+#define BR_STRING_CTXMENU_SPEECH _("Speech")
+#define BR_STRING_CTXMENU_START_SPEAKING _("Start speaking")
+#define BR_STRING_CTXMENU_STOP_SPEAKING _("Stop speaking")
+
+#endif /* BROWSER_STRING_H */
+
|