Added privacy.pxd definition.
[python-purple] / libpurple / conversation.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 connection
24 cimport buddyicon
25
26 cdef extern from "time.h":
27     ctypedef long int time_t
28
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
36
37     ctypedef enum PurpleConversationType:
38         PURPLE_CONV_TYPE_UNKNOWN = 0
39         PURPLE_CONV_TYPE_IM
40         PURPLE_CONV_TYPE_CHAT
41         PURPLE_CONV_TYPE_MISC
42         PURPLE_CONV_TYPE_ANY
43
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
59
60     ctypedef enum PurpleTypingState:
61         PURPLE_NOT_TYPING = 0
62         PURPLE_TYPING
63         PURPLE_TYPED
64
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
81
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
89
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)
106
107     ctypedef struct PurpleConvIm:
108         PurpleConversation *conv
109         PurpleTypingState typing_state
110         glib.guint typing_timeout
111         time_t type_again
112         glib.guint send_typed_timeout
113         buddyicon.PurpleBuddyIcon *icon
114
115     ctypedef struct PurpleConvChat:
116         PurpleConversation *conv
117         glib.GList *in_room
118         glib.GList *ignored
119         char *who
120         char *topic
121         int id
122         char *nick
123         glib.gboolean left
124
125     ctypedef struct PurpleConvChatBuddy:
126         char *name
127         char *alias
128         char *alias_key
129         glib.gboolean buddy
130         PurpleConvChatBuddyFlags flags
131
132     ctypedef struct PurpleConvMessage:
133         char *who
134         char *what
135         PurpleMessageFlags flags
136         time_t when
137         PurpleConversation *conv
138         char *alias
139
140     ctypedef union UnionType:
141         PurpleConvIm *im
142         PurpleConvChat *chat
143         void *misc
144
145     ctypedef struct PurpleConversation:
146         PurpleConversationType type
147         account.PurpleAccount *account
148         char *name
149         char *title
150         glib.gboolean logging
151         glib.GList *logs
152         UnionType u
153         PurpleConversationUiOps *ui_ops
154         void *ui_data
155         glib.GHashTable *data
156         connection.PurpleConnectionFlags features
157         glib.GList *message_history
158
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     void c_purple_conv_im_send "purple_conv_im_send" (PurpleConvIm *im, char *message)
166     void c_purple_conversation_destroy "purple_conversation_destroy" (PurpleConversation *conv)