2 # Copyright (c) 2008 INdT - Instituto Nokia de Tecnologia
4 # This file is part of python-purple.
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.
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.
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/>.
20 cdef extern from "libpurple/conversation.h":
21 ctypedef struct PurpleConversation:
24 ctypedef struct PurpleConvIm:
27 ctypedef enum PurpleMessageFlags:
28 PURPLE_MESSAGE_SEND = 0x0001
29 PURPLE_MESSAGE_RECV = 0x0002
30 PURPLE_MESSAGE_SYSTEM = 0x0004
31 PURPLE_MESSAGE_AUTO_RESP = 0x0008
32 PURPLE_MESSAGE_ACTIVE_ONLY = 0x0010
33 PURPLE_MESSAGE_NICK = 0x0020
34 PURPLE_MESSAGE_NO_LOG = 0x0040
35 PURPLE_MESSAGE_WHISPER = 0x0080
36 PURPLE_MESSAGE_ERROR = 0x0200
37 PURPLE_MESSAGE_DELAYED = 0x0400
38 PURPLE_MESSAGE_RAW = 0x0800
39 PURPLE_MESSAGE_IMAGES = 0x1000
40 PURPLE_MESSAGE_NOTIFY = 0x2000
41 PURPLE_MESSAGE_NO_LINKIFY = 0x4000
42 PURPLE_MESSAGE_INVISIBLE = 0x8000
44 ctypedef struct PurpleConversationUiOps:
45 void (*create_conversation) (PurpleConversation *conv)
46 void (*destroy_conversation) (PurpleConversation *conv)
47 void (*write_chat) (PurpleConversation *conv, const_char_ptr who, const_char_ptr message, PurpleMessageFlags flags, time_t mtime)
48 void (*write_im) (PurpleConversation *conv, const_char_ptr who, const_char_ptr message, PurpleMessageFlags flags, time_t mtime)
49 void (*write_conv) (PurpleConversation *conv, const_char_ptr name, const_char_ptr alias, const_char_ptr message, PurpleMessageFlags flags, time_t mtime)
50 void (*chat_add_users) (PurpleConversation *conv, GList *cbuddies, gboolean new_arrivals)
51 void (*chat_rename_user) (PurpleConversation *conv, const_char_ptr old_name, const_char_ptr new_name, const_char_ptr new_alias)
52 void (*chat_remove_users) (PurpleConversation *conv, GList *users)
53 void (*chat_update_user) (PurpleConversation *conv, const_char_ptr user)
54 void (*present) (PurpleConversation *conv)
55 gboolean (*has_focus) (PurpleConversation *conv)
56 gboolean (*custom_smiley_add) (PurpleConversation *conv, const_char_ptr smile, gboolean remote)
57 void (*custom_smiley_write) (PurpleConversation *conv, const_char_ptr smile, const_guchar_ptr data, gsize size)
58 void (*custom_smiley_close) (PurpleConversation *conv, const_char_ptr smile)
59 void (*send_confirm) (PurpleConversation *conv, const_char_ptr message)
61 void c_purple_conversations_init "purple_conversations_init" ()
62 void *c_purple_conversations_get_handle "purple_conversations_get_handle" ()
63 PurpleConversation *c_purple_conversation_new "purple_conversation_new" (int type, PurpleAccount *account, const_char_ptr name)
64 void c_purple_conversation_set_ui_ops "purple_conversation_set_ui_ops" (PurpleConversation *conv, PurpleConversationUiOps *ops)
65 PurpleConvIm *c_purple_conversation_get_im_data "purple_conversation_get_im_data" (PurpleConversation *conv)
66 void c_purple_conv_im_send "purple_conv_im_send" (PurpleConvIm *im, const_char_ptr message)
67 void c_purple_conversation_destroy "purple_conversation_destroy" (PurpleConversation *conv)