X-Git-Url: https://www.flypig.org.uk/git/?p=harbour-pedalo.git;a=blobdiff_plain;f=src%2Fstatus.h;fp=src%2Fstatus.h;h=f0256e03f0a4ecf0ba8966e3d337d5d1023aee2a;hp=0000000000000000000000000000000000000000;hb=371dcf3335b355f8d421352a394161dc6d9b9f24;hpb=e917baa52e7157c7c41424527c3881c22ff65588 diff --git a/src/status.h b/src/status.h new file mode 100644 index 0000000..f0256e0 --- /dev/null +++ b/src/status.h @@ -0,0 +1,32 @@ +#ifndef STATUS_H +#define STATUS_H + +#include + +class Status : public QObject +{ + Q_OBJECT +public: + explicit Status(QObject *parent = nullptr); + Q_PROPERTY(bool cycling READ getCycling WRITE setCycling NOTIFY cyclingChanged) + Q_PROPERTY(quint64 startTime READ getStartTime WRITE setStartTime NOTIFY startTimeChanged) + + bool getCycling() const; + quint64 getStartTime() const; + Q_INVOKABLE void startJourney(); + Q_INVOKABLE quint64 getDuration() const; + +signals: + void cyclingChanged(bool cycling); + void startTimeChanged(quint64 startTime); + +public slots: + void setCycling(bool value); + void setStartTime(quint64 value); + +private: + bool cycling; + quint64 startTime; +}; + +#endif // STATUS_H