[Tizen] Add GetRenderTaskList to SceneHolder
[platform/core/uifw/dali-adaptor.git] / dali / internal / window-system / common / window-impl.h
index b7c1d61..eb2cd9b 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_WINDOWSYSTEM_COMMON_WINDOW_IMPL_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
 // EXTERNAL INCLUDES
 #include <dali/public-api/actors/layer.h>
 #include <dali/public-api/adaptor-framework/window-enumerations.h>
+#include <dali/public-api/events/touch-event.h>
 #include <dali/public-api/object/base-object.h>
 #include <dali/public-api/object/property-array.h>
 #include <dali/public-api/object/ref-object.h>
-#include <dali/public-api/render-tasks/render-task-list.h>
 
 // INTERNAL INCLUDES
 #include <dali/devel-api/adaptor-framework/window-devel.h>
@@ -49,9 +49,10 @@ class WindowRenderSurface;
 class WindowBase;
 
 class Window;
-using WindowPtr       = IntrusivePtr<Window>;
-using OrientationPtr  = IntrusivePtr<Orientation>;
-using EventHandlerPtr = IntrusivePtr<EventHandler>;
+using WindowPtr          = IntrusivePtr<Window>;
+using OrientationPtr     = IntrusivePtr<Orientation>;
+using MouseInOutEventPtr = IntrusivePtr<Dali::DevelWindow::MouseInOutEvent>;
+using EventHandlerPtr    = IntrusivePtr<EventHandler>;
 
 /**
  * Window provides a surface to render onto with orientation & indicator properties.
@@ -64,6 +65,14 @@ public:
   typedef Dali::DevelWindow::VisibilityChangedSignalType             VisibilityChangedSignalType;
   typedef Dali::DevelWindow::TransitionEffectEventSignalType         TransitionEffectEventSignalType;
   typedef Dali::DevelWindow::KeyboardRepeatSettingsChangedSignalType KeyboardRepeatSettingsChangedSignalType;
+  typedef Dali::DevelWindow::AuxiliaryMessageSignalType              AuxiliaryMessageSignalType;
+  typedef Dali::DevelWindow::AccessibilityHighlightSignalType        AccessibilityHighlightSignalType;
+  typedef Dali::DevelWindow::MovedSignalType                         MovedSignalType;
+  typedef Dali::DevelWindow::OrientationChangedSignalType            OrientationChangedSignalType;
+  typedef Dali::DevelWindow::MouseInOutEventSignalType               MouseInOutEventSignalType;
+  typedef Dali::DevelWindow::MoveCompletedSignalType                 MoveCompletedSignalType;
+  typedef Dali::DevelWindow::ResizeCompletedSignalType               ResizeCompletedSignalType;
+  typedef Dali::DevelWindow::InsetsChangedSignalType                 InsetsChangedSignalType;
   typedef Signal<void()>                                             SignalType;
 
   /**
@@ -87,7 +96,7 @@ public:
    * @param[in] isTransparent Whether window is transparent
    * @return A newly allocated Window
    */
-  static Window* New(Any surface, const PositionSize& positionSize, const std::string& name, const std::string& className,  Dali::WindowType type, bool isTransparent = false);
+  static Window* New(Any surface, const PositionSize& positionSize, const std::string& name, const std::string& className, Dali::WindowType type, bool isTransparent = false);
 
   /**
    * @copydoc Dali::Window::SetClass()
@@ -116,6 +125,36 @@ public:
   void Activate();
 
   /**
+   * @copydoc Dali::DevelWindow::Maximize()
+   */
+  void Maximize(bool maximize);
+
+  /**
+   * @copydoc Dali::DevelWindow::IsMaximized()
+   */
+  bool IsMaximized() const;
+
+  /**
+   * @copydoc Dali::DevelWindow::SetMaximumSize()
+   */
+  void SetMaximumSize(Dali::Window::WindowSize size);
+
+  /**
+   * @copydoc Dali::DevelWindow::Minimize()
+   */
+  void Minimize(bool minimize);
+
+  /**
+   * @copydoc Dali::DevelWindow::IsMinimized()
+   */
+  bool IsMinimized() const;
+
+  /**
+   * @copydoc Dali::DevelWindow::SetMimimumSize()
+   */
+  void SetMimimumSize(Dali::Window::WindowSize size);
+
+  /**
    * @copydoc Dali::Window::GetLayerCount()
    */
   uint32_t GetLayerCount() const;
@@ -126,9 +165,10 @@ public:
   Dali::Layer GetLayer(uint32_t depth) const;
 
   /**
-   * @copydoc Dali::DevelWindow::GetRenderTaskList()
+   * @brief Get window resource ID assigned by window manager
+   * @return The resource ID of the window
    */
-  Dali::RenderTaskList GetRenderTaskList() const;
+  std::string GetNativeResourceId() const;
 
   /**
    * @copydoc Dali::Window::AddAvailableOrientation()
@@ -291,6 +331,11 @@ public:
   PositionSize GetPositionSize() const;
 
   /**
+   * @copydoc Dali::Window::SetLayout()
+   */
+  void SetLayout(unsigned int numCols, unsigned int numRows, unsigned int column, unsigned int row, unsigned int colSpan, unsigned int rowSpan);
+
+  /**
    * @copydoc Dali::Window::GetRootLayer()
    */
   Dali::Layer GetRootLayer() const;
@@ -326,11 +371,16 @@ public:
   static Dali::Window Get(Dali::Actor actor);
 
   /**
-   * @copydoc Dali::DevelWindow::SetParent()
+   * @copydoc Dali::DevelWindow::SetParent(Window window, Window parent)
    */
   void SetParent(Dali::Window& parent);
 
   /**
+   * @copydoc Dali::DevelWindow::SetParent(Window window, Window parent, bool belowParent)
+   */
+  void SetParent(Dali::Window& parent, bool belowParent);
+
+  /**
    * @copydoc Dali::DevelWindow::Unparent()
    */
   void Unparent();
@@ -360,6 +410,23 @@ public:
    */
   void SetPositionSizeWithOrientation(PositionSize positionSize, WindowOrientation orientation);
 
+  /**
+   * @brief Emit the accessibility highlight signal.
+   * The highlight indicates that it is an object to interact with the user regardless of focus.
+   * After setting the highlight on the object, you can do things that the object can do, such as
+   * giving or losing focus.
+   *
+   * @param[in] highlight If window needs to grab or clear highlight.
+   */
+  void EmitAccessibilityHighlightSignal(bool highlight);
+
+  /**
+   * @brief Sets the render notification trigger to call when render thread is completed a frame
+   *
+   * @param[in] renderNotification to use
+   */
+  void SetRenderNotification(TriggerEventInterface* renderNotification);
+
 public: // Dali::Internal::Adaptor::SceneHolder
   /**
    * @copydoc Dali::Internal::Adaptor::SceneHolder::GetNativeHandle
@@ -391,6 +458,46 @@ public: // Dali::Internal::Adaptor::SceneHolder
    */
   void EnableFloatingMode(bool enable);
 
+  /**
+   * @copydoc Dali::DevelWindow::IsFloatingModeEnabled()
+   */
+  bool IsFloatingModeEnabled();
+
+  /**
+   * @copydoc Dali::DevelWindow::IncludeInputRegion()
+   */
+  void IncludeInputRegion(const Rect<int>& inputRegion);
+
+  /**
+   * @copydoc Dali::DevelWindow::ExcludeInputRegion()
+   */
+  void ExcludeInputRegion(const Rect<int>& inputRegion);
+
+  /**
+   * @copydoc Dali::DevelWindow::SetNeedsRotationCompletedAcknowledgement()
+   */
+  void SetNeedsRotationCompletedAcknowledgement(bool needAcknowledgement);
+
+  /**
+   * @copydoc Dali::DevelWindow::SendRotationCompletedAcknowledgement()
+   */
+  void SendRotationCompletedAcknowledgement();
+
+  /**
+   * @copydoc Dali::DevelWindow::IsWindowRotating()
+   */
+  bool IsWindowRotating() const;
+
+  /**
+   * @copydoc Dali::DevelWindow::GetLastKeyEvent()
+   */
+  const Dali::KeyEvent& GetLastKeyEvent() const;
+
+  /**
+   * @copydoc Dali::DevelWindow::GetLastTouchEvent()
+   */
+  const Dali::TouchEvent& GetLastTouchEvent() const;
+
 private:
   /**
    * @brief Enumeration for orietation mode.
@@ -456,13 +563,64 @@ private:
   void OnWindowRedrawRequest();
 
   /**
-   * @brief Called when the window is resized or moved by display server.
+   * @brief Called when the window's geometry data is changed by display server or client.
+   * It is based on configure noification event.
    *
-   * @param positionSize the updated window's position and size.
+   * @param[in] positionSize the updated window's position and size.
    */
   void OnUpdatePositionSize(Dali::PositionSize& positionSize);
 
   /**
+   * @brief Called when display server sent the auxiliary message.
+   *
+   * @param[in] key the auxiliary message's key.
+   * @param[in] value the auxiliary message's value.
+   * @param[in] options the auxiliary message's options. This is the list of string.
+   */
+  void OnAuxiliaryMessage(const std::string& key, const std::string& value, const Property::Array& options);
+
+  /**
+   * @brief Called when Accessibility is enabled.
+   *
+   * This method is to register the window to accessibility bridge.
+   */
+  void OnAccessibilityEnabled();
+
+  /**
+   * @brief Called when Accessibility is disabled.
+   *
+   * This method is to remove the window from accessibility bridge.
+   */
+  void OnAccessibilityDisabled();
+
+  /**
+   * Called when the window rotation is finished.
+   *
+   * This signal is emmit when window rotation is finisehd and WindowRotationCompleted() is called.
+   */
+  void OnRotationFinished();
+
+  /**
+   * @brief Called when the mouse in or out event is received.
+   * @param[in] mouseInOutEvent the mouse event
+   */
+  void OnMouseInOutEvent(const Dali::DevelWindow::MouseInOutEvent& mouseInOutEvent);
+
+  /**
+   * @brief Called when the window is moved by display server.
+   *
+   * @param[in] position the moved window's position.
+   */
+  void OnMoveCompleted(Dali::Window::WindowPosition& position);
+
+  /**
+   * @brief Called when the window is resized by display server.
+   *
+   * @param[in] positionSize the resized window's size.
+   */
+  void OnResizeCompleted(Dali::Window::WindowSize& size);
+
+  /**
    * @brief Set available orientation to window base.
    */
   void SetAvailableAnlges(const std::vector<int>& angles);
@@ -482,6 +640,16 @@ private:
    */
   bool IsOrientationAvailable(WindowOrientation orientation) const;
 
+  /**
+   * @brief Called when window insets are changed by appearing or disappearing indicator, virtual keyboard, or clipboard.
+   *
+   * @param[in] partType the type of the part that occurs the window insets change.
+   * @param[in] partState the state of the part that occurs the window insets change.
+   * @param[in] insets the extents value of window insets.
+   */
+  void OnInsetsChanged(WindowInsetsPartType partType, WindowInsetsPartState partState, const Extents& insets);
+
+
 private: // Dali::Internal::Adaptor::SceneHolder
   /**
    * @copydoc Dali::Internal::Adaptor::SceneHolder::OnAdaptorSet
@@ -504,9 +672,9 @@ private: // Dali::Internal::Adaptor::SceneHolder
   void OnResume() override;
 
   /**
-   * @copydoc Dali::Internal::Adaptor::SceneHolder::RecalculateTouchPosition
+   * @copydoc Dali::Internal::Adaptor::SceneHolder::RecalculatePosition
    */
-  void RecalculateTouchPosition(Integration::Point& point) override;
+  Vector2 RecalculatePosition(const Vector2& position) override;
 
 private: // Dali::Internal::Adaptor::EventHandler::Observer
   /**
@@ -586,30 +754,88 @@ public: // Signals
     return mKeyboardRepeatSettingsChangedSignal;
   }
 
+  /**
+   * @copydoc Dali::DevelWindow::AuxiliaryMessageSignal()
+   */
+  AuxiliaryMessageSignalType& AuxiliaryMessageSignal()
+  {
+    return mAuxiliaryMessageSignal;
+  }
+
+  /**
+   * @copydoc Dali::DevelWindow::AccessibilityHighlightSignal()
+   */
+  AccessibilityHighlightSignalType& AccessibilityHighlightSignal()
+  {
+    return mAccessibilityHighlightSignal;
+  }
+
+  /**
+   * @copydoc Dali::DevelWindow::MovedSignal()
+   */
+  MovedSignalType& MovedSignal()
+  {
+    return mMovedSignal;
+  }
+
+  /**
+   * @copydoc Dali::DevelWindow::OrientationChangedSignal()
+   */
+  OrientationChangedSignalType& OrientationChangedSignal()
+  {
+    return mOrientationChangedSignal;
+  }
+
+  /**
+   * @copydoc Dali::DevelWindow::MouseInOutEventSignal()
+   */
+  MouseInOutEventSignalType& MouseInOutEventSignal()
+  {
+    return mMouseInOutEventSignal;
+  }
+
+  /**
+   * @copydoc Dali::DevelWindow::MoveCompletedSignal()
+   */
+  MoveCompletedSignalType& MoveCompletedSignal()
+  {
+    return mMoveCompletedSignal;
+  }
+
+  /**
+   * @copydoc Dali::DevelWindow::ResizeCompletedSignal()
+   */
+  ResizeCompletedSignalType& ResizeCompletedSignal()
+  {
+    return mResizeCompletedSignal;
+  }
+
+  /**
+   * @copydoc Dali::DevelWindow::InsetsChangedSignal()
+   */
+  InsetsChangedSignalType& InsetsChangedSignal()
+  {
+    return mInsetsChangedSignal;
+  }
+
 private:
   WindowRenderSurface* mWindowSurface; ///< The window rendering surface
   WindowBase*          mWindowBase;
   std::string          mName;
   std::string          mClassName;
-  bool                 mIsTransparent : 1;
-  bool                 mIsFocusAcceptable : 1;
-  bool                 mIconified : 1;
-  bool                 mOpaqueState : 1;
   Dali::Window         mParentWindow;
 
   OrientationPtr   mOrientation;
   std::vector<int> mAvailableAngles;
   int              mPreferredAngle;
 
-  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
-
-  OrientationMode mOrientationMode;      ///< The physical screen mode is portrait or landscape
+  int mRotationAngle;               ///< The angle of the rotation
+  int mWindowWidth;                 ///< The width of the window
+  int mWindowHeight;                ///< The height of the window
+  int mNativeWindowId;              ///< The Native Window Id
 
-  int mNativeWindowId;                   ///< The Native Window Id
+  EventHandlerPtr mEventHandler;    ///< The window events handler
+  OrientationMode mOrientationMode; ///< The physical screen mode is portrait or landscape
 
   // Signals
   SignalType                              mDeleteRequestSignal;
@@ -618,6 +844,25 @@ private:
   VisibilityChangedSignalType             mVisibilityChangedSignal;
   TransitionEffectEventSignalType         mTransitionEffectEventSignal;
   KeyboardRepeatSettingsChangedSignalType mKeyboardRepeatSettingsChangedSignal;
+  AuxiliaryMessageSignalType              mAuxiliaryMessageSignal;
+  AccessibilityHighlightSignalType        mAccessibilityHighlightSignal;
+  MovedSignalType                         mMovedSignal;
+  OrientationChangedSignalType            mOrientationChangedSignal;
+  MouseInOutEventSignalType               mMouseInOutEventSignal;
+  MoveCompletedSignalType                 mMoveCompletedSignal;
+  ResizeCompletedSignalType               mResizeCompletedSignal;
+  InsetsChangedSignalType                 mInsetsChangedSignal;
+
+  Dali::KeyEvent   mLastKeyEvent;
+  Dali::TouchEvent mLastTouchEvent;
+
+  bool mIsTransparent : 1;
+  bool mIsFocusAcceptable : 1;
+  bool mIconified : 1;
+  bool mOpaqueState : 1;
+  bool mWindowRotationAcknowledgement : 1;
+  bool mFocused : 1;
+  bool mIsWindowRotating : 1; ///< The window rotating flag.
 };
 
 } // namespace Adaptor