]> git.saurik.com Git - wxWidgets.git/blob - interface/power.h
committing changes before renaming
[wxWidgets.git] / interface / power.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: power.h
3 // Purpose: interface of wxPowerEvent
4 // Author: wxWidgets team
5 // RCS-ID: $Id$
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
8
9 /**
10 @class wxPowerEvent
11 @wxheader{power.h}
12
13 The power events are generated when the system power state changes, e.g. the
14 system is suspended, hibernated, plugged into or unplugged from the wall socket
15 and so on.
16
17 Notice that currently only suspend and resume events are generated and only
18 under MS Windows platform. To avoid the need to change the code using this
19 event later when these events are implemented on the other platforms please
20 use the test <tt>ifdef wxHAS_POWER_EVENTS</tt> instead of directly testing for
21 the platform in your code: this symbol will be defined for all platforms
22 supporting the power events.
23
24 @beginEventTable{wxPowerEvent}
25 @event{EVT_POWER_SUSPENDING(func)}:
26 System is about to be suspended, this event can be vetoed to prevent
27 suspend from taking place.
28 @event{EVT_POWER_SUSPENDED(func)}:
29 System is about to suspend: normally the application should quickly
30 (i.e. without user intervention) close all the open files and network
31 connections here, possibly remembering them to reopen them later when
32 the system is resumed.
33 @event{EVT_POWER_SUSPEND_CANCEL(func)}:
34 System suspension was cancelled because some application vetoed it.
35 @event{EVT_POWER_RESUME(func)}:
36 System resumed from suspend: normally the application should restore
37 the state in which it had been before the suspension.
38 @endEventTable
39
40 @library{wxbase}
41 @category{events}
42
43 @see ::wxGetPowerType(), ::wxGetBatteryState()
44 */
45 class wxPowerEvent : public wxEvent
46 {
47 public:
48 /**
49 Call this to prevent suspend from taking place in @c wxEVT_POWER_SUSPENDING
50 handler (it is ignored for all the others).
51 */
52 void Veto();
53 };
54