1.1 --- a/Frameworks/libpurple.framework/Versions/0.5.6/Headers/account.h Sun Jun 21 22:04:11 2009 -0400
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,1054 +0,0 @@
1.4 -/**
1.5 - * @file account.h Account API
1.6 - * @ingroup core
1.7 - * @see @ref account-signals
1.8 - */
1.9 -
1.10 -/* purple
1.11 - *
1.12 - * Purple is the legal property of its developers, whose names are too numerous
1.13 - * to list here. Please refer to the COPYRIGHT file distributed with this
1.14 - * source distribution.
1.15 - *
1.16 - * This program is free software; you can redistribute it and/or modify
1.17 - * it under the terms of the GNU General Public License as published by
1.18 - * the Free Software Foundation; either version 2 of the License, or
1.19 - * (at your option) any later version.
1.20 - *
1.21 - * This program is distributed in the hope that it will be useful,
1.22 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
1.23 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.24 - * GNU General Public License for more details.
1.25 - *
1.26 - * You should have received a copy of the GNU General Public License
1.27 - * along with this program; if not, write to the Free Software
1.28 - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
1.29 - */
1.30 -#ifndef _PURPLE_ACCOUNT_H_
1.31 -#define _PURPLE_ACCOUNT_H_
1.32 -
1.33 -#include <glib.h>
1.34 -#include <glib-object.h>
1.35 -
1.36 -/** @copydoc _PurpleAccountUiOps */
1.37 -typedef struct _PurpleAccountUiOps PurpleAccountUiOps;
1.38 -/** @copydoc _PurpleAccount */
1.39 -typedef struct _PurpleAccount PurpleAccount;
1.40 -
1.41 -typedef gboolean (*PurpleFilterAccountFunc)(PurpleAccount *account);
1.42 -typedef void (*PurpleAccountRequestAuthorizationCb)(void *);
1.43 -typedef void (*PurpleAccountRegistrationCb)(PurpleAccount *account, gboolean succeeded, void *user_data);
1.44 -typedef void (*PurpleAccountUnregistrationCb)(PurpleAccount *account, gboolean succeeded, void *user_data);
1.45 -
1.46 -#include "connection.h"
1.47 -#include "log.h"
1.48 -#include "proxy.h"
1.49 -#include "prpl.h"
1.50 -#include "status.h"
1.51 -
1.52 -/**
1.53 - * Account request types.
1.54 - */
1.55 -typedef enum
1.56 -{
1.57 - PURPLE_ACCOUNT_REQUEST_AUTHORIZATION = 0 /* Account authorization request */
1.58 -} PurpleAccountRequestType;
1.59 -
1.60 -
1.61 -/** Account UI operations, used to notify the user of status changes and when
1.62 - * buddies add this account to their buddy lists.
1.63 - */
1.64 -struct _PurpleAccountUiOps
1.65 -{
1.66 - /** A buddy who is already on this account's buddy list added this account
1.67 - * to their buddy list.
1.68 - */
1.69 - void (*notify_added)(PurpleAccount *account,
1.70 - const char *remote_user,
1.71 - const char *id,
1.72 - const char *alias,
1.73 - const char *message);
1.74 -
1.75 - /** This account's status changed. */
1.76 - void (*status_changed)(PurpleAccount *account,
1.77 - PurpleStatus *status);
1.78 -
1.79 - /** Someone we don't have on our list added us; prompt to add them. */
1.80 - void (*request_add)(PurpleAccount *account,
1.81 - const char *remote_user,
1.82 - const char *id,
1.83 - const char *alias,
1.84 - const char *message);
1.85 -
1.86 - /** Prompt for authorization when someone adds this account to their buddy
1.87 - * list. To authorize them to see this account's presence, call \a
1.88 - * authorize_cb (\a user_data); otherwise call \a deny_cb (\a user_data);
1.89 - * @return a UI-specific handle, as passed to #close_account_request.
1.90 - */
1.91 - void *(*request_authorize)(PurpleAccount *account,
1.92 - const char *remote_user,
1.93 - const char *id,
1.94 - const char *alias,
1.95 - const char *message,
1.96 - gboolean on_list,
1.97 - PurpleAccountRequestAuthorizationCb authorize_cb,
1.98 - PurpleAccountRequestAuthorizationCb deny_cb,
1.99 - void *user_data);
1.100 -
1.101 - /** Close a pending request for authorization. \a ui_handle is a handle
1.102 - * as returned by #request_authorize.
1.103 - */
1.104 - void (*close_account_request)(void *ui_handle);
1.105 -
1.106 - void (*_purple_reserved1)(void);
1.107 - void (*_purple_reserved2)(void);
1.108 - void (*_purple_reserved3)(void);
1.109 - void (*_purple_reserved4)(void);
1.110 -};
1.111 -
1.112 -/** Structure representing an account.
1.113 - */
1.114 -struct _PurpleAccount
1.115 -{
1.116 - char *username; /**< The username. */
1.117 - char *alias; /**< How you appear to yourself. */
1.118 - char *password; /**< The account password. */
1.119 - char *user_info; /**< User information. */
1.120 -
1.121 - char *buddy_icon_path; /**< The buddy icon's non-cached path. */
1.122 -
1.123 - gboolean remember_pass; /**< Remember the password. */
1.124 -
1.125 - char *protocol_id; /**< The ID of the protocol. */
1.126 -
1.127 - PurpleConnection *gc; /**< The connection handle. */
1.128 - gboolean disconnecting; /**< The account is currently disconnecting */
1.129 -
1.130 - GHashTable *settings; /**< Protocol-specific settings. */
1.131 - GHashTable *ui_settings; /**< UI-specific settings. */
1.132 -
1.133 - PurpleProxyInfo *proxy_info; /**< Proxy information. This will be set */
1.134 - /* to NULL when the account inherits */
1.135 - /* proxy settings from global prefs. */
1.136 -
1.137 - /*
1.138 - * TODO: Supplementing the next two linked lists with hash tables
1.139 - * should help performance a lot when these lists are long. This
1.140 - * matters quite a bit for protocols like MSN, where all your
1.141 - * buddies are added to your permit list. Currently we have to
1.142 - * iterate through the entire list if we want to check if someone
1.143 - * is permitted or denied. We should do this for 3.0.0.
1.144 - */
1.145 - GSList *permit; /**< Permit list. */
1.146 - GSList *deny; /**< Deny list. */
1.147 - int perm_deny; /**< The permit/deny setting. */
1.148 -
1.149 - GList *status_types; /**< Status types. */
1.150 -
1.151 - PurplePresence *presence; /**< Presence. */
1.152 - PurpleLog *system_log; /**< The system log */
1.153 -
1.154 - void *ui_data; /**< The UI can put data here. */
1.155 - PurpleAccountRegistrationCb registration_cb;
1.156 - void *registration_cb_user_data;
1.157 -
1.158 - gpointer priv; /**< Pointer to opaque private data. */
1.159 -};
1.160 -
1.161 -#ifdef __cplusplus
1.162 -extern "C" {
1.163 -#endif
1.164 -
1.165 -/**************************************************************************/
1.166 -/** @name Account API */
1.167 -/**************************************************************************/
1.168 -/*@{*/
1.169 -
1.170 -/**
1.171 - * Creates a new account.
1.172 - *
1.173 - * @param username The username.
1.174 - * @param protocol_id The protocol ID.
1.175 - *
1.176 - * @return The new account.
1.177 - */
1.178 -PurpleAccount *purple_account_new(const char *username, const char *protocol_id);
1.179 -
1.180 -/**
1.181 - * Destroys an account.
1.182 - *
1.183 - * @param account The account to destroy.
1.184 - */
1.185 -void purple_account_destroy(PurpleAccount *account);
1.186 -
1.187 -/**
1.188 - * Connects to an account.
1.189 - *
1.190 - * @param account The account to connect to.
1.191 - */
1.192 -void purple_account_connect(PurpleAccount *account);
1.193 -
1.194 -/**
1.195 - * Sets the callback for successful registration.
1.196 - *
1.197 - * @param account The account for which this callback should be used
1.198 - * @param cb The callback
1.199 - * @param user_data The user data passed to the callback
1.200 - */
1.201 -void purple_account_set_register_callback(PurpleAccount *account, PurpleAccountRegistrationCb cb, void *user_data);
1.202 -
1.203 -/**
1.204 - * Registers an account.
1.205 - *
1.206 - * @param account The account to register.
1.207 - */
1.208 -void purple_account_register(PurpleAccount *account);
1.209 -
1.210 -/**
1.211 - * Unregisters an account (deleting it from the server).
1.212 - *
1.213 - * @param account The account to unregister.
1.214 - * @param cb Optional callback to be called when unregistration is complete
1.215 - * @param user_data user data to pass to the callback
1.216 - */
1.217 -void purple_account_unregister(PurpleAccount *account, PurpleAccountUnregistrationCb cb, void *user_data);
1.218 -
1.219 -/**
1.220 - * Disconnects from an account.
1.221 - *
1.222 - * @param account The account to disconnect from.
1.223 - */
1.224 -void purple_account_disconnect(PurpleAccount *account);
1.225 -
1.226 -/**
1.227 - * Notifies the user that the account was added to a remote user's
1.228 - * buddy list.
1.229 - *
1.230 - * This will present a dialog informing the user that he was added to the
1.231 - * remote user's buddy list.
1.232 - *
1.233 - * @param account The account that was added.
1.234 - * @param remote_user The name of the user that added this account.
1.235 - * @param id The optional ID of the local account. Rarely used.
1.236 - * @param alias The optional alias of the user.
1.237 - * @param message The optional message sent from the user adding you.
1.238 - */
1.239 -void purple_account_notify_added(PurpleAccount *account, const char *remote_user,
1.240 - const char *id, const char *alias,
1.241 - const char *message);
1.242 -
1.243 -/**
1.244 - * Notifies the user that the account was addded to a remote user's buddy
1.245 - * list and asks ther user if they want to add the remote user to their buddy
1.246 - * list.
1.247 - *
1.248 - * This will present a dialog informing the local user that the remote user
1.249 - * added them to the remote user's buddy list and will ask if they want to add
1.250 - * the remote user to the buddy list.
1.251 - *
1.252 - * @param account The account that was added.
1.253 - * @param remote_user The name of the user that added this account.
1.254 - * @param id The optional ID of the local account. Rarely used.
1.255 - * @param alias The optional alias of the user.
1.256 - * @param message The optional message sent from the user adding you.
1.257 - */
1.258 -void purple_account_request_add(PurpleAccount *account, const char *remote_user,
1.259 - const char *id, const char *alias,
1.260 - const char *message);
1.261 -
1.262 -/**
1.263 - * Notifies the user that a remote user has wants to add the local user
1.264 - * to his or her buddy list and requires authorization to do so.
1.265 - *
1.266 - * This will present a dialog informing the user of this and ask if the
1.267 - * user authorizes or denies the remote user from adding him.
1.268 - *
1.269 - * @param account The account that was added
1.270 - * @param remote_user The name of the user that added this account.
1.271 - * @param id The optional ID of the local account. Rarely used.
1.272 - * @param alias The optional alias of the remote user.
1.273 - * @param message The optional message sent by the user wanting to add you.
1.274 - * @param on_list Is the remote user already on the buddy list?
1.275 - * @param auth_cb The callback called when the local user accepts
1.276 - * @param deny_cb The callback called when the local user rejects
1.277 - * @param user_data Data to be passed back to the above callbacks
1.278 - *
1.279 - * @return A UI-specific handle.
1.280 - */
1.281 -void *purple_account_request_authorization(PurpleAccount *account, const char *remote_user,
1.282 - const char *id, const char *alias, const char *message, gboolean on_list,
1.283 - PurpleAccountRequestAuthorizationCb auth_cb, PurpleAccountRequestAuthorizationCb deny_cb, void *user_data);
1.284 -
1.285 -/**
1.286 - * Close account requests registered for the given PurpleAccount
1.287 - *
1.288 - * @param account The account for which requests should be closed
1.289 - */
1.290 -void purple_account_request_close_with_account(PurpleAccount *account);
1.291 -
1.292 -/**
1.293 - * Close the account request for the given ui handle
1.294 - *
1.295 - * @param ui_handle The ui specific handle for which requests should be closed
1.296 - */
1.297 -void purple_account_request_close(void *ui_handle);
1.298 -
1.299 -/**
1.300 - * Requests a password from the user for the account. Does not set the
1.301 - * account password on success; do that in ok_cb if desired.
1.302 - *
1.303 - * @param account The account to request the password for.
1.304 - * @param ok_cb The callback for the OK button.
1.305 - * @param cancel_cb The callback for the cancel button.
1.306 - * @param user_data User data to be passed into callbacks.
1.307 - */
1.308 -void purple_account_request_password(PurpleAccount *account, GCallback ok_cb,
1.309 - GCallback cancel_cb, void *user_data);
1.310 -
1.311 -/**
1.312 - * Requests information from the user to change the account's password.
1.313 - *
1.314 - * @param account The account to change the password on.
1.315 - */
1.316 -void purple_account_request_change_password(PurpleAccount *account);
1.317 -
1.318 -/**
1.319 - * Requests information from the user to change the account's
1.320 - * user information.
1.321 - *
1.322 - * @param account The account to change the user information on.
1.323 - */
1.324 -void purple_account_request_change_user_info(PurpleAccount *account);
1.325 -
1.326 -/**
1.327 - * Sets the account's username.
1.328 - *
1.329 - * @param account The account.
1.330 - * @param username The username.
1.331 - */
1.332 -void purple_account_set_username(PurpleAccount *account, const char *username);
1.333 -
1.334 -/**
1.335 - * Sets the account's password.
1.336 - *
1.337 - * @param account The account.
1.338 - * @param password The password.
1.339 - */
1.340 -void purple_account_set_password(PurpleAccount *account, const char *password);
1.341 -
1.342 -/**
1.343 - * Sets the account's alias.
1.344 - *
1.345 - * @param account The account.
1.346 - * @param alias The alias.
1.347 - */
1.348 -void purple_account_set_alias(PurpleAccount *account, const char *alias);
1.349 -
1.350 -/**
1.351 - * Sets the account's user information
1.352 - *
1.353 - * @param account The account.
1.354 - * @param user_info The user information.
1.355 - */
1.356 -void purple_account_set_user_info(PurpleAccount *account, const char *user_info);
1.357 -
1.358 -/**
1.359 - * Sets the account's buddy icon path.
1.360 - *
1.361 - * @param account The account.
1.362 - * @param path The buddy icon non-cached path.
1.363 - */
1.364 -void purple_account_set_buddy_icon_path(PurpleAccount *account, const char *path);
1.365 -
1.366 -/**
1.367 - * Sets the account's protocol ID.
1.368 - *
1.369 - * @param account The account.
1.370 - * @param protocol_id The protocol ID.
1.371 - */
1.372 -void purple_account_set_protocol_id(PurpleAccount *account,
1.373 - const char *protocol_id);
1.374 -
1.375 -/**
1.376 - * Sets the account's connection.
1.377 - *
1.378 - * @param account The account.
1.379 - * @param gc The connection.
1.380 - */
1.381 -void purple_account_set_connection(PurpleAccount *account, PurpleConnection *gc);
1.382 -
1.383 -/**
1.384 - * Sets whether or not this account should save its password.
1.385 - *
1.386 - * @param account The account.
1.387 - * @param value @c TRUE if it should remember the password.
1.388 - */
1.389 -void purple_account_set_remember_password(PurpleAccount *account, gboolean value);
1.390 -
1.391 -/**
1.392 - * Sets whether or not this account should check for mail.
1.393 - *
1.394 - * @param account The account.
1.395 - * @param value @c TRUE if it should check for mail.
1.396 - */
1.397 -void purple_account_set_check_mail(PurpleAccount *account, gboolean value);
1.398 -
1.399 -/**
1.400 - * Sets whether or not this account is enabled for the specified
1.401 - * UI.
1.402 - *
1.403 - * @param account The account.
1.404 - * @param ui The UI.
1.405 - * @param value @c TRUE if it is enabled.
1.406 - */
1.407 -void purple_account_set_enabled(PurpleAccount *account, const char *ui,
1.408 - gboolean value);
1.409 -
1.410 -/**
1.411 - * Sets the account's proxy information.
1.412 - *
1.413 - * @param account The account.
1.414 - * @param info The proxy information.
1.415 - */
1.416 -void purple_account_set_proxy_info(PurpleAccount *account, PurpleProxyInfo *info);
1.417 -
1.418 -/**
1.419 - * Sets the account's status types.
1.420 - *
1.421 - * @param account The account.
1.422 - * @param status_types The list of status types.
1.423 - */
1.424 -void purple_account_set_status_types(PurpleAccount *account, GList *status_types);
1.425 -
1.426 -/**
1.427 - * Variadic version of purple_account_set_status_list(); the variadic list
1.428 - * replaces @a attrs, and should be <tt>NULL</tt>-terminated.
1.429 - *
1.430 - * @copydoc purple_account_set_status_list()
1.431 - */
1.432 -void purple_account_set_status(PurpleAccount *account, const char *status_id,
1.433 - gboolean active, ...) G_GNUC_NULL_TERMINATED;
1.434 -
1.435 -
1.436 -/**
1.437 - * Activates or deactivates a status. All changes to the statuses of
1.438 - * an account go through this function or purple_account_set_status().
1.439 - *
1.440 - * You can only deactivate an exclusive status by activating another exclusive
1.441 - * status. So, if @a status_id is an exclusive status and @a active is @c
1.442 - * FALSE, this function does nothing.
1.443 - *
1.444 - * @param account The account.
1.445 - * @param status_id The ID of the status.
1.446 - * @param active Whether @a status_id is to be activated (<tt>TRUE</tt>) or
1.447 - * deactivated (<tt>FALSE</tt>).
1.448 - * @param attrs A list of <tt>const char *</tt> attribute names followed by
1.449 - * <tt>const char *</tt> attribute values for the status.
1.450 - * (For example, one pair might be <tt>"message"</tt> followed
1.451 - * by <tt>"hello, talk to me!"</tt>.)
1.452 - */
1.453 -void purple_account_set_status_list(PurpleAccount *account,
1.454 - const char *status_id, gboolean active, GList *attrs);
1.455 -
1.456 -/**
1.457 - * Clears all protocol-specific settings on an account.
1.458 - *
1.459 - * @param account The account.
1.460 - */
1.461 -void purple_account_clear_settings(PurpleAccount *account);
1.462 -
1.463 -/**
1.464 - * Sets a protocol-specific integer setting for an account.
1.465 - *
1.466 - * @param account The account.
1.467 - * @param name The name of the setting.
1.468 - * @param value The setting's value.
1.469 - */
1.470 -void purple_account_set_int(PurpleAccount *account, const char *name, int value);
1.471 -
1.472 -/**
1.473 - * Sets a protocol-specific string setting for an account.
1.474 - *
1.475 - * @param account The account.
1.476 - * @param name The name of the setting.
1.477 - * @param value The setting's value.
1.478 - */
1.479 -void purple_account_set_string(PurpleAccount *account, const char *name,
1.480 - const char *value);
1.481 -
1.482 -/**
1.483 - * Sets a protocol-specific boolean setting for an account.
1.484 - *
1.485 - * @param account The account.
1.486 - * @param name The name of the setting.
1.487 - * @param value The setting's value.
1.488 - */
1.489 -void purple_account_set_bool(PurpleAccount *account, const char *name,
1.490 - gboolean value);
1.491 -
1.492 -/**
1.493 - * Sets a UI-specific integer setting for an account.
1.494 - *
1.495 - * @param account The account.
1.496 - * @param ui The UI name.
1.497 - * @param name The name of the setting.
1.498 - * @param value The setting's value.
1.499 - */
1.500 -void purple_account_set_ui_int(PurpleAccount *account, const char *ui,
1.501 - const char *name, int value);
1.502 -
1.503 -/**
1.504 - * Sets a UI-specific string setting for an account.
1.505 - *
1.506 - * @param account The account.
1.507 - * @param ui The UI name.
1.508 - * @param name The name of the setting.
1.509 - * @param value The setting's value.
1.510 - */
1.511 -void purple_account_set_ui_string(PurpleAccount *account, const char *ui,
1.512 - const char *name, const char *value);
1.513 -
1.514 -/**
1.515 - * Sets a UI-specific boolean setting for an account.
1.516 - *
1.517 - * @param account The account.
1.518 - * @param ui The UI name.
1.519 - * @param name The name of the setting.
1.520 - * @param value The setting's value.
1.521 - */
1.522 -void purple_account_set_ui_bool(PurpleAccount *account, const char *ui,
1.523 - const char *name, gboolean value);
1.524 -
1.525 -/**
1.526 - * Returns whether or not the account is connected.
1.527 - *
1.528 - * @param account The account.
1.529 - *
1.530 - * @return @c TRUE if connected, or @c FALSE otherwise.
1.531 - */
1.532 -gboolean purple_account_is_connected(const PurpleAccount *account);
1.533 -
1.534 -/**
1.535 - * Returns whether or not the account is connecting.
1.536 - *
1.537 - * @param account The account.
1.538 - *
1.539 - * @return @c TRUE if connecting, or @c FALSE otherwise.
1.540 - */
1.541 -gboolean purple_account_is_connecting(const PurpleAccount *account);
1.542 -
1.543 -/**
1.544 - * Returns whether or not the account is disconnected.
1.545 - *
1.546 - * @param account The account.
1.547 - *
1.548 - * @return @c TRUE if disconnected, or @c FALSE otherwise.
1.549 - */
1.550 -gboolean purple_account_is_disconnected(const PurpleAccount *account);
1.551 -
1.552 -/**
1.553 - * Returns the account's username.
1.554 - *
1.555 - * @param account The account.
1.556 - *
1.557 - * @return The username.
1.558 - */
1.559 -const char *purple_account_get_username(const PurpleAccount *account);
1.560 -
1.561 -/**
1.562 - * Returns the account's password.
1.563 - *
1.564 - * @param account The account.
1.565 - *
1.566 - * @return The password.
1.567 - */
1.568 -const char *purple_account_get_password(const PurpleAccount *account);
1.569 -
1.570 -/**
1.571 - * Returns the account's alias.
1.572 - *
1.573 - * @param account The account.
1.574 - *
1.575 - * @return The alias.
1.576 - */
1.577 -const char *purple_account_get_alias(const PurpleAccount *account);
1.578 -
1.579 -/**
1.580 - * Returns the account's user information.
1.581 - *
1.582 - * @param account The account.
1.583 - *
1.584 - * @return The user information.
1.585 - */
1.586 -const char *purple_account_get_user_info(const PurpleAccount *account);
1.587 -
1.588 -/**
1.589 - * Gets the account's buddy icon path.
1.590 - *
1.591 - * @param account The account.
1.592 - *
1.593 - * @return The buddy icon's non-cached path.
1.594 - */
1.595 -const char *purple_account_get_buddy_icon_path(const PurpleAccount *account);
1.596 -
1.597 -/**
1.598 - * Returns the account's protocol ID.
1.599 - *
1.600 - * @param account The account.
1.601 - *
1.602 - * @return The protocol ID.
1.603 - */
1.604 -const char *purple_account_get_protocol_id(const PurpleAccount *account);
1.605 -
1.606 -/**
1.607 - * Returns the account's protocol name.
1.608 - *
1.609 - * @param account The account.
1.610 - *
1.611 - * @return The protocol name.
1.612 - */
1.613 -const char *purple_account_get_protocol_name(const PurpleAccount *account);
1.614 -
1.615 -/**
1.616 - * Returns the account's connection.
1.617 - *
1.618 - * @param account The account.
1.619 - *
1.620 - * @return The connection.
1.621 - */
1.622 -PurpleConnection *purple_account_get_connection(const PurpleAccount *account);
1.623 -
1.624 -/**
1.625 - * Returns whether or not this account should save its password.
1.626 - *
1.627 - * @param account The account.
1.628 - *
1.629 - * @return @c TRUE if it should remember the password.
1.630 - */
1.631 -gboolean purple_account_get_remember_password(const PurpleAccount *account);
1.632 -
1.633 -/**
1.634 - * Returns whether or not this account should check for mail.
1.635 - *
1.636 - * @param account The account.
1.637 - *
1.638 - * @return @c TRUE if it should check for mail.
1.639 - */
1.640 -gboolean purple_account_get_check_mail(const PurpleAccount *account);
1.641 -
1.642 -/**
1.643 - * Returns whether or not this account is enabled for the
1.644 - * specified UI.
1.645 - *
1.646 - * @param account The account.
1.647 - * @param ui The UI.
1.648 - *
1.649 - * @return @c TRUE if it enabled on this UI.
1.650 - */
1.651 -gboolean purple_account_get_enabled(const PurpleAccount *account,
1.652 - const char *ui);
1.653 -
1.654 -/**
1.655 - * Returns the account's proxy information.
1.656 - *
1.657 - * @param account The account.
1.658 - *
1.659 - * @return The proxy information.
1.660 - */
1.661 -PurpleProxyInfo *purple_account_get_proxy_info(const PurpleAccount *account);
1.662 -
1.663 -/**
1.664 - * Returns the active status for this account. This looks through
1.665 - * the PurplePresence associated with this account and returns the
1.666 - * PurpleStatus that has its active flag set to "TRUE." There can be
1.667 - * only one active PurpleStatus in a PurplePresence.
1.668 - *
1.669 - * @param account The account.
1.670 - *
1.671 - * @return The active status.
1.672 - */
1.673 -PurpleStatus *purple_account_get_active_status(const PurpleAccount *account);
1.674 -
1.675 -/**
1.676 - * Returns the account status with the specified ID.
1.677 - *
1.678 - * Note that this works differently than purple_buddy_get_status() in that
1.679 - * it will only return NULL if the status was not registered.
1.680 - *
1.681 - * @param account The account.
1.682 - * @param status_id The status ID.
1.683 - *
1.684 - * @return The status, or NULL if it was never registered.
1.685 - */
1.686 -PurpleStatus *purple_account_get_status(const PurpleAccount *account,
1.687 - const char *status_id);
1.688 -
1.689 -/**
1.690 - * Returns the account status type with the specified ID.
1.691 - *
1.692 - * @param account The account.
1.693 - * @param id The ID of the status type to find.
1.694 - *
1.695 - * @return The status type if found, or NULL.
1.696 - */
1.697 -PurpleStatusType *purple_account_get_status_type(const PurpleAccount *account,
1.698 - const char *id);
1.699 -
1.700 -/**
1.701 - * Returns the account status type with the specified primitive.
1.702 - * Note: It is possible for an account to have more than one
1.703 - * PurpleStatusType with the same primitive. In this case, the
1.704 - * first PurpleStatusType is returned.
1.705 - *
1.706 - * @param account The account.
1.707 - * @param primitive The type of the status type to find.
1.708 - *
1.709 - * @return The status if found, or NULL.
1.710 - */
1.711 -PurpleStatusType *purple_account_get_status_type_with_primitive(
1.712 - const PurpleAccount *account,
1.713 - PurpleStatusPrimitive primitive);
1.714 -
1.715 -/**
1.716 - * Returns the account's presence.
1.717 - *
1.718 - * @param account The account.
1.719 - *
1.720 - * @return The account's presence.
1.721 - */
1.722 -PurplePresence *purple_account_get_presence(const PurpleAccount *account);
1.723 -
1.724 -/**
1.725 - * Returns whether or not an account status is active.
1.726 - *
1.727 - * @param account The account.
1.728 - * @param status_id The status ID.
1.729 - *
1.730 - * @return TRUE if active, or FALSE if not.
1.731 - */
1.732 -gboolean purple_account_is_status_active(const PurpleAccount *account,
1.733 - const char *status_id);
1.734 -
1.735 -/**
1.736 - * Returns the account's status types.
1.737 - *
1.738 - * @param account The account.
1.739 - *
1.740 - * @constreturn The account's status types.
1.741 - */
1.742 -GList *purple_account_get_status_types(const PurpleAccount *account);
1.743 -
1.744 -/**
1.745 - * Returns a protocol-specific integer setting for an account.
1.746 - *
1.747 - * @param account The account.
1.748 - * @param name The name of the setting.
1.749 - * @param default_value The default value.
1.750 - *
1.751 - * @return The value.
1.752 - */
1.753 -int purple_account_get_int(const PurpleAccount *account, const char *name,
1.754 - int default_value);
1.755 -
1.756 -/**
1.757 - * Returns a protocol-specific string setting for an account.
1.758 - *
1.759 - * @param account The account.
1.760 - * @param name The name of the setting.
1.761 - * @param default_value The default value.
1.762 - *
1.763 - * @return The value.
1.764 - */
1.765 -const char *purple_account_get_string(const PurpleAccount *account,
1.766 - const char *name,
1.767 - const char *default_value);
1.768 -
1.769 -/**
1.770 - * Returns a protocol-specific boolean setting for an account.
1.771 - *
1.772 - * @param account The account.
1.773 - * @param name The name of the setting.
1.774 - * @param default_value The default value.
1.775 - *
1.776 - * @return The value.
1.777 - */
1.778 -gboolean purple_account_get_bool(const PurpleAccount *account, const char *name,
1.779 - gboolean default_value);
1.780 -
1.781 -/**
1.782 - * Returns a UI-specific integer setting for an account.
1.783 - *
1.784 - * @param account The account.
1.785 - * @param ui The UI name.
1.786 - * @param name The name of the setting.
1.787 - * @param default_value The default value.
1.788 - *
1.789 - * @return The value.
1.790 - */
1.791 -int purple_account_get_ui_int(const PurpleAccount *account, const char *ui,
1.792 - const char *name, int default_value);
1.793 -
1.794 -/**
1.795 - * Returns a UI-specific string setting for an account.
1.796 - *
1.797 - * @param account The account.
1.798 - * @param ui The UI name.
1.799 - * @param name The name of the setting.
1.800 - * @param default_value The default value.
1.801 - *
1.802 - * @return The value.
1.803 - */
1.804 -const char *purple_account_get_ui_string(const PurpleAccount *account,
1.805 - const char *ui, const char *name,
1.806 - const char *default_value);
1.807 -
1.808 -/**
1.809 - * Returns a UI-specific boolean setting for an account.
1.810 - *
1.811 - * @param account The account.
1.812 - * @param ui The UI name.
1.813 - * @param name The name of the setting.
1.814 - * @param default_value The default value.
1.815 - *
1.816 - * @return The value.
1.817 - */
1.818 -gboolean purple_account_get_ui_bool(const PurpleAccount *account, const char *ui,
1.819 - const char *name, gboolean default_value);
1.820 -
1.821 -
1.822 -/**
1.823 - * Returns the system log for an account.
1.824 - *
1.825 - * @param account The account.
1.826 - * @param create Should it be created if it doesn't exist?
1.827 - *
1.828 - * @return The log.
1.829 - *
1.830 - * @note Callers should almost always pass @c FALSE for @a create.
1.831 - * Passing @c TRUE could result in an existing log being reopened,
1.832 - * if the log has already been closed, which not all loggers deal
1.833 - * with appropriately.
1.834 - */
1.835 -PurpleLog *purple_account_get_log(PurpleAccount *account, gboolean create);
1.836 -
1.837 -/**
1.838 - * Frees the system log of an account
1.839 - *
1.840 - * @param account The account.
1.841 - */
1.842 -void purple_account_destroy_log(PurpleAccount *account);
1.843 -
1.844 -/**
1.845 - * Adds a buddy to the server-side buddy list for the specified account.
1.846 - *
1.847 - * @param account The account.
1.848 - * @param buddy The buddy to add.
1.849 - */
1.850 -void purple_account_add_buddy(PurpleAccount *account, PurpleBuddy *buddy);
1.851 -/**
1.852 - * Adds a list of buddies to the server-side buddy list.
1.853 - *
1.854 - * @param account The account.
1.855 - * @param buddies The list of PurpleBlistNodes representing the buddies to add.
1.856 - */
1.857 -void purple_account_add_buddies(PurpleAccount *account, GList *buddies);
1.858 -
1.859 -/**
1.860 - * Removes a buddy from the server-side buddy list.
1.861 - *
1.862 - * @param account The account.
1.863 - * @param buddy The buddy to remove.
1.864 - * @param group The group to remove the buddy from.
1.865 - */
1.866 -void purple_account_remove_buddy(PurpleAccount *account, PurpleBuddy *buddy,
1.867 - PurpleGroup *group);
1.868 -
1.869 -/**
1.870 - * Removes a list of buddies from the server-side buddy list.
1.871 - *
1.872 - * @note The lists buddies and groups are parallel lists. Be sure that node n of
1.873 - * groups matches node n of buddies.
1.874 - *
1.875 - * @param account The account.
1.876 - * @param buddies The list of buddies to remove.
1.877 - * @param groups The list of groups to remove buddies from. Each node of this
1.878 - * list should match the corresponding node of buddies.
1.879 - */
1.880 -void purple_account_remove_buddies(PurpleAccount *account, GList *buddies,
1.881 - GList *groups);
1.882 -
1.883 -/**
1.884 - * Removes a group from the server-side buddy list.
1.885 - *
1.886 - * @param account The account.
1.887 - * @param group The group to remove.
1.888 - */
1.889 -void purple_account_remove_group(PurpleAccount *account, PurpleGroup *group);
1.890 -
1.891 -/**
1.892 - * Changes the password on the specified account.
1.893 - *
1.894 - * @param account The account.
1.895 - * @param orig_pw The old password.
1.896 - * @param new_pw The new password.
1.897 - */
1.898 -void purple_account_change_password(PurpleAccount *account, const char *orig_pw,
1.899 - const char *new_pw);
1.900 -
1.901 -/**
1.902 - * Whether the account supports sending offline messages to buddy.
1.903 - *
1.904 - * @param account The account
1.905 - * @param buddy The buddy
1.906 - */
1.907 -gboolean purple_account_supports_offline_message(PurpleAccount *account, PurpleBuddy *buddy);
1.908 -
1.909 -/**
1.910 - * Get the error that caused the account to be disconnected, or @c NULL if the
1.911 - * account is happily connected or disconnected without an error.
1.912 - *
1.913 - * @param account The account whose error should be retrieved.
1.914 - * @constreturn The type of error and a human-readable description of the
1.915 - * current error, or @c NULL if there is no current error. This
1.916 - * pointer is guaranteed to remain valid until the @ref
1.917 - * account-error-changed signal is emitted for @a account.
1.918 - */
1.919 -const PurpleConnectionErrorInfo *purple_account_get_current_error(PurpleAccount *account);
1.920 -
1.921 -/**
1.922 - * Clear an account's current error state, resetting it to @c NULL.
1.923 - *
1.924 - * @param account The account whose error state should be cleared.
1.925 - */
1.926 -void purple_account_clear_current_error(PurpleAccount *account);
1.927 -
1.928 -/*@}*/
1.929 -
1.930 -/**************************************************************************/
1.931 -/** @name Accounts API */
1.932 -/**************************************************************************/
1.933 -/*@{*/
1.934 -
1.935 -/**
1.936 - * Adds an account to the list of accounts.
1.937 - *
1.938 - * @param account The account.
1.939 - */
1.940 -void purple_accounts_add(PurpleAccount *account);
1.941 -
1.942 -/**
1.943 - * Removes an account from the list of accounts.
1.944 - *
1.945 - * @param account The account.
1.946 - */
1.947 -void purple_accounts_remove(PurpleAccount *account);
1.948 -
1.949 -/**
1.950 - * Deletes an account.
1.951 - *
1.952 - * This will remove any buddies from the buddy list that belong to this
1.953 - * account, buddy pounces that belong to this account, and will also
1.954 - * destroy @a account.
1.955 - *
1.956 - * @param account The account.
1.957 - */
1.958 -void purple_accounts_delete(PurpleAccount *account);
1.959 -
1.960 -/**
1.961 - * Reorders an account.
1.962 - *
1.963 - * @param account The account to reorder.
1.964 - * @param new_index The new index for the account.
1.965 - */
1.966 -void purple_accounts_reorder(PurpleAccount *account, gint new_index);
1.967 -
1.968 -/**
1.969 - * Returns a list of all accounts.
1.970 - *
1.971 - * @constreturn A list of all accounts.
1.972 - */
1.973 -GList *purple_accounts_get_all(void);
1.974 -
1.975 -/**
1.976 - * Returns a list of all enabled accounts
1.977 - *
1.978 - * @return A list of all enabled accounts. The list is owned
1.979 - * by the caller, and must be g_list_free()d to avoid
1.980 - * leaking the nodes.
1.981 - */
1.982 -GList *purple_accounts_get_all_active(void);
1.983 -
1.984 -/**
1.985 - * Finds an account with the specified name and protocol id.
1.986 - *
1.987 - * @param name The account username.
1.988 - * @param protocol The account protocol ID.
1.989 - *
1.990 - * @return The account, if found, or @c FALSE otherwise.
1.991 - */
1.992 -PurpleAccount *purple_accounts_find(const char *name, const char *protocol);
1.993 -
1.994 -/**
1.995 - * This is called by the core after all subsystems and what
1.996 - * not have been initialized. It sets all enabled accounts
1.997 - * to their startup status by signing them on, setting them
1.998 - * away, etc.
1.999 - *
1.1000 - * You probably shouldn't call this unless you really know
1.1001 - * what you're doing.
1.1002 - */
1.1003 -void purple_accounts_restore_current_statuses(void);
1.1004 -
1.1005 -/*@}*/
1.1006 -
1.1007 -
1.1008 -/**************************************************************************/
1.1009 -/** @name UI Registration Functions */
1.1010 -/**************************************************************************/
1.1011 -/*@{*/
1.1012 -/**
1.1013 - * Sets the UI operations structure to be used for accounts.
1.1014 - *
1.1015 - * @param ops The UI operations structure.
1.1016 - */
1.1017 -void purple_accounts_set_ui_ops(PurpleAccountUiOps *ops);
1.1018 -
1.1019 -/**
1.1020 - * Returns the UI operations structure used for accounts.
1.1021 - *
1.1022 - * @return The UI operations structure in use.
1.1023 - */
1.1024 -PurpleAccountUiOps *purple_accounts_get_ui_ops(void);
1.1025 -
1.1026 -/*@}*/
1.1027 -
1.1028 -
1.1029 -/**************************************************************************/
1.1030 -/** @name Accounts Subsystem */
1.1031 -/**************************************************************************/
1.1032 -/*@{*/
1.1033 -
1.1034 -/**
1.1035 - * Returns the accounts subsystem handle.
1.1036 - *
1.1037 - * @return The accounts subsystem handle.
1.1038 - */
1.1039 -void *purple_accounts_get_handle(void);
1.1040 -
1.1041 -/**
1.1042 - * Initializes the accounts subsystem.
1.1043 - */
1.1044 -void purple_accounts_init(void);
1.1045 -
1.1046 -/**
1.1047 - * Uninitializes the accounts subsystem.
1.1048 - */
1.1049 -void purple_accounts_uninit(void);
1.1050 -
1.1051 -/*@}*/
1.1052 -
1.1053 -#ifdef __cplusplus
1.1054 -}
1.1055 -#endif
1.1056 -
1.1057 -#endif /* _PURPLE_ACCOUNT_H_ */