Enroute Flight Navigation
A navigation app for VFR pilots
PlatformAdaptor_Android.h
1/***************************************************************************
2 * Copyright (C) 2019-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#include <QTimer>
25#include <QtGlobal>
26
27#include "platform/PlatformAdaptor_Abstract.h"
28
29namespace Platform {
30
32
33
35{
36 Q_OBJECT
37 QML_ELEMENT
38 QML_SINGLETON
39
40public:
45 explicit PlatformAdaptor(QObject *parent = nullptr);
46
47 // No default constructor, important for QML singleton
48 explicit PlatformAdaptor() = delete;
49
50 // factory function for QML singleton
51 static Platform::PlatformAdaptor* create(QQmlEngine* /*unused*/, QJSEngine* /*unused*/)
52 {
54 }
55
56 ~PlatformAdaptor() override = default;
57
58
59 //
60 // Methods
61 //
62
67 QString currentSSID() override;
68
70 void disableScreenSaver() override;
71
76 void lockWifi(bool lock) override;
77
82 void openSatView(const QGeoCoordinate& coordinate) override;
83
88 QString systemInfo() override;
89
91 void vibrateBrief() override;
92
94 void vibrateLong() override;
95
97 void onGUISetupCompleted() override;
98
99
100protected:
102 void deferredInitialization() override;
103
104private:
105 Q_DISABLE_COPY_MOVE(PlatformAdaptor)
106
107 bool splashScreenHidden {false};
108};
109
110} // namespace Platform
static Q_INVOKABLE Platform::PlatformAdaptor * platformAdaptor()
Pointer to appplication-wide static PlatformAdaptor instance.
Interface to platform-specific functionality.
Implementation of PlatformAdaptor for Android devices.
void onGUISetupCompleted() override
Implements a pure virtual method from PlatformAdaptor_Abstract.
void deferredInitialization() override
Re-implements a virtual method from PlatformAdaptor_Abstract.
void vibrateLong() override
Implements a pure virtual method from PlatformAdaptor_Abstract.
PlatformAdaptor(QObject *parent=nullptr)
Standard constructor.
QString systemInfo() override
Information about the system, in HTML format.
void openSatView(const QGeoCoordinate &coordinate) override
Re-implements a virtual method from PlatformAdaptor_Abstract.
void disableScreenSaver() override
Implements a pure virtual method from PlatformAdaptor_Abstract.
void lockWifi(bool lock) override
Implements s pure virtual method from PlatformAdaptor_Abstract.
QString currentSSID() override
Implements a pure virtual method from PlatformAdaptor_Abstract.
void vibrateBrief() override
Implements a pure virtual method from PlatformAdaptor_Abstract.