Sun, 01 Sep 2013 14:24:24 +0530
Renamed some prpl stuff to protocol stuff.
Renamed /plugins/prpl prefs to /protocols
| 4514 | 1 | /** |
|
7820
06fc9f66d2cb
[gaim-migrate @ 8472]
Mark Doliner <markdoliner@pidgin.im>
parents:
7805
diff
changeset
|
2 | * @file ft.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 | */ |
| 15884 | 27 | #ifndef _PURPLE_FT_H_ |
| 28 | #define _PURPLE_FT_H_ | |
| 4514 | 29 | |
|
34798
c1cb4cd0543d
Resolved conflicting function names
Ankit Vani <a@nevitus.org>
parents:
34794
diff
changeset
|
30 | #define PURPLE_TYPE_XFER (purple_xfer_get_g_type()) |
|
34792
09228ea79272
Added GBoxed to certificate, certificate pool, xfer, log
Ankit Vani <a@nevitus.org>
parents:
33465
diff
changeset
|
31 | |
| 4514 | 32 | /**************************************************************************/ |
| 33 | /** Data Structures */ | |
| 34 | /**************************************************************************/ | |
| 15884 | 35 | typedef struct _PurpleXfer PurpleXfer; |
| 4514 | 36 | |
|
12151
8002bb57756b
[gaim-migrate @ 14452]
Richard Laager <rlaager@pidgin.im>
parents:
12150
diff
changeset
|
37 | #include <glib.h> |
|
8002bb57756b
[gaim-migrate @ 14452]
Richard Laager <rlaager@pidgin.im>
parents:
12150
diff
changeset
|
38 | #include <stdio.h> |
|
8002bb57756b
[gaim-migrate @ 14452]
Richard Laager <rlaager@pidgin.im>
parents:
12150
diff
changeset
|
39 | |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
40 | #include "account.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
41 | |
| 4514 | 42 | /** |
| 43 | * Types of file transfers. | |
| 44 | */ | |
| 45 | typedef enum | |
| 46 | { | |
| 15884 | 47 | PURPLE_XFER_UNKNOWN = 0, /**< Unknown file transfer type. */ |
| 48 | PURPLE_XFER_SEND, /**< File sending. */ | |
| 49 | PURPLE_XFER_RECEIVE /**< File receiving. */ | |
| 4514 | 50 | |
| 15884 | 51 | } PurpleXferType; |
| 4514 | 52 | |
| 7805 | 53 | /** |
| 54 | * The different states of the xfer. | |
| 55 | */ | |
| 7738 | 56 | typedef enum |
| 57 | { | |
| 15884 | 58 | PURPLE_XFER_STATUS_UNKNOWN = 0, /**< Unknown, the xfer may be null. */ |
| 59 | PURPLE_XFER_STATUS_NOT_STARTED, /**< It hasn't started yet. */ | |
| 60 | PURPLE_XFER_STATUS_ACCEPTED, /**< Receive accepted, but destination file not selected yet */ | |
| 61 | PURPLE_XFER_STATUS_STARTED, /**< purple_xfer_start has been called. */ | |
| 62 | PURPLE_XFER_STATUS_DONE, /**< The xfer completed successfully. */ | |
|
30708
535bec1e66fb
Standardize on "cancelled".
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30131
diff
changeset
|
63 | 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
|
64 | PURPLE_XFER_STATUS_CANCEL_REMOTE /**< The xfer was cancelled by the other end, or we couldn't connect. */ |
| 15884 | 65 | } PurpleXferStatusType; |
| 7738 | 66 | |
| 4514 | 67 | /** |
| 68 | * File transfer UI operations. | |
| 69 | * | |
| 70 | * Any UI representing a file transfer must assign a filled-out | |
| 15884 | 71 | * PurpleXferUiOps structure to the purple_xfer. |
| 4514 | 72 | */ |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
73 | typedef struct |
| 4514 | 74 | { |
| 15884 | 75 | void (*new_xfer)(PurpleXfer *xfer); |
| 76 | void (*destroy)(PurpleXfer *xfer); | |
| 77 | void (*add_xfer)(PurpleXfer *xfer); | |
| 78 | void (*update_progress)(PurpleXfer *xfer, double percent); | |
| 79 | void (*cancel_local)(PurpleXfer *xfer); | |
| 80 | void (*cancel_remote)(PurpleXfer *xfer); | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
81 | |
|
28150
1213ec1efcf8
ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents:
22338
diff
changeset
|
82 | /** |
|
36637
9b0109ae118d
Renamed some prpl stuff to protocol stuff.
Ankit Vani <a@nevitus.org>
parents:
36545
diff
changeset
|
83 | * 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
|
84 | * 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
|
85 | * |
|
1213ec1efcf8
ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents:
22338
diff
changeset
|
86 | * @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
|
87 | * @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
|
88 | * @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
|
89 | * |
|
1213ec1efcf8
ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents:
22338
diff
changeset
|
90 | * @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
|
91 | * 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
|
92 | */ |
|
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
|
93 | 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
|
94 | |
|
1213ec1efcf8
ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents:
22338
diff
changeset
|
95 | /** |
|
36637
9b0109ae118d
Renamed some prpl stuff to protocol stuff.
Ankit Vani <a@nevitus.org>
parents:
36545
diff
changeset
|
96 | * 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
|
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 | * @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
|
99 | * @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
|
100 | * 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
|
101 | * @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
|
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 | * @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
|
104 | * 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
|
105 | * 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
|
106 | */ |
|
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
|
107 | 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
|
108 | |
|
1213ec1efcf8
ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents:
22338
diff
changeset
|
109 | /** |
|
1213ec1efcf8
ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents:
22338
diff
changeset
|
110 | * 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
|
111 | * 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
|
112 | * |
|
1213ec1efcf8
ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents:
22338
diff
changeset
|
113 | * 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
|
114 | * |
|
1213ec1efcf8
ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents:
22338
diff
changeset
|
115 | * @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
|
116 | * @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
|
117 | * @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
|
118 | */ |
|
1213ec1efcf8
ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents:
22338
diff
changeset
|
119 | 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
|
120 | |
|
28683
2fda587fb3e6
Add a comment about the add thumbnail op for PurpleXfer
Marcus Lundblad <malu@pidgin.im>
parents:
28263
diff
changeset
|
121 | /** |
|
2fda587fb3e6
Add a comment about the add thumbnail op for PurpleXfer
Marcus Lundblad <malu@pidgin.im>
parents:
28263
diff
changeset
|
122 | * 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
|
123 | * |
|
2fda587fb3e6
Add a comment about the add thumbnail op for PurpleXfer
Marcus Lundblad <malu@pidgin.im>
parents:
28263
diff
changeset
|
124 | * @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
|
125 | */ |
|
30114
8472e53fbbfc
Set desired image formats for thumbnails as a parameter to
Marcus Lundblad <malu@pidgin.im>
parents:
30113
diff
changeset
|
126 | void (*add_thumbnail)(PurpleXfer *xfer, const gchar *formats); |
| 15884 | 127 | } PurpleXferUiOps; |
| 4514 | 128 | |
| 129 | /** | |
| 130 | * A core representation of a file transfer. | |
| 131 | */ | |
| 15884 | 132 | struct _PurpleXfer |
| 4514 | 133 | { |
|
15280
9df6112da532
[gaim-migrate @ 18008]
Mark Doliner <markdoliner@pidgin.im>
parents:
15000
diff
changeset
|
134 | guint ref; /**< The reference count. */ |
| 15884 | 135 | PurpleXferType type; /**< The type of transfer. */ |
| 4514 | 136 | |
| 15884 | 137 | PurpleAccount *account; /**< The account. */ |
| 4514 | 138 | |
| 139 | char *who; /**< The person on the other end of the | |
| 140 | transfer. */ | |
| 141 | ||
|
9933
61bd3fadbfe6
[gaim-migrate @ 10825]
Dave West <kat@users.sourceforge.net>
parents:
9511
diff
changeset
|
142 | char *message; /**< A message sent with the request */ |
|
4605
67526771e679
[gaim-migrate @ 4892]
Mark Doliner <markdoliner@pidgin.im>
parents:
4595
diff
changeset
|
143 | char *filename; /**< The name sent over the network. */ |
|
67526771e679
[gaim-migrate @ 4892]
Mark Doliner <markdoliner@pidgin.im>
parents:
4595
diff
changeset
|
144 | char *local_filename; /**< The name on the local hard drive. */ |
|
32663
1b87b3e98b0a
Upgrade PurpleXfer for a 64-bit world.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32608
diff
changeset
|
145 | goffset size; /**< The size of the file. */ |
| 4514 | 146 | |
| 147 | FILE *dest_fp; /**< The destination file pointer. */ | |
| 148 | ||
| 149 | char *remote_ip; /**< The remote IP address. */ | |
| 150 | int local_port; /**< The local port. */ | |
| 151 | int remote_port; /**< The remote port. */ | |
| 152 | ||
| 153 | int fd; /**< The socket file descriptor. */ | |
| 154 | int watcher; /**< Watcher. */ | |
| 155 | ||
|
32663
1b87b3e98b0a
Upgrade PurpleXfer for a 64-bit world.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32608
diff
changeset
|
156 | goffset bytes_sent; /**< The number of bytes sent. */ |
|
1b87b3e98b0a
Upgrade PurpleXfer for a 64-bit world.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32608
diff
changeset
|
157 | goffset bytes_remaining; /**< The number of bytes remaining. */ |
|
13599
b6369e541654
[gaim-migrate @ 15984]
Mark Doliner <markdoliner@pidgin.im>
parents:
13009
diff
changeset
|
158 | time_t start_time; /**< When the transfer of data began. */ |
|
b6369e541654
[gaim-migrate @ 15984]
Mark Doliner <markdoliner@pidgin.im>
parents:
13009
diff
changeset
|
159 | time_t end_time; /**< When the transfer of data ended. */ |
| 4514 | 160 | |
|
15280
9df6112da532
[gaim-migrate @ 18008]
Mark Doliner <markdoliner@pidgin.im>
parents:
15000
diff
changeset
|
161 | size_t current_buffer_size; /**< This gradually increases for fast |
|
9df6112da532
[gaim-migrate @ 18008]
Mark Doliner <markdoliner@pidgin.im>
parents:
15000
diff
changeset
|
162 | network connections. */ |
|
9df6112da532
[gaim-migrate @ 18008]
Mark Doliner <markdoliner@pidgin.im>
parents:
15000
diff
changeset
|
163 | |
| 15884 | 164 | PurpleXferStatusType status; /**< File Transfer's status. */ |
| 4538 | 165 | |
|
36637
9b0109ae118d
Renamed some prpl stuff to protocol stuff.
Ankit Vani <a@nevitus.org>
parents:
36545
diff
changeset
|
166 | /** I/O operations, which should be set by the protocol using |
|
28971
26b55b57d27e
*** Plucked rev 3ad8ea46 (resiak@pidgin.im):
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
28688
diff
changeset
|
167 | * purple_xfer_set_init_fnc() and friends. Setting #init is |
|
26b55b57d27e
*** Plucked rev 3ad8ea46 (resiak@pidgin.im):
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
28688
diff
changeset
|
168 | * mandatory; all others are optional. |
|
26b55b57d27e
*** Plucked rev 3ad8ea46 (resiak@pidgin.im):
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
28688
diff
changeset
|
169 | */ |
| 4514 | 170 | struct |
| 171 | { | |
| 15884 | 172 | void (*init)(PurpleXfer *xfer); |
| 173 | void (*request_denied)(PurpleXfer *xfer); | |
| 174 | void (*start)(PurpleXfer *xfer); | |
| 175 | void (*end)(PurpleXfer *xfer); | |
| 176 | void (*cancel_send)(PurpleXfer *xfer); | |
| 177 | void (*cancel_recv)(PurpleXfer *xfer); | |
| 178 | gssize (*read)(guchar **buffer, PurpleXfer *xfer); | |
| 179 | gssize (*write)(const guchar *buffer, size_t size, PurpleXfer *xfer); | |
| 180 | void (*ack)(PurpleXfer *xfer, const guchar *buffer, size_t size); | |
| 4514 | 181 | } ops; |
| 182 | ||
| 15884 | 183 | PurpleXferUiOps *ui_ops; /**< UI-specific operations. */ |
| 4514 | 184 | void *ui_data; /**< UI-specific data. */ |
| 185 | ||
|
36637
9b0109ae118d
Renamed some prpl stuff to protocol stuff.
Ankit Vani <a@nevitus.org>
parents:
36545
diff
changeset
|
186 | void *proto_data; /**< protocol-specific data. */ |
| 4514 | 187 | }; |
| 188 | ||
|
32787
7072f190d6ad
Use G_BEGIN/END_DECLS in public libpurple files. This was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32663
diff
changeset
|
189 | G_BEGIN_DECLS |
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
190 | |
| 4514 | 191 | /**************************************************************************/ |
| 192 | /** @name File Transfer API */ | |
| 193 | /**************************************************************************/ | |
| 194 | /*@{*/ | |
| 195 | ||
| 196 | /** | |
|
34792
09228ea79272
Added GBoxed to certificate, certificate pool, xfer, log
Ankit Vani <a@nevitus.org>
parents:
33465
diff
changeset
|
197 | * Returns the GType for the PurpleXfer boxed structure. |
|
09228ea79272
Added GBoxed to certificate, certificate pool, xfer, log
Ankit Vani <a@nevitus.org>
parents:
33465
diff
changeset
|
198 | * TODO Boxing of PurpleXfer is a temporary solution to having a GType for |
|
09228ea79272
Added GBoxed to certificate, certificate pool, xfer, log
Ankit Vani <a@nevitus.org>
parents:
33465
diff
changeset
|
199 | * file transfers. This should rather be a GObject instead of a GBoxed. |
|
09228ea79272
Added GBoxed to certificate, certificate pool, xfer, log
Ankit Vani <a@nevitus.org>
parents:
33465
diff
changeset
|
200 | */ |
|
34798
c1cb4cd0543d
Resolved conflicting function names
Ankit Vani <a@nevitus.org>
parents:
34794
diff
changeset
|
201 | GType purple_xfer_get_g_type(void); |
|
34792
09228ea79272
Added GBoxed to certificate, certificate pool, xfer, log
Ankit Vani <a@nevitus.org>
parents:
33465
diff
changeset
|
202 | |
|
09228ea79272
Added GBoxed to certificate, certificate pool, xfer, log
Ankit Vani <a@nevitus.org>
parents:
33465
diff
changeset
|
203 | /** |
| 4514 | 204 | * Creates a new file transfer handle. |
|
36637
9b0109ae118d
Renamed some prpl stuff to protocol stuff.
Ankit Vani <a@nevitus.org>
parents:
36545
diff
changeset
|
205 | * This is called by protocols. |
| 7805 | 206 | * 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
|
207 | * is owned by the core. The protocol normally does not need to |
| 15884 | 208 | * purple_xfer_ref or unref. |
| 4514 | 209 | * |
| 210 | * @param account The account sending or receiving the file. | |
| 211 | * @param type The type of file transfer. | |
| 212 | * @param who The name of the remote user. | |
| 213 | * | |
| 214 | * @return A file transfer handle. | |
| 215 | */ | |
| 15884 | 216 | PurpleXfer *purple_xfer_new(PurpleAccount *account, |
| 217 | PurpleXferType type, const char *who); | |
| 4514 | 218 | |
| 219 | /** | |
|
15702
111fdd9108cc
Patch from Richard 'wabz' Nelson to add file-transfer ui. Amazing stuff\!
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15435
diff
changeset
|
220 | * Returns all xfers |
|
111fdd9108cc
Patch from Richard 'wabz' Nelson to add file-transfer ui. Amazing stuff\!
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15435
diff
changeset
|
221 | * |
|
111fdd9108cc
Patch from Richard 'wabz' Nelson to add file-transfer ui. Amazing stuff\!
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15435
diff
changeset
|
222 | * @return all current xfers with refs |
|
111fdd9108cc
Patch from Richard 'wabz' Nelson to add file-transfer ui. Amazing stuff\!
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15435
diff
changeset
|
223 | */ |
| 15884 | 224 | GList *purple_xfers_get_all(void); |
|
15702
111fdd9108cc
Patch from Richard 'wabz' Nelson to add file-transfer ui. Amazing stuff\!
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15435
diff
changeset
|
225 | |
|
111fdd9108cc
Patch from Richard 'wabz' Nelson to add file-transfer ui. Amazing stuff\!
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15435
diff
changeset
|
226 | /** |
| 15884 | 227 | * Increases the reference count on a PurpleXfer. |
| 228 | * Please call purple_xfer_unref later. | |
| 4514 | 229 | * |
| 7805 | 230 | * @param xfer A file transfer handle. |
| 4514 | 231 | */ |
| 15884 | 232 | void purple_xfer_ref(PurpleXfer *xfer); |
| 7805 | 233 | |
| 234 | /** | |
| 15884 | 235 | * Decreases the reference count on a PurpleXfer. |
| 236 | * If the reference reaches 0, purple_xfer_destroy (an internal function) | |
| 7805 | 237 | * will destroy the xfer. It calls the ui destroy cb first. |
|
8735
01248ea222d3
[gaim-migrate @ 9490]
Jonathan Champ <royanee@users.sourceforge.net>
parents:
8585
diff
changeset
|
238 | * Since the core keeps a ref on the xfer, only an erroneous call to |
| 7805 | 239 | * this function will destroy the xfer while still in use. |
| 240 | * | |
| 241 | * @param xfer A file transfer handle. | |
| 242 | */ | |
| 15884 | 243 | void purple_xfer_unref(PurpleXfer *xfer); |
| 4514 | 244 | |
| 245 | /** | |
|
8585
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
246 | * Requests confirmation for a file transfer from the user. If receiving |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
247 | * 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
|
248 | * 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
|
249 | * 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
|
250 | * again once the filename is available. |
| 4514 | 251 | * |
| 252 | * @param xfer The file transfer to request confirmation on. | |
| 253 | */ | |
| 15884 | 254 | void purple_xfer_request(PurpleXfer *xfer); |
| 4514 | 255 | |
| 256 | /** | |
| 257 | * Called if the user accepts the file transfer request. | |
| 258 | * | |
| 259 | * @param xfer The file transfer. | |
| 260 | * @param filename The filename. | |
| 261 | */ | |
| 15884 | 262 | void purple_xfer_request_accepted(PurpleXfer *xfer, const char *filename); |
| 4514 | 263 | |
| 264 | /** | |
| 265 | * Called if the user rejects the file transfer request. | |
| 266 | * | |
| 267 | * @param xfer The file transfer. | |
| 268 | */ | |
| 15884 | 269 | void purple_xfer_request_denied(PurpleXfer *xfer); |
| 4514 | 270 | |
| 271 | /** | |
|
32289
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
272 | * 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
|
273 | * |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
274 | * @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
|
275 | * |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
276 | * @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
|
277 | */ |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
278 | 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
|
279 | |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
280 | /** |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
281 | * 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
|
282 | * |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
283 | * @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
|
284 | * |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
285 | * @return The watcher. |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
286 | */ |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
287 | 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
|
288 | |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
289 | /** |
| 4514 | 290 | * Returns the type of file transfer. |
| 291 | * | |
| 292 | * @param xfer The file transfer. | |
| 293 | * | |
| 294 | * @return The type of the file transfer. | |
| 295 | */ | |
| 15884 | 296 | PurpleXferType purple_xfer_get_type(const PurpleXfer *xfer); |
| 4514 | 297 | |
| 298 | /** | |
| 299 | * Returns the account the file transfer is using. | |
| 300 | * | |
| 301 | * @param xfer The file transfer. | |
| 302 | * | |
| 303 | * @return The account. | |
| 304 | */ | |
| 15884 | 305 | PurpleAccount *purple_xfer_get_account(const PurpleXfer *xfer); |
| 4514 | 306 | |
| 307 | /** | |
|
17852
174c0d122a79
Add new function purple_xfer_get_remote_user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16743
diff
changeset
|
308 | * 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
|
309 | * |
|
174c0d122a79
Add new function purple_xfer_get_remote_user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16743
diff
changeset
|
310 | * @param xfer The file transfer. |
|
174c0d122a79
Add new function purple_xfer_get_remote_user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16743
diff
changeset
|
311 | * |
|
174c0d122a79
Add new function purple_xfer_get_remote_user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16743
diff
changeset
|
312 | * @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
|
313 | */ |
|
174c0d122a79
Add new function purple_xfer_get_remote_user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16743
diff
changeset
|
314 | 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
|
315 | |
|
174c0d122a79
Add new function purple_xfer_get_remote_user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16743
diff
changeset
|
316 | /** |
| 7805 | 317 | * Returns the status of the xfer. |
| 318 | * | |
| 319 | * @param xfer The file transfer. | |
| 320 | * | |
| 321 | * @return The status. | |
| 322 | */ | |
| 15884 | 323 | PurpleXferStatusType purple_xfer_get_status(const PurpleXfer *xfer); |
| 7805 | 324 | |
| 325 | /** | |
|
30708
535bec1e66fb
Standardize on "cancelled".
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30131
diff
changeset
|
326 | * Returns true if the file transfer was cancelled. |
| 7738 | 327 | * |
| 328 | * @param xfer The file transfer. | |
| 329 | * | |
|
30708
535bec1e66fb
Standardize on "cancelled".
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30131
diff
changeset
|
330 | * @return Whether or not the transfer was cancelled. |
| 7738 | 331 | */ |
|
32607
3d50780413f8
purple_xfer_is_canceled() renamed to purple_xfer_is_cancelled()
Andrew Victor <andrew.victor@mxit.com>
parents:
32604
diff
changeset
|
332 | gboolean purple_xfer_is_cancelled(const PurpleXfer *xfer); |
| 7738 | 333 | |
| 334 | /** | |
|
4539
44671e1ce14e
[gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents:
4538
diff
changeset
|
335 | * Returns the completed state for a file transfer. |
|
44671e1ce14e
[gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents:
4538
diff
changeset
|
336 | * |
|
44671e1ce14e
[gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents:
4538
diff
changeset
|
337 | * @param xfer The file transfer. |
|
44671e1ce14e
[gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents:
4538
diff
changeset
|
338 | * |
|
44671e1ce14e
[gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents:
4538
diff
changeset
|
339 | * @return The completed state. |
|
44671e1ce14e
[gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents:
4538
diff
changeset
|
340 | */ |
| 15884 | 341 | gboolean purple_xfer_is_completed(const PurpleXfer *xfer); |
|
4539
44671e1ce14e
[gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents:
4538
diff
changeset
|
342 | |
|
44671e1ce14e
[gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents:
4538
diff
changeset
|
343 | /** |
| 4514 | 344 | * Returns the name of the file being sent or received. |
| 345 | * | |
| 346 | * @param xfer The file transfer. | |
| 347 | * | |
| 348 | * @return The filename. | |
| 349 | */ | |
| 15884 | 350 | const char *purple_xfer_get_filename(const PurpleXfer *xfer); |
| 4514 | 351 | |
| 352 | /** | |
| 353 | * Returns the file's destination filename, | |
| 354 | * | |
| 355 | * @param xfer The file transfer. | |
| 356 | * | |
| 357 | * @return The destination filename. | |
| 358 | */ | |
| 15884 | 359 | const char *purple_xfer_get_local_filename(const PurpleXfer *xfer); |
| 4514 | 360 | |
| 361 | /** | |
|
13009
12ef9f229961
[gaim-migrate @ 15362]
Daniel Atallah <datallah@pidgin.im>
parents:
12151
diff
changeset
|
362 | * Returns the number of bytes sent (or received) so far. |
| 4514 | 363 | * |
| 364 | * @param xfer The file transfer. | |
| 365 | * | |
| 366 | * @return The number of bytes sent. | |
| 367 | */ | |
|
32663
1b87b3e98b0a
Upgrade PurpleXfer for a 64-bit world.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32608
diff
changeset
|
368 | goffset purple_xfer_get_bytes_sent(const PurpleXfer *xfer); |
| 4514 | 369 | |
| 370 | /** | |
|
13009
12ef9f229961
[gaim-migrate @ 15362]
Daniel Atallah <datallah@pidgin.im>
parents:
12151
diff
changeset
|
371 | * Returns the number of bytes remaining to send or receive. |
| 4514 | 372 | * |
| 373 | * @param xfer The file transfer. | |
| 374 | * | |
|
13009
12ef9f229961
[gaim-migrate @ 15362]
Daniel Atallah <datallah@pidgin.im>
parents:
12151
diff
changeset
|
375 | * @return The number of bytes remaining. |
| 4514 | 376 | */ |
|
32663
1b87b3e98b0a
Upgrade PurpleXfer for a 64-bit world.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32608
diff
changeset
|
377 | goffset purple_xfer_get_bytes_remaining(const PurpleXfer *xfer); |
| 4514 | 378 | |
| 379 | /** | |
| 380 | * Returns the size of the file being sent or received. | |
| 381 | * | |
| 382 | * @param xfer The file transfer. | |
| 7805 | 383 | * |
| 4514 | 384 | * @return The total size of the file. |
| 385 | */ | |
|
32663
1b87b3e98b0a
Upgrade PurpleXfer for a 64-bit world.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32608
diff
changeset
|
386 | goffset purple_xfer_get_size(const PurpleXfer *xfer); |
| 4514 | 387 | |
| 388 | /** | |
| 389 | * Returns the current percentage of progress of the transfer. | |
| 390 | * | |
| 391 | * This is a number between 0 (0%) and 1 (100%). | |
| 392 | * | |
| 393 | * @param xfer The file transfer. | |
| 394 | * | |
| 395 | * @return The percentage complete. | |
| 396 | */ | |
| 15884 | 397 | double purple_xfer_get_progress(const PurpleXfer *xfer); |
| 4514 | 398 | |
| 399 | /** | |
| 400 | * Returns the local port number in the file transfer. | |
| 401 | * | |
| 402 | * @param xfer The file transfer. | |
| 403 | * | |
| 404 | * @return The port number on this end. | |
| 405 | */ | |
| 15884 | 406 | unsigned int purple_xfer_get_local_port(const PurpleXfer *xfer); |
| 4514 | 407 | |
| 408 | /** | |
| 409 | * Returns the remote IP address in the file transfer. | |
| 410 | * | |
| 411 | * @param xfer The file transfer. | |
| 412 | * | |
| 413 | * @return The IP address on the other end. | |
| 414 | */ | |
| 15884 | 415 | const char *purple_xfer_get_remote_ip(const PurpleXfer *xfer); |
| 4514 | 416 | |
| 417 | /** | |
| 418 | * Returns the remote port number in the file transfer. | |
| 419 | * | |
| 420 | * @param xfer The file transfer. | |
| 421 | * | |
| 422 | * @return The port number on the other end. | |
| 423 | */ | |
| 15884 | 424 | unsigned int purple_xfer_get_remote_port(const PurpleXfer *xfer); |
| 4514 | 425 | |
| 426 | /** | |
|
22338
d6a489105624
Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20940
diff
changeset
|
427 | * 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
|
428 | * |
|
d6a489105624
Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20940
diff
changeset
|
429 | * @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
|
430 | * |
|
d6a489105624
Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20940
diff
changeset
|
431 | * @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
|
432 | */ |
|
d6a489105624
Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20940
diff
changeset
|
433 | 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
|
434 | |
|
d6a489105624
Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20940
diff
changeset
|
435 | /** |
|
d6a489105624
Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20940
diff
changeset
|
436 | * 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
|
437 | * |
|
d6a489105624
Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20940
diff
changeset
|
438 | * @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
|
439 | * |
|
d6a489105624
Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20940
diff
changeset
|
440 | * @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
|
441 | */ |
|
d6a489105624
Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20940
diff
changeset
|
442 | 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
|
443 | |
|
d6a489105624
Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20940
diff
changeset
|
444 | /** |
|
32289
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
445 | * 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
|
446 | * |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
447 | * @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
|
448 | * @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
|
449 | */ |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
450 | 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
|
451 | |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
452 | /** |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
453 | * 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
|
454 | * |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
455 | * @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
|
456 | * @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
|
457 | */ |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
458 | 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
|
459 | |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
460 | /** |
| 4538 | 461 | * Sets the completed state for the file transfer. |
| 462 | * | |
| 463 | * @param xfer The file transfer. | |
| 464 | * @param completed The completed state. | |
| 465 | */ | |
| 15884 | 466 | void purple_xfer_set_completed(PurpleXfer *xfer, gboolean completed); |
| 4538 | 467 | |
| 468 | /** | |
|
32289
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
469 | * 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
|
470 | * |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
471 | * @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
|
472 | * @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
|
473 | */ |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
474 | void purple_xfer_set_status(PurpleXfer *xfer, PurpleXferStatusType status); |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
475 | |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
476 | /** |
| 4514 | 477 | * Sets the filename for the file transfer. |
| 478 | * | |
| 479 | * @param xfer The file transfer. | |
|
9933
61bd3fadbfe6
[gaim-migrate @ 10825]
Dave West <kat@users.sourceforge.net>
parents:
9511
diff
changeset
|
480 | * @param message The message. |
|
61bd3fadbfe6
[gaim-migrate @ 10825]
Dave West <kat@users.sourceforge.net>
parents:
9511
diff
changeset
|
481 | */ |
| 15884 | 482 | 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
|
483 | |
|
61bd3fadbfe6
[gaim-migrate @ 10825]
Dave West <kat@users.sourceforge.net>
parents:
9511
diff
changeset
|
484 | /** |
|
61bd3fadbfe6
[gaim-migrate @ 10825]
Dave West <kat@users.sourceforge.net>
parents:
9511
diff
changeset
|
485 | * Sets the filename for the file transfer. |
|
61bd3fadbfe6
[gaim-migrate @ 10825]
Dave West <kat@users.sourceforge.net>
parents:
9511
diff
changeset
|
486 | * |
|
61bd3fadbfe6
[gaim-migrate @ 10825]
Dave West <kat@users.sourceforge.net>
parents:
9511
diff
changeset
|
487 | * @param xfer The file transfer. |
| 4514 | 488 | * @param filename The filename. |
| 489 | */ | |
| 15884 | 490 | void purple_xfer_set_filename(PurpleXfer *xfer, const char *filename); |
| 4514 | 491 | |
| 492 | /** | |
|
4605
67526771e679
[gaim-migrate @ 4892]
Mark Doliner <markdoliner@pidgin.im>
parents:
4595
diff
changeset
|
493 | * Sets the local filename for the file transfer. |
| 4514 | 494 | * |
| 495 | * @param xfer The file transfer. | |
| 496 | * @param filename The filename | |
| 497 | */ | |
| 15884 | 498 | void purple_xfer_set_local_filename(PurpleXfer *xfer, const char *filename); |
| 4514 | 499 | |
| 500 | /** | |
| 501 | * Sets the size of the file in a file transfer. | |
| 502 | * | |
| 503 | * @param xfer The file transfer. | |
| 504 | * @param size The size of the file. | |
| 505 | */ | |
|
32663
1b87b3e98b0a
Upgrade PurpleXfer for a 64-bit world.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32608
diff
changeset
|
506 | void purple_xfer_set_size(PurpleXfer *xfer, goffset size); |
| 4514 | 507 | |
| 508 | /** | |
|
32289
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
509 | * 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
|
510 | * |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
511 | * @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
|
512 | * @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
|
513 | */ |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
514 | 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
|
515 | |
|
8c121b654972
Add some get/set functions to help hidding _PrupleXfer.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32282
diff
changeset
|
516 | /** |
|
15322
cd268e368bc1
[gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents:
15280
diff
changeset
|
517 | * Sets the current working position in the active file transfer. This |
|
cd268e368bc1
[gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents:
15280
diff
changeset
|
518 | * 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
|
519 | * 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
|
520 | * |
|
cd268e368bc1
[gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents:
15280
diff
changeset
|
521 | * It's used for pausing and resuming an oscar file transfer. |
|
cd268e368bc1
[gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents:
15280
diff
changeset
|
522 | * |
|
cd268e368bc1
[gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents:
15280
diff
changeset
|
523 | * @param xfer The file transfer. |
|
cd268e368bc1
[gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents:
15280
diff
changeset
|
524 | * @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
|
525 | * sending a file then this is the byte that we will |
|
cd268e368bc1
[gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents:
15280
diff
changeset
|
526 | * send. If we're receiving a file, this is the |
|
cd268e368bc1
[gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents:
15280
diff
changeset
|
527 | * next byte that we expect to receive. |
|
cd268e368bc1
[gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents:
15280
diff
changeset
|
528 | */ |
|
32663
1b87b3e98b0a
Upgrade PurpleXfer for a 64-bit world.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32608
diff
changeset
|
529 | 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
|
530 | |
|
cd268e368bc1
[gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents:
15280
diff
changeset
|
531 | /** |
| 4514 | 532 | * Returns the UI operations structure for a file transfer. |
| 533 | * | |
| 534 | * @param xfer The file transfer. | |
| 535 | * | |
| 536 | * @return The UI operations structure. | |
| 537 | */ | |
| 15884 | 538 | PurpleXferUiOps *purple_xfer_get_ui_ops(const PurpleXfer *xfer); |
| 4514 | 539 | |
| 540 | /** | |
| 541 | * Sets the read function for the file transfer. | |
| 542 | * | |
| 543 | * @param xfer The file transfer. | |
| 544 | * @param fnc The read function. | |
| 545 | */ | |
| 15884 | 546 | void purple_xfer_set_read_fnc(PurpleXfer *xfer, |
| 547 | gssize (*fnc)(guchar **, PurpleXfer *)); | |
| 4514 | 548 | |
| 549 | /** | |
| 550 | * Sets the write function for the file transfer. | |
| 551 | * | |
| 552 | * @param xfer The file transfer. | |
| 553 | * @param fnc The write function. | |
| 554 | */ | |
| 15884 | 555 | void purple_xfer_set_write_fnc(PurpleXfer *xfer, |
| 556 | gssize (*fnc)(const guchar *, size_t, PurpleXfer *)); | |
| 4514 | 557 | |
| 558 | /** | |
| 559 | * Sets the acknowledge function for the file transfer. | |
| 560 | * | |
| 561 | * @param xfer The file transfer. | |
| 562 | * @param fnc The acknowledge function. | |
| 563 | */ | |
| 15884 | 564 | void purple_xfer_set_ack_fnc(PurpleXfer *xfer, |
| 565 | void (*fnc)(PurpleXfer *, const guchar *, size_t)); | |
| 4514 | 566 | |
| 567 | /** | |
| 7805 | 568 | * Sets the function to be called if the request is denied. |
| 569 | * | |
| 570 | * @param xfer The file transfer. | |
|
36637
9b0109ae118d
Renamed some prpl stuff to protocol stuff.
Ankit Vani <a@nevitus.org>
parents:
36545
diff
changeset
|
571 | * @param fnc The request denied protocol callback. |
| 7805 | 572 | */ |
| 15884 | 573 | void purple_xfer_set_request_denied_fnc(PurpleXfer *xfer, void (*fnc)(PurpleXfer *)); |
| 7805 | 574 | |
| 575 | /** | |
| 4514 | 576 | * Sets the transfer initialization function for the file transfer. |
| 577 | * | |
| 15884 | 578 | * This function is required, and must call purple_xfer_start() with |
| 4514 | 579 | * the necessary parameters. This will be called if the file transfer |
| 580 | * is accepted by the user. | |
| 581 | * | |
| 582 | * @param xfer The file transfer. | |
| 583 | * @param fnc The transfer initialization function. | |
| 584 | */ | |
| 15884 | 585 | void purple_xfer_set_init_fnc(PurpleXfer *xfer, void (*fnc)(PurpleXfer *)); |
| 4514 | 586 | |
| 587 | /** | |
| 588 | * Sets the start transfer function for the file transfer. | |
| 589 | * | |
| 590 | * @param xfer The file transfer. | |
| 591 | * @param fnc The start transfer function. | |
| 592 | */ | |
| 15884 | 593 | void purple_xfer_set_start_fnc(PurpleXfer *xfer, void (*fnc)(PurpleXfer *)); |
| 4514 | 594 | |
| 595 | /** | |
| 596 | * Sets the end transfer function for the file transfer. | |
| 597 | * | |
| 598 | * @param xfer The file transfer. | |
| 599 | * @param fnc The end transfer function. | |
| 600 | */ | |
| 15884 | 601 | void purple_xfer_set_end_fnc(PurpleXfer *xfer, void (*fnc)(PurpleXfer *)); |
| 4514 | 602 | |
| 603 | /** | |
|
4675
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
604 | * Sets the cancel send function for the file transfer. |
| 4514 | 605 | * |
| 606 | * @param xfer The file transfer. | |
|
4675
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
607 | * @param fnc The cancel send function. |
| 4514 | 608 | */ |
| 15884 | 609 | void purple_xfer_set_cancel_send_fnc(PurpleXfer *xfer, void (*fnc)(PurpleXfer *)); |
|
4675
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
610 | |
|
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
611 | /** |
|
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
612 | * Sets the cancel receive function for the file transfer. |
|
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
613 | * |
|
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
614 | * @param xfer The file transfer. |
|
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
615 | * @param fnc The cancel receive function. |
|
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
616 | */ |
| 15884 | 617 | void purple_xfer_set_cancel_recv_fnc(PurpleXfer *xfer, void (*fnc)(PurpleXfer *)); |
| 4514 | 618 | |
| 619 | /** | |
| 620 | * Reads in data from a file transfer stream. | |
| 621 | * | |
| 622 | * @param xfer The file transfer. | |
| 623 | * @param buffer The buffer that will be created to contain the data. | |
| 624 | * | |
| 8231 | 625 | * @return The number of bytes read, or -1. |
| 4514 | 626 | */ |
| 15884 | 627 | gssize purple_xfer_read(PurpleXfer *xfer, guchar **buffer); |
| 4514 | 628 | |
| 629 | /** | |
| 630 | * Writes data to a file transfer stream. | |
| 631 | * | |
| 632 | * @param xfer The file transfer. | |
| 633 | * @param buffer The buffer to read the data from. | |
| 634 | * @param size The number of bytes to write. | |
| 635 | * | |
| 8231 | 636 | * @return The number of bytes written, or -1. |
| 4514 | 637 | */ |
| 15884 | 638 | gssize purple_xfer_write(PurpleXfer *xfer, const guchar *buffer, gsize size); |
| 4514 | 639 | |
| 640 | /** | |
|
34272
8df870b218ca
HTTP: chop off another HTTP implementation (for xmpp oob file transfers)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33465
diff
changeset
|
641 | * 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
|
642 | * |
|
8df870b218ca
HTTP: chop off another HTTP implementation (for xmpp oob file transfers)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33465
diff
changeset
|
643 | * @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
|
644 | * @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
|
645 | * @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
|
646 | * |
|
8df870b218ca
HTTP: chop off another HTTP implementation (for xmpp oob file transfers)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33465
diff
changeset
|
647 | * @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
|
648 | */ |
|
8df870b218ca
HTTP: chop off another HTTP implementation (for xmpp oob file transfers)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33465
diff
changeset
|
649 | gboolean |
|
8df870b218ca
HTTP: chop off another HTTP implementation (for xmpp oob file transfers)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33465
diff
changeset
|
650 | 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
|
651 | |
|
8df870b218ca
HTTP: chop off another HTTP implementation (for xmpp oob file transfers)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33465
diff
changeset
|
652 | /** |
|
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
|
653 | * 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
|
654 | * |
|
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
|
655 | * @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
|
656 | * @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
|
657 | * @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
|
658 | * |
|
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
|
659 | * @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
|
660 | * 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
|
661 | */ |
|
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
|
662 | 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
|
663 | 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
|
664 | |
|
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
|
665 | /** |
| 4514 | 666 | * Starts a file transfer. |
| 667 | * | |
| 668 | * Either @a fd must be specified <i>or</i> @a ip and @a port on a | |
| 669 | * file receive transfer. On send, @a fd must be specified, and | |
| 670 | * @a ip and @a port are ignored. | |
| 671 | * | |
|
32608
68c936aba5df
Remove the special case of fd=0 in purple_xfer_start().
Andrew Victor <andrew.victor@mxit.com>
parents:
32607
diff
changeset
|
672 | * 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
|
673 | * 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
|
674 | * |
| 4514 | 675 | * @param xfer The file transfer. |
| 676 | * @param fd The file descriptor for the socket. | |
| 677 | * @param ip The IP address to connect to. | |
| 678 | * @param port The port to connect to. | |
| 679 | */ | |
| 15884 | 680 | void purple_xfer_start(PurpleXfer *xfer, int fd, const char *ip, |
| 4514 | 681 | unsigned int port); |
| 682 | ||
| 683 | /** | |
| 684 | * Ends a file transfer. | |
| 685 | * | |
| 686 | * @param xfer The file transfer. | |
| 687 | */ | |
| 15884 | 688 | void purple_xfer_end(PurpleXfer *xfer); |
| 4514 | 689 | |
| 690 | /** | |
|
8585
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
691 | * Adds a new file transfer to the list of file transfers. Call this only |
| 15884 | 692 | * if you are not using purple_xfer_start. |
|
8585
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
693 | * |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
694 | * @param xfer The file transfer. |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
695 | */ |
| 15884 | 696 | void purple_xfer_add(PurpleXfer *xfer); |
|
8585
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
697 | |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
698 | /** |
|
4675
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
699 | * Cancels a file transfer on the local end. |
| 4514 | 700 | * |
| 701 | * @param xfer The file transfer. | |
| 702 | */ | |
| 15884 | 703 | void purple_xfer_cancel_local(PurpleXfer *xfer); |
|
4675
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
704 | |
|
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
705 | /** |
|
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
706 | * Cancels a file transfer from the remote end. |
|
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
707 | * |
|
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
708 | * @param xfer The file transfer. |
|
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
709 | */ |
| 15884 | 710 | void purple_xfer_cancel_remote(PurpleXfer *xfer); |
| 4514 | 711 | |
| 712 | /** | |
| 713 | * Displays a file transfer-related error message. | |
| 714 | * | |
| 15884 | 715 | * This is a wrapper around purple_notify_error(), which automatically |
| 10654 | 716 | * specifies a title ("File transfer to <i>user</i> failed" or |
| 717 | * "File Transfer from <i>user</i> failed"). | |
| 4514 | 718 | * |
| 10654 | 719 | * @param type The type of file transfer. |
| 720 | * @param account The account sending or receiving the file. | |
| 721 | * @param who The user on the other end of the transfer. | |
| 722 | * @param msg The message to display. | |
| 4514 | 723 | */ |
| 15884 | 724 | void purple_xfer_error(PurpleXferType type, PurpleAccount *account, const char *who, const char *msg); |
| 4514 | 725 | |
|
8585
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
726 | /** |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
727 | * Updates file transfer progress. |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
728 | * |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
729 | * @param xfer The file transfer. |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
730 | */ |
| 15884 | 731 | void purple_xfer_update_progress(PurpleXfer *xfer); |
|
8585
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
732 | |
|
11084
b6acee973833
[gaim-migrate @ 13103]
Jonathan Clark <ardentlygnarly@users.sourceforge.net>
parents:
10654
diff
changeset
|
733 | /** |
|
b6acee973833
[gaim-migrate @ 13103]
Jonathan Clark <ardentlygnarly@users.sourceforge.net>
parents:
10654
diff
changeset
|
734 | * Displays a file transfer-related message in the conversation window |
|
b6acee973833
[gaim-migrate @ 13103]
Jonathan Clark <ardentlygnarly@users.sourceforge.net>
parents:
10654
diff
changeset
|
735 | * |
| 15884 | 736 | * This is a wrapper around purple_conversation_write |
|
11084
b6acee973833
[gaim-migrate @ 13103]
Jonathan Clark <ardentlygnarly@users.sourceforge.net>
parents:
10654
diff
changeset
|
737 | * |
|
b6acee973833
[gaim-migrate @ 13103]
Jonathan Clark <ardentlygnarly@users.sourceforge.net>
parents:
10654
diff
changeset
|
738 | * @param xfer The file transfer to which this message relates. |
|
b6acee973833
[gaim-migrate @ 13103]
Jonathan Clark <ardentlygnarly@users.sourceforge.net>
parents:
10654
diff
changeset
|
739 | * @param message The message to display. |
|
11129
c986d8566843
[gaim-migrate @ 13185]
Mark Doliner <markdoliner@pidgin.im>
parents:
11084
diff
changeset
|
740 | * @param is_error Is this an error message?. |
|
11084
b6acee973833
[gaim-migrate @ 13103]
Jonathan Clark <ardentlygnarly@users.sourceforge.net>
parents:
10654
diff
changeset
|
741 | */ |
|
33465
215bec3b763a
Add const to the API, where needed
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32787
diff
changeset
|
742 | 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
|
743 | |
|
28150
1213ec1efcf8
ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents:
22338
diff
changeset
|
744 | /** |
|
1213ec1efcf8
ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents:
22338
diff
changeset
|
745 | * 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
|
746 | * 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
|
747 | * 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
|
748 | * |
|
28156
0a75e2463576
ft: Add infrastructure to allow a prpl to moderate when to send packets.
Paul Aurich <darkrain42@pidgin.im>
parents:
28152
diff
changeset
|
749 | * @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
|
750 | */ |
|
1213ec1efcf8
ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents:
22338
diff
changeset
|
751 | 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
|
752 | |
|
28156
0a75e2463576
ft: Add infrastructure to allow a prpl to moderate when to send packets.
Paul Aurich <darkrain42@pidgin.im>
parents:
28152
diff
changeset
|
753 | /** |
|
36637
9b0109ae118d
Renamed some prpl stuff to protocol stuff.
Ankit Vani <a@nevitus.org>
parents:
36545
diff
changeset
|
754 | * 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
|
755 | * 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
|
756 | * 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
|
757 | * |
|
0a75e2463576
ft: Add infrastructure to allow a prpl to moderate when to send packets.
Paul Aurich <darkrain42@pidgin.im>
parents:
28152
diff
changeset
|
758 | * @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
|
759 | */ |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
34878
diff
changeset
|
760 | 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
|
761 | |
|
28263
d525655fd0f1
It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents:
28262
diff
changeset
|
762 | /** |
|
d525655fd0f1
It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents:
28262
diff
changeset
|
763 | * Gets the thumbnail data for a transfer |
|
d525655fd0f1
It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents:
28262
diff
changeset
|
764 | * |
|
d525655fd0f1
It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents:
28262
diff
changeset
|
765 | * @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
|
766 | * @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
|
767 | * 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
|
768 | * @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
|
769 | */ |
|
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
|
770 | 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
|
771 | |
|
30113
f60cbf3b3ca9
Allow PRPLs to specify the image formats acceptable for thumbnails (in
Marcus Lundblad <malu@pidgin.im>
parents:
29465
diff
changeset
|
772 | /** |
|
f60cbf3b3ca9
Allow PRPLs to specify the image formats acceptable for thumbnails (in
Marcus Lundblad <malu@pidgin.im>
parents:
29465
diff
changeset
|
773 | * 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
|
774 | * |
|
f60cbf3b3ca9
Allow PRPLs to specify the image formats acceptable for thumbnails (in
Marcus Lundblad <malu@pidgin.im>
parents:
29465
diff
changeset
|
775 | * @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
|
776 | * @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
|
777 | */ |
|
f60cbf3b3ca9
Allow PRPLs to specify the image formats acceptable for thumbnails (in
Marcus Lundblad <malu@pidgin.im>
parents:
29465
diff
changeset
|
778 | const gchar *purple_xfer_get_thumbnail_mimetype(const PurpleXfer *xfer); |
|
31293
169eeb43b52c
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
30708
diff
changeset
|
779 | |
|
169eeb43b52c
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
30708
diff
changeset
|
780 | |
|
28263
d525655fd0f1
It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents:
28262
diff
changeset
|
781 | /** |
|
d525655fd0f1
It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents:
28262
diff
changeset
|
782 | * Sets the thumbnail data for a transfer |
|
d525655fd0f1
It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents:
28262
diff
changeset
|
783 | * |
|
d525655fd0f1
It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents:
28262
diff
changeset
|
784 | * @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
|
785 | * @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
|
786 | * @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
|
787 | * @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
|
788 | */ |
|
d525655fd0f1
It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents:
28262
diff
changeset
|
789 | 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
|
790 | gsize size, const gchar *mimetype); |
|
28263
d525655fd0f1
It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents:
28262
diff
changeset
|
791 | |
|
d525655fd0f1
It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents:
28262
diff
changeset
|
792 | /** |
|
d525655fd0f1
It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents:
28262
diff
changeset
|
793 | * 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
|
794 | * 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
|
795 | * |
|
d525655fd0f1
It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents:
28262
diff
changeset
|
796 | * @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
|
797 | * @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
|
798 | * the protocols can use for thumbnails. |
|
28263
d525655fd0f1
It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents:
28262
diff
changeset
|
799 | */ |
|
30114
8472e53fbbfc
Set desired image formats for thumbnails as a parameter to
Marcus Lundblad <malu@pidgin.im>
parents:
30113
diff
changeset
|
800 | 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
|
801 | |
|
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
|
802 | /** |
|
3d93edd94500
Introduce API purple_xfer_get_protocol_data() and purple_xfer_set_protocol_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
31293
diff
changeset
|
803 | * 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
|
804 | * |
|
3d93edd94500
Introduce API purple_xfer_get_protocol_data() and purple_xfer_set_protocol_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
31293
diff
changeset
|
805 | * @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
|
806 | * @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
|
807 | */ |
|
32248
aa63f22a6e6a
Rename field for consistency.
Andrew Victor <andrew.victor@mxit.com>
parents:
32239
diff
changeset
|
808 | 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
|
809 | |
|
3d93edd94500
Introduce API purple_xfer_get_protocol_data() and purple_xfer_set_protocol_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
31293
diff
changeset
|
810 | /** |
|
3d93edd94500
Introduce API purple_xfer_get_protocol_data() and purple_xfer_set_protocol_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
31293
diff
changeset
|
811 | * 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
|
812 | * |
|
3d93edd94500
Introduce API purple_xfer_get_protocol_data() and purple_xfer_set_protocol_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
31293
diff
changeset
|
813 | * @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
|
814 | * |
|
3d93edd94500
Introduce API purple_xfer_get_protocol_data() and purple_xfer_set_protocol_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
31293
diff
changeset
|
815 | * @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
|
816 | */ |
|
32256
620e4580252a
These pointers should rather be marked const.
Andrew Victor <andrew.victor@mxit.com>
parents:
32249
diff
changeset
|
817 | 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
|
818 | |
|
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
|
819 | /** |
|
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
|
820 | * 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
|
821 | * |
|
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
|
822 | * @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
|
823 | * @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
|
824 | */ |
|
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
|
825 | 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
|
826 | |
|
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
|
827 | /** |
|
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
|
828 | * 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
|
829 | * |
|
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
|
830 | * @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
|
831 | * |
|
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
|
832 | * @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
|
833 | * 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
|
834 | * 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
|
835 | */ |
|
32256
620e4580252a
These pointers should rather be marked const.
Andrew Victor <andrew.victor@mxit.com>
parents:
32249
diff
changeset
|
836 | 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
|
837 | |
|
6263
6fec763a314c
[gaim-migrate @ 6760]
Christian Hammond <chipx86@chipx86.com>
parents:
6241
diff
changeset
|
838 | /*@}*/ |
|
6fec763a314c
[gaim-migrate @ 6760]
Christian Hammond <chipx86@chipx86.com>
parents:
6241
diff
changeset
|
839 | |
|
6fec763a314c
[gaim-migrate @ 6760]
Christian Hammond <chipx86@chipx86.com>
parents:
6241
diff
changeset
|
840 | /**************************************************************************/ |
| 4514 | 841 | /** @name UI Registration Functions */ |
| 842 | /**************************************************************************/ | |
| 843 | /*@{*/ | |
| 844 | ||
| 845 | /** | |
|
11281
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
846 | * Returns the handle to the file transfer subsystem |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
847 | * |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
848 | * @return The handle |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
849 | */ |
| 15884 | 850 | void *purple_xfers_get_handle(void); |
|
11281
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
851 | |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
852 | /** |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
853 | * Initializes the file transfer subsystem |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
854 | */ |
| 15884 | 855 | void purple_xfers_init(void); |
|
11281
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
856 | |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
857 | /** |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
858 | * Uninitializes the file transfer subsystem |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
859 | */ |
| 15884 | 860 | void purple_xfers_uninit(void); |
|
11281
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
861 | |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
862 | /** |
| 15884 | 863 | * Sets the UI operations structure to be used in all purple file transfers. |
| 4514 | 864 | * |
|
6720
cdc5348dd848
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6269
diff
changeset
|
865 | * @param ops The UI operations structure. |
| 4514 | 866 | */ |
| 15884 | 867 | void purple_xfers_set_ui_ops(PurpleXferUiOps *ops); |
| 4514 | 868 | |
| 869 | /** | |
| 15884 | 870 | * Returns the UI operations structure to be used in all purple file transfers. |
| 4514 | 871 | * |
| 872 | * @return The UI operations structure. | |
| 873 | */ | |
| 15884 | 874 | PurpleXferUiOps *purple_xfers_get_ui_ops(void); |
| 4514 | 875 | |
| 876 | /*@}*/ | |
| 877 | ||
|
32787
7072f190d6ad
Use G_BEGIN/END_DECLS in public libpurple files. This was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32663
diff
changeset
|
878 | G_END_DECLS |
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
879 | |
| 15884 | 880 | #endif /* _PURPLE_FT_H_ */ |
|
32663
1b87b3e98b0a
Upgrade PurpleXfer for a 64-bit world.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32608
diff
changeset
|
881 |