Solid

abstractinhibition.h
1/*
2 SPDX-FileCopyrightText: 2014 Alejandro Fiestas Olivares <afiestas@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5*/
6
7#ifndef ABSTRACT_INHIBITION_H
8#define ABSTRACT_INHIBITION_H
9
10#include <QObject>
11
12#include <solid/power/inhibition.h>
13
14namespace Solid
15{
16/**
17 * Represents an inhibition, allows to stop and start it
18 *
19 * When implementing this class take into account that the
20 * inhibition should be stopped upon object deletion, so
21 * stateChanged should be emitted on it
22 */
24{
26public:
27 explicit AbstractInhibition(QObject *parent = nullptr)
29 {
30 }
31 virtual ~AbstractInhibition()
32 {
33 }
34
35 virtual void start() = 0;
36 virtual void stop() = 0;
37 virtual Inhibition::State state() const = 0;
38
40 void stateChanged(Inhibition::State state);
41};
42} // Solid nanmespace
43#endif // ABSTRACT_INHIBITION_H
Represents an inhibition, allows to stop and start it.
The single responsibility of this class is to create arguments valid for logind Inhibit call.
Definition fakebattery.h:16
QObject(QObject *parent)
Q_OBJECTQ_OBJECT
Q_SIGNALSQ_SIGNALS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:17:12 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.