| 1 |
#ifndef DEKKODSERVICEPLUGIN_H |
| 2 |
#define DEKKODSERVICEPLUGIN_H |
| 3 |
|
| 4 |
#include <QObject> |
| 5 |
#include <PluginInfo.h> |
| 6 |
#include <PluginLoader.h> |
| 7 |
#include <QScopedPointer> |
| 8 |
|
| 9 |
class DekkodService : public ServicePlugin |
| 10 |
{ |
| 11 |
Q_OBJECT |
| 12 |
public: |
| 13 |
explicit DekkodService(QObject *parent = 0); |
| 14 |
|
| 15 |
|
| 16 |
public: |
| 17 |
virtual QString pluginId() const override; |
| 18 |
virtual QString location() const override; |
| 19 |
virtual QString i18n() const override; |
| 20 |
virtual QVariantMap documentation() const override; |
| 21 |
|
| 22 |
|
| 23 |
public: |
| 24 |
virtual void start(); |
| 25 |
virtual void stop(); |
| 26 |
|
| 27 |
protected: |
| 28 |
bool serviceFileInstalled() const; |
| 29 |
bool installServiceFile() const; |
| 30 |
bool removeServiceFile() const; |
| 31 |
bool serviceRunning() const; |
| 32 |
bool startService(); |
| 33 |
bool restartService(); |
| 34 |
bool stopService(); |
| 35 |
bool newVersion(); |
| 36 |
|
| 37 |
private: |
| 38 |
QString m_service; |
| 39 |
QString m_serviceFile; |
| 40 |
}; |
| 41 |
|
| 42 |
class DekkodServicePlugin : public QObject, public PluginInterface |
| 43 |
{ |
| 44 |
Q_OBJECT |
| 45 |
Q_INTERFACES(PluginInterface) |
| 46 |
Q_PLUGIN_METADATA(IID "org.dekkoproject.dekkod") |
| 47 |
|
| 48 |
|
| 49 |
public: |
| 50 |
virtual QString name() const; |
| 51 |
virtual QString description() const; |
| 52 |
virtual PluginInfo *create(QObject *parent) const; |
| 53 |
}; |
| 54 |
|
| 55 |
#endif |