sl@0: /* -*- mode: C; c-file-style: "gnu" -*- */ sl@0: /* connection.h Client connections sl@0: * sl@0: * Copyright (C) 2003, 2004 Red Hat, Inc. sl@0: * Portion Copyright © 2008 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. sl@0: * Licensed under the Academic Free License version 2.1 sl@0: * sl@0: * This program is free software; you can redistribute it and/or modify sl@0: * it under the terms of the GNU General Public License as published by sl@0: * the Free Software Foundation; either version 2 of the License, or sl@0: * (at your option) any later version. sl@0: * sl@0: * This program is distributed in the hope that it will be useful, sl@0: * but WITHOUT ANY WARRANTY; without even the implied warranty of sl@0: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the sl@0: * GNU General Public License for more details. sl@0: * sl@0: * You should have received a copy of the GNU General Public License sl@0: * along with this program; if not, write to the Free Software sl@0: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA sl@0: * sl@0: */ sl@0: sl@0: #ifndef BUS_CONNECTION_H sl@0: #define BUS_CONNECTION_H sl@0: sl@0: #include sl@0: #ifndef __SYMBIAN32__ sl@0: #include sl@0: #else sl@0: #include "dbus-list.h" sl@0: #endif //__SYMBIAN32__ sl@0: #include "bus.h" sl@0: sl@0: typedef dbus_bool_t (* BusConnectionForeachFunction) (DBusConnection *connection, sl@0: void *data); sl@0: sl@0: sl@0: BusConnections* bus_connections_new (BusContext *context); sl@0: BusConnections* bus_connections_ref (BusConnections *connections); sl@0: void bus_connections_unref (BusConnections *connections); sl@0: dbus_bool_t bus_connections_setup_connection (BusConnections *connections, sl@0: DBusConnection *connection); sl@0: void bus_connections_foreach (BusConnections *connections, sl@0: BusConnectionForeachFunction function, sl@0: void *data); sl@0: void bus_connections_foreach_active (BusConnections *connections, sl@0: BusConnectionForeachFunction function, sl@0: void *data); sl@0: BusContext* bus_connections_get_context (BusConnections *connections); sl@0: void bus_connections_increment_stamp (BusConnections *connections); sl@0: BusContext* bus_connection_get_context (DBusConnection *connection); sl@0: BusConnections* bus_connection_get_connections (DBusConnection *connection); sl@0: BusRegistry* bus_connection_get_registry (DBusConnection *connection); sl@0: BusActivation* bus_connection_get_activation (DBusConnection *connection); sl@0: BusMatchmaker* bus_connection_get_matchmaker (DBusConnection *connection); sl@0: BusSELinuxID* bus_connection_get_selinux_id (DBusConnection *connection); sl@0: dbus_bool_t bus_connections_check_limits (BusConnections *connections, sl@0: DBusConnection *requesting_completion, sl@0: DBusError *error); sl@0: void bus_connections_expire_incomplete (BusConnections *connections); sl@0: sl@0: dbus_bool_t bus_connections_expect_reply (BusConnections *connections, sl@0: BusTransaction *transaction, sl@0: DBusConnection *will_get_reply, sl@0: DBusConnection *will_send_reply, sl@0: DBusMessage *reply_to_this, sl@0: DBusError *error); sl@0: dbus_bool_t bus_connections_check_reply (BusConnections *connections, sl@0: BusTransaction *transaction, sl@0: DBusConnection *sending_reply, sl@0: DBusConnection *receiving_reply, sl@0: DBusMessage *reply, sl@0: DBusError *error); sl@0: sl@0: dbus_bool_t bus_connection_mark_stamp (DBusConnection *connection); sl@0: sl@0: dbus_bool_t bus_connection_is_active (DBusConnection *connection); sl@0: const char *bus_connection_get_name (DBusConnection *connection); sl@0: sl@0: dbus_bool_t bus_connection_preallocate_oom_error (DBusConnection *connection); sl@0: void bus_connection_send_oom_error (DBusConnection *connection, sl@0: DBusMessage *in_reply_to); sl@0: sl@0: /* called by signals.c */ sl@0: dbus_bool_t bus_connection_add_match_rule (DBusConnection *connection, sl@0: BusMatchRule *rule); sl@0: void bus_connection_add_match_rule_link (DBusConnection *connection, sl@0: DBusList *link); sl@0: void bus_connection_remove_match_rule (DBusConnection *connection, sl@0: BusMatchRule *rule); sl@0: int bus_connection_get_n_match_rules (DBusConnection *connection); sl@0: sl@0: sl@0: /* called by services.c */ sl@0: dbus_bool_t bus_connection_add_owned_service (DBusConnection *connection, sl@0: BusService *service); sl@0: void bus_connection_remove_owned_service (DBusConnection *connection, sl@0: BusService *service); sl@0: void bus_connection_add_owned_service_link (DBusConnection *connection, sl@0: DBusList *link); sl@0: int bus_connection_get_n_services_owned (DBusConnection *connection); sl@0: sl@0: /* called by driver.c */ sl@0: dbus_bool_t bus_connection_complete (DBusConnection *connection, sl@0: const DBusString *name, sl@0: DBusError *error); sl@0: sl@0: /* called by dispatch.c when the connection is dropped */ sl@0: void bus_connection_disconnected (DBusConnection *connection); sl@0: sl@0: dbus_bool_t bus_connection_is_in_group (DBusConnection *connection, sl@0: unsigned long gid); sl@0: dbus_bool_t bus_connection_get_groups (DBusConnection *connection, sl@0: unsigned long **groups, sl@0: int *n_groups, sl@0: DBusError *error); sl@0: BusClientPolicy* bus_connection_get_policy (DBusConnection *connection); sl@0: sl@0: /* transaction API so we can send or not send a block of messages as a whole */ sl@0: sl@0: typedef void (* BusTransactionCancelFunction) (void *data); sl@0: sl@0: BusTransaction* bus_transaction_new (BusContext *context); sl@0: BusContext* bus_transaction_get_context (BusTransaction *transaction); sl@0: BusConnections* bus_transaction_get_connections (BusTransaction *transaction); sl@0: dbus_bool_t bus_transaction_send (BusTransaction *transaction, sl@0: DBusConnection *connection, sl@0: DBusMessage *message); sl@0: dbus_bool_t bus_transaction_send_from_driver (BusTransaction *transaction, sl@0: DBusConnection *connection, sl@0: DBusMessage *message); sl@0: dbus_bool_t bus_transaction_send_error_reply (BusTransaction *transaction, sl@0: DBusConnection *connection, sl@0: const DBusError *error, sl@0: DBusMessage *in_reply_to); sl@0: void bus_transaction_cancel_and_free (BusTransaction *transaction); sl@0: void bus_transaction_execute_and_free (BusTransaction *transaction); sl@0: dbus_bool_t bus_transaction_add_cancel_hook (BusTransaction *transaction, sl@0: BusTransactionCancelFunction cancel_function, sl@0: void *data, sl@0: DBusFreeFunction free_data_function); sl@0: sl@0: #endif /* BUS_CONNECTION_H */