#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:
#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
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;
};
#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
#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
#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
#include <map>
/**
- * @brief WindowActivateInfoType enum class
+ * @internal
+ *
+ * @brief WindowActivateInfoType enum class.
+ *
* @since_tizen 5.5
*/
enum class WindowActivateInfoType {
};
/**
+ * @internal
+ *
* @brief IAtspiEvents Interface
* @since_tizen 5.5
*/
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();
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;
};
#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();
#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);
private:
static std::recursive_mutex mMutex;
- //static std::unique_lock<std::mutex> mLock;
};
#endif
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();
}
}
}
}
-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);
});
}
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);