summaryrefslogtreecommitdiff
path: root/rockwork/servicecontrol.h
diff options
context:
space:
mode:
Diffstat (limited to 'rockwork/servicecontrol.h')
-rw-r--r--rockwork/servicecontrol.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/rockwork/servicecontrol.h b/rockwork/servicecontrol.h
new file mode 100644
index 0000000..4689506
--- /dev/null
+++ b/rockwork/servicecontrol.h
@@ -0,0 +1,38 @@
+#ifndef SERVICECONTROL_H
+#define SERVICECONTROL_H
+
+#include <QObject>
+
+class ServiceControl : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QString serviceName READ serviceName WRITE setServiceName NOTIFY serviceNameChanged)
+ Q_PROPERTY(bool serviceFileInstalled READ serviceFileInstalled NOTIFY serviceFileInstalledChanged)
+ Q_PROPERTY(bool serviceRunning READ serviceRunning WRITE setServiceRunning NOTIFY serviceRunningChanged)
+
+public:
+ explicit ServiceControl(QObject *parent = 0);
+
+ QString serviceName() const;
+ void setServiceName(const QString &serviceName);
+
+ bool serviceFileInstalled() const;
+ Q_INVOKABLE bool installServiceFile();
+ Q_INVOKABLE bool removeServiceFile();
+
+ bool serviceRunning() const;
+ bool setServiceRunning(bool running);
+ Q_INVOKABLE bool startService();
+ Q_INVOKABLE bool stopService();
+ Q_INVOKABLE bool restartService();
+
+signals:
+ void serviceNameChanged();
+ void serviceFileInstalledChanged();
+ void serviceRunningChanged();
+
+private:
+ QString m_serviceName;
+};
+
+#endif // SERVICECONTROL_H