Updated nullclient-ecore.
[python-purple] / libpurple / status.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 blist
24 cimport conversation
25 cimport value
26
27 cdef extern from *:
28     ctypedef long int time_t
29     ctypedef void* va_list
30
31 cdef extern from "libpurple/status.h":
32     ctypedef struct PurpleStatusType
33     ctypedef struct PurpleStatusAttr
34     ctypedef struct PurplePresence
35     ctypedef struct PurpleStatus
36
37     ctypedef enum PurplePresenceContext:
38         PURPLE_PRESENCE_CONTEXT_UNSET = 0
39         PURPLE_PRESENCE_CONTEXT_ACCOUNT
40         PURPLE_PRESENCE_CONTEXT_CONV
41         PURPLE_PRESENCE_CONTEXT_BUDDY
42
43     ctypedef enum PurpleStatusPrimitive:
44         PURPLE_STATUS_UNSET = 0
45         PURPLE_STATUS_OFFLINE
46         PURPLE_STATUS_AVAILABLE
47         PURPLE_STATUS_UNAVAILABLE
48         PURPLE_STATUS_INVISIBLE
49         PURPLE_STATUS_AWAY
50         PURPLE_STATUS_EXTENDED_AWAY
51         PURPLE_STATUS_MOBILE
52         PURPLE_STATUS_TUNE
53         PURPLE_STATUS_NUM_PRIMITIVES
54
55     ctypedef struct PurpleStatusType:
56         PurpleStatusPrimitive primitive
57         char *id
58         char *name
59         char *primary_attr_id
60         glib.gboolean saveable
61         glib.gboolean user_settable
62         glib.gboolean independent
63         glib.GList *attrs
64
65     ctypedef struct PurpleStatusAttr:
66         char *id
67         char *name
68         value.PurpleValue *value_type
69
70     ctypedef struct __ChatType:
71         conversation.PurpleConversation *conv
72         char *user
73
74     ctypedef struct __BuddyType:
75         account.PurpleAccount *account
76         char *name
77         blist.PurpleBuddy *buddy
78
79     ctypedef union __UnionType:
80         account.PurpleAccount *account
81         __ChatType chat
82         __BuddyType buddy
83
84     ctypedef struct PurplePresence:
85         PurplePresenceContext context
86         glib.gboolean idle
87         time_t idle_time
88         time_t login_time
89         glib.GList *statuses
90         glib.GHashTable *status_table
91         PurpleStatus *active_status
92         __UnionType u
93
94     ctypedef struct PurpleStatus:
95         PurpleStatusType *type
96         PurplePresence *presence
97         char *title
98         glib.gboolean active
99         glib.GHashTable *attr_values
100
101     ctypedef struct PurpleStatusBuddyKey:
102         account.PurpleAccount *account
103         char *name
104
105     # PurpleStatusPrimitive API
106     char *purple_primitive_get_id_from_type(PurpleStatusPrimitive type)
107     char *purple_primitive_get_name_from_type(PurpleStatusPrimitive type)
108     PurpleStatusPrimitive purple_primitive_get_type_from_id(char *id)
109
110     # PurpleStatusType API
111     PurpleStatusType *purple_status_type_new_full( \
112             PurpleStatusPrimitive primitive, char *id, char *name, \
113             glib.gboolean saveable, glib.gboolean user_settable, \
114             glib.gboolean independent)
115     PurpleStatusType *purple_status_type_new(PurpleStatusPrimitive primitive, \
116             char *id, char *name, glib.gboolean user_settable)
117     PurpleStatusType *purple_status_type_new_with_attrs( \
118             PurpleStatusPrimitive primitive,
119             char *id, char *name, glib.gboolean saveable, \
120             glib.gboolean user_settable, glib.gboolean independent, \
121             char *attr_id, char *attr_name, value.PurpleValue *attr_value, ...)
122     void purple_status_type_destroy(PurpleStatusType *status_type)
123     void purple_status_type_set_primary_attr(PurpleStatusType *status_type, \
124             char *attr_id)
125     void purple_status_type_add_attr(PurpleStatusType *status_type, char *id, \
126             char *name, value.PurpleValue *value_)
127     void purple_status_type_add_attrs(PurpleStatusType *status_type, \
128             char *id, char *name, value.PurpleValue *value_, ...)
129     void purple_status_type_add_attrs_vargs(PurpleStatusType *status_type, \
130             va_list args)
131     PurpleStatusPrimitive purple_status_type_get_primitive( \
132             PurpleStatusType *status_type)
133     char *purple_status_type_get_id(PurpleStatusType *status_type)
134     char *purple_status_type_get_name(PurpleStatusType *status_type)
135     glib.gboolean purple_status_type_is_saveable(PurpleStatusType *status_type)
136     glib.gboolean purple_status_type_is_user_settable( \
137             PurpleStatusType *status_type)
138     glib.gboolean purple_status_type_is_independent( \
139             PurpleStatusType *status_type)
140     glib.gboolean purple_status_type_is_exclusive( \
141             PurpleStatusType *status_type)
142     glib.gboolean purple_status_type_is_available( \
143             PurpleStatusType *status_type)
144     char *purple_status_type_get_primary_attr(PurpleStatusType *type)
145     PurpleStatusAttr *purple_status_type_get_attr( \
146             PurpleStatusType *status_type, char *id)
147     glib.GList *purple_status_type_get_attrs(PurpleStatusType *status_type)
148     PurpleStatusType *purple_status_type_find_with_id( \
149             glib.GList *status_types, char *id)
150
151     # PurpleStatusAttr API
152     PurpleStatusAttr *purple_status_attr_new(char *id, char *name, \
153             value.PurpleValue *value_type)
154     void purple_status_attr_destroy(PurpleStatusAttr *attr)
155     char *purple_status_attr_get_id(PurpleStatusAttr *attr)
156     char *purple_status_attr_get_name(PurpleStatusAttr *attr)
157     value.PurpleValue *purple_status_attr_get_value(PurpleStatusAttr *attr)
158
159     # PurpleStatus API
160     PurpleStatus *purple_status_new(PurpleStatusType *status_type, \
161             PurplePresence *presence)
162     void purple_status_destroy(PurpleStatus *status)
163     void purple_status_set_active(PurpleStatus *status, glib.gboolean active)
164     void purple_status_set_active_with_attrs(PurpleStatus *status, \
165             glib.gboolean active, va_list args)
166     void purple_status_set_active_with_attrs_list(PurpleStatus *status, \
167             glib.gboolean active, glib.GList *attrs)
168     void purple_status_set_attr_boolean(PurpleStatus *status, char *id, \
169             glib.gboolean value_)
170     void purple_status_set_attr_int(PurpleStatus *status, char *id, int value_)
171     void purple_status_set_attr_string(PurpleStatus *status, char *id, \
172             char *value_)
173     PurpleStatusType *purple_status_get_type(PurpleStatus *status)
174     PurplePresence *purple_status_get_presence(PurpleStatus *status)
175     char *purple_status_get_id(PurpleStatus *status)
176     char *purple_status_get_name(PurpleStatus *status)
177     glib.gboolean purple_status_is_independent(PurpleStatus *status)
178     glib.gboolean purple_status_is_exclusive(PurpleStatus *status)
179     glib.gboolean purple_status_is_available(PurpleStatus *status)
180     glib.gboolean purple_status_is_active(PurpleStatus *status)
181     glib.gboolean purple_status_is_online(PurpleStatus *status)
182     value.PurpleValue *purple_status_get_attr_value(PurpleStatus *status, \
183             char *id)
184     glib.gboolean purple_status_get_attr_boolean(PurpleStatus *status, \
185             char *id)
186     int purple_status_get_attr_int(PurpleStatus *status, char *id)
187     char *purple_status_get_attr_string(PurpleStatus *status, char *id)
188     glib.gint purple_status_compare(PurpleStatus *status1, \
189             PurpleStatus *status2)
190
191     # PurplePresence API
192     PurplePresence *purple_presence_new(PurplePresenceContext context)
193     PurplePresence *purple_presence_new_for_account( \
194             account.PurpleAccount *account)
195     PurplePresence *purple_presence_new_for_conv( \
196             conversation.PurpleConversation *conv)
197     PurplePresence *purple_presence_new_for_buddy(blist.PurpleBuddy *buddy)
198     void purple_presence_destroy(PurplePresence *presence)
199     void purple_presence_add_status(PurplePresence *presence, \
200             PurpleStatus *status)
201     void purple_presence_add_list(PurplePresence *presence, \
202             glib.GList *source_list)
203     void purple_presence_set_status_active(PurplePresence *presence, \
204             char *status_id, glib.gboolean active)
205     void purple_presence_switch_status(PurplePresence *presence, \
206             char *status_id)
207     void purple_presence_set_idle(PurplePresence *presence, \
208             glib.gboolean idle, time_t idle_time)
209     void purple_presence_set_login_time(PurplePresence *presence, \
210             time_t login_time)
211     PurplePresenceContext purple_presence_get_context(PurplePresence *presence)
212     account.PurpleAccount *purple_presence_get_account( \
213             PurplePresence *presence)
214     conversation.PurpleConversation *purple_presence_get_conversation( \
215             PurplePresence *presence)
216     char *purple_presence_get_chat_user(PurplePresence *presence)
217     blist.PurpleBuddy *purple_presence_get_buddy(PurplePresence *presence)
218     glib.GList *purple_presence_get_statuses(PurplePresence *presence)
219     PurpleStatus *purple_presence_get_status(PurplePresence *presence, \
220             char *status_id)
221     PurpleStatus *purple_presence_get_active_status(PurplePresence *presence)
222     glib.gboolean purple_presence_is_available(PurplePresence *presence)
223     glib.gboolean purple_presence_is_online(PurplePresence *presence)
224     glib.gboolean purple_presence_is_status_active(PurplePresence *presence, \
225             char *status_id)
226     glib.gboolean purple_presence_is_status_primitive_active( \
227             PurplePresence *presence, PurpleStatusPrimitive primitive)
228     glib.gboolean purple_presence_is_idle(PurplePresence *presence)
229     time_t purple_presence_get_idle_time(PurplePresence *presence)
230     time_t purple_presence_get_login_time(PurplePresence *presence)
231     glib.gint purple_presence_compare(PurplePresence *presence1, \
232             PurplePresence *presence2)
233
234     # Status subsystem
235     void *purple_status_get_handle()
236     void purple_status_init()
237     void purple_status_uninit()