mark PurpleImageClass as private
[pidgin-git.git] / libpurple / protocols / novell / nmrequest.h
blob3bf989febb9b427ca722baab7020571b8a6c579d
1 /*
2 * nmrequest.h
4 * Copyright (c) 2004 Novell, Inc. All Rights Reserved.
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.
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.
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., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
21 #ifndef PURPLE_NOVELL_NMREQUEST_H
22 #define PURPLE_NOVELL_NMREQUEST_H
24 typedef struct _NMRequest NMRequest;
26 #include "nmuser.h"
28 /**
29 * Create a new request object. Object must be release with nm_release_object.
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
35 * @return The new request object
37 NMRequest *nm_create_request(const char *cmd, int trans_id, int gmt, nm_response_cb cb,
38 gpointer resp_data, gpointer user_define);
40 /**
41 * Release a request object.
43 * @param req The request to release
45 void nm_release_request(NMRequest * req);
47 /**
48 * Add a new reference to this object. This reference must be released by
49 * a call to nm_release_object.
51 * @param req The request object
53 void nm_request_add_ref(NMRequest * req);
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.
59 * @param req The request object
60 * @param callback The response callback
63 void nm_request_set_callback(NMRequest * req, nm_response_cb callback);
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).
70 * @param req The request object
71 * @param data Pointer to some data
74 void nm_request_set_data(NMRequest * req, gpointer data);
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.
81 * @param req The request object
82 * @param user_define Pointer to some data
85 void nm_request_set_user_define(NMRequest * req, gpointer user_define);
87 /**
88 * Set the return code. This is the return code that we received in
89 * the server response fields.
91 * @param req The request object
92 * @param rc The return code to set
94 void nm_request_set_ret_code(NMRequest * req, NMERR_T rc);
96 /**
97 * Get the transaction id for this request.
99 * @param req The request object
101 * @return The transaction id.
103 int nm_request_get_trans_id(NMRequest * req);
106 * Get the command (request type) for this request.
108 * @param req The request object
110 * @return The request cmd
112 const char *nm_request_get_cmd(NMRequest * req);
115 * Get the response data for this request
117 * @param req The request object
119 * @return The response data
121 gpointer nm_request_get_data(NMRequest * req);
124 * Get the user defined data for this request
126 * @param req The request object
128 * @return The user defined data
130 gpointer nm_request_get_user_define(NMRequest * req);
133 * Get the response callback for this request
135 * @param req The request object
137 * @return The response callback
139 nm_response_cb nm_request_get_callback(NMRequest * req);
142 * Get the return code
144 * @param req The request object
146 * @return The return code (from the response fields)
148 NMERR_T nm_request_get_ret_code(NMRequest * req);
150 #endif /* PURPLE_NOVELL_NMREQUEST_H */