Subversion Repositories tpanel

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 andreas 1
/*
258 andreas 2
 * Copyright (C) 2020 to 2023 by Andreas Theofilu <andreas@theosys.at>
2 andreas 3
 *
4
 * This program is free software; you can redistribute it and/or modify
5
 * it under the terms of the GNU General Public License as published by
6
 * the Free Software Foundation; either version 3 of the License, or
7
 * (at your option) any later version.
8
 *
9
 * This program is distributed in the hope that it will be useful,
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 * GNU General Public License for more details.
13
 *
14
 * You should have received a copy of the GNU General Public License
15
 * along with this program; if not, write to the Free Software Foundation,
16
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
17
 */
18
#ifndef __TQTMAIN_H__
19
#define __TQTMAIN_H__
20
 
21
#include <QMainWindow>
14 andreas 22
#include <QMetaType>
264 andreas 23
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
252 andreas 24
#include <QGeoPositionInfoSource>
254 andreas 25
#endif
3 andreas 26
#include "tpagemanager.h"
5 andreas 27
#include "tobject.h"
61 andreas 28
#include "tqemitqueue.h"
279 andreas 29
#include "tpagelist.h"
323 andreas 30
#include "tqgesturefilter.h"
2 andreas 31
 
21 andreas 32
extern bool prg_stopped;
34 andreas 33
extern std::atomic<bool> killed;
21 andreas 34
 
2 andreas 35
QT_BEGIN_NAMESPACE
36
class QAction;
37
class QMenu;
38
class QSessionManager;
5 andreas 39
class QLabel;
40
class QWidget;
14 andreas 41
class QByteArray;
10 andreas 42
class QMouseEvent;
15 andreas 43
class QMoveEvent;
190 andreas 44
class QGestureEvent;
15 andreas 45
class QEvent;
141 andreas 46
class QSound;
47
class QMediaPlayer;
254 andreas 48
class QOrientationSensor;
264 andreas 49
class QStackedWidget;
289 andreas 50
class QListWidgetItem;
254 andreas 51
#ifdef Q_OS_IOS
252 andreas 52
class QGeoPositionInfo;
254 andreas 53
#endif
264 andreas 54
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
181 andreas 55
class QAudioOutput;
56
#endif
23 andreas 57
class TQtSettings;
63 andreas 58
class TQKeyboard;
59
class TQKeypad;
120 andreas 60
class TQBusy;
179 andreas 61
class TqDownload;
140 andreas 62
class TQtPhone;
289 andreas 63
class TBitmap;
296 andreas 64
class TQScrollArea;
2 andreas 65
QT_END_NAMESPACE
247 andreas 66
#ifdef Q_OS_IOS
67
class TIOSBattery;
252 andreas 68
class TIOSRotate;
247 andreas 69
#endif
260 andreas 70
class TQtWait;
2 andreas 71
 
14 andreas 72
Q_DECLARE_METATYPE(size_t)
73
 
3 andreas 74
int qtmain(int argc, char **argv, TPageManager *pmanager);
2 andreas 75
 
277 andreas 76
class MainWindow : public QMainWindow, TQManageQueue, public TObject
2 andreas 77
{
14 andreas 78
    Q_OBJECT
2 andreas 79
 
5 andreas 80
    public:
88 andreas 81
        typedef enum J_ORIENTATION
82
        {
83
            O_UNDEFINED = -1,
84
            O_LANDSCAPE = 0,
130 andreas 85
            O_PORTRAIT = 1,
86
            O_REVERSE_LANDSCAPE = 8,
134 andreas 87
            O_REVERSE_PORTRAIT = 9,
88
            O_FACE_UP = 15,
89
            O_FACE_DOWN = 16
88 andreas 90
        }J_ORIENTATION;
91
 
5 andreas 92
        MainWindow();
34 andreas 93
        ~MainWindow();
22 andreas 94
        void setConfigFile(const std::string& file) { mFileConfig = file; }
23 andreas 95
        void setSetChange(bool state) { settingsChanged = state; }
38 andreas 96
        void setScaleFactor(double scale) { mScaleFactor = scale; }
198 andreas 97
        void setSetupScaleFactor(double scale) { mSetupScaleFactor = scale; }
38 andreas 98
        double getScaleFactor() { return mScaleFactor; }
264 andreas 99
        void setOrientation(Qt::ScreenOrientation ori) { mOrientation = ori; }
296 andreas 100
        void disconnectArea(TQScrollArea *area);
101
        void disconnectList(QListWidget *list);
297 andreas 102
        void reconnectArea(TQScrollArea *area);
103
        void reconnectList(QListWidget *list);
270 andreas 104
#if defined(QT_DEBUG) && (defined(Q_OS_IOS) || defined(Q_OS_ANDROID))
264 andreas 105
        static std::string orientationToString(Qt::ScreenOrientation ori);
263 andreas 106
#endif
2 andreas 107
 
14 andreas 108
    signals:
298 andreas 109
        void sigDisplayButton(ulong handle, ulong parent, TBitmap buffer, int width, int height, int left, int top, bool passthrough);
289 andreas 110
        void sigDisplayViewButton(ulong handle, ulong parent, bool vertical, TBitmap buffer, int width, int height, int left, int top, int space, TColor::COLOR_T fillColor);
285 andreas 111
        void sigAddViewButtonItems(ulong parent, std::vector<PGSUBVIEWITEM_T> items);
300 andreas 112
        void sigUpdateViewButton(ulong handle, ulong parent, TBitmap buffer, TColor::COLOR_T fillColor);
113
        void sigUpdateViewButtonItem(PGSUBVIEWITEM_T& item, ulong parent);
114
        void sigShowViewButtonItem(ulong handle, ulong parent, int position, int timer);
318 andreas 115
        void sigToggleViewButtonItem(ulong handle, ulong parent, int position, int timer);
116
        void sigHideAllViewItems(ulong handle);
117
        void sigHideViewItem(ulong handle, ulong parent);
118
        void sigSetSubViewPadding(ulong handle, int padding);
98 andreas 119
        void sigSetVisible(ulong handle, bool state);
14 andreas 120
        void sigSetPage(ulong handle, int width, int height);
217 andreas 121
        void sigSetSubPage(ulong handle, ulong parent, int left, int top, int width, int height, ANIMATION_t animate);
263 andreas 122
#ifndef _OPAQUE_SKIA_
289 andreas 123
        void sigSetBackground(ulong handle, TBitmap image, int width, int height, ulong color, int opacity=255);
263 andreas 124
#else
289 andreas 125
        void sigSetBackground(ulong handle, TBitmap image, int width, int height, ulong color);
262 andreas 126
#endif
14 andreas 127
        void sigDropPage(ulong handle);
128
        void sigDropSubPage(ulong handle);
98 andreas 129
        void sigDropButton(ulong handle);
21 andreas 130
        void sigPlayVideo(ulong handle, ulong parent, int left, int top, int width, int height, const std::string& url, const std::string& user, const std::string& pw);
291 andreas 131
        void sigInputText(Button::TButton *button, QByteArray buffer, int width, int height, int frame, size_t pixline);
132
        void sigListBox(Button::TButton *button, QByteArray buffer, int width, int height, int frame, size_t pixline);
63 andreas 133
        void sigKeyboard(const std::string& init, const std::string& prompt, bool priv);
134
        void sigKeypad(const std::string& init, const std::string& prompt, bool priv);
135
        void sigResetKeyboard();
64 andreas 136
        void sigShowSetup();
71 andreas 137
        void sigPlaySound(const std::string& file);
141 andreas 138
        void sigStopSound();
139
        void sigMuteSound(bool state);
111 andreas 140
        void sigSendVirtualKeys(const std::string& str);
140 andreas 141
        void sigShowPhoneDialog(bool state);
142
        void sigSetPhoneNumber(const std::string& number);
143
        void sigSetPhoneStatus(const std::string& msg);
141 andreas 144
        void sigSetPhoneState(int state, int id);
142 andreas 145
        void sigRepaintWindows();
151 andreas 146
        void sigToFront(ulong handle);
206 andreas 147
        void sigDownloadSurface(const std::string& file, size_t size);
179 andreas 148
        void sigOnProgressChanged(int percent);
206 andreas 149
        void sigDisplayMessage(const std::string& msg, const std::string& title);
209 andreas 150
        void sigFileDialog(ulong handle, const std::string& path, const std::string& extension, const std::string& suffix);
197 andreas 151
        void sigSetSizeMainWindow(int width, int height);
260 andreas 152
        void sigStartWait(const std::string& text);
153
        void sigStopWait();
271 andreas 154
        void sigPageFinished(uint handle);
279 andreas 155
        void sigListViewArea(ulong handle, ulong parent, Button::TButton& button, SUBVIEWLIST_T& list);
266 andreas 156
#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
259 andreas 157
        void sigActivateSettings(const std::string& oldNetlinx, int oldPort, int oldChannelID, const std::string& oldSurface, bool oldToolbarSuppress, bool oldToolbarForce);
158
#endif
5 andreas 159
    protected:
57 andreas 160
        bool event(QEvent *event) override;
5 andreas 161
        void closeEvent(QCloseEvent *event) override;
10 andreas 162
        void mousePressEvent(QMouseEvent* event) override;
163
        void mouseReleaseEvent(QMouseEvent* event) override;
311 andreas 164
        void mouseMoveEvent(QMouseEvent* event) override;
319 andreas 165
        void keyPressEvent(QKeyEvent *event) override;
166
        void keyReleaseEvent(QKeyEvent *event) override;
2 andreas 167
 
5 andreas 168
    private slots:
169
        void settings();
170
        void about();
2 andreas 171
#ifndef QT_NO_SESSIONMANAGER
5 andreas 172
        void commitData(QSessionManager &);
2 andreas 173
#endif
298 andreas 174
        void displayButton(ulong handle, ulong parent, TBitmap buffer, int width, int height, int left, int top, bool passthrough);
289 andreas 175
        void displayViewButton(ulong handle, ulong parent, bool vertical, TBitmap buffer, int width, int height, int left, int top, int space, TColor::COLOR_T fillColor);
285 andreas 176
        void addViewButtonItems(ulong parent, std::vector<PGSUBVIEWITEM_T> items);
300 andreas 177
        void updateViewButton(ulong handle, ulong parent, TBitmap buffer, TColor::COLOR_T fillColor);
178
        void updateViewButtonItem(PGSUBVIEWITEM_T& item, ulong parent);
179
        void showViewButtonItem(ulong handle, ulong parent, int position, int timer);
318 andreas 180
        void toggleViewButtonItem(ulong handle, ulong parent, int position, int timer);
181
        void hideAllViewItems(ulong handle);
182
        void hideViewItem(ulong handle, ulong parent);
183
        void setSubViewPadding(ulong handle, int padding);
98 andreas 184
        void SetVisible(ulong handle, bool state);
5 andreas 185
        void setPage(ulong handle, int width, int height);
217 andreas 186
        void setSubPage(ulong hanlde, ulong parent, int left, int top, int width, int height, ANIMATION_t animate);
262 andreas 187
#ifdef _OPAQUE_SKIA_
289 andreas 188
        void setBackground(ulong handle, TBitmap image, int width, int height, ulong color);
262 andreas 189
#else
289 andreas 190
        void setBackground(ulong handle, TBitnap image, int width, int height, ulong color, int opacity=255);
271 andreas 191
#endif  // _OPAQUE_SKIA_
11 andreas 192
        void dropPage(ulong handle);
193
        void dropSubPage(ulong handle);
98 andreas 194
        void dropButton(ulong handle);
21 andreas 195
        void playVideo(ulong handle, ulong parent, int left, int top, int width, int height, const std::string& url, const std::string& user, const std::string& pw);
291 andreas 196
        void inputText(Button::TButton *button, QByteArray buffer, int width, int height, int frame, size_t pixline);
197
        void listBox(Button::TButton *button, QByteArray buffer, int width, int height, int frame, size_t pixline);
63 andreas 198
        void showKeyboard(const std::string& init, const std::string& prompt, bool priv);
199
        void showKeypad(const std::string& init, const std::string& prompt, bool priv);
111 andreas 200
        void sendVirtualKeys(const std::string& str);
63 andreas 201
        void resetKeyboard();
64 andreas 202
        void showSetup();
71 andreas 203
        void playSound(const std::string& file);
141 andreas 204
        void stopSound();
205
        void muteSound(bool state);
213 andreas 206
        void onAppStateChanged(Qt::ApplicationState state);
130 andreas 207
        void onScreenOrientationChanged(Qt::ScreenOrientation ori);
252 andreas 208
        void onCurrentOrientationChanged(int currentOrientation);
266 andreas 209
#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
259 andreas 210
        void activateSettings(const std::string& oldNetlinx, int oldPort, int oldChannelID, const std::string& oldSurface, bool oldToolbarSuppress, bool oldToolbarForce);
254 andreas 211
#ifdef Q_OS_IOS
252 andreas 212
        void onPositionUpdated(const QGeoPositionInfo &update);
213
        void onErrorOccurred(QGeoPositionInfoSource::Error positioningError);
266 andreas 214
#endif  // Q_OS_IOS
215
#endif  // defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
213 andreas 216
        void onTListCallbackCurrentItemChanged(QListWidgetItem *current, QListWidgetItem *previous);
197 andreas 217
        void setSizeMainWindow(int width, int height);
140 andreas 218
        // Slots for the phone dialog
219
        void showPhoneDialog(bool state);
220
        void setPhoneNumber(const std::string& number);
221
        void setPhoneStatus(const std::string& msg);
141 andreas 222
        void setPhoneState(int state, int id);
130 andreas 223
        // Slots for the toolbar buttons.
32 andreas 224
        void arrowLeft();
225
        void arrowRight();
226
        void arrowUp();
227
        void arrowDown();
228
        void selectOk();
33 andreas 229
        void volumeUpPressed();
230
        void volumeUpReleased();
231
        void volumeDownPressed();
232
        void volumeDownReleased();
38 andreas 233
//        void volumeMute();
130 andreas 234
        // Slots for widget actions and button element actions
42 andreas 235
        void animationFinished();
295 andreas 236
        void animationInFinished();
142 andreas 237
        void repaintWindows();
151 andreas 238
        void toFront(ulong handle);
206 andreas 239
        void downloadSurface(const std::string& file, size_t size);
240
        void displayMessage(const std::string& msg, const std::string& title);
209 andreas 241
        void fileDialog(ulong handle, const std::string& path, const std::string& extension, const std::string& suffix);
179 andreas 242
        // Progress bar (busy indicator)
243
        void onProgressChanged(int percent);
260 andreas 244
        void startWait(const std::string& text);
245
        void stopWait();
273 andreas 246
        void pageFinished(ulong handle);
44 andreas 247
 
14 andreas 248
    private:
57 andreas 249
        bool gestureEvent(QGestureEvent *event);
14 andreas 250
        void createActions();
251
        void writeSettings();
31 andreas 252
        void playShowList();
38 andreas 253
        int scale(int value);
198 andreas 254
        int scaleSetup(int value);
259 andreas 255
        bool isScaled();
198 andreas 256
        bool isSetupScaled();
298 andreas 257
        bool startAnimation(TObject::OBJECT_t *obj, ANIMATION_t& ani, bool in = true);
179 andreas 258
        void downloadBar(const std::string& msg, QWidget *parent);
120 andreas 259
        void runEvents();
289 andreas 260
        void onSubViewItemClicked(ulong handle, bool pressed);
303 andreas 261
        void onInputChanged(ulong handle, std::string& text);
309 andreas 262
        void onFocusChanged(ulong handle, bool in);
263
        void onCursorChanged(ulong handle, int oldPos, int newPos);
323 andreas 264
        void onGestureEvent(QObject *obj, QGestureEvent *event);
285 andreas 265
        QPixmap scaleImage(QPixmap& pix);
266
        QPixmap scaleImage(unsigned char *buffer, int width, int height, int pixline);
14 andreas 267
 
298 andreas 268
        void _displayButton(ulong handle, ulong parent, TBitmap buffer, int width, int height, int left, int top, bool passthrough);
289 andreas 269
        void _displayViewButton(ulong handle, ulong parent, bool vertical, TBitmap buffer, int width, int height, int left, int top, int space, TColor::COLOR_T fillColor);
285 andreas 270
        void _addViewButtonItems(ulong parent, std::vector<PGSUBVIEWITEM_T> items);
300 andreas 271
        void _updateViewButton(ulong handle, ulong parent, TBitmap buffer, TColor::COLOR_T fillColor);
272
        void _updateViewButtonItem(PGSUBVIEWITEM_T& item, ulong parent);
273
        void _showViewButtonItem(ulong handle, ulong parent, int position, int timer);
318 andreas 274
        void _toggleViewButtonItem(ulong handle, ulong parent, int position, int timer);
275
        void _hideAllViewItems(ulong handle);
276
        void _hideViewItem(ulong handle, ulong parent);
277
        void _setSubViewPadding(ulong handle, int padding);
98 andreas 278
        void _setVisible(ulong handle, bool state);
14 andreas 279
        void _setPage(ulong handle, int width, int height);
217 andreas 280
        void _setSubPage(ulong handle, ulong parent, int left, int top, int width, int height, ANIMATION_t animate);
262 andreas 281
#ifdef _OPAQUE_SKIA_
289 andreas 282
        void _setBackground(ulong handle, TBitmap image, int width, int height, ulong color);
262 andreas 283
#else
289 andreas 284
        void _setBackground(ulong handle, TBitmap image, int width, int height, ulong color, int opacity=255);
271 andreas 285
#endif  // _OPAQUE_SKIA_
14 andreas 286
        void _dropPage(ulong handle);
287
        void _dropSubPage(ulong handle);
98 andreas 288
        void _dropButton(ulong handle);
21 andreas 289
        void _playVideo(ulong handle, ulong parent, int left, int top, int width, int height, const std::string& url, const std::string& user, const std::string& pw);
291 andreas 290
        void _inputText(Button::TButton *button, Button::BITMAP_t& bm, int frame);
291
        void _listBox(Button::TButton *button, Button::BITMAP_t& bm, int frame);
63 andreas 292
        void _showKeyboard(const std::string& init, const std::string& prompt, bool priv=false);
293
        void _showKeypad(const std::string& init, const std::string& prompt, bool priv=false);
294
        void _resetKeyboard();
64 andreas 295
        void _showSetup();
44 andreas 296
        void _resetSurface();
64 andreas 297
        void _shutdown();
71 andreas 298
        void _playSound(const std::string& file);
141 andreas 299
        void _stopSound();
300
        void _muteSound(bool state);
88 andreas 301
        void _setOrientation(J_ORIENTATION ori);
111 andreas 302
        void _sendVirtualKeys(const std::string& str);
140 andreas 303
        void _showPhoneDialog(bool state);
304
        void _setPhoneNumber(const std::string& number);
305
        void _setPhoneStatus(const std::string& msg);
141 andreas 306
        void _setPhoneState(int state, int id);
179 andreas 307
        void _onProgressChanged(int percent);
206 andreas 308
        void _displayMessage(const std::string& msg, const std::string& title);
209 andreas 309
        void _fileDialog(ulong handle, const std::string& path, const std::string& extension, const std::string& suffix);
197 andreas 310
        void _setSizeMainWindow(int width, int height);
235 andreas 311
#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
93 andreas 312
        void _signalState(Qt::ApplicationState state);
130 andreas 313
        void _orientationChanged(int orientation);
259 andreas 314
        void _activateSettings(const std::string& oldNetlinx, int oldPort, int oldChannelID, const std::string& oldSurface, bool oldToolbarSuppress, bool oldToolbarForce);
264 andreas 315
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
217 andreas 316
        void _freezeWorkaround();
266 andreas 317
#endif  // QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
271 andreas 318
#endif  // defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
142 andreas 319
        void _repaintWindows();
151 andreas 320
        void _toFront(ulong handle);
206 andreas 321
        void _downloadSurface(const std::string& file, size_t size);
260 andreas 322
        void _startWait(const std::string& text);
323
        void _stopWait();
271 andreas 324
        void _pageFinished(uint handle);
279 andreas 325
        void _listViewArea(ulong handle, ulong parent, Button::TButton& button, SUBVIEWLIST_T& list);
70 andreas 326
        void doReleaseButton();
142 andreas 327
        void repaintObjects();
297 andreas 328
        void refresh(ulong handle);
141 andreas 329
        int calcVolume(int value);
224 andreas 330
        std::string convertMask(const std::string& mask);
270 andreas 331
#ifdef Q_OS_ANDROID
266 andreas 332
        void hideAndroidBars();
271 andreas 333
#endif  // Q_OS_ANDROID
252 andreas 334
#ifdef Q_OS_IOS
335
        void setNotch();
336
        void initGeoLocation();
264 andreas 337
        Qt::ScreenOrientation getRealOrientation();
271 andreas 338
#endif  // Q_OS_IOS
70 andreas 339
 
293 andreas 340
        std::mutex draw_mutex;              // We're using threads and need to block execution sometimes
341
        std::mutex click_mutex;
296 andreas 342
        std::mutex anim_mutex;
293 andreas 343
 
142 andreas 344
        bool mWasInactive{false};           // If the application was inactive this is set to true until everything was repainted.
345
        bool mDoRepaint{false};             // This is set to TRUE whenever a reconnection to the controller happened.
23 andreas 346
        TQtSettings *mSettings{nullptr};    // The pointer to the settings dialog
22 andreas 347
        bool settingsChanged{false};        // true = settings have changed
218 andreas 348
 
88 andreas 349
        QToolBar *mToolbar{nullptr};        // The toolbar, if there is any
266 andreas 350
        QStackedWidget *mCentralWidget{nullptr};        // A stacked widget where all pages are stored
264 andreas 351
        bool mCentralInitialized{false};    // True = The central widget and all dependencies are initialized
21 andreas 352
        std::string mVideoURL;              // If the button is a video, this is the URL where it plays from.
22 andreas 353
        std::string mFileConfig;            // Path and file name of the config file
31 andreas 354
        bool mHasFocus{true};               // If this is FALSE, no output to sceen is allowed.
38 andreas 355
        std::atomic<double> mScaleFactor{1.0}; // The actual scale factor
198 andreas 356
        std::atomic<double> mSetupScaleFactor{1.0};     // The scale factor for the setup pages
300 andreas 357
        OBJECT_t *mLastObject{nullptr};     // This is for the hide effect of widgets.
296 andreas 358
        std::map<ulong, OBJECT_t *> mAnimObjects;   // List of started animations
213 andreas 359
        ulong mActualPageHandle{0};         // Holds the handle of the active page.
120 andreas 360
        std::atomic<bool> mBusy{false};     // If TRUE the busy indicator is active
179 andreas 361
        TqDownload *mDownloadBar{nullptr};  // Pointer to a dialog showing a progress bar
63 andreas 362
        TQKeyboard *mQKeyboard{nullptr};    // Pointer to an active virtual keyboard
363
        TQKeypad *mQKeypad{nullptr};        // Pointer to an active virtual keypad
65 andreas 364
        bool mKeyboard{false};              // TRUE = keyboard is visible
365
        bool mKeypad{false};                // TRUE = keypad is visible
140 andreas 366
        TQtPhone *mPhoneDialog{nullptr};    // Points to the internal phone dialog
70 andreas 367
        // Mouse
368
        int mLastPressX{-1};                // Remember the last mouse press X coordinate
369
        int mLastPressY{-1};                // Remember the last mouse press Y coordinate
264 andreas 370
        Qt::ScreenOrientation mOrientation{Qt::PrimaryOrientation};
252 andreas 371
        QOrientationSensor *mSensor{nullptr};   // Basic sensor for orientation
141 andreas 372
        QMediaPlayer *mMediaPlayer{nullptr};// Class to play sound files.
260 andreas 373
        TQtWait *mWaitBox{nullptr};         // This is a wait dialog.
323 andreas 374
        TQGestureFilter *mGestureFilter{nullptr};   // This handles the pinch and swipe gestures
264 andreas 375
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
252 andreas 376
        QGeoPositionInfoSource *mSource{nullptr};   // The geo location is used on IOS to keep app running in background
181 andreas 377
        QAudioOutput *mAudioOutput{nullptr};
378
#endif
247 andreas 379
#ifdef Q_OS_IOS
380
        TIOSBattery *mIosBattery{nullptr};  // Class to retrive the battery status on an iPhone or iPad
252 andreas 381
        TIOSRotate *mIosRotate{nullptr};    // Class to control rotation
259 andreas 382
        bool mIOSSettingsActive{false};     // TRUE: IOS settings are active.
263 andreas 383
        QMargins mNotchPortrait;            // The margins (notch, if any) for portrait orientation
384
        QMargins mNotchLandscape;           // The margins (notch, if any) for landscape orientation
385
        bool mHaveNotchPortrait{false};     // TRUE = Notch was already fetched for portrait orientation
386
        bool mHaveNotchLandscape{false};    // TRUE = Notch was already fetched for landscape orientation
247 andreas 387
#endif
213 andreas 388
        std::chrono::steady_clock::time_point mTouchStart;  // Time in micro seconds of the start of a touch event
153 andreas 389
        int mTouchX{0};                        // The X coordinate of the mouse pointer
390
        int mTouchY{0};                        // The Y coordinate of the mouse pointer
2 andreas 391
};
392
 
393
#endif