[Tizen][ATSPI] Introduce GetNodeInfo interface
[platform/core/uifw/dali-adaptor.git] / dali / internal / accessibility / bridge / bridge-accessible.h
index 219db3b..0f8533d 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_ACCESSIBILITY_BRIDGE_ACCESSIBLE_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.
@@ -25,7 +25,9 @@
 #include <vector>
 
 // INTERNAL INCLUDES
-#include "bridge-base.h"
+#include <dali/devel-api/atspi-interfaces/accessible.h>
+#include <dali/devel-api/atspi-interfaces/component.h>
+#include <dali/internal/accessibility/bridge/bridge-base.h>
 
 /**
  * @brief The BridgeAccessible class is to correspond with Dali::Accessibility::Accessible.
@@ -33,7 +35,6 @@
 class BridgeAccessible : public virtual BridgeBase
 {
 protected:
-
   /**
    * @brief Constructor.
    */
@@ -44,16 +45,23 @@ protected:
    */
   void RegisterInterfaces();
 
+  /**
+   * @brief Returns the Accessible object of the currently executed DBus method call.
+   *
+   * @return The Accessible object
+   */
+  Dali::Accessibility::Accessible* FindSelf() const;
+
 public:
   /**
    * @brief Enumeration for NeighborSearchMode.
    */
   enum class NeighborSearchMode
   {
-    NORMAL                          = 0,   ///< Normal
-    RECURSE_FROM_ROOT               = 1,   ///< Recurse from root
-    CONTINUE_AFTER_FAILED_RECURSION = 2,   ///< Continue after failed recursion
-    RECURSE_TO_OUTSIDE              = 3,   ///< Recurse to outside
+    NORMAL                          = 0, ///< Normal
+    RECURSE_FROM_ROOT               = 1, ///< Recurse from root
+    CONTINUE_AFTER_FAILED_RECURSION = 2, ///< Continue after failed recursion
+    RECURSE_TO_OUTSIDE              = 3, ///< Recurse to outside
   };
 
   using ReadingMaterialType = DBus::ValueOrError<
@@ -66,6 +74,7 @@ public:
     std::string,                      // localized name
     int32_t,                          // child count
     double,                           // current value
+    std::string,                      // formatted current value
     double,                           // minimum increment
     double,                           // maximum value
     double,                           // minimum value
@@ -83,7 +92,21 @@ public:
     Dali::Accessibility::Accessible*  // describedByObject
     >;
 
-  using Relation = std::tuple<uint32_t, std::vector<Dali::Accessibility::Address>>;
+  using NodeInfoType = DBus::ValueOrError<
+    std::string,                                    // role name
+    std::string,                                    // name
+    std::string,                                    // toolkit name
+    std::unordered_map<std::string, std::string>,   // attributes
+    Dali::Accessibility::States,                    // states
+    std::tuple<int32_t, int32_t, int32_t, int32_t>, // screen extents
+    std::tuple<int32_t, int32_t, int32_t, int32_t>, // window extents
+    double,                                         // current value
+    double,                                         // minimum increment
+    double,                                         // maximum value
+    double                                          // minimum value
+    >;
+
+  using Relation = std::tuple<uint32_t, std::vector<Dali::Accessibility::Accessible*>>;
 
   /**
    * @copydoc Dali::Accessibility::Accessible::GetChildCount()
@@ -146,9 +169,9 @@ public:
   DBus::ValueOrError<std::unordered_map<std::string, std::string>> GetAttributes();
 
   /**
-   * @copydoc Dali::Accessibility::Accessible::GetInterfaces()
+   * @copydoc Dali::Accessibility::Accessible::GetInterfacesAsStrings()
    */
-  DBus::ValueOrError<std::vector<std::string>> GetInterfaces();
+  DBus::ValueOrError<std::vector<std::string>> GetInterfacesAsStrings();
 
   /**
    * @brief Gets Accessible object on which surface lies the point with given coordinates.
@@ -177,7 +200,7 @@ public:
    *
    * The "Default label" is a text that could be read by screen-reader immediately
    * after the navigation context has changed (window activates, popup shows up, tab changes) and before first UI element is highlighted.
-   * @return The array containing the default label, its role, and its attributes
+   * @return The array containing the Accessible object being a source of default label text, its role, and its attributes
    * @note This is a Tizen only feature not present in upstream ATSPI.
    * Feature can be enabled/disabled for particular context root object by setting value of its accessibility attribute "default_label".
    */
@@ -190,11 +213,6 @@ public:
   ReadingMaterialType GetReadingMaterial();
 
   /**
-   * @copydoc Dali::Accessibility::Bridge::SuppressScreenReader()
-   */
-  void SuppressScreenReader(bool) override;
-
-  /**
    * @copydoc Dali::Accessibility::Accessible::DoGesture()
    */
   DBus::ValueOrError<bool> DoGesture(Dali::Accessibility::Gesture type, int32_t startPositionX, int32_t startPositionY, int32_t endPositionX, int32_t endPositionY, Dali::Accessibility::GestureState state, uint32_t eventTime);
@@ -204,6 +222,17 @@ public:
    */
   DBus::ValueOrError<std::vector<Relation>> GetRelationSet();
 
+  /**
+   * @copydoc Dali::Accessibility::Accessible::SetListenPostRender()
+   */
+  DBus::ValueOrError<void> SetListenPostRender(bool enabled);
+
+  /**
+   * @brief Gets Node information of the self object.
+   * @return Node information
+   */
+  NodeInfoType GetNodeInfo();
+
 private:
   /**
    * @brief Calculates Neighbor candidate object in root node.
@@ -285,10 +314,6 @@ private:
    * @return The Component object
    */
   Dali::Accessibility::Component* CalculateNavigableAccessibleAtPoint(Dali::Accessibility::Accessible* root, Dali::Accessibility::Point point, Dali::Accessibility::CoordinateType type, unsigned int maxRecursionDepth);
-
-
-protected:
-  bool mIsScreenReaderSuppressed = false;
 };
 
 #endif // DALI_INTERNAL_ACCESSIBILITY_BRIDGE_ACCESSIBLE_H