summaryrefslogtreecommitdiff
path: root/lisp/notifications.el
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2012-04-24 17:19:07 +0200
committerMichael Albinus <michael.albinus@gmx.de>2012-04-24 17:19:07 +0200
commitb613912badfb9050e6310ee14fddc90e0fd16b2c (patch)
tree4272e3287e843d565c07b06acd7d1d53ffae8a41 /lisp/notifications.el
parent257440aa1c368048203a111db15f5a791a07f53f (diff)
downloademacs-b613912badfb9050e6310ee14fddc90e0fd16b2c.tar.gz
* notifications.el (notifications-interface)
(notifications-notify-method, notifications-notify) (notifications-close-notification-method): Fix docstring. (notifications-get-capabilities-method): New defconst. (notifications-get-capabilities): New defun. * os.texi: (Notifications): Add notifications-get-capabilities.
Diffstat (limited to 'lisp/notifications.el')
-rw-r--r--lisp/notifications.el36
1 files changed, 33 insertions, 3 deletions
diff --git a/lisp/notifications.el b/lisp/notifications.el
index b825eb65abf..9dad2a91b93 100644
--- a/lisp/notifications.el
+++ b/lisp/notifications.el
@@ -64,13 +64,16 @@
"D-Bus notifications service path.")
(defconst notifications-interface "org.freedesktop.Notifications"
- "D-Bus notifications service path.")
+ "D-Bus notifications service interface.")
(defconst notifications-notify-method "Notify"
- "D-Bus notifications service path.")
+ "D-Bus notifications notify method.")
(defconst notifications-close-notification-method "CloseNotification"
- "D-Bus notifications service path.")
+ "D-Bus notifications close notification method.")
+
+(defconst notifications-get-capabilities-method "GetCapabilities"
+ "D-Bus notifications get capabilities method.")
(defconst notifications-action-signal "ActionInvoked"
"D-Bus notifications action signal.")
@@ -188,6 +191,9 @@ Various PARAMS can be set:
- `undefined' if the notification server hasn't provided
a reason
+Which parameters are accepted by the notification server can be
+checked via `notifications-get-capabilities'.
+
This function returns a notification id, an integer, which can be
used to manipulate the notification item with
`notifications-close-notification' or the `:replaces-id' argument
@@ -322,4 +328,28 @@ of another `notifications-notify' call."
notifications-close-notification-method
:int32 id))
+(defun notifications-get-capabilities ()
+ "Return the capabilities of the notification server, a list of strings.
+The following capabilities can be expected:
+
+ \"actions\" The server will provide the specified actions
+ to the user.
+ \"body\" Supports body text.
+ \"body-hyperlinks\" The server supports hyperlinks in the notifications.
+ \"body-images\" The server supports images in the notifications.
+ \"body-markup\" Supports markup in the body text.
+ \"icon-multi\" The server will render an animation of all the
+ frames in a given image array.
+ \"icon-static\" Supports display of exactly 1 frame of any
+ given image array. This value is mutually exclusive
+ with \"icon-multi\".
+ \"sound\" The server supports sounds on notifications.
+
+Further vendor-specific caps start with \"x-vendor\", like \"x-gnome-foo-cap\"."
+ (dbus-call-method :session
+ notifications-service
+ notifications-path
+ notifications-interface
+ notifications-get-capabilities-method))
+
(provide 'notifications)