MapItemListDialog: add airspace ack button (#2139)
[xcsoar.git] / src / Asset.hpp
blobe0ba36aec3d9f1a794f17dfbbc00d0f5e7a4091f
1 /*
2 Copyright_License {
4 XCSoar Glide Computer - http://www.xcsoar.org/
5 Copyright (C) 2000-2013 The XCSoar Project
6 A detailed list of copyright holders can be found in the file "AUTHORS".
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 as published by the Free Software Foundation; either version 2
11 of the License, or (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 #ifndef ASSET_H
24 #define ASSET_H
26 #include "Hardware/ModelType.hpp"
27 #include "Compiler.h"
29 #include <tchar.h>
31 // asset/registration data
32 extern TCHAR asset_number[];
34 /**
35 * Finds the unique ID of this PDA
37 void ReadAssetNumber();
39 // model info
40 #ifdef HAVE_MODEL_TYPE
42 extern ModelType global_model_type;
44 #else
46 #define global_model_type ModelType::GENERIC
48 #endif
50 /**
51 * Returns whether this is a debug build.
53 constexpr
54 static inline bool
55 IsDebug()
57 #ifdef NDEBUG
58 return false;
59 #else
60 return true;
61 #endif
64 /**
65 * Returns whether the application is running on an embedded platform.
66 * @return True if host hardware is an embedded platform, False otherwise
68 constexpr
69 static inline bool
70 IsEmbedded()
72 #if defined(_WIN32_WCE) || defined(ANDROID)
73 return true;
74 #else
75 return false;
76 #endif
79 /**
80 * Returns whether the application is running on Pocket PC / Windows
81 * CE / Windows Mobile.
83 constexpr
84 static inline bool
85 IsWindowsCE()
87 #ifdef _WIN32_WCE
88 return true;
89 #else
90 return false;
91 #endif
94 /**
95 * Returns whether the application is running on an old version of
96 * Windows CE (pre 5.0). Starting with version 5.0, several bug
97 * workarounds are disabled at compile time.
99 constexpr
100 static inline bool
101 IsOldWindowsCE()
103 #if defined(_WIN32_WCE) && _WIN32_WCE < 0x0500
104 return true;
105 #else
106 return false;
107 #endif
111 * Is XCSoar running on ancient and slow hardware? If yes, then some
112 * expensive UI features are disabled.
114 constexpr
115 static inline bool
116 IsAncientHardware()
118 #if defined(_WIN32_WCE) && _WIN32_WCE < 0x0400
119 /* Windows CE 3.0 (PPC2000 & PPC2002) */
120 return true;
121 #else
122 /* we assume that all other platforms are fast enough */
123 return false;
124 #endif
128 * Returns whether the application is running on a HP31x
129 * @return True if host hardware is a HP31x, False otherwise
131 static inline bool
132 IsHP31X()
134 return global_model_type == ModelType::HP31X;
138 * Returns whether the application is running on an Altair
139 * @return True if host hardware is an Altair, False otherwise
141 constexpr
142 static inline bool
143 IsAltair()
145 #if defined(GNAV)
146 return true;
147 #else
148 return false;
149 #endif
153 * Returns whether the application is running on Android
155 constexpr
156 static inline bool
157 IsAndroid()
159 #if defined(ANDROID)
160 return true;
161 #else
162 return false;
163 #endif
167 * Does this device have little main memory? On those, some expensive
168 * features are disabled.
170 constexpr
171 static inline bool
172 HasLittleMemory()
174 return IsAncientHardware() || IsAltair();
178 * Returns whether the application is compiled with IOIOLib
180 constexpr
181 static inline bool
182 HasIOIOLib()
184 #ifdef IOIOLIB
185 return true;
186 #else
187 return false;
188 #endif
192 * Does this device have a pointer device? (mouse or touch screen)
193 * @return True if a touch screen or mouse is assumed for the hardware
194 * that XCSoar is running on, False if the hardware has only buttons
196 constexpr
197 static inline bool
198 HasPointer()
200 return !IsAltair();
204 * Does this device have a touch screen? This is useful to know for
205 * sizing controls, as a touch screen may require bigger areas.
207 constexpr
208 static inline bool
209 HasTouchScreen()
211 return IsAndroid() || (IsWindowsCE() && !IsAltair());
215 * Does this device have a keyboard device?
216 * @return True if a keyboard is assumed for the hardware
217 * that XCSoar is running on, False if the hardware has no keyboard
219 constexpr
220 static inline bool
221 HasKeyboard()
223 return !IsEmbedded();
227 * Does this device have a display with colors?
229 * XXX not yet implemented!
231 constexpr
232 static inline bool
233 HasColors()
235 return true;
238 #endif