]>
git.saurik.com Git - wxWidgets.git/blob - interface/wx/power.h
   1 ///////////////////////////////////////////////////////////////////////////// 
   3 // Purpose:     interface of wxPowerEvent 
   4 // Author:      wxWidgets team 
   6 // Licence:     wxWindows license 
   7 ///////////////////////////////////////////////////////////////////////////// 
  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 
  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 
  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 
  20     the platform in your code: this symbol will be defined for all platforms 
  21     supporting the power events. 
  23     @beginEventTable{wxPowerEvent} 
  24     @event{EVT_POWER_SUSPENDING(func)}: 
  25            System is about to be suspended, this event can be vetoed to prevent 
  26            suspend from taking place. 
  27     @event{EVT_POWER_SUSPENDED(func)}: 
  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. 
  32     @event{EVT_POWER_SUSPEND_CANCEL(func)}: 
  33            System suspension was cancelled because some application vetoed it. 
  34     @event{EVT_POWER_RESUME(func)}: 
  35            System resumed from suspend: normally the application should restore 
  36            the state in which it had been before the suspension. 
  42     @see ::wxGetPowerType(), ::wxGetBatteryState() 
  44 class wxPowerEvent 
: public wxEvent
 
  48         Call this to prevent suspend from taking place in @c wxEVT_POWER_SUSPENDING 
  49         handler (it is ignored for all the others).