Plasma5Support

serviceoperationstatus.h
1/*
2 SPDX-FileCopyrightText: 2013 Marco Martin <mart@kde.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6#ifndef SERVICEOPERATIONSTATUS_P
7#define SERVICEOPERATIONSTATUS_P
8
9#include <QObject>
10#include <QPointer>
11#include <QQmlEngine>
12
13#include "plasma5support/service.h"
14
15namespace Plasma5Support
16{
17class Service;
18}
19
20/**
21 * @class ServiceOperationStatus
22 * @short Monitors services
23 */
25{
27 QML_ELEMENT
28
29 /**
30 * The service instance we want to monitor
31 */
32 Q_PROPERTY(Plasma5Support::Service *service READ service WRITE setService NOTIFY serviceChanged)
33
34 /**
35 * the service operation we want to monitor for enabled or disabled status
36 */
37 Q_PROPERTY(QString operation READ operation WRITE setOperation NOTIFY operationChanged)
38
39 /**
40 * true if the service operation is enabled
41 */
42 Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged)
43
44public:
45 explicit ServiceOperationStatus(QObject *parent = nullptr);
46 ~ServiceOperationStatus() override;
47
48 void setService(Plasma5Support::Service *service);
49 Plasma5Support::Service *service() const;
50
51 void setOperation(const QString &operation);
52 QString operation() const;
53
54 void setEnabled(bool enabled);
55 bool isEnabled() const;
56
58 void serviceChanged();
59 void operationChanged();
60 void enabledChanged();
61
62private Q_SLOTS:
63 void updateStatus();
64
65private:
66 QPointer<Plasma5Support::Service> m_service;
67 QString m_operation;
68 bool m_enabled;
69};
70
71#endif
This class provides a generic API for write access to settings or services.
Definition service.h:78
bool enabled
true if the service operation is enabled
QML_ELEMENTPlasma5Support::Service * service
The service instance we want to monitor.
QString operation
the service operation we want to monitor for enabled or disabled status
Namespace for everything in libplasma.
Definition datamodel.cpp:15
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
Q_SIGNALSQ_SIGNALS
Q_SLOTSQ_SLOTS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:08:57 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.