PositionSize API at dali-toolkit-test-utils/toolkit-window.cpp
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / dali-toolkit-test-utils / toolkit-window.cpp
index 3c01e99..cfdee85 100644 (file)
@@ -46,6 +46,8 @@ namespace Adaptor
 Window::Window( const PositionSize& positionSize )
 : SceneHolder( positionSize ),
   mFocusChangeSignal(),
+  mResizeSignal(),
+  mRotationAngle(90), // dummy angle for test coverage
   mVisibilityChangedSignal()
 {
 }
@@ -55,6 +57,27 @@ Window* Window::New(const PositionSize& positionSize, const std::string& name, c
   return new Window( positionSize );
 }
 
+WindowPosition Window::GetPosition() const
+{
+  PositionSize positionSize = mRenderSurface.GetPositionSize();
+
+  return WindowPosition(positionSize.x, positionSize.y);
+}
+
+PositionSize Window::GetPositionSize() const
+{
+  return mRenderSurface.GetPositionSize();
+}
+
+void Window::SetPositionSize(PositionSize positionSize)
+{
+  mRenderSurface.MoveResize(positionSize);
+
+  Uint16Pair newSize(positionSize.width, positionSize.height);
+  Dali::Window handle(this);
+  mResizeSignal.Emit(handle, newSize);
+}
+
 } // Adaptor
 } // Internal
 
@@ -80,16 +103,13 @@ Window::~Window()
 {
 }
 
-Window::Window(const Window& handle)
-: BaseHandle( handle )
-{
-}
+Window::Window( const Window& copy ) = default;
 
-Window& Window::operator=(const Window& rhs)
-{
-  BaseHandle::operator=(rhs);
-  return *this;
-}
+Window& Window::operator=( const Window& rhs ) = default;
+
+Window::Window( Window&& rhs ) = default;
+
+Window& Window::operator=( Window&& rhs ) = default;
 
 Dali::Window Window::New( PositionSize windowPosition, const std::string& name, bool isTransparent )
 {
@@ -163,14 +183,19 @@ FocusChangeSignalType& Window::FocusChangeSignal()
   return GetImplementation( *this ).mFocusChangeSignal;
 }
 
+ResizeSignalType& Window::ResizeSignal()
+{
+  return GetImplementation( *this ).mResizeSignal;
+}
+
 Window::KeyEventSignalType& Window::KeyEventSignal()
 {
   return GetImplementation( *this ).KeyEventSignal();
 }
 
-Window::TouchSignalType& Window::TouchSignal()
+Window::TouchEventSignalType& Window::TouchedSignal()
 {
-  return GetImplementation( *this ).TouchSignal();
+  return GetImplementation( *this ).TouchedSignal();
 }
 
 namespace DevelWindow
@@ -198,6 +223,16 @@ Window DownCast( BaseHandle handle )
   return Dali::Window( windowImpl );
 }
 
+void SetPositionSize(Window window, PositionSize positionSize)
+{
+  GetImplementation( window ).SetPositionSize(positionSize);
+}
+
+int GetPhysicalOrientation(Window window)
+{
+  return GetImplementation( window ).mRotationAngle;
+}
+
 void AddFrameRenderedCallback( Window window, std::unique_ptr< CallbackBase > callback, int32_t frameId )
 {
   CallbackBase::Execute( *callback, frameId );