hemeraqmlsandbox.h
1 #ifndef HEMERA_QML_SETTINGS_HEMERAQMLSANDBOX_H
2 #define HEMERA_QML_SETTINGS_HEMERAQMLSANDBOX_H
3 
4 #include <QtCore/QObject>
5 #include <QtCore/QFlags>
6 #include <QtCore/QStringList>
7 
8 #include <QtQml/QQmlListProperty>
9 
10 #include "hemeraqmllanguagesupport.h"
11 
12 namespace Hemera {
13 
14 namespace Qml {
15 
16 namespace Settings {
17 
18 class Device;
19 
26 class OrbitFeatures : public QObject
27 {
28  Q_OBJECT
29  Q_DISABLE_COPY(OrbitFeatures)
30 
31 public:
39  enum Feature {
46  Audio = 1 << 0,
51  Video = 1 << 1,
55  SerialPorts = 1 << 2,
59  Console = 1 << 3,
63  Printers = 1 << 4,
67  Disks = 1 << 5,
72  Hyperspace = 1 << 6,
77  Network = 1 << 7,
78 
79  // Software management
83  CheckForUpdates = 1 << 10,
87  DownloadUpdates = 1 << 11,
91  UpdateApplications = 1 << 12,
99  RemoveApplications = 1 << 14,
108  UpdateSystem = 1 << 16,
112  Planet = 1 << 17,
113 
114 
116 
119  SoftwareKeyboard = 1 << 20,
120  DoNotRestartOnUpdate = 1 << 21,
122  LegacyDevices = 1 << 31
123  };
124  Q_DECLARE_FLAGS(Features, Feature)
125  Q_FLAGS(Features)
126  Q_ENUMS(Feature)
127 };
128 
159 class Sandbox : public QObject
160 {
161  Q_OBJECT
162  Q_DISABLE_COPY(Sandbox)
163 
164 
165  Q_PROPERTY(QString name MEMBER m_name)
173  Q_PROPERTY(bool keepAlive MEMBER m_keepAlive)
178  Q_PROPERTY(Hemera::Qml::Settings::OrbitFeatures::Features features MEMBER m_features)
182  Q_PROPERTY(QString environment MEMBER m_environment)
189  Q_PROPERTY(QQmlListProperty<Hemera::Qml::Settings::Device> devices READ devices)
190  Q_PROPERTY(QQmlListProperty<Hemera::Qml::Settings::LanguageSupport> languageSupport READ languageSupport)
194  Q_PROPERTY(bool allowUpdates MEMBER m_allowUpdates)
203  Q_PROPERTY(bool runAsRoot MEMBER m_runAsRoot)
204  Q_PROPERTY(bool IUnderstandItIsASecurityRisk MEMBER m_IUnderstandItIsASecurityRisk)
205 
206  Q_CLASSINFO("DefaultProperty", "languageSupport")
207 
208 public:
209  explicit Sandbox(QObject *parent = 0);
210  virtual ~Sandbox();
211 
212  QQmlListProperty<Hemera::Qml::Settings::Device> devices();
213  QQmlListProperty<Hemera::Qml::Settings::LanguageSupport> languageSupport();
214 
215 private:
216  bool m_keepAlive;
217  OrbitFeatures::Features m_features;
218  QString m_environment;
219  QString m_name;
220  QList< Device* > m_devices;
221  QList< LanguageSupport* > m_languageSupport;
222  bool m_allowUpdates;
223  bool m_runAsRoot;
224  bool m_IUnderstandItIsASecurityRisk;
225 
226  friend class Gravity;
227 };
228 
229 }
230 
231 }
232 
233 }
234 
235 Q_DECLARE_OPERATORS_FOR_FLAGS(Hemera::Qml::Settings::OrbitFeatures::Features)
236 
237 #endif // HEMERA_QML_SETTINGS_HEMERAQMLSANDBOX_H
Definition: hemeraqmlsandbox.h:77
Definition: hemeraqmlsandbox.h:108
Definition: hemeraqmlappliance.cpp:3
No features allowed.
Definition: hemeraqmlsandbox.h:41
Container for Features enum.
Definition: hemeraqmlsandbox.h:26
Definition: hyperspacecapabilitywatcher.cpp:11
Definition: hemeraqmlsandbox.h:51
Definition: hemeraqmlsandbox.h:46
Definition: hemeraqmlsandbox.h:63
Definition: hemeraqmlsandbox.h:55
Registers the current application as a Planet, allowing satellites management.
Definition: hemeraplanet.h:58
Definition: hemeraqmlsandbox.h:59
Sandbox is the base object for any entity in Hemera which is meant to be run as a slave to Gravity...
Definition: hemeraqmlsandbox.h:159
This enables groups such as cdrom, floppy and tape.
Definition: hemeraqmlsandbox.h:122
Feature
Defines the available Features for a Sandbox.
Definition: hemeraqmlsandbox.h:39
Other features.
Definition: hemeraqmlsandbox.h:119
Definition: hemeraqmlsandbox.h:67