1/* GDBus - GLib D-Bus Library
2 *
3 * Copyright (C) 2008-2010 Red Hat, Inc.
4 *
5 * SPDX-License-Identifier: LGPL-2.1-or-later
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General
18 * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
19 *
20 * Author: David Zeuthen <davidz@redhat.com>
21 */
22
23#ifndef __G_DBUS_OBJECT_MANAGER_H__
24#define __G_DBUS_OBJECT_MANAGER_H__
25
26#include <gio/giotypes.h>
27
28G_BEGIN_DECLS
29
30#define G_TYPE_DBUS_OBJECT_MANAGER (g_dbus_object_manager_get_type())
31#define G_DBUS_OBJECT_MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_DBUS_OBJECT_MANAGER, GDBusObjectManager))
32#define G_IS_DBUS_OBJECT_MANAGER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_DBUS_OBJECT_MANAGER))
33#define G_DBUS_OBJECT_MANAGER_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE((o), G_TYPE_DBUS_OBJECT_MANAGER, GDBusObjectManagerIface))
34
35typedef struct _GDBusObjectManagerIface GDBusObjectManagerIface;
36
37/**
38 * GDBusObjectManagerIface:
39 * @parent_iface: The parent interface.
40 * @get_object_path: Virtual function for g_dbus_object_manager_get_object_path().
41 * @get_objects: Virtual function for g_dbus_object_manager_get_objects().
42 * @get_object: Virtual function for g_dbus_object_manager_get_object().
43 * @get_interface: Virtual function for g_dbus_object_manager_get_interface().
44 * @object_added: Signal handler for the #GDBusObjectManager::object-added signal.
45 * @object_removed: Signal handler for the #GDBusObjectManager::object-removed signal.
46 * @interface_added: Signal handler for the #GDBusObjectManager::interface-added signal.
47 * @interface_removed: Signal handler for the #GDBusObjectManager::interface-removed signal.
48 *
49 * Base type for D-Bus object managers.
50 *
51 * Since: 2.30
52 */
53struct _GDBusObjectManagerIface
54{
55 GTypeInterface parent_iface;
56
57 /* Virtual Functions */
58 const gchar *(*get_object_path) (GDBusObjectManager *manager);
59 GList *(*get_objects) (GDBusObjectManager *manager);
60 GDBusObject *(*get_object) (GDBusObjectManager *manager,
61 const gchar *object_path);
62 GDBusInterface *(*get_interface) (GDBusObjectManager *manager,
63 const gchar *object_path,
64 const gchar *interface_name);
65
66 /* Signals */
67 void (*object_added) (GDBusObjectManager *manager,
68 GDBusObject *object);
69 void (*object_removed) (GDBusObjectManager *manager,
70 GDBusObject *object);
71
72 void (*interface_added) (GDBusObjectManager *manager,
73 GDBusObject *object,
74 GDBusInterface *interface_);
75 void (*interface_removed) (GDBusObjectManager *manager,
76 GDBusObject *object,
77 GDBusInterface *interface_);
78};
79
80GIO_AVAILABLE_IN_ALL
81GType g_dbus_object_manager_get_type (void) G_GNUC_CONST;
82GIO_AVAILABLE_IN_ALL
83const gchar *g_dbus_object_manager_get_object_path (GDBusObjectManager *manager);
84GIO_AVAILABLE_IN_ALL
85GList *g_dbus_object_manager_get_objects (GDBusObjectManager *manager);
86GIO_AVAILABLE_IN_ALL
87GDBusObject *g_dbus_object_manager_get_object (GDBusObjectManager *manager,
88 const gchar *object_path);
89GIO_AVAILABLE_IN_ALL
90GDBusInterface *g_dbus_object_manager_get_interface (GDBusObjectManager *manager,
91 const gchar *object_path,
92 const gchar *interface_name);
93
94G_END_DECLS
95
96#endif /* __G_DBUS_OBJECT_MANAGER_H__ */
97