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 d37377ecb5d22524d025800a68c6adeee01d4497..0c47a2e66189e28f3eecc3cbffb801020f0ebfdf 100644 (file)
@@ -323,6 +323,11 @@ public:
      */
     virtual void updateExtents() = 0;
 
+    /**
+     * @copydoc UiObject::updateXPath()
+     */
+    virtual void updateXPath() = 0;
+
     /**
      * @copydoc UiObject::setFocus()
      */
@@ -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 7fb03ff4a91f7f96352ea47d369418e2dc2d9d25..dd187f9114ec3b03c438819e0ac01a6bbf3cd8c9 100644 (file)
@@ -116,6 +116,11 @@ public:
      */
     void updateExtents() override;
 
+    /**
+     * @copydoc UiObject::updateXPath()
+     */
+    void updateXPath() override;
+
     /**
      * @copydoc UiObject::setFocus()
      */
@@ -124,7 +129,7 @@ public:
     /**
      * @copydoc AccessibleNode::refresh()
      */
-    void refresh() override;
+    void refresh(bool updateAll = true) override;
 
     /**
      * @copydoc AccessibleNode::getActions()
index d2d8e5e9f8e3035a8c9e7d32a355cfb983512468..1a2852f7ae496ebfbe8e7849210ddf6dfdbe94ae 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 6d8d6230775a9c4dc17a9557ee4bf0142535b597..ea84cad9668056cb69eb6272acde137e2cf95840 100644 (file)
@@ -480,6 +480,13 @@ public:
      */
     void updateExtents() const;
 
+    /**
+     * @brief Updates object's XPath information.
+     *
+     * @since_tizen 7.0
+     */
+    void updateXPath() const;
+
     /**
      * @brief Sets focus to object.
      *
index fdf9c99e1abfa2b4bf6aec35dfeaf5570d3d53bc..3cb67eac56c923c1eb825261ca6722da009c295d 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 75a46e1517b00e417bbb0c00e384400ca2fdd23a..cd78ffa775da46a5c8a7888bd8d2d6386015e0d3 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 042171a7f0febef0fcfbd588bcad3f42a37e585c..6e25fa72ba65887a05580591b203118884f24451 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();