[AT-SPI] Require ControlAccessible for Control
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / controls / control-impl.h
index 55bc3d0..0a3584e 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_CONTROL_IMPL_H
 
 /*
- * Copyright (c) 2020 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.
@@ -20,6 +20,8 @@
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/adaptor-framework/style-change.h>
+#include <dali/public-api/animation/alpha-function.h>
+#include <dali/public-api/animation/time-period.h>
 #include <dali/public-api/events/long-press-gesture.h>
 #include <dali/public-api/events/pan-gesture.h>
 #include <dali/public-api/events/pinch-gesture.h>
@@ -41,8 +43,15 @@ namespace Toolkit
 
 class StyleManager;
 
+namespace DevelControl
+{
+class ControlAccessible;
+
+} // namespace DevelControl
+
 namespace Internal
 {
+
 /**
  * @brief This is the internal base class for all controls.
  *
@@ -57,7 +66,6 @@ public:
   class Extension; ///< Forward declare future extension interface
 
   // Creation & Destruction
-
   /**
    * @brief Creates a new ControlImpl instance that does not require touch by default.
    *
@@ -107,6 +115,17 @@ public:
    */
   void ClearBackground();
 
+  // Accessibility
+
+  /**
+   * @brief Gets the Accessible object that represents this control.
+   *
+   * This method creates the Accessible object if necessary, so a non-null return is expected.
+   *
+   * @return The Accessible object
+   */
+  Toolkit::DevelControl::ControlAccessible* GetAccessibleObject();
+
   // Gesture Detection
 
   /**
@@ -251,6 +270,7 @@ public:
   DALI_INTERNAL void KeyboardEnter();
   /// @endcond
 
+
   // Signals
 
   /**
@@ -378,8 +398,7 @@ protected: // From CustomActorImpl
    */
   void OnLayoutNegotiated(float size, Dimension::Type dimension) override;
 
-protected: // Helpers for deriving classes
-  // Construction
+public: // Helpers for deriving classes
 
   /**
    * @brief Flags for the constructor.
@@ -387,11 +406,10 @@ protected: // Helpers for deriving classes
    */
   enum ControlBehaviour
   {
-    CONTROL_BEHAVIOUR_DEFAULT = 0, ///< Default behaviour: Size negotiation is enabled & listens to Style Change signal, but doesn't receive event callbacks. @SINCE_1_2_10
-
-    REQUIRES_KEYBOARD_NAVIGATION_SUPPORT = 1 << (CustomActorImpl::ACTOR_FLAG_COUNT + 0), ///< True if needs to support keyboard navigation @SINCE_1_0.0
-
-    DISABLE_STYLE_CHANGE_SIGNALS = 1 << (CustomActorImpl::ACTOR_FLAG_COUNT + 1), ///< True if control should not monitor style change signals @SINCE_1_2_10
+    CONTROL_BEHAVIOUR_DEFAULT            = 0, ///< Default behaviour: Size negotiation is enabled & listens to Style Change signal, but doesn't receive event callbacks. @SINCE_1_2_10
+    NOT_IN_USE_1                         = 1 << (CustomActorImpl::ACTOR_FLAG_COUNT + 0),
+    REQUIRES_KEYBOARD_NAVIGATION_SUPPORT = 1 << (CustomActorImpl::ACTOR_FLAG_COUNT + 1), ///< True if needs to support keyboard navigation @SINCE_1_0.0
+    DISABLE_STYLE_CHANGE_SIGNALS         = 1 << (CustomActorImpl::ACTOR_FLAG_COUNT + 2), ///< True if control should not monitor style change signals @SINCE_1_2_10
 
     LAST_CONTROL_BEHAVIOUR_FLAG
   };
@@ -399,6 +417,19 @@ protected: // Helpers for deriving classes
   static const int CONTROL_BEHAVIOUR_FLAG_COUNT = Log<LAST_CONTROL_BEHAVIOUR_FLAG - 1>::value + 1; ///< Total count of flags
 
   /**
+   * @brief Creates a new ControlImpl instance that does not require touch by default.
+   *
+   * If touch is required, then the user can connect to this class' touch signal.
+   * @SINCE_2_1.8
+   * @param[in] additionalBehaviour Additional control behaviour.
+   * @return A handle to the ControlImpl instance
+   */
+  static Toolkit::Control New(ControlBehaviour additionalBehaviour);
+
+protected:
+  // Construction
+
+  /**
    * @brief Control constructor.
    *
    * @SINCE_1_0.0
@@ -615,6 +646,50 @@ public: // API for derived classes to override
     return NULL;
   }
 
+  // Transition APIs
+
+  /**
+   * @brief Make visual transition from source control to destination control about specific Visual.
+   * If both of source and destination control have same visual index, than generates information for the transition of this Control.
+   *
+   * @param[out] sourcePropertyMap Source property map to be applied on this Control.
+   * @param[out] destinationPropertyMap Destination property map to be applied on this Control.
+   * @param[in] source Source control of the animation.
+   * @param[in] destination Destination control of the animation.
+   * @param[in] visualIndex Property::Index to make animation.
+   */
+  void MakeVisualTransition(Dali::Property::Map& sourcePropertyMap, Dali::Property::Map& destinationPropertyMap,
+                            Dali::Toolkit::Control source, Dali::Toolkit::Control destination, Dali::Property::Index visualIndex);
+
+  /**
+   * @brief Retrieves source and destination visual properties for the Transition of this Control.
+   * The properties of this Control will be transitioned from the propeties of source Control to that of destination control.
+   * If a property value is different between source and destination Control,
+   * the property information of each Control will be included in sourceProperties and destinationProperties.
+   *
+   * @param[out] sourceProperties Source property list to be applied on this Control.
+   * @param[out] destinationProperties Destination property list to be applied on this Control.
+   * @param[in] source Source control of the animation.
+   * @param[in] destination Destination control of the animation.
+   *
+   * @note This method do not handle Actor properties.
+   * And the size and order of the sourceProperties and destinationProperties must be synchronized.
+   */
+  virtual void OnCreateTransitions(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)
+  {
+  }
+
+  /**
+   * @brief Update visual properties.
+   * @param[in] properties Property list to be used to update visual properties of this Control.
+   */
+  virtual void OnUpdateVisualProperties(const std::vector<std::pair<Dali::Property::Index, Dali::Property::Map>>& properties)
+  {
+  }
+
 private:
   /// @cond internal