shift-shell/components/dpmsplugin/dpmsutil.h
Devin Lin 90e65ea031 lockscreen: Reset state when screen is off
Wipe a partially entered password, and the open state of the lockscreen when the screen is off.
Addresses https://invent.kde.org/plasma/plasma-mobile/-/issues/110
2024-07-03 18:06:24 +00:00

37 lines
728 B
C++

// SPDX-FileCopyrightText: 2024 Devin Lin <devin@kde.org>
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <QObject>
#include <QPointer>
#include <QQuickItem>
#include <QQuickWindow>
#include <QTimer>
#include <qqmlregistration.h>
#include <KScreenDpms/Dpms>
/**
* Utility class that provides useful functions related to dpms.
*
* @author Devin Lin <devin@kde.org>
**/
class DPMSUtil : public QObject
{
Q_OBJECT
QML_ELEMENT
public:
DPMSUtil(QObject *parent = nullptr);
Q_INVOKABLE void turnDpmsOn();
Q_INVOKABLE void turnDpmsOff();
Q_SIGNALS:
void dpmsTurnedOn(QScreen *screen);
void dpmsTurnedOff(QScreen *screen);
private:
QScopedPointer<KScreen::Dpms> m_dpms;
};