summaryrefslogtreecommitdiff
path: root/src/lib/elm_sys_notify.eo
blob: 9adae9fef7095c1b46f57737bd8a932cb6147c8d (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
enum Elm.Sys_Notify.Server
{
   none = 0, [[No notificationserver (disables notifications)]]
   dbus = 1 << 0 [[Use DBus as a notification server]]
}

enum Elm.Sys_Notify.Closed_Reason
{
   [[The reason the notification was closed

     @since 1.8
   ]]

   legacy: elm_sys_notify_closed;

   expired, [[The notification expired]]
   dismissed, [[The notification was dismissed by the user]]
   requested, [[The notification was closed by a call to CloseNotification method]]
   undefined [[Undefined/reserved reasons]]
}

struct Elm.Sys_Notify.Notification_Closed
{
   [[Data on event when notification closed is emitted

     @since 1.8
   ]]
   id: uint; [[ID of the notification]]
   reason: Elm.Sys_Notify.Closed_Reason; [[The reason the notification was closed]]
}

struct Elm.Sys_Notify.Action_Invoked
{
   [[Data on event when the action invoked is emitted

     @since 1.8
   ]]
   id: uint; [[ID of the notification]]
   action_key: char *; [[The key of the action invoked. These match the
                                keys sent over in the list of actions]]
}

class Elm.Sys_Notify (Eo.Base, Elm.Sys_Notify_Interface)
{
   legacy_prefix: elm_sys_notify;
   eo_prefix: elm_obj_sys_notify;

   methods {
      @property servers {
         get {
            [[Get the notification servers that have been registered

              @since 1.17
            ]]
         }
         set {
            [[Set the notifications server to be used.

              Note: This is an advanced function that should be used only to
                    fullfill very specific purposes. Use elm_need_sys_notify()
                    which activates the default available notification
                    servers.

              @since 1.17
            ]]
            return: bool; [[$true on success, $false on failure]]
         }
         values {
            servers: Elm.Sys_Notify.Server; [[Binary mask of servers to enable.
            If a server is not present in the binary mask but was previously
            registered, it will be unregistered.]]
         }
      }

      singleton_get @class {
         [[Returns the singleton instance of the notification manager
         Elm.Sys_Notify. It is initialized upon the first call of this
         function

           @since 1.17
         ]]
         return: Elm.Sys_Notify *; [[The unique notification manager]]
      }
   }

   implements {
      class.constructor;
      Eo.Base.constructor;
      Eo.Base.destructor;
      Elm.Sys_Notify_Interface.send;
      Elm.Sys_Notify_Interface.simple_send;
      Elm.Sys_Notify_Interface.close;
   }
}