libpurple/ft.h

Thu, 18 Mar 2010 22:12:08 +0000

author
Marcus Lundblad <malu@pidgin.im>
date
Thu, 18 Mar 2010 22:12:08 +0000
branch
cpw.malu.ft_thumbnails
changeset 30115
619d2b5758c0
parent 30114
8472e53fbbfc
child 30126
f09ecb81212c
permissions
-rw-r--r--

Hide the thumbnail-related stuff from the PurpleXfer struct to
PurpleXferPrivData

4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
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
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
8 *
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
9 * Purple is the legal property of its developers, whose names are too numerous
8046
c581b20a47d6 [gaim-migrate @ 8730]
Sean Egan <seanegan@pidgin.im>
parents: 7887
diff changeset
10 * to list here. Please refer to the COPYRIGHT file distributed with this
c581b20a47d6 [gaim-migrate @ 8730]
Sean Egan <seanegan@pidgin.im>
parents: 7887
diff changeset
11 * source distribution.
8231
347c8992c445 [gaim-migrate @ 8954]
Tim Ringenbach <marv@pidgin.im>
parents: 8211
diff changeset
12 *
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
13 * This program is free software; you can redistribute it and/or modify
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
14 * it under the terms of the GNU General Public License as published by
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
15 * the Free Software Foundation; either version 2 of the License, or
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
16 * (at your option) any later version.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
17 *
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
18 * This program is distributed in the hope that it will be useful,
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
21 * GNU General Public License for more details.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
22 *
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
23 * You should have received a copy of the GNU General Public License
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
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
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
26 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
27 #ifndef _PURPLE_FT_H_
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
28 #define _PURPLE_FT_H_
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
29
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
30 /**************************************************************************/
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
31 /** Data Structures */
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
32 /**************************************************************************/
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
33 typedef struct _PurpleXfer PurpleXfer;
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
34
12151
8002bb57756b [gaim-migrate @ 14452]
Richard Laager <rlaager@pidgin.im>
parents: 12150
diff changeset
35 #include <glib.h>
8002bb57756b [gaim-migrate @ 14452]
Richard Laager <rlaager@pidgin.im>
parents: 12150
diff changeset
36 #include <stdio.h>
8002bb57756b [gaim-migrate @ 14452]
Richard Laager <rlaager@pidgin.im>
parents: 12150
diff changeset
37
5872
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5563
diff changeset
38 #include "account.h"
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5563
diff changeset
39
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
40 /**
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
41 * Types of file transfers.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
42 */
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
43 typedef enum
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
44 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
45 PURPLE_XFER_UNKNOWN = 0, /**< Unknown file transfer type. */
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
46 PURPLE_XFER_SEND, /**< File sending. */
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
47 PURPLE_XFER_RECEIVE /**< File receiving. */
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
48
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
49 } PurpleXferType;
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
50
7805
6045c467441e [gaim-migrate @ 8452]
Tim Ringenbach <marv@pidgin.im>
parents: 7738
diff changeset
51 /**
6045c467441e [gaim-migrate @ 8452]
Tim Ringenbach <marv@pidgin.im>
parents: 7738
diff changeset
52 * The different states of the xfer.
6045c467441e [gaim-migrate @ 8452]
Tim Ringenbach <marv@pidgin.im>
parents: 7738
diff changeset
53 */
7738
ebb766ef2146 [gaim-migrate @ 8383]
Tim Ringenbach <marv@pidgin.im>
parents: 7035
diff changeset
54 typedef enum
ebb766ef2146 [gaim-migrate @ 8383]
Tim Ringenbach <marv@pidgin.im>
parents: 7035
diff changeset
55 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
56 PURPLE_XFER_STATUS_UNKNOWN = 0, /**< Unknown, the xfer may be null. */
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
57 PURPLE_XFER_STATUS_NOT_STARTED, /**< It hasn't started yet. */
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
58 PURPLE_XFER_STATUS_ACCEPTED, /**< Receive accepted, but destination file not selected yet */
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
59 PURPLE_XFER_STATUS_STARTED, /**< purple_xfer_start has been called. */
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
60 PURPLE_XFER_STATUS_DONE, /**< The xfer completed successfully. */
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
61 PURPLE_XFER_STATUS_CANCEL_LOCAL, /**< The xfer was canceled by us. */
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
62 PURPLE_XFER_STATUS_CANCEL_REMOTE /**< The xfer was canceled by the other end, or we couldn't connect. */
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
63 } PurpleXferStatusType;
7738
ebb766ef2146 [gaim-migrate @ 8383]
Tim Ringenbach <marv@pidgin.im>
parents: 7035
diff changeset
64
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
65 /**
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
66 * File transfer UI operations.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
67 *
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
68 * Any UI representing a file transfer must assign a filled-out
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
69 * PurpleXferUiOps structure to the purple_xfer.
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
70 */
6240
0390b27fe09d [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
71 typedef struct
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
72 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
73 void (*new_xfer)(PurpleXfer *xfer);
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
74 void (*destroy)(PurpleXfer *xfer);
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
75 void (*add_xfer)(PurpleXfer *xfer);
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
76 void (*update_progress)(PurpleXfer *xfer, double percent);
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
77 void (*cancel_local)(PurpleXfer *xfer);
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
78 void (*cancel_remote)(PurpleXfer *xfer);
6240
0390b27fe09d [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
79
28150
1213ec1efcf8 ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents: 22338
diff changeset
80 /**
1213ec1efcf8 ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents: 22338
diff changeset
81 * UI op to write data received from the prpl. The UI must deal with the
1213ec1efcf8 ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents: 22338
diff changeset
82 * 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
83 *
1213ec1efcf8 ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents: 22338
diff changeset
84 * @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
85 * @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
86 * @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
87 *
1213ec1efcf8 ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents: 22338
diff changeset
88 * @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
89 * 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
90 * @since 2.6.0
1213ec1efcf8 ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents: 22338
diff changeset
91 */
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
92 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
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 /**
1213ec1efcf8 ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents: 22338
diff changeset
95 * UI op to read data to send to the prpl for a file transfer.
1213ec1efcf8 ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents: 22338
diff changeset
96 *
1213ec1efcf8 ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents: 22338
diff changeset
97 * @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
98 * @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
99 * 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
100 * @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
101 *
1213ec1efcf8 ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents: 22338
diff changeset
102 * @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
103 * 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
104 * 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
105 * @since 2.6.0
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 * @since 2.6.0
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 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
122
28683
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 * 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
125 *
2fda587fb3e6 Add a comment about the add thumbnail op for PurpleXfer
Marcus Lundblad <malu@pidgin.im>
parents: 28263
diff changeset
126 * @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
127 */
30114
8472e53fbbfc Set desired image formats for thumbnails as a parameter to
Marcus Lundblad <malu@pidgin.im>
parents: 30113
diff changeset
128 void (*add_thumbnail)(PurpleXfer *xfer, const gchar *formats);
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
129 } PurpleXferUiOps;
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
130
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
131 /**
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
132 * A core representation of a file transfer.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
133 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
134 struct _PurpleXfer
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
135 {
15280
9df6112da532 [gaim-migrate @ 18008]
Mark Doliner <markdoliner@pidgin.im>
parents: 15000
diff changeset
136 guint ref; /**< The reference count. */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
137 PurpleXferType type; /**< The type of transfer. */
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
138
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
139 PurpleAccount *account; /**< The account. */
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
140
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
141 char *who; /**< The person on the other end of the
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
142 transfer. */
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
143
9933
61bd3fadbfe6 [gaim-migrate @ 10825]
Dave West <kat@users.sourceforge.net>
parents: 9511
diff changeset
144 char *message; /**< A message sent with the request */
4605
67526771e679 [gaim-migrate @ 4892]
Mark Doliner <markdoliner@pidgin.im>
parents: 4595
diff changeset
145 char *filename; /**< The name sent over the network. */
67526771e679 [gaim-migrate @ 4892]
Mark Doliner <markdoliner@pidgin.im>
parents: 4595
diff changeset
146 char *local_filename; /**< The name on the local hard drive. */
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
147 size_t size; /**< The size of the file. */
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
148
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
149 FILE *dest_fp; /**< The destination file pointer. */
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
150
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
151 char *remote_ip; /**< The remote IP address. */
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
152 int local_port; /**< The local port. */
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
153 int remote_port; /**< The remote port. */
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
154
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
155 int fd; /**< The socket file descriptor. */
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
156 int watcher; /**< Watcher. */
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
157
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
158 size_t bytes_sent; /**< The number of bytes sent. */
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
159 size_t bytes_remaining; /**< The number of bytes remaining. */
13599
b6369e541654 [gaim-migrate @ 15984]
Mark Doliner <markdoliner@pidgin.im>
parents: 13009
diff changeset
160 time_t start_time; /**< When the transfer of data began. */
b6369e541654 [gaim-migrate @ 15984]
Mark Doliner <markdoliner@pidgin.im>
parents: 13009
diff changeset
161 time_t end_time; /**< When the transfer of data ended. */
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
162
15280
9df6112da532 [gaim-migrate @ 18008]
Mark Doliner <markdoliner@pidgin.im>
parents: 15000
diff changeset
163 size_t current_buffer_size; /**< This gradually increases for fast
9df6112da532 [gaim-migrate @ 18008]
Mark Doliner <markdoliner@pidgin.im>
parents: 15000
diff changeset
164 network connections. */
9df6112da532 [gaim-migrate @ 18008]
Mark Doliner <markdoliner@pidgin.im>
parents: 15000
diff changeset
165
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
166 PurpleXferStatusType status; /**< File Transfer's status. */
4538
929fb97f4e7f [gaim-migrate @ 4817]
Nathan Walp <nwalp@pidgin.im>
parents: 4518
diff changeset
167
28971
26b55b57d27e *** Plucked rev 3ad8ea46 (resiak@pidgin.im):
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 28688
diff changeset
168 /** I/O operations, which should be set by the prpl using
26b55b57d27e *** Plucked rev 3ad8ea46 (resiak@pidgin.im):
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 28688
diff changeset
169 * 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
170 * mandatory; all others are optional.
26b55b57d27e *** Plucked rev 3ad8ea46 (resiak@pidgin.im):
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 28688
diff changeset
171 */
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
172 struct
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
173 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
174 void (*init)(PurpleXfer *xfer);
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
175 void (*request_denied)(PurpleXfer *xfer);
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
176 void (*start)(PurpleXfer *xfer);
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
177 void (*end)(PurpleXfer *xfer);
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
178 void (*cancel_send)(PurpleXfer *xfer);
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
179 void (*cancel_recv)(PurpleXfer *xfer);
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
180 gssize (*read)(guchar **buffer, PurpleXfer *xfer);
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
181 gssize (*write)(const guchar *buffer, size_t size, PurpleXfer *xfer);
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
182 void (*ack)(PurpleXfer *xfer, const guchar *buffer, size_t size);
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
183 } ops;
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
184
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
185 PurpleXferUiOps *ui_ops; /**< UI-specific operations. */
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
186 void *ui_data; /**< UI-specific data. */
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
187
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
188 void *data; /**< prpl-specific data. */
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
189 };
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
190
5944
f19df037ac58 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5872
diff changeset
191 #ifdef __cplusplus
f19df037ac58 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5872
diff changeset
192 extern "C" {
f19df037ac58 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5872
diff changeset
193 #endif
f19df037ac58 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5872
diff changeset
194
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
195 /**************************************************************************/
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
196 /** @name File Transfer API */
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
197 /**************************************************************************/
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
198 /*@{*/
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
199
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
200 /**
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
201 * Creates a new file transfer handle.
7805
6045c467441e [gaim-migrate @ 8452]
Tim Ringenbach <marv@pidgin.im>
parents: 7738
diff changeset
202 * This is called by prpls.
6045c467441e [gaim-migrate @ 8452]
Tim Ringenbach <marv@pidgin.im>
parents: 7738
diff changeset
203 * The handle starts with a ref count of 1, and this reference
6045c467441e [gaim-migrate @ 8452]
Tim Ringenbach <marv@pidgin.im>
parents: 7738
diff changeset
204 * is owned by the core. The prpl normally does not need to
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
205 * purple_xfer_ref or unref.
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
206 *
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
207 * @param account The account sending or receiving the file.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
208 * @param type The type of file transfer.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
209 * @param who The name of the remote user.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
210 *
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
211 * @return A file transfer handle.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
212 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
213 PurpleXfer *purple_xfer_new(PurpleAccount *account,
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
214 PurpleXferType type, const char *who);
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
215
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
216 /**
15702
111fdd9108cc Patch from Richard 'wabz' Nelson to add file-transfer ui. Amazing stuff\!
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 15435
diff changeset
217 * 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
218 *
111fdd9108cc Patch from Richard 'wabz' Nelson to add file-transfer ui. Amazing stuff\!
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 15435
diff changeset
219 * @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
220 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
221 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
222
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
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
224 * Increases the reference count on a PurpleXfer.
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
225 * Please call purple_xfer_unref later.
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
226 *
7805
6045c467441e [gaim-migrate @ 8452]
Tim Ringenbach <marv@pidgin.im>
parents: 7738
diff changeset
227 * @param xfer A file transfer handle.
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
228 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
229 void purple_xfer_ref(PurpleXfer *xfer);
7805
6045c467441e [gaim-migrate @ 8452]
Tim Ringenbach <marv@pidgin.im>
parents: 7738
diff changeset
230
6045c467441e [gaim-migrate @ 8452]
Tim Ringenbach <marv@pidgin.im>
parents: 7738
diff changeset
231 /**
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
232 * Decreases the reference count on a PurpleXfer.
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
233 * If the reference reaches 0, purple_xfer_destroy (an internal function)
7805
6045c467441e [gaim-migrate @ 8452]
Tim Ringenbach <marv@pidgin.im>
parents: 7738
diff changeset
234 * 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
235 * Since the core keeps a ref on the xfer, only an erroneous call to
7805
6045c467441e [gaim-migrate @ 8452]
Tim Ringenbach <marv@pidgin.im>
parents: 7738
diff changeset
236 * this function will destroy the xfer while still in use.
6045c467441e [gaim-migrate @ 8452]
Tim Ringenbach <marv@pidgin.im>
parents: 7738
diff changeset
237 *
6045c467441e [gaim-migrate @ 8452]
Tim Ringenbach <marv@pidgin.im>
parents: 7738
diff changeset
238 * @param xfer A file transfer handle.
6045c467441e [gaim-migrate @ 8452]
Tim Ringenbach <marv@pidgin.im>
parents: 7738
diff changeset
239 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
240 void purple_xfer_unref(PurpleXfer *xfer);
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
241
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
242 /**
8585
23db71a2d432 [gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents: 8231
diff changeset
243 * Requests confirmation for a file transfer from the user. If receiving
23db71a2d432 [gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents: 8231
diff changeset
244 * 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
245 * 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
246 * 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
247 * again once the filename is available.
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
248 *
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
249 * @param xfer The file transfer to request confirmation on.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
250 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
251 void purple_xfer_request(PurpleXfer *xfer);
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
252
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
253 /**
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
254 * Called if the user accepts the file transfer request.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
255 *
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
256 * @param xfer The file transfer.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
257 * @param filename The filename.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
258 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
259 void purple_xfer_request_accepted(PurpleXfer *xfer, const char *filename);
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
260
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
261 /**
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
262 * Called if the user rejects the file transfer request.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
263 *
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
264 * @param xfer The file transfer.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
265 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
266 void purple_xfer_request_denied(PurpleXfer *xfer);
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
267
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
268 /**
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
269 * Returns the type of file transfer.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
270 *
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
271 * @param xfer The file transfer.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
272 *
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
273 * @return The type of the file transfer.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
274 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
275 PurpleXferType purple_xfer_get_type(const PurpleXfer *xfer);
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
276
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
277 /**
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
278 * Returns the account the file transfer is using.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
279 *
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
280 * @param xfer The file transfer.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
281 *
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
282 * @return The account.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
283 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
284 PurpleAccount *purple_xfer_get_account(const PurpleXfer *xfer);
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
285
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
286 /**
17852
174c0d122a79 Add new function purple_xfer_get_remote_user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16743
diff changeset
287 * 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
288 *
174c0d122a79 Add new function purple_xfer_get_remote_user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16743
diff changeset
289 * @param xfer The file transfer.
174c0d122a79 Add new function purple_xfer_get_remote_user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16743
diff changeset
290 *
174c0d122a79 Add new function purple_xfer_get_remote_user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16743
diff changeset
291 * @return The name of the remote user.
20940
925d3d68b3af Doxygen @since tags for libpurple and pidgin.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20889
diff changeset
292 *
925d3d68b3af Doxygen @since tags for libpurple and pidgin.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20889
diff changeset
293 * @since 2.1.0
17852
174c0d122a79 Add new function purple_xfer_get_remote_user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16743
diff changeset
294 */
174c0d122a79 Add new function purple_xfer_get_remote_user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16743
diff changeset
295 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
296
174c0d122a79 Add new function purple_xfer_get_remote_user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16743
diff changeset
297 /**
7805
6045c467441e [gaim-migrate @ 8452]
Tim Ringenbach <marv@pidgin.im>
parents: 7738
diff changeset
298 * Returns the status of the xfer.
6045c467441e [gaim-migrate @ 8452]
Tim Ringenbach <marv@pidgin.im>
parents: 7738
diff changeset
299 *
6045c467441e [gaim-migrate @ 8452]
Tim Ringenbach <marv@pidgin.im>
parents: 7738
diff changeset
300 * @param xfer The file transfer.
6045c467441e [gaim-migrate @ 8452]
Tim Ringenbach <marv@pidgin.im>
parents: 7738
diff changeset
301 *
6045c467441e [gaim-migrate @ 8452]
Tim Ringenbach <marv@pidgin.im>
parents: 7738
diff changeset
302 * @return The status.
6045c467441e [gaim-migrate @ 8452]
Tim Ringenbach <marv@pidgin.im>
parents: 7738
diff changeset
303 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
304 PurpleXferStatusType purple_xfer_get_status(const PurpleXfer *xfer);
7805
6045c467441e [gaim-migrate @ 8452]
Tim Ringenbach <marv@pidgin.im>
parents: 7738
diff changeset
305
6045c467441e [gaim-migrate @ 8452]
Tim Ringenbach <marv@pidgin.im>
parents: 7738
diff changeset
306 /**
7738
ebb766ef2146 [gaim-migrate @ 8383]
Tim Ringenbach <marv@pidgin.im>
parents: 7035
diff changeset
307 * Returns true if the file transfer was canceled.
ebb766ef2146 [gaim-migrate @ 8383]
Tim Ringenbach <marv@pidgin.im>
parents: 7035
diff changeset
308 *
ebb766ef2146 [gaim-migrate @ 8383]
Tim Ringenbach <marv@pidgin.im>
parents: 7035
diff changeset
309 * @param xfer The file transfer.
ebb766ef2146 [gaim-migrate @ 8383]
Tim Ringenbach <marv@pidgin.im>
parents: 7035
diff changeset
310 *
ebb766ef2146 [gaim-migrate @ 8383]
Tim Ringenbach <marv@pidgin.im>
parents: 7035
diff changeset
311 * @return Whether or not the transfer was canceled.
ebb766ef2146 [gaim-migrate @ 8383]
Tim Ringenbach <marv@pidgin.im>
parents: 7035
diff changeset
312 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
313 gboolean purple_xfer_is_canceled(const PurpleXfer *xfer);
7738
ebb766ef2146 [gaim-migrate @ 8383]
Tim Ringenbach <marv@pidgin.im>
parents: 7035
diff changeset
314
ebb766ef2146 [gaim-migrate @ 8383]
Tim Ringenbach <marv@pidgin.im>
parents: 7035
diff changeset
315 /**
4539
44671e1ce14e [gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents: 4538
diff changeset
316 * Returns the completed state for a file transfer.
44671e1ce14e [gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents: 4538
diff changeset
317 *
44671e1ce14e [gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents: 4538
diff changeset
318 * @param xfer The file transfer.
44671e1ce14e [gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents: 4538
diff changeset
319 *
44671e1ce14e [gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents: 4538
diff changeset
320 * @return The completed state.
44671e1ce14e [gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents: 4538
diff changeset
321 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
322 gboolean purple_xfer_is_completed(const PurpleXfer *xfer);
4539
44671e1ce14e [gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents: 4538
diff changeset
323
44671e1ce14e [gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents: 4538
diff changeset
324 /**
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
325 * Returns the name of the file being sent or received.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
326 *
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
327 * @param xfer The file transfer.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
328 *
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
329 * @return The filename.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
330 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
331 const char *purple_xfer_get_filename(const PurpleXfer *xfer);
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
332
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
333 /**
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
334 * Returns the file's destination filename,
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
335 *
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
336 * @param xfer The file transfer.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
337 *
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
338 * @return The destination filename.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
339 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
340 const char *purple_xfer_get_local_filename(const PurpleXfer *xfer);
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
341
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
342 /**
13009
12ef9f229961 [gaim-migrate @ 15362]
Daniel Atallah <datallah@pidgin.im>
parents: 12151
diff changeset
343 * Returns the number of bytes sent (or received) so far.
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
344 *
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
345 * @param xfer The file transfer.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
346 *
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
347 * @return The number of bytes sent.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
348 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
349 size_t purple_xfer_get_bytes_sent(const PurpleXfer *xfer);
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
350
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
351 /**
13009
12ef9f229961 [gaim-migrate @ 15362]
Daniel Atallah <datallah@pidgin.im>
parents: 12151
diff changeset
352 * Returns the number of bytes remaining to send or receive.
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
353 *
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
354 * @param xfer The file transfer.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
355 *
13009
12ef9f229961 [gaim-migrate @ 15362]
Daniel Atallah <datallah@pidgin.im>
parents: 12151
diff changeset
356 * @return The number of bytes remaining.
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
357 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
358 size_t purple_xfer_get_bytes_remaining(const PurpleXfer *xfer);
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
359
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
360 /**
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
361 * Returns the size of the file being sent or received.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
362 *
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
363 * @param xfer The file transfer.
7805
6045c467441e [gaim-migrate @ 8452]
Tim Ringenbach <marv@pidgin.im>
parents: 7738
diff changeset
364 *
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
365 * @return The total size of the file.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
366 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
367 size_t purple_xfer_get_size(const PurpleXfer *xfer);
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
368
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
369 /**
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
370 * Returns the current percentage of progress of the transfer.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
371 *
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
372 * This is a number between 0 (0%) and 1 (100%).
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
373 *
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
374 * @param xfer The file transfer.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
375 *
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
376 * @return The percentage complete.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
377 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
378 double purple_xfer_get_progress(const PurpleXfer *xfer);
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
379
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
380 /**
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
381 * Returns the local port number in the file transfer.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
382 *
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
383 * @param xfer The file transfer.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
384 *
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
385 * @return The port number on this end.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
386 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
387 unsigned int purple_xfer_get_local_port(const PurpleXfer *xfer);
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
388
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
389 /**
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
390 * Returns the remote IP address in the file transfer.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
391 *
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
392 * @param xfer The file transfer.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
393 *
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
394 * @return The IP address on the other end.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
395 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
396 const char *purple_xfer_get_remote_ip(const PurpleXfer *xfer);
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
397
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
398 /**
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
399 * Returns the remote port number in the file transfer.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
400 *
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
401 * @param xfer The file transfer.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
402 *
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
403 * @return The port number on the other end.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
404 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
405 unsigned int purple_xfer_get_remote_port(const PurpleXfer *xfer);
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
406
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
407 /**
22338
d6a489105624 Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20940
diff changeset
408 * 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
409 *
d6a489105624 Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20940
diff changeset
410 * @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
411 *
d6a489105624 Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20940
diff changeset
412 * @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
413 * @since 2.4.0
d6a489105624 Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20940
diff changeset
414 */
d6a489105624 Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20940
diff changeset
415 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
416
d6a489105624 Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20940
diff changeset
417 /**
d6a489105624 Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20940
diff changeset
418 * 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
419 *
d6a489105624 Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20940
diff changeset
420 * @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
421 *
d6a489105624 Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20940
diff changeset
422 * @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
423 * @since 2.4.0
d6a489105624 Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20940
diff changeset
424 */
d6a489105624 Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20940
diff changeset
425 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
426
d6a489105624 Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20940
diff changeset
427 /**
4538
929fb97f4e7f [gaim-migrate @ 4817]
Nathan Walp <nwalp@pidgin.im>
parents: 4518
diff changeset
428 * Sets the completed state for the file transfer.
929fb97f4e7f [gaim-migrate @ 4817]
Nathan Walp <nwalp@pidgin.im>
parents: 4518
diff changeset
429 *
929fb97f4e7f [gaim-migrate @ 4817]
Nathan Walp <nwalp@pidgin.im>
parents: 4518
diff changeset
430 * @param xfer The file transfer.
929fb97f4e7f [gaim-migrate @ 4817]
Nathan Walp <nwalp@pidgin.im>
parents: 4518
diff changeset
431 * @param completed The completed state.
929fb97f4e7f [gaim-migrate @ 4817]
Nathan Walp <nwalp@pidgin.im>
parents: 4518
diff changeset
432 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
433 void purple_xfer_set_completed(PurpleXfer *xfer, gboolean completed);
4538
929fb97f4e7f [gaim-migrate @ 4817]
Nathan Walp <nwalp@pidgin.im>
parents: 4518
diff changeset
434
929fb97f4e7f [gaim-migrate @ 4817]
Nathan Walp <nwalp@pidgin.im>
parents: 4518
diff changeset
435 /**
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
436 * Sets the filename for the file transfer.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
437 *
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
438 * @param xfer The file transfer.
9933
61bd3fadbfe6 [gaim-migrate @ 10825]
Dave West <kat@users.sourceforge.net>
parents: 9511
diff changeset
439 * @param message The message.
61bd3fadbfe6 [gaim-migrate @ 10825]
Dave West <kat@users.sourceforge.net>
parents: 9511
diff changeset
440 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
441 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
442
61bd3fadbfe6 [gaim-migrate @ 10825]
Dave West <kat@users.sourceforge.net>
parents: 9511
diff changeset
443 /**
61bd3fadbfe6 [gaim-migrate @ 10825]
Dave West <kat@users.sourceforge.net>
parents: 9511
diff changeset
444 * Sets the filename for the file transfer.
61bd3fadbfe6 [gaim-migrate @ 10825]
Dave West <kat@users.sourceforge.net>
parents: 9511
diff changeset
445 *
61bd3fadbfe6 [gaim-migrate @ 10825]
Dave West <kat@users.sourceforge.net>
parents: 9511
diff changeset
446 * @param xfer The file transfer.
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
447 * @param filename The filename.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
448 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
449 void purple_xfer_set_filename(PurpleXfer *xfer, const char *filename);
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
450
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
451 /**
4605
67526771e679 [gaim-migrate @ 4892]
Mark Doliner <markdoliner@pidgin.im>
parents: 4595
diff changeset
452 * Sets the local filename for the file transfer.
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
453 *
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
454 * @param xfer The file transfer.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
455 * @param filename The filename
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
456 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
457 void purple_xfer_set_local_filename(PurpleXfer *xfer, const char *filename);
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
458
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
459 /**
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
460 * Sets the size of the file in a file transfer.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
461 *
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
462 * @param xfer The file transfer.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
463 * @param size The size of the file.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
464 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
465 void purple_xfer_set_size(PurpleXfer *xfer, size_t size);
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
466
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
467 /**
15322
cd268e368bc1 [gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents: 15280
diff changeset
468 * Sets the current working position in the active file transfer. This
cd268e368bc1 [gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents: 15280
diff changeset
469 * 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
470 * 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
471 *
cd268e368bc1 [gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents: 15280
diff changeset
472 * It's used for pausing and resuming an oscar file transfer.
cd268e368bc1 [gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents: 15280
diff changeset
473 *
cd268e368bc1 [gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents: 15280
diff changeset
474 * @param xfer The file transfer.
cd268e368bc1 [gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents: 15280
diff changeset
475 * @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
476 * sending a file then this is the byte that we will
cd268e368bc1 [gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents: 15280
diff changeset
477 * send. If we're receiving a file, this is the
cd268e368bc1 [gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents: 15280
diff changeset
478 * next byte that we expect to receive.
cd268e368bc1 [gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents: 15280
diff changeset
479 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
480 void purple_xfer_set_bytes_sent(PurpleXfer *xfer, size_t bytes_sent);
15322
cd268e368bc1 [gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents: 15280
diff changeset
481
cd268e368bc1 [gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents: 15280
diff changeset
482 /**
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
483 * Returns the UI operations structure for a file transfer.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
484 *
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
485 * @param xfer The file transfer.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
486 *
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
487 * @return The UI operations structure.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
488 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
489 PurpleXferUiOps *purple_xfer_get_ui_ops(const PurpleXfer *xfer);
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
490
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
491 /**
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
492 * Sets the read function for the file transfer.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
493 *
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
494 * @param xfer The file transfer.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
495 * @param fnc The read function.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
496 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
497 void purple_xfer_set_read_fnc(PurpleXfer *xfer,
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
498 gssize (*fnc)(guchar **, PurpleXfer *));
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
499
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
500 /**
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
501 * Sets the write function for the file transfer.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
502 *
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
503 * @param xfer The file transfer.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
504 * @param fnc The write function.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
505 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
506 void purple_xfer_set_write_fnc(PurpleXfer *xfer,
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
507 gssize (*fnc)(const guchar *, size_t, PurpleXfer *));
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
508
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
509 /**
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
510 * Sets the acknowledge function for the file transfer.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
511 *
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
512 * @param xfer The file transfer.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
513 * @param fnc The acknowledge function.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
514 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
515 void purple_xfer_set_ack_fnc(PurpleXfer *xfer,
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
516 void (*fnc)(PurpleXfer *, const guchar *, size_t));
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
517
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
518 /**
7805
6045c467441e [gaim-migrate @ 8452]
Tim Ringenbach <marv@pidgin.im>
parents: 7738
diff changeset
519 * Sets the function to be called if the request is denied.
6045c467441e [gaim-migrate @ 8452]
Tim Ringenbach <marv@pidgin.im>
parents: 7738
diff changeset
520 *
6045c467441e [gaim-migrate @ 8452]
Tim Ringenbach <marv@pidgin.im>
parents: 7738
diff changeset
521 * @param xfer The file transfer.
6045c467441e [gaim-migrate @ 8452]
Tim Ringenbach <marv@pidgin.im>
parents: 7738
diff changeset
522 * @param fnc The request denied prpl callback.
6045c467441e [gaim-migrate @ 8452]
Tim Ringenbach <marv@pidgin.im>
parents: 7738
diff changeset
523 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
524 void purple_xfer_set_request_denied_fnc(PurpleXfer *xfer, void (*fnc)(PurpleXfer *));
7805
6045c467441e [gaim-migrate @ 8452]
Tim Ringenbach <marv@pidgin.im>
parents: 7738
diff changeset
525
6045c467441e [gaim-migrate @ 8452]
Tim Ringenbach <marv@pidgin.im>
parents: 7738
diff changeset
526 /**
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
527 * Sets the transfer initialization function for the file transfer.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
528 *
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
529 * This function is required, and must call purple_xfer_start() with
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
530 * the necessary parameters. This will be called if the file transfer
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
531 * is accepted by the user.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
532 *
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
533 * @param xfer The file transfer.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
534 * @param fnc The transfer initialization function.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
535 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
536 void purple_xfer_set_init_fnc(PurpleXfer *xfer, void (*fnc)(PurpleXfer *));
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
537
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
538 /**
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
539 * Sets the start transfer function for the file transfer.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
540 *
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
541 * @param xfer The file transfer.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
542 * @param fnc The start transfer function.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
543 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
544 void purple_xfer_set_start_fnc(PurpleXfer *xfer, void (*fnc)(PurpleXfer *));
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
545
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
546 /**
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
547 * Sets the end transfer function for the file transfer.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
548 *
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
549 * @param xfer The file transfer.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
550 * @param fnc The end transfer function.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
551 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
552 void purple_xfer_set_end_fnc(PurpleXfer *xfer, void (*fnc)(PurpleXfer *));
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
553
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
554 /**
4675
8e0a7b537ca2 [gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents: 4605
diff changeset
555 * Sets the cancel send function for the file transfer.
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
556 *
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
557 * @param xfer The file transfer.
4675
8e0a7b537ca2 [gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents: 4605
diff changeset
558 * @param fnc The cancel send function.
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
559 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
560 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
561
8e0a7b537ca2 [gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents: 4605
diff changeset
562 /**
8e0a7b537ca2 [gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents: 4605
diff changeset
563 * Sets the cancel receive function for the file transfer.
8e0a7b537ca2 [gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents: 4605
diff changeset
564 *
8e0a7b537ca2 [gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents: 4605
diff changeset
565 * @param xfer The file transfer.
8e0a7b537ca2 [gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents: 4605
diff changeset
566 * @param fnc The cancel receive function.
8e0a7b537ca2 [gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents: 4605
diff changeset
567 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
568 void purple_xfer_set_cancel_recv_fnc(PurpleXfer *xfer, void (*fnc)(PurpleXfer *));
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
569
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
570 /**
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
571 * Reads in data from a file transfer stream.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
572 *
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
573 * @param xfer The file transfer.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
574 * @param buffer The buffer that will be created to contain the data.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
575 *
8231
347c8992c445 [gaim-migrate @ 8954]
Tim Ringenbach <marv@pidgin.im>
parents: 8211
diff changeset
576 * @return The number of bytes read, or -1.
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
577 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
578 gssize purple_xfer_read(PurpleXfer *xfer, guchar **buffer);
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
579
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
580 /**
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
581 * Writes data to a file transfer stream.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
582 *
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
583 * @param xfer The file transfer.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
584 * @param buffer The buffer to read the data from.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
585 * @param size The number of bytes to write.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
586 *
8231
347c8992c445 [gaim-migrate @ 8954]
Tim Ringenbach <marv@pidgin.im>
parents: 8211
diff changeset
587 * @return The number of bytes written, or -1.
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
588 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
589 gssize purple_xfer_write(PurpleXfer *xfer, const guchar *buffer, gsize size);
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
590
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
591 /**
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
592 * Starts a file transfer.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
593 *
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
594 * Either @a fd must be specified <i>or</i> @a ip and @a port on a
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
595 * file receive transfer. On send, @a fd must be specified, and
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
596 * @a ip and @a port are ignored.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
597 *
28152
e9800c07eb5b ft: Fix a bunch of uses of 0 as an 'invalid' fd.
Paul Aurich <darkrain42@pidgin.im>
parents: 28150
diff changeset
598 * Prior to libpurple 2.6.0, passing '0' to @a fd was special-cased to
e9800c07eb5b ft: Fix a bunch of uses of 0 as an 'invalid' fd.
Paul Aurich <darkrain42@pidgin.im>
parents: 28150
diff changeset
599 * allow the protocol plugin to facilitate the file transfer itself. As of
e9800c07eb5b ft: Fix a bunch of uses of 0 as an 'invalid' fd.
Paul Aurich <darkrain42@pidgin.im>
parents: 28150
diff changeset
600 * 2.6.0, this is supported (for backward compatibility), but will be
e9800c07eb5b ft: Fix a bunch of uses of 0 as an 'invalid' fd.
Paul Aurich <darkrain42@pidgin.im>
parents: 28150
diff changeset
601 * removed in libpurple 3.0.0. If a prpl detects that the running libpurple
e9800c07eb5b ft: Fix a bunch of uses of 0 as an 'invalid' fd.
Paul Aurich <darkrain42@pidgin.im>
parents: 28150
diff changeset
602 * is running 2.6.0 or higher, it should use the invalid fd '-1'.
e9800c07eb5b ft: Fix a bunch of uses of 0 as an 'invalid' fd.
Paul Aurich <darkrain42@pidgin.im>
parents: 28150
diff changeset
603 *
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
604 * @param xfer The file transfer.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
605 * @param fd The file descriptor for the socket.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
606 * @param ip The IP address to connect to.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
607 * @param port The port to connect to.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
608 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
609 void purple_xfer_start(PurpleXfer *xfer, int fd, const char *ip,
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
610 unsigned int port);
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
611
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
612 /**
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
613 * Ends a file transfer.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
614 *
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
615 * @param xfer The file transfer.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
616 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
617 void purple_xfer_end(PurpleXfer *xfer);
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
618
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
619 /**
8585
23db71a2d432 [gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents: 8231
diff changeset
620 * Adds a new file transfer to the list of file transfers. Call this only
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
621 * if you are not using purple_xfer_start.
8585
23db71a2d432 [gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents: 8231
diff changeset
622 *
23db71a2d432 [gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents: 8231
diff changeset
623 * @param xfer The file transfer.
23db71a2d432 [gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents: 8231
diff changeset
624 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
625 void purple_xfer_add(PurpleXfer *xfer);
8585
23db71a2d432 [gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents: 8231
diff changeset
626
23db71a2d432 [gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents: 8231
diff changeset
627 /**
4675
8e0a7b537ca2 [gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents: 4605
diff changeset
628 * Cancels a file transfer on the local end.
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
629 *
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
630 * @param xfer The file transfer.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
631 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
632 void purple_xfer_cancel_local(PurpleXfer *xfer);
4675
8e0a7b537ca2 [gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents: 4605
diff changeset
633
8e0a7b537ca2 [gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents: 4605
diff changeset
634 /**
8e0a7b537ca2 [gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents: 4605
diff changeset
635 * Cancels a file transfer from the remote end.
8e0a7b537ca2 [gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents: 4605
diff changeset
636 *
8e0a7b537ca2 [gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents: 4605
diff changeset
637 * @param xfer The file transfer.
8e0a7b537ca2 [gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents: 4605
diff changeset
638 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
639 void purple_xfer_cancel_remote(PurpleXfer *xfer);
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
640
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
641 /**
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
642 * Displays a file transfer-related error message.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
643 *
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
644 * This is a wrapper around purple_notify_error(), which automatically
10654
b2dd3be1b087 [gaim-migrate @ 12182]
Richard Laager <rlaager@pidgin.im>
parents: 9933
diff changeset
645 * specifies a title ("File transfer to <i>user</i> failed" or
b2dd3be1b087 [gaim-migrate @ 12182]
Richard Laager <rlaager@pidgin.im>
parents: 9933
diff changeset
646 * "File Transfer from <i>user</i> failed").
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
647 *
10654
b2dd3be1b087 [gaim-migrate @ 12182]
Richard Laager <rlaager@pidgin.im>
parents: 9933
diff changeset
648 * @param type The type of file transfer.
b2dd3be1b087 [gaim-migrate @ 12182]
Richard Laager <rlaager@pidgin.im>
parents: 9933
diff changeset
649 * @param account The account sending or receiving the file.
b2dd3be1b087 [gaim-migrate @ 12182]
Richard Laager <rlaager@pidgin.im>
parents: 9933
diff changeset
650 * @param who The user on the other end of the transfer.
b2dd3be1b087 [gaim-migrate @ 12182]
Richard Laager <rlaager@pidgin.im>
parents: 9933
diff changeset
651 * @param msg The message to display.
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
652 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
653 void purple_xfer_error(PurpleXferType type, PurpleAccount *account, const char *who, const char *msg);
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
654
8585
23db71a2d432 [gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents: 8231
diff changeset
655 /**
23db71a2d432 [gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents: 8231
diff changeset
656 * Updates file transfer progress.
23db71a2d432 [gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents: 8231
diff changeset
657 *
23db71a2d432 [gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents: 8231
diff changeset
658 * @param xfer The file transfer.
23db71a2d432 [gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents: 8231
diff changeset
659 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
660 void purple_xfer_update_progress(PurpleXfer *xfer);
8585
23db71a2d432 [gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents: 8231
diff changeset
661
11084
b6acee973833 [gaim-migrate @ 13103]
Jonathan Clark <ardentlygnarly@users.sourceforge.net>
parents: 10654
diff changeset
662 /**
b6acee973833 [gaim-migrate @ 13103]
Jonathan Clark <ardentlygnarly@users.sourceforge.net>
parents: 10654
diff changeset
663 * Displays a file transfer-related message in the conversation window
b6acee973833 [gaim-migrate @ 13103]
Jonathan Clark <ardentlygnarly@users.sourceforge.net>
parents: 10654
diff changeset
664 *
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
665 * This is a wrapper around purple_conversation_write
11084
b6acee973833 [gaim-migrate @ 13103]
Jonathan Clark <ardentlygnarly@users.sourceforge.net>
parents: 10654
diff changeset
666 *
b6acee973833 [gaim-migrate @ 13103]
Jonathan Clark <ardentlygnarly@users.sourceforge.net>
parents: 10654
diff changeset
667 * @param xfer The file transfer to which this message relates.
b6acee973833 [gaim-migrate @ 13103]
Jonathan Clark <ardentlygnarly@users.sourceforge.net>
parents: 10654
diff changeset
668 * @param message The message to display.
11129
c986d8566843 [gaim-migrate @ 13185]
Mark Doliner <markdoliner@pidgin.im>
parents: 11084
diff changeset
669 * @param is_error Is this an error message?.
11084
b6acee973833 [gaim-migrate @ 13103]
Jonathan Clark <ardentlygnarly@users.sourceforge.net>
parents: 10654
diff changeset
670 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
671 void purple_xfer_conversation_write(PurpleXfer *xfer, char *message, gboolean is_error);
11084
b6acee973833 [gaim-migrate @ 13103]
Jonathan Clark <ardentlygnarly@users.sourceforge.net>
parents: 10654
diff changeset
672
28150
1213ec1efcf8 ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents: 22338
diff changeset
673 /**
1213ec1efcf8 ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents: 22338
diff changeset
674 * 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
675 * 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
676 * 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
677 *
28156
0a75e2463576 ft: Add infrastructure to allow a prpl to moderate when to send packets.
Paul Aurich <darkrain42@pidgin.im>
parents: 28152
diff changeset
678 * @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
679 *
1213ec1efcf8 ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents: 22338
diff changeset
680 * @since 2.6.0
1213ec1efcf8 ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents: 22338
diff changeset
681 */
1213ec1efcf8 ft: Allow the UI to overloadthe use of fread/fwrite. Closes #9844.
Jan Kaluza <hanzz.k@gmail.com>
parents: 22338
diff changeset
682 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
683
28156
0a75e2463576 ft: Add infrastructure to allow a prpl to moderate when to send packets.
Paul Aurich <darkrain42@pidgin.im>
parents: 28152
diff changeset
684 /**
28688
Paul Aurich <darkrain42@pidgin.im>
parents: 28159
diff changeset
685 * Allows the prpl 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
686 * the direction of the file transfer. Used when the prpl provides read/write
0a75e2463576 ft: Add infrastructure to allow a prpl to moderate when to send packets.
Paul Aurich <darkrain42@pidgin.im>
parents: 28152
diff changeset
687 * 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
688 *
0a75e2463576 ft: Add infrastructure to allow a prpl to moderate when to send packets.
Paul Aurich <darkrain42@pidgin.im>
parents: 28152
diff changeset
689 * @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
690 *
0a75e2463576 ft: Add infrastructure to allow a prpl to moderate when to send packets.
Paul Aurich <darkrain42@pidgin.im>
parents: 28152
diff changeset
691 * @since 2.6.0
0a75e2463576 ft: Add infrastructure to allow a prpl to moderate when to send packets.
Paul Aurich <darkrain42@pidgin.im>
parents: 28152
diff changeset
692 */
0a75e2463576 ft: Add infrastructure to allow a prpl to moderate when to send packets.
Paul Aurich <darkrain42@pidgin.im>
parents: 28152
diff changeset
693 void purple_xfer_prpl_ready(PurpleXfer *xfer);
0a75e2463576 ft: Add infrastructure to allow a prpl to moderate when to send packets.
Paul Aurich <darkrain42@pidgin.im>
parents: 28152
diff changeset
694
28263
d525655fd0f1 It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents: 28262
diff changeset
695 /**
d525655fd0f1 It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents: 28262
diff changeset
696 * Gets the thumbnail data for a transfer
d525655fd0f1 It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents: 28262
diff changeset
697 *
d525655fd0f1 It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents: 28262
diff changeset
698 * @param xfer The file transfer to get the thumbnail for
d525655fd0f1 It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents: 28262
diff changeset
699 * @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
700 */
d525655fd0f1 It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents: 28262
diff changeset
701 const void *purple_xfer_get_thumbnail_data(const PurpleXfer *xfer);
d525655fd0f1 It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents: 28262
diff changeset
702
d525655fd0f1 It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents: 28262
diff changeset
703 /**
d525655fd0f1 It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents: 28262
diff changeset
704 * Gets the thumbnail size for a transfer
d525655fd0f1 It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents: 28262
diff changeset
705 *
d525655fd0f1 It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents: 28262
diff changeset
706 * @param xfer The file transfer to get the thumbnail size for
d525655fd0f1 It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents: 28262
diff changeset
707 * @return The size, in bytes of the file transfer's thumbnail
d525655fd0f1 It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents: 28262
diff changeset
708 */
d525655fd0f1 It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents: 28262
diff changeset
709 gsize purple_xfer_get_thumbnail_size(const PurpleXfer *xfer);
d525655fd0f1 It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents: 28262
diff changeset
710
30113
f60cbf3b3ca9 Allow PRPLs to specify the image formats acceptable for thumbnails (in
Marcus Lundblad <malu@pidgin.im>
parents: 29465
diff changeset
711 /**
f60cbf3b3ca9 Allow PRPLs to specify the image formats acceptable for thumbnails (in
Marcus Lundblad <malu@pidgin.im>
parents: 29465
diff changeset
712 * 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
713 *
f60cbf3b3ca9 Allow PRPLs to specify the image formats acceptable for thumbnails (in
Marcus Lundblad <malu@pidgin.im>
parents: 29465
diff changeset
714 * @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
715 * @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
716 */
f60cbf3b3ca9 Allow PRPLs to specify the image formats acceptable for thumbnails (in
Marcus Lundblad <malu@pidgin.im>
parents: 29465
diff changeset
717 const gchar *purple_xfer_get_thumbnail_mimetype(const PurpleXfer *xfer);
f60cbf3b3ca9 Allow PRPLs to specify the image formats acceptable for thumbnails (in
Marcus Lundblad <malu@pidgin.im>
parents: 29465
diff changeset
718
f60cbf3b3ca9 Allow PRPLs to specify the image formats acceptable for thumbnails (in
Marcus Lundblad <malu@pidgin.im>
parents: 29465
diff changeset
719
28263
d525655fd0f1 It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents: 28262
diff changeset
720 /**
d525655fd0f1 It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents: 28262
diff changeset
721 * Sets the thumbnail data for a transfer
d525655fd0f1 It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents: 28262
diff changeset
722 *
d525655fd0f1 It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents: 28262
diff changeset
723 * @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
724 * @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
725 * @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
726 * @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
727 */
d525655fd0f1 It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents: 28262
diff changeset
728 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
729 gsize size, const gchar *mimetype);
28263
d525655fd0f1 It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents: 28262
diff changeset
730
d525655fd0f1 It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents: 28262
diff changeset
731 /**
d525655fd0f1 It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents: 28262
diff changeset
732 * 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
733 * 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
734 *
d525655fd0f1 It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents: 28262
diff changeset
735 * @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
736 * @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
737 * the protocols can use for thumbnails.
28263
d525655fd0f1 It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents: 28262
diff changeset
738 */
30114
8472e53fbbfc Set desired image formats for thumbnails as a parameter to
Marcus Lundblad <malu@pidgin.im>
parents: 30113
diff changeset
739 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
740
d525655fd0f1 It broke a bit during merge.
Marcus Lundblad <malu@pidgin.im>
parents: 28262
diff changeset
741
6263
6fec763a314c [gaim-migrate @ 6760]
Christian Hammond <chipx86@chipx86.com>
parents: 6241
diff changeset
742 /*@}*/
6fec763a314c [gaim-migrate @ 6760]
Christian Hammond <chipx86@chipx86.com>
parents: 6241
diff changeset
743
6fec763a314c [gaim-migrate @ 6760]
Christian Hammond <chipx86@chipx86.com>
parents: 6241
diff changeset
744 /**************************************************************************/
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
745 /** @name UI Registration Functions */
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
746 /**************************************************************************/
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
747 /*@{*/
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
748
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
749 /**
11281
a5cda37a16be [gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11159
diff changeset
750 * Returns the handle to the file transfer subsystem
a5cda37a16be [gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11159
diff changeset
751 *
a5cda37a16be [gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11159
diff changeset
752 * @return The handle
a5cda37a16be [gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11159
diff changeset
753 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
754 void *purple_xfers_get_handle(void);
11281
a5cda37a16be [gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11159
diff changeset
755
a5cda37a16be [gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11159
diff changeset
756 /**
a5cda37a16be [gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11159
diff changeset
757 * Initializes the file transfer subsystem
a5cda37a16be [gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11159
diff changeset
758 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
759 void purple_xfers_init(void);
11281
a5cda37a16be [gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11159
diff changeset
760
a5cda37a16be [gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11159
diff changeset
761 /**
a5cda37a16be [gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11159
diff changeset
762 * Uninitializes the file transfer subsystem
a5cda37a16be [gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11159
diff changeset
763 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
764 void purple_xfers_uninit(void);
11281
a5cda37a16be [gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11159
diff changeset
765
a5cda37a16be [gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11159
diff changeset
766 /**
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
767 * Sets the UI operations structure to be used in all purple file transfers.
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
768 *
6720
cdc5348dd848 [gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents: 6269
diff changeset
769 * @param ops The UI operations structure.
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
770 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
771 void purple_xfers_set_ui_ops(PurpleXferUiOps *ops);
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
772
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
773 /**
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
774 * Returns the UI operations structure to be used in all purple file transfers.
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
775 *
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
776 * @return The UI operations structure.
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
777 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
778 PurpleXferUiOps *purple_xfers_get_ui_ops(void);
4514
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
779
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
780 /*@}*/
40e3588a280f [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
781
5944
f19df037ac58 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5872
diff changeset
782 #ifdef __cplusplus
f19df037ac58 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5872
diff changeset
783 }
f19df037ac58 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5872
diff changeset
784 #endif
f19df037ac58 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5872
diff changeset
785
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15702
diff changeset
786 #endif /* _PURPLE_FT_H_ */

mercurial