kdeconnect-kde/plugins/notifications
Adam Pigg ebc316f703 Add a method for creating simple notifications
Summary:
Add a helper function to the daemon interface, which must be subclassed
by the implementations, which creates a simple notification.

For more complex needs, involving interacting with the notification, it
will still be nescessary to use KNotification directly, but this allows
for other future implementations to create a simple notification without
ifdef'ing the code.

Reviewers: kdeconnect, apol

Reviewed By: apol

Subscribers: kdeconnect

Differential Revision: https://phabricator.kde.org/D11104
2018-03-18 12:52:22 +01:00
..
CMakeLists.txt Clean-up requirements: cmake 3.0, qt 5.7, use min versions, deduplicate KF5 2018-03-17 23:34:33 +01:00
kdeconnect_notifications.json Remove unused "Encoding": "UTF-8" from plugins' metadata JSON 2018-03-17 23:32:27 +01:00
notification.cpp Make sure we don't request multiple times the notification icon 2018-03-16 00:06:47 +01:00
notification.h Make sure we don't request multiple times the notification icon 2018-03-16 00:06:47 +01:00
notification_debug.h Fix various krazy2 warnings 2015-08-21 22:38:54 +06:00
notificationsdbusinterface.cpp Rename NetworkPackage -> NetworkPacket 2018-03-05 20:03:23 +01:00
notificationsdbusinterface.h Rename NetworkPackage -> NetworkPacket 2018-03-05 20:03:23 +01:00
notificationsplugin.cpp Rename NetworkPackage -> NetworkPacket 2018-03-05 20:03:23 +01:00
notificationsplugin.h Add a method for creating simple notifications 2018-03-18 12:52:22 +01:00
README Move the plugins into a different top-ĺevel directory 2014-06-14 16:34:11 +02:00
sendreplydialog.cpp Merge branch 'master' into 1.x 2017-09-03 22:05:54 +02:00
sendreplydialog.h Merge branch 'master' into 1.x 2017-09-03 22:05:54 +02:00
sendreplydialog.ui Improvements on the SendReplyDialog 2017-08-03 17:26:29 +02:00

This plugin listens to packages with type "kdeconnect.notification" that will
contain all the information of the other device notifications.

The other device will report us every notification that is created or dismissed,
so we can keep in sync a local list of notifications.

At the beginning we can request the already existing notifications by sending a
package with the boolean "request" set to true.

The received packages will contain the following fields:

"id" (string): A unique notification id.
"appName" (string): The app that generated the notification
"ticker" (string): The title or headline of the notification.
"isClearable" (boolean): True if we can request to dismiss the notification.
"isCancel" (boolean): True if the notification was dismissed in the peer device.
"requestAnswer" (boolean): True if this is an answer to a "request" package.

Additionally the package can contain a payload with the icon of the notification
in PNG format.

The content of these fields is used to display the notifications to the user.
Note that if we receive a second notification with the same "id", we should
update the existent notification instead of creating a new one.

If the user dismisses a notification from this device, we have to request the
other device to remove it. This is done by sending a package with the fields
"id" set to the id of the notification we want to dismiss and a boolean "cancel"
set to true. The other device will answer with a notification package with
"isCancel" set to true when it is dismissed.