From 5244f7909e04b23fbd5706dc6bcadafba21f7600 Mon Sep 17 00:00:00 2001 From: Javier Date: Sun, 16 Nov 2014 16:40:06 +0100 Subject: initial notification support --- notificationconn.h | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 notificationconn.h (limited to 'notificationconn.h') 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 +#include +#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 -- cgit v1.2.3