1 /* vi: set et sw=4 ts=8 cino=t0,(0: */ 2 /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 8 -*- */ 3 /* 4 * Keep track of which handlers own which channels. 5 * 6 * Copyright (C) 2009 Nokia Corporation 7 * Copyright (C) 2009 Collabora Ltd. 8 * 9 * This library is free software; you can redistribute it and/or 10 * modify it under the terms of the GNU Lesser General Public 11 * License as published by the Free Software Foundation; either 12 * version 2.1 of the License, or (at your option) any later version. 13 * 14 * This library is distributed in the hope that it will be useful, but 15 * WITHOUT ANY WARRANTY; without even the implied warranty of 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 * Lesser General Public License for more details. 18 * 19 * You should have received a copy of the GNU Lesser General Public 20 * License along with this library; if not, write to the Free Software 21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 22 * 02110-1301 USA 23 * 24 */ 25 26 #ifndef MCD_HANDLER_MAP_H_ 27 #define MCD_HANDLER_MAP_H_ 28 29 #include <telepathy-glib/telepathy-glib.h> 30 31 G_BEGIN_DECLS 32 33 typedef struct _McdHandlerMap McdHandlerMap; 34 typedef struct _McdHandlerMapClass McdHandlerMapClass; 35 typedef struct _McdHandlerMapPrivate McdHandlerMapPrivate; 36 37 GType _mcd_handler_map_get_type (void); 38 39 #define MCD_TYPE_HANDLER_MAP \ 40 (_mcd_handler_map_get_type ()) 41 #define MCD_HANDLER_MAP(obj) \ 42 (G_TYPE_CHECK_INSTANCE_CAST ((obj), MCD_TYPE_HANDLER_MAP, \ 43 McdHandlerMap)) 44 #define MCD_HANDLER_MAP_CLASS(klass) \ 45 (G_TYPE_CHECK_CLASS_CAST ((klass), MCD_TYPE_HANDLER_MAP, \ 46 McdHandlerMapClass)) 47 #define MCD_IS_HANDLER_MAP(obj) \ 48 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MCD_TYPE_HANDLER_MAP)) 49 #define MCD_IS_HANDLER_MAP_CLASS(klass) \ 50 (G_TYPE_CHECK_CLASS_TYPE ((klass), MCD_TYPE_HANDLER_MAP)) 51 #define MCD_HANDLER_MAP_GET_CLASS(obj) \ 52 (G_TYPE_INSTANCE_GET_CLASS ((obj), MCD_TYPE_HANDLER_MAP, \ 53 McdHandlerMapClass)) 54 55 struct _McdHandlerMap 56 { 57 GObject parent; 58 McdHandlerMapPrivate *priv; 59 }; 60 61 struct _McdHandlerMapClass 62 { 63 GObjectClass parent_class; 64 }; 65 66 McdHandlerMap *_mcd_handler_map_new (TpDBusDaemon *dbus_daemon); 67 68 const gchar *_mcd_handler_map_get_handler (McdHandlerMap *self, 69 const gchar *channel_path, 70 const gchar **well_known_name); 71 72 void _mcd_handler_map_set_path_handled (McdHandlerMap *self, 73 const gchar *channel_path, 74 const gchar *unique_name, 75 const gchar *well_known_name); 76 77 void _mcd_handler_map_set_channel_handled (McdHandlerMap *self, 78 TpChannel *channel, 79 const gchar *unique_name, 80 const gchar *well_known_name, 81 const gchar *account_path); 82 83 GList *_mcd_handler_map_get_handled_channels (McdHandlerMap *self); 84 85 const gchar *_mcd_handler_map_get_channel_account (McdHandlerMap *self, 86 const gchar *channel_path); 87 88 void _mcd_handler_map_set_channel_handled_internally (McdHandlerMap *self, 89 TpChannel *channel, 90 const gchar *account_path); 91 92 G_END_DECLS 93 94 #endif 95