ScreenLockDetector/src/powermonitor.h

40 lines
769 B
C
Raw Normal View History

#pragma once
#include <QObject>
#include <QDBusInterface>
#include <QDBusConnection>
#include <QDebug>
class PowerMonitor : public QObject
{
Q_OBJECT
public:
explicit PowerMonitor(QObject *parent = nullptr) : QObject(parent) { initLogin1Dbus(); }
signals:
/*
* @brief
*/
void aboutToWakeUp();
/*
* @brief
*/
void aboutToSleep();
private slots:
/*
* @brief /
* @param enteringSleep
*/
void onPrepareForSleep(bool enteringSleep);
private:
/*
* @brief Login1 DBus接口
*/
void initLogin1Dbus();
QDBusInterface *m_login1Interface = nullptr;
};