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