summaryrefslogtreecommitdiff
path: root/src/lib/elementary/elm_sys_notify_eo.h
blob: 4094fc6f9ce66acc191590420e72e66d295f78e0 (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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#ifndef _ELM_SYS_NOTIFY_EO_H_
#define _ELM_SYS_NOTIFY_EO_H_

#ifndef _ELM_SYS_NOTIFY_EO_CLASS_TYPE
#define _ELM_SYS_NOTIFY_EO_CLASS_TYPE

typedef Eo Elm_Sys_Notify;

#endif

#ifndef _ELM_SYS_NOTIFY_EO_TYPES
#define _ELM_SYS_NOTIFY_EO_TYPES

/** System notification server types
 *
 * @ingroup Elm_Sys_Notify
 */
typedef enum
{
  ELM_SYS_NOTIFY_SERVER_NONE = 0, /**< No notificationserver (disables
                                   * notifications) */
  ELM_SYS_NOTIFY_SERVER_DBUS = 1 /* 1 >> 0 */ /**< Use DBus as a notification
                                               * server */
} Elm_Sys_Notify_Server;

/** The reason the notification was closed
 *
 * @since 1.8
 *
 * @ingroup Elm_Sys_Notify
 */
typedef enum
{
  ELM_SYS_NOTIFY_CLOSED_EXPIRED = 0, /**< The notification expired */
  ELM_SYS_NOTIFY_CLOSED_DISMISSED, /**< The notification was dismissed by the
                                    * user */
  ELM_SYS_NOTIFY_CLOSED_REQUESTED, /**< The notification was closed by a call to
                                    * CloseNotification method */
  ELM_SYS_NOTIFY_CLOSED_UNDEFINED /**< Undefined/reserved reasons */
} Elm_Sys_Notify_Closed_Reason;

/** Data on event when notification closed is emitted
 *
 * @since 1.8
 *
 * @ingroup Elm_Sys_Notify
 */
typedef struct _Elm_Sys_Notify_Notification_Closed
{
  unsigned int id; /**< ID of the notification */
  Elm_Sys_Notify_Closed_Reason reason; /**< The reason the notification was
                                        * closed */
} Elm_Sys_Notify_Notification_Closed;

/** Data on event when the action invoked is emitted
 *
 * @since 1.8
 *
 * @ingroup Elm_Sys_Notify
 */
typedef struct _Elm_Sys_Notify_Action_Invoked
{
  unsigned int id; /**< ID of the notification */
  char *action_key; /**< The key of the action invoked. These match the keys
                     * sent over in the list of actions */
} Elm_Sys_Notify_Action_Invoked;


#endif
/** Elementary system notification class
 *
 * @ingroup Elm_Sys_Notify
 */
#define ELM_SYS_NOTIFY_CLASS elm_sys_notify_class_get()

EWAPI const Efl_Class *elm_sys_notify_class_get(void) EINA_CONST;

/**
 * @brief Set the notifications server to be used.
 *
 * @note This is an advanced function that should be used only to fulfill very
 * specific purposes. Use elm_need_sys_notify() which activates the default
 * available notification servers.
 *
 * @param[in] obj The object.
 * @param[in] servers Binary mask of servers to enable. If a server is not
 * present in the binary mask but was previously registered, it will be
 * unregistered.
 *
 * @return @c true on success, @c false on failure
 *
 * @since 1.17
 *
 * @ingroup Elm_Sys_Notify
 */
EOAPI Eina_Bool elm_obj_sys_notify_servers_set(Eo *obj, Elm_Sys_Notify_Server servers);

/**
 * @brief Get the notification servers that have been registered
 *
 * @param[in] obj The object.
 *
 * @return Binary mask of servers to enable. If a server is not present in the
 * binary mask but was previously registered, it will be unregistered.
 *
 * @since 1.17
 *
 * @ingroup Elm_Sys_Notify
 */
EOAPI Elm_Sys_Notify_Server elm_obj_sys_notify_servers_get(const Eo *obj);

/**
 * @brief Returns the singleton instance of the notification manager
 * Elm.Sys_Notify. It is initialized upon the first call of this function
 *
 * @return The unique notification manager
 *
 * @since 1.17
 *
 * @ingroup Elm_Sys_Notify
 */
EOAPI Elm_Sys_Notify *elm_obj_sys_notify_singleton_get(void);

#endif