pm-inhibit/inhibitor.h

38 lines
1.1 KiB
C++

/*
* pm-inhibit - Power Management Inhibition Tool
* Copyright (C) 2022 Damien Goutte-Gattat
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ICP20221113_INHIBITOR_H
#define ICP20221113_INHIBITOR_H
#include <QDBusUnixFileDescriptor>
class Inhibitor
{
public:
Inhibitor(const QString& program, const QString& reason);
~Inhibitor();
bool isInhibited();
private:
QDBusUnixFileDescriptor *m_cookie;
unsigned m_fallbackCookie;
};
#endif /* !ICP20221113_INHIBITOR_H */