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/>.
26 cdef extern from "time.h":
27 ctypedef long int time_t
29 cdef extern from "libpurple/conversation.h":
30 ctypedef struct PurpleConversationUiOps
31 ctypedef struct PurpleConversation
32 ctypedef struct PurpleConvIm
33 ctypedef struct PurpleConvChat
34 ctypedef struct PurpleConvChatBuddy
35 ctypedef struct PurpleConvMessage
37 ctypedef enum PurpleConversationType:
38 PURPLE_CONV_TYPE_UNKNOWN = 0
44 ctypedef enum PurpleConvUpdateType:
45 PURPLE_CONV_UPDATE_ADD = 0
46 PURPLE_CONV_UPDATE_REMOVE
47 PURPLE_CONV_UPDATE_ACCOUNT
48 PURPLE_CONV_UPDATE_TYPING
49 PURPLE_CONV_UPDATE_UNSEEN
50 PURPLE_CONV_UPDATE_LOGGING
51 PURPLE_CONV_UPDATE_TOPIC
52 PURPLE_CONV_ACCOUNT_ONLINE
53 PURPLE_CONV_ACCOUNT_OFFLINE
54 PURPLE_CONV_UPDATE_AWAY
55 PURPLE_CONV_UPDATE_ICON
56 PURPLE_CONV_UPDATE_TITLE
57 PURPLE_CONV_UPDATE_CHATLEFT
58 PURPLE_CONV_UPDATE_FEATURES
60 ctypedef enum PurpleTypingState:
65 ctypedef enum PurpleMessageFlags:
66 PURPLE_MESSAGE_SEND = 0x0001
67 PURPLE_MESSAGE_RECV = 0x0002
68 PURPLE_MESSAGE_SYSTEM = 0x0004
69 PURPLE_MESSAGE_AUTO_RESP = 0x0008
70 PURPLE_MESSAGE_ACTIVE_ONLY = 0x0010
71 PURPLE_MESSAGE_NICK = 0x0020
72 PURPLE_MESSAGE_NO_LOG = 0x0040
73 PURPLE_MESSAGE_WHISPER = 0x0080
74 PURPLE_MESSAGE_ERROR = 0x0200
75 PURPLE_MESSAGE_DELAYED = 0x0400
76 PURPLE_MESSAGE_RAW = 0x0800
77 PURPLE_MESSAGE_IMAGES = 0x1000
78 PURPLE_MESSAGE_NOTIFY = 0x2000
79 PURPLE_MESSAGE_NO_LINKIFY = 0x4000
80 PURPLE_MESSAGE_INVISIBLE = 0x8000
82 ctypedef enum PurpleConvChatBuddyFlags:
83 PURPLE_CBFLAGS_NONE = 0x0000
84 PURPLE_CBFLAGS_VOICE = 0x0001
85 PURPLE_CBFLAGS_HALFOP = 0x0002
86 PURPLE_CBFLAGS_OP = 0x0004
87 PURPLE_CBFLAGS_FOUNDER = 0x0008
88 PURPLE_CBFLAGS_TYPING = 0x0010
90 ctypedef struct PurpleConversationUiOps:
91 void (*create_conversation) (PurpleConversation *conv)
92 void (*destroy_conversation) (PurpleConversation *conv)
93 void (*write_chat) (PurpleConversation *conv, char *who, char *message, PurpleMessageFlags flags, time_t mtime)
94 void (*write_im) (PurpleConversation *conv, char *who, char *message, PurpleMessageFlags flags, time_t mtime)
95 void (*write_conv) (PurpleConversation *conv, char *name, char *alias, char *message, PurpleMessageFlags flags, time_t mtime)
96 void (*chat_add_users) (PurpleConversation *conv, glib.GList *cbuddies, glib.gboolean new_arrivals)
97 void (*chat_rename_user) (PurpleConversation *conv, char *old_name, char *new_name, char *new_alias)
98 void (*chat_remove_users) (PurpleConversation *conv, glib.GList *users)
99 void (*chat_update_user) (PurpleConversation *conv, char *user)
100 void (*present) (PurpleConversation *conv)
101 glib.gboolean (*has_focus) (PurpleConversation *conv)
102 glib.gboolean (*custom_smiley_add) (PurpleConversation *conv, char *smile, glib.gboolean remote)
103 void (*custom_smiley_write) (PurpleConversation *conv, char *smile, glib.guchar *data, glib.gsize size)
104 void (*custom_smiley_close) (PurpleConversation *conv, char *smile)
105 void (*send_confirm) (PurpleConversation *conv, char *message)
107 ctypedef struct PurpleConvIm:
108 PurpleConversation *conv
109 PurpleTypingState typing_state
110 glib.guint typing_timeout
112 glib.guint send_typed_timeout
113 buddyicon.PurpleBuddyIcon *icon
115 ctypedef struct PurpleConvChat:
116 PurpleConversation *conv
125 ctypedef struct PurpleConvChatBuddy:
130 PurpleConvChatBuddyFlags flags
132 ctypedef struct PurpleConvMessage:
135 PurpleMessageFlags flags
137 PurpleConversation *conv
140 ctypedef union UnionType:
145 ctypedef struct PurpleConversation:
146 PurpleConversationType type
147 account.PurpleAccount *account
150 glib.gboolean logging
153 PurpleConversationUiOps *ui_ops
155 glib.GHashTable *data
156 connection.PurpleConnectionFlags features
157 glib.GList *message_history
159 void c_purple_conversations_init "purple_conversations_init" ()
160 void *c_purple_conversations_get_handle "purple_conversations_get_handle" ()
161 PurpleConversation *c_purple_conversation_new "purple_conversation_new" (int type, account.PurpleAccount *account, char *name)
162 void c_purple_conversation_set_ui_ops "purple_conversation_set_ui_ops" (PurpleConversation *conv, PurpleConversationUiOps *ops)
163 void c_purple_conversations_set_ui_ops "purple_conversations_set_ui_ops" (PurpleConversationUiOps *ops)
164 PurpleConvIm *c_purple_conversation_get_im_data "purple_conversation_get_im_data" (PurpleConversation *conv)
165 char *c_purple_conversation_get_name "purple_conversation_get_name" (PurpleConversation *conv)
166 account.PurpleAccount *c_purple_conversation_get_account "purple_conversation_get_account" (PurpleConversation *conv)
167 void c_purple_conv_im_send "purple_conv_im_send" (PurpleConvIm *im, char *message)
168 void c_purple_conversation_destroy "purple_conversation_destroy" (PurpleConversation *conv)