2 # Copyright (c) 2008 INdT - Instituto Nokia de Tecnologia
4 # This file is part of python-purple.
6 # python-purple is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
11 # python-purple is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
22 cdef class ProxyInfoType:
23 cdef proxy.PurpleProxyType c_type
26 self.c_type = proxy.PURPLE_PROXY_NONE
29 self.c_type = proxy.PURPLE_PROXY_NONE
31 NONE = property(get_NONE)
33 def get_USE_GLOBAL(self):
34 self.c_type = proxy.PURPLE_PROXY_USE_GLOBAL
36 USE_GLOBAL = property(get_USE_GLOBAL)
39 self.c_type = proxy.PURPLE_PROXY_HTTP
41 HTTP = property(get_HTTP)
44 self.c_type = proxy.PURPLE_PROXY_SOCKS4
48 self.c_type = proxy.PURPLE_PROXY_SOCKS5
51 def get_USE_ENVVAR (self):
52 self.c_type = proxy.PURPLE_PROXY_USE_ENVVAR
54 USE_ENVVAR = property(get_USE_ENVVAR)
58 cdef proxy.PurpleProxyInfo *c_proxyinfo
61 self.c_proxyinfo = NULL
63 def set_type(self, ProxyInfoType type):
65 proxy.c_purple_proxy_info_set_type(self.c_proxyinfo, type.c_type)
67 def set_host(self, char *host):
69 proxy.c_purple_proxy_info_set_host(self.c_proxyinfo, host)
71 def set_port(self, int port):
73 proxy.c_purple_proxy_info_set_port(self.c_proxyinfo, port)
75 def set_username(self, char *username):
77 proxy.c_purple_proxy_info_set_username(self.c_proxyinfo, username)
79 def set_password(self, char *password):
81 proxy.c_purple_proxy_info_set_password(self.c_proxyinfo, password)