| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
#ifndef SERVICEREGISTRY_H |
| 19 |
#define SERVICEREGISTRY_H |
| 20 |
|
| 21 |
#include <QLoggingCategory> |
| 22 |
#include <QObject> |
| 23 |
#include <QProcess> |
| 24 |
#include "PluginInfo.h" |
| 25 |
|
| 26 |
Q_DECLARE_LOGGING_CATEGORY(PLUGIN_SERVICE) |
| 27 |
|
| 28 |
class ServiceRegistry : public QObject |
| 29 |
{ |
| 30 |
Q_OBJECT |
| 31 |
public: |
| 32 |
explicit ServiceRegistry(QObject *parent = 0); |
| 33 |
~ServiceRegistry(); |
| 34 |
|
| 35 |
|
| 36 |
void setServiceKey(const QString &key); |
| 37 |
void startServices(); |
| 38 |
void killServices(); |
| 39 |
void clear(); |
| 40 |
|
| 41 |
Q_INVOKABLE void sendMessage(const QString &pluginId, const QString &key, const QVariant &value); |
| 42 |
|
| 43 |
signals: |
| 44 |
void serviceKeyChanged(); |
| 45 |
|
| 46 |
private slots: |
| 47 |
void loadServices(); |
| 48 |
|
| 49 |
private: |
| 50 |
QList<ServicePlugin *> m_services; |
| 51 |
QString m_key; |
| 52 |
}; |
| 53 |
|
| 54 |
#endif |