libtelepathy/inc/tp-connmgr.h
changeset 10 59927b2d3b75
parent 0 d0f3a028347a
equal deleted inserted replaced
0:d0f3a028347a 10:59927b2d3b75
     1 /* tp-connmgr.h
       
     2  *
       
     3  * 
       
     4  * Copyright (C) 2005 Collabora Ltd.
       
     5  * This library is free software; you can redistribute it and/or
       
     6  * modify it under the terms of the GNU Lesser General Public
       
     7  * License as published by the Free Software Foundation; either
       
     8  * version 2.1 of the License, or (at your option) any later version.
       
     9  *
       
    10  * This library is distributed in the hope that it will be useful,
       
    11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
       
    13  * Lesser General Public License for more details.
       
    14  *
       
    15  * You should have received a copy of the GNU Lesser General Public
       
    16  * License along with this library; if not, write to the Free Software
       
    17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
       
    18  *
       
    19  */
       
    20 
       
    21 
       
    22 
       
    23 #ifndef TP_CONNMGR_H
       
    24 #define TP_CONNMGR_H
       
    25 
       
    26 #ifndef DBUS_API_SUBJECT_TO_CHANGE
       
    27 #define DBUS_API_SUBJECT_TO_CHANGE
       
    28 #endif
       
    29 
       
    30 #include "tp-connmgr-gen.h"
       
    31 #include "tp-conn.h"
       
    32 #include <dbus/dbus-glib.h>
       
    33 #include <dbus/dbus-glib-lowlevel.h>
       
    34 #include <dbus/dbus.h>
       
    35 #include <glib.h>
       
    36 
       
    37 
       
    38 
       
    39 #define TELEPATHY_CONNMGR_TYPE  (tp_connmgr_get_type ())
       
    40 
       
    41 #define TELEPATHY_CONNMGR(obj)  (G_TYPE_CHECK_INSTANCE_CAST \
       
    42 		                    ((obj), TELEPATHY_CONNMGR_TYPE, \
       
    43 				     TpConnMgr))
       
    44 
       
    45 #define TELEPATHY_CONNMGR_CLASS(klass)  (G_TYPE_CHECK_CLASS_CAST \
       
    46 		                          ((klass), TELEPATHY_CONNMGR_TYPE, \
       
    47 					  TpConnMgrClass))
       
    48 
       
    49 #define TELEPATHY_IS_CONNMGR(obj)    (G_TYPE_CHECK_INSTANCE_TYPE \
       
    50 		                      ((obj), TELEPATHY_CONNMGR_TYPE))
       
    51 
       
    52 #define TELEPATHY_IS_CONNMGR_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE \
       
    53 		                           ((klass), TELEPATHY_CONNMGR_TYPE))
       
    54 
       
    55 #define TELEPATHY_CONNMGR_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS \
       
    56 		                            ((obj), TELEPATHY_CONNMGR_TYPE, \
       
    57 					    TpConnMgrClass))
       
    58 
       
    59 typedef struct _tp_connmgr TpConnMgr;
       
    60 typedef struct _tp_connmgrclass TpConnMgrClass;
       
    61 
       
    62 struct _tp_connmgr
       
    63 {
       
    64   DBusGProxy parent;
       
    65 
       
    66   gboolean first_run;
       
    67 };
       
    68 
       
    69 struct _tp_connmgrclass
       
    70 {
       
    71   DBusGProxyClass parent_class;
       
    72 };
       
    73 
       
    74 GType tp_connmgr_get_type(void);
       
    75 
       
    76 /* Actual function definitions */
       
    77 
       
    78 
       
    79 /*
       
    80 * Creates a new TpConnmgr (Connection Manager) object.
       
    81 * @param connection: A connection to the D-BUS.
       
    82 * @param name: The service name for the connection manager
       
    83 * @param path_name: The path name for the connection manager
       
    84 * @param interface_name: The interface name for the connection manager
       
    85 * @return A new Connection Manager object, or NULL if failed
       
    86 */
       
    87 
       
    88 #ifdef __cplusplus
       
    89 extern "C"
       
    90 {
       
    91 #endif
       
    92 #ifdef SYMBIAN
       
    93 IMPORT_C 
       
    94 #endif 
       
    95 TpConnMgr *tp_connmgr_new(DBusGConnection *connection,
       
    96 			const char *bus_name,
       
    97 			const char *object_path,
       
    98 			const char *interface_name);	
       
    99  #ifdef __cplusplus
       
   100 }
       
   101 #endif
       
   102 
       
   103 
       
   104 
       
   105 /* 
       
   106  * Creates a new TpConn object for this connection manager.
       
   107  * Also initializes a DBusGProxy object that is used to perform the
       
   108  * actual method calls. Thus, the connection should be usable
       
   109  * if this succeeds.
       
   110  * 
       
   111  * @param self: The connection manager object that the new connection
       
   112  * object is created for.  
       
   113  * @param connection_parameters: The parameters for the connection.
       
   114  * @protocol: The protocol for the connection.
       
   115  *
       
   116  * @return A TpConn object, or NULL if object could not be created.
       
   117  */
       
   118 
       
   119 
       
   120 #ifdef __cplusplus
       
   121 extern "C"
       
   122 {
       
   123 #endif
       
   124 #ifdef SYMBIAN
       
   125 IMPORT_C 
       
   126 #endif 
       
   127 TpConn *tp_connmgr_new_connection(TpConnMgr *self,
       
   128 				  GHashTable *connection_parameters,
       
   129 				  gchar *protocol);
       
   130 #ifdef __cplusplus
       
   131 }
       
   132 #endif
       
   133 
       
   134 
       
   135 
       
   136 
       
   137 #ifdef __cplusplus
       
   138 extern "C"
       
   139 {
       
   140 #endif
       
   141 #ifdef SYMBIAN
       
   142 IMPORT_C 
       
   143 #endif 
       
   144 gboolean tp_connmgr_list_protocols(TpConnMgr *self, char *** proto);
       
   145 #ifdef __cplusplus
       
   146 }
       
   147 #endif
       
   148 
       
   149 
       
   150 
       
   151 #ifdef __cplusplus
       
   152 extern "C"
       
   153 {
       
   154 #endif
       
   155 #ifdef SYMBIAN
       
   156 IMPORT_C 
       
   157 #endif 
       
   158 gboolean tp_connmgr_get_parameters (TpConnMgr *self, const char * IN_proto, GPtrArray** OUT_arg1);
       
   159 #ifdef __cplusplus
       
   160 }
       
   161 #endif
       
   162 
       
   163 
       
   164 
       
   165 
       
   166 #endif
       
   167