2003-09-21 Havoc Pennington <hp@pobox.com>
[platform/upstream/dbus.git] / glib / dbus-gproxy.h
1 /* -*- mode: C; c-file-style: "gnu" -*- */
2 /* dbus-gproxy.h convenience routines for calling methods, etc.
3  *
4  * Copyright (C) 2003  Red Hat, Inc.
5  *
6  * Licensed under the Academic Free License version 1.2
7  * 
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  * 
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21  *
22  */
23 #ifndef DBUS_GPROXY_H
24 #define DBUS_GPROXY_H
25
26 #if !defined (DBUS_INSIDE_DBUS_GLIB_H) && !defined (DBUS_COMPILATION)
27 #error "Only <dbus/dbus-glib.h> can be included directly, this file may disappear or change contents."
28 #endif
29
30 #include <dbus/dbus.h>
31 #include <glib.h>
32 #include <glib-object.h> /* for GCallback at the moment, we don't link to it */
33
34 G_BEGIN_DECLS
35
36 typedef struct DBusGProxy       DBusGProxy;
37
38 DBusGProxy*      dbus_gproxy_new_for_service       (DBusConnection      *connection,
39                                                     const char          *service_name,
40                                                     const char          *interface_name);
41 DBusGProxy*      dbus_gproxy_new_for_service_owner (DBusConnection      *connection,
42                                                     const char          *service_name,
43                                                     const char          *interface_name,
44                                                     GError             **error);
45 DBusGProxy*      dbus_gproxy_new_for_object_path   (DBusConnection      *connection,
46                                                     const char          *path,
47                                                     const char          *interface_name);
48 DBusGProxy*      dbus_gproxy_new_for_interface     (DBusConnection      *connection,
49                                                     const char          *interface_name);
50 void             dbus_gproxy_ref                   (DBusGProxy          *proxy);
51 void             dbus_gproxy_unref                 (DBusGProxy          *proxy);
52 gboolean         dbus_gproxy_connect_signal        (DBusGProxy          *proxy,
53                                                     const char          *signal_name,
54                                                     GCallback            callback,
55                                                     void                *data,
56                                                     GFreeFunc            free_data_func,
57                                                     GError             **error);
58 DBusPendingCall* dbus_gproxy_begin_call            (DBusGProxy          *proxy,
59                                                     const char          *method,
60                                                     int                  first_arg_type,
61                                                     ...);
62 gboolean         dbus_gproxy_end_call              (DBusGProxy          *proxy,
63                                                     DBusPendingCall     *pending,
64                                                     GError             **error,
65                                                     int                  first_arg_type,
66                                                     ...);
67 void             dbus_gproxy_oneway_call           (DBusGProxy          *proxy,
68                                                     const char          *method,
69                                                     int                  first_arg_type,
70                                                     ...);
71 void             dbus_gproxy_send                  (DBusGProxy          *proxy,
72                                                     DBusMessage         *message,
73                                                     dbus_uint32_t       *client_serial);
74
75
76 G_END_DECLS
77
78 #endif /* DBUS_GPROXY_H */