Fri, 06 Sep 2013 18:18:39 +0530
Merged soc.2013.gobjectification branch
| 4514 | 1 | /** |
|
34909
91be147083c6
Started GObjectification of PurpleXfer.
Ankit Vani <a@nevitus.org>
parents:
34878
diff
changeset
|
2 | * @file xfer.h File Transfer API |
|
5034
077678f7b048
[gaim-migrate @ 5377]
Christian Hammond <chipx86@chipx86.com>
parents:
4675
diff
changeset
|
3 | * @ingroup core |
|
20889
3d0ef192f98c
All the links to libpurple signal pages were in the comment containing the
Will Thompson <resiak@pidgin.im>
parents:
20147
diff
changeset
|
4 | * @see @ref xfer-signals |
|
20147
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
5 | */ |
|
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
6 | |
|
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
7 | /* purple |
| 4514 | 8 | * |
| 15884 | 9 | * Purple is the legal property of its developers, whose names are too numerous |
| 8046 | 10 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 11 | * source distribution. | |
| 8231 | 12 | * |
| 4514 | 13 | * This program is free software; you can redistribute it and/or modify |
| 14 | * it under the terms of the GNU General Public License as published by | |
| 15 | * the Free Software Foundation; either version 2 of the License, or | |
| 16 | * (at your option) any later version. | |
| 17 | * | |
| 18 | * This program is distributed in the hope that it will be useful, | |
| 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 21 | * GNU General Public License for more details. | |
| 22 | * | |
| 23 | * You should have received a copy of the GNU General Public License | |
| 24 | * along with this program; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
17852
diff
changeset
|
25 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 4514 | 26 | */ |
|
34909
91be147083c6
Started GObjectification of PurpleXfer.
Ankit Vani <a@nevitus.org>
parents:
34878
diff
changeset
|
27 | #ifndef _PURPLE_XFER_H_ |
|
91be147083c6
Started GObjectification of PurpleXfer.
Ankit Vani <a@nevitus.org>
parents:
34878
diff
changeset
|
28 | #define _PURPLE_XFER_H_ |
| 4514 | 29 | |
|
34909
91be147083c6
Started GObjectification of PurpleXfer.
Ankit Vani <a@nevitus.org>
parents:
34878
diff
changeset
|
30 | #define PURPLE_TYPE_XFER (purple_xfer_get_type()) |
|
91be147083c6
Started GObjectification of PurpleXfer.
Ankit Vani <a@nevitus.org>
parents:
34878
diff
changeset
|
31 | #define PURPLE_XFER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PURPLE_TYPE_XFER, PurpleXfer)) |
|
91be147083c6
Started GObjectification of PurpleXfer.
Ankit Vani <a@nevitus.org>
parents:
34878
diff
changeset
|
32 | #define PURPLE_XFER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), PURPLE_TYPE_XFER, PurpleXferClass)) |
|
91be147083c6
Started GObjectification of PurpleXfer.
Ankit Vani <a@nevitus.org>
parents:
34878
diff
changeset
|
33 | #define PURPLE_IS_XFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), PURPLE_TYPE_XFER)) |
|
91be147083c6
Started GObjectification of PurpleXfer.
Ankit Vani <a@nevitus.org>
parents:
34878
diff
changeset
|
34 | #define PURPLE_IS_XFER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), PURPLE_TYPE_XFER)) |
|
91be147083c6
Started GObjectification of PurpleXfer.
Ankit Vani <a@nevitus.org>
parents:
34878
diff
changeset
|
35 | #define PURPLE_XFER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), PURPLE_TYPE_XFER, PurpleXferClass)) |
|
34792
09228ea79272
Added GBoxed to certificate, certificate pool, xfer, log
Ankit Vani <a@nevitus.org>
parents:
33465
diff
changeset
|
36 | |
| 4514 | 37 | /**************************************************************************/ |
| 38 | /** Data Structures */ | |
| 39 | /**************************************************************************/ | |
|
34909
91be147083c6
Started GObjectification of PurpleXfer.
Ankit Vani <a@nevitus.org>
parents:
34878
diff
changeset
|
40 | /** @copydoc _PurpleXfer */ |
| 15884 | 41 | typedef struct _PurpleXfer PurpleXfer; |
|
34909
91be147083c6
Started GObjectification of PurpleXfer.
Ankit Vani <a@nevitus.org>
parents:
34878
diff
changeset
|
42 | /** @copydoc _PurpleXferClass */ |
|
91be147083c6
Started GObjectification of PurpleXfer.
Ankit Vani <a@nevitus.org>
parents:
34878
diff
changeset
|
43 | typedef struct _PurpleXferClass PurpleXferClass; |
| 4514 | 44 | |
|
12151
8002bb57756b
[gaim-migrate @ 14452]
Richard Laager <rlaager@pidgin.im>
parents:
12150
diff
changeset
|
45 | #include <glib.h> |
|
8002bb57756b
[gaim-migrate @ 14452]
Richard Laager <rlaager@pidgin.im>
parents:
12150
diff
changeset
|
46 | #include <stdio.h> |
|
8002bb57756b
[gaim-migrate @ 14452]
Richard Laager <rlaager@pidgin.im>
parents:
12150
diff
changeset
|
47 | |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
48 | #include "account.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
49 | |
| 4514 | 50 | /** |
| 51 | * Types of file transfers. | |
| 52 | */ | |
| 53 | typedef enum | |
| 54 | { | |
|
34926
c5b444d1447d
Changed prefix of PurpleXferType enums to PURPLE_XFER_TYPE_*
Ankit Vani <a@nevitus.org>
parents:
34924
diff
changeset
|
55 | PURPLE_XFER_TYPE_UNKNOWN = 0, /**< Unknown file transfer type. */ |
|
c5b444d1447d
Changed prefix of PurpleXferType enums to PURPLE_XFER_TYPE_*
Ankit Vani <a@nevitus.org>
parents:
34924
diff
changeset
|
56 | PURPLE_XFER_TYPE_SEND, /**< File sending. */ |
|
c5b444d1447d
Changed prefix of PurpleXferType enums to PURPLE_XFER_TYPE_*
Ankit Vani <a@nevitus.org>
parents:
34924
diff
changeset
|
57 | PURPLE_XFER_TYPE_RECEIVE /**< File receiving. */ |
| 4514 | 58 | |
| 15884 | 59 | } PurpleXferType; |
| 4514 | 60 | |
| 7805 | 61 | /** |
| 62 | * The different states of the xfer. | |
| 63 | */ | |
| 7738 | 64 | typedef enum |
| 65 | { | |
| 15884 | 66 | PURPLE_XFER_STATUS_UNKNOWN = 0, /**< Unknown, the xfer may be null. */ |
| 67 | PURPLE_XFER_STATUS_NOT_STARTED, /**< It hasn't started yet. */ | |
| 68 | PURPLE_XFER_STATUS_ACCEPTED, /**< Receive accepted, but destination file not selected yet */ | |
| 69 | PURPLE_XFER_STATUS_STARTED, /**< purple_xfer_start has been called. */ | |
| 70 | PURPLE_XFER_STATUS_DONE, /**< The xfer completed successfully. */ | |
|
30708
535bec1e66fb
Standardize on "cancelled".
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30131
diff
changeset
|
71 | PURPLE_XFER_STATUS_CANCEL_LOCAL, /**< The xfer was cancelled by us. */ |
|
535bec1e66fb
Standardize on "cancelled".
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30131
diff
changeset
|
72 | PURPLE_XFER_STATUS_CANCEL_REMOTE /**< The xfer was cancelled by the other end, or we couldn't connect. */ |
|
34909
91be147083c6
Started GObjectification of PurpleXfer.
Ankit Vani <a@nevitus.org>
parents:
34878
diff
changeset
|
73 | } PurpleXferStatus; |
| 7738 | 74 | |
| 4514 | 75 | /** |
| 76 | * File transfer UI operations. | |
| 77 | * | |
| 78 | * Any UI representing a file transfer must assign a filled-out | |
| 15884 | 79 | * PurpleXferUiOps structure to the purple_xfer. |
| 4514 | 80 | */ |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
81 | typedef struct |
| 4514 | 82 | { |
| 15884 | 83 | void (*new_xfer)(PurpleXfer *xfer); |
| 84 | void (*destroy)(PurpleXfer *xfer); | |
| 85 | void (*add_xfer)(PurpleXfer *xfer); | |
| 86 | void (*update_progress)(PurpleXfer *xfer, double percent); | |
| 87 | void (*cancel_local)(PurpleXfer *xfer); | |
| 88 | void (*cancel_remote)(PurpleXfer *xfer); | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
89 | |
|
28150
1213ec1efcf8
ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents:
22338
diff
changeset
|
90 | /** |
|
36637
9b0109ae118d
Renamed some prpl stuff to protocol stuff.
Ankit Vani <a@nevitus.org>
parents:
36545
diff
changeset
|
91 | * UI op to write data received from the protocol. The UI must deal with the |
|
28150
1213ec1efcf8
ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents:
22338
diff
changeset
|
92 | * entire buffer and return size, or it is treated as an error. |
|
1213ec1efcf8
ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents:
22338
diff
changeset
|
93 | * |
|
1213ec1efcf8
ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents:
22338
diff
changeset
|
94 | * @param xfer The file transfer structure |
|
1213ec1efcf8
ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents:
22338
diff
changeset
|
95 | * @param buffer The buffer to write |
|
1213ec1efcf8
ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents:
22338
diff
changeset
|
96 | * @param size The size of the buffer |
|
1213ec1efcf8
ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents:
22338
diff
changeset
|
97 | * |
|
1213ec1efcf8
ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents:
22338
diff
changeset
|
98 | * @return size if the write was successful, or a value between 0 and |
|
1213ec1efcf8
ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents:
22338
diff
changeset
|
99 | * size on error. |
|
1213ec1efcf8
ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents:
22338
diff
changeset
|
100 | */ |
|
28159
567c6a03a6ea
Fix building on win32, which has #define write wpurple_write (and similar for read).
Paul Aurich <darkrain42@pidgin.im>
parents:
28156
diff
changeset
|
101 | gssize (*ui_write)(PurpleXfer *xfer, const guchar *buffer, gssize size); |
|
28150
1213ec1efcf8
ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents:
22338
diff
changeset
|
102 | |
|
1213ec1efcf8
ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents:
22338
diff
changeset
|
103 | /** |
|
36637
9b0109ae118d
Renamed some prpl stuff to protocol stuff.
Ankit Vani <a@nevitus.org>
parents:
36545
diff
changeset
|
104 | * UI op to read data to send to the protocol for a file transfer. |
|
28150
1213ec1efcf8
ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents:
22338
diff
changeset
|
105 | * |
|
1213ec1efcf8
ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents:
22338
diff
changeset
|
106 | * @param xfer The file transfer structure |
|
1213ec1efcf8
ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents:
22338
diff
changeset
|
107 | * @param buffer A pointer to a buffer. The UI must allocate this buffer. |
|
1213ec1efcf8
ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents:
22338
diff
changeset
|
108 | * libpurple will free the data. |
|
1213ec1efcf8
ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents:
22338
diff
changeset
|
109 | * @param size The maximum amount of data to put in the buffer. |
|
1213ec1efcf8
ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents:
22338
diff
changeset
|
110 | * |
|
1213ec1efcf8
ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents:
22338
diff
changeset
|
111 | * @returns The amount of data in the buffer, 0 if nothing is available, |
|
1213ec1efcf8
ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents:
22338
diff
changeset
|
112 | * and a negative value if an error occurred and the transfer |
|
1213ec1efcf8
ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents:
22338
diff
changeset
|
113 | * should be cancelled (libpurple will cancel). |
|
1213ec1efcf8
ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents:
22338
diff
changeset
|
114 | */ |
|
28159
567c6a03a6ea
Fix building on win32, which has #define write wpurple_write (and similar for read).
Paul Aurich <darkrain42@pidgin.im>
parents:
28156
diff
changeset
|
115 | gssize (*ui_read)(PurpleXfer *xfer, guchar **buffer, gssize size); |
|
28150
1213ec1efcf8
ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents:
22338
diff
changeset
|
116 | |
|
1213ec1efcf8
ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents:
22338
diff
changeset
|
117 | /** |
|
1213ec1efcf8
ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents:
22338
diff
changeset
|
118 | * Op to notify the UI that not all the data read in was written. The UI |
|
1213ec1efcf8
ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents:
22338
diff
changeset
|
119 | * should re-enqueue this data and return it the next time read is called. |
|
1213ec1efcf8
ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents:
22338
diff
changeset
|
120 | * |
|
1213ec1efcf8
ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents:
22338
diff
changeset
|
121 | * This MUST be implemented if read and write are implemented. |
|
1213ec1efcf8
ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents:
22338
diff
changeset
|
122 | * |
|
1213ec1efcf8
ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents:
22338
diff
changeset
|
123 | * @param xfer The file transfer structure |
|
1213ec1efcf8
ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents:
22338
diff
changeset
|
124 | * @param buffer A pointer to the beginning of the unwritten data. |
|
1213ec1efcf8
ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents:
22338
diff
changeset
|
125 | * @param size The amount of unwritten data. |
|
1213ec1efcf8
ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents:
22338
diff
changeset
|
126 | */ |
|
1213ec1efcf8
ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents:
22338
diff
changeset
|
127 | void (*data_not_sent)(PurpleXfer *xfer, const guchar *buffer, gsize size); |
|
1213ec1efcf8
ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents:
22338
diff
changeset
|
128 | |
|
28683
2fda587fb3e6
Add a comment about the add thumbnail op for PurpleXfer
Marcus Lundblad <malu@pidgin.im>
parents:
28263
diff
changeset
|
129 | /** |
|
2fda587fb3e6
Add a comment about the add thumbnail op for PurpleXfer
Marcus Lundblad <malu@pidgin.im>
parents:
28263
diff
changeset
|
130 | * Op to create a thumbnail image for a file transfer |
|
2fda587fb3e6
Add a comment about the add thumbnail op for PurpleXfer
Marcus Lundblad <malu@pidgin.im>
parents:
28263
diff
changeset
|
131 | * |
|
2fda587fb3e6
Add a comment about the add thumbnail op for PurpleXfer
Marcus Lundblad <malu@pidgin.im>
parents:
28263
diff
changeset
|
132 | * @param xfer The file transfer structure |
|
2fda587fb3e6
Add a comment about the add thumbnail op for PurpleXfer
Marcus Lundblad <malu@pidgin.im>
parents:
28263
diff
changeset
|
133 | */ |
|
30114
8472e53fbbfc
Set desired image formats for thumbnails as a parameter to
Marcus Lundblad <malu@pidgin.im>
parents:
30113
diff
changeset
|
134 | void (*add_thumbnail)(PurpleXfer *xfer, const gchar *formats); |
| 15884 | 135 | } PurpleXferUiOps; |
| 4514 | 136 | |
| 137 | /** | |
| 138 | * A core representation of a file transfer. | |
| 139 | */ | |
| 15884 | 140 | struct _PurpleXfer |
| 4514 | 141 | { |
|
34909
91be147083c6
Started GObjectification of PurpleXfer.
Ankit Vani <a@nevitus.org>
parents:
34878
diff
changeset
|
142 | /*< private >*/ |
|
91be147083c6
Started GObjectification of PurpleXfer.
Ankit Vani <a@nevitus.org>
parents:
34878
diff
changeset
|
143 | GObject gparent; |
| 4514 | 144 | |
|
34909
91be147083c6
Started GObjectification of PurpleXfer.
Ankit Vani <a@nevitus.org>
parents:
34878
diff
changeset
|
145 | /** The UI data associated with this file transfer. This is a convenience |
|
91be147083c6
Started GObjectification of PurpleXfer.
Ankit Vani <a@nevitus.org>
parents:
34878
diff
changeset
|
146 | * field provided to the UIs -- it is not used by the libpurple core. |
|
91be147083c6
Started GObjectification of PurpleXfer.
Ankit Vani <a@nevitus.org>
parents:
34878
diff
changeset
|
147 | */ |
|
91be147083c6
Started GObjectification of PurpleXfer.
Ankit Vani <a@nevitus.org>
parents:
34878
diff
changeset
|
148 | gpointer ui_data; |
|
91be147083c6
Started GObjectification of PurpleXfer.
Ankit Vani <a@nevitus.org>
parents:
34878
diff
changeset
|
149 | }; |
| 4514 | 150 | |
|
34909
91be147083c6
Started GObjectification of PurpleXfer.
Ankit Vani <a@nevitus.org>
parents:
34878
diff
changeset
|
151 | /** Base class for all #PurpleXfer's */ |
|
91be147083c6
Started GObjectification of PurpleXfer.
Ankit Vani <a@nevitus.org>
parents:
34878
diff
changeset
|
152 | struct _PurpleXferClass |
|
91be147083c6
Started GObjectification of PurpleXfer.
Ankit Vani <a@nevitus.org>
parents:
34878
diff
changeset
|
153 | { |
|
91be147083c6
Started GObjectification of PurpleXfer.
Ankit Vani <a@nevitus.org>
parents:
34878
diff
changeset
|
154 | /*< private >*/ |
|
91be147083c6
Started GObjectification of PurpleXfer.
Ankit Vani <a@nevitus.org>
parents:
34878
diff
changeset
|
155 | GObjectClass parent_class; |
| 4538 | 156 | |
|
34909
91be147083c6
Started GObjectification of PurpleXfer.
Ankit Vani <a@nevitus.org>
parents:
34878
diff
changeset
|
157 | void (*_purple_reserved1)(void); |
|
91be147083c6
Started GObjectification of PurpleXfer.
Ankit Vani <a@nevitus.org>
parents:
34878
diff
changeset
|
158 | void (*_purple_reserved2)(void); |
|
91be147083c6
Started GObjectification of PurpleXfer.
Ankit Vani <a@nevitus.org>
parents:
34878
diff
changeset
|
159 | void (*_purple_reserved3)(void); |
|
91be147083c6
Started GObjectification of PurpleXfer.
Ankit Vani <a@nevitus.org>
parents:
34878
diff
changeset
|
160 | void (*_purple_reserved4)(void); |
| 4514 | 161 | }; |
| 162 | ||
|
32787
7072f190d6ad
Use G_BEGIN/END_DECLS in public libpurple files. This was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32663
diff
changeset
|
163 | G_BEGIN_DECLS |
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
164 | |
| 4514 | 165 | /**************************************************************************/ |
| 166 | /** @name File Transfer API */ | |
| 167 | /**************************************************************************/ | |
| 168 | /*@{*/ | |
| 169 | ||
| 170 | /** | |
|
34909
91be147083c6
Started GObjectification of PurpleXfer.
Ankit Vani <a@nevitus.org>
parents:
34878
diff
changeset
|
171 | * Returns the GType for the PurpleXfer object. |
|
34792
09228ea79272
Added GBoxed to certificate, certificate pool, xfer, log
Ankit Vani <a@nevitus.org>
parents:
33465
diff
changeset
|
172 | */ |
|
34909
91be147083c6
Started GObjectification of PurpleXfer.
Ankit Vani <a@nevitus.org>
parents:
34878
diff
changeset
|
173 | GType purple_xfer_get_type(void); |
|
34792
09228ea79272
Added GBoxed to certificate, certificate pool, xfer, log
Ankit Vani <a@nevitus.org>
parents:
33465
diff
changeset
|
174 | |
|
09228ea79272
Added GBoxed to certificate, certificate pool, xfer, log
Ankit Vani <a@nevitus.org>
parents:
33465
diff
changeset
|
175 | /** |
| 4514 | 176 | * Creates a new file transfer handle. |
|
36637
9b0109ae118d
Renamed some prpl stuff to protocol stuff.
Ankit Vani <a@nevitus.org>
parents:
36545
diff
changeset
|
177 | * This is called by protocols. |
| 7805 | 178 | * The handle starts with a ref count of 1, and this reference |
|
36637
9b0109ae118d
Renamed some prpl stuff to protocol stuff.
Ankit Vani <a@nevitus.org>
parents:
36545
diff
changeset
|
179 | * is owned by the core. The protocol normally does not need to |
|
34912
539b7b4d1949
Replaced purple_xfer_{ref|unref} with g_object_{ref|unref}
Ankit Vani <a@nevitus.org>
parents:
34909
diff
changeset
|
180 | * g_object_ref or unref. |
| 4514 | 181 | * |
| 182 | * @param account The account sending or receiving the file. | |
| 183 | * @param type The type of file transfer. | |
| 184 | * @param who The name of the remote user. | |
| 185 | * | |
| 186 | * @return A file transfer handle. | |
| 187 | */ | |
| 15884 | 188 | PurpleXfer *purple_xfer_new(PurpleAccount *account, |
| 189 | PurpleXferType type, const char *who); | |
| 4514 | 190 | |
| 191 | /** | |
|
8585
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
192 | * Requests confirmation for a file transfer from the user. If receiving |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
193 | * a file which is known at this point, this requests user to accept and |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
194 | * save the file. If the filename is unknown (not set) this only requests user |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
195 | * to accept the file transfer. In this case protocol must call this function |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
196 | * again once the filename is available. |
| 4514 | 197 | * |
| 198 | * @param xfer The file transfer to request confirmation on. | |
| 199 | */ | |
| 15884 | 200 | void purple_xfer_request(PurpleXfer *xfer); |
| 4514 | 201 | |
| 202 | /** | |
| 203 | * Called if the user accepts the file transfer request. | |
| 204 | * | |
| 205 | * @param xfer The file transfer. | |
| 206 | * @param filename The filename. | |
| 207 | */ | |
| 15884 | 208 | void purple_xfer_request_accepted(PurpleXfer *xfer, const char *filename); |
| 4514 | 209 | |
| 210 | /** | |
| 211 | * Called if the user rejects the file transfer request. | |
| 212 | * | |
| 213 | * @param xfer The file transfer. | |
| 214 | */ | |
| 15884 | 215 | void purple_xfer_request_denied(PurpleXfer *xfer); |
| 4514 | 216 | |
| 217 | /** | |
|
32289
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
218 | * Returns the socket file descriptor. |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
219 | * |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
220 | * @param xfer The file transfer. |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
221 | * |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
222 | * @return The socket file descriptor. |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
223 | */ |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
224 | int purple_xfer_get_fd(PurpleXfer *xfer); |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
225 | |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
226 | /** |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
227 | * Returns the Watcher for the transfer. |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
228 | * |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
229 | * @param xfer The file transfer. |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
230 | * |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
231 | * @return The watcher. |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
232 | */ |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
233 | int purple_xfer_get_watcher(PurpleXfer *xfer); |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
234 | |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
235 | /** |
| 4514 | 236 | * Returns the type of file transfer. |
| 237 | * | |
| 238 | * @param xfer The file transfer. | |
| 239 | * | |
| 240 | * @return The type of the file transfer. | |
| 241 | */ | |
|
34909
91be147083c6
Started GObjectification of PurpleXfer.
Ankit Vani <a@nevitus.org>
parents:
34878
diff
changeset
|
242 | PurpleXferType purple_xfer_get_xfer_type(const PurpleXfer *xfer); |
| 4514 | 243 | |
| 244 | /** | |
| 245 | * Returns the account the file transfer is using. | |
| 246 | * | |
| 247 | * @param xfer The file transfer. | |
| 248 | * | |
| 249 | * @return The account. | |
| 250 | */ | |
| 15884 | 251 | PurpleAccount *purple_xfer_get_account(const PurpleXfer *xfer); |
| 4514 | 252 | |
|
34922
6043d2b7f55a
Started GObjectification of xfer.c
Ankit Vani <a@nevitus.org>
parents:
34919
diff
changeset
|
253 | /** |
|
34913
21017b84a070
Refactored jabber to use the GObject xfer API.
Ankit Vani <a@nevitus.org>
parents:
34912
diff
changeset
|
254 | * Sets the name of the remote user. |
|
21017b84a070
Refactored jabber to use the GObject xfer API.
Ankit Vani <a@nevitus.org>
parents:
34912
diff
changeset
|
255 | * |
|
21017b84a070
Refactored jabber to use the GObject xfer API.
Ankit Vani <a@nevitus.org>
parents:
34912
diff
changeset
|
256 | * @param xfer The file transfer. |
|
21017b84a070
Refactored jabber to use the GObject xfer API.
Ankit Vani <a@nevitus.org>
parents:
34912
diff
changeset
|
257 | * @param who The name of the remote user. |
|
21017b84a070
Refactored jabber to use the GObject xfer API.
Ankit Vani <a@nevitus.org>
parents:
34912
diff
changeset
|
258 | */ |
|
21017b84a070
Refactored jabber to use the GObject xfer API.
Ankit Vani <a@nevitus.org>
parents:
34912
diff
changeset
|
259 | void purple_xfer_set_remote_user(PurpleXfer *xfer, const char *who); |
|
21017b84a070
Refactored jabber to use the GObject xfer API.
Ankit Vani <a@nevitus.org>
parents:
34912
diff
changeset
|
260 | |
| 4514 | 261 | /** |
|
17852
174c0d122a79
Add new function purple_xfer_get_remote_user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16743
diff
changeset
|
262 | * Returns the name of the remote user. |
|
174c0d122a79
Add new function purple_xfer_get_remote_user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16743
diff
changeset
|
263 | * |
|
174c0d122a79
Add new function purple_xfer_get_remote_user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16743
diff
changeset
|
264 | * @param xfer The file transfer. |
|
174c0d122a79
Add new function purple_xfer_get_remote_user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16743
diff
changeset
|
265 | * |
|
174c0d122a79
Add new function purple_xfer_get_remote_user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16743
diff
changeset
|
266 | * @return The name of the remote user. |
|
174c0d122a79
Add new function purple_xfer_get_remote_user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16743
diff
changeset
|
267 | */ |
|
174c0d122a79
Add new function purple_xfer_get_remote_user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16743
diff
changeset
|
268 | const char *purple_xfer_get_remote_user(const PurpleXfer *xfer); |
|
174c0d122a79
Add new function purple_xfer_get_remote_user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16743
diff
changeset
|
269 | |
|
174c0d122a79
Add new function purple_xfer_get_remote_user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16743
diff
changeset
|
270 | /** |
| 7805 | 271 | * Returns the status of the xfer. |
| 272 | * | |
| 273 | * @param xfer The file transfer. | |
| 274 | * | |
| 275 | * @return The status. | |
| 276 | */ | |
|
34909
91be147083c6
Started GObjectification of PurpleXfer.
Ankit Vani <a@nevitus.org>
parents:
34878
diff
changeset
|
277 | PurpleXferStatus purple_xfer_get_status(const PurpleXfer *xfer); |
| 7805 | 278 | |
| 279 | /** | |
|
30708
535bec1e66fb
Standardize on "cancelled".
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30131
diff
changeset
|
280 | * Returns true if the file transfer was cancelled. |
| 7738 | 281 | * |
| 282 | * @param xfer The file transfer. | |
| 283 | * | |
|
30708
535bec1e66fb
Standardize on "cancelled".
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30131
diff
changeset
|
284 | * @return Whether or not the transfer was cancelled. |
| 7738 | 285 | */ |
|
32607
3d50780413f8
purple_xfer_is_canceled() renamed to purple_xfer_is_cancelled()
Andrew Victor <andrew.victor@mxit.com>
parents:
32604
diff
changeset
|
286 | gboolean purple_xfer_is_cancelled(const PurpleXfer *xfer); |
| 7738 | 287 | |
| 288 | /** | |
|
4539
44671e1ce14e
[gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents:
4538
diff
changeset
|
289 | * Returns the completed state for a file transfer. |
|
44671e1ce14e
[gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents:
4538
diff
changeset
|
290 | * |
|
44671e1ce14e
[gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents:
4538
diff
changeset
|
291 | * @param xfer The file transfer. |
|
44671e1ce14e
[gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents:
4538
diff
changeset
|
292 | * |
|
44671e1ce14e
[gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents:
4538
diff
changeset
|
293 | * @return The completed state. |
|
44671e1ce14e
[gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents:
4538
diff
changeset
|
294 | */ |
| 15884 | 295 | gboolean purple_xfer_is_completed(const PurpleXfer *xfer); |
|
4539
44671e1ce14e
[gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents:
4538
diff
changeset
|
296 | |
|
44671e1ce14e
[gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents:
4538
diff
changeset
|
297 | /** |
| 4514 | 298 | * Returns the name of the file being sent or received. |
| 299 | * | |
| 300 | * @param xfer The file transfer. | |
| 301 | * | |
| 302 | * @return The filename. | |
| 303 | */ | |
| 15884 | 304 | const char *purple_xfer_get_filename(const PurpleXfer *xfer); |
| 4514 | 305 | |
| 306 | /** | |
| 307 | * Returns the file's destination filename, | |
| 308 | * | |
| 309 | * @param xfer The file transfer. | |
| 310 | * | |
| 311 | * @return The destination filename. | |
| 312 | */ | |
| 15884 | 313 | const char *purple_xfer_get_local_filename(const PurpleXfer *xfer); |
| 4514 | 314 | |
| 315 | /** | |
|
13009
12ef9f229961
[gaim-migrate @ 15362]
Daniel Atallah <datallah@pidgin.im>
parents:
12151
diff
changeset
|
316 | * Returns the number of bytes sent (or received) so far. |
| 4514 | 317 | * |
| 318 | * @param xfer The file transfer. | |
| 319 | * | |
| 320 | * @return The number of bytes sent. | |
| 321 | */ | |
|
32663
1b87b3e98b0a
Upgrade PurpleXfer for a 64-bit world.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32608
diff
changeset
|
322 | goffset purple_xfer_get_bytes_sent(const PurpleXfer *xfer); |
| 4514 | 323 | |
| 324 | /** | |
|
13009
12ef9f229961
[gaim-migrate @ 15362]
Daniel Atallah <datallah@pidgin.im>
parents:
12151
diff
changeset
|
325 | * Returns the number of bytes remaining to send or receive. |
| 4514 | 326 | * |
| 327 | * @param xfer The file transfer. | |
| 328 | * | |
|
13009
12ef9f229961
[gaim-migrate @ 15362]
Daniel Atallah <datallah@pidgin.im>
parents:
12151
diff
changeset
|
329 | * @return The number of bytes remaining. |
| 4514 | 330 | */ |
|
32663
1b87b3e98b0a
Upgrade PurpleXfer for a 64-bit world.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32608
diff
changeset
|
331 | goffset purple_xfer_get_bytes_remaining(const PurpleXfer *xfer); |
| 4514 | 332 | |
| 333 | /** | |
| 334 | * Returns the size of the file being sent or received. | |
| 335 | * | |
| 336 | * @param xfer The file transfer. | |
| 7805 | 337 | * |
| 4514 | 338 | * @return The total size of the file. |
| 339 | */ | |
|
32663
1b87b3e98b0a
Upgrade PurpleXfer for a 64-bit world.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32608
diff
changeset
|
340 | goffset purple_xfer_get_size(const PurpleXfer *xfer); |
| 4514 | 341 | |
| 342 | /** | |
| 343 | * Returns the current percentage of progress of the transfer. | |
| 344 | * | |
| 345 | * This is a number between 0 (0%) and 1 (100%). | |
| 346 | * | |
| 347 | * @param xfer The file transfer. | |
| 348 | * | |
| 349 | * @return The percentage complete. | |
| 350 | */ | |
| 15884 | 351 | double purple_xfer_get_progress(const PurpleXfer *xfer); |
| 4514 | 352 | |
| 353 | /** | |
| 354 | * Returns the local port number in the file transfer. | |
| 355 | * | |
| 356 | * @param xfer The file transfer. | |
| 357 | * | |
| 358 | * @return The port number on this end. | |
| 359 | */ | |
| 15884 | 360 | unsigned int purple_xfer_get_local_port(const PurpleXfer *xfer); |
| 4514 | 361 | |
| 362 | /** | |
| 363 | * Returns the remote IP address in the file transfer. | |
| 364 | * | |
| 365 | * @param xfer The file transfer. | |
| 366 | * | |
| 367 | * @return The IP address on the other end. | |
| 368 | */ | |
| 15884 | 369 | const char *purple_xfer_get_remote_ip(const PurpleXfer *xfer); |
| 4514 | 370 | |
| 371 | /** | |
| 372 | * Returns the remote port number in the file transfer. | |
| 373 | * | |
| 374 | * @param xfer The file transfer. | |
| 375 | * | |
| 376 | * @return The port number on the other end. | |
| 377 | */ | |
| 15884 | 378 | unsigned int purple_xfer_get_remote_port(const PurpleXfer *xfer); |
| 4514 | 379 | |
| 380 | /** | |
|
22338
d6a489105624
Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20940
diff
changeset
|
381 | * Returns the time the transfer of a file started. |
|
d6a489105624
Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20940
diff
changeset
|
382 | * |
|
d6a489105624
Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20940
diff
changeset
|
383 | * @param xfer The file transfer. |
|
d6a489105624
Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20940
diff
changeset
|
384 | * |
|
d6a489105624
Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20940
diff
changeset
|
385 | * @return The time when the transfer started. |
|
d6a489105624
Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20940
diff
changeset
|
386 | */ |
|
d6a489105624
Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20940
diff
changeset
|
387 | time_t purple_xfer_get_start_time(const PurpleXfer *xfer); |
|
d6a489105624
Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20940
diff
changeset
|
388 | |
|
d6a489105624
Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20940
diff
changeset
|
389 | /** |
|
d6a489105624
Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20940
diff
changeset
|
390 | * Returns the time the transfer of a file ended. |
|
d6a489105624
Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20940
diff
changeset
|
391 | * |
|
d6a489105624
Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20940
diff
changeset
|
392 | * @param xfer The file transfer. |
|
d6a489105624
Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20940
diff
changeset
|
393 | * |
|
d6a489105624
Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20940
diff
changeset
|
394 | * @return The time when the transfer ended. |
|
d6a489105624
Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20940
diff
changeset
|
395 | */ |
|
d6a489105624
Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20940
diff
changeset
|
396 | time_t purple_xfer_get_end_time(const PurpleXfer *xfer); |
|
d6a489105624
Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20940
diff
changeset
|
397 | |
|
d6a489105624
Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20940
diff
changeset
|
398 | /** |
|
32289
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
399 | * Sets the socket file descriptor. |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
400 | * |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
401 | * @param xfer The file transfer. |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
402 | * @param fd The file descriptor. |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
403 | */ |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
404 | void purple_xfer_set_fd(PurpleXfer *xfer, int fd); |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
405 | |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
406 | /** |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
407 | * Sets the watcher for the file transfer. |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
408 | * |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
409 | * @param xfer The file transfer. |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
410 | * @param watcher The watcher. |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
411 | */ |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
412 | void purple_xfer_set_watcher(PurpleXfer *xfer, int watcher); |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
413 | |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
414 | /** |
| 4538 | 415 | * Sets the completed state for the file transfer. |
| 416 | * | |
| 417 | * @param xfer The file transfer. | |
| 418 | * @param completed The completed state. | |
| 419 | */ | |
| 15884 | 420 | void purple_xfer_set_completed(PurpleXfer *xfer, gboolean completed); |
| 4538 | 421 | |
| 422 | /** | |
|
32289
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
423 | * Sets the current status for the file transfer. |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
424 | * |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
425 | * @param xfer The file transfer. |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
426 | * @param status The current status. |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
427 | */ |
|
34909
91be147083c6
Started GObjectification of PurpleXfer.
Ankit Vani <a@nevitus.org>
parents:
34878
diff
changeset
|
428 | void purple_xfer_set_status(PurpleXfer *xfer, PurpleXferStatus status); |
|
32289
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
429 | |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
430 | /** |
|
34924
a8e724fe164e
Fixed an incorrect documentation
Ankit Vani <a@nevitus.org>
parents:
34922
diff
changeset
|
431 | * Sets the message for the file transfer. |
| 4514 | 432 | * |
| 433 | * @param xfer The file transfer. | |
|
9933
61bd3fadbfe6
[gaim-migrate @ 10825]
Dave West <kat@users.sourceforge.net>
parents:
9511
diff
changeset
|
434 | * @param message The message. |
|
61bd3fadbfe6
[gaim-migrate @ 10825]
Dave West <kat@users.sourceforge.net>
parents:
9511
diff
changeset
|
435 | */ |
| 15884 | 436 | void purple_xfer_set_message(PurpleXfer *xfer, const char *message); |
|
9933
61bd3fadbfe6
[gaim-migrate @ 10825]
Dave West <kat@users.sourceforge.net>
parents:
9511
diff
changeset
|
437 | |
|
61bd3fadbfe6
[gaim-migrate @ 10825]
Dave West <kat@users.sourceforge.net>
parents:
9511
diff
changeset
|
438 | /** |
|
34927
cef809309dbf
Fixed libpurple build errors, and added purple_xfer_get_message()
Ankit Vani <a@nevitus.org>
parents:
34926
diff
changeset
|
439 | * Returns the message for the file transfer. |
|
cef809309dbf
Fixed libpurple build errors, and added purple_xfer_get_message()
Ankit Vani <a@nevitus.org>
parents:
34926
diff
changeset
|
440 | * |
|
cef809309dbf
Fixed libpurple build errors, and added purple_xfer_get_message()
Ankit Vani <a@nevitus.org>
parents:
34926
diff
changeset
|
441 | * @param xfer The file transfer. |
|
cef809309dbf
Fixed libpurple build errors, and added purple_xfer_get_message()
Ankit Vani <a@nevitus.org>
parents:
34926
diff
changeset
|
442 | * |
|
cef809309dbf
Fixed libpurple build errors, and added purple_xfer_get_message()
Ankit Vani <a@nevitus.org>
parents:
34926
diff
changeset
|
443 | * @return The message. |
|
cef809309dbf
Fixed libpurple build errors, and added purple_xfer_get_message()
Ankit Vani <a@nevitus.org>
parents:
34926
diff
changeset
|
444 | */ |
|
cef809309dbf
Fixed libpurple build errors, and added purple_xfer_get_message()
Ankit Vani <a@nevitus.org>
parents:
34926
diff
changeset
|
445 | const char *purple_xfer_get_message(const PurpleXfer *xfer); |
|
cef809309dbf
Fixed libpurple build errors, and added purple_xfer_get_message()
Ankit Vani <a@nevitus.org>
parents:
34926
diff
changeset
|
446 | |
|
cef809309dbf
Fixed libpurple build errors, and added purple_xfer_get_message()
Ankit Vani <a@nevitus.org>
parents:
34926
diff
changeset
|
447 | /** |
|
9933
61bd3fadbfe6
[gaim-migrate @ 10825]
Dave West <kat@users.sourceforge.net>
parents:
9511
diff
changeset
|
448 | * Sets the filename for the file transfer. |
|
61bd3fadbfe6
[gaim-migrate @ 10825]
Dave West <kat@users.sourceforge.net>
parents:
9511
diff
changeset
|
449 | * |
|
61bd3fadbfe6
[gaim-migrate @ 10825]
Dave West <kat@users.sourceforge.net>
parents:
9511
diff
changeset
|
450 | * @param xfer The file transfer. |
| 4514 | 451 | * @param filename The filename. |
| 452 | */ | |
| 15884 | 453 | void purple_xfer_set_filename(PurpleXfer *xfer, const char *filename); |
| 4514 | 454 | |
| 455 | /** | |
|
4605
67526771e679
[gaim-migrate @ 4892]
Mark Doliner <markdoliner@pidgin.im>
parents:
4595
diff
changeset
|
456 | * Sets the local filename for the file transfer. |
| 4514 | 457 | * |
| 458 | * @param xfer The file transfer. | |
| 459 | * @param filename The filename | |
| 460 | */ | |
| 15884 | 461 | void purple_xfer_set_local_filename(PurpleXfer *xfer, const char *filename); |
| 4514 | 462 | |
| 463 | /** | |
| 464 | * Sets the size of the file in a file transfer. | |
| 465 | * | |
| 466 | * @param xfer The file transfer. | |
| 467 | * @param size The size of the file. | |
| 468 | */ | |
|
32663
1b87b3e98b0a
Upgrade PurpleXfer for a 64-bit world.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32608
diff
changeset
|
469 | void purple_xfer_set_size(PurpleXfer *xfer, goffset size); |
| 4514 | 470 | |
| 471 | /** | |
|
32289
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
472 | * Sets the local port of the file transfer. |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
473 | * |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
474 | * @param xfer The file transfer. |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
475 | * @param local_port The local port. |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
476 | */ |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
477 | void purple_xfer_set_local_port(PurpleXfer *xfer, unsigned int local_port); |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
478 | |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
479 | /** |
|
15322
cd268e368bc1
[gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents:
15280
diff
changeset
|
480 | * Sets the current working position in the active file transfer. This |
|
cd268e368bc1
[gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents:
15280
diff
changeset
|
481 | * can be used to jump backward in the file if the protocol detects |
|
cd268e368bc1
[gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents:
15280
diff
changeset
|
482 | * that some bit of data needs to be resent or has been sent twice. |
|
cd268e368bc1
[gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents:
15280
diff
changeset
|
483 | * |
|
cd268e368bc1
[gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents:
15280
diff
changeset
|
484 | * It's used for pausing and resuming an oscar file transfer. |
|
cd268e368bc1
[gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents:
15280
diff
changeset
|
485 | * |
|
cd268e368bc1
[gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents:
15280
diff
changeset
|
486 | * @param xfer The file transfer. |
|
cd268e368bc1
[gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents:
15280
diff
changeset
|
487 | * @param bytes_sent The new current position in the file. If we're |
|
cd268e368bc1
[gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents:
15280
diff
changeset
|
488 | * sending a file then this is the byte that we will |
|
cd268e368bc1
[gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents:
15280
diff
changeset
|
489 | * send. If we're receiving a file, this is the |
|
cd268e368bc1
[gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents:
15280
diff
changeset
|
490 | * next byte that we expect to receive. |
|
cd268e368bc1
[gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents:
15280
diff
changeset
|
491 | */ |
|
32663
1b87b3e98b0a
Upgrade PurpleXfer for a 64-bit world.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32608
diff
changeset
|
492 | void purple_xfer_set_bytes_sent(PurpleXfer *xfer, goffset bytes_sent); |
|
15322
cd268e368bc1
[gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents:
15280
diff
changeset
|
493 | |
|
cd268e368bc1
[gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents:
15280
diff
changeset
|
494 | /** |
| 4514 | 495 | * Returns the UI operations structure for a file transfer. |
| 496 | * | |
| 497 | * @param xfer The file transfer. | |
| 498 | * | |
| 499 | * @return The UI operations structure. | |
| 500 | */ | |
| 15884 | 501 | PurpleXferUiOps *purple_xfer_get_ui_ops(const PurpleXfer *xfer); |
| 4514 | 502 | |
| 34919 | 503 | /** |
| 504 | * Sets the read function for the file transfer. | |
| 505 | * | |
| 506 | * @param xfer The file transfer. | |
| 507 | * @param fnc The read function. | |
| 508 | */ | |
| 509 | void purple_xfer_set_read_fnc(PurpleXfer *xfer, | |
| 510 | gssize (*fnc)(guchar **, PurpleXfer *)); | |
| 511 | ||
| 512 | /** | |
| 513 | * Sets the write function for the file transfer. | |
| 4514 | 514 | * |
| 34919 | 515 | * @param xfer The file transfer. |
| 516 | * @param fnc The write function. | |
| 4514 | 517 | */ |
| 34919 | 518 | void purple_xfer_set_write_fnc(PurpleXfer *xfer, |
| 519 | gssize (*fnc)(const guchar *, size_t, PurpleXfer *)); | |
| 4514 | 520 | |
| 34919 | 521 | /** |
| 522 | * Sets the acknowledge function for the file transfer. | |
| 523 | * | |
| 524 | * @param xfer The file transfer. | |
| 525 | * @param fnc The acknowledge function. | |
| 526 | */ | |
| 527 | void purple_xfer_set_ack_fnc(PurpleXfer *xfer, | |
| 528 | void (*fnc)(PurpleXfer *, const guchar *, size_t)); | |
| 529 | ||
| 530 | /** | |
| 531 | * Sets the function to be called if the request is denied. | |
| 7805 | 532 | * |
| 533 | * @param xfer The file transfer. | |
|
36637
9b0109ae118d
Renamed some prpl stuff to protocol stuff.
Ankit Vani <a@nevitus.org>
parents:
36545
diff
changeset
|
534 | * @param fnc The request denied protocol callback. |
| 34919 | 535 | */ |
| 536 | void purple_xfer_set_request_denied_fnc(PurpleXfer *xfer, void (*fnc)(PurpleXfer *)); | |
| 537 | ||
| 538 | /** | |
| 539 | * Sets the transfer initialization function for the file transfer. | |
| 4514 | 540 | * |
| 34919 | 541 | * This function is required, and must call purple_xfer_start() with |
| 542 | * the necessary parameters. This will be called if the file transfer | |
| 543 | * is accepted by the user. | |
| 544 | * | |
| 545 | * @param xfer The file transfer. | |
| 546 | * @param fnc The transfer initialization function. | |
| 547 | */ | |
| 548 | void purple_xfer_set_init_fnc(PurpleXfer *xfer, void (*fnc)(PurpleXfer *)); | |
| 549 | ||
| 550 | /** | |
| 551 | * Sets the start transfer function for the file transfer. | |
| 552 | * | |
| 553 | * @param xfer The file transfer. | |
| 554 | * @param fnc The start transfer function. | |
| 4514 | 555 | */ |
| 34919 | 556 | void purple_xfer_set_start_fnc(PurpleXfer *xfer, void (*fnc)(PurpleXfer *)); |
| 557 | ||
| 558 | /** | |
| 559 | * Sets the end transfer function for the file transfer. | |
| 560 | * | |
| 561 | * @param xfer The file transfer. | |
| 562 | * @param fnc The end transfer function. | |
| 563 | */ | |
| 564 | void purple_xfer_set_end_fnc(PurpleXfer *xfer, void (*fnc)(PurpleXfer *)); | |
| 565 | ||
| 566 | /** | |
| 567 | * Sets the cancel send function for the file transfer. | |
| 568 | * | |
| 569 | * @param xfer The file transfer. | |
| 570 | * @param fnc The cancel send function. | |
| 571 | */ | |
| 572 | void purple_xfer_set_cancel_send_fnc(PurpleXfer *xfer, void (*fnc)(PurpleXfer *)); | |
| 573 | ||
| 574 | /** | |
| 575 | * Sets the cancel receive function for the file transfer. | |
| 576 | * | |
| 577 | * @param xfer The file transfer. | |
| 578 | * @param fnc The cancel receive function. | |
| 579 | */ | |
| 580 | void purple_xfer_set_cancel_recv_fnc(PurpleXfer *xfer, void (*fnc)(PurpleXfer *)); | |
| 4514 | 581 | |
| 582 | /** | |
| 583 | * Reads in data from a file transfer stream. | |
| 584 | * | |
| 585 | * @param xfer The file transfer. | |
| 586 | * @param buffer The buffer that will be created to contain the data. | |
| 587 | * | |
| 8231 | 588 | * @return The number of bytes read, or -1. |
| 4514 | 589 | */ |
| 15884 | 590 | gssize purple_xfer_read(PurpleXfer *xfer, guchar **buffer); |
| 4514 | 591 | |
| 592 | /** | |
| 593 | * Writes data to a file transfer stream. | |
| 594 | * | |
| 595 | * @param xfer The file transfer. | |
| 596 | * @param buffer The buffer to read the data from. | |
| 597 | * @param size The number of bytes to write. | |
| 598 | * | |
| 8231 | 599 | * @return The number of bytes written, or -1. |
| 4514 | 600 | */ |
| 15884 | 601 | gssize purple_xfer_write(PurpleXfer *xfer, const guchar *buffer, gsize size); |
| 4514 | 602 | |
| 603 | /** | |
|
34272
8df870b218ca
HTTP: chop off another HTTP implementation (for xmpp oob file transfers)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33465
diff
changeset
|
604 | * Writes chunk of received file. |
|
8df870b218ca
HTTP: chop off another HTTP implementation (for xmpp oob file transfers)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33465
diff
changeset
|
605 | * |
|
8df870b218ca
HTTP: chop off another HTTP implementation (for xmpp oob file transfers)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33465
diff
changeset
|
606 | * @param xfer The file transfer. |
|
8df870b218ca
HTTP: chop off another HTTP implementation (for xmpp oob file transfers)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33465
diff
changeset
|
607 | * @param buffer The buffer to read the data from. |
|
8df870b218ca
HTTP: chop off another HTTP implementation (for xmpp oob file transfers)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33465
diff
changeset
|
608 | * @param size The number of bytes to write. |
|
8df870b218ca
HTTP: chop off another HTTP implementation (for xmpp oob file transfers)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33465
diff
changeset
|
609 | * |
|
8df870b218ca
HTTP: chop off another HTTP implementation (for xmpp oob file transfers)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33465
diff
changeset
|
610 | * @return TRUE on success, FALSE otherwise. |
|
8df870b218ca
HTTP: chop off another HTTP implementation (for xmpp oob file transfers)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33465
diff
changeset
|
611 | */ |
|
8df870b218ca
HTTP: chop off another HTTP implementation (for xmpp oob file transfers)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33465
diff
changeset
|
612 | gboolean |
|
8df870b218ca
HTTP: chop off another HTTP implementation (for xmpp oob file transfers)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33465
diff
changeset
|
613 | purple_xfer_write_file(PurpleXfer *xfer, const guchar *buffer, gsize size); |
|
8df870b218ca
HTTP: chop off another HTTP implementation (for xmpp oob file transfers)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33465
diff
changeset
|
614 | |
|
8df870b218ca
HTTP: chop off another HTTP implementation (for xmpp oob file transfers)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33465
diff
changeset
|
615 | /** |
|
34286
8d0979967d05
HTTP: removing extra yahoo HTTP implementations - file transfer (and small improvements to libpurple http and ft code)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34272
diff
changeset
|
616 | * Writes chunk of file being sent. |
|
8d0979967d05
HTTP: removing extra yahoo HTTP implementations - file transfer (and small improvements to libpurple http and ft code)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34272
diff
changeset
|
617 | * |
|
8d0979967d05
HTTP: removing extra yahoo HTTP implementations - file transfer (and small improvements to libpurple http and ft code)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34272
diff
changeset
|
618 | * @param xfer The file transfer. |
|
8d0979967d05
HTTP: removing extra yahoo HTTP implementations - file transfer (and small improvements to libpurple http and ft code)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34272
diff
changeset
|
619 | * @param buffer The buffer to write the data to. |
|
8d0979967d05
HTTP: removing extra yahoo HTTP implementations - file transfer (and small improvements to libpurple http and ft code)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34272
diff
changeset
|
620 | * @param size The size of buffer. |
|
8d0979967d05
HTTP: removing extra yahoo HTTP implementations - file transfer (and small improvements to libpurple http and ft code)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34272
diff
changeset
|
621 | * |
|
8d0979967d05
HTTP: removing extra yahoo HTTP implementations - file transfer (and small improvements to libpurple http and ft code)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34272
diff
changeset
|
622 | * @return Number of bytes written (0 means, the device is busy), or -1 on |
|
8d0979967d05
HTTP: removing extra yahoo HTTP implementations - file transfer (and small improvements to libpurple http and ft code)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34272
diff
changeset
|
623 | * failure. |
|
8d0979967d05
HTTP: removing extra yahoo HTTP implementations - file transfer (and small improvements to libpurple http and ft code)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34272
diff
changeset
|
624 | */ |
|
8d0979967d05
HTTP: removing extra yahoo HTTP implementations - file transfer (and small improvements to libpurple http and ft code)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34272
diff
changeset
|
625 | gssize |
|
8d0979967d05
HTTP: removing extra yahoo HTTP implementations - file transfer (and small improvements to libpurple http and ft code)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34272
diff
changeset
|
626 | purple_xfer_read_file(PurpleXfer *xfer, guchar *buffer, gsize size); |
|
8d0979967d05
HTTP: removing extra yahoo HTTP implementations - file transfer (and small improvements to libpurple http and ft code)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34272
diff
changeset
|
627 | |
|
8d0979967d05
HTTP: removing extra yahoo HTTP implementations - file transfer (and small improvements to libpurple http and ft code)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34272
diff
changeset
|
628 | /** |
| 4514 | 629 | * Starts a file transfer. |
| 630 | * | |
| 631 | * Either @a fd must be specified <i>or</i> @a ip and @a port on a | |
| 632 | * file receive transfer. On send, @a fd must be specified, and | |
| 633 | * @a ip and @a port are ignored. | |
| 634 | * | |
|
32608
68c936aba5df
Remove the special case of fd=0 in purple_xfer_start().
Andrew Victor <andrew.victor@mxit.com>
parents:
32607
diff
changeset
|
635 | * Passing @a fd as '-1' is a special-case and indicates to the |
|
68c936aba5df
Remove the special case of fd=0 in purple_xfer_start().
Andrew Victor <andrew.victor@mxit.com>
parents:
32607
diff
changeset
|
636 | * protocol plugin to facilitate the file transfer itself. |
|
28152
e9800c07eb5b
ft: Fix a bunch of uses of 0 as an 'invalid' fd.
Paul Aurich <darkrain42@pidgin.im>
parents:
28150
diff
changeset
|
637 | * |
| 4514 | 638 | * @param xfer The file transfer. |
| 639 | * @param fd The file descriptor for the socket. | |
| 640 | * @param ip The IP address to connect to. | |
| 641 | * @param port The port to connect to. | |
| 642 | */ | |
| 15884 | 643 | void purple_xfer_start(PurpleXfer *xfer, int fd, const char *ip, |
| 4514 | 644 | unsigned int port); |
| 645 | ||
| 646 | /** | |
| 647 | * Ends a file transfer. | |
| 648 | * | |
| 649 | * @param xfer The file transfer. | |
| 650 | */ | |
| 15884 | 651 | void purple_xfer_end(PurpleXfer *xfer); |
| 4514 | 652 | |
| 653 | /** | |
|
8585
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
654 | * Adds a new file transfer to the list of file transfers. Call this only |
| 15884 | 655 | * if you are not using purple_xfer_start. |
|
8585
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
656 | * |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
657 | * @param xfer The file transfer. |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
658 | */ |
| 15884 | 659 | void purple_xfer_add(PurpleXfer *xfer); |
|
8585
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
660 | |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
661 | /** |
|
4675
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
662 | * Cancels a file transfer on the local end. |
| 4514 | 663 | * |
| 664 | * @param xfer The file transfer. | |
| 665 | */ | |
| 15884 | 666 | void purple_xfer_cancel_local(PurpleXfer *xfer); |
|
4675
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
667 | |
|
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
668 | /** |
|
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
669 | * Cancels a file transfer from the remote end. |
|
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
670 | * |
|
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
671 | * @param xfer The file transfer. |
|
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
672 | */ |
| 15884 | 673 | void purple_xfer_cancel_remote(PurpleXfer *xfer); |
| 4514 | 674 | |
| 675 | /** | |
| 676 | * Displays a file transfer-related error message. | |
| 677 | * | |
| 15884 | 678 | * This is a wrapper around purple_notify_error(), which automatically |
| 10654 | 679 | * specifies a title ("File transfer to <i>user</i> failed" or |
| 680 | * "File Transfer from <i>user</i> failed"). | |
| 4514 | 681 | * |
| 10654 | 682 | * @param type The type of file transfer. |
| 683 | * @param account The account sending or receiving the file. | |
| 684 | * @param who The user on the other end of the transfer. | |
| 685 | * @param msg The message to display. | |
| 4514 | 686 | */ |
| 15884 | 687 | void purple_xfer_error(PurpleXferType type, PurpleAccount *account, const char *who, const char *msg); |
| 4514 | 688 | |
|
8585
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
689 | /** |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
690 | * Updates file transfer progress. |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
691 | * |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
692 | * @param xfer The file transfer. |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
693 | */ |
| 15884 | 694 | void purple_xfer_update_progress(PurpleXfer *xfer); |
|
8585
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
695 | |
|
11084
b6acee973833
[gaim-migrate @ 13103]
Jonathan Clark <ardentlygnarly@users.sourceforge.net>
parents:
10654
diff
changeset
|
696 | /** |
|
b6acee973833
[gaim-migrate @ 13103]
Jonathan Clark <ardentlygnarly@users.sourceforge.net>
parents:
10654
diff
changeset
|
697 | * Displays a file transfer-related message in the conversation window |
|
b6acee973833
[gaim-migrate @ 13103]
Jonathan Clark <ardentlygnarly@users.sourceforge.net>
parents:
10654
diff
changeset
|
698 | * |
| 15884 | 699 | * This is a wrapper around purple_conversation_write |
|
11084
b6acee973833
[gaim-migrate @ 13103]
Jonathan Clark <ardentlygnarly@users.sourceforge.net>
parents:
10654
diff
changeset
|
700 | * |
|
b6acee973833
[gaim-migrate @ 13103]
Jonathan Clark <ardentlygnarly@users.sourceforge.net>
parents:
10654
diff
changeset
|
701 | * @param xfer The file transfer to which this message relates. |
|
b6acee973833
[gaim-migrate @ 13103]
Jonathan Clark <ardentlygnarly@users.sourceforge.net>
parents:
10654
diff
changeset
|
702 | * @param message The message to display. |
|
11129
c986d8566843
[gaim-migrate @ 13185]
Mark Doliner <markdoliner@pidgin.im>
parents:
11084
diff
changeset
|
703 | * @param is_error Is this an error message?. |
|
11084
b6acee973833
[gaim-migrate @ 13103]
Jonathan Clark <ardentlygnarly@users.sourceforge.net>
parents:
10654
diff
changeset
|
704 | */ |
|
33465
215bec3b763a
Add const to the API, where needed
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32787
diff
changeset
|
705 | void purple_xfer_conversation_write(PurpleXfer *xfer, const gchar *message, gboolean is_error); |
|
11084
b6acee973833
[gaim-migrate @ 13103]
Jonathan Clark <ardentlygnarly@users.sourceforge.net>
parents:
10654
diff
changeset
|
706 | |
|
28150
1213ec1efcf8
ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents:
22338
diff
changeset
|
707 | /** |
|
1213ec1efcf8
ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents:
22338
diff
changeset
|
708 | * Allows the UI to signal it's ready to send/receive data (depending on |
|
28156
0a75e2463576
ft: Add infrastructure to allow a prpl to moderate when to send packets.
Paul Aurich <darkrain42@pidgin.im>
parents:
28152
diff
changeset
|
709 | * the direction of the file transfer. Used when the UI is providing |
|
0a75e2463576
ft: Add infrastructure to allow a prpl to moderate when to send packets.
Paul Aurich <darkrain42@pidgin.im>
parents:
28152
diff
changeset
|
710 | * read/write/data_not_sent UI ops. |
|
28150
1213ec1efcf8
ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents:
22338
diff
changeset
|
711 | * |
|
28156
0a75e2463576
ft: Add infrastructure to allow a prpl to moderate when to send packets.
Paul Aurich <darkrain42@pidgin.im>
parents:
28152
diff
changeset
|
712 | * @param xfer The file transfer which is ready. |
|
28150
1213ec1efcf8
ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents:
22338
diff
changeset
|
713 | */ |
|
1213ec1efcf8
ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents:
22338
diff
changeset
|
714 | void purple_xfer_ui_ready(PurpleXfer *xfer); |
|
1213ec1efcf8
ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents:
22338
diff
changeset
|
715 | |
|
28156
0a75e2463576
ft: Add infrastructure to allow a prpl to moderate when to send packets.
Paul Aurich <darkrain42@pidgin.im>
parents:
28152
diff
changeset
|
716 | /** |
|
36637
9b0109ae118d
Renamed some prpl stuff to protocol stuff.
Ankit Vani <a@nevitus.org>
parents:
36545
diff
changeset
|
717 | * Allows the protocol to signal it's ready to send/receive data (depending on |
|
9b0109ae118d
Renamed some prpl stuff to protocol stuff.
Ankit Vani <a@nevitus.org>
parents:
36545
diff
changeset
|
718 | * the direction of the file transfer. Used when the protocol provides read/write |
|
28156
0a75e2463576
ft: Add infrastructure to allow a prpl to moderate when to send packets.
Paul Aurich <darkrain42@pidgin.im>
parents:
28152
diff
changeset
|
719 | * ops and cannot/does not provide a raw fd to the core. |
|
0a75e2463576
ft: Add infrastructure to allow a prpl to moderate when to send packets.
Paul Aurich <darkrain42@pidgin.im>
parents:
28152
diff
changeset
|
720 | * |
|
0a75e2463576
ft: Add infrastructure to allow a prpl to moderate when to send packets.
Paul Aurich <darkrain42@pidgin.im>
parents:
28152
diff
changeset
|
721 | * @param xfer The file transfer which is ready. |
|
0a75e2463576
ft: Add infrastructure to allow a prpl to moderate when to send packets.
Paul Aurich <darkrain42@pidgin.im>
parents:
28152
diff
changeset
|
722 | */ |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
34878
diff
changeset
|
723 | void purple_xfer_protocol_ready(PurpleXfer *xfer); |
|
28156
0a75e2463576
ft: Add infrastructure to allow a prpl to moderate when to send packets.
Paul Aurich <darkrain42@pidgin.im>
parents:
28152
diff
changeset
|
724 | |
|
28263
d525655fd0f1
It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents:
28262
diff
changeset
|
725 | /** |
|
d525655fd0f1
It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents:
28262
diff
changeset
|
726 | * Gets the thumbnail data for a transfer |
|
d525655fd0f1
It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents:
28262
diff
changeset
|
727 | * |
|
d525655fd0f1
It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents:
28262
diff
changeset
|
728 | * @param xfer The file transfer to get the thumbnail for |
|
30126
f09ecb81212c
Rename purple_xfer_get_thumbnail_data/size to be more D-Bus friendly.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30115
diff
changeset
|
729 | * @param len If not @c NULL, the length of the thumbnail data returned |
|
f09ecb81212c
Rename purple_xfer_get_thumbnail_data/size to be more D-Bus friendly.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30115
diff
changeset
|
730 | * will be set in the location pointed to by this. |
|
28263
d525655fd0f1
It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents:
28262
diff
changeset
|
731 | * @return The thumbnail data, or NULL if there is no thumbnail |
|
d525655fd0f1
It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents:
28262
diff
changeset
|
732 | */ |
|
30126
f09ecb81212c
Rename purple_xfer_get_thumbnail_data/size to be more D-Bus friendly.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30115
diff
changeset
|
733 | gconstpointer purple_xfer_get_thumbnail(const PurpleXfer *xfer, gsize *len); |
|
28263
d525655fd0f1
It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents:
28262
diff
changeset
|
734 | |
|
30113
f60cbf3b3ca9
Allow PRPLs to specify the image formats acceptable for thumbnails (in
Marcus Lundblad <malu@pidgin.im>
parents:
29465
diff
changeset
|
735 | /** |
|
f60cbf3b3ca9
Allow PRPLs to specify the image formats acceptable for thumbnails (in
Marcus Lundblad <malu@pidgin.im>
parents:
29465
diff
changeset
|
736 | * Gets the mimetype of the thumbnail preview for a transfer |
|
f60cbf3b3ca9
Allow PRPLs to specify the image formats acceptable for thumbnails (in
Marcus Lundblad <malu@pidgin.im>
parents:
29465
diff
changeset
|
737 | * |
|
f60cbf3b3ca9
Allow PRPLs to specify the image formats acceptable for thumbnails (in
Marcus Lundblad <malu@pidgin.im>
parents:
29465
diff
changeset
|
738 | * @param xfer The file transfer to get the mimetype for |
|
f60cbf3b3ca9
Allow PRPLs to specify the image formats acceptable for thumbnails (in
Marcus Lundblad <malu@pidgin.im>
parents:
29465
diff
changeset
|
739 | * @return The mimetype of the thumbnail, or @c NULL if not thumbnail is set |
|
f60cbf3b3ca9
Allow PRPLs to specify the image formats acceptable for thumbnails (in
Marcus Lundblad <malu@pidgin.im>
parents:
29465
diff
changeset
|
740 | */ |
|
f60cbf3b3ca9
Allow PRPLs to specify the image formats acceptable for thumbnails (in
Marcus Lundblad <malu@pidgin.im>
parents:
29465
diff
changeset
|
741 | const gchar *purple_xfer_get_thumbnail_mimetype(const PurpleXfer *xfer); |
|
31293
169eeb43b52c
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
30708
diff
changeset
|
742 | |
|
169eeb43b52c
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
30708
diff
changeset
|
743 | |
|
28263
d525655fd0f1
It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents:
28262
diff
changeset
|
744 | /** |
|
d525655fd0f1
It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents:
28262
diff
changeset
|
745 | * Sets the thumbnail data for a transfer |
|
d525655fd0f1
It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents:
28262
diff
changeset
|
746 | * |
|
d525655fd0f1
It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents:
28262
diff
changeset
|
747 | * @param xfer The file transfer to set the data for |
|
d525655fd0f1
It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents:
28262
diff
changeset
|
748 | * @param thumbnail A pointer to the thumbnail data, this will be copied |
|
d525655fd0f1
It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents:
28262
diff
changeset
|
749 | * @param size The size in bytes of the passed in thumbnail data |
|
30113
f60cbf3b3ca9
Allow PRPLs to specify the image formats acceptable for thumbnails (in
Marcus Lundblad <malu@pidgin.im>
parents:
29465
diff
changeset
|
750 | * @param mimetype The mimetype of the generated thumbnail |
|
28263
d525655fd0f1
It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents:
28262
diff
changeset
|
751 | */ |
|
d525655fd0f1
It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents:
28262
diff
changeset
|
752 | void purple_xfer_set_thumbnail(PurpleXfer *xfer, gconstpointer thumbnail, |
|
30113
f60cbf3b3ca9
Allow PRPLs to specify the image formats acceptable for thumbnails (in
Marcus Lundblad <malu@pidgin.im>
parents:
29465
diff
changeset
|
753 | gsize size, const gchar *mimetype); |
|
28263
d525655fd0f1
It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents:
28262
diff
changeset
|
754 | |
|
d525655fd0f1
It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents:
28262
diff
changeset
|
755 | /** |
|
d525655fd0f1
It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents:
28262
diff
changeset
|
756 | * Prepare a thumbnail for a transfer (if the UI supports it) |
|
d525655fd0f1
It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents:
28262
diff
changeset
|
757 | * will be no-op in case the UI doesn't implement thumbnail creation |
|
d525655fd0f1
It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents:
28262
diff
changeset
|
758 | * |
|
d525655fd0f1
It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents:
28262
diff
changeset
|
759 | * @param xfer The file transfer to create a thumbnail for |
|
30114
8472e53fbbfc
Set desired image formats for thumbnails as a parameter to
Marcus Lundblad <malu@pidgin.im>
parents:
30113
diff
changeset
|
760 | * @param formats A comma-separated list of mimetypes for image formats |
|
8472e53fbbfc
Set desired image formats for thumbnails as a parameter to
Marcus Lundblad <malu@pidgin.im>
parents:
30113
diff
changeset
|
761 | * the protocols can use for thumbnails. |
|
28263
d525655fd0f1
It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents:
28262
diff
changeset
|
762 | */ |
|
30114
8472e53fbbfc
Set desired image formats for thumbnails as a parameter to
Marcus Lundblad <malu@pidgin.im>
parents:
30113
diff
changeset
|
763 | void purple_xfer_prepare_thumbnail(PurpleXfer *xfer, const gchar *formats); |
|
28263
d525655fd0f1
It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents:
28262
diff
changeset
|
764 | |
|
32239
3d93edd94500
Introduce API purple_xfer_get_protocol_data() and purple_xfer_set_protocol_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
31293
diff
changeset
|
765 | /** |
|
3d93edd94500
Introduce API purple_xfer_get_protocol_data() and purple_xfer_set_protocol_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
31293
diff
changeset
|
766 | * Sets the protocol data for a file transfer. |
|
3d93edd94500
Introduce API purple_xfer_get_protocol_data() and purple_xfer_set_protocol_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
31293
diff
changeset
|
767 | * |
|
3d93edd94500
Introduce API purple_xfer_get_protocol_data() and purple_xfer_set_protocol_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
31293
diff
changeset
|
768 | * @param xfer The file transfer. |
|
32554
0d844fac6679
Fix a bunch of tiny problems generating our doxygen documentation
Mark Doliner <markdoliner@pidgin.im>
parents:
32289
diff
changeset
|
769 | * @param proto_data The protocol data to set for the file transfer. |
|
32239
3d93edd94500
Introduce API purple_xfer_get_protocol_data() and purple_xfer_set_protocol_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
31293
diff
changeset
|
770 | */ |
|
32248
aa63f22a6e6a
Rename field for consistency.
Andrew Victor <andrew.victor@mxit.com>
parents:
32239
diff
changeset
|
771 | void purple_xfer_set_protocol_data(PurpleXfer *xfer, gpointer proto_data); |
|
32239
3d93edd94500
Introduce API purple_xfer_get_protocol_data() and purple_xfer_set_protocol_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
31293
diff
changeset
|
772 | |
|
3d93edd94500
Introduce API purple_xfer_get_protocol_data() and purple_xfer_set_protocol_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
31293
diff
changeset
|
773 | /** |
|
3d93edd94500
Introduce API purple_xfer_get_protocol_data() and purple_xfer_set_protocol_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
31293
diff
changeset
|
774 | * Gets the protocol data for a file transfer. |
|
3d93edd94500
Introduce API purple_xfer_get_protocol_data() and purple_xfer_set_protocol_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
31293
diff
changeset
|
775 | * |
|
3d93edd94500
Introduce API purple_xfer_get_protocol_data() and purple_xfer_set_protocol_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
31293
diff
changeset
|
776 | * @param xfer The file transfer. |
|
3d93edd94500
Introduce API purple_xfer_get_protocol_data() and purple_xfer_set_protocol_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
31293
diff
changeset
|
777 | * |
|
3d93edd94500
Introduce API purple_xfer_get_protocol_data() and purple_xfer_set_protocol_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
31293
diff
changeset
|
778 | * @return The protocol data for the file transfer. |
|
3d93edd94500
Introduce API purple_xfer_get_protocol_data() and purple_xfer_set_protocol_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
31293
diff
changeset
|
779 | */ |
|
32256
620e4580252a
These pointers should rather be marked const.
Andrew Victor <andrew.victor@mxit.com>
parents:
32249
diff
changeset
|
780 | gpointer purple_xfer_get_protocol_data(const PurpleXfer *xfer); |
|
28263
d525655fd0f1
It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents:
28262
diff
changeset
|
781 | |
|
32249
b636d2273c64
Added accessor functions purple_xfer_get_ui_data() and purple_xfer_set_ui_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
32248
diff
changeset
|
782 | /** |
|
b636d2273c64
Added accessor functions purple_xfer_get_ui_data() and purple_xfer_set_ui_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
32248
diff
changeset
|
783 | * Set the UI data associated with this file transfer. |
|
b636d2273c64
Added accessor functions purple_xfer_get_ui_data() and purple_xfer_set_ui_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
32248
diff
changeset
|
784 | * |
|
b636d2273c64
Added accessor functions purple_xfer_get_ui_data() and purple_xfer_set_ui_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
32248
diff
changeset
|
785 | * @param xfer The file transfer. |
|
b636d2273c64
Added accessor functions purple_xfer_get_ui_data() and purple_xfer_set_ui_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
32248
diff
changeset
|
786 | * @param ui_data A pointer to associate with this file transfer. |
|
b636d2273c64
Added accessor functions purple_xfer_get_ui_data() and purple_xfer_set_ui_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
32248
diff
changeset
|
787 | */ |
|
b636d2273c64
Added accessor functions purple_xfer_get_ui_data() and purple_xfer_set_ui_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
32248
diff
changeset
|
788 | void purple_xfer_set_ui_data(PurpleXfer *xfer, gpointer ui_data); |
|
b636d2273c64
Added accessor functions purple_xfer_get_ui_data() and purple_xfer_set_ui_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
32248
diff
changeset
|
789 | |
|
b636d2273c64
Added accessor functions purple_xfer_get_ui_data() and purple_xfer_set_ui_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
32248
diff
changeset
|
790 | /** |
|
b636d2273c64
Added accessor functions purple_xfer_get_ui_data() and purple_xfer_set_ui_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
32248
diff
changeset
|
791 | * Get the UI data associated with this file transfer. |
|
b636d2273c64
Added accessor functions purple_xfer_get_ui_data() and purple_xfer_set_ui_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
32248
diff
changeset
|
792 | * |
|
b636d2273c64
Added accessor functions purple_xfer_get_ui_data() and purple_xfer_set_ui_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
32248
diff
changeset
|
793 | * @param xfer The file transfer. |
|
b636d2273c64
Added accessor functions purple_xfer_get_ui_data() and purple_xfer_set_ui_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
32248
diff
changeset
|
794 | * |
|
b636d2273c64
Added accessor functions purple_xfer_get_ui_data() and purple_xfer_set_ui_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
32248
diff
changeset
|
795 | * @return The UI data associated with this file transfer. This is a |
|
b636d2273c64
Added accessor functions purple_xfer_get_ui_data() and purple_xfer_set_ui_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
32248
diff
changeset
|
796 | * convenience field provided to the UIs--it is not |
|
b636d2273c64
Added accessor functions purple_xfer_get_ui_data() and purple_xfer_set_ui_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
32248
diff
changeset
|
797 | * used by the libpurple core. |
|
b636d2273c64
Added accessor functions purple_xfer_get_ui_data() and purple_xfer_set_ui_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
32248
diff
changeset
|
798 | */ |
|
32256
620e4580252a
These pointers should rather be marked const.
Andrew Victor <andrew.victor@mxit.com>
parents:
32249
diff
changeset
|
799 | gpointer purple_xfer_get_ui_data(const PurpleXfer *xfer); |
|
32249
b636d2273c64
Added accessor functions purple_xfer_get_ui_data() and purple_xfer_set_ui_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
32248
diff
changeset
|
800 | |
|
6263
6fec763a314c
[gaim-migrate @ 6760]
Christian Hammond <chipx86@chipx86.com>
parents:
6241
diff
changeset
|
801 | /*@}*/ |
|
6fec763a314c
[gaim-migrate @ 6760]
Christian Hammond <chipx86@chipx86.com>
parents:
6241
diff
changeset
|
802 | |
|
6fec763a314c
[gaim-migrate @ 6760]
Christian Hammond <chipx86@chipx86.com>
parents:
6241
diff
changeset
|
803 | /**************************************************************************/ |
|
34909
91be147083c6
Started GObjectification of PurpleXfer.
Ankit Vani <a@nevitus.org>
parents:
34878
diff
changeset
|
804 | /** @name File Transfer Subsystem API */ |
| 4514 | 805 | /**************************************************************************/ |
| 806 | /*@{*/ | |
| 807 | ||
| 808 | /** | |
|
34909
91be147083c6
Started GObjectification of PurpleXfer.
Ankit Vani <a@nevitus.org>
parents:
34878
diff
changeset
|
809 | * Returns all xfers |
|
91be147083c6
Started GObjectification of PurpleXfer.
Ankit Vani <a@nevitus.org>
parents:
34878
diff
changeset
|
810 | * |
|
91be147083c6
Started GObjectification of PurpleXfer.
Ankit Vani <a@nevitus.org>
parents:
34878
diff
changeset
|
811 | * @return all current xfers with refs |
|
91be147083c6
Started GObjectification of PurpleXfer.
Ankit Vani <a@nevitus.org>
parents:
34878
diff
changeset
|
812 | */ |
|
91be147083c6
Started GObjectification of PurpleXfer.
Ankit Vani <a@nevitus.org>
parents:
34878
diff
changeset
|
813 | GList *purple_xfers_get_all(void); |
|
91be147083c6
Started GObjectification of PurpleXfer.
Ankit Vani <a@nevitus.org>
parents:
34878
diff
changeset
|
814 | |
|
91be147083c6
Started GObjectification of PurpleXfer.
Ankit Vani <a@nevitus.org>
parents:
34878
diff
changeset
|
815 | /** |
|
11281
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
816 | * Returns the handle to the file transfer subsystem |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
817 | * |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
818 | * @return The handle |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
819 | */ |
| 15884 | 820 | void *purple_xfers_get_handle(void); |
|
11281
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
821 | |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
822 | /** |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
823 | * Initializes the file transfer subsystem |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
824 | */ |
| 15884 | 825 | void purple_xfers_init(void); |
|
11281
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
826 | |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
827 | /** |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
828 | * Uninitializes the file transfer subsystem |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
829 | */ |
| 15884 | 830 | void purple_xfers_uninit(void); |
|
11281
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
831 | |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
832 | /** |
| 15884 | 833 | * Sets the UI operations structure to be used in all purple file transfers. |
| 4514 | 834 | * |
|
6720
cdc5348dd848
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6269
diff
changeset
|
835 | * @param ops The UI operations structure. |
| 4514 | 836 | */ |
| 15884 | 837 | void purple_xfers_set_ui_ops(PurpleXferUiOps *ops); |
| 4514 | 838 | |
| 839 | /** | |
| 15884 | 840 | * Returns the UI operations structure to be used in all purple file transfers. |
| 4514 | 841 | * |
| 842 | * @return The UI operations structure. | |
| 843 | */ | |
| 15884 | 844 | PurpleXferUiOps *purple_xfers_get_ui_ops(void); |
| 4514 | 845 | |
| 846 | /*@}*/ | |
| 847 | ||
|
32787
7072f190d6ad
Use G_BEGIN/END_DECLS in public libpurple files. This was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32663
diff
changeset
|
848 | G_END_DECLS |
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
849 | |
|
34909
91be147083c6
Started GObjectification of PurpleXfer.
Ankit Vani <a@nevitus.org>
parents:
34878
diff
changeset
|
850 | #endif /* _PURPLE_XFER_H_ */ |
|
32663
1b87b3e98b0a
Upgrade PurpleXfer for a 64-bit world.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32608
diff
changeset
|
851 |