[Tizen]Add KeyEventGeneratedSignal for Get KeyEvent normally
[platform/core/uifw/dali-adaptor.git] / dali / internal / window-system / common / window-impl.h
index 8abcd13..97fc575 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/window-devel.h>
+#include <dali/internal/window-system/common/event-handler.h>
 
 namespace Dali
 {
@@ -45,9 +47,7 @@ namespace Internal
 {
 namespace Adaptor
 {
-class EventHandler;
 class Orientation;
-class RotationObserver;
 class WindowRenderSurface;
 class WindowBase;
 
@@ -59,7 +59,7 @@ 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;
@@ -129,6 +129,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);
@@ -294,9 +299,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()
@@ -324,18 +329,6 @@ public:
   bool UngrabKeyList( const Dali::Vector< Dali::KEY >& key, Dali::Vector< bool >& result );
 
   /**
-   * Called from Orientation after the Change signal has been sent
-   */
-  void RotationDone( int orientation, int width, int height );
-
-  /**
-   * 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
-   */
-  bool SetRotationObserver( RotationObserver* observer );
-
-  /**
    * @copydoc Dali::DevelWindow::Get()
    */
   static Dali::Window Get( Dali::Actor actor );
@@ -393,39 +386,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
 
@@ -459,6 +464,11 @@ public: // Signals
    */
   Dali::DevelWindow::KeyEventSignalType& KeyEventSignal() { return mScene.KeyEventSignal(); };
 
+    /**
+   * @copydoc Dali::Window::KeyEventGeneratedSignal()
+   */
+  Dali::DevelWindow::KeyEventGeneratedSignalType& KeyEventGeneratedSignal() { return mScene.KeyEventGeneratedSignal(); };
+
   /**
     * @copydoc Dali::Window::TouchSignal()
     */
@@ -486,6 +496,10 @@ private:
   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