2020-08-02 22:22:19 +00:00
|
|
|
/*
|
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
2016-08-15 06:16:33 +00:00
|
|
|
|
2020-08-02 22:22:19 +00:00
|
|
|
SPDX-FileCopyrightText: 2013 Martin Gräßlin <mgraesslin@kde.org>
|
2016-08-15 06:16:33 +00:00
|
|
|
|
2020-08-02 22:22:19 +00:00
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
2022-12-16 20:08:44 +00:00
|
|
|
#pragma once
|
2016-08-15 06:16:33 +00:00
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
|
2023-03-23 11:39:20 +00:00
|
|
|
#include "libkwineffects/kwinglobals.h"
|
2016-08-15 06:37:24 +00:00
|
|
|
|
2016-08-15 06:16:33 +00:00
|
|
|
class OrgFreedesktopScreenSaverInterface;
|
2019-06-23 15:59:44 +00:00
|
|
|
class OrgKdeScreensaverInterface;
|
2016-08-15 06:16:33 +00:00
|
|
|
class QDBusServiceWatcher;
|
|
|
|
class QDBusPendingCallWatcher;
|
|
|
|
|
|
|
|
namespace KWin
|
|
|
|
{
|
|
|
|
|
2016-08-16 08:23:37 +00:00
|
|
|
class KWIN_EXPORT ScreenLockerWatcher : public QObject
|
2016-08-15 06:16:33 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2022-07-31 12:40:08 +00:00
|
|
|
explicit ScreenLockerWatcher();
|
|
|
|
|
|
|
|
bool isLocked() const;
|
2016-08-15 06:16:33 +00:00
|
|
|
Q_SIGNALS:
|
|
|
|
void locked(bool locked);
|
2019-06-23 15:59:44 +00:00
|
|
|
void aboutToLock();
|
2016-08-15 06:16:33 +00:00
|
|
|
private Q_SLOTS:
|
|
|
|
void setLocked(bool activated);
|
|
|
|
void activeQueried(QDBusPendingCallWatcher *watcher);
|
|
|
|
void serviceOwnerChanged(const QString &serviceName, const QString &oldOwner, const QString &newOwner);
|
2022-03-23 10:13:38 +00:00
|
|
|
|
2016-08-15 06:16:33 +00:00
|
|
|
private:
|
2016-08-16 07:26:17 +00:00
|
|
|
void initialize();
|
2022-03-17 14:05:01 +00:00
|
|
|
void queryActive();
|
2019-06-23 15:59:44 +00:00
|
|
|
OrgFreedesktopScreenSaverInterface *m_interface = nullptr;
|
|
|
|
OrgKdeScreensaverInterface *m_kdeInterface = nullptr;
|
2016-08-15 06:16:33 +00:00
|
|
|
QDBusServiceWatcher *m_serviceWatcher;
|
|
|
|
bool m_locked;
|
|
|
|
};
|
|
|
|
}
|