Mercurial > pidgin.yaz
comparison libgaim/protocols/novell/nmrequest.h @ 14192:60b1bc8dbf37
[gaim-migrate @ 16863]
Renamed 'core' to 'libgaim'
committer: Tailor Script <tailor@pidgin.im>
author | Evan Schoenberg <evan.s@dreskin.net> |
---|---|
date | Sat, 19 Aug 2006 01:50:10 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
14191:009db0b357b5 | 14192:60b1bc8dbf37 |
---|---|
1 /* | |
2 * nmrequest.h | |
3 * | |
4 * Copyright (c) 2004 Novell, Inc. All Rights Reserved. | |
5 * | |
6 * This program 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; version 2 of the License. | |
9 * | |
10 * This program is distributed in the hope that it will be useful, | |
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 * GNU General Public License for more details. | |
14 * | |
15 * You should have received a copy of the GNU General Public License | |
16 * along with this program; if not, write to the Free Software | |
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
18 * | |
19 */ | |
20 | |
21 #ifndef __NM_REQUEST_H__ | |
22 #define __NM_REQUEST_H__ | |
23 | |
24 typedef struct _NMRequest NMRequest; | |
25 | |
26 #include "nmuser.h" | |
27 | |
28 /** | |
29 * Create a new request object. Object must be release with nm_release_object. | |
30 * | |
31 * @param cmd The request command string (e.g. "login") | |
32 * @param trans_id The request transaction id | |
33 * @param gmt The time in seconds that the request was created | |
34 * | |
35 * @return The new request object | |
36 */ | |
37 NMRequest *nm_create_request(const char *cmd, int trans_id, int gmt, nm_response_cb cb, | |
38 gpointer resp_data, gpointer user_define); | |
39 | |
40 /** | |
41 * Release a request object. | |
42 * | |
43 * @param req The request to release | |
44 */ | |
45 void nm_release_request(NMRequest * req); | |
46 | |
47 /** | |
48 * Add a new reference to this object. This reference must be released by | |
49 * a call to nm_release_object. | |
50 * | |
51 * @param req The request object | |
52 */ | |
53 void nm_request_add_ref(NMRequest * req); | |
54 | |
55 /** | |
56 * Set the response callback for this request object. This is the callback | |
57 * that will be made when we get a response from the server. | |
58 * | |
59 * @param req The request object | |
60 * @param callback The response callback | |
61 * | |
62 */ | |
63 void nm_request_set_callback(NMRequest * req, nm_response_cb callback); | |
64 | |
65 /** | |
66 * Set the response data. This will be set differently depending on | |
67 * the request type (for example to nm_send_get_details will set this | |
68 * to be the newly create NMUserRecord object). | |
69 * | |
70 * @param req The request object | |
71 * @param data Pointer to some data | |
72 * | |
73 */ | |
74 void nm_request_set_data(NMRequest * req, gpointer data); | |
75 | |
76 /** | |
77 * Set the user defined data. This is the data that the client | |
78 * passes to the various nm_send_* functions. We will pass it | |
79 * back when we make the callback. | |
80 * | |
81 * @param req The request object | |
82 * @param user_define Pointer to some data | |
83 * | |
84 */ | |
85 void nm_request_set_user_define(NMRequest * req, gpointer user_define); | |
86 | |
87 /** | |
88 * Set the return code. This is the return code that we received in | |
89 * the server response fields. | |
90 * | |
91 * @param req The request object | |
92 * @param rc The return code to set | |
93 */ | |
94 void nm_request_set_ret_code(NMRequest * req, NMERR_T rc); | |
95 | |
96 /** | |
97 * Get the transaction id for this request. | |
98 * | |
99 * @param req The request object | |
100 * | |
101 * @return The transaction id. | |
102 */ | |
103 int nm_request_get_trans_id(NMRequest * req); | |
104 | |
105 /** | |
106 * Get the command (request type) for this request. | |
107 * | |
108 * @param req The request object | |
109 * | |
110 * @return The request cmd | |
111 */ | |
112 const char *nm_request_get_cmd(NMRequest * req); | |
113 | |
114 /** | |
115 * Get the response data for this request | |
116 * | |
117 * @param req The request object | |
118 * | |
119 * @return The response data | |
120 */ | |
121 gpointer nm_request_get_data(NMRequest * req); | |
122 | |
123 /** | |
124 * Get the user defined data for this request | |
125 * | |
126 * @param req The request object | |
127 * | |
128 * @return The user defined data | |
129 */ | |
130 gpointer nm_request_get_user_define(NMRequest * req); | |
131 | |
132 /** | |
133 * Get the response callback for this request | |
134 * | |
135 * @param req The request object | |
136 * | |
137 * @return The response callback | |
138 */ | |
139 nm_response_cb nm_request_get_callback(NMRequest * req); | |
140 | |
141 /** | |
142 * Get the return code | |
143 * | |
144 * @param req The request object | |
145 * | |
146 * @return The return code (from the response fields) | |
147 */ | |
148 NMERR_T nm_request_get_ret_code(NMRequest * req); | |
149 | |
150 #endif |