6 #ifndef SWIFT_MISC_SIMULATION_SIMULATORINFO_H
7 #define SWIFT_MISC_SIMULATION_SIMULATORINFO_H
11 #include <QJsonObject>
16 #include <QStringList>
26 namespace swift::misc::simulation
55 AllFsFamily =
FSX | FS9 | P3D | MSFS | MSFS2024,
56 All =
FSX | FS9 | XPLANE | P3D | FG | MSFS | MSFS2024
58 Q_DECLARE_FLAGS(Simulator, SimulatorFlag)
61 static constexpr
int NumberOfSimulators = 7;
79 CSimulatorInfo(
bool isFSX,
bool isFS9,
bool xp,
bool isP3D,
bool fg,
bool msfs,
bool msfs2024);
82 bool isUnspecified() const;
91 bool isXPlane() const;
103 bool isMSFS2024() const;
106 bool isAnySimulator() const;
109 bool isSingleSimulator() const;
112 bool isNoSimulator() const;
115 bool isMultipleSimulators() const;
118 bool isAllSimulators() const;
121 bool isMicrosoftSimulator() const;
124 bool isMicrosoftOrPrepare3DSimulator() const;
127 bool isFsxP3DFamily() const;
130 int numberSimulators() const;
143 Simulator getSimulator()
const {
return static_cast<Simulator
>(m_simulator); }
161 QString convertToQString(
bool i18n =
false)
const;
170 QSet<CSimulatorInfo> asSingleSimulatorSet()
const;
173 void invertSimulators();
179 static Simulator boolToFlag(
bool isFSX,
bool isFS9,
bool xp,
bool isP3D,
bool fg,
bool msfs,
bool msfs2024);
182 static Simulator identifierToSimulator(
const QString &identifier);
188 static const QStringList &allSimulatorStrings();
191 static const QSet<CSimulatorInfo> &allSimulatorsSet();
203 static CSimulatorInfo fromDatabaseJson(
const QJsonObject &json,
const QString &prefix);
245 int m_simulator =
static_cast<int>(None);
263 int getCountForUnknownSimulators()
const;
266 int getCountForFsFamilySimulators()
const;
269 int getCountForFsxFamilySimulators()
const;
278 int getMaximum()
const;
281 int getMinimum()
const;
284 int simulatorsRepresented()
const;
287 QMultiMap<int, CSimulatorInfo> countPerSimulator()
const;
290 QString toQString()
const;
301 Q_DECLARE_OPERATORS_FOR_FLAGS(swift::misc::simulation::CSimulatorInfo::Simulator)
IconIndex
Index for each icon, allows to send them via DBus, efficiently store them, etc.
Non-owning reference to a CPropertyIndex with a subset of its features.
Streamable status message, e.g.
Mix of the most commonly used mixin classes.
Count per simulator, small utility class allows to retrieve values as per simulator.
Simple hardcoded info about the corresponding simulator.
void addSimulator(Simulator s)
Add simulator flags.
void addSimulator(const CSimulatorInfo &simulatorInfo)
Add simulator.
Simulator getSimulator() const
Simulator.
static const CSimulatorInfo & msfs()
Const simulator info objects.
static const CSimulatorInfo & fs9()
Const simulator info objects.
static const CSimulatorInfo & fsx()
Const simulator info objects.
static const CSimulatorInfo & p3d()
Const simulator info objects.
static const CSimulatorInfo & xplane()
Const simulator info objects.
static const CSimulatorInfo & msfs2024()
Const simulator info objects.
void setSimulator(Simulator s)
Simulator.
void setAllSimulators()
All simulators.
static const CSimulatorInfo & fg()
Const simulator info objects.
Utility classes for FSX, OS and driver independent code.
#define SWIFT_MISC_EXPORT
Export a class or function from the library.
#define SWIFT_DECLARE_VALUEOBJECT_MIXINS(Namespace, Class)
Explicit template declaration of mixins for a CValueObject subclass to be placed near the top of the ...