NemoInterface.h 723 Bytes
Newer Older
Valentin Platzgummer's avatar
Valentin Platzgummer committed
1 2 3 4 5 6 7 8 9
#pragma once

#include <QGeoCoordinate>
#include <QObject>

#include "SnakeTilesLocal.h"

#include <memory>

10 11
class TileData;

Valentin Platzgummer's avatar
Valentin Platzgummer committed
12 13 14 15 16 17 18 19 20 21 22 23 24 25
class NemoInterface : public QObject {
  Q_OBJECT
  class Impl;
  using PImpl = std::unique_ptr<Impl>;

public:
  enum class NemoStatus {
    NotConnected = 0,
    Connected = 1,
    Timeout = -1,
    InvalidHeartbeat = -2
  };

  explicit NemoInterface(QObject *parent = nullptr);
Valentin Platzgummer's avatar
Valentin Platzgummer committed
26
  ~NemoInterface() override;
Valentin Platzgummer's avatar
Valentin Platzgummer committed
27 28 29 30

  void start();
  void stop();

31 32
  void publishTileData(const TileData &tileData);
  bool hasTileData(const TileData &tileData) const;
Valentin Platzgummer's avatar
Valentin Platzgummer committed
33

Valentin Platzgummer's avatar
Valentin Platzgummer committed
34 35
  NemoStatus status() const;
  QVector<int> progress() const;
Valentin Platzgummer's avatar
Valentin Platzgummer committed
36 37 38 39 40 41 42 43

signals:
  void statusChanged();
  void progressChanged();

private:
  PImpl pImpl;
};