Cosmetics.
[python-purple] / conversation_cbs.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 purple
21
22 cdef extern from *:
23     ctypedef char const_char "const char"
24     ctypedef glib.guchar const_guchar "const guchar"
25
26 cdef extern from "time.h":
27     ctypedef long int time_t
28
29 conversations_cbs = {}
30
31 cdef void create_conversation (conversation.PurpleConversation *conv):
32     debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "conversation", "create_conversation\n")
33     global conversations_cbs
34     try:
35         (<object>conversations_cbs["create_conversation"])("create_conversation")
36     except KeyError:
37         pass
38
39 cdef void destroy_conversation (conversation.PurpleConversation *conv):
40     debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "conversation", "destroy_conversation\n")
41     global conversations_cbs
42     try:
43         (<object>conversations_cbs["destroy_conversation"])("destroy_conversation")
44     except KeyError:
45         pass
46
47 cdef void write_chat (conversation.PurpleConversation *conv, const_char *who,
48                       const_char *message, conversation.PurpleMessageFlags flags,
49                       time_t mtime):
50     debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "conversation", "write_chat\n")
51     global conversations_cbs
52     try:
53         (<object>conversations_cbs["write_chat"])("write_chat")
54     except KeyError:
55         pass
56
57 cdef void write_im (conversation.PurpleConversation *conv, const_char *who,
58                     const_char *message, conversation.PurpleMessageFlags flags,
59                     time_t mtime):
60     debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "conversation", "write_im\n")
61     global conversations_cbs
62     try:
63         (<object>conversations_cbs["write_im"])("write_im")
64     except KeyError:
65         pass
66
67 cdef void write_conv (conversation.PurpleConversation *conv, const_char *name,
68                       const_char *alias, const_char *message,
69                       conversation.PurpleMessageFlags flags, time_t mtime):
70     debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "conversation", "write_conv\n")
71     global conversations_cbs
72     try:
73         (<object>conversations_cbs["write_conv"])("write_conv")
74     except KeyError:
75         pass
76
77 cdef void chat_add_users (conversation.PurpleConversation *conv,
78                           glib.GList *cbuddies, glib.gboolean new_arrivals):
79     debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "conversation", "chat_add_users\n")
80     global conversations_cbs
81     try:
82         (<object>conversations_cbs["chat_add_users"])("chat_add_users")
83     except KeyError:
84         pass
85
86 cdef void chat_rename_user (conversation.PurpleConversation *conv,
87                             const_char *old_name, const_char *new_name,
88                             const_char *new_alias):
89     debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "conversation", "chat_rename_user\n")
90     global conversations_cbs
91     try:
92         (<object>conversations_cbs["chat_rename_user"])("chat_rename_user")
93     except KeyError:
94         pass
95
96 cdef void chat_remove_users (conversation.PurpleConversation *conv,
97                              glib.GList *users):
98     debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "conversation", "chat_remove_users\n")
99     global conversations_cbs
100     try:
101         (<object>conversations_cbs["chat_remove_users"])("chat_remove_users")
102     except KeyError:
103         pass
104
105 cdef void chat_update_user (conversation.PurpleConversation *conv, const_char *user):
106     debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "conversation", "chat_update_user\n")
107     global conversations_cbs
108     try:
109         (<object>conversations_cbs["chat_update_user"])("chat_update_user")
110     except KeyError:
111         pass
112
113 cdef void present (conversation.PurpleConversation *conv):
114     debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "conversation", "present\n")
115     global conversations_cbs
116     try:
117         (<object>conversations_cbs["present"])("present")
118     except KeyError:
119         pass
120
121 cdef glib.gboolean has_focus (conversation.PurpleConversation *conv):
122     debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "conversation", "has_focus\n")
123     global conversations_cbs
124     try:
125         (<object>conversations_cbs["has_focus"])("has_focus")
126         return False
127     except KeyError:
128         return False
129
130 cdef glib.gboolean custom_smiley_add (conversation.PurpleConversation *conv,
131                                       const_char *smile, glib.gboolean remote):
132     debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "conversation", "custom_smiley_add\n")
133     global conversations_cbs
134     try:
135         (<object>conversations_cbs["custom_smiley_add"])("custom_smiley_add")
136         return False
137     except KeyError:
138         return False
139
140 cdef void custom_smiley_write (conversation.PurpleConversation *conv,
141                                const_char *smile, const_guchar *data,
142                                glib.gsize size):
143     debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "conversation", "custom_smiley_write\n")
144     try:
145         (<object>conversations_cbs["custom_smiley_write"])("custom_smiley_write")
146     except KeyError:
147         pass
148
149
150 cdef void custom_smiley_close (conversation.PurpleConversation *conv,
151                                const_char *smile):
152     debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "conversation", "custom_smiley_close\n")
153     try:
154         (<object>conversations_cbs["custom_smiley_close"])("custom_smiley_close")
155     except KeyError:
156         pass
157
158 cdef void send_confirm (conversation.PurpleConversation *conv, const_char *message):
159     debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "conversation", "send_confirm\n")
160     try:
161         (<object>conversations_cbs["send_confirm"])("send_confirm")
162     except KeyError:
163         pass