]> git.saurik.com Git - wxWidgets.git/blame - interface/platinfo.h
remove wxTextAttr::CreateFont(); return wxNullFont from GetFont() if we have no font...
[wxWidgets.git] / interface / platinfo.h
CommitLineData
23324ae1
FM
1/////////////////////////////////////////////////////////////////////////////
2// Name: platinfo.h
3// Purpose: documentation for wxPlatformInfo class
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
23324ae1
FM
21 @seealso
22 wxGetOSVersion, wxIsPlatformLittleEndian, wxIsPlatform64Bit, wxAppTraits
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.
44
4cc4bfaf
FM
45 @see GetOSMajorVersion(), GetOSMinorVersion(),
46 CheckToolkitVersion()
23324ae1
FM
47 */
48 bool CheckOSVersion(int major, int minor);
49
50 /**
51 Returns @true if the toolkit version is at least @c major.minor.
52
4cc4bfaf
FM
53 @see GetToolkitMajorVersion(),
54 GetToolkitMinorVersion(), CheckOSVersion()
23324ae1
FM
55 */
56 bool CheckToolkitVersion(int major, int minor);
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 */
75 static wxString GetArchName(wxArchitecture arch);
7c913512 76 wxString GetArchName();
23324ae1
FM
77 //@}
78
79 /**
80 Returns the architecture ID of this wxPlatformInfo instance.
81 */
82 wxArchitecture GetArchitecture();
83
84 //@{
85 /**
86 Returns the endianness ID of this wxPlatformInfo instance.
87 */
88 static wxEndianness GetEndianness(const wxString& end);
7c913512 89 wxEndianness GetEndianness();
23324ae1
FM
90 //@}
91
92 //@{
93 /**
94 Returns the name for the endianness of this wxPlatformInfo instance.
95 */
96 static wxString GetEndiannessName(wxEndianness end);
7c913512 97 wxString GetEndiannessName();
23324ae1
FM
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
4cc4bfaf 105 @see CheckOSVersion()
23324ae1
FM
106 */
107 int GetOSMajorVersion();
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
4cc4bfaf 114 @see CheckOSVersion()
23324ae1
FM
115 */
116 int GetOSMinorVersion();
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);
7c913512 124 wxString GetOperatingSystemFamilyName();
23324ae1
FM
125 //@}
126
127 //@{
128 /**
129 Returns the operating system ID of this wxPlatformInfo instance.
130 */
131 static wxOperatingSystemId GetOperatingSystemId(const wxString& name);
7c913512 132 wxOperatingSystemId GetOperatingSystemId();
23324ae1
FM
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);
7c913512 141 wxString GetOperatingSystemIdName();
23324ae1
FM
142 //@}
143
144 //@{
145 /**
146 Returns the wxWidgets port ID associated with this wxPlatformInfo instance.
147 */
148 static wxPortId GetPortId(const wxString& portname);
7c913512 149 wxPortId GetPortId();
23324ae1
FM
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);
7c913512 158 wxString GetPortIdName();
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,
167 bool usingUniversal);
7c913512 168 wxString GetPortIdShortName();
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
FM
176 See wxAppTraits::GetToolkitVersion for more info.
177
4cc4bfaf 178 @see CheckToolkitVersion()
23324ae1
FM
179 */
180 int GetToolkitMajorVersion();
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
FM
187 See wxAppTraits::GetToolkitVersion for more info.
188
4cc4bfaf 189 @see CheckToolkitVersion()
23324ae1
FM
190 */
191 int GetToolkitMinorVersion();
192
193 /**
194 Returns @true if this instance is fully initialized with valid values.
195 */
4cc4bfaf 196 bool IsOk();
23324ae1
FM
197
198 /**
199 Returns @true if this wxPlatformInfo describes wxUniversal build.
200 */
201 bool IsUsingUniversalWidgets();
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);
238
239 /**
240 Equality operator. Tests all class' internal variables.
241 */
242 bool operator==(const wxPlatformInfo& t);
243};