Mercurial > pidgin.yaz
comparison src/protocols/novell/nmrequest.h @ 8675:9ee2542d1104
[gaim-migrate @ 9428]
A GroupWise plugin from Novell.
committer: Tailor Script <tailor@pidgin.im>
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Sat, 17 Apr 2004 13:55:28 +0000 |
parents | |
children | 046dd8ef2920 |
comparison
equal
deleted
inserted
replaced
8674:8c7da2e36136 | 8675:9ee2542d1104 |
---|---|
1 /* | |
2 * nmrequest.h | |
3 * | |
4 * Copyright © 2004 Unpublished Work of Novell, Inc. All Rights Reserved. | |
5 * | |
6 * THIS WORK IS AN UNPUBLISHED WORK OF NOVELL, INC. NO PART OF THIS WORK MAY BE | |
7 * USED, PRACTICED, PERFORMED, COPIED, DISTRIBUTED, REVISED, MODIFIED, | |
8 * TRANSLATED, ABRIDGED, CONDENSED, EXPANDED, COLLECTED, COMPILED, LINKED, | |
9 * RECAST, TRANSFORMED OR ADAPTED WITHOUT THE PRIOR WRITTEN CONSENT OF NOVELL, | |
10 * INC. ANY USE OR EXPLOITATION OF THIS WORK WITHOUT AUTHORIZATION COULD SUBJECT | |
11 * THE PERPETRATOR TO CRIMINAL AND CIVIL LIABILITY. | |
12 * | |
13 * AS BETWEEN [GAIM] AND NOVELL, NOVELL GRANTS [GAIM] THE RIGHT TO REPUBLISH | |
14 * THIS WORK UNDER THE GPL (GNU GENERAL PUBLIC LICENSE) WITH ALL RIGHTS AND | |
15 * LICENSES THEREUNDER. IF YOU HAVE RECEIVED THIS WORK DIRECTLY OR INDIRECTLY | |
16 * FROM [GAIM] AS PART OF SUCH A REPUBLICATION, YOU HAVE ALL RIGHTS AND LICENSES | |
17 * GRANTED BY [GAIM] UNDER THE GPL. IN CONNECTION WITH SUCH A REPUBLICATION, IF | |
18 * ANYTHING IN THIS NOTICE CONFLICTS WITH THE TERMS OF THE GPL, SUCH TERMS | |
19 * PREVAIL. | |
20 * | |
21 */ | |
22 | |
23 #ifndef __NM_REQUEST_H__ | |
24 #define __NM_REQUEST_H__ | |
25 | |
26 typedef struct _NMRequest NMRequest; | |
27 | |
28 #include "nmuser.h" | |
29 | |
30 /** | |
31 * Create a new request object. Object must be release with nm_release_object. | |
32 * | |
33 * @param cmd The request command string (e.g. "login") | |
34 * @param trans_id The request transaction id | |
35 * @param gmt The time in seconds that the request was created | |
36 * | |
37 * @return The new request object | |
38 */ | |
39 NMRequest *nm_create_request(const char *cmd, int trans_id, int gmt); | |
40 | |
41 /** | |
42 * Release a request object. | |
43 * | |
44 * @param req The request to release | |
45 */ | |
46 void nm_release_request(NMRequest * req); | |
47 | |
48 /** | |
49 * Add a new reference to this object. This reference must be released by | |
50 * a call to nm_release_object. | |
51 * | |
52 * @param req The request object | |
53 */ | |
54 void nm_request_add_ref(NMRequest * req); | |
55 | |
56 /** | |
57 * Set the response callback for this request object. This is the callback | |
58 * that will be made when we get a response from the server. | |
59 * | |
60 * @param req The request object | |
61 * @param callback The response callback | |
62 * | |
63 */ | |
64 void nm_request_set_callback(NMRequest * req, nm_response_cb callback); | |
65 | |
66 /** | |
67 * Set the response data. This will be set differently depending on | |
68 * the request type (for example to nm_send_get_details will set this | |
69 * to be the newly create NMUserRecord object). | |
70 * | |
71 * @param req The request object | |
72 * @param data Pointer to some data | |
73 * | |
74 */ | |
75 void nm_request_set_data(NMRequest * req, gpointer data); | |
76 | |
77 /** | |
78 * Set the user defined data. This is the data that the client | |
79 * passes to the various nm_send_* functions. We will pass it | |
80 * back when we make the callback. | |
81 * | |
82 * @param req The request object | |
83 * @param user_define Pointer to some data | |
84 * | |
85 */ | |
86 void nm_request_set_user_define(NMRequest * req, gpointer user_define); | |
87 | |
88 /** | |
89 * Set the return code. This is the return code that we recieved in | |
90 * the server response fields. | |
91 * | |
92 * @param req The request object | |
93 * @param rc The return code to set | |
94 */ | |
95 void nm_request_set_ret_code(NMRequest * req, NMERR_T rc); | |
96 | |
97 /** | |
98 * Get the transaction id for this request. | |
99 * | |
100 * @param req The request object | |
101 * | |
102 * @return The transaction id. | |
103 */ | |
104 int nm_request_get_trans_id(NMRequest * req); | |
105 | |
106 /** | |
107 * Get the command (request type) for this request. | |
108 * | |
109 * @param req The request object | |
110 * | |
111 * @return The request cmd | |
112 */ | |
113 const char *nm_request_get_cmd(NMRequest * req); | |
114 | |
115 /** | |
116 * Get the response data for this request | |
117 * | |
118 * @param req The request object | |
119 * | |
120 * @return The response data | |
121 */ | |
122 gpointer nm_request_get_data(NMRequest * req); | |
123 | |
124 /** | |
125 * Get the user defined data for this request | |
126 * | |
127 * @param req The request object | |
128 * | |
129 * @return The user defined data | |
130 */ | |
131 gpointer nm_request_get_user_define(NMRequest * req); | |
132 | |
133 /** | |
134 * Get the response callback for this request | |
135 * | |
136 * @param req The request object | |
137 * | |
138 * @return The response callback | |
139 */ | |
140 nm_response_cb nm_request_get_callback(NMRequest * req); | |
141 | |
142 /** | |
143 * Get the return code | |
144 * | |
145 * @param req The request object | |
146 * | |
147 * @return The return code (from the response fields) | |
148 */ | |
149 NMERR_T nm_request_get_ret_code(NMRequest * req); | |
150 | |
151 #endif |