Merge branch 'devel/master' into tizen
[platform/core/uifw/dali-adaptor.git] / dali / internal / window-system / common / window-impl.h
index cf21b18..bebb11b 100644 (file)
 #endif
 
 // INTERNAL INCLUDES
+#include <dali/internal/adaptor/common/adaptor-impl.h>
 #include <dali/public-api/adaptor-framework/window.h>
 #include <dali/public-api/adaptor-framework/key-grab.h>
-#include <dali/devel-api/adaptor-framework/drag-and-drop-detector.h>
 #include <dali/devel-api/adaptor-framework/window-devel.h>
+#include <dali/internal/window-system/common/event-handler.h>
 
 namespace Dali
 {
@@ -46,9 +47,7 @@ namespace Internal
 {
 namespace Adaptor
 {
-class EventHandler;
 class Orientation;
-class RotationObserver;
 class WindowRenderSurface;
 class WindowBase;
 
@@ -60,12 +59,14 @@ using EventHandlerPtr = IntrusivePtr< EventHandler >;
 /**
  * Window provides a surface to render onto with orientation & indicator properties.
  */
-class Window : public Dali::Internal::Adaptor::SceneHolder, public ConnectionTracker
+class Window : public Dali::Internal::Adaptor::SceneHolder, public EventHandler::Observer, public ConnectionTracker
 {
 public:
   typedef Dali::Window::IndicatorSignalType IndicatorSignalType;
   typedef Dali::Window::FocusSignalType FocusSignalType;
   typedef Dali::Window::ResizedSignalType ResizedSignalType;
+  typedef Dali::Window::FocusChangeSignalType FocusChangeSignalType;
+  typedef Dali::Window::ResizeSignalType ResizeSignalType;
   typedef Signal< void () > SignalType;
 
   /**
@@ -130,6 +131,11 @@ public:
   Dali::Layer GetLayer( uint32_t depth ) const;
 
   /**
+   * @copydoc Dali::DevelWindow::GetRenderTaskList()
+   */
+  Dali::RenderTaskList GetRenderTaskList() const;
+
+  /**
    * @copydoc Dali::Window::AddAvailableOrientation()
    */
   void AddAvailableOrientation(Dali::Window::WindowOrientation orientation);
@@ -160,11 +166,6 @@ public:
   Dali::Window::WindowOrientation GetPreferredOrientation();
 
   /**
-   * @copydoc Dali::Window::GetDragAndDropDetector() const
-   */
-  Dali::DragAndDropDetector GetDragAndDropDetector() const;
-
-  /**
    * @copydoc Dali::Window::SetAcceptFocus()
    */
   void SetAcceptFocus( bool accept );
@@ -300,9 +301,9 @@ public:
   void SetPositionSize( PositionSize positionSize );
 
   /**
-   * @copydoc Dali::DevelWindow::GetRootLayer()
+   * @copydoc Dali::Window::GetRootLayer()
    */
-  Dali::Layer GetRootLayer();
+  Dali::Layer GetRootLayer() const;
 
   /**
    * @copydoc Dali::Window::SetTransparency()
@@ -330,16 +331,24 @@ public:
   bool UngrabKeyList( const Dali::Vector< Dali::KEY >& key, Dali::Vector< bool >& result );
 
   /**
-   * Called from Orientation after the Change signal has been sent
+   * @copydoc Dali::DevelWindow::Get()
    */
-  void RotationDone( int orientation, int width, int height );
+  static Dali::Window Get( Dali::Actor actor );
 
   /**
-   * Set the rotation observer (note, some adaptors may not have a rotation observer)
-   * @param[in] observer The rotation observer
-   * @return If the rotation observer is set
+   * @copydoc Dali::DevelWindow::SetParent()
    */
-  bool SetRotationObserver( RotationObserver* observer );
+  void SetParent( Dali::Window& parent );
+
+  /**
+   * @copydoc Dali::DevelWindow::Unparent()
+   */
+  void Unparent();
+
+  /**
+   * @copydoc Dali::DevelWindow::GetParent()
+   */
+  Dali::Window GetParent();
 
 public: // Dali::Internal::Adaptor::SceneHolder
 
@@ -394,39 +403,51 @@ private:
 private: // Dali::Internal::Adaptor::SceneHolder
 
   /**
-   * @copydoc Dali::Internal::Adaptor::SceneHolder::FeedTouchPoint
+   * @copydoc Dali::Internal::Adaptor::SceneHolder::OnAdaptorSet
    */
-  void FeedTouchPoint( TouchPoint& point, int timeStamp ) override;
+  void OnAdaptorSet( Dali::Adaptor& adaptor ) override;
 
   /**
-   * @copydoc Dali::Internal::Adaptor::SceneHolder::FeedWheelEvent
+   * @copydoc Dali::Internal::Adaptor::SceneHolder::OnSurfaceSet
    */
-  void FeedWheelEvent( WheelEvent& wheelEvent ) override;
+  void OnSurfaceSet( Dali::RenderSurfaceInterface* surface ) override;
 
   /**
-   * @copydoc Dali::Internal::Adaptor::SceneHolder::FeedKeyEvent
+   * @copydoc Dali::Internal::Adaptor::SceneHolder::OnPause
    */
-  void FeedKeyEvent( KeyEvent& keyEvent ) override;
+  void OnPause() override;
 
   /**
-   * @copydoc Dali::Internal::Adaptor::SceneHolder::OnAdaptorSet
+   * @copydoc Dali::Internal::Adaptor::SceneHolder::OnResume
    */
-  void OnAdaptorSet( Dali::Adaptor& adaptor ) override;
+  void OnResume() override;
 
   /**
-   * @copydoc Dali::Internal::Adaptor::SceneHolder::OnSurfaceSet
+   * @copydoc Dali::Internal::Adaptor::SceneHolder::RecalculateTouchPosition
    */
-  void OnSurfaceSet( Dali::RenderSurfaceInterface* surface ) override;
+  void RecalculateTouchPosition( Integration::Point& point ) override;
+
+private: // Dali::Internal::Adaptor::EventHandler::Observer
 
   /**
-   * @copydoc Dali::Internal::Adaptor::SceneHolder::OnPause
+   * @copydoc Dali::Internal::Adaptor::EventHandler::Observer::OnTouchPoint
    */
-  void OnPause() override;
+  void OnTouchPoint( Dali::Integration::Point& point, int timeStamp ) override;
 
   /**
-   * @copydoc Dali::Internal::Adaptor::SceneHolder::OnResume
+   * @copydoc Dali::Internal::Adaptor::EventHandler::Observer::OnWheelEvent
    */
-  void OnResume() override;
+  void OnWheelEvent( Dali::Integration::WheelEvent& wheelEvent ) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::EventHandler::Observer::OnKeyEvent
+   */
+  void OnKeyEvent( Dali::Integration::KeyEvent& keyEvent ) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::EventHandler::Observer::OnRotation
+   */
+  void OnRotation( const RotationEvent& rotation ) override;
 
 public: // Signals
 
@@ -441,9 +462,17 @@ public: // Signals
   FocusSignalType& FocusChangedSignal() { return mFocusChangedSignal; }
 
   /**
+   * @copydoc Dali::Window::WindowFocusChangedSignal()
+   */
+  FocusChangeSignalType& FocusChangeSignal() { return mFocusChangeSignal; }
+  /**
    * @copydoc Dali::Window::ResizedSignal()
    */
   ResizedSignalType& ResizedSignal() { return mResizedSignal; }
+  /**
+   * @copydoc Dali::Window::ResizedSignal()
+   */
+  ResizeSignalType& ResizeSignal() { return mResizeSignal; }
 
   /**
    * This signal is emitted when the window is requesting to be deleted
@@ -453,22 +482,7 @@ public: // Signals
   /**
    * @copydoc Dali::Window::SignalEventProcessingFinished()
    */
-  Dali::DevelWindow::EventProcessingFinishedSignalType& EventProcessingFinishedSignal() { return mScene.EventProcessingFinishedSignal(); };
-
-  /**
-   * @copydoc Dali::Window::KeyEventSignal()
-   */
-  Dali::DevelWindow::KeyEventSignalType& KeyEventSignal() { return mScene.KeyEventSignal(); };
-
-  /**
-    * @copydoc Dali::Window::TouchSignal()
-    */
-  Dali::DevelWindow::TouchSignalType& TouchSignal() { return mScene.TouchSignal(); };
-
-  /**
-   * @copydoc Dali::Window::WheelEventSignal()
-   */
-  Dali::DevelWindow::WheelEventSignalType& WheelEventSignal() { return mScene.WheelEventSignal(); };
+  Dali::DevelWindow::EventProcessingFinishedSignalType& EventProcessingFinishedSignal() { return mScene.EventProcessingFinishedSignal(); }
 
 private:
 
@@ -481,13 +495,17 @@ private:
   bool                                  mIconified:1;
   bool                                  mOpaqueState:1;
   bool                                  mResizeEnabled:1;
-  Dali::DragAndDropDetector             mDragAndDropDetector;
   Dali::Window::Type                    mType;
+  Dali::Window                          mParentWindow;
 
   OrientationPtr                               mOrientation;
   std::vector<Dali::Window::WindowOrientation> mAvailableOrientations;
   Dali::Window::WindowOrientation              mPreferredOrientation;
 
+  int                                   mRotationAngle;     ///< The angle of the rotation
+  int                                   mWindowWidth;       ///< The width of the window
+  int                                   mWindowHeight;      ///< The height of the window
+
   EventHandlerPtr                       mEventHandler;      ///< The window events handler
 
   // Signals
@@ -495,8 +513,8 @@ private:
   FocusSignalType                       mFocusChangedSignal;
   ResizedSignalType                     mResizedSignal;
   SignalType                            mDeleteRequestSignal;
-
-
+  FocusChangeSignalType                 mFocusChangeSignal;
+  ResizeSignalType                      mResizeSignal;
 };
 
 } // namespace Adaptor