summaryrefslogtreecommitdiff
path: root/meegohandsetnotification/meegohandsetnotification.cpp
diff options
context:
space:
mode:
authorJavier S. Pedro <maemo@javispedro.com>2011-09-24 20:52:17 +0200
committerJavier S. Pedro <maemo@javispedro.com>2011-09-24 20:52:17 +0200
commita1ec50943454ba4674c8c5e5d5dadcdbd414b111 (patch)
tree163aed51758c98fa6feec35a344aa8b5095c32e5 /meegohandsetnotification/meegohandsetnotification.cpp
parentcba26597f1c09764d37be0d13863ec5d5c340da0 (diff)
downloadsowatch-a1ec50943454ba4674c8c5e5d5dadcdbd414b111.tar.gz
sowatch-a1ec50943454ba4674c8c5e5d5dadcdbd414b111.zip
Incoming phone calls working!
Diffstat (limited to 'meegohandsetnotification/meegohandsetnotification.cpp')
-rw-r--r--meegohandsetnotification/meegohandsetnotification.cpp61
1 files changed, 61 insertions, 0 deletions
diff --git a/meegohandsetnotification/meegohandsetnotification.cpp b/meegohandsetnotification/meegohandsetnotification.cpp
new file mode 100644
index 0000000..69e2bd5
--- /dev/null
+++ b/meegohandsetnotification/meegohandsetnotification.cpp
@@ -0,0 +1,61 @@
+#include "meegohandsetnotification.h"
+
+MeegoHandsetNotification::MeegoHandsetNotification(const ::Notification& n, QObject *parent) :
+ sowatch::Notification(parent), _n(n)
+{
+}
+
+sowatch::Notification::Type MeegoHandsetNotification::type() const
+{
+ QString eventType = _n.parameters().value("eventType").toString();
+ if (eventType == "email.arrived")
+ return sowatch::Notification::EmailNotification;
+ else if (eventType == "x-nokia.call.missed")
+ return sowatch::Notification::MissedCallNotification;
+ else if (eventType == "x-nokia.messaging.im")
+ return sowatch::Notification::ImNotification;
+ else if (eventType == "x-nokia.messaging.sms")
+ return sowatch::Notification::SmsNotification;
+ else if (eventType == "x-nokia.messaging.mms")
+ return sowatch::Notification::MmsNotification;
+ else
+ return sowatch::Notification::OtherNotification;
+}
+
+uint MeegoHandsetNotification::count() const
+{
+ return _n.parameters().value("count").toUInt();
+}
+
+QDateTime MeegoHandsetNotification::dateTime() const
+{
+ const uint timestamp = _n.parameters().value("timestamp").toUInt();
+ return QDateTime::fromTime_t(timestamp);
+}
+
+QString MeegoHandsetNotification::title() const
+{
+ return _n.parameters().value("summary").toString();
+}
+
+QString MeegoHandsetNotification::body() const
+{
+ return _n.parameters().value("body").toString();
+}
+
+void MeegoHandsetNotification::activate()
+{
+ // TODO Actually do something
+}
+
+void MeegoHandsetNotification::clear()
+{
+ // TODO Actually clear...
+ emit cleared();
+}
+
+void MeegoHandsetNotification::changeTo(const ::Notification &notification)
+{
+ _n = notification;
+ emit changed();
+}