[dali_2.3.22] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / control / control-data-impl.h
index 2354a94..b2109ee 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_CONTROL_DATA_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.
@@ -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.
@@ -141,6 +148,12 @@ public:
   void NotifyVisualEvent(Visual::Base& object, Property::Index signalId) override;
 
   /**
+   * @brief Called when the visual needs relayout request.
+   * @param[in] object The visual who requests relayout
+   */
+  void RelayoutRequest(Visual::Base& object) override;
+
+  /**
    * @copydoc Dali::Toolkit::DevelControl::RegisterVisual()
    */
   void RegisterVisual(Property::Index index, Toolkit::Visual::Base& visual);
@@ -181,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
    */
@@ -218,6 +240,11 @@ public:
   void DoAction(Dali::Property::Index visualIndex, Dali::Property::Index actionId, const Dali::Property::Value attributes);
 
   /**
+   * @copydoc Dali::Toolkit::DevelControl::DoActionExtension()
+   */
+  void DoActionExtension(Dali::Property::Index visualIndex, Dali::Property::Index actionId, Dali::Any attributes);
+
+  /**
    * @brief Function used to set control properties.
    * @param[in] object The object whose property to set
    * @param[in] index The index of the property to set
@@ -412,7 +439,8 @@ public:
    */
   void CreateTransitions(std::vector<std::pair<Dali::Property::Index, Dali::Property::Map>>& sourceProperties,
                          std::vector<std::pair<Dali::Property::Index, Dali::Property::Map>>& destinationProperties,
-                         Dali::Toolkit::Control source, Dali::Toolkit::Control destination);
+                         Dali::Toolkit::Control                                              source,
+                         Dali::Toolkit::Control                                              destination);
 
   /**
    * @brief Update visual properties.
@@ -427,6 +455,21 @@ public:
    */
   Toolkit::DevelControl::ControlAccessible* GetAccessibleObject();
 
+  /**
+   * @copydoc Dali::Toolkit::DevelControl::IsAccessibleCreated()
+   */
+  bool IsAccessibleCreated() const;
+
+  /**
+   * @copydoc Dali::Toolkit::DevelControl::EnableCreateAccessible()
+   */
+  void EnableCreateAccessible(bool enable);
+
+  /**
+   * @copydoc Dali::Toolkit::DevelControl::IsCreateAccessibleEnabled()
+   */
+  bool IsCreateAccessibleEnabled() const;
+
 private:
   /**
    * Used as an alternative to boolean so that it is obvious whether a visual is enabled/disabled.
@@ -472,8 +515,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
@@ -486,22 +531,41 @@ private:
   void RegisterAccessibilityPositionPropertyNotification();
 
   /**
-   * @brief Remove property notification added by RegisterPropertyNotification
+   * @brief Remove property notification added by RegisterAccessibilityPositionPropertyNotification
    */
   void UnregisterAccessibilityPositionPropertyNotification();
 
+  /**
+   * @brief Register PropertySet signal to check highlighted object name and description
+   */
+  void RegisterAccessibilityPropertySetSignal();
+
+  /**
+   * @brief Remove PropertySet signal added by RegisterAccessibilityPropertySetSignal
+   */
+  void UnregisterAccessibilityPropertySetSignal();
+
+  /**
+   * @brief Signal callback of PropertySet when this object is become highlighted, so RegisterAccessibilityPropertySetSignal called.
+   *
+   * @param[in] handle Handle of the control.
+   * @param[in] index The index of property.
+   * @param[in] value The value of property.
+   */
+  void OnAccessibilityPropertySet(Dali::Handle& handle, Dali::Property::Index index, const Dali::Property::Value& value);
+
 public:
   Control&            mControlImpl;
   DevelControl::State mState;
   std::string         mSubStateName;
   Property::Map       mAccessibilityAttributes;
 
-  int mLeftFocusableActorId;  ///< Actor ID of Left focusable control.
-  int mRightFocusableActorId; ///< Actor ID of Right focusable control.
-  int mUpFocusableActorId;    ///< Actor ID of Up focusable control.
-  int mDownFocusableActorId;  ///< Actor ID of Down focusable control.
-  int mClockwiseFocusableActorId;  ///< Actor ID of Clockwise focusable control.
-  int mCounterClockwiseFocusableActorId;  ///< Actor ID of Counter clockwise focusable control.
+  int mLeftFocusableActorId;             ///< Actor ID of Left focusable control.
+  int mRightFocusableActorId;            ///< Actor ID of Right focusable control.
+  int mUpFocusableActorId;               ///< Actor ID of Up focusable control.
+  int mDownFocusableActorId;             ///< Actor ID of Down focusable control.
+  int mClockwiseFocusableActorId;        ///< Actor ID of Clockwise focusable control.
+  int mCounterClockwiseFocusableActorId; ///< Actor ID of Counter clockwise focusable control.
 
   RegisteredVisualContainer                 mVisuals; ///< Stores visuals needed by the control, non trivial type so std::vector used.
   std::string                               mStyleName;
@@ -530,9 +594,11 @@ public:
   std::string mAccessibilityName;
   std::string mAccessibilityDescription;
   std::string mAccessibilityTranslationDomain;
+  std::string mAutomationId;
 
   bool mAccessibilityHighlightable = false;
   bool mAccessibilityHidden        = false;
+  bool mAccessibleCreatable        = true;
 
   Dali::Accessibility::Role mAccessibilityRole = Dali::Accessibility::Role::UNKNOWN;
 
@@ -555,7 +621,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
@@ -586,10 +652,12 @@ public:
   static const PropertyRegistration PROPERTY_23;
   static const PropertyRegistration PROPERTY_24;
   static const PropertyRegistration PROPERTY_25;
+  static const PropertyRegistration PROPERTY_26;
 
 private:
   // Accessibility - notification for highlighted object to check if it is showing.
   bool                                        mIsAccessibilityPositionPropertyNotificationSet{false};
+  bool                                        mIsAccessibilityPropertySetSignalRegistered{false};
   Dali::PropertyNotification                  mAccessibilityPositionNotification;
   Dali::Accessibility::ScreenRelativeMoveType mAccessibilityLastScreenRelativeMoveType{Accessibility::ScreenRelativeMoveType::OUTSIDE};
 };