File indexing completed on 2024-04-28 04:00:49

0001 /*
0002     SPDX-FileCopyrightText: 2014 Alejandro Fiestas Olivares <afiestas@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006 
0007 #include "inhibition.h"
0008 #include "backends/abstractinhibition.h"
0009 
0010 using namespace Solid;
0011 
0012 class Solid::InhibitionPrivate
0013 {
0014 public:
0015     AbstractInhibition *backendObject;
0016 };
0017 
0018 Inhibition::Inhibition(AbstractInhibition *backend, QObject *parent)
0019     : QObject(parent)
0020     , d_ptr(new InhibitionPrivate)
0021 {
0022     d_ptr->backendObject = backend;
0023     connect(d_ptr->backendObject, &AbstractInhibition::stateChanged, this, &Inhibition::stateChanged);
0024 }
0025 
0026 Inhibition::~Inhibition()
0027 {
0028     delete d_ptr->backendObject;
0029     delete d_ptr;
0030 }
0031 
0032 void Inhibition::start()
0033 {
0034     d_ptr->backendObject->start();
0035 }
0036 
0037 void Inhibition::stop()
0038 {
0039     d_ptr->backendObject->stop();
0040 }
0041 
0042 Inhibition::State Inhibition::state() const
0043 {
0044     return d_ptr->backendObject->state();
0045 }
0046 
0047 #include "moc_inhibition.cpp"