HostPower.h revision dd75abdbfc282ea059bd3b4f818d4066daf21482
f650118f144626d9f84baace12426f962f41a252vboxsync/** @file
f650118f144626d9f84baace12426f962f41a252vboxsync *
f650118f144626d9f84baace12426f962f41a252vboxsync * VirtualBox interface to host's power notification service
f650118f144626d9f84baace12426f962f41a252vboxsync */
f650118f144626d9f84baace12426f962f41a252vboxsync
f650118f144626d9f84baace12426f962f41a252vboxsync/*
f650118f144626d9f84baace12426f962f41a252vboxsync * Copyright (C) 2006-2007 Sun Microsystems, Inc.
f650118f144626d9f84baace12426f962f41a252vboxsync *
f650118f144626d9f84baace12426f962f41a252vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
f650118f144626d9f84baace12426f962f41a252vboxsync * available from http://www.virtualbox.org. This file is free software;
f650118f144626d9f84baace12426f962f41a252vboxsync * you can redistribute it and/or modify it under the terms of the GNU
f650118f144626d9f84baace12426f962f41a252vboxsync * General Public License (GPL) as published by the Free Software
f650118f144626d9f84baace12426f962f41a252vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
f650118f144626d9f84baace12426f962f41a252vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
f650118f144626d9f84baace12426f962f41a252vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
f650118f144626d9f84baace12426f962f41a252vboxsync *
f650118f144626d9f84baace12426f962f41a252vboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
f650118f144626d9f84baace12426f962f41a252vboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
f650118f144626d9f84baace12426f962f41a252vboxsync * additional information or have any questions.
f650118f144626d9f84baace12426f962f41a252vboxsync */
f650118f144626d9f84baace12426f962f41a252vboxsync
f650118f144626d9f84baace12426f962f41a252vboxsync#ifndef ____H_HOSTPOWER
f650118f144626d9f84baace12426f962f41a252vboxsync#define ____H_HOSTPOWER
f650118f144626d9f84baace12426f962f41a252vboxsync
f650118f144626d9f84baace12426f962f41a252vboxsync#include "VirtualBoxBase.h"
a62ce5472a6bd50322d061cb720cd84ae5038371vboxsync#include "MachineImpl.h"
f650118f144626d9f84baace12426f962f41a252vboxsync
dd75abdbfc282ea059bd3b4f818d4066daf21482vboxsync#include <vector>
dd75abdbfc282ea059bd3b4f818d4066daf21482vboxsync
f650118f144626d9f84baace12426f962f41a252vboxsyncclass VirtualBox;
f650118f144626d9f84baace12426f962f41a252vboxsync
f650118f144626d9f84baace12426f962f41a252vboxsynctypedef enum
f650118f144626d9f84baace12426f962f41a252vboxsync{
f650118f144626d9f84baace12426f962f41a252vboxsync HostPowerEvent_Suspend,
f650118f144626d9f84baace12426f962f41a252vboxsync HostPowerEvent_Resume,
f650118f144626d9f84baace12426f962f41a252vboxsync HostPowerEvent_BatteryLow
f650118f144626d9f84baace12426f962f41a252vboxsync} HostPowerEvent;
f650118f144626d9f84baace12426f962f41a252vboxsync
f650118f144626d9f84baace12426f962f41a252vboxsyncclass HostPowerService
f650118f144626d9f84baace12426f962f41a252vboxsync{
f650118f144626d9f84baace12426f962f41a252vboxsyncpublic:
dd75abdbfc282ea059bd3b4f818d4066daf21482vboxsync
dd75abdbfc282ea059bd3b4f818d4066daf21482vboxsync HostPowerService (VirtualBox *aVirtualBox);
f650118f144626d9f84baace12426f962f41a252vboxsync virtual ~HostPowerService();
f650118f144626d9f84baace12426f962f41a252vboxsync
dd75abdbfc282ea059bd3b4f818d4066daf21482vboxsync void notify (HostPowerEvent aEvent);
f650118f144626d9f84baace12426f962f41a252vboxsync
f650118f144626d9f84baace12426f962f41a252vboxsyncprotected:
dd75abdbfc282ea059bd3b4f818d4066daf21482vboxsync
f650118f144626d9f84baace12426f962f41a252vboxsync ComObjPtr <VirtualBox, ComWeakRef> mVirtualBox;
1182fb63729addc520f50d0b2ccc537f80a2eb0bvboxsync
dd75abdbfc282ea059bd3b4f818d4066daf21482vboxsync std::vector <ComPtr <IConsole> > mConsoles;
f650118f144626d9f84baace12426f962f41a252vboxsync};
f650118f144626d9f84baace12426f962f41a252vboxsync
f650118f144626d9f84baace12426f962f41a252vboxsync# ifdef RT_OS_WINDOWS
f650118f144626d9f84baace12426f962f41a252vboxsync/**
f650118f144626d9f84baace12426f962f41a252vboxsync * The Windows hosted Power Service.
f650118f144626d9f84baace12426f962f41a252vboxsync */
f650118f144626d9f84baace12426f962f41a252vboxsyncclass HostPowerServiceWin : public HostPowerService
f650118f144626d9f84baace12426f962f41a252vboxsync{
f650118f144626d9f84baace12426f962f41a252vboxsyncpublic:
dd75abdbfc282ea059bd3b4f818d4066daf21482vboxsync
f650118f144626d9f84baace12426f962f41a252vboxsync HostPowerServiceWin(VirtualBox *aVirtualBox);
f650118f144626d9f84baace12426f962f41a252vboxsync virtual ~HostPowerServiceWin();
f650118f144626d9f84baace12426f962f41a252vboxsync
f650118f144626d9f84baace12426f962f41a252vboxsyncprivate:
dd75abdbfc282ea059bd3b4f818d4066daf21482vboxsync
f650118f144626d9f84baace12426f962f41a252vboxsync static DECLCALLBACK(int) NotificationThread (RTTHREAD ThreadSelf, void *pInstance);
f650118f144626d9f84baace12426f962f41a252vboxsync static LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
f650118f144626d9f84baace12426f962f41a252vboxsync
f650118f144626d9f84baace12426f962f41a252vboxsync HWND mHwnd;
f650118f144626d9f84baace12426f962f41a252vboxsync RTTHREAD mThread;
f650118f144626d9f84baace12426f962f41a252vboxsync};
f650118f144626d9f84baace12426f962f41a252vboxsync# endif /* RT_OS_WINDOWS */
f650118f144626d9f84baace12426f962f41a252vboxsync
899cf879d9636e1b7fe8bd6b05926c372dc32ed5vboxsync#endif /* !____H_HOSTPOWER */