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 Navigation
44{
45class Clock;
46class Navigator;
47} // namespace Navigation
48
49namespace NOTAM
50{
51class NOTAMProvider;
52} // namespace NOTAM
53
54namespace Notifications
55{
57} // namespace Notifications
58
59namespace Traffic
60{
61class FlarmnetDB;
62class PasswordDB;
64} // namespace Traffic
65
66namespace Platform
67{
68class FileExchange;
69class PlatformAdaptor;
70} // namespace Platform
71
72namespace Positioning
73{
75} // namespace Positioning
76
77namespace Weather
78{
79class WeatherDataProvider;
80} // namespace Weather
81
104
105class GlobalObject : public QObject
106{
107 Q_OBJECT
108
109public:
114 explicit GlobalObject(QObject *parent = nullptr);
115
121 ~GlobalObject() override = default;
122
127 static void clear();
128
138 Q_INVOKABLE static bool canConstruct();
139
144 Q_INVOKABLE static Navigation::Clock* clock();
145
151
156 Q_INVOKABLE static DemoRunner* demoRunner();
157
162 Q_INVOKABLE static Traffic::FlarmnetDB* flarmnetDB();
163
169
176
181 Q_INVOKABLE static GlobalSettings* globalSettings();
182
187 Q_INVOKABLE static Librarian* librarian();
188
194
199 Q_INVOKABLE static Sensors* sensors();
200
205 Q_INVOKABLE static Navigation::Navigator* navigator();
206
211 Q_INVOKABLE static Traffic::PasswordDB* passwordDB();
212
218
223 Q_INVOKABLE static NOTAM::NOTAMProvider* notamProvider();
224
230
235 Q_INVOKABLE static QNetworkAccessManager* networkAccessManager();
236
242
248
254
260
261protected:
270 {
271 ;
272 }
273
274private:
275 Q_DISABLE_COPY_MOVE(GlobalObject)
276
277 template <typename T>
278 static auto allocateInternal(QPointer<T> &pointer) -> T *;
279};
Manages the list of geographic maps.
Definition DataManager.h:71
Remote controls the app and takes screenshot images.
Definition DemoRunner.h:38
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 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.