1 /* GDBus - GLib D-Bus Library
3 * Copyright (C) 2008-2010 Red Hat, Inc.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General
16 * Public License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
18 * Boston, MA 02111-1307, USA.
20 * Author: David Zeuthen <davidz@redhat.com>
23 #ifndef __G_DBUS_NAME_OWNING_H__
24 #define __G_DBUS_NAME_OWNING_H__
26 #include <gio/giotypes.h>
31 * GBusAcquiredCallback:
32 * @connection: The #GDBusConnection to a message bus.
33 * @name: The name that is requested to be owned.
34 * @user_data: User data passed to g_bus_own_name().
36 * Invoked when a connection to a message bus has been obtained.
40 typedef void (*GBusAcquiredCallback) (GDBusConnection *connection,
45 * GBusNameAcquiredCallback:
46 * @connection: The #GDBusConnection on which to acquired the name.
47 * @name: The name being owned.
48 * @user_data: User data passed to g_bus_own_name() or g_bus_own_name_on_connection().
50 * Invoked when the name is acquired.
54 typedef void (*GBusNameAcquiredCallback) (GDBusConnection *connection,
59 * GBusNameLostCallback:
60 * @connection: The #GDBusConnection on which to acquire the name or %NULL if
61 * the connection was disconnected.
62 * @name: The name being owned.
63 * @user_data: User data passed to g_bus_own_name() or g_bus_own_name_on_connection().
65 * Invoked when the name is lost or @connection has been closed.
69 typedef void (*GBusNameLostCallback) (GDBusConnection *connection,
73 guint g_bus_own_name (GBusType bus_type,
75 GBusNameOwnerFlags flags,
76 GBusAcquiredCallback bus_acquired_handler,
77 GBusNameAcquiredCallback name_acquired_handler,
78 GBusNameLostCallback name_lost_handler,
80 GDestroyNotify user_data_free_func);
82 guint g_bus_own_name_on_connection (GDBusConnection *connection,
84 GBusNameOwnerFlags flags,
85 GBusNameAcquiredCallback name_acquired_handler,
86 GBusNameLostCallback name_lost_handler,
88 GDestroyNotify user_data_free_func);
90 void g_bus_unown_name (guint owner_id);
94 #endif /* __G_DBUS_NAME_OWNING_H__ */