QtService  1.1.0
A platform independent library to easily create system services and use some of their features
qmlservicesingleton.h
1 #ifndef QMLSERVICESINGLETON_H
2 #define QMLSERVICESINGLETON_H
3 
4 #include <QObject>
5 #include <QtService/Service>
6 #include <QtService/ServiceControl>
7 
8 #ifdef DOXYGEN_RUN
10 
18 class QtService
19 #else
20 namespace QtService {
21 
22 class QmlServiceSingleton : public QObject
23 #endif
24 {
25  Q_OBJECT
26 
42  Q_PROPERTY(QtService::Service* service READ service CONSTANT)
43 
44 public:
46  explicit QmlServiceSingleton(QObject *parent = nullptr);
47 
49  Q_INVOKABLE QtService::ServiceControl *createControl(const QString &backend, QString serviceId, QObject *parent = nullptr) const;
51  Q_INVOKABLE QtService::ServiceControl *createControlFromName(const QString &backend, const QString &serviceName, QObject *parent = nullptr) const;
53  Q_INVOKABLE QtService::ServiceControl *createControlFromName(const QString &backend, const QString &serviceName, const QString &domain, QObject *parent = nullptr) const;
54 
56  QtService::Service* service() const;
57 };
58 
59 }
60 
61 #endif // QMLSERVICESINGLETON_H
Q_INVOKABLE QtService::ServiceControl * createControlFromName(const QString &backend, const QString &serviceName, QObject *parent=nullptr) const
Creates a new ServiceControl by guessing the service id from the given name and this applications dom...
The QML import for the QtService QML module.
Q_INVOKABLE QtService::ServiceControl * createControl(const QString &backend, QString serviceId, QObject *parent=nullptr) const
Creates a new ServiceControl for the given service on the service manager defined by backend...
The main interface to implement to create a service.
Definition: service.h:37
The primary namespace of the QtService library.
A class to interact with the systems service manager.