Mercurial > pidgin
comparison src/account.h @ 5563:9eb5b13fd412
[gaim-migrate @ 5965]
Just a taste of what's coming.
Standard "This won't compile" thing. Plugin authors, you're going to hate
me, but that's okay, because I have friends too!
It's really late. My brain resembles that of fish swimming in jello pudding
with neon lights flying around chanting musicals. I'm not on drugs. I'm
just that tired.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Fri, 30 May 2003 09:38:29 +0000 |
parents | |
children | 187c740f2a4e |
comparison
equal
deleted
inserted
replaced
5562:3c8d34574601 | 5563:9eb5b13fd412 |
---|---|
1 /** | |
2 * @file account.h Account API | |
3 * @ingroup core | |
4 * | |
5 * gaim | |
6 * | |
7 * Copyright (C) 2003 Christian Hammond <chipx86@gnupdate.org> | |
8 * | |
9 * This program is free software; you can redistribute it and/or modify | |
10 * it under the terms of the GNU General Public License as published by | |
11 * the Free Software Foundation; either version 2 of the License, or | |
12 * (at your option) any later version. | |
13 * | |
14 * This program is distributed in the hope that it will be useful, | |
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 * GNU General Public License for more details. | |
18 * | |
19 * You should have received a copy of the GNU General Public License | |
20 * along with this program; if not, write to the Free Software | |
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
22 */ | |
23 #ifndef _GAIM_ACCOUNTS_H_ | |
24 #define _GAIM_ACCOUNTS_H_ | |
25 | |
26 typedef struct _GaimAccount GaimAccount; | |
27 | |
28 #include "connection.h" | |
29 #include "prpl.h" | |
30 | |
31 struct _GaimAccount | |
32 { | |
33 char *username; /**< The username. */ | |
34 char *alias; /**< The current alias. */ | |
35 char *password; /**< The account password. */ | |
36 char *user_info; /**< User information. */ | |
37 | |
38 char *buddy_icon; /**< The buddy icon. */ | |
39 | |
40 gboolean remember_pass; /**< Remember the password. */ | |
41 | |
42 GaimProtocol protocol; /**< The account protocol. */ | |
43 | |
44 GaimConnection *gc; /**< The connection handle. */ | |
45 | |
46 GHashTable *settings; /**< Protocol-specific settings. */ | |
47 | |
48 struct gaim_proxy_info *gpi; /**< Proxy information. */ | |
49 | |
50 GSList *permit; /**< Permit list. */ | |
51 GSList *deny; /**< Deny list. */ | |
52 int perm_deny; /**< The permit/deny setting. */ | |
53 }; | |
54 | |
55 /** | |
56 * Creates a new account. | |
57 * | |
58 * @param username The username. | |
59 * @param protocol The protocol. | |
60 */ | |
61 GaimAccount *gaim_account_new(const char *username, GaimProtocol protocol); | |
62 | |
63 /** | |
64 * Destroys an account. | |
65 * | |
66 * @param account The account to destroy. | |
67 */ | |
68 void gaim_account_destroy(GaimAccount *account); | |
69 | |
70 /** | |
71 * Connects to an account. | |
72 * | |
73 * @param account The account to connect to. | |
74 * | |
75 * @return The gaim connection. | |
76 */ | |
77 GaimConnection *gaim_account_connect(GaimAccount *account); | |
78 | |
79 /** | |
80 * Disconnects from an account. | |
81 * | |
82 * @param account The account to disconnect from. | |
83 * | |
84 * @return The gaim connection. | |
85 */ | |
86 void gaim_account_disconnect(GaimAccount *account); | |
87 | |
88 /** | |
89 * Sets the account's username. | |
90 * | |
91 * @param account The account. | |
92 * @param username The username. | |
93 */ | |
94 void gaim_account_set_username(GaimAccount *account, const char *username); | |
95 | |
96 /** | |
97 * Sets the account's password. | |
98 * | |
99 * @param account The account. | |
100 * @param password The password. | |
101 */ | |
102 void gaim_account_set_password(GaimAccount *account, const char *password); | |
103 | |
104 /** | |
105 * Sets the account's alias. | |
106 * | |
107 * @param account The account. | |
108 * @param alias The alias. | |
109 */ | |
110 void gaim_account_set_alias(GaimAccount *account, const char *alias); | |
111 | |
112 /** | |
113 * Sets the account's user information | |
114 * | |
115 * @param account The account. | |
116 * @param info The user information. | |
117 */ | |
118 void gaim_account_set_user_info(GaimAccount *account, const char *user_info); | |
119 | |
120 /** | |
121 * Sets the account's buddy icon. | |
122 * | |
123 * @param account The account. | |
124 * @param icon The buddy icon file. | |
125 */ | |
126 void gaim_account_set_buddy_icon(GaimAccount *account, const char *icon); | |
127 | |
128 /** | |
129 * Sets the account's protocol. | |
130 * | |
131 * @param account The account. | |
132 * @param protocol The protocol. | |
133 */ | |
134 void gaim_account_set_protocol(GaimAccount *account, GaimProtocol protocol); | |
135 | |
136 /** | |
137 * Sets the account's connection. | |
138 * | |
139 * @param account The account. | |
140 * @param gc The connection. | |
141 */ | |
142 void gaim_account_set_connection(GaimAccount *account, GaimConnection *gc); | |
143 | |
144 /** | |
145 * Sets whether or not this account should save its password. | |
146 * | |
147 * @param account The account. | |
148 * @param value @c TRUE if it should remember the password. | |
149 */ | |
150 void gaim_account_set_remember_password(GaimAccount *account, gboolean value); | |
151 | |
152 /** | |
153 * Sets a protocol-specific integer setting for an account. | |
154 * | |
155 * @param account The account. | |
156 * @param name The name of the setting. | |
157 * @param value The setting's value. | |
158 */ | |
159 void gaim_account_set_int(GaimAccount *account, const char *name, int value); | |
160 | |
161 /** | |
162 * Sets a protocol-specific string setting for an account. | |
163 * | |
164 * @param account The account. | |
165 * @param name The name of the setting. | |
166 * @param value The setting's value. | |
167 */ | |
168 void gaim_account_set_string(GaimAccount *account, const char *name, | |
169 const char *string); | |
170 | |
171 /** | |
172 * Sets a protocol-specific boolean setting for an account. | |
173 * | |
174 * @param account The account. | |
175 * @param name The name of the setting. | |
176 * @param value The setting's value. | |
177 */ | |
178 void gaim_account_set_bool(GaimAccount *account, const char *name, | |
179 gboolean value); | |
180 | |
181 | |
182 /** | |
183 * Returns whether or not the account is connected. | |
184 * | |
185 * @param account The account. | |
186 * | |
187 * @return @c TRUE if connected, or @c FALSE otherwise. | |
188 */ | |
189 gboolean gaim_account_is_connected(const GaimAccount *account); | |
190 | |
191 /** | |
192 * Returns the account's username. | |
193 * | |
194 * @param account The account. | |
195 * | |
196 * @return The username. | |
197 */ | |
198 const char *gaim_account_get_username(const GaimAccount *account); | |
199 | |
200 /** | |
201 * Returns the account's password. | |
202 * | |
203 * @param account The account. | |
204 * | |
205 * @return The password. | |
206 */ | |
207 const char *gaim_account_get_password(const GaimAccount *account); | |
208 | |
209 /** | |
210 * Returns the account's alias. | |
211 * | |
212 * @param account The account. | |
213 * | |
214 * @return The alias. | |
215 */ | |
216 const char *gaim_account_get_alias(const GaimAccount *account); | |
217 | |
218 /** | |
219 * Returns the account's user information. | |
220 * | |
221 * @param account The account. | |
222 * | |
223 * @return The user information. | |
224 */ | |
225 const char *gaim_account_get_user_info(const GaimAccount *account); | |
226 | |
227 /** | |
228 * Returns the account's buddy icon filename. | |
229 * | |
230 * @param account The account. | |
231 * | |
232 * @return The buddy icon filename. | |
233 */ | |
234 const char *gaim_account_get_buddy_icon(const GaimAccount *account); | |
235 | |
236 /** | |
237 * Returns the account's protocol. | |
238 * | |
239 * @param account The account. | |
240 * | |
241 * @return The protocol. | |
242 */ | |
243 GaimProtocol gaim_account_get_protocol(const GaimAccount *account); | |
244 | |
245 /** | |
246 * Returns the account's connection. | |
247 * | |
248 * @param account The account. | |
249 * | |
250 * @return The connection. | |
251 */ | |
252 GaimConnection *gaim_account_get_connection(const GaimAccount *account); | |
253 | |
254 /** | |
255 * Returns whether or not this account should save its password. | |
256 * | |
257 * @param account The account. | |
258 * | |
259 * @return @c TRUE if it should remember the password. | |
260 */ | |
261 gboolean gaim_account_get_remember_password(const GaimAccount *account); | |
262 | |
263 /** | |
264 * Returns a protocol-specific integer setting for an account. | |
265 * | |
266 * @param account The account. | |
267 * @param name The name of the setting. | |
268 * | |
269 * @return The value. | |
270 */ | |
271 int gaim_account_get_int(const GaimAccount *account, const char *name); | |
272 | |
273 /** | |
274 * Returns a protocol-specific string setting for an account. | |
275 * | |
276 * @param account The account. | |
277 * @param name The name of the setting. | |
278 * | |
279 * @return The value. | |
280 */ | |
281 const char *gaim_account_get_string(const GaimAccount *account, | |
282 const char *name); | |
283 | |
284 /** | |
285 * Returns a protocol-specific boolean setting for an account. | |
286 * | |
287 * @param account The account. | |
288 * @param name The name of the setting. | |
289 * | |
290 * @return The value. | |
291 */ | |
292 gboolean gaim_account_get_bool(const GaimAccount *account, const char *name); | |
293 | |
294 /** | |
295 * Returns a list of all accounts. | |
296 * | |
297 * @return A list of all accounts. | |
298 */ | |
299 GList *gaim_accounts_get_all(void); | |
300 | |
301 #endif /* _GAIM_ACCOUNTS_H_ */ |