Use modern construct 'using' instead of typedef.
[platform/core/uifw/dali-core.git] / dali / devel-api / common / stage-devel.h
index a0e19f4..fd93853 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_STAGE_DEVEL_H
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
  */
 
 // INTERNAL INCLUDES
-#include <dali/public-api/common/stage.h>
+#include <dali/devel-api/common/stage.h>
 
 namespace Dali
 {
 
+class FrameCallbackInterface;
+
 namespace DevelStage
 {
 
@@ -36,7 +38,7 @@ enum class Rendering
   CONTINUOUSLY, ///< Will render continuously.
 };
 
-typedef Signal< bool (const KeyEvent&) > KeyEventGeneratedSignalType;      ///< Stage key event generated signal type
+using KeyEventGeneratedSignalType = Signal<bool( const KeyEvent& )>; ///< Stage key event generated signal type
 
 /**
  * @brief The user would connect to this signal to get a KeyEvent when KeyEvent is generated.
@@ -65,6 +67,31 @@ DALI_CORE_API void SetRenderingBehavior( Dali::Stage stage, Rendering renderingB
  */
 DALI_CORE_API Rendering GetRenderingBehavior( Dali::Stage stage );
 
+/*
+ * @brief The FrameCallbackInterface implementation added gets called on every frame from the update-thread.
+ *
+ * @param[in] stage The stage to set the FrameCallbackInterface implementation on
+ * @param[in] frameCallback An implementation of the FrameCallbackInterface
+ * @param[in] rootActor The root-actor in the scene that the callback applies to
+ *
+ * @note The frameCallback cannot be added more than once. This will assert if that is attempted.
+ * @note Only the rootActor and it's children will be parsed by the UpdateProxy.
+ * @note If the rootActor is destroyed, then the callback is automatically removed
+ * @see FrameCallbackInterface
+ */
+DALI_CORE_API void AddFrameCallback( Dali::Stage stage, FrameCallbackInterface& frameCallback, Actor rootActor );
+
+/**
+ * @brief Removes the specified FrameCallbackInterface implementation from being called on every frame.
+ *
+ * @param[in] stage The stage to clear the FrameCallbackInterface on
+ * @param[in] frameCallback The FrameCallbackInterface implementation to remove
+ *
+ * @note This function will block if the FrameCallbackInterface::Update method is being processed in the update-thread.
+ * @note If the callback implementation has already been removed, then this is a no-op.
+ */
+DALI_CORE_API void RemoveFrameCallback( Dali::Stage stage, FrameCallbackInterface& frameCallback );
+
 } // namespace DevelStage
 
 } // namespace Dali