]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/_power.i
No need to use 2-phase create of the text ctrl
[wxWidgets.git] / wxPython / src / _power.i
CommitLineData
d0e2ede0
RD
1/////////////////////////////////////////////////////////////////////////////
2// Name: _power.i
3// Purpose: SWIG interface for wx poser events and functions
4//
5// Author: Robin Dunn
6//
7// Created: 28-May-2006
8// RCS-ID: $Id$
9// Copyright: (c) 2006 by Total Control Software
10// Licence: wxWindows license
11/////////////////////////////////////////////////////////////////////////////
12
13// Not a %module
14
15//---------------------------------------------------------------------------
16%newgroup
17
18%{
19#include <wx/power.h>
20%}
21
22
23
24%{
25#ifndef wxHAS_POWER_EVENTS
26// Dummy class and other definitions for platforms that don't have them
27
28class wxPowerEvent : public wxEvent
29{
30public:
31 wxPowerEvent(wxEventType evtType) : wxEvent(wxID_NONE, evtType) {}
32 void Veto() {}
33 bool IsVetoed() const { return false; }
34
35 virtual wxEvent *Clone() const { return new wxPowerEvent(*this); }
36};
37
38enum {
39 wxEVT_POWER_SUSPENDING,
40 wxEVT_POWER_SUSPENDED,
41 wxEVT_POWER_SUSPEND_CANCEL,
42 wxEVT_POWER_RESUME,
43};
44
45wxPowerType wxGetPowerType() { return wxPOWER_UNKNOWN; }
46wxBatteryState wxGetBatteryState() { return wxBATTERY_UNKNOWN_STATE; }
47
48#endif
49%}
50
51
52
53enum wxPowerType
54{
55 wxPOWER_SOCKET,
56 wxPOWER_BATTERY,
57 wxPOWER_UNKNOWN
58};
59
60enum wxBatteryState
61{
62 wxBATTERY_NORMAL_STATE, // system is fully usable
63 wxBATTERY_LOW_STATE, // start to worry
64 wxBATTERY_CRITICAL_STATE, // save quickly
65 wxBATTERY_SHUTDOWN_STATE, // too late
66 wxBATTERY_UNKNOWN_STATE
67};
68
69
70DocStr(wxPowerEvent,
71"wx.PowerEvent is generated when the system online status changes.
72Currently this is only implemented for Windows.",
73"");
74class wxPowerEvent : public wxEvent
75{
76public:
77 wxPowerEvent(wxEventType evtType);
78
79 // Veto the operation (only makes sense with EVT_POWER_SUSPENDING)
80 void Veto();
81 bool IsVetoed() const;
82};
83
84
85%constant wxEventType wxEVT_POWER_SUSPENDING;
86%constant wxEventType wxEVT_POWER_SUSPENDED;
87%constant wxEventType wxEVT_POWER_SUSPEND_CANCEL;
88%constant wxEventType wxEVT_POWER_RESUME;
89
90%pythoncode {
91EVT_POWER_SUSPENDING = wx.PyEventBinder( wxEVT_POWER_SUSPENDING , 1 )
92EVT_POWER_SUSPENDED = wx.PyEventBinder( wxEVT_POWER_SUSPENDED , 1 )
93EVT_POWER_SUSPEND_CANCEL = wx.PyEventBinder( wxEVT_POWER_SUSPEND_CANCEL , 1 )
94EVT_POWER_RESUME = wx.PyEventBinder( wxEVT_POWER_RESUME , 1 )
95}
96
97
98DocDeclStr(
99 wxPowerType , wxGetPowerType(),
100 "return the current system power state: online or offline", "");
101
102
103DocDeclStr(
104 wxBatteryState , wxGetBatteryState(),
105 "return approximate battery state", "");
106
107
108//---------------------------------------------------------------------------