swift
aircraftmodelloaderprovider.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (C) 2015 swift Project Community / Contributors
2 // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3 
5 
6 #ifndef SWIFT_MISC_SIMULATION_IAIRCRAFTMODELLOADERPROVIDER_H
7 #define SWIFT_MISC_SIMULATION_IAIRCRAFTMODELLOADERPROVIDER_H
8 
10 
11 namespace swift::misc::simulation
12 {
17  {
18  Q_OBJECT
19 
20  public:
22  static IAircraftModelLoader *createModelLoader(const CSimulatorInfo &simulator, QObject *parent = nullptr);
23 
25  IAircraftModelLoader *loaderInstance(const CSimulatorInfo &simulator);
26 
28  static CMultiAircraftModelLoaderProvider &multiModelLoaderInstance();
29 
32  IAircraftModelLoader *modelLoaderP3D() const { return m_loaderP3D; }
33  IAircraftModelLoader *modelLoaderXP() const { return m_loaderXP; }
34  IAircraftModelLoader *modelLoaderFG() const { return m_loaderFG; }
35  IAircraftModelLoader *modelLoaderMsfs() const { return m_loaderMsfs; }
37 
38  signals:
40  void loadingFinished(const swift::misc::CStatusMessageList &status, const CSimulatorInfo &simulator,
42 
44  void diskLoadingStarted(const CSimulatorInfo &simulator, IAircraftModelLoader::LoadMode mode);
45 
47  void loadingProgress(const CSimulatorInfo &simulator, const QString &message, int progressPercentage);
48 
50  void cacheChanged(const CSimulatorInfo &simulator);
51 
52  private:
53  IAircraftModelLoader *m_loaderP3D = nullptr;
54  IAircraftModelLoader *m_loaderXP = nullptr;
55  IAircraftModelLoader *m_loaderFG = nullptr;
56  IAircraftModelLoader *m_loaderMsfs = nullptr;
57  IAircraftModelLoader *m_loaderMsfs2024 = nullptr;
58 
60  IAircraftModelLoader *initLoader(const CSimulatorInfo &simulator);
61  };
62 } // namespace swift::misc::simulation
63 
64 #endif // SWIFT_MISC_SIMULATION_IAIRCRAFTMODELLOADERPROVIDER_H
Status messages, e.g. from Core -> GUI.
Single instances of all model loaders (lazy init)
IAircraftModelLoader * modelLoaderMsfs() const
Simulator specific loaders.
IAircraftModelLoader * modelLoaderFG() const
Simulator specific loaders.
void diskLoadingStarted(const CSimulatorInfo &simulator, IAircraftModelLoader::LoadMode mode)
Disk loading started.
void cacheChanged(const CSimulatorInfo &simulator)
Relayed from centralized caches.
void loadingFinished(const swift::misc::CStatusMessageList &status, const CSimulatorInfo &simulator, IAircraftModelLoader::LoadFinishedInfo info)
Parsing is finished or cache has been loaded.
IAircraftModelLoader * modelLoaderP3D() const
Simulator specific loaders.
IAircraftModelLoader * modelLoaderXP() const
Simulator specific loaders.
void loadingProgress(const CSimulatorInfo &simulator, const QString &message, int progressPercentage)
Loading progress, normally from disk.
Simple hardcoded info about the corresponding simulator.
Definition: simulatorinfo.h:41
Load the aircraft for a simulator.
#define SWIFT_MISC_EXPORT
Export a class or function from the library.