From 251e6762341109c4ea7fce49f8991d5e62ca2a9d Mon Sep 17 00:00:00 2001 From: Hosang Kim Date: Fri, 26 Jan 2024 18:20:57 +0900 Subject: [PATCH] libaurum: Add ISearchable interface for common methods 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 | 32 ++++++++++++++++++++++++++++++++ libaurum/inc/UiDevice.h | 24 ++++-------------------- libaurum/inc/UiObject.h | 25 +++++-------------------- 3 files changed, 41 insertions(+), 40 deletions(-) diff --git a/libaurum/inc/Interface/ISearchable.h b/libaurum/inc/Interface/ISearchable.h index d48fdcf..aff1e56 100644 --- a/libaurum/inc/Interface/ISearchable.h +++ b/libaurum/inc/Interface/ISearchable.h @@ -79,6 +79,38 @@ public: */ virtual std::vector> findObjects( const std::shared_ptr 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> getMatches( + const std::shared_ptr 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> getMatchesInMatches( + const std::shared_ptr firstSelector, const std::shared_ptr secondSelector, const bool earlyReturn) const = 0; }; } diff --git a/libaurum/inc/UiDevice.h b/libaurum/inc/UiDevice.h index 75a9b4c..d952f3d 100644 --- a/libaurum/inc/UiDevice.h +++ b/libaurum/inc/UiDevice.h @@ -314,32 +314,16 @@ public: const std::shared_ptr 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> getMatches( - const std::shared_ptr selector, const bool earlyReturn) const; + const std::shared_ptr 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> getMatchesInMatches( - const std::shared_ptr firstSelector, const std::shared_ptr secondSelector, const bool earlyReturn) const; + const std::shared_ptr firstSelector, const std::shared_ptr secondSelector, const bool earlyReturn) const override; /** * TODO diff --git a/libaurum/inc/UiObject.h b/libaurum/inc/UiObject.h index 4b58602..5ec7aa4 100644 --- a/libaurum/inc/UiObject.h +++ b/libaurum/inc/UiObject.h @@ -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 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> getMatches( - const std::shared_ptr selector, const bool earlyReturn) const; + const std::shared_ptr 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> getMatchesInMatches( - const std::shared_ptr firstSelector, const std::shared_ptr secondSelector, const bool earlyReturn) const; + const std::shared_ptr firstSelector, const std::shared_ptr secondSelector, const bool earlyReturn) const override; /** * TODO -- 2.7.4