Changeset View
Changeset View
Standalone View
Standalone View
plugins/notifications/notification.h
Show All 36 Lines | 33 | { | |||
---|---|---|---|---|---|
37 | Q_PROPERTY(QString appName READ appName) | 37 | Q_PROPERTY(QString appName READ appName) | ||
38 | Q_PROPERTY(QString ticker READ ticker) | 38 | Q_PROPERTY(QString ticker READ ticker) | ||
39 | Q_PROPERTY(QString title READ title) | 39 | Q_PROPERTY(QString title READ title) | ||
40 | Q_PROPERTY(QString text READ text) | 40 | Q_PROPERTY(QString text READ text) | ||
41 | Q_PROPERTY(QString iconPath READ iconPath) | 41 | Q_PROPERTY(QString iconPath READ iconPath) | ||
42 | Q_PROPERTY(bool dismissable READ dismissable) | 42 | Q_PROPERTY(bool dismissable READ dismissable) | ||
43 | Q_PROPERTY(bool hasIcon READ hasIcon) | 43 | Q_PROPERTY(bool hasIcon READ hasIcon) | ||
44 | Q_PROPERTY(bool silent READ silent) | 44 | Q_PROPERTY(bool silent READ silent) | ||
45 | Q_PROPERTY(QString replyId READ replyId) | ||||
45 | 46 | | |||
46 | public: | 47 | public: | ||
47 | Notification(const NetworkPackage& np, QObject* parent); | 48 | Notification(const NetworkPackage& np, QObject* parent); | ||
48 | ~Notification() override; | 49 | ~Notification() override; | ||
49 | 50 | | |||
50 | QString internalId() const { return mInternalId; } | 51 | QString internalId() const { return mInternalId; } | ||
51 | QString appName() const { return mAppName; } | 52 | QString appName() const { return mAppName; } | ||
52 | QString ticker() const { return mTicker; } | 53 | QString ticker() const { return mTicker; } | ||
53 | QString title() const { return mTitle; } | 54 | QString title() const { return mTitle; } | ||
54 | QString text() const { return mText; } | 55 | QString text() const { return mText; } | ||
55 | QString iconPath() const { return mIconPath; } | 56 | QString iconPath() const { return mIconPath; } | ||
56 | bool dismissable() const { return mDismissable; } | 57 | bool dismissable() const { return mDismissable; } | ||
58 | QString replyId() const { return mRequestReplyId; } | ||||
57 | bool hasIcon() const { return mHasIcon; } | 59 | bool hasIcon() const { return mHasIcon; } | ||
58 | void show(); | 60 | void show(); | ||
59 | bool silent() const { return mSilent; } | 61 | bool silent() const { return mSilent; } | ||
60 | void update(const NetworkPackage &np); | 62 | void update(const NetworkPackage &np); | ||
61 | KNotification* createKNotification(bool update, const NetworkPackage &np); | 63 | KNotification* createKNotification(bool update, const NetworkPackage &np); | ||
62 | 64 | | |||
63 | public Q_SLOTS: | 65 | public Q_SLOTS: | ||
64 | Q_SCRIPTABLE void dismiss(); | 66 | Q_SCRIPTABLE void dismiss(); | ||
65 | Q_SCRIPTABLE void applyIconAndShow(); | 67 | Q_SCRIPTABLE void applyIconAndShow(); | ||
66 | void closed(); | 68 | void closed(); | ||
67 | 69 | | |||
68 | Q_SIGNALS: | 70 | Q_SIGNALS: | ||
69 | void dismissRequested(const QString& mInternalId); | 71 | void dismissRequested(const QString& mInternalId); | ||
72 | void replyRequested(); | ||||
70 | 73 | | |||
71 | private: | 74 | private: | ||
72 | QString mInternalId; | 75 | QString mInternalId; | ||
73 | QString mAppName; | 76 | QString mAppName; | ||
74 | QString mTicker; | 77 | QString mTicker; | ||
75 | QString mTitle; | 78 | QString mTitle; | ||
76 | QString mText; | 79 | QString mText; | ||
77 | QString mIconPath; | 80 | QString mIconPath; | ||
81 | QString mRequestReplyId; | ||||
78 | bool mDismissable; | 82 | bool mDismissable; | ||
79 | bool mHasIcon; | 83 | bool mHasIcon; | ||
80 | KNotification* mNotification; | 84 | KNotification* mNotification; | ||
81 | QDir mImagesDir; | 85 | QDir mImagesDir; | ||
82 | bool mSilent; | 86 | bool mSilent; | ||
83 | bool mClosed; | 87 | bool mClosed; | ||
84 | QString mPayloadHash; | 88 | QString mPayloadHash; | ||
85 | 89 | | |||
86 | void parseNetworkPackage(const NetworkPackage& np); | 90 | void parseNetworkPackage(const NetworkPackage& np); | ||
87 | }; | 91 | }; | ||
88 | 92 | | |||
89 | #endif | 93 | #endif |