[dali_2.3.38] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / dali-toolkit-test-utils / toolkit-scene-holder-impl.h
index 62c432e..e43b4be 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_SCENE_HOLDER_IMPL_H
 
 /*
 #define DALI_TOOLKIT_SCENE_HOLDER_IMPL_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  *
  */
 
  *
  */
 
-#include <test-render-surface.h>
-
 #include <dali/integration-api/scene.h>
 #include <dali/public-api/actors/layer.h>
 #include <dali/public-api/object/base-object.h>
 #include <dali/integration-api/scene.h>
 #include <dali/public-api/actors/layer.h>
 #include <dali/public-api/object/base-object.h>
+#include "test-render-surface.h"
+
+#include <dali/public-api/events/hover-event.h>
+#include <dali/public-api/events/touch-event.h>
 
 namespace Dali
 {
 
 namespace Dali
 {
-
 namespace Internal
 {
 namespace Internal
 {
-
 namespace Adaptor
 {
 namespace Adaptor
 {
-
 class SceneHolder : public Dali::BaseObject
 {
 public:
 class SceneHolder : public Dali::BaseObject
 {
 public:
-
-  SceneHolder( const Dali::Rect<int>& positionSize );
+  SceneHolder(const Dali::Rect<int>& positionSize);
 
   virtual ~SceneHolder();
 
 
   virtual ~SceneHolder();
 
+  void Add(Dali::Actor actor);
+
+  void Remove(Dali::Actor actor);
+
   Dali::Layer GetRootLayer() const;
 
   Dali::Layer GetRootLayer() const;
 
-  void SetBackgroundColor( Vector4 color );
+  void SetBackgroundColor(Vector4 color);
 
   Vector4 GetBackgroundColor() const;
 
 
   Vector4 GetBackgroundColor() const;
 
-  void FeedTouchPoint( Dali::TouchPoint& point, int timeStamp );
+  void FeedTouchPoint(Dali::TouchPoint& point, int timeStamp);
 
 
-  void FeedWheelEvent( Dali::WheelEvent& wheelEvent );
+  void FeedWheelEvent(Dali::WheelEvent& wheelEvent);
 
 
-  void FeedKeyEvent( Dali::KeyEvent& keyEvent );
+  void FeedKeyEvent(Dali::KeyEvent& keyEvent);
 
   Dali::Integration::SceneHolder::KeyEventSignalType& KeyEventSignal();
 
   Dali::Integration::SceneHolder::KeyEventGeneratedSignalType& KeyEventGeneratedSignal();
 
 
   Dali::Integration::SceneHolder::KeyEventSignalType& KeyEventSignal();
 
   Dali::Integration::SceneHolder::KeyEventGeneratedSignalType& KeyEventGeneratedSignal();
 
-  Dali::Integration::SceneHolder::TouchSignalType& TouchSignal();
+  Dali::Integration::SceneHolder::TouchEventSignalType& TouchedSignal();
 
   Dali::Integration::SceneHolder::WheelEventSignalType& WheelEventSignal();
 
 
   Dali::Integration::SceneHolder::WheelEventSignalType& WheelEventSignal();
 
+  Dali::Integration::SceneHolder::WheelEventGeneratedSignalType& WheelEventGeneratedSignal();
+
   Integration::Scene GetScene();
 
   Integration::Scene GetScene();
 
-  Integration::RenderSurface& GetRenderSurface();
+  Dali::Integration::RenderSurfaceInterface& GetRenderSurface();
+
+  Dali::RenderTaskList GetRenderTaskList();
+
+  class SceneHolderLifeCycleObserver;
+  std::unique_ptr<SceneHolderLifeCycleObserver> mLifeCycleObserver; ///< The adaptor life cycle observer
+  Dali::TouchEvent                              mLastTouchEvent;
+  Dali::HoverEvent                              mLastHoverEvent;
 
 
-private:
+  uint32_t                 mId;             ///< A unique ID to identify the SceneHolder starting from 0
+  Dali::Integration::Scene mScene{nullptr}; ///< The Scene
+  std::string              mName;           ///< The name of the SceneHolder
 
 
-  TestRenderSurface mRenderSurface;
-  Integration::Scene mScene;
+  TestRenderSurface* mRenderSurface;
 };
 
 } // namespace Adaptor
 
 } // namespace Internal
 
 };
 
 } // namespace Adaptor
 
 } // namespace Internal
 
-inline Internal::Adaptor::SceneHolder& GetImplementation( Dali::Integration::SceneHolder& sceneHolder )
+inline Internal::Adaptor::SceneHolder& GetImplementation(Dali::Integration::SceneHolder& sceneHolder)
 {
 {
-  DALI_ASSERT_ALWAYS( sceneHolder && "SceneHolder handle is empty" );
+  DALI_ASSERT_ALWAYS(sceneHolder && "SceneHolder handle is empty");
   BaseObject& object = sceneHolder.GetBaseObject();
   BaseObject& object = sceneHolder.GetBaseObject();
-  return static_cast<Internal::Adaptor::SceneHolder&>( object );
+  return static_cast<Internal::Adaptor::SceneHolder&>(object);
 }
 
 }
 
-inline const Internal::Adaptor::SceneHolder& GetImplementation( const Dali::Integration::SceneHolder& sceneHolder )
+inline const Internal::Adaptor::SceneHolder& GetImplementation(const Dali::Integration::SceneHolder& sceneHolder)
 {
 {
-  DALI_ASSERT_ALWAYS( sceneHolder && "SceneHolder handle is empty" );
+  DALI_ASSERT_ALWAYS(sceneHolder && "SceneHolder handle is empty");
   const BaseObject& object = sceneHolder.GetBaseObject();
   const BaseObject& object = sceneHolder.GetBaseObject();
-  return static_cast<const Internal::Adaptor::SceneHolder&>( object );
+  return static_cast<const Internal::Adaptor::SceneHolder&>(object);
 }
 
 } // namespace Dali
 }
 
 } // namespace Dali