kwin/plugins/idletime/poller.h
Vlad Zahorodnii 1fb9f6f13a Switch to SPDX license markers
The main advantage of SPDX license identifiers over the traditional
license headers is that it's more difficult to overlook inappropriate
licenses for kwin, for example GPL 3. We also don't have to copy a
lot of boilerplate text.

In order to create this change, I ran licensedigger -r -c from the
toplevel source directory.
2020-08-07 19:57:56 +00:00

56 lines
1.4 KiB
C++

/********************************************************************
KWin - the KDE window manager
This file is part of the KDE project.
SPDX-FileCopyrightText: 2015 Martin Gräßlin <mgraesslin@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*********************************************************************/
#ifndef POLLER_H
#define POLLER_H
#include <KIdleTime/private/abstractsystempoller.h>
#include <QHash>
namespace KWayland
{
namespace Client
{
class Seat;
class Idle;
class IdleTimeout;
}
}
class Poller : public AbstractSystemPoller
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.kde.kidletime.AbstractSystemPoller" FILE "kwin.json")
Q_INTERFACES(AbstractSystemPoller)
public:
Poller(QObject *parent = nullptr);
~Poller() override;
bool isAvailable() override;
bool setUpPoller() override;
void unloadPoller() override;
public Q_SLOTS:
void addTimeout(int nextTimeout) override;
void removeTimeout(int nextTimeout) override;
QList<int> timeouts() const override;
int forcePollRequest() override;
void catchIdleEvent() override;
void stopCatchingIdleEvents() override;
void simulateUserActivity() override;
private:
KWayland::Client::Seat *m_seat = nullptr;
KWayland::Client::Idle *m_idle = nullptr;
KWayland::Client::IdleTimeout *m_catchResumeTimeout = nullptr;
QHash<int, KWayland::Client::IdleTimeout*> m_timeouts;
};
#endif