#include "IEventSource.h"
#include "Runnable.h"
#include "A11yEvent.h"
+#include "AurumXML.h"
#include <atspi/atspi.h>
#include <memory>
*/
virtual std::map<AtspiAccessible *, std::shared_ptr<AccessibleApplication>> getActiveAppMap(void) = 0;
+ /**
+ * @brief Gets XML Document map.
+ *
+ * @return map (package std::string, @AurumXML)
+ * @since_tizen 7.0
+ */
+ virtual std::map<std::string, std::shared_ptr<AurumXML>> getXMLDocMap(void) = 0;
+
public:
/**
* @brief Gets active application vector.
*/
virtual std::map<AtspiAccessible *, std::shared_ptr<AccessibleApplication>> getActiveAppMap(void) override;
+ /**
+ * @copydoc @AccessibleWatcher::getXMLDocMap()
+ */
+ virtual std::map<std::string, std::shared_ptr<AurumXML>> getXMLDocMap(void) override;
+
public:
/**
* @brief Listen atspi events.
std::list<AtspiAccessible *> mActivatedApplicationList;
std::set<AtspiAccessible *> mWindowSet;
std::map<AtspiAccessible *, std::shared_ptr<AccessibleApplication>> mActiveAppMap;
+ std::map<std::string, std::shared_ptr<AurumXML>> mXMLDocMap;
static GThread *mEventThread;
static std::vector<std::shared_ptr<A11yEventInfo>> mEventQueue;
static std::mutex mMutex;
std::map<AtspiAccessible *, std::shared_ptr<AccessibleApplication>> getActiveAppMap(void);
+ std::map<std::string, std::shared_ptr<AurumXML>> getXMLDocMap(void);
+
public:
/**
* @brief TBD
std::vector<std::shared_ptr<AccessibleApplication>> mApplicationList;
std::map<AtspiAccessible *, std::shared_ptr<AccessibleApplication>> mActiveAppMap;
+ std::map<std::string, std::shared_ptr<AurumXML>> mXMLDocMap;
+
};
}
else {
LOGI("app(%s) is already in map", pkg);
}
+
+ if (!instance->mXMLDocMap.count(std::string(pkg))) {
+ instance->mXMLDocMap.insert(std::pair<std::string, std::shared_ptr<AurumXML>>(std::string(pkg),
+ std::make_shared<AurumXML>(std::make_shared<AtspiAccessibleNode>(app))));
+ }
}
else if (!strncmp(event->type, "window:deactivate", 16)) {
LOGI("window deactivate in app(%s)", pkg);
LOGE("deactivated window's app(%s) is not in map", pkg);
}
+ if (instance->mXMLDocMap.count(std::string(pkg))) {
+ instance->mXMLDocMap.erase(std::string(pkg));
+ }
+
g_object_unref(app);
}
}
return mActiveAppMap;
}
+std::map<std::string, std::shared_ptr<AurumXML>> AtspiAccessibleWatcher::getXMLDocMap(void)
+{
+ return mXMLDocMap;
+}
+
bool AtspiAccessibleWatcher::removeFromActivatedList(AtspiAccessible *node)
{
LOGI("remove from activelist node %p", node);
return mActiveAppMap;
}
+std::map<std::string, std::shared_ptr<AurumXML>> MockAccessibleWatcher::getXMLDocMap(void)
+{
+ return mXMLDocMap;
+}
+
std::shared_ptr<MockAccessibleApplication> MockAccessibleWatcher::addApplication(std::string pkgName, Rect<int> geometry, int ifaces, int properties)
{
std::shared_ptr<MockAccessibleNode> appNode = std::make_shared<MockAccessibleNode>(nullptr, pkgName, pkgName, "application", "", "Elm_Win", "default", "", geometry, ifaces, properties);