libaurum: add updateXPath 62/272062/4
authorHosang Kim <hosang12.kim@samsung.com>
Mon, 7 Mar 2022 14:26:49 +0000 (23:26 +0900)
committerkim hosang <hosang12.kim@samsung.com>
Thu, 24 Mar 2022 05:13:04 +0000 (05:13 +0000)
Change-Id: I61a2f9b89e2d50a8936ba17f67605f82824a93b4

libaurum/inc/Accessibility/AccessibleNode.h
libaurum/inc/Impl/Accessibility/AtspiAccessibleNode.h
libaurum/inc/Impl/Accessibility/MockAccessibleNode.h
libaurum/inc/UiObject.h
libaurum/src/Impl/Accessibility/AtspiAccessibleNode.cc
libaurum/src/Impl/Accessibility/MockAccessibleNode.cc
libaurum/src/UiObject.cc

index d37377e..0c47a2e 100644 (file)
@@ -324,6 +324,11 @@ public:
     virtual void updateExtents() = 0;
 
     /**
+     * @copydoc UiObject::updateXPath()
+     */
+    virtual void updateXPath() = 0;
+
+    /**
      * @copydoc UiObject::setFocus()
      */
     virtual bool setFocus() = 0;
@@ -333,7 +338,7 @@ public:
      *
      * @since_tizen 6.5
      */
-    virtual void refresh() = 0;
+    virtual void refresh(bool updateAll = true) = 0;
 
     /**
      * @brief Gets available atspi action name.
@@ -423,6 +428,7 @@ protected:
     std::string mAutomationId;
     std::string mType;
     std::string mStyle;
+    std::string mXPath;
     Rect<int> mScreenBoundingBox;
     Rect<int> mWindowBoundingBox;
     int mSupportingIfaces;
index 7fb03ff..dd187f9 100644 (file)
@@ -117,6 +117,11 @@ public:
     void updateExtents() override;
 
     /**
+     * @copydoc UiObject::updateXPath()
+     */
+    void updateXPath() override;
+
+    /**
      * @copydoc UiObject::setFocus()
      */
     bool setFocus() override;
@@ -124,7 +129,7 @@ public:
     /**
      * @copydoc AccessibleNode::refresh()
      */
-    void refresh() override;
+    void refresh(bool updateAll = true) override;
 
     /**
      * @copydoc AccessibleNode::getActions()
index d2d8e5e..1a2852f 100644 (file)
@@ -116,6 +116,11 @@ public:
      * @since_tizen 6.5
      */
     void updateExtents() override;
+    /**
+     * @brief TBD
+     * @since_tizen 6.5
+     */
+    void updateXPath() override;
 
     /**
      * @brief TBD
@@ -127,7 +132,7 @@ public:
      * @brief TBD
      * @since_tizen 6.5
      */
-    void refresh() override;
+    void refresh(bool updateAll = true) override;
 
     /**
      * @brief TBD
index 6d8d623..ea84cad 100644 (file)
@@ -481,6 +481,13 @@ public:
     void updateExtents() const;
 
     /**
+     * @brief Updates object's XPath information.
+     *
+     * @since_tizen 7.0
+     */
+    void updateXPath() const;
+
+    /**
      * @brief Sets focus to object.
      *
      * @since_tizen 7.0
index fdf9c99..3cb67ea 100644 (file)
@@ -230,6 +230,16 @@ void AtspiAccessibleNode::updateExtents()
     }
 }
 
+void AtspiAccessibleNode::updateXPath()
+{
+    auto XMLDocMap = AccessibleWatcher::getInstance()->getXMLDocMap();
+    if (XMLDocMap.count(mPkg) == 0) return;
+
+    auto XMLDoc = XMLDocMap[mPkg];
+
+    mXPath = XMLDoc->getXPath(mId);
+}
+
 bool AtspiAccessibleNode::setFocus()
 {
     AtspiComponent *component = AtspiWrapper::Atspi_accessible_get_component_iface(mNode);
@@ -242,7 +252,7 @@ bool AtspiAccessibleNode::setFocus()
         return false;
 }
 
-void AtspiAccessibleNode::refresh()
+void AtspiAccessibleNode::refresh(bool updateAll)
 {
     AtspiWrapper::Atspi_accessible_clear_cache(mNode);
 
@@ -327,6 +337,8 @@ void AtspiAccessibleNode::refresh()
                 g_free(windowExtent);
             }
             g_object_unref(component);
+
+            if (updateAll) updateXPath();
         }
     } else {
         setFeatureProperty(ATSPI_STATE_INVALID);
index 75a46e1..cd78ffa 100644 (file)
@@ -109,12 +109,16 @@ void MockAccessibleNode::updateExtents()
 {
 }
 
+void MockAccessibleNode::updateXPath()
+{
+}
+
 bool MockAccessibleNode::setFocus()
 {
     return false;
 }
 
-void MockAccessibleNode::refresh()
+void MockAccessibleNode::refresh(bool updateAll)
 {
 }
 
index 042171a..6e25fa7 100644 (file)
@@ -304,6 +304,11 @@ void UiObject::updateExtents() const
     mNode->updateExtents();
 }
 
+void UiObject::updateXPath() const
+{
+    mNode->updateXPath();
+}
+
 bool UiObject::setFocus() const
 {
     return mNode->setFocus();