Imported Upstream version 2.73.3
[platform/upstream/glib.git] / gio / gnotificationbackend.h
1 /*
2  * Copyright © 2013 Lars Uebernickel
3  *
4  * SPDX-License-Identifier: LGPL-2.1-or-later
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General
17  * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
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