Corrently add, edit and list journey details
[harbour-pedalo.git] / src / status.h
diff --git a/src/status.h b/src/status.h
new file mode 100644 (file)
index 0000000..f0256e0
--- /dev/null
@@ -0,0 +1,32 @@
+#ifndef STATUS_H
+#define STATUS_H
+
+#include <QObject>
+
+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