1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: SWIG definitions of various utility classes
7 // Created: 25-nov-1998
9 // Copyright: (c) 1998 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
18 #include <wx/config.h>
21 //---------------------------------------------------------------------------
24 %include my_typemaps.i
29 wxString wxPyEmptyStr("");
35 static PyObject* __EnumerationHelper(bool flag, wxString& str, long index) {
36 PyObject* ret = PyTuple_New(3);
38 PyTuple_SET_ITEM(ret, 0, PyInt_FromLong(flag));
39 PyTuple_SET_ITEM(ret, 1, PyString_FromString(str));
40 PyTuple_SET_ITEM(ret, 2, PyInt_FromLong(index));
46 //---------------------------------------------------------------------------
50 wxConfig(const wxString& appName = wxPyEmptyStr,
51 const wxString& vendorName = wxPyEmptyStr,
52 const wxString& localFilename = wxPyEmptyStr,
53 const wxString& globalFilename = wxPyEmptyStr,
58 void DontCreateOnDemand();
59 bool DeleteAll(); // This is supposed to have been fixed...
60 bool DeleteEntry(const wxString& key, bool bDeleteGroupIfEmpty = TRUE);
61 bool DeleteGroup(const wxString& key);
62 bool Exists(wxString& strName);
63 bool Flush(bool bCurrentOnly = FALSE);
64 wxString GetAppName();
67 // Each of these enumeration methods return a 3-tuple consisting of
68 // the continue flag, the value string, and the index for the next call.
70 PyObject* GetFirstGroup() {
75 cont = self->GetFirstGroup(value, index);
76 return __EnumerationHelper(cont, value, index);
79 PyObject* GetFirstEntry() {
84 cont = self->GetFirstEntry(value, index);
85 return __EnumerationHelper(cont, value, index);
88 PyObject* GetNextGroup(long index) {
92 cont = self->GetNextGroup(value, index);
93 return __EnumerationHelper(cont, value, index);
96 PyObject* GetNextEntry(long index) {
100 cont = self->GetNextEntry(value, index);
101 return __EnumerationHelper(cont, value, index);
106 int GetNumberOfEntries(bool bRecursive = FALSE);
107 int GetNumberOfGroups(bool bRecursive = FALSE);
109 wxString GetVendorName();
110 bool HasEntry(wxString& strName);
111 bool HasGroup(const wxString& strName);
112 bool IsExpandingEnvVars();
113 bool IsRecordingDefaults();
115 wxString Read(const wxString& key, const wxString& defaultVal = wxPyEmptyStr);
116 %name(ReadInt)long Read(const wxString& key, long defaultVal = 0);
117 %name(ReadFloat)double Read(const wxString& key, double defaultVal = 0.0);
119 void SetExpandEnvVars (bool bDoIt = TRUE);
120 void SetPath(const wxString& strPath);
121 void SetRecordDefaults(bool bDoIt = TRUE);
123 bool Write(const wxString& key, const wxString& value);
124 %name(WriteInt)bool Write(const wxString& key, long value);
125 %name(WriteFloat)bool Write(const wxString& key, double value);
130 //---------------------------------------------------------------------------
134 wxClassInfo::CleanUpClasses();
135 wxClassInfo::InitializeClasses();
139 //---------------------------------------------------------------------------