annotate libpurple/protocols/msn/table.h @ 31681:3e98b34853ee

Better status message handling in Gadu-Gadu. Fixes #14314
author tomkiewicz@cpw.pidgin.im
date Wed, 22 Jun 2011 22:10:37 +0000
parents 7a0ae0a9d716
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2 * @file table.h MSN helper structure
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3 *
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
4 * purple
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5 *
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
6 * Purple is the legal property of its developers, whose names are too numerous
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
7 * to list here. Please refer to the COPYRIGHT file distributed with this
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
8 * source distribution.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
9 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
10 * This program is free software; you can redistribute it and/or modify
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
11 * it under the terms of the GNU General Public License as published by
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
12 * the Free Software Foundation; either version 2 of the License, or
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
13 * (at your option) any later version.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
14 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
15 * This program is distributed in the hope that it will be useful,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
18 * GNU General Public License for more details.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
19 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
20 * You should have received a copy of the GNU General Public License
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
21 * along with this program; if not, write to the Free Software
19681
44b4e8bd759b The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 15822
diff changeset
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
23 */
28983
462cb893521b Minor header file cleanup. Mostly I wanted to move some enums above some #includes
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
24 #ifndef MSN_TABLE_H
462cb893521b Minor header file cleanup. Mostly I wanted to move some enums above some #includes
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
25 #define MSN_TABLE_H
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
26
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
27 typedef struct _MsnTable MsnTable;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
28
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
29 #include "cmdproc.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
30 #include "transaction.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
31 #include "msg.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
32
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
33 typedef void (*MsnMsgTypeCb)(MsnCmdProc *cmdproc, MsnMessage *msg);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
34
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
35 struct _MsnTable
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
36 {
30720
7a0ae0a9d716 Document MsnTable.
masca@cpw.pidgin.im
parents: 28983
diff changeset
37 GHashTable *cmds; /**< Callbacks that manage command response. */
7a0ae0a9d716 Document MsnTable.
masca@cpw.pidgin.im
parents: 28983
diff changeset
38 GHashTable *msgs; /**< Callbacks that manage incoming messages. */
7a0ae0a9d716 Document MsnTable.
masca@cpw.pidgin.im
parents: 28983
diff changeset
39 GHashTable *errors; /**< Callbacks that manage command errors. */
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
40
30720
7a0ae0a9d716 Document MsnTable.
masca@cpw.pidgin.im
parents: 28983
diff changeset
41 GHashTable *async; /**< Callbacks that manage incoming asyncronous messages. */
7a0ae0a9d716 Document MsnTable.
masca@cpw.pidgin.im
parents: 28983
diff changeset
42 /* TODO: Does this one is really needed? */
7a0ae0a9d716 Document MsnTable.
masca@cpw.pidgin.im
parents: 28983
diff changeset
43 GHashTable *fallback; /**< Fallback callback. */
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
44 };
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
45
30720
7a0ae0a9d716 Document MsnTable.
masca@cpw.pidgin.im
parents: 28983
diff changeset
46 /**
7a0ae0a9d716 Document MsnTable.
masca@cpw.pidgin.im
parents: 28983
diff changeset
47 * Create a new instance of a MsnTable which map commands, errors and messages
7a0ae0a9d716 Document MsnTable.
masca@cpw.pidgin.im
parents: 28983
diff changeset
48 * with callbacks that will handle it.
7a0ae0a9d716 Document MsnTable.
masca@cpw.pidgin.im
parents: 28983
diff changeset
49 *
7a0ae0a9d716 Document MsnTable.
masca@cpw.pidgin.im
parents: 28983
diff changeset
50 * @return A new MsnTable.
7a0ae0a9d716 Document MsnTable.
masca@cpw.pidgin.im
parents: 28983
diff changeset
51 */
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
52 MsnTable *msn_table_new(void);
30720
7a0ae0a9d716 Document MsnTable.
masca@cpw.pidgin.im
parents: 28983
diff changeset
53
7a0ae0a9d716 Document MsnTable.
masca@cpw.pidgin.im
parents: 28983
diff changeset
54 /**
7a0ae0a9d716 Document MsnTable.
masca@cpw.pidgin.im
parents: 28983
diff changeset
55 * Destroy a MsnTable.
7a0ae0a9d716 Document MsnTable.
masca@cpw.pidgin.im
parents: 28983
diff changeset
56 *
7a0ae0a9d716 Document MsnTable.
masca@cpw.pidgin.im
parents: 28983
diff changeset
57 * @param table The MsnTable to be destroyed.
7a0ae0a9d716 Document MsnTable.
masca@cpw.pidgin.im
parents: 28983
diff changeset
58 */
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
59 void msn_table_destroy(MsnTable *table);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
60
30720
7a0ae0a9d716 Document MsnTable.
masca@cpw.pidgin.im
parents: 28983
diff changeset
61 /**
7a0ae0a9d716 Document MsnTable.
masca@cpw.pidgin.im
parents: 28983
diff changeset
62 * Relate an incomming command from server with a callback able to handle
7a0ae0a9d716 Document MsnTable.
masca@cpw.pidgin.im
parents: 28983
diff changeset
63 * the event.
7a0ae0a9d716 Document MsnTable.
masca@cpw.pidgin.im
parents: 28983
diff changeset
64 *
7a0ae0a9d716 Document MsnTable.
masca@cpw.pidgin.im
parents: 28983
diff changeset
65 * @param table The MsnTable.
7a0ae0a9d716 Document MsnTable.
masca@cpw.pidgin.im
parents: 28983
diff changeset
66 * @param command If NULL this add an incoming asyncronous command set in answer.
7a0ae0a9d716 Document MsnTable.
masca@cpw.pidgin.im
parents: 28983
diff changeset
67 * Else, the command sent.
7a0ae0a9d716 Document MsnTable.
masca@cpw.pidgin.im
parents: 28983
diff changeset
68 * @param answer The server answer to 'command'. If 'command' is NULL,
7a0ae0a9d716 Document MsnTable.
masca@cpw.pidgin.im
parents: 28983
diff changeset
69 * the asyncronous command sent by the server.
7a0ae0a9d716 Document MsnTable.
masca@cpw.pidgin.im
parents: 28983
diff changeset
70 * @param cb Callback to handle this event.
7a0ae0a9d716 Document MsnTable.
masca@cpw.pidgin.im
parents: 28983
diff changeset
71 */
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
72 void msn_table_add_cmd(MsnTable *table, char *command, char *answer,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
73 MsnTransCb cb);
30720
7a0ae0a9d716 Document MsnTable.
masca@cpw.pidgin.im
parents: 28983
diff changeset
74
7a0ae0a9d716 Document MsnTable.
masca@cpw.pidgin.im
parents: 28983
diff changeset
75 /**
7a0ae0a9d716 Document MsnTable.
masca@cpw.pidgin.im
parents: 28983
diff changeset
76 * Set a callback to handle incoming command errors.
7a0ae0a9d716 Document MsnTable.
masca@cpw.pidgin.im
parents: 28983
diff changeset
77 *
7a0ae0a9d716 Document MsnTable.
masca@cpw.pidgin.im
parents: 28983
diff changeset
78 * @param table The MsnTable.
7a0ae0a9d716 Document MsnTable.
masca@cpw.pidgin.im
parents: 28983
diff changeset
79 * @param answer Incoming command with error.
7a0ae0a9d716 Document MsnTable.
masca@cpw.pidgin.im
parents: 28983
diff changeset
80 * @param cb Callback to handle this error.
7a0ae0a9d716 Document MsnTable.
masca@cpw.pidgin.im
parents: 28983
diff changeset
81 */
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
82 void msn_table_add_error(MsnTable *table, char *answer, MsnErrorCb cb);
30720
7a0ae0a9d716 Document MsnTable.
masca@cpw.pidgin.im
parents: 28983
diff changeset
83
7a0ae0a9d716 Document MsnTable.
masca@cpw.pidgin.im
parents: 28983
diff changeset
84 /**
7a0ae0a9d716 Document MsnTable.
masca@cpw.pidgin.im
parents: 28983
diff changeset
85 * Relate a message Content-type with a callback able to handle it.
7a0ae0a9d716 Document MsnTable.
masca@cpw.pidgin.im
parents: 28983
diff changeset
86 *
7a0ae0a9d716 Document MsnTable.
masca@cpw.pidgin.im
parents: 28983
diff changeset
87 * @param table The MsnTable.
7a0ae0a9d716 Document MsnTable.
masca@cpw.pidgin.im
parents: 28983
diff changeset
88 * @param type The Message Content-Type.
7a0ae0a9d716 Document MsnTable.
masca@cpw.pidgin.im
parents: 28983
diff changeset
89 * @param cb Callback to handle this Content-type.
7a0ae0a9d716 Document MsnTable.
masca@cpw.pidgin.im
parents: 28983
diff changeset
90 */
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
91 void msn_table_add_msg_type(MsnTable *table, char *type, MsnMsgTypeCb cb);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
92
28983
462cb893521b Minor header file cleanup. Mostly I wanted to move some enums above some #includes
Mark Doliner <mark@kingant.net>
parents: 19681
diff changeset
93 #endif /* MSN_TABLE_H */