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/>.
24 ctypedef char const_char "const char"
26 cdef extern from "libpurple/connection.h":
27 ctypedef struct PurpleConnection
29 ctypedef enum PurpleConnectionFlags:
30 PURPLE_CONNECTION_HTML = 0x0001
31 PURPLE_CONNECTION_NO_BGCOLOR = 0x0002
32 PURPLE_CONNECTION_AUTO_RESP = 0x0004
33 PURPLE_CONNECTION_FORMATTING_WBFO = 0x0008
34 PURPLE_CONNECTION_NO_NEWLINES = 0x0010
35 PURPLE_CONNECTION_NO_FONTSIZE = 0x0020
36 PURPLE_CONNECTION_NO_URLDESC = 0x0040
37 PURPLE_CONNECTION_NO_IMAGES = 0x0080
38 PURPLE_CONNECTION_ALLOW_CUSTOM_SMILEY = 0x0100
40 ctypedef enum PurpleConnectionState:
41 PURPLE_DISCONNECTED = 0
45 ctypedef enum PurpleConnectionError:
46 PURPLE_CONNECTION_ERROR_NETWORK_ERROR = 0
47 PURPLE_CONNECTION_ERROR_INVALID_USERNAME = 1
48 PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED = 2
49 PURPLE_CONNECTION_ERROR_AUTHENTICATION_IMPOSSIBLE = 3
50 PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT = 4
51 PURPLE_CONNECTION_ERROR_ENCRYPTION_ERROR = 5
52 PURPLE_CONNECTION_ERROR_NAME_IN_USE = 6
53 PURPLE_CONNECTION_ERROR_INVALID_SETTINGS = 7
54 PURPLE_CONNECTION_ERROR_CERT_NOT_PROVIDED = 8
55 PURPLE_CONNECTION_ERROR_CERT_UNTRUSTED = 9
56 PURPLE_CONNECTION_ERROR_CERT_EXPIRED = 10
57 PURPLE_CONNECTION_ERROR_CERT_NOT_ACTIVATED = 11
58 PURPLE_CONNECTION_ERROR_CERT_HOSTNAME_MISMATCH = 12
59 PURPLE_CONNECTION_ERROR_CERT_FINGERPRINT_MISMATCH = 13
60 PURPLE_CONNECTION_ERROR_CERT_SELF_SIGNED = 14
61 PURPLE_CONNECTION_ERROR_CERT_OTHER_ERROR = 15
62 PURPLE_CONNECTION_ERROR_OTHER_ERROR = 16
64 ctypedef struct PurpleConnectionErrorInfo:
65 PurpleConnectionError type
68 ctypedef struct PurpleConnectionUiOps:
69 void (*connect_progress) (PurpleConnection *gc, const_char *text, size_t step, size_t step_count)
70 void (*connected) (PurpleConnection *gc)
71 void (*disconnected) (PurpleConnection *gc)
72 void (*notice) (PurpleConnection *gc, const_char *text)
73 void (*report_disconnect) (PurpleConnection *gc, const_char *text)
74 void (*network_connected) ()
75 void (*network_disconnected) ()
76 void (*report_disconnect_reason) (PurpleConnection *gc, PurpleConnectionError reason, const_char *text)
78 ctypedef struct PurpleConnection:
81 account.PurpleAccount *c_purple_connection_get_account "purple_connection_get_account" (PurpleConnection *gc)
82 void *c_purple_connections_get_handle "purple_connections_get_handle" ()
83 void c_purple_connections_set_ui_ops "purple_connections_set_ui_ops" (PurpleConnectionUiOps *ops)