summaryrefslogtreecommitdiffstats
path: root/src/uscxml/plugins/ioprocessor
diff options
context:
space:
mode:
authorStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2013-04-17 20:43:59 (GMT)
committerStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2013-04-17 20:43:59 (GMT)
commitbd394cdb9f78715cf92ddaaef026b6b00d3d2bd9 (patch)
tree2ecf830f7e343af4d8f0439f43ae0cbdafd7b3ba /src/uscxml/plugins/ioprocessor
parent1c10bc4bf19c5ce73e3e10380e613da8bf93a1b0 (diff)
downloaduscxml-bd394cdb9f78715cf92ddaaef026b6b00d3d2bd9.zip
uscxml-bd394cdb9f78715cf92ddaaef026b6b00d3d2bd9.tar.gz
uscxml-bd394cdb9f78715cf92ddaaef026b6b00d3d2bd9.tar.bz2
Fixed setConfiguration and started MMI arch
Diffstat (limited to 'src/uscxml/plugins/ioprocessor')
-rw-r--r--src/uscxml/plugins/ioprocessor/modality/MMIComponent.cpp30
-rw-r--r--src/uscxml/plugins/ioprocessor/modality/MMIComponent.h51
-rw-r--r--src/uscxml/plugins/ioprocessor/modality/MMIMessages.cpp338
-rw-r--r--src/uscxml/plugins/ioprocessor/modality/MMIMessages.h280
4 files changed, 699 insertions, 0 deletions
diff --git a/src/uscxml/plugins/ioprocessor/modality/MMIComponent.cpp b/src/uscxml/plugins/ioprocessor/modality/MMIComponent.cpp
new file mode 100644
index 0000000..a38e275
--- /dev/null
+++ b/src/uscxml/plugins/ioprocessor/modality/MMIComponent.cpp
@@ -0,0 +1,30 @@
+#include "MMIComponent.h"
+//#include <glog/logging.h>
+
+#ifdef BUILD_AS_PLUGINS
+#include <Pluma/Connector.hpp>
+#endif
+
+namespace uscxml {
+
+MMIIOProcessor::MMIIOProcessor() {
+}
+
+MMIIOProcessor::~MMIIOProcessor() {
+}
+
+boost::shared_ptr<IOProcessorImpl> MMIIOProcessor::create(InterpreterImpl* interpreter) {
+ boost::shared_ptr<MMIIOProcessor> invoker = boost::shared_ptr<MMIIOProcessor>(new MMIIOProcessor());
+ invoker->_interpreter = interpreter;
+ return invoker;
+}
+
+Data MMIIOProcessor::getDataModelVariables() {
+ Data data;
+ return data;
+}
+
+void MMIIOProcessor::send(const SendRequest& req) {
+}
+
+} \ No newline at end of file
diff --git a/src/uscxml/plugins/ioprocessor/modality/MMIComponent.h b/src/uscxml/plugins/ioprocessor/modality/MMIComponent.h
new file mode 100644
index 0000000..bee568b
--- /dev/null
+++ b/src/uscxml/plugins/ioprocessor/modality/MMIComponent.h
@@ -0,0 +1,51 @@
+#ifndef MMIIOPROCESSOR_H_W09J90F0
+#define MMIIOPROCESSOR_H_W09J90F0
+
+#include <uscxml/Interpreter.h>
+#include "MMIMessages.h"
+
+#ifdef BUILD_AS_PLUGINS
+#include "uscxml/plugins/Plugins.h"
+#endif
+
+namespace uscxml {
+
+class MMIIOProcessor : public IOProcessorImpl {
+public:
+ MMIIOProcessor();
+ virtual ~MMIIOProcessor();
+ virtual boost::shared_ptr<IOProcessorImpl> create(InterpreterImpl* interpreter);
+
+ virtual std::set<std::string> getNames() {
+ return std::set<std::string>();
+ };
+
+ virtual Data getDataModelVariables();
+ virtual void send(const SendRequest& req);
+
+ /** Modality component */
+ virtual PrepareResponse prepare(const PrepareRequest&);
+ virtual StartResponse start(const StartRequest&);
+ virtual CancelResponse cancel(const CancelRequest&);
+ virtual PauseResponse pause(const PauseRequest&);
+ virtual ResumeResponse resume(const ResumeRequest&);
+ virtual ExtensionNotification extension(const ExtensionNotification&);
+ virtual ClearContextRequest clearContext(const ClearContextRequest&);
+ virtual StatusResponse status(const StatusRequest&);
+
+ /** Interaction Manager */
+ virtual NewContextResponse newContext(const NewContextRequest&);
+ virtual DoneNotification done(const DoneNotification&);
+// virtual ExtensionNotification extension(const ExtensionNotification&);
+
+
+};
+
+#ifdef BUILD_AS_PLUGINS
+PLUMA_INHERIT_PROVIDER(MMIIOProcessor, IOProcessorImpl);
+#endif
+
+}
+
+
+#endif /* end of include guard: MMIIOPROCESSOR_H_W09J90F0 */
diff --git a/src/uscxml/plugins/ioprocessor/modality/MMIMessages.cpp b/src/uscxml/plugins/ioprocessor/modality/MMIMessages.cpp
new file mode 100644
index 0000000..ed92fac
--- /dev/null
+++ b/src/uscxml/plugins/ioprocessor/modality/MMIMessages.cpp
@@ -0,0 +1,338 @@
+#include "MMIMessages.h"
+
+#include <DOM/Simple/DOMImplementation.hpp>
+#include <DOM/io/Stream.hpp>
+#include <DOM/SAX2DOM/SAX2DOM.hpp>
+#include <SAX/helpers/InputSourceResolver.hpp>
+
+#include <boost/algorithm/string.hpp>
+
+namespace uscxml {
+
+using namespace Arabica::DOM;
+
+std::string MMIMessage::nameSpace = "http://www.w3.org/2008/04/mmi-arch";
+
+Arabica::DOM::Document<std::string> MMIMessage::toXML() {
+ Arabica::DOM::DOMImplementation<std::string> domFactory = Arabica::SimpleDOM::DOMImplementation<std::string>::getDOMImplementation();
+ Document<std::string> doc = domFactory.createDocument(nameSpace, "", 0);
+ Element<std::string> mmiElem = doc.createElementNS(nameSpace, "mmi");
+ Element<std::string> msgElem = doc.createElementNS(nameSpace, tagName);
+ msgElem.setAttributeNS(nameSpace, "Source", source);
+ msgElem.setAttributeNS(nameSpace, "Target", target);
+ msgElem.setAttributeNS(nameSpace, "RequestID", requestId);
+
+ if (data.size() > 0) {
+ Element<std::string> dataElem = doc.createElementNS(nameSpace, "data");
+
+ // try to parse content
+ std::stringstream* ss = new std::stringstream();
+ (*ss) << data;
+ std::auto_ptr<std::istream> ssPtr(ss);
+ Arabica::SAX::InputSource<std::string> inputSource;
+ inputSource.setByteStream(ssPtr);
+
+ Arabica::SAX2DOM::Parser<std::string> parser;
+ if(parser.parse(inputSource)) {
+ Node<std::string> importedNode = doc.importNode(parser.getDocument().getDocumentElement(), true);
+ dataElem.appendChild(importedNode);
+ } else {
+ Text<std::string> textElem = doc.createTextNode(data);
+ dataElem.appendChild(textElem);
+ }
+ msgElem.appendChild(dataElem);
+ }
+
+ mmiElem.appendChild(msgElem);
+ doc.appendChild(mmiElem);
+ std::cout << doc;
+ return doc;
+}
+
+Arabica::DOM::Document<std::string> ContextualizedRequest::toXML() {
+ Document<std::string> doc = MMIMessage::toXML();
+ Element<std::string> msgElem = Element<std::string>(doc.getDocumentElement().getFirstChild());
+ msgElem.setAttributeNS(nameSpace, "Context", context);
+ return doc;
+}
+
+Arabica::DOM::Document<std::string> ContentRequest::toXML() {
+ Document<std::string> doc = ContextualizedRequest::toXML();
+ Element<std::string> msgElem = Element<std::string>(doc.getDocumentElement().getFirstChild());
+
+ if (contentURL.href.size() > 0) {
+ Element<std::string> contentURLElem = doc.createElementNS(nameSpace, "contentURL");
+ contentURLElem.setAttributeNS(nameSpace, "href", contentURL.href);
+ contentURLElem.setAttributeNS(nameSpace, "fetchtimeout", contentURL.fetchTimeout);
+ contentURLElem.setAttributeNS(nameSpace, "max-age", contentURL.maxAge);
+ msgElem.appendChild(contentURLElem);
+ }
+
+ if (content.size() > 0) {
+ Element<std::string> contentElem = doc.createElementNS(nameSpace, "content");
+
+ // try to parse content
+ std::stringstream* ss = new std::stringstream();
+ (*ss) << content;
+ std::auto_ptr<std::istream> ssPtr(ss);
+ Arabica::SAX::InputSource<std::string> inputSource;
+ inputSource.setByteStream(ssPtr);
+
+ Arabica::SAX2DOM::Parser<std::string> parser;
+ if(parser.parse(inputSource)) {
+ Node<std::string> importedNode = doc.importNode(parser.getDocument().getDocumentElement(), true);
+ contentElem.appendChild(importedNode);
+ } else {
+ Text<std::string> textElem = doc.createTextNode(content);
+ contentElem.appendChild(textElem);
+ }
+ msgElem.appendChild(contentElem);
+
+ }
+ return doc;
+}
+
+Arabica::DOM::Document<std::string> ExtensionNotification::toXML() {
+ Document<std::string> doc = ContextualizedRequest::toXML();
+ Element<std::string> msgElem = Element<std::string>(doc.getDocumentElement().getFirstChild());
+ msgElem.setAttributeNS(nameSpace, "Name", name);
+ return doc;
+}
+
+Arabica::DOM::Document<std::string> StatusResponse::toXML() {
+ Document<std::string> doc = ContextualizedRequest::toXML();
+ Element<std::string> msgElem = Element<std::string>(doc.getDocumentElement().getFirstChild());
+ if (status == ALIVE) {
+ msgElem.setAttributeNS(nameSpace, "Status", "alive");
+ } else if(status == DEAD) {
+ msgElem.setAttributeNS(nameSpace, "Status", "dead");
+ } else if(status == FAILURE) {
+ msgElem.setAttributeNS(nameSpace, "Status", "failure");
+ } else if(status == SUCCESS) {
+ msgElem.setAttributeNS(nameSpace, "Status", "success");
+ }
+ return doc;
+}
+
+Arabica::DOM::Document<std::string> StatusInfoResponse::toXML() {
+ Document<std::string> doc = StatusResponse::toXML();
+ Element<std::string> msgElem = Element<std::string>(doc.getDocumentElement().getFirstChild());
+
+ Element<std::string> statusInfoElem = doc.createElementNS(nameSpace, "StatusInfo");
+ Text<std::string> statusInfoText = doc.createTextNode(statusInfo);
+ statusInfoElem.appendChild(statusInfoText);
+ msgElem.appendChild(statusInfoElem);
+
+ return doc;
+}
+
+Arabica::DOM::Document<std::string> StatusRequest::toXML() {
+ Document<std::string> doc = ContextualizedRequest::toXML();
+ Element<std::string> msgElem = Element<std::string>(doc.getDocumentElement().getFirstChild());
+
+ if (automaticUpdate) {
+ msgElem.setAttributeNS(nameSpace, "RequestAutomaticUpdate", "true");
+ } else {
+ msgElem.setAttributeNS(nameSpace, "RequestAutomaticUpdate", "false");
+ }
+
+ return doc;
+}
+
+MMIMessage MMIMessage::fromXML(const Arabica::DOM::Document<std::string>& doc) {
+ MMIMessage msg;
+ Node<std::string> node = doc.getDocumentElement().getFirstChild();
+ while (node) {
+ if (node.getNodeType() == Node_base::ELEMENT_NODE)
+ break;
+ node = node.getNextSibling();
+ }
+ Element<std::string> msgElem(node);
+ msg.source = msgElem.getAttributeNS("http://www.w3.org/2008/04/mmi-arch", "Source");
+ msg.target = msgElem.getAttributeNS("http://www.w3.org/2008/04/mmi-arch", "Target");
+// msg.data = msgElem.getAttributeNS("http://www.w3.org/2008/04/mmi-arch", "Data");
+ msg.requestId = msgElem.getAttributeNS("http://www.w3.org/2008/04/mmi-arch", "RequestID");
+ msg.tagName = msgElem.getLocalName();
+
+ Element<std::string> dataElem;
+ node = msgElem.getFirstChild();
+ while (node) {
+ if (node.getNodeType() == Node_base::ELEMENT_NODE)
+ dataElem = Element<std::string>(node);
+ if (dataElem && boost::iequals(dataElem.getLocalName(), "data"))
+ break;
+ node = node.getNextSibling();
+ }
+
+ if (dataElem && boost::iequals(dataElem.getLocalName(), "data")) {
+ std::stringstream ss;
+ node = dataElem.getFirstChild();
+ while (node) {
+ if (node.getNodeType() == Node_base::ELEMENT_NODE) {
+ ss << node;
+ break;
+ }
+ node = node.getNextSibling();
+ }
+ msg.data = ss.str();
+ }
+
+ return msg;
+}
+
+ContextualizedRequest ContextualizedRequest::fromXML(const Arabica::DOM::Document<std::string>& doc) {
+ ContextualizedRequest msg(NewContextRequest::fromXML(doc));
+ Node<std::string> node = doc.getDocumentElement().getFirstChild();
+ while (node) {
+ if (node.getNodeType() == Node_base::ELEMENT_NODE)
+ break;
+ node = node.getNextSibling();
+ }
+ Element<std::string> msgElem(node);
+ msg.context = msgElem.getAttributeNS("http://www.w3.org/2008/04/mmi-arch", "Context");
+ return msg;
+}
+
+ContentRequest ContentRequest::fromXML(const Arabica::DOM::Document<std::string>& doc) {
+ ContentRequest msg(ContextualizedRequest::fromXML(doc));
+ Node<std::string> node = doc.getDocumentElement().getFirstChild();
+ while (node) {
+ if (node.getNodeType() == Node_base::ELEMENT_NODE)
+ break;
+ node = node.getNextSibling();
+ }
+ Element<std::string> msgElem(node);
+ Element<std::string> contentElem;
+
+ node = msgElem.getFirstChild();
+ while (node) {
+ if (node.getNodeType() == Node_base::ELEMENT_NODE) {
+ contentElem = Element<std::string>(node);
+ if (boost::iequals(contentElem.getLocalName(), "content") ||
+ boost::iequals(contentElem.getLocalName(), "contentURL"))
+ break;
+ }
+ node = node.getNextSibling();
+ }
+
+ if (contentElem) {
+ if(boost::iequals(contentElem.getLocalName(), "content")) {
+ std::stringstream ss;
+ node = contentElem.getFirstChild();
+ while (node) {
+ if (node.getNodeType() == Node_base::ELEMENT_NODE) {
+ ss << node;
+ break;
+ }
+ node = node.getNextSibling();
+ }
+ msg.content = ss.str();
+ } else if(boost::iequals(contentElem.getLocalName(), "contentURL")) {
+ msg.contentURL.href = contentElem.getAttributeNS("http://www.w3.org/2008/04/mmi-arch", "href");
+ msg.contentURL.maxAge = contentElem.getAttributeNS("http://www.w3.org/2008/04/mmi-arch", "max-age");
+ msg.contentURL.fetchTimeout = contentElem.getAttributeNS("http://www.w3.org/2008/04/mmi-arch", "fetchtimeout");
+ }
+ }
+
+ //msg.content = msgElem.getAttributeNS("http://www.w3.org/2008/04/mmi-arch", "Context");
+ return msg;
+}
+
+ExtensionNotification ExtensionNotification::fromXML(const Arabica::DOM::Document<std::string>& doc) {
+ ExtensionNotification msg(ContextualizedRequest::fromXML(doc));
+ Node<std::string> node = doc.getDocumentElement().getFirstChild();
+ while (node) {
+ if (node.getNodeType() == Node_base::ELEMENT_NODE)
+ break;
+ node = node.getNextSibling();
+ }
+ Element<std::string> msgElem(node);
+ msg.name = msgElem.getAttributeNS("http://www.w3.org/2008/04/mmi-arch", "Name");
+ return msg;
+}
+
+StatusResponse StatusResponse::fromXML(const Arabica::DOM::Document<std::string>& doc) {
+ StatusResponse msg(ContextualizedRequest::fromXML(doc));
+ Node<std::string> node = doc.getDocumentElement().getFirstChild();
+ while (node) {
+ if (node.getNodeType() == Node_base::ELEMENT_NODE)
+ break;
+ node = node.getNextSibling();
+ }
+ Element<std::string> msgElem(node);
+ std::string status = msgElem.getAttributeNS("http://www.w3.org/2008/04/mmi-arch", "Status");
+
+ if (boost::iequals(status, "ALIVE")) {
+ msg.status = ALIVE;
+ } else if(boost::iequals(status, "DEAD")) {
+ msg.status = DEAD;
+ } else if(boost::iequals(status, "FAILURE")) {
+ msg.status = FAILURE;
+ } else if(boost::iequals(status, "SUCCESS")) {
+ msg.status = SUCCESS;
+ }
+ return msg;
+}
+
+StatusInfoResponse StatusInfoResponse::fromXML(const Arabica::DOM::Document<std::string>& doc) {
+ StatusInfoResponse msg(StatusResponse::fromXML(doc));
+ Node<std::string> node = doc.getDocumentElement().getFirstChild();
+ while (node) {
+ if (node.getNodeType() == Node_base::ELEMENT_NODE)
+ break;
+ node = node.getNextSibling();
+ }
+ Element<std::string> msgElem(node);
+ Element<std::string> statusInfoElem;
+
+ node = msgElem.getFirstChild();
+ while (node) {
+ if (node.getNodeType() == Node_base::ELEMENT_NODE) {
+ statusInfoElem = Element<std::string>(node);
+ if (statusInfoElem && boost::iequals(statusInfoElem.getLocalName(), "statusInfo"))
+ break;
+ }
+ node = node.getNextSibling();
+ }
+
+ if (statusInfoElem && boost::iequals(statusInfoElem.getLocalName(), "statusInfo")) {
+ node = statusInfoElem.getFirstChild();
+ while (node) {
+ if (node.getNodeType() == Node_base::TEXT_NODE) {
+ msg.statusInfo = node.getNodeValue();
+ break;
+ }
+ node = node.getNextSibling();
+ }
+ }
+
+ return msg;
+}
+
+
+StatusRequest StatusRequest::fromXML(const Arabica::DOM::Document<std::string>& doc) {
+ StatusRequest msg(ContextualizedRequest::fromXML(doc));
+ Node<std::string> node = doc.getDocumentElement().getFirstChild();
+ while (node) {
+ if (node.getNodeType() == Node_base::ELEMENT_NODE)
+ break;
+ node = node.getNextSibling();
+ }
+ Element<std::string> msgElem(node);
+ std::string autoUpdate = msgElem.getAttributeNS("http://www.w3.org/2008/04/mmi-arch", "RequestAutomaticUpdate");
+
+ if (boost::iequals(autoUpdate, "true")) {
+ msg.automaticUpdate = true;
+ } else if(boost::iequals(autoUpdate, "on")) {
+ msg.automaticUpdate = true;
+ } else if(boost::iequals(autoUpdate, "yes")) {
+ msg.automaticUpdate = true;
+ } else if(boost::iequals(autoUpdate, "1")) {
+ msg.automaticUpdate = true;
+ } else {
+ msg.automaticUpdate = false;
+ }
+ return msg;
+}
+
+} \ No newline at end of file
diff --git a/src/uscxml/plugins/ioprocessor/modality/MMIMessages.h b/src/uscxml/plugins/ioprocessor/modality/MMIMessages.h
new file mode 100644
index 0000000..af31efe
--- /dev/null
+++ b/src/uscxml/plugins/ioprocessor/modality/MMIMessages.h
@@ -0,0 +1,280 @@
+#ifndef MMIMESSAGES_H_OS0SE7H5
+#define MMIMESSAGES_H_OS0SE7H5
+
+#include <DOM/Node.hpp>
+#include <DOM/Document.hpp>
+
+namespace uscxml {
+
+class MMIMessage {
+public:
+ virtual Arabica::DOM::Document<std::string> toXML();
+ static MMIMessage fromXML(const Arabica::DOM::Document<std::string>& doc);
+
+ std::string source;
+ std::string target;
+ std::string data;
+ std::string requestId;
+ std::string tagName;
+
+ static std::string nameSpace;
+
+protected:
+ MMIMessage() {}
+};
+
+class NewContextRequest : public MMIMessage {
+public:
+ NewContextRequest() {
+ tagName = "NewContextRequest";
+ }
+ NewContextRequest(const MMIMessage& father) : MMIMessage(father) {}
+ static NewContextRequest fromXML(const Arabica::DOM::Document<std::string>& doc) {
+ return MMIMessage::fromXML(doc);
+ }
+
+};
+
+class ContextualizedRequest : public NewContextRequest {
+public:
+ virtual Arabica::DOM::Document<std::string> toXML();
+ static ContextualizedRequest fromXML(const Arabica::DOM::Document<std::string>& doc);
+
+ std::string context;
+protected:
+ ContextualizedRequest() {}
+ ContextualizedRequest(const NewContextRequest& father) : NewContextRequest(father) {}
+};
+
+class PauseRequest : public ContextualizedRequest {
+public:
+ PauseRequest() {
+ tagName = "PauseRequest";
+ }
+ PauseRequest(const ContextualizedRequest& father) : ContextualizedRequest(father) {}
+ static PauseRequest fromXML(const Arabica::DOM::Document<std::string>& doc) {
+ return ContextualizedRequest::fromXML(doc);
+ }
+};
+class ResumeRequest : public ContextualizedRequest {
+public:
+ ResumeRequest() {
+ tagName = "ResumeRequest";
+ }
+ ResumeRequest(const ContextualizedRequest& father) : ContextualizedRequest(father) {}
+ static ResumeRequest fromXML(const Arabica::DOM::Document<std::string>& doc) {
+ return ContextualizedRequest::fromXML(doc);
+ }
+
+};
+class CancelRequest : public ContextualizedRequest {
+public:
+ CancelRequest() {
+ tagName = "CancelRequest";
+ }
+ CancelRequest(const ContextualizedRequest& father) : ContextualizedRequest(father) {}
+ static CancelRequest fromXML(const Arabica::DOM::Document<std::string>& doc) {
+ return ContextualizedRequest::fromXML(doc);
+ }
+
+};
+class ClearContextRequest : public ContextualizedRequest {
+public:
+ ClearContextRequest() {
+ tagName = "ClearContextRequest";
+ }
+ ClearContextRequest(const ContextualizedRequest& father) : ContextualizedRequest(father) {}
+ static ClearContextRequest fromXML(const Arabica::DOM::Document<std::string>& doc) {
+ return ContextualizedRequest::fromXML(doc);
+ }
+
+};
+class StatusRequest : public ContextualizedRequest {
+public:
+ StatusRequest() {
+ tagName = "StatusRequest";
+ }
+ virtual Arabica::DOM::Document<std::string> toXML();
+ static StatusRequest fromXML(const Arabica::DOM::Document<std::string>& doc);
+
+ bool automaticUpdate;
+protected:
+ StatusRequest(const ContextualizedRequest& father) : ContextualizedRequest(father) {}
+};
+
+class ContentRequest : public ContextualizedRequest {
+public:
+ struct ContentURL {
+ std::string href;
+ std::string maxAge;
+ std::string fetchTimeout;
+ };
+
+ virtual Arabica::DOM::Document<std::string> toXML();
+ static ContentRequest fromXML(const Arabica::DOM::Document<std::string>& doc);
+ std::string content;
+ ContentURL contentURL;
+protected:
+ ContentRequest() {}
+ ContentRequest(const ContextualizedRequest& father) : ContextualizedRequest(father) {}
+};
+
+class PrepareRequest : public ContentRequest {
+public:
+ PrepareRequest() {
+ tagName = "PrepareRequest";
+ }
+ PrepareRequest(const ContentRequest& father) : ContentRequest(father) {}
+ static PrepareRequest fromXML(const Arabica::DOM::Document<std::string>& doc) {
+ return ContentRequest::fromXML(doc);
+ }
+};
+
+class StartRequest : public ContentRequest {
+public:
+ StartRequest() {
+ tagName = "StartRequest";
+ }
+ StartRequest(const ContentRequest& father) : ContentRequest(father) {}
+ static StartRequest fromXML(const Arabica::DOM::Document<std::string>& doc) {
+ return ContentRequest::fromXML(doc);
+ }
+
+};
+
+class ExtensionNotification : public ContextualizedRequest {
+public:
+ ExtensionNotification() {
+ tagName = "ExtensionNotification";
+ }
+ virtual Arabica::DOM::Document<std::string> toXML();
+ static ExtensionNotification fromXML(const Arabica::DOM::Document<std::string>& doc);
+
+ std::string name;
+protected:
+ ExtensionNotification(const ContextualizedRequest& father) : ContextualizedRequest(father) {}
+
+};
+
+class StatusResponse : public ContextualizedRequest {
+public:
+ enum Status {
+ ALIVE = 0,
+ DEAD = 1,
+ SUCCESS = 2,
+ FAILURE = 3
+ };
+
+ StatusResponse() {
+ tagName = "StatusResponse";
+ }
+ virtual Arabica::DOM::Document<std::string> toXML();
+ static StatusResponse fromXML(const Arabica::DOM::Document<std::string>& doc);
+ Status status;
+protected:
+ StatusResponse(const ContextualizedRequest& father) : ContextualizedRequest(father) {}
+
+};
+
+class StatusInfoResponse : public StatusResponse {
+public:
+ virtual Arabica::DOM::Document<std::string> toXML();
+ static StatusInfoResponse fromXML(const Arabica::DOM::Document<std::string>& doc);
+ std::string statusInfo;
+protected:
+ StatusInfoResponse() {}
+ StatusInfoResponse(const StatusResponse& father) : StatusResponse(father) {}
+};
+
+class PrepareResponse : public StatusInfoResponse {
+public:
+ PrepareResponse() {
+ tagName = "PrepareResponse";
+ }
+ PrepareResponse(const StatusInfoResponse& father) : StatusInfoResponse(father) {}
+ static PrepareResponse fromXML(const Arabica::DOM::Document<std::string>& doc) {
+ return StatusInfoResponse::fromXML(doc);
+ }
+};
+
+class StartResponse : public StatusInfoResponse {
+public:
+ StartResponse() {
+ tagName = "StartResponse";
+ }
+ StartResponse(const StatusInfoResponse& father) : StatusInfoResponse(father) {}
+ static StartResponse fromXML(const Arabica::DOM::Document<std::string>& doc) {
+ return StatusInfoResponse::fromXML(doc);
+ }
+};
+
+class CancelResponse : public StatusInfoResponse {
+public:
+ CancelResponse() {
+ tagName = "CancelResponse";
+ }
+ CancelResponse(const StatusInfoResponse& father) : StatusInfoResponse(father) {}
+ static CancelResponse fromXML(const Arabica::DOM::Document<std::string>& doc) {
+ return StatusInfoResponse::fromXML(doc);
+ }
+};
+
+class PauseResponse : public StatusInfoResponse {
+public:
+ PauseResponse() {
+ tagName = "PauseResponse";
+ }
+ PauseResponse(const StatusInfoResponse& father) : StatusInfoResponse(father) {}
+ static PauseResponse fromXML(const Arabica::DOM::Document<std::string>& doc) {
+ return StatusInfoResponse::fromXML(doc);
+ }
+};
+
+class ResumeResponse : public StatusInfoResponse {
+public:
+ ResumeResponse() {
+ tagName = "ResumeResponse";
+ }
+ ResumeResponse(const StatusInfoResponse& father) : StatusInfoResponse(father) {}
+ static ResumeResponse fromXML(const Arabica::DOM::Document<std::string>& doc) {
+ return StatusInfoResponse::fromXML(doc);
+ }
+};
+
+class ClearContextResponse : public StatusInfoResponse {
+public:
+ ClearContextResponse() {
+ tagName = "ClearContextResponse";
+ }
+ ClearContextResponse(const StatusInfoResponse& father) : StatusInfoResponse(father) {}
+ static ClearContextResponse fromXML(const Arabica::DOM::Document<std::string>& doc) {
+ return StatusInfoResponse::fromXML(doc);
+ }
+};
+
+class NewContextResponse : public StatusInfoResponse {
+public:
+ NewContextResponse() {
+ tagName = "NewContextResponse";
+ }
+ NewContextResponse(const StatusInfoResponse& father) : StatusInfoResponse(father) {}
+ static NewContextResponse fromXML(const Arabica::DOM::Document<std::string>& doc) {
+ return StatusInfoResponse::fromXML(doc);
+ }
+
+};
+
+class DoneNotification : public StatusInfoResponse {
+public:
+ DoneNotification() {
+ tagName = "DoneNotification";
+ }
+ DoneNotification(const StatusInfoResponse& father) : StatusInfoResponse(father) {}
+ static DoneNotification fromXML(const Arabica::DOM::Document<std::string>& doc) {
+ return StatusInfoResponse::fromXML(doc);
+ }
+};
+
+}
+
+#endif /* end of include guard: MMIMESSAGES_H_OS0SE7H5 */