Added more properties to account and buddy.
[python-purple] / libpurple / connection.pxd
1 #
2 #  Copyright (c) 2008 INdT - Instituto Nokia de Tecnologia
3 #
4 #  This file is part of python-purple.
5 #
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.
10 #
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.
15 #
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/>.
18 #
19
20 cimport glib
21
22 cimport account
23 cimport plugin
24
25 cdef extern from *:
26     ctypedef int size_t
27     ctypedef long int time_t
28     ctypedef char const_char "const char"
29
30 cdef extern from "libpurple/connection.h":
31     ctypedef struct PurpleConnection
32
33     ctypedef enum PurpleConnectionFlags:
34         PURPLE_CONNECTION_HTML = 0x0001
35         PURPLE_CONNECTION_NO_BGCOLOR = 0x0002
36         PURPLE_CONNECTION_AUTO_RESP = 0x0004
37         PURPLE_CONNECTION_FORMATTING_WBFO = 0x0008
38         PURPLE_CONNECTION_NO_NEWLINES = 0x0010
39         PURPLE_CONNECTION_NO_FONTSIZE = 0x0020
40         PURPLE_CONNECTION_NO_URLDESC = 0x0040
41         PURPLE_CONNECTION_NO_IMAGES = 0x0080
42         PURPLE_CONNECTION_ALLOW_CUSTOM_SMILEY = 0x0100
43
44     ctypedef enum PurpleConnectionState:
45         PURPLE_DISCONNECTED = 0
46         PURPLE_CONNECTED
47         PURPLE_CONNECTING
48
49     ctypedef enum PurpleConnectionError:
50         PURPLE_CONNECTION_ERROR_NETWORK_ERROR = 0
51         PURPLE_CONNECTION_ERROR_INVALID_USERNAME = 1
52         PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED = 2
53         PURPLE_CONNECTION_ERROR_AUTHENTICATION_IMPOSSIBLE = 3
54         PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT = 4
55         PURPLE_CONNECTION_ERROR_ENCRYPTION_ERROR = 5
56         PURPLE_CONNECTION_ERROR_NAME_IN_USE = 6
57         PURPLE_CONNECTION_ERROR_INVALID_SETTINGS = 7
58         PURPLE_CONNECTION_ERROR_CERT_NOT_PROVIDED = 8
59         PURPLE_CONNECTION_ERROR_CERT_UNTRUSTED = 9
60         PURPLE_CONNECTION_ERROR_CERT_EXPIRED = 10
61         PURPLE_CONNECTION_ERROR_CERT_NOT_ACTIVATED = 11
62         PURPLE_CONNECTION_ERROR_CERT_HOSTNAME_MISMATCH = 12
63         PURPLE_CONNECTION_ERROR_CERT_FINGERPRINT_MISMATCH = 13
64         PURPLE_CONNECTION_ERROR_CERT_SELF_SIGNED = 14
65         PURPLE_CONNECTION_ERROR_CERT_OTHER_ERROR = 15
66         PURPLE_CONNECTION_ERROR_OTHER_ERROR = 16
67
68     ctypedef struct PurpleConnectionErrorInfo:
69         PurpleConnectionError type
70         char *description
71
72     ctypedef struct PurpleConnectionUiOps:
73         void (*connect_progress) (PurpleConnection *gc, const_char *text, size_t step, size_t step_count)
74         void (*connected) (PurpleConnection *gc)
75         void (*disconnected) (PurpleConnection *gc)
76         void (*notice) (PurpleConnection *gc, const_char *text)
77         void (*report_disconnect) (PurpleConnection *gc, const_char *text)
78         void (*network_connected) ()
79         void (*network_disconnected) ()
80         void (*report_disconnect_reason) (PurpleConnection *gc, PurpleConnectionError reason, const_char *text)
81
82     ctypedef struct PurpleConnection:
83         plugin.PurplePlugin *prpl
84         PurpleConnectionFlags flags
85         PurpleConnectionState state
86         account.PurpleAccount *account
87         char *password
88         int inpa
89         glib.GSList *buddy_chats
90         void *proto_data
91         char *display_name
92         glib.guint keepalive
93         glib.gboolean wants_to_die
94         glib.guint disconnect_timeout
95         time_t last_received
96
97     account.PurpleAccount *c_purple_connection_get_account "purple_connection_get_account" (PurpleConnection *gc)
98     void *c_purple_connections_get_handle "purple_connections_get_handle" ()
99     void c_purple_connections_set_ui_ops "purple_connections_set_ui_ops" (PurpleConnectionUiOps *ops)