2003-06-04 Havoc Pennington <hp@pobox.com>
[platform/upstream/dbus.git] / dbus / dbus-connection-internal.h
1 /* -*- mode: C; c-file-style: "gnu" -*- */
2 /* dbus-connection-internal.h DBusConnection internal interfaces
3  *
4  * Copyright (C) 2002  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_CONNECTION_INTERNAL_H
24 #define DBUS_CONNECTION_INTERNAL_H
25
26 #include <dbus/dbus-internals.h>
27 #include <dbus/dbus-connection.h>
28 #include <dbus/dbus-message.h>
29 #include <dbus/dbus-transport.h>
30 #include <dbus/dbus-resources.h>
31 #include <dbus/dbus-list.h>
32
33 DBUS_BEGIN_DECLS;
34
35 typedef enum
36 {
37   DBUS_ITERATION_DO_WRITING = 1 << 0, /**< Write messages out. */
38   DBUS_ITERATION_DO_READING = 1 << 1, /**< Read messages in. */
39   DBUS_ITERATION_BLOCK      = 1 << 2  /**< Block if nothing to do. */
40 } DBusIterationFlags;
41
42 void              _dbus_connection_lock                        (DBusConnection     *connection);
43 void              _dbus_connection_unlock                      (DBusConnection     *connection);
44 void              _dbus_connection_ref_unlocked                (DBusConnection     *connection);
45 dbus_bool_t       _dbus_connection_queue_received_message      (DBusConnection     *connection,
46                                                                 DBusMessage        *message);
47 void              _dbus_connection_queue_received_message_link (DBusConnection     *connection,
48                                                                 DBusList           *link);
49 dbus_bool_t       _dbus_connection_have_messages_to_send       (DBusConnection     *connection);
50 DBusMessage*      _dbus_connection_get_message_to_send         (DBusConnection     *connection);
51 void              _dbus_connection_message_sent                (DBusConnection     *connection,
52                                                                 DBusMessage        *message);
53 dbus_bool_t       _dbus_connection_add_watch                   (DBusConnection     *connection,
54                                                                 DBusWatch          *watch);
55 void              _dbus_connection_remove_watch                (DBusConnection     *connection,
56                                                                 DBusWatch          *watch);
57 void              _dbus_connection_toggle_watch                (DBusConnection     *connection,
58                                                                 DBusWatch          *watch,
59                                                                 dbus_bool_t         enabled);
60 dbus_bool_t       _dbus_connection_handle_watch                (DBusWatch          *watch,
61                                                                 unsigned int        condition,
62                                                                 void               *data);
63 dbus_bool_t       _dbus_connection_add_timeout                 (DBusConnection     *connection,
64                                                                 DBusTimeout        *timeout);
65 void              _dbus_connection_remove_timeout              (DBusConnection     *connection,
66                                                                 DBusTimeout        *timeout);
67 void              _dbus_connection_toggle_timeout              (DBusConnection     *connection,
68                                                                 DBusTimeout        *timeout,
69                                                                 dbus_bool_t         enabled);
70 DBusConnection*   _dbus_connection_new_for_transport           (DBusTransport      *transport);
71 void              _dbus_connection_do_iteration                (DBusConnection     *connection,
72                                                                 unsigned int        flags,
73                                                                 int                 timeout_milliseconds);
74 void              _dbus_connection_notify_disconnected         (DBusConnection     *connection);
75 void              _dbus_connection_handler_destroyed_locked    (DBusConnection     *connection,
76                                                                 DBusMessageHandler *handler);
77 dbus_bool_t       _dbus_message_handler_add_connection         (DBusMessageHandler *handler,
78                                                                 DBusConnection     *connection);
79 void              _dbus_message_handler_remove_connection      (DBusMessageHandler *handler,
80                                                                 DBusConnection     *connection);
81 DBusHandlerResult _dbus_message_handler_handle_message         (DBusMessageHandler *handler,
82                                                                 DBusConnection     *connection,
83                                                                 DBusMessage        *message);
84
85 DBUS_END_DECLS;
86
87 #endif /* DBUS_CONNECTION_INTERNAL_H */