/
sandbox_p.h
51 lines (39 loc) · 1010 Bytes
/
sandbox_p.h
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
/**
* @file sandbox_p.h
* @copyright 2013 Jolla Ltd.
* @author Martin Kampas <martin.kampas@tieto.com>
* @date 2013
*/
#ifndef _SANDBOX_P_H
#define _SANDBOX_P_H
#include <QtCore/QDir>
#include <QtCore/QString>
class Sandbox {
class FileEngineHandler;
public:
enum Usage {
UseDirectly,
UseAsSkeleton,
};
enum Scope {
ThisProcess = 0x01,
ChildProcesses = 0x02,
};
Q_DECLARE_FLAGS(Scopes, Scope)
public:
Sandbox();
Sandbox(const QString &sandboxPath, Usage usage, Scopes scopes);
~Sandbox();
bool isActive() const;
void addWorldFiles(const QString &directory, QDir::Filters filters = QDir::NoFilter,
const QStringList &filterNames = QStringList());
private:
bool copyFile(QAbstractFileEngine *src, QAbstractFileEngine *dst);
private:
static Sandbox *s_instance;
QString m_sandboxPath;
QString m_tempDir;
FileEngineHandler *m_handler;
};
Q_DECLARE_OPERATORS_FOR_FLAGS(Sandbox::Scopes)
#endif