#include <wx/power.h>
Helper functions for acquiring and releasing the given power resource.
If an application performs a long running task without user interaction it is often necessary to prevent the system from automatically suspending or powering off the screen and Acquire() method can be used to do this.
Notice that currently this functionality is only implemented for MSW and OS X.
If possible, use wxPowerResourceBlocker class to ensure that Release() is called instead of calling it manually.
Static Public Member Functions | |
static bool | Acquire (wxPowerResourceKind kind, const wxString &reason=wxString()) |
Acquire a power resource for the application. More... | |
static void | Release (wxPowerResourceKind kind) |
Release a previously acquired power resource. More... | |
|
static |
Acquire a power resource for the application.
If successful, the system will not automatically power of the screen or suspend until Release() is called.
Every call to Acquire must be matched by a corresponding call to Release() or the system will not suspend until the application ends, use wxPowerResourceBlocker to ensure that this happens.
kind | Power resource required, either wxPOWER_RESOURCE_SCREEN or wxPOWER_RESOURCE_SYSTEM. |
reason | Optional reason may be specified which might be used on some platforms to inform the user what is preventing power saving. It should usually describe the operation requiring the resource and specifying it is strongly recommended. |
|
static |