From a10ed86b31c1f692f4f30bd9dfa9b73f756397f0 Mon Sep 17 00:00:00 2001 From: "Seungho, Baek" Date: Tue, 14 Jul 2020 18:52:33 +0900 Subject: [PATCH 01/16] Revert "[Tizen] Add check code with orientation in creating egl window." This reverts commit 20a704c4d5e2b8837ca9e7fa052eeee7f27641db. --- .../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 6c10d95..08c168f 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 1862fe6e03f51192ae0dd24babce74f87ce69e6d Mon Sep 17 00:00:00 2001 From: "Seungho, Baek" Date: Tue, 14 Jul 2020 18:52:35 +0900 Subject: [PATCH 02/16] Revert "[Tizen] Add rotation's values to winBase-wl2" This reverts commit ceab8e84637a8bfcbbefaeca7bc5075c5d6ec370. --- .../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 08c168f..091d959 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 1e2e28a..d631927 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 @@ -528,10 +528,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 581da58269269d401555624c55cb6db49161830a Mon Sep 17 00:00:00 2001 From: "Seungho, Baek" Date: Tue, 14 Jul 2020 18:52:39 +0900 Subject: [PATCH 03/16] Revert "[Tizen] Add screen and client rotation itself function" This reverts commit b5cb1a3ad7463ef83cea56ca7bceb78d7b387ed2. --- .../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 bfe300c..6de1182 100644 --- a/dali/integration-api/adaptor-framework/render-surface-interface.h +++ b/dali/integration-api/adaptor-framework/render-surface-interface.h @@ -107,12 +107,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 c5a9751..e296ea1 100644 --- a/dali/integration-api/adaptor-framework/scene-holder-impl.cpp +++ b/dali/integration-api/adaptor-framework/scene-holder-impl.cpp @@ -192,7 +192,7 @@ void SceneHolder::SetSurface(Dali::RenderSurfaceInterface* surface) mScene.SurfaceReplaced(); - SurfaceResized( false ); + SurfaceResized(); unsigned int dpiHorizontal, dpiVertical; dpiHorizontal = dpiVertical = 0; @@ -206,11 +206,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 ) ); GraphicsInterface& graphics = mAdaptor->GetGraphicsInterface(); EglGraphics* eglGraphics = static_cast(&graphics); diff --git a/dali/integration-api/adaptor-framework/scene-holder-impl.h b/dali/integration-api/adaptor-framework/scene-holder-impl.h index f11bfa2..38560cf 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 1d12c41..a5daaa2 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 b9a6442..15be716 100755 --- a/dali/internal/window-system/common/window-impl.cpp +++ b/dali/internal/window-system/common/window-impl.cpp @@ -624,13 +624,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 ); @@ -704,13 +698,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 ); @@ -816,14 +804,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 ) ); } @@ -865,13 +847,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 8c58c9b..9c60476 100644 --- a/dali/internal/window-system/common/window-render-surface.cpp +++ b/dali/internal/window-system/common/window-render-surface.cpp @@ -112,7 +112,6 @@ void WindowRenderSurface::Initialize( Any surface ) if( mScreenRotationAngle != 0 ) { mScreenRotationFinished = false; - mResizeFinished = false; } } @@ -143,6 +142,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 ); @@ -194,11 +199,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(); @@ -419,11 +419,11 @@ bool WindowRenderSurface::PreRender( bool resizingSurface, const std::vectorSetEglWindowRotation( totalAngle ); mWindowBase->SetEglWindowBufferTransform( totalAngle ); @@ -440,22 +440,9 @@ bool WindowRenderSurface::PreRender( bool resizingSurface, const std::vectorResizeEglWindow( positionSize ); + mWindowBase->ResizeEglWindow( mPositionSize ); mResizeFinished = true; DALI_LOG_INFO( gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::PreRender: Set resize\n" ); @@ -573,7 +560,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 c4439b2..6f982e4 100644 --- a/dali/internal/window-system/common/window-render-surface.h +++ b/dali/internal/window-system/common/window-render-surface.h @@ -127,12 +127,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 35b27e4..ac6879d 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 1f78350..d9116e1 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; @@ -496,9 +485,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 091d959..754fa5a 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 d631927..dad079d 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; @@ -525,9 +514,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 6c5b8da..48069c7 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 f4a6626..bfca63c 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 462279a..527f5cc 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 a2bc3ee..ebedfef 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 8a7add1..ecc9e07 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 8c7cb11..bdbe0a8 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 c846e54..7697790 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 f034d85..48c0560 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 4c6ca3d0b10e2e0028beae7c0738648d02e2caf5 Mon Sep 17 00:00:00 2001 From: "Seungho, Baek" Date: Tue, 14 Jul 2020 18:52:42 +0900 Subject: [PATCH 04/16] Revert "[Tizen] Add DALi Autofill implementation" This reverts commit c588200b316d5b7a3c5a9796e7029721a400ccee. --- 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 14aaaea..5d0ec0a 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 7421798..ea7e10d 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" ) @@ -132,13 +129,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 ) @@ -291,8 +281,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 3530a68..789939d 100755 --- a/dali/devel-api/file.list +++ b/dali/devel-api/file.list @@ -4,9 +4,6 @@ SET( devel_api_src_files ${adaptor_devel_api_dir}/adaptor-framework/accessibility-adaptor.cpp ${adaptor_devel_api_dir}/adaptor-framework/animated-image-loading.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 @@ -48,9 +45,6 @@ SET( devel_api_adaptor_framework_header_files ${adaptor_devel_api_dir}/adaptor-framework/animated-image-loading.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 a7b1b4d..6d0908f 100644 --- a/packaging/dali-adaptor.spec +++ b/packaging/dali-adaptor.spec @@ -108,11 +108,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) @@ -308,7 +303,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" cmake_flags+=" -DCOMPONENT_APPLICATION_SUPPORT=YES" -- 2.7.4 From 21e870fd644e69309f018fd8c78ad1baad28a43b Mon Sep 17 00:00:00 2001 From: "Seungho, Baek" Date: Tue, 14 Jul 2020 18:52:46 +0900 Subject: [PATCH 05/16] Revert "[Tizen] Temporarily modified so that window is no null" This reverts commit 86f0bd1a4b30ef0996d54c041fd97d35772aabc5. --- .../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 817819d117c3bd532b08dd884205aad338f694bf Mon Sep 17 00:00:00 2001 From: "Seungho, Baek" Date: Tue, 14 Jul 2020 18:52:56 +0900 Subject: [PATCH 06/16] [Tizen] Temporarily modified so that window is no null This reverts commit 21e870fd644e69309f018fd8c78ad1baad28a43b. Change-Id: I597ee4298464c22f55cc6d78155aa93cc3385790 --- .../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 cd7955a1890f70153f7199d506ef95f18e76f352 Mon Sep 17 00:00:00 2001 From: "Seungho, Baek" Date: Tue, 14 Jul 2020 18:53:10 +0900 Subject: [PATCH 07/16] [Tizen] Add DALi Autofill implementation This reverts commit 4c6ca3d0b10e2e0028beae7c0738648d02e2caf5. Change-Id: Id3d0afdae142fa5a6a1229ab59725f884725ed0f --- 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 5d0ec0a..14aaaea 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 ea7e10d..7421798 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" ) @@ -129,6 +132,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 ) @@ -281,6 +291,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 789939d..3530a68 100755 --- a/dali/devel-api/file.list +++ b/dali/devel-api/file.list @@ -4,6 +4,9 @@ SET( devel_api_src_files ${adaptor_devel_api_dir}/adaptor-framework/accessibility-adaptor.cpp ${adaptor_devel_api_dir}/adaptor-framework/animated-image-loading.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 @@ -45,6 +48,9 @@ SET( devel_api_adaptor_framework_header_files ${adaptor_devel_api_dir}/adaptor-framework/animated-image-loading.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 6d0908f..a7b1b4d 100644 --- a/packaging/dali-adaptor.spec +++ b/packaging/dali-adaptor.spec @@ -108,6 +108,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) @@ -303,6 +308,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" cmake_flags+=" -DCOMPONENT_APPLICATION_SUPPORT=YES" -- 2.7.4 From d7297370f47892a886082786e8120dcdfe3b5608 Mon Sep 17 00:00:00 2001 From: "Seungho, Baek" Date: Tue, 14 Jul 2020 18:53:20 +0900 Subject: [PATCH 08/16] [Tizen] Add screen and client rotation itself function This reverts commit 581da58269269d401555624c55cb6db49161830a. Change-Id: I41074185c24bd2b45c0dfeb38b3465c854db69a2 --- .../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 6de1182..bfe300c 100644 --- a/dali/integration-api/adaptor-framework/render-surface-interface.h +++ b/dali/integration-api/adaptor-framework/render-surface-interface.h @@ -107,6 +107,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 e296ea1..c5a9751 100644 --- a/dali/integration-api/adaptor-framework/scene-holder-impl.cpp +++ b/dali/integration-api/adaptor-framework/scene-holder-impl.cpp @@ -192,7 +192,7 @@ void SceneHolder::SetSurface(Dali::RenderSurfaceInterface* surface) mScene.SurfaceReplaced(); - SurfaceResized(); + SurfaceResized( false ); unsigned int dpiHorizontal, dpiVertical; dpiHorizontal = dpiVertical = 0; @@ -206,10 +206,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 ); GraphicsInterface& graphics = mAdaptor->GetGraphicsInterface(); EglGraphics* eglGraphics = static_cast(&graphics); diff --git a/dali/integration-api/adaptor-framework/scene-holder-impl.h b/dali/integration-api/adaptor-framework/scene-holder-impl.h index 38560cf..f11bfa2 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 a5daaa2..1d12c41 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 15be716..b9a6442 100755 --- a/dali/internal/window-system/common/window-impl.cpp +++ b/dali/internal/window-system/common/window-impl.cpp @@ -624,7 +624,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 ); @@ -698,7 +704,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 ); @@ -804,8 +816,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 ) ); } @@ -847,7 +865,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 9c60476..8c58c9b 100644 --- a/dali/internal/window-system/common/window-render-surface.cpp +++ b/dali/internal/window-system/common/window-render-surface.cpp @@ -112,6 +112,7 @@ void WindowRenderSurface::Initialize( Any surface ) if( mScreenRotationAngle != 0 ) { mScreenRotationFinished = false; + mResizeFinished = false; } } @@ -142,12 +143,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 ); @@ -199,6 +194,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(); @@ -419,11 +419,11 @@ bool WindowRenderSurface::PreRender( bool resizingSurface, const std::vectorSetEglWindowRotation( totalAngle ); mWindowBase->SetEglWindowBufferTransform( totalAngle ); @@ -440,9 +440,22 @@ bool WindowRenderSurface::PreRender( bool resizingSurface, const std::vectorResizeEglWindow( 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" ); @@ -560,6 +573,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 6f982e4..c4439b2 100644 --- a/dali/internal/window-system/common/window-render-surface.h +++ b/dali/internal/window-system/common/window-render-surface.h @@ -127,6 +127,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 ac6879d..35b27e4 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 d9116e1..1f78350 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; @@ -485,6 +496,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 754fa5a..091d959 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 dad079d..d631927 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; @@ -514,6 +525,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 48069c7..6c5b8da 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 bfca63c..f4a6626 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 527f5cc..462279a 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 ebedfef..a2bc3ee 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 ecc9e07..8a7add1 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 bdbe0a8..8c7cb11 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 7697790..c846e54 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 48c0560..f034d85 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 e5c810bb11e22b545697377a3523db6242cfb9be Mon Sep 17 00:00:00 2001 From: "Seungho, Baek" Date: Tue, 14 Jul 2020 18:53:30 +0900 Subject: [PATCH 09/16] [Tizen] Add rotation's values to winBase-wl2 This reverts commit 1862fe6e03f51192ae0dd24babce74f87ce69e6d. Change-Id: I16fa85cd3871fa6fd8d2d8cb72e6bf6ee1f93803 --- .../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 091d959..08c168f 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 d631927..1e2e28a 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 @@ -528,6 +528,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 105e7e07e0cb709b33081fd6ee3e793cd38a59c8 Mon Sep 17 00:00:00 2001 From: "Seungho, Baek" Date: Tue, 14 Jul 2020 18:53:40 +0900 Subject: [PATCH 10/16] [Tizen] Add check code with orientation in creating egl window. This reverts commit a10ed86b31c1f692f4f30bd9dfa9b73f756397f0. Change-Id: Ic7c23f5578788f878669d223e0f2d872e55459ef --- .../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 08c168f..6c10d95 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 2164741fa94cd6b39da157a1fe7a9fc65392e4ee Mon Sep 17 00:00:00 2001 From: "Seungho, Baek" Date: Tue, 14 Jul 2020 18:53:50 +0900 Subject: [PATCH 11/16] [Tizen] Fix screen rotation bug when application is initialized. This reverts commit 6ff7eef978f70d112409e89c77dd5b3a8eda09eb. Change-Id: If753d444919eee33202d5f16de4b8ccbe487c145 --- 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 b9a6442..0249cf8 100755 --- a/dali/internal/window-system/common/window-impl.cpp +++ b/dali/internal/window-system/common/window-impl.cpp @@ -821,6 +821,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 8c58c9b..3dfc05b 100644 --- a/dali/internal/window-system/common/window-render-surface.cpp +++ b/dali/internal/window-system/common/window-render-surface.cpp @@ -106,14 +106,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() @@ -224,20 +216,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); @@ -577,11 +557,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 From a72a4a20fe0480687c411086e4291eb7e104f9db Mon Sep 17 00:00:00 2001 From: "Seungho, Baek" Date: Tue, 14 Jul 2020 18:53:59 +0900 Subject: [PATCH 12/16] [Tizen] remove setenv() that can cause Seg fault This reverts commit c233992c9b529d75cfdabd05025871fee2c599b1. Change-Id: I7ab2d7bc589aabeb91bf6fdf08065ee14a3dab07 --- dali/internal/adaptor/common/adaptor-impl.cpp | 1 - .../window-system/tizen-wayland/native-render-surface-ecore-wl.cpp | 1 - 2 files changed, 2 deletions(-) diff --git a/dali/internal/adaptor/common/adaptor-impl.cpp b/dali/internal/adaptor/common/adaptor-impl.cpp index 58f9c85..1d845aa 100755 --- a/dali/internal/adaptor/common/adaptor-impl.cpp +++ b/dali/internal/adaptor/common/adaptor-impl.cpp @@ -389,7 +389,6 @@ void Adaptor::Start() else { unsigned int maxTextureSize = mConfigurationManager->GetMaxTextureSize(); - setenv( DALI_ENV_MAX_TEXTURE_SIZE, std::to_string( maxTextureSize ).c_str(), 1 ); Dali::TizenPlatform::ImageLoader::SetMaxTextureSize( maxTextureSize ); } 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 6c5b8da..066fac6 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 @@ -150,7 +150,6 @@ int NativeRenderSurfaceEcoreWl::GetOrientation() const void NativeRenderSurfaceEcoreWl::InitializeGraphics() { DALI_LOG_TRACE_METHOD( gNativeSurfaceLogFilter ); - unsetenv( "EGL_PLATFORM" ); mGraphics = &mAdaptor->GetGraphicsInterface(); auto eglGraphics = static_cast(mGraphics); -- 2.7.4 From 528fd9feb690dae13ccec1926824789dc12208b4 Mon Sep 17 00:00:00 2001 From: Adeel Kazmi Date: Wed, 22 Jul 2020 16:25:42 +0100 Subject: [PATCH 13/16] [Tizen] (WebP Loader) Ensure member variables are initialised (SVACE issue) Change-Id: Id1a5d8456496b82d5bdf80ebebf54919cdab9634 --- dali/internal/imaging/common/webp-loading.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/dali/internal/imaging/common/webp-loading.cpp b/dali/internal/imaging/common/webp-loading.cpp index d3031fa..93a88b5 100644 --- a/dali/internal/imaging/common/webp-loading.cpp +++ b/dali/internal/imaging/common/webp-loading.cpp @@ -65,8 +65,7 @@ struct WebPLoading::Impl { public: Impl( const std::string& url, bool isLocalResource ) - : mUrl( url ), - mLoadingFrame( 0 ) + : mUrl( url ) { #ifdef DALI_WEBP_ENABLED if( ReadWebPInformation( isLocalResource ) ) @@ -180,12 +179,12 @@ public: std::string mUrl; std::vector mTimeStamp; - uint32_t mLoadingFrame; + uint32_t mLoadingFrame{0}; #ifdef DALI_WEBP_ENABLED - WebPData mWebPData; - WebPAnimDecoder* mWebPAnimDecoder; - WebPAnimInfo mWebPAnimInfo; + WebPData mWebPData{0}; + WebPAnimDecoder* mWebPAnimDecoder{nullptr}; + WebPAnimInfo mWebPAnimInfo{0}; #endif }; -- 2.7.4 From 90abc75928c3c99d9c72bba65273141177642d1e Mon Sep 17 00:00:00 2001 From: seungho Date: Mon, 24 Aug 2020 11:12:01 +0900 Subject: [PATCH 14/16] [Tizen] Fix coverity error of gif-loading Change-Id: I810e0b78adc101b7d1643d2265b3b77636c03339 Signed-off-by: seungho --- dali/internal/imaging/common/gif-loading.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/dali/internal/imaging/common/gif-loading.cpp b/dali/internal/imaging/common/gif-loading.cpp index 187d91c..9e34c36 100644 --- a/dali/internal/imaging/common/gif-loading.cpp +++ b/dali/internal/imaging/common/gif-loading.cpp @@ -494,10 +494,6 @@ bool DecodeImage( GifFileType *gif, uint32_t *data, int rowpix, int xin, int yin // what we need is image size. SavedImage *sp; sp = &gif->SavedImages[ gif->ImageCount - 1 ]; - if( !sp ) - { - goto on_error; - } gifW = sp->ImageDesc.Width; gifH = sp->ImageDesc.Height; -- 2.7.4 From c5ac345f99d4bf327f2f4425019e006c3bb184c2 Mon Sep 17 00:00:00 2001 From: Seoyeon Kim Date: Wed, 9 Sep 2020 14:55:04 +0900 Subject: [PATCH 15/16] [Tizen] Add deprecated logs to Adaptor and Application - DALi projects are deprecated now, so added deprecated logs to major classes. Change-Id: Id1874a9909adff9b3b4e5227732e2a62b17404e2 Signed-off-by: Seoyeon Kim --- dali/internal/adaptor/common/adaptor.cpp | 10 ++++++++++ dali/public-api/adaptor-framework/application.cpp | 7 +++++++ dali/public-api/adaptor-framework/application.h | 12 ++++++++++++ doc/dali-adaptor-doc.h | 2 +- 4 files changed, 30 insertions(+), 1 deletion(-) diff --git a/dali/internal/adaptor/common/adaptor.cpp b/dali/internal/adaptor/common/adaptor.cpp index 9551d82..74c7773 100755 --- a/dali/internal/adaptor/common/adaptor.cpp +++ b/dali/internal/adaptor/common/adaptor.cpp @@ -34,11 +34,13 @@ namespace Dali Adaptor& Adaptor::New( Window window ) { + DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: DALi is deprecated and will be removed from next version. Please use NUI(C# interface of DALi).\n For more information on NUI, see the NUI quick start page : https://docs.tizen.org/application/dotnet/get-started/nui/quickstart/ \n" ); return New( window, Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS ); } Adaptor& Adaptor::New( Window window, Configuration::ContextLoss configuration ) { + DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: DALi is deprecated and will be removed from next version. Please use NUI(C# interface of DALi).\n For more information on NUI, see the NUI quick start page : https://docs.tizen.org/application/dotnet/get-started/nui/quickstart/ \n" ); Internal::Adaptor::SceneHolder* sceneHolder = &Dali::GetImplementation( window ); Adaptor* adaptor = Internal::Adaptor::Adaptor::New( Dali::Integration::SceneHolder( sceneHolder ), configuration, NULL ); return *adaptor; @@ -46,11 +48,13 @@ Adaptor& Adaptor::New( Window window, Configuration::ContextLoss configuration ) Adaptor& Adaptor::New( Window window, const Dali::RenderSurfaceInterface& surface ) { + DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: DALi is deprecated and will be removed from next version. Please use NUI(C# interface of DALi).\n For more information on NUI, see the NUI quick start page : https://docs.tizen.org/application/dotnet/get-started/nui/quickstart/ \n" ); return New( window, surface, Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS ); } Adaptor& Adaptor::New( Window window, const Dali::RenderSurfaceInterface& surface, Configuration::ContextLoss configuration ) { + DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: DALi is deprecated and will be removed from next version. Please use NUI(C# interface of DALi).\n For more information on NUI, see the NUI quick start page : https://docs.tizen.org/application/dotnet/get-started/nui/quickstart/ \n" ); Internal::Adaptor::SceneHolder* sceneHolder = &Dali::GetImplementation( window ); Dali::RenderSurfaceInterface* pSurface = const_cast(&surface); Adaptor* adaptor = Internal::Adaptor::Adaptor::New( Dali::Integration::SceneHolder( sceneHolder ), pSurface, configuration, NULL ); @@ -59,22 +63,26 @@ Adaptor& Adaptor::New( Window window, const Dali::RenderSurfaceInterface& surfac Adaptor& Adaptor::New( Dali::Integration::SceneHolder window ) { + DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: DALi is deprecated and will be removed from next version. Please use NUI(C# interface of DALi).\n For more information on NUI, see the NUI quick start page : https://docs.tizen.org/application/dotnet/get-started/nui/quickstart/ \n" ); return New( window, Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS ); } Adaptor& Adaptor::New( Dali::Integration::SceneHolder window, Configuration::ContextLoss configuration ) { + DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: DALi is deprecated and will be removed from next version. Please use NUI(C# interface of DALi).\n For more information on NUI, see the NUI quick start page : https://docs.tizen.org/application/dotnet/get-started/nui/quickstart/ \n" ); Adaptor* adaptor = Internal::Adaptor::Adaptor::New( window, configuration, NULL ); return *adaptor; } Adaptor& Adaptor::New( Dali::Integration::SceneHolder window, const Dali::RenderSurfaceInterface& surface ) { + DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: DALi is deprecated and will be removed from next version. Please use NUI(C# interface of DALi).\n For more information on NUI, see the NUI quick start page : https://docs.tizen.org/application/dotnet/get-started/nui/quickstart/ \n" ); return New( window, surface, Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS ); } Adaptor& Adaptor::New( Dali::Integration::SceneHolder window, const Dali::RenderSurfaceInterface& surface, Configuration::ContextLoss configuration ) { + DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: DALi is deprecated and will be removed from next version. Please use NUI(C# interface of DALi).\n For more information on NUI, see the NUI quick start page : https://docs.tizen.org/application/dotnet/get-started/nui/quickstart/ \n" ); Dali::RenderSurfaceInterface* pSurface = const_cast(&surface); Adaptor* adaptor = Internal::Adaptor::Adaptor::New( window, pSurface, configuration, NULL ); return *adaptor; @@ -87,6 +95,7 @@ Adaptor::~Adaptor() void Adaptor::Start() { + DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: DALi is deprecated and will be removed from next version. Please use NUI(C# interface of DALi).\n For more information on NUI, see the NUI quick start page : https://docs.tizen.org/application/dotnet/get-started/nui/quickstart/ \n" ); mImpl->Start(); } @@ -192,6 +201,7 @@ void Adaptor::SetPreRenderCallback( CallbackBase* callback ) Adaptor& Adaptor::Get() { + DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: DALi is deprecated and will be removed from next version. Please use NUI(C# interface of DALi).\n For more information on NUI, see the NUI quick start page : https://docs.tizen.org/application/dotnet/get-started/nui/quickstart/ \n" ); return Internal::Adaptor::Adaptor::Get(); } diff --git a/dali/public-api/adaptor-framework/application.cpp b/dali/public-api/adaptor-framework/application.cpp index 8aa2318..5f5882c 100644 --- a/dali/public-api/adaptor-framework/application.cpp +++ b/dali/public-api/adaptor-framework/application.cpp @@ -29,11 +29,13 @@ namespace Dali Application Application::New() { + DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: DALi is deprecated and will be removed from next version. Please use NUI(C# interface of DALi).\n For more information on NUI, see the NUI quick start page : https://docs.tizen.org/application/dotnet/get-started/nui/quickstart/ \n" ); return New( NULL, NULL ); } Application Application::New( int* argc, char **argv[] ) { + DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: DALi is deprecated and will be removed from next version. Please use NUI(C# interface of DALi).\n For more information on NUI, see the NUI quick start page : https://docs.tizen.org/application/dotnet/get-started/nui/quickstart/ \n" ); Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::GetPreInitializedApplication(); if( internal ) { @@ -56,6 +58,7 @@ Application Application::New( int* argc, char **argv[] ) Application Application::New( int* argc, char **argv[], const std::string& stylesheet ) { + DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: DALi is deprecated and will be removed from next version. Please use NUI(C# interface of DALi).\n For more information on NUI, see the NUI quick start page : https://docs.tizen.org/application/dotnet/get-started/nui/quickstart/ \n" ); Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::GetPreInitializedApplication(); if( internal ) { @@ -79,6 +82,7 @@ Application Application::New( int* argc, char **argv[], const std::string& style Application Application::New( int* argc, char **argv[], const std::string& stylesheet, WINDOW_MODE windowMode ) { + DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: DALi is deprecated and will be removed from next version. Please use NUI(C# interface of DALi).\n For more information on NUI, see the NUI quick start page : https://docs.tizen.org/application/dotnet/get-started/nui/quickstart/ \n" ); Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::GetPreInitializedApplication(); if( internal ) { @@ -104,6 +108,7 @@ Application Application::New( int* argc, char **argv[], const std::string& style Application Application::New( int* argc, char **argv[], const std::string& stylesheet, Application::WINDOW_MODE windowMode, PositionSize positionSize ) { + DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: DALi is deprecated and will be removed from next version. Please use NUI(C# interface of DALi).\n For more information on NUI, see the NUI quick start page : https://docs.tizen.org/application/dotnet/get-started/nui/quickstart/ \n" ); Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::GetPreInitializedApplication(); if( internal ) { @@ -152,11 +157,13 @@ Application& Application::operator=(const Application& application) void Application::MainLoop() { + DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: DALi is deprecated and will be removed from next version. Please use NUI(C# interface of DALi).\n For more information on NUI, see the NUI quick start page : https://docs.tizen.org/application/dotnet/get-started/nui/quickstart/ \n" ); Internal::Adaptor::GetImplementation(*this).MainLoop(Configuration::APPLICATION_HANDLES_CONTEXT_LOSS); } void Application::MainLoop(Configuration::ContextLoss configuration) { + DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: DALi is deprecated and will be removed from next version. Please use NUI(C# interface of DALi).\n For more information on NUI, see the NUI quick start page : https://docs.tizen.org/application/dotnet/get-started/nui/quickstart/ \n" ); Internal::Adaptor::GetImplementation(*this).MainLoop(configuration); } diff --git a/dali/public-api/adaptor-framework/application.h b/dali/public-api/adaptor-framework/application.h index 38dec63..ce7747e 100644 --- a/dali/public-api/adaptor-framework/application.h +++ b/dali/public-api/adaptor-framework/application.h @@ -43,6 +43,8 @@ class Application; } } /** + * @DEPRECATED_1_5.19 + * * @brief An Application class object should be created by every application * that wishes to use Dali. * @@ -124,6 +126,8 @@ public: public: /** + * @DEPRECATED_1_5.19 + * * @brief This is the constructor for applications without an argument list. * @SINCE_1_0.0 * @PRIVLEVEL_PUBLIC @@ -133,6 +137,8 @@ public: static Application New(); /** + * @DEPRECATED_1_5.19 + * * @brief This is the constructor for applications. * * @SINCE_1_0.0 @@ -145,6 +151,8 @@ public: static Application New( int* argc, char **argv[] ); /** + * @DEPRECATED_1_5.19 + * * @brief This is the constructor for applications with a name. * * @SINCE_1_0.0 @@ -159,6 +167,8 @@ public: static Application New( int* argc, char **argv[], const std::string& stylesheet ); /** + * @DEPRECATED_1_5.19 + * * @brief This is the constructor for applications with a name. * * @SINCE_1_0.0 @@ -174,6 +184,8 @@ public: static Application New( int* argc, char **argv[], const std::string& stylesheet, WINDOW_MODE windowMode ); /** + * @DEPRECATED_1_5.19 + * * @brief This is the constructor for applications. * * @SINCE_1_2.60 diff --git a/doc/dali-adaptor-doc.h b/doc/dali-adaptor-doc.h index bdded7b..513b424 100644 --- a/doc/dali-adaptor-doc.h +++ b/doc/dali-adaptor-doc.h @@ -19,7 +19,7 @@ */ /** - * @defgroup dali_adaptor DALi Adaptor + * @defgroup dali_adaptor DALi Adaptor (Deprecated) * * @brief DALi Adaptor is a platform adaptation layer. * -- 2.7.4 From ba86df0204329c252f04c2148550f0a68109d0b8 Mon Sep 17 00:00:00 2001 From: Heeyong Song Date: Thu, 4 Feb 2021 14:43:05 +0900 Subject: [PATCH 16/16] [Tizen] Fix SVACE issue Change-Id: If8c8f2c61248125dca481e308148bd5cc584bb6d --- dali/internal/imaging/common/loader-png.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dali/internal/imaging/common/loader-png.cpp b/dali/internal/imaging/common/loader-png.cpp index 4b51af3..55a3149 100755 --- a/dali/internal/imaging/common/loader-png.cpp +++ b/dali/internal/imaging/common/loader-png.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 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. @@ -308,6 +308,12 @@ bool LoadBitmapFromPng( const Dali::ImageLoader::Input& input, Dali::Devel::Pixe DALI_ASSERT_DEBUG(pixels); rows = reinterpret_cast< png_bytep* >( malloc(sizeof(png_bytep) * height) ); + if(!rows) + { + DALI_LOG_ERROR("malloc is failed\n"); + return false; + } + for(y=0; y