]> git.0d.be Git - empathy.git/blob - libempathy/empathy-file.h
Removed pointless gio-2.0 deps in megaphone, nothere, and python. (Jonny Lamb)
[empathy.git] / libempathy / empathy-file.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3  * Copyright (C) 2007 Marco Barisione <marco@barisione.org>
4  *
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., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18  */
19
20 #ifndef __EMPATHY_FILE_H__
21 #define __EMPATHY_FILE_H__
22
23 #include <gio/gio.h>
24 #include <glib.h>
25
26 #include <telepathy-glib/channel.h>
27 #include <libtelepathy/tp-constants.h>
28
29 #include <extensions/extensions.h>
30
31 #include "empathy-contact.h"
32
33 #include <libmissioncontrol/mc-account.h>
34
35 /* Forward-declaration to resolve cyclic dependencies */
36 typedef struct _EmpathyFile      EmpathyFile;
37
38 #include "empathy-file.h"
39
40 G_BEGIN_DECLS
41
42 #define EMPATHY_FILE_UNKNOWN_SIZE G_MAXUINT64
43
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))
50
51 typedef struct _EmpathyFileClass EmpathyFileClass;
52
53 struct _EmpathyFile
54 {
55   GObject      parent;
56 };
57
58 struct _EmpathyFileClass
59 {
60   GObjectClass parent_class;
61 };
62
63 GType empathy_file_get_type (void) G_GNUC_CONST;
64
65 EmpathyFile *empathy_file_new (McAccount *account, TpChannel *channel);
66
67 TpChannel *empathy_file_get_channel (EmpathyFile *file);
68 void empathy_file_accept (EmpathyFile *file);
69 void empathy_file_cancel (EmpathyFile *file);
70
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);
83
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);
87
88 G_END_DECLS
89
90 #endif /* __EMPATHY_FILE_H__ */