KWin
Loading...
Searching...
No Matches
screenlockerwatcher.h
Go to the documentation of this file.
1/*
2 KWin - the KDE window manager
3 This file is part of the KDE project.
4
5 SPDX-FileCopyrightText: 2013 Martin Gräßlin <mgraesslin@kde.org>
6
7 SPDX-License-Identifier: GPL-2.0-or-later
8*/
9#pragma once
10
11#include <QObject>
12
13#include "effect/globals.h"
14
15class OrgFreedesktopScreenSaverInterface;
16class OrgKdeScreensaverInterface;
17class QDBusServiceWatcher;
18class QDBusPendingCallWatcher;
19
20namespace KWin
21{
22
23class KWIN_EXPORT ScreenLockerWatcher : public QObject
24{
25 Q_OBJECT
26public:
27 explicit ScreenLockerWatcher();
28
29 bool isLocked() const;
30Q_SIGNALS:
31 void locked(bool locked);
33private Q_SLOTS:
34 void setLocked(bool activated);
35 void activeQueried(QDBusPendingCallWatcher *watcher);
36 void serviceOwnerChanged(const QString &serviceName, const QString &oldOwner, const QString &newOwner);
37
38private:
39 void initialize();
40 void queryActive();
41 OrgFreedesktopScreenSaverInterface *m_interface = nullptr;
42 OrgKdeScreensaverInterface *m_kdeInterface = nullptr;
43 QDBusServiceWatcher *m_serviceWatcher;
44 bool m_locked;
45};
46}
void locked(bool locked)