]> git.0d.be Git - empathy.git/blob - libempathy/empathy-tp-file.h
Don't set NM presence state on connect when it was unset
[empathy.git] / libempathy / empathy-tp-file.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3  * Copyright (C) 2007-2008 Collabora Ltd.
4  * Copyright (C) 2007 Marco Barisione <marco@barisione.org>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19  *
20  * Authors: Marco Barisione <marco@barisione.org>
21  *          Jonny Lamb <jonny.lamb@collabora.co.uk>
22  */
23
24 #ifndef __EMPATHY_TP_FILE_H__
25 #define __EMPATHY_TP_FILE_H__
26
27 #include <gio/gio.h>
28 #include <glib.h>
29
30 #include <telepathy-glib/channel.h>
31
32 #include "empathy-contact.h"
33
34 #include <libmissioncontrol/mc-account.h>
35
36 G_BEGIN_DECLS
37
38 #define EMPATHY_TP_FILE_UNKNOWN_SIZE G_MAXUINT64
39
40 #define EMPATHY_TYPE_TP_FILE         (empathy_tp_file_get_type ())
41 #define EMPATHY_TP_FILE(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), EMPATHY_TYPE_TP_FILE, EmpathyTpFile))
42 #define EMPATHY_TP_FILE_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), EMPATHY_TYPE_TP_FILE, EmpathyTpFileClass))
43 #define EMPATHY_IS_TP_FILE(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), EMPATHY_TYPE_TP_FILE))
44 #define EMPATHY_IS_TP_FILE_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), EMPATHY_TYPE_TP_FILE))
45 #define EMPATHY_TP_FILE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), EMPATHY_TYPE_TP_FILE, EmpathyTpFileClass))
46
47 typedef struct _EmpathyTpFile EmpathyTpFile;
48 typedef struct _EmpathyTpFilePriv EmpathyTpFilePriv;
49 typedef struct _EmpathyTpFileClass EmpathyTpFileClass;
50
51 struct _EmpathyTpFile
52 {
53   GObject      parent;
54
55   /*<private>*/
56   EmpathyTpFilePriv *priv;
57 };
58
59 struct _EmpathyTpFileClass
60 {
61   GObjectClass parent_class;
62 };
63
64 GType empathy_tp_file_get_type (void) G_GNUC_CONST;
65
66 EmpathyTpFile *empathy_tp_file_new (TpChannel *channel);
67
68 TpChannel *empathy_tp_file_get_channel (EmpathyTpFile *tp_file);
69 void empathy_tp_file_accept (EmpathyTpFile *tp_file, guint64 offset,
70   GFile *gfile, GError **error);
71 void empathy_tp_file_cancel (EmpathyTpFile *tp_file);
72 void empathy_tp_file_offer (EmpathyTpFile *tp_file, GFile *gfile,
73   GError **error);
74
75 EmpathyContact *empathy_tp_file_get_contact (EmpathyTpFile *tp_file);
76 const gchar *empathy_tp_file_get_filename (EmpathyTpFile *tp_file);
77 gboolean empathy_tp_file_is_incoming (EmpathyTpFile *tp_file);
78 TpFileTransferState empathy_tp_file_get_state (
79   EmpathyTpFile *tp_file, TpFileTransferStateChangeReason *reason);
80 guint64 empathy_tp_file_get_size (EmpathyTpFile *tp_file);
81 guint64 empathy_tp_file_get_transferred_bytes (EmpathyTpFile *tp_file);
82 gint empathy_tp_file_get_remaining_time (EmpathyTpFile *tp_file);
83 gdouble empathy_tp_file_get_speed (EmpathyTpFile *tp_file);
84 const gchar *empathy_tp_file_get_content_type (EmpathyTpFile *tp_file);
85 gboolean empathy_tp_file_is_ready (EmpathyTpFile *tp_file);
86
87 G_END_DECLS
88
89 #endif /* __EMPATHY_TP_FILE_H__ */