From 29aaea2d80a9eb1715b6cddfac2d2aacf76358bd Mon Sep 17 00:00:00 2001 From: Andrew Branson Date: Thu, 11 Feb 2016 23:55:16 +0100 Subject: launchpad ~mzanetti/rockwork/trunk r87 --- rockwork/servicecontrol.h | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 rockwork/servicecontrol.h (limited to 'rockwork/servicecontrol.h') 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 + +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 -- cgit v1.2.3