Enroute Flight Navigation
A navigation app for VFR pilots
GlobalObject.h
1/***************************************************************************
2 * Copyright (C) 2021-2025 by Stefan Kebekus *
3 * stefan.kebekus@gmail.com *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 3 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
20
21#pragma once
22
23#include <QObject>
24
25class DemoRunner;
26class GlobalSettings;
27class Librarian;
28class QNetworkAccessManager;
29class Sensors;
30
31namespace DataManagement
32{
33class DataManager;
34class SSLErrorHandler;
35} // namespace DataManagement
36
37namespace GeoMaps
38{
39class GeoMapProvider;
40class WaypointLibrary;
41} // namespace GeoMaps
42
43namespace Flightlog
44{
45class FlightLog;
46} // namespace Flightlog
47
48namespace Navigation
49{
50class Clock;
51class Navigator;
52} // namespace Navigation
53
54namespace NOTAM
55{
56class NOTAMProvider;
57} // namespace NOTAM
58
59namespace Notifications
60{
62} // namespace Notifications
63
64namespace Traffic
65{
66class FlarmnetDB;
67class PasswordDB;
69} // namespace Traffic
70
71namespace Platform
72{
73class FileExchange;
74class PlatformAdaptor;
75} // namespace Platform
76
77namespace Positioning
78{
80} // namespace Positioning
81
82namespace Weather
83{
84class WeatherDataProvider;
85} // namespace Weather
86
109
110class GlobalObject : public QObject
111{
112 Q_OBJECT
113
114public:
119 explicit GlobalObject(QObject *parent = nullptr);
120
126 ~GlobalObject() override = default;
127
132 static void clear();
133
143 Q_INVOKABLE static bool canConstruct();
144
149 Q_INVOKABLE static Navigation::Clock* clock();
150
156
161 Q_INVOKABLE static DemoRunner* demoRunner();
162
167 Q_INVOKABLE static Traffic::FlarmnetDB* flarmnetDB();
168
174
179 Q_INVOKABLE static Flightlog::FlightLog* flightLog();
180
187
192 Q_INVOKABLE static GlobalSettings* globalSettings();
193
198 Q_INVOKABLE static Librarian* librarian();
199
205
210 Q_INVOKABLE static Sensors* sensors();
211
216 Q_INVOKABLE static Navigation::Navigator* navigator();
217
222 Q_INVOKABLE static Traffic::PasswordDB* passwordDB();
223
229
234 Q_INVOKABLE static NOTAM::NOTAMProvider* notamProvider();
235
241
246 Q_INVOKABLE static QNetworkAccessManager* networkAccessManager();
247
253
259
265
271
272protected:
281 {
282 ;
283 }
284
285private:
286 Q_DISABLE_COPY_MOVE(GlobalObject)
287
288 template <typename T>
289 static auto allocateInternal(QPointer<T> &pointer) -> T *;
290};
Manages the list of geographic maps.
Definition DataManager.h:73
Remote controls the app and takes screenshot images.
Definition DemoRunner.h:38
Flight log manager with pluggable automatic flight detection.
Definition FlightLog.h:53
Provides geographic information.
Library of user-defined waypoints.
Base class for global singleton objects.
static Q_INVOKABLE bool canConstruct()
Indicates if the static methods are ready to be used.
static Q_INVOKABLE Traffic::PasswordDB * passwordDB()
Pointer to appplication-wide static PasswordDB instance.
static Q_INVOKABLE GeoMaps::WaypointLibrary * waypointLibrary()
Pointer to appplication-wide static WaypointLibrary instance.
static Q_INVOKABLE Platform::PlatformAdaptor * platformAdaptor()
Pointer to appplication-wide static PlatformAdaptor instance.
static Q_INVOKABLE GeoMaps::GeoMapProvider * geoMapProvider()
Pointer to appplication-wide static GeoMaps::GeoMapProvider instance.
static Q_INVOKABLE Librarian * librarian()
Pointer to appplication-wide static librarian instance.
static Q_INVOKABLE Navigation::Navigator * navigator()
Pointer to appplication-wide static Navigation::Navigator instance.
static Q_INVOKABLE Positioning::PositionProvider * positionProvider()
Pointer to appplication-wide static PositionProvider instance.
static Q_INVOKABLE DataManagement::DataManager * dataManager()
Pointer to appplication-wide static GeoMaps::DataManager instance.
static Q_INVOKABLE Platform::FileExchange * fileExchange()
Pointer to appplication-wide static FileExchange instance.
static Q_INVOKABLE Sensors * sensors()
Pointer to appplication-wide static Navigation::Clock instance.
~GlobalObject() override=default
Standard deconstructor.
static Q_INVOKABLE Notifications::NotificationManager * notificationManager()
Pointer to appplication-wide static notification manager instance.
static Q_INVOKABLE DataManagement::SSLErrorHandler * sslErrorHandler()
Pointer to appplication-wide static QNetworkAccessManager instance.
static Q_INVOKABLE DemoRunner * demoRunner()
Pointer to appplication-wide static DemoRunner instance.
static Q_INVOKABLE Weather::WeatherDataProvider * weatherDataProvider()
Pointer to appplication-wide static WeatherDataProvider instance.
GlobalObject(QObject *parent=nullptr)
Standard constructor.
static Q_INVOKABLE Flightlog::FlightLog * flightLog()
Pointer to appplication-wide static FlightLog instance.
static Q_INVOKABLE Traffic::TrafficDataProvider * trafficDataProvider()
Pointer to appplication-wide static TrafficDataProvider instance.
static Q_INVOKABLE Traffic::FlarmnetDB * flarmnetDB()
Pointer to appplication-wide static FlarmnetDB instance.
static Q_INVOKABLE Navigation::Clock * clock()
Pointer to appplication-wide static Navigation::Clock instance.
virtual void deferredInitialization()
Non-constructor initialization.
static Q_INVOKABLE NOTAM::NOTAMProvider * notamProvider()
Pointer to appplication-wide static notification manager instance.
static void clear()
Deletes all globally defined objects.
static Q_INVOKABLE QNetworkAccessManager * networkAccessManager()
Pointer to appplication-wide static QNetworkAccessManager instance.
static Q_INVOKABLE GlobalSettings * globalSettings()
Pointer to appplication-wide static Settings instance.
Global Settings Manager.
Manage libraries and text assets.
Definition Librarian.h:39
Manage NOTAM data and download NOTAM data from the FAA if required.
This extremely simple class give accss to time and offers a few time-related functions.
Definition Clock.h:39
Main hub for navigation data.
Definition Navigator.h:43
This class manages notifications and presents them to the GUI.
Implementation of FileExchange for Android devices.
Implementation of PlatformAdaptor for Android devices.
Central Position Provider.
Sensor data.
Definition Sensors.h:43
Flarmnet database.
Definition FlarmnetDB.h:37
Password database.
Definition PasswordDB.h:37
WeatherDataProvider, weather service manager.