Frameworks/libpurple.framework/Versions/0.6.2/Headers/ft.h
author Zachary West <zacw@adium.im>
Fri Aug 21 13:25:11 2009 -0700 (2009-08-21)
changeset 2592 e8d15275025e
parent 1739 Frameworks/libpurple.framework/Versions/0.6.0/Headers/ft.h@8b0daad9656c
permissions -rw-r--r--
im.pidgin.adium.1-4 at 267c6165e02e34318a1823960bd04c0639952f73
     1 /**
     2  * @file ft.h File Transfer API
     3  * @ingroup core
     4  * @see @ref xfer-signals
     5  */
     6 
     7 /* purple
     8  *
     9  * Purple is the legal property of its developers, whose names are too numerous
    10  * to list here.  Please refer to the COPYRIGHT file distributed with this
    11  * source distribution.
    12  *
    13  * This program is free software; you can redistribute it and/or modify
    14  * it under the terms of the GNU General Public License as published by
    15  * the Free Software Foundation; either version 2 of the License, or
    16  * (at your option) any later version.
    17  *
    18  * This program is distributed in the hope that it will be useful,
    19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    21  * GNU General Public License for more details.
    22  *
    23  * You should have received a copy of the GNU General Public License
    24  * along with this program; if not, write to the Free Software
    25  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
    26  */
    27 #ifndef _PURPLE_FT_H_
    28 #define _PURPLE_FT_H_
    29 
    30 /**************************************************************************/
    31 /** Data Structures                                                       */
    32 /**************************************************************************/
    33 typedef struct _PurpleXfer PurpleXfer;
    34 
    35 #include <glib.h>
    36 #include <stdio.h>
    37 
    38 #include "account.h"
    39 
    40 /**
    41  * Types of file transfers.
    42  */
    43 typedef enum
    44 {
    45 	PURPLE_XFER_UNKNOWN = 0,  /**< Unknown file transfer type. */
    46 	PURPLE_XFER_SEND,         /**< File sending.               */
    47 	PURPLE_XFER_RECEIVE       /**< File receiving.             */
    48 
    49 } PurpleXferType;
    50 
    51 /**
    52  * The different states of the xfer.
    53  */
    54 typedef enum
    55 {
    56 	PURPLE_XFER_STATUS_UNKNOWN = 0,   /**< Unknown, the xfer may be null. */
    57 	PURPLE_XFER_STATUS_NOT_STARTED,   /**< It hasn't started yet. */
    58 	PURPLE_XFER_STATUS_ACCEPTED,      /**< Receive accepted, but destination file not selected yet */
    59 	PURPLE_XFER_STATUS_STARTED,       /**< purple_xfer_start has been called. */
    60 	PURPLE_XFER_STATUS_DONE,          /**< The xfer completed successfully. */
    61 	PURPLE_XFER_STATUS_CANCEL_LOCAL,  /**< The xfer was canceled by us. */
    62 	PURPLE_XFER_STATUS_CANCEL_REMOTE  /**< The xfer was canceled by the other end, or we couldn't connect. */
    63 } PurpleXferStatusType;
    64 
    65 /**
    66  * File transfer UI operations.
    67  *
    68  * Any UI representing a file transfer must assign a filled-out
    69  * PurpleXferUiOps structure to the purple_xfer.
    70  */
    71 typedef struct
    72 {
    73 	void (*new_xfer)(PurpleXfer *xfer);
    74 	void (*destroy)(PurpleXfer *xfer);
    75 	void (*add_xfer)(PurpleXfer *xfer);
    76 	void (*update_progress)(PurpleXfer *xfer, double percent);
    77 	void (*cancel_local)(PurpleXfer *xfer);
    78 	void (*cancel_remote)(PurpleXfer *xfer);
    79 
    80 	/**
    81 	 * UI op to write data received from the prpl. The UI must deal with the
    82 	 * entire buffer and return size, or it is treated as an error.
    83 	 *
    84 	 * @param xfer    The file transfer structure
    85 	 * @param buffer  The buffer to write
    86 	 * @param size    The size of the buffer
    87 	 *
    88 	 * @return size if the write was successful, or a value between 0 and
    89 	 *         size on error.
    90 	 * @since 2.6.0
    91 	 */
    92 	gssize (*ui_write)(PurpleXfer *xfer, const guchar *buffer, gssize size);
    93 
    94 	/**
    95 	 * UI op to read data to send to the prpl for a file transfer.
    96 	 *
    97 	 * @param xfer    The file transfer structure
    98 	 * @param buffer  A pointer to a buffer. The UI must allocate this buffer.
    99 	 *                libpurple will free the data.
   100 	 * @param size    The maximum amount of data to put in the buffer.
   101 	 *
   102 	 * @returns The amount of data in the buffer, 0 if nothing is available,
   103 	 *          and a negative value if an error occurred and the transfer
   104 	 *          should be cancelled (libpurple will cancel).
   105 	 * @since 2.6.0
   106 	 */
   107 	gssize (*ui_read)(PurpleXfer *xfer, guchar **buffer, gssize size);
   108 
   109 	/**
   110 	 * Op to notify the UI that not all the data read in was written. The UI
   111 	 * should re-enqueue this data and return it the next time read is called.
   112 	 *
   113 	 * This MUST be implemented if read and write are implemented.
   114 	 *
   115 	 * @param xfer    The file transfer structure
   116 	 * @param buffer  A pointer to the beginning of the unwritten data.
   117 	 * @param size    The amount of unwritten data.
   118 	 *
   119 	 * @since 2.6.0
   120 	 */
   121 	void (*data_not_sent)(PurpleXfer *xfer, const guchar *buffer, gsize size);
   122 
   123 	void (*_purple_reserved1)(void);
   124 } PurpleXferUiOps;
   125 
   126 /**
   127  * A core representation of a file transfer.
   128  */
   129 struct _PurpleXfer
   130 {
   131 	guint ref;                    /**< The reference count.                */
   132 	PurpleXferType type;            /**< The type of transfer.               */
   133 
   134 	PurpleAccount *account;         /**< The account.                        */
   135 
   136 	char *who;                    /**< The person on the other end of the
   137 	                                   transfer.                           */
   138 
   139 	char *message;                /**< A message sent with the request     */
   140 	char *filename;               /**< The name sent over the network.     */
   141 	char *local_filename;         /**< The name on the local hard drive.   */
   142 	size_t size;                  /**< The size of the file.               */
   143 
   144 	FILE *dest_fp;                /**< The destination file pointer.       */
   145 
   146 	char *remote_ip;              /**< The remote IP address.              */
   147 	int local_port;               /**< The local port.                     */
   148 	int remote_port;              /**< The remote port.                    */
   149 
   150 	int fd;                       /**< The socket file descriptor.         */
   151 	int watcher;                  /**< Watcher.                            */
   152 
   153 	size_t bytes_sent;            /**< The number of bytes sent.           */
   154 	size_t bytes_remaining;       /**< The number of bytes remaining.      */
   155 	time_t start_time;            /**< When the transfer of data began.    */
   156 	time_t end_time;              /**< When the transfer of data ended.    */
   157 
   158 	size_t current_buffer_size;   /**< This gradually increases for fast
   159 	                                   network connections. */
   160 
   161 	PurpleXferStatusType status;    /**< File Transfer's status.             */
   162 
   163 	/* I/O operations. */
   164 	struct
   165 	{
   166 		void (*init)(PurpleXfer *xfer);
   167 		void (*request_denied)(PurpleXfer *xfer);
   168 		void (*start)(PurpleXfer *xfer);
   169 		void (*end)(PurpleXfer *xfer);
   170 		void (*cancel_send)(PurpleXfer *xfer);
   171 		void (*cancel_recv)(PurpleXfer *xfer);
   172 		gssize (*read)(guchar **buffer, PurpleXfer *xfer);
   173 		gssize (*write)(const guchar *buffer, size_t size, PurpleXfer *xfer);
   174 		void (*ack)(PurpleXfer *xfer, const guchar *buffer, size_t size);
   175 	} ops;
   176 
   177 	PurpleXferUiOps *ui_ops;            /**< UI-specific operations. */
   178 	void *ui_data;                    /**< UI-specific data.       */
   179 
   180 	void *data;                       /**< prpl-specific data.     */
   181 };
   182 
   183 #ifdef __cplusplus
   184 extern "C" {
   185 #endif
   186 
   187 /**************************************************************************/
   188 /** @name File Transfer API                                               */
   189 /**************************************************************************/
   190 /*@{*/
   191 
   192 /**
   193  * Creates a new file transfer handle.
   194  * This is called by prpls.
   195  * The handle starts with a ref count of 1, and this reference
   196  * is owned by the core. The prpl normally does not need to
   197  * purple_xfer_ref or unref.
   198  *
   199  * @param account The account sending or receiving the file.
   200  * @param type    The type of file transfer.
   201  * @param who     The name of the remote user.
   202  *
   203  * @return A file transfer handle.
   204  */
   205 PurpleXfer *purple_xfer_new(PurpleAccount *account,
   206 								PurpleXferType type, const char *who);
   207 
   208 /**
   209  * Returns all xfers
   210  *
   211  * @return all current xfers with refs
   212  */
   213 GList *purple_xfers_get_all(void);
   214 
   215 /**
   216  * Increases the reference count on a PurpleXfer.
   217  * Please call purple_xfer_unref later.
   218  *
   219  * @param xfer A file transfer handle.
   220  */
   221 void purple_xfer_ref(PurpleXfer *xfer);
   222 
   223 /**
   224  * Decreases the reference count on a PurpleXfer.
   225  * If the reference reaches 0, purple_xfer_destroy (an internal function)
   226  * will destroy the xfer. It calls the ui destroy cb first.
   227  * Since the core keeps a ref on the xfer, only an erroneous call to
   228  * this function will destroy the xfer while still in use.
   229  *
   230  * @param xfer A file transfer handle.
   231  */
   232 void purple_xfer_unref(PurpleXfer *xfer);
   233 
   234 /**
   235  * Requests confirmation for a file transfer from the user. If receiving
   236  * a file which is known at this point, this requests user to accept and
   237  * save the file. If the filename is unknown (not set) this only requests user
   238  * to accept the file transfer. In this case protocol must call this function
   239  * again once the filename is available.
   240  *
   241  * @param xfer The file transfer to request confirmation on.
   242  */
   243 void purple_xfer_request(PurpleXfer *xfer);
   244 
   245 /**
   246  * Called if the user accepts the file transfer request.
   247  *
   248  * @param xfer     The file transfer.
   249  * @param filename The filename.
   250  */
   251 void purple_xfer_request_accepted(PurpleXfer *xfer, const char *filename);
   252 
   253 /**
   254  * Called if the user rejects the file transfer request.
   255  *
   256  * @param xfer The file transfer.
   257  */
   258 void purple_xfer_request_denied(PurpleXfer *xfer);
   259 
   260 /**
   261  * Returns the type of file transfer.
   262  *
   263  * @param xfer The file transfer.
   264  *
   265  * @return The type of the file transfer.
   266  */
   267 PurpleXferType purple_xfer_get_type(const PurpleXfer *xfer);
   268 
   269 /**
   270  * Returns the account the file transfer is using.
   271  *
   272  * @param xfer The file transfer.
   273  *
   274  * @return The account.
   275  */
   276 PurpleAccount *purple_xfer_get_account(const PurpleXfer *xfer);
   277 
   278 /**
   279  * Returns the name of the remote user.
   280  *
   281  * @param xfer The file transfer.
   282  *
   283  * @return The name of the remote user.
   284  *
   285  * @since 2.1.0
   286  */
   287 const char *purple_xfer_get_remote_user(const PurpleXfer *xfer);
   288 
   289 /**
   290  * Returns the status of the xfer.
   291  *
   292  * @param xfer The file transfer.
   293  *
   294  * @return The status.
   295  */
   296 PurpleXferStatusType purple_xfer_get_status(const PurpleXfer *xfer);
   297 
   298 /**
   299  * Returns true if the file transfer was canceled.
   300  *
   301  * @param xfer The file transfer.
   302  *
   303  * @return Whether or not the transfer was canceled.
   304  */
   305 gboolean purple_xfer_is_canceled(const PurpleXfer *xfer);
   306 
   307 /**
   308  * Returns the completed state for a file transfer.
   309  *
   310  * @param xfer The file transfer.
   311  *
   312  * @return The completed state.
   313  */
   314 gboolean purple_xfer_is_completed(const PurpleXfer *xfer);
   315 
   316 /**
   317  * Returns the name of the file being sent or received.
   318  *
   319  * @param xfer The file transfer.
   320  *
   321  * @return The filename.
   322  */
   323 const char *purple_xfer_get_filename(const PurpleXfer *xfer);
   324 
   325 /**
   326  * Returns the file's destination filename,
   327  *
   328  * @param xfer The file transfer.
   329  *
   330  * @return The destination filename.
   331  */
   332 const char *purple_xfer_get_local_filename(const PurpleXfer *xfer);
   333 
   334 /**
   335  * Returns the number of bytes sent (or received) so far.
   336  *
   337  * @param xfer The file transfer.
   338  *
   339  * @return The number of bytes sent.
   340  */
   341 size_t purple_xfer_get_bytes_sent(const PurpleXfer *xfer);
   342 
   343 /**
   344  * Returns the number of bytes remaining to send or receive.
   345  *
   346  * @param xfer The file transfer.
   347  *
   348  * @return The number of bytes remaining.
   349  */
   350 size_t purple_xfer_get_bytes_remaining(const PurpleXfer *xfer);
   351 
   352 /**
   353  * Returns the size of the file being sent or received.
   354  *
   355  * @param xfer The file transfer.
   356  *
   357  * @return The total size of the file.
   358  */
   359 size_t purple_xfer_get_size(const PurpleXfer *xfer);
   360 
   361 /**
   362  * Returns the current percentage of progress of the transfer.
   363  *
   364  * This is a number between 0 (0%) and 1 (100%).
   365  *
   366  * @param xfer The file transfer.
   367  *
   368  * @return The percentage complete.
   369  */
   370 double purple_xfer_get_progress(const PurpleXfer *xfer);
   371 
   372 /**
   373  * Returns the local port number in the file transfer.
   374  *
   375  * @param xfer The file transfer.
   376  *
   377  * @return The port number on this end.
   378  */
   379 unsigned int purple_xfer_get_local_port(const PurpleXfer *xfer);
   380 
   381 /**
   382  * Returns the remote IP address in the file transfer.
   383  *
   384  * @param xfer The file transfer.
   385  *
   386  * @return The IP address on the other end.
   387  */
   388 const char *purple_xfer_get_remote_ip(const PurpleXfer *xfer);
   389 
   390 /**
   391  * Returns the remote port number in the file transfer.
   392  *
   393  * @param xfer The file transfer.
   394  *
   395  * @return The port number on the other end.
   396  */
   397 unsigned int purple_xfer_get_remote_port(const PurpleXfer *xfer);
   398 
   399 /**
   400  * Returns the time the transfer of a file started.
   401  *
   402  * @param xfer  The file transfer.
   403  *
   404  * @return The time when the transfer started.
   405  * @since 2.4.0
   406  */
   407 time_t purple_xfer_get_start_time(const PurpleXfer *xfer);
   408 
   409 /**
   410  * Returns the time the transfer of a file ended.
   411  *
   412  * @param xfer  The file transfer.
   413  *
   414  * @return The time when the transfer ended.
   415  * @since 2.4.0
   416  */
   417 time_t purple_xfer_get_end_time(const PurpleXfer *xfer);
   418 
   419 /**
   420  * Sets the completed state for the file transfer.
   421  *
   422  * @param xfer      The file transfer.
   423  * @param completed The completed state.
   424  */
   425 void purple_xfer_set_completed(PurpleXfer *xfer, gboolean completed);
   426 
   427 /**
   428  * Sets the filename for the file transfer.
   429  *
   430  * @param xfer     The file transfer.
   431  * @param message The message.
   432  */
   433 void purple_xfer_set_message(PurpleXfer *xfer, const char *message);
   434 
   435 /**
   436  * Sets the filename for the file transfer.
   437  *
   438  * @param xfer     The file transfer.
   439  * @param filename The filename.
   440  */
   441 void purple_xfer_set_filename(PurpleXfer *xfer, const char *filename);
   442 
   443 /**
   444  * Sets the local filename for the file transfer.
   445  *
   446  * @param xfer     The file transfer.
   447  * @param filename The filename
   448  */
   449 void purple_xfer_set_local_filename(PurpleXfer *xfer, const char *filename);
   450 
   451 /**
   452  * Sets the size of the file in a file transfer.
   453  *
   454  * @param xfer The file transfer.
   455  * @param size The size of the file.
   456  */
   457 void purple_xfer_set_size(PurpleXfer *xfer, size_t size);
   458 
   459 /**
   460  * Sets the current working position in the active file transfer.  This
   461  * can be used to jump backward in the file if the protocol detects
   462  * that some bit of data needs to be resent or has been sent twice.
   463  *
   464  * It's used for pausing and resuming an oscar file transfer.
   465  *
   466  * @param xfer       The file transfer.
   467  * @param bytes_sent The new current position in the file.  If we're
   468  *                   sending a file then this is the byte that we will
   469  *                   send.  If we're receiving a file, this is the
   470  *                   next byte that we expect to receive.
   471  */
   472 void purple_xfer_set_bytes_sent(PurpleXfer *xfer, size_t bytes_sent);
   473 
   474 /**
   475  * Returns the UI operations structure for a file transfer.
   476  *
   477  * @param xfer The file transfer.
   478  *
   479  * @return The UI operations structure.
   480  */
   481 PurpleXferUiOps *purple_xfer_get_ui_ops(const PurpleXfer *xfer);
   482 
   483 /**
   484  * Sets the read function for the file transfer.
   485  *
   486  * @param xfer The file transfer.
   487  * @param fnc  The read function.
   488  */
   489 void purple_xfer_set_read_fnc(PurpleXfer *xfer,
   490 		gssize (*fnc)(guchar **, PurpleXfer *));
   491 
   492 /**
   493  * Sets the write function for the file transfer.
   494  *
   495  * @param xfer The file transfer.
   496  * @param fnc  The write function.
   497  */
   498 void purple_xfer_set_write_fnc(PurpleXfer *xfer,
   499 		gssize (*fnc)(const guchar *, size_t, PurpleXfer *));
   500 
   501 /**
   502  * Sets the acknowledge function for the file transfer.
   503  *
   504  * @param xfer The file transfer.
   505  * @param fnc  The acknowledge function.
   506  */
   507 void purple_xfer_set_ack_fnc(PurpleXfer *xfer,
   508 		void (*fnc)(PurpleXfer *, const guchar *, size_t));
   509 
   510 /**
   511  * Sets the function to be called if the request is denied.
   512  *
   513  * @param xfer The file transfer.
   514  * @param fnc The request denied prpl callback.
   515  */
   516 void purple_xfer_set_request_denied_fnc(PurpleXfer *xfer, void (*fnc)(PurpleXfer *));
   517 
   518 /**
   519  * Sets the transfer initialization function for the file transfer.
   520  *
   521  * This function is required, and must call purple_xfer_start() with
   522  * the necessary parameters. This will be called if the file transfer
   523  * is accepted by the user.
   524  *
   525  * @param xfer The file transfer.
   526  * @param fnc  The transfer initialization function.
   527  */
   528 void purple_xfer_set_init_fnc(PurpleXfer *xfer, void (*fnc)(PurpleXfer *));
   529 
   530 /**
   531  * Sets the start transfer function for the file transfer.
   532  *
   533  * @param xfer The file transfer.
   534  * @param fnc  The start transfer function.
   535  */
   536 void purple_xfer_set_start_fnc(PurpleXfer *xfer, void (*fnc)(PurpleXfer *));
   537 
   538 /**
   539  * Sets the end transfer function for the file transfer.
   540  *
   541  * @param xfer The file transfer.
   542  * @param fnc  The end transfer function.
   543  */
   544 void purple_xfer_set_end_fnc(PurpleXfer *xfer, void (*fnc)(PurpleXfer *));
   545 
   546 /**
   547  * Sets the cancel send function for the file transfer.
   548  *
   549  * @param xfer The file transfer.
   550  * @param fnc  The cancel send function.
   551  */
   552 void purple_xfer_set_cancel_send_fnc(PurpleXfer *xfer, void (*fnc)(PurpleXfer *));
   553 
   554 /**
   555  * Sets the cancel receive function for the file transfer.
   556  *
   557  * @param xfer The file transfer.
   558  * @param fnc  The cancel receive function.
   559  */
   560 void purple_xfer_set_cancel_recv_fnc(PurpleXfer *xfer, void (*fnc)(PurpleXfer *));
   561 
   562 /**
   563  * Reads in data from a file transfer stream.
   564  *
   565  * @param xfer   The file transfer.
   566  * @param buffer The buffer that will be created to contain the data.
   567  *
   568  * @return The number of bytes read, or -1.
   569  */
   570 gssize purple_xfer_read(PurpleXfer *xfer, guchar **buffer);
   571 
   572 /**
   573  * Writes data to a file transfer stream.
   574  *
   575  * @param xfer   The file transfer.
   576  * @param buffer The buffer to read the data from.
   577  * @param size   The number of bytes to write.
   578  *
   579  * @return The number of bytes written, or -1.
   580  */
   581 gssize purple_xfer_write(PurpleXfer *xfer, const guchar *buffer, gsize size);
   582 
   583 /**
   584  * Starts a file transfer.
   585  *
   586  * Either @a fd must be specified <i>or</i> @a ip and @a port on a
   587  * file receive transfer. On send, @a fd must be specified, and
   588  * @a ip and @a port are ignored.
   589  *
   590  * Prior to libpurple 2.6.0, passing '0' to @a fd was special-cased to
   591  * allow the protocol plugin to facilitate the file transfer itself. As of
   592  * 2.6.0, this is supported (for backward compatibility), but will be
   593  * removed in libpurple 3.0.0. If a prpl detects that the running libpurple
   594  * is running 2.6.0 or higher, it should use the invalid fd '-1'.
   595  *
   596  * @param xfer The file transfer.
   597  * @param fd   The file descriptor for the socket.
   598  * @param ip   The IP address to connect to.
   599  * @param port The port to connect to.
   600  */
   601 void purple_xfer_start(PurpleXfer *xfer, int fd, const char *ip,
   602 					 unsigned int port);
   603 
   604 /**
   605  * Ends a file transfer.
   606  *
   607  * @param xfer The file transfer.
   608  */
   609 void purple_xfer_end(PurpleXfer *xfer);
   610 
   611 /**
   612  * Adds a new file transfer to the list of file transfers. Call this only
   613  * if you are not using purple_xfer_start.
   614  *
   615  * @param xfer The file transfer.
   616  */
   617 void purple_xfer_add(PurpleXfer *xfer);
   618 
   619 /**
   620  * Cancels a file transfer on the local end.
   621  *
   622  * @param xfer The file transfer.
   623  */
   624 void purple_xfer_cancel_local(PurpleXfer *xfer);
   625 
   626 /**
   627  * Cancels a file transfer from the remote end.
   628  *
   629  * @param xfer The file transfer.
   630  */
   631 void purple_xfer_cancel_remote(PurpleXfer *xfer);
   632 
   633 /**
   634  * Displays a file transfer-related error message.
   635  *
   636  * This is a wrapper around purple_notify_error(), which automatically
   637  * specifies a title ("File transfer to <i>user</i> failed" or
   638  * "File Transfer from <i>user</i> failed").
   639  *
   640  * @param type    The type of file transfer.
   641  * @param account The account sending or receiving the file.
   642  * @param who     The user on the other end of the transfer.
   643  * @param msg     The message to display.
   644  */
   645 void purple_xfer_error(PurpleXferType type, PurpleAccount *account, const char *who, const char *msg);
   646 
   647 /**
   648  * Updates file transfer progress.
   649  *
   650  * @param xfer      The file transfer.
   651  */
   652 void purple_xfer_update_progress(PurpleXfer *xfer);
   653 
   654 /**
   655  * Displays a file transfer-related message in the conversation window
   656  *
   657  * This is a wrapper around purple_conversation_write
   658  *
   659  * @param xfer The file transfer to which this message relates.
   660  * @param message The message to display.
   661  * @param is_error Is this an error message?.
   662  */
   663 void purple_xfer_conversation_write(PurpleXfer *xfer, char *message, gboolean is_error);
   664 
   665 /**
   666  * Allows the UI to signal it's ready to send/receive data (depending on
   667  * the direction of the file transfer. Used when the UI is providing
   668  * read/write/data_not_sent UI ops.
   669  *
   670  * @param xfer The file transfer which is ready.
   671  *
   672  * @since 2.6.0
   673  */
   674 void purple_xfer_ui_ready(PurpleXfer *xfer);
   675 
   676 /**
   677  * Allows the prpl to signal it's readh to send/receive data (depending on
   678  * the direction of the file transfer. Used when the prpl provides read/write
   679  * ops and cannot/does not provide a raw fd to the core.
   680  *
   681  * @param xfer The file transfer which is ready.
   682  *
   683  * @since 2.6.0
   684  */
   685 void purple_xfer_prpl_ready(PurpleXfer *xfer);
   686 
   687 /*@}*/
   688 
   689 /**************************************************************************/
   690 /** @name UI Registration Functions                                       */
   691 /**************************************************************************/
   692 /*@{*/
   693 
   694 /**
   695  * Returns the handle to the file transfer subsystem
   696  *
   697  * @return The handle
   698  */
   699 void *purple_xfers_get_handle(void);
   700 
   701 /**
   702  * Initializes the file transfer subsystem
   703  */
   704 void purple_xfers_init(void);
   705 
   706 /**
   707  * Uninitializes the file transfer subsystem
   708  */
   709 void purple_xfers_uninit(void);
   710 
   711 /**
   712  * Sets the UI operations structure to be used in all purple file transfers.
   713  *
   714  * @param ops The UI operations structure.
   715  */
   716 void purple_xfers_set_ui_ops(PurpleXferUiOps *ops);
   717 
   718 /**
   719  * Returns the UI operations structure to be used in all purple file transfers.
   720  *
   721  * @return The UI operations structure.
   722  */
   723 PurpleXferUiOps *purple_xfers_get_ui_ops(void);
   724 
   725 /*@}*/
   726 
   727 #ifdef __cplusplus
   728 }
   729 #endif
   730 
   731 #endif /* _PURPLE_FT_H_ */