File indexing completed on 2024-05-19 05:37:52
0001 /* 0002 SPDX-FileCopyrightText: 2011 Sebastian Kügler <sebas@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-only 0005 */ 0006 0007 #pragma once 0008 0009 // plasma 0010 #include <Plasma5Support/ServiceJob> 0011 0012 class SessionManagement; 0013 class QDBusPendingCall; 0014 0015 class PowerManagementJob : public Plasma5Support::ServiceJob 0016 { 0017 Q_OBJECT 0018 0019 public: 0020 PowerManagementJob(const QString &operation, QMap<QString, QVariant> ¶meters, QObject *parent = nullptr); 0021 ~PowerManagementJob() override; 0022 0023 protected: 0024 void start() override; 0025 0026 private: 0027 QDBusPendingCall setScreenBrightness(int value, bool silent); 0028 QDBusPendingCall setKeyboardBrightness(int value, bool silent); 0029 QDBusPendingCall setPowerProfile(const QString &value); 0030 SessionManagement *m_session; 0031 inline static uint m_sleepInhibitionCookie = -1; 0032 inline static uint m_lockInhibitionCookie = -1; 0033 };