Allow to send ResourceReady signal unlimited
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / control / control-data-impl.h
index 46cc97b..bd7378f 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_CONTROL_DATA_IMPL_H
 
 /*
- * Copyright (c) 2022 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.
@@ -54,12 +54,14 @@ struct RegisteredVisual
   Toolkit::Visual::Base visual;
   bool                  enabled : 1;
   bool                  pending : 1;
+  bool                  overideReadyTransition : 1;
 
   RegisteredVisual(Property::Index aIndex, Toolkit::Visual::Base& aVisual, bool aEnabled, bool aPendingReplacement)
   : index(aIndex),
     visual(aVisual),
     enabled(aEnabled),
-    pending(aPendingReplacement)
+    pending(aPendingReplacement),
+    overideReadyTransition(false)
   {
   }
 };
@@ -126,6 +128,11 @@ public:
   void LongPressDetected(Actor actor, const LongPressGesture& longPress);
 
   /**
+   * @brief Called when resources of control are ready.
+   */
+  void ResourceReady();
+
+  /**
    * @brief Called when a resource is ready.
    * @param[in] object The visual whose resources are ready
    * @note Overriding method in Visual::EventObserver.
@@ -187,6 +194,15 @@ public:
   bool IsVisualEnabled(Property::Index index) const;
 
   /**
+   * @brief Sets the given visual to be ready transition
+   *
+   * @param[in] control The control
+   * @param[in] visual The visual to ready transition overriden
+   * @param[in] enable flag to set enabled or disabled.
+   */
+  void EnableReadyTransitionOverriden(Toolkit::Visual::Base& visual, bool enable);
+
+  /**
    * @brief Stops observing the given visual.
    * @param[in] visual The visual to stop observing
    */
@@ -484,8 +500,10 @@ private:
 
   /**
    * @brief Callbacks called on idle.
+   *
+   * @return True if we need to call this idle callback one more time.
    */
-  void OnIdleCallback();
+  bool OnIdleCallback();
 
   /**
    * @brief Checks highlighted object geometry if it is showing or not
@@ -568,7 +586,7 @@ public:
   bool             mIsKeyboardNavigationSupported : 1;    ///< Stores whether keyboard navigation is supported by the control.
   bool             mIsKeyboardFocusGroup : 1;             ///< Stores whether the control is a focus group.
   bool             mIsEmittingResourceReadySignal : 1;    ///< True during ResourceReady().
-  bool             mNeedToEmitResourceReady : 1;          ///< True if need to emit the resource ready signal again.
+  bool             mIdleCallbackRegistered : 1;           ///< True if need to emit the resource ready signal again.
   bool             mDispatchKeyEvents : 1;                ///< Whether the actor emits key event signals
 
   RegisteredVisualContainer mRemoveVisuals; ///< List of visuals that are being replaced by another visual once ready