]> git.saurik.com Git - wxWidgets.git/blame - interface/power.h
Ticket #9592: gtk-choice-setcolumns.2.diff
[wxWidgets.git] / interface / power.h
CommitLineData
23324ae1
FM
1/////////////////////////////////////////////////////////////////////////////
2// Name: power.h
e54c96f1 3// Purpose: interface of wxPowerEvent
23324ae1
FM
4// Author: wxWidgets team
5// RCS-ID: $Id$
6// Licence: wxWindows license
7/////////////////////////////////////////////////////////////////////////////
8
9/**
10 @class wxPowerEvent
11 @wxheader{power.h}
7c913512 12
23324ae1
FM
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.
7c913512 16
23324ae1
FM
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
b1b95a65
FM
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
23324ae1
FM
21 the platform in your code: this symbol will be defined for all platforms
22 supporting the power events.
7c913512 23
b1b95a65
FM
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
23324ae1 40 @library{wxbase}
b1b95a65 41 @category{events}
7c913512 42
b1b95a65 43 @see ::wxGetPowerType(), ::wxGetBatteryState()
23324ae1
FM
44*/
45class wxPowerEvent : public wxEvent
46{
47public:
48 /**
b1b95a65
FM
49 Call this to prevent suspend from taking place in @c wxEVT_POWER_SUSPENDING
50 handler (it is ignored for all the others).
23324ae1
FM
51 */
52 void Veto();
53};
e54c96f1 54