HostPower.h revision f650118f144626d9f84baace12426f962f41a252
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"
f650118f144626d9f84baace12426f962f41a252vboxsync
f650118f144626d9f84baace12426f962f41a252vboxsyncclass VirtualBox;
f650118f144626d9f84baace12426f962f41a252vboxsync
f650118f144626d9f84baace12426f962f41a252vboxsynctypedef enum
f650118f144626d9f84baace12426f962f41a252vboxsync{
f650118f144626d9f84baace12426f962f41a252vboxsync HostPowerEvent_Suspend,
f650118f144626d9f84baace12426f962f41a252vboxsync HostPowerEvent_Resume,
f650118f144626d9f84baace12426f962f41a252vboxsync HostPowerEvent_BatteryLow
f650118f144626d9f84baace12426f962f41a252vboxsync} HostPowerEvent;
f650118f144626d9f84baace12426f962f41a252vboxsync
f650118f144626d9f84baace12426f962f41a252vboxsyncclass HostPowerService
f650118f144626d9f84baace12426f962f41a252vboxsync{
f650118f144626d9f84baace12426f962f41a252vboxsyncpublic:
f650118f144626d9f84baace12426f962f41a252vboxsync HostPowerService(VirtualBox *aVirtualBox);
f650118f144626d9f84baace12426f962f41a252vboxsync virtual ~HostPowerService();
f650118f144626d9f84baace12426f962f41a252vboxsync
f650118f144626d9f84baace12426f962f41a252vboxsync void notify(HostPowerEvent event);
f650118f144626d9f84baace12426f962f41a252vboxsync
f650118f144626d9f84baace12426f962f41a252vboxsyncprotected:
f650118f144626d9f84baace12426f962f41a252vboxsync ComObjPtr <VirtualBox, ComWeakRef> mVirtualBox;
f650118f144626d9f84baace12426f962f41a252vboxsync};
f650118f144626d9f84baace12426f962f41a252vboxsync
f650118f144626d9f84baace12426f962f41a252vboxsync# ifdef RT_OS_WINDOWS
f650118f144626d9f84baace12426f962f41a252vboxsync/**
f650118f144626d9f84baace12426f962f41a252vboxsync * The Windows hosted Power Service.
f650118f144626d9f84baace12426f962f41a252vboxsync */
f650118f144626d9f84baace12426f962f41a252vboxsyncclass HostPowerServiceWin : public HostPowerService
f650118f144626d9f84baace12426f962f41a252vboxsync{
f650118f144626d9f84baace12426f962f41a252vboxsyncpublic:
f650118f144626d9f84baace12426f962f41a252vboxsync HostPowerServiceWin(VirtualBox *aVirtualBox);
f650118f144626d9f84baace12426f962f41a252vboxsync virtual ~HostPowerServiceWin();
f650118f144626d9f84baace12426f962f41a252vboxsync
f650118f144626d9f84baace12426f962f41a252vboxsyncprivate:
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
f650118f144626d9f84baace12426f962f41a252vboxsync#endif /* ____H_HOSTPOWER */