Frameworks/libpurple.framework/Versions/0.5.6/Headers/proxy.h
branchadium-1.3
changeset 350 708bedafdc3a
parent 349 17ef128722b7
child 351 b01ab9b157f9
     1.1 --- a/Frameworks/libpurple.framework/Versions/0.5.6/Headers/proxy.h	Sun Jun 21 22:04:11 2009 -0400
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,301 +0,0 @@
     1.4 -/**
     1.5 - * @file proxy.h Proxy API
     1.6 - * @ingroup core
     1.7 - */
     1.8 -
     1.9 -/* purple
    1.10 - *
    1.11 - * Purple is the legal property of its developers, whose names are too numerous
    1.12 - * to list here.  Please refer to the COPYRIGHT file distributed with this
    1.13 - * source distribution.
    1.14 - *
    1.15 - * This program is free software; you can redistribute it and/or modify
    1.16 - * it under the terms of the GNU General Public License as published by
    1.17 - * the Free Software Foundation; either version 2 of the License, or
    1.18 - * (at your option) any later version.
    1.19 - *
    1.20 - * This program is distributed in the hope that it will be useful,
    1.21 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.22 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1.23 - * GNU General Public License for more details.
    1.24 - *
    1.25 - * You should have received a copy of the GNU General Public License
    1.26 - * along with this program; if not, write to the Free Software
    1.27 - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
    1.28 - */
    1.29 -#ifndef _PURPLE_PROXY_H_
    1.30 -#define _PURPLE_PROXY_H_
    1.31 -
    1.32 -#include <glib.h>
    1.33 -#include "eventloop.h"
    1.34 -
    1.35 -/**
    1.36 - * A type of proxy connection.
    1.37 - */
    1.38 -typedef enum
    1.39 -{
    1.40 -	PURPLE_PROXY_USE_GLOBAL = -1,  /**< Use the global proxy information. */
    1.41 -	PURPLE_PROXY_NONE = 0,         /**< No proxy.                         */
    1.42 -	PURPLE_PROXY_HTTP,             /**< HTTP proxy.                       */
    1.43 -	PURPLE_PROXY_SOCKS4,           /**< SOCKS 4 proxy.                    */
    1.44 -	PURPLE_PROXY_SOCKS5,           /**< SOCKS 5 proxy.                    */
    1.45 -	PURPLE_PROXY_USE_ENVVAR        /**< Use environmental settings.       */
    1.46 -
    1.47 -} PurpleProxyType;
    1.48 -
    1.49 -/**
    1.50 - * Information on proxy settings.
    1.51 - */
    1.52 -typedef struct
    1.53 -{
    1.54 -	PurpleProxyType type;   /**< The proxy type.  */
    1.55 -
    1.56 -	char *host;           /**< The host.        */
    1.57 -	int   port;           /**< The port number. */
    1.58 -	char *username;       /**< The username.    */
    1.59 -	char *password;       /**< The password.    */
    1.60 -
    1.61 -} PurpleProxyInfo;
    1.62 -
    1.63 -typedef struct _PurpleProxyConnectData PurpleProxyConnectData;
    1.64 -
    1.65 -typedef void (*PurpleProxyConnectFunction)(gpointer data, gint source, const gchar *error_message);
    1.66 -
    1.67 -
    1.68 -#include "account.h"
    1.69 -
    1.70 -#ifdef __cplusplus
    1.71 -extern "C" {
    1.72 -#endif
    1.73 -
    1.74 -/**************************************************************************/
    1.75 -/** @name Proxy structure API                                             */
    1.76 -/**************************************************************************/
    1.77 -/*@{*/
    1.78 -
    1.79 -/**
    1.80 - * Creates a proxy information structure.
    1.81 - *
    1.82 - * @return The proxy information structure.
    1.83 - */
    1.84 -PurpleProxyInfo *purple_proxy_info_new(void);
    1.85 -
    1.86 -/**
    1.87 - * Destroys a proxy information structure.
    1.88 - *
    1.89 - * @param info The proxy information structure to destroy.
    1.90 - */
    1.91 -void purple_proxy_info_destroy(PurpleProxyInfo *info);
    1.92 -
    1.93 -/**
    1.94 - * Sets the type of proxy.
    1.95 - *
    1.96 - * @param info The proxy information.
    1.97 - * @param type The proxy type.
    1.98 - */
    1.99 -void purple_proxy_info_set_type(PurpleProxyInfo *info, PurpleProxyType type);
   1.100 -
   1.101 -/**
   1.102 - * Sets the proxy host.
   1.103 - *
   1.104 - * @param info The proxy information.
   1.105 - * @param host The host.
   1.106 - */
   1.107 -void purple_proxy_info_set_host(PurpleProxyInfo *info, const char *host);
   1.108 -
   1.109 -/**
   1.110 - * Sets the proxy port.
   1.111 - *
   1.112 - * @param info The proxy information.
   1.113 - * @param port The port.
   1.114 - */
   1.115 -void purple_proxy_info_set_port(PurpleProxyInfo *info, int port);
   1.116 -
   1.117 -/**
   1.118 - * Sets the proxy username.
   1.119 - *
   1.120 - * @param info     The proxy information.
   1.121 - * @param username The username.
   1.122 - */
   1.123 -void purple_proxy_info_set_username(PurpleProxyInfo *info, const char *username);
   1.124 -
   1.125 -/**
   1.126 - * Sets the proxy password.
   1.127 - *
   1.128 - * @param info     The proxy information.
   1.129 - * @param password The password.
   1.130 - */
   1.131 -void purple_proxy_info_set_password(PurpleProxyInfo *info, const char *password);
   1.132 -
   1.133 -/**
   1.134 - * Returns the proxy's type.
   1.135 - *
   1.136 - * @param info The proxy information.
   1.137 - *
   1.138 - * @return The type.
   1.139 - */
   1.140 -PurpleProxyType purple_proxy_info_get_type(const PurpleProxyInfo *info);
   1.141 -
   1.142 -/**
   1.143 - * Returns the proxy's host.
   1.144 - *
   1.145 - * @param info The proxy information.
   1.146 - *
   1.147 - * @return The host.
   1.148 - */
   1.149 -const char *purple_proxy_info_get_host(const PurpleProxyInfo *info);
   1.150 -
   1.151 -/**
   1.152 - * Returns the proxy's port.
   1.153 - *
   1.154 - * @param info The proxy information.
   1.155 - *
   1.156 - * @return The port.
   1.157 - */
   1.158 -int purple_proxy_info_get_port(const PurpleProxyInfo *info);
   1.159 -
   1.160 -/**
   1.161 - * Returns the proxy's username.
   1.162 - *
   1.163 - * @param info The proxy information.
   1.164 - *
   1.165 - * @return The username.
   1.166 - */
   1.167 -const char *purple_proxy_info_get_username(const PurpleProxyInfo *info);
   1.168 -
   1.169 -/**
   1.170 - * Returns the proxy's password.
   1.171 - *
   1.172 - * @param info The proxy information.
   1.173 - *
   1.174 - * @return The password.
   1.175 - */
   1.176 -const char *purple_proxy_info_get_password(const PurpleProxyInfo *info);
   1.177 -
   1.178 -/*@}*/
   1.179 -
   1.180 -/**************************************************************************/
   1.181 -/** @name Global Proxy API                                                */
   1.182 -/**************************************************************************/
   1.183 -/*@{*/
   1.184 -
   1.185 -/**
   1.186 - * Returns purple's global proxy information.
   1.187 - *
   1.188 - * @return The global proxy information.
   1.189 - */
   1.190 -PurpleProxyInfo *purple_global_proxy_get_info(void);
   1.191 -
   1.192 -/*@}*/
   1.193 -
   1.194 -/**************************************************************************/
   1.195 -/** @name Proxy API                                                       */
   1.196 -/**************************************************************************/
   1.197 -/*@{*/
   1.198 -
   1.199 -/**
   1.200 - * Returns the proxy subsystem handle.
   1.201 - *
   1.202 - * @return The proxy subsystem handle.
   1.203 - */
   1.204 -void *purple_proxy_get_handle(void);
   1.205 -
   1.206 -/**
   1.207 - * Initializes the proxy subsystem.
   1.208 - */
   1.209 -void purple_proxy_init(void);
   1.210 -
   1.211 -/**
   1.212 - * Uninitializes the proxy subsystem.
   1.213 - */
   1.214 -void purple_proxy_uninit(void);
   1.215 -
   1.216 -/**
   1.217 - * Returns configuration of a proxy.
   1.218 - *
   1.219 - * @param account The account for which the configuration is needed.
   1.220 - *
   1.221 - * @return The configuration of a proxy.
   1.222 - */
   1.223 -PurpleProxyInfo *purple_proxy_get_setup(PurpleAccount *account);
   1.224 -
   1.225 -/**
   1.226 - * Makes a connection to the specified host and port.  Note that this
   1.227 - * function name can be misleading--although it is called "proxy
   1.228 - * connect," it is used for establishing any outgoing TCP connection,
   1.229 - * whether through a proxy or not.
   1.230 - *
   1.231 - * @param handle     A handle that should be associated with this
   1.232 - *                   connection attempt.  The handle can be used
   1.233 - *                   to cancel the connection attempt using the
   1.234 - *                   purple_proxy_connect_cancel_with_handle()
   1.235 - *                   function.
   1.236 - * @param account    The account making the connection.
   1.237 - * @param host       The destination host.
   1.238 - * @param port       The destination port.
   1.239 - * @param connect_cb The function to call when the connection is
   1.240 - *                   established.  If the connection failed then
   1.241 - *                   fd will be -1 and error message will be set
   1.242 - *                   to something descriptive (hopefully).
   1.243 - * @param data       User-defined data.
   1.244 - *
   1.245 - * @return NULL if there was an error, or a reference to an
   1.246 - *         opaque data structure that can be used to cancel
   1.247 - *         the pending connection, if needed.
   1.248 - */
   1.249 -PurpleProxyConnectData *purple_proxy_connect(void *handle,
   1.250 -			PurpleAccount *account,
   1.251 -			const char *host, int port,
   1.252 -			PurpleProxyConnectFunction connect_cb, gpointer data);
   1.253 -
   1.254 -/**
   1.255 - * Makes a connection through a SOCKS5 proxy.
   1.256 - *
   1.257 - * @param handle     A handle that should be associated with this
   1.258 - *                   connection attempt.  The handle can be used
   1.259 - *                   to cancel the connection attempt using the
   1.260 - *                   purple_proxy_connect_cancel_with_handle()
   1.261 - *                   function.
   1.262 - * @param gpi        The PurpleProxyInfo specifying the proxy settings
   1.263 - * @param host       The destination host.
   1.264 - * @param port       The destination port.
   1.265 - * @param connect_cb The function to call when the connection is
   1.266 - *                   established.  If the connection failed then
   1.267 - *                   fd will be -1 and error message will be set
   1.268 - *                   to something descriptive (hopefully).
   1.269 - * @param data       User-defined data.
   1.270 - *
   1.271 - * @return NULL if there was an error, or a reference to an
   1.272 - *         opaque data structure that can be used to cancel
   1.273 - *         the pending connection, if needed.
   1.274 - */
   1.275 -PurpleProxyConnectData *purple_proxy_connect_socks5(void *handle,
   1.276 -			PurpleProxyInfo *gpi,
   1.277 -			const char *host, int port,
   1.278 -			PurpleProxyConnectFunction connect_cb, gpointer data);
   1.279 -
   1.280 -/**
   1.281 - * Cancel an in-progress connection attempt.  This should be called
   1.282 - * by the PRPL if the user disables an account while it is still
   1.283 - * performing the initial sign on.  Or when establishing a file
   1.284 - * transfer, if we attempt to connect to a remote user but they
   1.285 - * are behind a firewall then the PRPL can cancel the connection
   1.286 - * attempt early rather than just letting the OS's TCP/IP stack
   1.287 - * time-out the connection.
   1.288 - */
   1.289 -void purple_proxy_connect_cancel(PurpleProxyConnectData *connect_data);
   1.290 -
   1.291 -/*
   1.292 - * Closes all proxy connections registered with the specified handle.
   1.293 - *
   1.294 - * @param handle The handle.
   1.295 - */
   1.296 -void purple_proxy_connect_cancel_with_handle(void *handle);
   1.297 -
   1.298 -/*@}*/
   1.299 -
   1.300 -#ifdef __cplusplus
   1.301 -}
   1.302 -#endif
   1.303 -
   1.304 -#endif /* _PURPLE_PROXY_H_ */