1 /*<private_header>*/ 2 /* 3 * Context objects for TpBaseClient calls (internal) 4 * 5 * Copyright (C) 2009 Collabora Ltd. <http://www.collabora.co.uk/> 6 * 7 * This library is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU Lesser General Public 9 * License as published by the Free Software Foundation; either 10 * version 2.1 of the License, or (at your option) any later version. 11 * 12 * This library is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 * Lesser General Public License for more details. 16 * 17 * You should have received a copy of the GNU Lesser General Public 18 * License along with this library; if not, write to the Free Software 19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 */ 21 22 #ifndef __TP_OBSERVE_CHANNELS_CONTEXT_INTERNAL_H__ 23 #define __TP_OBSERVE_CHANNELS_CONTEXT_INTERNAL_H__ 24 25 #include <dbus/dbus-glib.h> 26 27 #include <telepathy-glib/account.h> 28 #include <telepathy-glib/channel-dispatch-operation.h> 29 #include <telepathy-glib/observe-channels-context.h> 30 31 G_BEGIN_DECLS 32 33 typedef enum 34 { 35 TP_OBSERVE_CHANNELS_CONTEXT_STATE_NONE, 36 TP_OBSERVE_CHANNELS_CONTEXT_STATE_DONE, 37 TP_OBSERVE_CHANNELS_CONTEXT_STATE_FAILED, 38 TP_OBSERVE_CHANNELS_CONTEXT_STATE_DELAYED, 39 } TpObserveChannelsContextState; 40 41 struct _TpObserveChannelsContext { 42 /*<private>*/ 43 GObject parent; 44 TpObserveChannelsContextPrivate *priv; 45 46 TpAccount *account; 47 TpConnection *connection; 48 /* array of reffed TpChannel */ 49 GPtrArray *channels; 50 /* Reffed TpChannelDispatchOperation, or NULL */ 51 TpChannelDispatchOperation *dispatch_operation; 52 /* Array of reffed TpChannelRequest */ 53 GPtrArray *requests; 54 GHashTable *observer_info; 55 }; 56 57 TpObserveChannelsContext * _tp_observe_channels_context_new ( 58 TpAccount *account, 59 TpConnection *connection, 60 GPtrArray *channels, 61 TpChannelDispatchOperation *dispatch_operation, 62 GPtrArray *requests, 63 GHashTable *observer_info, 64 DBusGMethodInvocation *dbus_context); 65 66 TpObserveChannelsContextState _tp_observe_channels_context_get_state ( 67 TpObserveChannelsContext *self); 68 69 void _tp_observe_channels_context_prepare_async (TpObserveChannelsContext *self, 70 const GQuark *account_features, 71 const GQuark *connection_features, 72 const GQuark *channel_features, 73 GAsyncReadyCallback callback, 74 gpointer user_data); 75 76 gboolean _tp_observe_channels_context_prepare_finish ( 77 TpObserveChannelsContext *self, 78 GAsyncResult *result, 79 GError **error); 80 81 G_END_DECLS 82 83 #endif 84