1 /* 2 * file-transfer-channel.h - Header for SalutFileTransferChannel 3 * Copyright (C) 2007 Marco Barisione <marco@barisione.org> 4 * Copyright (C) 2005, 2007, 2008 Collabora Ltd. 5 * @author: Sjoerd Simons <sjoerd@luon.net> 6 * @author: Jonny Lamb <jonny.lamb@collabora.co.uk> 7 * @author: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> 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, 15 * but 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 02110-1301 USA 22 */ 23 24 #ifndef __SALUT_FILE_TRANSFER_CHANNEL_H__ 25 #define __SALUT_FILE_TRANSFER_CHANNEL_H__ 26 27 #include <glib-object.h> 28 #include <gibber/gibber-file-transfer.h> 29 30 #include <extensions/_gen/svc.h> 31 #include <extensions/_gen/interfaces.h> 32 #include <extensions/_gen/enums.h> 33 34 #include <telepathy-glib/base-channel.h> 35 36 #include "contact.h" 37 #include "connection.h" 38 #include "contact.h" 39 40 G_BEGIN_DECLS 41 42 typedef struct _SalutFileTransferChannel SalutFileTransferChannel; 43 typedef struct _SalutFileTransferChannelClass SalutFileTransferChannelClass; 44 typedef struct _SalutFileTransferChannelPrivate SalutFileTransferChannelPrivate; 45 46 struct _SalutFileTransferChannelClass { 47 TpBaseChannelClass parent_class; 48 TpDBusPropertiesMixinClass dbus_props_class; 49 }; 50 51 struct _SalutFileTransferChannel { 52 TpBaseChannel parent; 53 54 SalutFileTransferChannelPrivate *priv; 55 }; 56 57 GType salut_file_transfer_channel_get_type (void); 58 59 /* TYPE MACROS */ 60 #define SALUT_TYPE_FILE_TRANSFER_CHANNEL \ 61 (salut_file_transfer_channel_get_type ()) 62 #define SALUT_FILE_TRANSFER_CHANNEL(obj) \ 63 (G_TYPE_CHECK_INSTANCE_CAST((obj), SALUT_TYPE_FILE_TRANSFER_CHANNEL, SalutFileTransferChannel)) 64 #define SALUT_FILE_TRANSFER_CHANNEL_CLASS(klass) \ 65 (G_TYPE_CHECK_CLASS_CAST((klass), SALUT_TYPE_FILE_TRANSFER_CHANNEL, \ 66 SalutFileTransferChannelClass)) 67 #define SALUT_IS_FILE_TRANSFER_CHANNEL(obj) \ 68 (G_TYPE_CHECK_INSTANCE_TYPE((obj), SALUT_TYPE_FILE_TRANSFER_CHANNEL)) 69 #define SALUT_IS_FILE_TRANSFER_CHANNEL_CLASS(klass) \ 70 (G_TYPE_CHECK_CLASS_TYPE((klass), SALUT_TYPE_FILE_TRANSFER_CHANNEL)) 71 #define SALUT_FILE_TRANSFER_CHANNEL_GET_CLASS(obj) \ 72 (G_TYPE_INSTANCE_GET_CLASS ((obj), SALUT_TYPE_FILE_TRANSFER_CHANNEL, \ 73 SalutFileTransferChannelClass)) 74 75 gboolean salut_file_transfer_channel_offer_file (SalutFileTransferChannel *self, 76 GError **error); 77 78 SalutFileTransferChannel * salut_file_transfer_channel_new ( 79 SalutConnection *conn, SalutContact *contact, 80 TpHandle handle, TpHandle initiator_handle, 81 TpFileTransferState state, const gchar *content_type, 82 const gchar *filename, guint64 size, TpFileHashType hash_type, 83 const gchar *content_hash, const gchar *description, guint64 date, 84 guint64 initial_offset, const gchar *file_uri, 85 const gchar *service_name, const GHashTable *metadata); 86 87 SalutFileTransferChannel * salut_file_transfer_channel_new_from_stanza ( 88 SalutConnection *connection, SalutContact *contact, 89 TpHandle handle, 90 TpFileTransferState state, WockyStanza *stanza); 91 92 G_END_DECLS 93 94 #endif /* #ifndef __SALUT_FILE_TRANSFER_CHANNEL_H__*/ 95