1.1 --- a/Frameworks/libpurple.framework/Versions/0.6.0/Headers/account.h Fri Aug 21 13:24:36 2009 -0700
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,1065 +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 "privacy.h"
1.49 -#include "proxy.h"
1.50 -#include "prpl.h"
1.51 -#include "status.h"
1.52 -
1.53 -/**
1.54 - * Account request types.
1.55 - */
1.56 -typedef enum
1.57 -{
1.58 - PURPLE_ACCOUNT_REQUEST_AUTHORIZATION = 0 /* Account authorization request */
1.59 -} PurpleAccountRequestType;
1.60 -
1.61 -
1.62 -/** Account UI operations, used to notify the user of status changes and when
1.63 - * buddies add this account to their buddy lists.
1.64 - */
1.65 -struct _PurpleAccountUiOps
1.66 -{
1.67 - /** A buddy who is already on this account's buddy list added this account
1.68 - * to their buddy list.
1.69 - */
1.70 - void (*notify_added)(PurpleAccount *account,
1.71 - const char *remote_user,
1.72 - const char *id,
1.73 - const char *alias,
1.74 - const char *message);
1.75 -
1.76 - /** This account's status changed. */
1.77 - void (*status_changed)(PurpleAccount *account,
1.78 - PurpleStatus *status);
1.79 -
1.80 - /** Someone we don't have on our list added us; prompt to add them. */
1.81 - void (*request_add)(PurpleAccount *account,
1.82 - const char *remote_user,
1.83 - const char *id,
1.84 - const char *alias,
1.85 - const char *message);
1.86 -
1.87 - /** Prompt for authorization when someone adds this account to their buddy
1.88 - * list. To authorize them to see this account's presence, call \a
1.89 - * authorize_cb (\a user_data); otherwise call \a deny_cb (\a user_data);
1.90 - * @return a UI-specific handle, as passed to #close_account_request.
1.91 - */
1.92 - void *(*request_authorize)(PurpleAccount *account,
1.93 - const char *remote_user,
1.94 - const char *id,
1.95 - const char *alias,
1.96 - const char *message,
1.97 - gboolean on_list,
1.98 - PurpleAccountRequestAuthorizationCb authorize_cb,
1.99 - PurpleAccountRequestAuthorizationCb deny_cb,
1.100 - void *user_data);
1.101 -
1.102 - /** Close a pending request for authorization. \a ui_handle is a handle
1.103 - * as returned by #request_authorize.
1.104 - */
1.105 - void (*close_account_request)(void *ui_handle);
1.106 -
1.107 - void (*_purple_reserved1)(void);
1.108 - void (*_purple_reserved2)(void);
1.109 - void (*_purple_reserved3)(void);
1.110 - void (*_purple_reserved4)(void);
1.111 -};
1.112 -
1.113 -/** Structure representing an account.
1.114 - */
1.115 -struct _PurpleAccount
1.116 -{
1.117 - char *username; /**< The username. */
1.118 - char *alias; /**< How you appear to yourself. */
1.119 - char *password; /**< The account password. */
1.120 - char *user_info; /**< User information. */
1.121 -
1.122 - char *buddy_icon_path; /**< The buddy icon's non-cached path. */
1.123 -
1.124 - gboolean remember_pass; /**< Remember the password. */
1.125 -
1.126 - char *protocol_id; /**< The ID of the protocol. */
1.127 -
1.128 - PurpleConnection *gc; /**< The connection handle. */
1.129 - gboolean disconnecting; /**< The account is currently disconnecting */
1.130 -
1.131 - GHashTable *settings; /**< Protocol-specific settings. */
1.132 - GHashTable *ui_settings; /**< UI-specific settings. */
1.133 -
1.134 - PurpleProxyInfo *proxy_info; /**< Proxy information. This will be set */
1.135 - /* to NULL when the account inherits */
1.136 - /* proxy settings from global prefs. */
1.137 -
1.138 - /*
1.139 - * TODO: Supplementing the next two linked lists with hash tables
1.140 - * should help performance a lot when these lists are long. This
1.141 - * matters quite a bit for protocols like MSN, where all your
1.142 - * buddies are added to your permit list. Currently we have to
1.143 - * iterate through the entire list if we want to check if someone
1.144 - * is permitted or denied. We should do this for 3.0.0.
1.145 - */
1.146 - GSList *permit; /**< Permit list. */
1.147 - GSList *deny; /**< Deny list. */
1.148 - PurplePrivacyType perm_deny; /**< The permit/deny setting. */
1.149 -
1.150 - GList *status_types; /**< Status types. */
1.151 -
1.152 - PurplePresence *presence; /**< Presence. */
1.153 - PurpleLog *system_log; /**< The system log */
1.154 -
1.155 - void *ui_data; /**< The UI can put data here. */
1.156 - PurpleAccountRegistrationCb registration_cb;
1.157 - void *registration_cb_user_data;
1.158 -
1.159 - gpointer priv; /**< Pointer to opaque private data. */
1.160 -};
1.161 -
1.162 -#ifdef __cplusplus
1.163 -extern "C" {
1.164 -#endif
1.165 -
1.166 -/**************************************************************************/
1.167 -/** @name Account API */
1.168 -/**************************************************************************/
1.169 -/*@{*/
1.170 -
1.171 -/**
1.172 - * Creates a new account.
1.173 - *
1.174 - * @param username The username.
1.175 - * @param protocol_id The protocol ID.
1.176 - *
1.177 - * @return The new account.
1.178 - */
1.179 -PurpleAccount *purple_account_new(const char *username, const char *protocol_id);
1.180 -
1.181 -/**
1.182 - * Destroys an account.
1.183 - *
1.184 - * @param account The account to destroy.
1.185 - */
1.186 -void purple_account_destroy(PurpleAccount *account);
1.187 -
1.188 -/**
1.189 - * Connects to an account.
1.190 - *
1.191 - * @param account The account to connect to.
1.192 - */
1.193 -void purple_account_connect(PurpleAccount *account);
1.194 -
1.195 -/**
1.196 - * Sets the callback for successful registration.
1.197 - *
1.198 - * @param account The account for which this callback should be used
1.199 - * @param cb The callback
1.200 - * @param user_data The user data passed to the callback
1.201 - */
1.202 -void purple_account_set_register_callback(PurpleAccount *account, PurpleAccountRegistrationCb cb, void *user_data);
1.203 -
1.204 -/**
1.205 - * Registers an account.
1.206 - *
1.207 - * @param account The account to register.
1.208 - */
1.209 -void purple_account_register(PurpleAccount *account);
1.210 -
1.211 -/**
1.212 - * Unregisters an account (deleting it from the server).
1.213 - *
1.214 - * @param account The account to unregister.
1.215 - * @param cb Optional callback to be called when unregistration is complete
1.216 - * @param user_data user data to pass to the callback
1.217 - */
1.218 -void purple_account_unregister(PurpleAccount *account, PurpleAccountUnregistrationCb cb, void *user_data);
1.219 -
1.220 -/**
1.221 - * Disconnects from an account.
1.222 - *
1.223 - * @param account The account to disconnect from.
1.224 - */
1.225 -void purple_account_disconnect(PurpleAccount *account);
1.226 -
1.227 -/**
1.228 - * Notifies the user that the account was added to a remote user's
1.229 - * buddy list.
1.230 - *
1.231 - * This will present a dialog informing the user that he was added to the
1.232 - * remote user's buddy list.
1.233 - *
1.234 - * @param account The account that was added.
1.235 - * @param remote_user The name of the user that added this account.
1.236 - * @param id The optional ID of the local account. Rarely used.
1.237 - * @param alias The optional alias of the user.
1.238 - * @param message The optional message sent from the user adding you.
1.239 - */
1.240 -void purple_account_notify_added(PurpleAccount *account, const char *remote_user,
1.241 - const char *id, const char *alias,
1.242 - const char *message);
1.243 -
1.244 -/**
1.245 - * Notifies the user that the account was addded to a remote user's buddy
1.246 - * list and asks ther user if they want to add the remote user to their buddy
1.247 - * list.
1.248 - *
1.249 - * This will present a dialog informing the local user that the remote user
1.250 - * added them to the remote user's buddy list and will ask if they want to add
1.251 - * the remote user to the buddy list.
1.252 - *
1.253 - * @param account The account that was added.
1.254 - * @param remote_user The name of the user that added this account.
1.255 - * @param id The optional ID of the local account. Rarely used.
1.256 - * @param alias The optional alias of the user.
1.257 - * @param message The optional message sent from the user adding you.
1.258 - */
1.259 -void purple_account_request_add(PurpleAccount *account, const char *remote_user,
1.260 - const char *id, const char *alias,
1.261 - const char *message);
1.262 -
1.263 -/**
1.264 - * Notifies the user that a remote user has wants to add the local user
1.265 - * to his or her buddy list and requires authorization to do so.
1.266 - *
1.267 - * This will present a dialog informing the user of this and ask if the
1.268 - * user authorizes or denies the remote user from adding him.
1.269 - *
1.270 - * @param account The account that was added
1.271 - * @param remote_user The name of the user that added this account.
1.272 - * @param id The optional ID of the local account. Rarely used.
1.273 - * @param alias The optional alias of the remote user.
1.274 - * @param message The optional message sent by the user wanting to add you.
1.275 - * @param on_list Is the remote user already on the buddy list?
1.276 - * @param auth_cb The callback called when the local user accepts
1.277 - * @param deny_cb The callback called when the local user rejects
1.278 - * @param user_data Data to be passed back to the above callbacks
1.279 - *
1.280 - * @return A UI-specific handle.
1.281 - */
1.282 -void *purple_account_request_authorization(PurpleAccount *account, const char *remote_user,
1.283 - const char *id, const char *alias, const char *message, gboolean on_list,
1.284 - PurpleAccountRequestAuthorizationCb auth_cb, PurpleAccountRequestAuthorizationCb deny_cb, void *user_data);
1.285 -
1.286 -/**
1.287 - * Close account requests registered for the given PurpleAccount
1.288 - *
1.289 - * @param account The account for which requests should be closed
1.290 - */
1.291 -void purple_account_request_close_with_account(PurpleAccount *account);
1.292 -
1.293 -/**
1.294 - * Close the account request for the given ui handle
1.295 - *
1.296 - * @param ui_handle The ui specific handle for which requests should be closed
1.297 - */
1.298 -void purple_account_request_close(void *ui_handle);
1.299 -
1.300 -/**
1.301 - * Requests a password from the user for the account. Does not set the
1.302 - * account password on success; do that in ok_cb if desired.
1.303 - *
1.304 - * @param account The account to request the password for.
1.305 - * @param ok_cb The callback for the OK button.
1.306 - * @param cancel_cb The callback for the cancel button.
1.307 - * @param user_data User data to be passed into callbacks.
1.308 - */
1.309 -void purple_account_request_password(PurpleAccount *account, GCallback ok_cb,
1.310 - GCallback cancel_cb, void *user_data);
1.311 -
1.312 -/**
1.313 - * Requests information from the user to change the account's password.
1.314 - *
1.315 - * @param account The account to change the password on.
1.316 - */
1.317 -void purple_account_request_change_password(PurpleAccount *account);
1.318 -
1.319 -/**
1.320 - * Requests information from the user to change the account's
1.321 - * user information.
1.322 - *
1.323 - * @param account The account to change the user information on.
1.324 - */
1.325 -void purple_account_request_change_user_info(PurpleAccount *account);
1.326 -
1.327 -/**
1.328 - * Sets the account's username.
1.329 - *
1.330 - * @param account The account.
1.331 - * @param username The username.
1.332 - */
1.333 -void purple_account_set_username(PurpleAccount *account, const char *username);
1.334 -
1.335 -/**
1.336 - * Sets the account's password.
1.337 - *
1.338 - * @param account The account.
1.339 - * @param password The password.
1.340 - */
1.341 -void purple_account_set_password(PurpleAccount *account, const char *password);
1.342 -
1.343 -/**
1.344 - * Sets the account's alias.
1.345 - *
1.346 - * @param account The account.
1.347 - * @param alias The alias.
1.348 - */
1.349 -void purple_account_set_alias(PurpleAccount *account, const char *alias);
1.350 -
1.351 -/**
1.352 - * Sets the account's user information
1.353 - *
1.354 - * @param account The account.
1.355 - * @param user_info The user information.
1.356 - */
1.357 -void purple_account_set_user_info(PurpleAccount *account, const char *user_info);
1.358 -
1.359 -/**
1.360 - * Sets the account's buddy icon path.
1.361 - *
1.362 - * @param account The account.
1.363 - * @param path The buddy icon non-cached path.
1.364 - */
1.365 -void purple_account_set_buddy_icon_path(PurpleAccount *account, const char *path);
1.366 -
1.367 -/**
1.368 - * Sets the account's protocol ID.
1.369 - *
1.370 - * @param account The account.
1.371 - * @param protocol_id The protocol ID.
1.372 - */
1.373 -void purple_account_set_protocol_id(PurpleAccount *account,
1.374 - const char *protocol_id);
1.375 -
1.376 -/**
1.377 - * Sets the account's connection.
1.378 - *
1.379 - * @param account The account.
1.380 - * @param gc The connection.
1.381 - */
1.382 -void purple_account_set_connection(PurpleAccount *account, PurpleConnection *gc);
1.383 -
1.384 -/**
1.385 - * Sets whether or not this account should save its password.
1.386 - *
1.387 - * @param account The account.
1.388 - * @param value @c TRUE if it should remember the password.
1.389 - */
1.390 -void purple_account_set_remember_password(PurpleAccount *account, gboolean value);
1.391 -
1.392 -/**
1.393 - * Sets whether or not this account should check for mail.
1.394 - *
1.395 - * @param account The account.
1.396 - * @param value @c TRUE if it should check for mail.
1.397 - */
1.398 -void purple_account_set_check_mail(PurpleAccount *account, gboolean value);
1.399 -
1.400 -/**
1.401 - * Sets whether or not this account is enabled for the specified
1.402 - * UI.
1.403 - *
1.404 - * @param account The account.
1.405 - * @param ui The UI.
1.406 - * @param value @c TRUE if it is enabled.
1.407 - */
1.408 -void purple_account_set_enabled(PurpleAccount *account, const char *ui,
1.409 - gboolean value);
1.410 -
1.411 -/**
1.412 - * Sets the account's proxy information.
1.413 - *
1.414 - * @param account The account.
1.415 - * @param info The proxy information.
1.416 - */
1.417 -void purple_account_set_proxy_info(PurpleAccount *account, PurpleProxyInfo *info);
1.418 -
1.419 -/**
1.420 - * Sets the account's status types.
1.421 - *
1.422 - * @param account The account.
1.423 - * @param status_types The list of status types.
1.424 - */
1.425 -void purple_account_set_status_types(PurpleAccount *account, GList *status_types);
1.426 -
1.427 -/**
1.428 - * Variadic version of purple_account_set_status_list(); the variadic list
1.429 - * replaces @a attrs, and should be <tt>NULL</tt>-terminated.
1.430 - *
1.431 - * @copydoc purple_account_set_status_list()
1.432 - */
1.433 -void purple_account_set_status(PurpleAccount *account, const char *status_id,
1.434 - gboolean active, ...) G_GNUC_NULL_TERMINATED;
1.435 -
1.436 -
1.437 -/**
1.438 - * Activates or deactivates a status. All changes to the statuses of
1.439 - * an account go through this function or purple_account_set_status().
1.440 - *
1.441 - * You can only deactivate an exclusive status by activating another exclusive
1.442 - * status. So, if @a status_id is an exclusive status and @a active is @c
1.443 - * FALSE, this function does nothing.
1.444 - *
1.445 - * @param account The account.
1.446 - * @param status_id The ID of the status.
1.447 - * @param active Whether @a status_id is to be activated (<tt>TRUE</tt>) or
1.448 - * deactivated (<tt>FALSE</tt>).
1.449 - * @param attrs A list of <tt>const char *</tt> attribute names followed by
1.450 - * <tt>const char *</tt> attribute values for the status.
1.451 - * (For example, one pair might be <tt>"message"</tt> followed
1.452 - * by <tt>"hello, talk to me!"</tt>.)
1.453 - */
1.454 -void purple_account_set_status_list(PurpleAccount *account,
1.455 - const char *status_id, gboolean active, GList *attrs);
1.456 -
1.457 -/**
1.458 - * Clears all protocol-specific settings on an account.
1.459 - *
1.460 - * @param account The account.
1.461 - */
1.462 -void purple_account_clear_settings(PurpleAccount *account);
1.463 -
1.464 -/**
1.465 - * Removes an account-specific setting by name.
1.466 - *
1.467 - * @param account The account.
1.468 - * @param setting The setting to remove.
1.469 - *
1.470 - * @since 2.6.0
1.471 - */
1.472 -void purple_account_remove_setting(PurpleAccount *account, const char *setting);
1.473 -
1.474 -/**
1.475 - * Sets a protocol-specific integer setting for an account.
1.476 - *
1.477 - * @param account The account.
1.478 - * @param name The name of the setting.
1.479 - * @param value The setting's value.
1.480 - */
1.481 -void purple_account_set_int(PurpleAccount *account, const char *name, int value);
1.482 -
1.483 -/**
1.484 - * Sets a protocol-specific string setting for an account.
1.485 - *
1.486 - * @param account The account.
1.487 - * @param name The name of the setting.
1.488 - * @param value The setting's value.
1.489 - */
1.490 -void purple_account_set_string(PurpleAccount *account, const char *name,
1.491 - const char *value);
1.492 -
1.493 -/**
1.494 - * Sets a protocol-specific boolean setting for an account.
1.495 - *
1.496 - * @param account The account.
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_bool(PurpleAccount *account, const char *name,
1.501 - gboolean value);
1.502 -
1.503 -/**
1.504 - * Sets a UI-specific integer 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_int(PurpleAccount *account, const char *ui,
1.512 - const char *name, int value);
1.513 -
1.514 -/**
1.515 - * Sets a UI-specific string 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_string(PurpleAccount *account, const char *ui,
1.523 - const char *name, const char *value);
1.524 -
1.525 -/**
1.526 - * Sets a UI-specific boolean setting for an account.
1.527 - *
1.528 - * @param account The account.
1.529 - * @param ui The UI name.
1.530 - * @param name The name of the setting.
1.531 - * @param value The setting's value.
1.532 - */
1.533 -void purple_account_set_ui_bool(PurpleAccount *account, const char *ui,
1.534 - const char *name, gboolean value);
1.535 -
1.536 -/**
1.537 - * Returns whether or not the account is connected.
1.538 - *
1.539 - * @param account The account.
1.540 - *
1.541 - * @return @c TRUE if connected, or @c FALSE otherwise.
1.542 - */
1.543 -gboolean purple_account_is_connected(const PurpleAccount *account);
1.544 -
1.545 -/**
1.546 - * Returns whether or not the account is connecting.
1.547 - *
1.548 - * @param account The account.
1.549 - *
1.550 - * @return @c TRUE if connecting, or @c FALSE otherwise.
1.551 - */
1.552 -gboolean purple_account_is_connecting(const PurpleAccount *account);
1.553 -
1.554 -/**
1.555 - * Returns whether or not the account is disconnected.
1.556 - *
1.557 - * @param account The account.
1.558 - *
1.559 - * @return @c TRUE if disconnected, or @c FALSE otherwise.
1.560 - */
1.561 -gboolean purple_account_is_disconnected(const PurpleAccount *account);
1.562 -
1.563 -/**
1.564 - * Returns the account's username.
1.565 - *
1.566 - * @param account The account.
1.567 - *
1.568 - * @return The username.
1.569 - */
1.570 -const char *purple_account_get_username(const PurpleAccount *account);
1.571 -
1.572 -/**
1.573 - * Returns the account's password.
1.574 - *
1.575 - * @param account The account.
1.576 - *
1.577 - * @return The password.
1.578 - */
1.579 -const char *purple_account_get_password(const PurpleAccount *account);
1.580 -
1.581 -/**
1.582 - * Returns the account's alias.
1.583 - *
1.584 - * @param account The account.
1.585 - *
1.586 - * @return The alias.
1.587 - */
1.588 -const char *purple_account_get_alias(const PurpleAccount *account);
1.589 -
1.590 -/**
1.591 - * Returns the account's user information.
1.592 - *
1.593 - * @param account The account.
1.594 - *
1.595 - * @return The user information.
1.596 - */
1.597 -const char *purple_account_get_user_info(const PurpleAccount *account);
1.598 -
1.599 -/**
1.600 - * Gets the account's buddy icon path.
1.601 - *
1.602 - * @param account The account.
1.603 - *
1.604 - * @return The buddy icon's non-cached path.
1.605 - */
1.606 -const char *purple_account_get_buddy_icon_path(const PurpleAccount *account);
1.607 -
1.608 -/**
1.609 - * Returns the account's protocol ID.
1.610 - *
1.611 - * @param account The account.
1.612 - *
1.613 - * @return The protocol ID.
1.614 - */
1.615 -const char *purple_account_get_protocol_id(const PurpleAccount *account);
1.616 -
1.617 -/**
1.618 - * Returns the account's protocol name.
1.619 - *
1.620 - * @param account The account.
1.621 - *
1.622 - * @return The protocol name.
1.623 - */
1.624 -const char *purple_account_get_protocol_name(const PurpleAccount *account);
1.625 -
1.626 -/**
1.627 - * Returns the account's connection.
1.628 - *
1.629 - * @param account The account.
1.630 - *
1.631 - * @return The connection.
1.632 - */
1.633 -PurpleConnection *purple_account_get_connection(const PurpleAccount *account);
1.634 -
1.635 -/**
1.636 - * Returns whether or not this account should save its password.
1.637 - *
1.638 - * @param account The account.
1.639 - *
1.640 - * @return @c TRUE if it should remember the password.
1.641 - */
1.642 -gboolean purple_account_get_remember_password(const PurpleAccount *account);
1.643 -
1.644 -/**
1.645 - * Returns whether or not this account should check for mail.
1.646 - *
1.647 - * @param account The account.
1.648 - *
1.649 - * @return @c TRUE if it should check for mail.
1.650 - */
1.651 -gboolean purple_account_get_check_mail(const PurpleAccount *account);
1.652 -
1.653 -/**
1.654 - * Returns whether or not this account is enabled for the
1.655 - * specified UI.
1.656 - *
1.657 - * @param account The account.
1.658 - * @param ui The UI.
1.659 - *
1.660 - * @return @c TRUE if it enabled on this UI.
1.661 - */
1.662 -gboolean purple_account_get_enabled(const PurpleAccount *account,
1.663 - const char *ui);
1.664 -
1.665 -/**
1.666 - * Returns the account's proxy information.
1.667 - *
1.668 - * @param account The account.
1.669 - *
1.670 - * @return The proxy information.
1.671 - */
1.672 -PurpleProxyInfo *purple_account_get_proxy_info(const PurpleAccount *account);
1.673 -
1.674 -/**
1.675 - * Returns the active status for this account. This looks through
1.676 - * the PurplePresence associated with this account and returns the
1.677 - * PurpleStatus that has its active flag set to "TRUE." There can be
1.678 - * only one active PurpleStatus in a PurplePresence.
1.679 - *
1.680 - * @param account The account.
1.681 - *
1.682 - * @return The active status.
1.683 - */
1.684 -PurpleStatus *purple_account_get_active_status(const PurpleAccount *account);
1.685 -
1.686 -/**
1.687 - * Returns the account status with the specified ID.
1.688 - *
1.689 - * Note that this works differently than purple_buddy_get_status() in that
1.690 - * it will only return NULL if the status was not registered.
1.691 - *
1.692 - * @param account The account.
1.693 - * @param status_id The status ID.
1.694 - *
1.695 - * @return The status, or NULL if it was never registered.
1.696 - */
1.697 -PurpleStatus *purple_account_get_status(const PurpleAccount *account,
1.698 - const char *status_id);
1.699 -
1.700 -/**
1.701 - * Returns the account status type with the specified ID.
1.702 - *
1.703 - * @param account The account.
1.704 - * @param id The ID of the status type to find.
1.705 - *
1.706 - * @return The status type if found, or NULL.
1.707 - */
1.708 -PurpleStatusType *purple_account_get_status_type(const PurpleAccount *account,
1.709 - const char *id);
1.710 -
1.711 -/**
1.712 - * Returns the account status type with the specified primitive.
1.713 - * Note: It is possible for an account to have more than one
1.714 - * PurpleStatusType with the same primitive. In this case, the
1.715 - * first PurpleStatusType is returned.
1.716 - *
1.717 - * @param account The account.
1.718 - * @param primitive The type of the status type to find.
1.719 - *
1.720 - * @return The status if found, or NULL.
1.721 - */
1.722 -PurpleStatusType *purple_account_get_status_type_with_primitive(
1.723 - const PurpleAccount *account,
1.724 - PurpleStatusPrimitive primitive);
1.725 -
1.726 -/**
1.727 - * Returns the account's presence.
1.728 - *
1.729 - * @param account The account.
1.730 - *
1.731 - * @return The account's presence.
1.732 - */
1.733 -PurplePresence *purple_account_get_presence(const PurpleAccount *account);
1.734 -
1.735 -/**
1.736 - * Returns whether or not an account status is active.
1.737 - *
1.738 - * @param account The account.
1.739 - * @param status_id The status ID.
1.740 - *
1.741 - * @return TRUE if active, or FALSE if not.
1.742 - */
1.743 -gboolean purple_account_is_status_active(const PurpleAccount *account,
1.744 - const char *status_id);
1.745 -
1.746 -/**
1.747 - * Returns the account's status types.
1.748 - *
1.749 - * @param account The account.
1.750 - *
1.751 - * @constreturn The account's status types.
1.752 - */
1.753 -GList *purple_account_get_status_types(const PurpleAccount *account);
1.754 -
1.755 -/**
1.756 - * Returns a protocol-specific integer setting for an account.
1.757 - *
1.758 - * @param account The account.
1.759 - * @param name The name of the setting.
1.760 - * @param default_value The default value.
1.761 - *
1.762 - * @return The value.
1.763 - */
1.764 -int purple_account_get_int(const PurpleAccount *account, const char *name,
1.765 - int default_value);
1.766 -
1.767 -/**
1.768 - * Returns a protocol-specific string setting for an account.
1.769 - *
1.770 - * @param account The account.
1.771 - * @param name The name of the setting.
1.772 - * @param default_value The default value.
1.773 - *
1.774 - * @return The value.
1.775 - */
1.776 -const char *purple_account_get_string(const PurpleAccount *account,
1.777 - const char *name,
1.778 - const char *default_value);
1.779 -
1.780 -/**
1.781 - * Returns a protocol-specific boolean setting for an account.
1.782 - *
1.783 - * @param account The account.
1.784 - * @param name The name of the setting.
1.785 - * @param default_value The default value.
1.786 - *
1.787 - * @return The value.
1.788 - */
1.789 -gboolean purple_account_get_bool(const PurpleAccount *account, const char *name,
1.790 - gboolean default_value);
1.791 -
1.792 -/**
1.793 - * Returns a UI-specific integer setting for an account.
1.794 - *
1.795 - * @param account The account.
1.796 - * @param ui The UI name.
1.797 - * @param name The name of the setting.
1.798 - * @param default_value The default value.
1.799 - *
1.800 - * @return The value.
1.801 - */
1.802 -int purple_account_get_ui_int(const PurpleAccount *account, const char *ui,
1.803 - const char *name, int default_value);
1.804 -
1.805 -/**
1.806 - * Returns a UI-specific string setting for an account.
1.807 - *
1.808 - * @param account The account.
1.809 - * @param ui The UI name.
1.810 - * @param name The name of the setting.
1.811 - * @param default_value The default value.
1.812 - *
1.813 - * @return The value.
1.814 - */
1.815 -const char *purple_account_get_ui_string(const PurpleAccount *account,
1.816 - const char *ui, const char *name,
1.817 - const char *default_value);
1.818 -
1.819 -/**
1.820 - * Returns a UI-specific boolean setting for an account.
1.821 - *
1.822 - * @param account The account.
1.823 - * @param ui The UI name.
1.824 - * @param name The name of the setting.
1.825 - * @param default_value The default value.
1.826 - *
1.827 - * @return The value.
1.828 - */
1.829 -gboolean purple_account_get_ui_bool(const PurpleAccount *account, const char *ui,
1.830 - const char *name, gboolean default_value);
1.831 -
1.832 -
1.833 -/**
1.834 - * Returns the system log for an account.
1.835 - *
1.836 - * @param account The account.
1.837 - * @param create Should it be created if it doesn't exist?
1.838 - *
1.839 - * @return The log.
1.840 - *
1.841 - * @note Callers should almost always pass @c FALSE for @a create.
1.842 - * Passing @c TRUE could result in an existing log being reopened,
1.843 - * if the log has already been closed, which not all loggers deal
1.844 - * with appropriately.
1.845 - */
1.846 -PurpleLog *purple_account_get_log(PurpleAccount *account, gboolean create);
1.847 -
1.848 -/**
1.849 - * Frees the system log of an account
1.850 - *
1.851 - * @param account The account.
1.852 - */
1.853 -void purple_account_destroy_log(PurpleAccount *account);
1.854 -
1.855 -/**
1.856 - * Adds a buddy to the server-side buddy list for the specified account.
1.857 - *
1.858 - * @param account The account.
1.859 - * @param buddy The buddy to add.
1.860 - */
1.861 -void purple_account_add_buddy(PurpleAccount *account, PurpleBuddy *buddy);
1.862 -/**
1.863 - * Adds a list of buddies to the server-side buddy list.
1.864 - *
1.865 - * @param account The account.
1.866 - * @param buddies The list of PurpleBlistNodes representing the buddies to add.
1.867 - */
1.868 -void purple_account_add_buddies(PurpleAccount *account, GList *buddies);
1.869 -
1.870 -/**
1.871 - * Removes a buddy from the server-side buddy list.
1.872 - *
1.873 - * @param account The account.
1.874 - * @param buddy The buddy to remove.
1.875 - * @param group The group to remove the buddy from.
1.876 - */
1.877 -void purple_account_remove_buddy(PurpleAccount *account, PurpleBuddy *buddy,
1.878 - PurpleGroup *group);
1.879 -
1.880 -/**
1.881 - * Removes a list of buddies from the server-side buddy list.
1.882 - *
1.883 - * @note The lists buddies and groups are parallel lists. Be sure that node n of
1.884 - * groups matches node n of buddies.
1.885 - *
1.886 - * @param account The account.
1.887 - * @param buddies The list of buddies to remove.
1.888 - * @param groups The list of groups to remove buddies from. Each node of this
1.889 - * list should match the corresponding node of buddies.
1.890 - */
1.891 -void purple_account_remove_buddies(PurpleAccount *account, GList *buddies,
1.892 - GList *groups);
1.893 -
1.894 -/**
1.895 - * Removes a group from the server-side buddy list.
1.896 - *
1.897 - * @param account The account.
1.898 - * @param group The group to remove.
1.899 - */
1.900 -void purple_account_remove_group(PurpleAccount *account, PurpleGroup *group);
1.901 -
1.902 -/**
1.903 - * Changes the password on the specified account.
1.904 - *
1.905 - * @param account The account.
1.906 - * @param orig_pw The old password.
1.907 - * @param new_pw The new password.
1.908 - */
1.909 -void purple_account_change_password(PurpleAccount *account, const char *orig_pw,
1.910 - const char *new_pw);
1.911 -
1.912 -/**
1.913 - * Whether the account supports sending offline messages to buddy.
1.914 - *
1.915 - * @param account The account
1.916 - * @param buddy The buddy
1.917 - */
1.918 -gboolean purple_account_supports_offline_message(PurpleAccount *account, PurpleBuddy *buddy);
1.919 -
1.920 -/**
1.921 - * Get the error that caused the account to be disconnected, or @c NULL if the
1.922 - * account is happily connected or disconnected without an error.
1.923 - *
1.924 - * @param account The account whose error should be retrieved.
1.925 - * @constreturn The type of error and a human-readable description of the
1.926 - * current error, or @c NULL if there is no current error. This
1.927 - * pointer is guaranteed to remain valid until the @ref
1.928 - * account-error-changed signal is emitted for @a account.
1.929 - */
1.930 -const PurpleConnectionErrorInfo *purple_account_get_current_error(PurpleAccount *account);
1.931 -
1.932 -/**
1.933 - * Clear an account's current error state, resetting it to @c NULL.
1.934 - *
1.935 - * @param account The account whose error state should be cleared.
1.936 - */
1.937 -void purple_account_clear_current_error(PurpleAccount *account);
1.938 -
1.939 -/*@}*/
1.940 -
1.941 -/**************************************************************************/
1.942 -/** @name Accounts API */
1.943 -/**************************************************************************/
1.944 -/*@{*/
1.945 -
1.946 -/**
1.947 - * Adds an account to the list of accounts.
1.948 - *
1.949 - * @param account The account.
1.950 - */
1.951 -void purple_accounts_add(PurpleAccount *account);
1.952 -
1.953 -/**
1.954 - * Removes an account from the list of accounts.
1.955 - *
1.956 - * @param account The account.
1.957 - */
1.958 -void purple_accounts_remove(PurpleAccount *account);
1.959 -
1.960 -/**
1.961 - * Deletes an account.
1.962 - *
1.963 - * This will remove any buddies from the buddy list that belong to this
1.964 - * account, buddy pounces that belong to this account, and will also
1.965 - * destroy @a account.
1.966 - *
1.967 - * @param account The account.
1.968 - */
1.969 -void purple_accounts_delete(PurpleAccount *account);
1.970 -
1.971 -/**
1.972 - * Reorders an account.
1.973 - *
1.974 - * @param account The account to reorder.
1.975 - * @param new_index The new index for the account.
1.976 - */
1.977 -void purple_accounts_reorder(PurpleAccount *account, gint new_index);
1.978 -
1.979 -/**
1.980 - * Returns a list of all accounts.
1.981 - *
1.982 - * @constreturn A list of all accounts.
1.983 - */
1.984 -GList *purple_accounts_get_all(void);
1.985 -
1.986 -/**
1.987 - * Returns a list of all enabled accounts
1.988 - *
1.989 - * @return A list of all enabled accounts. The list is owned
1.990 - * by the caller, and must be g_list_free()d to avoid
1.991 - * leaking the nodes.
1.992 - */
1.993 -GList *purple_accounts_get_all_active(void);
1.994 -
1.995 -/**
1.996 - * Finds an account with the specified name and protocol id.
1.997 - *
1.998 - * @param name The account username.
1.999 - * @param protocol The account protocol ID.
1.1000 - *
1.1001 - * @return The account, if found, or @c FALSE otherwise.
1.1002 - */
1.1003 -PurpleAccount *purple_accounts_find(const char *name, const char *protocol);
1.1004 -
1.1005 -/**
1.1006 - * This is called by the core after all subsystems and what
1.1007 - * not have been initialized. It sets all enabled accounts
1.1008 - * to their startup status by signing them on, setting them
1.1009 - * away, etc.
1.1010 - *
1.1011 - * You probably shouldn't call this unless you really know
1.1012 - * what you're doing.
1.1013 - */
1.1014 -void purple_accounts_restore_current_statuses(void);
1.1015 -
1.1016 -/*@}*/
1.1017 -
1.1018 -
1.1019 -/**************************************************************************/
1.1020 -/** @name UI Registration Functions */
1.1021 -/**************************************************************************/
1.1022 -/*@{*/
1.1023 -/**
1.1024 - * Sets the UI operations structure to be used for accounts.
1.1025 - *
1.1026 - * @param ops The UI operations structure.
1.1027 - */
1.1028 -void purple_accounts_set_ui_ops(PurpleAccountUiOps *ops);
1.1029 -
1.1030 -/**
1.1031 - * Returns the UI operations structure used for accounts.
1.1032 - *
1.1033 - * @return The UI operations structure in use.
1.1034 - */
1.1035 -PurpleAccountUiOps *purple_accounts_get_ui_ops(void);
1.1036 -
1.1037 -/*@}*/
1.1038 -
1.1039 -
1.1040 -/**************************************************************************/
1.1041 -/** @name Accounts Subsystem */
1.1042 -/**************************************************************************/
1.1043 -/*@{*/
1.1044 -
1.1045 -/**
1.1046 - * Returns the accounts subsystem handle.
1.1047 - *
1.1048 - * @return The accounts subsystem handle.
1.1049 - */
1.1050 -void *purple_accounts_get_handle(void);
1.1051 -
1.1052 -/**
1.1053 - * Initializes the accounts subsystem.
1.1054 - */
1.1055 -void purple_accounts_init(void);
1.1056 -
1.1057 -/**
1.1058 - * Uninitializes the accounts subsystem.
1.1059 - */
1.1060 -void purple_accounts_uninit(void);
1.1061 -
1.1062 -/*@}*/
1.1063 -
1.1064 -#ifdef __cplusplus
1.1065 -}
1.1066 -#endif
1.1067 -
1.1068 -#endif /* _PURPLE_ACCOUNT_H_ */
2.1 --- a/Frameworks/libpurple.framework/Versions/0.6.0/Headers/accountopt.h Fri Aug 21 13:24:36 2009 -0700
2.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
2.3 @@ -1,395 +0,0 @@
2.4 -/**
2.5 - * @file accountopt.h Account Options API
2.6 - * @ingroup core
2.7 - */
2.8 -
2.9 -/* purple
2.10 - *
2.11 - * Purple is the legal property of its developers, whose names are too numerous
2.12 - * to list here. Please refer to the COPYRIGHT file distributed with this
2.13 - * source distribution.
2.14 - *
2.15 - * This program is free software; you can redistribute it and/or modify
2.16 - * it under the terms of the GNU General Public License as published by
2.17 - * the Free Software Foundation; either version 2 of the License, or
2.18 - * (at your option) any later version.
2.19 - *
2.20 - * This program is distributed in the hope that it will be useful,
2.21 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
2.22 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2.23 - * GNU General Public License for more details.
2.24 - *
2.25 - * You should have received a copy of the GNU General Public License
2.26 - * along with this program; if not, write to the Free Software
2.27 - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
2.28 - */
2.29 -#ifndef _PURPLE_ACCOUNTOPT_H_
2.30 -#define _PURPLE_ACCOUNTOPT_H_
2.31 -
2.32 -#include "prefs.h"
2.33 -
2.34 -/**
2.35 - * An option for an account.
2.36 - *
2.37 - * This is set by protocol plugins, and appears in the account settings
2.38 - * dialogs.
2.39 - */
2.40 -typedef struct
2.41 -{
2.42 - PurplePrefType type; /**< The type of value. */
2.43 -
2.44 - char *text; /**< The text that will appear to the user. */
2.45 - char *pref_name; /**< The name of the associated preference. */
2.46 -
2.47 - union
2.48 - {
2.49 - gboolean boolean; /**< The default boolean value. */
2.50 - int integer; /**< The default integer value. */
2.51 - char *string; /**< The default string value. */
2.52 - GList *list; /**< The default list value. */
2.53 -
2.54 - } default_value;
2.55 -
2.56 - gboolean masked; /**< Whether the value entered should be
2.57 - * obscured from view (for passwords and
2.58 - * similar options)
2.59 - */
2.60 -} PurpleAccountOption;
2.61 -
2.62 -/**
2.63 - * A username split.
2.64 - *
2.65 - * This is used by some protocols to separate the fields of the username
2.66 - * into more human-readable components.
2.67 - */
2.68 -typedef struct
2.69 -{
2.70 - char *text; /**< The text that will appear to the user. */
2.71 - char *default_value; /**< The default value. */
2.72 - char field_sep; /**< The field separator. */
2.73 - gboolean reverse; /**< TRUE if the separator should be found
2.74 - starting a the end of the string, FALSE
2.75 - otherwise */
2.76 -
2.77 -} PurpleAccountUserSplit;
2.78 -
2.79 -#ifdef __cplusplus
2.80 -extern "C" {
2.81 -#endif
2.82 -
2.83 -/**************************************************************************/
2.84 -/** @name Account Option API */
2.85 -/**************************************************************************/
2.86 -/*@{*/
2.87 -
2.88 -/**
2.89 - * Creates a new account option. If you know what @a type will be in advance,
2.90 - * consider using purple_account_option_bool_new(),
2.91 - * purple_account_option_int_new(), purple_account_option_string_new() or
2.92 - * purple_account_option_list_new() (as appropriate) instead.
2.93 - *
2.94 - * @param type The type of option.
2.95 - * @param text The text of the option.
2.96 - * @param pref_name The account preference name for the option.
2.97 - *
2.98 - * @return The account option.
2.99 - */
2.100 -PurpleAccountOption *purple_account_option_new(PurplePrefType type,
2.101 - const char *text, const char *pref_name);
2.102 -
2.103 -/**
2.104 - * Creates a new boolean account option.
2.105 - *
2.106 - * @param text The text of the option.
2.107 - * @param pref_name The account preference name for the option.
2.108 - * @param default_value The default value.
2.109 - *
2.110 - * @return The account option.
2.111 - */
2.112 -PurpleAccountOption *purple_account_option_bool_new(const char *text,
2.113 - const char *pref_name, gboolean default_value);
2.114 -
2.115 -/**
2.116 - * Creates a new integer account option.
2.117 - *
2.118 - * @param text The text of the option.
2.119 - * @param pref_name The account preference name for the option.
2.120 - * @param default_value The default value.
2.121 - *
2.122 - * @return The account option.
2.123 - */
2.124 -PurpleAccountOption *purple_account_option_int_new(const char *text,
2.125 - const char *pref_name, int default_value);
2.126 -
2.127 -/**
2.128 - * Creates a new string account option.
2.129 - *
2.130 - * @param text The text of the option.
2.131 - * @param pref_name The account preference name for the option.
2.132 - * @param default_value The default value.
2.133 - *
2.134 - * @return The account option.
2.135 - */
2.136 -PurpleAccountOption *purple_account_option_string_new(const char *text,
2.137 - const char *pref_name, const char *default_value);
2.138 -
2.139 -/**
2.140 - * Creates a new list account option.
2.141 - *
2.142 - * The list passed will be owned by the account option, and the
2.143 - * strings inside will be freed automatically.
2.144 - *
2.145 - * The list is a list of #PurpleKeyValuePair items. The key is the label that
2.146 - * should be displayed to the user, and the <tt>(const char *)</tt> value is
2.147 - * the internal ID that should be passed to purple_account_set_string() to
2.148 - * choose that value.
2.149 - *
2.150 - * @param text The text of the option.
2.151 - * @param pref_name The account preference name for the option.
2.152 - * @param list The key, value list.
2.153 - *
2.154 - * @return The account option.
2.155 - */
2.156 -PurpleAccountOption *purple_account_option_list_new(const char *text,
2.157 - const char *pref_name, GList *list);
2.158 -
2.159 -/**
2.160 - * Destroys an account option.
2.161 - *
2.162 - * @param option The option to destroy.
2.163 - */
2.164 -void purple_account_option_destroy(PurpleAccountOption *option);
2.165 -
2.166 -/**
2.167 - * Sets the default boolean value for an account option.
2.168 - *
2.169 - * @param option The account option.
2.170 - * @param value The default boolean value.
2.171 - */
2.172 -void purple_account_option_set_default_bool(PurpleAccountOption *option,
2.173 - gboolean value);
2.174 -
2.175 -/**
2.176 - * Sets the default integer value for an account option.
2.177 - *
2.178 - * @param option The account option.
2.179 - * @param value The default integer value.
2.180 - */
2.181 -void purple_account_option_set_default_int(PurpleAccountOption *option,
2.182 - int value);
2.183 -
2.184 -/**
2.185 - * Sets the default string value for an account option.
2.186 - *
2.187 - * @param option The account option.
2.188 - * @param value The default string value.
2.189 - */
2.190 -void purple_account_option_set_default_string(PurpleAccountOption *option,
2.191 - const char *value);
2.192 -
2.193 -/**
2.194 - * Sets the masking for an account option. Setting this to %TRUE acts
2.195 - * as a hint to the UI that the option's value should be obscured from
2.196 - * view, like a password.
2.197 - *
2.198 - * @param option The account option.
2.199 - * @param masked The masking.
2.200 - */
2.201 -void
2.202 -purple_account_option_set_masked(PurpleAccountOption *option, gboolean masked);
2.203 -
2.204 -/**
2.205 - * Sets the list values for an account option.
2.206 - *
2.207 - * The list passed will be owned by the account option, and the
2.208 - * strings inside will be freed automatically.
2.209 - *
2.210 - * The list is in key, value pairs. The key is the ID stored and used
2.211 - * internally, and the value is the label displayed.
2.212 - *
2.213 - * @param option The account option.
2.214 - * @param values The default list value.
2.215 - */
2.216 -void purple_account_option_set_list(PurpleAccountOption *option, GList *values);
2.217 -
2.218 -/**
2.219 - * Adds an item to a list account option.
2.220 - *
2.221 - * @param option The account option.
2.222 - * @param key The key.
2.223 - * @param value The value.
2.224 - */
2.225 -void purple_account_option_add_list_item(PurpleAccountOption *option,
2.226 - const char *key, const char *value);
2.227 -
2.228 -/**
2.229 - * Returns the specified account option's type.
2.230 - *
2.231 - * @param option The account option.
2.232 - *
2.233 - * @return The account option's type.
2.234 - */
2.235 -PurplePrefType purple_account_option_get_type(const PurpleAccountOption *option);
2.236 -
2.237 -/**
2.238 - * Returns the text for an account option.
2.239 - *
2.240 - * @param option The account option.
2.241 - *
2.242 - * @return The account option's text.
2.243 - */
2.244 -const char *purple_account_option_get_text(const PurpleAccountOption *option);
2.245 -
2.246 -/**
2.247 - * Returns the name of an account option. This corresponds to the @c pref_name
2.248 - * parameter supplied to purple_account_option_new() or one of the
2.249 - * type-specific constructors.
2.250 - *
2.251 - * @param option The account option.
2.252 - *
2.253 - * @return The option's name.
2.254 - */
2.255 -const char *purple_account_option_get_setting(const PurpleAccountOption *option);
2.256 -
2.257 -/**
2.258 - * Returns the default boolean value for an account option.
2.259 - *
2.260 - * @param option The account option.
2.261 - *
2.262 - * @return The default boolean value.
2.263 - */
2.264 -gboolean purple_account_option_get_default_bool(const PurpleAccountOption *option);
2.265 -
2.266 -/**
2.267 - * Returns the default integer value for an account option.
2.268 - *
2.269 - * @param option The account option.
2.270 - *
2.271 - * @return The default integer value.
2.272 - */
2.273 -int purple_account_option_get_default_int(const PurpleAccountOption *option);
2.274 -
2.275 -/**
2.276 - * Returns the default string value for an account option.
2.277 - *
2.278 - * @param option The account option.
2.279 - *
2.280 - * @return The default string value.
2.281 - */
2.282 -const char *purple_account_option_get_default_string(
2.283 - const PurpleAccountOption *option);
2.284 -
2.285 -/**
2.286 - * Returns the default string value for a list account option.
2.287 - *
2.288 - * @param option The account option.
2.289 - *
2.290 - * @return The default list string value.
2.291 - */
2.292 -const char *purple_account_option_get_default_list_value(
2.293 - const PurpleAccountOption *option);
2.294 -
2.295 -/**
2.296 - * Returns whether an option's value should be masked from view, like a
2.297 - * password. If so, the UI might display each character of the option
2.298 - * as a '*' (for example).
2.299 - *
2.300 - * @param option The account option.
2.301 - *
2.302 - * @return %TRUE if the option's value should be obscured.
2.303 - */
2.304 -gboolean
2.305 -purple_account_option_get_masked(const PurpleAccountOption *option);
2.306 -
2.307 -/**
2.308 - * Returns the list values for an account option.
2.309 - *
2.310 - * @param option The account option.
2.311 - *
2.312 - * @constreturn A list of #PurpleKeyValuePair, mapping the human-readable
2.313 - * description of the value to the <tt>(const char *)</tt> that
2.314 - * should be passed to purple_account_set_string() to set the
2.315 - * option.
2.316 - */
2.317 -GList *purple_account_option_get_list(const PurpleAccountOption *option);
2.318 -
2.319 -/*@}*/
2.320 -
2.321 -
2.322 -/**************************************************************************/
2.323 -/** @name Account User Split API */
2.324 -/**************************************************************************/
2.325 -/*@{*/
2.326 -
2.327 -/**
2.328 - * Creates a new account username split.
2.329 - *
2.330 - * @param text The text of the option.
2.331 - * @param default_value The default value.
2.332 - * @param sep The field separator.
2.333 - *
2.334 - * @return The new user split.
2.335 - */
2.336 -PurpleAccountUserSplit *purple_account_user_split_new(const char *text,
2.337 - const char *default_value,
2.338 - char sep);
2.339 -
2.340 -/**
2.341 - * Destroys an account username split.
2.342 - *
2.343 - * @param split The split to destroy.
2.344 - */
2.345 -void purple_account_user_split_destroy(PurpleAccountUserSplit *split);
2.346 -
2.347 -/**
2.348 - * Returns the text for an account username split.
2.349 - *
2.350 - * @param split The account username split.
2.351 - *
2.352 - * @return The account username split's text.
2.353 - */
2.354 -const char *purple_account_user_split_get_text(const PurpleAccountUserSplit *split);
2.355 -
2.356 -/**
2.357 - * Returns the default string value for an account split.
2.358 - *
2.359 - * @param split The account username split.
2.360 - *
2.361 - * @return The default string.
2.362 - */
2.363 -const char *purple_account_user_split_get_default_value(
2.364 - const PurpleAccountUserSplit *split);
2.365 -
2.366 -/**
2.367 - * Returns the field separator for an account split.
2.368 - *
2.369 - * @param split The account username split.
2.370 - *
2.371 - * @return The field separator.
2.372 - */
2.373 -char purple_account_user_split_get_separator(const PurpleAccountUserSplit *split);
2.374 -
2.375 -/**
2.376 - * Returns the 'reverse' value for an account split.
2.377 - *
2.378 - * @param split The account username split.
2.379 - *
2.380 - * @return The 'reverse' value.
2.381 - */
2.382 -gboolean purple_account_user_split_get_reverse(const PurpleAccountUserSplit *split);
2.383 -
2.384 -/**
2.385 - * Sets the 'reverse' value for an account split.
2.386 - *
2.387 - * @param split The account username split.
2.388 - * @param reverse The 'reverse' value
2.389 - */
2.390 -void purple_account_user_split_set_reverse(PurpleAccountUserSplit *split, gboolean reverse);
2.391 -
2.392 -/*@}*/
2.393 -
2.394 -#ifdef __cplusplus
2.395 -}
2.396 -#endif
2.397 -
2.398 -#endif /* _PURPLE_ACCOUNTOPT_H_ */
3.1 --- a/Frameworks/libpurple.framework/Versions/0.6.0/Headers/blist.h Fri Aug 21 13:24:36 2009 -0700
3.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
3.3 @@ -1,1248 +0,0 @@
3.4 -/**
3.5 - * @file blist.h Buddy List API
3.6 - * @ingroup core
3.7 - * @see @ref blist-signals
3.8 - */
3.9 -
3.10 -/* purple
3.11 - *
3.12 - * Purple is the legal property of its developers, whose names are too numerous
3.13 - * to list here. Please refer to the COPYRIGHT file distributed with this
3.14 - * source distribution.
3.15 - *
3.16 - * This program is free software; you can redistribute it and/or modify
3.17 - * it under the terms of the GNU General Public License as published by
3.18 - * the Free Software Foundation; either version 2 of the License, or
3.19 - * (at your option) any later version.
3.20 - *
3.21 - * This program is distributed in the hope that it will be useful,
3.22 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
3.23 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3.24 - * GNU General Public License for more details.
3.25 - *
3.26 - * You should have received a copy of the GNU General Public License
3.27 - * along with this program; if not, write to the Free Software
3.28 - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
3.29 - */
3.30 -#ifndef _PURPLE_BLIST_H_
3.31 -#define _PURPLE_BLIST_H_
3.32 -
3.33 -/* I can't believe I let ChipX86 inspire me to write good code. -Sean */
3.34 -
3.35 -#include <glib.h>
3.36 -
3.37 -/** @copydoc _PurpleBuddyList */
3.38 -typedef struct _PurpleBuddyList PurpleBuddyList;
3.39 -/** @copydoc _PurpleBlistUiOps */
3.40 -typedef struct _PurpleBlistUiOps PurpleBlistUiOps;
3.41 -/** @copydoc _PurpleBlistNode */
3.42 -typedef struct _PurpleBlistNode PurpleBlistNode;
3.43 -
3.44 -/** @copydoc _PurpleChat */
3.45 -typedef struct _PurpleChat PurpleChat;
3.46 -/** @copydoc _PurpleGroup */
3.47 -typedef struct _PurpleGroup PurpleGroup;
3.48 -/** @copydoc _PurpleContact */
3.49 -typedef struct _PurpleContact PurpleContact;
3.50 -/** @copydoc _PurpleBuddy */
3.51 -typedef struct _PurpleBuddy PurpleBuddy;
3.52 -
3.53 -/**************************************************************************/
3.54 -/* Enumerations */
3.55 -/**************************************************************************/
3.56 -typedef enum
3.57 -{
3.58 - PURPLE_BLIST_GROUP_NODE,
3.59 - PURPLE_BLIST_CONTACT_NODE,
3.60 - PURPLE_BLIST_BUDDY_NODE,
3.61 - PURPLE_BLIST_CHAT_NODE,
3.62 - PURPLE_BLIST_OTHER_NODE
3.63 -
3.64 -} PurpleBlistNodeType;
3.65 -
3.66 -#define PURPLE_BLIST_NODE_IS_CHAT(n) (purple_blist_node_get_type(n) == PURPLE_BLIST_CHAT_NODE)
3.67 -#define PURPLE_BLIST_NODE_IS_BUDDY(n) (purple_blist_node_get_type(n) == PURPLE_BLIST_BUDDY_NODE)
3.68 -#define PURPLE_BLIST_NODE_IS_CONTACT(n) (purple_blist_node_get_type(n) == PURPLE_BLIST_CONTACT_NODE)
3.69 -#define PURPLE_BLIST_NODE_IS_GROUP(n) (purple_blist_node_get_type(n) == PURPLE_BLIST_GROUP_NODE)
3.70 -
3.71 -#define PURPLE_BUDDY_IS_ONLINE(b) \
3.72 - ((b) != NULL && purple_account_is_connected(purple_buddy_get_account(b)) && \
3.73 - purple_presence_is_online(purple_buddy_get_presence(b)))
3.74 -
3.75 -typedef enum
3.76 -{
3.77 - PURPLE_BLIST_NODE_FLAG_NO_SAVE = 1 << 0 /**< node should not be saved with the buddy list */
3.78 -
3.79 -} PurpleBlistNodeFlags;
3.80 -
3.81 -/**
3.82 - * @since 2.6.0
3.83 - */
3.84 -#define PURPLE_BLIST_NODE(obj) ((PurpleBlistNode *)(obj))
3.85 -
3.86 -#define PURPLE_BLIST_NODE_HAS_FLAG(b, f) (purple_blist_node_get_flags((PurpleBlistNode*)(b)) & (f))
3.87 -#define PURPLE_BLIST_NODE_SHOULD_SAVE(b) (! PURPLE_BLIST_NODE_HAS_FLAG(b, PURPLE_BLIST_NODE_FLAG_NO_SAVE))
3.88 -
3.89 -#define PURPLE_BLIST_NODE_NAME(n) (purple_blist_node_get_type(n) == PURPLE_BLIST_CHAT_NODE ? purple_chat_get_name((PurpleChat*)n) : \
3.90 - purple_blist_node_get_type(n) == PURPLE_BLIST_BUDDY_NODE ? purple_buddy_get_name((PurpleBuddy*)n) : NULL)
3.91 -
3.92 -/**
3.93 - * @since 2.6.0
3.94 - */
3.95 -#define PURPLE_GROUP(obj) ((PurpleGroup *)(obj))
3.96 -
3.97 -/**
3.98 - * @since 2.6.0
3.99 - */
3.100 -#define PURPLE_CONTACT(obj) ((PurpleContact *)(obj))
3.101 -
3.102 -/**
3.103 - * @since 2.6.0
3.104 - */
3.105 -#define PURPLE_BUDDY(obj) ((PurpleBuddy *)(obj))
3.106 -
3.107 -/**
3.108 - * @since 2.6.0
3.109 - */
3.110 -#define PURPLE_CHAT(obj) ((PurpleChat *)(obj))
3.111 -
3.112 -#include "account.h"
3.113 -#include "buddyicon.h"
3.114 -#include "status.h"
3.115 -
3.116 -/**************************************************************************/
3.117 -/* Data Structures */
3.118 -/**************************************************************************/
3.119 -
3.120 -#if !(defined PURPLE_HIDE_STRUCTS) || (defined _PURPLE_BLIST_C_)
3.121 -
3.122 -/**
3.123 - * A Buddy list node. This can represent a group, a buddy, or anything else.
3.124 - * This is a base class for PurpleBuddy, PurpleContact, PurpleGroup, and for
3.125 - * anything else that wants to put itself in the buddy list. */
3.126 -struct _PurpleBlistNode {
3.127 - PurpleBlistNodeType type; /**< The type of node this is */
3.128 - PurpleBlistNode *prev; /**< The sibling before this buddy. */
3.129 - PurpleBlistNode *next; /**< The sibling after this buddy. */
3.130 - PurpleBlistNode *parent; /**< The parent of this node */
3.131 - PurpleBlistNode *child; /**< The child of this node */
3.132 - GHashTable *settings; /**< per-node settings */
3.133 - void *ui_data; /**< The UI can put data here. */
3.134 - PurpleBlistNodeFlags flags; /**< The buddy flags */
3.135 -};
3.136 -
3.137 -/**
3.138 - * A buddy. This contains everything Purple will ever need to know about someone on the buddy list. Everything.
3.139 - */
3.140 -struct _PurpleBuddy {
3.141 - PurpleBlistNode node; /**< The node that this buddy inherits from */
3.142 - char *name; /**< The name of the buddy. */
3.143 - char *alias; /**< The user-set alias of the buddy */
3.144 - char *server_alias; /**< The server-specified alias of the buddy. (i.e. MSN "Friendly Names") */
3.145 - void *proto_data; /**< This allows the prpl to associate whatever data it wants with a buddy */
3.146 - PurpleBuddyIcon *icon; /**< The buddy icon. */
3.147 - PurpleAccount *account; /**< the account this buddy belongs to */
3.148 - PurplePresence *presence;
3.149 -};
3.150 -
3.151 -/**
3.152 - * A contact. This contains everything Purple will ever need to know about a contact.
3.153 - */
3.154 -struct _PurpleContact {
3.155 - PurpleBlistNode node; /**< The node that this contact inherits from. */
3.156 - char *alias; /**< The user-set alias of the contact */
3.157 - int totalsize; /**< The number of buddies in this contact */
3.158 - int currentsize; /**< The number of buddies in this contact corresponding to online accounts */
3.159 - int online; /**< The number of buddies in this contact who are currently online */
3.160 - PurpleBuddy *priority; /**< The "top" buddy for this contact */
3.161 - gboolean priority_valid; /**< Is priority valid? */
3.162 -};
3.163 -
3.164 -
3.165 -/**
3.166 - * A group. This contains everything Purple will ever need to know about a group.
3.167 - */
3.168 -struct _PurpleGroup {
3.169 - PurpleBlistNode node; /**< The node that this group inherits from */
3.170 - char *name; /**< The name of this group. */
3.171 - int totalsize; /**< The number of chats and contacts in this group */
3.172 - int currentsize; /**< The number of chats and contacts in this group corresponding to online accounts */
3.173 - int online; /**< The number of chats and contacts in this group who are currently online */
3.174 -};
3.175 -
3.176 -/**
3.177 - * A chat. This contains everything Purple needs to put a chat room in the
3.178 - * buddy list.
3.179 - */
3.180 -struct _PurpleChat {
3.181 - PurpleBlistNode node; /**< The node that this chat inherits from */
3.182 - char *alias; /**< The display name of this chat. */
3.183 - GHashTable *components; /**< the stuff the protocol needs to know to join the chat */
3.184 - PurpleAccount *account; /**< The account this chat is attached to */
3.185 -};
3.186 -
3.187 -/**
3.188 - * The Buddy List
3.189 - */
3.190 -struct _PurpleBuddyList {
3.191 - PurpleBlistNode *root; /**< The first node in the buddy list */
3.192 - GHashTable *buddies; /**< Every buddy in this list */
3.193 - void *ui_data; /**< UI-specific data. */
3.194 -};
3.195 -
3.196 -#endif /* PURPLE_HIDE_STRUCTS && PURPLE_BLIST_STRUCTS */
3.197 -
3.198 -/**
3.199 - * Buddy list UI operations.
3.200 - *
3.201 - * Any UI representing a buddy list must assign a filled-out PurpleBlistUiOps
3.202 - * structure to the buddy list core.
3.203 - */
3.204 -struct _PurpleBlistUiOps
3.205 -{
3.206 - void (*new_list)(PurpleBuddyList *list); /**< Sets UI-specific data on a buddy list. */
3.207 - void (*new_node)(PurpleBlistNode *node); /**< Sets UI-specific data on a node. */
3.208 - void (*show)(PurpleBuddyList *list); /**< The core will call this when it's finished doing its core stuff */
3.209 - void (*update)(PurpleBuddyList *list,
3.210 - PurpleBlistNode *node); /**< This will update a node in the buddy list. */
3.211 - void (*remove)(PurpleBuddyList *list,
3.212 - PurpleBlistNode *node); /**< This removes a node from the list */
3.213 - void (*destroy)(PurpleBuddyList *list); /**< When the list is destroyed, this is called to destroy the UI. */
3.214 - void (*set_visible)(PurpleBuddyList *list,
3.215 - gboolean show); /**< Hides or unhides the buddy list */
3.216 - void (*request_add_buddy)(PurpleAccount *account, const char *username,
3.217 - const char *group, const char *alias);
3.218 - void (*request_add_chat)(PurpleAccount *account, PurpleGroup *group,
3.219 - const char *alias, const char *name);
3.220 - void (*request_add_group)(void);
3.221 -
3.222 - /**
3.223 - * This is called when a node has been modified and should be saved.
3.224 - *
3.225 - * Implementation of this UI op is OPTIONAL. If not implemented, it will
3.226 - * be set to a fallback function that saves data to blist.xml like in
3.227 - * previous libpurple versions.
3.228 - *
3.229 - * @attrib node The node which has been modified.
3.230 - *
3.231 - * @since 2.6.0.
3.232 - */
3.233 - void (*save_node)(PurpleBlistNode *node);
3.234 -
3.235 - /**
3.236 - * Called when a node is about to be removed from the buddy list.
3.237 - * The UI op should update the relevant data structures to remove this
3.238 - * node (for example, removing a buddy from the group this node is in).
3.239 - *
3.240 - * Implementation of this UI op is OPTIONAL. If not implemented, it will
3.241 - * be set to a fallback function that saves data to blist.xml like in
3.242 - * previous libpurple versions.
3.243 - *
3.244 - * @attrib node The node which has been modified.
3.245 - * @since 2.6.0.
3.246 - */
3.247 - void (*remove_node)(PurpleBlistNode *node);
3.248 -
3.249 - /**
3.250 - * Called to save all the data for an account. If the UI sets this,
3.251 - * the callback must save the privacy and buddy list data for an account.
3.252 - * If the account is NULL, save the data for all accounts.
3.253 - *
3.254 - * Implementation of this UI op is OPTIONAL. If not implemented, it will
3.255 - * be set to a fallback function that saves data to blist.xml like in
3.256 - * previous libpurple versions.
3.257 - *
3.258 - * @attrib account The account whose data to save. If NULL, save all data
3.259 - * for all accounts.
3.260 - * @since 2.6.0.
3.261 - */
3.262 - void (*save_account)(PurpleAccount *account);
3.263 -
3.264 - void (*_purple_reserved1)(void);
3.265 -};
3.266 -
3.267 -#ifdef __cplusplus
3.268 -extern "C" {
3.269 -#endif
3.270 -
3.271 -/**************************************************************************/
3.272 -/** @name Buddy List API */
3.273 -/**************************************************************************/
3.274 -/*@{*/
3.275 -
3.276 -/**
3.277 - * Creates a new buddy list
3.278 - *
3.279 - * @return The new buddy list.
3.280 - * @deprecated In 3.0.0, this will be handled by purple_blist_init()
3.281 - */
3.282 -PurpleBuddyList *purple_blist_new(void);
3.283 -
3.284 -/**
3.285 - * Sets the main buddy list.
3.286 - *
3.287 - * @param blist The buddy list you want to use.
3.288 - * @deprecated In 3.0.0, this will be handled by purple_blist_init()
3.289 - */
3.290 -void purple_set_blist(PurpleBuddyList *blist);
3.291 -
3.292 -/**
3.293 - * Returns the main buddy list.
3.294 - *
3.295 - * @return The main buddy list.
3.296 - */
3.297 -PurpleBuddyList *purple_get_blist(void);
3.298 -
3.299 -/**
3.300 - * Returns the root node of the main buddy list.
3.301 - *
3.302 - * @return The root node.
3.303 - */
3.304 -PurpleBlistNode *purple_blist_get_root(void);
3.305 -
3.306 -/**
3.307 - * Returns a list of every buddy in the list. Use of this function is
3.308 - * discouraged if you do not actually need every buddy in the list. Use
3.309 - * purple_find_buddies instead.
3.310 - *
3.311 - * @return A list of every buddy in the list. Caller is responsible for
3.312 - * freeing the list.
3.313 - *
3.314 - * @see purple_find_buddies
3.315 - * @since 2.6.0
3.316 - */
3.317 -GSList *purple_blist_get_buddies(void);
3.318 -
3.319 -/**
3.320 - * Returns the UI data for the list.
3.321 - *
3.322 - * @return The UI data for the list.
3.323 - *
3.324 - * @since 2.6.0
3.325 - */
3.326 -gpointer purple_blist_get_ui_data(void);
3.327 -
3.328 -/**
3.329 - * Sets the UI data for the list.
3.330 - *
3.331 - * @param ui_data The UI data for the list.
3.332 - *
3.333 - * @since 2.6.0
3.334 - */
3.335 -void purple_blist_set_ui_data(gpointer ui_data);
3.336 -
3.337 -/**
3.338 - * Returns the next node of a given node. This function is to be used to iterate
3.339 - * over the tree returned by purple_get_blist.
3.340 - *
3.341 - * @param node A node.
3.342 - * @param offline Whether to include nodes for offline accounts
3.343 - * @return The next node
3.344 - * @see purple_blist_node_get_parent
3.345 - * @see purple_blist_node_get_first_child
3.346 - * @see purple_blist_node_get_sibling_next
3.347 - * @see purple_blist_node_get_sibling_prev
3.348 - */
3.349 -PurpleBlistNode *purple_blist_node_next(PurpleBlistNode *node, gboolean offline);
3.350 -
3.351 -/**
3.352 - * Returns the parent node of a given node.
3.353 - *
3.354 - * @param node A node.
3.355 - * @return The parent node.
3.356 - * @since 2.4.0
3.357 - * @see purple_blist_node_get_first_child
3.358 - * @see purple_blist_node_get_sibling_next
3.359 - * @see purple_blist_node_get_sibling_prev
3.360 - * @see purple_blist_node_next
3.361 - */
3.362 -PurpleBlistNode *purple_blist_node_get_parent(PurpleBlistNode *node);
3.363 -
3.364 -/**
3.365 - * Returns the the first child node of a given node.
3.366 - *
3.367 - * @param node A node.
3.368 - * @return The child node.
3.369 - * @since 2.4.0
3.370 - * @see purple_blist_node_get_parent
3.371 - * @see purple_blist_node_get_sibling_next
3.372 - * @see purple_blist_node_get_sibling_prev
3.373 - * @see purple_blist_node_next
3.374 - */
3.375 -PurpleBlistNode *purple_blist_node_get_first_child(PurpleBlistNode *node);
3.376 -
3.377 -/**
3.378 - * Returns the sibling node of a given node.
3.379 - *
3.380 - * @param node A node.
3.381 - * @return The sibling node.
3.382 - * @since 2.4.0
3.383 - * @see purple_blist_node_get_parent
3.384 - * @see purple_blist_node_get_first_child
3.385 - * @see purple_blist_node_get_sibling_prev
3.386 - * @see purple_blist_node_next
3.387 - */
3.388 -PurpleBlistNode *purple_blist_node_get_sibling_next(PurpleBlistNode *node);
3.389 -
3.390 -/**
3.391 - * Returns the previous sibling node of a given node.
3.392 - *
3.393 - * @param node A node.
3.394 - * @return The sibling node.
3.395 - * @since 2.4.0
3.396 - * @see purple_blist_node_get_parent
3.397 - * @see purple_blist_node_get_first_child
3.398 - * @see purple_blist_node_get_sibling_next
3.399 - * @see purple_blist_node_next
3.400 - */
3.401 -PurpleBlistNode *purple_blist_node_get_sibling_prev(PurpleBlistNode *node);
3.402 -
3.403 -/**
3.404 - * Returns the UI data of a given node.
3.405 - *
3.406 - * @param node The node.
3.407 - * @return The UI data.
3.408 - * @since 2.6.0
3.409 - */
3.410 -gpointer purple_blist_node_get_ui_data(const PurpleBlistNode *node);
3.411 -
3.412 -/**
3.413 - * Sets the UI data of a given node.
3.414 - *
3.415 - * @param node The node.
3.416 - * @param ui_data The UI data.
3.417 - *
3.418 - * @since 2.6.0
3.419 - */
3.420 -void purple_blist_node_set_ui_data(PurpleBlistNode *node, gpointer ui_data);
3.421 -
3.422 -/**
3.423 - * Shows the buddy list, creating a new one if necessary.
3.424 - */
3.425 -void purple_blist_show(void);
3.426 -
3.427 -
3.428 -/**
3.429 - * Destroys the buddy list window.
3.430 - *
3.431 - * @deprecated The UI is responsible for cleaning up the
3.432 - * PurpleBuddyList->ui_data. purple_blist_uninit() will free the
3.433 - * PurpleBuddyList* itself.
3.434 - */
3.435 -void purple_blist_destroy(void);
3.436 -
3.437 -/**
3.438 - * Hides or unhides the buddy list.
3.439 - *
3.440 - * @param show Whether or not to show the buddy list
3.441 - */
3.442 -void purple_blist_set_visible(gboolean show);
3.443 -
3.444 -/**
3.445 - * Updates a buddy's status.
3.446 - *
3.447 - * This should only be called from within Purple.
3.448 - *
3.449 - * @param buddy The buddy whose status has changed.
3.450 - * @param old_status The status from which we are changing.
3.451 - */
3.452 -void purple_blist_update_buddy_status(PurpleBuddy *buddy, PurpleStatus *old_status);
3.453 -
3.454 -/**
3.455 - * Updates a node's custom icon.
3.456 - *
3.457 - * @param node The PurpleBlistNode whose custom icon has changed.
3.458 - *
3.459 - * @since 2.5.0
3.460 - */
3.461 -void purple_blist_update_node_icon(PurpleBlistNode *node);
3.462 -
3.463 -#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_BLIST_C_)
3.464 -/**
3.465 - * Updates a buddy's icon.
3.466 - *
3.467 - * @param buddy The buddy whose buddy icon has changed
3.468 - * @deprecated Use purple_blist_update_node_icon() instead.
3.469 - */
3.470 -void purple_blist_update_buddy_icon(PurpleBuddy *buddy);
3.471 -#endif
3.472 -
3.473 -/**
3.474 - * Renames a buddy in the buddy list.
3.475 - *
3.476 - * @param buddy The buddy whose name will be changed.
3.477 - * @param name The new name of the buddy.
3.478 - */
3.479 -void purple_blist_rename_buddy(PurpleBuddy *buddy, const char *name);
3.480 -
3.481 -/**
3.482 - * Aliases a contact in the buddy list.
3.483 - *
3.484 - * @param contact The contact whose alias will be changed.
3.485 - * @param alias The contact's alias.
3.486 - */
3.487 -void purple_blist_alias_contact(PurpleContact *contact, const char *alias);
3.488 -
3.489 -/**
3.490 - * Aliases a buddy in the buddy list.
3.491 - *
3.492 - * @param buddy The buddy whose alias will be changed.
3.493 - * @param alias The buddy's alias.
3.494 - */
3.495 -void purple_blist_alias_buddy(PurpleBuddy *buddy, const char *alias);
3.496 -
3.497 -/**
3.498 - * Sets the server-sent alias of a buddy in the buddy list.
3.499 - * PRPLs should call serv_got_alias() instead of this.
3.500 - *
3.501 - * @param buddy The buddy whose alias will be changed.
3.502 - * @param alias The buddy's "official" alias.
3.503 - */
3.504 -void purple_blist_server_alias_buddy(PurpleBuddy *buddy, const char *alias);
3.505 -
3.506 -/**
3.507 - * Aliases a chat in the buddy list.
3.508 - *
3.509 - * @param chat The chat whose alias will be changed.
3.510 - * @param alias The chat's new alias.
3.511 - */
3.512 -void purple_blist_alias_chat(PurpleChat *chat, const char *alias);
3.513 -
3.514 -/**
3.515 - * Renames a group
3.516 - *
3.517 - * @param group The group to rename
3.518 - * @param name The new name
3.519 - */
3.520 -void purple_blist_rename_group(PurpleGroup *group, const char *name);
3.521 -
3.522 -/**
3.523 - * Creates a new chat for the buddy list
3.524 - *
3.525 - * @param account The account this chat will get added to
3.526 - * @param alias The alias of the new chat
3.527 - * @param components The info the prpl needs to join the chat. The
3.528 - * hash function should be g_str_hash() and the
3.529 - * equal function should be g_str_equal().
3.530 - * @return A newly allocated chat
3.531 - */
3.532 -PurpleChat *purple_chat_new(PurpleAccount *account, const char *alias, GHashTable *components);
3.533 -
3.534 -/**
3.535 - * Destroys a chat
3.536 - *
3.537 - * @param chat The chat to destroy
3.538 - */
3.539 -void purple_chat_destroy(PurpleChat *chat);
3.540 -
3.541 -/**
3.542 - * Adds a new chat to the buddy list.
3.543 - *
3.544 - * The chat will be inserted right after node or appended to the end
3.545 - * of group if node is NULL. If both are NULL, the buddy will be added to
3.546 - * the "Chats" group.
3.547 - *
3.548 - * @param chat The new chat who gets added
3.549 - * @param group The group to add the new chat to.
3.550 - * @param node The insertion point
3.551 - */
3.552 -void purple_blist_add_chat(PurpleChat *chat, PurpleGroup *group, PurpleBlistNode *node);
3.553 -
3.554 -/**
3.555 - * Creates a new buddy.
3.556 - *
3.557 - * This function only creates the PurpleBuddy. Use purple_blist_add_buddy
3.558 - * to add the buddy to the list and purple_account_add_buddy to sync up
3.559 - * with the server.
3.560 - *
3.561 - * @param account The account this buddy will get added to
3.562 - * @param name The name of the new buddy
3.563 - * @param alias The alias of the new buddy (or NULL if unaliased)
3.564 - * @return A newly allocated buddy
3.565 - *
3.566 - * @see purple_account_add_buddy
3.567 - * @see purple_blist_add_buddy
3.568 - */
3.569 -PurpleBuddy *purple_buddy_new(PurpleAccount *account, const char *name, const char *alias);
3.570 -
3.571 -/**
3.572 - * Destroys a buddy
3.573 - *
3.574 - * @param buddy The buddy to destroy
3.575 - */
3.576 -void purple_buddy_destroy(PurpleBuddy *buddy);
3.577 -
3.578 -/**
3.579 - * Sets a buddy's icon.
3.580 - *
3.581 - * This should only be called from within Purple. You probably want to
3.582 - * call purple_buddy_icon_set_data().
3.583 - *
3.584 - * @param buddy The buddy.
3.585 - * @param icon The buddy icon.
3.586 - *
3.587 - * @see purple_buddy_icon_set_data()
3.588 - */
3.589 -void purple_buddy_set_icon(PurpleBuddy *buddy, PurpleBuddyIcon *icon);
3.590 -
3.591 -/**
3.592 - * Returns a buddy's account.
3.593 - *
3.594 - * @param buddy The buddy.
3.595 - *
3.596 - * @return The account
3.597 - */
3.598 -PurpleAccount *purple_buddy_get_account(const PurpleBuddy *buddy);
3.599 -
3.600 -/**
3.601 - * Returns a buddy's name
3.602 - *
3.603 - * @param buddy The buddy.
3.604 - *
3.605 - * @return The name.
3.606 - */
3.607 -const char *purple_buddy_get_name(const PurpleBuddy *buddy);
3.608 -
3.609 -/**
3.610 - * Returns a buddy's icon.
3.611 - *
3.612 - * @param buddy The buddy.
3.613 - *
3.614 - * @return The buddy icon.
3.615 - */
3.616 -PurpleBuddyIcon *purple_buddy_get_icon(const PurpleBuddy *buddy);
3.617 -
3.618 -/**
3.619 - * Returns a buddy's protocol-specific data.
3.620 - *
3.621 - * This should only be called from the associated prpl.
3.622 - *
3.623 - * @param buddy The buddy.
3.624 - * @return The protocol data.
3.625 - *
3.626 - * @see purple_buddy_set_protocol_data()
3.627 - * @since 2.6.0
3.628 - */
3.629 -gpointer purple_buddy_get_protocol_data(const PurpleBuddy *buddy);
3.630 -
3.631 -/**
3.632 - * Sets a buddy's protocol-specific data.
3.633 - *
3.634 - * This should only be called from the associated prpl.
3.635 - *
3.636 - * @param buddy The buddy.
3.637 - * @param data The data.
3.638 - *
3.639 - * @see purple_buddy_get_protocol_data()
3.640 - * @since 2.6.0
3.641 - */
3.642 -void purple_buddy_set_protocol_data(PurpleBuddy *buddy, gpointer data);
3.643 -
3.644 -/**
3.645 - * Returns a buddy's contact.
3.646 - *
3.647 - * @param buddy The buddy.
3.648 - *
3.649 - * @return The buddy's contact.
3.650 - */
3.651 -PurpleContact *purple_buddy_get_contact(PurpleBuddy *buddy);
3.652 -
3.653 -/**
3.654 - * Returns a buddy's presence.
3.655 - *
3.656 - * @param buddy The buddy.
3.657 - *
3.658 - * @return The buddy's presence.
3.659 - */
3.660 -PurplePresence *purple_buddy_get_presence(const PurpleBuddy *buddy);
3.661 -
3.662 -/**
3.663 - * Adds a new buddy to the buddy list.
3.664 - *
3.665 - * The buddy will be inserted right after node or prepended to the
3.666 - * group if node is NULL. If both are NULL, the buddy will be added to
3.667 - * the "Buddies" group.
3.668 - *
3.669 - * @param buddy The new buddy who gets added
3.670 - * @param contact The optional contact to place the buddy in.
3.671 - * @param group The group to add the new buddy to.
3.672 - * @param node The insertion point. Pass in NULL to add the node as
3.673 - * the first child in the given group.
3.674 - */
3.675 -void purple_blist_add_buddy(PurpleBuddy *buddy, PurpleContact *contact, PurpleGroup *group, PurpleBlistNode *node);
3.676 -
3.677 -/**
3.678 - * Creates a new group
3.679 - *
3.680 - * You can't have more than one group with the same name. Sorry. If you pass
3.681 - * this the name of a group that already exists, it will return that group.
3.682 - *
3.683 - * @param name The name of the new group
3.684 - * @return A new group struct
3.685 -*/
3.686 -PurpleGroup *purple_group_new(const char *name);
3.687 -
3.688 -/**
3.689 - * Destroys a group
3.690 - *
3.691 - * @param group The group to destroy
3.692 -*/
3.693 -void purple_group_destroy(PurpleGroup *group);
3.694 -
3.695 -/**
3.696 - * Adds a new group to the buddy list.
3.697 - *
3.698 - * The new group will be inserted after insert or prepended to the list if
3.699 - * node is NULL.
3.700 - *
3.701 - * @param group The group
3.702 - * @param node The insertion point
3.703 - */
3.704 -void purple_blist_add_group(PurpleGroup *group, PurpleBlistNode *node);
3.705 -
3.706 -/**
3.707 - * Creates a new contact
3.708 - *
3.709 - * @return A new contact struct
3.710 - */
3.711 -PurpleContact *purple_contact_new(void);
3.712 -
3.713 -/**
3.714 - * Destroys a contact
3.715 - *
3.716 - * @param contact The contact to destroy
3.717 - */
3.718 -void purple_contact_destroy(PurpleContact *contact);
3.719 -
3.720 -/**
3.721 - * Adds a new contact to the buddy list.
3.722 - *
3.723 - * The new contact will be inserted after insert or prepended to the list if
3.724 - * node is NULL.
3.725 - *
3.726 - * @param contact The contact
3.727 - * @param group The group to add the contact to
3.728 - * @param node The insertion point
3.729 - */
3.730 -void purple_blist_add_contact(PurpleContact *contact, PurpleGroup *group, PurpleBlistNode *node);
3.731 -
3.732 -/**
3.733 - * Merges two contacts
3.734 - *
3.735 - * All of the buddies from source will be moved to target
3.736 - *
3.737 - * @param source The contact to merge
3.738 - * @param node The place to merge to (a buddy or contact)
3.739 - */
3.740 -void purple_blist_merge_contact(PurpleContact *source, PurpleBlistNode *node);
3.741 -
3.742 -/**
3.743 - * Returns the highest priority buddy for a given contact.
3.744 - *
3.745 - * @param contact The contact
3.746 - * @return The highest priority buddy
3.747 - */
3.748 -PurpleBuddy *purple_contact_get_priority_buddy(PurpleContact *contact);
3.749 -
3.750 -#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_BLIST_C_)
3.751 -/**
3.752 - * Sets the alias for a contact.
3.753 - *
3.754 - * @param contact The contact
3.755 - * @param alias The alias to set, or NULL to unset
3.756 - *
3.757 - * @deprecated Use purple_blist_alias_contact() instead.
3.758 - */
3.759 -void purple_contact_set_alias(PurpleContact *contact, const char *alias);
3.760 -#endif
3.761 -
3.762 -/**
3.763 - * Gets the alias for a contact.
3.764 - *
3.765 - * @param contact The contact
3.766 - * @return The alias, or NULL if it is not set.
3.767 - */
3.768 -const char *purple_contact_get_alias(PurpleContact *contact);
3.769 -
3.770 -/**
3.771 - * Determines whether an account owns any buddies in a given contact
3.772 - *
3.773 - * @param contact The contact to search through.
3.774 - * @param account The account.
3.775 - *
3.776 - * @return TRUE if there are any buddies from account in the contact, or FALSE otherwise.
3.777 - */
3.778 -gboolean purple_contact_on_account(PurpleContact *contact, PurpleAccount *account);
3.779 -
3.780 -/**
3.781 - * Invalidates the priority buddy so that the next call to
3.782 - * purple_contact_get_priority_buddy recomputes it.
3.783 - *
3.784 - * @param contact The contact
3.785 - */
3.786 -void purple_contact_invalidate_priority_buddy(PurpleContact *contact);
3.787 -
3.788 -/**
3.789 - * Removes a buddy from the buddy list and frees the memory allocated to it.
3.790 - * This doesn't actually try to remove the buddy from the server list.
3.791 - *
3.792 - * @param buddy The buddy to be removed
3.793 - *
3.794 - * @see purple_account_remove_buddy
3.795 - */
3.796 -void purple_blist_remove_buddy(PurpleBuddy *buddy);
3.797 -
3.798 -/**
3.799 - * Removes a contact, and any buddies it contains, and frees the memory
3.800 - * allocated to it. This calls purple_blist_remove_buddy and therefore
3.801 - * doesn't remove the buddies from the server list.
3.802 - *
3.803 - * @param contact The contact to be removed
3.804 - *
3.805 - * @see purple_blist_remove_buddy
3.806 - */
3.807 -void purple_blist_remove_contact(PurpleContact *contact);
3.808 -
3.809 -/**
3.810 - * Removes a chat from the buddy list and frees the memory allocated to it.
3.811 - *
3.812 - * @param chat The chat to be removed
3.813 - */
3.814 -void purple_blist_remove_chat(PurpleChat *chat);
3.815 -
3.816 -/**
3.817 - * Removes a group from the buddy list and frees the memory allocated to it and to
3.818 - * its children
3.819 - *
3.820 - * @param group The group to be removed
3.821 - */
3.822 -void purple_blist_remove_group(PurpleGroup *group);
3.823 -
3.824 -/**
3.825 - * Returns the alias of a buddy.
3.826 - *
3.827 - * @param buddy The buddy whose name will be returned.
3.828 - * @return The alias (if set), server alias (if set),
3.829 - * or NULL.
3.830 - */
3.831 -const char *purple_buddy_get_alias_only(PurpleBuddy *buddy);
3.832 -
3.833 -/**
3.834 - * Gets the server alias for a buddy.
3.835 - *
3.836 - * @param buddy The buddy whose name will be returned
3.837 - * @return The server alias, or NULL if it is not set.
3.838 - */
3.839 -const char *purple_buddy_get_server_alias(PurpleBuddy *buddy);
3.840 -
3.841 -/**
3.842 - * Returns the correct name to display for a buddy, taking the contact alias
3.843 - * into account. In order of precedence: the buddy's alias; the buddy's
3.844 - * contact alias; the buddy's server alias; the buddy's user name.
3.845 - *
3.846 - * @param buddy The buddy whose name will be returned
3.847 - * @return The appropriate name or alias, or NULL.
3.848 - *
3.849 - */
3.850 -const char *purple_buddy_get_contact_alias(PurpleBuddy *buddy);
3.851 -
3.852 -#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_BLIST_C_)
3.853 -/**
3.854 - * Returns the correct alias for this user, ignoring server aliases. Used
3.855 - * when a user-recognizable name is required. In order: buddy's alias; buddy's
3.856 - * contact alias; buddy's user name.
3.857 - *
3.858 - * @param buddy The buddy whose alias will be returned.
3.859 - * @return The appropriate name or alias.
3.860 - * @deprecated Try purple_buddy_get_alias(), if server aliases are okay.
3.861 - */
3.862 -const char *purple_buddy_get_local_alias(PurpleBuddy *buddy);
3.863 -#endif
3.864 -
3.865 -/**
3.866 - * Returns the correct name to display for a buddy. In order of precedence:
3.867 - * the buddy's alias; the buddy's server alias; the buddy's c