summaryrefslogtreecommitdiff
path: root/src/lib/elm_sys_notify.h
blob: 4534838ca7219ebafef8e4fcaa8861521008c493 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#ifndef ELM_SYS_NOTIFY_H
#define ELM_SYS_NOTIFY_H

typedef void (*Elm_Sys_Notify_Send_Cb)(void *data, unsigned int id);

#include "elm_sys_notify_interface.eo.h"
#include "elm_sys_notify_interface.eo.legacy.h"
#include "elm_sys_notify.eo.h"
#include "elm_sys_notify.eo.legacy.h"

/**
 * Emitted when the signal NotificationClosed is received.
 * @since 1.8
 */
EAPI extern int ELM_EVENT_SYS_NOTIFY_NOTIFICATION_CLOSED;

/**
 * Emitted when the signal ActionInvoked is received.
 * @since 1.8
 */
EAPI extern int ELM_EVENT_SYS_NOTIFY_ACTION_INVOKED; /**< A Action has been invoked. */


/**
 * @def elm_sys_notify_simple_send
 *
 * Create a new notification just with Icon, Body and Summary.
 *
 * @param[in] icon
 * @param[in] summary
 * @param[in] body
 *
 * @see elm_sys_notify_send()
 *
 * @since 1.8
 */
#define elm_sys_notify_simple_send(icon, summary, body)    \
        elm_sys_notify_send(0, icon, summary, body,        \
                            ELM_SYS_NOTIFY_URGENCY_NORMAL, \
                            -1, NULL, NULL)

/**
 * Sends a notification to the notification servers that have
 * been registered by elm_need_sys_notify() or
 * elm_sys_notify_servers_set().
 *
 * @param replaces_id Notification ID that this notification replaces.
 * The value 0 means a new notification.
 * @param icon The optional program icon of the calling application.
 * @param summary The summary text briefly describing the notification.
 * @param body The optional detailed body text. Can be empty.
 * @param urgency The urgency level.
 * @param timeout Timeout display in milliseconds.
 * @param cb Callback used to retrieve the notification id
 * return by the Notification Server.
 * @param cb_data Optional context data
 *
 * @since 1.8
 */
EAPI void      elm_sys_notify_send(unsigned int replaces_id,
                                   const char *icon,
                                   const char *summary,
                                   const char *body,
                                   Elm_Sys_Notify_Urgency urgency,
                                   int timeout,
                                   Elm_Sys_Notify_Send_Cb cb,
                                   const void *cb_data);

/**
 * Causes a notification to be forcefully closed and removed from the user's
 * view. It can be used, for example, in the event that what the notification
 * pertains to is no longer relevant, or to cancel a notification * with no
 * expiration time.
 *
 * @param id Notification id
 *
 * @note If the notification no longer exists,
 * an empty D-BUS Error message is sent back.
 *
 * @since 1.8
 */
EAPI void      elm_sys_notify_close(unsigned int id);

#endif