Deskflow 1.22.0.197
Keyboard and mouse sharing utility
Loading...
Searching...
No Matches
OSXPowerManager.h
Go to the documentation of this file.
1/*
2 * Deskflow -- mouse and keyboard sharing utility
3 * SPDX-FileCopyrightText: (C) 2012 - 2021 Symless Ltd.
4 * SPDX-FileCopyrightText: (C) 2008 Volker Lanz <vl@fidra.de>
5 * SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
6 */
7
8#pragma once
9
10#include <IOKit/pwr_mgt/IOPMLib.h>
11
13{
14public:
15 OSXPowerManager() = default;
17
21 void disableSleep();
22
26 void enableSleep();
27
30
31private:
32 // handler for assertion preventing the system from going to sleep
33 IOPMAssertionID m_sleepPreventionAssertionID = 0;
34};
void enableSleep()
Enable automatically sleeping.
Definition OSXPowerManager.cpp:30
void disableSleep()
Prevents the system from sleep automatically.
Definition OSXPowerManager.cpp:16
OSXPowerManager(const OSXPowerManager &)=delete
~OSXPowerManager()
Definition OSXPowerManager.cpp:11
OSXPowerManager & operator=(const OSXPowerManager &)=delete
OSXPowerManager()=default