Add EmitWheelEventGeneratedSignal for custom wheel event
[platform/core/uifw/dali-core.git] / dali / integration-api / scene.h
index d137773..66f78ad 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_SCENE_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -22,6 +22,8 @@
 #include <memory>
 
 // INTERNAL INCLUDES
+#include <dali/graphics-api/graphics-controller.h>
+#include <dali/graphics-api/graphics-render-target-create-info.h>
 #include <dali/public-api/common/vector-wrapper.h>
 #include <dali/public-api/math/vector2.h>
 #include <dali/public-api/math/vector4.h>
@@ -64,6 +66,7 @@ public:
   using KeyEventGeneratedSignalType       = Signal<bool(const Dali::KeyEvent&)>;   ///< key event generated signal type
   using TouchEventSignalType              = Signal<void(const Dali::TouchEvent&)>; ///< Touch signal type
   using WheelEventSignalType              = Signal<void(const Dali::WheelEvent&)>; ///< WheelEvent signal type
+  using WheelEventGeneratedSignalType     = Signal<bool(const Dali::WheelEvent&)>; ///< WheelEvent generated signal type
 
   using FrameCallbackContainer = std::vector<std::pair<std::unique_ptr<CallbackBase>, int32_t> >;
 
@@ -225,9 +228,9 @@ public:
   /**
    * @brief Sets the render target for the surface.
    *
-   * @param[in] renderTarget The render target for the surface
+   * @param[in] renderTarget The render target create info for the surface
    */
-  void SetSurfaceRenderTarget(Graphics::RenderTarget* renderTarget);
+  void SetSurfaceRenderTarget(const Graphics::RenderTargetCreateInfo& createInfo);
 
   /**
    * @brief Retrieve the Scene that the given actor belongs to.
@@ -411,6 +414,23 @@ public:
    */
   WheelEventSignalType& WheelEventSignal();
 
+  /**
+   * @brief When a custom wheel event occurs, it need to process the focused actor first.
+   *
+   * Therefore, KeyboardFocusManager first checks whether WheelEvent is generated as WheelEventGeneratedSignal.
+   * After that wheelEventProcessor must invoke WheelEvent only if wheelEventGeneratedSignal () is not consumed.
+   *
+   * This is only valid for custom wheel events.
+   *
+   * A callback of the following type may be connected:
+   * @code
+   *   bool YourCallbackName(const WheelEvent& event);
+   * @endcode
+   *
+   * @return The return is true if WheelEvent is consumed, otherwise false.
+   */
+  WheelEventGeneratedSignalType& WheelEventGeneratedSignal();
+
 public: // Not intended for application developers
   /**
    * @brief This constructor is used by Dali::New() methods.