proxy.h
Go to the documentation of this file.00001
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef _PURPLE_PROXY_H_
00027 #define _PURPLE_PROXY_H_
00028
00029 #include <glib.h>
00030 #include "eventloop.h"
00031
00035 typedef enum
00036 {
00037 PURPLE_PROXY_USE_GLOBAL = -1,
00038 PURPLE_PROXY_NONE = 0,
00039 PURPLE_PROXY_HTTP,
00040 PURPLE_PROXY_SOCKS4,
00041 PURPLE_PROXY_SOCKS5,
00042 PURPLE_PROXY_USE_ENVVAR
00044 } PurpleProxyType;
00045
00049 typedef struct
00050 {
00051 PurpleProxyType type;
00053 char *host;
00054 int port;
00055 char *username;
00056 char *password;
00058 } PurpleProxyInfo;
00059
00060 typedef struct _PurpleProxyConnectData PurpleProxyConnectData;
00061
00062 typedef void (*PurpleProxyConnectFunction)(gpointer data, gint source, const gchar *error_message);
00063
00064
00065 #include "account.h"
00066
00067 #ifdef __cplusplus
00068 extern "C" {
00069 #endif
00070
00071
00073
00081 PurpleProxyInfo *purple_proxy_info_new(void);
00082
00088 void purple_proxy_info_destroy(PurpleProxyInfo *info);
00089
00096 void purple_proxy_info_set_type(PurpleProxyInfo *info, PurpleProxyType type);
00097
00104 void purple_proxy_info_set_host(PurpleProxyInfo *info, const char *host);
00105
00112 void purple_proxy_info_set_port(PurpleProxyInfo *info, int port);
00113
00120 void purple_proxy_info_set_username(PurpleProxyInfo *info, const char *username);
00121
00128 void purple_proxy_info_set_password(PurpleProxyInfo *info, const char *password);
00129
00137 PurpleProxyType purple_proxy_info_get_type(const PurpleProxyInfo *info);
00138
00146 const char *purple_proxy_info_get_host(const PurpleProxyInfo *info);
00147
00155 int purple_proxy_info_get_port(const PurpleProxyInfo *info);
00156
00164 const char *purple_proxy_info_get_username(const PurpleProxyInfo *info);
00165
00173 const char *purple_proxy_info_get_password(const PurpleProxyInfo *info);
00174
00177
00179
00187 PurpleProxyInfo *purple_global_proxy_get_info(void);
00188
00191
00193
00201 void *purple_proxy_get_handle(void);
00202
00206 void purple_proxy_init(void);
00207
00211 void purple_proxy_uninit(void);
00212
00220 PurpleProxyInfo *purple_proxy_get_setup(PurpleAccount *account);
00221
00246 PurpleProxyConnectData *purple_proxy_connect(void *handle,
00247 PurpleAccount *account,
00248 const char *host, int port,
00249 PurpleProxyConnectFunction connect_cb, gpointer data);
00250
00272 PurpleProxyConnectData *purple_proxy_connect_socks5(void *handle,
00273 PurpleProxyInfo *gpi,
00274 const char *host, int port,
00275 PurpleProxyConnectFunction connect_cb, gpointer data);
00276
00286 void purple_proxy_connect_cancel(PurpleProxyConnectData *connect_data);
00287
00288
00289
00290
00291
00292
00293 void purple_proxy_connect_cancel_with_handle(void *handle);
00294
00297 #ifdef __cplusplus
00298 }
00299 #endif
00300
00301 #endif