2023-09-06 22:20:59 +05:00
|
|
|
#ifndef SYSTEMCONTROLLER_H
|
|
|
|
|
#define SYSTEMCONTROLLER_H
|
|
|
|
|
|
2026-05-15 09:57:44 +03:00
|
|
|
#include <QByteArray>
|
2023-09-06 22:20:59 +05:00
|
|
|
#include <QObject>
|
|
|
|
|
|
|
|
|
|
class SystemController : public QObject
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
2026-04-30 14:53:03 +08:00
|
|
|
explicit SystemController(QObject *parent = nullptr);
|
2023-09-06 22:20:59 +05:00
|
|
|
|
2026-05-15 09:57:44 +03:00
|
|
|
static bool saveFile(const QString &fileName, const QString &data);
|
|
|
|
|
static bool saveFile(const QString &fileName, const QByteArray &data);
|
2024-12-31 04:16:52 +01:00
|
|
|
static bool readFile(const QString &fileName, QByteArray &data);
|
|
|
|
|
static bool readFile(const QString &fileName, QString &data);
|
2023-09-07 22:45:01 +05:00
|
|
|
|
2023-09-06 22:20:59 +05:00
|
|
|
public slots:
|
2023-09-07 22:45:01 +05:00
|
|
|
QString getFileName(const QString &acceptLabel, const QString &nameFilter, const QString &selectedFile = "",
|
|
|
|
|
const bool isSaveMode = false, const QString &defaultSuffix = "");
|
2023-09-06 22:20:59 +05:00
|
|
|
|
|
|
|
|
void setQmlRoot(QObject *qmlRoot);
|
|
|
|
|
|
2024-09-09 14:36:33 +03:00
|
|
|
bool isAuthenticated();
|
2024-12-31 04:16:52 +01:00
|
|
|
void sendTouch(float x, float y);
|
|
|
|
|
|
2023-09-06 22:20:59 +05:00
|
|
|
signals:
|
2023-09-07 22:45:01 +05:00
|
|
|
void fileDialogClosed(const bool isAccepted);
|
2023-09-06 22:20:59 +05:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
QObject *m_qmlRoot;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // SYSTEMCONTROLLER_H
|