61167d947d38682dcb639020c586106601c07457
[python-purple] / libpurple / blist.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
24 cdef extern from *:
25     ctypedef char const_char "const char"
26
27 # hack to avoid recursive loops by cython
28 cdef extern from "libpurple/status.h":
29     ctypedef struct PurplePresence:
30         pass
31
32 cdef extern from "libpurple/blist.h":
33     ctypedef struct PurpleBuddyList
34     ctypedef struct PurpleBlistUiOps
35     ctypedef struct PurpleBlistNode
36     ctypedef struct PurpleChat
37     ctypedef struct PurpleGroup
38     ctypedef struct PurpleContact
39     ctypedef struct PurpleBuddy
40
41     ctypedef enum PurpleBlistNodeType:
42         PURPLE_BLIST_GROUP_NODE
43         PURPLE_BLIST_CONTACT_NODE
44         PURPLE_BLIST_BUDDY_NODE
45         PURPLE_BLIST_CHAT_NODE
46         PURPLE_BLIST_OTHER_NODE
47
48     ctypedef enum PurpleBlistNodeFlags:
49         PURPLE_BLIST_NODE_FLAG_NO_SAVE = 1 << 0
50
51     ctypedef struct PurpleBlistNode:
52         PurpleBlistNodeType type
53         PurpleBlistNode *prev
54         PurpleBlistNode *next
55         PurpleBlistNode *parent
56         PurpleBlistNode *child
57         glib.GHashTable *settings
58         void *ui_data
59         PurpleBlistNodeFlags flags
60
61     ctypedef struct PurpleBuddy:
62         char *name
63         char *alias
64         char *server_alias
65         void *proto_data
66
67     ctypedef struct PurpleContact:
68         pass
69
70     ctypedef struct PurpleGroup:
71         pass
72
73     ctypedef struct PurpleChat:
74         pass
75
76     ctypedef struct PurpleBuddyList:
77         PurpleBlistNode *root
78         glib.GHashTable *buddies
79         void *ui_data
80
81     ctypedef struct PurpleBlistUiOps:
82         void (*new_list) (PurpleBuddyList *list)
83         void (*new_node) (PurpleBlistNode *node)
84         void (*show) (PurpleBuddyList *list)
85         void (*update) (PurpleBuddyList *list, PurpleBlistNode *node)
86         void (*remove) (PurpleBuddyList *list, PurpleBlistNode *node)
87         void (*destroy) (PurpleBuddyList *list)
88         void (*set_visible) (PurpleBuddyList *list, glib.gboolean show)
89         void (*request_add_buddy) (account.PurpleAccount *account, const_char *username, const_char *group, const_char *alias)
90         void (*request_add_chat) (account.PurpleAccount *account, PurpleGroup *group, const_char *alias, const_char *name)
91         void (*request_add_group) ()
92
93     void *c_purple_blist_get_handle "purple_blist_get_handle" ()
94     void c_purple_blist_load "purple_blist_load" ()
95     PurpleBuddyList* c_purple_blist_new "purple_blist_new" ()
96     void c_purple_blist_set_ui_ops "purple_blist_set_ui_ops" (PurpleBlistUiOps *ops)
97
98     PurpleBuddy *c_purple_buddy_new "purple_buddy_new" (account.PurpleAccount *account,
99             char *screenname, char *alias)
100     char *c_purple_buddy_get_alias_only "purple_buddy_get_alias_only" (PurpleBuddy *buddy)
101     char *c_purple_buddy_get_name "purple_buddy_get_name" (PurpleBuddy *buddy)
102     PurpleBuddy *c_purple_find_buddy "purple_find_buddy" (account.PurpleAccount *account, char *name)
103     void c_purple_set_blist "purple_set_blist" (PurpleBuddyList *list)
104     glib.GSList *c_purple_find_buddies "purple_find_buddies" (account.PurpleAccount *account, char *name)
105     account.PurpleAccount *c_purple_buddy_get_account "purple_buddy_get_account" (PurpleBuddy *buddy)
106     PurplePresence *c_purple_buddy_get_presence "purple_buddy_get_presence" (PurpleBuddy *buddy)