From e4e48ef005c29d076be5096f6bf33b524fec6312 Mon Sep 17 00:00:00 2001 From: Wonsik Jung Date: Tue, 2 Jun 2020 16:34:12 +0900 Subject: [PATCH 01/16] [Tizen] Add rotation's values to winBase-wl2 This reverts commit fa81d8b41fc0b20a1ad0d53eceeef98ad0167901. Change-Id: I7f7c9933c2e954c1afc9513b3640baaf5d6d40c2 --- .../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 0a1bec4..be48236 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 @@ -762,6 +762,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 ); @@ -1570,14 +1575,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 764b7d4..4825a33 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 @@ -518,6 +518,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 From 34fbc68ac6e2fba939dd82c05aa294af93a21fcb Mon Sep 17 00:00:00 2001 From: Wonsik Jung Date: Tue, 2 Jun 2020 16:34:40 +0900 Subject: [PATCH 02/16] [Tizen] Add check code with orientation in creating egl window. This reverts commit 0cce4d36bbe18e9447ecd98e8412a6495e17a867. Change-Id: I8abe1494fd3df2f844a65f638a5515319454b46f --- .../tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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 be48236..aafb808 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 @@ -1386,7 +1386,15 @@ int WindowBaseEcoreWl2::GetNativeWindowId() EGLNativeWindowType WindowBaseEcoreWl2::CreateEglWindow( int width, int height ) { - mEglWindow = wl_egl_window_create( mWlSurface, width, height ); + int totalAngle = (mWindowRotationAngle + mScreenRotationAngle) % 360; + if( totalAngle == 90 || totalAngle == 270 ) + { + mEglWindow = wl_egl_window_create( mWlSurface, height, width ); + } + else + { + mEglWindow = wl_egl_window_create( mWlSurface, width, height ); + } return static_cast< EGLNativeWindowType >( mEglWindow ); } @@ -1587,6 +1595,7 @@ void WindowBaseEcoreWl2::SetAvailableAnlges( const std::vector< int >& angles ) void WindowBaseEcoreWl2::SetPreferredAngle( int angle ) { + DALI_LOG_RELEASE_INFO( "WindowBaseEcoreWl2::SetPreferredAngle, angle: %d\n", angle ); ecore_wl2_window_preferred_rotation_set( mEcoreWindow, angle ); } -- 2.7.4 From d15e8ea593966f1339142e90ed9841f5ac234427 Mon Sep 17 00:00:00 2001 From: Wonsik Jung Date: Tue, 2 Jun 2020 16:35:12 +0900 Subject: [PATCH 03/16] [Tizen] Call PostRender method of the surface if needed This reverts commit af69695e538867e01ea4a57948f06b97fd74fa9e. Change-Id: Icbd230ce1c0a4061b6440de97b5ab7dbc4fad98e --- dali/internal/adaptor/common/combined-update-render-controller.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dali/internal/adaptor/common/combined-update-render-controller.cpp b/dali/internal/adaptor/common/combined-update-render-controller.cpp index 0e20903..3bd8101 100644 --- a/dali/internal/adaptor/common/combined-update-render-controller.cpp +++ b/dali/internal/adaptor/common/combined-update-render-controller.cpp @@ -752,7 +752,10 @@ void CombinedUpdateRenderController::UpdateRenderThread() // Render the surface mCore.RenderScene( scene, false ); - windowSurface->PostRender( false, false, surfaceResized ); // Swap Buffer + if( renderStatus.NeedsPostRender() ) + { + windowSurface->PostRender( false, false, surfaceResized ); // Swap Buffer + } } } } -- 2.7.4 From 7e12b804069b4baedfbd6588cd238b4d5406e680 Mon Sep 17 00:00:00 2001 From: Joogab Yun Date: Mon, 8 Jun 2020 19:10:06 +0900 Subject: [PATCH 04/16] DALi Version 1.5.15 Change-Id: I3b8b0f9bb1d4d3ff852a88d552e9f030f7f845ab --- 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 28b3ebd..d89bb3f 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 = 14; +const unsigned int ADAPTOR_MICRO_VERSION = 15; const char * const ADAPTOR_BUILD_DATE = __DATE__ " " __TIME__; #ifdef DEBUG_ENABLED diff --git a/packaging/dali-adaptor.spec b/packaging/dali-adaptor.spec index acc28db..7a83814 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.14 +Version: 1.5.15 Release: 1 Group: System/Libraries License: Apache-2.0 and BSD-3-Clause and MIT -- 2.7.4 From 963448e91b17dfce9ba9b5ddc94f4371cf40c37a Mon Sep 17 00:00:00 2001 From: Joogab Yun Date: Mon, 8 Jun 2020 19:20:06 +0900 Subject: [PATCH 05/16] Revert "[Tizen] Call PostRender method of the surface if needed" This reverts commit d15e8ea593966f1339142e90ed9841f5ac234427. --- dali/internal/adaptor/common/combined-update-render-controller.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/dali/internal/adaptor/common/combined-update-render-controller.cpp b/dali/internal/adaptor/common/combined-update-render-controller.cpp index 3bd8101..0e20903 100644 --- a/dali/internal/adaptor/common/combined-update-render-controller.cpp +++ b/dali/internal/adaptor/common/combined-update-render-controller.cpp @@ -752,10 +752,7 @@ void CombinedUpdateRenderController::UpdateRenderThread() // Render the surface mCore.RenderScene( scene, false ); - if( renderStatus.NeedsPostRender() ) - { - windowSurface->PostRender( false, false, surfaceResized ); // Swap Buffer - } + windowSurface->PostRender( false, false, surfaceResized ); // Swap Buffer } } } -- 2.7.4 From aaf54893139a3f50086f3fb3b72f7c37d6ae7d14 Mon Sep 17 00:00:00 2001 From: Joogab Yun Date: Mon, 8 Jun 2020 19:20:09 +0900 Subject: [PATCH 06/16] Revert "[Tizen] Add check code with orientation in creating egl window." This reverts commit 34fbc68ac6e2fba939dd82c05aa294af93a21fcb. --- .../tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 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 aafb808..be48236 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 @@ -1386,15 +1386,7 @@ int WindowBaseEcoreWl2::GetNativeWindowId() EGLNativeWindowType WindowBaseEcoreWl2::CreateEglWindow( int width, int height ) { - int totalAngle = (mWindowRotationAngle + mScreenRotationAngle) % 360; - if( totalAngle == 90 || totalAngle == 270 ) - { - mEglWindow = wl_egl_window_create( mWlSurface, height, width ); - } - else - { - mEglWindow = wl_egl_window_create( mWlSurface, width, height ); - } + mEglWindow = wl_egl_window_create( mWlSurface, width, height ); return static_cast< EGLNativeWindowType >( mEglWindow ); } @@ -1595,7 +1587,6 @@ void WindowBaseEcoreWl2::SetAvailableAnlges( const std::vector< int >& angles ) void WindowBaseEcoreWl2::SetPreferredAngle( int angle ) { - DALI_LOG_RELEASE_INFO( "WindowBaseEcoreWl2::SetPreferredAngle, angle: %d\n", angle ); ecore_wl2_window_preferred_rotation_set( mEcoreWindow, angle ); } -- 2.7.4 From 9016ac471b829c4bff172578642420e95ea0fabf Mon Sep 17 00:00:00 2001 From: Joogab Yun Date: Mon, 8 Jun 2020 19:20:12 +0900 Subject: [PATCH 07/16] Revert "[Tizen] Add rotation's values to winBase-wl2" This reverts commit e4e48ef005c29d076be5096f6bf33b524fec6312. --- .../tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp | 15 +++++---------- .../tizen-wayland/ecore-wl2/window-base-ecore-wl2.h | 4 ---- 2 files changed, 5 insertions(+), 14 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 be48236..0a1bec4 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 @@ -762,11 +762,6 @@ 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 ); @@ -1575,14 +1570,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() ); - std::size_t size = angles.size(); - for( std::size_t i = 0; i < size; ++i ) + for( std::size_t i = 0; i < angles.size(); ++i ) { - mAvaiableWindowOrientations[i] = static_cast< int >( angles[i] ); - DALI_LOG_RELEASE_INFO( "%d ", mAvaiableWindowOrientations[i] ); + rotations[i] = static_cast< int >( angles[i] ); + DALI_LOG_RELEASE_INFO( "%d ", rotations[i] ); } - ecore_wl2_window_available_rotations_set( mEcoreWindow, mAvaiableWindowOrientations, size ); + ecore_wl2_window_available_rotations_set( mEcoreWindow, rotations, angles.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 4825a33..764b7d4 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 @@ -518,10 +518,6 @@ 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 From c4c023980cd0789d404798b0bb1198c06f229783 Mon Sep 17 00:00:00 2001 From: Joogab Yun Date: Mon, 8 Jun 2020 19:20:16 +0900 Subject: [PATCH 08/16] Revert "[Tizen] Add screen and client rotation itself function" This reverts commit 66a23802f346abdce94e3c590f6d7786a24b0adc. --- .../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 41ddf8f..7162a1c 100644 --- a/dali/integration-api/adaptor-framework/scene-holder-impl.cpp +++ b/dali/integration-api/adaptor-framework/scene-holder-impl.cpp @@ -191,7 +191,7 @@ void SceneHolder::SetSurface(Dali::RenderSurfaceInterface* surface) mScene.SurfaceReplaced(); - SurfaceResized( false ); + SurfaceResized(); unsigned int dpiHorizontal, dpiVertical; dpiHorizontal = dpiVertical = 0; @@ -204,11 +204,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 5851ab2..b21ca77 100755 --- a/dali/internal/window-system/common/window-impl.cpp +++ b/dali/internal/window-system/common/window-impl.cpp @@ -577,13 +577,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 ); @@ -643,13 +637,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 ); @@ -734,14 +722,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 ) ); } @@ -783,13 +765,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 8ecc906..c95d508 100644 --- a/dali/internal/window-system/common/window-render-surface.cpp +++ b/dali/internal/window-system/common/window-render-surface.cpp @@ -110,7 +110,6 @@ void WindowRenderSurface::Initialize( Any surface ) if( mScreenRotationAngle != 0 ) { mScreenRotationFinished = false; - mResizeFinished = false; } } @@ -141,6 +140,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 ); @@ -192,11 +197,6 @@ void WindowRenderSurface::GetDpi( unsigned int& dpiHorizontal, unsigned int& dpi dpiVertical = mDpiVertical; } -int WindowRenderSurface::GetOrientation() const -{ - return mWindowBase->GetOrientation(); -} - void WindowRenderSurface::InitializeGraphics() { mGraphics = &mAdaptor->GetGraphicsInterface(); @@ -358,11 +358,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 ); @@ -379,22 +379,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" ); @@ -507,7 +494,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 0a1bec4..dbd8aa6 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 @@ -692,10 +692,7 @@ WindowBaseEcoreWl2::WindowBaseEcoreWl2( Dali::PositionSize positionSize, Any sur mWindowPositionSize( positionSize ), mOwnSurface( false ), mMoveResizeSerial( 0 ), - mLastSubmittedMoveResizeSerial( 0 ), - mWindowRotationAngle( 0 ), - mScreenRotationAngle( 0 ), - mSupportedPreProtation( 0 ) + mLastSubmittedMoveResizeSerial( 0 ) #ifdef DALI_ELDBUS_AVAILABLE , mSystemConnection( NULL ) #endif @@ -1079,7 +1076,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" ); } } @@ -1089,7 +1086,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 ); @@ -1101,7 +1098,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; @@ -1117,7 +1114,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( "" ); @@ -1179,7 +1176,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( "" ); @@ -1521,10 +1518,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; } @@ -2278,16 +2274,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; @@ -2300,21 +2286,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 764b7d4..f429435 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; @@ -515,9 +504,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 fd2afc7f6dde3df01350aafb179629a656b2f0bc Mon Sep 17 00:00:00 2001 From: Joogab Yun Date: Mon, 8 Jun 2020 19:20:18 +0900 Subject: [PATCH 09/16] Revert "[Tizen] Add DALi Autofill implementation" This reverts commit 90394697f1fef1007d99a29facdf56bd06d7c241. --- 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 ae2dcc2..acc28db 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 b5f2cdf93fa1653539e614a148b782e7c6787367 Mon Sep 17 00:00:00 2001 From: Joogab Yun Date: Mon, 8 Jun 2020 19:20:21 +0900 Subject: [PATCH 10/16] Revert "[Tizen] Temporarily modified so that window is no null" This reverts commit fbf404b4b1d3e531d2b10ef3107dff2b252ccea7. --- .../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 454ad56c1b08b0a5499448760d0194046ee70daf Mon Sep 17 00:00:00 2001 From: Joogab Yun Date: Mon, 8 Jun 2020 19:20:38 +0900 Subject: [PATCH 11/16] [Tizen] Temporarily modified so that window is no null This reverts commit b5f2cdf93fa1653539e614a148b782e7c6787367. Change-Id: I4fb6282e0bf70d037c2c9db6ac7b45cea7e9fac0 --- .../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 e7eb6ae71d0d36fc248344c2014b0dbf61182a89 Mon Sep 17 00:00:00 2001 From: Joogab Yun Date: Mon, 8 Jun 2020 19:20:52 +0900 Subject: [PATCH 12/16] [Tizen] Add DALi Autofill implementation This reverts commit fd2afc7f6dde3df01350aafb179629a656b2f0bc. Change-Id: I4a9c41207d293d2961a63f187a4adecfaa209674 --- 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 7a83814..eea6dc4 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 31ef9b567bc133a2f527fabd975e90371065084d Mon Sep 17 00:00:00 2001 From: Joogab Yun Date: Mon, 8 Jun 2020 19:21:05 +0900 Subject: [PATCH 13/16] [Tizen] Add screen and client rotation itself function This reverts commit c4c023980cd0789d404798b0bb1198c06f229783. Change-Id: Ibdb60e709d85c1f4a1170cef4b448164f768cf81 --- .../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 7162a1c..41ddf8f 100644 --- a/dali/integration-api/adaptor-framework/scene-holder-impl.cpp +++ b/dali/integration-api/adaptor-framework/scene-holder-impl.cpp @@ -191,7 +191,7 @@ void SceneHolder::SetSurface(Dali::RenderSurfaceInterface* surface) mScene.SurfaceReplaced(); - SurfaceResized(); + SurfaceResized( false ); unsigned int dpiHorizontal, dpiVertical; dpiHorizontal = dpiVertical = 0; @@ -204,10 +204,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 b21ca77..5851ab2 100755 --- a/dali/internal/window-system/common/window-impl.cpp +++ b/dali/internal/window-system/common/window-impl.cpp @@ -577,7 +577,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 ); @@ -637,7 +643,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 ); @@ -722,8 +734,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 ) ); } @@ -765,7 +783,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 c95d508..8ecc906 100644 --- a/dali/internal/window-system/common/window-render-surface.cpp +++ b/dali/internal/window-system/common/window-render-surface.cpp @@ -110,6 +110,7 @@ void WindowRenderSurface::Initialize( Any surface ) if( mScreenRotationAngle != 0 ) { mScreenRotationFinished = false; + mResizeFinished = false; } } @@ -140,12 +141,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 ); @@ -197,6 +192,11 @@ void WindowRenderSurface::GetDpi( unsigned int& dpiHorizontal, unsigned int& dpi dpiVertical = mDpiVertical; } +int WindowRenderSurface::GetOrientation() const +{ + return mWindowBase->GetOrientation(); +} + void WindowRenderSurface::InitializeGraphics() { mGraphics = &mAdaptor->GetGraphicsInterface(); @@ -358,11 +358,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 ); @@ -379,9 +379,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" ); @@ -494,6 +507,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 dbd8aa6..0a1bec4 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 @@ -692,7 +692,10 @@ WindowBaseEcoreWl2::WindowBaseEcoreWl2( Dali::PositionSize positionSize, Any sur mWindowPositionSize( positionSize ), mOwnSurface( false ), mMoveResizeSerial( 0 ), - mLastSubmittedMoveResizeSerial( 0 ) + mLastSubmittedMoveResizeSerial( 0 ), + mWindowRotationAngle( 0 ), + mScreenRotationAngle( 0 ), + mSupportedPreProtation( 0 ) #ifdef DALI_ELDBUS_AVAILABLE , mSystemConnection( NULL ) #endif @@ -1076,7 +1079,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" ); } } @@ -1086,7 +1089,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 ); @@ -1098,7 +1101,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; @@ -1114,7 +1117,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( "" ); @@ -1176,7 +1179,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( "" ); @@ -1518,9 +1521,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; } @@ -2274,6 +2278,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; @@ -2286,15 +2300,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 f429435..764b7d4 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; @@ -504,6 +515,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 a0d8f118c92154409e8285d15138ac6928983537 Mon Sep 17 00:00:00 2001 From: Joogab Yun Date: Mon, 8 Jun 2020 19:21:18 +0900 Subject: [PATCH 14/16] [Tizen] Add rotation's values to winBase-wl2 This reverts commit 9016ac471b829c4bff172578642420e95ea0fabf. Change-Id: Id2aff1ac2c3355a06caf6468520080820a36b71c --- .../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 0a1bec4..be48236 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 @@ -762,6 +762,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 ); @@ -1570,14 +1575,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 764b7d4..4825a33 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 @@ -518,6 +518,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 From 5c702b1466680db1c1469a9397b5e5ac93b9d4ab Mon Sep 17 00:00:00 2001 From: Joogab Yun Date: Mon, 8 Jun 2020 19:21:33 +0900 Subject: [PATCH 15/16] [Tizen] Add check code with orientation in creating egl window. This reverts commit aaf54893139a3f50086f3fb3b72f7c37d6ae7d14. Change-Id: I9e6e88bd569ef9cbb401301e752eb661d6d89fa7 --- .../tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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 be48236..aafb808 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 @@ -1386,7 +1386,15 @@ int WindowBaseEcoreWl2::GetNativeWindowId() EGLNativeWindowType WindowBaseEcoreWl2::CreateEglWindow( int width, int height ) { - mEglWindow = wl_egl_window_create( mWlSurface, width, height ); + int totalAngle = (mWindowRotationAngle + mScreenRotationAngle) % 360; + if( totalAngle == 90 || totalAngle == 270 ) + { + mEglWindow = wl_egl_window_create( mWlSurface, height, width ); + } + else + { + mEglWindow = wl_egl_window_create( mWlSurface, width, height ); + } return static_cast< EGLNativeWindowType >( mEglWindow ); } @@ -1587,6 +1595,7 @@ void WindowBaseEcoreWl2::SetAvailableAnlges( const std::vector< int >& angles ) void WindowBaseEcoreWl2::SetPreferredAngle( int angle ) { + DALI_LOG_RELEASE_INFO( "WindowBaseEcoreWl2::SetPreferredAngle, angle: %d\n", angle ); ecore_wl2_window_preferred_rotation_set( mEcoreWindow, angle ); } -- 2.7.4 From 59826ecb77bb226fc0f40e3bfc35a43aff5b39b3 Mon Sep 17 00:00:00 2001 From: Wonsik Jung Date: Wed, 6 May 2020 09:19:41 +0900 Subject: [PATCH 16/16] [Tizen] Fix screen rotation bug when application is initialized. When DALi application initialized, DALi checks the value of screen rotation. After that, DALi does not work the screen rotation's process. To fix, the valid output transform event is used the init time. Change-Id: Ia1e238d97c4fed751bc4a4abef71d66b356bf3c4 --- dali/internal/window-system/common/window-impl.cpp | 1 + .../window-system/common/window-render-surface.cpp | 26 +++------------------- 2 files changed, 4 insertions(+), 23 deletions(-) diff --git a/dali/internal/window-system/common/window-impl.cpp b/dali/internal/window-system/common/window-impl.cpp index 5851ab2..ac3ccc1 100755 --- a/dali/internal/window-system/common/window-impl.cpp +++ b/dali/internal/window-system/common/window-impl.cpp @@ -739,6 +739,7 @@ void Window::OnOutputTransformed() { forceUpdate = true; } + DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), OnOutputTransformed()\n", this, mNativeWindowId ); SurfaceResized( forceUpdate ); PositionSize positionSize = mSurface->GetPositionSize(); diff --git a/dali/internal/window-system/common/window-render-surface.cpp b/dali/internal/window-system/common/window-render-surface.cpp index 8ecc906..dacb89e 100644 --- a/dali/internal/window-system/common/window-render-surface.cpp +++ b/dali/internal/window-system/common/window-render-surface.cpp @@ -104,14 +104,6 @@ void WindowRenderSurface::Initialize( Any surface ) // Connect signals mWindowBase->OutputTransformedSignal().Connect( this, &WindowRenderSurface::OutputTransformed ); - - // Check screen rotation - mScreenRotationAngle = mWindowBase->GetScreenRotationAngle(); - if( mScreenRotationAngle != 0 ) - { - mScreenRotationFinished = false; - mResizeFinished = false; - } } Any WindowRenderSurface::GetNativeWindow() @@ -222,20 +214,8 @@ void WindowRenderSurface::CreateSurface() { DALI_LOG_TRACE_METHOD( gWindowRenderSurfaceLogFilter ); - int width, height; - if( mScreenRotationAngle == 0 || mScreenRotationAngle == 180 ) - { - width = mPositionSize.width; - height = mPositionSize.height; - } - else - { - width = mPositionSize.height; - height = mPositionSize.width; - } - // Create the EGL window - EGLNativeWindowType window = mWindowBase->CreateEglWindow( width, height ); + EGLNativeWindowType window = mWindowBase->CreateEglWindow( mPositionSize.width, mPositionSize.height ); auto eglGraphics = static_cast(mGraphics); @@ -511,11 +491,11 @@ void WindowRenderSurface::OutputTransformed() mOutputTransformedSignal.Emit(); - DALI_LOG_INFO( gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::OutputTransformed: angle = %d screen rotation = %d\n", mRotationAngle, mScreenRotationAngle ); + DALI_LOG_RELEASE_INFO( "WindowRenderSurface::OutputTransformed: window = %d screen = %d\n", mRotationAngle, mScreenRotationAngle ); } else { - DALI_LOG_INFO( gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::OutputTransformed: Ignore output transform [%d]\n", mScreenRotationAngle ); + DALI_LOG_RELEASE_INFO( "WindowRenderSurface::OutputTransformed: Ignore output transform [%d]\n", mScreenRotationAngle ); } } -- 2.7.4