blob: f9ab076f67bfbff3ce496223cc6ac14622282709 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
#ifndef VMCHOOSER_VSESSION_H_
#define VMCHOOSER_VSESSION_H_
#include <QString>
#include <QList>
#include <QDomDocument>
#include <QDir>
#include "session.h"
// TODO: check #includes (in all files)
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;
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;
QString getNodeText(const QString& nodeName) const;
// TODO: remove next line
void addNode(const QString& nodeName);
void addNodeWithAttribute(const QString& nodeName,
const QString& value,
const QString& attribute = "param",
bool replace = true);
// TODO: remove next line
void addTODO(const QString& value, const QString& nodeName,
const QString& attribute = "param");
// TODO: remove next line
void addNodeText(const QString& text, const QString& nodeName);
void addPrinters(const QString& script, const QString& type = "printer");
void addScanners(const QString& script);
void addUserAndHostname();
QString toXml() const;
bool run() const;
bool operator<(const Session& other) const;
static QList<Session*> readXmlDir(const QString& path);
static QList<Session*> readXmlFile(const QString& filepath);
private:
QDomDocument doc_;
QString baseDirPath_;
};
#endif /*VMCHOOSER_VSESSION_H_*/
|