summaryrefslogtreecommitdiff
path: root/libsowatch/weathernotification.h
diff options
context:
space:
mode:
Diffstat (limited to 'libsowatch/weathernotification.h')
-rw-r--r--libsowatch/weathernotification.h27
1 files changed, 21 insertions, 6 deletions
diff --git a/libsowatch/weathernotification.h b/libsowatch/weathernotification.h
index 843a844..5fe4697 100644
--- a/libsowatch/weathernotification.h
+++ b/libsowatch/weathernotification.h
@@ -9,6 +9,11 @@ namespace sowatch
class WeatherNotification : public Notification
{
Q_OBJECT
+ Q_ENUMS(WeatherType Unit)
+ Q_PROPERTY(WeatherType forecast READ forecast NOTIFY forecastChanged)
+ Q_PROPERTY(int temperature READ temperature NOTIFY temperatureChanged)
+ Q_PROPERTY(Unit temperatureUnits READ temperatureUnits NOTIFY temperatureUnitsChanged)
+
public:
explicit WeatherNotification(QObject *parent = 0);
@@ -29,17 +34,27 @@ public:
Fahrenheit
};
- virtual WeatherType forecast() = 0;
- virtual int temperature() = 0;
- virtual Unit temperatureUnits() = 0;
+ Priority priority() const;
+
+ virtual WeatherType forecast() const = 0;
+ virtual int temperature() const = 0;
+ virtual Unit temperatureUnits() const = 0;
+
+signals:
+ void forecastChanged();
+ void temperatureChanged();
+ void temperatureUnitsChanged();
- /** Quite useful helper function. */
+protected:
+ /** Useful helper functions. */
static qreal convertTemperature(qreal temp, Unit from, Unit to);
static int convertTemperature(int temp, Unit from, Unit to);
};
-
-
}
+QML_DECLARE_TYPE(sowatch::WeatherNotification)
+QML_DECLARE_TYPE(sowatch::WeatherNotification::WeatherType)
+QML_DECLARE_TYPE(sowatch::WeatherNotification::Unit)
+
#endif // WEATHERNOTIFICATION_H