update for beta release
[framework/uifw/e17.git] / src / modules / notification / e_mod_main.h
1 #ifndef E_MOD_MAIN_H
2 #define E_MOD_MAIN_H
3
4 #define HAVE_EDBUS 1
5 #include <e.h>
6 #include <E_Notification_Daemon.h>
7 #include "config.h"
8
9 #define MOD_CFG_FILE_EPOCH 0x0002
10 #define MOD_CFG_FILE_GENERATION 0x0006
11 #define MOD_CFG_FILE_VERSION                                    \
12 ((MOD_CFG_FILE_EPOCH << 16) | MOD_CFG_FILE_GENERATION)
13
14 #undef  MAX
15 #define MAX(x, y) (((x) > (y)) ? (x) : (y))
16
17
18 typedef enum   _Popup_Corner Popup_Corner;
19 typedef struct _Config Config;
20 typedef struct _Config_Item Config_Item;
21 typedef struct _Instance Instance;
22 typedef struct _Popup_Data Popup_Data;
23 typedef struct _Notification_Box Notification_Box;
24 typedef struct _Notification_Box_Icon Notification_Box_Icon;
25
26 enum _Popup_Corner
27   {
28     CORNER_TL,
29     CORNER_TR,
30     CORNER_BL,
31     CORNER_BR
32   };
33
34 struct _Config 
35 {
36   E_Config_Dialog *cfd;
37
38   int version;
39   int show_low;
40   int show_normal;
41   int show_critical;
42   int force_timeout;
43   int ignore_replacement;
44   int dual_screen;
45   float timeout;
46   Popup_Corner corner;
47
48   struct
49   {
50     Eina_Bool presentation;
51     Eina_Bool offline;
52   } last_config_mode;
53   
54   Eina_List  *instances;
55   Eina_List  *n_box;
56   Eina_List  *config_dialog;
57   E_Menu     *menu;
58   Eina_List  *handlers;
59   Eina_List  *items;
60   Eina_List  *popups;
61   int         next_id;
62
63   Ecore_Timer *initial_mode_timer;
64   E_Notification_Daemon *daemon;
65 };
66
67 struct _Config_Item 
68 {
69   const char *id;
70   int show_label;
71   int show_popup;
72   int focus_window;
73   int store_low;
74   int store_normal;
75   int store_critical;
76 };
77
78 struct _Instance 
79 {
80   E_Gadcon_Client  *gcc;
81   Notification_Box *n_box;
82   Config_Item      *ci;
83 };
84
85
86 struct _Notification_Box
87 {
88   const char     *id;
89   Instance       *inst;
90   Evas_Object    *o_box;
91   Evas_Object    *o_empty;
92   Eina_List      *icons;
93 };
94
95 struct _Notification_Box_Icon
96 {
97   Notification_Box *n_box;
98   unsigned int      n_id;
99   const char       *label;
100   Evas_Object      *o_holder;
101   Evas_Object      *o_icon;
102   Evas_Object      *o_holder2;
103   Evas_Object      *o_icon2;
104   E_Border         *border;
105   E_Notification   *notif;
106
107   int             popup;
108   Ecore_Timer    *mouse_in_timer;
109 };
110
111 struct _Popup_Data
112 {
113   E_Notification *notif;
114   E_Popup *win;
115   Evas *e;
116   Evas_Object *theme;
117   const char  *app_name;
118   Evas_Object *app_icon;
119   Ecore_Timer *timer;
120   E_Zone *zone;
121 };
122
123
124 int  notification_popup_notify(E_Notification *n, unsigned int replaces_id, const char *appname);
125 void notification_popup_shutdown(void);
126 void notification_popup_close(unsigned int id);
127
128 void notification_box_notify(E_Notification *n, unsigned int replaces_id, unsigned int id);
129 void notification_box_shutdown(void);
130 void notification_box_del(const char *id);
131 void notification_box_visible_set(Notification_Box *b, Eina_Bool visible);
132 Notification_Box *notification_box_get(const char *id, Evas *evas);
133 Config_Item *notification_box_config_item_get(const char *id);
134 void notification_box_orient_set(Notification_Box *b, int horizontal);
135 void notification_box_cb_obj_moveresize(void *data, Evas *e, Evas_Object *obj, void *event_info);
136 Eina_Bool  notification_box_cb_border_remove(void *data, int type, E_Event_Border_Remove *ev);
137
138 EAPI extern E_Module_Api e_modapi;
139 EAPI void  *e_modapi_init(E_Module *m);
140 EAPI int    e_modapi_shutdown(E_Module *m);
141 EAPI int    e_modapi_save(E_Module *m);
142
143 void _gc_orient    (E_Gadcon_Client *gcc, E_Gadcon_Orient orient);
144
145 void config_notification_box_module(Config_Item *ci);
146
147 E_Config_Dialog *e_int_config_notification_module(E_Container *con, 
148                                                   const char *params __UNUSED__);
149
150 extern E_Module *notification_mod;
151 extern Config   *notification_cfg;
152 extern const E_Gadcon_Client_Class _gc_class;
153
154 #endif