libaurum: Add clearCallback method to AccessibleWatcher interface 19/322719/2
authorHosang Kim <hosang12.kim@samsung.com>
Thu, 10 Apr 2025 06:10:12 +0000 (15:10 +0900)
committerHosang Kim <hosang12.kim@samsung.com>
Fri, 18 Apr 2025 04:16:30 +0000 (13:16 +0900)
Change-Id: I969cfb8eb93bc368a165219a8b83f677dbce5ae8

libaurum/inc/Accessibility/AccessibleWatcher.h
libaurum/inc/Impl/Accessibility/AtspiAccessibleWatcher.h
libaurum/inc/Impl/Accessibility/MockAccessibleWatcher.h
libaurum/inc/UiDevice.h
libaurum/src/Impl/Accessibility/AtspiAccessibleWatcher.cc
libaurum/src/Impl/Accessibility/MockAccessibleWatcher.cc
libaurum/src/UiDevice.cc

index 9b8caf8f361351bee5be53d8c8c8b1cde1d41dd8..e8f40140d07938e68d5a6203fd2a9166172fc7f3 100644 (file)
@@ -113,6 +113,14 @@ public:
      */
     virtual bool registerCallback(const A11yEvent type, EventHandler cb, void *data) = 0;
 
+    /**
+     * @brief Clear atspi event callbacks.
+     *
+     * @return true if callback is unregistered, else false
+     * @since_tizen 10.0
+     */
+    virtual bool clearCallback() = 0;
+
     /**
      * @brief Set AurumXML synchronization.
      *
index 32f26c42fa6479f9d9e620ccd7ac2513eab49715..3e536e29ac7e47eb96819854fd556fd93309b170 100644 (file)
@@ -122,6 +122,11 @@ public:
      */
     virtual bool registerCallback(const A11yEvent type, EventHandler cb, void *data) override;
 
+    /**
+     * @copydoc @AccessibleWatcher::clearCallback()
+     */
+    virtual bool clearCallback() override;
+
     /**
      * @copydoc @AccessibleWatcher::setXMLsync()
      */
index a80c348a67ebf1b48980e8b3e9b6da3ee170f598..83ff89ae962fdf0ec4e516b53392d7b07b1f7190 100644 (file)
@@ -57,6 +57,8 @@ public:
 
     virtual bool registerCallback(const A11yEvent type, EventHandler cb, void *data) override;
 
+    virtual bool clearCallback() override;
+
     std::map<std::pair<std::string, int>, std::shared_ptr<AurumXML>> getXMLDocMap(void);
 
     std::shared_ptr<AurumXML> getXMLDoc(std::pair<std::string, int> process);
index 86103723fc083c45d2f90a070fc86a3989dc9c17..34555f2a3f94f59ef587910122d903fb95a68f94 100644 (file)
@@ -354,7 +354,7 @@ public:
     bool executeAndWaitForEvents(
         const Runnable *cmd, const A11yEvent type, const int timeout, const std::string packageName, const int count) const;
 
-/**
+    /**
      * @brief Register atspi event callback.
      *
      * @param[in] type @A11yEvent
@@ -366,6 +366,14 @@ public:
      */
     bool registerCallback(const A11yEvent type, EventHandler cb, void *data) const;
 
+    /**
+     * @brief Clear atspi event callbacks.
+     *
+     * @return true
+     * @return false
+     */
+    bool clearCallback() const;
+
 public:
     /**
      * @brief Gets UiDevice instance.
index 72b5499fc94f537e0d3ead7047fac1a20addabe4..e800e60318b6960b33435f9b0666cf0910576d2c 100644 (file)
@@ -615,6 +615,12 @@ bool AtspiAccessibleWatcher::registerCallback(const A11yEvent type, EventHandler
     return true;
 }
 
+bool AtspiAccessibleWatcher::clearCallback()
+{
+    mHandlers.clear();
+    return true;
+}
+
 void AtspiAccessibleWatcher::setXMLsync(bool sync)
 {
     LOGI("setXMLSync: %s", (sync ? "TRUE" : "FALSE"));
index 57e949150c0bd53cd4d9a499f5589fe688899af1..217791de825cf1c396c46e8b9b64a7e9092f140d 100644 (file)
@@ -48,6 +48,11 @@ bool MockAccessibleWatcher::registerCallback(const A11yEvent type, EventHandler
     return true;
 }
 
+bool MockAccessibleWatcher::clearCallback()
+{
+    return true;
+}
+
 void MockAccessibleWatcher::setXMLsync(bool sync)
 {
 }
index c55aa37840f130d896fb8ce50a95fa9025651f8d..0873948820a99ab6e136aa245553a92182f370f8 100644 (file)
@@ -440,6 +440,11 @@ bool UiDevice::registerCallback(const A11yEvent type, EventHandler cb, void *dat
     return AccessibleWatcher::getInstance()->registerCallback(type, cb, data);
 }
 
+bool UiDevice::clearCallback() const
+{
+    return AccessibleWatcher::getInstance()->clearCallback();
+}
+
 int UiDevice::getWindowAngle()
 {
     auto wins = getWindowRoot();