libpurple/protocols/msn/table.h

Wed, 15 Dec 2010 22:04:08 +0000

author
Elliott Sales de Andrade <qulogic@pidgin.im>
date
Wed, 15 Dec 2010 22:04:08 +0000
changeset 31237
9c2341bd9199
parent 30919
9a43c599f25d
permissions
-rw-r--r--

Fix typo

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

mercurial