From daa26e6b09d513d41f41236ade4cdb9c732d0bb4 Mon Sep 17 00:00:00 2001 From: Victor Cebollada Date: Thu, 27 Feb 2020 07:55:18 +0000 Subject: [PATCH 01/16] Removed the 'setenv' function of the Third Party Windows platform. * Moved to windows-dependencies as it's needed by dali-demo. Change-Id: I329519c6825f4f9487cd05ded5f085afc6481bac Signed-off-by: Victor Cebollada --- third-party/windows-platform/environment.cpp | 9 --------- third-party/windows-platform/extern-definitions.h | 1 - 2 files changed, 10 deletions(-) diff --git a/third-party/windows-platform/environment.cpp b/third-party/windows-platform/environment.cpp index d6dab55..f218e20 100644 --- a/third-party/windows-platform/environment.cpp +++ b/third-party/windows-platform/environment.cpp @@ -3,15 +3,6 @@ using namespace std; -int setenv( const char *__name, const char *__value, int __replace ) -{ - string value = __name; - value += "="; - value += __value; - - return putenv( value.c_str() ); -} - const char* app_get_data_path() { static std::string envValue = ""; diff --git a/third-party/windows-platform/extern-definitions.h b/third-party/windows-platform/extern-definitions.h index 814b1e4..4b4ef27 100644 --- a/third-party/windows-platform/extern-definitions.h +++ b/third-party/windows-platform/extern-definitions.h @@ -20,7 +20,6 @@ #include -int setenv( const char* __name, const char* __value, int __replace ); const char* app_get_data_path(); static int strncasecmp(const char *s1, const char *s2, register int n) -- 2.7.4 From 1b05937f81661c41db0c26a55011d316bc461b47 Mon Sep 17 00:00:00 2001 From: Heeyong Song Date: Mon, 27 Apr 2020 12:55:28 +0900 Subject: [PATCH 02/16] DALi Version 1.5.9 Change-Id: I06066578477de54f63d067cd16ce2ba1f384579b --- dali/public-api/dali-adaptor-version.cpp | 2 +- packaging/dali-adaptor.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dali/public-api/dali-adaptor-version.cpp b/dali/public-api/dali-adaptor-version.cpp index d5c97a2..e4a7e7e 100644 --- a/dali/public-api/dali-adaptor-version.cpp +++ b/dali/public-api/dali-adaptor-version.cpp @@ -28,7 +28,7 @@ namespace Dali const unsigned int ADAPTOR_MAJOR_VERSION = 1; const unsigned int ADAPTOR_MINOR_VERSION = 5; -const unsigned int ADAPTOR_MICRO_VERSION = 8; +const unsigned int ADAPTOR_MICRO_VERSION = 9; const char * const ADAPTOR_BUILD_DATE = __DATE__ " " __TIME__; #ifdef DEBUG_ENABLED diff --git a/packaging/dali-adaptor.spec b/packaging/dali-adaptor.spec index 879b25c..7bfdf6e 100644 --- a/packaging/dali-adaptor.spec +++ b/packaging/dali-adaptor.spec @@ -17,7 +17,7 @@ Name: dali-adaptor Summary: The DALi Tizen Adaptor -Version: 1.5.8 +Version: 1.5.9 Release: 1 Group: System/Libraries License: Apache-2.0 and BSD-3-Clause and MIT -- 2.7.4 From c8c8d9f28d642007abff62c11c28b65961268a4b Mon Sep 17 00:00:00 2001 From: Heeyong Song Date: Mon, 27 Apr 2020 12:55:28 +0900 Subject: [PATCH 03/16] DALi Version 1.5.9 Change-Id: I06066578477de54f63d067cd16ce2ba1f384579b --- dali/public-api/dali-adaptor-version.cpp | 2 +- packaging/dali-adaptor.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dali/public-api/dali-adaptor-version.cpp b/dali/public-api/dali-adaptor-version.cpp index d5c97a2..e4a7e7e 100644 --- a/dali/public-api/dali-adaptor-version.cpp +++ b/dali/public-api/dali-adaptor-version.cpp @@ -28,7 +28,7 @@ namespace Dali const unsigned int ADAPTOR_MAJOR_VERSION = 1; const unsigned int ADAPTOR_MINOR_VERSION = 5; -const unsigned int ADAPTOR_MICRO_VERSION = 8; +const unsigned int ADAPTOR_MICRO_VERSION = 9; const char * const ADAPTOR_BUILD_DATE = __DATE__ " " __TIME__; #ifdef DEBUG_ENABLED diff --git a/packaging/dali-adaptor.spec b/packaging/dali-adaptor.spec index 879b25c..7bfdf6e 100644 --- a/packaging/dali-adaptor.spec +++ b/packaging/dali-adaptor.spec @@ -17,7 +17,7 @@ Name: dali-adaptor Summary: The DALi Tizen Adaptor -Version: 1.5.8 +Version: 1.5.9 Release: 1 Group: System/Libraries License: Apache-2.0 and BSD-3-Clause and MIT -- 2.7.4 From 41394934725551e977e1e0825a72669aa9d6637d Mon Sep 17 00:00:00 2001 From: Jiyun Yang Date: Wed, 22 Apr 2020 15:07:39 +0900 Subject: [PATCH 04/16] [Tizen] Temporarily modified so that window is no null Change-Id: I9eaa7eda8f6fb5eb6c89bcdc0765cb0038ed0cdf --- .../tizen-wayland/widget-application-impl-tizen.cpp | 4 ++-- dali/public-api/adaptor-framework/window.cpp | 21 +++++++++------------ 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/dali/internal/system/tizen-wayland/widget-application-impl-tizen.cpp b/dali/internal/system/tizen-wayland/widget-application-impl-tizen.cpp index ff22534..2b4b480 100644 --- a/dali/internal/system/tizen-wayland/widget-application-impl-tizen.cpp +++ b/dali/internal/system/tizen-wayland/widget-application-impl-tizen.cpp @@ -55,9 +55,9 @@ int OnInstanceInit(widget_base_instance_h instanceHandle, bundle *content, int w } else { - window = Dali::Window::New(PositionSize(0,0,w,h) ,"", false); - if( window ) + if(Internal::Adaptor::Adaptor::GetImplementation(application->GetAdaptor()).IsMultipleWindowSupported()) { + window = Dali::Window::New(PositionSize(0,0,w,h) ,"", false); DALI_LOG_RELEASE_INFO("Widget Instance create new Window (win:%p, cnt:%d) (%dx%d) (id:%s )\n", window, application->GetWidgetCount(), w, h, std::string(id).c_str()); } else diff --git a/dali/public-api/adaptor-framework/window.cpp b/dali/public-api/adaptor-framework/window.cpp index 9d8c830..d82b0c6 100644 --- a/dali/public-api/adaptor-framework/window.cpp +++ b/dali/public-api/adaptor-framework/window.cpp @@ -49,23 +49,20 @@ Window Window::New(PositionSize posSize, const std::string& name, const std::str isNewWindowAllowed = Internal::Adaptor::Adaptor::GetImplementation(adaptor).IsMultipleWindowSupported(); } - if (isNewWindowAllowed) + if (!isNewWindowAllowed) { - Internal::Adaptor::Window* window = Internal::Adaptor::Window::New(posSize, name, className, isTransparent); + DALI_LOG_ERROR("This device can't support multiple windows.\n"); + } + Internal::Adaptor::Window* window = Internal::Adaptor::Window::New(posSize, name, className, isTransparent); - Integration::SceneHolder sceneHolder = Integration::SceneHolder(window); + Integration::SceneHolder sceneHolder = Integration::SceneHolder(window); - if (isAdaptorAvailable) - { - Dali::Adaptor& adaptor = Internal::Adaptor::Adaptor::Get(); - Internal::Adaptor::Adaptor::GetImplementation(adaptor).AddWindow(sceneHolder, name, className, isTransparent); - } - newWindow = Window(window); - } - else + if (isAdaptorAvailable) { - DALI_LOG_ERROR("This device can't support multiple windows.\n"); + Dali::Adaptor& adaptor = Internal::Adaptor::Adaptor::Get(); + Internal::Adaptor::Adaptor::GetImplementation(adaptor).AddWindow(sceneHolder, name, className, isTransparent); } + newWindow = Window(window); return newWindow; } -- 2.7.4 From 7e09e25a54423ba157604dcc1f0a26befc75b5cc Mon Sep 17 00:00:00 2001 From: Jiyun Yang Date: Wed, 22 Apr 2020 15:07:41 +0900 Subject: [PATCH 05/16] [Tizen] Add DALi Autofill implementation Change-Id: Ie58e39c00e59a1a64197600e18480886bb0e9e12 --- build/tizen/CMakeLists.txt | 2 +- build/tizen/deps-check.cmake | 12 + .../devel-api/adaptor-framework/autofill-group.cpp | 89 ++++ dali/devel-api/adaptor-framework/autofill-group.h | 151 ++++++ dali/devel-api/adaptor-framework/autofill-item.cpp | 115 ++++ dali/devel-api/adaptor-framework/autofill-item.h | 210 ++++++++ .../adaptor-framework/autofill-manager.cpp | 126 +++++ .../devel-api/adaptor-framework/autofill-manager.h | 213 ++++++++ dali/devel-api/file.list | 6 + dali/internal/input/common/autofill-factory.h | 54 ++ dali/internal/input/common/autofill-group-impl.cpp | 44 ++ dali/internal/input/common/autofill-group-impl.h | 137 +++++ dali/internal/input/common/autofill-item-impl.cpp | 43 ++ dali/internal/input/common/autofill-item-impl.h | 174 ++++++ .../input/common/autofill-manager-impl.cpp | 44 ++ dali/internal/input/common/autofill-manager-impl.h | 190 +++++++ dali/internal/input/file.list | 39 +- .../tizen-wayland/autofill-factory-ecore-wl.cpp | 53 ++ .../tizen-wayland/autofill-group-impl-ecore-wl.cpp | 230 ++++++++ .../tizen-wayland/autofill-group-impl-ecore-wl.h | 150 ++++++ .../tizen-wayland/autofill-item-impl-ecore-wl.cpp | 207 +++++++ .../tizen-wayland/autofill-item-impl-ecore-wl.h | 195 +++++++ .../autofill-manager-impl-ecore-wl.cpp | 592 +++++++++++++++++++++ .../tizen-wayland/autofill-manager-impl-ecore-wl.h | 258 +++++++++ .../input/ubuntu-x11/autofill-factory-x.cpp | 54 ++ .../input/ubuntu-x11/autofill-group-impl-x.cpp | 134 +++++ .../input/ubuntu-x11/autofill-group-impl-x.h | 127 +++++ .../input/ubuntu-x11/autofill-item-impl-x.cpp | 155 ++++++ .../input/ubuntu-x11/autofill-item-impl-x.h | 171 ++++++ .../input/ubuntu-x11/autofill-manager-impl-x.cpp | 252 +++++++++ .../input/ubuntu-x11/autofill-manager-impl-x.h | 217 ++++++++ packaging/dali-adaptor.spec | 6 + 32 files changed, 4435 insertions(+), 15 deletions(-) create mode 100755 dali/devel-api/adaptor-framework/autofill-group.cpp create mode 100755 dali/devel-api/adaptor-framework/autofill-group.h create mode 100755 dali/devel-api/adaptor-framework/autofill-item.cpp create mode 100755 dali/devel-api/adaptor-framework/autofill-item.h create mode 100755 dali/devel-api/adaptor-framework/autofill-manager.cpp create mode 100755 dali/devel-api/adaptor-framework/autofill-manager.h create mode 100644 dali/internal/input/common/autofill-factory.h create mode 100755 dali/internal/input/common/autofill-group-impl.cpp create mode 100644 dali/internal/input/common/autofill-group-impl.h create mode 100755 dali/internal/input/common/autofill-item-impl.cpp create mode 100644 dali/internal/input/common/autofill-item-impl.h create mode 100755 dali/internal/input/common/autofill-manager-impl.cpp create mode 100644 dali/internal/input/common/autofill-manager-impl.h create mode 100755 dali/internal/input/tizen-wayland/autofill-factory-ecore-wl.cpp create mode 100755 dali/internal/input/tizen-wayland/autofill-group-impl-ecore-wl.cpp create mode 100644 dali/internal/input/tizen-wayland/autofill-group-impl-ecore-wl.h create mode 100755 dali/internal/input/tizen-wayland/autofill-item-impl-ecore-wl.cpp create mode 100644 dali/internal/input/tizen-wayland/autofill-item-impl-ecore-wl.h create mode 100755 dali/internal/input/tizen-wayland/autofill-manager-impl-ecore-wl.cpp create mode 100644 dali/internal/input/tizen-wayland/autofill-manager-impl-ecore-wl.h create mode 100755 dali/internal/input/ubuntu-x11/autofill-factory-x.cpp create mode 100755 dali/internal/input/ubuntu-x11/autofill-group-impl-x.cpp create mode 100644 dali/internal/input/ubuntu-x11/autofill-group-impl-x.h create mode 100755 dali/internal/input/ubuntu-x11/autofill-item-impl-x.cpp create mode 100644 dali/internal/input/ubuntu-x11/autofill-item-impl-x.h create mode 100755 dali/internal/input/ubuntu-x11/autofill-manager-impl-x.cpp create mode 100644 dali/internal/input/ubuntu-x11/autofill-manager-impl-x.h diff --git a/build/tizen/CMakeLists.txt b/build/tizen/CMakeLists.txt index 7c56a82..459a7b5 100644 --- a/build/tizen/CMakeLists.txt +++ b/build/tizen/CMakeLists.txt @@ -378,7 +378,7 @@ IF( ENABLE_LINK_TEST ) ADD_EXECUTABLE( ${LINKER_TEST_NAME} ${LINKER_TEST_SOURCES} ) MESSAGE(STATUS "libs: ${DALICORE_LDFLAGS}") TARGET_COMPILE_OPTIONS( ${LINKER_TEST_NAME} PRIVATE -I${ROOT_SRC_DIR} ${DALICORE_CFLAGS} ) - TARGET_LINK_LIBRARIES(${LINKER_TEST_NAME} ${name} ${DALICORE_LDFLAGS} ${VCONF_LDFLAGS} ${HARFBUZZ_LDFLAGS} ) + TARGET_LINK_LIBRARIES(${LINKER_TEST_NAME} ${name} ${DALICORE_LDFLAGS} ${VCONF_LDFLAGS} ${HARFBUZZ_LDFLAGS} ${AUTOFILL_LDFLAGS} ) TARGET_INCLUDE_DIRECTORIES( ${LINKER_TEST_NAME} PRIVATE ${DALI_TEST_SUITE_DIR} ) ENDIF() diff --git a/build/tizen/deps-check.cmake b/build/tizen/deps-check.cmake index b496dd9..b60bd0c 100644 --- a/build/tizen/deps-check.cmake +++ b/build/tizen/deps-check.cmake @@ -18,6 +18,9 @@ ARG_ENABLE( ENABLE_PROFILE enable_profile "${ENABLE_VAL};UBUNTU" "Select the var # Tizen Major version ARG_ENABLE( ENABLE_TIZEN_MAJOR_VERSION enable_tizen_major_version "${ENABLE_VAL};0" "Specify the Tizen Major version for backwards compatibility" ) +# Tizen Minor version +ARG_ENABLE( ENABLE_TIZEN_MINOR_VERSION enable_tizen_minor_version "${ENABLE_VAL};0" "Specify the Tizen Minor version for backwards compatibility" ) + ARG_ENABLE( ENABLE_FEEDBACK enable_feedback 1 "Enable feedback plugin" ) ARG_ENABLE( ENABLE_WAYLAND enable_wayland "${ENABLE_VAL}" "Build on Wayland" ) @@ -126,6 +129,13 @@ ENDIF() CHECK_MODULE_AND_SET( WAYLAND_EXTENSION xdg-shell-client text-client input-method-client [] ) +IF( enable_tizen_major_version GREATER 5 ) + IF( enable_tizen_minor_version GREATER 5 ) + CHECK_MODULE_AND_SET( AUTOFILL capi-ui-autofill [] ) + ADD_DEFINITIONS( -DCAPI_AUTOFILL_SUPPORT ) + ENDIF() +ENDIF() + # BUILD CONDITIONS IF( watch_available AND WEARABLE_PROFILE ) ADD_DEFINITIONS( -DAPPCORE_WATCH_AVAILABLE ) @@ -265,6 +275,8 @@ SET( DALI_LDFLAGS ${LIBCURL_LDFLAGS} ${LIBCRYPTO_LDFLAGS} ${HARFBUZZ_LDFLAGS} + ${AUTOFILL_LDFLAGS} + ${TPKP_CURL_LDFLAGS} ${UTILX_LDFLAGS} -lgif -lturbojpeg diff --git a/dali/devel-api/adaptor-framework/autofill-group.cpp b/dali/devel-api/adaptor-framework/autofill-group.cpp new file mode 100755 index 0000000..cca5b06 --- /dev/null +++ b/dali/devel-api/adaptor-framework/autofill-group.cpp @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// CLASS HEADER +#include + +// INTERNAL INCLUDES +#include + +namespace Dali +{ + +AutofillGroup::AutofillGroup() +{ +} + +AutofillGroup::AutofillGroup( Internal::Adaptor::AutofillGroup* internal ) +: BaseHandle( internal ) +{ +} + +AutofillGroup::~AutofillGroup() +{ +} + +AutofillGroup::AutofillGroup( const AutofillGroup& group ) +: BaseHandle( group ) +{ +} + +AutofillGroup& AutofillGroup::operator=( const AutofillGroup& group ) +{ + if( *this != group ) + { + BaseHandle::operator=( group ); + } + return *this; +} + +AutofillGroup AutofillGroup::DownCast( BaseHandle handle ) +{ + return AutofillGroup( dynamic_cast< Internal::Adaptor::AutofillGroup* >( handle.GetObjectPtr() ) ); +} + +const std::string& AutofillGroup::GetId() const +{ + return Internal::Adaptor::GetImplementation(*this).GetId(); +} + +void AutofillGroup::AddAutofillItem( Dali::AutofillItem item ) +{ + Internal::Adaptor::GetImplementation(*this).AddAutofillItem( item ); +} + +Dali::AutofillItem AutofillGroup::GetAutofillItem( const std::string& id ) +{ + return Internal::Adaptor::GetImplementation(*this).GetAutofillItem( id ); +} + +void AutofillGroup::SaveAutofillData() +{ + Internal::Adaptor::GetImplementation(*this).SaveAutofillData(); +} + +void AutofillGroup::RequestAuthentication() +{ + Internal::Adaptor::GetImplementation(*this).RequestAuthentication(); +} + +void AutofillGroup::SendFillRequest() +{ + Internal::Adaptor::GetImplementation(*this).SendFillRequest(); +} + +} // namespace Dali diff --git a/dali/devel-api/adaptor-framework/autofill-group.h b/dali/devel-api/adaptor-framework/autofill-group.h new file mode 100755 index 0000000..26bfe8d --- /dev/null +++ b/dali/devel-api/adaptor-framework/autofill-group.h @@ -0,0 +1,151 @@ +#ifndef DALI_AUTOFILL_GROUP_H +#define DALI_AUTOFILL_GROUP_H + +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// EXTERNAL INCLUDES +#include + +// INTERNAL INCLUDES +#include +#include + +namespace Dali +{ + +namespace Internal DALI_INTERNAL +{ +namespace Adaptor +{ +class AutofillGroup; +} +} + + +/** + * @brief The AutofillGroup class + * + * is used to group AutofillItems together. + */ +class DALI_ADAPTOR_API AutofillGroup : public BaseHandle +{ +public: + + /** + * @brief Creates an uninitialized AutofillGroup. + * + * To create AutofillGroup instance, please refer to Dali::AutofillManager::CreateAutofillGroup(). + */ + AutofillGroup(); + + /** + * @brief AutofillGroup Destructor. + */ + ~AutofillGroup(); + + /** + * @brief Copy constructor. + * + * @param[in] group AutofillGroup to copy. The copied player will point at the same implementation + */ + AutofillGroup( const AutofillGroup& group ); + + /** + * @brief Assignment operator. + * + * @param[in] group The AutofillGroup to assign from. + * @return The updated AutofillGroup. + */ + AutofillGroup& operator=( const AutofillGroup& group ); + + /** + * @brief Downcast a handle to AutofillGroup handle. + * + * If handle points to a AutofillGroup the downcast produces valid + * handle. If not the returned handle is left uninitialized. + * + * @param[in] handle Handle to an object + * @return Handle to a AutofillGroup or an uninitialized handle + */ + static AutofillGroup DownCast( BaseHandle handle ); + + /** + * @brief Equality operator. + * + * @param[in] rhs The AutofillGroup structure to test against + * @return True if AutofillGroups are equal + */ + bool operator==( const AutofillGroup& rhs ) const + { + if( &rhs == this ) + { + return true; + } + return false; + } + + /** + * @brief Gets AutofillGroup unique Id. + * + * @return AutofillGroup ID + */ + const std::string& GetId() const; + + /** + * @brief Adds AutofillItem to AutofillGroup itself in order to group. + * + * @param[in] item AutofillItem instance to be included in AutofillGroup + */ + void AddAutofillItem( Dali::AutofillItem item ); + + /** + * @brief Gets AutofillItem instance according to the id. + * + * @param[in] id AutofillItem Id to get from AutofillGroup List + * @return AutofillItem instance to match for Id + */ + Dali::AutofillItem GetAutofillItem( const std::string& id ); + + /** + * @brief Stores Autofill data in autofill group. + */ + void SaveAutofillData(); + + /** + * @brief Requests and receives autofill authentication information. + */ + void RequestAuthentication(); + + /** + * @brief Sends fill request to fill out the data. + */ + void SendFillRequest(); + +public: // Not intended for application developers + + /** + * @brief Internal constructor + */ + explicit DALI_INTERNAL AutofillGroup( Internal::Adaptor::AutofillGroup* internal ); + +}; + + +} // namespace Dali + +#endif // DALI_AUTOFILL_GROUP_H diff --git a/dali/devel-api/adaptor-framework/autofill-item.cpp b/dali/devel-api/adaptor-framework/autofill-item.cpp new file mode 100755 index 0000000..2b68534 --- /dev/null +++ b/dali/devel-api/adaptor-framework/autofill-item.cpp @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// CLASS HEADER +#include + +// INTERNAL INCLUDES +#include + +namespace Dali +{ + +AutofillItem::AutofillItem() +{ +} + +AutofillItem::AutofillItem( Internal::Adaptor::AutofillItem* internal ) +: BaseHandle( internal ) +{ +} + +AutofillItem::~AutofillItem() +{ +} + +AutofillItem::AutofillItem( const AutofillItem& item ) +: BaseHandle( item ) +{ +} + +AutofillItem& AutofillItem::operator=( const AutofillItem& item ) +{ + if( *this != item ) + { + BaseHandle::operator=( item ); + } + return *this; +} + +AutofillItem AutofillItem::DownCast( BaseHandle handle ) +{ + return AutofillItem( dynamic_cast< Internal::Adaptor::AutofillItem* >( handle.GetObjectPtr() ) ); +} + + +const std::string& AutofillItem::GetId() const +{ + return Internal::Adaptor::GetImplementation(*this).GetId(); +} + +const std::string& AutofillItem::GetLabel() const +{ + return Internal::Adaptor::GetImplementation(*this).GetLabel(); +} + +Dali::AutofillItem::Hint AutofillItem::GetHint() const +{ + return Internal::Adaptor::GetImplementation(*this).GetHint(); +} + +bool AutofillItem::IsSensitiveData() const +{ + return Internal::Adaptor::GetImplementation(*this).IsSensitiveData(); +} + +void AutofillItem::SetSaveValue( const std::string& value ) +{ + Internal::Adaptor::GetImplementation(*this).SetSaveValue( value ); +} + +const std::string& AutofillItem::GetSaveValue() const +{ + return Internal::Adaptor::GetImplementation(*this).GetSaveValue(); +} + +const std::string& AutofillItem::GetPresentationText( int index ) const +{ + return Internal::Adaptor::GetImplementation(*this).GetPresentationText( index ); +} + +const std::string& AutofillItem::GetFillValue( int index ) const +{ + return Internal::Adaptor::GetImplementation(*this).GetFillValue( index ); +} + +void AutofillItem::ClearPresentationTextList() +{ + Internal::Adaptor::GetImplementation(*this).ClearPresentationTextList(); +} + +void AutofillItem::ClearFillValueList() +{ + Internal::Adaptor::GetImplementation(*this).ClearFillValueList(); +} + +unsigned int AutofillItem::GetFillValueCount() +{ + return Internal::Adaptor::GetImplementation(*this).GetFillValueCount(); +} + +} // namespace Dali diff --git a/dali/devel-api/adaptor-framework/autofill-item.h b/dali/devel-api/adaptor-framework/autofill-item.h new file mode 100755 index 0000000..e47cb12 --- /dev/null +++ b/dali/devel-api/adaptor-framework/autofill-item.h @@ -0,0 +1,210 @@ +#ifndef DALI_AUTOFILL_ITEM_H +#define DALI_AUTOFILL_ITEM_H + +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// EXTERNAL INCLUDES +#include + +// INTERNAL INCLUDES +#include + +namespace Dali +{ + +namespace Internal DALI_INTERNAL +{ +namespace Adaptor +{ +class AutofillItem; +} +} + + +/** + * @brief The AutofillItem class + * + * is used to pass on data from the AutofillItem. + * AutofillItem includes Id, Label, Autofill Hint, and whether it is sensitive or not. + */ +class DALI_ADAPTOR_API AutofillItem : public BaseHandle +{ +public: + + /** + * @brief Enumeration for hint of the autofill item. + */ + enum class Hint + { + CREDIT_CARD_EXPIRATION_DATE, ///< Autofill hint for a credit card expiration date + CREDIT_CARD_EXPIRATION_DAY, ///< Autofill hint for a credit card expiration day + CREDIT_CARD_EXPIRATION_MONTH, ///< Autofill hint for a credit card expiration month + CREDIT_CARD_EXPIRATION_YEAR, ///< Autofill hint for a credit card expiration year + CREDIT_CARD_NUMBER, ///< Autofill hint for a credit card number + EMAIL_ADDRESS, ///< Autofill hint for an email address + NAME, ///< Autofill hint for a user's real name + PHONE, ///< Autofill hint for a phone number + POSTAL_ADDRESS, ///< Autofill hint for a postal address + POSTAL_CODE, ///< Autofill hint for a postal code + ID, ///< Autofill hint for a user's ID + PASSWORD, ///< Autofill hint for password + CREDIT_CARD_SECURITY_CODE ///< Autofill hint for a credit card security code + }; + +public: + + /** + * @brief Creates an uninitialized AutofillItem. + * + * To create AutofillItem instance, please refer to Dali::AutofillManager::CreateAutofillItem(). + */ + AutofillItem(); + + /** + * @brief AutofillItem Destructor. + */ + ~AutofillItem(); + + /** + * @brief Copy constructor. + * + * @param[in] item AutofillItem to copy. The copied player will point at the same implementation + */ + AutofillItem( const AutofillItem& item ); + + /** + * @brief Assignment operator. + * + * @param[in] item The AutofillItem to assign from. + * @return The updated AutofillItem. + */ + AutofillItem& operator=( const AutofillItem& item ); + + /** + * @brief Downcast a handle to AutofillItem handle. + * + * If handle points to a AutofillItem the downcast produces valid + * handle. If not the returned handle is left uninitialized. + * + * @param[in] handle Handle to an object + * @return Handle to a AutofillItem or an uninitialized handle + */ + static AutofillItem DownCast( BaseHandle handle ); + + /** + * @brief Equality operator. + * + * @param[in] rhs The AutofillItem structure to test against + * @return True if AutofillItems are equal + */ + bool operator==( const AutofillItem& rhs ) const + { + if( &rhs == this ) + { + return true; + } + return false; + } + + /** + * @brief Gets AutofillItem Id. + * + * @return AutofillItem Id + */ + const std::string& GetId() const; + + /** + * @brief Gets AutofillItem Label. + * + * @return AutofillItem Label + */ + const std::string& GetLabel() const; + + /** + * @brief Gets AutofillItem Hint. + * + * @return AutofillItem Hint + */ + Dali::AutofillItem::Hint GetHint() const; + + /** + * @brief Gets whether AutofillItem is sensitive data or not. + * + * @return True if the AutofillItem is sensitive. + */ + bool IsSensitiveData() const; + + /** + * @brief Sets AutofillItem value for saving. + * + * @param[in] value The value for saving + */ + void SetSaveValue( const std::string& value ); + + /** + * @brief Gets the saved value of AutofillItem. + * + * @return The saved value + */ + const std::string& GetSaveValue() const; + + /** + * @brief Gets the presentation text with a index of the list. + * + * @param index The index for the presentation text list + * @return The presentation text to show up for the fill value + */ + const std::string& GetPresentationText( int index ) const; + + /** + * @brief Gets the value to be filled with a index of the list. + * + * @param index The index for the value list + * @return The value to be filled + */ + const std::string& GetFillValue( int index ) const; + + /** + * @brief Clears the presentation text list. + */ + void ClearPresentationTextList(); + + /** + * @brief Clears the value list. + */ + void ClearFillValueList(); + + /** + * @brief Gets the number of fill value in the list. + * + * @return The number of fill value in the list + */ + unsigned int GetFillValueCount(); + +public: // Not intended for application developers + + /** + * @brief Internal constructor + */ + explicit DALI_INTERNAL AutofillItem( Internal::Adaptor::AutofillItem* internal ); + +}; + +} // namespace Dali + +#endif // DALI_AUTOFILL_ITEM_H diff --git a/dali/devel-api/adaptor-framework/autofill-manager.cpp b/dali/devel-api/adaptor-framework/autofill-manager.cpp new file mode 100755 index 0000000..4507004 --- /dev/null +++ b/dali/devel-api/adaptor-framework/autofill-manager.cpp @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// CLASS HEADER +#include + +// INTERNAL INCLUDES +#include + +namespace Dali +{ + +AutofillManager::AutofillManager() +{ +} + +AutofillManager::~AutofillManager() +{ +} + +AutofillManager AutofillManager::Get() +{ + return Internal::Adaptor::AutofillManager::Get(); +} + +AutofillManager::AutofillManager(Internal::Adaptor::AutofillManager *impl) +: BaseHandle(impl) +{ +} + +/////////////////////////////////////////////// Autofill Item and Group /////////////////////////////////////////////// + +Dali::AutofillItem AutofillManager::CreateAutofillItem( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool isSensitive ) +{ + return Internal::Adaptor::GetImplementation(*this).CreateAutofillItem( id, label, hint, isSensitive ); +} + +Dali::AutofillGroup AutofillManager::CreateAutofillGroup( const std::string& groupId ) +{ + return Internal::Adaptor::GetImplementation(*this).CreateAutofillGroup( groupId ); +} + + +/////////////////////////////////////////////// Autofill Authentication Information /////////////////////////////////////////////// + +bool AutofillManager::IsAutofillDataPresent() const +{ + return Internal::Adaptor::GetImplementation(*this).IsAutofillDataPresent(); +} + +bool AutofillManager::IsAuthenticationNeeded() const +{ + return Internal::Adaptor::GetImplementation(*this).IsAuthenticationNeeded(); +} + +const std::string& AutofillManager::GetAuthenticationServiceName() const +{ + return Internal::Adaptor::GetImplementation(*this).GetAuthenticationServiceName(); +} + +const std::string& AutofillManager::GetAuthenticationServiceMessage() const +{ + return Internal::Adaptor::GetImplementation(*this).GetAuthenticationServiceMessage(); +} + +const std::string& AutofillManager::GetAuthenticationServiceImagePath() const +{ + return Internal::Adaptor::GetImplementation(*this).GetAuthenticationServiceImagePath(); +} + +/////////////////////////////////////////////// Autofill Fill Response /////////////////////////////////////////////// + +const std::string& AutofillManager::GetFillItemId() const +{ + return Internal::Adaptor::GetImplementation(*this).GetFillItemId(); +} + +const std::string& AutofillManager::GetFillItemPresentationText() const +{ + return Internal::Adaptor::GetImplementation(*this).GetFillItemPresentationText(); +} + +const std::string& AutofillManager::GetFillItemValue() const +{ + return Internal::Adaptor::GetImplementation(*this).GetFillItemValue(); +} + +void AutofillManager::SaveAutofillData( Dali::AutofillGroup group ) +{ + Internal::Adaptor::GetImplementation(*this).SaveAutofillData( group ); +} + + +// Signals + +AutofillManager::AuthSignalType& AutofillManager::AuthenticationReceivedSignal() +{ + return Internal::Adaptor::GetImplementation(*this).AuthenticationReceivedSignal(); +} + +AutofillManager::FillSignalType& AutofillManager::FillResponseReceivedSignal() +{ + return Internal::Adaptor::GetImplementation(*this).FillResponseReceivedSignal(); +} + +AutofillManager::ListSignalType& AutofillManager::ListEventSignal() +{ + return Internal::Adaptor::GetImplementation(*this).ListEventSignal(); +} + + +} // namespace Dali diff --git a/dali/devel-api/adaptor-framework/autofill-manager.h b/dali/devel-api/adaptor-framework/autofill-manager.h new file mode 100755 index 0000000..fce0af9 --- /dev/null +++ b/dali/devel-api/adaptor-framework/autofill-manager.h @@ -0,0 +1,213 @@ +#ifndef DALI_AUTOFILL_MANAGER_H +#define DALI_AUTOFILL_MANAGER_H + +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// EXTERNAL INCLUDES +#include +#include + +// INTERNAL INCLUDES +#include +#include + +namespace Dali +{ + +namespace Internal DALI_INTERNAL +{ +namespace Adaptor +{ +class AutofillManager; +} +} + + +/** + * @brief The AutofillManager class + * + * allows the application to fill out the user data, such as email, account and address previously saved. + * Currently, Autofill is limited to text input box. Later it can be ScrollView, etc. + * + * Signals + * | %Signal Name | Method | + * |------------------------|-------------------------------------| + * | authenticationReceived | @ref AuthenticationReceivedSignal() | + * | fillResponseReceived | @ref FillResponseReceivedSignal() | + */ +class DALI_ADAPTOR_API AutofillManager : public BaseHandle +{ +public: + + + // TODO : Need to update parameter and return value according to each Signal + typedef Signal< void () > AuthSignalType; ///< Authentication Received Signal + typedef Signal< void ( AutofillItem ) > FillSignalType; ///< Fill Response Received Signal + typedef Signal< void () > ListSignalType; ///< List Event Signal for multi-group + +public: + + /** + * @brief Retrieves a handle to the instance of AutofillManager. + * + * @return A handle to the AutofillManager. + */ + static AutofillManager Get(); + + + /////////////////////////////////////////////// Autofill Item and Group /////////////////////////////////////////////// + + /** + * @brief Creates AutofillItem instance. + * + * @param[in] id A unique ID that does not always change on each launching + * @param[in] label An auxiliary means to guess heuristically what data is + * @param[in] hint The Hint - id (username), name, password, phone, credit card number, organization, and so on + * @param[in] isSensitive Whether this AutofillItem is a sensitive data or not + * @return A public handle to the newly allocated AutofillItem + */ + Dali::AutofillItem CreateAutofillItem( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool isSensitive ); + + /** + * @brief Creates AutofillGroup instance. + * + * @param[in] groupId A unique ID value of each AutofillGroup + * @return A public handle to the newly allocated AutofillGroup + */ + Dali::AutofillGroup CreateAutofillGroup( const std::string& groupId ); + + + /////////////////////////////////////////////// Autofill Authentication Information /////////////////////////////////////////////// + + /** + * @brief Gets the 'autofill data present' attribute in autofill authentication information. + * + * @return True if Autofill data is present + */ + bool IsAutofillDataPresent() const; + + /** + * @brief Gets the 'authentication needed' attribute in autofill authentication information. + * + * @return True if the authentication is needed in the current Autofill process. + */ + bool IsAuthenticationNeeded() const; + + /** + * @brief Gets the service name in autofill authentication information. + * + * @return The autofill authentication service name + */ + const std::string& GetAuthenticationServiceName() const; + + /** + * @brief Gets the service message in autofill authentication information. + * + * @return The autofill authentication service message + */ + const std::string& GetAuthenticationServiceMessage() const; + + /** + * @brief Gets the service logo image path in autofill authentication information. + * + * @return The autofill authentication service logo image path + */ + const std::string& GetAuthenticationServiceImagePath() const; + + + /////////////////////////////////////////////// Autofill Fill Response /////////////////////////////////////////////// + + /** + * @brief Gets the autofill ID in an autofill fill response item. + * + * @return The autofill fill response item ID + */ + const std::string& GetFillItemId() const; + + /** + * @brief Gets the presentation text in an autofill fill response item. + * + * @return The presentation text + */ + const std::string& GetFillItemPresentationText() const; + + /** + * @brief Gets the autofill value in an autofill fill response item. + * + * @return The autofill fill response item value + */ + const std::string& GetFillItemValue() const; + + /** + * @brief Stores the current Autofill data. + * + * @param[in] group The AutofillGroup to store the data + */ + void SaveAutofillData( Dali::AutofillGroup group ); + +public: + // Signals + /** + * @brief This is emitted when the authentication is needed and AutofillManager gets the information. + * + * @return The signal containing the received data + */ + AuthSignalType& AuthenticationReceivedSignal(); + + /** + * @brief This is emitted when AutofillManager receives the fill response. + * + * @return The signal containing the received data + */ + FillSignalType& FillResponseReceivedSignal(); + + /** + * @brief This is emitted when the list for multi fill response group is needed. + * + * @return The signal containing the received data + */ + ListSignalType& ListEventSignal(); + + // Construction & Destruction + /** + * @brief Constructor. + * + * Create an uninitialized handle. + * This can be initialized by calling AutofillManager::Get(). + */ + AutofillManager(); + + /** + * @brief Destructor + * + * This is non-virtual since derived Handle types must not contain data or virtual methods. + */ + ~AutofillManager(); + + /** + * @brief This constructor is used by AutofillManager::Get(). + * + * @param[in] autofillManager A pointer to the AutofillManager. + */ + explicit DALI_INTERNAL AutofillManager( Internal::Adaptor::AutofillManager* autofillManager ); + +}; + +} // namespace Dali + +#endif // DALI_AUTOFILL_MANAGER_H diff --git a/dali/devel-api/file.list b/dali/devel-api/file.list index 33c3ab3..41be6eb 100755 --- a/dali/devel-api/file.list +++ b/dali/devel-api/file.list @@ -3,6 +3,9 @@ SET( devel_api_src_files ${adaptor_devel_api_dir}/adaptor-framework/accessibility-adaptor.cpp ${adaptor_devel_api_dir}/adaptor-framework/application-devel.cpp + ${adaptor_devel_api_dir}/adaptor-framework/autofill-group.cpp + ${adaptor_devel_api_dir}/adaptor-framework/autofill-item.cpp + ${adaptor_devel_api_dir}/adaptor-framework/autofill-manager.cpp ${adaptor_devel_api_dir}/adaptor-framework/bitmap-saver.cpp ${adaptor_devel_api_dir}/adaptor-framework/clipboard.cpp ${adaptor_devel_api_dir}/adaptor-framework/clipboard-event-notifier.cpp @@ -44,6 +47,9 @@ SET( devel_api_adaptor_framework_header_files ${adaptor_devel_api_dir}/adaptor-framework/accessibility-gesture-event.h ${adaptor_devel_api_dir}/adaptor-framework/application-devel.h ${adaptor_devel_api_dir}/adaptor-framework/atspi-accessibility.h + ${adaptor_devel_api_dir}/adaptor-framework/autofill-group.h + ${adaptor_devel_api_dir}/adaptor-framework/autofill-item.h + ${adaptor_devel_api_dir}/adaptor-framework/autofill-manager.h ${adaptor_devel_api_dir}/adaptor-framework/bitmap-saver.h ${adaptor_devel_api_dir}/adaptor-framework/clipboard-event-notifier.h ${adaptor_devel_api_dir}/adaptor-framework/clipboard.h diff --git a/dali/internal/input/common/autofill-factory.h b/dali/internal/input/common/autofill-factory.h new file mode 100644 index 0000000..cc86821 --- /dev/null +++ b/dali/internal/input/common/autofill-factory.h @@ -0,0 +1,54 @@ +#ifndef DALI_INTERNAL_INPUT_COMMON_AUTOFILL_FACTORY_H +#define DALI_INTERNAL_INPUT_COMMON_AUTOFILL_FACTORY_H + +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// INTERNAL INCLUDES +#include +#include +#include + +namespace Dali +{ +namespace Internal +{ +namespace Adaptor +{ + +class AutofillGroup; +class AutofillItem; +class AutofillManager; + +namespace AutofillFactory +{ +// Factory function creating new AutofillGroup, AutofillItem, and AutofillManager +// Symbol exists but may be overriden during linking + + Dali::AutofillGroup CreateAutofillGroup( const std::string& groupId ); + + Dali::AutofillItem CreateAutofillItem( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool sensitiveData ); + + Dali::AutofillManager CreateAutofillManager(); + +} + +} // namespace Adaptor +} // namespace Internal +} // namespace Dali + +#endif // DALI_INTERNAL_INPUT_COMMON_AUTOFILL_FACTORY_H diff --git a/dali/internal/input/common/autofill-group-impl.cpp b/dali/internal/input/common/autofill-group-impl.cpp new file mode 100755 index 0000000..f2807e9 --- /dev/null +++ b/dali/internal/input/common/autofill-group-impl.cpp @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// CLASS HEADER +//#include + +// INTERNAL INCLUDES +#include + + +namespace Dali +{ + +namespace Internal +{ + +namespace Adaptor +{ + +Dali::AutofillGroup AutofillGroup::New( const std::string& groupId ) +{ + return Dali::Internal::Adaptor::AutofillFactory::CreateAutofillGroup( groupId ); +} + + +} // Adaptor + +} // Internal + +} // Dali diff --git a/dali/internal/input/common/autofill-group-impl.h b/dali/internal/input/common/autofill-group-impl.h new file mode 100644 index 0000000..f335c10 --- /dev/null +++ b/dali/internal/input/common/autofill-group-impl.h @@ -0,0 +1,137 @@ +#ifndef DALI_INTERNAL_AUTOFILL_GROUP_IMPL_H +#define DALI_INTERNAL_AUTOFILL_GROUP_IMPL_H + +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// EXTERNAL INCLUDES +#include + +// INTERNAL INCLUDES +#include + +namespace Dali +{ + +namespace Internal +{ + +namespace Adaptor +{ + +/** + * @brief This class is used to group AutofillItems. + */ +class AutofillGroup : public Dali::BaseObject +{ + +public: + + /** + * @brief Constructor. + * + * @param[in] groupId A unique ID value of each AutofillGroup + * @return A public handle to the newly allocated AutofillGroup. + */ + static Dali::AutofillGroup New( const std::string& groupId ); + + /** + * @brief Initialize AutofillGroup constructor. + */ + virtual void Initialize() = 0; + + /** + * @copydoc Dali::AutofillGroup::GetId() + */ + virtual const std::string& GetId() const = 0; + + /** + * @copydoc Dali::AutofillGroup::AddAutofillItem() + */ + virtual void AddAutofillItem( Dali::AutofillItem item ) = 0; + + /** + * @copydoc Dali::AutofillGroup::GetAutofillItem() + */ + virtual Dali::AutofillItem GetAutofillItem( const std::string& id ) = 0; + + /** + * @brief Clears all lists of AutofillItem added in AutofillGroup. + */ + virtual void ClearAutofillItemList() = 0; + + /** + * @copydoc Dali::AutofillGroup::SaveAutofillData() + */ + virtual void SaveAutofillData() = 0; + + /** + * @copydoc Dali::AutofillGroup::RequestAuthentication() + */ + virtual void RequestAuthentication() = 0; + + /** + * @copydoc Dali::AutofillGroup::SendFillRequest() + */ + virtual void SendFillRequest() = 0; + +public: + /** + * Constructor. + */ + AutofillGroup() = default; + +protected: + /** + * Destructor. + */ + ~AutofillGroup() = default; + +private: + // Undefined copy constructor + AutofillGroup( const AutofillGroup& autofillGroup ) = delete; + + // Undefined assignment operator + AutofillGroup& operator=( AutofillGroup& autofillGroup ) = delete; + +}; + +inline static Internal::Adaptor::AutofillGroup& GetImplementation(Dali::AutofillGroup& autofillGroup) +{ + DALI_ASSERT_ALWAYS( autofillGroup && "AutofillGroup handle is empty" ); + + BaseObject& handle = autofillGroup.GetBaseObject(); + + return static_cast(handle); +} + +inline static const Internal::Adaptor::AutofillGroup& GetImplementation(const Dali::AutofillGroup& autofillGroup) +{ + DALI_ASSERT_ALWAYS( autofillGroup && "AutofillGroup handle is empty" ); + + const BaseObject& handle = autofillGroup.GetBaseObject(); + + return static_cast(handle); +} + +} // namespace Adaptor + +} // namespace Internal + +} // namespace Dali + +#endif // DALI_INTERNAL_AUTOFILL_GROUP_IMPL_H diff --git a/dali/internal/input/common/autofill-item-impl.cpp b/dali/internal/input/common/autofill-item-impl.cpp new file mode 100755 index 0000000..eacf07e --- /dev/null +++ b/dali/internal/input/common/autofill-item-impl.cpp @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// CLASS HEADER +//#include + +// INTERNAL INCLUDES +#include + +namespace Dali +{ + +namespace Internal +{ + +namespace Adaptor +{ + +Dali::AutofillItem AutofillItem::New( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool sensitiveData ) +{ + return Dali::Internal::Adaptor::AutofillFactory::CreateAutofillItem( id, label, hint, sensitiveData ); +} + + +} // Adaptor + +} // Internal + +} // Dali diff --git a/dali/internal/input/common/autofill-item-impl.h b/dali/internal/input/common/autofill-item-impl.h new file mode 100644 index 0000000..92c5db8 --- /dev/null +++ b/dali/internal/input/common/autofill-item-impl.h @@ -0,0 +1,174 @@ +#ifndef DALI_INTERNAL_AUTOFILL_ITEM_IMPL_H +#define DALI_INTERNAL_AUTOFILL_ITEM_IMPL_H + +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// EXTERNAL INCLUDES +#include + +// INTERNAL INCLUDES +#include + +namespace Dali +{ + +namespace Internal +{ + +namespace Adaptor +{ + +/** + * @brief This class is used to pass on data from the AutofillItem of control. + */ +class AutofillItem : public Dali::BaseObject +{ + +public: + + /** + * @brief Constructor. + * + * @param[in] id A unique ID for this AutofillItem + * @param[in] label An auxiliary means to guess what data is + * @param[in] hint The hint - id (username), name, password, phone, credit card number, organization, and so on + * @param[in] sensitiveData Whether this AutofillItem is a sensitive data or not. (The default is false) + * @return A public handle to the newly allocated AutofillItem + */ + static Dali::AutofillItem New( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool sensitiveData ); + + /** + * @brief Initialize AutofillItem constructor. + */ + virtual void Initialize() = 0; + + /** + * @copydoc Dali::AutofillItem::GetId() + */ + virtual const std::string& GetId() const = 0; + + /** + * @copydoc Dali::AutofillItem::GetLabel() + */ + virtual const std::string& GetLabel() const = 0; + + /** + * @copydoc Dali::AutofillItem::GetHint() + */ + virtual Dali::AutofillItem::Hint GetHint() const = 0; + + /** + * @copydoc Dali::AutofillItem::IsSensitiveData() + */ + virtual bool IsSensitiveData() const = 0; + + /** + * @copydoc Dali::AutofillItem::SetSaveValue() + */ + virtual void SetSaveValue( const std::string& value ) = 0; + + /** + * @copydoc Dali::AutofillItem::GetSaveValue() + */ + virtual const std::string& GetSaveValue() const = 0; + + /** + * @brief Adds the presentation text to fill out in the list. + * + * @param[in] presentationText The presentation text to fill out + */ + virtual void AddPresentationList( const std::string& presentationText ) = 0; + + /** + * @brief Adds the value to fill out in the list. + * + * @param[in] fillValue The value to fill out + */ + virtual void AddFillValueList( const std::string& fillValue ) = 0; + + /** + * @copydoc Dali::AutofillItem::GetPresentationText() + */ + virtual const std::string& GetPresentationText( int index ) const = 0; + + /** + * @copydoc Dali::AutofillItem::GetFillValue() + */ + virtual const std::string& GetFillValue( int index ) const = 0; + + /** + * @copydoc Dali::AutofillItem::ClearPresentationTextList() + */ + virtual void ClearPresentationTextList() = 0; + + /** + * @copydoc Dali::AutofillItem::ClearFillValueList() + */ + virtual void ClearFillValueList() = 0; + + /** + * @copydoc Dali::AutofillItem::GetFillValueCount() + */ + virtual unsigned int GetFillValueCount() = 0; + +public: + /** + * Constructor. + */ + AutofillItem() = default; + +protected: + /** + * Destructor. + */ + ~AutofillItem() = default; + +private: + // Undefined copy constructor + AutofillItem( const AutofillItem& autofillItem ) = delete; + + // Undefined assignment operator + AutofillItem& operator=( AutofillItem& autofillItem ) = delete; + +}; + +inline static Internal::Adaptor::AutofillItem& GetImplementation(Dali::AutofillItem& autofillItem) +{ + DALI_ASSERT_ALWAYS( autofillItem && "AutofillItem handle is empty" ); + + BaseObject& handle = autofillItem.GetBaseObject(); + + return static_cast(handle); +} + +inline static const Internal::Adaptor::AutofillItem& GetImplementation(const Dali::AutofillItem& autofillItem) +{ + DALI_ASSERT_ALWAYS( autofillItem && "AutofillItem handle is empty" ); + + const BaseObject& handle = autofillItem.GetBaseObject(); + + return static_cast(handle); +} + +} // namespace Adaptor + +} // namespace Internal + +} // namespace Dali + +#endif // DALI_INTERNAL_AUTOFILL_ITEM_IMPL_H diff --git a/dali/internal/input/common/autofill-manager-impl.cpp b/dali/internal/input/common/autofill-manager-impl.cpp new file mode 100755 index 0000000..5dd466e --- /dev/null +++ b/dali/internal/input/common/autofill-manager-impl.cpp @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// CLASS HEADER +//#include + +// INTERNAL INCLUDES +#include + + +namespace Dali +{ + +namespace Internal +{ + +namespace Adaptor +{ + +Dali::AutofillManager AutofillManager::Get() +{ + return Dali::Internal::Adaptor::AutofillFactory::CreateAutofillManager(); +} + + +} // Adaptor + +} // Internal + +} // Dali diff --git a/dali/internal/input/common/autofill-manager-impl.h b/dali/internal/input/common/autofill-manager-impl.h new file mode 100644 index 0000000..48819ab --- /dev/null +++ b/dali/internal/input/common/autofill-manager-impl.h @@ -0,0 +1,190 @@ +#ifndef DALI_INTERNAL_AUTOFILL_MANAGER_IMPL_H +#define DALI_INTERNAL_AUTOFILL_MANAGER_IMPL_H + +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// EXTERNAL INCLUDES +#include + +// INTERNAL INCLUDES +#include + +namespace Dali +{ + +namespace Internal +{ + +namespace Adaptor +{ + +class AutofillManager : public Dali::BaseObject +{ + +public: + + /** + * @brief Gets the AutofillManager instance + * + * It creates the instance if it has not already been created. + * Internally, a check should be made using IsAvailable() before this is called as we do not want + * to create an instance if not needed by applications. + * @see IsAvailable() + */ + static Dali::AutofillManager Get(); + + /** + * @brief Connects Callbacks required for Autofill daemon. + */ + virtual void ConnectCallbacks() = 0; + + /** + * @copydoc Dali::AutofillManager::CreateAutofillItem() + */ + virtual Dali::AutofillItem CreateAutofillItem( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool isSensitive ) = 0; + + /** + * @copydoc Dali::AutofillManager::CreateAutofillGroup() + */ + virtual Dali::AutofillGroup CreateAutofillGroup( const std::string& groupId ) = 0; + + /** + * @copydoc Dali::AutofillManager::IsAutofillDataPresent() + */ + virtual bool IsAutofillDataPresent() const = 0; + + /** + * @copydoc Dali::AutofillManager::IsAuthenticationNeeded() + */ + virtual bool IsAuthenticationNeeded() const = 0; + + /** + * @copydoc Dali::AutofillManager::GetAuthenticationServiceName() + */ + virtual const std::string& GetAuthenticationServiceName() const = 0; + + /** + * @copydoc Dali::AutofillManager::GetAuthenticationServiceMessage() + */ + virtual const std::string& GetAuthenticationServiceMessage() const = 0; + + /** + * @copydoc Dali::AutofillManager::GetAuthenticationServiceImagePath() + */ + virtual const std::string& GetAuthenticationServiceImagePath() const = 0; + + /** + * @copydoc Dali::AutofillManager::GetFillItemId() + */ + virtual const std::string& GetFillItemId() const = 0; + + /** + * @copydoc Dali::AutofillManager::GetFillItemPresentationText() + */ + virtual const std::string& GetFillItemPresentationText() const = 0; + + /** + * @copydoc Dali::AutofillManager::GetFillItemValue() + */ + virtual const std::string& GetFillItemValue() const = 0; + + /** + * @copydoc Dali::AutofillManager::SaveAutofillData() + */ + virtual void SaveAutofillData( Dali::AutofillGroup group ) = 0; + +public: // Signals + + /** + * @copydoc Dali::AutofillManager::AuthenticationReceivedSignal() + */ + virtual Dali::AutofillManager::AuthSignalType& AuthenticationReceivedSignal() { return mAuthReceivedSignal; } + + /** + * @copydoc Dali::AutofillManager::FillResponseReceivedSignal() + */ + virtual Dali::AutofillManager::FillSignalType& FillResponseReceivedSignal() { return mFillReceivedSignal; } + + /** + * @copydoc Dali::AutofillManager::ListEventSignal() + */ + virtual Dali::AutofillManager::ListSignalType& ListEventSignal() { return mListReceivedSignal; } + +private: + /** + * Context created the first time and kept until deleted. + */ + virtual void CreateContext() = 0; + + /** + * Delete Autofill context. + */ + virtual void DeleteContext() = 0; + +public: + /** + * Constructor. + */ + AutofillManager() = default; + +protected: + /** + * Destructor. + */ + ~AutofillManager() = default; + +private: + // Undefined copy constructor + AutofillManager( const AutofillManager& autofillManager ) = delete; + + // Undefined assignment operator + AutofillManager& operator=( AutofillManager& autofillManager ) = delete; + +private: + Dali::AutofillManager::AuthSignalType mAuthReceivedSignal; ///< Authentication Received Signal + Dali::AutofillManager::FillSignalType mFillReceivedSignal; ///< Fill Response Received Signal + Dali::AutofillManager::ListSignalType mListReceivedSignal; ///< List Received Signal + + +}; + +inline static Internal::Adaptor::AutofillManager& GetImplementation(Dali::AutofillManager& autofillManager) +{ + DALI_ASSERT_ALWAYS( autofillManager && "AutofillManager handle is empty" ); + + BaseObject& handle = autofillManager.GetBaseObject(); + + return static_cast(handle); +} + +inline static const Internal::Adaptor::AutofillManager& GetImplementation(const Dali::AutofillManager& autofillManager) +{ + DALI_ASSERT_ALWAYS( autofillManager && "AutofillManager handle is empty" ); + + const BaseObject& handle = autofillManager.GetBaseObject(); + + return static_cast(handle); +} + +} // namespace Adaptor + +} // namespace Internal + +} // namespace Dali + +#endif // DALI_INTERNAL_AUTOFILL_MANAGER_IMPL_H diff --git a/dali/internal/input/file.list b/dali/internal/input/file.list index 3e447ce..c940bb7 100644 --- a/dali/internal/input/file.list +++ b/dali/internal/input/file.list @@ -1,28 +1,39 @@ # module: input, backend: common -SET( adaptor_input_common_src_files - ${adaptor_input_dir}/common/input-method-context-impl.cpp - ${adaptor_input_dir}/common/key-grab.cpp - ${adaptor_input_dir}/common/key-impl.cpp - ${adaptor_input_dir}/common/keyboard.cpp - ${adaptor_input_dir}/common/physical-keyboard-impl.cpp +SET( adaptor_input_common_src_files + ${adaptor_input_dir}/common/autofill-group-impl.cpp + ${adaptor_input_dir}/common/autofill-item-impl.cpp + ${adaptor_input_dir}/common/autofill-manager-impl.cpp + ${adaptor_input_dir}/common/input-method-context-impl.cpp + ${adaptor_input_dir}/common/key-grab.cpp + ${adaptor_input_dir}/common/key-impl.cpp + ${adaptor_input_dir}/common/keyboard.cpp + ${adaptor_input_dir}/common/physical-keyboard-impl.cpp ) # module: input, backend: tizen-wayland -SET( adaptor_input_tizen_wayland_src_files +SET( adaptor_input_tizen_wayland_src_files + ${adaptor_input_dir}/tizen-wayland/autofill-factory-ecore-wl.cpp + ${adaptor_input_dir}/tizen-wayland/autofill-group-impl-ecore-wl.cpp + ${adaptor_input_dir}/tizen-wayland/autofill-item-impl-ecore-wl.cpp + ${adaptor_input_dir}/tizen-wayland/autofill-manager-impl-ecore-wl.cpp ${adaptor_input_dir}/tizen-wayland/ecore-virtual-keyboard.cpp - ${adaptor_input_dir}/tizen-wayland/input-method-context-factory-ecore-wl.cpp - ${adaptor_input_dir}/tizen-wayland/input-method-context-impl-ecore-wl.cpp - ${adaptor_input_dir}/tizen-wayland/key-mapping-ecore-wl.cpp + ${adaptor_input_dir}/tizen-wayland/input-method-context-factory-ecore-wl.cpp + ${adaptor_input_dir}/tizen-wayland/input-method-context-impl-ecore-wl.cpp + ${adaptor_input_dir}/tizen-wayland/key-mapping-ecore-wl.cpp ${adaptor_input_dir}/tizen-wayland/virtual-keyboard-impl-ecore-wl.cpp ) # module: input, backend: ubuntu-x11 -SET( adaptor_input_ubuntu_x11_src_files +SET( adaptor_input_ubuntu_x11_src_files + ${adaptor_input_dir}/ubuntu-x11/autofill-factory-x.cpp + ${adaptor_input_dir}/ubuntu-x11/autofill-group-impl-x.cpp + ${adaptor_input_dir}/ubuntu-x11/autofill-item-impl-x.cpp + ${adaptor_input_dir}/ubuntu-x11/autofill-manager-impl-x.cpp ${adaptor_input_dir}/tizen-wayland/ecore-virtual-keyboard.cpp - ${adaptor_input_dir}/ubuntu-x11/input-method-context-factory-x.cpp - ${adaptor_input_dir}/ubuntu-x11/input-method-context-impl-x.cpp - ${adaptor_input_dir}/ubuntu-x11/key-mapping-x.cpp + ${adaptor_input_dir}/ubuntu-x11/input-method-context-factory-x.cpp + ${adaptor_input_dir}/ubuntu-x11/input-method-context-impl-x.cpp + ${adaptor_input_dir}/ubuntu-x11/key-mapping-x.cpp ${adaptor_input_dir}/ubuntu-x11/virtual-keyboard-impl-x.cpp ) diff --git a/dali/internal/input/tizen-wayland/autofill-factory-ecore-wl.cpp b/dali/internal/input/tizen-wayland/autofill-factory-ecore-wl.cpp new file mode 100755 index 0000000..4d7d912 --- /dev/null +++ b/dali/internal/input/tizen-wayland/autofill-factory-ecore-wl.cpp @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include +#include +#include +#include + +namespace Dali +{ +namespace Internal +{ +namespace Adaptor +{ + +namespace AutofillFactory +{ + +// Autofill Factory to be implemented by the platform +Dali::AutofillGroup CreateAutofillGroup( const std::string& groupId ) +{ + return Dali::Internal::Adaptor::AutofillGroupEcoreWl::New( groupId ); +} + +Dali::AutofillItem CreateAutofillItem( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool sensitiveData ) +{ + return Dali::Internal::Adaptor::AutofillItemEcorewWl::New( id, label, hint, sensitiveData ); +} + +Dali::AutofillManager CreateAutofillManager() +{ + return Dali::Internal::Adaptor::AutofillManagerEcoreWl::Get(); +} + +} + +} // namespace Adaptor +} // namespace Internal +} // namespace Dali diff --git a/dali/internal/input/tizen-wayland/autofill-group-impl-ecore-wl.cpp b/dali/internal/input/tizen-wayland/autofill-group-impl-ecore-wl.cpp new file mode 100755 index 0000000..73cbeff --- /dev/null +++ b/dali/internal/input/tizen-wayland/autofill-group-impl-ecore-wl.cpp @@ -0,0 +1,230 @@ +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// CLASS HEADER +#include + +// EXTERNAL INCLUDES +#include // for strcmp +#include +#include + +// INTERNAL INCLUDES +#include + +namespace Dali +{ + +namespace Internal +{ + +namespace Adaptor +{ + +namespace +{ +#if defined(DEBUG_ENABLED) +Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_AUTOFILL"); +#endif + +BaseHandle Create() +{ + return Dali::Internal::Adaptor::AutofillGroup::New( "" ); +} + +Dali::TypeRegistration type( typeid(Dali::AutofillGroup), typeid(Dali::BaseHandle), Create ); + +} // unnamed namespace + + +AutofillGroupEcoreWl::AutofillGroupEcoreWl( const std::string groupId ) +: mAutofillItemList(), + mGroupId( groupId ) +{ +#ifdef CAPI_AUTOFILL_SUPPORT + mAutofillGroupHandle = NULL; + mAutofillSaveGroupHandle = NULL; +#endif // CAPI_AUTOFILL_SUPPORT +} + +AutofillGroupEcoreWl::~AutofillGroupEcoreWl() +{ +#ifdef CAPI_AUTOFILL_SUPPORT + if( mAutofillGroupHandle ) + { + autofill_view_info_destroy( mAutofillGroupHandle ); + mAutofillGroupHandle = NULL; + } + if( mAutofillSaveGroupHandle ) + { + autofill_save_view_info_destroy( mAutofillSaveGroupHandle ); + mAutofillSaveGroupHandle = NULL; + } +#endif // CAPI_AUTOFILL_SUPPORT +} + + +Dali::AutofillGroup AutofillGroupEcoreWl::New( const std::string& groupId ) +{ + Dali::Internal::Adaptor::AutofillGroup* group = new Dali::Internal::Adaptor::AutofillGroupEcoreWl( groupId ); + Dali::AutofillGroup handle = Dali::AutofillGroup( group ); + group->Initialize(); + + return handle; +} + +void AutofillGroupEcoreWl::Initialize() +{ +#ifdef CAPI_AUTOFILL_SUPPORT + int ret = autofill_view_info_create( &mAutofillGroupHandle ); + if( ret != AUTOFILL_ERROR_NONE ) + { + DALI_LOG_ERROR( "Failed to create autofill group info handle : %d \n", ret ); + return; + } + + autofill_view_info_set_view_id( mAutofillGroupHandle, mGroupId.c_str() ); + +#endif // CAPI_AUTOFILL_SUPPORT +} + +const std::string& AutofillGroupEcoreWl::GetId() const +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillGroupEcoreWl::GetId \n" ); + return mGroupId; +} + +#ifdef CAPI_AUTOFILL_SUPPORT +autofill_view_info_h AutofillGroupEcoreWl::GetAutofillGroupHandle() +{ + return mAutofillGroupHandle; +} + +autofill_save_view_info_h AutofillGroupEcoreWl::GetAutofillSaveGroupHandle() +{ + return mAutofillSaveGroupHandle; +} +#endif // CAPI_AUTOFILL_SUPPORT + +void AutofillGroupEcoreWl::AddAutofillItem( Dali::AutofillItem item ) +{ +#ifdef CAPI_AUTOFILL_SUPPORT + Internal::Adaptor::AutofillItem& itemImpl = Internal::Adaptor::GetImplementation( item ); + Internal::Adaptor::AutofillItemEcorewWl& itemImplWl = static_cast( itemImpl ); + + if( mAutofillGroupHandle && itemImplWl.GetAutofillItemHandle() ) + { + autofill_view_info_add_item( mAutofillGroupHandle, itemImplWl.GetAutofillItemHandle() ); + } +#endif // CAPI_AUTOFILL_SUPPORT + + // Pushes back an AutofillItem to the ItemList of AutofillGroup. + mAutofillItemList.push_back( item ); +} + +Dali::AutofillItem AutofillGroupEcoreWl::GetAutofillItem( const std::string& id ) +{ + Dali::AutofillItem item = Dali::AutofillItem(); + for( std::vector::iterator iter = mAutofillItemList.begin(), endIter = mAutofillItemList.end(); iter != endIter; ++iter ) + { + const std::string& itemId = ( *iter ).GetId(); + + if( itemId.compare( id ) == 0 ) + { + item = ( *iter ); + } + } + return item; +} + +void AutofillGroupEcoreWl::ClearAutofillItemList() +{ + for( std::vector::iterator iter = mAutofillItemList.begin(), endIter = mAutofillItemList.end(); iter != endIter; ++iter ) + { + ( *iter ).ClearPresentationTextList(); + ( *iter ).ClearFillValueList(); + } +} + +void AutofillGroupEcoreWl::SaveAutofillData() +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillGroupEcoreWl::SaveAutofillData\n" ); +#ifdef CAPI_AUTOFILL_SUPPORT + // Creates autofill save view info handle. + autofill_save_view_info_create( &mAutofillSaveGroupHandle ); + autofill_save_view_info_set_view_id( mAutofillSaveGroupHandle, mGroupId.c_str() ); + + for( std::vector::iterator iter = mAutofillItemList.begin(), endIter = mAutofillItemList.end(); iter != endIter; ++iter ) + { + Internal::Adaptor::AutofillItem& itemImpl = Internal::Adaptor::GetImplementation( *iter ); + Internal::Adaptor::AutofillItemEcorewWl& itemImplWl = static_cast( itemImpl ); + + // Appends autofill save item in autofill save view. + autofill_save_view_info_add_item( mAutofillSaveGroupHandle, itemImplWl.GetAutofillSaveItemHandle() ); + } +#endif // CAPI_AUTOFILL_SUPPORT +} + +// If Autofill service sends authentication signal, AutofillManagerEcoreWl::ReceiveAuthInfo() would be called. +void AutofillGroupEcoreWl::RequestAuthentication() +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillGroupEcoreWl::RequestAuthentication\n" ); + +#ifdef CAPI_AUTOFILL_SUPPORT + Dali::AutofillManager manager = Dali::AutofillManager::Get(); + Internal::Adaptor::AutofillManager& managerImpl = Internal::Adaptor::GetImplementation( manager ); + Internal::Adaptor::AutofillManagerEcoreWl& managerImplWl = static_cast( managerImpl ); + + // Requests to invoke the authentication information. + // After requests of authentication, AutofillManagerEcoreWl::AuthInfoCallback would be called. + int ret = autofill_auth_info_request( managerImplWl.GetAutofillHandle(), mAutofillGroupHandle ); + if( ret != AUTOFILL_ERROR_NONE ) + { + DALI_LOG_ERROR( "Failed to request auth info. error : %d \n", ret ); + } +#endif // CAPI_AUTOFILL_SUPPORT +} + +// If Autofill service sends fill response signal, AutofillManagerEcoreWl::FillGroupItem() or +// AutofillManagerEcoreWl::FillMultipleGroupItem() would be called according to the number of group count. +void AutofillGroupEcoreWl::SendFillRequest() +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillGroupEcoreWl::SendFillRequest\n" ); + +#ifdef CAPI_AUTOFILL_SUPPORT + Dali::AutofillManager manager = Dali::AutofillManager::Get(); + Internal::Adaptor::AutofillManager& managerImpl = Internal::Adaptor::GetImplementation( manager ); + Internal::Adaptor::AutofillManagerEcoreWl& managerImplWl = static_cast( managerImpl ); + + // Removes all elements of each AutofillItem in AutofillGroup + ClearAutofillItemList(); + + // Sends fill request to fill out each input form. + // After request of fill data, AutofillManagerEcoreWl::FillResponseCallback would be called. + int ret = autofill_fill_request( managerImplWl.GetAutofillHandle(), mAutofillGroupHandle ); + if( ret != AUTOFILL_ERROR_NONE ) + { + DALI_LOG_ERROR( "Failed to request fill : %d \n", ret ); + } +#endif // CAPI_AUTOFILL_SUPPORT +} + +} // Adaptor + +} // Internal + +} // Dali diff --git a/dali/internal/input/tizen-wayland/autofill-group-impl-ecore-wl.h b/dali/internal/input/tizen-wayland/autofill-group-impl-ecore-wl.h new file mode 100644 index 0000000..0abdca3 --- /dev/null +++ b/dali/internal/input/tizen-wayland/autofill-group-impl-ecore-wl.h @@ -0,0 +1,150 @@ +#ifndef DALI_INTERNAL_AUTOFILL_GROUP_IMPL_ECORE_WL_H +#define DALI_INTERNAL_AUTOFILL_GROUP_IMPL_ECORE_WL_H + +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// EXTERNAL INCLUDES +#include +#ifdef CAPI_AUTOFILL_SUPPORT +#include +#endif // CAPI_AUTOFILL_SUPPORT +#include + +// INTERNAL INCLUDES +#include +#include + +namespace Dali +{ + +namespace Internal +{ + +namespace Adaptor +{ + + +/** + * @brief This class is used to group AutofillItems. + */ +class AutofillGroupEcoreWl : public Dali::Internal::Adaptor::AutofillGroup +{ + +public: + + /** + * @brief Constructor. + * + * @param[in] groupId A unique ID value of each AutofillGroup + * @return A public handle to the newly allocated AutofillGroup. + */ + static Dali::AutofillGroup New( const std::string& groupId ); + + /** + * @brief Initialize AutofillGroup constructor. + */ + void Initialize() override; + + /** + * @copydoc Dali::AutofillGroup::GetId() + */ + const std::string& GetId() const override; + +#ifdef CAPI_AUTOFILL_SUPPORT + /** + * @brief Gets Autofill framework group handle + * @return Autofill framework group handle, which type is 'autofill_view_info_h' + */ + autofill_view_info_h GetAutofillGroupHandle(); + + /** + * @brief Gets Autofill framework save group handle + * @return Autofill framework save group handle, which type is 'autofill_save_view_info_h' + */ + autofill_save_view_info_h GetAutofillSaveGroupHandle(); +#endif // CAPI_AUTOFILL_SUPPORT + + /** + * @copydoc Dali::AutofillGroup::AddAutofillItem() + */ + void AddAutofillItem( Dali::AutofillItem item ) override; + + /** + * @copydoc Dali::AutofillGroup::GetAutofillItem() + */ + Dali::AutofillItem GetAutofillItem( const std::string& id ) override; + + /** + * @brief Clears all lists of AutofillItem added in AutofillGroup. + */ + void ClearAutofillItemList() override; + + /** + * @copydoc Dali::AutofillGroup::SaveAutofillData() + */ + void SaveAutofillData() override; + + /** + * @copydoc Dali::AutofillGroup::RequestAuthentication() + */ + void RequestAuthentication() override; + + /** + * @copydoc Dali::AutofillGroup::SendFillRequest() + */ + void SendFillRequest() override; + +private: + /** + * Constructor. + */ + explicit AutofillGroupEcoreWl( const std::string groupId ); + +protected: + /** + * Destructor. + */ + ~AutofillGroupEcoreWl(); + +private: + // Undefined copy constructor + explicit AutofillGroupEcoreWl( const AutofillGroupEcoreWl& autofillGroup ) = delete; + + // Undefined assignment operator + AutofillGroupEcoreWl& operator=( AutofillGroupEcoreWl& autofillGroup ) = delete; + + +private: +#ifdef CAPI_AUTOFILL_SUPPORT + autofill_view_info_h mAutofillGroupHandle; ///< The Autofill Framework group handle + autofill_save_view_info_h mAutofillSaveGroupHandle; +#endif // CAPI_AUTOFILL_SUPPORT + + std::vector mAutofillItemList; ///< The List to add AutofillItem + std::string mGroupId; ///< The AutofillGroup ID + +}; + + +} // namespace Adaptor + +} // namespace Internal + +} // namespace Dali + +#endif // DALI_INTERNAL_AUTOFILL_GROUP_IMPL_ECORE_WL_H diff --git a/dali/internal/input/tizen-wayland/autofill-item-impl-ecore-wl.cpp b/dali/internal/input/tizen-wayland/autofill-item-impl-ecore-wl.cpp new file mode 100755 index 0000000..146f9cc --- /dev/null +++ b/dali/internal/input/tizen-wayland/autofill-item-impl-ecore-wl.cpp @@ -0,0 +1,207 @@ +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// CLASS HEADER +#include + +// EXTERNAL INCLUDES +#include +#include + +namespace Dali +{ + +namespace Internal +{ + +namespace Adaptor +{ + +namespace +{ +#if defined(DEBUG_ENABLED) +Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_AUTOFILL"); +#endif + +BaseHandle Create() +{ + return Dali::Internal::Adaptor::AutofillItem::New( "", "", Dali::AutofillItem::Hint::ID, false ); +} + +Dali::TypeRegistration type( typeid(Dali::AutofillItem), typeid(Dali::BaseHandle), Create ); + +} // unnamed namespace + + +AutofillItemEcorewWl::AutofillItemEcorewWl( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool sensitiveData ) +: mId( id ), + mLabel( label ), + mHint( hint ), + mSensitiveData( sensitiveData ), + mValue(""), + mPresentationTextList(), + mValueList() +{ +#ifdef CAPI_AUTOFILL_SUPPORT + mAutofillItemHandle = NULL; + mAutofillSaveItemHandle = NULL; +#endif // CAPI_AUTOFILL_SUPPORT +} + +AutofillItemEcorewWl::~AutofillItemEcorewWl() +{ +#ifdef CAPI_AUTOFILL_SUPPORT + if( mAutofillItemHandle ) + { + autofill_item_destroy( mAutofillItemHandle ); + mAutofillItemHandle = NULL; + } + + if( mAutofillSaveItemHandle ) + { + autofill_save_item_destroy( mAutofillSaveItemHandle ); + mAutofillSaveItemHandle = NULL; + } +#endif // CAPI_AUTOFILL_SUPPORT +} + + +Dali::AutofillItem AutofillItemEcorewWl::New( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool sensitiveData ) +{ + Dali::Internal::Adaptor::AutofillItem* item = new Dali::Internal::Adaptor::AutofillItemEcorewWl( id, label, hint, sensitiveData ); + Dali::AutofillItem handle = Dali::AutofillItem( item ); + item->Initialize(); + + return handle; +} + +void AutofillItemEcorewWl::Initialize() +{ +#ifdef CAPI_AUTOFILL_SUPPORT + int ret = autofill_item_create( &mAutofillItemHandle ); + if( ret != AUTOFILL_ERROR_NONE ) + { + DALI_LOG_ERROR( "Failed to create autofill item handle : %d \n", ret ); + return; + } + + autofill_item_set_id( mAutofillItemHandle, mId.c_str() ); + autofill_item_set_label( mAutofillItemHandle, mLabel.c_str() ); + autofill_item_set_sensitive_data( mAutofillItemHandle, mSensitiveData ); + + // Create autofill save item handle for save. + autofill_save_item_create( &mAutofillSaveItemHandle ); + autofill_save_item_set_id( mAutofillSaveItemHandle, mId.c_str() ); + autofill_save_item_set_label( mAutofillSaveItemHandle, mLabel.c_str() ); + autofill_save_item_set_sensitive_data( mAutofillSaveItemHandle, mSensitiveData ); + + autofill_hint_e value = static_cast(mHint); + autofill_item_set_autofill_hint( mAutofillItemHandle, value ); + autofill_save_item_set_autofill_hint( mAutofillSaveItemHandle, value); +#endif // CAPI_AUTOFILL_SUPPORT +} + +const std::string& AutofillItemEcorewWl::GetId() const +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillItemEcorewWl::GetId \n" ); + return mId; +} + +const std::string& AutofillItemEcorewWl::GetLabel() const +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillItemEcorewWl::GetLabel \n" ); + return mLabel; +} + + +Dali::AutofillItem::Hint AutofillItemEcorewWl::GetHint() const +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillItemEcorewWl::GetHint \n" ); + return mHint; +} + +bool AutofillItemEcorewWl::IsSensitiveData() const +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillItemEcorewWl::IsSensitiveData \n" ); + return mSensitiveData; +} + +void AutofillItemEcorewWl::SetSaveValue( const std::string& value ) +{ + mValue = value; +#ifdef CAPI_AUTOFILL_SUPPORT + autofill_save_item_set_value( mAutofillSaveItemHandle, mValue.c_str() ); +#endif // CAPI_AUTOFILL_SUPPORT +} + +const std::string& AutofillItemEcorewWl::GetSaveValue() const +{ + return mValue; +} + +#ifdef CAPI_AUTOFILL_SUPPORT +autofill_item_h AutofillItemEcorewWl::GetAutofillItemHandle() +{ + return mAutofillItemHandle; +} + +autofill_save_item_h AutofillItemEcorewWl::GetAutofillSaveItemHandle() +{ + return mAutofillSaveItemHandle; +} +#endif // CAPI_AUTOFILL_SUPPORT + +void AutofillItemEcorewWl::AddPresentationList( const std::string& presentationText ) +{ + mPresentationTextList.push_back( presentationText ); +} + +void AutofillItemEcorewWl::AddFillValueList( const std::string& fillValue ) +{ + mValueList.push_back( fillValue ); +} + +const std::string& AutofillItemEcorewWl::GetPresentationText( int index ) const +{ + return mPresentationTextList[index]; +} + +const std::string& AutofillItemEcorewWl::GetFillValue( int index ) const +{ + return mValueList[index]; +} + +void AutofillItemEcorewWl::ClearPresentationTextList() +{ + mPresentationTextList.clear(); +} + +void AutofillItemEcorewWl::ClearFillValueList() +{ + mValueList.clear(); +} + +unsigned int AutofillItemEcorewWl::GetFillValueCount() +{ + return mValueList.size(); +} + +} // Adaptor + +} // Internal + +} // Dali diff --git a/dali/internal/input/tizen-wayland/autofill-item-impl-ecore-wl.h b/dali/internal/input/tizen-wayland/autofill-item-impl-ecore-wl.h new file mode 100644 index 0000000..2fbbd6b --- /dev/null +++ b/dali/internal/input/tizen-wayland/autofill-item-impl-ecore-wl.h @@ -0,0 +1,195 @@ +#ifndef DALI_INTERNAL_AUTOFILL_ITEM_IMPL_ECORE_WL_H +#define DALI_INTERNAL_AUTOFILL_ITEM_IMPL_ECORE_WL_H + +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// EXTERNAL INCLUDES +#include +#ifdef CAPI_AUTOFILL_SUPPORT +#include +#endif // CAPI_AUTOFILL_SUPPORT +#include + +// INTERNAL INCLUDES +#include + +namespace Dali +{ + +namespace Internal +{ + +namespace Adaptor +{ + + +/** + * @brief This class is used to pass on data from the AutofillItem of control. + */ +class AutofillItemEcorewWl : public Dali::Internal::Adaptor::AutofillItem +{ + +public: + + /** + * @brief Constructor. + * + * @param[in] id A unique ID for this AutofillItem + * @param[in] label An auxiliary means to guess what data is + * @param[in] hint The hint - id (username), name, password, phone, credit card number, organization, and so on + * @param[in] sensitiveData Whether this AutofillItem is a sensitive data or not. (The default is false) + * @return A public handle to the newly allocated AutofillItem + */ + static Dali::AutofillItem New( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool sensitiveData ); + + /** + * @brief Initialize AutofillItem constructor. + */ + void Initialize() override; + + /** + * @copydoc Dali::AutofillItem::GetId() + */ + const std::string& GetId() const override; + + /** + * @copydoc Dali::AutofillItem::GetLabel() + */ + const std::string& GetLabel() const override; + + /** + * @copydoc Dali::AutofillItem::GetHint() + */ + Dali::AutofillItem::Hint GetHint() const override; + + /** + * @copydoc Dali::AutofillItem::IsSensitiveData() + */ + bool IsSensitiveData() const override; + + /** + * @copydoc Dali::AutofillItem::SetSaveValue() + */ + void SetSaveValue( const std::string& value ) override; + + /** + * @copydoc Dali::AutofillItem::GetSaveValue() + */ + const std::string& GetSaveValue() const override; + +#ifdef CAPI_AUTOFILL_SUPPORT + /** + * @brief Gets Autofill framework item handle + * @return Autofill framework item handle, which type is 'autofill_item_h' + */ + autofill_item_h GetAutofillItemHandle(); + + /** + * @brief Gets Autofill framework save item handle + * @return Autofill framework save item handle, which type is 'autofill_save_item_h' + */ + autofill_save_item_h GetAutofillSaveItemHandle(); +#endif // CAPI_AUTOFILL_SUPPORT + + /** + * @brief Adds the presentation text to fill out in the list. + * + * @param[in] presentationText The presentation text to fill out + */ + void AddPresentationList( const std::string& presentationText ) override; + + /** + * @brief Adds the value to fill out in the list. + * + * @param[in] fillValue The value to fill out + */ + void AddFillValueList( const std::string& fillValue ) override; + + /** + * @copydoc Dali::AutofillItem::GetPresentationText() + */ + const std::string& GetPresentationText( int index ) const override; + + /** + * @copydoc Dali::AutofillItem::GetFillValue() + */ + const std::string& GetFillValue( int index ) const override; + + /** + * @copydoc Dali::AutofillItem::ClearPresentationTextList() + */ + void ClearPresentationTextList() override; + + /** + * @copydoc Dali::AutofillItem::ClearFillValueList() + */ + void ClearFillValueList() override; + + /** + * @copydoc Dali::AutofillItem::GetFillValueCount() + */ + unsigned int GetFillValueCount() override; + +private: + /** + * Constructor. + */ + explicit AutofillItemEcorewWl( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool sensitiveData ); + +protected: + /** + * Destructor. + */ + ~AutofillItemEcorewWl(); + +private: + // Undefined copy constructor + explicit AutofillItemEcorewWl( const AutofillItemEcorewWl& autofillItem ) = delete; + + // Undefined assignment operator + AutofillItemEcorewWl& operator=( AutofillItemEcorewWl& autofillItem ) = delete; + +private: +#ifdef CAPI_AUTOFILL_SUPPORT + autofill_item_h mAutofillItemHandle; ///< The Autofill Framework item handle + autofill_save_item_h mAutofillSaveItemHandle; ///< The Autofill Framework save item handle for save +#endif // CAPI_AUTOFILL_SUPPORT + +// Data +private: + std::string mId; ///< The AutofillItem ID + std::string mLabel; ///< The AutofillItem Label + Dali::AutofillItem::Hint mHint; ///< The AutofillItem Hint (id (username), name, password, phone, credit card number, organization, so on) + bool mSensitiveData; ///< Whether the data is sensitive or not + + std::string mValue; + + std::vector mPresentationTextList; ///< The list for the presentation text to fill out + std::vector mValueList; ///< The list for the value to fill out + +}; + + + +} // namespace Adaptor + +} // namespace Internal + +} // namespace Dali + +#endif // DALI_INTERNAL_AUTOFILL_ITEM_IMPL_ECORE_WL_H diff --git a/dali/internal/input/tizen-wayland/autofill-manager-impl-ecore-wl.cpp b/dali/internal/input/tizen-wayland/autofill-manager-impl-ecore-wl.cpp new file mode 100755 index 0000000..79e0613 --- /dev/null +++ b/dali/internal/input/tizen-wayland/autofill-manager-impl-ecore-wl.cpp @@ -0,0 +1,592 @@ +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// CLASS HEADER +#include + +// EXTERNAL INCLUDES +#include +#include +#include + +// INTERNAL INCLUDES +#include + + +namespace Dali +{ + +namespace Internal +{ + +namespace Adaptor +{ + +namespace +{ +#if defined(DEBUG_ENABLED) +Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_AUTOFILL"); +#endif + +// Signals +const char* const SIGNAL_AUTHENTICATION_RECEIVED = "authenticationReceived"; +const char* const SIGNAL_FILL_RESPONSE_RECEIVED = "fillResponseReceived"; +const char* const SIGNAL_LIST_RECEIVED = "listReceived"; + + +#ifdef CAPI_AUTOFILL_SUPPORT + +// All methods in this range are Static function calls used by ecore 'c' style callback registration +static void ConnectionStatusChangedCallback( autofill_h autofillHandle, autofill_connection_status_e status, void *user_data ) +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillManagerEcoreWl::ConnectionStatusChangedCallback mAutofillHandle : %p \n", autofillHandle ); + + switch( status ) + { + case AUTOFILL_CONNECTION_STATUS_CONNECTED: + { + DALI_LOG_INFO( gLogFilter, Debug::General, "Autofill Connected.\n" ); + break; + } + case AUTOFILL_CONNECTION_STATUS_DISCONNECTED: + { + DALI_LOG_INFO( gLogFilter, Debug::General, "Autofill Disconnected.\n" ); + break; + } + case AUTOFILL_CONNECTION_STATUS_REJECTED: + { + DALI_LOG_INFO( gLogFilter, Debug::General, "Autofill Rejected.\n" ); + break; + } + default: + { + // Do nothing + break; + } + } +} + +// Callback to receive the authentication information. +static void AuthInfoCallback( autofill_h ah, autofill_auth_info_h authInfoHandle, void *data ) +{ + Dali::AutofillManager autofill = AutofillManager::Get(); + Internal::Adaptor::AutofillManager& autofillImpl = Internal::Adaptor::GetImplementation( autofill ); + Internal::Adaptor::AutofillManagerEcoreWl& autofillImplWl = static_cast( autofillImpl ); + autofillImplWl.ReceiveAuthInfo( authInfoHandle, data ); +} + +// If there's an only one fill response group, then this callback is called. +static bool FillResponseItemCallback( autofill_fill_response_item_h itemHandle, void *userData ) +{ + Dali::AutofillManager autofill = AutofillManager::Get(); + Internal::Adaptor::AutofillManager& autofillImpl = Internal::Adaptor::GetImplementation( autofill ); + Internal::Adaptor::AutofillManagerEcoreWl& autofillImplWl = static_cast( autofillImpl ); + autofillImplWl.FillGroupItem( itemHandle, userData ); // Implementation here + return true; +} + +// If the fill response groups are multiple, then this callback is called. +static bool FillResponseMultipleItemCallback( autofill_fill_response_item_h itemHandle, void *userData ) +{ + Dali::AutofillManager autofill = AutofillManager::Get(); + Internal::Adaptor::AutofillManager& autofillImpl = Internal::Adaptor::GetImplementation( autofill ); + Internal::Adaptor::AutofillManagerEcoreWl& autofillImplWl = static_cast( autofillImpl ); + autofillImplWl.FillMultipleGroupItem( itemHandle, userData ); // Implementation here + return true; +} + +// This callback is called according to the number of pairs to fill out. +static bool FillResponseGroupCallback( autofill_fill_response_group_h groupHandle, void *userData ) +{ + int* count = static_cast(userData); + + // According to the number of group count, Retrieves all fill response items of each fill response group. + if( *count == 1 ) + { + autofill_fill_response_group_foreach_item( groupHandle, FillResponseItemCallback, NULL ); + } + else if( *count > 1 ) + { + autofill_fill_response_group_foreach_item( groupHandle, FillResponseMultipleItemCallback, groupHandle ); + } + + return true; +} + +// Callback to receive autofill fill response. +static void FillResponseCallback( autofill_h autofillHandle, autofill_fill_response_h fillResponseHandle, void *data ) +{ + if( !fillResponseHandle ) + { + DALI_LOG_ERROR("Fill response handle is empty. \n"); + return; + } + + // Get fill response group count + int count = 0; + autofill_fill_response_get_group_count( fillResponseHandle, &count ); + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillManagerEcoreWl::FillResponseCallback group count : %d \n", count ); + + // Retrieves all groups of each fill response. + autofill_fill_response_foreach_group( fillResponseHandle, FillResponseGroupCallback, &count ); + + if( count > 1 ) + { + // Emits the signal to make a list of multiple data. + Dali::AutofillManager autofill = AutofillManager::Get(); + autofill.ListEventSignal().Emit(); + } +} +#endif // CAPI_AUTOFILL_SUPPORT + +BaseHandle Create() +{ + return Dali::AutofillManager::Get(); +} + +Dali::TypeRegistration typeRegistration( typeid(Dali::AutofillManager), typeid(Dali::BaseHandle), Create ); + +Dali::SignalConnectorType signalConnector1( typeRegistration, SIGNAL_AUTHENTICATION_RECEIVED, Dali::Internal::Adaptor::AutofillManagerEcoreWl::DoConnectSignal ); +Dali::SignalConnectorType signalConnector2( typeRegistration, SIGNAL_FILL_RESPONSE_RECEIVED, Dali::Internal::Adaptor::AutofillManagerEcoreWl::DoConnectSignal ); +Dali::SignalConnectorType signalConnector3( typeRegistration, SIGNAL_LIST_RECEIVED, Dali::Internal::Adaptor::AutofillManagerEcoreWl::DoConnectSignal ); + +} // unnamed namespace + + + +Dali::AutofillManager AutofillManagerEcoreWl::Get() +{ + Dali::AutofillManager autofill; + AutofillManagerEcoreWl *autofillPtr = NULL; + + Dali::SingletonService service( SingletonService::Get() ); + if( service ) + { + // Check whether the singleton is already created + Dali::BaseHandle handle = service.GetSingleton( typeid( Dali::AutofillManager ) ); + if( handle ) + { + // If so, downcast the handle + autofillPtr = dynamic_cast< AutofillManagerEcoreWl* >( handle.GetObjectPtr() ); + autofill = Dali::AutofillManager( autofillPtr ); + } + else if( Adaptor::IsAvailable() ) + { + // Create instance and register singleton only if the adaptor is available + autofillPtr = new AutofillManagerEcoreWl(); + autofill = Dali::AutofillManager( autofillPtr ); + service.Register( typeid( autofill ), autofill ); + + // Connect Autofill daemon at the first time + autofillPtr->CreateContext(); + autofillPtr->ConnectCallbacks(); + } + } + + return autofill; +} + +AutofillManagerEcoreWl::AutofillManagerEcoreWl() +: mAutofillGroup(), + mAuthenticationServiceName(""), + mAuthenticationServiceMessage(""), + mAuthenticationServiceImagePath(""), + mFillItemId(""), + mFillItemPresentationText(""), + mFillItemValue(""), + mIsDataPresent( false ), + mIsAuthNeeded( false ) +{ +#ifdef CAPI_AUTOFILL_SUPPORT + mAutofillHandle = NULL; +#endif // CAPI_AUTOFILL_SUPPORT +} + +AutofillManagerEcoreWl::~AutofillManagerEcoreWl() +{ + DeleteContext(); +} + +void AutofillManagerEcoreWl::CreateContext() +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillManagerEcoreWl::CreateContext\n" ); + +#ifdef CAPI_AUTOFILL_SUPPORT + int ret = autofill_create( &mAutofillHandle ); + if( ret != AUTOFILL_ERROR_NONE ) + { + DALI_LOG_ERROR( "Failed to create autofill handle : %d \n", ret ); + } +#endif // CAPI_AUTOFILL_SUPPORT +} + +void AutofillManagerEcoreWl::DeleteContext() +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillManagerEcoreWl::DeleteContext\n" ); +#ifdef CAPI_AUTOFILL_SUPPORT + if( mAutofillHandle ) + { + // Unsets the callback to receive the authentication information. + autofill_auth_info_unset_received_cb( mAutofillHandle ); + + autofill_destroy( mAutofillHandle ); + mAutofillHandle = NULL; + } +#endif // CAPI_AUTOFILL_SUPPORT +} + +// Callbacks for connecting to autofill daemon. +void AutofillManagerEcoreWl::ConnectCallbacks() +{ +#ifdef CAPI_AUTOFILL_SUPPORT + if( mAutofillHandle ) + { + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillManagerEcoreWl::ConnectCallbacks\n" ); + + int ret = autofill_connect( mAutofillHandle, ConnectionStatusChangedCallback, NULL ); + if( ret != AUTOFILL_ERROR_NONE ) + { + DALI_LOG_ERROR( "Failed to connect : %d \n", ret ); + } + + // Sets the callback to receive the authentication information. + autofill_auth_info_set_received_cb( mAutofillHandle, AuthInfoCallback, NULL ); + + // Sets the callback to receive autofill fill response. + autofill_fill_response_set_received_cb( mAutofillHandle, FillResponseCallback, NULL ); + } +#endif // CAPI_AUTOFILL_SUPPORT +} + + +/////////////////////////////////////////////// Autofill Callback implementation /////////////////////////////////////////////// + +#ifdef CAPI_AUTOFILL_SUPPORT + +autofill_h AutofillManagerEcoreWl::GetAutofillHandle() +{ + return mAutofillHandle; +} + +// Implementation to receive the authentication information. +void AutofillManagerEcoreWl::ReceiveAuthInfo( autofill_auth_info_h authInfoHandle, void *data ) +{ + bool autofillDataPresent = false; + bool authenticationNeeded = false; + char* serviceName = NULL; + char* serviceMessage = NULL; + char* serviceLogoImagePath = NULL; + char* groupId = NULL; + + // Gets the authentication information which is set by Autofill Service framework. + autofill_auth_info_get_view_id( authInfoHandle, &groupId ); + autofill_auth_info_get_autofill_data_present( authInfoHandle, &autofillDataPresent ); + autofill_auth_info_get_authentication_needed( authInfoHandle, &authenticationNeeded ); + + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillManagerEcoreWl::ReceiveAuthInfo group id : %s, Is autofill data present ? : %s, Is authentication needed ? : %s \n", + groupId, autofillDataPresent ? "true" : "false", authenticationNeeded ? "true" : "false" ); + + for( std::vector::iterator iter = mAutofillGroupList.begin(), endIter = mAutofillGroupList.end(); iter != endIter; ++iter ) + { + const std::string id = ( *iter ).GetId(); + if( id.compare( groupId ) == 0 ) + { + mAutofillGroup = ( *iter ); + break; + } + } + // Sets the 'autofill data present' and 'authentication needed' attributes in autofill authentication information. + mIsDataPresent = autofillDataPresent; + mIsAuthNeeded = authenticationNeeded; + + if( groupId ) + { + free( groupId ); + } + + if( !autofillDataPresent ) + { + DALI_LOG_ERROR( " -> The autofill data is not present now. \n" ); + return; + } + + // If autofill authentication is needed, get authentication service information and set to DALi member variables. + if( authenticationNeeded ) + { + // Gets the authentication service information which is set by Autofill Service framework. + autofill_auth_info_get_service_name( authInfoHandle, &serviceName ); + autofill_auth_info_get_service_message( authInfoHandle, &serviceMessage ); + autofill_auth_info_get_service_logo_image_path( authInfoHandle, &serviceLogoImagePath ); + + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillManagerEcoreWl::ReceiveAuthInfo service name : %s, logo path : %s, message : '%s' \n", + serviceName, serviceLogoImagePath, serviceMessage ); + + // Sets the authentication service information in order to use in other components. + mAuthenticationServiceName = serviceName; + mAuthenticationServiceMessage = serviceMessage; + mAuthenticationServiceImagePath = serviceLogoImagePath; + + // Emits the signal to receive the authentication information. + mAuthReceivedSignal.Emit(); + + if( serviceMessage ) + { + free( serviceMessage ); + } + + if( serviceName ) + { + free( serviceName ); + } + + if( serviceLogoImagePath ) + { + free( serviceLogoImagePath ); + } + } + else + { + // If Authentication is not needed, sends fill request directly to fill the data. + mAutofillGroup.SendFillRequest(); + } +} + +// Implementation to fill out the data +void AutofillManagerEcoreWl::FillGroupItem( autofill_fill_response_item_h itemHandle, void *userData ) +{ + char* id = NULL; + char* value = NULL; + char* presentationText = NULL; + + // Gets the fill response information which is set by Autofill Service framework. + autofill_fill_response_item_get_id( itemHandle, &id ); + autofill_fill_response_item_get_presentation_text( itemHandle, &presentationText ); + autofill_fill_response_item_get_value( itemHandle, &value ); + + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillManagerEcoreWl::FillResponseItemCallback item id : %s, value : %s, presentation text : %s\n", + id, value, presentationText ); + + // Sets the fill response information in order to use in other components. + mFillItemId = id; + mFillItemPresentationText = presentationText; + mFillItemValue = value; + + Dali::AutofillItem item = mAutofillGroup.GetAutofillItem( id ); + Internal::Adaptor::AutofillItem& itemImpl = Internal::Adaptor::GetImplementation( item ); + itemImpl.AddPresentationList( presentationText ); + itemImpl.AddFillValueList( value ); + + // Emits the signal to fill the data in text input field. + mFillReceivedSignal.Emit( item ); + + if( id ) + { + free( id ); + } + + if( value ) + { + free( value ); + } + + if( presentationText ) + { + free( presentationText ); + } + +} + +// Implementation to fill out the data when the group count is more than one. +void AutofillManagerEcoreWl::FillMultipleGroupItem( autofill_fill_response_item_h itemHandle, void *userData ) +{ + char* id = NULL; + char* value = NULL; + char* presentationText = NULL; + + // Gets the fill response information which is set by Autofill Service framework. + autofill_fill_response_item_get_id( itemHandle, &id ); + autofill_fill_response_item_get_presentation_text( itemHandle, &presentationText ); + autofill_fill_response_item_get_value( itemHandle, &value ); + + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillManagerEcoreWl::FillResponseMultipleItemCallback item id : %s, value : %s, presentation text : %s\n", + id, value, presentationText ); + + // Sets the fill response information in order to use in other components. + mFillItemId = id; + mFillItemPresentationText = presentationText; + mFillItemValue = value; + + Dali::AutofillItem item = mAutofillGroup.GetAutofillItem( id ); + Internal::Adaptor::AutofillItem& itemImpl = Internal::Adaptor::GetImplementation( item ); + itemImpl.AddPresentationList( presentationText ); + itemImpl.AddFillValueList( value ); + + if( id ) + { + free( id ); + } + + if( value ) + { + free( value ); + } + + if( presentationText ) + { + free( presentationText ); + } +} +#endif // CAPI_AUTOFILL_SUPPORT + + +/////////////////////////////////////////////// Autofill Item and Group /////////////////////////////////////////////// + +Dali::AutofillItem AutofillManagerEcoreWl::CreateAutofillItem( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool isSensitive ) +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillManagerEcoreWl::CreateAutofillItem \n" ); + + Dali::AutofillItem item = AutofillItem::New( id, label, hint, isSensitive ); + mAutofillItemList.push_back( item ); + + return mAutofillItemList.back(); +} + +Dali::AutofillGroup AutofillManagerEcoreWl::CreateAutofillGroup( const std::string& groupId ) +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillManagerEcoreWl::CreateAutofillGroup \n" ); + + Dali::AutofillGroup group = AutofillGroup::New( groupId ); + mAutofillGroupList.push_back( group ); + + return mAutofillGroupList.back(); +} + + +/////////////////////////////////////////////// Autofill Authentication Information /////////////////////////////////////////////// + +bool AutofillManagerEcoreWl::IsAutofillDataPresent() const +{ + return mIsDataPresent; +} + +bool AutofillManagerEcoreWl::IsAuthenticationNeeded() const +{ + return mIsAuthNeeded; +} + +const std::string& AutofillManagerEcoreWl::GetAuthenticationServiceName() const +{ + return mAuthenticationServiceName; +} + +const std::string& AutofillManagerEcoreWl::GetAuthenticationServiceMessage() const +{ + return mAuthenticationServiceMessage; +} + +const std::string& AutofillManagerEcoreWl::GetAuthenticationServiceImagePath() const +{ + return mAuthenticationServiceImagePath; +} + + +/////////////////////////////////////////////// Autofill Fill Response /////////////////////////////////////////////// + +const std::string& AutofillManagerEcoreWl::GetFillItemId() const +{ + return mFillItemId; +} + +const std::string& AutofillManagerEcoreWl::GetFillItemPresentationText() const +{ + return mFillItemPresentationText; +} + +const std::string& AutofillManagerEcoreWl::GetFillItemValue() const +{ + return mFillItemValue; +} + +void AutofillManagerEcoreWl::SaveAutofillData( Dali::AutofillGroup group ) +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillManagerEcoreWl::SaveAutofillData -> Sends request to store data. \n" ); + +#ifdef CAPI_AUTOFILL_SUPPORT + Internal::Adaptor::AutofillGroup& groupImpl = Internal::Adaptor::GetImplementation( group ); + Internal::Adaptor::AutofillGroupEcoreWl& groupImplWl = static_cast( groupImpl ); + + // Sends request to save autofill data. + int ret = autofill_commit( mAutofillHandle, groupImplWl.GetAutofillSaveGroupHandle() ); + if( ret != AUTOFILL_ERROR_NONE ) + { + DALI_LOG_ERROR( "Failed to request auth info. error : %d \n", ret ); + } +#endif // CAPI_AUTOFILL_SUPPORT +} + +// Signals +AutofillManagerEcoreWl::AuthSignalType& AutofillManagerEcoreWl::AuthenticationReceivedSignal() +{ + return mAuthReceivedSignal; +} + +AutofillManagerEcoreWl::FillSignalType& AutofillManagerEcoreWl::FillResponseReceivedSignal() +{ + return mFillReceivedSignal; +} + +AutofillManagerEcoreWl::ListSignalType& AutofillManagerEcoreWl::ListEventSignal() +{ + return mListReceivedSignal; +} + +bool AutofillManagerEcoreWl::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor ) +{ + Dali::BaseHandle handle( object ); + + bool connected( true ); + AutofillManagerEcoreWl* manager = dynamic_cast< AutofillManagerEcoreWl* >( object ); + + if( manager ) + { + if( 0 == signalName.compare( SIGNAL_AUTHENTICATION_RECEIVED ) ) + { + manager->AuthenticationReceivedSignal().Connect( tracker, functor ); + } + else if( 0 == signalName.compare( SIGNAL_FILL_RESPONSE_RECEIVED ) ) + { + manager->FillResponseReceivedSignal().Connect( tracker, functor ); + } + else if( 0 == signalName.compare( SIGNAL_LIST_RECEIVED ) ) + { + manager->ListEventSignal().Connect( tracker, functor ); + } + else + { + // signalName does not match any signal + connected = false; + } + } + + return connected; +} + +} // Adaptor + +} // Internal + +} // Dali diff --git a/dali/internal/input/tizen-wayland/autofill-manager-impl-ecore-wl.h b/dali/internal/input/tizen-wayland/autofill-manager-impl-ecore-wl.h new file mode 100644 index 0000000..4f84ff3 --- /dev/null +++ b/dali/internal/input/tizen-wayland/autofill-manager-impl-ecore-wl.h @@ -0,0 +1,258 @@ +#ifndef DALI_INTERNAL_AUTOFILL_MANAGER_IMPL_ECORE_WL_H +#define DALI_INTERNAL_AUTOFILL_MANAGER_IMPL_ECORE_WL_H + +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// EXTERNAL INCLUDES +#include +#ifdef CAPI_AUTOFILL_SUPPORT +#include +#endif // CAPI_AUTOFILL_SUPPORT +#include + +// INTERNAL INCLUDES +#include +#include + +namespace Dali +{ + +namespace Internal +{ + +namespace Adaptor +{ + +class AutofillManagerEcoreWl : public Dali::Internal::Adaptor::AutofillManager +{ + +public: + + using AuthSignalType = Dali::AutofillManager::AuthSignalType; + using FillSignalType = Dali::AutofillManager::FillSignalType; + using ListSignalType = Dali::AutofillManager::ListSignalType; + +public: + + /** + * @brief Gets the AutofillManager instance + * + * It creates the instance if it has not already been created. + * Internally, a check should be made using IsAvailable() before this is called as we do not want + * to create an instance if not needed by applications. + * @see IsAvailable() + */ + static Dali::AutofillManager Get(); + + /** + * @brief Connects Callbacks required for Autofill daemon. + */ + void ConnectCallbacks() override; + +#ifdef CAPI_AUTOFILL_SUPPORT + + /** + * @brief Gets Autofill framework handle + * @return Autofill framework handle, which type is 'autofill_h" + */ + autofill_h GetAutofillHandle(); + + /** + * @brief Implement to receives Autofill Authentication Information callback. + * + * In this method, gets authentication information and emits the signal to check the authentication. + * @param authInfoHandle The autofill authentication information handle + * @param data The data from authentication information callback + */ + void ReceiveAuthInfo( autofill_auth_info_h authInfoHandle, void *data ); + + /** + * @brief Implement to fill out the data. + * + * This method would emit the signal to fill out the data. + * @param itemHandle The autofill fill response item handle + * @param userData The data from fill response callback + */ + void FillGroupItem( autofill_fill_response_item_h itemHandle, void *userData ); + + /** + * @brief Implement to set multiple group information. + * + * This method would emit the signals to make lists and fill out the data. + * @param itemHandle The autofill fill response item handle + * @param userData The data from fill response callback + */ + void FillMultipleGroupItem( autofill_fill_response_item_h itemHandle, void *userData ); +#endif // CAPI_AUTOFILL_SUPPORT + + + /////////////////////////////////////////////// Autofill Item and Group /////////////////////////////////////////////// + + /** + * @copydoc Dali::AutofillManager::CreateAutofillItem() + */ + Dali::AutofillItem CreateAutofillItem( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool isSensitive ) override; + + /** + * @copydoc Dali::AutofillManager::CreateAutofillGroup() + */ + Dali::AutofillGroup CreateAutofillGroup( const std::string& groupId ) override; + + + /////////////////////////////////////////////// Autofill Authentication Information /////////////////////////////////////////////// + + /** + * @copydoc Dali::AutofillManager::IsAutofillDataPresent() + */ + bool IsAutofillDataPresent() const override; + + /** + * @copydoc Dali::AutofillManager::IsAuthenticationNeeded() + */ + bool IsAuthenticationNeeded() const override; + + /** + * @copydoc Dali::AutofillManager::GetAuthenticationServiceName() + */ + const std::string& GetAuthenticationServiceName() const override; + + /** + * @copydoc Dali::AutofillManager::GetAuthenticationServiceMessage() + */ + const std::string& GetAuthenticationServiceMessage() const override; + + /** + * @copydoc Dali::AutofillManager::GetAuthenticationServiceImagePath() + */ + const std::string& GetAuthenticationServiceImagePath() const override; + + + /////////////////////////////////////////////// Autofill Fill Response /////////////////////////////////////////////// + + /** + * @copydoc Dali::AutofillManager::GetFillItemId() + */ + const std::string& GetFillItemId() const override; + + /** + * @copydoc Dali::AutofillManager::GetFillItemPresentationText() + */ + const std::string& GetFillItemPresentationText() const override; + + /** + * @copydoc Dali::AutofillManager::GetFillItemValue() + */ + const std::string& GetFillItemValue() const override; + + /** + * @copydoc Dali::AutofillManager::SaveAutofillData() + */ + void SaveAutofillData( Dali::AutofillGroup group ) override; + +public: // Signals + + /** + * @copydoc Dali::AutofillManager::AuthenticationReceivedSignal() + */ + AuthSignalType& AuthenticationReceivedSignal() override; + + /** + * @copydoc Dali::AutofillManager::FillResponseReceivedSignal() + */ + FillSignalType& FillResponseReceivedSignal() override; + + /** + * @copydoc Dali::AutofillManager::ListEventSignal() + */ + ListSignalType& ListEventSignal() override; + + /** + * Connects a callback function with the object's signals. + * @param[in] object The object providing the signal. + * @param[in] tracker Used to disconnect the signal. + * @param[in] signalName The signal to connect to. + * @param[in] functor A newly allocated FunctorDelegate. + * @return True if the signal was connected. + * @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the caller is responsible for deleting the unused functor. + */ + static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor ); + +private: + /** + * Context created the first time and kept until deleted. + */ + void CreateContext() override; + + /** + * Delete Autofill context. + */ + void DeleteContext() override; + +private: + /** + * Constructor. + */ + explicit AutofillManagerEcoreWl(); + +protected: + /** + * Destructor. + */ + ~AutofillManagerEcoreWl(); + +private: + // Undefined copy constructor + explicit AutofillManagerEcoreWl( const AutofillManagerEcoreWl& autofillManager ) = delete; + + // Undefined assignment operator + AutofillManagerEcoreWl& operator=( AutofillManagerEcoreWl& autofillManager ) = delete; + +private: +#ifdef CAPI_AUTOFILL_SUPPORT + autofill_h mAutofillHandle; ///< The Autofill framework handle +#endif // CAPI_AUTOFILL_SUPPORT + Dali::AutofillGroup mAutofillGroup; + + std::vector mAutofillGroupList; ///< The list to manage AutofillGroup + std::vector mAutofillItemList; ///< The list to manage AutofillItem + +private: + AuthSignalType mAuthReceivedSignal; ///< Authentication Received Signal + FillSignalType mFillReceivedSignal; ///< Fill Response Received Signal + ListSignalType mListReceivedSignal; ///< List Received Signal + +private: + std::string mAuthenticationServiceName; ///< The autofill authentication service name + std::string mAuthenticationServiceMessage; ///< The autofill authentication service message + std::string mAuthenticationServiceImagePath; ///< The autofill authentication service logo image path + std::string mFillItemId; ///< The autofill fill response item ID + std::string mFillItemPresentationText; ///< The autofill fill response item presentation text + std::string mFillItemValue; ///< The autofill fill response item value (input data) + + bool mIsDataPresent; ///< The autofill data presence + bool mIsAuthNeeded; ///< The authentication need + +}; + +} // namespace Adaptor + +} // namespace Internal + +} // namespace Dali + +#endif // DALI_INTERNAL_AUTOFILL_MANAGER_IMPL_ECORE_WL_H diff --git a/dali/internal/input/ubuntu-x11/autofill-factory-x.cpp b/dali/internal/input/ubuntu-x11/autofill-factory-x.cpp new file mode 100755 index 0000000..06848ac --- /dev/null +++ b/dali/internal/input/ubuntu-x11/autofill-factory-x.cpp @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include +#include +#include +#include + +namespace Dali +{ +namespace Internal +{ +namespace Adaptor +{ + +namespace AutofillFactory +{ + +// Autofill Factory to be implemented by the platform + +Dali::AutofillGroup CreateAutofillGroup( const std::string& groupId ) +{ + return Dali::Internal::Adaptor::AutofillGroupX::New( groupId ); +} + +Dali::AutofillItem CreateAutofillItem( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool sensitiveData ) +{ + return Dali::Internal::Adaptor::AutofillItemX::New( id, label, hint, sensitiveData ); +} + +Dali::AutofillManager CreateAutofillManager() +{ + return Dali::Internal::Adaptor::AutofillManagerX::Get(); +} + +} + +} // namespace Adaptor +} // namespace Internal +} // namespace Dali diff --git a/dali/internal/input/ubuntu-x11/autofill-group-impl-x.cpp b/dali/internal/input/ubuntu-x11/autofill-group-impl-x.cpp new file mode 100755 index 0000000..4f6b775 --- /dev/null +++ b/dali/internal/input/ubuntu-x11/autofill-group-impl-x.cpp @@ -0,0 +1,134 @@ +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// CLASS HEADER +#include + +// EXTERNAL INCLUDES +#include +#include + + +namespace Dali +{ + +namespace Internal +{ + +namespace Adaptor +{ + +namespace +{ +#if defined(DEBUG_ENABLED) +Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_AUTOFILL"); +#endif + + +BaseHandle Create() +{ + return Dali::Internal::Adaptor::AutofillGroup::New( "" ); +} + +Dali::TypeRegistration type( typeid(Dali::AutofillGroup), typeid(Dali::BaseHandle), Create ); + +} // unnamed namespace + + +AutofillGroupX::AutofillGroupX( const std::string groupId ) +: mAutofillItemList(), + mGroupId( groupId ) +{ +} + +AutofillGroupX::~AutofillGroupX() +{ +} + +Dali::AutofillGroup AutofillGroupX::New( const std::string& groupId ) +{ + Dali::Internal::Adaptor::AutofillGroup* group = new Dali::Internal::Adaptor::AutofillGroupX( groupId ); + Dali::AutofillGroup handle = Dali::AutofillGroup( group ); + + group->Initialize(); + + return handle; +} + +void AutofillGroupX::Initialize() +{ +} + +const std::string& AutofillGroupX::GetId() const +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillGroupX::GetId \n" ); + return mGroupId; +} + +void AutofillGroupX::AddAutofillItem( Dali::AutofillItem item ) +{ + // Pushes back an AutofillItem to the ItemList of AutofillGroupX. + mAutofillItemList.push_back( item ); +} + +Dali::AutofillItem AutofillGroupX::GetAutofillItem( const std::string& id ) +{ + Dali::AutofillItem item = Dali::AutofillItem(); + for( std::vector::iterator iter = mAutofillItemList.begin(), endIter = mAutofillItemList.end(); iter != endIter; ++iter ) + { + const std::string& itemId = ( *iter ).GetId(); + + if( itemId.compare( id ) == 0 ) + { + item = ( *iter ); + } + } + return item; +} + +void AutofillGroupX::ClearAutofillItemList() +{ + for( std::vector::iterator iter = mAutofillItemList.begin(), endIter = mAutofillItemList.end(); iter != endIter; ++iter ) + { + ( *iter ).ClearPresentationTextList(); + ( *iter ).ClearFillValueList(); + } +} + +void AutofillGroupX::SaveAutofillData() +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillGroupX::SaveAutofillData\n" ); + // Do Nothing +} + +void AutofillGroupX::RequestAuthentication() +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillGroupX::RequestAuthentication\n" ); + // Do Nothing +} + +void AutofillGroupX::SendFillRequest() +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillGroupX::SendFillRequest\n" ); + // Do Nothing +} + +} // Adaptor + +} // Internal + +} // Dali diff --git a/dali/internal/input/ubuntu-x11/autofill-group-impl-x.h b/dali/internal/input/ubuntu-x11/autofill-group-impl-x.h new file mode 100644 index 0000000..4003215 --- /dev/null +++ b/dali/internal/input/ubuntu-x11/autofill-group-impl-x.h @@ -0,0 +1,127 @@ +#ifndef DALI_INTERNAL_AUTOFILL_GROUP_IMPL_X_H +#define DALI_INTERNAL_AUTOFILL_GROUP_IMPL_X_H + +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// EXTERNAL INCLUDES +#include +#include + +// INTERNAL INCLUDES +#include +#include + +namespace Dali +{ + +namespace Internal +{ + +namespace Adaptor +{ + + +/** + * @brief This class is used to group AutofillItems. + */ +class AutofillGroupX : public Dali::Internal::Adaptor::AutofillGroup +{ + +public: + + /** + * @brief Constructor. + * + * @param[in] groupId A unique ID value of each AutofillGroup + * @return A public handle to the newly allocated AutofillGroup. + */ + static Dali::AutofillGroup New( const std::string& groupId ); + + /** + * @brief Initialize AutofillGroup constructor. + */ + void Initialize() override; + + /** + * @copydoc Dali::AutofillGroup::GetId() + */ + const std::string& GetId() const override; + + /** + * @copydoc Dali::AutofillGroup::AddAutofillItem() + */ + void AddAutofillItem( Dali::AutofillItem item ) override; + + /** + * @copydoc Dali::AutofillGroup::GetAutofillItem() + */ + Dali::AutofillItem GetAutofillItem( const std::string& id ) override; + + /** + * @brief Clears all lists of AutofillItem added in AutofillGroup. + */ + void ClearAutofillItemList() override; + + /** + * @copydoc Dali::AutofillGroup::SaveAutofillData() + */ + void SaveAutofillData() override; + + /** + * @copydoc Dali::AutofillGroup::RequestAuthentication() + */ + void RequestAuthentication() override; + + /** + * @copydoc Dali::AutofillGroup::SendFillRequest() + */ + void SendFillRequest() override; + +private: + /** + * Constructor. + */ + explicit AutofillGroupX( const std::string groupId ); + +protected: + /** + * Destructor. + */ + ~AutofillGroupX(); + +private: + // Undefined copy constructor + explicit AutofillGroupX( const AutofillGroupX& autofillGroup ) = delete; + + // Undefined assignment operator + AutofillGroupX& operator=( AutofillGroupX& autofillGroup ) = delete; + +private: + std::vector mAutofillItemList; ///< The List to add AutofillItem + std::string mGroupId; ///< The AutofillGroup ID + +}; + + +} // namespace Adaptor + +} // namespace Internal + +} // namespace Dali + +#endif // DALI_INTERNAL_AUTOFILL_GROUP_IMPL_X_H diff --git a/dali/internal/input/ubuntu-x11/autofill-item-impl-x.cpp b/dali/internal/input/ubuntu-x11/autofill-item-impl-x.cpp new file mode 100755 index 0000000..9801552 --- /dev/null +++ b/dali/internal/input/ubuntu-x11/autofill-item-impl-x.cpp @@ -0,0 +1,155 @@ +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// CLASS HEADER +#include + +// EXTERNAL INCLUDES + +#include +#include + +namespace Dali +{ + +namespace Internal +{ + +namespace Adaptor +{ + +namespace +{ +#if defined(DEBUG_ENABLED) +Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_AUTOFILL"); +#endif + + +BaseHandle Create() +{ + return Dali::Internal::Adaptor::AutofillItem::New( "", "", Dali::AutofillItem::Hint::ID, false ); +} + +Dali::TypeRegistration type( typeid(Dali::AutofillItem), typeid(Dali::BaseHandle), Create ); + +} // unnamed namespace + + +AutofillItemX::AutofillItemX( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool sensitiveData ) +: mId( id ), + mLabel( label ), + mHint( hint ), + mSensitiveData( sensitiveData ), + mValue(""), + mPresentationTextList(), + mValueList() +{ +} + +AutofillItemX::~AutofillItemX() +{ +} + + +Dali::AutofillItem AutofillItemX::New( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool sensitiveData ) +{ + Dali::Internal::Adaptor::AutofillItem* item = new Dali::Internal::Adaptor::AutofillItemX( id, label, hint, sensitiveData ); + Dali::AutofillItem handle = Dali::AutofillItem( item ); + + item->Initialize(); + + return handle; +} + +void AutofillItemX::Initialize() +{ +} + +const std::string& AutofillItemX::GetId() const +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillItemX::GetId \n" ); + return mId; +} + +const std::string& AutofillItemX::GetLabel() const +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillItemX::GetLabel \n" ); + return mLabel; +} + +Dali::AutofillItem::Hint AutofillItemX::GetHint() const +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillItemX::GetHint \n" ); + return mHint; +} + +bool AutofillItemX::IsSensitiveData() const +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillItemX::IsSensitiveData \n" ); + return mSensitiveData; +} + +void AutofillItemX::SetSaveValue( const std::string& value ) +{ + mValue = value; +} + +const std::string& AutofillItemX::GetSaveValue() const +{ + return mValue; +} + +void AutofillItemX::AddPresentationList( const std::string& presentationText ) +{ + mPresentationTextList.push_back( presentationText ); +} + +void AutofillItemX::AddFillValueList( const std::string& fillValue ) +{ + mValueList.push_back( fillValue ); +} + +const std::string& AutofillItemX::GetPresentationText( int index ) const +{ + return mPresentationTextList[index]; +} + +const std::string& AutofillItemX::GetFillValue( int index ) const +{ + return mValueList[index]; +} + +void AutofillItemX::ClearPresentationTextList() +{ + mPresentationTextList.clear(); +} + +void AutofillItemX::ClearFillValueList() +{ + mValueList.clear(); +} + +unsigned int AutofillItemX::GetFillValueCount() +{ + return mValueList.size(); +} + +} // Adaptor + +} // Internal + +} // Dali diff --git a/dali/internal/input/ubuntu-x11/autofill-item-impl-x.h b/dali/internal/input/ubuntu-x11/autofill-item-impl-x.h new file mode 100644 index 0000000..c7b8985 --- /dev/null +++ b/dali/internal/input/ubuntu-x11/autofill-item-impl-x.h @@ -0,0 +1,171 @@ +#ifndef DALI_INTERNAL_AUTOFILL_ITEM_IMPL_X_H +#define DALI_INTERNAL_AUTOFILL_ITEM_IMPL_X_H + +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// EXTERNAL INCLUDES +#include +#include + +// INTERNAL INCLUDES +#include + +namespace Dali +{ + +namespace Internal +{ + +namespace Adaptor +{ + +/** + * @brief This class is used to pass on data from the AutofillItem of control. + */ +class AutofillItemX : public Dali::Internal::Adaptor::AutofillItem +{ + +public: + + /** + * @brief Constructor. + * + * @param[in] id A unique ID for this AutofillItem + * @param[in] label An auxiliary means to guess what data is + * @param[in] hint The hint - id (username), name, password, phone, credit card number, organization, and so on + * @param[in] sensitiveData Whether this AutofillItem is a sensitive data or not. (The default is false) + * @return A public handle to the newly allocated AutofillItem + */ + static Dali::AutofillItem New( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool sensitiveData ); + + /** + * @brief Initialize AutofillItem constructor. + */ + void Initialize() override; + + /** + * @copydoc Dali::AutofillItem::GetId() + */ + const std::string& GetId() const override; + + /** + * @copydoc Dali::AutofillItem::GetLabel() + */ + const std::string& GetLabel() const override; + + /** + * @copydoc Dali::AutofillItem::GetHint() + */ + Dali::AutofillItem::Hint GetHint() const override; + + /** + * @copydoc Dali::AutofillItem::IsSensitiveData() + */ + bool IsSensitiveData() const override; + + /** + * @copydoc Dali::AutofillItem::SetSaveValue() + */ + void SetSaveValue( const std::string& value ) override; + + /** + * @copydoc Dali::AutofillItem::GetSaveValue() + */ + const std::string& GetSaveValue() const override; + + /** + * @brief Adds the presentation text to fill out in the list. + * + * @param[in] presentationText The presentation text to fill out + */ + void AddPresentationList( const std::string& presentationText ) override; + + /** + * @brief Adds the value to fill out in the list. + * + * @param[in] fillValue The value to fill out + */ + void AddFillValueList( const std::string& fillValue ) override; + + /** + * @copydoc Dali::AutofillItem::GetPresentationText() + */ + const std::string& GetPresentationText( int index ) const override; + + /** + * @copydoc Dali::AutofillItem::GetFillValue() + */ + const std::string& GetFillValue( int index ) const override; + + /** + * @copydoc Dali::AutofillItem::ClearPresentationTextList() + */ + void ClearPresentationTextList() override; + + /** + * @copydoc Dali::AutofillItem::ClearFillValueList() + */ + void ClearFillValueList() override; + + /** + * @copydoc Dali::AutofillItem::GetFillValueCount() + */ + unsigned int GetFillValueCount() override; + +private: + /** + * Constructor. + */ + explicit AutofillItemX( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool sensitiveData ); + +protected: + /** + * Destructor. + */ + ~AutofillItemX(); + +private: + // Undefined copy constructor + explicit AutofillItemX( const AutofillItemX& autofillItem ) = delete; + + // Undefined assignment operator + AutofillItemX& operator=( AutofillItemX& autofillItem ) = delete; + + +// Data +private: + std::string mId; ///< The AutofillItem ID + std::string mLabel; ///< The AutofillItem Label + Dali::AutofillItem::Hint mHint; ///< The AutofillItem Hint (id (username), name, password, phone, credit card number, organization, so on) + bool mSensitiveData; ///< Whether the data is sensitive or not + + std::string mValue; + + std::vector mPresentationTextList; ///< The list for the presentation text to fill out + std::vector mValueList; ///< The list for the value to fill out + +}; + + +} // namespace Adaptor + +} // namespace Internal + +} // namespace Dali + +#endif // DALI_INTERNAL_AUTOFILL_ITEM_IMPL_X_H diff --git a/dali/internal/input/ubuntu-x11/autofill-manager-impl-x.cpp b/dali/internal/input/ubuntu-x11/autofill-manager-impl-x.cpp new file mode 100755 index 0000000..25c289f --- /dev/null +++ b/dali/internal/input/ubuntu-x11/autofill-manager-impl-x.cpp @@ -0,0 +1,252 @@ +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// CLASS HEADER +#include + +// EXTERNAL INCLUDES +#include +#include +#include + +// INTERNAL INCLUDES +#include + +namespace Dali +{ + +namespace Internal +{ + +namespace Adaptor +{ + +namespace +{ +#if defined(DEBUG_ENABLED) +Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_AUTOFILL"); +#endif + +// Signals +const char* const SIGNAL_AUTHENTICATION_RECEIVED = "authenticationReceived"; +const char* const SIGNAL_FILL_RESPONSE_RECEIVED = "fillResponseReceived"; +const char* const SIGNAL_LIST_RECEIVED = "listReceived"; + +BaseHandle Create() +{ + return Dali::AutofillManager::Get(); +} + +Dali::TypeRegistration typeRegistration( typeid(Dali::AutofillManager), typeid(Dali::BaseHandle), Create ); + +Dali::SignalConnectorType signalConnector1( typeRegistration, SIGNAL_AUTHENTICATION_RECEIVED, Dali::Internal::Adaptor::AutofillManagerX::DoConnectSignal ); +Dali::SignalConnectorType signalConnector2( typeRegistration, SIGNAL_FILL_RESPONSE_RECEIVED, Dali::Internal::Adaptor::AutofillManagerX::DoConnectSignal ); +Dali::SignalConnectorType signalConnector3( typeRegistration, SIGNAL_LIST_RECEIVED, Dali::Internal::Adaptor::AutofillManagerX::DoConnectSignal ); + +} // unnamed namespace + + + +Dali::AutofillManager AutofillManagerX::Get() +{ + Dali::AutofillManager autofill; + AutofillManagerX *autofillPtr = NULL; + + Dali::SingletonService service( SingletonService::Get() ); + if( service ) + { + // Check whether the singleton is already created + Dali::BaseHandle handle = service.GetSingleton( typeid( Dali::AutofillManager ) ); + if( handle ) + { + // If so, downcast the handle + autofillPtr = dynamic_cast< AutofillManagerX* >( handle.GetObjectPtr() ); + autofill = Dali::AutofillManager( autofillPtr ); + } + else if( Adaptor::IsAvailable() ) + { + // Create instance and register singleton only if the adaptor is available + autofillPtr = new AutofillManagerX(); + autofill = Dali::AutofillManager( autofillPtr ); + service.Register( typeid( autofill ), autofill ); + } + } + + return autofill; +} + +AutofillManagerX::AutofillManagerX() +: mAutofillGroup(), + mAuthenticationServiceName(""), + mAuthenticationServiceMessage(""), + mAuthenticationServiceImagePath(""), + mFillItemId(""), + mFillItemPresentationText(""), + mFillItemValue(""), + mIsDataPresent( false ), + mIsAuthNeeded( false ) +{ +} + +AutofillManagerX::~AutofillManagerX() +{ + DeleteContext(); +} + +void AutofillManagerX::ConnectCallbacks() +{ +} + +void AutofillManagerX::CreateContext() +{ +} + +void AutofillManagerX::DeleteContext() +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillManagerX::DeleteContext\n" ); + // Do Nothing +} + + +/////////////////////////////////////////////// Autofill Item and Group /////////////////////////////////////////////// + +Dali::AutofillItem AutofillManagerX::CreateAutofillItem( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool isSensitive ) +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillManagerX::CreateAutofillItem \n" ); + + Dali::AutofillItem item = AutofillItem::New( id, label, hint, isSensitive ); + mAutofillItemList.push_back( item ); + + return mAutofillItemList.back(); +} + +Dali::AutofillGroup AutofillManagerX::CreateAutofillGroup( const std::string& groupId ) +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillManagerX::CreateAutofillGroup \n" ); + + Dali::AutofillGroup group = AutofillGroup::New( groupId ); + mAutofillGroupList.push_back( group ); + + return mAutofillGroupList.back(); +} + + +/////////////////////////////////////////////// Autofill Authentication Information /////////////////////////////////////////////// + +bool AutofillManagerX::IsAutofillDataPresent() const +{ + return mIsDataPresent; +} + +bool AutofillManagerX::IsAuthenticationNeeded() const +{ + return mIsAuthNeeded; +} + +const std::string& AutofillManagerX::GetAuthenticationServiceName() const +{ + return mAuthenticationServiceName; +} + +const std::string& AutofillManagerX::GetAuthenticationServiceMessage() const +{ + return mAuthenticationServiceMessage; +} + +const std::string& AutofillManagerX::GetAuthenticationServiceImagePath() const +{ + return mAuthenticationServiceImagePath; +} + + +/////////////////////////////////////////////// Autofill Fill Response /////////////////////////////////////////////// + +const std::string& AutofillManagerX::GetFillItemId() const +{ + return mFillItemId; +} + +const std::string& AutofillManagerX::GetFillItemPresentationText() const +{ + return mFillItemPresentationText; +} + +const std::string& AutofillManagerX::GetFillItemValue() const +{ + return mFillItemValue; +} + +void AutofillManagerX::SaveAutofillData( Dali::AutofillGroup group ) +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillManagerX::SaveAutofillData\n" ); + // Do Nothing +} + +// Signals +AutofillManagerX::AuthSignalType& AutofillManagerX::AuthenticationReceivedSignal() +{ + return mAuthReceivedSignal; +} + +AutofillManagerX::FillSignalType& AutofillManagerX::FillResponseReceivedSignal() +{ + return mFillReceivedSignal; +} + +AutofillManagerX::ListSignalType& AutofillManagerX::ListEventSignal() +{ + return mListReceivedSignal; +} + +bool AutofillManagerX::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor ) +{ + Dali::BaseHandle handle( object ); + + bool connected( true ); + AutofillManagerX* manager = dynamic_cast< AutofillManagerX* >( object ); + + if( manager ) + { + if( 0 == signalName.compare( SIGNAL_AUTHENTICATION_RECEIVED ) ) + { + manager->AuthenticationReceivedSignal().Connect( tracker, functor ); + } + else if( 0 == signalName.compare( SIGNAL_FILL_RESPONSE_RECEIVED ) ) + { + manager->FillResponseReceivedSignal().Connect( tracker, functor ); + } + else if( 0 == signalName.compare( SIGNAL_LIST_RECEIVED ) ) + { + manager->ListEventSignal().Connect( tracker, functor ); + } + else + { + // signalName does not match any signal + connected = false; + } + } + + return connected; +} + + + +} // Adaptor + +} // Internal + +} // Dali diff --git a/dali/internal/input/ubuntu-x11/autofill-manager-impl-x.h b/dali/internal/input/ubuntu-x11/autofill-manager-impl-x.h new file mode 100644 index 0000000..1b0b3e9 --- /dev/null +++ b/dali/internal/input/ubuntu-x11/autofill-manager-impl-x.h @@ -0,0 +1,217 @@ +#ifndef DALI_INTERNAL_AUTOFILL_MANAGER_IMPL_X_H +#define DALI_INTERNAL_AUTOFILL_MANAGER_IMPL_X_H + +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// EXTERNAL INCLUDES +#include +#include + +// INTERNAL INCLUDES +#include +#include + +namespace Dali +{ + +namespace Internal +{ + +namespace Adaptor +{ + +class AutofillManagerX : public Dali::Internal::Adaptor::AutofillManager +{ + +public: + + using AuthSignalType = Dali::AutofillManager::AuthSignalType; + using FillSignalType = Dali::AutofillManager::FillSignalType; + using ListSignalType = Dali::AutofillManager::ListSignalType; + +public: + + /** + * @brief Gets the AutofillManager instance + * + * It creates the instance if it has not already been created. + * Internally, a check should be made using IsAvailable() before this is called as we do not want + * to create an instance if not needed by applications. + * @see IsAvailable() + */ + static Dali::AutofillManager Get(); + + /** + * @brief Connects Callbacks required for Autofill daemon. + */ + void ConnectCallbacks() override; + + + /////////////////////////////////////////////// Autofill Item and Group /////////////////////////////////////////////// + + /** + * @copydoc Dali::AutofillManager::CreateAutofillItem() + */ + Dali::AutofillItem CreateAutofillItem( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool isSensitive ) override; + + /** + * @copydoc Dali::AutofillManager::CreateAutofillGroup() + */ + Dali::AutofillGroup CreateAutofillGroup( const std::string& groupId ) override; + + + /////////////////////////////////////////////// Autofill Authentication Information /////////////////////////////////////////////// + + /** + * @copydoc Dali::AutofillManager::IsAutofillDataPresent() + */ + bool IsAutofillDataPresent() const override; + + /** + * @copydoc Dali::AutofillManager::IsAuthenticationNeeded() + */ + bool IsAuthenticationNeeded() const override; + + /** + * @copydoc Dali::AutofillManager::GetAuthenticationServiceName() + */ + const std::string& GetAuthenticationServiceName() const override; + + /** + * @copydoc Dali::AutofillManager::GetAuthenticationServiceMessage() + */ + const std::string& GetAuthenticationServiceMessage() const override; + + /** + * @copydoc Dali::AutofillManager::GetAuthenticationServiceImagePath() + */ + const std::string& GetAuthenticationServiceImagePath() const override; + + + /////////////////////////////////////////////// Autofill Fill Response /////////////////////////////////////////////// + + /** + * @copydoc Dali::AutofillManager::GetFillItemId() + */ + const std::string& GetFillItemId() const override; + + /** + * @copydoc Dali::AutofillManager::GetFillItemPresentationText() + */ + const std::string& GetFillItemPresentationText() const override; + + /** + * @copydoc Dali::AutofillManager::GetFillItemValue() + */ + const std::string& GetFillItemValue() const override; + + /** + * @copydoc Dali::AutofillManager::SaveAutofillData() + */ + void SaveAutofillData( Dali::AutofillGroup group ) override; + +public: // Signals + + /** + * @copydoc Dali::AutofillManager::AuthenticationReceivedSignal() + */ + AuthSignalType& AuthenticationReceivedSignal() override; + + /** + * @copydoc Dali::AutofillManager::FillResponseReceivedSignal() + */ + FillSignalType& FillResponseReceivedSignal() override; + + /** + * @copydoc Dali::AutofillManager::ListEventSignal() + */ + ListSignalType& ListEventSignal() override; + + /** + * Connects a callback function with the object's signals. + * @param[in] object The object providing the signal. + * @param[in] tracker Used to disconnect the signal. + * @param[in] signalName The signal to connect to. + * @param[in] functor A newly allocated FunctorDelegate. + * @return True if the signal was connected. + * @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the caller is responsible for deleting the unused functor. + */ + static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor ); + +private: + /** + * Context created the first time and kept until deleted. + */ + void CreateContext() override; + + /** + * Delete Autofill context. + */ + void DeleteContext() override; + +private: + /** + * Constructor. + */ + explicit AutofillManagerX(); + +protected: + /** + * Destructor. + */ + ~AutofillManagerX(); + +private: + // Undefined copy constructor + explicit AutofillManagerX( const AutofillManagerX& autofillManager ) = delete; + + // Undefined assignment operator + AutofillManagerX& operator=( AutofillManagerX& autofillManager ) = delete; + +private: + Dali::AutofillGroup mAutofillGroup; + + std::vector mAutofillGroupList; ///< The list to manage AutofillGroup + std::vector mAutofillItemList; ///< The list to manage AutofillItem + +private: + AuthSignalType mAuthReceivedSignal; ///< Authentication Received Signal + FillSignalType mFillReceivedSignal; ///< Fill Response Received Signal + ListSignalType mListReceivedSignal; ///< List Received Signal + +private: + std::string mAuthenticationServiceName; ///< The autofill authentication service name + std::string mAuthenticationServiceMessage; ///< The autofill authentication service message + std::string mAuthenticationServiceImagePath; ///< The autofill authentication service logo image path + std::string mFillItemId; ///< The autofill fill response item ID + std::string mFillItemPresentationText; ///< The autofill fill response item presentation text + std::string mFillItemValue; ///< The autofill fill response item value (input data) + + bool mIsDataPresent; ///< The autofill data presence + bool mIsAuthNeeded; ///< The authentication need + +}; + + +} // namespace Adaptor + +} // namespace Internal + +} // namespace Dali + +#endif // DALI_INTERNAL_AUTOFILL_MANAGER_IMPL_X_H diff --git a/packaging/dali-adaptor.spec b/packaging/dali-adaptor.spec index 7bfdf6e..6b855f7 100644 --- a/packaging/dali-adaptor.spec +++ b/packaging/dali-adaptor.spec @@ -100,6 +100,11 @@ BuildRequires: pkgconfig(ecore-imf) BuildRequires: pkgconfig(capi-system-system-settings) +# for autofill +%if 0%{?tizen_version_major} >= 5 && 0%{?tizen_version_minor} >= 5 +BuildRequires: pkgconfig(capi-ui-autofill) +%endif + # for feedback plugin BuildRequires: pkgconfig(mm-sound) BuildRequires: pkgconfig(feedback) @@ -298,6 +303,7 @@ cmake_flags+=" -DCMAKE_INSTALL_PREFIX=$PREFIX" cmake_flags+=" -DCMAKE_INSTALL_LIBDIR=%{_libdir}" cmake_flags+=" -DCMAKE_INSTALL_INCLUDEDIR=%{_includedir}" cmake_flags+=" -DENABLE_TIZEN_MAJOR_VERSION=%{tizen_version_major}" +cmake_flags+=" -DENABLE_TIZEN_MINOR_VERSION=%{tizen_version_minor}" cmake_flags+=" -DENABLE_FEEDBACK=YES" cmake_flags+=" -DENABLE_APPFW=YES" -- 2.7.4 From 1427b3fd59a952185ca3c34804c5c62ef86c8a0f Mon Sep 17 00:00:00 2001 From: Jiyun Yang Date: Wed, 22 Apr 2020 15:07:43 +0900 Subject: [PATCH 06/16] [Tizen] Add screen and client rotation itself function Change-Id: I5b46266d7d30f5351376122a636155b3cbe8fdf4 --- .../adaptor-framework/render-surface-interface.h | 6 ++++ .../adaptor-framework/scene-holder-impl.cpp | 7 ++-- .../adaptor-framework/scene-holder-impl.h | 5 +-- dali/internal/window-system/common/window-base.h | 11 +++++++ dali/internal/window-system/common/window-impl.cpp | 32 +++++++++++++++--- .../window-system/common/window-render-surface.cpp | 34 +++++++++++++------ .../window-system/common/window-render-surface.h | 6 ++++ .../ecore-wl/window-base-ecore-wl.cpp | 27 +++++++++++++-- .../tizen-wayland/ecore-wl/window-base-ecore-wl.h | 14 ++++++++ .../ecore-wl2/window-base-ecore-wl2.cpp | 38 +++++++++++++++++----- .../ecore-wl2/window-base-ecore-wl2.h | 14 ++++++++ .../native-render-surface-ecore-wl.cpp | 5 +++ .../tizen-wayland/native-render-surface-ecore-wl.h | 6 ++++ .../ubuntu-x11/pixmap-render-surface-ecore-x.cpp | 5 +++ .../ubuntu-x11/pixmap-render-surface-ecore-x.h | 6 ++++ .../ubuntu-x11/window-base-ecore-x.cpp | 10 ++++++ .../window-system/ubuntu-x11/window-base-ecore-x.h | 11 +++++++ .../window-system/windows/window-base-win.cpp | 8 +++++ .../window-system/windows/window-base-win.h | 11 +++++++ 19 files changed, 225 insertions(+), 31 deletions(-) diff --git a/dali/integration-api/adaptor-framework/render-surface-interface.h b/dali/integration-api/adaptor-framework/render-surface-interface.h index 25ad128..a683a59 100644 --- a/dali/integration-api/adaptor-framework/render-surface-interface.h +++ b/dali/integration-api/adaptor-framework/render-surface-interface.h @@ -100,6 +100,12 @@ public: virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) = 0; /** + * @brief Return the orientation of the surface. + * @return The orientation + */ + virtual int GetOrientation() const = 0; + + /** * @brief InitializeGraphics the platform specific graphics surface interfaces */ virtual void InitializeGraphics() = 0; diff --git a/dali/integration-api/adaptor-framework/scene-holder-impl.cpp b/dali/integration-api/adaptor-framework/scene-holder-impl.cpp index 2440b35..69f5e89 100644 --- a/dali/integration-api/adaptor-framework/scene-holder-impl.cpp +++ b/dali/integration-api/adaptor-framework/scene-holder-impl.cpp @@ -189,7 +189,7 @@ void SceneHolder::SetSurface(Dali::RenderSurfaceInterface* surface) mScene.SurfaceReplaced(); - SurfaceResized(); + SurfaceResized( false ); unsigned int dpiHorizontal, dpiVertical; dpiHorizontal = dpiVertical = 0; @@ -202,10 +202,11 @@ void SceneHolder::SetSurface(Dali::RenderSurfaceInterface* surface) OnSurfaceSet( surface ); } -void SceneHolder::SurfaceResized() +void SceneHolder::SurfaceResized( bool forceUpdate ) { PositionSize surfacePositionSize = mSurface->GetPositionSize(); - mScene.SurfaceResized( static_cast( surfacePositionSize.width ), static_cast( surfacePositionSize.height ) ); + int orientation = mSurface->GetOrientation(); + mScene.SurfaceResized( static_cast( surfacePositionSize.width ), static_cast( surfacePositionSize.height ), orientation, forceUpdate ); } Dali::RenderSurfaceInterface* SceneHolder::GetSurface() const diff --git a/dali/integration-api/adaptor-framework/scene-holder-impl.h b/dali/integration-api/adaptor-framework/scene-holder-impl.h index 3a830f9..318ceeb 100644 --- a/dali/integration-api/adaptor-framework/scene-holder-impl.h +++ b/dali/integration-api/adaptor-framework/scene-holder-impl.h @@ -112,9 +112,10 @@ public: void SetSurface( Dali::RenderSurfaceInterface* surface ); /** - * @brief Called when the surface set is resized. + * @brief Called when the surface is resized. + * @param[in] forceUpdate The flag to update force */ - void SurfaceResized(); + void SurfaceResized( bool forceUpdate ); /** * @brief Get the render surface diff --git a/dali/internal/window-system/common/window-base.h b/dali/internal/window-system/common/window-base.h index 9871611..1be77f9 100644 --- a/dali/internal/window-system/common/window-base.h +++ b/dali/internal/window-system/common/window-base.h @@ -311,6 +311,12 @@ public: virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) = 0; /** + * @brief Return the orientation of the surface. + * @return The orientation + */ + virtual int GetOrientation() const = 0; + + /** * @brief Get the screen rotation angle of the window */ virtual int GetScreenRotationAngle() = 0; @@ -320,6 +326,11 @@ public: */ virtual void SetWindowRotationAngle( int degree ) = 0; + /** + * @brief Get the rotation angle of the window + */ + virtual int GetWindowRotationAngle() = 0; + /** * @brief Inform the window rotation is completed */ diff --git a/dali/internal/window-system/common/window-impl.cpp b/dali/internal/window-system/common/window-impl.cpp index a0fd809..abbfe21 100644 --- a/dali/internal/window-system/common/window-impl.cpp +++ b/dali/internal/window-system/common/window-impl.cpp @@ -584,7 +584,13 @@ void Window::SetSize( Dali::Window::WindowSize size ) { Uint16Pair newSize( newRect.width, newRect.height ); - SurfaceResized(); + bool forceUpdate = false; + if( mWindowBase->IsEglWindowRotationSupported() ) + { + forceUpdate = true; + } + + SurfaceResized( forceUpdate ); mAdaptor->SurfaceResizePrepare( mSurface.get(), newSize ); @@ -644,7 +650,13 @@ void Window::SetPositionSize( PositionSize positionSize ) { Uint16Pair newSize( newRect.width, newRect.height ); - SurfaceResized(); + bool forceUpdate = false; + if( mWindowBase->IsEglWindowRotationSupported() ) + { + forceUpdate = true; + } + + SurfaceResized( forceUpdate ); mAdaptor->SurfaceResizePrepare( mSurface.get(), newSize ); @@ -729,8 +741,14 @@ void Window::OnFocusChanged( bool focusIn ) void Window::OnOutputTransformed() { + bool forceUpdate = false; + if( mWindowBase->IsEglWindowRotationSupported() ) + { + forceUpdate = true; + } + SurfaceResized( forceUpdate ); + PositionSize positionSize = mSurface->GetPositionSize(); - SurfaceResized(); mAdaptor->SurfaceResizePrepare( mSurface.get(), Adaptor::SurfaceSize( positionSize.width, positionSize.height ) ); mAdaptor->SurfaceResizeComplete( mSurface.get(), Adaptor::SurfaceSize( positionSize.width, positionSize.height ) ); } @@ -772,7 +790,13 @@ void Window::OnRotation( const RotationEvent& rotation ) mWindowSurface->RequestRotation( mRotationAngle, mWindowWidth, mWindowHeight ); - SurfaceResized(); + bool forceUpdate = false; + if( mWindowBase->IsEglWindowRotationSupported() ) + { + forceUpdate = true; + } + + SurfaceResized( forceUpdate ); mAdaptor->SurfaceResizePrepare( mSurface.get(), Adaptor::SurfaceSize( mWindowWidth, mWindowHeight ) ); diff --git a/dali/internal/window-system/common/window-render-surface.cpp b/dali/internal/window-system/common/window-render-surface.cpp index f86d7c2..789d86e 100644 --- a/dali/internal/window-system/common/window-render-surface.cpp +++ b/dali/internal/window-system/common/window-render-surface.cpp @@ -115,6 +115,7 @@ void WindowRenderSurface::Initialize( Any surface ) if( mScreenRotationAngle != 0 ) { mScreenRotationFinished = false; + mResizeFinished = false; } } @@ -145,12 +146,6 @@ void WindowRenderSurface::SetTransparency( bool transparent ) void WindowRenderSurface::RequestRotation( int angle, int width, int height ) { - if( !mRotationSupported ) - { - DALI_LOG_INFO( gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::Rotate: Rotation is not supported!\n" ); - return; - } - if( !mRotationTrigger ) { mRotationTrigger = TriggerEventFactory::CreateTriggerEvent( MakeCallback( this, &WindowRenderSurface::ProcessRotationRequest ), TriggerEventInterface::KEEP_ALIVE_AFTER_TRIGGER ); @@ -202,6 +197,11 @@ void WindowRenderSurface::GetDpi( unsigned int& dpiHorizontal, unsigned int& dpi dpiVertical = mDpiVertical; } +int WindowRenderSurface::GetOrientation() const +{ + return mWindowBase->GetOrientation(); +} + void WindowRenderSurface::InitializeGraphics() { @@ -354,11 +354,11 @@ bool WindowRenderSurface::PreRender( bool resizingSurface ) if( resizingSurface ) { + int totalAngle = (mRotationAngle + mScreenRotationAngle) % 360; + // Window rotate or screen rotate if( !mRotationFinished || !mScreenRotationFinished ) { - int totalAngle = (mRotationAngle + mScreenRotationAngle) % 360; - mWindowBase->SetEglWindowRotation( totalAngle ); mWindowBase->SetEglWindowBufferTransform( totalAngle ); @@ -375,9 +375,22 @@ bool WindowRenderSurface::PreRender( bool resizingSurface ) } // Resize case - if( !mResizeFinished ) + if ( !mResizeFinished ) { - mWindowBase->ResizeEglWindow( mPositionSize ); + Dali::PositionSize positionSize; + positionSize.x = mPositionSize.x; + positionSize.y = mPositionSize.y; + if( totalAngle == 0 || totalAngle == 180 ) + { + positionSize.width = mPositionSize.width; + positionSize.height = mPositionSize.height; + } + else + { + positionSize.width = mPositionSize.height; + positionSize.height = mPositionSize.width; + } + mWindowBase->ResizeEglWindow( positionSize ); mResizeFinished = true; DALI_LOG_INFO( gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::PreRender: Set resize\n" ); @@ -490,6 +503,7 @@ void WindowRenderSurface::OutputTransformed() { mScreenRotationAngle = screenRotationAngle; mScreenRotationFinished = false; + mResizeFinished = false; mOutputTransformedSignal.Emit(); diff --git a/dali/internal/window-system/common/window-render-surface.h b/dali/internal/window-system/common/window-render-surface.h index f8160b8..6cab258 100644 --- a/dali/internal/window-system/common/window-render-surface.h +++ b/dali/internal/window-system/common/window-render-surface.h @@ -124,6 +124,12 @@ public: // from Dali::RenderSurfaceInterface virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override; /** + * @brief Return the orientation of the surface. + * @return The orientation + */ + virtual int GetOrientation() const override; + + /** * @copydoc Dali::RenderSurfaceInterface::InitializeGraphics() */ virtual void InitializeGraphics() override; diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp b/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp index 509ddd4..4258b7f 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp +++ b/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp @@ -585,7 +585,10 @@ WindowBaseEcoreWl::WindowBaseEcoreWl( Dali::PositionSize positionSize, Any surfa mBrightness( 0 ), mBrightnessChangeState( 0 ), mBrightnessChangeDone( true ), - mOwnSurface( false ) + mOwnSurface( false ), + mWindowRotationAngle( 0 ), + mScreenRotationAngle( 0 ), + mSupportedPreProtation( 0 ) #ifdef DALI_ELDBUS_AVAILABLE , mSystemConnection( NULL ) #endif @@ -1317,9 +1320,10 @@ bool WindowBaseEcoreWl::IsEglWindowRotationSupported() wl_egl_window_capability capability = static_cast< wl_egl_window_capability >( wl_egl_window_get_capabilities( mEglWindow ) ); if( capability == WL_EGL_WINDOW_CAPABILITY_ROTATION_SUPPORTED ) { + mSupportedPreProtation = true; return true; } - + mSupportedPreProtation = false; return false; } @@ -2062,6 +2066,16 @@ void WindowBaseEcoreWl::GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVe dpiVertical = int( yres + 0.5f ); } +int WindowBaseEcoreWl::GetOrientation() const +{ + int orientation = (mScreenRotationAngle + mWindowRotationAngle) % 360; + if( mSupportedPreProtation ) + { + orientation = 0; + } + return orientation; +} + int WindowBaseEcoreWl::GetScreenRotationAngle() { int transform = 0; @@ -2075,14 +2089,21 @@ int WindowBaseEcoreWl::GetScreenRotationAngle() transform = ecore_wl_output_transform_get( ecore_wl_window_output_find( mEcoreWindow ) ); } - return transform * 90; + mScreenRotationAngle = transform * 90; + return mScreenRotationAngle; } void WindowBaseEcoreWl::SetWindowRotationAngle( int degree ) { + mWindowRotationAngle = degree; ecore_wl_window_rotation_set( mEcoreWindow, degree ); } +int WindowBaseEcoreWl::GetWindowRotationAngle() +{ + return mWindowRotationAngle; +} + void WindowBaseEcoreWl::WindowRotationCompleted( int degree, int width, int height ) { ecore_wl_window_rotation_change_done_send( mEcoreWindow ); diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.h b/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.h index 5811b5c..2d0a4ce 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.h +++ b/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.h @@ -395,6 +395,12 @@ public: virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override; /** + * @brief Return the orientation of the surface. + * @return The orientation + */ + virtual int GetOrientation() const override; + + /** * @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenRotationAngle() */ virtual int GetScreenRotationAngle() override; @@ -405,6 +411,11 @@ public: virtual void SetWindowRotationAngle( int degree ) override; /** + * @copydoc Dali::Internal::Adaptor::WindowBase::GetWindowRotationAngle() + */ + virtual int GetWindowRotationAngle() override; + + /** * @copydoc Dali::Internal::Adaptor::WindowBase::WindowRotationCompleted() */ virtual void WindowRotationCompleted( int degree, int width, int height ) override; @@ -475,6 +486,9 @@ private: bool mOwnSurface; + int mWindowRotationAngle; + int mScreenRotationAngle; + int mSupportedPreProtation; #ifdef DALI_ELDBUS_AVAILABLE Eldbus_Connection* mSystemConnection; #endif // DALI_ELDBUS_AVAILABLE diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp index 89fae58..8c2c04a 100755 --- a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp +++ b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp @@ -690,7 +690,10 @@ WindowBaseEcoreWl2::WindowBaseEcoreWl2( Dali::PositionSize positionSize, Any sur mBrightnessChangeDone( true ), mOwnSurface( false ), mMoveResizeSerial( 0 ), - mLastSubmittedMoveResizeSerial( 0 ) + mLastSubmittedMoveResizeSerial( 0 ), + mWindowRotationAngle( 0 ), + mScreenRotationAngle( 0 ), + mSupportedPreProtation( 0 ) #ifdef DALI_ELDBUS_AVAILABLE , mSystemConnection( NULL ) #endif @@ -1071,7 +1074,7 @@ void WindowBaseEcoreWl2::OnMouseButtonCancel( void* data, int type, void* event mTouchEventSignal.Emit( point, touchEvent->timestamp ); - DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl::OnMouseButtonCancel\n" ); + DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::OnMouseButtonCancel\n" ); } } @@ -1081,7 +1084,7 @@ void WindowBaseEcoreWl2::OnMouseWheel( void* data, int type, void* event ) if( mouseWheelEvent->window == static_cast< unsigned int >( ecore_wl2_window_id_get( mEcoreWindow ) ) ) { - DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl::OnMouseWheel: direction: %d, modifiers: %d, x: %d, y: %d, z: %d\n", mouseWheelEvent->direction, mouseWheelEvent->modifiers, mouseWheelEvent->x, mouseWheelEvent->y, mouseWheelEvent->z ); + DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::OnMouseWheel: direction: %d, modifiers: %d, x: %d, y: %d, z: %d\n", mouseWheelEvent->direction, mouseWheelEvent->modifiers, mouseWheelEvent->x, mouseWheelEvent->y, mouseWheelEvent->z ); WheelEvent wheelEvent( WheelEvent::MOUSE_WHEEL, mouseWheelEvent->direction, mouseWheelEvent->modifiers, Vector2( mouseWheelEvent->x, mouseWheelEvent->y ), mouseWheelEvent->z, mouseWheelEvent->timestamp ); @@ -1093,7 +1096,7 @@ void WindowBaseEcoreWl2::OnDetentRotation( void* data, int type, void* event ) { Ecore_Event_Detent_Rotate* detentEvent = static_cast< Ecore_Event_Detent_Rotate* >( event ); - DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Concise, "WindowBaseEcoreWl::OnDetentRotation\n" ); + DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Concise, "WindowBaseEcoreWl2::OnDetentRotation\n" ); int direction = ( detentEvent->direction == ECORE_DETENT_DIRECTION_CLOCKWISE ) ? 1 : -1; int timeStamp = detentEvent->timestamp; @@ -1109,7 +1112,7 @@ void WindowBaseEcoreWl2::OnKeyDown( void* data, int type, void* event ) if( keyEvent->window == static_cast< unsigned int >( ecore_wl2_window_id_get( mEcoreWindow ) ) ) { - DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl::OnKeyDown\n" ); + DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::OnKeyDown\n" ); std::string keyName( keyEvent->keyname ); std::string logicalKey( "" ); @@ -1171,7 +1174,7 @@ void WindowBaseEcoreWl2::OnKeyUp( void* data, int type, void* event ) if( keyEvent->window == static_cast< unsigned int >( ecore_wl2_window_id_get( mEcoreWindow ) ) ) { - DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl::OnKeyUp\n" ); + DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::OnKeyUp\n" ); std::string keyName( keyEvent->keyname ); std::string logicalKey( "" ); @@ -1513,9 +1516,10 @@ bool WindowBaseEcoreWl2::IsEglWindowRotationSupported() wl_egl_window_tizen_capability capability = static_cast< wl_egl_window_tizen_capability >( wl_egl_window_tizen_get_capabilities( mEglWindow ) ); if( capability == WL_EGL_WINDOW_TIZEN_CAPABILITY_ROTATION_SUPPORTED ) { + mSupportedPreProtation = true; return true; } - + mSupportedPreProtation = false; return false; } @@ -2259,6 +2263,16 @@ void WindowBaseEcoreWl2::GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiV dpiVertical = int( yres + 0.5f ); } +int WindowBaseEcoreWl2::GetOrientation() const +{ + int orientation = (mScreenRotationAngle + mWindowRotationAngle) % 360; + if( mSupportedPreProtation ) + { + orientation = 0; + } + return orientation; +} + int WindowBaseEcoreWl2::GetScreenRotationAngle() { int transform = 0; @@ -2271,15 +2285,21 @@ int WindowBaseEcoreWl2::GetScreenRotationAngle() { transform = ecore_wl2_output_transform_get( ecore_wl2_window_output_find( mEcoreWindow ) ); } - - return transform * 90; + mScreenRotationAngle = transform * 90; + return mScreenRotationAngle; } void WindowBaseEcoreWl2::SetWindowRotationAngle( int degree ) { + mWindowRotationAngle = degree; ecore_wl2_window_rotation_set( mEcoreWindow, degree ); } +int WindowBaseEcoreWl2::GetWindowRotationAngle() +{ + return mWindowRotationAngle; +} + void WindowBaseEcoreWl2::WindowRotationCompleted( int degree, int width, int height ) { ecore_wl2_window_rotation_change_done_send( mEcoreWindow, degree, width, height ); diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h index c7a7240..bd4afb5 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h +++ b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h @@ -417,6 +417,12 @@ public: virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override; /** + * @brief Return the orientation of the surface. + * @return The orientation + */ + virtual int GetOrientation() const override; + + /** * @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenRotationAngle() */ virtual int GetScreenRotationAngle() override; @@ -427,6 +433,11 @@ public: virtual void SetWindowRotationAngle( int degree ) override; /** + * @copydoc Dali::Internal::Adaptor::WindowBase::GetWindowRotationAngle() + */ + virtual int GetWindowRotationAngle() override; + + /** * @copydoc Dali::Internal::Adaptor::WindowBase::WindowRotationCompleted() */ virtual void WindowRotationCompleted( int degree, int width, int height ) override; @@ -501,6 +512,9 @@ private: volatile uint32_t mMoveResizeSerial; uint32_t mLastSubmittedMoveResizeSerial; + int mWindowRotationAngle; + int mScreenRotationAngle; + int mSupportedPreProtation; #ifdef DALI_ELDBUS_AVAILABLE Eldbus_Connection* mSystemConnection; #endif // DALI_ELDBUS_AVAILABLE diff --git a/dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.cpp b/dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.cpp index 3ef4f68..7bb678c 100644 --- a/dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.cpp +++ b/dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.cpp @@ -142,6 +142,11 @@ void NativeRenderSurfaceEcoreWl::GetDpi( unsigned int& dpiHorizontal, unsigned i dpiVertical = int( yres + 0.5f ); } +int NativeRenderSurfaceEcoreWl::GetOrientation() const +{ + return 0; +} + void NativeRenderSurfaceEcoreWl::InitializeGraphics() { DALI_LOG_TRACE_METHOD( gNativeSurfaceLogFilter ); diff --git a/dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.h b/dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.h index e3a33ba..dba6bfd 100644 --- a/dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.h +++ b/dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.h @@ -84,6 +84,12 @@ public: // from Dali::RenderSurfaceInterface virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override; /** + * @brief Return the orientation of the surface. + * @return The orientation + */ + virtual int GetOrientation() const override; + + /** * @copydoc Dali::RenderSurfaceInterface::InitializeGraphics() */ virtual void InitializeGraphics() override; diff --git a/dali/internal/window-system/ubuntu-x11/pixmap-render-surface-ecore-x.cpp b/dali/internal/window-system/ubuntu-x11/pixmap-render-surface-ecore-x.cpp index 2e93140..b9b9811 100644 --- a/dali/internal/window-system/ubuntu-x11/pixmap-render-surface-ecore-x.cpp +++ b/dali/internal/window-system/ubuntu-x11/pixmap-render-surface-ecore-x.cpp @@ -147,6 +147,11 @@ void PixmapRenderSurfaceEcoreX::GetDpi( unsigned int& dpiHorizontal, unsigned in dpiVertical = int( yres + 0.5f ); } +int PixmapRenderSurfaceEcoreX::GetOrientation() const +{ + return 0; +} + void PixmapRenderSurfaceEcoreX::InitializeGraphics() { mGraphics = &mAdaptor->GetGraphicsInterface(); diff --git a/dali/internal/window-system/ubuntu-x11/pixmap-render-surface-ecore-x.h b/dali/internal/window-system/ubuntu-x11/pixmap-render-surface-ecore-x.h index 034fee6..89f2501 100644 --- a/dali/internal/window-system/ubuntu-x11/pixmap-render-surface-ecore-x.h +++ b/dali/internal/window-system/ubuntu-x11/pixmap-render-surface-ecore-x.h @@ -82,6 +82,12 @@ public: // from Dali::RenderSurfaceInterface virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override; /** + * @brief Return the orientation of the surface. + * @return The orientation + */ + virtual int GetOrientation() const override; + + /** * @copydoc Dali::RenderSurfaceInterface::InitializeGraphics() */ virtual void InitializeGraphics() override; diff --git a/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp b/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp index ab67b43..77567d4 100755 --- a/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp +++ b/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp @@ -834,6 +834,11 @@ void WindowBaseEcoreX::GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVer dpiVertical = ecore_x_dpi_get(); } +int WindowBaseEcoreX::GetOrientation() const +{ + return 0; +} + int WindowBaseEcoreX::GetScreenRotationAngle() { return 0; @@ -843,6 +848,11 @@ void WindowBaseEcoreX::SetWindowRotationAngle( int degree ) { } +int WindowBaseEcoreX::GetWindowRotationAngle() +{ + return 0; +} + void WindowBaseEcoreX::WindowRotationCompleted( int degree, int width, int height ) { } diff --git a/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h b/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h index 8ab7080..f01d32d 100644 --- a/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h +++ b/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h @@ -329,6 +329,12 @@ public: virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override; /** + * @brief Return the orientation of the surface. + * @return The orientation + */ + virtual int GetOrientation() const override; + + /** * @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenRotationAngle() */ virtual int GetScreenRotationAngle() override; @@ -339,6 +345,11 @@ public: virtual void SetWindowRotationAngle( int degree ) override; /** + * @copydoc Dali::Internal::Adaptor::WindowBase::GetWindowRotationAngle() + */ + virtual int GetWindowRotationAngle() override; + + /** * @copydoc Dali::Internal::Adaptor::WindowBase::WindowRotationCompleted() */ virtual void WindowRotationCompleted( int degree, int width, int height ) override; diff --git a/dali/internal/window-system/windows/window-base-win.cpp b/dali/internal/window-system/windows/window-base-win.cpp index c968bea..7c64458 100755 --- a/dali/internal/window-system/windows/window-base-win.cpp +++ b/dali/internal/window-system/windows/window-base-win.cpp @@ -454,6 +454,10 @@ void WindowBaseWin::SetWindowRotationAngle( int degree ) { } +int WindowBaseWin::GetWindowRotationAngle() +{ +} + void WindowBaseWin::WindowRotationCompleted( int degree, int width, int height ) { } @@ -462,6 +466,10 @@ void WindowBaseWin::SetTransparency( bool transparent ) { } +int WindowBaseWin::GetOrientation() const +{ +} + unsigned int WindowBaseWin::GetSurfaceId( Any surface ) const { unsigned int surfaceId = 0; diff --git a/dali/internal/window-system/windows/window-base-win.h b/dali/internal/window-system/windows/window-base-win.h index c0a17dc..05b208e 100755 --- a/dali/internal/window-system/windows/window-base-win.h +++ b/dali/internal/window-system/windows/window-base-win.h @@ -327,6 +327,11 @@ public: virtual void SetWindowRotationAngle( int degree ) override; /** + * @copydoc Dali::Internal::Adaptor::WindowBase::GetWindowRotationAngle() + */ + virtual void GetWindowRotationAngle() override; + + /** * @copydoc Dali::Internal::Adaptor::WindowBase::WindowRotationCompleted() */ virtual void WindowRotationCompleted( int degree, int width, int height ) override; @@ -337,6 +342,12 @@ public: virtual void SetTransparency( bool transparent ) override; /** + * @brief Return the orientation of the surface. + * @return The orientation + */ + virtual int GetOrientation() const override; + + /** * @copydoc Dali::Internal::Adaptor::WindowBase::SetParent() */ virtual void SetParent( WindowBase* parentWinBase ) override; -- 2.7.4 From d25af24c1a49084f60d79181a9b4d304ce5579f9 Mon Sep 17 00:00:00 2001 From: "Seungho, Baek" Date: Fri, 27 Mar 2020 15:06:31 +0900 Subject: [PATCH 07/16] Make Capture api common. - Current implementation, Capture can be used only in the wearable profile Change-Id: I269e5e5b604b6deba97980ce53493fd0ae9039c0 Signed-off-by: Seungho, Baek --- build/tizen/profiles/wearable-profile.cmake | 1 + .../capture-impl.cpp} | 76 +++------------------- .../tizen-wearable => common}/capture-impl.h | 30 +-------- dali/internal/system/file.list | 10 +-- .../capture}/capture.cpp | 2 +- dali/public-api/capture/capture.h | 4 +- dali/public-api/file.list | 64 +++++++++--------- 7 files changed, 47 insertions(+), 140 deletions(-) rename dali/internal/system/{tizen-wayland/tizen-wearable/capture-impl-tizen.cpp => common/capture-impl.cpp} (79%) mode change 100755 => 100644 rename dali/internal/system/{tizen-wayland/tizen-wearable => common}/capture-impl.h (90%) mode change 100755 => 100644 rename dali/{internal/system/tizen-wayland/tizen-wearable => public-api/capture}/capture.cpp (96%) diff --git a/build/tizen/profiles/wearable-profile.cmake b/build/tizen/profiles/wearable-profile.cmake index 8488967..3682664 100644 --- a/build/tizen/profiles/wearable-profile.cmake +++ b/build/tizen/profiles/wearable-profile.cmake @@ -30,6 +30,7 @@ SET( SOURCES ${adaptor_styling_common_src_files} ${adaptor_system_common_src_files} ${adaptor_system_linux_src_files} + ${adaptor_system_tizen_wayland_src_files} ${adaptor_system_tizen_wearable_src_files} ${adaptor_text_common_src_files} ${adaptor_resampler_src_files} diff --git a/dali/internal/system/tizen-wayland/tizen-wearable/capture-impl-tizen.cpp b/dali/internal/system/common/capture-impl.cpp old mode 100755 new mode 100644 similarity index 79% rename from dali/internal/system/tizen-wayland/tizen-wearable/capture-impl-tizen.cpp rename to dali/internal/system/common/capture-impl.cpp index 0c9487e..1ba6f58 --- a/dali/internal/system/tizen-wayland/tizen-wearable/capture-impl-tizen.cpp +++ b/dali/internal/system/common/capture-impl.cpp @@ -16,7 +16,7 @@ */ // CLASS HEADER -#include +#include // EXTERNAL INCLUDES #include @@ -46,8 +46,7 @@ namespace Adaptor Capture::Capture() : mTimer(), mPath(), - mNativeImageSourcePtr( NULL ), - mTbmSurface( NULL ) + mNativeImageSourcePtr( NULL ) { } @@ -55,13 +54,13 @@ Capture::Capture( Dali::CameraActor cameraActor ) : mCameraActor( cameraActor ), mTimer(), mPath(), - mNativeImageSourcePtr( NULL ), - mTbmSurface( NULL ) + mNativeImageSourcePtr( NULL ) { } Capture::~Capture() { + DeleteNativeImageSource(); } CapturePtr Capture::New() @@ -98,62 +97,16 @@ Dali::Capture::CaptureFinishedSignalType& Capture::FinishedSignal() return mFinishedSignal; } -void Capture::CreateSurface( const Vector2& size ) -{ - DALI_ASSERT_ALWAYS(!mTbmSurface && "mTbmSurface is already created."); - - mTbmSurface = tbm_surface_create( size.width, size.height, TBM_FORMAT_RGBA8888 ); -} - -void Capture::DeleteSurface() -{ - DALI_ASSERT_ALWAYS(mTbmSurface && "mTbmSurface is empty."); - - tbm_surface_destroy( mTbmSurface ); - mTbmSurface = NULL; -} - -void Capture::ClearSurface( const Vector2& size ) -{ - DALI_ASSERT_ALWAYS(mTbmSurface && "mTbmSurface is empty."); - - tbm_surface_info_s surface_info; - - if( tbm_surface_map( mTbmSurface, TBM_SURF_OPTION_WRITE, &surface_info ) == TBM_SURFACE_ERROR_NONE ) - { - //DALI_ASSERT_ALWAYS(surface_info.bpp == 32 && "unsupported tbm format"); - - unsigned char* ptr = surface_info.planes[0].ptr; - memset( ptr, 0, surface_info.size ); // TODO: support color - - if( tbm_surface_unmap( mTbmSurface ) != TBM_SURFACE_ERROR_NONE ) - { - DALI_LOG_ERROR( "Fail to unmap tbm_surface\n" ); - } - } - else - { - DALI_ASSERT_ALWAYS(0 && "tbm_surface_map failed"); - } -} - -bool Capture::IsSurfaceCreated() -{ - return mTbmSurface != 0; -} - -void Capture::CreateNativeImageSource() +void Capture::CreateNativeImageSource( const Vector2& size ) { Dali::Adaptor& adaptor = Dali::Adaptor::Get(); DALI_ASSERT_ALWAYS(adaptor.IsAvailable() && "Dali::Adaptor is not available."); - DALI_ASSERT_ALWAYS(mTbmSurface && "mTbmSurface is empty."); - DALI_ASSERT_ALWAYS(!mNativeImageSourcePtr && "NativeImageSource is already created."); // create the NativeImageSource object with our surface - mNativeImageSourcePtr = Dali::NativeImageSource::New( mTbmSurface ); + mNativeImageSourcePtr = Dali::NativeImageSource::New( size.width, size.height, Dali::NativeImageSource::COLOR_DEPTH_DEFAULT ); } void Capture::DeleteNativeImageSource() @@ -277,10 +230,7 @@ bool Capture::IsRenderTaskSetup() void Capture::SetupResources( const Dali::Vector2& size, const Dali::Vector4& clearColor, Dali::Actor source ) { - CreateSurface( size ); - ClearSurface( size ); - - CreateNativeImageSource(); + CreateNativeImageSource( size ); CreateFrameBuffer(); @@ -298,16 +248,6 @@ void Capture::UnsetResources() { DeleteFrameBuffer(); } - - if( IsNativeImageSourceCreated() ) - { - DeleteNativeImageSource(); - } - - if( IsSurfaceCreated() ) - { - DeleteSurface(); - } } void Capture::OnRenderFinished( Dali::RenderTask& task ) @@ -319,7 +259,7 @@ void Capture::OnRenderFinished( Dali::RenderTask& task ) if( !Save() ) { state = Dali::Capture::FinishState::FAILED; - DALI_LOG_ERROR("Fail to Capture mTbmSurface[%p] Path[%s]", mTbmSurface, mPath.c_str()); + DALI_LOG_ERROR("Fail to Capture Path[%s]", mPath.c_str()); } Dali::Capture handle( this ); diff --git a/dali/internal/system/tizen-wayland/tizen-wearable/capture-impl.h b/dali/internal/system/common/capture-impl.h old mode 100755 new mode 100644 similarity index 90% rename from dali/internal/system/tizen-wayland/tizen-wearable/capture-impl.h rename to dali/internal/system/common/capture-impl.h index 4eae7f6..69d97e2 --- a/dali/internal/system/tizen-wayland/tizen-wearable/capture-impl.h +++ b/dali/internal/system/common/capture-impl.h @@ -21,7 +21,6 @@ // EXTERNAL INCLUDES #include #include -#include #include #include #include @@ -85,35 +84,9 @@ protected: private: /** - * @brief Create surface. - * - * @param[in] size of surface. - */ - void CreateSurface( const Dali::Vector2& size ); - - /** - * @brief Delete surface. - */ - void DeleteSurface(); - - /** - * @brief Clear surface with color. - * - * @param[in] size of clear aread. - */ - void ClearSurface( const Dali::Vector2& size ); - - /** - * @brief Query whether surface is created or not. - * - * @return True is surface is created. - */ - bool IsSurfaceCreated(); - - /** * @brief Create native image source. */ - void CreateNativeImageSource(); + void CreateNativeImageSource( const Dali::Vector2& size ); /** * @brief Delete native image source. @@ -218,7 +191,6 @@ private: Dali::Capture::CaptureFinishedSignalType mFinishedSignal; std::string mPath; Dali::NativeImageSourcePtr mNativeImageSourcePtr; ///< pointer to surface image - tbm_surface_h mTbmSurface; }; } // End of namespace Adaptor diff --git a/dali/internal/system/file.list b/dali/internal/system/file.list index 3c5be55..42bef31 100644 --- a/dali/internal/system/file.list +++ b/dali/internal/system/file.list @@ -2,6 +2,7 @@ # module: system, backend: common SET( adaptor_system_common_src_files ${adaptor_system_dir}/common/abort-handler.cpp + ${adaptor_system_dir}/common/capture-impl.cpp ${adaptor_system_dir}/common/color-controller-impl.cpp ${adaptor_system_dir}/common/command-line-options.cpp ${adaptor_system_dir}/common/configuration-manager.cpp @@ -50,16 +51,7 @@ SET( adaptor_system_tizen_wayland_src_files # module: system, backend: tizen-wearable SET( adaptor_system_tizen_wearable_src_files - ${adaptor_system_dir}/common/shared-file.cpp - ${adaptor_system_dir}/common/trigger-event.cpp - ${adaptor_system_dir}/common/trigger-event-factory.cpp - ${adaptor_system_dir}/tizen-wayland/logging-tizen.cpp - ${adaptor_system_dir}/tizen-wayland/tizen-wearable/capture.cpp - ${adaptor_system_dir}/tizen-wayland/tizen-wearable/capture-impl-tizen.cpp ${adaptor_system_dir}/tizen-wayland/tizen-wearable/watch-time.cpp - ${adaptor_system_dir}/tizen-wayland/system-settings-tizen.cpp - ${adaptor_system_dir}/tizen-wayland/widget-application-impl-tizen.cpp - ${adaptor_system_dir}/tizen-wayland/widget-controller-tizen.cpp ) # module: system, backend: ubuntu-x11 diff --git a/dali/internal/system/tizen-wayland/tizen-wearable/capture.cpp b/dali/public-api/capture/capture.cpp similarity index 96% rename from dali/internal/system/tizen-wayland/tizen-wearable/capture.cpp rename to dali/public-api/capture/capture.cpp index 156b206..1cc768c 100644 --- a/dali/internal/system/tizen-wayland/tizen-wearable/capture.cpp +++ b/dali/public-api/capture/capture.cpp @@ -19,7 +19,7 @@ #include // INTERNAL HEADER -#include +#include namespace Dali { diff --git a/dali/public-api/capture/capture.h b/dali/public-api/capture/capture.h index 5119203..c58dd1c 100755 --- a/dali/public-api/capture/capture.h +++ b/dali/public-api/capture/capture.h @@ -2,7 +2,7 @@ #define DALI_CAPTURE_H /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,7 +45,7 @@ class Capture; /** * @brief Capture snapshots the current scene and save as a file. * - * @SINCE_1_3_4 + * @SINCE_1_3.4 * * Applications should follow the example below to create capture : * diff --git a/dali/public-api/file.list b/dali/public-api/file.list index 219b9c4..71866f1 100644 --- a/dali/public-api/file.list +++ b/dali/public-api/file.list @@ -1,55 +1,57 @@ SET( adaptor_public_api_src_files - ${adaptor_public_api_dir}/adaptor-framework/application.cpp - ${adaptor_public_api_dir}/adaptor-framework/key.cpp - ${adaptor_public_api_dir}/adaptor-framework/window.cpp - ${adaptor_public_api_dir}/adaptor-framework/timer.cpp - ${adaptor_public_api_dir}/adaptor-framework/tts-player.cpp - ${adaptor_public_api_dir}/adaptor-framework/native-image-source.cpp - ${adaptor_public_api_dir}/adaptor-framework/widget.cpp - ${adaptor_public_api_dir}/adaptor-framework/widget-application.cpp - ${adaptor_public_api_dir}/adaptor-framework/widget-impl.cpp + ${adaptor_public_api_dir}/adaptor-framework/application.cpp + ${adaptor_public_api_dir}/adaptor-framework/key.cpp + ${adaptor_public_api_dir}/adaptor-framework/window.cpp + ${adaptor_public_api_dir}/adaptor-framework/timer.cpp + ${adaptor_public_api_dir}/adaptor-framework/tts-player.cpp + ${adaptor_public_api_dir}/adaptor-framework/native-image-source.cpp + ${adaptor_public_api_dir}/adaptor-framework/widget.cpp + ${adaptor_public_api_dir}/adaptor-framework/widget-application.cpp + ${adaptor_public_api_dir}/adaptor-framework/widget-impl.cpp + ${adaptor_public_api_dir}/capture/capture.cpp ${adaptor_public_api_dir}/dali-adaptor-version.cpp ) SET( public_api_header_files - ${adaptor_public_api_dir}/dali-adaptor-version.h + ${adaptor_public_api_dir}/dali-adaptor-version.h ${adaptor_public_api_dir}/dali-adaptor-common.h ) SET( public_api_adaptor_framework_header_files - ${adaptor_public_api_dir}/adaptor-framework/application.h - ${adaptor_public_api_dir}/adaptor-framework/application-configuration.h - ${adaptor_public_api_dir}/adaptor-framework/device-status.h - ${adaptor_public_api_dir}/adaptor-framework/input-method.h - ${adaptor_public_api_dir}/adaptor-framework/key.h - ${adaptor_public_api_dir}/adaptor-framework/key-grab.h - ${adaptor_public_api_dir}/adaptor-framework/style-change.h - ${adaptor_public_api_dir}/adaptor-framework/timer.h - ${adaptor_public_api_dir}/adaptor-framework/tts-player.h - ${adaptor_public_api_dir}/adaptor-framework/native-image-source.h - ${adaptor_public_api_dir}/adaptor-framework/window.h - ${adaptor_public_api_dir}/adaptor-framework/widget.h - ${adaptor_public_api_dir}/adaptor-framework/widget-application.h + ${adaptor_public_api_dir}/adaptor-framework/application.h + ${adaptor_public_api_dir}/adaptor-framework/application-configuration.h + ${adaptor_public_api_dir}/adaptor-framework/device-status.h + ${adaptor_public_api_dir}/adaptor-framework/input-method.h + ${adaptor_public_api_dir}/adaptor-framework/key.h + ${adaptor_public_api_dir}/adaptor-framework/key-grab.h + ${adaptor_public_api_dir}/adaptor-framework/style-change.h + ${adaptor_public_api_dir}/adaptor-framework/timer.h + ${adaptor_public_api_dir}/adaptor-framework/tts-player.h + ${adaptor_public_api_dir}/adaptor-framework/native-image-source.h + ${adaptor_public_api_dir}/adaptor-framework/window.h + ${adaptor_public_api_dir}/adaptor-framework/widget.h + ${adaptor_public_api_dir}/adaptor-framework/widget-application.h ${adaptor_public_api_dir}/adaptor-framework/widget-impl.h ) + +SET( public_dali_capture_header_files + ${adaptor_public_api_dir}/capture/capture.h +) + + # wearable and watch extra public headers SET( adaptor_dali_wearable_header_file ${adaptor_public_api_dir}/watch/dali-wearable.h ) + # wearable and watch extra public headers SET( public_dali_watch_header_files - ${adaptor_public_api_dir}/watch/watch-application.h + ${adaptor_public_api_dir}/watch/watch-application.h ${adaptor_public_api_dir}/watch/watch-time.h -) - -# wearable and watch extra public headers -SET( public_dali_capture_header_files - ${adaptor_public_api_dir}/capture/capture.h -) - +) \ No newline at end of file -- 2.7.4 From adaaa8ab9167fa63ffae1005969bfc745985cac1 Mon Sep 17 00:00:00 2001 From: "Seungho, Baek" Date: Mon, 6 Apr 2020 14:00:21 +0900 Subject: [PATCH 08/16] Make capture return Buffer. - If developer want to use saved buffer, Dali::Capture can return it. Change-Id: I03213cec5e54edf8f0e79f00e02a77f70fe16e51 Signed-off-by: Seungho, Baek --- dali/internal/system/common/capture-impl.cpp | 30 +++++++++++++++++++++------- dali/internal/system/common/capture-impl.h | 10 ++++++++-- dali/public-api/capture/capture.cpp | 7 ++++++- dali/public-api/capture/capture.h | 8 ++++++++ 4 files changed, 45 insertions(+), 10 deletions(-) diff --git a/dali/internal/system/common/capture-impl.cpp b/dali/internal/system/common/capture-impl.cpp index 1ba6f58..8dc77b9 100644 --- a/dali/internal/system/common/capture-impl.cpp +++ b/dali/internal/system/common/capture-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,7 +46,8 @@ namespace Adaptor Capture::Capture() : mTimer(), mPath(), - mNativeImageSourcePtr( NULL ) + mNativeImageSourcePtr( NULL ), + mFileSave( false ) { } @@ -54,7 +55,8 @@ Capture::Capture( Dali::CameraActor cameraActor ) : mCameraActor( cameraActor ), mTimer(), mPath(), - mNativeImageSourcePtr( NULL ) + mNativeImageSourcePtr( NULL ), + mFileSave( false ) { } @@ -85,6 +87,10 @@ void Capture::Start( Dali::Actor source, const Dali::Vector2& size, const std::s Reference(); mPath = path; + if( mPath.size() > 0 ) + { + mFileSave = true; + } DALI_ASSERT_ALWAYS(source && "Source is NULL."); @@ -92,6 +98,13 @@ void Capture::Start( Dali::Actor source, const Dali::Vector2& size, const std::s SetupResources( size, clearColor, source ); } +Dali::NativeImageSourcePtr Capture::GetNativeImageSource() const +{ + DALI_ASSERT_ALWAYS( mNativeImageSourcePtr && "mNativeImageSourcePtr is NULL."); + + return mNativeImageSourcePtr; +} + Dali::Capture::CaptureFinishedSignalType& Capture::FinishedSignal() { return mFinishedSignal; @@ -256,10 +269,13 @@ void Capture::OnRenderFinished( Dali::RenderTask& task ) mTimer.Stop(); - if( !Save() ) + if( mFileSave ) { - state = Dali::Capture::FinishState::FAILED; - DALI_LOG_ERROR("Fail to Capture Path[%s]", mPath.c_str()); + if( !SaveFile() ) + { + state = Dali::Capture::FinishState::FAILED; + DALI_LOG_ERROR( "Fail to Capture Path[%s]", mPath.c_str() ); + } } Dali::Capture handle( this ); @@ -286,7 +302,7 @@ bool Capture::OnTimeOut() return false; } -bool Capture::Save() +bool Capture::SaveFile() { DALI_ASSERT_ALWAYS(mNativeImageSourcePtr && "mNativeImageSourcePtr is NULL"); diff --git a/dali/internal/system/common/capture-impl.h b/dali/internal/system/common/capture-impl.h index 69d97e2..61e116a 100644 --- a/dali/internal/system/common/capture-impl.h +++ b/dali/internal/system/common/capture-impl.h @@ -2,7 +2,7 @@ #define DALI_INTERNAL_CAPTURE_H /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -71,6 +71,11 @@ public: void Start( Dali::Actor source, const Dali::Vector2& size, const std::string &path, const Dali::Vector4& clearColor ); /** + * @copydoc Dali::Capture::GetNativeImageSource + */ + Dali::NativeImageSourcePtr GetNativeImageSource() const; + + /** * @copydoc Dali::Capture::FinishedSignal */ Dali::Capture::CaptureFinishedSignalType& FinishedSignal(); @@ -170,7 +175,7 @@ private: * * @return True is success to save, false is fail. */ - bool Save(); + bool SaveFile(); private: @@ -191,6 +196,7 @@ private: Dali::Capture::CaptureFinishedSignalType mFinishedSignal; std::string mPath; Dali::NativeImageSourcePtr mNativeImageSourcePtr; ///< pointer to surface image + bool mFileSave; }; } // End of namespace Adaptor diff --git a/dali/public-api/capture/capture.cpp b/dali/public-api/capture/capture.cpp index 1cc768c..701db7d 100644 --- a/dali/public-api/capture/capture.cpp +++ b/dali/public-api/capture/capture.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -72,6 +72,11 @@ void Capture::Start( Actor source, const Vector2& size, const std::string &path GetImpl( *this ).Start( source, size, path, Dali::Color::TRANSPARENT ); } +Dali::NativeImageSourcePtr Capture::GetNativeImageSource() const +{ + return GetImpl( *this ).GetNativeImageSource(); +} + Capture::CaptureFinishedSignalType& Capture::FinishedSignal() { return GetImpl( *this ).FinishedSignal(); diff --git a/dali/public-api/capture/capture.h b/dali/public-api/capture/capture.h index c58dd1c..c1696f3 100755 --- a/dali/public-api/capture/capture.h +++ b/dali/public-api/capture/capture.h @@ -25,6 +25,7 @@ // INTERNAL INCLUDES #include +#include namespace Dali { @@ -192,6 +193,13 @@ public: void Start( Actor source, const Vector2& size, const std::string &path ); /** + * @brief Get NativeImageSourcePtr that is saved captured image. + * + * @SINCE_1_5_10 + */ + Dali::NativeImageSourcePtr GetNativeImageSource() const; + + /** * @brief Get finished signal. * * @SINCE_1_3_4 -- 2.7.4 From 476863fdf73040633854171723db3fa71bdb9b1a Mon Sep 17 00:00:00 2001 From: Heeyong Song Date: Wed, 6 May 2020 16:26:11 +0900 Subject: [PATCH 09/16] DALi Version 1.5.10 Change-Id: I40c566a6d9568f566f1b3819c59b0c1c24f7c552 --- dali/public-api/dali-adaptor-version.cpp | 2 +- packaging/dali-adaptor.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dali/public-api/dali-adaptor-version.cpp b/dali/public-api/dali-adaptor-version.cpp index e4a7e7e..1b2c65c 100644 --- a/dali/public-api/dali-adaptor-version.cpp +++ b/dali/public-api/dali-adaptor-version.cpp @@ -28,7 +28,7 @@ namespace Dali const unsigned int ADAPTOR_MAJOR_VERSION = 1; const unsigned int ADAPTOR_MINOR_VERSION = 5; -const unsigned int ADAPTOR_MICRO_VERSION = 9; +const unsigned int ADAPTOR_MICRO_VERSION = 10; const char * const ADAPTOR_BUILD_DATE = __DATE__ " " __TIME__; #ifdef DEBUG_ENABLED diff --git a/packaging/dali-adaptor.spec b/packaging/dali-adaptor.spec index 7bfdf6e..7d218ed 100644 --- a/packaging/dali-adaptor.spec +++ b/packaging/dali-adaptor.spec @@ -17,7 +17,7 @@ Name: dali-adaptor Summary: The DALi Tizen Adaptor -Version: 1.5.9 +Version: 1.5.10 Release: 1 Group: System/Libraries License: Apache-2.0 and BSD-3-Clause and MIT -- 2.7.4 From abb581a051b7263bedd102beca356463fceaf8b2 Mon Sep 17 00:00:00 2001 From: Heeyong Song Date: Wed, 6 May 2020 17:18:16 +0900 Subject: [PATCH 10/16] Revert "[Tizen] Add screen and client rotation itself function" This reverts commit 1427b3fd59a952185ca3c34804c5c62ef86c8a0f. Change-Id: I156d7aab9b3662e26e4478369caca9bed11e64db --- .../adaptor-framework/render-surface-interface.h | 6 ---- .../adaptor-framework/scene-holder-impl.cpp | 7 ++-- .../adaptor-framework/scene-holder-impl.h | 5 ++- dali/internal/window-system/common/window-base.h | 11 ------- dali/internal/window-system/common/window-impl.cpp | 32 +++--------------- .../window-system/common/window-render-surface.cpp | 34 ++++++------------- .../window-system/common/window-render-surface.h | 6 ---- .../ecore-wl/window-base-ecore-wl.cpp | 27 ++------------- .../tizen-wayland/ecore-wl/window-base-ecore-wl.h | 14 -------- .../ecore-wl2/window-base-ecore-wl2.cpp | 38 +++++----------------- .../ecore-wl2/window-base-ecore-wl2.h | 14 -------- .../native-render-surface-ecore-wl.cpp | 5 --- .../tizen-wayland/native-render-surface-ecore-wl.h | 6 ---- .../ubuntu-x11/pixmap-render-surface-ecore-x.cpp | 5 --- .../ubuntu-x11/pixmap-render-surface-ecore-x.h | 6 ---- .../ubuntu-x11/window-base-ecore-x.cpp | 10 ------ .../window-system/ubuntu-x11/window-base-ecore-x.h | 11 ------- .../window-system/windows/window-base-win.cpp | 8 ----- .../window-system/windows/window-base-win.h | 11 ------- 19 files changed, 31 insertions(+), 225 deletions(-) diff --git a/dali/integration-api/adaptor-framework/render-surface-interface.h b/dali/integration-api/adaptor-framework/render-surface-interface.h index a683a59..25ad128 100644 --- a/dali/integration-api/adaptor-framework/render-surface-interface.h +++ b/dali/integration-api/adaptor-framework/render-surface-interface.h @@ -100,12 +100,6 @@ public: virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) = 0; /** - * @brief Return the orientation of the surface. - * @return The orientation - */ - virtual int GetOrientation() const = 0; - - /** * @brief InitializeGraphics the platform specific graphics surface interfaces */ virtual void InitializeGraphics() = 0; diff --git a/dali/integration-api/adaptor-framework/scene-holder-impl.cpp b/dali/integration-api/adaptor-framework/scene-holder-impl.cpp index 69f5e89..2440b35 100644 --- a/dali/integration-api/adaptor-framework/scene-holder-impl.cpp +++ b/dali/integration-api/adaptor-framework/scene-holder-impl.cpp @@ -189,7 +189,7 @@ void SceneHolder::SetSurface(Dali::RenderSurfaceInterface* surface) mScene.SurfaceReplaced(); - SurfaceResized( false ); + SurfaceResized(); unsigned int dpiHorizontal, dpiVertical; dpiHorizontal = dpiVertical = 0; @@ -202,11 +202,10 @@ void SceneHolder::SetSurface(Dali::RenderSurfaceInterface* surface) OnSurfaceSet( surface ); } -void SceneHolder::SurfaceResized( bool forceUpdate ) +void SceneHolder::SurfaceResized() { PositionSize surfacePositionSize = mSurface->GetPositionSize(); - int orientation = mSurface->GetOrientation(); - mScene.SurfaceResized( static_cast( surfacePositionSize.width ), static_cast( surfacePositionSize.height ), orientation, forceUpdate ); + mScene.SurfaceResized( static_cast( surfacePositionSize.width ), static_cast( surfacePositionSize.height ) ); } Dali::RenderSurfaceInterface* SceneHolder::GetSurface() const diff --git a/dali/integration-api/adaptor-framework/scene-holder-impl.h b/dali/integration-api/adaptor-framework/scene-holder-impl.h index 318ceeb..3a830f9 100644 --- a/dali/integration-api/adaptor-framework/scene-holder-impl.h +++ b/dali/integration-api/adaptor-framework/scene-holder-impl.h @@ -112,10 +112,9 @@ public: void SetSurface( Dali::RenderSurfaceInterface* surface ); /** - * @brief Called when the surface is resized. - * @param[in] forceUpdate The flag to update force + * @brief Called when the surface set is resized. */ - void SurfaceResized( bool forceUpdate ); + void SurfaceResized(); /** * @brief Get the render surface diff --git a/dali/internal/window-system/common/window-base.h b/dali/internal/window-system/common/window-base.h index 1be77f9..9871611 100644 --- a/dali/internal/window-system/common/window-base.h +++ b/dali/internal/window-system/common/window-base.h @@ -311,12 +311,6 @@ public: virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) = 0; /** - * @brief Return the orientation of the surface. - * @return The orientation - */ - virtual int GetOrientation() const = 0; - - /** * @brief Get the screen rotation angle of the window */ virtual int GetScreenRotationAngle() = 0; @@ -326,11 +320,6 @@ public: */ virtual void SetWindowRotationAngle( int degree ) = 0; - /** - * @brief Get the rotation angle of the window - */ - virtual int GetWindowRotationAngle() = 0; - /** * @brief Inform the window rotation is completed */ diff --git a/dali/internal/window-system/common/window-impl.cpp b/dali/internal/window-system/common/window-impl.cpp index abbfe21..a0fd809 100644 --- a/dali/internal/window-system/common/window-impl.cpp +++ b/dali/internal/window-system/common/window-impl.cpp @@ -584,13 +584,7 @@ void Window::SetSize( Dali::Window::WindowSize size ) { Uint16Pair newSize( newRect.width, newRect.height ); - bool forceUpdate = false; - if( mWindowBase->IsEglWindowRotationSupported() ) - { - forceUpdate = true; - } - - SurfaceResized( forceUpdate ); + SurfaceResized(); mAdaptor->SurfaceResizePrepare( mSurface.get(), newSize ); @@ -650,13 +644,7 @@ void Window::SetPositionSize( PositionSize positionSize ) { Uint16Pair newSize( newRect.width, newRect.height ); - bool forceUpdate = false; - if( mWindowBase->IsEglWindowRotationSupported() ) - { - forceUpdate = true; - } - - SurfaceResized( forceUpdate ); + SurfaceResized(); mAdaptor->SurfaceResizePrepare( mSurface.get(), newSize ); @@ -741,14 +729,8 @@ void Window::OnFocusChanged( bool focusIn ) void Window::OnOutputTransformed() { - bool forceUpdate = false; - if( mWindowBase->IsEglWindowRotationSupported() ) - { - forceUpdate = true; - } - SurfaceResized( forceUpdate ); - PositionSize positionSize = mSurface->GetPositionSize(); + SurfaceResized(); mAdaptor->SurfaceResizePrepare( mSurface.get(), Adaptor::SurfaceSize( positionSize.width, positionSize.height ) ); mAdaptor->SurfaceResizeComplete( mSurface.get(), Adaptor::SurfaceSize( positionSize.width, positionSize.height ) ); } @@ -790,13 +772,7 @@ void Window::OnRotation( const RotationEvent& rotation ) mWindowSurface->RequestRotation( mRotationAngle, mWindowWidth, mWindowHeight ); - bool forceUpdate = false; - if( mWindowBase->IsEglWindowRotationSupported() ) - { - forceUpdate = true; - } - - SurfaceResized( forceUpdate ); + SurfaceResized(); mAdaptor->SurfaceResizePrepare( mSurface.get(), Adaptor::SurfaceSize( mWindowWidth, mWindowHeight ) ); diff --git a/dali/internal/window-system/common/window-render-surface.cpp b/dali/internal/window-system/common/window-render-surface.cpp index 789d86e..f86d7c2 100644 --- a/dali/internal/window-system/common/window-render-surface.cpp +++ b/dali/internal/window-system/common/window-render-surface.cpp @@ -115,7 +115,6 @@ void WindowRenderSurface::Initialize( Any surface ) if( mScreenRotationAngle != 0 ) { mScreenRotationFinished = false; - mResizeFinished = false; } } @@ -146,6 +145,12 @@ void WindowRenderSurface::SetTransparency( bool transparent ) void WindowRenderSurface::RequestRotation( int angle, int width, int height ) { + if( !mRotationSupported ) + { + DALI_LOG_INFO( gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::Rotate: Rotation is not supported!\n" ); + return; + } + if( !mRotationTrigger ) { mRotationTrigger = TriggerEventFactory::CreateTriggerEvent( MakeCallback( this, &WindowRenderSurface::ProcessRotationRequest ), TriggerEventInterface::KEEP_ALIVE_AFTER_TRIGGER ); @@ -197,11 +202,6 @@ void WindowRenderSurface::GetDpi( unsigned int& dpiHorizontal, unsigned int& dpi dpiVertical = mDpiVertical; } -int WindowRenderSurface::GetOrientation() const -{ - return mWindowBase->GetOrientation(); -} - void WindowRenderSurface::InitializeGraphics() { @@ -354,11 +354,11 @@ bool WindowRenderSurface::PreRender( bool resizingSurface ) if( resizingSurface ) { - int totalAngle = (mRotationAngle + mScreenRotationAngle) % 360; - // Window rotate or screen rotate if( !mRotationFinished || !mScreenRotationFinished ) { + int totalAngle = (mRotationAngle + mScreenRotationAngle) % 360; + mWindowBase->SetEglWindowRotation( totalAngle ); mWindowBase->SetEglWindowBufferTransform( totalAngle ); @@ -375,22 +375,9 @@ bool WindowRenderSurface::PreRender( bool resizingSurface ) } // Resize case - if ( !mResizeFinished ) + if( !mResizeFinished ) { - Dali::PositionSize positionSize; - positionSize.x = mPositionSize.x; - positionSize.y = mPositionSize.y; - if( totalAngle == 0 || totalAngle == 180 ) - { - positionSize.width = mPositionSize.width; - positionSize.height = mPositionSize.height; - } - else - { - positionSize.width = mPositionSize.height; - positionSize.height = mPositionSize.width; - } - mWindowBase->ResizeEglWindow( positionSize ); + mWindowBase->ResizeEglWindow( mPositionSize ); mResizeFinished = true; DALI_LOG_INFO( gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::PreRender: Set resize\n" ); @@ -503,7 +490,6 @@ void WindowRenderSurface::OutputTransformed() { mScreenRotationAngle = screenRotationAngle; mScreenRotationFinished = false; - mResizeFinished = false; mOutputTransformedSignal.Emit(); diff --git a/dali/internal/window-system/common/window-render-surface.h b/dali/internal/window-system/common/window-render-surface.h index 6cab258..f8160b8 100644 --- a/dali/internal/window-system/common/window-render-surface.h +++ b/dali/internal/window-system/common/window-render-surface.h @@ -124,12 +124,6 @@ public: // from Dali::RenderSurfaceInterface virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override; /** - * @brief Return the orientation of the surface. - * @return The orientation - */ - virtual int GetOrientation() const override; - - /** * @copydoc Dali::RenderSurfaceInterface::InitializeGraphics() */ virtual void InitializeGraphics() override; diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp b/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp index 4258b7f..509ddd4 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp +++ b/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp @@ -585,10 +585,7 @@ WindowBaseEcoreWl::WindowBaseEcoreWl( Dali::PositionSize positionSize, Any surfa mBrightness( 0 ), mBrightnessChangeState( 0 ), mBrightnessChangeDone( true ), - mOwnSurface( false ), - mWindowRotationAngle( 0 ), - mScreenRotationAngle( 0 ), - mSupportedPreProtation( 0 ) + mOwnSurface( false ) #ifdef DALI_ELDBUS_AVAILABLE , mSystemConnection( NULL ) #endif @@ -1320,10 +1317,9 @@ bool WindowBaseEcoreWl::IsEglWindowRotationSupported() wl_egl_window_capability capability = static_cast< wl_egl_window_capability >( wl_egl_window_get_capabilities( mEglWindow ) ); if( capability == WL_EGL_WINDOW_CAPABILITY_ROTATION_SUPPORTED ) { - mSupportedPreProtation = true; return true; } - mSupportedPreProtation = false; + return false; } @@ -2066,16 +2062,6 @@ void WindowBaseEcoreWl::GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVe dpiVertical = int( yres + 0.5f ); } -int WindowBaseEcoreWl::GetOrientation() const -{ - int orientation = (mScreenRotationAngle + mWindowRotationAngle) % 360; - if( mSupportedPreProtation ) - { - orientation = 0; - } - return orientation; -} - int WindowBaseEcoreWl::GetScreenRotationAngle() { int transform = 0; @@ -2089,21 +2075,14 @@ int WindowBaseEcoreWl::GetScreenRotationAngle() transform = ecore_wl_output_transform_get( ecore_wl_window_output_find( mEcoreWindow ) ); } - mScreenRotationAngle = transform * 90; - return mScreenRotationAngle; + return transform * 90; } void WindowBaseEcoreWl::SetWindowRotationAngle( int degree ) { - mWindowRotationAngle = degree; ecore_wl_window_rotation_set( mEcoreWindow, degree ); } -int WindowBaseEcoreWl::GetWindowRotationAngle() -{ - return mWindowRotationAngle; -} - void WindowBaseEcoreWl::WindowRotationCompleted( int degree, int width, int height ) { ecore_wl_window_rotation_change_done_send( mEcoreWindow ); diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.h b/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.h index 2d0a4ce..5811b5c 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.h +++ b/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.h @@ -395,12 +395,6 @@ public: virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override; /** - * @brief Return the orientation of the surface. - * @return The orientation - */ - virtual int GetOrientation() const override; - - /** * @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenRotationAngle() */ virtual int GetScreenRotationAngle() override; @@ -411,11 +405,6 @@ public: virtual void SetWindowRotationAngle( int degree ) override; /** - * @copydoc Dali::Internal::Adaptor::WindowBase::GetWindowRotationAngle() - */ - virtual int GetWindowRotationAngle() override; - - /** * @copydoc Dali::Internal::Adaptor::WindowBase::WindowRotationCompleted() */ virtual void WindowRotationCompleted( int degree, int width, int height ) override; @@ -486,9 +475,6 @@ private: bool mOwnSurface; - int mWindowRotationAngle; - int mScreenRotationAngle; - int mSupportedPreProtation; #ifdef DALI_ELDBUS_AVAILABLE Eldbus_Connection* mSystemConnection; #endif // DALI_ELDBUS_AVAILABLE diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp index 8c2c04a..89fae58 100755 --- a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp +++ b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp @@ -690,10 +690,7 @@ WindowBaseEcoreWl2::WindowBaseEcoreWl2( Dali::PositionSize positionSize, Any sur mBrightnessChangeDone( true ), mOwnSurface( false ), mMoveResizeSerial( 0 ), - mLastSubmittedMoveResizeSerial( 0 ), - mWindowRotationAngle( 0 ), - mScreenRotationAngle( 0 ), - mSupportedPreProtation( 0 ) + mLastSubmittedMoveResizeSerial( 0 ) #ifdef DALI_ELDBUS_AVAILABLE , mSystemConnection( NULL ) #endif @@ -1074,7 +1071,7 @@ void WindowBaseEcoreWl2::OnMouseButtonCancel( void* data, int type, void* event mTouchEventSignal.Emit( point, touchEvent->timestamp ); - DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::OnMouseButtonCancel\n" ); + DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl::OnMouseButtonCancel\n" ); } } @@ -1084,7 +1081,7 @@ void WindowBaseEcoreWl2::OnMouseWheel( void* data, int type, void* event ) if( mouseWheelEvent->window == static_cast< unsigned int >( ecore_wl2_window_id_get( mEcoreWindow ) ) ) { - DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::OnMouseWheel: direction: %d, modifiers: %d, x: %d, y: %d, z: %d\n", mouseWheelEvent->direction, mouseWheelEvent->modifiers, mouseWheelEvent->x, mouseWheelEvent->y, mouseWheelEvent->z ); + DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl::OnMouseWheel: direction: %d, modifiers: %d, x: %d, y: %d, z: %d\n", mouseWheelEvent->direction, mouseWheelEvent->modifiers, mouseWheelEvent->x, mouseWheelEvent->y, mouseWheelEvent->z ); WheelEvent wheelEvent( WheelEvent::MOUSE_WHEEL, mouseWheelEvent->direction, mouseWheelEvent->modifiers, Vector2( mouseWheelEvent->x, mouseWheelEvent->y ), mouseWheelEvent->z, mouseWheelEvent->timestamp ); @@ -1096,7 +1093,7 @@ void WindowBaseEcoreWl2::OnDetentRotation( void* data, int type, void* event ) { Ecore_Event_Detent_Rotate* detentEvent = static_cast< Ecore_Event_Detent_Rotate* >( event ); - DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Concise, "WindowBaseEcoreWl2::OnDetentRotation\n" ); + DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Concise, "WindowBaseEcoreWl::OnDetentRotation\n" ); int direction = ( detentEvent->direction == ECORE_DETENT_DIRECTION_CLOCKWISE ) ? 1 : -1; int timeStamp = detentEvent->timestamp; @@ -1112,7 +1109,7 @@ void WindowBaseEcoreWl2::OnKeyDown( void* data, int type, void* event ) if( keyEvent->window == static_cast< unsigned int >( ecore_wl2_window_id_get( mEcoreWindow ) ) ) { - DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::OnKeyDown\n" ); + DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl::OnKeyDown\n" ); std::string keyName( keyEvent->keyname ); std::string logicalKey( "" ); @@ -1174,7 +1171,7 @@ void WindowBaseEcoreWl2::OnKeyUp( void* data, int type, void* event ) if( keyEvent->window == static_cast< unsigned int >( ecore_wl2_window_id_get( mEcoreWindow ) ) ) { - DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::OnKeyUp\n" ); + DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl::OnKeyUp\n" ); std::string keyName( keyEvent->keyname ); std::string logicalKey( "" ); @@ -1516,10 +1513,9 @@ bool WindowBaseEcoreWl2::IsEglWindowRotationSupported() wl_egl_window_tizen_capability capability = static_cast< wl_egl_window_tizen_capability >( wl_egl_window_tizen_get_capabilities( mEglWindow ) ); if( capability == WL_EGL_WINDOW_TIZEN_CAPABILITY_ROTATION_SUPPORTED ) { - mSupportedPreProtation = true; return true; } - mSupportedPreProtation = false; + return false; } @@ -2263,16 +2259,6 @@ void WindowBaseEcoreWl2::GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiV dpiVertical = int( yres + 0.5f ); } -int WindowBaseEcoreWl2::GetOrientation() const -{ - int orientation = (mScreenRotationAngle + mWindowRotationAngle) % 360; - if( mSupportedPreProtation ) - { - orientation = 0; - } - return orientation; -} - int WindowBaseEcoreWl2::GetScreenRotationAngle() { int transform = 0; @@ -2285,21 +2271,15 @@ int WindowBaseEcoreWl2::GetScreenRotationAngle() { transform = ecore_wl2_output_transform_get( ecore_wl2_window_output_find( mEcoreWindow ) ); } - mScreenRotationAngle = transform * 90; - return mScreenRotationAngle; + + return transform * 90; } void WindowBaseEcoreWl2::SetWindowRotationAngle( int degree ) { - mWindowRotationAngle = degree; ecore_wl2_window_rotation_set( mEcoreWindow, degree ); } -int WindowBaseEcoreWl2::GetWindowRotationAngle() -{ - return mWindowRotationAngle; -} - void WindowBaseEcoreWl2::WindowRotationCompleted( int degree, int width, int height ) { ecore_wl2_window_rotation_change_done_send( mEcoreWindow, degree, width, height ); diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h index bd4afb5..c7a7240 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h +++ b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h @@ -417,12 +417,6 @@ public: virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override; /** - * @brief Return the orientation of the surface. - * @return The orientation - */ - virtual int GetOrientation() const override; - - /** * @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenRotationAngle() */ virtual int GetScreenRotationAngle() override; @@ -433,11 +427,6 @@ public: virtual void SetWindowRotationAngle( int degree ) override; /** - * @copydoc Dali::Internal::Adaptor::WindowBase::GetWindowRotationAngle() - */ - virtual int GetWindowRotationAngle() override; - - /** * @copydoc Dali::Internal::Adaptor::WindowBase::WindowRotationCompleted() */ virtual void WindowRotationCompleted( int degree, int width, int height ) override; @@ -512,9 +501,6 @@ private: volatile uint32_t mMoveResizeSerial; uint32_t mLastSubmittedMoveResizeSerial; - int mWindowRotationAngle; - int mScreenRotationAngle; - int mSupportedPreProtation; #ifdef DALI_ELDBUS_AVAILABLE Eldbus_Connection* mSystemConnection; #endif // DALI_ELDBUS_AVAILABLE diff --git a/dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.cpp b/dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.cpp index 7bb678c..3ef4f68 100644 --- a/dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.cpp +++ b/dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.cpp @@ -142,11 +142,6 @@ void NativeRenderSurfaceEcoreWl::GetDpi( unsigned int& dpiHorizontal, unsigned i dpiVertical = int( yres + 0.5f ); } -int NativeRenderSurfaceEcoreWl::GetOrientation() const -{ - return 0; -} - void NativeRenderSurfaceEcoreWl::InitializeGraphics() { DALI_LOG_TRACE_METHOD( gNativeSurfaceLogFilter ); diff --git a/dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.h b/dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.h index dba6bfd..e3a33ba 100644 --- a/dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.h +++ b/dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.h @@ -84,12 +84,6 @@ public: // from Dali::RenderSurfaceInterface virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override; /** - * @brief Return the orientation of the surface. - * @return The orientation - */ - virtual int GetOrientation() const override; - - /** * @copydoc Dali::RenderSurfaceInterface::InitializeGraphics() */ virtual void InitializeGraphics() override; diff --git a/dali/internal/window-system/ubuntu-x11/pixmap-render-surface-ecore-x.cpp b/dali/internal/window-system/ubuntu-x11/pixmap-render-surface-ecore-x.cpp index b9b9811..2e93140 100644 --- a/dali/internal/window-system/ubuntu-x11/pixmap-render-surface-ecore-x.cpp +++ b/dali/internal/window-system/ubuntu-x11/pixmap-render-surface-ecore-x.cpp @@ -147,11 +147,6 @@ void PixmapRenderSurfaceEcoreX::GetDpi( unsigned int& dpiHorizontal, unsigned in dpiVertical = int( yres + 0.5f ); } -int PixmapRenderSurfaceEcoreX::GetOrientation() const -{ - return 0; -} - void PixmapRenderSurfaceEcoreX::InitializeGraphics() { mGraphics = &mAdaptor->GetGraphicsInterface(); diff --git a/dali/internal/window-system/ubuntu-x11/pixmap-render-surface-ecore-x.h b/dali/internal/window-system/ubuntu-x11/pixmap-render-surface-ecore-x.h index 89f2501..034fee6 100644 --- a/dali/internal/window-system/ubuntu-x11/pixmap-render-surface-ecore-x.h +++ b/dali/internal/window-system/ubuntu-x11/pixmap-render-surface-ecore-x.h @@ -82,12 +82,6 @@ public: // from Dali::RenderSurfaceInterface virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override; /** - * @brief Return the orientation of the surface. - * @return The orientation - */ - virtual int GetOrientation() const override; - - /** * @copydoc Dali::RenderSurfaceInterface::InitializeGraphics() */ virtual void InitializeGraphics() override; diff --git a/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp b/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp index 77567d4..ab67b43 100755 --- a/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp +++ b/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp @@ -834,11 +834,6 @@ void WindowBaseEcoreX::GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVer dpiVertical = ecore_x_dpi_get(); } -int WindowBaseEcoreX::GetOrientation() const -{ - return 0; -} - int WindowBaseEcoreX::GetScreenRotationAngle() { return 0; @@ -848,11 +843,6 @@ void WindowBaseEcoreX::SetWindowRotationAngle( int degree ) { } -int WindowBaseEcoreX::GetWindowRotationAngle() -{ - return 0; -} - void WindowBaseEcoreX::WindowRotationCompleted( int degree, int width, int height ) { } diff --git a/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h b/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h index f01d32d..8ab7080 100644 --- a/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h +++ b/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h @@ -329,12 +329,6 @@ public: virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override; /** - * @brief Return the orientation of the surface. - * @return The orientation - */ - virtual int GetOrientation() const override; - - /** * @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenRotationAngle() */ virtual int GetScreenRotationAngle() override; @@ -345,11 +339,6 @@ public: virtual void SetWindowRotationAngle( int degree ) override; /** - * @copydoc Dali::Internal::Adaptor::WindowBase::GetWindowRotationAngle() - */ - virtual int GetWindowRotationAngle() override; - - /** * @copydoc Dali::Internal::Adaptor::WindowBase::WindowRotationCompleted() */ virtual void WindowRotationCompleted( int degree, int width, int height ) override; diff --git a/dali/internal/window-system/windows/window-base-win.cpp b/dali/internal/window-system/windows/window-base-win.cpp index 7c64458..c968bea 100755 --- a/dali/internal/window-system/windows/window-base-win.cpp +++ b/dali/internal/window-system/windows/window-base-win.cpp @@ -454,10 +454,6 @@ void WindowBaseWin::SetWindowRotationAngle( int degree ) { } -int WindowBaseWin::GetWindowRotationAngle() -{ -} - void WindowBaseWin::WindowRotationCompleted( int degree, int width, int height ) { } @@ -466,10 +462,6 @@ void WindowBaseWin::SetTransparency( bool transparent ) { } -int WindowBaseWin::GetOrientation() const -{ -} - unsigned int WindowBaseWin::GetSurfaceId( Any surface ) const { unsigned int surfaceId = 0; diff --git a/dali/internal/window-system/windows/window-base-win.h b/dali/internal/window-system/windows/window-base-win.h index 05b208e..c0a17dc 100755 --- a/dali/internal/window-system/windows/window-base-win.h +++ b/dali/internal/window-system/windows/window-base-win.h @@ -327,11 +327,6 @@ public: virtual void SetWindowRotationAngle( int degree ) override; /** - * @copydoc Dali::Internal::Adaptor::WindowBase::GetWindowRotationAngle() - */ - virtual void GetWindowRotationAngle() override; - - /** * @copydoc Dali::Internal::Adaptor::WindowBase::WindowRotationCompleted() */ virtual void WindowRotationCompleted( int degree, int width, int height ) override; @@ -342,12 +337,6 @@ public: virtual void SetTransparency( bool transparent ) override; /** - * @brief Return the orientation of the surface. - * @return The orientation - */ - virtual int GetOrientation() const override; - - /** * @copydoc Dali::Internal::Adaptor::WindowBase::SetParent() */ virtual void SetParent( WindowBase* parentWinBase ) override; -- 2.7.4 From 7e310b4ff142050a931a00c62be451ed25807def Mon Sep 17 00:00:00 2001 From: Heeyong Song Date: Wed, 6 May 2020 17:22:52 +0900 Subject: [PATCH 11/16] Revert "[Tizen] Add DALi Autofill implementation" This reverts commit 7e09e25a54423ba157604dcc1f0a26befc75b5cc. Change-Id: I917379f6425ceb8c0e19659c2f04161ad8f862bd --- build/tizen/CMakeLists.txt | 2 +- build/tizen/deps-check.cmake | 12 - .../devel-api/adaptor-framework/autofill-group.cpp | 89 ---- dali/devel-api/adaptor-framework/autofill-group.h | 151 ------ dali/devel-api/adaptor-framework/autofill-item.cpp | 115 ---- dali/devel-api/adaptor-framework/autofill-item.h | 210 -------- .../adaptor-framework/autofill-manager.cpp | 126 ----- .../devel-api/adaptor-framework/autofill-manager.h | 213 -------- dali/devel-api/file.list | 6 - dali/internal/input/common/autofill-factory.h | 54 -- dali/internal/input/common/autofill-group-impl.cpp | 44 -- dali/internal/input/common/autofill-group-impl.h | 137 ----- dali/internal/input/common/autofill-item-impl.cpp | 43 -- dali/internal/input/common/autofill-item-impl.h | 174 ------ .../input/common/autofill-manager-impl.cpp | 44 -- dali/internal/input/common/autofill-manager-impl.h | 190 ------- dali/internal/input/file.list | 39 +- .../tizen-wayland/autofill-factory-ecore-wl.cpp | 53 -- .../tizen-wayland/autofill-group-impl-ecore-wl.cpp | 230 -------- .../tizen-wayland/autofill-group-impl-ecore-wl.h | 150 ------ .../tizen-wayland/autofill-item-impl-ecore-wl.cpp | 207 ------- .../tizen-wayland/autofill-item-impl-ecore-wl.h | 195 ------- .../autofill-manager-impl-ecore-wl.cpp | 592 --------------------- .../tizen-wayland/autofill-manager-impl-ecore-wl.h | 258 --------- .../input/ubuntu-x11/autofill-factory-x.cpp | 54 -- .../input/ubuntu-x11/autofill-group-impl-x.cpp | 134 ----- .../input/ubuntu-x11/autofill-group-impl-x.h | 127 ----- .../input/ubuntu-x11/autofill-item-impl-x.cpp | 155 ------ .../input/ubuntu-x11/autofill-item-impl-x.h | 171 ------ .../input/ubuntu-x11/autofill-manager-impl-x.cpp | 252 --------- .../input/ubuntu-x11/autofill-manager-impl-x.h | 217 -------- packaging/dali-adaptor.spec | 6 - 32 files changed, 15 insertions(+), 4435 deletions(-) delete mode 100755 dali/devel-api/adaptor-framework/autofill-group.cpp delete mode 100755 dali/devel-api/adaptor-framework/autofill-group.h delete mode 100755 dali/devel-api/adaptor-framework/autofill-item.cpp delete mode 100755 dali/devel-api/adaptor-framework/autofill-item.h delete mode 100755 dali/devel-api/adaptor-framework/autofill-manager.cpp delete mode 100755 dali/devel-api/adaptor-framework/autofill-manager.h delete mode 100644 dali/internal/input/common/autofill-factory.h delete mode 100755 dali/internal/input/common/autofill-group-impl.cpp delete mode 100644 dali/internal/input/common/autofill-group-impl.h delete mode 100755 dali/internal/input/common/autofill-item-impl.cpp delete mode 100644 dali/internal/input/common/autofill-item-impl.h delete mode 100755 dali/internal/input/common/autofill-manager-impl.cpp delete mode 100644 dali/internal/input/common/autofill-manager-impl.h delete mode 100755 dali/internal/input/tizen-wayland/autofill-factory-ecore-wl.cpp delete mode 100755 dali/internal/input/tizen-wayland/autofill-group-impl-ecore-wl.cpp delete mode 100644 dali/internal/input/tizen-wayland/autofill-group-impl-ecore-wl.h delete mode 100755 dali/internal/input/tizen-wayland/autofill-item-impl-ecore-wl.cpp delete mode 100644 dali/internal/input/tizen-wayland/autofill-item-impl-ecore-wl.h delete mode 100755 dali/internal/input/tizen-wayland/autofill-manager-impl-ecore-wl.cpp delete mode 100644 dali/internal/input/tizen-wayland/autofill-manager-impl-ecore-wl.h delete mode 100755 dali/internal/input/ubuntu-x11/autofill-factory-x.cpp delete mode 100755 dali/internal/input/ubuntu-x11/autofill-group-impl-x.cpp delete mode 100644 dali/internal/input/ubuntu-x11/autofill-group-impl-x.h delete mode 100755 dali/internal/input/ubuntu-x11/autofill-item-impl-x.cpp delete mode 100644 dali/internal/input/ubuntu-x11/autofill-item-impl-x.h delete mode 100755 dali/internal/input/ubuntu-x11/autofill-manager-impl-x.cpp delete mode 100644 dali/internal/input/ubuntu-x11/autofill-manager-impl-x.h diff --git a/build/tizen/CMakeLists.txt b/build/tizen/CMakeLists.txt index 459a7b5..7c56a82 100644 --- a/build/tizen/CMakeLists.txt +++ b/build/tizen/CMakeLists.txt @@ -378,7 +378,7 @@ IF( ENABLE_LINK_TEST ) ADD_EXECUTABLE( ${LINKER_TEST_NAME} ${LINKER_TEST_SOURCES} ) MESSAGE(STATUS "libs: ${DALICORE_LDFLAGS}") TARGET_COMPILE_OPTIONS( ${LINKER_TEST_NAME} PRIVATE -I${ROOT_SRC_DIR} ${DALICORE_CFLAGS} ) - TARGET_LINK_LIBRARIES(${LINKER_TEST_NAME} ${name} ${DALICORE_LDFLAGS} ${VCONF_LDFLAGS} ${HARFBUZZ_LDFLAGS} ${AUTOFILL_LDFLAGS} ) + TARGET_LINK_LIBRARIES(${LINKER_TEST_NAME} ${name} ${DALICORE_LDFLAGS} ${VCONF_LDFLAGS} ${HARFBUZZ_LDFLAGS} ) TARGET_INCLUDE_DIRECTORIES( ${LINKER_TEST_NAME} PRIVATE ${DALI_TEST_SUITE_DIR} ) ENDIF() diff --git a/build/tizen/deps-check.cmake b/build/tizen/deps-check.cmake index b60bd0c..b496dd9 100644 --- a/build/tizen/deps-check.cmake +++ b/build/tizen/deps-check.cmake @@ -18,9 +18,6 @@ ARG_ENABLE( ENABLE_PROFILE enable_profile "${ENABLE_VAL};UBUNTU" "Select the var # Tizen Major version ARG_ENABLE( ENABLE_TIZEN_MAJOR_VERSION enable_tizen_major_version "${ENABLE_VAL};0" "Specify the Tizen Major version for backwards compatibility" ) -# Tizen Minor version -ARG_ENABLE( ENABLE_TIZEN_MINOR_VERSION enable_tizen_minor_version "${ENABLE_VAL};0" "Specify the Tizen Minor version for backwards compatibility" ) - ARG_ENABLE( ENABLE_FEEDBACK enable_feedback 1 "Enable feedback plugin" ) ARG_ENABLE( ENABLE_WAYLAND enable_wayland "${ENABLE_VAL}" "Build on Wayland" ) @@ -129,13 +126,6 @@ ENDIF() CHECK_MODULE_AND_SET( WAYLAND_EXTENSION xdg-shell-client text-client input-method-client [] ) -IF( enable_tizen_major_version GREATER 5 ) - IF( enable_tizen_minor_version GREATER 5 ) - CHECK_MODULE_AND_SET( AUTOFILL capi-ui-autofill [] ) - ADD_DEFINITIONS( -DCAPI_AUTOFILL_SUPPORT ) - ENDIF() -ENDIF() - # BUILD CONDITIONS IF( watch_available AND WEARABLE_PROFILE ) ADD_DEFINITIONS( -DAPPCORE_WATCH_AVAILABLE ) @@ -275,8 +265,6 @@ SET( DALI_LDFLAGS ${LIBCURL_LDFLAGS} ${LIBCRYPTO_LDFLAGS} ${HARFBUZZ_LDFLAGS} - ${AUTOFILL_LDFLAGS} - ${TPKP_CURL_LDFLAGS} ${UTILX_LDFLAGS} -lgif -lturbojpeg diff --git a/dali/devel-api/adaptor-framework/autofill-group.cpp b/dali/devel-api/adaptor-framework/autofill-group.cpp deleted file mode 100755 index cca5b06..0000000 --- a/dali/devel-api/adaptor-framework/autofill-group.cpp +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -// CLASS HEADER -#include - -// INTERNAL INCLUDES -#include - -namespace Dali -{ - -AutofillGroup::AutofillGroup() -{ -} - -AutofillGroup::AutofillGroup( Internal::Adaptor::AutofillGroup* internal ) -: BaseHandle( internal ) -{ -} - -AutofillGroup::~AutofillGroup() -{ -} - -AutofillGroup::AutofillGroup( const AutofillGroup& group ) -: BaseHandle( group ) -{ -} - -AutofillGroup& AutofillGroup::operator=( const AutofillGroup& group ) -{ - if( *this != group ) - { - BaseHandle::operator=( group ); - } - return *this; -} - -AutofillGroup AutofillGroup::DownCast( BaseHandle handle ) -{ - return AutofillGroup( dynamic_cast< Internal::Adaptor::AutofillGroup* >( handle.GetObjectPtr() ) ); -} - -const std::string& AutofillGroup::GetId() const -{ - return Internal::Adaptor::GetImplementation(*this).GetId(); -} - -void AutofillGroup::AddAutofillItem( Dali::AutofillItem item ) -{ - Internal::Adaptor::GetImplementation(*this).AddAutofillItem( item ); -} - -Dali::AutofillItem AutofillGroup::GetAutofillItem( const std::string& id ) -{ - return Internal::Adaptor::GetImplementation(*this).GetAutofillItem( id ); -} - -void AutofillGroup::SaveAutofillData() -{ - Internal::Adaptor::GetImplementation(*this).SaveAutofillData(); -} - -void AutofillGroup::RequestAuthentication() -{ - Internal::Adaptor::GetImplementation(*this).RequestAuthentication(); -} - -void AutofillGroup::SendFillRequest() -{ - Internal::Adaptor::GetImplementation(*this).SendFillRequest(); -} - -} // namespace Dali diff --git a/dali/devel-api/adaptor-framework/autofill-group.h b/dali/devel-api/adaptor-framework/autofill-group.h deleted file mode 100755 index 26bfe8d..0000000 --- a/dali/devel-api/adaptor-framework/autofill-group.h +++ /dev/null @@ -1,151 +0,0 @@ -#ifndef DALI_AUTOFILL_GROUP_H -#define DALI_AUTOFILL_GROUP_H - -/* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -// EXTERNAL INCLUDES -#include - -// INTERNAL INCLUDES -#include -#include - -namespace Dali -{ - -namespace Internal DALI_INTERNAL -{ -namespace Adaptor -{ -class AutofillGroup; -} -} - - -/** - * @brief The AutofillGroup class - * - * is used to group AutofillItems together. - */ -class DALI_ADAPTOR_API AutofillGroup : public BaseHandle -{ -public: - - /** - * @brief Creates an uninitialized AutofillGroup. - * - * To create AutofillGroup instance, please refer to Dali::AutofillManager::CreateAutofillGroup(). - */ - AutofillGroup(); - - /** - * @brief AutofillGroup Destructor. - */ - ~AutofillGroup(); - - /** - * @brief Copy constructor. - * - * @param[in] group AutofillGroup to copy. The copied player will point at the same implementation - */ - AutofillGroup( const AutofillGroup& group ); - - /** - * @brief Assignment operator. - * - * @param[in] group The AutofillGroup to assign from. - * @return The updated AutofillGroup. - */ - AutofillGroup& operator=( const AutofillGroup& group ); - - /** - * @brief Downcast a handle to AutofillGroup handle. - * - * If handle points to a AutofillGroup the downcast produces valid - * handle. If not the returned handle is left uninitialized. - * - * @param[in] handle Handle to an object - * @return Handle to a AutofillGroup or an uninitialized handle - */ - static AutofillGroup DownCast( BaseHandle handle ); - - /** - * @brief Equality operator. - * - * @param[in] rhs The AutofillGroup structure to test against - * @return True if AutofillGroups are equal - */ - bool operator==( const AutofillGroup& rhs ) const - { - if( &rhs == this ) - { - return true; - } - return false; - } - - /** - * @brief Gets AutofillGroup unique Id. - * - * @return AutofillGroup ID - */ - const std::string& GetId() const; - - /** - * @brief Adds AutofillItem to AutofillGroup itself in order to group. - * - * @param[in] item AutofillItem instance to be included in AutofillGroup - */ - void AddAutofillItem( Dali::AutofillItem item ); - - /** - * @brief Gets AutofillItem instance according to the id. - * - * @param[in] id AutofillItem Id to get from AutofillGroup List - * @return AutofillItem instance to match for Id - */ - Dali::AutofillItem GetAutofillItem( const std::string& id ); - - /** - * @brief Stores Autofill data in autofill group. - */ - void SaveAutofillData(); - - /** - * @brief Requests and receives autofill authentication information. - */ - void RequestAuthentication(); - - /** - * @brief Sends fill request to fill out the data. - */ - void SendFillRequest(); - -public: // Not intended for application developers - - /** - * @brief Internal constructor - */ - explicit DALI_INTERNAL AutofillGroup( Internal::Adaptor::AutofillGroup* internal ); - -}; - - -} // namespace Dali - -#endif // DALI_AUTOFILL_GROUP_H diff --git a/dali/devel-api/adaptor-framework/autofill-item.cpp b/dali/devel-api/adaptor-framework/autofill-item.cpp deleted file mode 100755 index 2b68534..0000000 --- a/dali/devel-api/adaptor-framework/autofill-item.cpp +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -// CLASS HEADER -#include - -// INTERNAL INCLUDES -#include - -namespace Dali -{ - -AutofillItem::AutofillItem() -{ -} - -AutofillItem::AutofillItem( Internal::Adaptor::AutofillItem* internal ) -: BaseHandle( internal ) -{ -} - -AutofillItem::~AutofillItem() -{ -} - -AutofillItem::AutofillItem( const AutofillItem& item ) -: BaseHandle( item ) -{ -} - -AutofillItem& AutofillItem::operator=( const AutofillItem& item ) -{ - if( *this != item ) - { - BaseHandle::operator=( item ); - } - return *this; -} - -AutofillItem AutofillItem::DownCast( BaseHandle handle ) -{ - return AutofillItem( dynamic_cast< Internal::Adaptor::AutofillItem* >( handle.GetObjectPtr() ) ); -} - - -const std::string& AutofillItem::GetId() const -{ - return Internal::Adaptor::GetImplementation(*this).GetId(); -} - -const std::string& AutofillItem::GetLabel() const -{ - return Internal::Adaptor::GetImplementation(*this).GetLabel(); -} - -Dali::AutofillItem::Hint AutofillItem::GetHint() const -{ - return Internal::Adaptor::GetImplementation(*this).GetHint(); -} - -bool AutofillItem::IsSensitiveData() const -{ - return Internal::Adaptor::GetImplementation(*this).IsSensitiveData(); -} - -void AutofillItem::SetSaveValue( const std::string& value ) -{ - Internal::Adaptor::GetImplementation(*this).SetSaveValue( value ); -} - -const std::string& AutofillItem::GetSaveValue() const -{ - return Internal::Adaptor::GetImplementation(*this).GetSaveValue(); -} - -const std::string& AutofillItem::GetPresentationText( int index ) const -{ - return Internal::Adaptor::GetImplementation(*this).GetPresentationText( index ); -} - -const std::string& AutofillItem::GetFillValue( int index ) const -{ - return Internal::Adaptor::GetImplementation(*this).GetFillValue( index ); -} - -void AutofillItem::ClearPresentationTextList() -{ - Internal::Adaptor::GetImplementation(*this).ClearPresentationTextList(); -} - -void AutofillItem::ClearFillValueList() -{ - Internal::Adaptor::GetImplementation(*this).ClearFillValueList(); -} - -unsigned int AutofillItem::GetFillValueCount() -{ - return Internal::Adaptor::GetImplementation(*this).GetFillValueCount(); -} - -} // namespace Dali diff --git a/dali/devel-api/adaptor-framework/autofill-item.h b/dali/devel-api/adaptor-framework/autofill-item.h deleted file mode 100755 index e47cb12..0000000 --- a/dali/devel-api/adaptor-framework/autofill-item.h +++ /dev/null @@ -1,210 +0,0 @@ -#ifndef DALI_AUTOFILL_ITEM_H -#define DALI_AUTOFILL_ITEM_H - -/* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -// EXTERNAL INCLUDES -#include - -// INTERNAL INCLUDES -#include - -namespace Dali -{ - -namespace Internal DALI_INTERNAL -{ -namespace Adaptor -{ -class AutofillItem; -} -} - - -/** - * @brief The AutofillItem class - * - * is used to pass on data from the AutofillItem. - * AutofillItem includes Id, Label, Autofill Hint, and whether it is sensitive or not. - */ -class DALI_ADAPTOR_API AutofillItem : public BaseHandle -{ -public: - - /** - * @brief Enumeration for hint of the autofill item. - */ - enum class Hint - { - CREDIT_CARD_EXPIRATION_DATE, ///< Autofill hint for a credit card expiration date - CREDIT_CARD_EXPIRATION_DAY, ///< Autofill hint for a credit card expiration day - CREDIT_CARD_EXPIRATION_MONTH, ///< Autofill hint for a credit card expiration month - CREDIT_CARD_EXPIRATION_YEAR, ///< Autofill hint for a credit card expiration year - CREDIT_CARD_NUMBER, ///< Autofill hint for a credit card number - EMAIL_ADDRESS, ///< Autofill hint for an email address - NAME, ///< Autofill hint for a user's real name - PHONE, ///< Autofill hint for a phone number - POSTAL_ADDRESS, ///< Autofill hint for a postal address - POSTAL_CODE, ///< Autofill hint for a postal code - ID, ///< Autofill hint for a user's ID - PASSWORD, ///< Autofill hint for password - CREDIT_CARD_SECURITY_CODE ///< Autofill hint for a credit card security code - }; - -public: - - /** - * @brief Creates an uninitialized AutofillItem. - * - * To create AutofillItem instance, please refer to Dali::AutofillManager::CreateAutofillItem(). - */ - AutofillItem(); - - /** - * @brief AutofillItem Destructor. - */ - ~AutofillItem(); - - /** - * @brief Copy constructor. - * - * @param[in] item AutofillItem to copy. The copied player will point at the same implementation - */ - AutofillItem( const AutofillItem& item ); - - /** - * @brief Assignment operator. - * - * @param[in] item The AutofillItem to assign from. - * @return The updated AutofillItem. - */ - AutofillItem& operator=( const AutofillItem& item ); - - /** - * @brief Downcast a handle to AutofillItem handle. - * - * If handle points to a AutofillItem the downcast produces valid - * handle. If not the returned handle is left uninitialized. - * - * @param[in] handle Handle to an object - * @return Handle to a AutofillItem or an uninitialized handle - */ - static AutofillItem DownCast( BaseHandle handle ); - - /** - * @brief Equality operator. - * - * @param[in] rhs The AutofillItem structure to test against - * @return True if AutofillItems are equal - */ - bool operator==( const AutofillItem& rhs ) const - { - if( &rhs == this ) - { - return true; - } - return false; - } - - /** - * @brief Gets AutofillItem Id. - * - * @return AutofillItem Id - */ - const std::string& GetId() const; - - /** - * @brief Gets AutofillItem Label. - * - * @return AutofillItem Label - */ - const std::string& GetLabel() const; - - /** - * @brief Gets AutofillItem Hint. - * - * @return AutofillItem Hint - */ - Dali::AutofillItem::Hint GetHint() const; - - /** - * @brief Gets whether AutofillItem is sensitive data or not. - * - * @return True if the AutofillItem is sensitive. - */ - bool IsSensitiveData() const; - - /** - * @brief Sets AutofillItem value for saving. - * - * @param[in] value The value for saving - */ - void SetSaveValue( const std::string& value ); - - /** - * @brief Gets the saved value of AutofillItem. - * - * @return The saved value - */ - const std::string& GetSaveValue() const; - - /** - * @brief Gets the presentation text with a index of the list. - * - * @param index The index for the presentation text list - * @return The presentation text to show up for the fill value - */ - const std::string& GetPresentationText( int index ) const; - - /** - * @brief Gets the value to be filled with a index of the list. - * - * @param index The index for the value list - * @return The value to be filled - */ - const std::string& GetFillValue( int index ) const; - - /** - * @brief Clears the presentation text list. - */ - void ClearPresentationTextList(); - - /** - * @brief Clears the value list. - */ - void ClearFillValueList(); - - /** - * @brief Gets the number of fill value in the list. - * - * @return The number of fill value in the list - */ - unsigned int GetFillValueCount(); - -public: // Not intended for application developers - - /** - * @brief Internal constructor - */ - explicit DALI_INTERNAL AutofillItem( Internal::Adaptor::AutofillItem* internal ); - -}; - -} // namespace Dali - -#endif // DALI_AUTOFILL_ITEM_H diff --git a/dali/devel-api/adaptor-framework/autofill-manager.cpp b/dali/devel-api/adaptor-framework/autofill-manager.cpp deleted file mode 100755 index 4507004..0000000 --- a/dali/devel-api/adaptor-framework/autofill-manager.cpp +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -// CLASS HEADER -#include - -// INTERNAL INCLUDES -#include - -namespace Dali -{ - -AutofillManager::AutofillManager() -{ -} - -AutofillManager::~AutofillManager() -{ -} - -AutofillManager AutofillManager::Get() -{ - return Internal::Adaptor::AutofillManager::Get(); -} - -AutofillManager::AutofillManager(Internal::Adaptor::AutofillManager *impl) -: BaseHandle(impl) -{ -} - -/////////////////////////////////////////////// Autofill Item and Group /////////////////////////////////////////////// - -Dali::AutofillItem AutofillManager::CreateAutofillItem( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool isSensitive ) -{ - return Internal::Adaptor::GetImplementation(*this).CreateAutofillItem( id, label, hint, isSensitive ); -} - -Dali::AutofillGroup AutofillManager::CreateAutofillGroup( const std::string& groupId ) -{ - return Internal::Adaptor::GetImplementation(*this).CreateAutofillGroup( groupId ); -} - - -/////////////////////////////////////////////// Autofill Authentication Information /////////////////////////////////////////////// - -bool AutofillManager::IsAutofillDataPresent() const -{ - return Internal::Adaptor::GetImplementation(*this).IsAutofillDataPresent(); -} - -bool AutofillManager::IsAuthenticationNeeded() const -{ - return Internal::Adaptor::GetImplementation(*this).IsAuthenticationNeeded(); -} - -const std::string& AutofillManager::GetAuthenticationServiceName() const -{ - return Internal::Adaptor::GetImplementation(*this).GetAuthenticationServiceName(); -} - -const std::string& AutofillManager::GetAuthenticationServiceMessage() const -{ - return Internal::Adaptor::GetImplementation(*this).GetAuthenticationServiceMessage(); -} - -const std::string& AutofillManager::GetAuthenticationServiceImagePath() const -{ - return Internal::Adaptor::GetImplementation(*this).GetAuthenticationServiceImagePath(); -} - -/////////////////////////////////////////////// Autofill Fill Response /////////////////////////////////////////////// - -const std::string& AutofillManager::GetFillItemId() const -{ - return Internal::Adaptor::GetImplementation(*this).GetFillItemId(); -} - -const std::string& AutofillManager::GetFillItemPresentationText() const -{ - return Internal::Adaptor::GetImplementation(*this).GetFillItemPresentationText(); -} - -const std::string& AutofillManager::GetFillItemValue() const -{ - return Internal::Adaptor::GetImplementation(*this).GetFillItemValue(); -} - -void AutofillManager::SaveAutofillData( Dali::AutofillGroup group ) -{ - Internal::Adaptor::GetImplementation(*this).SaveAutofillData( group ); -} - - -// Signals - -AutofillManager::AuthSignalType& AutofillManager::AuthenticationReceivedSignal() -{ - return Internal::Adaptor::GetImplementation(*this).AuthenticationReceivedSignal(); -} - -AutofillManager::FillSignalType& AutofillManager::FillResponseReceivedSignal() -{ - return Internal::Adaptor::GetImplementation(*this).FillResponseReceivedSignal(); -} - -AutofillManager::ListSignalType& AutofillManager::ListEventSignal() -{ - return Internal::Adaptor::GetImplementation(*this).ListEventSignal(); -} - - -} // namespace Dali diff --git a/dali/devel-api/adaptor-framework/autofill-manager.h b/dali/devel-api/adaptor-framework/autofill-manager.h deleted file mode 100755 index fce0af9..0000000 --- a/dali/devel-api/adaptor-framework/autofill-manager.h +++ /dev/null @@ -1,213 +0,0 @@ -#ifndef DALI_AUTOFILL_MANAGER_H -#define DALI_AUTOFILL_MANAGER_H - -/* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -// EXTERNAL INCLUDES -#include -#include - -// INTERNAL INCLUDES -#include -#include - -namespace Dali -{ - -namespace Internal DALI_INTERNAL -{ -namespace Adaptor -{ -class AutofillManager; -} -} - - -/** - * @brief The AutofillManager class - * - * allows the application to fill out the user data, such as email, account and address previously saved. - * Currently, Autofill is limited to text input box. Later it can be ScrollView, etc. - * - * Signals - * | %Signal Name | Method | - * |------------------------|-------------------------------------| - * | authenticationReceived | @ref AuthenticationReceivedSignal() | - * | fillResponseReceived | @ref FillResponseReceivedSignal() | - */ -class DALI_ADAPTOR_API AutofillManager : public BaseHandle -{ -public: - - - // TODO : Need to update parameter and return value according to each Signal - typedef Signal< void () > AuthSignalType; ///< Authentication Received Signal - typedef Signal< void ( AutofillItem ) > FillSignalType; ///< Fill Response Received Signal - typedef Signal< void () > ListSignalType; ///< List Event Signal for multi-group - -public: - - /** - * @brief Retrieves a handle to the instance of AutofillManager. - * - * @return A handle to the AutofillManager. - */ - static AutofillManager Get(); - - - /////////////////////////////////////////////// Autofill Item and Group /////////////////////////////////////////////// - - /** - * @brief Creates AutofillItem instance. - * - * @param[in] id A unique ID that does not always change on each launching - * @param[in] label An auxiliary means to guess heuristically what data is - * @param[in] hint The Hint - id (username), name, password, phone, credit card number, organization, and so on - * @param[in] isSensitive Whether this AutofillItem is a sensitive data or not - * @return A public handle to the newly allocated AutofillItem - */ - Dali::AutofillItem CreateAutofillItem( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool isSensitive ); - - /** - * @brief Creates AutofillGroup instance. - * - * @param[in] groupId A unique ID value of each AutofillGroup - * @return A public handle to the newly allocated AutofillGroup - */ - Dali::AutofillGroup CreateAutofillGroup( const std::string& groupId ); - - - /////////////////////////////////////////////// Autofill Authentication Information /////////////////////////////////////////////// - - /** - * @brief Gets the 'autofill data present' attribute in autofill authentication information. - * - * @return True if Autofill data is present - */ - bool IsAutofillDataPresent() const; - - /** - * @brief Gets the 'authentication needed' attribute in autofill authentication information. - * - * @return True if the authentication is needed in the current Autofill process. - */ - bool IsAuthenticationNeeded() const; - - /** - * @brief Gets the service name in autofill authentication information. - * - * @return The autofill authentication service name - */ - const std::string& GetAuthenticationServiceName() const; - - /** - * @brief Gets the service message in autofill authentication information. - * - * @return The autofill authentication service message - */ - const std::string& GetAuthenticationServiceMessage() const; - - /** - * @brief Gets the service logo image path in autofill authentication information. - * - * @return The autofill authentication service logo image path - */ - const std::string& GetAuthenticationServiceImagePath() const; - - - /////////////////////////////////////////////// Autofill Fill Response /////////////////////////////////////////////// - - /** - * @brief Gets the autofill ID in an autofill fill response item. - * - * @return The autofill fill response item ID - */ - const std::string& GetFillItemId() const; - - /** - * @brief Gets the presentation text in an autofill fill response item. - * - * @return The presentation text - */ - const std::string& GetFillItemPresentationText() const; - - /** - * @brief Gets the autofill value in an autofill fill response item. - * - * @return The autofill fill response item value - */ - const std::string& GetFillItemValue() const; - - /** - * @brief Stores the current Autofill data. - * - * @param[in] group The AutofillGroup to store the data - */ - void SaveAutofillData( Dali::AutofillGroup group ); - -public: - // Signals - /** - * @brief This is emitted when the authentication is needed and AutofillManager gets the information. - * - * @return The signal containing the received data - */ - AuthSignalType& AuthenticationReceivedSignal(); - - /** - * @brief This is emitted when AutofillManager receives the fill response. - * - * @return The signal containing the received data - */ - FillSignalType& FillResponseReceivedSignal(); - - /** - * @brief This is emitted when the list for multi fill response group is needed. - * - * @return The signal containing the received data - */ - ListSignalType& ListEventSignal(); - - // Construction & Destruction - /** - * @brief Constructor. - * - * Create an uninitialized handle. - * This can be initialized by calling AutofillManager::Get(). - */ - AutofillManager(); - - /** - * @brief Destructor - * - * This is non-virtual since derived Handle types must not contain data or virtual methods. - */ - ~AutofillManager(); - - /** - * @brief This constructor is used by AutofillManager::Get(). - * - * @param[in] autofillManager A pointer to the AutofillManager. - */ - explicit DALI_INTERNAL AutofillManager( Internal::Adaptor::AutofillManager* autofillManager ); - -}; - -} // namespace Dali - -#endif // DALI_AUTOFILL_MANAGER_H diff --git a/dali/devel-api/file.list b/dali/devel-api/file.list index 41be6eb..33c3ab3 100755 --- a/dali/devel-api/file.list +++ b/dali/devel-api/file.list @@ -3,9 +3,6 @@ SET( devel_api_src_files ${adaptor_devel_api_dir}/adaptor-framework/accessibility-adaptor.cpp ${adaptor_devel_api_dir}/adaptor-framework/application-devel.cpp - ${adaptor_devel_api_dir}/adaptor-framework/autofill-group.cpp - ${adaptor_devel_api_dir}/adaptor-framework/autofill-item.cpp - ${adaptor_devel_api_dir}/adaptor-framework/autofill-manager.cpp ${adaptor_devel_api_dir}/adaptor-framework/bitmap-saver.cpp ${adaptor_devel_api_dir}/adaptor-framework/clipboard.cpp ${adaptor_devel_api_dir}/adaptor-framework/clipboard-event-notifier.cpp @@ -47,9 +44,6 @@ SET( devel_api_adaptor_framework_header_files ${adaptor_devel_api_dir}/adaptor-framework/accessibility-gesture-event.h ${adaptor_devel_api_dir}/adaptor-framework/application-devel.h ${adaptor_devel_api_dir}/adaptor-framework/atspi-accessibility.h - ${adaptor_devel_api_dir}/adaptor-framework/autofill-group.h - ${adaptor_devel_api_dir}/adaptor-framework/autofill-item.h - ${adaptor_devel_api_dir}/adaptor-framework/autofill-manager.h ${adaptor_devel_api_dir}/adaptor-framework/bitmap-saver.h ${adaptor_devel_api_dir}/adaptor-framework/clipboard-event-notifier.h ${adaptor_devel_api_dir}/adaptor-framework/clipboard.h diff --git a/dali/internal/input/common/autofill-factory.h b/dali/internal/input/common/autofill-factory.h deleted file mode 100644 index cc86821..0000000 --- a/dali/internal/input/common/autofill-factory.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef DALI_INTERNAL_INPUT_COMMON_AUTOFILL_FACTORY_H -#define DALI_INTERNAL_INPUT_COMMON_AUTOFILL_FACTORY_H - -/* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -// INTERNAL INCLUDES -#include -#include -#include - -namespace Dali -{ -namespace Internal -{ -namespace Adaptor -{ - -class AutofillGroup; -class AutofillItem; -class AutofillManager; - -namespace AutofillFactory -{ -// Factory function creating new AutofillGroup, AutofillItem, and AutofillManager -// Symbol exists but may be overriden during linking - - Dali::AutofillGroup CreateAutofillGroup( const std::string& groupId ); - - Dali::AutofillItem CreateAutofillItem( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool sensitiveData ); - - Dali::AutofillManager CreateAutofillManager(); - -} - -} // namespace Adaptor -} // namespace Internal -} // namespace Dali - -#endif // DALI_INTERNAL_INPUT_COMMON_AUTOFILL_FACTORY_H diff --git a/dali/internal/input/common/autofill-group-impl.cpp b/dali/internal/input/common/autofill-group-impl.cpp deleted file mode 100755 index f2807e9..0000000 --- a/dali/internal/input/common/autofill-group-impl.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -// CLASS HEADER -//#include - -// INTERNAL INCLUDES -#include - - -namespace Dali -{ - -namespace Internal -{ - -namespace Adaptor -{ - -Dali::AutofillGroup AutofillGroup::New( const std::string& groupId ) -{ - return Dali::Internal::Adaptor::AutofillFactory::CreateAutofillGroup( groupId ); -} - - -} // Adaptor - -} // Internal - -} // Dali diff --git a/dali/internal/input/common/autofill-group-impl.h b/dali/internal/input/common/autofill-group-impl.h deleted file mode 100644 index f335c10..0000000 --- a/dali/internal/input/common/autofill-group-impl.h +++ /dev/null @@ -1,137 +0,0 @@ -#ifndef DALI_INTERNAL_AUTOFILL_GROUP_IMPL_H -#define DALI_INTERNAL_AUTOFILL_GROUP_IMPL_H - -/* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -// EXTERNAL INCLUDES -#include - -// INTERNAL INCLUDES -#include - -namespace Dali -{ - -namespace Internal -{ - -namespace Adaptor -{ - -/** - * @brief This class is used to group AutofillItems. - */ -class AutofillGroup : public Dali::BaseObject -{ - -public: - - /** - * @brief Constructor. - * - * @param[in] groupId A unique ID value of each AutofillGroup - * @return A public handle to the newly allocated AutofillGroup. - */ - static Dali::AutofillGroup New( const std::string& groupId ); - - /** - * @brief Initialize AutofillGroup constructor. - */ - virtual void Initialize() = 0; - - /** - * @copydoc Dali::AutofillGroup::GetId() - */ - virtual const std::string& GetId() const = 0; - - /** - * @copydoc Dali::AutofillGroup::AddAutofillItem() - */ - virtual void AddAutofillItem( Dali::AutofillItem item ) = 0; - - /** - * @copydoc Dali::AutofillGroup::GetAutofillItem() - */ - virtual Dali::AutofillItem GetAutofillItem( const std::string& id ) = 0; - - /** - * @brief Clears all lists of AutofillItem added in AutofillGroup. - */ - virtual void ClearAutofillItemList() = 0; - - /** - * @copydoc Dali::AutofillGroup::SaveAutofillData() - */ - virtual void SaveAutofillData() = 0; - - /** - * @copydoc Dali::AutofillGroup::RequestAuthentication() - */ - virtual void RequestAuthentication() = 0; - - /** - * @copydoc Dali::AutofillGroup::SendFillRequest() - */ - virtual void SendFillRequest() = 0; - -public: - /** - * Constructor. - */ - AutofillGroup() = default; - -protected: - /** - * Destructor. - */ - ~AutofillGroup() = default; - -private: - // Undefined copy constructor - AutofillGroup( const AutofillGroup& autofillGroup ) = delete; - - // Undefined assignment operator - AutofillGroup& operator=( AutofillGroup& autofillGroup ) = delete; - -}; - -inline static Internal::Adaptor::AutofillGroup& GetImplementation(Dali::AutofillGroup& autofillGroup) -{ - DALI_ASSERT_ALWAYS( autofillGroup && "AutofillGroup handle is empty" ); - - BaseObject& handle = autofillGroup.GetBaseObject(); - - return static_cast(handle); -} - -inline static const Internal::Adaptor::AutofillGroup& GetImplementation(const Dali::AutofillGroup& autofillGroup) -{ - DALI_ASSERT_ALWAYS( autofillGroup && "AutofillGroup handle is empty" ); - - const BaseObject& handle = autofillGroup.GetBaseObject(); - - return static_cast(handle); -} - -} // namespace Adaptor - -} // namespace Internal - -} // namespace Dali - -#endif // DALI_INTERNAL_AUTOFILL_GROUP_IMPL_H diff --git a/dali/internal/input/common/autofill-item-impl.cpp b/dali/internal/input/common/autofill-item-impl.cpp deleted file mode 100755 index eacf07e..0000000 --- a/dali/internal/input/common/autofill-item-impl.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -// CLASS HEADER -//#include - -// INTERNAL INCLUDES -#include - -namespace Dali -{ - -namespace Internal -{ - -namespace Adaptor -{ - -Dali::AutofillItem AutofillItem::New( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool sensitiveData ) -{ - return Dali::Internal::Adaptor::AutofillFactory::CreateAutofillItem( id, label, hint, sensitiveData ); -} - - -} // Adaptor - -} // Internal - -} // Dali diff --git a/dali/internal/input/common/autofill-item-impl.h b/dali/internal/input/common/autofill-item-impl.h deleted file mode 100644 index 92c5db8..0000000 --- a/dali/internal/input/common/autofill-item-impl.h +++ /dev/null @@ -1,174 +0,0 @@ -#ifndef DALI_INTERNAL_AUTOFILL_ITEM_IMPL_H -#define DALI_INTERNAL_AUTOFILL_ITEM_IMPL_H - -/* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -// EXTERNAL INCLUDES -#include - -// INTERNAL INCLUDES -#include - -namespace Dali -{ - -namespace Internal -{ - -namespace Adaptor -{ - -/** - * @brief This class is used to pass on data from the AutofillItem of control. - */ -class AutofillItem : public Dali::BaseObject -{ - -public: - - /** - * @brief Constructor. - * - * @param[in] id A unique ID for this AutofillItem - * @param[in] label An auxiliary means to guess what data is - * @param[in] hint The hint - id (username), name, password, phone, credit card number, organization, and so on - * @param[in] sensitiveData Whether this AutofillItem is a sensitive data or not. (The default is false) - * @return A public handle to the newly allocated AutofillItem - */ - static Dali::AutofillItem New( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool sensitiveData ); - - /** - * @brief Initialize AutofillItem constructor. - */ - virtual void Initialize() = 0; - - /** - * @copydoc Dali::AutofillItem::GetId() - */ - virtual const std::string& GetId() const = 0; - - /** - * @copydoc Dali::AutofillItem::GetLabel() - */ - virtual const std::string& GetLabel() const = 0; - - /** - * @copydoc Dali::AutofillItem::GetHint() - */ - virtual Dali::AutofillItem::Hint GetHint() const = 0; - - /** - * @copydoc Dali::AutofillItem::IsSensitiveData() - */ - virtual bool IsSensitiveData() const = 0; - - /** - * @copydoc Dali::AutofillItem::SetSaveValue() - */ - virtual void SetSaveValue( const std::string& value ) = 0; - - /** - * @copydoc Dali::AutofillItem::GetSaveValue() - */ - virtual const std::string& GetSaveValue() const = 0; - - /** - * @brief Adds the presentation text to fill out in the list. - * - * @param[in] presentationText The presentation text to fill out - */ - virtual void AddPresentationList( const std::string& presentationText ) = 0; - - /** - * @brief Adds the value to fill out in the list. - * - * @param[in] fillValue The value to fill out - */ - virtual void AddFillValueList( const std::string& fillValue ) = 0; - - /** - * @copydoc Dali::AutofillItem::GetPresentationText() - */ - virtual const std::string& GetPresentationText( int index ) const = 0; - - /** - * @copydoc Dali::AutofillItem::GetFillValue() - */ - virtual const std::string& GetFillValue( int index ) const = 0; - - /** - * @copydoc Dali::AutofillItem::ClearPresentationTextList() - */ - virtual void ClearPresentationTextList() = 0; - - /** - * @copydoc Dali::AutofillItem::ClearFillValueList() - */ - virtual void ClearFillValueList() = 0; - - /** - * @copydoc Dali::AutofillItem::GetFillValueCount() - */ - virtual unsigned int GetFillValueCount() = 0; - -public: - /** - * Constructor. - */ - AutofillItem() = default; - -protected: - /** - * Destructor. - */ - ~AutofillItem() = default; - -private: - // Undefined copy constructor - AutofillItem( const AutofillItem& autofillItem ) = delete; - - // Undefined assignment operator - AutofillItem& operator=( AutofillItem& autofillItem ) = delete; - -}; - -inline static Internal::Adaptor::AutofillItem& GetImplementation(Dali::AutofillItem& autofillItem) -{ - DALI_ASSERT_ALWAYS( autofillItem && "AutofillItem handle is empty" ); - - BaseObject& handle = autofillItem.GetBaseObject(); - - return static_cast(handle); -} - -inline static const Internal::Adaptor::AutofillItem& GetImplementation(const Dali::AutofillItem& autofillItem) -{ - DALI_ASSERT_ALWAYS( autofillItem && "AutofillItem handle is empty" ); - - const BaseObject& handle = autofillItem.GetBaseObject(); - - return static_cast(handle); -} - -} // namespace Adaptor - -} // namespace Internal - -} // namespace Dali - -#endif // DALI_INTERNAL_AUTOFILL_ITEM_IMPL_H diff --git a/dali/internal/input/common/autofill-manager-impl.cpp b/dali/internal/input/common/autofill-manager-impl.cpp deleted file mode 100755 index 5dd466e..0000000 --- a/dali/internal/input/common/autofill-manager-impl.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -// CLASS HEADER -//#include - -// INTERNAL INCLUDES -#include - - -namespace Dali -{ - -namespace Internal -{ - -namespace Adaptor -{ - -Dali::AutofillManager AutofillManager::Get() -{ - return Dali::Internal::Adaptor::AutofillFactory::CreateAutofillManager(); -} - - -} // Adaptor - -} // Internal - -} // Dali diff --git a/dali/internal/input/common/autofill-manager-impl.h b/dali/internal/input/common/autofill-manager-impl.h deleted file mode 100644 index 48819ab..0000000 --- a/dali/internal/input/common/autofill-manager-impl.h +++ /dev/null @@ -1,190 +0,0 @@ -#ifndef DALI_INTERNAL_AUTOFILL_MANAGER_IMPL_H -#define DALI_INTERNAL_AUTOFILL_MANAGER_IMPL_H - -/* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -// EXTERNAL INCLUDES -#include - -// INTERNAL INCLUDES -#include - -namespace Dali -{ - -namespace Internal -{ - -namespace Adaptor -{ - -class AutofillManager : public Dali::BaseObject -{ - -public: - - /** - * @brief Gets the AutofillManager instance - * - * It creates the instance if it has not already been created. - * Internally, a check should be made using IsAvailable() before this is called as we do not want - * to create an instance if not needed by applications. - * @see IsAvailable() - */ - static Dali::AutofillManager Get(); - - /** - * @brief Connects Callbacks required for Autofill daemon. - */ - virtual void ConnectCallbacks() = 0; - - /** - * @copydoc Dali::AutofillManager::CreateAutofillItem() - */ - virtual Dali::AutofillItem CreateAutofillItem( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool isSensitive ) = 0; - - /** - * @copydoc Dali::AutofillManager::CreateAutofillGroup() - */ - virtual Dali::AutofillGroup CreateAutofillGroup( const std::string& groupId ) = 0; - - /** - * @copydoc Dali::AutofillManager::IsAutofillDataPresent() - */ - virtual bool IsAutofillDataPresent() const = 0; - - /** - * @copydoc Dali::AutofillManager::IsAuthenticationNeeded() - */ - virtual bool IsAuthenticationNeeded() const = 0; - - /** - * @copydoc Dali::AutofillManager::GetAuthenticationServiceName() - */ - virtual const std::string& GetAuthenticationServiceName() const = 0; - - /** - * @copydoc Dali::AutofillManager::GetAuthenticationServiceMessage() - */ - virtual const std::string& GetAuthenticationServiceMessage() const = 0; - - /** - * @copydoc Dali::AutofillManager::GetAuthenticationServiceImagePath() - */ - virtual const std::string& GetAuthenticationServiceImagePath() const = 0; - - /** - * @copydoc Dali::AutofillManager::GetFillItemId() - */ - virtual const std::string& GetFillItemId() const = 0; - - /** - * @copydoc Dali::AutofillManager::GetFillItemPresentationText() - */ - virtual const std::string& GetFillItemPresentationText() const = 0; - - /** - * @copydoc Dali::AutofillManager::GetFillItemValue() - */ - virtual const std::string& GetFillItemValue() const = 0; - - /** - * @copydoc Dali::AutofillManager::SaveAutofillData() - */ - virtual void SaveAutofillData( Dali::AutofillGroup group ) = 0; - -public: // Signals - - /** - * @copydoc Dali::AutofillManager::AuthenticationReceivedSignal() - */ - virtual Dali::AutofillManager::AuthSignalType& AuthenticationReceivedSignal() { return mAuthReceivedSignal; } - - /** - * @copydoc Dali::AutofillManager::FillResponseReceivedSignal() - */ - virtual Dali::AutofillManager::FillSignalType& FillResponseReceivedSignal() { return mFillReceivedSignal; } - - /** - * @copydoc Dali::AutofillManager::ListEventSignal() - */ - virtual Dali::AutofillManager::ListSignalType& ListEventSignal() { return mListReceivedSignal; } - -private: - /** - * Context created the first time and kept until deleted. - */ - virtual void CreateContext() = 0; - - /** - * Delete Autofill context. - */ - virtual void DeleteContext() = 0; - -public: - /** - * Constructor. - */ - AutofillManager() = default; - -protected: - /** - * Destructor. - */ - ~AutofillManager() = default; - -private: - // Undefined copy constructor - AutofillManager( const AutofillManager& autofillManager ) = delete; - - // Undefined assignment operator - AutofillManager& operator=( AutofillManager& autofillManager ) = delete; - -private: - Dali::AutofillManager::AuthSignalType mAuthReceivedSignal; ///< Authentication Received Signal - Dali::AutofillManager::FillSignalType mFillReceivedSignal; ///< Fill Response Received Signal - Dali::AutofillManager::ListSignalType mListReceivedSignal; ///< List Received Signal - - -}; - -inline static Internal::Adaptor::AutofillManager& GetImplementation(Dali::AutofillManager& autofillManager) -{ - DALI_ASSERT_ALWAYS( autofillManager && "AutofillManager handle is empty" ); - - BaseObject& handle = autofillManager.GetBaseObject(); - - return static_cast(handle); -} - -inline static const Internal::Adaptor::AutofillManager& GetImplementation(const Dali::AutofillManager& autofillManager) -{ - DALI_ASSERT_ALWAYS( autofillManager && "AutofillManager handle is empty" ); - - const BaseObject& handle = autofillManager.GetBaseObject(); - - return static_cast(handle); -} - -} // namespace Adaptor - -} // namespace Internal - -} // namespace Dali - -#endif // DALI_INTERNAL_AUTOFILL_MANAGER_IMPL_H diff --git a/dali/internal/input/file.list b/dali/internal/input/file.list index c940bb7..3e447ce 100644 --- a/dali/internal/input/file.list +++ b/dali/internal/input/file.list @@ -1,39 +1,28 @@ # module: input, backend: common -SET( adaptor_input_common_src_files - ${adaptor_input_dir}/common/autofill-group-impl.cpp - ${adaptor_input_dir}/common/autofill-item-impl.cpp - ${adaptor_input_dir}/common/autofill-manager-impl.cpp - ${adaptor_input_dir}/common/input-method-context-impl.cpp - ${adaptor_input_dir}/common/key-grab.cpp - ${adaptor_input_dir}/common/key-impl.cpp - ${adaptor_input_dir}/common/keyboard.cpp - ${adaptor_input_dir}/common/physical-keyboard-impl.cpp +SET( adaptor_input_common_src_files + ${adaptor_input_dir}/common/input-method-context-impl.cpp + ${adaptor_input_dir}/common/key-grab.cpp + ${adaptor_input_dir}/common/key-impl.cpp + ${adaptor_input_dir}/common/keyboard.cpp + ${adaptor_input_dir}/common/physical-keyboard-impl.cpp ) # module: input, backend: tizen-wayland -SET( adaptor_input_tizen_wayland_src_files - ${adaptor_input_dir}/tizen-wayland/autofill-factory-ecore-wl.cpp - ${adaptor_input_dir}/tizen-wayland/autofill-group-impl-ecore-wl.cpp - ${adaptor_input_dir}/tizen-wayland/autofill-item-impl-ecore-wl.cpp - ${adaptor_input_dir}/tizen-wayland/autofill-manager-impl-ecore-wl.cpp +SET( adaptor_input_tizen_wayland_src_files ${adaptor_input_dir}/tizen-wayland/ecore-virtual-keyboard.cpp - ${adaptor_input_dir}/tizen-wayland/input-method-context-factory-ecore-wl.cpp - ${adaptor_input_dir}/tizen-wayland/input-method-context-impl-ecore-wl.cpp - ${adaptor_input_dir}/tizen-wayland/key-mapping-ecore-wl.cpp + ${adaptor_input_dir}/tizen-wayland/input-method-context-factory-ecore-wl.cpp + ${adaptor_input_dir}/tizen-wayland/input-method-context-impl-ecore-wl.cpp + ${adaptor_input_dir}/tizen-wayland/key-mapping-ecore-wl.cpp ${adaptor_input_dir}/tizen-wayland/virtual-keyboard-impl-ecore-wl.cpp ) # module: input, backend: ubuntu-x11 -SET( adaptor_input_ubuntu_x11_src_files - ${adaptor_input_dir}/ubuntu-x11/autofill-factory-x.cpp - ${adaptor_input_dir}/ubuntu-x11/autofill-group-impl-x.cpp - ${adaptor_input_dir}/ubuntu-x11/autofill-item-impl-x.cpp - ${adaptor_input_dir}/ubuntu-x11/autofill-manager-impl-x.cpp +SET( adaptor_input_ubuntu_x11_src_files ${adaptor_input_dir}/tizen-wayland/ecore-virtual-keyboard.cpp - ${adaptor_input_dir}/ubuntu-x11/input-method-context-factory-x.cpp - ${adaptor_input_dir}/ubuntu-x11/input-method-context-impl-x.cpp - ${adaptor_input_dir}/ubuntu-x11/key-mapping-x.cpp + ${adaptor_input_dir}/ubuntu-x11/input-method-context-factory-x.cpp + ${adaptor_input_dir}/ubuntu-x11/input-method-context-impl-x.cpp + ${adaptor_input_dir}/ubuntu-x11/key-mapping-x.cpp ${adaptor_input_dir}/ubuntu-x11/virtual-keyboard-impl-x.cpp ) diff --git a/dali/internal/input/tizen-wayland/autofill-factory-ecore-wl.cpp b/dali/internal/input/tizen-wayland/autofill-factory-ecore-wl.cpp deleted file mode 100755 index 4d7d912..0000000 --- a/dali/internal/input/tizen-wayland/autofill-factory-ecore-wl.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#include -#include -#include -#include - -namespace Dali -{ -namespace Internal -{ -namespace Adaptor -{ - -namespace AutofillFactory -{ - -// Autofill Factory to be implemented by the platform -Dali::AutofillGroup CreateAutofillGroup( const std::string& groupId ) -{ - return Dali::Internal::Adaptor::AutofillGroupEcoreWl::New( groupId ); -} - -Dali::AutofillItem CreateAutofillItem( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool sensitiveData ) -{ - return Dali::Internal::Adaptor::AutofillItemEcorewWl::New( id, label, hint, sensitiveData ); -} - -Dali::AutofillManager CreateAutofillManager() -{ - return Dali::Internal::Adaptor::AutofillManagerEcoreWl::Get(); -} - -} - -} // namespace Adaptor -} // namespace Internal -} // namespace Dali diff --git a/dali/internal/input/tizen-wayland/autofill-group-impl-ecore-wl.cpp b/dali/internal/input/tizen-wayland/autofill-group-impl-ecore-wl.cpp deleted file mode 100755 index 73cbeff..0000000 --- a/dali/internal/input/tizen-wayland/autofill-group-impl-ecore-wl.cpp +++ /dev/null @@ -1,230 +0,0 @@ -/* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -// CLASS HEADER -#include - -// EXTERNAL INCLUDES -#include // for strcmp -#include -#include - -// INTERNAL INCLUDES -#include - -namespace Dali -{ - -namespace Internal -{ - -namespace Adaptor -{ - -namespace -{ -#if defined(DEBUG_ENABLED) -Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_AUTOFILL"); -#endif - -BaseHandle Create() -{ - return Dali::Internal::Adaptor::AutofillGroup::New( "" ); -} - -Dali::TypeRegistration type( typeid(Dali::AutofillGroup), typeid(Dali::BaseHandle), Create ); - -} // unnamed namespace - - -AutofillGroupEcoreWl::AutofillGroupEcoreWl( const std::string groupId ) -: mAutofillItemList(), - mGroupId( groupId ) -{ -#ifdef CAPI_AUTOFILL_SUPPORT - mAutofillGroupHandle = NULL; - mAutofillSaveGroupHandle = NULL; -#endif // CAPI_AUTOFILL_SUPPORT -} - -AutofillGroupEcoreWl::~AutofillGroupEcoreWl() -{ -#ifdef CAPI_AUTOFILL_SUPPORT - if( mAutofillGroupHandle ) - { - autofill_view_info_destroy( mAutofillGroupHandle ); - mAutofillGroupHandle = NULL; - } - if( mAutofillSaveGroupHandle ) - { - autofill_save_view_info_destroy( mAutofillSaveGroupHandle ); - mAutofillSaveGroupHandle = NULL; - } -#endif // CAPI_AUTOFILL_SUPPORT -} - - -Dali::AutofillGroup AutofillGroupEcoreWl::New( const std::string& groupId ) -{ - Dali::Internal::Adaptor::AutofillGroup* group = new Dali::Internal::Adaptor::AutofillGroupEcoreWl( groupId ); - Dali::AutofillGroup handle = Dali::AutofillGroup( group ); - group->Initialize(); - - return handle; -} - -void AutofillGroupEcoreWl::Initialize() -{ -#ifdef CAPI_AUTOFILL_SUPPORT - int ret = autofill_view_info_create( &mAutofillGroupHandle ); - if( ret != AUTOFILL_ERROR_NONE ) - { - DALI_LOG_ERROR( "Failed to create autofill group info handle : %d \n", ret ); - return; - } - - autofill_view_info_set_view_id( mAutofillGroupHandle, mGroupId.c_str() ); - -#endif // CAPI_AUTOFILL_SUPPORT -} - -const std::string& AutofillGroupEcoreWl::GetId() const -{ - DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillGroupEcoreWl::GetId \n" ); - return mGroupId; -} - -#ifdef CAPI_AUTOFILL_SUPPORT -autofill_view_info_h AutofillGroupEcoreWl::GetAutofillGroupHandle() -{ - return mAutofillGroupHandle; -} - -autofill_save_view_info_h AutofillGroupEcoreWl::GetAutofillSaveGroupHandle() -{ - return mAutofillSaveGroupHandle; -} -#endif // CAPI_AUTOFILL_SUPPORT - -void AutofillGroupEcoreWl::AddAutofillItem( Dali::AutofillItem item ) -{ -#ifdef CAPI_AUTOFILL_SUPPORT - Internal::Adaptor::AutofillItem& itemImpl = Internal::Adaptor::GetImplementation( item ); - Internal::Adaptor::AutofillItemEcorewWl& itemImplWl = static_cast( itemImpl ); - - if( mAutofillGroupHandle && itemImplWl.GetAutofillItemHandle() ) - { - autofill_view_info_add_item( mAutofillGroupHandle, itemImplWl.GetAutofillItemHandle() ); - } -#endif // CAPI_AUTOFILL_SUPPORT - - // Pushes back an AutofillItem to the ItemList of AutofillGroup. - mAutofillItemList.push_back( item ); -} - -Dali::AutofillItem AutofillGroupEcoreWl::GetAutofillItem( const std::string& id ) -{ - Dali::AutofillItem item = Dali::AutofillItem(); - for( std::vector::iterator iter = mAutofillItemList.begin(), endIter = mAutofillItemList.end(); iter != endIter; ++iter ) - { - const std::string& itemId = ( *iter ).GetId(); - - if( itemId.compare( id ) == 0 ) - { - item = ( *iter ); - } - } - return item; -} - -void AutofillGroupEcoreWl::ClearAutofillItemList() -{ - for( std::vector::iterator iter = mAutofillItemList.begin(), endIter = mAutofillItemList.end(); iter != endIter; ++iter ) - { - ( *iter ).ClearPresentationTextList(); - ( *iter ).ClearFillValueList(); - } -} - -void AutofillGroupEcoreWl::SaveAutofillData() -{ - DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillGroupEcoreWl::SaveAutofillData\n" ); -#ifdef CAPI_AUTOFILL_SUPPORT - // Creates autofill save view info handle. - autofill_save_view_info_create( &mAutofillSaveGroupHandle ); - autofill_save_view_info_set_view_id( mAutofillSaveGroupHandle, mGroupId.c_str() ); - - for( std::vector::iterator iter = mAutofillItemList.begin(), endIter = mAutofillItemList.end(); iter != endIter; ++iter ) - { - Internal::Adaptor::AutofillItem& itemImpl = Internal::Adaptor::GetImplementation( *iter ); - Internal::Adaptor::AutofillItemEcorewWl& itemImplWl = static_cast( itemImpl ); - - // Appends autofill save item in autofill save view. - autofill_save_view_info_add_item( mAutofillSaveGroupHandle, itemImplWl.GetAutofillSaveItemHandle() ); - } -#endif // CAPI_AUTOFILL_SUPPORT -} - -// If Autofill service sends authentication signal, AutofillManagerEcoreWl::ReceiveAuthInfo() would be called. -void AutofillGroupEcoreWl::RequestAuthentication() -{ - DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillGroupEcoreWl::RequestAuthentication\n" ); - -#ifdef CAPI_AUTOFILL_SUPPORT - Dali::AutofillManager manager = Dali::AutofillManager::Get(); - Internal::Adaptor::AutofillManager& managerImpl = Internal::Adaptor::GetImplementation( manager ); - Internal::Adaptor::AutofillManagerEcoreWl& managerImplWl = static_cast( managerImpl ); - - // Requests to invoke the authentication information. - // After requests of authentication, AutofillManagerEcoreWl::AuthInfoCallback would be called. - int ret = autofill_auth_info_request( managerImplWl.GetAutofillHandle(), mAutofillGroupHandle ); - if( ret != AUTOFILL_ERROR_NONE ) - { - DALI_LOG_ERROR( "Failed to request auth info. error : %d \n", ret ); - } -#endif // CAPI_AUTOFILL_SUPPORT -} - -// If Autofill service sends fill response signal, AutofillManagerEcoreWl::FillGroupItem() or -// AutofillManagerEcoreWl::FillMultipleGroupItem() would be called according to the number of group count. -void AutofillGroupEcoreWl::SendFillRequest() -{ - DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillGroupEcoreWl::SendFillRequest\n" ); - -#ifdef CAPI_AUTOFILL_SUPPORT - Dali::AutofillManager manager = Dali::AutofillManager::Get(); - Internal::Adaptor::AutofillManager& managerImpl = Internal::Adaptor::GetImplementation( manager ); - Internal::Adaptor::AutofillManagerEcoreWl& managerImplWl = static_cast( managerImpl ); - - // Removes all elements of each AutofillItem in AutofillGroup - ClearAutofillItemList(); - - // Sends fill request to fill out each input form. - // After request of fill data, AutofillManagerEcoreWl::FillResponseCallback would be called. - int ret = autofill_fill_request( managerImplWl.GetAutofillHandle(), mAutofillGroupHandle ); - if( ret != AUTOFILL_ERROR_NONE ) - { - DALI_LOG_ERROR( "Failed to request fill : %d \n", ret ); - } -#endif // CAPI_AUTOFILL_SUPPORT -} - -} // Adaptor - -} // Internal - -} // Dali diff --git a/dali/internal/input/tizen-wayland/autofill-group-impl-ecore-wl.h b/dali/internal/input/tizen-wayland/autofill-group-impl-ecore-wl.h deleted file mode 100644 index 0abdca3..0000000 --- a/dali/internal/input/tizen-wayland/autofill-group-impl-ecore-wl.h +++ /dev/null @@ -1,150 +0,0 @@ -#ifndef DALI_INTERNAL_AUTOFILL_GROUP_IMPL_ECORE_WL_H -#define DALI_INTERNAL_AUTOFILL_GROUP_IMPL_ECORE_WL_H - -/* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -// EXTERNAL INCLUDES -#include -#ifdef CAPI_AUTOFILL_SUPPORT -#include -#endif // CAPI_AUTOFILL_SUPPORT -#include - -// INTERNAL INCLUDES -#include -#include - -namespace Dali -{ - -namespace Internal -{ - -namespace Adaptor -{ - - -/** - * @brief This class is used to group AutofillItems. - */ -class AutofillGroupEcoreWl : public Dali::Internal::Adaptor::AutofillGroup -{ - -public: - - /** - * @brief Constructor. - * - * @param[in] groupId A unique ID value of each AutofillGroup - * @return A public handle to the newly allocated AutofillGroup. - */ - static Dali::AutofillGroup New( const std::string& groupId ); - - /** - * @brief Initialize AutofillGroup constructor. - */ - void Initialize() override; - - /** - * @copydoc Dali::AutofillGroup::GetId() - */ - const std::string& GetId() const override; - -#ifdef CAPI_AUTOFILL_SUPPORT - /** - * @brief Gets Autofill framework group handle - * @return Autofill framework group handle, which type is 'autofill_view_info_h' - */ - autofill_view_info_h GetAutofillGroupHandle(); - - /** - * @brief Gets Autofill framework save group handle - * @return Autofill framework save group handle, which type is 'autofill_save_view_info_h' - */ - autofill_save_view_info_h GetAutofillSaveGroupHandle(); -#endif // CAPI_AUTOFILL_SUPPORT - - /** - * @copydoc Dali::AutofillGroup::AddAutofillItem() - */ - void AddAutofillItem( Dali::AutofillItem item ) override; - - /** - * @copydoc Dali::AutofillGroup::GetAutofillItem() - */ - Dali::AutofillItem GetAutofillItem( const std::string& id ) override; - - /** - * @brief Clears all lists of AutofillItem added in AutofillGroup. - */ - void ClearAutofillItemList() override; - - /** - * @copydoc Dali::AutofillGroup::SaveAutofillData() - */ - void SaveAutofillData() override; - - /** - * @copydoc Dali::AutofillGroup::RequestAuthentication() - */ - void RequestAuthentication() override; - - /** - * @copydoc Dali::AutofillGroup::SendFillRequest() - */ - void SendFillRequest() override; - -private: - /** - * Constructor. - */ - explicit AutofillGroupEcoreWl( const std::string groupId ); - -protected: - /** - * Destructor. - */ - ~AutofillGroupEcoreWl(); - -private: - // Undefined copy constructor - explicit AutofillGroupEcoreWl( const AutofillGroupEcoreWl& autofillGroup ) = delete; - - // Undefined assignment operator - AutofillGroupEcoreWl& operator=( AutofillGroupEcoreWl& autofillGroup ) = delete; - - -private: -#ifdef CAPI_AUTOFILL_SUPPORT - autofill_view_info_h mAutofillGroupHandle; ///< The Autofill Framework group handle - autofill_save_view_info_h mAutofillSaveGroupHandle; -#endif // CAPI_AUTOFILL_SUPPORT - - std::vector mAutofillItemList; ///< The List to add AutofillItem - std::string mGroupId; ///< The AutofillGroup ID - -}; - - -} // namespace Adaptor - -} // namespace Internal - -} // namespace Dali - -#endif // DALI_INTERNAL_AUTOFILL_GROUP_IMPL_ECORE_WL_H diff --git a/dali/internal/input/tizen-wayland/autofill-item-impl-ecore-wl.cpp b/dali/internal/input/tizen-wayland/autofill-item-impl-ecore-wl.cpp deleted file mode 100755 index 146f9cc..0000000 --- a/dali/internal/input/tizen-wayland/autofill-item-impl-ecore-wl.cpp +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -// CLASS HEADER -#include - -// EXTERNAL INCLUDES -#include -#include - -namespace Dali -{ - -namespace Internal -{ - -namespace Adaptor -{ - -namespace -{ -#if defined(DEBUG_ENABLED) -Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_AUTOFILL"); -#endif - -BaseHandle Create() -{ - return Dali::Internal::Adaptor::AutofillItem::New( "", "", Dali::AutofillItem::Hint::ID, false ); -} - -Dali::TypeRegistration type( typeid(Dali::AutofillItem), typeid(Dali::BaseHandle), Create ); - -} // unnamed namespace - - -AutofillItemEcorewWl::AutofillItemEcorewWl( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool sensitiveData ) -: mId( id ), - mLabel( label ), - mHint( hint ), - mSensitiveData( sensitiveData ), - mValue(""), - mPresentationTextList(), - mValueList() -{ -#ifdef CAPI_AUTOFILL_SUPPORT - mAutofillItemHandle = NULL; - mAutofillSaveItemHandle = NULL; -#endif // CAPI_AUTOFILL_SUPPORT -} - -AutofillItemEcorewWl::~AutofillItemEcorewWl() -{ -#ifdef CAPI_AUTOFILL_SUPPORT - if( mAutofillItemHandle ) - { - autofill_item_destroy( mAutofillItemHandle ); - mAutofillItemHandle = NULL; - } - - if( mAutofillSaveItemHandle ) - { - autofill_save_item_destroy( mAutofillSaveItemHandle ); - mAutofillSaveItemHandle = NULL; - } -#endif // CAPI_AUTOFILL_SUPPORT -} - - -Dali::AutofillItem AutofillItemEcorewWl::New( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool sensitiveData ) -{ - Dali::Internal::Adaptor::AutofillItem* item = new Dali::Internal::Adaptor::AutofillItemEcorewWl( id, label, hint, sensitiveData ); - Dali::AutofillItem handle = Dali::AutofillItem( item ); - item->Initialize(); - - return handle; -} - -void AutofillItemEcorewWl::Initialize() -{ -#ifdef CAPI_AUTOFILL_SUPPORT - int ret = autofill_item_create( &mAutofillItemHandle ); - if( ret != AUTOFILL_ERROR_NONE ) - { - DALI_LOG_ERROR( "Failed to create autofill item handle : %d \n", ret ); - return; - } - - autofill_item_set_id( mAutofillItemHandle, mId.c_str() ); - autofill_item_set_label( mAutofillItemHandle, mLabel.c_str() ); - autofill_item_set_sensitive_data( mAutofillItemHandle, mSensitiveData ); - - // Create autofill save item handle for save. - autofill_save_item_create( &mAutofillSaveItemHandle ); - autofill_save_item_set_id( mAutofillSaveItemHandle, mId.c_str() ); - autofill_save_item_set_label( mAutofillSaveItemHandle, mLabel.c_str() ); - autofill_save_item_set_sensitive_data( mAutofillSaveItemHandle, mSensitiveData ); - - autofill_hint_e value = static_cast(mHint); - autofill_item_set_autofill_hint( mAutofillItemHandle, value ); - autofill_save_item_set_autofill_hint( mAutofillSaveItemHandle, value); -#endif // CAPI_AUTOFILL_SUPPORT -} - -const std::string& AutofillItemEcorewWl::GetId() const -{ - DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillItemEcorewWl::GetId \n" ); - return mId; -} - -const std::string& AutofillItemEcorewWl::GetLabel() const -{ - DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillItemEcorewWl::GetLabel \n" ); - return mLabel; -} - - -Dali::AutofillItem::Hint AutofillItemEcorewWl::GetHint() const -{ - DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillItemEcorewWl::GetHint \n" ); - return mHint; -} - -bool AutofillItemEcorewWl::IsSensitiveData() const -{ - DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillItemEcorewWl::IsSensitiveData \n" ); - return mSensitiveData; -} - -void AutofillItemEcorewWl::SetSaveValue( const std::string& value ) -{ - mValue = value; -#ifdef CAPI_AUTOFILL_SUPPORT - autofill_save_item_set_value( mAutofillSaveItemHandle, mValue.c_str() ); -#endif // CAPI_AUTOFILL_SUPPORT -} - -const std::string& AutofillItemEcorewWl::GetSaveValue() const -{ - return mValue; -} - -#ifdef CAPI_AUTOFILL_SUPPORT -autofill_item_h AutofillItemEcorewWl::GetAutofillItemHandle() -{ - return mAutofillItemHandle; -} - -autofill_save_item_h AutofillItemEcorewWl::GetAutofillSaveItemHandle() -{ - return mAutofillSaveItemHandle; -} -#endif // CAPI_AUTOFILL_SUPPORT - -void AutofillItemEcorewWl::AddPresentationList( const std::string& presentationText ) -{ - mPresentationTextList.push_back( presentationText ); -} - -void AutofillItemEcorewWl::AddFillValueList( const std::string& fillValue ) -{ - mValueList.push_back( fillValue ); -} - -const std::string& AutofillItemEcorewWl::GetPresentationText( int index ) const -{ - return mPresentationTextList[index]; -} - -const std::string& AutofillItemEcorewWl::GetFillValue( int index ) const -{ - return mValueList[index]; -} - -void AutofillItemEcorewWl::ClearPresentationTextList() -{ - mPresentationTextList.clear(); -} - -void AutofillItemEcorewWl::ClearFillValueList() -{ - mValueList.clear(); -} - -unsigned int AutofillItemEcorewWl::GetFillValueCount() -{ - return mValueList.size(); -} - -} // Adaptor - -} // Internal - -} // Dali diff --git a/dali/internal/input/tizen-wayland/autofill-item-impl-ecore-wl.h b/dali/internal/input/tizen-wayland/autofill-item-impl-ecore-wl.h deleted file mode 100644 index 2fbbd6b..0000000 --- a/dali/internal/input/tizen-wayland/autofill-item-impl-ecore-wl.h +++ /dev/null @@ -1,195 +0,0 @@ -#ifndef DALI_INTERNAL_AUTOFILL_ITEM_IMPL_ECORE_WL_H -#define DALI_INTERNAL_AUTOFILL_ITEM_IMPL_ECORE_WL_H - -/* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -// EXTERNAL INCLUDES -#include -#ifdef CAPI_AUTOFILL_SUPPORT -#include -#endif // CAPI_AUTOFILL_SUPPORT -#include - -// INTERNAL INCLUDES -#include - -namespace Dali -{ - -namespace Internal -{ - -namespace Adaptor -{ - - -/** - * @brief This class is used to pass on data from the AutofillItem of control. - */ -class AutofillItemEcorewWl : public Dali::Internal::Adaptor::AutofillItem -{ - -public: - - /** - * @brief Constructor. - * - * @param[in] id A unique ID for this AutofillItem - * @param[in] label An auxiliary means to guess what data is - * @param[in] hint The hint - id (username), name, password, phone, credit card number, organization, and so on - * @param[in] sensitiveData Whether this AutofillItem is a sensitive data or not. (The default is false) - * @return A public handle to the newly allocated AutofillItem - */ - static Dali::AutofillItem New( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool sensitiveData ); - - /** - * @brief Initialize AutofillItem constructor. - */ - void Initialize() override; - - /** - * @copydoc Dali::AutofillItem::GetId() - */ - const std::string& GetId() const override; - - /** - * @copydoc Dali::AutofillItem::GetLabel() - */ - const std::string& GetLabel() const override; - - /** - * @copydoc Dali::AutofillItem::GetHint() - */ - Dali::AutofillItem::Hint GetHint() const override; - - /** - * @copydoc Dali::AutofillItem::IsSensitiveData() - */ - bool IsSensitiveData() const override; - - /** - * @copydoc Dali::AutofillItem::SetSaveValue() - */ - void SetSaveValue( const std::string& value ) override; - - /** - * @copydoc Dali::AutofillItem::GetSaveValue() - */ - const std::string& GetSaveValue() const override; - -#ifdef CAPI_AUTOFILL_SUPPORT - /** - * @brief Gets Autofill framework item handle - * @return Autofill framework item handle, which type is 'autofill_item_h' - */ - autofill_item_h GetAutofillItemHandle(); - - /** - * @brief Gets Autofill framework save item handle - * @return Autofill framework save item handle, which type is 'autofill_save_item_h' - */ - autofill_save_item_h GetAutofillSaveItemHandle(); -#endif // CAPI_AUTOFILL_SUPPORT - - /** - * @brief Adds the presentation text to fill out in the list. - * - * @param[in] presentationText The presentation text to fill out - */ - void AddPresentationList( const std::string& presentationText ) override; - - /** - * @brief Adds the value to fill out in the list. - * - * @param[in] fillValue The value to fill out - */ - void AddFillValueList( const std::string& fillValue ) override; - - /** - * @copydoc Dali::AutofillItem::GetPresentationText() - */ - const std::string& GetPresentationText( int index ) const override; - - /** - * @copydoc Dali::AutofillItem::GetFillValue() - */ - const std::string& GetFillValue( int index ) const override; - - /** - * @copydoc Dali::AutofillItem::ClearPresentationTextList() - */ - void ClearPresentationTextList() override; - - /** - * @copydoc Dali::AutofillItem::ClearFillValueList() - */ - void ClearFillValueList() override; - - /** - * @copydoc Dali::AutofillItem::GetFillValueCount() - */ - unsigned int GetFillValueCount() override; - -private: - /** - * Constructor. - */ - explicit AutofillItemEcorewWl( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool sensitiveData ); - -protected: - /** - * Destructor. - */ - ~AutofillItemEcorewWl(); - -private: - // Undefined copy constructor - explicit AutofillItemEcorewWl( const AutofillItemEcorewWl& autofillItem ) = delete; - - // Undefined assignment operator - AutofillItemEcorewWl& operator=( AutofillItemEcorewWl& autofillItem ) = delete; - -private: -#ifdef CAPI_AUTOFILL_SUPPORT - autofill_item_h mAutofillItemHandle; ///< The Autofill Framework item handle - autofill_save_item_h mAutofillSaveItemHandle; ///< The Autofill Framework save item handle for save -#endif // CAPI_AUTOFILL_SUPPORT - -// Data -private: - std::string mId; ///< The AutofillItem ID - std::string mLabel; ///< The AutofillItem Label - Dali::AutofillItem::Hint mHint; ///< The AutofillItem Hint (id (username), name, password, phone, credit card number, organization, so on) - bool mSensitiveData; ///< Whether the data is sensitive or not - - std::string mValue; - - std::vector mPresentationTextList; ///< The list for the presentation text to fill out - std::vector mValueList; ///< The list for the value to fill out - -}; - - - -} // namespace Adaptor - -} // namespace Internal - -} // namespace Dali - -#endif // DALI_INTERNAL_AUTOFILL_ITEM_IMPL_ECORE_WL_H diff --git a/dali/internal/input/tizen-wayland/autofill-manager-impl-ecore-wl.cpp b/dali/internal/input/tizen-wayland/autofill-manager-impl-ecore-wl.cpp deleted file mode 100755 index 79e0613..0000000 --- a/dali/internal/input/tizen-wayland/autofill-manager-impl-ecore-wl.cpp +++ /dev/null @@ -1,592 +0,0 @@ -/* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -// CLASS HEADER -#include - -// EXTERNAL INCLUDES -#include -#include -#include - -// INTERNAL INCLUDES -#include - - -namespace Dali -{ - -namespace Internal -{ - -namespace Adaptor -{ - -namespace -{ -#if defined(DEBUG_ENABLED) -Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_AUTOFILL"); -#endif - -// Signals -const char* const SIGNAL_AUTHENTICATION_RECEIVED = "authenticationReceived"; -const char* const SIGNAL_FILL_RESPONSE_RECEIVED = "fillResponseReceived"; -const char* const SIGNAL_LIST_RECEIVED = "listReceived"; - - -#ifdef CAPI_AUTOFILL_SUPPORT - -// All methods in this range are Static function calls used by ecore 'c' style callback registration -static void ConnectionStatusChangedCallback( autofill_h autofillHandle, autofill_connection_status_e status, void *user_data ) -{ - DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillManagerEcoreWl::ConnectionStatusChangedCallback mAutofillHandle : %p \n", autofillHandle ); - - switch( status ) - { - case AUTOFILL_CONNECTION_STATUS_CONNECTED: - { - DALI_LOG_INFO( gLogFilter, Debug::General, "Autofill Connected.\n" ); - break; - } - case AUTOFILL_CONNECTION_STATUS_DISCONNECTED: - { - DALI_LOG_INFO( gLogFilter, Debug::General, "Autofill Disconnected.\n" ); - break; - } - case AUTOFILL_CONNECTION_STATUS_REJECTED: - { - DALI_LOG_INFO( gLogFilter, Debug::General, "Autofill Rejected.\n" ); - break; - } - default: - { - // Do nothing - break; - } - } -} - -// Callback to receive the authentication information. -static void AuthInfoCallback( autofill_h ah, autofill_auth_info_h authInfoHandle, void *data ) -{ - Dali::AutofillManager autofill = AutofillManager::Get(); - Internal::Adaptor::AutofillManager& autofillImpl = Internal::Adaptor::GetImplementation( autofill ); - Internal::Adaptor::AutofillManagerEcoreWl& autofillImplWl = static_cast( autofillImpl ); - autofillImplWl.ReceiveAuthInfo( authInfoHandle, data ); -} - -// If there's an only one fill response group, then this callback is called. -static bool FillResponseItemCallback( autofill_fill_response_item_h itemHandle, void *userData ) -{ - Dali::AutofillManager autofill = AutofillManager::Get(); - Internal::Adaptor::AutofillManager& autofillImpl = Internal::Adaptor::GetImplementation( autofill ); - Internal::Adaptor::AutofillManagerEcoreWl& autofillImplWl = static_cast( autofillImpl ); - autofillImplWl.FillGroupItem( itemHandle, userData ); // Implementation here - return true; -} - -// If the fill response groups are multiple, then this callback is called. -static bool FillResponseMultipleItemCallback( autofill_fill_response_item_h itemHandle, void *userData ) -{ - Dali::AutofillManager autofill = AutofillManager::Get(); - Internal::Adaptor::AutofillManager& autofillImpl = Internal::Adaptor::GetImplementation( autofill ); - Internal::Adaptor::AutofillManagerEcoreWl& autofillImplWl = static_cast( autofillImpl ); - autofillImplWl.FillMultipleGroupItem( itemHandle, userData ); // Implementation here - return true; -} - -// This callback is called according to the number of pairs to fill out. -static bool FillResponseGroupCallback( autofill_fill_response_group_h groupHandle, void *userData ) -{ - int* count = static_cast(userData); - - // According to the number of group count, Retrieves all fill response items of each fill response group. - if( *count == 1 ) - { - autofill_fill_response_group_foreach_item( groupHandle, FillResponseItemCallback, NULL ); - } - else if( *count > 1 ) - { - autofill_fill_response_group_foreach_item( groupHandle, FillResponseMultipleItemCallback, groupHandle ); - } - - return true; -} - -// Callback to receive autofill fill response. -static void FillResponseCallback( autofill_h autofillHandle, autofill_fill_response_h fillResponseHandle, void *data ) -{ - if( !fillResponseHandle ) - { - DALI_LOG_ERROR("Fill response handle is empty. \n"); - return; - } - - // Get fill response group count - int count = 0; - autofill_fill_response_get_group_count( fillResponseHandle, &count ); - DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillManagerEcoreWl::FillResponseCallback group count : %d \n", count ); - - // Retrieves all groups of each fill response. - autofill_fill_response_foreach_group( fillResponseHandle, FillResponseGroupCallback, &count ); - - if( count > 1 ) - { - // Emits the signal to make a list of multiple data. - Dali::AutofillManager autofill = AutofillManager::Get(); - autofill.ListEventSignal().Emit(); - } -} -#endif // CAPI_AUTOFILL_SUPPORT - -BaseHandle Create() -{ - return Dali::AutofillManager::Get(); -} - -Dali::TypeRegistration typeRegistration( typeid(Dali::AutofillManager), typeid(Dali::BaseHandle), Create ); - -Dali::SignalConnectorType signalConnector1( typeRegistration, SIGNAL_AUTHENTICATION_RECEIVED, Dali::Internal::Adaptor::AutofillManagerEcoreWl::DoConnectSignal ); -Dali::SignalConnectorType signalConnector2( typeRegistration, SIGNAL_FILL_RESPONSE_RECEIVED, Dali::Internal::Adaptor::AutofillManagerEcoreWl::DoConnectSignal ); -Dali::SignalConnectorType signalConnector3( typeRegistration, SIGNAL_LIST_RECEIVED, Dali::Internal::Adaptor::AutofillManagerEcoreWl::DoConnectSignal ); - -} // unnamed namespace - - - -Dali::AutofillManager AutofillManagerEcoreWl::Get() -{ - Dali::AutofillManager autofill; - AutofillManagerEcoreWl *autofillPtr = NULL; - - Dali::SingletonService service( SingletonService::Get() ); - if( service ) - { - // Check whether the singleton is already created - Dali::BaseHandle handle = service.GetSingleton( typeid( Dali::AutofillManager ) ); - if( handle ) - { - // If so, downcast the handle - autofillPtr = dynamic_cast< AutofillManagerEcoreWl* >( handle.GetObjectPtr() ); - autofill = Dali::AutofillManager( autofillPtr ); - } - else if( Adaptor::IsAvailable() ) - { - // Create instance and register singleton only if the adaptor is available - autofillPtr = new AutofillManagerEcoreWl(); - autofill = Dali::AutofillManager( autofillPtr ); - service.Register( typeid( autofill ), autofill ); - - // Connect Autofill daemon at the first time - autofillPtr->CreateContext(); - autofillPtr->ConnectCallbacks(); - } - } - - return autofill; -} - -AutofillManagerEcoreWl::AutofillManagerEcoreWl() -: mAutofillGroup(), - mAuthenticationServiceName(""), - mAuthenticationServiceMessage(""), - mAuthenticationServiceImagePath(""), - mFillItemId(""), - mFillItemPresentationText(""), - mFillItemValue(""), - mIsDataPresent( false ), - mIsAuthNeeded( false ) -{ -#ifdef CAPI_AUTOFILL_SUPPORT - mAutofillHandle = NULL; -#endif // CAPI_AUTOFILL_SUPPORT -} - -AutofillManagerEcoreWl::~AutofillManagerEcoreWl() -{ - DeleteContext(); -} - -void AutofillManagerEcoreWl::CreateContext() -{ - DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillManagerEcoreWl::CreateContext\n" ); - -#ifdef CAPI_AUTOFILL_SUPPORT - int ret = autofill_create( &mAutofillHandle ); - if( ret != AUTOFILL_ERROR_NONE ) - { - DALI_LOG_ERROR( "Failed to create autofill handle : %d \n", ret ); - } -#endif // CAPI_AUTOFILL_SUPPORT -} - -void AutofillManagerEcoreWl::DeleteContext() -{ - DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillManagerEcoreWl::DeleteContext\n" ); -#ifdef CAPI_AUTOFILL_SUPPORT - if( mAutofillHandle ) - { - // Unsets the callback to receive the authentication information. - autofill_auth_info_unset_received_cb( mAutofillHandle ); - - autofill_destroy( mAutofillHandle ); - mAutofillHandle = NULL; - } -#endif // CAPI_AUTOFILL_SUPPORT -} - -// Callbacks for connecting to autofill daemon. -void AutofillManagerEcoreWl::ConnectCallbacks() -{ -#ifdef CAPI_AUTOFILL_SUPPORT - if( mAutofillHandle ) - { - DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillManagerEcoreWl::ConnectCallbacks\n" ); - - int ret = autofill_connect( mAutofillHandle, ConnectionStatusChangedCallback, NULL ); - if( ret != AUTOFILL_ERROR_NONE ) - { - DALI_LOG_ERROR( "Failed to connect : %d \n", ret ); - } - - // Sets the callback to receive the authentication information. - autofill_auth_info_set_received_cb( mAutofillHandle, AuthInfoCallback, NULL ); - - // Sets the callback to receive autofill fill response. - autofill_fill_response_set_received_cb( mAutofillHandle, FillResponseCallback, NULL ); - } -#endif // CAPI_AUTOFILL_SUPPORT -} - - -/////////////////////////////////////////////// Autofill Callback implementation /////////////////////////////////////////////// - -#ifdef CAPI_AUTOFILL_SUPPORT - -autofill_h AutofillManagerEcoreWl::GetAutofillHandle() -{ - return mAutofillHandle; -} - -// Implementation to receive the authentication information. -void AutofillManagerEcoreWl::ReceiveAuthInfo( autofill_auth_info_h authInfoHandle, void *data ) -{ - bool autofillDataPresent = false; - bool authenticationNeeded = false; - char* serviceName = NULL; - char* serviceMessage = NULL; - char* serviceLogoImagePath = NULL; - char* groupId = NULL; - - // Gets the authentication information which is set by Autofill Service framework. - autofill_auth_info_get_view_id( authInfoHandle, &groupId ); - autofill_auth_info_get_autofill_data_present( authInfoHandle, &autofillDataPresent ); - autofill_auth_info_get_authentication_needed( authInfoHandle, &authenticationNeeded ); - - DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillManagerEcoreWl::ReceiveAuthInfo group id : %s, Is autofill data present ? : %s, Is authentication needed ? : %s \n", - groupId, autofillDataPresent ? "true" : "false", authenticationNeeded ? "true" : "false" ); - - for( std::vector::iterator iter = mAutofillGroupList.begin(), endIter = mAutofillGroupList.end(); iter != endIter; ++iter ) - { - const std::string id = ( *iter ).GetId(); - if( id.compare( groupId ) == 0 ) - { - mAutofillGroup = ( *iter ); - break; - } - } - // Sets the 'autofill data present' and 'authentication needed' attributes in autofill authentication information. - mIsDataPresent = autofillDataPresent; - mIsAuthNeeded = authenticationNeeded; - - if( groupId ) - { - free( groupId ); - } - - if( !autofillDataPresent ) - { - DALI_LOG_ERROR( " -> The autofill data is not present now. \n" ); - return; - } - - // If autofill authentication is needed, get authentication service information and set to DALi member variables. - if( authenticationNeeded ) - { - // Gets the authentication service information which is set by Autofill Service framework. - autofill_auth_info_get_service_name( authInfoHandle, &serviceName ); - autofill_auth_info_get_service_message( authInfoHandle, &serviceMessage ); - autofill_auth_info_get_service_logo_image_path( authInfoHandle, &serviceLogoImagePath ); - - DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillManagerEcoreWl::ReceiveAuthInfo service name : %s, logo path : %s, message : '%s' \n", - serviceName, serviceLogoImagePath, serviceMessage ); - - // Sets the authentication service information in order to use in other components. - mAuthenticationServiceName = serviceName; - mAuthenticationServiceMessage = serviceMessage; - mAuthenticationServiceImagePath = serviceLogoImagePath; - - // Emits the signal to receive the authentication information. - mAuthReceivedSignal.Emit(); - - if( serviceMessage ) - { - free( serviceMessage ); - } - - if( serviceName ) - { - free( serviceName ); - } - - if( serviceLogoImagePath ) - { - free( serviceLogoImagePath ); - } - } - else - { - // If Authentication is not needed, sends fill request directly to fill the data. - mAutofillGroup.SendFillRequest(); - } -} - -// Implementation to fill out the data -void AutofillManagerEcoreWl::FillGroupItem( autofill_fill_response_item_h itemHandle, void *userData ) -{ - char* id = NULL; - char* value = NULL; - char* presentationText = NULL; - - // Gets the fill response information which is set by Autofill Service framework. - autofill_fill_response_item_get_id( itemHandle, &id ); - autofill_fill_response_item_get_presentation_text( itemHandle, &presentationText ); - autofill_fill_response_item_get_value( itemHandle, &value ); - - DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillManagerEcoreWl::FillResponseItemCallback item id : %s, value : %s, presentation text : %s\n", - id, value, presentationText ); - - // Sets the fill response information in order to use in other components. - mFillItemId = id; - mFillItemPresentationText = presentationText; - mFillItemValue = value; - - Dali::AutofillItem item = mAutofillGroup.GetAutofillItem( id ); - Internal::Adaptor::AutofillItem& itemImpl = Internal::Adaptor::GetImplementation( item ); - itemImpl.AddPresentationList( presentationText ); - itemImpl.AddFillValueList( value ); - - // Emits the signal to fill the data in text input field. - mFillReceivedSignal.Emit( item ); - - if( id ) - { - free( id ); - } - - if( value ) - { - free( value ); - } - - if( presentationText ) - { - free( presentationText ); - } - -} - -// Implementation to fill out the data when the group count is more than one. -void AutofillManagerEcoreWl::FillMultipleGroupItem( autofill_fill_response_item_h itemHandle, void *userData ) -{ - char* id = NULL; - char* value = NULL; - char* presentationText = NULL; - - // Gets the fill response information which is set by Autofill Service framework. - autofill_fill_response_item_get_id( itemHandle, &id ); - autofill_fill_response_item_get_presentation_text( itemHandle, &presentationText ); - autofill_fill_response_item_get_value( itemHandle, &value ); - - DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillManagerEcoreWl::FillResponseMultipleItemCallback item id : %s, value : %s, presentation text : %s\n", - id, value, presentationText ); - - // Sets the fill response information in order to use in other components. - mFillItemId = id; - mFillItemPresentationText = presentationText; - mFillItemValue = value; - - Dali::AutofillItem item = mAutofillGroup.GetAutofillItem( id ); - Internal::Adaptor::AutofillItem& itemImpl = Internal::Adaptor::GetImplementation( item ); - itemImpl.AddPresentationList( presentationText ); - itemImpl.AddFillValueList( value ); - - if( id ) - { - free( id ); - } - - if( value ) - { - free( value ); - } - - if( presentationText ) - { - free( presentationText ); - } -} -#endif // CAPI_AUTOFILL_SUPPORT - - -/////////////////////////////////////////////// Autofill Item and Group /////////////////////////////////////////////// - -Dali::AutofillItem AutofillManagerEcoreWl::CreateAutofillItem( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool isSensitive ) -{ - DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillManagerEcoreWl::CreateAutofillItem \n" ); - - Dali::AutofillItem item = AutofillItem::New( id, label, hint, isSensitive ); - mAutofillItemList.push_back( item ); - - return mAutofillItemList.back(); -} - -Dali::AutofillGroup AutofillManagerEcoreWl::CreateAutofillGroup( const std::string& groupId ) -{ - DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillManagerEcoreWl::CreateAutofillGroup \n" ); - - Dali::AutofillGroup group = AutofillGroup::New( groupId ); - mAutofillGroupList.push_back( group ); - - return mAutofillGroupList.back(); -} - - -/////////////////////////////////////////////// Autofill Authentication Information /////////////////////////////////////////////// - -bool AutofillManagerEcoreWl::IsAutofillDataPresent() const -{ - return mIsDataPresent; -} - -bool AutofillManagerEcoreWl::IsAuthenticationNeeded() const -{ - return mIsAuthNeeded; -} - -const std::string& AutofillManagerEcoreWl::GetAuthenticationServiceName() const -{ - return mAuthenticationServiceName; -} - -const std::string& AutofillManagerEcoreWl::GetAuthenticationServiceMessage() const -{ - return mAuthenticationServiceMessage; -} - -const std::string& AutofillManagerEcoreWl::GetAuthenticationServiceImagePath() const -{ - return mAuthenticationServiceImagePath; -} - - -/////////////////////////////////////////////// Autofill Fill Response /////////////////////////////////////////////// - -const std::string& AutofillManagerEcoreWl::GetFillItemId() const -{ - return mFillItemId; -} - -const std::string& AutofillManagerEcoreWl::GetFillItemPresentationText() const -{ - return mFillItemPresentationText; -} - -const std::string& AutofillManagerEcoreWl::GetFillItemValue() const -{ - return mFillItemValue; -} - -void AutofillManagerEcoreWl::SaveAutofillData( Dali::AutofillGroup group ) -{ - DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillManagerEcoreWl::SaveAutofillData -> Sends request to store data. \n" ); - -#ifdef CAPI_AUTOFILL_SUPPORT - Internal::Adaptor::AutofillGroup& groupImpl = Internal::Adaptor::GetImplementation( group ); - Internal::Adaptor::AutofillGroupEcoreWl& groupImplWl = static_cast( groupImpl ); - - // Sends request to save autofill data. - int ret = autofill_commit( mAutofillHandle, groupImplWl.GetAutofillSaveGroupHandle() ); - if( ret != AUTOFILL_ERROR_NONE ) - { - DALI_LOG_ERROR( "Failed to request auth info. error : %d \n", ret ); - } -#endif // CAPI_AUTOFILL_SUPPORT -} - -// Signals -AutofillManagerEcoreWl::AuthSignalType& AutofillManagerEcoreWl::AuthenticationReceivedSignal() -{ - return mAuthReceivedSignal; -} - -AutofillManagerEcoreWl::FillSignalType& AutofillManagerEcoreWl::FillResponseReceivedSignal() -{ - return mFillReceivedSignal; -} - -AutofillManagerEcoreWl::ListSignalType& AutofillManagerEcoreWl::ListEventSignal() -{ - return mListReceivedSignal; -} - -bool AutofillManagerEcoreWl::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor ) -{ - Dali::BaseHandle handle( object ); - - bool connected( true ); - AutofillManagerEcoreWl* manager = dynamic_cast< AutofillManagerEcoreWl* >( object ); - - if( manager ) - { - if( 0 == signalName.compare( SIGNAL_AUTHENTICATION_RECEIVED ) ) - { - manager->AuthenticationReceivedSignal().Connect( tracker, functor ); - } - else if( 0 == signalName.compare( SIGNAL_FILL_RESPONSE_RECEIVED ) ) - { - manager->FillResponseReceivedSignal().Connect( tracker, functor ); - } - else if( 0 == signalName.compare( SIGNAL_LIST_RECEIVED ) ) - { - manager->ListEventSignal().Connect( tracker, functor ); - } - else - { - // signalName does not match any signal - connected = false; - } - } - - return connected; -} - -} // Adaptor - -} // Internal - -} // Dali diff --git a/dali/internal/input/tizen-wayland/autofill-manager-impl-ecore-wl.h b/dali/internal/input/tizen-wayland/autofill-manager-impl-ecore-wl.h deleted file mode 100644 index 4f84ff3..0000000 --- a/dali/internal/input/tizen-wayland/autofill-manager-impl-ecore-wl.h +++ /dev/null @@ -1,258 +0,0 @@ -#ifndef DALI_INTERNAL_AUTOFILL_MANAGER_IMPL_ECORE_WL_H -#define DALI_INTERNAL_AUTOFILL_MANAGER_IMPL_ECORE_WL_H - -/* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -// EXTERNAL INCLUDES -#include -#ifdef CAPI_AUTOFILL_SUPPORT -#include -#endif // CAPI_AUTOFILL_SUPPORT -#include - -// INTERNAL INCLUDES -#include -#include - -namespace Dali -{ - -namespace Internal -{ - -namespace Adaptor -{ - -class AutofillManagerEcoreWl : public Dali::Internal::Adaptor::AutofillManager -{ - -public: - - using AuthSignalType = Dali::AutofillManager::AuthSignalType; - using FillSignalType = Dali::AutofillManager::FillSignalType; - using ListSignalType = Dali::AutofillManager::ListSignalType; - -public: - - /** - * @brief Gets the AutofillManager instance - * - * It creates the instance if it has not already been created. - * Internally, a check should be made using IsAvailable() before this is called as we do not want - * to create an instance if not needed by applications. - * @see IsAvailable() - */ - static Dali::AutofillManager Get(); - - /** - * @brief Connects Callbacks required for Autofill daemon. - */ - void ConnectCallbacks() override; - -#ifdef CAPI_AUTOFILL_SUPPORT - - /** - * @brief Gets Autofill framework handle - * @return Autofill framework handle, which type is 'autofill_h" - */ - autofill_h GetAutofillHandle(); - - /** - * @brief Implement to receives Autofill Authentication Information callback. - * - * In this method, gets authentication information and emits the signal to check the authentication. - * @param authInfoHandle The autofill authentication information handle - * @param data The data from authentication information callback - */ - void ReceiveAuthInfo( autofill_auth_info_h authInfoHandle, void *data ); - - /** - * @brief Implement to fill out the data. - * - * This method would emit the signal to fill out the data. - * @param itemHandle The autofill fill response item handle - * @param userData The data from fill response callback - */ - void FillGroupItem( autofill_fill_response_item_h itemHandle, void *userData ); - - /** - * @brief Implement to set multiple group information. - * - * This method would emit the signals to make lists and fill out the data. - * @param itemHandle The autofill fill response item handle - * @param userData The data from fill response callback - */ - void FillMultipleGroupItem( autofill_fill_response_item_h itemHandle, void *userData ); -#endif // CAPI_AUTOFILL_SUPPORT - - - /////////////////////////////////////////////// Autofill Item and Group /////////////////////////////////////////////// - - /** - * @copydoc Dali::AutofillManager::CreateAutofillItem() - */ - Dali::AutofillItem CreateAutofillItem( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool isSensitive ) override; - - /** - * @copydoc Dali::AutofillManager::CreateAutofillGroup() - */ - Dali::AutofillGroup CreateAutofillGroup( const std::string& groupId ) override; - - - /////////////////////////////////////////////// Autofill Authentication Information /////////////////////////////////////////////// - - /** - * @copydoc Dali::AutofillManager::IsAutofillDataPresent() - */ - bool IsAutofillDataPresent() const override; - - /** - * @copydoc Dali::AutofillManager::IsAuthenticationNeeded() - */ - bool IsAuthenticationNeeded() const override; - - /** - * @copydoc Dali::AutofillManager::GetAuthenticationServiceName() - */ - const std::string& GetAuthenticationServiceName() const override; - - /** - * @copydoc Dali::AutofillManager::GetAuthenticationServiceMessage() - */ - const std::string& GetAuthenticationServiceMessage() const override; - - /** - * @copydoc Dali::AutofillManager::GetAuthenticationServiceImagePath() - */ - const std::string& GetAuthenticationServiceImagePath() const override; - - - /////////////////////////////////////////////// Autofill Fill Response /////////////////////////////////////////////// - - /** - * @copydoc Dali::AutofillManager::GetFillItemId() - */ - const std::string& GetFillItemId() const override; - - /** - * @copydoc Dali::AutofillManager::GetFillItemPresentationText() - */ - const std::string& GetFillItemPresentationText() const override; - - /** - * @copydoc Dali::AutofillManager::GetFillItemValue() - */ - const std::string& GetFillItemValue() const override; - - /** - * @copydoc Dali::AutofillManager::SaveAutofillData() - */ - void SaveAutofillData( Dali::AutofillGroup group ) override; - -public: // Signals - - /** - * @copydoc Dali::AutofillManager::AuthenticationReceivedSignal() - */ - AuthSignalType& AuthenticationReceivedSignal() override; - - /** - * @copydoc Dali::AutofillManager::FillResponseReceivedSignal() - */ - FillSignalType& FillResponseReceivedSignal() override; - - /** - * @copydoc Dali::AutofillManager::ListEventSignal() - */ - ListSignalType& ListEventSignal() override; - - /** - * Connects a callback function with the object's signals. - * @param[in] object The object providing the signal. - * @param[in] tracker Used to disconnect the signal. - * @param[in] signalName The signal to connect to. - * @param[in] functor A newly allocated FunctorDelegate. - * @return True if the signal was connected. - * @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the caller is responsible for deleting the unused functor. - */ - static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor ); - -private: - /** - * Context created the first time and kept until deleted. - */ - void CreateContext() override; - - /** - * Delete Autofill context. - */ - void DeleteContext() override; - -private: - /** - * Constructor. - */ - explicit AutofillManagerEcoreWl(); - -protected: - /** - * Destructor. - */ - ~AutofillManagerEcoreWl(); - -private: - // Undefined copy constructor - explicit AutofillManagerEcoreWl( const AutofillManagerEcoreWl& autofillManager ) = delete; - - // Undefined assignment operator - AutofillManagerEcoreWl& operator=( AutofillManagerEcoreWl& autofillManager ) = delete; - -private: -#ifdef CAPI_AUTOFILL_SUPPORT - autofill_h mAutofillHandle; ///< The Autofill framework handle -#endif // CAPI_AUTOFILL_SUPPORT - Dali::AutofillGroup mAutofillGroup; - - std::vector mAutofillGroupList; ///< The list to manage AutofillGroup - std::vector mAutofillItemList; ///< The list to manage AutofillItem - -private: - AuthSignalType mAuthReceivedSignal; ///< Authentication Received Signal - FillSignalType mFillReceivedSignal; ///< Fill Response Received Signal - ListSignalType mListReceivedSignal; ///< List Received Signal - -private: - std::string mAuthenticationServiceName; ///< The autofill authentication service name - std::string mAuthenticationServiceMessage; ///< The autofill authentication service message - std::string mAuthenticationServiceImagePath; ///< The autofill authentication service logo image path - std::string mFillItemId; ///< The autofill fill response item ID - std::string mFillItemPresentationText; ///< The autofill fill response item presentation text - std::string mFillItemValue; ///< The autofill fill response item value (input data) - - bool mIsDataPresent; ///< The autofill data presence - bool mIsAuthNeeded; ///< The authentication need - -}; - -} // namespace Adaptor - -} // namespace Internal - -} // namespace Dali - -#endif // DALI_INTERNAL_AUTOFILL_MANAGER_IMPL_ECORE_WL_H diff --git a/dali/internal/input/ubuntu-x11/autofill-factory-x.cpp b/dali/internal/input/ubuntu-x11/autofill-factory-x.cpp deleted file mode 100755 index 06848ac..0000000 --- a/dali/internal/input/ubuntu-x11/autofill-factory-x.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#include -#include -#include -#include - -namespace Dali -{ -namespace Internal -{ -namespace Adaptor -{ - -namespace AutofillFactory -{ - -// Autofill Factory to be implemented by the platform - -Dali::AutofillGroup CreateAutofillGroup( const std::string& groupId ) -{ - return Dali::Internal::Adaptor::AutofillGroupX::New( groupId ); -} - -Dali::AutofillItem CreateAutofillItem( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool sensitiveData ) -{ - return Dali::Internal::Adaptor::AutofillItemX::New( id, label, hint, sensitiveData ); -} - -Dali::AutofillManager CreateAutofillManager() -{ - return Dali::Internal::Adaptor::AutofillManagerX::Get(); -} - -} - -} // namespace Adaptor -} // namespace Internal -} // namespace Dali diff --git a/dali/internal/input/ubuntu-x11/autofill-group-impl-x.cpp b/dali/internal/input/ubuntu-x11/autofill-group-impl-x.cpp deleted file mode 100755 index 4f6b775..0000000 --- a/dali/internal/input/ubuntu-x11/autofill-group-impl-x.cpp +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -// CLASS HEADER -#include - -// EXTERNAL INCLUDES -#include -#include - - -namespace Dali -{ - -namespace Internal -{ - -namespace Adaptor -{ - -namespace -{ -#if defined(DEBUG_ENABLED) -Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_AUTOFILL"); -#endif - - -BaseHandle Create() -{ - return Dali::Internal::Adaptor::AutofillGroup::New( "" ); -} - -Dali::TypeRegistration type( typeid(Dali::AutofillGroup), typeid(Dali::BaseHandle), Create ); - -} // unnamed namespace - - -AutofillGroupX::AutofillGroupX( const std::string groupId ) -: mAutofillItemList(), - mGroupId( groupId ) -{ -} - -AutofillGroupX::~AutofillGroupX() -{ -} - -Dali::AutofillGroup AutofillGroupX::New( const std::string& groupId ) -{ - Dali::Internal::Adaptor::AutofillGroup* group = new Dali::Internal::Adaptor::AutofillGroupX( groupId ); - Dali::AutofillGroup handle = Dali::AutofillGroup( group ); - - group->Initialize(); - - return handle; -} - -void AutofillGroupX::Initialize() -{ -} - -const std::string& AutofillGroupX::GetId() const -{ - DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillGroupX::GetId \n" ); - return mGroupId; -} - -void AutofillGroupX::AddAutofillItem( Dali::AutofillItem item ) -{ - // Pushes back an AutofillItem to the ItemList of AutofillGroupX. - mAutofillItemList.push_back( item ); -} - -Dali::AutofillItem AutofillGroupX::GetAutofillItem( const std::string& id ) -{ - Dali::AutofillItem item = Dali::AutofillItem(); - for( std::vector::iterator iter = mAutofillItemList.begin(), endIter = mAutofillItemList.end(); iter != endIter; ++iter ) - { - const std::string& itemId = ( *iter ).GetId(); - - if( itemId.compare( id ) == 0 ) - { - item = ( *iter ); - } - } - return item; -} - -void AutofillGroupX::ClearAutofillItemList() -{ - for( std::vector::iterator iter = mAutofillItemList.begin(), endIter = mAutofillItemList.end(); iter != endIter; ++iter ) - { - ( *iter ).ClearPresentationTextList(); - ( *iter ).ClearFillValueList(); - } -} - -void AutofillGroupX::SaveAutofillData() -{ - DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillGroupX::SaveAutofillData\n" ); - // Do Nothing -} - -void AutofillGroupX::RequestAuthentication() -{ - DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillGroupX::RequestAuthentication\n" ); - // Do Nothing -} - -void AutofillGroupX::SendFillRequest() -{ - DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillGroupX::SendFillRequest\n" ); - // Do Nothing -} - -} // Adaptor - -} // Internal - -} // Dali diff --git a/dali/internal/input/ubuntu-x11/autofill-group-impl-x.h b/dali/internal/input/ubuntu-x11/autofill-group-impl-x.h deleted file mode 100644 index 4003215..0000000 --- a/dali/internal/input/ubuntu-x11/autofill-group-impl-x.h +++ /dev/null @@ -1,127 +0,0 @@ -#ifndef DALI_INTERNAL_AUTOFILL_GROUP_IMPL_X_H -#define DALI_INTERNAL_AUTOFILL_GROUP_IMPL_X_H - -/* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -// EXTERNAL INCLUDES -#include -#include - -// INTERNAL INCLUDES -#include -#include - -namespace Dali -{ - -namespace Internal -{ - -namespace Adaptor -{ - - -/** - * @brief This class is used to group AutofillItems. - */ -class AutofillGroupX : public Dali::Internal::Adaptor::AutofillGroup -{ - -public: - - /** - * @brief Constructor. - * - * @param[in] groupId A unique ID value of each AutofillGroup - * @return A public handle to the newly allocated AutofillGroup. - */ - static Dali::AutofillGroup New( const std::string& groupId ); - - /** - * @brief Initialize AutofillGroup constructor. - */ - void Initialize() override; - - /** - * @copydoc Dali::AutofillGroup::GetId() - */ - const std::string& GetId() const override; - - /** - * @copydoc Dali::AutofillGroup::AddAutofillItem() - */ - void AddAutofillItem( Dali::AutofillItem item ) override; - - /** - * @copydoc Dali::AutofillGroup::GetAutofillItem() - */ - Dali::AutofillItem GetAutofillItem( const std::string& id ) override; - - /** - * @brief Clears all lists of AutofillItem added in AutofillGroup. - */ - void ClearAutofillItemList() override; - - /** - * @copydoc Dali::AutofillGroup::SaveAutofillData() - */ - void SaveAutofillData() override; - - /** - * @copydoc Dali::AutofillGroup::RequestAuthentication() - */ - void RequestAuthentication() override; - - /** - * @copydoc Dali::AutofillGroup::SendFillRequest() - */ - void SendFillRequest() override; - -private: - /** - * Constructor. - */ - explicit AutofillGroupX( const std::string groupId ); - -protected: - /** - * Destructor. - */ - ~AutofillGroupX(); - -private: - // Undefined copy constructor - explicit AutofillGroupX( const AutofillGroupX& autofillGroup ) = delete; - - // Undefined assignment operator - AutofillGroupX& operator=( AutofillGroupX& autofillGroup ) = delete; - -private: - std::vector mAutofillItemList; ///< The List to add AutofillItem - std::string mGroupId; ///< The AutofillGroup ID - -}; - - -} // namespace Adaptor - -} // namespace Internal - -} // namespace Dali - -#endif // DALI_INTERNAL_AUTOFILL_GROUP_IMPL_X_H diff --git a/dali/internal/input/ubuntu-x11/autofill-item-impl-x.cpp b/dali/internal/input/ubuntu-x11/autofill-item-impl-x.cpp deleted file mode 100755 index 9801552..0000000 --- a/dali/internal/input/ubuntu-x11/autofill-item-impl-x.cpp +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -// CLASS HEADER -#include - -// EXTERNAL INCLUDES - -#include -#include - -namespace Dali -{ - -namespace Internal -{ - -namespace Adaptor -{ - -namespace -{ -#if defined(DEBUG_ENABLED) -Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_AUTOFILL"); -#endif - - -BaseHandle Create() -{ - return Dali::Internal::Adaptor::AutofillItem::New( "", "", Dali::AutofillItem::Hint::ID, false ); -} - -Dali::TypeRegistration type( typeid(Dali::AutofillItem), typeid(Dali::BaseHandle), Create ); - -} // unnamed namespace - - -AutofillItemX::AutofillItemX( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool sensitiveData ) -: mId( id ), - mLabel( label ), - mHint( hint ), - mSensitiveData( sensitiveData ), - mValue(""), - mPresentationTextList(), - mValueList() -{ -} - -AutofillItemX::~AutofillItemX() -{ -} - - -Dali::AutofillItem AutofillItemX::New( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool sensitiveData ) -{ - Dali::Internal::Adaptor::AutofillItem* item = new Dali::Internal::Adaptor::AutofillItemX( id, label, hint, sensitiveData ); - Dali::AutofillItem handle = Dali::AutofillItem( item ); - - item->Initialize(); - - return handle; -} - -void AutofillItemX::Initialize() -{ -} - -const std::string& AutofillItemX::GetId() const -{ - DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillItemX::GetId \n" ); - return mId; -} - -const std::string& AutofillItemX::GetLabel() const -{ - DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillItemX::GetLabel \n" ); - return mLabel; -} - -Dali::AutofillItem::Hint AutofillItemX::GetHint() const -{ - DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillItemX::GetHint \n" ); - return mHint; -} - -bool AutofillItemX::IsSensitiveData() const -{ - DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillItemX::IsSensitiveData \n" ); - return mSensitiveData; -} - -void AutofillItemX::SetSaveValue( const std::string& value ) -{ - mValue = value; -} - -const std::string& AutofillItemX::GetSaveValue() const -{ - return mValue; -} - -void AutofillItemX::AddPresentationList( const std::string& presentationText ) -{ - mPresentationTextList.push_back( presentationText ); -} - -void AutofillItemX::AddFillValueList( const std::string& fillValue ) -{ - mValueList.push_back( fillValue ); -} - -const std::string& AutofillItemX::GetPresentationText( int index ) const -{ - return mPresentationTextList[index]; -} - -const std::string& AutofillItemX::GetFillValue( int index ) const -{ - return mValueList[index]; -} - -void AutofillItemX::ClearPresentationTextList() -{ - mPresentationTextList.clear(); -} - -void AutofillItemX::ClearFillValueList() -{ - mValueList.clear(); -} - -unsigned int AutofillItemX::GetFillValueCount() -{ - return mValueList.size(); -} - -} // Adaptor - -} // Internal - -} // Dali diff --git a/dali/internal/input/ubuntu-x11/autofill-item-impl-x.h b/dali/internal/input/ubuntu-x11/autofill-item-impl-x.h deleted file mode 100644 index c7b8985..0000000 --- a/dali/internal/input/ubuntu-x11/autofill-item-impl-x.h +++ /dev/null @@ -1,171 +0,0 @@ -#ifndef DALI_INTERNAL_AUTOFILL_ITEM_IMPL_X_H -#define DALI_INTERNAL_AUTOFILL_ITEM_IMPL_X_H - -/* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -// EXTERNAL INCLUDES -#include -#include - -// INTERNAL INCLUDES -#include - -namespace Dali -{ - -namespace Internal -{ - -namespace Adaptor -{ - -/** - * @brief This class is used to pass on data from the AutofillItem of control. - */ -class AutofillItemX : public Dali::Internal::Adaptor::AutofillItem -{ - -public: - - /** - * @brief Constructor. - * - * @param[in] id A unique ID for this AutofillItem - * @param[in] label An auxiliary means to guess what data is - * @param[in] hint The hint - id (username), name, password, phone, credit card number, organization, and so on - * @param[in] sensitiveData Whether this AutofillItem is a sensitive data or not. (The default is false) - * @return A public handle to the newly allocated AutofillItem - */ - static Dali::AutofillItem New( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool sensitiveData ); - - /** - * @brief Initialize AutofillItem constructor. - */ - void Initialize() override; - - /** - * @copydoc Dali::AutofillItem::GetId() - */ - const std::string& GetId() const override; - - /** - * @copydoc Dali::AutofillItem::GetLabel() - */ - const std::string& GetLabel() const override; - - /** - * @copydoc Dali::AutofillItem::GetHint() - */ - Dali::AutofillItem::Hint GetHint() const override; - - /** - * @copydoc Dali::AutofillItem::IsSensitiveData() - */ - bool IsSensitiveData() const override; - - /** - * @copydoc Dali::AutofillItem::SetSaveValue() - */ - void SetSaveValue( const std::string& value ) override; - - /** - * @copydoc Dali::AutofillItem::GetSaveValue() - */ - const std::string& GetSaveValue() const override; - - /** - * @brief Adds the presentation text to fill out in the list. - * - * @param[in] presentationText The presentation text to fill out - */ - void AddPresentationList( const std::string& presentationText ) override; - - /** - * @brief Adds the value to fill out in the list. - * - * @param[in] fillValue The value to fill out - */ - void AddFillValueList( const std::string& fillValue ) override; - - /** - * @copydoc Dali::AutofillItem::GetPresentationText() - */ - const std::string& GetPresentationText( int index ) const override; - - /** - * @copydoc Dali::AutofillItem::GetFillValue() - */ - const std::string& GetFillValue( int index ) const override; - - /** - * @copydoc Dali::AutofillItem::ClearPresentationTextList() - */ - void ClearPresentationTextList() override; - - /** - * @copydoc Dali::AutofillItem::ClearFillValueList() - */ - void ClearFillValueList() override; - - /** - * @copydoc Dali::AutofillItem::GetFillValueCount() - */ - unsigned int GetFillValueCount() override; - -private: - /** - * Constructor. - */ - explicit AutofillItemX( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool sensitiveData ); - -protected: - /** - * Destructor. - */ - ~AutofillItemX(); - -private: - // Undefined copy constructor - explicit AutofillItemX( const AutofillItemX& autofillItem ) = delete; - - // Undefined assignment operator - AutofillItemX& operator=( AutofillItemX& autofillItem ) = delete; - - -// Data -private: - std::string mId; ///< The AutofillItem ID - std::string mLabel; ///< The AutofillItem Label - Dali::AutofillItem::Hint mHint; ///< The AutofillItem Hint (id (username), name, password, phone, credit card number, organization, so on) - bool mSensitiveData; ///< Whether the data is sensitive or not - - std::string mValue; - - std::vector mPresentationTextList; ///< The list for the presentation text to fill out - std::vector mValueList; ///< The list for the value to fill out - -}; - - -} // namespace Adaptor - -} // namespace Internal - -} // namespace Dali - -#endif // DALI_INTERNAL_AUTOFILL_ITEM_IMPL_X_H diff --git a/dali/internal/input/ubuntu-x11/autofill-manager-impl-x.cpp b/dali/internal/input/ubuntu-x11/autofill-manager-impl-x.cpp deleted file mode 100755 index 25c289f..0000000 --- a/dali/internal/input/ubuntu-x11/autofill-manager-impl-x.cpp +++ /dev/null @@ -1,252 +0,0 @@ -/* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -// CLASS HEADER -#include - -// EXTERNAL INCLUDES -#include -#include -#include - -// INTERNAL INCLUDES -#include - -namespace Dali -{ - -namespace Internal -{ - -namespace Adaptor -{ - -namespace -{ -#if defined(DEBUG_ENABLED) -Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_AUTOFILL"); -#endif - -// Signals -const char* const SIGNAL_AUTHENTICATION_RECEIVED = "authenticationReceived"; -const char* const SIGNAL_FILL_RESPONSE_RECEIVED = "fillResponseReceived"; -const char* const SIGNAL_LIST_RECEIVED = "listReceived"; - -BaseHandle Create() -{ - return Dali::AutofillManager::Get(); -} - -Dali::TypeRegistration typeRegistration( typeid(Dali::AutofillManager), typeid(Dali::BaseHandle), Create ); - -Dali::SignalConnectorType signalConnector1( typeRegistration, SIGNAL_AUTHENTICATION_RECEIVED, Dali::Internal::Adaptor::AutofillManagerX::DoConnectSignal ); -Dali::SignalConnectorType signalConnector2( typeRegistration, SIGNAL_FILL_RESPONSE_RECEIVED, Dali::Internal::Adaptor::AutofillManagerX::DoConnectSignal ); -Dali::SignalConnectorType signalConnector3( typeRegistration, SIGNAL_LIST_RECEIVED, Dali::Internal::Adaptor::AutofillManagerX::DoConnectSignal ); - -} // unnamed namespace - - - -Dali::AutofillManager AutofillManagerX::Get() -{ - Dali::AutofillManager autofill; - AutofillManagerX *autofillPtr = NULL; - - Dali::SingletonService service( SingletonService::Get() ); - if( service ) - { - // Check whether the singleton is already created - Dali::BaseHandle handle = service.GetSingleton( typeid( Dali::AutofillManager ) ); - if( handle ) - { - // If so, downcast the handle - autofillPtr = dynamic_cast< AutofillManagerX* >( handle.GetObjectPtr() ); - autofill = Dali::AutofillManager( autofillPtr ); - } - else if( Adaptor::IsAvailable() ) - { - // Create instance and register singleton only if the adaptor is available - autofillPtr = new AutofillManagerX(); - autofill = Dali::AutofillManager( autofillPtr ); - service.Register( typeid( autofill ), autofill ); - } - } - - return autofill; -} - -AutofillManagerX::AutofillManagerX() -: mAutofillGroup(), - mAuthenticationServiceName(""), - mAuthenticationServiceMessage(""), - mAuthenticationServiceImagePath(""), - mFillItemId(""), - mFillItemPresentationText(""), - mFillItemValue(""), - mIsDataPresent( false ), - mIsAuthNeeded( false ) -{ -} - -AutofillManagerX::~AutofillManagerX() -{ - DeleteContext(); -} - -void AutofillManagerX::ConnectCallbacks() -{ -} - -void AutofillManagerX::CreateContext() -{ -} - -void AutofillManagerX::DeleteContext() -{ - DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillManagerX::DeleteContext\n" ); - // Do Nothing -} - - -/////////////////////////////////////////////// Autofill Item and Group /////////////////////////////////////////////// - -Dali::AutofillItem AutofillManagerX::CreateAutofillItem( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool isSensitive ) -{ - DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillManagerX::CreateAutofillItem \n" ); - - Dali::AutofillItem item = AutofillItem::New( id, label, hint, isSensitive ); - mAutofillItemList.push_back( item ); - - return mAutofillItemList.back(); -} - -Dali::AutofillGroup AutofillManagerX::CreateAutofillGroup( const std::string& groupId ) -{ - DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillManagerX::CreateAutofillGroup \n" ); - - Dali::AutofillGroup group = AutofillGroup::New( groupId ); - mAutofillGroupList.push_back( group ); - - return mAutofillGroupList.back(); -} - - -/////////////////////////////////////////////// Autofill Authentication Information /////////////////////////////////////////////// - -bool AutofillManagerX::IsAutofillDataPresent() const -{ - return mIsDataPresent; -} - -bool AutofillManagerX::IsAuthenticationNeeded() const -{ - return mIsAuthNeeded; -} - -const std::string& AutofillManagerX::GetAuthenticationServiceName() const -{ - return mAuthenticationServiceName; -} - -const std::string& AutofillManagerX::GetAuthenticationServiceMessage() const -{ - return mAuthenticationServiceMessage; -} - -const std::string& AutofillManagerX::GetAuthenticationServiceImagePath() const -{ - return mAuthenticationServiceImagePath; -} - - -/////////////////////////////////////////////// Autofill Fill Response /////////////////////////////////////////////// - -const std::string& AutofillManagerX::GetFillItemId() const -{ - return mFillItemId; -} - -const std::string& AutofillManagerX::GetFillItemPresentationText() const -{ - return mFillItemPresentationText; -} - -const std::string& AutofillManagerX::GetFillItemValue() const -{ - return mFillItemValue; -} - -void AutofillManagerX::SaveAutofillData( Dali::AutofillGroup group ) -{ - DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillManagerX::SaveAutofillData\n" ); - // Do Nothing -} - -// Signals -AutofillManagerX::AuthSignalType& AutofillManagerX::AuthenticationReceivedSignal() -{ - return mAuthReceivedSignal; -} - -AutofillManagerX::FillSignalType& AutofillManagerX::FillResponseReceivedSignal() -{ - return mFillReceivedSignal; -} - -AutofillManagerX::ListSignalType& AutofillManagerX::ListEventSignal() -{ - return mListReceivedSignal; -} - -bool AutofillManagerX::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor ) -{ - Dali::BaseHandle handle( object ); - - bool connected( true ); - AutofillManagerX* manager = dynamic_cast< AutofillManagerX* >( object ); - - if( manager ) - { - if( 0 == signalName.compare( SIGNAL_AUTHENTICATION_RECEIVED ) ) - { - manager->AuthenticationReceivedSignal().Connect( tracker, functor ); - } - else if( 0 == signalName.compare( SIGNAL_FILL_RESPONSE_RECEIVED ) ) - { - manager->FillResponseReceivedSignal().Connect( tracker, functor ); - } - else if( 0 == signalName.compare( SIGNAL_LIST_RECEIVED ) ) - { - manager->ListEventSignal().Connect( tracker, functor ); - } - else - { - // signalName does not match any signal - connected = false; - } - } - - return connected; -} - - - -} // Adaptor - -} // Internal - -} // Dali diff --git a/dali/internal/input/ubuntu-x11/autofill-manager-impl-x.h b/dali/internal/input/ubuntu-x11/autofill-manager-impl-x.h deleted file mode 100644 index 1b0b3e9..0000000 --- a/dali/internal/input/ubuntu-x11/autofill-manager-impl-x.h +++ /dev/null @@ -1,217 +0,0 @@ -#ifndef DALI_INTERNAL_AUTOFILL_MANAGER_IMPL_X_H -#define DALI_INTERNAL_AUTOFILL_MANAGER_IMPL_X_H - -/* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -// EXTERNAL INCLUDES -#include -#include - -// INTERNAL INCLUDES -#include -#include - -namespace Dali -{ - -namespace Internal -{ - -namespace Adaptor -{ - -class AutofillManagerX : public Dali::Internal::Adaptor::AutofillManager -{ - -public: - - using AuthSignalType = Dali::AutofillManager::AuthSignalType; - using FillSignalType = Dali::AutofillManager::FillSignalType; - using ListSignalType = Dali::AutofillManager::ListSignalType; - -public: - - /** - * @brief Gets the AutofillManager instance - * - * It creates the instance if it has not already been created. - * Internally, a check should be made using IsAvailable() before this is called as we do not want - * to create an instance if not needed by applications. - * @see IsAvailable() - */ - static Dali::AutofillManager Get(); - - /** - * @brief Connects Callbacks required for Autofill daemon. - */ - void ConnectCallbacks() override; - - - /////////////////////////////////////////////// Autofill Item and Group /////////////////////////////////////////////// - - /** - * @copydoc Dali::AutofillManager::CreateAutofillItem() - */ - Dali::AutofillItem CreateAutofillItem( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool isSensitive ) override; - - /** - * @copydoc Dali::AutofillManager::CreateAutofillGroup() - */ - Dali::AutofillGroup CreateAutofillGroup( const std::string& groupId ) override; - - - /////////////////////////////////////////////// Autofill Authentication Information /////////////////////////////////////////////// - - /** - * @copydoc Dali::AutofillManager::IsAutofillDataPresent() - */ - bool IsAutofillDataPresent() const override; - - /** - * @copydoc Dali::AutofillManager::IsAuthenticationNeeded() - */ - bool IsAuthenticationNeeded() const override; - - /** - * @copydoc Dali::AutofillManager::GetAuthenticationServiceName() - */ - const std::string& GetAuthenticationServiceName() const override; - - /** - * @copydoc Dali::AutofillManager::GetAuthenticationServiceMessage() - */ - const std::string& GetAuthenticationServiceMessage() const override; - - /** - * @copydoc Dali::AutofillManager::GetAuthenticationServiceImagePath() - */ - const std::string& GetAuthenticationServiceImagePath() const override; - - - /////////////////////////////////////////////// Autofill Fill Response /////////////////////////////////////////////// - - /** - * @copydoc Dali::AutofillManager::GetFillItemId() - */ - const std::string& GetFillItemId() const override; - - /** - * @copydoc Dali::AutofillManager::GetFillItemPresentationText() - */ - const std::string& GetFillItemPresentationText() const override; - - /** - * @copydoc Dali::AutofillManager::GetFillItemValue() - */ - const std::string& GetFillItemValue() const override; - - /** - * @copydoc Dali::AutofillManager::SaveAutofillData() - */ - void SaveAutofillData( Dali::AutofillGroup group ) override; - -public: // Signals - - /** - * @copydoc Dali::AutofillManager::AuthenticationReceivedSignal() - */ - AuthSignalType& AuthenticationReceivedSignal() override; - - /** - * @copydoc Dali::AutofillManager::FillResponseReceivedSignal() - */ - FillSignalType& FillResponseReceivedSignal() override; - - /** - * @copydoc Dali::AutofillManager::ListEventSignal() - */ - ListSignalType& ListEventSignal() override; - - /** - * Connects a callback function with the object's signals. - * @param[in] object The object providing the signal. - * @param[in] tracker Used to disconnect the signal. - * @param[in] signalName The signal to connect to. - * @param[in] functor A newly allocated FunctorDelegate. - * @return True if the signal was connected. - * @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the caller is responsible for deleting the unused functor. - */ - static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor ); - -private: - /** - * Context created the first time and kept until deleted. - */ - void CreateContext() override; - - /** - * Delete Autofill context. - */ - void DeleteContext() override; - -private: - /** - * Constructor. - */ - explicit AutofillManagerX(); - -protected: - /** - * Destructor. - */ - ~AutofillManagerX(); - -private: - // Undefined copy constructor - explicit AutofillManagerX( const AutofillManagerX& autofillManager ) = delete; - - // Undefined assignment operator - AutofillManagerX& operator=( AutofillManagerX& autofillManager ) = delete; - -private: - Dali::AutofillGroup mAutofillGroup; - - std::vector mAutofillGroupList; ///< The list to manage AutofillGroup - std::vector mAutofillItemList; ///< The list to manage AutofillItem - -private: - AuthSignalType mAuthReceivedSignal; ///< Authentication Received Signal - FillSignalType mFillReceivedSignal; ///< Fill Response Received Signal - ListSignalType mListReceivedSignal; ///< List Received Signal - -private: - std::string mAuthenticationServiceName; ///< The autofill authentication service name - std::string mAuthenticationServiceMessage; ///< The autofill authentication service message - std::string mAuthenticationServiceImagePath; ///< The autofill authentication service logo image path - std::string mFillItemId; ///< The autofill fill response item ID - std::string mFillItemPresentationText; ///< The autofill fill response item presentation text - std::string mFillItemValue; ///< The autofill fill response item value (input data) - - bool mIsDataPresent; ///< The autofill data presence - bool mIsAuthNeeded; ///< The authentication need - -}; - - -} // namespace Adaptor - -} // namespace Internal - -} // namespace Dali - -#endif // DALI_INTERNAL_AUTOFILL_MANAGER_IMPL_X_H diff --git a/packaging/dali-adaptor.spec b/packaging/dali-adaptor.spec index 6b855f7..7bfdf6e 100644 --- a/packaging/dali-adaptor.spec +++ b/packaging/dali-adaptor.spec @@ -100,11 +100,6 @@ BuildRequires: pkgconfig(ecore-imf) BuildRequires: pkgconfig(capi-system-system-settings) -# for autofill -%if 0%{?tizen_version_major} >= 5 && 0%{?tizen_version_minor} >= 5 -BuildRequires: pkgconfig(capi-ui-autofill) -%endif - # for feedback plugin BuildRequires: pkgconfig(mm-sound) BuildRequires: pkgconfig(feedback) @@ -303,7 +298,6 @@ cmake_flags+=" -DCMAKE_INSTALL_PREFIX=$PREFIX" cmake_flags+=" -DCMAKE_INSTALL_LIBDIR=%{_libdir}" cmake_flags+=" -DCMAKE_INSTALL_INCLUDEDIR=%{_includedir}" cmake_flags+=" -DENABLE_TIZEN_MAJOR_VERSION=%{tizen_version_major}" -cmake_flags+=" -DENABLE_TIZEN_MINOR_VERSION=%{tizen_version_minor}" cmake_flags+=" -DENABLE_FEEDBACK=YES" cmake_flags+=" -DENABLE_APPFW=YES" -- 2.7.4 From 598a6b24da1e453806102f39f8a257a227f3e964 Mon Sep 17 00:00:00 2001 From: Heeyong Song Date: Wed, 6 May 2020 17:23:01 +0900 Subject: [PATCH 12/16] Revert "[Tizen] Temporarily modified so that window is no null" This reverts commit 41394934725551e977e1e0825a72669aa9d6637d. Change-Id: Ib6c95290bcdffca28c4d7a430a2e4bf1960a485a --- .../tizen-wayland/widget-application-impl-tizen.cpp | 4 ++-- dali/public-api/adaptor-framework/window.cpp | 21 ++++++++++++--------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/dali/internal/system/tizen-wayland/widget-application-impl-tizen.cpp b/dali/internal/system/tizen-wayland/widget-application-impl-tizen.cpp index 2b4b480..ff22534 100644 --- a/dali/internal/system/tizen-wayland/widget-application-impl-tizen.cpp +++ b/dali/internal/system/tizen-wayland/widget-application-impl-tizen.cpp @@ -55,9 +55,9 @@ int OnInstanceInit(widget_base_instance_h instanceHandle, bundle *content, int w } else { - if(Internal::Adaptor::Adaptor::GetImplementation(application->GetAdaptor()).IsMultipleWindowSupported()) + window = Dali::Window::New(PositionSize(0,0,w,h) ,"", false); + if( window ) { - window = Dali::Window::New(PositionSize(0,0,w,h) ,"", false); DALI_LOG_RELEASE_INFO("Widget Instance create new Window (win:%p, cnt:%d) (%dx%d) (id:%s )\n", window, application->GetWidgetCount(), w, h, std::string(id).c_str()); } else diff --git a/dali/public-api/adaptor-framework/window.cpp b/dali/public-api/adaptor-framework/window.cpp index d82b0c6..9d8c830 100644 --- a/dali/public-api/adaptor-framework/window.cpp +++ b/dali/public-api/adaptor-framework/window.cpp @@ -49,20 +49,23 @@ Window Window::New(PositionSize posSize, const std::string& name, const std::str isNewWindowAllowed = Internal::Adaptor::Adaptor::GetImplementation(adaptor).IsMultipleWindowSupported(); } - if (!isNewWindowAllowed) + if (isNewWindowAllowed) { - DALI_LOG_ERROR("This device can't support multiple windows.\n"); - } - Internal::Adaptor::Window* window = Internal::Adaptor::Window::New(posSize, name, className, isTransparent); + Internal::Adaptor::Window* window = Internal::Adaptor::Window::New(posSize, name, className, isTransparent); - Integration::SceneHolder sceneHolder = Integration::SceneHolder(window); + Integration::SceneHolder sceneHolder = Integration::SceneHolder(window); - if (isAdaptorAvailable) + if (isAdaptorAvailable) + { + Dali::Adaptor& adaptor = Internal::Adaptor::Adaptor::Get(); + Internal::Adaptor::Adaptor::GetImplementation(adaptor).AddWindow(sceneHolder, name, className, isTransparent); + } + newWindow = Window(window); + } + else { - Dali::Adaptor& adaptor = Internal::Adaptor::Adaptor::Get(); - Internal::Adaptor::Adaptor::GetImplementation(adaptor).AddWindow(sceneHolder, name, className, isTransparent); + DALI_LOG_ERROR("This device can't support multiple windows.\n"); } - newWindow = Window(window); return newWindow; } -- 2.7.4 From bfb1ff07cf3c38997281dd93b3d8d056196cc5fa Mon Sep 17 00:00:00 2001 From: Heeyong Song Date: Wed, 6 May 2020 17:23:54 +0900 Subject: [PATCH 13/16] [Tizen] Temporarily modified so that window is no null Change-Id: Ib258a798789764e9531f5cf1405c0ab74ee35ba8 --- .../tizen-wayland/widget-application-impl-tizen.cpp | 4 ++-- dali/public-api/adaptor-framework/window.cpp | 21 +++++++++------------ 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/dali/internal/system/tizen-wayland/widget-application-impl-tizen.cpp b/dali/internal/system/tizen-wayland/widget-application-impl-tizen.cpp index ff22534..2b4b480 100644 --- a/dali/internal/system/tizen-wayland/widget-application-impl-tizen.cpp +++ b/dali/internal/system/tizen-wayland/widget-application-impl-tizen.cpp @@ -55,9 +55,9 @@ int OnInstanceInit(widget_base_instance_h instanceHandle, bundle *content, int w } else { - window = Dali::Window::New(PositionSize(0,0,w,h) ,"", false); - if( window ) + if(Internal::Adaptor::Adaptor::GetImplementation(application->GetAdaptor()).IsMultipleWindowSupported()) { + window = Dali::Window::New(PositionSize(0,0,w,h) ,"", false); DALI_LOG_RELEASE_INFO("Widget Instance create new Window (win:%p, cnt:%d) (%dx%d) (id:%s )\n", window, application->GetWidgetCount(), w, h, std::string(id).c_str()); } else diff --git a/dali/public-api/adaptor-framework/window.cpp b/dali/public-api/adaptor-framework/window.cpp index 9d8c830..d82b0c6 100644 --- a/dali/public-api/adaptor-framework/window.cpp +++ b/dali/public-api/adaptor-framework/window.cpp @@ -49,23 +49,20 @@ Window Window::New(PositionSize posSize, const std::string& name, const std::str isNewWindowAllowed = Internal::Adaptor::Adaptor::GetImplementation(adaptor).IsMultipleWindowSupported(); } - if (isNewWindowAllowed) + if (!isNewWindowAllowed) { - Internal::Adaptor::Window* window = Internal::Adaptor::Window::New(posSize, name, className, isTransparent); + DALI_LOG_ERROR("This device can't support multiple windows.\n"); + } + Internal::Adaptor::Window* window = Internal::Adaptor::Window::New(posSize, name, className, isTransparent); - Integration::SceneHolder sceneHolder = Integration::SceneHolder(window); + Integration::SceneHolder sceneHolder = Integration::SceneHolder(window); - if (isAdaptorAvailable) - { - Dali::Adaptor& adaptor = Internal::Adaptor::Adaptor::Get(); - Internal::Adaptor::Adaptor::GetImplementation(adaptor).AddWindow(sceneHolder, name, className, isTransparent); - } - newWindow = Window(window); - } - else + if (isAdaptorAvailable) { - DALI_LOG_ERROR("This device can't support multiple windows.\n"); + Dali::Adaptor& adaptor = Internal::Adaptor::Adaptor::Get(); + Internal::Adaptor::Adaptor::GetImplementation(adaptor).AddWindow(sceneHolder, name, className, isTransparent); } + newWindow = Window(window); return newWindow; } -- 2.7.4 From ea546073a1ae0dd21580a8eda426793f67839ebb Mon Sep 17 00:00:00 2001 From: Heeyong Song Date: Wed, 6 May 2020 17:24:14 +0900 Subject: [PATCH 14/16] [Tizen] Add DALi Autofill implementation Change-Id: Icf538c7533848526483ce18e9d3d55a4f02b1905 --- build/tizen/CMakeLists.txt | 2 +- build/tizen/deps-check.cmake | 12 + .../devel-api/adaptor-framework/autofill-group.cpp | 89 ++++ dali/devel-api/adaptor-framework/autofill-group.h | 151 ++++++ dali/devel-api/adaptor-framework/autofill-item.cpp | 115 ++++ dali/devel-api/adaptor-framework/autofill-item.h | 210 ++++++++ .../adaptor-framework/autofill-manager.cpp | 126 +++++ .../devel-api/adaptor-framework/autofill-manager.h | 213 ++++++++ dali/devel-api/file.list | 6 + dali/internal/input/common/autofill-factory.h | 54 ++ dali/internal/input/common/autofill-group-impl.cpp | 44 ++ dali/internal/input/common/autofill-group-impl.h | 137 +++++ dali/internal/input/common/autofill-item-impl.cpp | 43 ++ dali/internal/input/common/autofill-item-impl.h | 174 ++++++ .../input/common/autofill-manager-impl.cpp | 44 ++ dali/internal/input/common/autofill-manager-impl.h | 190 +++++++ dali/internal/input/file.list | 39 +- .../tizen-wayland/autofill-factory-ecore-wl.cpp | 53 ++ .../tizen-wayland/autofill-group-impl-ecore-wl.cpp | 230 ++++++++ .../tizen-wayland/autofill-group-impl-ecore-wl.h | 150 ++++++ .../tizen-wayland/autofill-item-impl-ecore-wl.cpp | 207 +++++++ .../tizen-wayland/autofill-item-impl-ecore-wl.h | 195 +++++++ .../autofill-manager-impl-ecore-wl.cpp | 592 +++++++++++++++++++++ .../tizen-wayland/autofill-manager-impl-ecore-wl.h | 258 +++++++++ .../input/ubuntu-x11/autofill-factory-x.cpp | 54 ++ .../input/ubuntu-x11/autofill-group-impl-x.cpp | 134 +++++ .../input/ubuntu-x11/autofill-group-impl-x.h | 127 +++++ .../input/ubuntu-x11/autofill-item-impl-x.cpp | 155 ++++++ .../input/ubuntu-x11/autofill-item-impl-x.h | 171 ++++++ .../input/ubuntu-x11/autofill-manager-impl-x.cpp | 252 +++++++++ .../input/ubuntu-x11/autofill-manager-impl-x.h | 217 ++++++++ packaging/dali-adaptor.spec | 6 + 32 files changed, 4435 insertions(+), 15 deletions(-) create mode 100755 dali/devel-api/adaptor-framework/autofill-group.cpp create mode 100755 dali/devel-api/adaptor-framework/autofill-group.h create mode 100755 dali/devel-api/adaptor-framework/autofill-item.cpp create mode 100755 dali/devel-api/adaptor-framework/autofill-item.h create mode 100755 dali/devel-api/adaptor-framework/autofill-manager.cpp create mode 100755 dali/devel-api/adaptor-framework/autofill-manager.h create mode 100644 dali/internal/input/common/autofill-factory.h create mode 100755 dali/internal/input/common/autofill-group-impl.cpp create mode 100644 dali/internal/input/common/autofill-group-impl.h create mode 100755 dali/internal/input/common/autofill-item-impl.cpp create mode 100644 dali/internal/input/common/autofill-item-impl.h create mode 100755 dali/internal/input/common/autofill-manager-impl.cpp create mode 100644 dali/internal/input/common/autofill-manager-impl.h create mode 100755 dali/internal/input/tizen-wayland/autofill-factory-ecore-wl.cpp create mode 100755 dali/internal/input/tizen-wayland/autofill-group-impl-ecore-wl.cpp create mode 100644 dali/internal/input/tizen-wayland/autofill-group-impl-ecore-wl.h create mode 100755 dali/internal/input/tizen-wayland/autofill-item-impl-ecore-wl.cpp create mode 100644 dali/internal/input/tizen-wayland/autofill-item-impl-ecore-wl.h create mode 100755 dali/internal/input/tizen-wayland/autofill-manager-impl-ecore-wl.cpp create mode 100644 dali/internal/input/tizen-wayland/autofill-manager-impl-ecore-wl.h create mode 100755 dali/internal/input/ubuntu-x11/autofill-factory-x.cpp create mode 100755 dali/internal/input/ubuntu-x11/autofill-group-impl-x.cpp create mode 100644 dali/internal/input/ubuntu-x11/autofill-group-impl-x.h create mode 100755 dali/internal/input/ubuntu-x11/autofill-item-impl-x.cpp create mode 100644 dali/internal/input/ubuntu-x11/autofill-item-impl-x.h create mode 100755 dali/internal/input/ubuntu-x11/autofill-manager-impl-x.cpp create mode 100644 dali/internal/input/ubuntu-x11/autofill-manager-impl-x.h diff --git a/build/tizen/CMakeLists.txt b/build/tizen/CMakeLists.txt index 7c56a82..459a7b5 100644 --- a/build/tizen/CMakeLists.txt +++ b/build/tizen/CMakeLists.txt @@ -378,7 +378,7 @@ IF( ENABLE_LINK_TEST ) ADD_EXECUTABLE( ${LINKER_TEST_NAME} ${LINKER_TEST_SOURCES} ) MESSAGE(STATUS "libs: ${DALICORE_LDFLAGS}") TARGET_COMPILE_OPTIONS( ${LINKER_TEST_NAME} PRIVATE -I${ROOT_SRC_DIR} ${DALICORE_CFLAGS} ) - TARGET_LINK_LIBRARIES(${LINKER_TEST_NAME} ${name} ${DALICORE_LDFLAGS} ${VCONF_LDFLAGS} ${HARFBUZZ_LDFLAGS} ) + TARGET_LINK_LIBRARIES(${LINKER_TEST_NAME} ${name} ${DALICORE_LDFLAGS} ${VCONF_LDFLAGS} ${HARFBUZZ_LDFLAGS} ${AUTOFILL_LDFLAGS} ) TARGET_INCLUDE_DIRECTORIES( ${LINKER_TEST_NAME} PRIVATE ${DALI_TEST_SUITE_DIR} ) ENDIF() diff --git a/build/tizen/deps-check.cmake b/build/tizen/deps-check.cmake index b496dd9..b60bd0c 100644 --- a/build/tizen/deps-check.cmake +++ b/build/tizen/deps-check.cmake @@ -18,6 +18,9 @@ ARG_ENABLE( ENABLE_PROFILE enable_profile "${ENABLE_VAL};UBUNTU" "Select the var # Tizen Major version ARG_ENABLE( ENABLE_TIZEN_MAJOR_VERSION enable_tizen_major_version "${ENABLE_VAL};0" "Specify the Tizen Major version for backwards compatibility" ) +# Tizen Minor version +ARG_ENABLE( ENABLE_TIZEN_MINOR_VERSION enable_tizen_minor_version "${ENABLE_VAL};0" "Specify the Tizen Minor version for backwards compatibility" ) + ARG_ENABLE( ENABLE_FEEDBACK enable_feedback 1 "Enable feedback plugin" ) ARG_ENABLE( ENABLE_WAYLAND enable_wayland "${ENABLE_VAL}" "Build on Wayland" ) @@ -126,6 +129,13 @@ ENDIF() CHECK_MODULE_AND_SET( WAYLAND_EXTENSION xdg-shell-client text-client input-method-client [] ) +IF( enable_tizen_major_version GREATER 5 ) + IF( enable_tizen_minor_version GREATER 5 ) + CHECK_MODULE_AND_SET( AUTOFILL capi-ui-autofill [] ) + ADD_DEFINITIONS( -DCAPI_AUTOFILL_SUPPORT ) + ENDIF() +ENDIF() + # BUILD CONDITIONS IF( watch_available AND WEARABLE_PROFILE ) ADD_DEFINITIONS( -DAPPCORE_WATCH_AVAILABLE ) @@ -265,6 +275,8 @@ SET( DALI_LDFLAGS ${LIBCURL_LDFLAGS} ${LIBCRYPTO_LDFLAGS} ${HARFBUZZ_LDFLAGS} + ${AUTOFILL_LDFLAGS} + ${TPKP_CURL_LDFLAGS} ${UTILX_LDFLAGS} -lgif -lturbojpeg diff --git a/dali/devel-api/adaptor-framework/autofill-group.cpp b/dali/devel-api/adaptor-framework/autofill-group.cpp new file mode 100755 index 0000000..cca5b06 --- /dev/null +++ b/dali/devel-api/adaptor-framework/autofill-group.cpp @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// CLASS HEADER +#include + +// INTERNAL INCLUDES +#include + +namespace Dali +{ + +AutofillGroup::AutofillGroup() +{ +} + +AutofillGroup::AutofillGroup( Internal::Adaptor::AutofillGroup* internal ) +: BaseHandle( internal ) +{ +} + +AutofillGroup::~AutofillGroup() +{ +} + +AutofillGroup::AutofillGroup( const AutofillGroup& group ) +: BaseHandle( group ) +{ +} + +AutofillGroup& AutofillGroup::operator=( const AutofillGroup& group ) +{ + if( *this != group ) + { + BaseHandle::operator=( group ); + } + return *this; +} + +AutofillGroup AutofillGroup::DownCast( BaseHandle handle ) +{ + return AutofillGroup( dynamic_cast< Internal::Adaptor::AutofillGroup* >( handle.GetObjectPtr() ) ); +} + +const std::string& AutofillGroup::GetId() const +{ + return Internal::Adaptor::GetImplementation(*this).GetId(); +} + +void AutofillGroup::AddAutofillItem( Dali::AutofillItem item ) +{ + Internal::Adaptor::GetImplementation(*this).AddAutofillItem( item ); +} + +Dali::AutofillItem AutofillGroup::GetAutofillItem( const std::string& id ) +{ + return Internal::Adaptor::GetImplementation(*this).GetAutofillItem( id ); +} + +void AutofillGroup::SaveAutofillData() +{ + Internal::Adaptor::GetImplementation(*this).SaveAutofillData(); +} + +void AutofillGroup::RequestAuthentication() +{ + Internal::Adaptor::GetImplementation(*this).RequestAuthentication(); +} + +void AutofillGroup::SendFillRequest() +{ + Internal::Adaptor::GetImplementation(*this).SendFillRequest(); +} + +} // namespace Dali diff --git a/dali/devel-api/adaptor-framework/autofill-group.h b/dali/devel-api/adaptor-framework/autofill-group.h new file mode 100755 index 0000000..26bfe8d --- /dev/null +++ b/dali/devel-api/adaptor-framework/autofill-group.h @@ -0,0 +1,151 @@ +#ifndef DALI_AUTOFILL_GROUP_H +#define DALI_AUTOFILL_GROUP_H + +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// EXTERNAL INCLUDES +#include + +// INTERNAL INCLUDES +#include +#include + +namespace Dali +{ + +namespace Internal DALI_INTERNAL +{ +namespace Adaptor +{ +class AutofillGroup; +} +} + + +/** + * @brief The AutofillGroup class + * + * is used to group AutofillItems together. + */ +class DALI_ADAPTOR_API AutofillGroup : public BaseHandle +{ +public: + + /** + * @brief Creates an uninitialized AutofillGroup. + * + * To create AutofillGroup instance, please refer to Dali::AutofillManager::CreateAutofillGroup(). + */ + AutofillGroup(); + + /** + * @brief AutofillGroup Destructor. + */ + ~AutofillGroup(); + + /** + * @brief Copy constructor. + * + * @param[in] group AutofillGroup to copy. The copied player will point at the same implementation + */ + AutofillGroup( const AutofillGroup& group ); + + /** + * @brief Assignment operator. + * + * @param[in] group The AutofillGroup to assign from. + * @return The updated AutofillGroup. + */ + AutofillGroup& operator=( const AutofillGroup& group ); + + /** + * @brief Downcast a handle to AutofillGroup handle. + * + * If handle points to a AutofillGroup the downcast produces valid + * handle. If not the returned handle is left uninitialized. + * + * @param[in] handle Handle to an object + * @return Handle to a AutofillGroup or an uninitialized handle + */ + static AutofillGroup DownCast( BaseHandle handle ); + + /** + * @brief Equality operator. + * + * @param[in] rhs The AutofillGroup structure to test against + * @return True if AutofillGroups are equal + */ + bool operator==( const AutofillGroup& rhs ) const + { + if( &rhs == this ) + { + return true; + } + return false; + } + + /** + * @brief Gets AutofillGroup unique Id. + * + * @return AutofillGroup ID + */ + const std::string& GetId() const; + + /** + * @brief Adds AutofillItem to AutofillGroup itself in order to group. + * + * @param[in] item AutofillItem instance to be included in AutofillGroup + */ + void AddAutofillItem( Dali::AutofillItem item ); + + /** + * @brief Gets AutofillItem instance according to the id. + * + * @param[in] id AutofillItem Id to get from AutofillGroup List + * @return AutofillItem instance to match for Id + */ + Dali::AutofillItem GetAutofillItem( const std::string& id ); + + /** + * @brief Stores Autofill data in autofill group. + */ + void SaveAutofillData(); + + /** + * @brief Requests and receives autofill authentication information. + */ + void RequestAuthentication(); + + /** + * @brief Sends fill request to fill out the data. + */ + void SendFillRequest(); + +public: // Not intended for application developers + + /** + * @brief Internal constructor + */ + explicit DALI_INTERNAL AutofillGroup( Internal::Adaptor::AutofillGroup* internal ); + +}; + + +} // namespace Dali + +#endif // DALI_AUTOFILL_GROUP_H diff --git a/dali/devel-api/adaptor-framework/autofill-item.cpp b/dali/devel-api/adaptor-framework/autofill-item.cpp new file mode 100755 index 0000000..2b68534 --- /dev/null +++ b/dali/devel-api/adaptor-framework/autofill-item.cpp @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// CLASS HEADER +#include + +// INTERNAL INCLUDES +#include + +namespace Dali +{ + +AutofillItem::AutofillItem() +{ +} + +AutofillItem::AutofillItem( Internal::Adaptor::AutofillItem* internal ) +: BaseHandle( internal ) +{ +} + +AutofillItem::~AutofillItem() +{ +} + +AutofillItem::AutofillItem( const AutofillItem& item ) +: BaseHandle( item ) +{ +} + +AutofillItem& AutofillItem::operator=( const AutofillItem& item ) +{ + if( *this != item ) + { + BaseHandle::operator=( item ); + } + return *this; +} + +AutofillItem AutofillItem::DownCast( BaseHandle handle ) +{ + return AutofillItem( dynamic_cast< Internal::Adaptor::AutofillItem* >( handle.GetObjectPtr() ) ); +} + + +const std::string& AutofillItem::GetId() const +{ + return Internal::Adaptor::GetImplementation(*this).GetId(); +} + +const std::string& AutofillItem::GetLabel() const +{ + return Internal::Adaptor::GetImplementation(*this).GetLabel(); +} + +Dali::AutofillItem::Hint AutofillItem::GetHint() const +{ + return Internal::Adaptor::GetImplementation(*this).GetHint(); +} + +bool AutofillItem::IsSensitiveData() const +{ + return Internal::Adaptor::GetImplementation(*this).IsSensitiveData(); +} + +void AutofillItem::SetSaveValue( const std::string& value ) +{ + Internal::Adaptor::GetImplementation(*this).SetSaveValue( value ); +} + +const std::string& AutofillItem::GetSaveValue() const +{ + return Internal::Adaptor::GetImplementation(*this).GetSaveValue(); +} + +const std::string& AutofillItem::GetPresentationText( int index ) const +{ + return Internal::Adaptor::GetImplementation(*this).GetPresentationText( index ); +} + +const std::string& AutofillItem::GetFillValue( int index ) const +{ + return Internal::Adaptor::GetImplementation(*this).GetFillValue( index ); +} + +void AutofillItem::ClearPresentationTextList() +{ + Internal::Adaptor::GetImplementation(*this).ClearPresentationTextList(); +} + +void AutofillItem::ClearFillValueList() +{ + Internal::Adaptor::GetImplementation(*this).ClearFillValueList(); +} + +unsigned int AutofillItem::GetFillValueCount() +{ + return Internal::Adaptor::GetImplementation(*this).GetFillValueCount(); +} + +} // namespace Dali diff --git a/dali/devel-api/adaptor-framework/autofill-item.h b/dali/devel-api/adaptor-framework/autofill-item.h new file mode 100755 index 0000000..e47cb12 --- /dev/null +++ b/dali/devel-api/adaptor-framework/autofill-item.h @@ -0,0 +1,210 @@ +#ifndef DALI_AUTOFILL_ITEM_H +#define DALI_AUTOFILL_ITEM_H + +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// EXTERNAL INCLUDES +#include + +// INTERNAL INCLUDES +#include + +namespace Dali +{ + +namespace Internal DALI_INTERNAL +{ +namespace Adaptor +{ +class AutofillItem; +} +} + + +/** + * @brief The AutofillItem class + * + * is used to pass on data from the AutofillItem. + * AutofillItem includes Id, Label, Autofill Hint, and whether it is sensitive or not. + */ +class DALI_ADAPTOR_API AutofillItem : public BaseHandle +{ +public: + + /** + * @brief Enumeration for hint of the autofill item. + */ + enum class Hint + { + CREDIT_CARD_EXPIRATION_DATE, ///< Autofill hint for a credit card expiration date + CREDIT_CARD_EXPIRATION_DAY, ///< Autofill hint for a credit card expiration day + CREDIT_CARD_EXPIRATION_MONTH, ///< Autofill hint for a credit card expiration month + CREDIT_CARD_EXPIRATION_YEAR, ///< Autofill hint for a credit card expiration year + CREDIT_CARD_NUMBER, ///< Autofill hint for a credit card number + EMAIL_ADDRESS, ///< Autofill hint for an email address + NAME, ///< Autofill hint for a user's real name + PHONE, ///< Autofill hint for a phone number + POSTAL_ADDRESS, ///< Autofill hint for a postal address + POSTAL_CODE, ///< Autofill hint for a postal code + ID, ///< Autofill hint for a user's ID + PASSWORD, ///< Autofill hint for password + CREDIT_CARD_SECURITY_CODE ///< Autofill hint for a credit card security code + }; + +public: + + /** + * @brief Creates an uninitialized AutofillItem. + * + * To create AutofillItem instance, please refer to Dali::AutofillManager::CreateAutofillItem(). + */ + AutofillItem(); + + /** + * @brief AutofillItem Destructor. + */ + ~AutofillItem(); + + /** + * @brief Copy constructor. + * + * @param[in] item AutofillItem to copy. The copied player will point at the same implementation + */ + AutofillItem( const AutofillItem& item ); + + /** + * @brief Assignment operator. + * + * @param[in] item The AutofillItem to assign from. + * @return The updated AutofillItem. + */ + AutofillItem& operator=( const AutofillItem& item ); + + /** + * @brief Downcast a handle to AutofillItem handle. + * + * If handle points to a AutofillItem the downcast produces valid + * handle. If not the returned handle is left uninitialized. + * + * @param[in] handle Handle to an object + * @return Handle to a AutofillItem or an uninitialized handle + */ + static AutofillItem DownCast( BaseHandle handle ); + + /** + * @brief Equality operator. + * + * @param[in] rhs The AutofillItem structure to test against + * @return True if AutofillItems are equal + */ + bool operator==( const AutofillItem& rhs ) const + { + if( &rhs == this ) + { + return true; + } + return false; + } + + /** + * @brief Gets AutofillItem Id. + * + * @return AutofillItem Id + */ + const std::string& GetId() const; + + /** + * @brief Gets AutofillItem Label. + * + * @return AutofillItem Label + */ + const std::string& GetLabel() const; + + /** + * @brief Gets AutofillItem Hint. + * + * @return AutofillItem Hint + */ + Dali::AutofillItem::Hint GetHint() const; + + /** + * @brief Gets whether AutofillItem is sensitive data or not. + * + * @return True if the AutofillItem is sensitive. + */ + bool IsSensitiveData() const; + + /** + * @brief Sets AutofillItem value for saving. + * + * @param[in] value The value for saving + */ + void SetSaveValue( const std::string& value ); + + /** + * @brief Gets the saved value of AutofillItem. + * + * @return The saved value + */ + const std::string& GetSaveValue() const; + + /** + * @brief Gets the presentation text with a index of the list. + * + * @param index The index for the presentation text list + * @return The presentation text to show up for the fill value + */ + const std::string& GetPresentationText( int index ) const; + + /** + * @brief Gets the value to be filled with a index of the list. + * + * @param index The index for the value list + * @return The value to be filled + */ + const std::string& GetFillValue( int index ) const; + + /** + * @brief Clears the presentation text list. + */ + void ClearPresentationTextList(); + + /** + * @brief Clears the value list. + */ + void ClearFillValueList(); + + /** + * @brief Gets the number of fill value in the list. + * + * @return The number of fill value in the list + */ + unsigned int GetFillValueCount(); + +public: // Not intended for application developers + + /** + * @brief Internal constructor + */ + explicit DALI_INTERNAL AutofillItem( Internal::Adaptor::AutofillItem* internal ); + +}; + +} // namespace Dali + +#endif // DALI_AUTOFILL_ITEM_H diff --git a/dali/devel-api/adaptor-framework/autofill-manager.cpp b/dali/devel-api/adaptor-framework/autofill-manager.cpp new file mode 100755 index 0000000..4507004 --- /dev/null +++ b/dali/devel-api/adaptor-framework/autofill-manager.cpp @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// CLASS HEADER +#include + +// INTERNAL INCLUDES +#include + +namespace Dali +{ + +AutofillManager::AutofillManager() +{ +} + +AutofillManager::~AutofillManager() +{ +} + +AutofillManager AutofillManager::Get() +{ + return Internal::Adaptor::AutofillManager::Get(); +} + +AutofillManager::AutofillManager(Internal::Adaptor::AutofillManager *impl) +: BaseHandle(impl) +{ +} + +/////////////////////////////////////////////// Autofill Item and Group /////////////////////////////////////////////// + +Dali::AutofillItem AutofillManager::CreateAutofillItem( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool isSensitive ) +{ + return Internal::Adaptor::GetImplementation(*this).CreateAutofillItem( id, label, hint, isSensitive ); +} + +Dali::AutofillGroup AutofillManager::CreateAutofillGroup( const std::string& groupId ) +{ + return Internal::Adaptor::GetImplementation(*this).CreateAutofillGroup( groupId ); +} + + +/////////////////////////////////////////////// Autofill Authentication Information /////////////////////////////////////////////// + +bool AutofillManager::IsAutofillDataPresent() const +{ + return Internal::Adaptor::GetImplementation(*this).IsAutofillDataPresent(); +} + +bool AutofillManager::IsAuthenticationNeeded() const +{ + return Internal::Adaptor::GetImplementation(*this).IsAuthenticationNeeded(); +} + +const std::string& AutofillManager::GetAuthenticationServiceName() const +{ + return Internal::Adaptor::GetImplementation(*this).GetAuthenticationServiceName(); +} + +const std::string& AutofillManager::GetAuthenticationServiceMessage() const +{ + return Internal::Adaptor::GetImplementation(*this).GetAuthenticationServiceMessage(); +} + +const std::string& AutofillManager::GetAuthenticationServiceImagePath() const +{ + return Internal::Adaptor::GetImplementation(*this).GetAuthenticationServiceImagePath(); +} + +/////////////////////////////////////////////// Autofill Fill Response /////////////////////////////////////////////// + +const std::string& AutofillManager::GetFillItemId() const +{ + return Internal::Adaptor::GetImplementation(*this).GetFillItemId(); +} + +const std::string& AutofillManager::GetFillItemPresentationText() const +{ + return Internal::Adaptor::GetImplementation(*this).GetFillItemPresentationText(); +} + +const std::string& AutofillManager::GetFillItemValue() const +{ + return Internal::Adaptor::GetImplementation(*this).GetFillItemValue(); +} + +void AutofillManager::SaveAutofillData( Dali::AutofillGroup group ) +{ + Internal::Adaptor::GetImplementation(*this).SaveAutofillData( group ); +} + + +// Signals + +AutofillManager::AuthSignalType& AutofillManager::AuthenticationReceivedSignal() +{ + return Internal::Adaptor::GetImplementation(*this).AuthenticationReceivedSignal(); +} + +AutofillManager::FillSignalType& AutofillManager::FillResponseReceivedSignal() +{ + return Internal::Adaptor::GetImplementation(*this).FillResponseReceivedSignal(); +} + +AutofillManager::ListSignalType& AutofillManager::ListEventSignal() +{ + return Internal::Adaptor::GetImplementation(*this).ListEventSignal(); +} + + +} // namespace Dali diff --git a/dali/devel-api/adaptor-framework/autofill-manager.h b/dali/devel-api/adaptor-framework/autofill-manager.h new file mode 100755 index 0000000..fce0af9 --- /dev/null +++ b/dali/devel-api/adaptor-framework/autofill-manager.h @@ -0,0 +1,213 @@ +#ifndef DALI_AUTOFILL_MANAGER_H +#define DALI_AUTOFILL_MANAGER_H + +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// EXTERNAL INCLUDES +#include +#include + +// INTERNAL INCLUDES +#include +#include + +namespace Dali +{ + +namespace Internal DALI_INTERNAL +{ +namespace Adaptor +{ +class AutofillManager; +} +} + + +/** + * @brief The AutofillManager class + * + * allows the application to fill out the user data, such as email, account and address previously saved. + * Currently, Autofill is limited to text input box. Later it can be ScrollView, etc. + * + * Signals + * | %Signal Name | Method | + * |------------------------|-------------------------------------| + * | authenticationReceived | @ref AuthenticationReceivedSignal() | + * | fillResponseReceived | @ref FillResponseReceivedSignal() | + */ +class DALI_ADAPTOR_API AutofillManager : public BaseHandle +{ +public: + + + // TODO : Need to update parameter and return value according to each Signal + typedef Signal< void () > AuthSignalType; ///< Authentication Received Signal + typedef Signal< void ( AutofillItem ) > FillSignalType; ///< Fill Response Received Signal + typedef Signal< void () > ListSignalType; ///< List Event Signal for multi-group + +public: + + /** + * @brief Retrieves a handle to the instance of AutofillManager. + * + * @return A handle to the AutofillManager. + */ + static AutofillManager Get(); + + + /////////////////////////////////////////////// Autofill Item and Group /////////////////////////////////////////////// + + /** + * @brief Creates AutofillItem instance. + * + * @param[in] id A unique ID that does not always change on each launching + * @param[in] label An auxiliary means to guess heuristically what data is + * @param[in] hint The Hint - id (username), name, password, phone, credit card number, organization, and so on + * @param[in] isSensitive Whether this AutofillItem is a sensitive data or not + * @return A public handle to the newly allocated AutofillItem + */ + Dali::AutofillItem CreateAutofillItem( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool isSensitive ); + + /** + * @brief Creates AutofillGroup instance. + * + * @param[in] groupId A unique ID value of each AutofillGroup + * @return A public handle to the newly allocated AutofillGroup + */ + Dali::AutofillGroup CreateAutofillGroup( const std::string& groupId ); + + + /////////////////////////////////////////////// Autofill Authentication Information /////////////////////////////////////////////// + + /** + * @brief Gets the 'autofill data present' attribute in autofill authentication information. + * + * @return True if Autofill data is present + */ + bool IsAutofillDataPresent() const; + + /** + * @brief Gets the 'authentication needed' attribute in autofill authentication information. + * + * @return True if the authentication is needed in the current Autofill process. + */ + bool IsAuthenticationNeeded() const; + + /** + * @brief Gets the service name in autofill authentication information. + * + * @return The autofill authentication service name + */ + const std::string& GetAuthenticationServiceName() const; + + /** + * @brief Gets the service message in autofill authentication information. + * + * @return The autofill authentication service message + */ + const std::string& GetAuthenticationServiceMessage() const; + + /** + * @brief Gets the service logo image path in autofill authentication information. + * + * @return The autofill authentication service logo image path + */ + const std::string& GetAuthenticationServiceImagePath() const; + + + /////////////////////////////////////////////// Autofill Fill Response /////////////////////////////////////////////// + + /** + * @brief Gets the autofill ID in an autofill fill response item. + * + * @return The autofill fill response item ID + */ + const std::string& GetFillItemId() const; + + /** + * @brief Gets the presentation text in an autofill fill response item. + * + * @return The presentation text + */ + const std::string& GetFillItemPresentationText() const; + + /** + * @brief Gets the autofill value in an autofill fill response item. + * + * @return The autofill fill response item value + */ + const std::string& GetFillItemValue() const; + + /** + * @brief Stores the current Autofill data. + * + * @param[in] group The AutofillGroup to store the data + */ + void SaveAutofillData( Dali::AutofillGroup group ); + +public: + // Signals + /** + * @brief This is emitted when the authentication is needed and AutofillManager gets the information. + * + * @return The signal containing the received data + */ + AuthSignalType& AuthenticationReceivedSignal(); + + /** + * @brief This is emitted when AutofillManager receives the fill response. + * + * @return The signal containing the received data + */ + FillSignalType& FillResponseReceivedSignal(); + + /** + * @brief This is emitted when the list for multi fill response group is needed. + * + * @return The signal containing the received data + */ + ListSignalType& ListEventSignal(); + + // Construction & Destruction + /** + * @brief Constructor. + * + * Create an uninitialized handle. + * This can be initialized by calling AutofillManager::Get(). + */ + AutofillManager(); + + /** + * @brief Destructor + * + * This is non-virtual since derived Handle types must not contain data or virtual methods. + */ + ~AutofillManager(); + + /** + * @brief This constructor is used by AutofillManager::Get(). + * + * @param[in] autofillManager A pointer to the AutofillManager. + */ + explicit DALI_INTERNAL AutofillManager( Internal::Adaptor::AutofillManager* autofillManager ); + +}; + +} // namespace Dali + +#endif // DALI_AUTOFILL_MANAGER_H diff --git a/dali/devel-api/file.list b/dali/devel-api/file.list index 33c3ab3..41be6eb 100755 --- a/dali/devel-api/file.list +++ b/dali/devel-api/file.list @@ -3,6 +3,9 @@ SET( devel_api_src_files ${adaptor_devel_api_dir}/adaptor-framework/accessibility-adaptor.cpp ${adaptor_devel_api_dir}/adaptor-framework/application-devel.cpp + ${adaptor_devel_api_dir}/adaptor-framework/autofill-group.cpp + ${adaptor_devel_api_dir}/adaptor-framework/autofill-item.cpp + ${adaptor_devel_api_dir}/adaptor-framework/autofill-manager.cpp ${adaptor_devel_api_dir}/adaptor-framework/bitmap-saver.cpp ${adaptor_devel_api_dir}/adaptor-framework/clipboard.cpp ${adaptor_devel_api_dir}/adaptor-framework/clipboard-event-notifier.cpp @@ -44,6 +47,9 @@ SET( devel_api_adaptor_framework_header_files ${adaptor_devel_api_dir}/adaptor-framework/accessibility-gesture-event.h ${adaptor_devel_api_dir}/adaptor-framework/application-devel.h ${adaptor_devel_api_dir}/adaptor-framework/atspi-accessibility.h + ${adaptor_devel_api_dir}/adaptor-framework/autofill-group.h + ${adaptor_devel_api_dir}/adaptor-framework/autofill-item.h + ${adaptor_devel_api_dir}/adaptor-framework/autofill-manager.h ${adaptor_devel_api_dir}/adaptor-framework/bitmap-saver.h ${adaptor_devel_api_dir}/adaptor-framework/clipboard-event-notifier.h ${adaptor_devel_api_dir}/adaptor-framework/clipboard.h diff --git a/dali/internal/input/common/autofill-factory.h b/dali/internal/input/common/autofill-factory.h new file mode 100644 index 0000000..cc86821 --- /dev/null +++ b/dali/internal/input/common/autofill-factory.h @@ -0,0 +1,54 @@ +#ifndef DALI_INTERNAL_INPUT_COMMON_AUTOFILL_FACTORY_H +#define DALI_INTERNAL_INPUT_COMMON_AUTOFILL_FACTORY_H + +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// INTERNAL INCLUDES +#include +#include +#include + +namespace Dali +{ +namespace Internal +{ +namespace Adaptor +{ + +class AutofillGroup; +class AutofillItem; +class AutofillManager; + +namespace AutofillFactory +{ +// Factory function creating new AutofillGroup, AutofillItem, and AutofillManager +// Symbol exists but may be overriden during linking + + Dali::AutofillGroup CreateAutofillGroup( const std::string& groupId ); + + Dali::AutofillItem CreateAutofillItem( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool sensitiveData ); + + Dali::AutofillManager CreateAutofillManager(); + +} + +} // namespace Adaptor +} // namespace Internal +} // namespace Dali + +#endif // DALI_INTERNAL_INPUT_COMMON_AUTOFILL_FACTORY_H diff --git a/dali/internal/input/common/autofill-group-impl.cpp b/dali/internal/input/common/autofill-group-impl.cpp new file mode 100755 index 0000000..f2807e9 --- /dev/null +++ b/dali/internal/input/common/autofill-group-impl.cpp @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// CLASS HEADER +//#include + +// INTERNAL INCLUDES +#include + + +namespace Dali +{ + +namespace Internal +{ + +namespace Adaptor +{ + +Dali::AutofillGroup AutofillGroup::New( const std::string& groupId ) +{ + return Dali::Internal::Adaptor::AutofillFactory::CreateAutofillGroup( groupId ); +} + + +} // Adaptor + +} // Internal + +} // Dali diff --git a/dali/internal/input/common/autofill-group-impl.h b/dali/internal/input/common/autofill-group-impl.h new file mode 100644 index 0000000..f335c10 --- /dev/null +++ b/dali/internal/input/common/autofill-group-impl.h @@ -0,0 +1,137 @@ +#ifndef DALI_INTERNAL_AUTOFILL_GROUP_IMPL_H +#define DALI_INTERNAL_AUTOFILL_GROUP_IMPL_H + +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// EXTERNAL INCLUDES +#include + +// INTERNAL INCLUDES +#include + +namespace Dali +{ + +namespace Internal +{ + +namespace Adaptor +{ + +/** + * @brief This class is used to group AutofillItems. + */ +class AutofillGroup : public Dali::BaseObject +{ + +public: + + /** + * @brief Constructor. + * + * @param[in] groupId A unique ID value of each AutofillGroup + * @return A public handle to the newly allocated AutofillGroup. + */ + static Dali::AutofillGroup New( const std::string& groupId ); + + /** + * @brief Initialize AutofillGroup constructor. + */ + virtual void Initialize() = 0; + + /** + * @copydoc Dali::AutofillGroup::GetId() + */ + virtual const std::string& GetId() const = 0; + + /** + * @copydoc Dali::AutofillGroup::AddAutofillItem() + */ + virtual void AddAutofillItem( Dali::AutofillItem item ) = 0; + + /** + * @copydoc Dali::AutofillGroup::GetAutofillItem() + */ + virtual Dali::AutofillItem GetAutofillItem( const std::string& id ) = 0; + + /** + * @brief Clears all lists of AutofillItem added in AutofillGroup. + */ + virtual void ClearAutofillItemList() = 0; + + /** + * @copydoc Dali::AutofillGroup::SaveAutofillData() + */ + virtual void SaveAutofillData() = 0; + + /** + * @copydoc Dali::AutofillGroup::RequestAuthentication() + */ + virtual void RequestAuthentication() = 0; + + /** + * @copydoc Dali::AutofillGroup::SendFillRequest() + */ + virtual void SendFillRequest() = 0; + +public: + /** + * Constructor. + */ + AutofillGroup() = default; + +protected: + /** + * Destructor. + */ + ~AutofillGroup() = default; + +private: + // Undefined copy constructor + AutofillGroup( const AutofillGroup& autofillGroup ) = delete; + + // Undefined assignment operator + AutofillGroup& operator=( AutofillGroup& autofillGroup ) = delete; + +}; + +inline static Internal::Adaptor::AutofillGroup& GetImplementation(Dali::AutofillGroup& autofillGroup) +{ + DALI_ASSERT_ALWAYS( autofillGroup && "AutofillGroup handle is empty" ); + + BaseObject& handle = autofillGroup.GetBaseObject(); + + return static_cast(handle); +} + +inline static const Internal::Adaptor::AutofillGroup& GetImplementation(const Dali::AutofillGroup& autofillGroup) +{ + DALI_ASSERT_ALWAYS( autofillGroup && "AutofillGroup handle is empty" ); + + const BaseObject& handle = autofillGroup.GetBaseObject(); + + return static_cast(handle); +} + +} // namespace Adaptor + +} // namespace Internal + +} // namespace Dali + +#endif // DALI_INTERNAL_AUTOFILL_GROUP_IMPL_H diff --git a/dali/internal/input/common/autofill-item-impl.cpp b/dali/internal/input/common/autofill-item-impl.cpp new file mode 100755 index 0000000..eacf07e --- /dev/null +++ b/dali/internal/input/common/autofill-item-impl.cpp @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// CLASS HEADER +//#include + +// INTERNAL INCLUDES +#include + +namespace Dali +{ + +namespace Internal +{ + +namespace Adaptor +{ + +Dali::AutofillItem AutofillItem::New( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool sensitiveData ) +{ + return Dali::Internal::Adaptor::AutofillFactory::CreateAutofillItem( id, label, hint, sensitiveData ); +} + + +} // Adaptor + +} // Internal + +} // Dali diff --git a/dali/internal/input/common/autofill-item-impl.h b/dali/internal/input/common/autofill-item-impl.h new file mode 100644 index 0000000..92c5db8 --- /dev/null +++ b/dali/internal/input/common/autofill-item-impl.h @@ -0,0 +1,174 @@ +#ifndef DALI_INTERNAL_AUTOFILL_ITEM_IMPL_H +#define DALI_INTERNAL_AUTOFILL_ITEM_IMPL_H + +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// EXTERNAL INCLUDES +#include + +// INTERNAL INCLUDES +#include + +namespace Dali +{ + +namespace Internal +{ + +namespace Adaptor +{ + +/** + * @brief This class is used to pass on data from the AutofillItem of control. + */ +class AutofillItem : public Dali::BaseObject +{ + +public: + + /** + * @brief Constructor. + * + * @param[in] id A unique ID for this AutofillItem + * @param[in] label An auxiliary means to guess what data is + * @param[in] hint The hint - id (username), name, password, phone, credit card number, organization, and so on + * @param[in] sensitiveData Whether this AutofillItem is a sensitive data or not. (The default is false) + * @return A public handle to the newly allocated AutofillItem + */ + static Dali::AutofillItem New( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool sensitiveData ); + + /** + * @brief Initialize AutofillItem constructor. + */ + virtual void Initialize() = 0; + + /** + * @copydoc Dali::AutofillItem::GetId() + */ + virtual const std::string& GetId() const = 0; + + /** + * @copydoc Dali::AutofillItem::GetLabel() + */ + virtual const std::string& GetLabel() const = 0; + + /** + * @copydoc Dali::AutofillItem::GetHint() + */ + virtual Dali::AutofillItem::Hint GetHint() const = 0; + + /** + * @copydoc Dali::AutofillItem::IsSensitiveData() + */ + virtual bool IsSensitiveData() const = 0; + + /** + * @copydoc Dali::AutofillItem::SetSaveValue() + */ + virtual void SetSaveValue( const std::string& value ) = 0; + + /** + * @copydoc Dali::AutofillItem::GetSaveValue() + */ + virtual const std::string& GetSaveValue() const = 0; + + /** + * @brief Adds the presentation text to fill out in the list. + * + * @param[in] presentationText The presentation text to fill out + */ + virtual void AddPresentationList( const std::string& presentationText ) = 0; + + /** + * @brief Adds the value to fill out in the list. + * + * @param[in] fillValue The value to fill out + */ + virtual void AddFillValueList( const std::string& fillValue ) = 0; + + /** + * @copydoc Dali::AutofillItem::GetPresentationText() + */ + virtual const std::string& GetPresentationText( int index ) const = 0; + + /** + * @copydoc Dali::AutofillItem::GetFillValue() + */ + virtual const std::string& GetFillValue( int index ) const = 0; + + /** + * @copydoc Dali::AutofillItem::ClearPresentationTextList() + */ + virtual void ClearPresentationTextList() = 0; + + /** + * @copydoc Dali::AutofillItem::ClearFillValueList() + */ + virtual void ClearFillValueList() = 0; + + /** + * @copydoc Dali::AutofillItem::GetFillValueCount() + */ + virtual unsigned int GetFillValueCount() = 0; + +public: + /** + * Constructor. + */ + AutofillItem() = default; + +protected: + /** + * Destructor. + */ + ~AutofillItem() = default; + +private: + // Undefined copy constructor + AutofillItem( const AutofillItem& autofillItem ) = delete; + + // Undefined assignment operator + AutofillItem& operator=( AutofillItem& autofillItem ) = delete; + +}; + +inline static Internal::Adaptor::AutofillItem& GetImplementation(Dali::AutofillItem& autofillItem) +{ + DALI_ASSERT_ALWAYS( autofillItem && "AutofillItem handle is empty" ); + + BaseObject& handle = autofillItem.GetBaseObject(); + + return static_cast(handle); +} + +inline static const Internal::Adaptor::AutofillItem& GetImplementation(const Dali::AutofillItem& autofillItem) +{ + DALI_ASSERT_ALWAYS( autofillItem && "AutofillItem handle is empty" ); + + const BaseObject& handle = autofillItem.GetBaseObject(); + + return static_cast(handle); +} + +} // namespace Adaptor + +} // namespace Internal + +} // namespace Dali + +#endif // DALI_INTERNAL_AUTOFILL_ITEM_IMPL_H diff --git a/dali/internal/input/common/autofill-manager-impl.cpp b/dali/internal/input/common/autofill-manager-impl.cpp new file mode 100755 index 0000000..5dd466e --- /dev/null +++ b/dali/internal/input/common/autofill-manager-impl.cpp @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// CLASS HEADER +//#include + +// INTERNAL INCLUDES +#include + + +namespace Dali +{ + +namespace Internal +{ + +namespace Adaptor +{ + +Dali::AutofillManager AutofillManager::Get() +{ + return Dali::Internal::Adaptor::AutofillFactory::CreateAutofillManager(); +} + + +} // Adaptor + +} // Internal + +} // Dali diff --git a/dali/internal/input/common/autofill-manager-impl.h b/dali/internal/input/common/autofill-manager-impl.h new file mode 100644 index 0000000..48819ab --- /dev/null +++ b/dali/internal/input/common/autofill-manager-impl.h @@ -0,0 +1,190 @@ +#ifndef DALI_INTERNAL_AUTOFILL_MANAGER_IMPL_H +#define DALI_INTERNAL_AUTOFILL_MANAGER_IMPL_H + +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// EXTERNAL INCLUDES +#include + +// INTERNAL INCLUDES +#include + +namespace Dali +{ + +namespace Internal +{ + +namespace Adaptor +{ + +class AutofillManager : public Dali::BaseObject +{ + +public: + + /** + * @brief Gets the AutofillManager instance + * + * It creates the instance if it has not already been created. + * Internally, a check should be made using IsAvailable() before this is called as we do not want + * to create an instance if not needed by applications. + * @see IsAvailable() + */ + static Dali::AutofillManager Get(); + + /** + * @brief Connects Callbacks required for Autofill daemon. + */ + virtual void ConnectCallbacks() = 0; + + /** + * @copydoc Dali::AutofillManager::CreateAutofillItem() + */ + virtual Dali::AutofillItem CreateAutofillItem( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool isSensitive ) = 0; + + /** + * @copydoc Dali::AutofillManager::CreateAutofillGroup() + */ + virtual Dali::AutofillGroup CreateAutofillGroup( const std::string& groupId ) = 0; + + /** + * @copydoc Dali::AutofillManager::IsAutofillDataPresent() + */ + virtual bool IsAutofillDataPresent() const = 0; + + /** + * @copydoc Dali::AutofillManager::IsAuthenticationNeeded() + */ + virtual bool IsAuthenticationNeeded() const = 0; + + /** + * @copydoc Dali::AutofillManager::GetAuthenticationServiceName() + */ + virtual const std::string& GetAuthenticationServiceName() const = 0; + + /** + * @copydoc Dali::AutofillManager::GetAuthenticationServiceMessage() + */ + virtual const std::string& GetAuthenticationServiceMessage() const = 0; + + /** + * @copydoc Dali::AutofillManager::GetAuthenticationServiceImagePath() + */ + virtual const std::string& GetAuthenticationServiceImagePath() const = 0; + + /** + * @copydoc Dali::AutofillManager::GetFillItemId() + */ + virtual const std::string& GetFillItemId() const = 0; + + /** + * @copydoc Dali::AutofillManager::GetFillItemPresentationText() + */ + virtual const std::string& GetFillItemPresentationText() const = 0; + + /** + * @copydoc Dali::AutofillManager::GetFillItemValue() + */ + virtual const std::string& GetFillItemValue() const = 0; + + /** + * @copydoc Dali::AutofillManager::SaveAutofillData() + */ + virtual void SaveAutofillData( Dali::AutofillGroup group ) = 0; + +public: // Signals + + /** + * @copydoc Dali::AutofillManager::AuthenticationReceivedSignal() + */ + virtual Dali::AutofillManager::AuthSignalType& AuthenticationReceivedSignal() { return mAuthReceivedSignal; } + + /** + * @copydoc Dali::AutofillManager::FillResponseReceivedSignal() + */ + virtual Dali::AutofillManager::FillSignalType& FillResponseReceivedSignal() { return mFillReceivedSignal; } + + /** + * @copydoc Dali::AutofillManager::ListEventSignal() + */ + virtual Dali::AutofillManager::ListSignalType& ListEventSignal() { return mListReceivedSignal; } + +private: + /** + * Context created the first time and kept until deleted. + */ + virtual void CreateContext() = 0; + + /** + * Delete Autofill context. + */ + virtual void DeleteContext() = 0; + +public: + /** + * Constructor. + */ + AutofillManager() = default; + +protected: + /** + * Destructor. + */ + ~AutofillManager() = default; + +private: + // Undefined copy constructor + AutofillManager( const AutofillManager& autofillManager ) = delete; + + // Undefined assignment operator + AutofillManager& operator=( AutofillManager& autofillManager ) = delete; + +private: + Dali::AutofillManager::AuthSignalType mAuthReceivedSignal; ///< Authentication Received Signal + Dali::AutofillManager::FillSignalType mFillReceivedSignal; ///< Fill Response Received Signal + Dali::AutofillManager::ListSignalType mListReceivedSignal; ///< List Received Signal + + +}; + +inline static Internal::Adaptor::AutofillManager& GetImplementation(Dali::AutofillManager& autofillManager) +{ + DALI_ASSERT_ALWAYS( autofillManager && "AutofillManager handle is empty" ); + + BaseObject& handle = autofillManager.GetBaseObject(); + + return static_cast(handle); +} + +inline static const Internal::Adaptor::AutofillManager& GetImplementation(const Dali::AutofillManager& autofillManager) +{ + DALI_ASSERT_ALWAYS( autofillManager && "AutofillManager handle is empty" ); + + const BaseObject& handle = autofillManager.GetBaseObject(); + + return static_cast(handle); +} + +} // namespace Adaptor + +} // namespace Internal + +} // namespace Dali + +#endif // DALI_INTERNAL_AUTOFILL_MANAGER_IMPL_H diff --git a/dali/internal/input/file.list b/dali/internal/input/file.list index 3e447ce..c940bb7 100644 --- a/dali/internal/input/file.list +++ b/dali/internal/input/file.list @@ -1,28 +1,39 @@ # module: input, backend: common -SET( adaptor_input_common_src_files - ${adaptor_input_dir}/common/input-method-context-impl.cpp - ${adaptor_input_dir}/common/key-grab.cpp - ${adaptor_input_dir}/common/key-impl.cpp - ${adaptor_input_dir}/common/keyboard.cpp - ${adaptor_input_dir}/common/physical-keyboard-impl.cpp +SET( adaptor_input_common_src_files + ${adaptor_input_dir}/common/autofill-group-impl.cpp + ${adaptor_input_dir}/common/autofill-item-impl.cpp + ${adaptor_input_dir}/common/autofill-manager-impl.cpp + ${adaptor_input_dir}/common/input-method-context-impl.cpp + ${adaptor_input_dir}/common/key-grab.cpp + ${adaptor_input_dir}/common/key-impl.cpp + ${adaptor_input_dir}/common/keyboard.cpp + ${adaptor_input_dir}/common/physical-keyboard-impl.cpp ) # module: input, backend: tizen-wayland -SET( adaptor_input_tizen_wayland_src_files +SET( adaptor_input_tizen_wayland_src_files + ${adaptor_input_dir}/tizen-wayland/autofill-factory-ecore-wl.cpp + ${adaptor_input_dir}/tizen-wayland/autofill-group-impl-ecore-wl.cpp + ${adaptor_input_dir}/tizen-wayland/autofill-item-impl-ecore-wl.cpp + ${adaptor_input_dir}/tizen-wayland/autofill-manager-impl-ecore-wl.cpp ${adaptor_input_dir}/tizen-wayland/ecore-virtual-keyboard.cpp - ${adaptor_input_dir}/tizen-wayland/input-method-context-factory-ecore-wl.cpp - ${adaptor_input_dir}/tizen-wayland/input-method-context-impl-ecore-wl.cpp - ${adaptor_input_dir}/tizen-wayland/key-mapping-ecore-wl.cpp + ${adaptor_input_dir}/tizen-wayland/input-method-context-factory-ecore-wl.cpp + ${adaptor_input_dir}/tizen-wayland/input-method-context-impl-ecore-wl.cpp + ${adaptor_input_dir}/tizen-wayland/key-mapping-ecore-wl.cpp ${adaptor_input_dir}/tizen-wayland/virtual-keyboard-impl-ecore-wl.cpp ) # module: input, backend: ubuntu-x11 -SET( adaptor_input_ubuntu_x11_src_files +SET( adaptor_input_ubuntu_x11_src_files + ${adaptor_input_dir}/ubuntu-x11/autofill-factory-x.cpp + ${adaptor_input_dir}/ubuntu-x11/autofill-group-impl-x.cpp + ${adaptor_input_dir}/ubuntu-x11/autofill-item-impl-x.cpp + ${adaptor_input_dir}/ubuntu-x11/autofill-manager-impl-x.cpp ${adaptor_input_dir}/tizen-wayland/ecore-virtual-keyboard.cpp - ${adaptor_input_dir}/ubuntu-x11/input-method-context-factory-x.cpp - ${adaptor_input_dir}/ubuntu-x11/input-method-context-impl-x.cpp - ${adaptor_input_dir}/ubuntu-x11/key-mapping-x.cpp + ${adaptor_input_dir}/ubuntu-x11/input-method-context-factory-x.cpp + ${adaptor_input_dir}/ubuntu-x11/input-method-context-impl-x.cpp + ${adaptor_input_dir}/ubuntu-x11/key-mapping-x.cpp ${adaptor_input_dir}/ubuntu-x11/virtual-keyboard-impl-x.cpp ) diff --git a/dali/internal/input/tizen-wayland/autofill-factory-ecore-wl.cpp b/dali/internal/input/tizen-wayland/autofill-factory-ecore-wl.cpp new file mode 100755 index 0000000..4d7d912 --- /dev/null +++ b/dali/internal/input/tizen-wayland/autofill-factory-ecore-wl.cpp @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include +#include +#include +#include + +namespace Dali +{ +namespace Internal +{ +namespace Adaptor +{ + +namespace AutofillFactory +{ + +// Autofill Factory to be implemented by the platform +Dali::AutofillGroup CreateAutofillGroup( const std::string& groupId ) +{ + return Dali::Internal::Adaptor::AutofillGroupEcoreWl::New( groupId ); +} + +Dali::AutofillItem CreateAutofillItem( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool sensitiveData ) +{ + return Dali::Internal::Adaptor::AutofillItemEcorewWl::New( id, label, hint, sensitiveData ); +} + +Dali::AutofillManager CreateAutofillManager() +{ + return Dali::Internal::Adaptor::AutofillManagerEcoreWl::Get(); +} + +} + +} // namespace Adaptor +} // namespace Internal +} // namespace Dali diff --git a/dali/internal/input/tizen-wayland/autofill-group-impl-ecore-wl.cpp b/dali/internal/input/tizen-wayland/autofill-group-impl-ecore-wl.cpp new file mode 100755 index 0000000..73cbeff --- /dev/null +++ b/dali/internal/input/tizen-wayland/autofill-group-impl-ecore-wl.cpp @@ -0,0 +1,230 @@ +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// CLASS HEADER +#include + +// EXTERNAL INCLUDES +#include // for strcmp +#include +#include + +// INTERNAL INCLUDES +#include + +namespace Dali +{ + +namespace Internal +{ + +namespace Adaptor +{ + +namespace +{ +#if defined(DEBUG_ENABLED) +Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_AUTOFILL"); +#endif + +BaseHandle Create() +{ + return Dali::Internal::Adaptor::AutofillGroup::New( "" ); +} + +Dali::TypeRegistration type( typeid(Dali::AutofillGroup), typeid(Dali::BaseHandle), Create ); + +} // unnamed namespace + + +AutofillGroupEcoreWl::AutofillGroupEcoreWl( const std::string groupId ) +: mAutofillItemList(), + mGroupId( groupId ) +{ +#ifdef CAPI_AUTOFILL_SUPPORT + mAutofillGroupHandle = NULL; + mAutofillSaveGroupHandle = NULL; +#endif // CAPI_AUTOFILL_SUPPORT +} + +AutofillGroupEcoreWl::~AutofillGroupEcoreWl() +{ +#ifdef CAPI_AUTOFILL_SUPPORT + if( mAutofillGroupHandle ) + { + autofill_view_info_destroy( mAutofillGroupHandle ); + mAutofillGroupHandle = NULL; + } + if( mAutofillSaveGroupHandle ) + { + autofill_save_view_info_destroy( mAutofillSaveGroupHandle ); + mAutofillSaveGroupHandle = NULL; + } +#endif // CAPI_AUTOFILL_SUPPORT +} + + +Dali::AutofillGroup AutofillGroupEcoreWl::New( const std::string& groupId ) +{ + Dali::Internal::Adaptor::AutofillGroup* group = new Dali::Internal::Adaptor::AutofillGroupEcoreWl( groupId ); + Dali::AutofillGroup handle = Dali::AutofillGroup( group ); + group->Initialize(); + + return handle; +} + +void AutofillGroupEcoreWl::Initialize() +{ +#ifdef CAPI_AUTOFILL_SUPPORT + int ret = autofill_view_info_create( &mAutofillGroupHandle ); + if( ret != AUTOFILL_ERROR_NONE ) + { + DALI_LOG_ERROR( "Failed to create autofill group info handle : %d \n", ret ); + return; + } + + autofill_view_info_set_view_id( mAutofillGroupHandle, mGroupId.c_str() ); + +#endif // CAPI_AUTOFILL_SUPPORT +} + +const std::string& AutofillGroupEcoreWl::GetId() const +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillGroupEcoreWl::GetId \n" ); + return mGroupId; +} + +#ifdef CAPI_AUTOFILL_SUPPORT +autofill_view_info_h AutofillGroupEcoreWl::GetAutofillGroupHandle() +{ + return mAutofillGroupHandle; +} + +autofill_save_view_info_h AutofillGroupEcoreWl::GetAutofillSaveGroupHandle() +{ + return mAutofillSaveGroupHandle; +} +#endif // CAPI_AUTOFILL_SUPPORT + +void AutofillGroupEcoreWl::AddAutofillItem( Dali::AutofillItem item ) +{ +#ifdef CAPI_AUTOFILL_SUPPORT + Internal::Adaptor::AutofillItem& itemImpl = Internal::Adaptor::GetImplementation( item ); + Internal::Adaptor::AutofillItemEcorewWl& itemImplWl = static_cast( itemImpl ); + + if( mAutofillGroupHandle && itemImplWl.GetAutofillItemHandle() ) + { + autofill_view_info_add_item( mAutofillGroupHandle, itemImplWl.GetAutofillItemHandle() ); + } +#endif // CAPI_AUTOFILL_SUPPORT + + // Pushes back an AutofillItem to the ItemList of AutofillGroup. + mAutofillItemList.push_back( item ); +} + +Dali::AutofillItem AutofillGroupEcoreWl::GetAutofillItem( const std::string& id ) +{ + Dali::AutofillItem item = Dali::AutofillItem(); + for( std::vector::iterator iter = mAutofillItemList.begin(), endIter = mAutofillItemList.end(); iter != endIter; ++iter ) + { + const std::string& itemId = ( *iter ).GetId(); + + if( itemId.compare( id ) == 0 ) + { + item = ( *iter ); + } + } + return item; +} + +void AutofillGroupEcoreWl::ClearAutofillItemList() +{ + for( std::vector::iterator iter = mAutofillItemList.begin(), endIter = mAutofillItemList.end(); iter != endIter; ++iter ) + { + ( *iter ).ClearPresentationTextList(); + ( *iter ).ClearFillValueList(); + } +} + +void AutofillGroupEcoreWl::SaveAutofillData() +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillGroupEcoreWl::SaveAutofillData\n" ); +#ifdef CAPI_AUTOFILL_SUPPORT + // Creates autofill save view info handle. + autofill_save_view_info_create( &mAutofillSaveGroupHandle ); + autofill_save_view_info_set_view_id( mAutofillSaveGroupHandle, mGroupId.c_str() ); + + for( std::vector::iterator iter = mAutofillItemList.begin(), endIter = mAutofillItemList.end(); iter != endIter; ++iter ) + { + Internal::Adaptor::AutofillItem& itemImpl = Internal::Adaptor::GetImplementation( *iter ); + Internal::Adaptor::AutofillItemEcorewWl& itemImplWl = static_cast( itemImpl ); + + // Appends autofill save item in autofill save view. + autofill_save_view_info_add_item( mAutofillSaveGroupHandle, itemImplWl.GetAutofillSaveItemHandle() ); + } +#endif // CAPI_AUTOFILL_SUPPORT +} + +// If Autofill service sends authentication signal, AutofillManagerEcoreWl::ReceiveAuthInfo() would be called. +void AutofillGroupEcoreWl::RequestAuthentication() +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillGroupEcoreWl::RequestAuthentication\n" ); + +#ifdef CAPI_AUTOFILL_SUPPORT + Dali::AutofillManager manager = Dali::AutofillManager::Get(); + Internal::Adaptor::AutofillManager& managerImpl = Internal::Adaptor::GetImplementation( manager ); + Internal::Adaptor::AutofillManagerEcoreWl& managerImplWl = static_cast( managerImpl ); + + // Requests to invoke the authentication information. + // After requests of authentication, AutofillManagerEcoreWl::AuthInfoCallback would be called. + int ret = autofill_auth_info_request( managerImplWl.GetAutofillHandle(), mAutofillGroupHandle ); + if( ret != AUTOFILL_ERROR_NONE ) + { + DALI_LOG_ERROR( "Failed to request auth info. error : %d \n", ret ); + } +#endif // CAPI_AUTOFILL_SUPPORT +} + +// If Autofill service sends fill response signal, AutofillManagerEcoreWl::FillGroupItem() or +// AutofillManagerEcoreWl::FillMultipleGroupItem() would be called according to the number of group count. +void AutofillGroupEcoreWl::SendFillRequest() +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillGroupEcoreWl::SendFillRequest\n" ); + +#ifdef CAPI_AUTOFILL_SUPPORT + Dali::AutofillManager manager = Dali::AutofillManager::Get(); + Internal::Adaptor::AutofillManager& managerImpl = Internal::Adaptor::GetImplementation( manager ); + Internal::Adaptor::AutofillManagerEcoreWl& managerImplWl = static_cast( managerImpl ); + + // Removes all elements of each AutofillItem in AutofillGroup + ClearAutofillItemList(); + + // Sends fill request to fill out each input form. + // After request of fill data, AutofillManagerEcoreWl::FillResponseCallback would be called. + int ret = autofill_fill_request( managerImplWl.GetAutofillHandle(), mAutofillGroupHandle ); + if( ret != AUTOFILL_ERROR_NONE ) + { + DALI_LOG_ERROR( "Failed to request fill : %d \n", ret ); + } +#endif // CAPI_AUTOFILL_SUPPORT +} + +} // Adaptor + +} // Internal + +} // Dali diff --git a/dali/internal/input/tizen-wayland/autofill-group-impl-ecore-wl.h b/dali/internal/input/tizen-wayland/autofill-group-impl-ecore-wl.h new file mode 100644 index 0000000..0abdca3 --- /dev/null +++ b/dali/internal/input/tizen-wayland/autofill-group-impl-ecore-wl.h @@ -0,0 +1,150 @@ +#ifndef DALI_INTERNAL_AUTOFILL_GROUP_IMPL_ECORE_WL_H +#define DALI_INTERNAL_AUTOFILL_GROUP_IMPL_ECORE_WL_H + +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// EXTERNAL INCLUDES +#include +#ifdef CAPI_AUTOFILL_SUPPORT +#include +#endif // CAPI_AUTOFILL_SUPPORT +#include + +// INTERNAL INCLUDES +#include +#include + +namespace Dali +{ + +namespace Internal +{ + +namespace Adaptor +{ + + +/** + * @brief This class is used to group AutofillItems. + */ +class AutofillGroupEcoreWl : public Dali::Internal::Adaptor::AutofillGroup +{ + +public: + + /** + * @brief Constructor. + * + * @param[in] groupId A unique ID value of each AutofillGroup + * @return A public handle to the newly allocated AutofillGroup. + */ + static Dali::AutofillGroup New( const std::string& groupId ); + + /** + * @brief Initialize AutofillGroup constructor. + */ + void Initialize() override; + + /** + * @copydoc Dali::AutofillGroup::GetId() + */ + const std::string& GetId() const override; + +#ifdef CAPI_AUTOFILL_SUPPORT + /** + * @brief Gets Autofill framework group handle + * @return Autofill framework group handle, which type is 'autofill_view_info_h' + */ + autofill_view_info_h GetAutofillGroupHandle(); + + /** + * @brief Gets Autofill framework save group handle + * @return Autofill framework save group handle, which type is 'autofill_save_view_info_h' + */ + autofill_save_view_info_h GetAutofillSaveGroupHandle(); +#endif // CAPI_AUTOFILL_SUPPORT + + /** + * @copydoc Dali::AutofillGroup::AddAutofillItem() + */ + void AddAutofillItem( Dali::AutofillItem item ) override; + + /** + * @copydoc Dali::AutofillGroup::GetAutofillItem() + */ + Dali::AutofillItem GetAutofillItem( const std::string& id ) override; + + /** + * @brief Clears all lists of AutofillItem added in AutofillGroup. + */ + void ClearAutofillItemList() override; + + /** + * @copydoc Dali::AutofillGroup::SaveAutofillData() + */ + void SaveAutofillData() override; + + /** + * @copydoc Dali::AutofillGroup::RequestAuthentication() + */ + void RequestAuthentication() override; + + /** + * @copydoc Dali::AutofillGroup::SendFillRequest() + */ + void SendFillRequest() override; + +private: + /** + * Constructor. + */ + explicit AutofillGroupEcoreWl( const std::string groupId ); + +protected: + /** + * Destructor. + */ + ~AutofillGroupEcoreWl(); + +private: + // Undefined copy constructor + explicit AutofillGroupEcoreWl( const AutofillGroupEcoreWl& autofillGroup ) = delete; + + // Undefined assignment operator + AutofillGroupEcoreWl& operator=( AutofillGroupEcoreWl& autofillGroup ) = delete; + + +private: +#ifdef CAPI_AUTOFILL_SUPPORT + autofill_view_info_h mAutofillGroupHandle; ///< The Autofill Framework group handle + autofill_save_view_info_h mAutofillSaveGroupHandle; +#endif // CAPI_AUTOFILL_SUPPORT + + std::vector mAutofillItemList; ///< The List to add AutofillItem + std::string mGroupId; ///< The AutofillGroup ID + +}; + + +} // namespace Adaptor + +} // namespace Internal + +} // namespace Dali + +#endif // DALI_INTERNAL_AUTOFILL_GROUP_IMPL_ECORE_WL_H diff --git a/dali/internal/input/tizen-wayland/autofill-item-impl-ecore-wl.cpp b/dali/internal/input/tizen-wayland/autofill-item-impl-ecore-wl.cpp new file mode 100755 index 0000000..146f9cc --- /dev/null +++ b/dali/internal/input/tizen-wayland/autofill-item-impl-ecore-wl.cpp @@ -0,0 +1,207 @@ +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// CLASS HEADER +#include + +// EXTERNAL INCLUDES +#include +#include + +namespace Dali +{ + +namespace Internal +{ + +namespace Adaptor +{ + +namespace +{ +#if defined(DEBUG_ENABLED) +Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_AUTOFILL"); +#endif + +BaseHandle Create() +{ + return Dali::Internal::Adaptor::AutofillItem::New( "", "", Dali::AutofillItem::Hint::ID, false ); +} + +Dali::TypeRegistration type( typeid(Dali::AutofillItem), typeid(Dali::BaseHandle), Create ); + +} // unnamed namespace + + +AutofillItemEcorewWl::AutofillItemEcorewWl( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool sensitiveData ) +: mId( id ), + mLabel( label ), + mHint( hint ), + mSensitiveData( sensitiveData ), + mValue(""), + mPresentationTextList(), + mValueList() +{ +#ifdef CAPI_AUTOFILL_SUPPORT + mAutofillItemHandle = NULL; + mAutofillSaveItemHandle = NULL; +#endif // CAPI_AUTOFILL_SUPPORT +} + +AutofillItemEcorewWl::~AutofillItemEcorewWl() +{ +#ifdef CAPI_AUTOFILL_SUPPORT + if( mAutofillItemHandle ) + { + autofill_item_destroy( mAutofillItemHandle ); + mAutofillItemHandle = NULL; + } + + if( mAutofillSaveItemHandle ) + { + autofill_save_item_destroy( mAutofillSaveItemHandle ); + mAutofillSaveItemHandle = NULL; + } +#endif // CAPI_AUTOFILL_SUPPORT +} + + +Dali::AutofillItem AutofillItemEcorewWl::New( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool sensitiveData ) +{ + Dali::Internal::Adaptor::AutofillItem* item = new Dali::Internal::Adaptor::AutofillItemEcorewWl( id, label, hint, sensitiveData ); + Dali::AutofillItem handle = Dali::AutofillItem( item ); + item->Initialize(); + + return handle; +} + +void AutofillItemEcorewWl::Initialize() +{ +#ifdef CAPI_AUTOFILL_SUPPORT + int ret = autofill_item_create( &mAutofillItemHandle ); + if( ret != AUTOFILL_ERROR_NONE ) + { + DALI_LOG_ERROR( "Failed to create autofill item handle : %d \n", ret ); + return; + } + + autofill_item_set_id( mAutofillItemHandle, mId.c_str() ); + autofill_item_set_label( mAutofillItemHandle, mLabel.c_str() ); + autofill_item_set_sensitive_data( mAutofillItemHandle, mSensitiveData ); + + // Create autofill save item handle for save. + autofill_save_item_create( &mAutofillSaveItemHandle ); + autofill_save_item_set_id( mAutofillSaveItemHandle, mId.c_str() ); + autofill_save_item_set_label( mAutofillSaveItemHandle, mLabel.c_str() ); + autofill_save_item_set_sensitive_data( mAutofillSaveItemHandle, mSensitiveData ); + + autofill_hint_e value = static_cast(mHint); + autofill_item_set_autofill_hint( mAutofillItemHandle, value ); + autofill_save_item_set_autofill_hint( mAutofillSaveItemHandle, value); +#endif // CAPI_AUTOFILL_SUPPORT +} + +const std::string& AutofillItemEcorewWl::GetId() const +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillItemEcorewWl::GetId \n" ); + return mId; +} + +const std::string& AutofillItemEcorewWl::GetLabel() const +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillItemEcorewWl::GetLabel \n" ); + return mLabel; +} + + +Dali::AutofillItem::Hint AutofillItemEcorewWl::GetHint() const +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillItemEcorewWl::GetHint \n" ); + return mHint; +} + +bool AutofillItemEcorewWl::IsSensitiveData() const +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillItemEcorewWl::IsSensitiveData \n" ); + return mSensitiveData; +} + +void AutofillItemEcorewWl::SetSaveValue( const std::string& value ) +{ + mValue = value; +#ifdef CAPI_AUTOFILL_SUPPORT + autofill_save_item_set_value( mAutofillSaveItemHandle, mValue.c_str() ); +#endif // CAPI_AUTOFILL_SUPPORT +} + +const std::string& AutofillItemEcorewWl::GetSaveValue() const +{ + return mValue; +} + +#ifdef CAPI_AUTOFILL_SUPPORT +autofill_item_h AutofillItemEcorewWl::GetAutofillItemHandle() +{ + return mAutofillItemHandle; +} + +autofill_save_item_h AutofillItemEcorewWl::GetAutofillSaveItemHandle() +{ + return mAutofillSaveItemHandle; +} +#endif // CAPI_AUTOFILL_SUPPORT + +void AutofillItemEcorewWl::AddPresentationList( const std::string& presentationText ) +{ + mPresentationTextList.push_back( presentationText ); +} + +void AutofillItemEcorewWl::AddFillValueList( const std::string& fillValue ) +{ + mValueList.push_back( fillValue ); +} + +const std::string& AutofillItemEcorewWl::GetPresentationText( int index ) const +{ + return mPresentationTextList[index]; +} + +const std::string& AutofillItemEcorewWl::GetFillValue( int index ) const +{ + return mValueList[index]; +} + +void AutofillItemEcorewWl::ClearPresentationTextList() +{ + mPresentationTextList.clear(); +} + +void AutofillItemEcorewWl::ClearFillValueList() +{ + mValueList.clear(); +} + +unsigned int AutofillItemEcorewWl::GetFillValueCount() +{ + return mValueList.size(); +} + +} // Adaptor + +} // Internal + +} // Dali diff --git a/dali/internal/input/tizen-wayland/autofill-item-impl-ecore-wl.h b/dali/internal/input/tizen-wayland/autofill-item-impl-ecore-wl.h new file mode 100644 index 0000000..2fbbd6b --- /dev/null +++ b/dali/internal/input/tizen-wayland/autofill-item-impl-ecore-wl.h @@ -0,0 +1,195 @@ +#ifndef DALI_INTERNAL_AUTOFILL_ITEM_IMPL_ECORE_WL_H +#define DALI_INTERNAL_AUTOFILL_ITEM_IMPL_ECORE_WL_H + +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// EXTERNAL INCLUDES +#include +#ifdef CAPI_AUTOFILL_SUPPORT +#include +#endif // CAPI_AUTOFILL_SUPPORT +#include + +// INTERNAL INCLUDES +#include + +namespace Dali +{ + +namespace Internal +{ + +namespace Adaptor +{ + + +/** + * @brief This class is used to pass on data from the AutofillItem of control. + */ +class AutofillItemEcorewWl : public Dali::Internal::Adaptor::AutofillItem +{ + +public: + + /** + * @brief Constructor. + * + * @param[in] id A unique ID for this AutofillItem + * @param[in] label An auxiliary means to guess what data is + * @param[in] hint The hint - id (username), name, password, phone, credit card number, organization, and so on + * @param[in] sensitiveData Whether this AutofillItem is a sensitive data or not. (The default is false) + * @return A public handle to the newly allocated AutofillItem + */ + static Dali::AutofillItem New( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool sensitiveData ); + + /** + * @brief Initialize AutofillItem constructor. + */ + void Initialize() override; + + /** + * @copydoc Dali::AutofillItem::GetId() + */ + const std::string& GetId() const override; + + /** + * @copydoc Dali::AutofillItem::GetLabel() + */ + const std::string& GetLabel() const override; + + /** + * @copydoc Dali::AutofillItem::GetHint() + */ + Dali::AutofillItem::Hint GetHint() const override; + + /** + * @copydoc Dali::AutofillItem::IsSensitiveData() + */ + bool IsSensitiveData() const override; + + /** + * @copydoc Dali::AutofillItem::SetSaveValue() + */ + void SetSaveValue( const std::string& value ) override; + + /** + * @copydoc Dali::AutofillItem::GetSaveValue() + */ + const std::string& GetSaveValue() const override; + +#ifdef CAPI_AUTOFILL_SUPPORT + /** + * @brief Gets Autofill framework item handle + * @return Autofill framework item handle, which type is 'autofill_item_h' + */ + autofill_item_h GetAutofillItemHandle(); + + /** + * @brief Gets Autofill framework save item handle + * @return Autofill framework save item handle, which type is 'autofill_save_item_h' + */ + autofill_save_item_h GetAutofillSaveItemHandle(); +#endif // CAPI_AUTOFILL_SUPPORT + + /** + * @brief Adds the presentation text to fill out in the list. + * + * @param[in] presentationText The presentation text to fill out + */ + void AddPresentationList( const std::string& presentationText ) override; + + /** + * @brief Adds the value to fill out in the list. + * + * @param[in] fillValue The value to fill out + */ + void AddFillValueList( const std::string& fillValue ) override; + + /** + * @copydoc Dali::AutofillItem::GetPresentationText() + */ + const std::string& GetPresentationText( int index ) const override; + + /** + * @copydoc Dali::AutofillItem::GetFillValue() + */ + const std::string& GetFillValue( int index ) const override; + + /** + * @copydoc Dali::AutofillItem::ClearPresentationTextList() + */ + void ClearPresentationTextList() override; + + /** + * @copydoc Dali::AutofillItem::ClearFillValueList() + */ + void ClearFillValueList() override; + + /** + * @copydoc Dali::AutofillItem::GetFillValueCount() + */ + unsigned int GetFillValueCount() override; + +private: + /** + * Constructor. + */ + explicit AutofillItemEcorewWl( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool sensitiveData ); + +protected: + /** + * Destructor. + */ + ~AutofillItemEcorewWl(); + +private: + // Undefined copy constructor + explicit AutofillItemEcorewWl( const AutofillItemEcorewWl& autofillItem ) = delete; + + // Undefined assignment operator + AutofillItemEcorewWl& operator=( AutofillItemEcorewWl& autofillItem ) = delete; + +private: +#ifdef CAPI_AUTOFILL_SUPPORT + autofill_item_h mAutofillItemHandle; ///< The Autofill Framework item handle + autofill_save_item_h mAutofillSaveItemHandle; ///< The Autofill Framework save item handle for save +#endif // CAPI_AUTOFILL_SUPPORT + +// Data +private: + std::string mId; ///< The AutofillItem ID + std::string mLabel; ///< The AutofillItem Label + Dali::AutofillItem::Hint mHint; ///< The AutofillItem Hint (id (username), name, password, phone, credit card number, organization, so on) + bool mSensitiveData; ///< Whether the data is sensitive or not + + std::string mValue; + + std::vector mPresentationTextList; ///< The list for the presentation text to fill out + std::vector mValueList; ///< The list for the value to fill out + +}; + + + +} // namespace Adaptor + +} // namespace Internal + +} // namespace Dali + +#endif // DALI_INTERNAL_AUTOFILL_ITEM_IMPL_ECORE_WL_H diff --git a/dali/internal/input/tizen-wayland/autofill-manager-impl-ecore-wl.cpp b/dali/internal/input/tizen-wayland/autofill-manager-impl-ecore-wl.cpp new file mode 100755 index 0000000..79e0613 --- /dev/null +++ b/dali/internal/input/tizen-wayland/autofill-manager-impl-ecore-wl.cpp @@ -0,0 +1,592 @@ +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// CLASS HEADER +#include + +// EXTERNAL INCLUDES +#include +#include +#include + +// INTERNAL INCLUDES +#include + + +namespace Dali +{ + +namespace Internal +{ + +namespace Adaptor +{ + +namespace +{ +#if defined(DEBUG_ENABLED) +Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_AUTOFILL"); +#endif + +// Signals +const char* const SIGNAL_AUTHENTICATION_RECEIVED = "authenticationReceived"; +const char* const SIGNAL_FILL_RESPONSE_RECEIVED = "fillResponseReceived"; +const char* const SIGNAL_LIST_RECEIVED = "listReceived"; + + +#ifdef CAPI_AUTOFILL_SUPPORT + +// All methods in this range are Static function calls used by ecore 'c' style callback registration +static void ConnectionStatusChangedCallback( autofill_h autofillHandle, autofill_connection_status_e status, void *user_data ) +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillManagerEcoreWl::ConnectionStatusChangedCallback mAutofillHandle : %p \n", autofillHandle ); + + switch( status ) + { + case AUTOFILL_CONNECTION_STATUS_CONNECTED: + { + DALI_LOG_INFO( gLogFilter, Debug::General, "Autofill Connected.\n" ); + break; + } + case AUTOFILL_CONNECTION_STATUS_DISCONNECTED: + { + DALI_LOG_INFO( gLogFilter, Debug::General, "Autofill Disconnected.\n" ); + break; + } + case AUTOFILL_CONNECTION_STATUS_REJECTED: + { + DALI_LOG_INFO( gLogFilter, Debug::General, "Autofill Rejected.\n" ); + break; + } + default: + { + // Do nothing + break; + } + } +} + +// Callback to receive the authentication information. +static void AuthInfoCallback( autofill_h ah, autofill_auth_info_h authInfoHandle, void *data ) +{ + Dali::AutofillManager autofill = AutofillManager::Get(); + Internal::Adaptor::AutofillManager& autofillImpl = Internal::Adaptor::GetImplementation( autofill ); + Internal::Adaptor::AutofillManagerEcoreWl& autofillImplWl = static_cast( autofillImpl ); + autofillImplWl.ReceiveAuthInfo( authInfoHandle, data ); +} + +// If there's an only one fill response group, then this callback is called. +static bool FillResponseItemCallback( autofill_fill_response_item_h itemHandle, void *userData ) +{ + Dali::AutofillManager autofill = AutofillManager::Get(); + Internal::Adaptor::AutofillManager& autofillImpl = Internal::Adaptor::GetImplementation( autofill ); + Internal::Adaptor::AutofillManagerEcoreWl& autofillImplWl = static_cast( autofillImpl ); + autofillImplWl.FillGroupItem( itemHandle, userData ); // Implementation here + return true; +} + +// If the fill response groups are multiple, then this callback is called. +static bool FillResponseMultipleItemCallback( autofill_fill_response_item_h itemHandle, void *userData ) +{ + Dali::AutofillManager autofill = AutofillManager::Get(); + Internal::Adaptor::AutofillManager& autofillImpl = Internal::Adaptor::GetImplementation( autofill ); + Internal::Adaptor::AutofillManagerEcoreWl& autofillImplWl = static_cast( autofillImpl ); + autofillImplWl.FillMultipleGroupItem( itemHandle, userData ); // Implementation here + return true; +} + +// This callback is called according to the number of pairs to fill out. +static bool FillResponseGroupCallback( autofill_fill_response_group_h groupHandle, void *userData ) +{ + int* count = static_cast(userData); + + // According to the number of group count, Retrieves all fill response items of each fill response group. + if( *count == 1 ) + { + autofill_fill_response_group_foreach_item( groupHandle, FillResponseItemCallback, NULL ); + } + else if( *count > 1 ) + { + autofill_fill_response_group_foreach_item( groupHandle, FillResponseMultipleItemCallback, groupHandle ); + } + + return true; +} + +// Callback to receive autofill fill response. +static void FillResponseCallback( autofill_h autofillHandle, autofill_fill_response_h fillResponseHandle, void *data ) +{ + if( !fillResponseHandle ) + { + DALI_LOG_ERROR("Fill response handle is empty. \n"); + return; + } + + // Get fill response group count + int count = 0; + autofill_fill_response_get_group_count( fillResponseHandle, &count ); + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillManagerEcoreWl::FillResponseCallback group count : %d \n", count ); + + // Retrieves all groups of each fill response. + autofill_fill_response_foreach_group( fillResponseHandle, FillResponseGroupCallback, &count ); + + if( count > 1 ) + { + // Emits the signal to make a list of multiple data. + Dali::AutofillManager autofill = AutofillManager::Get(); + autofill.ListEventSignal().Emit(); + } +} +#endif // CAPI_AUTOFILL_SUPPORT + +BaseHandle Create() +{ + return Dali::AutofillManager::Get(); +} + +Dali::TypeRegistration typeRegistration( typeid(Dali::AutofillManager), typeid(Dali::BaseHandle), Create ); + +Dali::SignalConnectorType signalConnector1( typeRegistration, SIGNAL_AUTHENTICATION_RECEIVED, Dali::Internal::Adaptor::AutofillManagerEcoreWl::DoConnectSignal ); +Dali::SignalConnectorType signalConnector2( typeRegistration, SIGNAL_FILL_RESPONSE_RECEIVED, Dali::Internal::Adaptor::AutofillManagerEcoreWl::DoConnectSignal ); +Dali::SignalConnectorType signalConnector3( typeRegistration, SIGNAL_LIST_RECEIVED, Dali::Internal::Adaptor::AutofillManagerEcoreWl::DoConnectSignal ); + +} // unnamed namespace + + + +Dali::AutofillManager AutofillManagerEcoreWl::Get() +{ + Dali::AutofillManager autofill; + AutofillManagerEcoreWl *autofillPtr = NULL; + + Dali::SingletonService service( SingletonService::Get() ); + if( service ) + { + // Check whether the singleton is already created + Dali::BaseHandle handle = service.GetSingleton( typeid( Dali::AutofillManager ) ); + if( handle ) + { + // If so, downcast the handle + autofillPtr = dynamic_cast< AutofillManagerEcoreWl* >( handle.GetObjectPtr() ); + autofill = Dali::AutofillManager( autofillPtr ); + } + else if( Adaptor::IsAvailable() ) + { + // Create instance and register singleton only if the adaptor is available + autofillPtr = new AutofillManagerEcoreWl(); + autofill = Dali::AutofillManager( autofillPtr ); + service.Register( typeid( autofill ), autofill ); + + // Connect Autofill daemon at the first time + autofillPtr->CreateContext(); + autofillPtr->ConnectCallbacks(); + } + } + + return autofill; +} + +AutofillManagerEcoreWl::AutofillManagerEcoreWl() +: mAutofillGroup(), + mAuthenticationServiceName(""), + mAuthenticationServiceMessage(""), + mAuthenticationServiceImagePath(""), + mFillItemId(""), + mFillItemPresentationText(""), + mFillItemValue(""), + mIsDataPresent( false ), + mIsAuthNeeded( false ) +{ +#ifdef CAPI_AUTOFILL_SUPPORT + mAutofillHandle = NULL; +#endif // CAPI_AUTOFILL_SUPPORT +} + +AutofillManagerEcoreWl::~AutofillManagerEcoreWl() +{ + DeleteContext(); +} + +void AutofillManagerEcoreWl::CreateContext() +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillManagerEcoreWl::CreateContext\n" ); + +#ifdef CAPI_AUTOFILL_SUPPORT + int ret = autofill_create( &mAutofillHandle ); + if( ret != AUTOFILL_ERROR_NONE ) + { + DALI_LOG_ERROR( "Failed to create autofill handle : %d \n", ret ); + } +#endif // CAPI_AUTOFILL_SUPPORT +} + +void AutofillManagerEcoreWl::DeleteContext() +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillManagerEcoreWl::DeleteContext\n" ); +#ifdef CAPI_AUTOFILL_SUPPORT + if( mAutofillHandle ) + { + // Unsets the callback to receive the authentication information. + autofill_auth_info_unset_received_cb( mAutofillHandle ); + + autofill_destroy( mAutofillHandle ); + mAutofillHandle = NULL; + } +#endif // CAPI_AUTOFILL_SUPPORT +} + +// Callbacks for connecting to autofill daemon. +void AutofillManagerEcoreWl::ConnectCallbacks() +{ +#ifdef CAPI_AUTOFILL_SUPPORT + if( mAutofillHandle ) + { + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillManagerEcoreWl::ConnectCallbacks\n" ); + + int ret = autofill_connect( mAutofillHandle, ConnectionStatusChangedCallback, NULL ); + if( ret != AUTOFILL_ERROR_NONE ) + { + DALI_LOG_ERROR( "Failed to connect : %d \n", ret ); + } + + // Sets the callback to receive the authentication information. + autofill_auth_info_set_received_cb( mAutofillHandle, AuthInfoCallback, NULL ); + + // Sets the callback to receive autofill fill response. + autofill_fill_response_set_received_cb( mAutofillHandle, FillResponseCallback, NULL ); + } +#endif // CAPI_AUTOFILL_SUPPORT +} + + +/////////////////////////////////////////////// Autofill Callback implementation /////////////////////////////////////////////// + +#ifdef CAPI_AUTOFILL_SUPPORT + +autofill_h AutofillManagerEcoreWl::GetAutofillHandle() +{ + return mAutofillHandle; +} + +// Implementation to receive the authentication information. +void AutofillManagerEcoreWl::ReceiveAuthInfo( autofill_auth_info_h authInfoHandle, void *data ) +{ + bool autofillDataPresent = false; + bool authenticationNeeded = false; + char* serviceName = NULL; + char* serviceMessage = NULL; + char* serviceLogoImagePath = NULL; + char* groupId = NULL; + + // Gets the authentication information which is set by Autofill Service framework. + autofill_auth_info_get_view_id( authInfoHandle, &groupId ); + autofill_auth_info_get_autofill_data_present( authInfoHandle, &autofillDataPresent ); + autofill_auth_info_get_authentication_needed( authInfoHandle, &authenticationNeeded ); + + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillManagerEcoreWl::ReceiveAuthInfo group id : %s, Is autofill data present ? : %s, Is authentication needed ? : %s \n", + groupId, autofillDataPresent ? "true" : "false", authenticationNeeded ? "true" : "false" ); + + for( std::vector::iterator iter = mAutofillGroupList.begin(), endIter = mAutofillGroupList.end(); iter != endIter; ++iter ) + { + const std::string id = ( *iter ).GetId(); + if( id.compare( groupId ) == 0 ) + { + mAutofillGroup = ( *iter ); + break; + } + } + // Sets the 'autofill data present' and 'authentication needed' attributes in autofill authentication information. + mIsDataPresent = autofillDataPresent; + mIsAuthNeeded = authenticationNeeded; + + if( groupId ) + { + free( groupId ); + } + + if( !autofillDataPresent ) + { + DALI_LOG_ERROR( " -> The autofill data is not present now. \n" ); + return; + } + + // If autofill authentication is needed, get authentication service information and set to DALi member variables. + if( authenticationNeeded ) + { + // Gets the authentication service information which is set by Autofill Service framework. + autofill_auth_info_get_service_name( authInfoHandle, &serviceName ); + autofill_auth_info_get_service_message( authInfoHandle, &serviceMessage ); + autofill_auth_info_get_service_logo_image_path( authInfoHandle, &serviceLogoImagePath ); + + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillManagerEcoreWl::ReceiveAuthInfo service name : %s, logo path : %s, message : '%s' \n", + serviceName, serviceLogoImagePath, serviceMessage ); + + // Sets the authentication service information in order to use in other components. + mAuthenticationServiceName = serviceName; + mAuthenticationServiceMessage = serviceMessage; + mAuthenticationServiceImagePath = serviceLogoImagePath; + + // Emits the signal to receive the authentication information. + mAuthReceivedSignal.Emit(); + + if( serviceMessage ) + { + free( serviceMessage ); + } + + if( serviceName ) + { + free( serviceName ); + } + + if( serviceLogoImagePath ) + { + free( serviceLogoImagePath ); + } + } + else + { + // If Authentication is not needed, sends fill request directly to fill the data. + mAutofillGroup.SendFillRequest(); + } +} + +// Implementation to fill out the data +void AutofillManagerEcoreWl::FillGroupItem( autofill_fill_response_item_h itemHandle, void *userData ) +{ + char* id = NULL; + char* value = NULL; + char* presentationText = NULL; + + // Gets the fill response information which is set by Autofill Service framework. + autofill_fill_response_item_get_id( itemHandle, &id ); + autofill_fill_response_item_get_presentation_text( itemHandle, &presentationText ); + autofill_fill_response_item_get_value( itemHandle, &value ); + + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillManagerEcoreWl::FillResponseItemCallback item id : %s, value : %s, presentation text : %s\n", + id, value, presentationText ); + + // Sets the fill response information in order to use in other components. + mFillItemId = id; + mFillItemPresentationText = presentationText; + mFillItemValue = value; + + Dali::AutofillItem item = mAutofillGroup.GetAutofillItem( id ); + Internal::Adaptor::AutofillItem& itemImpl = Internal::Adaptor::GetImplementation( item ); + itemImpl.AddPresentationList( presentationText ); + itemImpl.AddFillValueList( value ); + + // Emits the signal to fill the data in text input field. + mFillReceivedSignal.Emit( item ); + + if( id ) + { + free( id ); + } + + if( value ) + { + free( value ); + } + + if( presentationText ) + { + free( presentationText ); + } + +} + +// Implementation to fill out the data when the group count is more than one. +void AutofillManagerEcoreWl::FillMultipleGroupItem( autofill_fill_response_item_h itemHandle, void *userData ) +{ + char* id = NULL; + char* value = NULL; + char* presentationText = NULL; + + // Gets the fill response information which is set by Autofill Service framework. + autofill_fill_response_item_get_id( itemHandle, &id ); + autofill_fill_response_item_get_presentation_text( itemHandle, &presentationText ); + autofill_fill_response_item_get_value( itemHandle, &value ); + + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillManagerEcoreWl::FillResponseMultipleItemCallback item id : %s, value : %s, presentation text : %s\n", + id, value, presentationText ); + + // Sets the fill response information in order to use in other components. + mFillItemId = id; + mFillItemPresentationText = presentationText; + mFillItemValue = value; + + Dali::AutofillItem item = mAutofillGroup.GetAutofillItem( id ); + Internal::Adaptor::AutofillItem& itemImpl = Internal::Adaptor::GetImplementation( item ); + itemImpl.AddPresentationList( presentationText ); + itemImpl.AddFillValueList( value ); + + if( id ) + { + free( id ); + } + + if( value ) + { + free( value ); + } + + if( presentationText ) + { + free( presentationText ); + } +} +#endif // CAPI_AUTOFILL_SUPPORT + + +/////////////////////////////////////////////// Autofill Item and Group /////////////////////////////////////////////// + +Dali::AutofillItem AutofillManagerEcoreWl::CreateAutofillItem( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool isSensitive ) +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillManagerEcoreWl::CreateAutofillItem \n" ); + + Dali::AutofillItem item = AutofillItem::New( id, label, hint, isSensitive ); + mAutofillItemList.push_back( item ); + + return mAutofillItemList.back(); +} + +Dali::AutofillGroup AutofillManagerEcoreWl::CreateAutofillGroup( const std::string& groupId ) +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillManagerEcoreWl::CreateAutofillGroup \n" ); + + Dali::AutofillGroup group = AutofillGroup::New( groupId ); + mAutofillGroupList.push_back( group ); + + return mAutofillGroupList.back(); +} + + +/////////////////////////////////////////////// Autofill Authentication Information /////////////////////////////////////////////// + +bool AutofillManagerEcoreWl::IsAutofillDataPresent() const +{ + return mIsDataPresent; +} + +bool AutofillManagerEcoreWl::IsAuthenticationNeeded() const +{ + return mIsAuthNeeded; +} + +const std::string& AutofillManagerEcoreWl::GetAuthenticationServiceName() const +{ + return mAuthenticationServiceName; +} + +const std::string& AutofillManagerEcoreWl::GetAuthenticationServiceMessage() const +{ + return mAuthenticationServiceMessage; +} + +const std::string& AutofillManagerEcoreWl::GetAuthenticationServiceImagePath() const +{ + return mAuthenticationServiceImagePath; +} + + +/////////////////////////////////////////////// Autofill Fill Response /////////////////////////////////////////////// + +const std::string& AutofillManagerEcoreWl::GetFillItemId() const +{ + return mFillItemId; +} + +const std::string& AutofillManagerEcoreWl::GetFillItemPresentationText() const +{ + return mFillItemPresentationText; +} + +const std::string& AutofillManagerEcoreWl::GetFillItemValue() const +{ + return mFillItemValue; +} + +void AutofillManagerEcoreWl::SaveAutofillData( Dali::AutofillGroup group ) +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillManagerEcoreWl::SaveAutofillData -> Sends request to store data. \n" ); + +#ifdef CAPI_AUTOFILL_SUPPORT + Internal::Adaptor::AutofillGroup& groupImpl = Internal::Adaptor::GetImplementation( group ); + Internal::Adaptor::AutofillGroupEcoreWl& groupImplWl = static_cast( groupImpl ); + + // Sends request to save autofill data. + int ret = autofill_commit( mAutofillHandle, groupImplWl.GetAutofillSaveGroupHandle() ); + if( ret != AUTOFILL_ERROR_NONE ) + { + DALI_LOG_ERROR( "Failed to request auth info. error : %d \n", ret ); + } +#endif // CAPI_AUTOFILL_SUPPORT +} + +// Signals +AutofillManagerEcoreWl::AuthSignalType& AutofillManagerEcoreWl::AuthenticationReceivedSignal() +{ + return mAuthReceivedSignal; +} + +AutofillManagerEcoreWl::FillSignalType& AutofillManagerEcoreWl::FillResponseReceivedSignal() +{ + return mFillReceivedSignal; +} + +AutofillManagerEcoreWl::ListSignalType& AutofillManagerEcoreWl::ListEventSignal() +{ + return mListReceivedSignal; +} + +bool AutofillManagerEcoreWl::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor ) +{ + Dali::BaseHandle handle( object ); + + bool connected( true ); + AutofillManagerEcoreWl* manager = dynamic_cast< AutofillManagerEcoreWl* >( object ); + + if( manager ) + { + if( 0 == signalName.compare( SIGNAL_AUTHENTICATION_RECEIVED ) ) + { + manager->AuthenticationReceivedSignal().Connect( tracker, functor ); + } + else if( 0 == signalName.compare( SIGNAL_FILL_RESPONSE_RECEIVED ) ) + { + manager->FillResponseReceivedSignal().Connect( tracker, functor ); + } + else if( 0 == signalName.compare( SIGNAL_LIST_RECEIVED ) ) + { + manager->ListEventSignal().Connect( tracker, functor ); + } + else + { + // signalName does not match any signal + connected = false; + } + } + + return connected; +} + +} // Adaptor + +} // Internal + +} // Dali diff --git a/dali/internal/input/tizen-wayland/autofill-manager-impl-ecore-wl.h b/dali/internal/input/tizen-wayland/autofill-manager-impl-ecore-wl.h new file mode 100644 index 0000000..4f84ff3 --- /dev/null +++ b/dali/internal/input/tizen-wayland/autofill-manager-impl-ecore-wl.h @@ -0,0 +1,258 @@ +#ifndef DALI_INTERNAL_AUTOFILL_MANAGER_IMPL_ECORE_WL_H +#define DALI_INTERNAL_AUTOFILL_MANAGER_IMPL_ECORE_WL_H + +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// EXTERNAL INCLUDES +#include +#ifdef CAPI_AUTOFILL_SUPPORT +#include +#endif // CAPI_AUTOFILL_SUPPORT +#include + +// INTERNAL INCLUDES +#include +#include + +namespace Dali +{ + +namespace Internal +{ + +namespace Adaptor +{ + +class AutofillManagerEcoreWl : public Dali::Internal::Adaptor::AutofillManager +{ + +public: + + using AuthSignalType = Dali::AutofillManager::AuthSignalType; + using FillSignalType = Dali::AutofillManager::FillSignalType; + using ListSignalType = Dali::AutofillManager::ListSignalType; + +public: + + /** + * @brief Gets the AutofillManager instance + * + * It creates the instance if it has not already been created. + * Internally, a check should be made using IsAvailable() before this is called as we do not want + * to create an instance if not needed by applications. + * @see IsAvailable() + */ + static Dali::AutofillManager Get(); + + /** + * @brief Connects Callbacks required for Autofill daemon. + */ + void ConnectCallbacks() override; + +#ifdef CAPI_AUTOFILL_SUPPORT + + /** + * @brief Gets Autofill framework handle + * @return Autofill framework handle, which type is 'autofill_h" + */ + autofill_h GetAutofillHandle(); + + /** + * @brief Implement to receives Autofill Authentication Information callback. + * + * In this method, gets authentication information and emits the signal to check the authentication. + * @param authInfoHandle The autofill authentication information handle + * @param data The data from authentication information callback + */ + void ReceiveAuthInfo( autofill_auth_info_h authInfoHandle, void *data ); + + /** + * @brief Implement to fill out the data. + * + * This method would emit the signal to fill out the data. + * @param itemHandle The autofill fill response item handle + * @param userData The data from fill response callback + */ + void FillGroupItem( autofill_fill_response_item_h itemHandle, void *userData ); + + /** + * @brief Implement to set multiple group information. + * + * This method would emit the signals to make lists and fill out the data. + * @param itemHandle The autofill fill response item handle + * @param userData The data from fill response callback + */ + void FillMultipleGroupItem( autofill_fill_response_item_h itemHandle, void *userData ); +#endif // CAPI_AUTOFILL_SUPPORT + + + /////////////////////////////////////////////// Autofill Item and Group /////////////////////////////////////////////// + + /** + * @copydoc Dali::AutofillManager::CreateAutofillItem() + */ + Dali::AutofillItem CreateAutofillItem( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool isSensitive ) override; + + /** + * @copydoc Dali::AutofillManager::CreateAutofillGroup() + */ + Dali::AutofillGroup CreateAutofillGroup( const std::string& groupId ) override; + + + /////////////////////////////////////////////// Autofill Authentication Information /////////////////////////////////////////////// + + /** + * @copydoc Dali::AutofillManager::IsAutofillDataPresent() + */ + bool IsAutofillDataPresent() const override; + + /** + * @copydoc Dali::AutofillManager::IsAuthenticationNeeded() + */ + bool IsAuthenticationNeeded() const override; + + /** + * @copydoc Dali::AutofillManager::GetAuthenticationServiceName() + */ + const std::string& GetAuthenticationServiceName() const override; + + /** + * @copydoc Dali::AutofillManager::GetAuthenticationServiceMessage() + */ + const std::string& GetAuthenticationServiceMessage() const override; + + /** + * @copydoc Dali::AutofillManager::GetAuthenticationServiceImagePath() + */ + const std::string& GetAuthenticationServiceImagePath() const override; + + + /////////////////////////////////////////////// Autofill Fill Response /////////////////////////////////////////////// + + /** + * @copydoc Dali::AutofillManager::GetFillItemId() + */ + const std::string& GetFillItemId() const override; + + /** + * @copydoc Dali::AutofillManager::GetFillItemPresentationText() + */ + const std::string& GetFillItemPresentationText() const override; + + /** + * @copydoc Dali::AutofillManager::GetFillItemValue() + */ + const std::string& GetFillItemValue() const override; + + /** + * @copydoc Dali::AutofillManager::SaveAutofillData() + */ + void SaveAutofillData( Dali::AutofillGroup group ) override; + +public: // Signals + + /** + * @copydoc Dali::AutofillManager::AuthenticationReceivedSignal() + */ + AuthSignalType& AuthenticationReceivedSignal() override; + + /** + * @copydoc Dali::AutofillManager::FillResponseReceivedSignal() + */ + FillSignalType& FillResponseReceivedSignal() override; + + /** + * @copydoc Dali::AutofillManager::ListEventSignal() + */ + ListSignalType& ListEventSignal() override; + + /** + * Connects a callback function with the object's signals. + * @param[in] object The object providing the signal. + * @param[in] tracker Used to disconnect the signal. + * @param[in] signalName The signal to connect to. + * @param[in] functor A newly allocated FunctorDelegate. + * @return True if the signal was connected. + * @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the caller is responsible for deleting the unused functor. + */ + static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor ); + +private: + /** + * Context created the first time and kept until deleted. + */ + void CreateContext() override; + + /** + * Delete Autofill context. + */ + void DeleteContext() override; + +private: + /** + * Constructor. + */ + explicit AutofillManagerEcoreWl(); + +protected: + /** + * Destructor. + */ + ~AutofillManagerEcoreWl(); + +private: + // Undefined copy constructor + explicit AutofillManagerEcoreWl( const AutofillManagerEcoreWl& autofillManager ) = delete; + + // Undefined assignment operator + AutofillManagerEcoreWl& operator=( AutofillManagerEcoreWl& autofillManager ) = delete; + +private: +#ifdef CAPI_AUTOFILL_SUPPORT + autofill_h mAutofillHandle; ///< The Autofill framework handle +#endif // CAPI_AUTOFILL_SUPPORT + Dali::AutofillGroup mAutofillGroup; + + std::vector mAutofillGroupList; ///< The list to manage AutofillGroup + std::vector mAutofillItemList; ///< The list to manage AutofillItem + +private: + AuthSignalType mAuthReceivedSignal; ///< Authentication Received Signal + FillSignalType mFillReceivedSignal; ///< Fill Response Received Signal + ListSignalType mListReceivedSignal; ///< List Received Signal + +private: + std::string mAuthenticationServiceName; ///< The autofill authentication service name + std::string mAuthenticationServiceMessage; ///< The autofill authentication service message + std::string mAuthenticationServiceImagePath; ///< The autofill authentication service logo image path + std::string mFillItemId; ///< The autofill fill response item ID + std::string mFillItemPresentationText; ///< The autofill fill response item presentation text + std::string mFillItemValue; ///< The autofill fill response item value (input data) + + bool mIsDataPresent; ///< The autofill data presence + bool mIsAuthNeeded; ///< The authentication need + +}; + +} // namespace Adaptor + +} // namespace Internal + +} // namespace Dali + +#endif // DALI_INTERNAL_AUTOFILL_MANAGER_IMPL_ECORE_WL_H diff --git a/dali/internal/input/ubuntu-x11/autofill-factory-x.cpp b/dali/internal/input/ubuntu-x11/autofill-factory-x.cpp new file mode 100755 index 0000000..06848ac --- /dev/null +++ b/dali/internal/input/ubuntu-x11/autofill-factory-x.cpp @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include +#include +#include +#include + +namespace Dali +{ +namespace Internal +{ +namespace Adaptor +{ + +namespace AutofillFactory +{ + +// Autofill Factory to be implemented by the platform + +Dali::AutofillGroup CreateAutofillGroup( const std::string& groupId ) +{ + return Dali::Internal::Adaptor::AutofillGroupX::New( groupId ); +} + +Dali::AutofillItem CreateAutofillItem( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool sensitiveData ) +{ + return Dali::Internal::Adaptor::AutofillItemX::New( id, label, hint, sensitiveData ); +} + +Dali::AutofillManager CreateAutofillManager() +{ + return Dali::Internal::Adaptor::AutofillManagerX::Get(); +} + +} + +} // namespace Adaptor +} // namespace Internal +} // namespace Dali diff --git a/dali/internal/input/ubuntu-x11/autofill-group-impl-x.cpp b/dali/internal/input/ubuntu-x11/autofill-group-impl-x.cpp new file mode 100755 index 0000000..4f6b775 --- /dev/null +++ b/dali/internal/input/ubuntu-x11/autofill-group-impl-x.cpp @@ -0,0 +1,134 @@ +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// CLASS HEADER +#include + +// EXTERNAL INCLUDES +#include +#include + + +namespace Dali +{ + +namespace Internal +{ + +namespace Adaptor +{ + +namespace +{ +#if defined(DEBUG_ENABLED) +Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_AUTOFILL"); +#endif + + +BaseHandle Create() +{ + return Dali::Internal::Adaptor::AutofillGroup::New( "" ); +} + +Dali::TypeRegistration type( typeid(Dali::AutofillGroup), typeid(Dali::BaseHandle), Create ); + +} // unnamed namespace + + +AutofillGroupX::AutofillGroupX( const std::string groupId ) +: mAutofillItemList(), + mGroupId( groupId ) +{ +} + +AutofillGroupX::~AutofillGroupX() +{ +} + +Dali::AutofillGroup AutofillGroupX::New( const std::string& groupId ) +{ + Dali::Internal::Adaptor::AutofillGroup* group = new Dali::Internal::Adaptor::AutofillGroupX( groupId ); + Dali::AutofillGroup handle = Dali::AutofillGroup( group ); + + group->Initialize(); + + return handle; +} + +void AutofillGroupX::Initialize() +{ +} + +const std::string& AutofillGroupX::GetId() const +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillGroupX::GetId \n" ); + return mGroupId; +} + +void AutofillGroupX::AddAutofillItem( Dali::AutofillItem item ) +{ + // Pushes back an AutofillItem to the ItemList of AutofillGroupX. + mAutofillItemList.push_back( item ); +} + +Dali::AutofillItem AutofillGroupX::GetAutofillItem( const std::string& id ) +{ + Dali::AutofillItem item = Dali::AutofillItem(); + for( std::vector::iterator iter = mAutofillItemList.begin(), endIter = mAutofillItemList.end(); iter != endIter; ++iter ) + { + const std::string& itemId = ( *iter ).GetId(); + + if( itemId.compare( id ) == 0 ) + { + item = ( *iter ); + } + } + return item; +} + +void AutofillGroupX::ClearAutofillItemList() +{ + for( std::vector::iterator iter = mAutofillItemList.begin(), endIter = mAutofillItemList.end(); iter != endIter; ++iter ) + { + ( *iter ).ClearPresentationTextList(); + ( *iter ).ClearFillValueList(); + } +} + +void AutofillGroupX::SaveAutofillData() +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillGroupX::SaveAutofillData\n" ); + // Do Nothing +} + +void AutofillGroupX::RequestAuthentication() +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillGroupX::RequestAuthentication\n" ); + // Do Nothing +} + +void AutofillGroupX::SendFillRequest() +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillGroupX::SendFillRequest\n" ); + // Do Nothing +} + +} // Adaptor + +} // Internal + +} // Dali diff --git a/dali/internal/input/ubuntu-x11/autofill-group-impl-x.h b/dali/internal/input/ubuntu-x11/autofill-group-impl-x.h new file mode 100644 index 0000000..4003215 --- /dev/null +++ b/dali/internal/input/ubuntu-x11/autofill-group-impl-x.h @@ -0,0 +1,127 @@ +#ifndef DALI_INTERNAL_AUTOFILL_GROUP_IMPL_X_H +#define DALI_INTERNAL_AUTOFILL_GROUP_IMPL_X_H + +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// EXTERNAL INCLUDES +#include +#include + +// INTERNAL INCLUDES +#include +#include + +namespace Dali +{ + +namespace Internal +{ + +namespace Adaptor +{ + + +/** + * @brief This class is used to group AutofillItems. + */ +class AutofillGroupX : public Dali::Internal::Adaptor::AutofillGroup +{ + +public: + + /** + * @brief Constructor. + * + * @param[in] groupId A unique ID value of each AutofillGroup + * @return A public handle to the newly allocated AutofillGroup. + */ + static Dali::AutofillGroup New( const std::string& groupId ); + + /** + * @brief Initialize AutofillGroup constructor. + */ + void Initialize() override; + + /** + * @copydoc Dali::AutofillGroup::GetId() + */ + const std::string& GetId() const override; + + /** + * @copydoc Dali::AutofillGroup::AddAutofillItem() + */ + void AddAutofillItem( Dali::AutofillItem item ) override; + + /** + * @copydoc Dali::AutofillGroup::GetAutofillItem() + */ + Dali::AutofillItem GetAutofillItem( const std::string& id ) override; + + /** + * @brief Clears all lists of AutofillItem added in AutofillGroup. + */ + void ClearAutofillItemList() override; + + /** + * @copydoc Dali::AutofillGroup::SaveAutofillData() + */ + void SaveAutofillData() override; + + /** + * @copydoc Dali::AutofillGroup::RequestAuthentication() + */ + void RequestAuthentication() override; + + /** + * @copydoc Dali::AutofillGroup::SendFillRequest() + */ + void SendFillRequest() override; + +private: + /** + * Constructor. + */ + explicit AutofillGroupX( const std::string groupId ); + +protected: + /** + * Destructor. + */ + ~AutofillGroupX(); + +private: + // Undefined copy constructor + explicit AutofillGroupX( const AutofillGroupX& autofillGroup ) = delete; + + // Undefined assignment operator + AutofillGroupX& operator=( AutofillGroupX& autofillGroup ) = delete; + +private: + std::vector mAutofillItemList; ///< The List to add AutofillItem + std::string mGroupId; ///< The AutofillGroup ID + +}; + + +} // namespace Adaptor + +} // namespace Internal + +} // namespace Dali + +#endif // DALI_INTERNAL_AUTOFILL_GROUP_IMPL_X_H diff --git a/dali/internal/input/ubuntu-x11/autofill-item-impl-x.cpp b/dali/internal/input/ubuntu-x11/autofill-item-impl-x.cpp new file mode 100755 index 0000000..9801552 --- /dev/null +++ b/dali/internal/input/ubuntu-x11/autofill-item-impl-x.cpp @@ -0,0 +1,155 @@ +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// CLASS HEADER +#include + +// EXTERNAL INCLUDES + +#include +#include + +namespace Dali +{ + +namespace Internal +{ + +namespace Adaptor +{ + +namespace +{ +#if defined(DEBUG_ENABLED) +Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_AUTOFILL"); +#endif + + +BaseHandle Create() +{ + return Dali::Internal::Adaptor::AutofillItem::New( "", "", Dali::AutofillItem::Hint::ID, false ); +} + +Dali::TypeRegistration type( typeid(Dali::AutofillItem), typeid(Dali::BaseHandle), Create ); + +} // unnamed namespace + + +AutofillItemX::AutofillItemX( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool sensitiveData ) +: mId( id ), + mLabel( label ), + mHint( hint ), + mSensitiveData( sensitiveData ), + mValue(""), + mPresentationTextList(), + mValueList() +{ +} + +AutofillItemX::~AutofillItemX() +{ +} + + +Dali::AutofillItem AutofillItemX::New( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool sensitiveData ) +{ + Dali::Internal::Adaptor::AutofillItem* item = new Dali::Internal::Adaptor::AutofillItemX( id, label, hint, sensitiveData ); + Dali::AutofillItem handle = Dali::AutofillItem( item ); + + item->Initialize(); + + return handle; +} + +void AutofillItemX::Initialize() +{ +} + +const std::string& AutofillItemX::GetId() const +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillItemX::GetId \n" ); + return mId; +} + +const std::string& AutofillItemX::GetLabel() const +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillItemX::GetLabel \n" ); + return mLabel; +} + +Dali::AutofillItem::Hint AutofillItemX::GetHint() const +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillItemX::GetHint \n" ); + return mHint; +} + +bool AutofillItemX::IsSensitiveData() const +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillItemX::IsSensitiveData \n" ); + return mSensitiveData; +} + +void AutofillItemX::SetSaveValue( const std::string& value ) +{ + mValue = value; +} + +const std::string& AutofillItemX::GetSaveValue() const +{ + return mValue; +} + +void AutofillItemX::AddPresentationList( const std::string& presentationText ) +{ + mPresentationTextList.push_back( presentationText ); +} + +void AutofillItemX::AddFillValueList( const std::string& fillValue ) +{ + mValueList.push_back( fillValue ); +} + +const std::string& AutofillItemX::GetPresentationText( int index ) const +{ + return mPresentationTextList[index]; +} + +const std::string& AutofillItemX::GetFillValue( int index ) const +{ + return mValueList[index]; +} + +void AutofillItemX::ClearPresentationTextList() +{ + mPresentationTextList.clear(); +} + +void AutofillItemX::ClearFillValueList() +{ + mValueList.clear(); +} + +unsigned int AutofillItemX::GetFillValueCount() +{ + return mValueList.size(); +} + +} // Adaptor + +} // Internal + +} // Dali diff --git a/dali/internal/input/ubuntu-x11/autofill-item-impl-x.h b/dali/internal/input/ubuntu-x11/autofill-item-impl-x.h new file mode 100644 index 0000000..c7b8985 --- /dev/null +++ b/dali/internal/input/ubuntu-x11/autofill-item-impl-x.h @@ -0,0 +1,171 @@ +#ifndef DALI_INTERNAL_AUTOFILL_ITEM_IMPL_X_H +#define DALI_INTERNAL_AUTOFILL_ITEM_IMPL_X_H + +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// EXTERNAL INCLUDES +#include +#include + +// INTERNAL INCLUDES +#include + +namespace Dali +{ + +namespace Internal +{ + +namespace Adaptor +{ + +/** + * @brief This class is used to pass on data from the AutofillItem of control. + */ +class AutofillItemX : public Dali::Internal::Adaptor::AutofillItem +{ + +public: + + /** + * @brief Constructor. + * + * @param[in] id A unique ID for this AutofillItem + * @param[in] label An auxiliary means to guess what data is + * @param[in] hint The hint - id (username), name, password, phone, credit card number, organization, and so on + * @param[in] sensitiveData Whether this AutofillItem is a sensitive data or not. (The default is false) + * @return A public handle to the newly allocated AutofillItem + */ + static Dali::AutofillItem New( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool sensitiveData ); + + /** + * @brief Initialize AutofillItem constructor. + */ + void Initialize() override; + + /** + * @copydoc Dali::AutofillItem::GetId() + */ + const std::string& GetId() const override; + + /** + * @copydoc Dali::AutofillItem::GetLabel() + */ + const std::string& GetLabel() const override; + + /** + * @copydoc Dali::AutofillItem::GetHint() + */ + Dali::AutofillItem::Hint GetHint() const override; + + /** + * @copydoc Dali::AutofillItem::IsSensitiveData() + */ + bool IsSensitiveData() const override; + + /** + * @copydoc Dali::AutofillItem::SetSaveValue() + */ + void SetSaveValue( const std::string& value ) override; + + /** + * @copydoc Dali::AutofillItem::GetSaveValue() + */ + const std::string& GetSaveValue() const override; + + /** + * @brief Adds the presentation text to fill out in the list. + * + * @param[in] presentationText The presentation text to fill out + */ + void AddPresentationList( const std::string& presentationText ) override; + + /** + * @brief Adds the value to fill out in the list. + * + * @param[in] fillValue The value to fill out + */ + void AddFillValueList( const std::string& fillValue ) override; + + /** + * @copydoc Dali::AutofillItem::GetPresentationText() + */ + const std::string& GetPresentationText( int index ) const override; + + /** + * @copydoc Dali::AutofillItem::GetFillValue() + */ + const std::string& GetFillValue( int index ) const override; + + /** + * @copydoc Dali::AutofillItem::ClearPresentationTextList() + */ + void ClearPresentationTextList() override; + + /** + * @copydoc Dali::AutofillItem::ClearFillValueList() + */ + void ClearFillValueList() override; + + /** + * @copydoc Dali::AutofillItem::GetFillValueCount() + */ + unsigned int GetFillValueCount() override; + +private: + /** + * Constructor. + */ + explicit AutofillItemX( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool sensitiveData ); + +protected: + /** + * Destructor. + */ + ~AutofillItemX(); + +private: + // Undefined copy constructor + explicit AutofillItemX( const AutofillItemX& autofillItem ) = delete; + + // Undefined assignment operator + AutofillItemX& operator=( AutofillItemX& autofillItem ) = delete; + + +// Data +private: + std::string mId; ///< The AutofillItem ID + std::string mLabel; ///< The AutofillItem Label + Dali::AutofillItem::Hint mHint; ///< The AutofillItem Hint (id (username), name, password, phone, credit card number, organization, so on) + bool mSensitiveData; ///< Whether the data is sensitive or not + + std::string mValue; + + std::vector mPresentationTextList; ///< The list for the presentation text to fill out + std::vector mValueList; ///< The list for the value to fill out + +}; + + +} // namespace Adaptor + +} // namespace Internal + +} // namespace Dali + +#endif // DALI_INTERNAL_AUTOFILL_ITEM_IMPL_X_H diff --git a/dali/internal/input/ubuntu-x11/autofill-manager-impl-x.cpp b/dali/internal/input/ubuntu-x11/autofill-manager-impl-x.cpp new file mode 100755 index 0000000..25c289f --- /dev/null +++ b/dali/internal/input/ubuntu-x11/autofill-manager-impl-x.cpp @@ -0,0 +1,252 @@ +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// CLASS HEADER +#include + +// EXTERNAL INCLUDES +#include +#include +#include + +// INTERNAL INCLUDES +#include + +namespace Dali +{ + +namespace Internal +{ + +namespace Adaptor +{ + +namespace +{ +#if defined(DEBUG_ENABLED) +Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_AUTOFILL"); +#endif + +// Signals +const char* const SIGNAL_AUTHENTICATION_RECEIVED = "authenticationReceived"; +const char* const SIGNAL_FILL_RESPONSE_RECEIVED = "fillResponseReceived"; +const char* const SIGNAL_LIST_RECEIVED = "listReceived"; + +BaseHandle Create() +{ + return Dali::AutofillManager::Get(); +} + +Dali::TypeRegistration typeRegistration( typeid(Dali::AutofillManager), typeid(Dali::BaseHandle), Create ); + +Dali::SignalConnectorType signalConnector1( typeRegistration, SIGNAL_AUTHENTICATION_RECEIVED, Dali::Internal::Adaptor::AutofillManagerX::DoConnectSignal ); +Dali::SignalConnectorType signalConnector2( typeRegistration, SIGNAL_FILL_RESPONSE_RECEIVED, Dali::Internal::Adaptor::AutofillManagerX::DoConnectSignal ); +Dali::SignalConnectorType signalConnector3( typeRegistration, SIGNAL_LIST_RECEIVED, Dali::Internal::Adaptor::AutofillManagerX::DoConnectSignal ); + +} // unnamed namespace + + + +Dali::AutofillManager AutofillManagerX::Get() +{ + Dali::AutofillManager autofill; + AutofillManagerX *autofillPtr = NULL; + + Dali::SingletonService service( SingletonService::Get() ); + if( service ) + { + // Check whether the singleton is already created + Dali::BaseHandle handle = service.GetSingleton( typeid( Dali::AutofillManager ) ); + if( handle ) + { + // If so, downcast the handle + autofillPtr = dynamic_cast< AutofillManagerX* >( handle.GetObjectPtr() ); + autofill = Dali::AutofillManager( autofillPtr ); + } + else if( Adaptor::IsAvailable() ) + { + // Create instance and register singleton only if the adaptor is available + autofillPtr = new AutofillManagerX(); + autofill = Dali::AutofillManager( autofillPtr ); + service.Register( typeid( autofill ), autofill ); + } + } + + return autofill; +} + +AutofillManagerX::AutofillManagerX() +: mAutofillGroup(), + mAuthenticationServiceName(""), + mAuthenticationServiceMessage(""), + mAuthenticationServiceImagePath(""), + mFillItemId(""), + mFillItemPresentationText(""), + mFillItemValue(""), + mIsDataPresent( false ), + mIsAuthNeeded( false ) +{ +} + +AutofillManagerX::~AutofillManagerX() +{ + DeleteContext(); +} + +void AutofillManagerX::ConnectCallbacks() +{ +} + +void AutofillManagerX::CreateContext() +{ +} + +void AutofillManagerX::DeleteContext() +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillManagerX::DeleteContext\n" ); + // Do Nothing +} + + +/////////////////////////////////////////////// Autofill Item and Group /////////////////////////////////////////////// + +Dali::AutofillItem AutofillManagerX::CreateAutofillItem( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool isSensitive ) +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillManagerX::CreateAutofillItem \n" ); + + Dali::AutofillItem item = AutofillItem::New( id, label, hint, isSensitive ); + mAutofillItemList.push_back( item ); + + return mAutofillItemList.back(); +} + +Dali::AutofillGroup AutofillManagerX::CreateAutofillGroup( const std::string& groupId ) +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillManagerX::CreateAutofillGroup \n" ); + + Dali::AutofillGroup group = AutofillGroup::New( groupId ); + mAutofillGroupList.push_back( group ); + + return mAutofillGroupList.back(); +} + + +/////////////////////////////////////////////// Autofill Authentication Information /////////////////////////////////////////////// + +bool AutofillManagerX::IsAutofillDataPresent() const +{ + return mIsDataPresent; +} + +bool AutofillManagerX::IsAuthenticationNeeded() const +{ + return mIsAuthNeeded; +} + +const std::string& AutofillManagerX::GetAuthenticationServiceName() const +{ + return mAuthenticationServiceName; +} + +const std::string& AutofillManagerX::GetAuthenticationServiceMessage() const +{ + return mAuthenticationServiceMessage; +} + +const std::string& AutofillManagerX::GetAuthenticationServiceImagePath() const +{ + return mAuthenticationServiceImagePath; +} + + +/////////////////////////////////////////////// Autofill Fill Response /////////////////////////////////////////////// + +const std::string& AutofillManagerX::GetFillItemId() const +{ + return mFillItemId; +} + +const std::string& AutofillManagerX::GetFillItemPresentationText() const +{ + return mFillItemPresentationText; +} + +const std::string& AutofillManagerX::GetFillItemValue() const +{ + return mFillItemValue; +} + +void AutofillManagerX::SaveAutofillData( Dali::AutofillGroup group ) +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillManagerX::SaveAutofillData\n" ); + // Do Nothing +} + +// Signals +AutofillManagerX::AuthSignalType& AutofillManagerX::AuthenticationReceivedSignal() +{ + return mAuthReceivedSignal; +} + +AutofillManagerX::FillSignalType& AutofillManagerX::FillResponseReceivedSignal() +{ + return mFillReceivedSignal; +} + +AutofillManagerX::ListSignalType& AutofillManagerX::ListEventSignal() +{ + return mListReceivedSignal; +} + +bool AutofillManagerX::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor ) +{ + Dali::BaseHandle handle( object ); + + bool connected( true ); + AutofillManagerX* manager = dynamic_cast< AutofillManagerX* >( object ); + + if( manager ) + { + if( 0 == signalName.compare( SIGNAL_AUTHENTICATION_RECEIVED ) ) + { + manager->AuthenticationReceivedSignal().Connect( tracker, functor ); + } + else if( 0 == signalName.compare( SIGNAL_FILL_RESPONSE_RECEIVED ) ) + { + manager->FillResponseReceivedSignal().Connect( tracker, functor ); + } + else if( 0 == signalName.compare( SIGNAL_LIST_RECEIVED ) ) + { + manager->ListEventSignal().Connect( tracker, functor ); + } + else + { + // signalName does not match any signal + connected = false; + } + } + + return connected; +} + + + +} // Adaptor + +} // Internal + +} // Dali diff --git a/dali/internal/input/ubuntu-x11/autofill-manager-impl-x.h b/dali/internal/input/ubuntu-x11/autofill-manager-impl-x.h new file mode 100644 index 0000000..1b0b3e9 --- /dev/null +++ b/dali/internal/input/ubuntu-x11/autofill-manager-impl-x.h @@ -0,0 +1,217 @@ +#ifndef DALI_INTERNAL_AUTOFILL_MANAGER_IMPL_X_H +#define DALI_INTERNAL_AUTOFILL_MANAGER_IMPL_X_H + +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// EXTERNAL INCLUDES +#include +#include + +// INTERNAL INCLUDES +#include +#include + +namespace Dali +{ + +namespace Internal +{ + +namespace Adaptor +{ + +class AutofillManagerX : public Dali::Internal::Adaptor::AutofillManager +{ + +public: + + using AuthSignalType = Dali::AutofillManager::AuthSignalType; + using FillSignalType = Dali::AutofillManager::FillSignalType; + using ListSignalType = Dali::AutofillManager::ListSignalType; + +public: + + /** + * @brief Gets the AutofillManager instance + * + * It creates the instance if it has not already been created. + * Internally, a check should be made using IsAvailable() before this is called as we do not want + * to create an instance if not needed by applications. + * @see IsAvailable() + */ + static Dali::AutofillManager Get(); + + /** + * @brief Connects Callbacks required for Autofill daemon. + */ + void ConnectCallbacks() override; + + + /////////////////////////////////////////////// Autofill Item and Group /////////////////////////////////////////////// + + /** + * @copydoc Dali::AutofillManager::CreateAutofillItem() + */ + Dali::AutofillItem CreateAutofillItem( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool isSensitive ) override; + + /** + * @copydoc Dali::AutofillManager::CreateAutofillGroup() + */ + Dali::AutofillGroup CreateAutofillGroup( const std::string& groupId ) override; + + + /////////////////////////////////////////////// Autofill Authentication Information /////////////////////////////////////////////// + + /** + * @copydoc Dali::AutofillManager::IsAutofillDataPresent() + */ + bool IsAutofillDataPresent() const override; + + /** + * @copydoc Dali::AutofillManager::IsAuthenticationNeeded() + */ + bool IsAuthenticationNeeded() const override; + + /** + * @copydoc Dali::AutofillManager::GetAuthenticationServiceName() + */ + const std::string& GetAuthenticationServiceName() const override; + + /** + * @copydoc Dali::AutofillManager::GetAuthenticationServiceMessage() + */ + const std::string& GetAuthenticationServiceMessage() const override; + + /** + * @copydoc Dali::AutofillManager::GetAuthenticationServiceImagePath() + */ + const std::string& GetAuthenticationServiceImagePath() const override; + + + /////////////////////////////////////////////// Autofill Fill Response /////////////////////////////////////////////// + + /** + * @copydoc Dali::AutofillManager::GetFillItemId() + */ + const std::string& GetFillItemId() const override; + + /** + * @copydoc Dali::AutofillManager::GetFillItemPresentationText() + */ + const std::string& GetFillItemPresentationText() const override; + + /** + * @copydoc Dali::AutofillManager::GetFillItemValue() + */ + const std::string& GetFillItemValue() const override; + + /** + * @copydoc Dali::AutofillManager::SaveAutofillData() + */ + void SaveAutofillData( Dali::AutofillGroup group ) override; + +public: // Signals + + /** + * @copydoc Dali::AutofillManager::AuthenticationReceivedSignal() + */ + AuthSignalType& AuthenticationReceivedSignal() override; + + /** + * @copydoc Dali::AutofillManager::FillResponseReceivedSignal() + */ + FillSignalType& FillResponseReceivedSignal() override; + + /** + * @copydoc Dali::AutofillManager::ListEventSignal() + */ + ListSignalType& ListEventSignal() override; + + /** + * Connects a callback function with the object's signals. + * @param[in] object The object providing the signal. + * @param[in] tracker Used to disconnect the signal. + * @param[in] signalName The signal to connect to. + * @param[in] functor A newly allocated FunctorDelegate. + * @return True if the signal was connected. + * @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the caller is responsible for deleting the unused functor. + */ + static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor ); + +private: + /** + * Context created the first time and kept until deleted. + */ + void CreateContext() override; + + /** + * Delete Autofill context. + */ + void DeleteContext() override; + +private: + /** + * Constructor. + */ + explicit AutofillManagerX(); + +protected: + /** + * Destructor. + */ + ~AutofillManagerX(); + +private: + // Undefined copy constructor + explicit AutofillManagerX( const AutofillManagerX& autofillManager ) = delete; + + // Undefined assignment operator + AutofillManagerX& operator=( AutofillManagerX& autofillManager ) = delete; + +private: + Dali::AutofillGroup mAutofillGroup; + + std::vector mAutofillGroupList; ///< The list to manage AutofillGroup + std::vector mAutofillItemList; ///< The list to manage AutofillItem + +private: + AuthSignalType mAuthReceivedSignal; ///< Authentication Received Signal + FillSignalType mFillReceivedSignal; ///< Fill Response Received Signal + ListSignalType mListReceivedSignal; ///< List Received Signal + +private: + std::string mAuthenticationServiceName; ///< The autofill authentication service name + std::string mAuthenticationServiceMessage; ///< The autofill authentication service message + std::string mAuthenticationServiceImagePath; ///< The autofill authentication service logo image path + std::string mFillItemId; ///< The autofill fill response item ID + std::string mFillItemPresentationText; ///< The autofill fill response item presentation text + std::string mFillItemValue; ///< The autofill fill response item value (input data) + + bool mIsDataPresent; ///< The autofill data presence + bool mIsAuthNeeded; ///< The authentication need + +}; + + +} // namespace Adaptor + +} // namespace Internal + +} // namespace Dali + +#endif // DALI_INTERNAL_AUTOFILL_MANAGER_IMPL_X_H diff --git a/packaging/dali-adaptor.spec b/packaging/dali-adaptor.spec index 7d218ed..c62493a 100644 --- a/packaging/dali-adaptor.spec +++ b/packaging/dali-adaptor.spec @@ -100,6 +100,11 @@ BuildRequires: pkgconfig(ecore-imf) BuildRequires: pkgconfig(capi-system-system-settings) +# for autofill +%if 0%{?tizen_version_major} >= 5 && 0%{?tizen_version_minor} >= 5 +BuildRequires: pkgconfig(capi-ui-autofill) +%endif + # for feedback plugin BuildRequires: pkgconfig(mm-sound) BuildRequires: pkgconfig(feedback) @@ -298,6 +303,7 @@ cmake_flags+=" -DCMAKE_INSTALL_PREFIX=$PREFIX" cmake_flags+=" -DCMAKE_INSTALL_LIBDIR=%{_libdir}" cmake_flags+=" -DCMAKE_INSTALL_INCLUDEDIR=%{_includedir}" cmake_flags+=" -DENABLE_TIZEN_MAJOR_VERSION=%{tizen_version_major}" +cmake_flags+=" -DENABLE_TIZEN_MINOR_VERSION=%{tizen_version_minor}" cmake_flags+=" -DENABLE_FEEDBACK=YES" cmake_flags+=" -DENABLE_APPFW=YES" -- 2.7.4 From 24f274b0f3130e92d092d97d275629c05f3a047b Mon Sep 17 00:00:00 2001 From: Heeyong Song Date: Wed, 6 May 2020 17:24:36 +0900 Subject: [PATCH 15/16] [Tizen] Add screen and client rotation itself function Change-Id: Ib542fed33b74ade4cbeed01c908c9039e7019778 --- .../adaptor-framework/render-surface-interface.h | 6 ++++ .../adaptor-framework/scene-holder-impl.cpp | 7 ++-- .../adaptor-framework/scene-holder-impl.h | 5 +-- dali/internal/window-system/common/window-base.h | 11 +++++++ dali/internal/window-system/common/window-impl.cpp | 32 +++++++++++++++--- .../window-system/common/window-render-surface.cpp | 34 +++++++++++++------ .../window-system/common/window-render-surface.h | 6 ++++ .../ecore-wl/window-base-ecore-wl.cpp | 27 +++++++++++++-- .../tizen-wayland/ecore-wl/window-base-ecore-wl.h | 14 ++++++++ .../ecore-wl2/window-base-ecore-wl2.cpp | 38 +++++++++++++++++----- .../ecore-wl2/window-base-ecore-wl2.h | 14 ++++++++ .../native-render-surface-ecore-wl.cpp | 5 +++ .../tizen-wayland/native-render-surface-ecore-wl.h | 6 ++++ .../ubuntu-x11/pixmap-render-surface-ecore-x.cpp | 5 +++ .../ubuntu-x11/pixmap-render-surface-ecore-x.h | 6 ++++ .../ubuntu-x11/window-base-ecore-x.cpp | 10 ++++++ .../window-system/ubuntu-x11/window-base-ecore-x.h | 11 +++++++ .../window-system/windows/window-base-win.cpp | 8 +++++ .../window-system/windows/window-base-win.h | 11 +++++++ 19 files changed, 225 insertions(+), 31 deletions(-) diff --git a/dali/integration-api/adaptor-framework/render-surface-interface.h b/dali/integration-api/adaptor-framework/render-surface-interface.h index 25ad128..a683a59 100644 --- a/dali/integration-api/adaptor-framework/render-surface-interface.h +++ b/dali/integration-api/adaptor-framework/render-surface-interface.h @@ -100,6 +100,12 @@ public: virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) = 0; /** + * @brief Return the orientation of the surface. + * @return The orientation + */ + virtual int GetOrientation() const = 0; + + /** * @brief InitializeGraphics the platform specific graphics surface interfaces */ virtual void InitializeGraphics() = 0; diff --git a/dali/integration-api/adaptor-framework/scene-holder-impl.cpp b/dali/integration-api/adaptor-framework/scene-holder-impl.cpp index 2440b35..69f5e89 100644 --- a/dali/integration-api/adaptor-framework/scene-holder-impl.cpp +++ b/dali/integration-api/adaptor-framework/scene-holder-impl.cpp @@ -189,7 +189,7 @@ void SceneHolder::SetSurface(Dali::RenderSurfaceInterface* surface) mScene.SurfaceReplaced(); - SurfaceResized(); + SurfaceResized( false ); unsigned int dpiHorizontal, dpiVertical; dpiHorizontal = dpiVertical = 0; @@ -202,10 +202,11 @@ void SceneHolder::SetSurface(Dali::RenderSurfaceInterface* surface) OnSurfaceSet( surface ); } -void SceneHolder::SurfaceResized() +void SceneHolder::SurfaceResized( bool forceUpdate ) { PositionSize surfacePositionSize = mSurface->GetPositionSize(); - mScene.SurfaceResized( static_cast( surfacePositionSize.width ), static_cast( surfacePositionSize.height ) ); + int orientation = mSurface->GetOrientation(); + mScene.SurfaceResized( static_cast( surfacePositionSize.width ), static_cast( surfacePositionSize.height ), orientation, forceUpdate ); } Dali::RenderSurfaceInterface* SceneHolder::GetSurface() const diff --git a/dali/integration-api/adaptor-framework/scene-holder-impl.h b/dali/integration-api/adaptor-framework/scene-holder-impl.h index 3a830f9..318ceeb 100644 --- a/dali/integration-api/adaptor-framework/scene-holder-impl.h +++ b/dali/integration-api/adaptor-framework/scene-holder-impl.h @@ -112,9 +112,10 @@ public: void SetSurface( Dali::RenderSurfaceInterface* surface ); /** - * @brief Called when the surface set is resized. + * @brief Called when the surface is resized. + * @param[in] forceUpdate The flag to update force */ - void SurfaceResized(); + void SurfaceResized( bool forceUpdate ); /** * @brief Get the render surface diff --git a/dali/internal/window-system/common/window-base.h b/dali/internal/window-system/common/window-base.h index 9871611..1be77f9 100644 --- a/dali/internal/window-system/common/window-base.h +++ b/dali/internal/window-system/common/window-base.h @@ -311,6 +311,12 @@ public: virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) = 0; /** + * @brief Return the orientation of the surface. + * @return The orientation + */ + virtual int GetOrientation() const = 0; + + /** * @brief Get the screen rotation angle of the window */ virtual int GetScreenRotationAngle() = 0; @@ -320,6 +326,11 @@ public: */ virtual void SetWindowRotationAngle( int degree ) = 0; + /** + * @brief Get the rotation angle of the window + */ + virtual int GetWindowRotationAngle() = 0; + /** * @brief Inform the window rotation is completed */ diff --git a/dali/internal/window-system/common/window-impl.cpp b/dali/internal/window-system/common/window-impl.cpp index a0fd809..abbfe21 100644 --- a/dali/internal/window-system/common/window-impl.cpp +++ b/dali/internal/window-system/common/window-impl.cpp @@ -584,7 +584,13 @@ void Window::SetSize( Dali::Window::WindowSize size ) { Uint16Pair newSize( newRect.width, newRect.height ); - SurfaceResized(); + bool forceUpdate = false; + if( mWindowBase->IsEglWindowRotationSupported() ) + { + forceUpdate = true; + } + + SurfaceResized( forceUpdate ); mAdaptor->SurfaceResizePrepare( mSurface.get(), newSize ); @@ -644,7 +650,13 @@ void Window::SetPositionSize( PositionSize positionSize ) { Uint16Pair newSize( newRect.width, newRect.height ); - SurfaceResized(); + bool forceUpdate = false; + if( mWindowBase->IsEglWindowRotationSupported() ) + { + forceUpdate = true; + } + + SurfaceResized( forceUpdate ); mAdaptor->SurfaceResizePrepare( mSurface.get(), newSize ); @@ -729,8 +741,14 @@ void Window::OnFocusChanged( bool focusIn ) void Window::OnOutputTransformed() { + bool forceUpdate = false; + if( mWindowBase->IsEglWindowRotationSupported() ) + { + forceUpdate = true; + } + SurfaceResized( forceUpdate ); + PositionSize positionSize = mSurface->GetPositionSize(); - SurfaceResized(); mAdaptor->SurfaceResizePrepare( mSurface.get(), Adaptor::SurfaceSize( positionSize.width, positionSize.height ) ); mAdaptor->SurfaceResizeComplete( mSurface.get(), Adaptor::SurfaceSize( positionSize.width, positionSize.height ) ); } @@ -772,7 +790,13 @@ void Window::OnRotation( const RotationEvent& rotation ) mWindowSurface->RequestRotation( mRotationAngle, mWindowWidth, mWindowHeight ); - SurfaceResized(); + bool forceUpdate = false; + if( mWindowBase->IsEglWindowRotationSupported() ) + { + forceUpdate = true; + } + + SurfaceResized( forceUpdate ); mAdaptor->SurfaceResizePrepare( mSurface.get(), Adaptor::SurfaceSize( mWindowWidth, mWindowHeight ) ); diff --git a/dali/internal/window-system/common/window-render-surface.cpp b/dali/internal/window-system/common/window-render-surface.cpp index f86d7c2..789d86e 100644 --- a/dali/internal/window-system/common/window-render-surface.cpp +++ b/dali/internal/window-system/common/window-render-surface.cpp @@ -115,6 +115,7 @@ void WindowRenderSurface::Initialize( Any surface ) if( mScreenRotationAngle != 0 ) { mScreenRotationFinished = false; + mResizeFinished = false; } } @@ -145,12 +146,6 @@ void WindowRenderSurface::SetTransparency( bool transparent ) void WindowRenderSurface::RequestRotation( int angle, int width, int height ) { - if( !mRotationSupported ) - { - DALI_LOG_INFO( gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::Rotate: Rotation is not supported!\n" ); - return; - } - if( !mRotationTrigger ) { mRotationTrigger = TriggerEventFactory::CreateTriggerEvent( MakeCallback( this, &WindowRenderSurface::ProcessRotationRequest ), TriggerEventInterface::KEEP_ALIVE_AFTER_TRIGGER ); @@ -202,6 +197,11 @@ void WindowRenderSurface::GetDpi( unsigned int& dpiHorizontal, unsigned int& dpi dpiVertical = mDpiVertical; } +int WindowRenderSurface::GetOrientation() const +{ + return mWindowBase->GetOrientation(); +} + void WindowRenderSurface::InitializeGraphics() { @@ -354,11 +354,11 @@ bool WindowRenderSurface::PreRender( bool resizingSurface ) if( resizingSurface ) { + int totalAngle = (mRotationAngle + mScreenRotationAngle) % 360; + // Window rotate or screen rotate if( !mRotationFinished || !mScreenRotationFinished ) { - int totalAngle = (mRotationAngle + mScreenRotationAngle) % 360; - mWindowBase->SetEglWindowRotation( totalAngle ); mWindowBase->SetEglWindowBufferTransform( totalAngle ); @@ -375,9 +375,22 @@ bool WindowRenderSurface::PreRender( bool resizingSurface ) } // Resize case - if( !mResizeFinished ) + if ( !mResizeFinished ) { - mWindowBase->ResizeEglWindow( mPositionSize ); + Dali::PositionSize positionSize; + positionSize.x = mPositionSize.x; + positionSize.y = mPositionSize.y; + if( totalAngle == 0 || totalAngle == 180 ) + { + positionSize.width = mPositionSize.width; + positionSize.height = mPositionSize.height; + } + else + { + positionSize.width = mPositionSize.height; + positionSize.height = mPositionSize.width; + } + mWindowBase->ResizeEglWindow( positionSize ); mResizeFinished = true; DALI_LOG_INFO( gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::PreRender: Set resize\n" ); @@ -490,6 +503,7 @@ void WindowRenderSurface::OutputTransformed() { mScreenRotationAngle = screenRotationAngle; mScreenRotationFinished = false; + mResizeFinished = false; mOutputTransformedSignal.Emit(); diff --git a/dali/internal/window-system/common/window-render-surface.h b/dali/internal/window-system/common/window-render-surface.h index f8160b8..6cab258 100644 --- a/dali/internal/window-system/common/window-render-surface.h +++ b/dali/internal/window-system/common/window-render-surface.h @@ -124,6 +124,12 @@ public: // from Dali::RenderSurfaceInterface virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override; /** + * @brief Return the orientation of the surface. + * @return The orientation + */ + virtual int GetOrientation() const override; + + /** * @copydoc Dali::RenderSurfaceInterface::InitializeGraphics() */ virtual void InitializeGraphics() override; diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp b/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp index 509ddd4..4258b7f 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp +++ b/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp @@ -585,7 +585,10 @@ WindowBaseEcoreWl::WindowBaseEcoreWl( Dali::PositionSize positionSize, Any surfa mBrightness( 0 ), mBrightnessChangeState( 0 ), mBrightnessChangeDone( true ), - mOwnSurface( false ) + mOwnSurface( false ), + mWindowRotationAngle( 0 ), + mScreenRotationAngle( 0 ), + mSupportedPreProtation( 0 ) #ifdef DALI_ELDBUS_AVAILABLE , mSystemConnection( NULL ) #endif @@ -1317,9 +1320,10 @@ bool WindowBaseEcoreWl::IsEglWindowRotationSupported() wl_egl_window_capability capability = static_cast< wl_egl_window_capability >( wl_egl_window_get_capabilities( mEglWindow ) ); if( capability == WL_EGL_WINDOW_CAPABILITY_ROTATION_SUPPORTED ) { + mSupportedPreProtation = true; return true; } - + mSupportedPreProtation = false; return false; } @@ -2062,6 +2066,16 @@ void WindowBaseEcoreWl::GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVe dpiVertical = int( yres + 0.5f ); } +int WindowBaseEcoreWl::GetOrientation() const +{ + int orientation = (mScreenRotationAngle + mWindowRotationAngle) % 360; + if( mSupportedPreProtation ) + { + orientation = 0; + } + return orientation; +} + int WindowBaseEcoreWl::GetScreenRotationAngle() { int transform = 0; @@ -2075,14 +2089,21 @@ int WindowBaseEcoreWl::GetScreenRotationAngle() transform = ecore_wl_output_transform_get( ecore_wl_window_output_find( mEcoreWindow ) ); } - return transform * 90; + mScreenRotationAngle = transform * 90; + return mScreenRotationAngle; } void WindowBaseEcoreWl::SetWindowRotationAngle( int degree ) { + mWindowRotationAngle = degree; ecore_wl_window_rotation_set( mEcoreWindow, degree ); } +int WindowBaseEcoreWl::GetWindowRotationAngle() +{ + return mWindowRotationAngle; +} + void WindowBaseEcoreWl::WindowRotationCompleted( int degree, int width, int height ) { ecore_wl_window_rotation_change_done_send( mEcoreWindow ); diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.h b/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.h index 5811b5c..2d0a4ce 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.h +++ b/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.h @@ -395,6 +395,12 @@ public: virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override; /** + * @brief Return the orientation of the surface. + * @return The orientation + */ + virtual int GetOrientation() const override; + + /** * @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenRotationAngle() */ virtual int GetScreenRotationAngle() override; @@ -405,6 +411,11 @@ public: virtual void SetWindowRotationAngle( int degree ) override; /** + * @copydoc Dali::Internal::Adaptor::WindowBase::GetWindowRotationAngle() + */ + virtual int GetWindowRotationAngle() override; + + /** * @copydoc Dali::Internal::Adaptor::WindowBase::WindowRotationCompleted() */ virtual void WindowRotationCompleted( int degree, int width, int height ) override; @@ -475,6 +486,9 @@ private: bool mOwnSurface; + int mWindowRotationAngle; + int mScreenRotationAngle; + int mSupportedPreProtation; #ifdef DALI_ELDBUS_AVAILABLE Eldbus_Connection* mSystemConnection; #endif // DALI_ELDBUS_AVAILABLE diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp index 89fae58..8c2c04a 100755 --- a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp +++ b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp @@ -690,7 +690,10 @@ WindowBaseEcoreWl2::WindowBaseEcoreWl2( Dali::PositionSize positionSize, Any sur mBrightnessChangeDone( true ), mOwnSurface( false ), mMoveResizeSerial( 0 ), - mLastSubmittedMoveResizeSerial( 0 ) + mLastSubmittedMoveResizeSerial( 0 ), + mWindowRotationAngle( 0 ), + mScreenRotationAngle( 0 ), + mSupportedPreProtation( 0 ) #ifdef DALI_ELDBUS_AVAILABLE , mSystemConnection( NULL ) #endif @@ -1071,7 +1074,7 @@ void WindowBaseEcoreWl2::OnMouseButtonCancel( void* data, int type, void* event mTouchEventSignal.Emit( point, touchEvent->timestamp ); - DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl::OnMouseButtonCancel\n" ); + DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::OnMouseButtonCancel\n" ); } } @@ -1081,7 +1084,7 @@ void WindowBaseEcoreWl2::OnMouseWheel( void* data, int type, void* event ) if( mouseWheelEvent->window == static_cast< unsigned int >( ecore_wl2_window_id_get( mEcoreWindow ) ) ) { - DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl::OnMouseWheel: direction: %d, modifiers: %d, x: %d, y: %d, z: %d\n", mouseWheelEvent->direction, mouseWheelEvent->modifiers, mouseWheelEvent->x, mouseWheelEvent->y, mouseWheelEvent->z ); + DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::OnMouseWheel: direction: %d, modifiers: %d, x: %d, y: %d, z: %d\n", mouseWheelEvent->direction, mouseWheelEvent->modifiers, mouseWheelEvent->x, mouseWheelEvent->y, mouseWheelEvent->z ); WheelEvent wheelEvent( WheelEvent::MOUSE_WHEEL, mouseWheelEvent->direction, mouseWheelEvent->modifiers, Vector2( mouseWheelEvent->x, mouseWheelEvent->y ), mouseWheelEvent->z, mouseWheelEvent->timestamp ); @@ -1093,7 +1096,7 @@ void WindowBaseEcoreWl2::OnDetentRotation( void* data, int type, void* event ) { Ecore_Event_Detent_Rotate* detentEvent = static_cast< Ecore_Event_Detent_Rotate* >( event ); - DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Concise, "WindowBaseEcoreWl::OnDetentRotation\n" ); + DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Concise, "WindowBaseEcoreWl2::OnDetentRotation\n" ); int direction = ( detentEvent->direction == ECORE_DETENT_DIRECTION_CLOCKWISE ) ? 1 : -1; int timeStamp = detentEvent->timestamp; @@ -1109,7 +1112,7 @@ void WindowBaseEcoreWl2::OnKeyDown( void* data, int type, void* event ) if( keyEvent->window == static_cast< unsigned int >( ecore_wl2_window_id_get( mEcoreWindow ) ) ) { - DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl::OnKeyDown\n" ); + DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::OnKeyDown\n" ); std::string keyName( keyEvent->keyname ); std::string logicalKey( "" ); @@ -1171,7 +1174,7 @@ void WindowBaseEcoreWl2::OnKeyUp( void* data, int type, void* event ) if( keyEvent->window == static_cast< unsigned int >( ecore_wl2_window_id_get( mEcoreWindow ) ) ) { - DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl::OnKeyUp\n" ); + DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::OnKeyUp\n" ); std::string keyName( keyEvent->keyname ); std::string logicalKey( "" ); @@ -1513,9 +1516,10 @@ bool WindowBaseEcoreWl2::IsEglWindowRotationSupported() wl_egl_window_tizen_capability capability = static_cast< wl_egl_window_tizen_capability >( wl_egl_window_tizen_get_capabilities( mEglWindow ) ); if( capability == WL_EGL_WINDOW_TIZEN_CAPABILITY_ROTATION_SUPPORTED ) { + mSupportedPreProtation = true; return true; } - + mSupportedPreProtation = false; return false; } @@ -2259,6 +2263,16 @@ void WindowBaseEcoreWl2::GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiV dpiVertical = int( yres + 0.5f ); } +int WindowBaseEcoreWl2::GetOrientation() const +{ + int orientation = (mScreenRotationAngle + mWindowRotationAngle) % 360; + if( mSupportedPreProtation ) + { + orientation = 0; + } + return orientation; +} + int WindowBaseEcoreWl2::GetScreenRotationAngle() { int transform = 0; @@ -2271,15 +2285,21 @@ int WindowBaseEcoreWl2::GetScreenRotationAngle() { transform = ecore_wl2_output_transform_get( ecore_wl2_window_output_find( mEcoreWindow ) ); } - - return transform * 90; + mScreenRotationAngle = transform * 90; + return mScreenRotationAngle; } void WindowBaseEcoreWl2::SetWindowRotationAngle( int degree ) { + mWindowRotationAngle = degree; ecore_wl2_window_rotation_set( mEcoreWindow, degree ); } +int WindowBaseEcoreWl2::GetWindowRotationAngle() +{ + return mWindowRotationAngle; +} + void WindowBaseEcoreWl2::WindowRotationCompleted( int degree, int width, int height ) { ecore_wl2_window_rotation_change_done_send( mEcoreWindow, degree, width, height ); diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h index c7a7240..bd4afb5 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h +++ b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h @@ -417,6 +417,12 @@ public: virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override; /** + * @brief Return the orientation of the surface. + * @return The orientation + */ + virtual int GetOrientation() const override; + + /** * @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenRotationAngle() */ virtual int GetScreenRotationAngle() override; @@ -427,6 +433,11 @@ public: virtual void SetWindowRotationAngle( int degree ) override; /** + * @copydoc Dali::Internal::Adaptor::WindowBase::GetWindowRotationAngle() + */ + virtual int GetWindowRotationAngle() override; + + /** * @copydoc Dali::Internal::Adaptor::WindowBase::WindowRotationCompleted() */ virtual void WindowRotationCompleted( int degree, int width, int height ) override; @@ -501,6 +512,9 @@ private: volatile uint32_t mMoveResizeSerial; uint32_t mLastSubmittedMoveResizeSerial; + int mWindowRotationAngle; + int mScreenRotationAngle; + int mSupportedPreProtation; #ifdef DALI_ELDBUS_AVAILABLE Eldbus_Connection* mSystemConnection; #endif // DALI_ELDBUS_AVAILABLE diff --git a/dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.cpp b/dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.cpp index 3ef4f68..7bb678c 100644 --- a/dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.cpp +++ b/dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.cpp @@ -142,6 +142,11 @@ void NativeRenderSurfaceEcoreWl::GetDpi( unsigned int& dpiHorizontal, unsigned i dpiVertical = int( yres + 0.5f ); } +int NativeRenderSurfaceEcoreWl::GetOrientation() const +{ + return 0; +} + void NativeRenderSurfaceEcoreWl::InitializeGraphics() { DALI_LOG_TRACE_METHOD( gNativeSurfaceLogFilter ); diff --git a/dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.h b/dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.h index e3a33ba..dba6bfd 100644 --- a/dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.h +++ b/dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.h @@ -84,6 +84,12 @@ public: // from Dali::RenderSurfaceInterface virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override; /** + * @brief Return the orientation of the surface. + * @return The orientation + */ + virtual int GetOrientation() const override; + + /** * @copydoc Dali::RenderSurfaceInterface::InitializeGraphics() */ virtual void InitializeGraphics() override; diff --git a/dali/internal/window-system/ubuntu-x11/pixmap-render-surface-ecore-x.cpp b/dali/internal/window-system/ubuntu-x11/pixmap-render-surface-ecore-x.cpp index 2e93140..b9b9811 100644 --- a/dali/internal/window-system/ubuntu-x11/pixmap-render-surface-ecore-x.cpp +++ b/dali/internal/window-system/ubuntu-x11/pixmap-render-surface-ecore-x.cpp @@ -147,6 +147,11 @@ void PixmapRenderSurfaceEcoreX::GetDpi( unsigned int& dpiHorizontal, unsigned in dpiVertical = int( yres + 0.5f ); } +int PixmapRenderSurfaceEcoreX::GetOrientation() const +{ + return 0; +} + void PixmapRenderSurfaceEcoreX::InitializeGraphics() { mGraphics = &mAdaptor->GetGraphicsInterface(); diff --git a/dali/internal/window-system/ubuntu-x11/pixmap-render-surface-ecore-x.h b/dali/internal/window-system/ubuntu-x11/pixmap-render-surface-ecore-x.h index 034fee6..89f2501 100644 --- a/dali/internal/window-system/ubuntu-x11/pixmap-render-surface-ecore-x.h +++ b/dali/internal/window-system/ubuntu-x11/pixmap-render-surface-ecore-x.h @@ -82,6 +82,12 @@ public: // from Dali::RenderSurfaceInterface virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override; /** + * @brief Return the orientation of the surface. + * @return The orientation + */ + virtual int GetOrientation() const override; + + /** * @copydoc Dali::RenderSurfaceInterface::InitializeGraphics() */ virtual void InitializeGraphics() override; diff --git a/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp b/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp index ab67b43..77567d4 100755 --- a/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp +++ b/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp @@ -834,6 +834,11 @@ void WindowBaseEcoreX::GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVer dpiVertical = ecore_x_dpi_get(); } +int WindowBaseEcoreX::GetOrientation() const +{ + return 0; +} + int WindowBaseEcoreX::GetScreenRotationAngle() { return 0; @@ -843,6 +848,11 @@ void WindowBaseEcoreX::SetWindowRotationAngle( int degree ) { } +int WindowBaseEcoreX::GetWindowRotationAngle() +{ + return 0; +} + void WindowBaseEcoreX::WindowRotationCompleted( int degree, int width, int height ) { } diff --git a/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h b/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h index 8ab7080..f01d32d 100644 --- a/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h +++ b/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h @@ -329,6 +329,12 @@ public: virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override; /** + * @brief Return the orientation of the surface. + * @return The orientation + */ + virtual int GetOrientation() const override; + + /** * @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenRotationAngle() */ virtual int GetScreenRotationAngle() override; @@ -339,6 +345,11 @@ public: virtual void SetWindowRotationAngle( int degree ) override; /** + * @copydoc Dali::Internal::Adaptor::WindowBase::GetWindowRotationAngle() + */ + virtual int GetWindowRotationAngle() override; + + /** * @copydoc Dali::Internal::Adaptor::WindowBase::WindowRotationCompleted() */ virtual void WindowRotationCompleted( int degree, int width, int height ) override; diff --git a/dali/internal/window-system/windows/window-base-win.cpp b/dali/internal/window-system/windows/window-base-win.cpp index c968bea..7c64458 100755 --- a/dali/internal/window-system/windows/window-base-win.cpp +++ b/dali/internal/window-system/windows/window-base-win.cpp @@ -454,6 +454,10 @@ void WindowBaseWin::SetWindowRotationAngle( int degree ) { } +int WindowBaseWin::GetWindowRotationAngle() +{ +} + void WindowBaseWin::WindowRotationCompleted( int degree, int width, int height ) { } @@ -462,6 +466,10 @@ void WindowBaseWin::SetTransparency( bool transparent ) { } +int WindowBaseWin::GetOrientation() const +{ +} + unsigned int WindowBaseWin::GetSurfaceId( Any surface ) const { unsigned int surfaceId = 0; diff --git a/dali/internal/window-system/windows/window-base-win.h b/dali/internal/window-system/windows/window-base-win.h index c0a17dc..05b208e 100755 --- a/dali/internal/window-system/windows/window-base-win.h +++ b/dali/internal/window-system/windows/window-base-win.h @@ -327,6 +327,11 @@ public: virtual void SetWindowRotationAngle( int degree ) override; /** + * @copydoc Dali::Internal::Adaptor::WindowBase::GetWindowRotationAngle() + */ + virtual void GetWindowRotationAngle() override; + + /** * @copydoc Dali::Internal::Adaptor::WindowBase::WindowRotationCompleted() */ virtual void WindowRotationCompleted( int degree, int width, int height ) override; @@ -337,6 +342,12 @@ public: virtual void SetTransparency( bool transparent ) override; /** + * @brief Return the orientation of the surface. + * @return The orientation + */ + virtual int GetOrientation() const override; + + /** * @copydoc Dali::Internal::Adaptor::WindowBase::SetParent() */ virtual void SetParent( WindowBase* parentWinBase ) override; -- 2.7.4 From 4113857d0a1391193858623ff4bd2412eb96a6f4 Mon Sep 17 00:00:00 2001 From: Wonsik Jung Date: Mon, 25 May 2020 18:59:53 +0900 Subject: [PATCH 16/16] [Tizen] Add rotation's values to winBase-wl2 Add the window roation's values to winBase-wl2. It is temporary solution until EFL's patch is completed. After that, it will be reverted. Change-Id: I9630b6721ab6f7d392287e5e28c7f5e43b84c817 --- .../tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp | 15 ++++++++++----- .../tizen-wayland/ecore-wl2/window-base-ecore-wl2.h | 4 ++++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp index 8c2c04a..9624c20 100755 --- a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp +++ b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp @@ -760,6 +760,11 @@ void WindowBaseEcoreWl2::Initialize( PositionSize positionSize, Any surface, boo CreateWindow( positionSize ); } + for( int i = 0; i < 4; ++i ) + { + mAvaiableWindowOrientations[i] = 0; + } + mWlSurface = ecore_wl2_window_surface_get( mEcoreWindow ); SetTransparency( isTransparent ); @@ -1562,14 +1567,14 @@ void WindowBaseEcoreWl2::Activate() void WindowBaseEcoreWl2::SetAvailableAnlges( const std::vector< int >& angles ) { - int rotations[4] = { 0 }; DALI_LOG_RELEASE_INFO( "WindowBaseEcoreWl2::SetAvailableAnlges, angle's count: %d, angles\n", angles.size() ); - for( std::size_t i = 0; i < angles.size(); ++i ) + std::size_t size = angles.size(); + for( std::size_t i = 0; i < size; ++i ) { - rotations[i] = static_cast< int >( angles[i] ); - DALI_LOG_RELEASE_INFO( "%d ", rotations[i] ); + mAvaiableWindowOrientations[i] = static_cast< int >( angles[i] ); + DALI_LOG_RELEASE_INFO( "%d ", mAvaiableWindowOrientations[i] ); } - ecore_wl2_window_available_rotations_set( mEcoreWindow, rotations, angles.size() ); + ecore_wl2_window_available_rotations_set( mEcoreWindow, mAvaiableWindowOrientations, size ); } void WindowBaseEcoreWl2::SetPreferredAngle( int angle ) diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h index bd4afb5..83d06d2 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h +++ b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h @@ -515,6 +515,10 @@ private: int mWindowRotationAngle; int mScreenRotationAngle; int mSupportedPreProtation; + + // Temporary solution to fix window rotation and window hide + // It will be removed when EFL patch is completed. + int mAvaiableWindowOrientations[4]; #ifdef DALI_ELDBUS_AVAILABLE Eldbus_Connection* mSystemConnection; #endif // DALI_ELDBUS_AVAILABLE -- 2.7.4