]> git.saurik.com Git - wxWidgets.git/blob - interface/platinfo.h
include more headers for PCH-less compilation
[wxWidgets.git] / interface / platinfo.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: platinfo.h
3 // Purpose: interface of wxPlatformInfo
4 // Author: wxWidgets team
5 // RCS-ID: $Id$
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
8
9 /**
10 @class wxPlatformInfo
11 @wxheader{platinfo.h}
12
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.
17
18 @library{wxbase}
19 @category{FIXME}
20
21 @see wxGetOSVersion(), wxIsPlatformLittleEndian(), wxIsPlatform64Bit(),
22 wxAppTraits
23 */
24 class wxPlatformInfo : public wxObject
25 {
26 public:
27 //@{
28 /**
29 Initializes the object using given values.
30 */
31 wxPlatformInfo();
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);
40 //@}
41
42 /**
43 Returns @true if the OS version is at least @c major.minor.
44
45 @see GetOSMajorVersion(), GetOSMinorVersion(),
46 CheckToolkitVersion()
47 */
48 bool CheckOSVersion(int major, int minor) const;
49
50 /**
51 Returns @true if the toolkit version is at least @c major.minor.
52
53 @see GetToolkitMajorVersion(),
54 GetToolkitMinorVersion(), CheckOSVersion()
55 */
56 bool CheckToolkitVersion(int major, int minor) const;
57
58 /**
59 Returns the global wxPlatformInfo object, initialized with the values for the
60 currently running platform.
61 */
62 static const wxPlatformInfo Get();
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 */
75 static wxString GetArchName(wxArchitecture arch) const;
76 wxString GetArchName() const;
77 //@}
78
79 /**
80 Returns the architecture ID of this wxPlatformInfo instance.
81 */
82 wxArchitecture GetArchitecture() const;
83
84 //@{
85 /**
86 Returns the endianness ID of this wxPlatformInfo instance.
87 */
88 static wxEndianness GetEndianness(const wxString& end) const;
89 wxEndianness GetEndianness() const;
90 //@}
91
92 //@{
93 /**
94 Returns the name for the endianness of this wxPlatformInfo instance.
95 */
96 static wxString GetEndiannessName(wxEndianness end) const;
97 wxString GetEndiannessName() const;
98 //@}
99
100 /**
101 Returns the run-time major version of the OS associated with this
102 wxPlatformInfo instance.
103 See wxGetOsVersion() for more info.
104
105 @see CheckOSVersion()
106 */
107 int GetOSMajorVersion() const;
108
109 /**
110 Returns the run-time minor version of the OS associated with this
111 wxPlatformInfo instance.
112 See wxGetOsVersion() for more info.
113
114 @see CheckOSVersion()
115 */
116 int GetOSMinorVersion() const;
117
118 //@{
119 /**
120 Returns the operating system family name of the OS associated with this
121 wxPlatformInfo instance.
122 */
123 static wxString GetOperatingSystemFamilyName(wxOperatingSystemId os) const;
124 wxString GetOperatingSystemFamilyName() const;
125 //@}
126
127 //@{
128 /**
129 Returns the operating system ID of this wxPlatformInfo instance.
130 */
131 static wxOperatingSystemId GetOperatingSystemId(const wxString& name) const;
132 wxOperatingSystemId GetOperatingSystemId() const;
133 //@}
134
135 //@{
136 /**
137 Returns the operating system name of the OS associated with this wxPlatformInfo
138 instance.
139 */
140 static wxString GetOperatingSystemIdName(wxOperatingSystemId os) const;
141 wxString GetOperatingSystemIdName() const;
142 //@}
143
144 //@{
145 /**
146 Returns the wxWidgets port ID associated with this wxPlatformInfo instance.
147 */
148 static wxPortId GetPortId(const wxString& portname) const;
149 wxPortId GetPortId() const;
150 //@}
151
152 //@{
153 /**
154 Returns the name of the wxWidgets port ID associated with this wxPlatformInfo
155 instance.
156 */
157 static wxString GetPortIdName(wxPortId port, bool usingUniversal) const;
158 wxString GetPortIdName() const;
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,
167 bool usingUniversal) const;
168 wxString GetPortIdShortName() const;
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.
176 See wxAppTraits::GetToolkitVersion for more info.
177
178 @see CheckToolkitVersion()
179 */
180 int GetToolkitMajorVersion() const;
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.
187 See wxAppTraits::GetToolkitVersion for more info.
188
189 @see CheckToolkitVersion()
190 */
191 int GetToolkitMinorVersion() const;
192
193 /**
194 Returns @true if this instance is fully initialized with valid values.
195 */
196 bool IsOk() const;
197
198 /**
199 Returns @true if this wxPlatformInfo describes wxUniversal build.
200 */
201 bool IsUsingUniversalWidgets() const;
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 */
237 bool operator!=(const wxPlatformInfo& t) const;
238
239 /**
240 Equality operator. Tests all class' internal variables.
241 */
242 bool operator==(const wxPlatformInfo& t) const;
243 };
244