[AT-SPI] Remove SetAccessibilityConstructor()
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / controls / control-impl.h
index 48c6b9c..9ccb533 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_CONTROL_IMPL_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.
@@ -43,6 +43,12 @@ namespace Toolkit
 
 class StyleManager;
 
+namespace DevelControl
+{
+class ControlAccessible;
+
+} // namespace DevelControl
+
 namespace Internal
 {
 
@@ -60,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.
    *
@@ -110,6 +115,19 @@ public:
    */
   void ClearBackground();
 
+  // Accessibility
+
+  /**
+   * @brief Gets the Accessible object that represents this control.
+   *
+   * This method calls CreateAccessibleObject() if necessary, so a non-null return is expected.
+   *
+   * @return The Accessible object
+   *
+   * @see CreateAccessibleObject()
+   */
+  Toolkit::DevelControl::ControlAccessible* GetAccessibleObject();
+
   // Gesture Detection
 
   /**
@@ -382,8 +400,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.
@@ -402,6 +419,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
@@ -477,6 +507,24 @@ public: // API for derived classes to override
    */
   virtual bool OnAccessibilityZoom();
 
+  /**
+   * @brief This method should be overriden by deriving classes when they wish to be
+   * represented by a custom Accessible object implementation.
+   *
+   * The AT-SPI infrastructure is responsible for destroying the returned object.
+   *
+   * Currently, this method is called at most once in a given Control's lifetime, when
+   * GetAccessibleObject() is called for the first time. A future version of the
+   * AT-SPI infrastructure, however, may delete the Accessible object and request a new
+   * one to be created (by calling this method) multiple times, for example during
+   * scene connection and disconnection.
+   *
+   * @return The newly created Accessible object
+   *
+   * @see GetAccessibleObject()
+   */
+  virtual DevelControl::ControlAccessible* CreateAccessibleObject();
+
   // Keyboard focus
 
   /**