#ifndef VMCHOOSER_VSESSION_H_ #define VMCHOOSER_VSESSION_H_ #include #include #include #include #include #include "session.h" #include "httpxmldownloader.h" enum ImgType { VMWARE, VBOX, OTHER }; class VSession : public Session { public: bool init(const QString& xml, const QString& baseDirPath); ImgType imgtype() const; bool isActive() const; bool isLocked() const; bool isValid() const; int priority() const; QString shortDescription() const { return getAttribute("short_description"); } QString description() const { return getAttribute("description"); } QString icon() const; QString os() const { return getAttribute("os"); } QString getAttribute(const QString& nodeName, const QString& attribute = "param") const; QList keywords() const; bool containsKeywords(const QList& keywords) const; QString getNodeText(const QString& nodeName) const; void addNodeWithAttribute(const QString& nodeName, const QString& value, const QString& attribute = "param", bool replace = true); void addUserAndHostname(); void mergePoolXml(); QString toXml() const; bool run() const; int type() const; bool operator<(const Session& other) const; static QList readXmlDir(const QString& path); static QList readXmlFile(const QString& filepath); static void addSessionsAfterDownload(QNetworkReply* reply); private: QList keywords_; QDomDocument doc_; QString baseDirPath_; QProcess *_process; void readKeywords(); }; #endif /*VMCHOOSER_VSESSION_H_*/