2013-04-25 01:12:43 -07:00
|
|
|
#ifndef E_TYPEDEFS
|
|
|
|
|
2013-01-03 14:07:56 -08:00
|
|
|
#ifndef _E_NOTIFICATION_H
|
|
|
|
#define _E_NOTIFICATION_H
|
|
|
|
|
2013-04-25 01:12:43 -07:00
|
|
|
#define E_NOTIFICATION_TYPE 0x12342166
|
2013-01-03 14:07:56 -08:00
|
|
|
|
|
|
|
typedef enum _E_Notification_Notify_Urgency
|
|
|
|
{
|
2022-06-17 16:44:17 -07:00
|
|
|
E_NOTIFICATION_NOTIFY_URGENCY_LOW = 0,
|
|
|
|
E_NOTIFICATION_NOTIFY_URGENCY_NORMAL = 1,
|
|
|
|
E_NOTIFICATION_NOTIFY_URGENCY_CRITICAL = 2
|
2013-01-03 14:07:56 -08:00
|
|
|
} E_Notification_Notify_Urgency;
|
|
|
|
|
2013-01-03 14:08:00 -08:00
|
|
|
typedef enum _E_Notification_Notify_Closed_Reason
|
2013-01-03 14:07:56 -08:00
|
|
|
{
|
2022-06-17 16:44:17 -07:00
|
|
|
E_NOTIFICATION_NOTIFY_CLOSED_REASON_EXPIRED = 1,
|
|
|
|
E_NOTIFICATION_NOTIFY_CLOSED_REASON_DISMISSED = 2,
|
|
|
|
E_NOTIFICATION_NOTIFY_CLOSED_REASON_REQUESTED = 3,
|
|
|
|
E_NOTIFICATION_NOTIFY_CLOSED_REASON_UNDEFINED = 4
|
2013-01-03 14:08:00 -08:00
|
|
|
} E_Notification_Notify_Closed_Reason;
|
2013-01-03 14:07:56 -08:00
|
|
|
|
2022-06-17 16:44:17 -07:00
|
|
|
typedef struct _E_Notification_Notify_Action
|
|
|
|
{
|
|
|
|
const char *action;
|
|
|
|
const char *label;
|
|
|
|
} E_Notification_Notify_Action;
|
|
|
|
|
2013-01-03 14:07:56 -08:00
|
|
|
typedef struct _E_Notification_Notify
|
|
|
|
{
|
2013-04-25 01:12:43 -07:00
|
|
|
E_Object e_obj_inherit;
|
2013-01-03 14:08:00 -08:00
|
|
|
unsigned int id;
|
2013-01-03 14:07:56 -08:00
|
|
|
const char *app_name;
|
2022-06-17 16:44:17 -07:00
|
|
|
unsigned int replaces_id;
|
2014-07-30 16:18:24 -07:00
|
|
|
const char *summary;
|
2013-01-03 14:07:56 -08:00
|
|
|
const char *body;
|
2022-06-17 16:44:17 -07:00
|
|
|
int timeout; // time in ms
|
2013-01-03 14:07:56 -08:00
|
|
|
E_Notification_Notify_Urgency urgency;
|
2022-06-17 16:44:17 -07:00
|
|
|
struct {
|
2013-01-03 14:07:56 -08:00
|
|
|
const char *icon;
|
|
|
|
const char *icon_path;
|
2022-06-17 16:44:17 -07:00
|
|
|
struct {
|
2013-01-03 14:07:56 -08:00
|
|
|
int width;
|
|
|
|
int height;
|
|
|
|
int rowstride;
|
|
|
|
Eina_Bool has_alpha;
|
|
|
|
int bits_per_sample;
|
|
|
|
int channels;
|
|
|
|
unsigned char *data;
|
|
|
|
int data_size;
|
|
|
|
} raw;
|
|
|
|
} icon;
|
2022-06-17 16:44:17 -07:00
|
|
|
const char *category;
|
|
|
|
const char *desktop_entry;
|
|
|
|
const char *sound_file;
|
|
|
|
const char *sound_name;
|
|
|
|
int x, y;
|
|
|
|
Eina_Bool have_xy;
|
|
|
|
Eina_Bool icon_actions;
|
|
|
|
Eina_Bool resident;
|
|
|
|
Eina_Bool suppress_sound;
|
|
|
|
Eina_Bool transient;
|
|
|
|
E_Notification_Notify_Action *actions;
|
2013-01-03 14:07:56 -08:00
|
|
|
} E_Notification_Notify;
|
|
|
|
|
|
|
|
typedef unsigned int (*E_Notification_Notify_Cb)(void *data, E_Notification_Notify *n);
|
|
|
|
typedef void (*E_Notification_Close_Cb)(void *data, unsigned int id);
|
|
|
|
|
|
|
|
typedef struct _E_Notification_Server_Info
|
|
|
|
{
|
|
|
|
const char *name;
|
|
|
|
const char *vendor;
|
|
|
|
const char *version;
|
|
|
|
const char *spec_version;
|
|
|
|
const char *capabilities[];
|
|
|
|
} E_Notification_Server_Info;
|
|
|
|
|
2013-01-03 14:08:00 -08:00
|
|
|
/**
|
|
|
|
* Register a notification server
|
|
|
|
*
|
|
|
|
* It's only possible to have one server registered at a time. If this function
|
|
|
|
* is called twice it will return EINA_FALSE on the second time.
|
|
|
|
*
|
|
|
|
* @return EINA_TRUE if server was registered, EINA_FALSE otherwise.
|
|
|
|
*/
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API Eina_Bool e_notification_server_register(const E_Notification_Server_Info *server_info, E_Notification_Notify_Cb notify_cb, E_Notification_Close_Cb close_cb, const void *data);
|
2013-01-03 14:08:00 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Unregister the sole notification server
|
|
|
|
*/
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API void e_notification_server_unregister(void);
|
2013-01-03 14:08:00 -08:00
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API void e_notification_notify_close(E_Notification_Notify *notify, E_Notification_Notify_Closed_Reason reason);
|
|
|
|
E_API Evas_Object *e_notification_notify_raw_image_get(E_Notification_Notify *notify, Evas *evas);
|
2013-01-03 14:07:56 -08:00
|
|
|
|
2013-01-03 14:08:10 -08:00
|
|
|
//client
|
|
|
|
typedef void (*E_Notification_Client_Send_Cb)(void *data, unsigned int id);
|
2022-06-17 16:44:17 -07:00
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API Eina_Bool e_notification_client_send(E_Notification_Notify *notify, E_Notification_Client_Send_Cb cb, const void *data);
|
2022-06-17 16:44:17 -07:00
|
|
|
E_API void e_notification_notify_action(E_Notification_Notify *notify, const char *action);
|
2018-01-22 12:13:24 -08:00
|
|
|
E_API Eina_Bool e_notification_util_send(const char *summary, const char *body);
|
2013-01-03 14:07:56 -08:00
|
|
|
#endif
|
2013-04-25 01:12:43 -07:00
|
|
|
|
|
|
|
#endif
|