]>
git.saurik.com Git - wxWidgets.git/blob - interface/platinfo.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxPlatformInfo
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
13 This class holds informations about the operating system and the toolkit that
15 is running under and some basic architecture info of the machine where it's
21 @see wxGetOSVersion(), wxIsPlatformLittleEndian(), wxIsPlatform64Bit(),
24 class wxPlatformInfo
: public wxObject
29 Initializes the object using given values.
32 wxPlatformInfo(wxPortId pid
= wxPORT_UNKNOWN
,
35 wxOperatingSystemId id
= wxOS_UNKNOWN
,
38 wxArchitecture arch
= wxARCH_INVALID
,
39 wxEndianness endian
= wxENDIAN_INVALID
);
43 Returns @true if the OS version is at least @c major.minor.
45 @see GetOSMajorVersion(), GetOSMinorVersion(),
48 bool CheckOSVersion(int major
, int minor
) const;
51 Returns @true if the toolkit version is at least @c major.minor.
53 @see GetToolkitMajorVersion(),
54 GetToolkitMinorVersion(), CheckOSVersion()
56 bool CheckToolkitVersion(int major
, int minor
) const;
59 Returns the global wxPlatformInfo object, initialized with the values for the
60 currently running platform.
62 static const wxPlatformInfo
Get();
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).
69 static wxArchitecture
GetArch(const wxString
& arch
);
73 Returns the name for the architecture of this wxPlatformInfo instance.
75 static wxString
GetArchName(wxArchitecture arch
) const;
76 wxString
GetArchName() const;
80 Returns the architecture ID of this wxPlatformInfo instance.
82 wxArchitecture
GetArchitecture() const;
86 Returns the endianness ID of this wxPlatformInfo instance.
88 static wxEndianness
GetEndianness(const wxString
& end
) const;
89 wxEndianness
GetEndianness() const;
94 Returns the name for the endianness of this wxPlatformInfo instance.
96 static wxString
GetEndiannessName(wxEndianness end
) const;
97 wxString
GetEndiannessName() const;
101 Returns the run-time major version of the OS associated with this
102 wxPlatformInfo instance.
103 See wxGetOsVersion() for more info.
105 @see CheckOSVersion()
107 int GetOSMajorVersion() const;
110 Returns the run-time minor version of the OS associated with this
111 wxPlatformInfo instance.
112 See wxGetOsVersion() for more info.
114 @see CheckOSVersion()
116 int GetOSMinorVersion() const;
120 Returns the operating system family name of the OS associated with this
121 wxPlatformInfo instance.
123 static wxString
GetOperatingSystemFamilyName(wxOperatingSystemId os
) const;
124 wxString
GetOperatingSystemFamilyName() const;
129 Returns the operating system ID of this wxPlatformInfo instance.
131 static wxOperatingSystemId
GetOperatingSystemId(const wxString
& name
) const;
132 wxOperatingSystemId
GetOperatingSystemId() const;
137 Returns the operating system name of the OS associated with this wxPlatformInfo
140 static wxString
GetOperatingSystemIdName(wxOperatingSystemId os
) const;
141 wxString
GetOperatingSystemIdName() const;
146 Returns the wxWidgets port ID associated with this wxPlatformInfo instance.
148 static wxPortId
GetPortId(const wxString
& portname
) const;
149 wxPortId
GetPortId() const;
154 Returns the name of the wxWidgets port ID associated with this wxPlatformInfo
157 static wxString
GetPortIdName(wxPortId port
, bool usingUniversal
) const;
158 wxString
GetPortIdName() const;
163 Returns the short name of the wxWidgets port ID associated with this
164 wxPlatformInfo instance.
166 static wxString
GetPortIdShortName(wxPortId port
,
167 bool usingUniversal
) const;
168 wxString
GetPortIdShortName() const;
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.
178 @see CheckToolkitVersion()
180 int GetToolkitMajorVersion() const;
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.
189 @see CheckToolkitVersion()
191 int GetToolkitMinorVersion() const;
194 Returns @true if this instance is fully initialized with valid values.
199 Returns @true if this wxPlatformInfo describes wxUniversal build.
201 bool IsUsingUniversalWidgets() const;
204 Sets the architecture enum value associated with this wxPlatformInfo instance.
206 void SetArchitecture(wxArchitecture n
);
209 Sets the endianness enum value associated with this wxPlatformInfo instance.
211 void SetEndianness(wxEndianness n
);
214 Sets the version of the operating system associated with this wxPlatformInfo
217 void SetOSVersion(int major
, int minor
);
220 Sets the operating system associated with this wxPlatformInfo instance.
222 void SetOperatingSystemId(wxOperatingSystemId n
);
225 Sets the wxWidgets port ID associated with this wxPlatformInfo instance.
227 void SetPortId(wxPortId n
);
230 Sets the version of the toolkit associated with this wxPlatformInfo instance.
232 void SetToolkitVersion(int major
, int minor
);
235 Inequality operator. Tests all class' internal variables.
237 bool operator!=(const wxPlatformInfo
& t
) const;
240 Equality operator. Tests all class' internal variables.
242 bool operator==(const wxPlatformInfo
& t
) const;