1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxPowerEvent
4 // Author: wxWidgets team
6 // Licence: wxWindows licence
7 /////////////////////////////////////////////////////////////////////////////
18 wxBATTERY_NORMAL_STATE
, // system is fully usable
19 wxBATTERY_LOW_STATE
, // start to worry
20 wxBATTERY_CRITICAL_STATE
, // save quickly
21 wxBATTERY_SHUTDOWN_STATE
, // too late
22 wxBATTERY_UNKNOWN_STATE
29 The power events are generated when the system power state changes, e.g. the
30 system is suspended, hibernated, plugged into or unplugged from the wall socket
31 and so on. wxPowerEvents are emitted by wxWindows.
33 Notice that currently only suspend and resume events are generated and only
34 under MS Windows platform. To avoid the need to change the code using this
35 event later when these events are implemented on the other platforms please
36 use the test <tt>ifdef wxHAS_POWER_EVENTS</tt> instead of directly testing for
37 the platform in your code: this symbol will be defined for all platforms
38 supporting the power events.
40 @beginEventTable{wxPowerEvent}
41 @event{EVT_POWER_SUSPENDING(func)}
42 System is about to be suspended, this event can be vetoed to prevent
43 suspend from taking place.
44 @event{EVT_POWER_SUSPENDED(func)}
45 System is about to suspend: normally the application should quickly
46 (i.e. without user intervention) close all the open files and network
47 connections here, possibly remembering them to reopen them later when
48 the system is resumed.
49 @event{EVT_POWER_SUSPEND_CANCEL(func)}
50 System suspension was cancelled because some application vetoed it.
51 @event{EVT_POWER_RESUME(func)}
52 System resumed from suspend: normally the application should restore
53 the state in which it had been before the suspension.
59 @see ::wxGetPowerType(), ::wxGetBatteryState()
61 class wxPowerEvent
: public wxEvent
65 wxPowerEvent(wxEventType evtType
);
68 Call this to prevent suspend from taking place in @c wxEVT_POWER_SUSPENDING
69 handler (it is ignored for all the others).
74 Returns whether Veto has been called.
76 bool IsVetoed() const;
79 wxEventType wxEVT_POWER_SUSPENDING
;
80 wxEventType wxEVT_POWER_SUSPENDED
;
81 wxEventType wxEVT_POWER_SUSPEND_CANCEL
;
82 wxEventType wxEVT_POWER_RESUME
;