]> git.saurik.com Git - wxWidgets.git/blame - interface/platinfo.h
added convenient wxON_BLOCK_EXIT_THISn() macros wrapping wxON_BLOCK_EXIT_OBJn(*this)
[wxWidgets.git] / interface / platinfo.h
CommitLineData
23324ae1
FM
1/////////////////////////////////////////////////////////////////////////////
2// Name: platinfo.h
e54c96f1 3// Purpose: interface of wxPlatformInfo
23324ae1
FM
4// Author: wxWidgets team
5// RCS-ID: $Id$
6// Licence: wxWindows license
7/////////////////////////////////////////////////////////////////////////////
8
9/**
10 @class wxPlatformInfo
11 @wxheader{platinfo.h}
7c913512 12
23324ae1
FM
13 This class holds informations about the operating system and the toolkit that
14 the application
15 is running under and some basic architecture info of the machine where it's
16 running.
7c913512 17
23324ae1
FM
18 @library{wxbase}
19 @category{FIXME}
7c913512 20
e54c96f1
FM
21 @see wxGetOSVersion(), wxIsPlatformLittleEndian(), wxIsPlatform64Bit(),
22 wxAppTraits
23324ae1
FM
23*/
24class wxPlatformInfo : public wxObject
25{
26public:
27 //@{
28 /**
29 Initializes the object using given values.
30 */
31 wxPlatformInfo();
7c913512
FM
32 wxPlatformInfo(wxPortId pid = wxPORT_UNKNOWN,
33 int tkMajor = -1,
34 int tkMinor = -1,
35 wxOperatingSystemId id = wxOS_UNKNOWN,
36 int osMajor = -1,
37 int osMinor = -1,
38 wxArchitecture arch = wxARCH_INVALID,
39 wxEndianness endian = wxENDIAN_INVALID);
23324ae1
FM
40 //@}
41
42 /**
43 Returns @true if the OS version is at least @c major.minor.
3c4f71cc 44
4cc4bfaf
FM
45 @see GetOSMajorVersion(), GetOSMinorVersion(),
46 CheckToolkitVersion()
23324ae1 47 */
328f5751 48 bool CheckOSVersion(int major, int minor) const;
23324ae1
FM
49
50 /**
51 Returns @true if the toolkit version is at least @c major.minor.
3c4f71cc 52
4cc4bfaf
FM
53 @see GetToolkitMajorVersion(),
54 GetToolkitMinorVersion(), CheckOSVersion()
23324ae1 55 */
328f5751 56 bool CheckToolkitVersion(int major, int minor) const;
23324ae1
FM
57
58 /**
59 Returns the global wxPlatformInfo object, initialized with the values for the
60 currently running platform.
61 */
4cc4bfaf 62 static const wxPlatformInfo Get();
23324ae1
FM
63
64 /**
65 Converts the given string to a wxArchitecture enum value or to
66 wxARCH_INVALID if the given string is not a valid architecture string
67 (i.e. does not contain nor @c 32 nor @c 64 strings).
68 */
69 static wxArchitecture GetArch(const wxString& arch);
70
71 //@{
72 /**
73 Returns the name for the architecture of this wxPlatformInfo instance.
74 */
328f5751
FM
75 static wxString GetArchName(wxArchitecture arch) const;
76 wxString GetArchName() const;
23324ae1
FM
77 //@}
78
79 /**
80 Returns the architecture ID of this wxPlatformInfo instance.
81 */
328f5751 82 wxArchitecture GetArchitecture() const;
23324ae1
FM
83
84 //@{
85 /**
86 Returns the endianness ID of this wxPlatformInfo instance.
87 */
328f5751
FM
88 static wxEndianness GetEndianness(const wxString& end) const;
89 wxEndianness GetEndianness() const;
23324ae1
FM
90 //@}
91
92 //@{
93 /**
94 Returns the name for the endianness of this wxPlatformInfo instance.
95 */
328f5751
FM
96 static wxString GetEndiannessName(wxEndianness end) const;
97 wxString GetEndiannessName() const;
23324ae1
FM
98 //@}
99
100 /**
101 Returns the run-time major version of the OS associated with this
102 wxPlatformInfo instance.
e54c96f1 103 See wxGetOsVersion() for more info.
3c4f71cc 104
4cc4bfaf 105 @see CheckOSVersion()
23324ae1 106 */
328f5751 107 int GetOSMajorVersion() const;
23324ae1
FM
108
109 /**
110 Returns the run-time minor version of the OS associated with this
111 wxPlatformInfo instance.
e54c96f1 112 See wxGetOsVersion() for more info.
3c4f71cc 113
4cc4bfaf 114 @see CheckOSVersion()
23324ae1 115 */
328f5751 116 int GetOSMinorVersion() const;
23324ae1
FM
117
118 //@{
119 /**
120 Returns the operating system family name of the OS associated with this
121 wxPlatformInfo instance.
122 */
328f5751
FM
123 static wxString GetOperatingSystemFamilyName(wxOperatingSystemId os) const;
124 wxString GetOperatingSystemFamilyName() const;
23324ae1
FM
125 //@}
126
127 //@{
128 /**
129 Returns the operating system ID of this wxPlatformInfo instance.
130 */
328f5751
FM
131 static wxOperatingSystemId GetOperatingSystemId(const wxString& name) const;
132 wxOperatingSystemId GetOperatingSystemId() const;
23324ae1
FM
133 //@}
134
135 //@{
136 /**
137 Returns the operating system name of the OS associated with this wxPlatformInfo
138 instance.
139 */
328f5751
FM
140 static wxString GetOperatingSystemIdName(wxOperatingSystemId os) const;
141 wxString GetOperatingSystemIdName() const;
23324ae1
FM
142 //@}
143
144 //@{
145 /**
146 Returns the wxWidgets port ID associated with this wxPlatformInfo instance.
147 */
328f5751
FM
148 static wxPortId GetPortId(const wxString& portname) const;
149 wxPortId GetPortId() const;
23324ae1
FM
150 //@}
151
152 //@{
153 /**
154 Returns the name of the wxWidgets port ID associated with this wxPlatformInfo
155 instance.
156 */
328f5751
FM
157 static wxString GetPortIdName(wxPortId port, bool usingUniversal) const;
158 wxString GetPortIdName() const;
23324ae1
FM
159 //@}
160
161 //@{
162 /**
163 Returns the short name of the wxWidgets port ID associated with this
164 wxPlatformInfo instance.
165 */
166 static wxString GetPortIdShortName(wxPortId port,
328f5751
FM
167 bool usingUniversal) const;
168 wxString GetPortIdShortName() const;
23324ae1
FM
169 //@}
170
171 /**
172 Returns the run-time major version of the toolkit associated with this
173 wxPlatformInfo instance.
174 Note that if GetPortId() returns wxPORT_BASE, then this value is zero (unless
175 externally modified with wxPlatformInfo::SetToolkitVersion); that is, no native toolkit is in use.
23324ae1 176 See wxAppTraits::GetToolkitVersion for more info.
3c4f71cc 177
4cc4bfaf 178 @see CheckToolkitVersion()
23324ae1 179 */
328f5751 180 int GetToolkitMajorVersion() const;
23324ae1
FM
181
182 /**
183 Returns the run-time minor version of the toolkit associated with this
184 wxPlatformInfo instance.
185 Note that if GetPortId() returns wxPORT_BASE, then this value is zero (unless
186 externally modified with wxPlatformInfo::SetToolkitVersion); that is, no native toolkit is in use.
23324ae1 187 See wxAppTraits::GetToolkitVersion for more info.
3c4f71cc 188
4cc4bfaf 189 @see CheckToolkitVersion()
23324ae1 190 */
328f5751 191 int GetToolkitMinorVersion() const;
23324ae1
FM
192
193 /**
194 Returns @true if this instance is fully initialized with valid values.
195 */
328f5751 196 bool IsOk() const;
23324ae1
FM
197
198 /**
199 Returns @true if this wxPlatformInfo describes wxUniversal build.
200 */
328f5751 201 bool IsUsingUniversalWidgets() const;
23324ae1
FM
202
203 /**
204 Sets the architecture enum value associated with this wxPlatformInfo instance.
205 */
206 void SetArchitecture(wxArchitecture n);
207
208 /**
209 Sets the endianness enum value associated with this wxPlatformInfo instance.
210 */
211 void SetEndianness(wxEndianness n);
212
213 /**
214 Sets the version of the operating system associated with this wxPlatformInfo
215 instance.
216 */
217 void SetOSVersion(int major, int minor);
218
219 /**
220 Sets the operating system associated with this wxPlatformInfo instance.
221 */
222 void SetOperatingSystemId(wxOperatingSystemId n);
223
224 /**
225 Sets the wxWidgets port ID associated with this wxPlatformInfo instance.
226 */
227 void SetPortId(wxPortId n);
228
229 /**
230 Sets the version of the toolkit associated with this wxPlatformInfo instance.
231 */
232 void SetToolkitVersion(int major, int minor);
233
234 /**
235 Inequality operator. Tests all class' internal variables.
236 */
328f5751 237 bool operator!=(const wxPlatformInfo& t) const;
23324ae1
FM
238
239 /**
240 Equality operator. Tests all class' internal variables.
241 */
328f5751 242 bool operator==(const wxPlatformInfo& t) const;
23324ae1 243};
e54c96f1 244