deskflow/src/lib/platform/XDGPowerManager.h

38 lines
828 B
C
Raw Normal View History

/*
* Deskflow -- mouse and keyboard sharing utility
* SPDX-FileCopyrightText: (C) 2012 - 2016 Synergy App Ltd
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
*/
#pragma once
#include <string>
class XDGPowerManager
{
public:
XDGPowerManager() = default;
~XDGPowerManager();
2021-07-23 15:50:09 +00:00
/**
* @brief Prevent the system from sleep
*/
void disableSleep() const;
2021-07-23 15:50:09 +00:00
/**
* @brief Enables automatical sleep
*/
void enableSleep() const;
2021-07-23 16:08:26 +00:00
XDGPowerManager(const XDGPowerManager &) = delete;
XDGPowerManager &operator=(const XDGPowerManager &) = delete;
enum class InhibitScreenServices
{
kScreenSaver,
kSessionManager
};
static bool inhibitScreenCall(InhibitScreenServices serviceID, bool state, std::string &error);
};