mirror of
https://github.com/deskflow/deskflow.git
synced 2026-07-01 21:02:39 +08:00
38 lines
860 B
C++
38 lines
860 B
C++
/*
|
|
* Deskflow -- mouse and keyboard sharing utility
|
|
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
|
|
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
|
|
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <string>
|
|
|
|
class XWindowsPowerManager
|
|
{
|
|
public:
|
|
XWindowsPowerManager() = default;
|
|
~XWindowsPowerManager();
|
|
|
|
/**
|
|
* @brief Prevent the system from sleep
|
|
*/
|
|
void disableSleep() const;
|
|
|
|
/**
|
|
* @brief Enables automatical sleep
|
|
*/
|
|
void enableSleep() const;
|
|
|
|
XWindowsPowerManager(const XWindowsPowerManager &) = delete;
|
|
XWindowsPowerManager &operator=(const XWindowsPowerManager &) = delete;
|
|
|
|
enum class InhibitScreenServices
|
|
{
|
|
kScreenSaver,
|
|
kSessionManager
|
|
};
|
|
static bool inhibitScreenCall(InhibitScreenServices serviceID, bool state, std::string &error);
|
|
};
|