Enroute Flight Navigation
A navigation app for VFR pilots
PlatformAdaptor_Abstract.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 <QGeoCoordinate>
24#include <QQmlEngine>
25#include <QQuickItem>
26
27#include "GlobalObject.h"
28
29
30namespace Platform {
31
51
53{
54 Q_OBJECT
55
56public:
61 explicit PlatformAdaptor_Abstract(QObject* parent = nullptr);
62
63 ~PlatformAdaptor_Abstract() override = default;
64
65
66 //
67 // Methods
68 //
69
74 Q_INVOKABLE static QString clipboardText();
75
81 Q_INVOKABLE static bool setClipboardText(const QString& text);
82
89 Q_INVOKABLE virtual QString currentSSID() { return {}; }
90
98 Q_INVOKABLE virtual void disableScreenSaver() {}
99
112 Q_INVOKABLE virtual void lockWifi(bool lock) { Q_UNUSED(lock) }
113
123 Q_INVOKABLE virtual void openSatView(const QGeoCoordinate& coordinate);
124
138 Q_INVOKABLE virtual void setupInputMethodEventFilter(QQuickItem* item) { Q_UNUSED(item) }
139
144 Q_INVOKABLE virtual QString systemInfo();
145
151 Q_INVOKABLE virtual void vibrateBrief() {}
152
159 Q_INVOKABLE virtual void vibrateLong() {}
160
166 Q_INVOKABLE virtual QString language();
167
176 Q_INVOKABLE static void saveScreenshot(const QImage& image, const QString& path);
177
178public slots:
187 virtual void onGUISetupCompleted() {}
188
189
190signals:
198 void error(const QString& message);
199
206
212
219
220private:
221 Q_DISABLE_COPY_MOVE(PlatformAdaptor_Abstract)
222
223};
224
225} // namespace Platform
GlobalObject(QObject *parent=nullptr)
Standard constructor.
virtual Q_INVOKABLE void vibrateBrief()
Make the device briefly vibrate.
static Q_INVOKABLE void saveScreenshot(const QImage &image, const QString &path)
Save image as a raster graphic file in path.
virtual void onGUISetupCompleted()
Signal handler: GUI setup completed.
void serialPortsChanged()
Emitted when a serial port configuration changes.
virtual Q_INVOKABLE void disableScreenSaver()
Disable the screen saver.
void wifiConnected()
Emitted when a new WiFi connections becomes available.
void error(const QString &message)
Emitted when an error occurs.
virtual Q_INVOKABLE void setupInputMethodEventFilter(QQuickItem *item)
Workaround for QTBUG-80790.
virtual Q_INVOKABLE void vibrateLong()
Make the device vibrate for a longer period.
virtual Q_INVOKABLE QString language()
Language code that is to be used in the GUI.
PlatformAdaptor_Abstract(QObject *parent=nullptr)
Standard constructor.
virtual Q_INVOKABLE QString systemInfo()
Information about the system, in HTML format.
virtual Q_INVOKABLE QString currentSSID()
SSID of current Wi-Fi network.
static Q_INVOKABLE QString clipboardText()
Content of ClipBoard.
virtual Q_INVOKABLE void lockWifi(bool lock)
Lock connection to Wi-Fi network.
static Q_INVOKABLE bool setClipboardText(const QString &text)
Set text content to ClipBoard.
virtual Q_INVOKABLE void openSatView(const QGeoCoordinate &coordinate)
Open an external app or web site showing a satellite view.
void languageChanged()
Emitted when the OS requests a language change.