summaryrefslogtreecommitdiff
path: root/notificationconn.h
diff options
context:
space:
mode:
authorJavier <dev.git@javispedro.com>2014-11-16 16:40:06 +0100
committerJavier <dev.git@javispedro.com>2014-11-16 16:40:06 +0100
commit5244f7909e04b23fbd5706dc6bcadafba21f7600 (patch)
tree88d8730dc70b68586d2d31845dc51eead9e526cb /notificationconn.h
parentd8d8fc7a0d139e7b864eee3b573bd208f823ad4f (diff)
downloadsapd-5244f7909e04b23fbd5706dc6bcadafba21f7600.tar.gz
sapd-5244f7909e04b23fbd5706dc6bcadafba21f7600.zip
initial notification support
Diffstat (limited to 'notificationconn.h')
-rw-r--r--notificationconn.h71
1 files changed, 71 insertions, 0 deletions
diff --git a/notificationconn.h b/notificationconn.h
new file mode 100644
index 0000000..9be3e20
--- /dev/null
+++ b/notificationconn.h
@@ -0,0 +1,71 @@
+#ifndef NOTIFICATIONCONN_H
+#define NOTIFICATIONCONN_H
+
+#include <QtCore/QObject>
+#include <QtCore/QDateTime>
+#include "sapconnection.h"
+#include "sapsocket.h"
+
+class NotificationConn : public QObject
+{
+ Q_OBJECT
+
+public:
+ NotificationConn(SAPConnection *conn, QObject *parent = 0);
+
+protected:
+ enum NotificationType {
+ NotificationPopup = 0
+ };
+
+ enum NotificationAttributeType {
+ NotificationPackageName = 0,
+ NotificationCount = 1,
+ NotificationTitle = 2,
+ NotificationTime = 3,
+ NotificationSender = 4,
+ NotificationBody = 5,
+ NotificationThumbnail = 6,
+ NotificationApplicationName = 7,
+ NotificationOpenInWatch = 9,
+ NotificationOpenInHost = 10,
+ NotificationId = 11
+ };
+
+ struct Notification {
+ Notification();
+
+ NotificationType type;
+ int sequenceNumber;
+ bool urgent;
+ int applicationId;
+ int category;
+ QString packageName;
+ int count;
+ QString title;
+ QDateTime time;
+ int sender;
+ QString body;
+ QByteArray thumbnail;
+ QString applicationName;
+ //bool openInWatch;
+ //bool openInHost;
+ int notificationId;
+ };
+
+ QByteArray packNotification(const Notification &n);
+
+private:
+
+
+private slots:
+ void handleConnected();
+ void handleMessageReceived();
+ void performTest();
+
+private:
+ SAPConnection *_conn;
+ SAPSocket *_socket;
+};
+
+#endif // NOTIFICATIONCONN_H