giomodule test: force shared library build
[platform/upstream/glib.git] / gio / gnotificationbackend.h
1 /*
2  * Copyright © 2013 Lars Uebernickel
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License as published
6  * by the Free Software Foundation; either version 2 of the licence or (at
7  * your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General
15  * Public License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
17  * Boston, MA 02111-1307, USA.
18  *
19  * Authors: Lars Uebernickel <lars@uebernic.de>
20  */
21
22 #ifndef __G_NOTIFICATION_BACKEND_H__
23 #define __G_NOTIFICATION_BACKEND_H__
24
25 #include <gio/giotypes.h>
26
27 G_BEGIN_DECLS
28
29 #define G_TYPE_NOTIFICATION_BACKEND         (g_notification_backend_get_type ())
30 #define G_NOTIFICATION_BACKEND(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_NOTIFICATION_BACKEND, GNotificationBackend))
31 #define G_IS_NOTIFICATION_BACKEND(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_NOTIFICATION_BACKEND))
32 #define G_NOTIFICATION_BACKEND_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST ((k), G_TYPE_NOTIFICATION_BACKEND, GNotificationBackendClass))
33 #define G_NOTIFICATION_BACKEND_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_NOTIFICATION_BACKEND, GNotificationBackendClass))
34
35 #define G_NOTIFICATION_BACKEND_EXTENSION_POINT_NAME "gnotification-backend"
36
37 typedef struct _GNotificationBackend      GNotificationBackend;
38 typedef struct _GNotificationBackendClass GNotificationBackendClass;
39
40 struct _GNotificationBackend
41 {
42   GObject parent_instance;
43
44   GApplication    *application;
45   GDBusConnection *dbus_connection;
46 };
47
48 struct _GNotificationBackendClass
49 {
50   GObjectClass parent_class;
51
52   gboolean  (*is_supported)             (void);
53
54   void      (*send_notification)        (GNotificationBackend *backend,
55                                          const gchar          *id,
56                                          GNotification        *notification);
57
58   void      (*withdraw_notification)    (GNotificationBackend *backend,
59                                          const gchar          *id);
60 };
61
62 GType                   g_notification_backend_get_type                 (void);
63
64 GNotificationBackend *  g_notification_backend_new_default              (GApplication         *application);
65
66 void                    g_notification_backend_send_notification        (GNotificationBackend *backend,
67                                                                          const gchar          *id,
68                                                                          GNotification        *notification);
69
70 void                    g_notification_backend_withdraw_notification    (GNotificationBackend *backend,
71                                                                          const gchar          *id);
72
73 G_END_DECLS
74
75 #endif