ofdbus/dbus/bus/services.h
changeset 0 e4d67989cc36
equal deleted inserted replaced
-1:000000000000 0:e4d67989cc36
       
     1 /* -*- mode: C; c-file-style: "gnu" -*- */
       
     2 /* services.h  Service management
       
     3  *
       
     4  * Copyright (C) 2003  Red Hat, Inc.
       
     5  * Portion Copyright © 2008 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
       
     6  * Licensed under the Academic Free License version 2.1
       
     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 
       
    24 #ifndef BUS_SERVICES_H
       
    25 #define BUS_SERVICES_H
       
    26 
       
    27 #include <dbus/dbus.h>
       
    28 #ifndef __SYMBIAN32__
       
    29 #include <dbus/dbus-string.h>
       
    30 #include <dbus/dbus-hash.h>
       
    31 #else
       
    32 #include "dbus-string.h"
       
    33 #include "dbus-hash.h"
       
    34 #endif //__SYMBIAN32__
       
    35 #include "connection.h"
       
    36 #include "bus.h"
       
    37 
       
    38 typedef void (* BusServiceForeachFunction) (BusService       *service,
       
    39                                             void             *data);
       
    40 
       
    41 BusRegistry* bus_registry_new             (BusContext                  *context);
       
    42 BusRegistry* bus_registry_ref             (BusRegistry                 *registry);
       
    43 void         bus_registry_unref           (BusRegistry                 *registry);
       
    44 BusService*  bus_registry_lookup          (BusRegistry                 *registry,
       
    45                                            const DBusString            *service_name);
       
    46 BusService*  bus_registry_ensure          (BusRegistry                 *registry,
       
    47                                            const DBusString            *service_name,
       
    48                                            DBusConnection              *owner_connection_if_created,
       
    49 					   dbus_uint32_t                flags,
       
    50                                            BusTransaction              *transaction,
       
    51                                            DBusError                   *error);
       
    52 void         bus_registry_foreach         (BusRegistry                 *registry,
       
    53                                            BusServiceForeachFunction    function,
       
    54                                            void                        *data);
       
    55 dbus_bool_t  bus_registry_list_services   (BusRegistry                 *registry,
       
    56                                            char                      ***listp,
       
    57                                            int                         *array_len);
       
    58 dbus_bool_t  bus_registry_acquire_service (BusRegistry                 *registry,
       
    59                                            DBusConnection              *connection,
       
    60                                            const DBusString            *service_name,
       
    61                                            dbus_uint32_t                flags,
       
    62                                            dbus_uint32_t               *result,
       
    63                                            BusTransaction              *transaction,
       
    64                                            DBusError                   *error);
       
    65 dbus_bool_t  bus_registry_release_service (BusRegistry                 *registry,
       
    66                                            DBusConnection              *connection,
       
    67                                            const DBusString            *service_name,
       
    68                                            dbus_uint32_t               *result,
       
    69                                            BusTransaction              *transaction,
       
    70                                            DBusError                   *error);
       
    71 dbus_bool_t  bus_registry_set_service_context_table (BusRegistry           *registry,
       
    72 						     DBusHashTable         *table);
       
    73 
       
    74 BusService*     bus_service_ref                       (BusService     *service);
       
    75 void            bus_service_unref                     (BusService     *service);
       
    76 dbus_bool_t     bus_service_add_owner                 (BusService     *service,
       
    77                                                        DBusConnection *connection,
       
    78 						       dbus_uint32_t   flags,
       
    79                                                        BusTransaction *transaction,
       
    80                                                        DBusError      *error);
       
    81 dbus_bool_t     bus_service_swap_owner                (BusService     *service,
       
    82                                                        DBusConnection *connection,
       
    83                                                        BusTransaction *transaction,
       
    84                                                        DBusError      *error);
       
    85 dbus_bool_t     bus_service_remove_owner              (BusService     *service,
       
    86                                                        DBusConnection *connection,
       
    87                                                        BusTransaction *transaction,
       
    88                                                        DBusError      *error);
       
    89 dbus_bool_t     bus_service_has_owner                 (BusService     *service,
       
    90                                                        DBusConnection *connection);
       
    91 BusOwner*       bus_service_get_primary_owner         (BusService     *service);
       
    92 dbus_bool_t     bus_service_get_allow_replacement     (BusService     *service);
       
    93 const char*     bus_service_get_name                  (BusService     *service);
       
    94 dbus_bool_t     bus_service_list_queued_owners        (BusService *service,
       
    95                                                        DBusList  **return_list,
       
    96                                                        DBusError  *error);
       
    97 
       
    98 DBusConnection* bus_service_get_primary_owners_connection (BusService     *service);
       
    99 #endif /* BUS_SERVICES_H */