MythTV master
mythpowerosx.h
Go to the documentation of this file.
1#ifndef MYTHPOWEROSX_H
2#define MYTHPOWEROSX_H
3
4// Qt
5#include <QObject>
6
7// MythTV
8#include "mythpower.h"
9
10// OS X
11#include <CoreFoundation/CoreFoundation.h>
12#include <IOKit/pwr_mgt/IOPMLib.h>
13#include <IOKit/IOMessage.h>
14
15class MythPowerOSX final : public MythPower
16{
17 Q_OBJECT
18
19 friend class MythPower;
20
21 public:
22
23 protected slots:
24 void Refresh (void) override;
25
26 protected:
28 ~MythPowerOSX() override;
29 void Init(void) override;
30 bool DoFeature (bool Delayed = false) override;
31
32 static void PowerCallBack (void *Reference, io_service_t Service,
33 natural_t Type, void *Data);
34 static void PowerSourceCallBack (void *Reference);
35
36 CFRunLoopSourceRef m_powerRef { nullptr };
37 io_connect_t m_rootPowerDomain { 0 };
38 io_object_t m_powerNotifier { MACH_PORT_NULL };
39 IONotificationPortRef m_powerNotifyPort { nullptr };
40};
41
42#endif // MYTHPOWEROSX_H
~MythPowerOSX() override
bool DoFeature(bool Delayed=false) override
static void PowerSourceCallBack(void *Reference)
Receive notification of changes to the power supply.
IONotificationPortRef m_powerNotifyPort
Definition: mythpowerosx.h:39
MythPowerOSX()
Power management for OSX.
static void PowerCallBack(void *Reference, io_service_t Service, natural_t Type, void *Data)
Receive notification of power status changes.
void Refresh(void) override
io_connect_t m_rootPowerDomain
Definition: mythpowerosx.h:37
void Init(void) override
CFRunLoopSourceRef m_powerRef
Definition: mythpowerosx.h:36
io_object_t m_powerNotifier
Definition: mythpowerosx.h:38