libaurum: Add doc for Accessible, AtspiAccessible classes 23/265623/4
authorWoochanlee <wc0917.lee@samsung.com>
Mon, 25 Oct 2021 10:37:43 +0000 (19:37 +0900)
committerwoochan lee <wc0917.lee@samsung.com>
Thu, 4 Nov 2021 04:39:44 +0000 (04:39 +0000)
Change-Id: I3ddc06de57dea697a2a522c6750beeed6b576e08

12 files changed:
libaurum/inc/Accessibility/AccessibleApplication.h
libaurum/inc/Accessibility/AccessibleWatcher.h
libaurum/inc/Accessibility/AccessibleWindow.h
libaurum/inc/Accessibility/IEventConsumer.h
libaurum/inc/Accessibility/IEventSource.h
libaurum/inc/Impl/Accessibility/AtspiAccessibleApplication.h
libaurum/inc/Impl/Accessibility/AtspiAccessibleWatcher.h
libaurum/inc/Impl/Accessibility/AtspiAccessibleWindow.h
libaurum/inc/Impl/Accessibility/AtspiWrapper.h
libaurum/src/Accessibility/AccessibleNode.cc
libaurum/src/Accessibility/AccessibleWatcher.cc
libaurum/src/Impl/Accessibility/AtspiAccessibleWatcher.cc

index 9701b3048dc9e0a0e4141d8caa4e02229da4c13e..097d141a8736ee0ae5172be97a00f875f43e5157 100644 (file)
 
 #include <memory>
 
+/**
+ * @class AccessibleApplication
+ *
+ * @ingroup aurum
+ *
+ * @brief Class that matches atspi Application Node.
+ *        It provides information such as active window, application name.
+ */
 class AccessibleApplication {
 public:
+    /**
+     * @brief AccessibleApplication constructor.
+     *
+     * @since_tizen 5.5
+     */
     AccessibleApplication(std::shared_ptr<AccessibleNode> node);
+
+    /**
+     * @brief AccessibleApplication destructor.
+     *
+     * @since_tizen 5.5
+     */
     virtual ~AccessibleApplication();
 
 public:
+    /**
+     * @brief Gets matched @AccessibleNode.
+     *
+     * @return @AccessibleNode
+     *
+     * @since_tizen 5.5
+     */
     std::shared_ptr<AccessibleNode> getAccessibleNode();
+
+    /**
+     * @brief Checks this active or not.
+     *
+     * @return true if it actives, else false
+     *
+     * @since_tizen 5.5
+     */
     bool isActive(void);
 
 public:
+    /**
+     * @brief Gets application's window.
+     *
+     * @return @AccessibleWindow vector
+     *
+     * @since_tizen 5.5
+     */
     virtual std::vector<std::shared_ptr<AccessibleWindow>> getWindows(void) = 0;
+
+    /**
+     * @brief Gets currently active window.
+     *
+     * @return @AccessibleWindow vector
+     *
+     * @since_tizen 5.5
+     */
     virtual std::vector<std::shared_ptr<AccessibleWindow>> getActiveWindows(void);
+
+    /**
+     * @brief Gets application package name.
+     *
+     * @return string
+     *
+     * @since_tizen 5.5
+     */
     virtual std::string getPackageName(void) = 0;
 
 private:
index 6c775562dc31f239457c9ce55cb50617f632ed21..d2977f2e9be9a1b6af71f3b8c601847ba2d646c8 100644 (file)
 #include "config.h"
 
 /**
- * @brief AccessibleWatcher class
- * @since_tizen 5.5
+ * @class AccessibleWatcher
+ *
+ * @ingroup aurum
+ *
+ * @brief Class that communicates with the atspi sever and generates an event,
+ *        and generates a node that matches with atspi node.
  */
 class AccessibleWatcher : public IEventSource {
 public:
     /**
-     * @brief TBD
+     * @brief AccessibleWatcher constructor.
+     *
      * @since_tizen 5.5
      */
     AccessibleWatcher();
 
     /**
-     * @brief TBD
+     * @brief AccessibleWatcher destructor.
+     *
      * @since_tizen 5.5
      */
     virtual ~AccessibleWatcher();
 
     /**
-     * @brief TBD
+     * @brief Gets @AccessibleWatcher instance.
+     *
      * @since_tizen 5.5
      */
     static AccessibleWatcher *getInstance(AccessibleWatcher *watcherImpl = nullptr);
 
 public:
     /**
-     * @brief TBD
+     * @brief Gets current running application count in device.
+     *
+     * @return application count
+     *
      * @since_tizen 5.5
      */
     virtual int getApplicationCount(void) const = 0;
 
     /**
-     * @brief TBD
+     * @brief Gets application class at specific index.
+     *
+     * @param[in] index application index
+     *
+     * @return @AccessibleApplication ptr
+     *
      * @since_tizen 5.5
      */
     virtual std::shared_ptr<AccessibleApplication> getApplicationAt(int index) const = 0;
 
     /**
-     * @brief TBD
+     * @brief Gets application node vector.
+     *
+     * @return @AccessibleApplication vector
+     *
      * @since_tizen 5.5
      */
     virtual std::vector<std::shared_ptr<AccessibleApplication>> getApplications(void) const = 0;
 
     /**
-     * @brief TBD
+     * @brief Executes runnable command and wait given event.
+     *
+     * @param[in] cmd @Runnable
+     * @param[in] type @A11yEvent
+     * @param[in] timeout time(millisecond) to wait event occur
+     *
+     * @return true if event occur in time, else false
+     *
      * @since_tizen 6.5
      */
     virtual bool executeAndWaitForEvents(const Runnable *cmd, const A11yEvent type, const int timeout) = 0;
 
     /**
-     * @brief TBD
+     * @brief Gets active application map.
+     *
+     * @return map (pure Atspi Node ptr(@AtspiAccessible), @AccessibleApplication)
      * @since_tizen 6.5
      */
     virtual std::map<AtspiAccessible *, std::shared_ptr<AccessibleApplication>> getActiveAppMap(void) = 0;
 
 public:
     /**
-     * @brief TBD
+     * @brief Gets active application vector.
+     *
+     * @return @AccessibleApplication vector
+     *
      * @since_tizen 5.5
      */
     virtual std::vector<std::shared_ptr<AccessibleApplication>> getActiveApplications(void) const;
+
 public:
     /**
-     * @brief TBD
-     * @since_tizen 5.5
+     * @copydoc @IEventSource::attach()
      */
     void attach(std::shared_ptr<IEventConsumer> source) override;
 
     /**
-     * @brief TBD
-     * @since_tizen 5.5
+     * @copydoc @IEventSource::detach()
      */
     void detach(std::shared_ptr<IEventConsumer> source) override;
 
     /**
-     * @brief TBD
-     * @since_tizen 5.5
+     * @copydoc @IEventSource::notifyAll()
      */
-    void notifyAll(int type, int type2, void *src) override;
+    void notifyAll(int type1, int type2, void *src) override;
 
 private:
-    /**
-     * @brief TBD
-     */
     std::set<std::shared_ptr<IEventConsumer>> mSources;
-
-    /**
-     * @brief TBD
-     */
     std::mutex mLock;
 };
 
-#endif
\ No newline at end of file
+#endif
index 751a774b508caa8be72e06e0cbfe99cc554a3be7..f422d68ed3bd80ff1e29d008919a0d7774659122 100644 (file)
 
 class AccessibleApplication;
 
+/**
+ * @class AccessibleWindow
+ *
+ * @ingroup aurum
+ *
+ * @brief Class that matches atspi Window Node.
+ *        It provides information such as window title, window properties.
+ */
 class AccessibleWindow {
 public:
     /**
-     * @brief TBD
+     * @brief AccessibleWindow constructor.
+     *
+     * @param[in] app @AccessibleApplication
+     * @param[in] node @AccessibleNode
+     *
      * @since_tizen 6.0
      */
     AccessibleWindow(std::shared_ptr<AccessibleApplication> app, std::shared_ptr<AccessibleNode> node);
 
     /**
-     * @brief TBD
+     * @brief AccessibleWindow destructor.
+     *
      * @since_tizen 6.0
      */
     virtual ~AccessibleWindow();
 
 public:
     /**
-     * @brief TBD
+     * @brief Gets window title.
+     *
+     * @return string
+     *
      * @since_tizen 6.0
      */
     std::string getTitle(void);
 
     /**
-     * @brief TBD
+     * @brief Checks current window showing or not.
+     *
+     * @return true if it is showing, else false
+     *
      * @since_tizen 6.0
      */
     bool isShowing();
 
     /**
-     * @brief TBD
+     * @brief Checks current window active or not.
+     *
+     * @return true if it actives, else false
+     *
      * @since_tizen 6.0
      */
     bool isActive();
 
     /**
-     * @brief TBD
+     * @brief Gets the application node that this window belongs.
+     *
+     * @return @AccessibleApplication ptr
+     *
      * @since_tizen 6.0
      */
     std::shared_ptr<AccessibleApplication> getApplication(void);
 
     /**
-     * @brief TBD
-     * @since_tizen 6.0
+     * @brief Gets matched @AccessibleNode.
+     *
+     * @return @AccessibleNode
+     *
+     * @since_tizen 5.5
      */
     std::shared_ptr<AccessibleNode> getAccessibleNode(void);
 
 private:
-     /**
-     * @brief TBD
-     */
     std::shared_ptr<AccessibleApplication> mApp;
-
-    /**
-     * @brief TBD
-     */
     std::shared_ptr<AccessibleNode> mNode;
 };
 
index fe4b7d860ccafb081104a9a8ea8512600a82b30b..d8cd29adc9373dc10ac25d052ddb8a0f2dde713c 100644 (file)
 #ifndef _IEVENT_CONSUMER_H_
 #define _IEVENT_CONSUMER_H_
 
+/**
+ * @class EventType
+ *
+ * @ingroup aurum
+ *
+ * @brief Enum class for Event Type.
+ */
 enum class EventType {
     none = 0,
     Object = 1,
 };
 
+/**
+ * @class ObjectEventType
+ *
+ * @ingroup aurum
+ *
+ * @brief Enum class for Object Event Type.
+ */
 enum class ObjectEventType {
     none = 0,
     ObjectStateDefunct = 1,
 };
 
+/**
+ * @class IEventConsumer
+ *
+ * @ingroup aurum
+ *
+ * @brief Class for Event generate.
+ */
 class IEventConsumer
 {
 public:
+    /**
+     * @brief IEventConsumer destructor.
+     *
+     * @since_tizen 5.5
+     */
     virtual ~IEventConsumer() {};
-    virtual void notify(int type, int type2, void *src) = 0;
+
+    /**
+     * @brief Notifies event to source node.
+     *
+     * @param[in] type1 @EventType
+     * @param[in] type2 @ObjectEventType
+     * @param[in] src source Node ptr
+     *
+     * @since_tizen 5.5
+     */
+    virtual void notify(int type1, int type2, void *src) = 0;
 };
 
 #endif
index cdb2196652bb178ce36bea6aea7266515aeb08aa..d1f6ce426f7d8ae1aec9edb6466e87d3d3416821 100644 (file)
 #include "IEventConsumer.h"
 #include <memory>
 
+/**
+ * @class IEventSource
+ *
+ * @ingroup aurum
+ *
+ * @brief Class for Event generate.
+ */
 class IEventSource
 {
 public:
+    /**
+     * @brief IEventSource destructor.
+     *
+     * @since_tizen 5.5
+     */
     virtual ~IEventSource() {};
+
+    /**
+     * @brief Attaches event source.
+     *
+     * @param[in] source @IEventConsumer
+     *
+     * @since_tizen 5.5
+     */
     virtual void attach(std::shared_ptr<IEventConsumer> source) = 0;
+
+    /**
+     * @brief Detaches event source.
+     *
+     * @param[in] source @IEventConsumer
+     *
+     * @since_tizen 5.5
+     */
     virtual void detach(std::shared_ptr<IEventConsumer> source) = 0;
-    virtual void notifyAll(int type, int type2, void *src) = 0;
+
+    /**
+     * @brief Notifies all attached event.
+     *
+     * @param[in] type1 @EventType
+     * @param[in] type2 @ObjectEventType
+     * @param[in] src source Node ptr
+     *
+     * @since_tizen 5.5
+     */
+    virtual void notifyAll(int type1, int type2, void *src) = 0;
 };
 
 #endif
index 626abb9053426fff0bf4db399a310daec979acd9..a6cdb80cd70aef0f3c129479aa7be78793d23894 100644 (file)
 #include <memory>
 #include <atspi/atspi.h>
 
+/**
+ * @internal
+ *
+ * @class AtspiAccessibleApplication
+ *
+ * @ingroup aurum
+ *
+ * @brief Class that matches atspi Application Node.
+ *        It provides information such as active window, application name.
+ */
 class AtspiAccessibleApplication : public AccessibleApplication, public std::enable_shared_from_this<AtspiAccessibleApplication> {
 public:
     /**
-     * @brief TBD
+     * @brief AtspiAccessibleApplication constructor.
+     *
+     * @param[in] node @AccessibleNode
+     *
      * @since_tizen 6.0
      */
     AtspiAccessibleApplication(std::shared_ptr<AccessibleNode> node);
 
     /**
-     * @brief TBD
+     * @brief AtspiAccessibleApplication destructor.
+     *
      * @since_tizen 6.0
      */
     virtual ~AtspiAccessibleApplication();
 
 public:
     /**
-     * @brief TBD
-     * @since_tizen 6.0
+     * @copydoc @AccessibleApplication::getWindows()
      */
     std::vector<std::shared_ptr<AccessibleWindow>> getWindows(void) override;
 
     /**
-     * @brief TBD
-     * @since_tizen 6.0
+     * @copydoc @AccessibleApplication::getPackageName()
      */
     std::string getPackageName(void) override;
 };
 
-#endif
\ No newline at end of file
+#endif
index e53dc38c3156b3a27567023b5b272fbf1f3ad30a..f4ed61ff2ae8b6499355823c660f232ae2edf22a 100644 (file)
 #include <map>
 
 /**
- * @brief WindowActivateInfoType enum class
+ * @internal
+ *
+ * @brief WindowActivateInfoType enum class.
+ *
  * @since_tizen 5.5
  */
 enum class WindowActivateInfoType {
@@ -44,6 +47,8 @@ enum class WindowActivateInfoType {
 };
 
 /**
+ * @internal
+ *
  * @brief IAtspiEvents Interface
  * @since_tizen 5.5
  */
@@ -62,7 +67,16 @@ public:
     virtual void onObjectDefunct(AtspiAccessible *node) = 0;
 };
 
-
+/**
+ * @internal
+ *
+ * @class AtspiAccessibleWatcher
+ *
+ * @ingroup aurum
+ *
+ * @brief Class that communicates with the atspi sever and generates an event,
+ *        and generates a node that matches with atspi node.
+ */
 class AtspiAccessibleWatcher : public AccessibleWatcher, public IAtspiEvents {
 public:
     AtspiAccessibleWatcher();
@@ -70,128 +84,76 @@ public:
 
 public:
     /**
-     * @brief TBD
-     * @since_tizen 5.5
+     * @copydoc @AccessibleWatcher::getApplicationCount()
      */
     virtual int getApplicationCount(void) const override;
 
     /**
-     * @brief TBD
-     * @since_tizen 5.5
+     * @copydoc @AccessibleWatcher::getApplicationAt()
      */
     virtual std::shared_ptr<AccessibleApplication> getApplicationAt(int index) const override;
 
     /**
-     * @brief TBD
-     * @since_tizen 5.5
+     * @copydoc @AccessibleWatcher::getApplications()
      */
     virtual std::vector<std::shared_ptr<AccessibleApplication>> getApplications(void) const override;
 
     /**
-     * @brief TBD
-     * @since_tizen 6.5
+     * @copydoc @AccessibleWatcher::executeAndWaitForEvents()
      */
     virtual bool executeAndWaitForEvents(const Runnable *cmd, const A11yEvent type, const int timeout) override;
 
+    /**
+     * @copydoc @AccessibleWatcher::getActiveAppMap()
+     */
     virtual std::map<AtspiAccessible *, std::shared_ptr<AccessibleApplication>> getActiveAppMap(void) override;
 
 public:
     /**
-     * @brief TBD
+     * @brief Listen atspi events.
+     *
+     * @param[in] event AtspiEvent
+     * @param[in] watcher @AtspiAccessibleWatcher
+     *
      * @since_tizen 5.5
      */
-    static void onAtspiEvents(AtspiEvent *event, void *user_data);
+    static void onAtspiEvents(AtspiEvent *event, void *watcher);
 
     /**
-     * @brief TBD
+     * @brief Notifies when object defunct.
+     *
+     * @param[in] node @AtspiAccessible
+     *
      * @since_tizen 5.5
      */
     void onObjectDefunct(AtspiAccessible *node) override;
 
     /**
-     * @brief TBD
+     * @brief AtspiEvent listener.
+     *
+     * @param[in] event AtspiEvent
+     * @param[in] user_data data for event by user
+     *
      * @since_tizen 6.5
      */
     static void onEventListener(AtspiEvent *event, void *user_data);
 private:
-    /**
-     * @brief TBD
-     * @since_tizen 5.5
-     */
+    /** Private methods for Mock Test **/
     bool removeFromActivatedList(AtspiAccessible *node);
-
-    /**
-     * @brief TBD
-     * @since_tizen 5.5
-     */
     bool addToActivatedList(AtspiAccessible *node);
-
-    /**
-     * @brief TBD
-     * @since_tizen 5.5
-     */
     bool removeFromWindowSet(AtspiAccessible *node);
-
-    /**
-     * @brief TBD
-     * @since_tizen 5.5
-     */
     bool addToWindowSet(AtspiAccessible *node);
-
-    /**
-     * @brief TBD
-     * @since_tizen 6.5
-     */
     void addEventListener(AtspiEventListener *listener, A11yEvent type);
-
-    /**
-     * @brief TBD
-     * @since_tizen 6.5
-     */
     void removeEventListener(AtspiEventListener *listener, A11yEvent type);
 
-public:
-    /**
-     * @brief TBD
-     */
-    static guint timeoutId;
-
 private:
-    /**
-     * @brief TBD
-     */
-    GDBusProxy *                                  mDbusProxy;
-
-    /**
-     * @brief TBD
-     */
-    std::list<AtspiAccessible *>          mActivatedWindowList;
-
-    /**
-     * @brief TBD
-     */
-    std::list<AtspiAccessible *>          mActivatedApplicationList;
-
-    /**
-     * @brief TBD
-     */
-    std::set<AtspiAccessible *>            mWindowSet;
-
-    /**
-     * @brief TBD
-     */
+    GDBusProxy *mDbusProxy;
+    std::list<AtspiAccessible *> mActivatedWindowList;
+    std::list<AtspiAccessible *> mActivatedApplicationList;
+    std::set<AtspiAccessible *> mWindowSet;
     std::map<AtspiAccessible *, std::shared_ptr<AccessibleApplication>> mActiveAppMap;
-
-    /**
-     * @brief TBD
-     */
-    static GThread *                                      mEventThread;
-
-    /**
-     * @brief TBD
-     */
-    static std::vector<std::shared_ptr<A11yEventInfo>>    mEventQueue;
-
+    static GThread *mEventThread;
+    static std::vector<std::shared_ptr<A11yEventInfo>> mEventQueue;
     static std::mutex mMutex;
 };
 
index a303bc037d55f994e1d3a6ed52c310c8561370dc..e9d6f713955dd3308e3893025aebb84ef8d88633 100644 (file)
 
 #include "AccessibleWindow.h"
 
+/**
+ * @internal
+ *
+ * @class AtspiAccessibleWindow
+ *
+ * @ingroup aurum
+ *
+ * @brief Class that matches atspi Window Node.
+ */
 class AtspiAccessibleWindow : public AccessibleWindow {
 public:
     /**
-     * @brief TBD
-     * @since_tizen 6.0
+     * @brief AtspiAccessibleWindow constructor.
+     *
+     * @param[in] app @AccessibleApplication
+     * @param[in] node @AccessibleNode
+     *
+     * @since_tizen 5.5
      */
     AtspiAccessibleWindow(std::shared_ptr<AccessibleApplication> app, std::shared_ptr<AccessibleNode> node);
 
     /**
-     * @brief TBD
-     * @since_tizen 6.0
+     * @brief AtspiAccessibleWindow desturctor.
+     *
+     * @since_tizen 5.5
      */
     ~AtspiAccessibleWindow();
 
index 9ff87f6c08747c55f24859241263b03b30378fc1..ee603d683fc75647867b36703342361c86f70468 100644 (file)
 #include <atspi/atspi.h>
 #include <mutex>
 
+/**
+ * @internal
+ *
+ * @class AtspiWrapper
+ *
+ * @ingroup aurum
+ *
+ * @brief Class that matches atspi Window Node.
+ */
 class AtspiWrapper {
 public:
+    /** Wrapper methods for Atspi APIs **/
     static GArray *Atspi_state_set_get_states(AtspiStateSet *set);
     static GArray *Atspi_accessible_get_interfaces(AtspiAccessible *node);
     static gchar *Atspi_accessible_get_name(AtspiAccessible *node, GError **error);
@@ -49,7 +59,6 @@ public:
 
 private:
     static std::recursive_mutex mMutex;
-    //static std::unique_lock<std::mutex> mLock;
 };
 
 #endif
index 5bd1a4f08df3ad1aee1b1a93fc892d8b4709d05d..45c3993ec0836e48aa5545ecfdd065631659fa0a 100644 (file)
@@ -50,11 +50,11 @@ std::string AccessibleNode::description() {
     return ss.str();
 }
 
-void AccessibleNode::notify(int type, int type2, void *src)
+void AccessibleNode::notify(int type1, int type2, void *src)
 {
     void *handler = getRawHandler();
 
-    if ((EventType)type == EventType::Object && (ObjectEventType)type2 == ObjectEventType::ObjectStateDefunct) {
+    if ((EventType)type1 == EventType::Object && (ObjectEventType)type2 == ObjectEventType::ObjectStateDefunct) {
         if (handler == src) invalidate();
     }
 }
index 77b571f6095b9d726b2f1f133b62a324f97d8788..5b6bc3ad8ac7ccf3c6c395b0711b10cf0c6ad70f 100644 (file)
@@ -88,10 +88,10 @@ void AccessibleWatcher::detach(std::shared_ptr<IEventConsumer> source)
     }
 }
 
-void AccessibleWatcher::notifyAll(int type, int type2, void *src)
+void AccessibleWatcher::notifyAll(int type1, int type2, void *src)
 {
     std::unique_lock<std::mutex> lock(mLock);
     std::for_each(mSources.begin(), mSources.end(), [&](auto source){
-        source->notify(type, type2, src);
+        source->notify(type1, type2, src);
     });
 }
index 9a6441e64406a5c820864997111ba12d08ad8776..a167104dec33c49308ae7bc9def6c030d1694b7a 100644 (file)
@@ -155,14 +155,14 @@ AtspiAccessibleWatcher::~AtspiAccessibleWatcher()
     atspi_exit();
 }
 
-void AtspiAccessibleWatcher::onAtspiEvents(AtspiEvent *event, void *user_data)
+void AtspiAccessibleWatcher::onAtspiEvents(AtspiEvent *event, void *watcher)
 {
     if (!event->source)
     {
         return;
     }
     char *name = NULL, *pkg = NULL;
-    AtspiAccessibleWatcher *instance = (AtspiAccessibleWatcher *)user_data;
+    AtspiAccessibleWatcher *instance = (AtspiAccessibleWatcher *)watcher;
     name = AtspiWrapper::Atspi_accessible_get_name(event->source, NULL);
 
     AtspiAccessible *app = AtspiWrapper::Atspi_accessible_get_application(event->source, NULL);