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