os/ossrv/ofdbus/dbus/bus/connection.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
/* -*- mode: C; c-file-style: "gnu" -*- */
sl@0
     2
/* connection.h  Client connections
sl@0
     3
 *
sl@0
     4
 * Copyright (C) 2003, 2004  Red Hat, Inc.
sl@0
     5
 * Portion Copyright © 2008 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
sl@0
     6
 * Licensed under the Academic Free License version 2.1
sl@0
     7
 * 
sl@0
     8
 * This program is free software; you can redistribute it and/or modify
sl@0
     9
 * it under the terms of the GNU General Public License as published by
sl@0
    10
 * the Free Software Foundation; either version 2 of the License, or
sl@0
    11
 * (at your option) any later version.
sl@0
    12
 *
sl@0
    13
 * This program is distributed in the hope that it will be useful,
sl@0
    14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
sl@0
    15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
sl@0
    16
 * GNU General Public License for more details.
sl@0
    17
 * 
sl@0
    18
 * You should have received a copy of the GNU General Public License
sl@0
    19
 * along with this program; if not, write to the Free Software
sl@0
    20
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
sl@0
    21
 *
sl@0
    22
 */
sl@0
    23
sl@0
    24
#ifndef BUS_CONNECTION_H
sl@0
    25
#define BUS_CONNECTION_H
sl@0
    26
sl@0
    27
#include <dbus/dbus.h>
sl@0
    28
#ifndef __SYMBIAN32__
sl@0
    29
#include <dbus/dbus-list.h>
sl@0
    30
#else
sl@0
    31
#include "dbus-list.h"
sl@0
    32
#endif //__SYMBIAN32__
sl@0
    33
#include "bus.h"
sl@0
    34
sl@0
    35
typedef dbus_bool_t (* BusConnectionForeachFunction) (DBusConnection *connection, 
sl@0
    36
                                                      void           *data);
sl@0
    37
sl@0
    38
sl@0
    39
BusConnections* bus_connections_new               (BusContext                   *context);
sl@0
    40
BusConnections* bus_connections_ref               (BusConnections               *connections);
sl@0
    41
void            bus_connections_unref             (BusConnections               *connections);
sl@0
    42
dbus_bool_t     bus_connections_setup_connection  (BusConnections               *connections,
sl@0
    43
                                                   DBusConnection               *connection);
sl@0
    44
void            bus_connections_foreach           (BusConnections               *connections,
sl@0
    45
                                                   BusConnectionForeachFunction  function,
sl@0
    46
                                                   void                         *data);
sl@0
    47
void            bus_connections_foreach_active    (BusConnections               *connections,
sl@0
    48
                                                   BusConnectionForeachFunction  function,
sl@0
    49
                                                   void                         *data);
sl@0
    50
BusContext*     bus_connections_get_context       (BusConnections               *connections);
sl@0
    51
void            bus_connections_increment_stamp   (BusConnections               *connections);
sl@0
    52
BusContext*     bus_connection_get_context        (DBusConnection               *connection);
sl@0
    53
BusConnections* bus_connection_get_connections    (DBusConnection               *connection);
sl@0
    54
BusRegistry*    bus_connection_get_registry       (DBusConnection               *connection);
sl@0
    55
BusActivation*  bus_connection_get_activation     (DBusConnection               *connection);
sl@0
    56
BusMatchmaker*  bus_connection_get_matchmaker     (DBusConnection               *connection);
sl@0
    57
BusSELinuxID*   bus_connection_get_selinux_id     (DBusConnection               *connection);
sl@0
    58
dbus_bool_t     bus_connections_check_limits      (BusConnections               *connections,
sl@0
    59
                                                   DBusConnection               *requesting_completion,
sl@0
    60
                                                   DBusError                    *error);
sl@0
    61
void            bus_connections_expire_incomplete (BusConnections               *connections);
sl@0
    62
sl@0
    63
dbus_bool_t     bus_connections_expect_reply      (BusConnections               *connections,
sl@0
    64
                                                   BusTransaction               *transaction,
sl@0
    65
                                                   DBusConnection               *will_get_reply,
sl@0
    66
                                                   DBusConnection               *will_send_reply,
sl@0
    67
                                                   DBusMessage                  *reply_to_this,
sl@0
    68
                                                   DBusError                    *error);
sl@0
    69
dbus_bool_t     bus_connections_check_reply       (BusConnections               *connections,
sl@0
    70
                                                   BusTransaction               *transaction,
sl@0
    71
                                                   DBusConnection               *sending_reply,
sl@0
    72
                                                   DBusConnection               *receiving_reply,
sl@0
    73
                                                   DBusMessage                  *reply,
sl@0
    74
                                                   DBusError                    *error);
sl@0
    75
sl@0
    76
dbus_bool_t     bus_connection_mark_stamp         (DBusConnection               *connection);
sl@0
    77
sl@0
    78
dbus_bool_t bus_connection_is_active (DBusConnection *connection);
sl@0
    79
const char *bus_connection_get_name  (DBusConnection *connection);
sl@0
    80
sl@0
    81
dbus_bool_t bus_connection_preallocate_oom_error (DBusConnection *connection);
sl@0
    82
void        bus_connection_send_oom_error        (DBusConnection *connection,
sl@0
    83
                                                  DBusMessage    *in_reply_to);
sl@0
    84
sl@0
    85
/* called by signals.c */
sl@0
    86
dbus_bool_t bus_connection_add_match_rule      (DBusConnection *connection,
sl@0
    87
                                                BusMatchRule   *rule);
sl@0
    88
void        bus_connection_add_match_rule_link (DBusConnection *connection,
sl@0
    89
                                                DBusList       *link);
sl@0
    90
void        bus_connection_remove_match_rule   (DBusConnection *connection,
sl@0
    91
                                                BusMatchRule   *rule);
sl@0
    92
int         bus_connection_get_n_match_rules   (DBusConnection *connection);
sl@0
    93
sl@0
    94
sl@0
    95
/* called by services.c */
sl@0
    96
dbus_bool_t bus_connection_add_owned_service      (DBusConnection *connection,
sl@0
    97
                                                   BusService     *service);
sl@0
    98
void        bus_connection_remove_owned_service   (DBusConnection *connection,
sl@0
    99
                                                   BusService     *service);
sl@0
   100
void        bus_connection_add_owned_service_link (DBusConnection *connection,
sl@0
   101
                                                   DBusList       *link);
sl@0
   102
int         bus_connection_get_n_services_owned   (DBusConnection *connection);
sl@0
   103
sl@0
   104
/* called by driver.c */
sl@0
   105
dbus_bool_t bus_connection_complete (DBusConnection               *connection,
sl@0
   106
				     const DBusString             *name,
sl@0
   107
                                     DBusError                    *error);
sl@0
   108
sl@0
   109
/* called by dispatch.c when the connection is dropped */
sl@0
   110
void        bus_connection_disconnected (DBusConnection *connection);
sl@0
   111
sl@0
   112
dbus_bool_t      bus_connection_is_in_group (DBusConnection       *connection,
sl@0
   113
                                             unsigned long         gid);
sl@0
   114
dbus_bool_t      bus_connection_get_groups  (DBusConnection       *connection,
sl@0
   115
                                             unsigned long       **groups,
sl@0
   116
                                             int                  *n_groups,
sl@0
   117
                                             DBusError            *error);
sl@0
   118
BusClientPolicy* bus_connection_get_policy  (DBusConnection       *connection);
sl@0
   119
sl@0
   120
/* transaction API so we can send or not send a block of messages as a whole */
sl@0
   121
sl@0
   122
typedef void (* BusTransactionCancelFunction) (void *data);
sl@0
   123
sl@0
   124
BusTransaction* bus_transaction_new              (BusContext                   *context);
sl@0
   125
BusContext*     bus_transaction_get_context      (BusTransaction               *transaction);
sl@0
   126
BusConnections* bus_transaction_get_connections  (BusTransaction               *transaction);
sl@0
   127
dbus_bool_t     bus_transaction_send             (BusTransaction               *transaction,
sl@0
   128
                                                  DBusConnection               *connection,
sl@0
   129
                                                  DBusMessage                  *message);
sl@0
   130
dbus_bool_t     bus_transaction_send_from_driver (BusTransaction               *transaction,
sl@0
   131
                                                  DBusConnection               *connection,
sl@0
   132
                                                  DBusMessage                  *message);
sl@0
   133
dbus_bool_t     bus_transaction_send_error_reply (BusTransaction               *transaction,
sl@0
   134
                                                  DBusConnection               *connection,
sl@0
   135
                                                  const DBusError              *error,
sl@0
   136
                                                  DBusMessage                  *in_reply_to);
sl@0
   137
void            bus_transaction_cancel_and_free  (BusTransaction               *transaction);
sl@0
   138
void            bus_transaction_execute_and_free (BusTransaction               *transaction);
sl@0
   139
dbus_bool_t     bus_transaction_add_cancel_hook  (BusTransaction               *transaction,
sl@0
   140
                                                  BusTransactionCancelFunction  cancel_function,
sl@0
   141
                                                  void                         *data,
sl@0
   142
                                                  DBusFreeFunction              free_data_function);
sl@0
   143
sl@0
   144
#endif /* BUS_CONNECTION_H */