1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 * Copyright (C) 2007 Marco Barisione <marco@barisione.org>
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.
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.
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 #ifndef __EMPATHY_FILE_H__
21 #define __EMPATHY_FILE_H__
26 #include <telepathy-glib/channel.h>
27 #include <libtelepathy/tp-constants.h>
29 #include <extensions/extensions.h>
31 #include "empathy-contact.h"
33 #include <libmissioncontrol/mc-account.h>
35 /* Forward-declaration to resolve cyclic dependencies */
36 typedef struct _EmpathyFile EmpathyFile;
38 #include "empathy-file.h"
42 #define EMPATHY_FILE_UNKNOWN_SIZE G_MAXUINT64
44 #define EMPATHY_TYPE_FILE (empathy_file_get_type ())
45 #define EMPATHY_FILE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), EMPATHY_TYPE_FILE, EmpathyFile))
46 #define EMPATHY_FILE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), EMPATHY_TYPE_FILE, EmpathyFileClass))
47 #define EMPATHY_IS_FILE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), EMPATHY_TYPE_FILE))
48 #define EMPATHY_IS_FILE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), EMPATHY_TYPE_FILE))
49 #define EMPATHY_FILE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), EMPATHY_TYPE_FILE, EmpathyFileClass))
51 typedef struct _EmpathyFileClass EmpathyFileClass;
58 struct _EmpathyFileClass
60 GObjectClass parent_class;
63 GType empathy_file_get_type (void) G_GNUC_CONST;
65 EmpathyFile *empathy_file_new (McAccount *account, TpChannel *channel);
67 TpChannel *empathy_file_get_channel (EmpathyFile *file);
68 void empathy_file_accept (EmpathyFile *file);
69 void empathy_file_cancel (EmpathyFile *file);
71 const gchar *empathy_file_get_id (EmpathyFile *file);
72 guint64 empathy_file_get_transferred_bytes (EmpathyFile *file);
73 EmpathyContact *empathy_file_get_contact (EmpathyFile *file);
74 GInputStream *empathy_file_get_input_stream (EmpathyFile *file);
75 GOutputStream *empathy_file_get_output_stream (EmpathyFile *file);
76 const gchar *empathy_file_get_filename (EmpathyFile *file);
77 EmpFileTransferDirection empathy_file_get_direction (EmpathyFile *file);
78 EmpFileTransferState empathy_file_get_state (EmpathyFile *file);
79 EmpFileTransferStateChangeReason empathy_file_get_state_change_reason (EmpathyFile *file);
80 guint64 empathy_file_get_size (EmpathyFile *file);
81 guint64 empathy_file_get_transferred_bytes (EmpathyFile *file);
82 gint empathy_file_get_remaining_time (EmpathyFile *file);
84 void empathy_file_set_input_stream (EmpathyFile *file, GInputStream *uri);
85 void empathy_file_set_output_stream (EmpathyFile *file, GOutputStream *uri);
86 void empathy_file_set_filename (EmpathyFile *file, const gchar *filename);
90 #endif /* __EMPATHY_FILE_H__ */