67cf1755029f8d63bbd4a76ea82ecc0c30d6491e
[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 char const_char "const char"
29     ctypedef long int time_t
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         const_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     glib.gboolean purple_presence_is_online(PurplePresence *presence)