libaurum: Add ISearchable interface for common methods
authorHosang Kim <hosang12.kim@samsung.com>
Fri, 26 Jan 2024 09:20:57 +0000 (18:20 +0900)
committerHosang Kim <hosang12.kim@samsung.com>
Tue, 6 Feb 2024 04:11:20 +0000 (13:11 +0900)
Implement the ISearchable abstract class in UiObject and UiDevice
to improve code readability and maintainability by separating interface from implementation.

Change-Id: I2ef4d467024f0971622b7f97bba1a6daee30b15a

libaurum/inc/Interface/ISearchable.h
libaurum/inc/UiDevice.h
libaurum/inc/UiObject.h

index d48fdcf032549ae781c7836bc31d80b3c8752e11..aff1e56d5bc0f43234738e115a773345e5a06cc6 100644 (file)
@@ -79,6 +79,38 @@ public:
      */
     virtual std::vector<std::shared_ptr<UiObject>> findObjects(
         const std::shared_ptr<UiSelector> selector) const = 0;
+
+    /**
+     * @brief Get the Matches object that satisfied with the selector condition in the object tree.
+     *        This method is similar to findObjects, but getMatches is more faster than findObjects.
+     *        A single dbus method call occurs internally and retrieves a list of objects
+     *        that satisfy the selector specified in uifw.
+     *
+     * @param[in] selector @UiSelector
+     * @param[in] earlyReturn boolean Returns immediately when a matched object is found
+     *
+     * @return the list of found UiObject pointer vector
+     *
+     * @since_tizen 8.0
+     */
+    virtual std::vector<std::shared_ptr<UiObject>> getMatches(
+        const std::shared_ptr<UiSelector> selector, const bool earlyReturn) const = 0;
+
+    /**
+     * @brief Get the object that satisfied with both condition in the object tree.
+     *        Additional object detection is performed using the second selector for the object
+     *        found in the first selector.
+     *
+     * @param[in] firstSelector @UiSelector
+     * @param[in] secondSelector @UiSelector
+     * @param[in] earlyReturn boolean Returns immediately when a matched object is found
+     *
+     * @return the list of found UiObject pointer vector
+     *
+     * @since_tizen 8.0
+     */
+    virtual std::vector<std::shared_ptr<UiObject>> getMatchesInMatches(
+        const std::shared_ptr<UiSelector> firstSelector, const std::shared_ptr<UiSelector> secondSelector, const bool earlyReturn) const = 0;
 };
 
 }
index 75a9b4c7358059f96b388264bcf6bce7b495ad53..d952f3d1d827fb11398083a708a8177d8f19f4ce 100644 (file)
@@ -314,32 +314,16 @@ public:
         const std::shared_ptr<UiSelector> selector) const override;
 
     /**
-     * @brief Get the Matches object that satisfied with the selector condition in the object tree.
-     *        This method is similar to findObjects, but getMatches is more faster than findObjects.
-     *
-     * @param[in] selector @UiSelector
-     * @param[in] earlyReturn boolean
-     *
-     * @return the list of found UiObject pointer vector
-     *
-     * @since_tizen 8.0
+     * @copydoc ISearchable::getMatches()
      */
     std::vector<std::shared_ptr<UiObject>> getMatches(
-        const std::shared_ptr<UiSelector> selector, const bool earlyReturn) const;
+        const std::shared_ptr<UiSelector> selector, const bool earlyReturn) const override;
 
     /**
-     * @brief Get the object that satisfied with both condition in the object tree.
-     *
-     * @param[in] firstSelector @UiSelector
-     * @param[in] secondSelector @UiSelector
-     * @param[in] earlyReturn boolean
-     *
-     * @return the list of found UiObject pointer vector
-     *
-     * @since_tizen 8.0
+     * @copydoc ISearchable::getMatchesInMatches()
      */
     std::vector<std::shared_ptr<UiObject>> getMatchesInMatches(
-        const std::shared_ptr<UiSelector> firstSelector, const std::shared_ptr<UiSelector> secondSelector, const bool earlyReturn) const;
+        const std::shared_ptr<UiSelector> firstSelector, const std::shared_ptr<UiSelector> secondSelector, const bool earlyReturn) const override;
 
     /**
      * TODO
index 4b586023275aaef3b4f1d70b316f74af2d57ba8e..5ec7aa4b76de0fe25be193b0a98fb406a6b9fbc4 100644 (file)
@@ -23,6 +23,7 @@
 #include "Accessible.h"
 #include "ISearchable.h"
 #include "IObject.h"
+
 #include "UiSelector.h"
 #include "Waiter.h"
 
@@ -139,32 +140,16 @@ public:
         const std::shared_ptr<UiSelector> selector) const override;
 
     /**
-     * @brief Get the Matches object that satisfied with the selector condition in the object tree.
-     *        This method is similar to findObjects, but getMatches is more faster than findObjects.
-     *
-     * @param[in] selector @UiSelector
-     * @param[in] earlyReturn boolean
-     *
-     * @return the list of found UiObject pointer vector
-     *
-     * @since_tizen 8.0
+     * @copydoc ISearchable::getMatches()
      */
     std::vector<std::shared_ptr<UiObject>> getMatches(
-        const std::shared_ptr<UiSelector> selector, const bool earlyReturn) const;
+        const std::shared_ptr<UiSelector> selector, const bool earlyReturn) const override;
 
     /**
-     * @brief Get the object that satisfied with both condition in the object tree.
-     *
-     * @param[in] firstSelector @UiSelector
-     * @param[in] secondSelector @UiSelector
-     * @param[in] earlyReturn boolean
-     *
-     * @return the list of found UiObject pointer vector
-     *
-     * @since_tizen 8.0
+     * @copydoc ISearchable::getMatchesInMatches()
      */
     std::vector<std::shared_ptr<UiObject>> getMatchesInMatches(
-        const std::shared_ptr<UiSelector> firstSelector, const std::shared_ptr<UiSelector> secondSelector, const bool earlyReturn) const;
+        const std::shared_ptr<UiSelector> firstSelector, const std::shared_ptr<UiSelector> secondSelector, const bool earlyReturn) const override;
 
     /**
      * TODO