Newer
Older
#pragma once
#include <QGeoCoordinate>
#include <QObject>
#include <memory>
class TileData;
class NemoInterface : public QObject {
Q_OBJECT
class Impl;
using PImpl = std::unique_ptr<Impl>;
NemoInterface();
NemoInterface(NemoInterface &other) = delete;
static NemoInterface *createInstance();
~NemoInterface() override;
static NemoInterface *instance();
enum class STATUS {
NOT_CONNECTED = 0,
HEARTBEAT_DETECTED = 1,
WEBSOCKET_DETECTED = 2,
TIMEOUT = -1,
INVALID_HEARTBEAT = -2
};
Q_PROPERTY(STATUS status READ status NOTIFY statusChanged)
Q_PROPERTY(QString statusString READ statusString NOTIFY statusChanged)
Q_PROPERTY(QVector<int> progress READ progress NOTIFY progressChanged)
Q_PROPERTY(QString editorQml READ editorQml CONSTANT)
Q_PROPERTY(bool running READ running NOTIFY runningChanged)
Q_INVOKABLE void start();
Q_INVOKABLE void stop();
Q_INVOKABLE void publishTileData();
Q_INVOKABLE void requestProgress();
void setTileData(const TileData &tileData);
bool hasTileData(const TileData &tileData) const;
void setAutoPublish(bool ap);
void setHoldProgress(bool hp);
STATUS status() const;
QString statusString() const;
QVector<int> progress() const;
QString editorQml();
bool running();
signals:
void statusChanged();
void progressChanged();
void runningChanged();
private:
PImpl pImpl;
};
#define pNemoInterface NemoInterface::instance()