Seems 0.5.6 was kept around, whoops. I wondered why that binary was a little heavy.
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_ */
2.1 --- a/Frameworks/libpurple.framework/Versions/0.5.6/Headers/accountopt.h Sun Jun 21 22:04:11 2009 -0400
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.5.6/Headers/blist.h Sun Jun 21 22:04:11 2009 -0400
3.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
3.3 @@ -1,1045 +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 -#define PURPLE_BLIST_NODE_HAS_FLAG(b, f) (purple_blist_node_get_flags((PurpleBlistNode*)(b)) & (f))
3.82 -#define PURPLE_BLIST_NODE_SHOULD_SAVE(b) (! PURPLE_BLIST_NODE_HAS_FLAG(b, PURPLE_BLIST_NODE_FLAG_NO_SAVE))
3.83 -
3.84 -#define PURPLE_BLIST_NODE_NAME(n) (purple_blist_node_get_type(n) == PURPLE_BLIST_CHAT_NODE ? purple_chat_get_name((PurpleChat*)n) : \
3.85 - purple_blist_node_get_type(n) == PURPLE_BLIST_BUDDY_NODE ? purple_buddy_get_name((PurpleBuddy*)n) : NULL)
3.86 -
3.87 -#include "account.h"
3.88 -#include "buddyicon.h"
3.89 -#include "status.h"
3.90 -
3.91 -/**************************************************************************/
3.92 -/* Data Structures */
3.93 -/**************************************************************************/
3.94 -
3.95 -#if !(defined PURPLE_HIDE_STRUCTS) || (defined _PURPLE_BLIST_C_)
3.96 -
3.97 -/**
3.98 - * A Buddy list node. This can represent a group, a buddy, or anything else.
3.99 - * This is a base class for struct buddy and struct group and for anything
3.100 - * else that wants to put itself in the buddy list. */
3.101 -struct _PurpleBlistNode {
3.102 - PurpleBlistNodeType type; /**< The type of node this is */
3.103 - PurpleBlistNode *prev; /**< The sibling before this buddy. */
3.104 - PurpleBlistNode *next; /**< The sibling after this buddy. */
3.105 - PurpleBlistNode *parent; /**< The parent of this node */
3.106 - PurpleBlistNode *child; /**< The child of this node */
3.107 - GHashTable *settings; /**< per-node settings */
3.108 - void *ui_data; /**< The UI can put data here. */
3.109 - PurpleBlistNodeFlags flags; /**< The buddy flags */
3.110 -};
3.111 -
3.112 -/**
3.113 - * A buddy. This contains everything Purple will ever need to know about someone on the buddy list. Everything.
3.114 - */
3.115 -struct _PurpleBuddy {
3.116 - PurpleBlistNode node; /**< The node that this buddy inherits from */
3.117 - char *name; /**< The screenname of the buddy. */
3.118 - char *alias; /**< The user-set alias of the buddy */
3.119 - char *server_alias; /**< The server-specified alias of the buddy. (i.e. MSN "Friendly Names") */
3.120 - void *proto_data; /**< This allows the prpl to associate whatever data it wants with a buddy */
3.121 - PurpleBuddyIcon *icon; /**< The buddy icon. */
3.122 - PurpleAccount *account; /**< the account this buddy belongs to */
3.123 - PurplePresence *presence;
3.124 -};
3.125 -
3.126 -/**
3.127 - * A contact. This contains everything Purple will ever need to know about a contact.
3.128 - */
3.129 -struct _PurpleContact {
3.130 - PurpleBlistNode node; /**< The node that this contact inherits from. */
3.131 - char *alias; /**< The user-set alias of the contact */
3.132 - int totalsize; /**< The number of buddies in this contact */
3.133 - int currentsize; /**< The number of buddies in this contact corresponding to online accounts */
3.134 - int online; /**< The number of buddies in this contact who are currently online */
3.135 - PurpleBuddy *priority; /**< The "top" buddy for this contact */
3.136 - gboolean priority_valid; /**< Is priority valid? */
3.137 -};
3.138 -
3.139 -
3.140 -/**
3.141 - * A group. This contains everything Purple will ever need to know about a group.
3.142 - */
3.143 -struct _PurpleGroup {
3.144 - PurpleBlistNode node; /**< The node that this group inherits from */
3.145 - char *name; /**< The name of this group. */
3.146 - int totalsize; /**< The number of chats and contacts in this group */
3.147 - int currentsize; /**< The number of chats and contacts in this group corresponding to online accounts */
3.148 - int online; /**< The number of chats and contacts in this group who are currently online */
3.149 -};
3.150 -
3.151 -/**
3.152 - * A chat. This contains everything Purple needs to put a chat room in the
3.153 - * buddy list.
3.154 - */
3.155 -struct _PurpleChat {
3.156 - PurpleBlistNode node; /**< The node that this chat inherits from */
3.157 - char *alias; /**< The display name of this chat. */
3.158 - GHashTable *components; /**< the stuff the protocol needs to know to join the chat */
3.159 - PurpleAccount *account; /**< The account this chat is attached to */
3.160 -};
3.161 -
3.162 -#endif /* PURPLE_HIDE_STRUCTS && PURPLE_BLIST_STRUCTS */
3.163 -
3.164 -
3.165 -/**
3.166 - * The Buddy List
3.167 - */
3.168 -struct _PurpleBuddyList {
3.169 - PurpleBlistNode *root; /**< The first node in the buddy list */
3.170 - GHashTable *buddies; /**< Every buddy in this list */
3.171 - void *ui_data; /**< UI-specific data. */
3.172 -};
3.173 -
3.174 -/**
3.175 - * Buddy list UI operations.
3.176 - *
3.177 - * Any UI representing a buddy list must assign a filled-out PurpleBlistUiOps
3.178 - * structure to the buddy list core.
3.179 - */
3.180 -struct _PurpleBlistUiOps
3.181 -{
3.182 - void (*new_list)(PurpleBuddyList *list); /**< Sets UI-specific data on a buddy list. */
3.183 - void (*new_node)(PurpleBlistNode *node); /**< Sets UI-specific data on a node. */
3.184 - void (*show)(PurpleBuddyList *list); /**< The core will call this when it's finished doing its core stuff */
3.185 - void (*update)(PurpleBuddyList *list,
3.186 - PurpleBlistNode *node); /**< This will update a node in the buddy list. */
3.187 - void (*remove)(PurpleBuddyList *list,
3.188 - PurpleBlistNode *node); /**< This removes a node from the list */
3.189 - void (*destroy)(PurpleBuddyList *list); /**< When the list gets destroyed, this gets called to destroy the UI. */
3.190 - void (*set_visible)(PurpleBuddyList *list,
3.191 - gboolean show); /**< Hides or unhides the buddy list */
3.192 - void (*request_add_buddy)(PurpleAccount *account, const char *username,
3.193 - const char *group, const char *alias);
3.194 - void (*request_add_chat)(PurpleAccount *account, PurpleGroup *group,
3.195 - const char *alias, const char *name);
3.196 - void (*request_add_group)(void);
3.197 -
3.198 - void (*_purple_reserved1)(void);
3.199 - void (*_purple_reserved2)(void);
3.200 - void (*_purple_reserved3)(void);
3.201 - void (*_purple_reserved4)(void);
3.202 -};
3.203 -
3.204 -#ifdef __cplusplus
3.205 -extern "C" {
3.206 -#endif
3.207 -
3.208 -/**************************************************************************/
3.209 -/** @name Buddy List API */
3.210 -/**************************************************************************/
3.211 -/*@{*/
3.212 -
3.213 -/**
3.214 - * Creates a new buddy list
3.215 - *
3.216 - * @return The new buddy list.
3.217 - */
3.218 -PurpleBuddyList *purple_blist_new(void);
3.219 -
3.220 -/**
3.221 - * Sets the main buddy list.
3.222 - *
3.223 - * @param blist The buddy list you want to use.
3.224 - */
3.225 -void purple_set_blist(PurpleBuddyList *blist);
3.226 -
3.227 -/**
3.228 - * Returns the main buddy list.
3.229 - *
3.230 - * @return The main buddy list.
3.231 - */
3.232 -PurpleBuddyList *purple_get_blist(void);
3.233 -
3.234 -/**
3.235 - * Returns the root node of the main buddy list.
3.236 - *
3.237 - * @return The root node.
3.238 - */
3.239 -PurpleBlistNode *purple_blist_get_root(void);
3.240 -
3.241 -/**
3.242 - * Returns the next node of a given node. This function is to be used to iterate
3.243 - * over the tree returned by purple_get_blist.
3.244 - *
3.245 - * @param node A node.
3.246 - * @param offline Whether to include nodes for offline accounts
3.247 - * @return The next node
3.248 - * @see purple_blist_node_get_parent
3.249 - * @see purple_blist_node_get_first_child
3.250 - * @see purple_blist_node_get_sibling_next
3.251 - * @see purple_blist_node_get_sibling_prev
3.252 - */
3.253 -PurpleBlistNode *purple_blist_node_next(PurpleBlistNode *node, gboolean offline);
3.254 -
3.255 -/**
3.256 - * Returns the parent node of a given node.
3.257 - *
3.258 - * @param node A node.
3.259 - * @return The parent node.
3.260 - * @since 2.4.0
3.261 - * @see purple_blist_node_get_first_child
3.262 - * @see purple_blist_node_get_sibling_next
3.263 - * @see purple_blist_node_get_sibling_prev
3.264 - * @see purple_blist_node_next
3.265 - */
3.266 -PurpleBlistNode *purple_blist_node_get_parent(PurpleBlistNode *node);
3.267 -
3.268 -/**
3.269 - * Returns the the first child node of a given node.
3.270 - *
3.271 - * @param node A node.
3.272 - * @return The child node.
3.273 - * @since 2.4.0
3.274 - * @see purple_blist_node_get_parent
3.275 - * @see purple_blist_node_get_sibling_next
3.276 - * @see purple_blist_node_get_sibling_prev
3.277 - * @see purple_blist_node_next
3.278 - */
3.279 -PurpleBlistNode *purple_blist_node_get_first_child(PurpleBlistNode *node);
3.280 -
3.281 -/**
3.282 - * Returns the sibling node of a given node.
3.283 - *
3.284 - * @param node A node.
3.285 - * @return The sibling node.
3.286 - * @since 2.4.0
3.287 - * @see purple_blist_node_get_parent
3.288 - * @see purple_blist_node_get_first_child
3.289 - * @see purple_blist_node_get_sibling_prev
3.290 - * @see purple_blist_node_next
3.291 - */
3.292 -PurpleBlistNode *purple_blist_node_get_sibling_next(PurpleBlistNode *node);
3.293 -
3.294 -/**
3.295 - * Returns the previous sibling node of a given node.
3.296 - *
3.297 - * @param node A node.
3.298 - * @return The sibling node.
3.299 - * @since 2.4.0
3.300 - * @see purple_blist_node_get_parent
3.301 - * @see purple_blist_node_get_first_child
3.302 - * @see purple_blist_node_get_sibling_next
3.303 - * @see purple_blist_node_next
3.304 - */
3.305 -PurpleBlistNode *purple_blist_node_get_sibling_prev(PurpleBlistNode *node);
3.306 -
3.307 -/**
3.308 - * Shows the buddy list, creating a new one if necessary.
3.309 - */
3.310 -void purple_blist_show(void);
3.311 -
3.312 -
3.313 -/**
3.314 - * Destroys the buddy list window.
3.315 - */
3.316 -void purple_blist_destroy(void);
3.317 -
3.318 -/**
3.319 - * Hides or unhides the buddy list.
3.320 - *
3.321 - * @param show Whether or not to show the buddy list
3.322 - */
3.323 -void purple_blist_set_visible(gboolean show);
3.324 -
3.325 -/**
3.326 - * Updates a buddy's status.
3.327 - *
3.328 - * @param buddy The buddy whose status has changed.
3.329 - * @param old_status The status from which we are changing.
3.330 - */
3.331 -void purple_blist_update_buddy_status(PurpleBuddy *buddy, PurpleStatus *old_status);
3.332 -
3.333 -/**
3.334 - * Updates a node's custom icon.
3.335 - *
3.336 - * @param node The PurpleBlistNode whose custom icon has changed.
3.337 - * @since 2.5.0
3.338 - */
3.339 -void purple_blist_update_node_icon(PurpleBlistNode *node);
3.340 -
3.341 -#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_BLIST_C_)
3.342 -/**
3.343 - * Updates a buddy's icon.
3.344 - *
3.345 - * @param buddy The buddy whose buddy icon has changed
3.346 - * @deprecated Use purple_blist_update_node_icon() instead.
3.347 - */
3.348 -void purple_blist_update_buddy_icon(PurpleBuddy *buddy);
3.349 -#endif
3.350 -
3.351 -/**
3.352 - * Renames a buddy in the buddy list.
3.353 - *
3.354 - * @param buddy The buddy whose name will be changed.
3.355 - * @param name The new name of the buddy.
3.356 - */
3.357 -void purple_blist_rename_buddy(PurpleBuddy *buddy, const char *name);
3.358 -
3.359 -/**
3.360 - * Aliases a contact in the buddy list.
3.361 - *
3.362 - * @param contact The contact whose alias will be changed.
3.363 - * @param alias The contact's alias.
3.364 - */
3.365 -void purple_blist_alias_contact(PurpleContact *contact, const char *alias);
3.366 -
3.367 -/**
3.368 - * Aliases a buddy in the buddy list.
3.369 - *
3.370 - * @param buddy The buddy whose alias will be changed.
3.371 - * @param alias The buddy's alias.
3.372 - */
3.373 -void purple_blist_alias_buddy(PurpleBuddy *buddy, const char *alias);
3.374 -
3.375 -/**
3.376 - * Sets the server-sent alias of a buddy in the buddy list.
3.377 - * PRPLs should call serv_got_alias() instead of this.
3.378 - *
3.379 - * @param buddy The buddy whose alias will be changed.
3.380 - * @param alias The buddy's "official" alias.
3.381 - */
3.382 -void purple_blist_server_alias_buddy(PurpleBuddy *buddy, const char *alias);
3.383 -
3.384 -/**
3.385 - * Aliases a chat in the buddy list.
3.386 - *
3.387 - * @param chat The chat whose alias will be changed.
3.388 - * @param alias The chat's new alias.
3.389 - */
3.390 -void purple_blist_alias_chat(PurpleChat *chat, const char *alias);
3.391 -
3.392 -/**
3.393 - * Renames a group
3.394 - *
3.395 - * @param group The group to rename
3.396 - * @param name The new name
3.397 - */
3.398 -void purple_blist_rename_group(PurpleGroup *group, const char *name);
3.399 -
3.400 -/**
3.401 - * Creates a new chat for the buddy list
3.402 - *
3.403 - * @param account The account this chat will get added to
3.404 - * @param alias The alias of the new chat
3.405 - * @param components The info the prpl needs to join the chat. The
3.406 - * hash function should be g_str_hash() and the
3.407 - * equal function should be g_str_equal().
3.408 - * @return A newly allocated chat
3.409 - */
3.410 -PurpleChat *purple_chat_new(PurpleAccount *account, const char *alias, GHashTable *components);
3.411 -
3.412 -/**
3.413 - * Adds a new chat to the buddy list.
3.414 - *
3.415 - * The chat will be inserted right after node or appended to the end
3.416 - * of group if node is NULL. If both are NULL, the buddy will be added to
3.417 - * the "Chats" group.
3.418 - *
3.419 - * @param chat The new chat who gets added
3.420 - * @param group The group to add the new chat to.
3.421 - * @param node The insertion point
3.422 - */
3.423 -void purple_blist_add_chat(PurpleChat *chat, PurpleGroup *group, PurpleBlistNode *node);
3.424 -
3.425 -/**
3.426 - * Creates a new buddy
3.427 - *
3.428 - * @param account The account this buddy will get added to
3.429 - * @param screenname The screenname of the new buddy
3.430 - * @param alias The alias of the new buddy (or NULL if unaliased)
3.431 - * @return A newly allocated buddy
3.432 - */
3.433 -PurpleBuddy *purple_buddy_new(PurpleAccount *account, const char *screenname, const char *alias);
3.434 -
3.435 -/**
3.436 - * Sets a buddy's icon.
3.437 - *
3.438 - * This should only be called from within Purple. You probably want to
3.439 - * call purple_buddy_icon_set_data().
3.440 - *
3.441 - * @param buddy The buddy.
3.442 - * @param icon The buddy icon.
3.443 - *
3.444 - * @see purple_buddy_icon_set_data()
3.445 - */
3.446 -void purple_buddy_set_icon(PurpleBuddy *buddy, PurpleBuddyIcon *icon);
3.447 -
3.448 -/**
3.449 - * Returns a buddy's account.
3.450 - *
3.451 - * @param buddy The buddy.
3.452 - *
3.453 - * @return The account
3.454 - */
3.455 -PurpleAccount *purple_buddy_get_account(const PurpleBuddy *buddy);
3.456 -
3.457 -/**
3.458 - * Returns a buddy's name
3.459 - *
3.460 - * @param buddy The buddy.
3.461 - *
3.462 - * @return The name.
3.463 - */
3.464 -const char *purple_buddy_get_name(const PurpleBuddy *buddy);
3.465 -
3.466 -/**
3.467 - * Returns a buddy's icon.
3.468 - *
3.469 - * @param buddy The buddy.
3.470 - *
3.471 - * @return The buddy icon.
3.472 - */
3.473 -PurpleBuddyIcon *purple_buddy_get_icon(const PurpleBuddy *buddy);
3.474 -
3.475 -/**
3.476 - * Returns a buddy's contact.
3.477 - *
3.478 - * @param buddy The buddy.
3.479 - *
3.480 - * @return The buddy's contact.
3.481 - */
3.482 -PurpleContact *purple_buddy_get_contact(PurpleBuddy *buddy);
3.483 -
3.484 -/**
3.485 - * Returns a buddy's presence.
3.486 - *
3.487 - * @param buddy The buddy.
3.488 - *
3.489 - * @return The buddy's presence.
3.490 - */
3.491 -PurplePresence *purple_buddy_get_presence(const PurpleBuddy *buddy);
3.492 -
3.493 -/**
3.494 - * Adds a new buddy to the buddy list.
3.495 - *
3.496 - * The buddy will be inserted right after node or prepended to the
3.497 - * group if node is NULL. If both are NULL, the buddy will be added to
3.498 - * the "Buddies" group.
3.499 - *
3.500 - * @param buddy The new buddy who gets added
3.501 - * @param contact The optional contact to place the buddy in.
3.502 - * @param group The group to add the new buddy to.
3.503 - * @param node The insertion point. Pass in NULL to add the node as
3.504 - * the last child in the given group.
3.505 - */
3.506 -void purple_blist_add_buddy(PurpleBuddy *buddy, PurpleContact *contact, PurpleGroup *group, PurpleBlistNode *node);
3.507 -
3.508 -/**
3.509 - * Creates a new group
3.510 - *
3.511 - * You can't have more than one group with the same name. Sorry. If you pass
3.512 - * this the * name of a group that already exists, it will return that group.
3.513 - *
3.514 - * @param name The name of the new group
3.515 - * @return A new group struct
3.516 -*/
3.517 -PurpleGroup *purple_group_new(const char *name);
3.518 -
3.519 -/**
3.520 - * Adds a new group to the buddy list.
3.521 - *
3.522 - * The new group will be inserted after insert or prepended to the list if
3.523 - * node is NULL.
3.524 - *
3.525 - * @param group The group
3.526 - * @param node The insertion point
3.527 - */
3.528 -void purple_blist_add_group(PurpleGroup *group, PurpleBlistNode *node);
3.529 -
3.530 -/**
3.531 - * Creates a new contact
3.532 - *
3.533 - * @return A new contact struct
3.534 - */
3.535 -PurpleContact *purple_contact_new(void);
3.536 -
3.537 -/**
3.538 - * Adds a new contact to the buddy list.
3.539 - *
3.540 - * The new contact will be inserted after insert or prepended to the list if
3.541 - * node is NULL.
3.542 - *
3.543 - * @param contact The contact
3.544 - * @param group The group to add the contact to
3.545 - * @param node The insertion point
3.546 - */
3.547 -void purple_blist_add_contact(PurpleContact *contact, PurpleGroup *group, PurpleBlistNode *node);
3.548 -
3.549 -/**
3.550 - * Merges two contacts
3.551 - *
3.552 - * All of the buddies from source will be moved to target
3.553 - *
3.554 - * @param source The contact to merge
3.555 - * @param node The place to merge to (a buddy or contact)
3.556 - */
3.557 -void purple_blist_merge_contact(PurpleContact *source, PurpleBlistNode *node);
3.558 -
3.559 -/**
3.560 - * Returns the highest priority buddy for a given contact.
3.561 - *
3.562 - * @param contact The contact
3.563 - * @return The highest priority buddy
3.564 - */
3.565 -PurpleBuddy *purple_contact_get_priority_buddy(PurpleContact *contact);
3.566 -
3.567 -#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_BLIST_C_)
3.568 -/**
3.569 - * Sets the alias for a contact.
3.570 - *
3.571 - * @param contact The contact
3.572 - * @param alias The alias to set, or NULL to unset
3.573 - *
3.574 - * @deprecated Use purple_blist_alias_contact() instead.
3.575 - */
3.576 -void purple_contact_set_alias(PurpleContact *contact, const char *alias);
3.577 -#endif
3.578 -
3.579 -/**
3.580 - * Gets the alias for a contact.
3.581 - *
3.582 - * @param contact The contact
3.583 - * @return The alias, or NULL if it is not set.
3.584 - */
3.585 -const char *purple_contact_get_alias(PurpleContact *contact);
3.586 -
3.587 -/**
3.588 - * Determines whether an account owns any buddies in a given contact
3.589 - *
3.590 - * @param contact The contact to search through.
3.591 - * @param account The account.
3.592 - *
3.593 - * @return TRUE if there are any buddies from account in the contact, or FALSE otherwise.
3.594 - */
3.595 -gboolean purple_contact_on_account(PurpleContact *contact, PurpleAccount *account);
3.596 -
3.597 -/**
3.598 - * Invalidates the priority buddy so that the next call to
3.599 - * purple_contact_get_priority_buddy recomputes it.
3.600 - *
3.601 - * @param contact The contact
3.602 - */
3.603 -void purple_contact_invalidate_priority_buddy(PurpleContact *contact);
3.604 -
3.605 -/**
3.606 - * Removes a buddy from the buddy list and frees the memory allocated to it.
3.607 - * This doesn't actually try to remove the buddy from the server list, nor does
3.608 - * it clean up the prpl_data.
3.609 - *
3.610 - * @param buddy The buddy to be removed
3.611 - */
3.612 -void purple_blist_remove_buddy(PurpleBuddy *buddy);
3.613 -
3.614 -/**
3.615 - * Removes a contact, and any buddies it contains, and frees the memory
3.616 - * allocated to it.
3.617 - *
3.618 - * @param contact The contact to be removed
3.619 - */
3.620 -void purple_blist_remove_contact(PurpleContact *contact);
3.621 -
3.622 -/**
3.623 - * Removes a chat from the buddy list and frees the memory allocated to it.
3.624 - *
3.625 - * @param chat The chat to be removed
3.626 - */
3.627 -void purple_blist_remove_chat(PurpleChat *chat);
3.628 -
3.629 -/**
3.630 - * Removes a group from the buddy list and frees the memory allocated to it and to
3.631 - * its children
3.632 - *
3.633 - * @param group The group to be removed
3.634 - */
3.635 -void purple_blist_remove_group(PurpleGroup *group);
3.636 -
3.637 -/**
3.638 - * Returns the alias of a buddy.
3.639 - *
3.640 - * @param buddy The buddy whose name will be returned.
3.641 - * @return The alias (if set), server alias (if set),
3.642 - * or NULL.
3.643 - */
3.644 -const char *purple_buddy_get_alias_only(PurpleBuddy *buddy);
3.645 -
3.646 -/**
3.647 - * Gets the server alias for a buddy.
3.648 - *
3.649 - * @param buddy The buddy whose name will be returned
3.650 - * @return The server alias, or NULL if it is not set.
3.651 - */
3.652 -const char *purple_buddy_get_server_alias(PurpleBuddy *buddy);
3.653 -
3.654 -/**
3.655 - * Returns the correct name to display for a buddy, taking the contact alias
3.656 - * into account. In order of precedence: the buddy's alias; the buddy's
3.657 - * contact alias; the buddy's server alias; the buddy's user name.
3.658 - *
3.659 - * @param buddy The buddy whose name will be returned
3.660 - * @return The appropriate name or alias, or NULL.
3.661 - *
3.662 - */
3.663 -const char *purple_buddy_get_contact_alias(PurpleBuddy *buddy);
3.664 -
3.665 -/**
3.666 - * Returns the correct alias for this user, ignoring server aliases. Used
3.667 - * when a user-recognizable name is required. In order: buddy's alias; buddy's
3.668 - * contact alias; buddy's user name.
3.669 - *
3.670 - * @param buddy The buddy whose alias will be returned.
3.671 - * @return The appropriate name or alias.
3.672 - */
3.673 -const char *purple_buddy_get_local_alias(PurpleBuddy *buddy);
3.674 -
3.675 -/**
3.676 - * Returns the correct name to display for a buddy. In order of precedence:
3.677 - * the buddy's alias; the buddy's server alias; the buddy's contact alias;
3.678 - * the buddy's user name.
3.679 - *
3.680 - * @param buddy The buddy whose name will be returned.
3.681 - * @return The appropriate name or alias, or NULL
3.682 - */
3.683 -const char *purple_buddy_get_alias(PurpleBuddy *buddy);
3.684 -
3.685 -/**
3.686 - * Returns the correct name to display for a blist chat.
3.687 - *
3.688 - * @param chat The chat whose name will be returned.
3.689 - * @return The alias (if set), or first component value.
3.690 - */
3.691 -const char *purple_chat_get_name(PurpleChat *chat);
3.692 -
3.693 -/**
3.694 - * Finds the buddy struct given a screenname and an account
3.695 - *
3.696 - * @param account The account this buddy belongs to
3.697 - * @param name The buddy's screenname
3.698 - * @return The buddy or NULL if the buddy does not exist
3.699 - */
3.700 -PurpleBuddy *purple_find_buddy(PurpleAccount *account, const char *name);
3.701 -
3.702 -/**
3.703 - * Finds the buddy struct given a screenname, an account, and a group
3.704 - *
3.705 - * @param account The account this buddy belongs to
3.706 - * @param name The buddy's screenname
3.707 - * @param group The group to look in
3.708 - * @return The buddy or NULL if the buddy does not exist in the group
3.709 - */
3.710 -PurpleBuddy *purple_find_buddy_in_group(PurpleAccount *account, const char *name,
3.711 - PurpleGroup *group);
3.712 -
3.713 -/**
3.714 - * Finds all PurpleBuddy structs given a screenname and an account
3.715 - *
3.716 - * @param account The account this buddy belongs to
3.717 - * @param name The buddy's screenname (or NULL to return all buddies in the account)
3.718 - *
3.719 - * @return A GSList of buddies (which must be freed), or NULL if the buddy doesn't exist
3.720 - */
3.721 -GSList *purple_find_buddies(PurpleAccount *account, const char *name);
3.722 -
3.723 -
3.724 -/**
3.725 - * Finds a group by name
3.726 - *
3.727 - * @param name The group's name
3.728 - * @return The group or NULL if the group does not exist
3.729 - */
3.730 -PurpleGroup *purple_find_group(const char *name);
3.731 -
3.732 -/**
3.733 - * Finds a chat by name.
3.734 - *
3.735 - * @param account The chat's account.
3.736 - * @param name The chat's name.
3.737 - *
3.738 - * @return The chat, or @c NULL if the chat does not exist.
3.739 - */
3.740 -PurpleChat *purple_blist_find_chat(PurpleAccount *account, const char *name);
3.741 -
3.742 -/**
3.743 - * Returns the group of which the chat is a member.
3.744 - *
3.745 - * @param chat The chat.
3.746 - *
3.747 - * @return The parent group, or @c NULL if the chat is not in a group.
3.748 - */
3.749 -PurpleGroup *purple_chat_get_group(PurpleChat *chat);
3.750 -
3.751 -/**
3.752 - * Returns the account the chat belongs to.
3.753 - *
3.754 - * @param chat The chat.
3.755 - *
3.756 - * @return The account the chat belongs to.
3.757 - * @since 2.4.0
3.758 - */
3.759 -PurpleAccount *purple_chat_get_account(PurpleChat *chat);
3.760 -
3.761 -/**
3.762 - * Get a hashtable containing information about a chat.
3.763 - *
3.764 - * @param chat The chat.
3.765 - *
3.766 - * @constreturn The hashtable.
3.767 - * @since 2.4.0
3.768 - */
3.769 -GHashTable *purple_chat_get_components(PurpleChat *chat);
3.770 -
3.771 -/**
3.772 - * Returns the group of which the buddy is a member.
3.773 - *
3.774 - * @param buddy The buddy
3.775 - * @return The group or NULL if the buddy is not in a group
3.776 - */
3.777 -PurpleGroup *purple_buddy_get_group(PurpleBuddy *buddy);
3.778 -
3.779 -
3.780 -/**
3.781 - * Returns a list of accounts that have buddies in this group
3.782 - *
3.783 - * @param g The group
3.784 - *
3.785 - * @return A GSList of accounts (which must be freed), or NULL if the group
3.786 - * has no accounts.
3.787 - */
3.788 -GSList *purple_group_get_accounts(PurpleGroup *g);
3.789 -
3.790 -/**
3.791 - * Determines whether an account owns any buddies in a given group
3.792 - *
3.793 - * @param g The group to search through.
3.794 - * @param account The account.
3.795 - *
3.796 - * @return TRUE if there are any buddies in the group, or FALSE otherwise.
3.797 - */
3.798 -gboolean purple_group_on_account(PurpleGroup *g, PurpleAccount *account);
3.799 -
3.800 -/**
3.801 - * Returns the name of a group.
3.802 - *
3.803 - * @param group The group.
3.804 - *
3.805 - * @return The name of the group.
3.806 - */
3.807 -const char *purple_group_get_name(PurpleGroup *group);
3.808 -
3.809 -/**
3.810 - * Called when an account gets signed on. Tells the UI to update all the
3.811 - * buddies.
3.812 - *
3.813 - * @param account The account
3.814 - */
3.815 -void purple_blist_add_account(PurpleAccount *account);
3.816 -
3.817 -
3.818 -/**
3.819 - * Called when an account gets signed off. Sets the presence of all the buddies to 0
3.820 - * and tells the UI to update them.
3.821 - *
3.822 - * @param account The account
3.823 - */
3.824 -void purple_blist_remove_account(PurpleAccount *account);
3.825 -
3.826 -
3.827 -/**
3.828 - * Determines the total size of a group
3.829 - *
3.830 - * @param group The group
3.831 - * @param offline Count buddies in offline accounts
3.832 - * @return The number of buddies in the group
3.833 - */
3.834 -int purple_blist_get_group_size(PurpleGroup *group, gboolean offline);
3.835 -
3.836 -/**
3.837 - * Determines the number of online buddies in a group
3.838 - *
3.839 - * @param group The group
3.840 - * @return The number of online buddies in the group, or 0 if the group is NULL
3.841 - */
3.842 -int purple_blist_get_group_online_count(PurpleGroup *group);
3.843 -
3.844 -/*@}*/
3.845 -
3.846 -/****************************************************************************************/
3.847 -/** @name Buddy list file management API */
3.848 -/****************************************************************************************/
3.849 -
3.850 -/**
3.851 - * Loads the buddy list from ~/.purple/blist.xml.
3.852 - */
3.853 -void purple_blist_load(void);
3.854 -
3.855 -/**
3.856 - * Schedule a save of the blist.xml file. This is used by the privacy
3.857 - * API whenever the privacy settings are changed. If you make a change
3.858 - * to blist.xml using one of the functions in the buddy list API, then
3.859 - * the buddy list is saved automatically, so you should not need to
3.860 - * call this.
3.861 - */
3.862 -void purple_blist_schedule_save(void);
3.863 -
3.864 -/**
3.865 - * Requests from the user information needed to add a buddy to the
3.866 - * buddy list.
3.867 - *
3.868 - * @param account The account the buddy is added to.
3.869 - * @param username The username of the buddy.
3.870 - * @param group The name of the group to place the buddy in.
3.871 - * @param alias The optional alias for the buddy.
3.872 - */
3.873 -void purple_blist_request_add_buddy(PurpleAccount *account, const char *username,
3.874 - const char *group, const char *alias);
3.875 -
3.876 -/**
3.877 - * Requests from the user information needed to add a chat to the
3.878 - * buddy list.
3.879 - *
3.880 - * @param account The account the buddy is added to.
3.881 - * @param group The optional group to add the chat to.
3.882 - * @param alias The optional alias for the chat.
3.883 - * @param name The required chat name.
3.884 - */
3.885 -void purple_blist_request_add_chat(PurpleAccount *account, PurpleGroup *group,
3.886 - const char *alias, const char *name);
3.887 -
3.888 -/**
3.889 - * Requests from the user information needed to add a group to the
3.890 - * buddy list.
3.891 - */
3.892 -void purple_blist_request_add_group(void);
3.893 -
3.894 -/**
3.895 - * Associates a boolean with a node in the buddy list
3.896 - *
3.897 - * @param node The node to associate the data with
3.898 - * @param key The identifier for the data
3.899 - * @param value The value to set
3.900 - */
3.901 -void purple_blist_node_set_bool(PurpleBlistNode *node, const char *key, gboolean value);
3.902 -
3.903 -/**
3.904 - * Retrieves a named boolean setting from a node in the buddy list
3.905 - *
3.906 - * @param node The node to retrieve the data from
3.907 - * @param key The identifier of the data
3.908 - *
3.909 - * @return The value, or FALSE if there is no setting
3.910 - */
3.911 -gboolean purple_blist_node_get_bool(PurpleBlistNode *node, const char *key);
3.912 -
3.913 -/**
3.914 - * Associates an integer with a node in the buddy list
3.915 - *
3.916 - * @param node The node to associate the data with
3.917 - * @param key The identifier for the data
3.918 - * @param value The value to set
3.919 - */
3.920 -void purple_blist_node_set_int(PurpleBlistNode *node, const char *key, int value);
3.921 -
3.922 -/**
3.923 - * Retrieves a named integer setting from a node in the buddy list
3.924 - *
3.925 - * @param node The node to retrieve the data from
3.926 - * @param key The identifier of the data
3.927 - *
3.928 - * @return The value, or 0 if there is no setting
3.929 - */
3.930 -int purple_blist_node_get_int(PurpleBlistNode *node, const char *key);
3.931 -
3.932 -/**
3.933 - * Associates a string with a node in the buddy list
3.934 - *
3.935 - * @param node The node to associate the data with
3.936 - * @param key The identifier for the data
3.937 - * @param value The value to set
3.938 - */
3.939 -void purple_blist_node_set_string(PurpleBlistNode *node, const char *key,
3.940 - const char *value);
3.941 -
3.942 -/**
3.943 - * Retrieves a named string setting from a node in the buddy list
3.944 - *
3.945 - * @param node The node to retrieve the data from
3.946 - * @param key The identifier of the data
3.947 - *
3.948 - * @return The value, or NULL if there is no setting
3.949 - */
3.950 -const char *purple_blist_node_get_string(PurpleBlistNode *node, const char *key);
3.951 -
3.952 -/**
3.953 - * Removes a named setting from a blist node
3.954 - *
3.955 - * @param node The node from which to remove the setting
3.956 - * @param key The name of the setting
3.957 - */
3.958 -void purple_blist_node_remove_setting(PurpleBlistNode *node, const char *key);
3.959 -
3.960 -/**
3.961 - * Set the flags for the given node. Setting a node's flags will overwrite
3.962 - * the old flags, so if you want to save them, you must first call
3.963 - * purple_blist_node_get_flags and modify that appropriately.
3.964 - *
3.965 - * @param node The node on which to set the flags.
3.966 - * @param flags The flags to set. This is a bitmask.
3.967 - */
3.968 -void purple_blist_node_set_flags(PurpleBlistNode *node, PurpleBlistNodeFlags flags);
3.969 -
3.970 -/**
3.971 - * Get the current flags on a given node.
3.972 - *
3.973 - * @param node The node from which to get the flags.
3.974 - *
3.975 - * @return The flags on the node. This is a bitmask.
3.976 - */
3.977 -PurpleBlistNodeFlags purple_blist_node_get_flags(PurpleBlistNode *node);
3.978 -
3.979 -/**
3.980 - * Get the type of a given node.
3.981 - *
3.982 - * @param node The node.
3.983 - *
3.984 - * @return The type of the node.
3.985 - * @since 2.1.0
3.986 - */
3.987 -PurpleBlistNodeType purple_blist_node_get_type(PurpleBlistNode *node);
3.988 -
3.989 -/*@}*/
3.990 -
3.991 -/**
3.992 - * Retrieves the extended menu items for a buddy list node.
3.993 - * @param n The blist node for which to obtain the extended menu items.
3.994 - * @return A list of PurpleMenuAction items, as harvested by the
3.995 - * blist-node-extended-menu signal.
3.996 - */
3.997 -GList *purple_blist_node_get_extended_menu(PurpleBlistNode *n);
3.998 -
3.999 -/**************************************************************************/
3.1000 -/** @name UI Registration Functions */
3.1001 -/**************************************************************************/
3.1002 -/*@{*/
3.1003 -
3.1004 -/**
3.1005 - * Sets the UI operations structure to be used for the buddy list.
3.1006 - *
3.1007 - * @param ops The ops struct.
3.1008 - */
3.1009 -void purple_blist_set_ui_ops(PurpleBlistUiOps *ops);
3.1010 -
3.1011 -/**
3.1012 - * Returns the UI operations structure to be used for the buddy list.
3.1013 - *
3.1014 - * @return The UI operations structure.
3.1015 - */
3.1016 -PurpleBlistUiOps *purple_blist_get_ui_ops(void);
3.1017 -
3.1018 -/*@}*/
3.1019 -
3.1020 -/**************************************************************************/
3.1021 -/** @name Buddy List Subsystem */
3.1022 -/**************************************************************************/
3.1023 -/*@{*/
3.1024 -
3.1025 -/**
3.1026 - * Returns the handle for the buddy list subsystem.
3.1027 - *
3.1028 - * @return The buddy list subsystem handle.
3.1029 - */
3.1030 -void *purple_blist_get_handle(void);
3.1031 -
3.1032 -/**
3.1033 - * Initializes the buddy list subsystem.
3.1034 - */
3.1035 -void purple_blist_init(void);
3.1036 -
3.1037 -/**
3.1038 - * Uninitializes the buddy list subsystem.
3.1039 - */
3.1040 -void purple_blist_uninit(void);
3.1041 -
3.1042 -/*@}*/
3.1043 -
3.1044 -#ifdef __cplusplus
3.1045 -}
3.1046 -#endif
3.1047 -
3.1048 -#endif /* _PURPLE_BLIST_H_ */
4.1 --- a/Frameworks/libpurple.framework/Versions/0.5.6/Headers/buddy.h Sun Jun 21 22:04:11 2009 -0400
4.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
4.3 @@ -1,124 +0,0 @@
4.4 -/**
4.5 - * @file buddy.h Buddy handlers
4.6 - *
4.7 - * purple
4.8 - *
4.9 - * Copyright (C) 2003 Nathan Walp <faceprint@faceprint.com>
4.10 - *
4.11 - * This program is free software; you can redistribute it and/or modify
4.12 - * it under the terms of the GNU General Public License as published by
4.13 - * the Free Software Foundation; either version 2 of the License, or
4.14 - * (at your option) any later version.
4.15 - *
4.16 - * This program is distributed in the hope that it will be useful,
4.17 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
4.18 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4.19 - * GNU General Public License for more details.
4.20 - *
4.21 - * You should have received a copy of the GNU General Public License
4.22 - * along with this program; if not, write to the Free Software
4.23 - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
4.24 - */
4.25 -#ifndef _PURPLE_JABBER_BUDDY_H_
4.26 -#define _PURPLE_JABBER_BUDDY_H_
4.27 -
4.28 -typedef enum {
4.29 - JABBER_BUDDY_STATE_UNKNOWN = -2,
4.30 - JABBER_BUDDY_STATE_ERROR = -1,
4.31 - JABBER_BUDDY_STATE_UNAVAILABLE = 0,
4.32 - JABBER_BUDDY_STATE_ONLINE,
4.33 - JABBER_BUDDY_STATE_CHAT,
4.34 - JABBER_BUDDY_STATE_AWAY,
4.35 - JABBER_BUDDY_STATE_XA,
4.36 - JABBER_BUDDY_STATE_DND
4.37 -} JabberBuddyState;
4.38 -
4.39 -#include "jabber.h"
4.40 -#include "caps.h"
4.41 -
4.42 -#define AVATARNAMESPACEDATA "http://www.xmpp.org/extensions/xep-0084.html#ns-data"
4.43 -#define AVATARNAMESPACEMETA "http://www.xmpp.org/extensions/xep-0084.html#ns-metadata"
4.44 -
4.45 -typedef struct _JabberBuddy {
4.46 - GList *resources;
4.47 - char *error_msg;
4.48 - enum {
4.49 - JABBER_INVISIBLE_NONE = 0,
4.50 - JABBER_INVISIBLE_SERVER = 1 << 1,
4.51 - JABBER_INVIS_BUDDY = 1 << 2
4.52 - } invisible;
4.53 - enum {
4.54 - JABBER_SUB_NONE = 0,
4.55 - JABBER_SUB_PENDING = 1 << 1,
4.56 - JABBER_SUB_TO = 1 << 2,
4.57 - JABBER_SUB_FROM = 1 << 3,
4.58 - JABBER_SUB_BOTH = (JABBER_SUB_TO | JABBER_SUB_FROM),
4.59 - JABBER_SUB_REMOVE = 1 << 4
4.60 - } subscription;
4.61 -} JabberBuddy;
4.62 -
4.63 -typedef struct _JabberAdHocCommands {
4.64 - char *jid;
4.65 - char *node;
4.66 - char *name;
4.67 -} JabberAdHocCommands;
4.68 -
4.69 -typedef struct _JabberBuddyResource {
4.70 - JabberBuddy *jb;
4.71 - char *name;
4.72 - int priority;
4.73 - JabberBuddyState state;
4.74 - char *status;
4.75 - JabberCapabilities capabilities;
4.76 - char *thread_id;
4.77 - enum {
4.78 - JABBER_CHAT_STATES_UNKNOWN,
4.79 - JABBER_CHAT_STATES_UNSUPPORTED,
4.80 - JABBER_CHAT_STATES_SUPPORTED
4.81 - } chat_states;
4.82 - struct {
4.83 - char *version;
4.84 - char *name;
4.85 - char *os;
4.86 - } client;
4.87 - JabberCapsClientInfo *caps;
4.88 - GList *commands;
4.89 -} JabberBuddyResource;
4.90 -
4.91 -void jabber_buddy_free(JabberBuddy *jb);
4.92 -JabberBuddy *jabber_buddy_find(JabberStream *js, const char *name,
4.93 - gboolean create);
4.94 -JabberBuddyResource *jabber_buddy_find_resource(JabberBuddy *jb,
4.95 - const char *resource);
4.96 -JabberBuddyResource *jabber_buddy_track_resource(JabberBuddy *jb, const char *resource,
4.97 - int priority, JabberBuddyState state, const char *status);
4.98 -void jabber_buddy_resource_free(JabberBuddyResource *jbr);
4.99 -void jabber_buddy_remove_resource(JabberBuddy *jb, const char *resource);
4.100 -const char *jabber_buddy_get_status_msg(JabberBuddy *jb);
4.101 -void jabber_buddy_get_info(PurpleConnection *gc, const char *who);
4.102 -
4.103 -GList *jabber_blist_node_menu(PurpleBlistNode *node);
4.104 -
4.105 -void jabber_set_info(PurpleConnection *gc, const char *info);
4.106 -void jabber_setup_set_info(PurplePluginAction *action);
4.107 -void jabber_set_buddy_icon(PurpleConnection *gc, PurpleStoredImage *img);
4.108 -void jabber_buddy_avatar_update_metadata(JabberStream *js, const char *from, xmlnode *items);
4.109 -
4.110 -const char *jabber_buddy_state_get_name(JabberBuddyState state);
4.111 -const char *jabber_buddy_state_get_status_id(JabberBuddyState state);
4.112 -const char *jabber_buddy_state_get_show(JabberBuddyState state);
4.113 -JabberBuddyState jabber_buddy_status_id_get_state(const char *id);
4.114 -JabberBuddyState jabber_buddy_show_get_state(const char *id);
4.115 -
4.116 -void jabber_user_search(JabberStream *js, const char *directory);
4.117 -void jabber_user_search_begin(PurplePluginAction *);
4.118 -
4.119 -void jabber_buddy_remove_all_pending_buddy_info_requests(JabberStream *js);
4.120 -
4.121 -void jabber_vcard_fetch_mine(JabberStream *js);
4.122 -
4.123 -gboolean jabber_resource_has_capability(const JabberBuddyResource *jbr,
4.124 - const gchar *cap);
4.125 -gboolean jabber_buddy_has_capability(const JabberBuddy *jb, const gchar *cap);
4.126 -
4.127 -#endif /* _PURPLE_JABBER_BUDDY_H_ */
5.1 --- a/Frameworks/libpurple.framework/Versions/0.5.6/Headers/buddyicon.h Sun Jun 21 22:04:11 2009 -0400
5.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
5.3 @@ -1,443 +0,0 @@
5.4 -/**
5.5 - * @file buddyicon.h Buddy Icon API
5.6 - * @ingroup core
5.7 - */
5.8 -
5.9 -/* purple
5.10 - *
5.11 - * Purple is the legal property of its developers, whose names are too numerous
5.12 - * to list here. Please refer to the COPYRIGHT file distributed with this
5.13 - * source distribution.
5.14 - *
5.15 - * This program is free software; you can redistribute it and/or modify
5.16 - * it under the terms of the GNU General Public License as published by
5.17 - * the Free Software Foundation; either version 2 of the License, or
5.18 - * (at your option) any later version.
5.19 - *
5.20 - * This program is distributed in the hope that it will be useful,
5.21 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
5.22 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5.23 - * GNU General Public License for more details.
5.24 - *
5.25 - * You should have received a copy of the GNU General Public License
5.26 - * along with this program; if not, write to the Free Software
5.27 - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
5.28 - */
5.29 -#ifndef _PURPLE_BUDDYICON_H_
5.30 -#define _PURPLE_BUDDYICON_H_
5.31 -
5.32 -/** An opaque structure representing a buddy icon for a particular user on a
5.33 - * particular #PurpleAccount. Instances are reference-counted; use
5.34 - * purple_buddy_icon_ref() and purple_buddy_icon_unref() to take and release
5.35 - * references.
5.36 - */
5.37 -typedef struct _PurpleBuddyIcon PurpleBuddyIcon;
5.38 -
5.39 -#include "account.h"
5.40 -#include "blist.h"
5.41 -#include "imgstore.h"
5.42 -#include "prpl.h"
5.43 -#include "util.h"
5.44 -
5.45 -#ifdef __cplusplus
5.46 -extern "C" {
5.47 -#endif
5.48 -
5.49 -
5.50 -/**************************************************************************/
5.51 -/** @name Buddy Icon API */
5.52 -/**************************************************************************/
5.53 -/*@{*/
5.54 -
5.55 -/**
5.56 - * Creates a new buddy icon structure and populates it.
5.57 - *
5.58 - * If the buddy icon already exists, you'll get a reference to that structure,
5.59 - * which will have been updated with the data supplied.
5.60 - *
5.61 - * @param account The account the user is on.
5.62 - * @param username The username the icon belongs to.
5.63 - * @param icon_data The buddy icon data.
5.64 - * @param icon_len The buddy icon length.
5.65 - * @param checksum A protocol checksum from the prpl or @c NULL.
5.66 - *
5.67 - * @return The buddy icon structure, with a reference for the caller.
5.68 - */
5.69 -PurpleBuddyIcon *purple_buddy_icon_new(PurpleAccount *account, const char *username,
5.70 - void *icon_data, size_t icon_len,
5.71 - const char *checksum);
5.72 -
5.73 -/**
5.74 - * Increments the reference count on a buddy icon.
5.75 - *
5.76 - * @param icon The buddy icon.
5.77 - *
5.78 - * @return @a icon.
5.79 - */
5.80 -PurpleBuddyIcon *purple_buddy_icon_ref(PurpleBuddyIcon *icon);
5.81 -
5.82 -/**
5.83 - * Decrements the reference count on a buddy icon.
5.84 - *
5.85 - * If the reference count reaches 0, the icon will be destroyed.
5.86 - *
5.87 - * @param icon The buddy icon.
5.88 - *
5.89 - * @return @a icon, or @c NULL if the reference count reached 0.
5.90 - */
5.91 -PurpleBuddyIcon *purple_buddy_icon_unref(PurpleBuddyIcon *icon);
5.92 -
5.93 -/**
5.94 - * Updates every instance of this icon.
5.95 - *
5.96 - * @param icon The buddy icon.
5.97 - */
5.98 -void purple_buddy_icon_update(PurpleBuddyIcon *icon);
5.99 -
5.100 -/**
5.101 - * Sets the buddy icon's data.
5.102 - *
5.103 - * @param icon The buddy icon.
5.104 - * @param data The buddy icon data, which the buddy icon code
5.105 - * takes ownership of and will free.
5.106 - * @param len The length of the data in @a data.
5.107 - * @param checksum A protocol checksum from the prpl or @c NULL.
5.108 - */
5.109 -void
5.110 -purple_buddy_icon_set_data(PurpleBuddyIcon *icon, guchar *data,
5.111 - size_t len, const char *checksum);
5.112 -
5.113 -/**
5.114 - * Returns the buddy icon's account.
5.115 - *
5.116 - * @param icon The buddy icon.
5.117 - *
5.118 - * @return The account.
5.119 - */
5.120 -PurpleAccount *purple_buddy_icon_get_account(const PurpleBuddyIcon *icon);
5.121 -
5.122 -/**
5.123 - * Returns the buddy icon's username.
5.124 - *
5.125 - * @param icon The buddy icon.
5.126 - *
5.127 - * @return The username.
5.128 - */
5.129 -const char *purple_buddy_icon_get_username(const PurpleBuddyIcon *icon);
5.130 -
5.131 -/**
5.132 - * Returns the buddy icon's checksum.
5.133 - *
5.134 - * This function is really only for prpl use.
5.135 - *
5.136 - * @param icon The buddy icon.
5.137 - *
5.138 - * @return The checksum.
5.139 - */
5.140 -const char *purple_buddy_icon_get_checksum(const PurpleBuddyIcon *icon);
5.141 -
5.142 -/**
5.143 - * Returns the buddy icon's data.
5.144 - *
5.145 - * @param icon The buddy icon.
5.146 - * @param len If not @c NULL, the length of the icon data returned will be
5.147 - * set in the location pointed to by this.
5.148 - *
5.149 - * @return A pointer to the icon data.
5.150 - */
5.151 -gconstpointer purple_buddy_icon_get_data(const PurpleBuddyIcon *icon, size_t *len);
5.152 -
5.153 -/**
5.154 - * Returns an extension corresponding to the buddy icon's file type.
5.155 - *
5.156 - * @param icon The buddy icon.
5.157 - *
5.158 - * @return The icon's extension, "icon" if unknown, or @c NULL if
5.159 - * the image data has disappeared.
5.160 - */
5.161 -const char *purple_buddy_icon_get_extension(const PurpleBuddyIcon *icon);
5.162 -
5.163 -/**
5.164 - * Returns a full path to an icon.
5.165 - *
5.166 - * If the icon has data and the file exists in the cache, this will return
5.167 - * a full path to the cache file.
5.168 - *
5.169 - * In general, it is not appropriate to be poking in the icon cache
5.170 - * directly. If you find yourself wanting to use this function, think
5.171 - * very long and hard about it, and then don't.
5.172 - *
5.173 - * @param icon The buddy icon
5.174 - *
5.175 - * @return A full path to the file, or @c NULL under various conditions.
5.176 - */
5.177 -char *purple_buddy_icon_get_full_path(PurpleBuddyIcon *icon);
5.178 -
5.179 -/*@}*/
5.180 -
5.181 -/**************************************************************************/
5.182 -/** @name Buddy Icon Subsystem API */
5.183 -/**************************************************************************/
5.184 -/*@{*/
5.185 -
5.186 -/**
5.187 - * Sets a buddy icon for a user.
5.188 - *
5.189 - * @param account The account the user is on.
5.190 - * @param username The username of the user.
5.191 - * @param icon_data The buddy icon data, which the buddy icon code
5.192 - * takes ownership of and will free.
5.193 - * @param icon_len The length of the icon data.
5.194 - * @param checksum A protocol checksum from the prpl or @c NULL.
5.195 - *
5.196 - * @return The buddy icon set, or NULL if no icon was set.
5.197 - */
5.198 -void
5.199 -purple_buddy_icons_set_for_user(PurpleAccount *account, const char *username,
5.200 - void *icon_data, size_t icon_len,
5.201 - const char *checksum);
5.202 -
5.203 -/**
5.204 - * Returns the checksum for the buddy icon of a specified buddy.
5.205 - *
5.206 - * This avoids loading the icon image data from the cache if it's
5.207 - * not already loaded for some other reason.
5.208 - *
5.209 - * @param buddy The buddy
5.210 - *
5.211 - * @return The checksum.
5.212 - */
5.213 -const char *
5.214 -purple_buddy_icons_get_checksum_for_user(PurpleBuddy *buddy);
5.215 -
5.216 -/**
5.217 - * Returns the buddy icon information for a user.
5.218 - *
5.219 - * @param account The account the user is on.
5.220 - * @param username The username of the user.
5.221 - *
5.222 - * @return The icon (with a reference for the caller) if found, or @c NULL if
5.223 - * not found.
5.224 - */
5.225 -PurpleBuddyIcon *
5.226 -purple_buddy_icons_find(PurpleAccount *account, const char *username);
5.227 -
5.228 -/**
5.229 - * Returns the buddy icon image for an account.
5.230 - *
5.231 - * The caller owns a reference to the image in the store, and must dereference
5.232 - * the image with purple_imgstore_unref() for it to be freed.
5.233 - *
5.234 - * This function deals with loading the icon from the cache, if
5.235 - * needed, so it should be called in any case where you want the
5.236 - * appropriate icon.
5.237 - *
5.238 - * @param account The account
5.239 - *
5.240 - * @return The account's buddy icon image.
5.241 - */
5.242 -PurpleStoredImage *
5.243 -purple_buddy_icons_find_account_icon(PurpleAccount *account);
5.244 -
5.245 -/**
5.246 - * Sets a buddy icon for an account.
5.247 - *
5.248 - * This function will deal with saving a record of the icon,
5.249 - * caching the data, etc.
5.250 - *
5.251 - * @param account The account for which to set a custom icon.
5.252 - * @param icon_data The image data of the icon, which the
5.253 - * buddy icon code will free.
5.254 - * @param icon_len The length of the data in @a icon_data.
5.255 - *
5.256 - * @return The icon that was set. The caller does NOT own
5.257 - * a reference to this, and must call purple_imgstore_ref()
5.258 - * if it wants one.
5.259 - */
5.260 -PurpleStoredImage *
5.261 -purple_buddy_icons_set_account_icon(PurpleAccount *account,
5.262 - guchar *icon_data, size_t icon_len);
5.263 -
5.264 -/**
5.265 - * Returns the timestamp of when the icon was set.
5.266 - *
5.267 - * This is intended for use in protocols that require a timestamp for
5.268 - * buddy icon update reasons.
5.269 - *
5.270 - * @param account The account
5.271 - *
5.272 - * @return The time the icon was set, or 0 if an error occurred.
5.273 - */
5.274 -time_t
5.275 -purple_buddy_icons_get_account_icon_timestamp(PurpleAccount *account);
5.276 -
5.277 -/**
5.278 - * Returns a boolean indicating if a given blist node has a custom buddy icon.
5.279 - *
5.280 - * @param node The blist node.
5.281 - *
5.282 - * @return A boolean indicating if @a node has a custom buddy icon.
5.283 - * @since 2.5.0
5.284 - */
5.285 -gboolean
5.286 -purple_buddy_icons_node_has_custom_icon(PurpleBlistNode *node);
5.287 -
5.288 -/**
5.289 - * Returns the custom buddy icon image for a blist node.
5.290 - *
5.291 - * The caller owns a reference to the image in the store, and must dereference
5.292 - * the image with purple_imgstore_unref() for it to be freed.
5.293 - *
5.294 - * This function deals with loading the icon from the cache, if
5.295 - * needed, so it should be called in any case where you want the
5.296 - * appropriate icon.
5.297 - *
5.298 - * @param node The node.
5.299 - *
5.300 - * @return The custom buddy icon.
5.301 - * @since 2.5.0
5.302 - */
5.303 -PurpleStoredImage *
5.304 -purple_buddy_icons_node_find_custom_icon(PurpleBlistNode *node);
5.305 -
5.306 -/**
5.307 - * Sets a custom buddy icon for a blist node.
5.308 - *
5.309 - * This function will deal with saving a record of the icon, caching the data,
5.310 - * etc.
5.311 - *
5.312 - * @param node The blist node for which to set a custom icon.
5.313 - * @param icon_data The image data of the icon, which the buddy icon code will
5.314 - * free. Use NULL to unset the icon.
5.315 - * @param icon_len The length of the data in @a icon_data.
5.316 - *
5.317 - * @return The icon that was set. The caller does NOT own a reference to this,
5.318 - * and must call purple_imgstore_ref() if it wants one.
5.319 - * @since 2.5.0
5.320 - */
5.321 -PurpleStoredImage *
5.322 -purple_buddy_icons_node_set_custom_icon(PurpleBlistNode *node,
5.323 - guchar *icon_data, size_t icon_len);
5.324 -
5.325 -/**
5.326 - * Sets a custom buddy icon for a blist node.
5.327 - *
5.328 - * Convenience wrapper around purple_buddy_icons_node_set_custom_icon.
5.329 - * @see purple_buddy_icons_node_set_custom_icon()
5.330 - *
5.331 - * @param node The blist node for which to set a custom icon.
5.332 - * @param filename The path to the icon to set for the blist node. Use NULL
5.333 - * to unset the custom icon.
5.334 - *
5.335 - * @return The icon that was set. The caller does NOT own a reference to this,
5.336 - * and must call purple_imgstore_ref() if it wants one.
5.337 - * @since 2.5.0
5.338 - */
5.339 -PurpleStoredImage *
5.340 -purple_buddy_icons_node_set_custom_icon_from_file(PurpleBlistNode *node,
5.341 - const gchar *filename);
5.342 -
5.343 -#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_BUDDYICON_C_)
5.344 -/**
5.345 - * PurpleContact version of purple_buddy_icons_node_has_custom_icon.
5.346 - *
5.347 - * @copydoc purple_buddy_icons_node_has_custom_icon()
5.348 - *
5.349 - * @deprecated Use purple_buddy_icons_node_has_custom_icon instead.
5.350 - */
5.351 -gboolean
5.352 -purple_buddy_icons_has_custom_icon(PurpleContact *contact);
5.353 -
5.354 -/**
5.355 - * PurpleContact version of purple_buddy_icons_node_find_custom_icon.
5.356 - *
5.357 - * @copydoc purple_buddy_icons_node_find_custom_icon()
5.358 - *
5.359 - * @deprecated Use purple_buddy_icons_node_find_custom_icon instead.
5.360 - */
5.361 -PurpleStoredImage *
5.362 -purple_buddy_icons_find_custom_icon(PurpleContact *contact);
5.363 -
5.364 -/**
5.365 - * PurpleContact version of purple_buddy_icons_node_set_custom_icon.
5.366 - *
5.367 - * @copydoc purple_buddy_icons_node_set_custom_icon()
5.368 - *
5.369 - * @deprecated Use purple_buddy_icons_node_set_custom_icon instead.
5.370 - */
5.371 -PurpleStoredImage *
5.372 -purple_buddy_icons_set_custom_icon(PurpleContact *contact,
5.373 - guchar *icon_data, size_t icon_len);
5.374 -#endif
5.375 -
5.376 -/**
5.377 - * Sets whether or not buddy icon caching is enabled.
5.378 - *
5.379 - * @param caching TRUE of buddy icon caching should be enabled, or
5.380 - * FALSE otherwise.
5.381 - */
5.382 -void purple_buddy_icons_set_caching(gboolean caching);
5.383 -
5.384 -/**
5.385 - * Returns whether or not buddy icon caching should be enabled.
5.386 - *
5.387 - * The default is TRUE, unless otherwise specified by
5.388 - * purple_buddy_icons_set_caching().
5.389 - *
5.390 - * @return TRUE if buddy icon caching is enabled, or FALSE otherwise.
5.391 - */
5.392 -gboolean purple_buddy_icons_is_caching(void);
5.393 -
5.394 -/**
5.395 - * Sets the directory used to store buddy icon cache files.
5.396 - *
5.397 - * @param cache_dir The directory to store buddy icon cache files to.
5.398 - */
5.399 -void purple_buddy_icons_set_cache_dir(const char *cache_dir);
5.400 -
5.401 -/**
5.402 - * Returns the directory used to store buddy icon cache files.
5.403 - *
5.404 - * The default directory is PURPLEDIR/icons, unless otherwise specified
5.405 - * by purple_buddy_icons_set_cache_dir().
5.406 - *
5.407 - * @return The directory to store buddy icon cache files to.
5.408 - */
5.409 -const char *purple_buddy_icons_get_cache_dir(void);
5.410 -
5.411 -/**
5.412 - * Returns the buddy icon subsystem handle.
5.413 - *
5.414 - * @return The subsystem handle.
5.415 - */
5.416 -void *purple_buddy_icons_get_handle(void);
5.417 -
5.418 -/**
5.419 - * Initializes the buddy icon subsystem.
5.420 - */
5.421 -void purple_buddy_icons_init(void);
5.422 -
5.423 -/**
5.424 - * Uninitializes the buddy icon subsystem.
5.425 - */
5.426 -void purple_buddy_icons_uninit(void);
5.427 -
5.428 -/*@}*/
5.429 -
5.430 -/**************************************************************************/
5.431 -/** @name Buddy Icon Helper API */
5.432 -/**************************************************************************/
5.433 -/*@{*/
5.434 -
5.435 -/**
5.436 - * Gets display size for a buddy icon
5.437 - */
5.438 -void purple_buddy_icon_get_scale_size(PurpleBuddyIconSpec *spec, int *width, int *height);
5.439 -
5.440 -/*@}*/
5.441 -
5.442 -#ifdef __cplusplus
5.443 -}
5.444 -#endif
5.445 -
5.446 -#endif /* _PURPLE_BUDDYICON_H_ */
6.1 --- a/Frameworks/libpurple.framework/Versions/0.5.6/Headers/buddylist.h Sun Jun 21 22:04:11 2009 -0400
6.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
6.3 @@ -1,65 +0,0 @@
6.4 -/**
6.5 - * @file buddylist.h
6.6 - *
6.7 - * purple
6.8 - *
6.9 - * Copyright (C) 2005 Bartosz Oler <bartosz@bzimage.us>
6.10 - *
6.11 - * This program is free software; you can redistribute it and/or modify
6.12 - * it under the terms of the GNU General Public License as published by
6.13 - * the Free Software Foundation; either version 2 of the License, or
6.14 - * (at your option) any later version.
6.15 - *
6.16 - * This program is distributed in the hope that it will be useful,
6.17 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
6.18 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
6.19 - * GNU General Public License for more details.
6.20 - *
6.21 - * You should have received a copy of the GNU General Public License
6.22 - * along with this program; if not, write to the Free Software
6.23 - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
6.24 - */
6.25 -
6.26 -
6.27 -#ifndef _PURPLE_GG_BUDDYLIST_H
6.28 -#define _PURPLE_GG_BUDDYLIST_H
6.29 -
6.30 -#include "connection.h"
6.31 -#include "account.h"
6.32 -
6.33 -void
6.34 -ggp_buddylist_send(PurpleConnection *gc);
6.35 -
6.36 -/**
6.37 - * Load buddylist from server into the rooster.
6.38 - *
6.39 - * @param gc PurpleConnection
6.40 - * @param buddylist Pointer to the buddylist that will be loaded.
6.41 - */
6.42 -/* void ggp_buddylist_load(PurpleConnection *gc, char *buddylist) {{{ */
6.43 -void
6.44 -ggp_buddylist_load(PurpleConnection *gc, char *buddylist);
6.45 -
6.46 -/**
6.47 - * Set offline status for all buddies.
6.48 - *
6.49 - * @param gc Connection handler
6.50 - */
6.51 -void
6.52 -ggp_buddylist_offline(PurpleConnection *gc);
6.53 -
6.54 -/**
6.55 - * Get all the buddies in the current account.
6.56 - *
6.57 - * @param account Current account.
6.58 - *
6.59 - * @return List of buddies.
6.60 - */
6.61 -char *
6.62 -ggp_buddylist_dump(PurpleAccount *account);
6.63 -
6.64 -
6.65 -#endif /* _PURPLE_GG_BUDDYLIST_H */
6.66 -
6.67 -
6.68 -/* vim: set ts=8 sts=0 sw=8 noet: */
7.1 --- a/Frameworks/libpurple.framework/Versions/0.5.6/Headers/caps.h Sun Jun 21 22:04:11 2009 -0400
7.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
7.3 @@ -1,49 +0,0 @@
7.4 -/*
7.5 - * purple - Jabber Protocol Plugin
7.6 - *
7.7 - * Copyright (C) 2007, Andreas Monitzer <andy@monitzer.com>
7.8 - *
7.9 - * This program is free software; you can redistribute it and/or modify
7.10 - * it under the terms of the GNU General Public License as published by
7.11 - * the Free Software Foundation; either version 2 of the License, or
7.12 - * (at your option) any later version.
7.13 - *
7.14 - * This program is distributed in the hope that it will be useful,
7.15 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
7.16 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7.17 - * GNU General Public License for more details.
7.18 - *
7.19 - * You should have received a copy of the GNU General Public License
7.20 - * along with this program; if not, write to the Free Software
7.21 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
7.22 - *
7.23 - */
7.24 -
7.25 -#ifndef _PURPLE_JABBER_CAPS_H_
7.26 -#define _PURPLE_JABBER_CAPS_H_
7.27 -
7.28 -typedef struct _JabberCapsClientInfo JabberCapsClientInfo;
7.29 -
7.30 -#include "jabber.h"
7.31 -
7.32 -/* Implementation of XEP-0115 */
7.33 -
7.34 -typedef struct _JabberCapsIdentity {
7.35 - char *category;
7.36 - char *type;
7.37 - char *name;
7.38 -} JabberCapsIdentity;
7.39 -
7.40 -struct _JabberCapsClientInfo {
7.41 - GList *identities; /* JabberCapsIdentity */
7.42 - GList *features; /* char * */
7.43 -};
7.44 -
7.45 -typedef void (*jabber_caps_get_info_cb)(JabberCapsClientInfo *info, gpointer user_data);
7.46 -
7.47 -void jabber_caps_init(void);
7.48 -
7.49 -void jabber_caps_get_info(JabberStream *js, const char *who, const char *node, const char *ver, const char *ext, jabber_caps_get_info_cb cb, gpointer user_data);
7.50 -void jabber_caps_free_clientinfo(JabberCapsClientInfo *clientinfo);
7.51 -
7.52 -#endif /* _PURPLE_JABBER_CAPS_H_ */
8.1 --- a/Frameworks/libpurple.framework/Versions/0.5.6/Headers/certificate.h Sun Jun 21 22:04:11 2009 -0400
8.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
8.3 @@ -1,802 +0,0 @@
8.4 -/**
8.5 - * @file certificate.h Public-Key Certificate API
8.6 - * @ingroup core
8.7 - * @see @ref certificate-signals
8.8 - * @since 2.2.0
8.9 - */
8.10 -
8.11 -/*
8.12 - *
8.13 - * purple
8.14 - *
8.15 - * Purple is the legal property of its developers, whose names are too numerous
8.16 - * to list here. Please refer to the COPYRIGHT file distributed with this
8.17 - * source distribution.
8.18 - *
8.19 - * This program is free software; you can redistribute it and/or modify
8.20 - * it under the terms of the GNU General Public License as published by
8.21 - * the Free Software Foundation; either version 2 of the License, or
8.22 - * (at your option) any later version.
8.23 - *
8.24 - * This program is distributed in the hope that it will be useful,
8.25 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
8.26 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8.27 - * GNU General Public License for more details.
8.28 - *
8.29 - * You should have received a copy of the GNU General Public License
8.30 - * along with this program; if not, write to the Free Software
8.31 - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
8.32 - */
8.33 -
8.34 -#ifndef _PURPLE_CERTIFICATE_H
8.35 -#define _PURPLE_CERTIFICATE_H
8.36 -
8.37 -#include <time.h>
8.38 -
8.39 -#include <glib.h>
8.40 -
8.41 -#ifdef __cplusplus
8.42 -extern "C" {
8.43 -#endif /* __cplusplus */
8.44 -
8.45 -
8.46 -typedef enum
8.47 -{
8.48 - PURPLE_CERTIFICATE_INVALID = 0,
8.49 - PURPLE_CERTIFICATE_VALID = 1
8.50 -} PurpleCertificateVerificationStatus;
8.51 -
8.52 -typedef struct _PurpleCertificate PurpleCertificate;
8.53 -typedef struct _PurpleCertificatePool PurpleCertificatePool;
8.54 -typedef struct _PurpleCertificateScheme PurpleCertificateScheme;
8.55 -typedef struct _PurpleCertificateVerifier PurpleCertificateVerifier;
8.56 -typedef struct _PurpleCertificateVerificationRequest PurpleCertificateVerificationRequest;
8.57 -
8.58 -/**
8.59 - * Callback function for the results of a verification check
8.60 - * @param st Status code
8.61 - * @param userdata User-defined data
8.62 - */
8.63 -typedef void (*PurpleCertificateVerifiedCallback)
8.64 - (PurpleCertificateVerificationStatus st,
8.65 - gpointer userdata);
8.66 -
8.67 -/** A certificate instance
8.68 - *
8.69 - * An opaque data structure representing a single certificate under some
8.70 - * CertificateScheme
8.71 - */
8.72 -struct _PurpleCertificate
8.73 -{
8.74 - /** Scheme this certificate is under */
8.75 - PurpleCertificateScheme * scheme;
8.76 - /** Opaque pointer to internal data */
8.77 - gpointer data;
8.78 -};
8.79 -
8.80 -/**
8.81 - * Database for retrieval or storage of Certificates
8.82 - *
8.83 - * More or less a hash table; all lookups and writes are controlled by a string
8.84 - * key.
8.85 - */
8.86 -struct _PurpleCertificatePool
8.87 -{
8.88 - /** Scheme this Pool operates for */
8.89 - gchar *scheme_name;
8.90 - /** Internal name to refer to the pool by */
8.91 - gchar *name;
8.92 -
8.93 - /** User-friendly name for this type
8.94 - * ex: N_("SSL Servers")
8.95 - * When this is displayed anywhere, it should be i18ned
8.96 - * ex: _(pool->fullname)
8.97 - */
8.98 - gchar *fullname;
8.99 -
8.100 - /** Internal pool data */
8.101 - gpointer data;
8.102 -
8.103 - /**
8.104 - * Set up the Pool's internal state
8.105 - *
8.106 - * Upon calling purple_certificate_register_pool() , this function will
8.107 - * be called. May be NULL.
8.108 - * @return TRUE if the initialization succeeded, otherwise FALSE
8.109 - */
8.110 - gboolean (* init)(void);
8.111 -
8.112 - /**
8.113 - * Uninit the Pool's internal state
8.114 - *
8.115 - * Will be called by purple_certificate_unregister_pool() . May be NULL
8.116 - */
8.117 - void (* uninit)(void);
8.118 -
8.119 - /** Check for presence of a certificate in the pool using unique ID */
8.120 - gboolean (* cert_in_pool)(const gchar *id);
8.121 - /** Retrieve a PurpleCertificate from the pool */
8.122 - PurpleCertificate * (* get_cert)(const gchar *id);
8.123 - /** Add a certificate to the pool. Must overwrite any other
8.124 - * certificates sharing the same ID in the pool.
8.125 - * @return TRUE if the operation succeeded, otherwise FALSE
8.126 - */
8.127 - gboolean (* put_cert)(const gchar *id, PurpleCertificate *crt);
8.128 - /** Delete a certificate from the pool */
8.129 - gboolean (* delete_cert)(const gchar *id);
8.130 -
8.131 - /** Returns a list of IDs stored in the pool */
8.132 - GList * (* get_idlist)(void);
8.133 -
8.134 - void (*_purple_reserved1)(void);
8.135 - void (*_purple_reserved2)(void);
8.136 - void (*_purple_reserved3)(void);
8.137 - void (*_purple_reserved4)(void);
8.138 -};
8.139 -
8.140 -/** A certificate type
8.141 - *
8.142 - * A CertificateScheme must implement all of the fields in the structure,
8.143 - * and register it using purple_certificate_register_scheme()
8.144 - *
8.145 - * There may be only ONE CertificateScheme provided for each certificate
8.146 - * type, as specified by the "name" field.
8.147 - */
8.148 -struct _PurpleCertificateScheme
8.149 -{
8.150 - /** Name of the certificate type
8.151 - * ex: "x509", "pgp", etc.
8.152 - * This must be globally unique - you may not register more than one
8.153 - * CertificateScheme of the same name at a time.
8.154 - */
8.155 - gchar * name;
8.156 -
8.157 - /** User-friendly name for this type
8.158 - * ex: N_("X.509 Certificates")
8.159 - * When this is displayed anywhere, it should be i18ned
8.160 - * ex: _(scheme->fullname)
8.161 - */
8.162 - gchar * fullname;
8.163 -
8.164 - /** Imports a certificate from a file
8.165 - *
8.166 - * @param filename File to import the certificate from
8.167 - * @return Pointer to the newly allocated Certificate struct
8.168 - * or NULL on failure.
8.169 - */
8.170 - PurpleCertificate * (* import_certificate)(const gchar * filename);
8.171 -
8.172 - /**
8.173 - * Exports a certificate to a file
8.174 - *
8.175 - * @param filename File to export the certificate to
8.176 - * @param crt Certificate to export
8.177 - * @return TRUE if the export succeeded, otherwise FALSE
8.178 - * @see purple_certificate_export()
8.179 - */
8.180 - gboolean (* export_certificate)(const gchar *filename, PurpleCertificate *crt);
8.181 -
8.182 - /**
8.183 - * Duplicates a certificate
8.184 - *
8.185 - * Certificates are generally assumed to be read-only, so feel free to
8.186 - * do any sort of reference-counting magic you want here. If this ever
8.187 - * changes, please remember to change the magic accordingly.
8.188 - * @return Reference to the new copy
8.189 - */
8.190 - PurpleCertificate * (* copy_certificate)(PurpleCertificate *crt);
8.191 -
8.192 - /** Destroys and frees a Certificate structure
8.193 - *
8.194 - * Destroys a Certificate's internal data structures and calls
8.195 - * free(crt)
8.196 - *
8.197 - * @param crt Certificate instance to be destroyed. It WILL NOT be
8.198 - * destroyed if it is not of the correct
8.199 - * CertificateScheme. Can be NULL
8.200 - */
8.201 - void (* destroy_certificate)(PurpleCertificate * crt);
8.202 -
8.203 - /** Find whether "crt" has a valid signature from issuer "issuer"
8.204 - * @see purple_certificate_signed_by() */
8.205 - gboolean (*signed_by)(PurpleCertificate *crt, PurpleCertificate *issuer);
8.206 - /**
8.207 - * Retrieves the certificate public key fingerprint using SHA1
8.208 - *
8.209 - * @param crt Certificate instance
8.210 - * @return Binary representation of SHA1 hash - must be freed using
8.211 - * g_byte_array_free()
8.212 - */
8.213 - GByteArray * (* get_fingerprint_sha1)(PurpleCertificate *crt);
8.214 -
8.215 - /**
8.216 - * Retrieves a unique certificate identifier
8.217 - *
8.218 - * @param crt Certificate instance
8.219 - * @return Newly allocated string that can be used to uniquely
8.220 - * identify the certificate.
8.221 - */
8.222 - gchar * (* get_unique_id)(PurpleCertificate *crt);
8.223 -
8.224 - /**
8.225 - * Retrieves a unique identifier for the certificate's issuer
8.226 - *
8.227 - * @param crt Certificate instance
8.228 - * @return Newly allocated string that can be used to uniquely
8.229 - * identify the issuer's certificate.
8.230 - */
8.231 - gchar * (* get_issuer_unique_id)(PurpleCertificate *crt);
8.232 -
8.233 - /**
8.234 - * Gets the certificate subject's name
8.235 - *
8.236 - * For X.509, this is the "Common Name" field, as we're only using it
8.237 - * for hostname verification at the moment
8.238 - *
8.239 - * @see purple_certificate_get_subject_name()
8.240 - *
8.241 - * @param crt Certificate instance
8.242 - * @return Newly allocated string with the certificate subject.
8.243 - */
8.244 - gchar * (* get_subject_name)(PurpleCertificate *crt);
8.245 -
8.246 - /**
8.247 - * Check the subject name against that on the certificate
8.248 - * @see purple_certificate_check_subject_name()
8.249 - * @return TRUE if it is a match, else FALSE
8.250 - */
8.251 - gboolean (* check_subject_name)(PurpleCertificate *crt, const gchar *name);
8.252 -
8.253 - /** Retrieve the certificate activation/expiration times */
8.254 - gboolean (* get_times)(PurpleCertificate *crt, time_t *activation, time_t *expiration);
8.255 -
8.256 - void (*_purple_reserved1)(void);
8.257 - void (*_purple_reserved2)(void);
8.258 - void (*_purple_reserved3)(void);
8.259 - void (*_purple_reserved4)(void);
8.260 -};
8.261 -
8.262 -/** A set of operations used to provide logic for verifying a Certificate's
8.263 - * authenticity.
8.264 - *
8.265 - * A Verifier provider must fill out these fields, then register it using
8.266 - * purple_certificate_register_verifier()
8.267 - *
8.268 - * The (scheme_name, name) value must be unique for each Verifier - you may not
8.269 - * register more than one Verifier of the same name for each Scheme
8.270 - */
8.271 -struct _PurpleCertificateVerifier
8.272 -{
8.273 - /** Name of the scheme this Verifier operates on
8.274 - *
8.275 - * The scheme will be looked up by name when a Request is generated
8.276 - * using this Verifier
8.277 - */
8.278 - gchar *scheme_name;
8.279 -
8.280 - /** Name of the Verifier - case insensitive */
8.281 - gchar *name;
8.282 -
8.283 - /**
8.284 - * Start the verification process
8.285 - *
8.286 - * To be called from purple_certificate_verify once it has
8.287 - * constructed the request. This will use the information in the
8.288 - * given VerificationRequest to check the certificate and callback
8.289 - * the requester with the verification results.
8.290 - *
8.291 - * @param vrq Request to process
8.292 - */
8.293 - void (* start_verification)(PurpleCertificateVerificationRequest *vrq);
8.294 -
8.295 - /**
8.296 - * Destroy a completed Request under this Verifier
8.297 - * The function pointed to here is only responsible for cleaning up
8.298 - * whatever PurpleCertificateVerificationRequest::data points to.
8.299 - * It should not call free(vrq)
8.300 - *
8.301 - * @param vrq Request to destroy
8.302 - */
8.303 - void (* destroy_request)(PurpleCertificateVerificationRequest *vrq);
8.304 -
8.305 - void (*_purple_reserved1)(void);
8.306 - void (*_purple_reserved2)(void);
8.307 - void (*_purple_reserved3)(void);
8.308 - void (*_purple_reserved4)(void);
8.309 -};
8.310 -
8.311 -/** Structure for a single certificate request
8.312 - *
8.313 - * Useful for keeping track of the state of a verification that involves
8.314 - * several steps
8.315 - */
8.316 -struct _PurpleCertificateVerificationRequest
8.317 -{
8.318 - /** Reference to the verification logic used */
8.319 - PurpleCertificateVerifier *verifier;
8.320 - /** Reference to the scheme used.
8.321 - *
8.322 - * This is looked up from the Verifier when the Request is generated
8.323 - */
8.324 - PurpleCertificateScheme *scheme;
8.325 -
8.326 - /**
8.327 - * Name to check that the certificate is issued to
8.328 - *
8.329 - * For X.509 certificates, this is the Common Name
8.330 - */
8.331 - gchar *subject_name;
8.332 -
8.333 - /** List of certificates in the chain to be verified (such as that returned by purple_ssl_get_peer_certificates )
8.334 - *
8.335 - * This is most relevant for X.509 certificates used in SSL sessions.
8.336 - * The list order should be: certificate, issuer, issuer's issuer, etc.
8.337 - */
8.338 - GList *cert_chain;
8.339 -
8.340 - /** Internal data used by the Verifier code */
8.341 - gpointer data;
8.342 -
8.343 - /** Function to call with the verification result */
8.344 - PurpleCertificateVerifiedCallback cb;
8.345 - /** Data to pass to the post-verification callback */
8.346 - gpointer cb_data;
8.347 -};
8.348 -
8.349 -/*****************************************************************************/
8.350 -/** @name Certificate Verification Functions */
8.351 -/*****************************************************************************/
8.352 -/*@{*/
8.353 -
8.354 -/**
8.355 - * Constructs a verification request and passed control to the specified Verifier
8.356 - *
8.357 - * It is possible that the callback will be called immediately upon calling
8.358 - * this function. Plan accordingly.
8.359 - *
8.360 - * @param verifier Verification logic to use.
8.361 - * @see purple_certificate_find_verifier()
8.362 - *
8.363 - * @param subject_name Name that should match the first certificate in the
8.364 - * chain for the certificate to be valid. Will be strdup'd
8.365 - * into the Request struct
8.366 - *
8.367 - * @param cert_chain Certificate chain to check. If there is more than one
8.368 - * certificate in the chain (X.509), the peer's
8.369 - * certificate comes first, then the issuer/signer's
8.370 - * certificate, etc. The whole list is duplicated into the
8.371 - * Request struct.
8.372 - *
8.373 - * @param cb Callback function to be called with whether the
8.374 - * certificate was approved or not.
8.375 - * @param cb_data User-defined data for the above.
8.376 - */
8.377 -void
8.378 -purple_certificate_verify (PurpleCertificateVerifier *verifier,
8.379 - const gchar *subject_name, GList *cert_chain,
8.380 - PurpleCertificateVerifiedCallback cb,
8.381 - gpointer cb_data);
8.382 -
8.383 -/**
8.384 - * Completes and destroys a VerificationRequest
8.385 - *
8.386 - * @param vrq Request to conclude
8.387 - * @param st Success/failure code to pass to the request's
8.388 - * completion callback.
8.389 - */
8.390 -void
8.391 -purple_certificate_verify_complete(PurpleCertificateVerificationRequest *vrq,
8.392 - PurpleCertificateVerificationStatus st);
8.393 -
8.394 -/*@}*/
8.395 -
8.396 -/*****************************************************************************/
8.397 -/** @name Certificate Functions */
8.398 -/*****************************************************************************/
8.399 -/*@{*/
8.400 -
8.401 -/**
8.402 - * Makes a duplicate of a certificate
8.403 - *
8.404 - * @param crt Instance to duplicate
8.405 - * @return Pointer to new instance
8.406 - */
8.407 -PurpleCertificate *
8.408 -purple_certificate_copy(PurpleCertificate *crt);
8.409 -
8.410 -/**
8.411 - * Duplicates an entire list of certificates
8.412 - *
8.413 - * @param crt_list List to duplicate
8.414 - * @return New list copy
8.415 - */
8.416 -GList *
8.417 -purple_certificate_copy_list(GList *crt_list);
8.418 -
8.419 -/**
8.420 - * Destroys and free()'s a Certificate
8.421 - *
8.422 - * @param crt Instance to destroy. May be NULL.
8.423 - */
8.424 -void
8.425 -purple_certificate_destroy (PurpleCertificate *crt);
8.426 -
8.427 -/**
8.428 - * Destroy an entire list of Certificate instances and the containing list
8.429 - *
8.430 - * @param crt_list List of certificates to destroy. May be NULL.
8.431 - */
8.432 -void
8.433 -purple_certificate_destroy_list (GList * crt_list);
8.434 -
8.435 -/**
8.436 - * Check whether 'crt' has a valid signature made by 'issuer'
8.437 - *
8.438 - * @param crt Certificate instance to check signature of
8.439 - * @param issuer Certificate thought to have signed 'crt'
8.440 - *
8.441 - * @return TRUE if 'crt' has a valid signature made by 'issuer',
8.442 - * otherwise FALSE
8.443 - * @todo Find a way to give the reason (bad signature, not the issuer, etc.)
8.444 - */
8.445 -gboolean
8.446 -purple_certificate_signed_by(PurpleCertificate *crt, PurpleCertificate *issuer);
8.447 -
8.448 -/**
8.449 - * Check that a certificate chain is valid
8.450 - *
8.451 - * Uses purple_certificate_signed_by() to verify that each PurpleCertificate
8.452 - * in the chain carries a valid signature from the next. A single-certificate
8.453 - * chain is considered to be valid.
8.454 - *
8.455 - * @param chain List of PurpleCertificate instances comprising the chain,
8.456 - * in the order certificate, issuer, issuer's issuer, etc.
8.457 - * @return TRUE if the chain is valid. See description.
8.458 - * @todo Specify which certificate in the chain caused a failure
8.459 - */
8.460 -gboolean
8.461 -purple_certificate_check_signature_chain(GList *chain);
8.462 -
8.463 -/**
8.464 - * Imports a PurpleCertificate from a file
8.465 - *
8.466 - * @param scheme Scheme to import under
8.467 - * @param filename File path to import from
8.468 - * @return Pointer to a new PurpleCertificate, or NULL on failure
8.469 - */
8.470 -PurpleCertificate *
8.471 -purple_certificate_import(PurpleCertificateScheme *scheme, const gchar *filename);
8.472 -
8.473 -/**
8.474 - * Exports a PurpleCertificate to a file
8.475 - *
8.476 - * @param filename File to export the certificate to
8.477 - * @param crt Certificate to export
8.478 - * @return TRUE if the export succeeded, otherwise FALSE
8.479 - */
8.480 -gboolean
8.481 -purple_certificate_export(const gchar *filename, PurpleCertificate *crt);
8.482 -
8.483 -
8.484 -/**
8.485 - * Retrieves the certificate public key fingerprint using SHA1.
8.486 - *
8.487 - * @param crt Certificate instance
8.488 - * @return Binary representation of the hash. You are responsible for free()ing
8.489 - * this.
8.490 - * @see purple_base16_encode_chunked()
8.491 - */
8.492 -GByteArray *
8.493 -purple_certificate_get_fingerprint_sha1(PurpleCertificate *crt);
8.494 -
8.495 -/**
8.496 - * Get a unique identifier for the certificate
8.497 - *
8.498 - * @param crt Certificate instance
8.499 - * @return String representing the certificate uniquely. Must be g_free()'ed
8.500 - */
8.501 -gchar *
8.502 -purple_certificate_get_unique_id(PurpleCertificate *crt);
8.503 -
8.504 -/**
8.505 - * Get a unique identifier for the certificate's issuer
8.506 - *
8.507 - * @param crt Certificate instance
8.508 - * @return String representing the certificate's issuer uniquely. Must be
8.509 - * g_free()'ed
8.510 - */
8.511 -gchar *
8.512 -purple_certificate_get_issuer_unique_id(PurpleCertificate *crt);
8.513 -
8.514 -/**
8.515 - * Gets the certificate subject's name
8.516 - *
8.517 - * For X.509, this is the "Common Name" field, as we're only using it
8.518 - * for hostname verification at the moment
8.519 - *
8.520 - * @param crt Certificate instance
8.521 - * @return Newly allocated string with the certificate subject.
8.522 - */
8.523 -gchar *
8.524 -purple_certificate_get_subject_name(PurpleCertificate *crt);
8.525 -
8.526 -/**
8.527 - * Check the subject name against that on the certificate
8.528 - * @param crt Certificate instance
8.529 - * @param name Name to check.
8.530 - * @return TRUE if it is a match, else FALSE
8.531 - */
8.532 -gboolean
8.533 -purple_certificate_check_subject_name(PurpleCertificate *crt, const gchar *name);
8.534 -
8.535 -/**
8.536 - * Get the expiration/activation times.
8.537 - *
8.538 - * @param crt Certificate instance
8.539 - * @param activation Reference to store the activation time at. May be NULL
8.540 - * if you don't actually want it.
8.541 - * @param expiration Reference to store the expiration time at. May be NULL
8.542 - * if you don't actually want it.
8.543 - * @return TRUE if the requested values were obtained, otherwise FALSE.
8.544 - */
8.545 -gboolean
8.546 -purple_certificate_get_times(PurpleCertificate *crt, time_t *activation, time_t *expiration);
8.547 -
8.548 -/*@}*/
8.549 -
8.550 -/*****************************************************************************/
8.551 -/** @name Certificate Pool Functions */
8.552 -/*****************************************************************************/
8.553 -/*@{*/
8.554 -/**
8.555 - * Helper function for generating file paths in ~/.purple/certificates for
8.556 - * CertificatePools that use them.
8.557 - *
8.558 - * All components will be escaped for filesystem friendliness.
8.559 - *
8.560 - * @param pool CertificatePool to build a path for
8.561 - * @param id Key to look up a Certificate by. May be NULL.
8.562 - * @return A newly allocated path of the form
8.563 - * ~/.purple/certificates/scheme_name/pool_name/unique_id
8.564 - */
8.565 -gchar *
8.566 -purple_certificate_pool_mkpath(PurpleCertificatePool *pool, const gchar *id);
8.567 -
8.568 -/**
8.569 - * Determines whether a pool can be used.
8.570 - *
8.571 - * Checks whether the associated CertificateScheme is loaded.
8.572 - *
8.573 - * @param pool Pool to check
8.574 - *
8.575 - * @return TRUE if the pool can be used, otherwise FALSE
8.576 - */
8.577 -gboolean
8.578 -purple_certificate_pool_usable(PurpleCertificatePool *pool);
8.579 -
8.580 -/**
8.581 - * Looks up the scheme the pool operates under
8.582 - *
8.583 - * @param pool Pool to get the scheme of
8.584 - *
8.585 - * @return Pointer to the pool's scheme, or NULL if it isn't loaded.
8.586 - * @see purple_certificate_pool_usable()
8.587 - */
8.588 -PurpleCertificateScheme *
8.589 -purple_certificate_pool_get_scheme(PurpleCertificatePool *pool);
8.590 -
8.591 -/**
8.592 - * Check for presence of an ID in a pool.
8.593 - * @param pool Pool to look in
8.594 - * @param id ID to look for
8.595 - * @return TRUE if the ID is in the pool, else FALSE
8.596 - */
8.597 -gboolean
8.598 -purple_certificate_pool_contains(PurpleCertificatePool *pool, const gchar *id);
8.599 -
8.600 -/**
8.601 - * Retrieve a certificate from a pool.
8.602 - * @param pool Pool to fish in
8.603 - * @param id ID to look up
8.604 - * @return Retrieved certificate, or NULL if it wasn't there
8.605 - */
8.606 -PurpleCertificate *
8.607 -purple_certificate_pool_retrieve(PurpleCertificatePool *pool, const gchar *id);
8.608 -
8.609 -/**
8.610 - * Add a certificate to a pool
8.611 - *
8.612 - * Any pre-existing certificate of the same ID will be overwritten.
8.613 - *
8.614 - * @param pool Pool to add to
8.615 - * @param id ID to store the certificate with
8.616 - * @param crt Certificate to store
8.617 - * @return TRUE if the operation succeeded, otherwise FALSE
8.618 - */
8.619 -gboolean
8.620 -purple_certificate_pool_store(PurpleCertificatePool *pool, const gchar *id, PurpleCertificate *crt);
8.621 -
8.622 -/**
8.623 - * Remove a certificate from a pool
8.624 - *
8.625 - * @param pool Pool to remove from
8.626 - * @param id ID to remove
8.627 - * @return TRUE if the operation succeeded, otherwise FALSE
8.628 - */
8.629 -gboolean
8.630 -purple_certificate_pool_delete(PurpleCertificatePool *pool, const gchar *id);
8.631 -
8.632 -/**
8.633 - * Get the list of IDs currently in the pool.
8.634 - *
8.635 - * @param pool Pool to enumerate
8.636 - * @return GList pointing to newly-allocated id strings. Free using
8.637 - * purple_certificate_pool_destroy_idlist()
8.638 - */
8.639 -GList *
8.640 -purple_certificate_pool_get_idlist(PurpleCertificatePool *pool);
8.641 -
8.642 -/**
8.643 - * Destroys the result given by purple_certificate_pool_get_idlist()
8.644 - *
8.645 - * @param idlist ID List to destroy
8.646 - */
8.647 -void
8.648 -purple_certificate_pool_destroy_idlist(GList *idlist);
8.649 -
8.650 -/*@}*/
8.651 -
8.652 -/*****************************************************************************/
8.653 -/** @name Certificate Subsystem API */
8.654 -/*****************************************************************************/
8.655 -/*@{*/
8.656 -
8.657 -/**
8.658 - * Initialize the certificate system
8.659 - */
8.660 -void
8.661 -purple_certificate_init(void);
8.662 -
8.663 -/**
8.664 - * Un-initialize the certificate system
8.665 - */
8.666 -void
8.667 -purple_certificate_uninit(void);
8.668 -
8.669 -/**
8.670 - * Get the Certificate subsystem handle for signalling purposes
8.671 - */
8.672 -gpointer
8.673 -purple_certificate_get_handle(void);
8.674 -
8.675 -/** Look up a registered CertificateScheme by name
8.676 - * @param name The scheme name. Case insensitive.
8.677 - * @return Pointer to the located Scheme, or NULL if it isn't found.
8.678 - */
8.679 -PurpleCertificateScheme *
8.680 -purple_certificate_find_scheme(const gchar *name);
8.681 -
8.682 -/**
8.683 - * Get all registered CertificateSchemes
8.684 - *
8.685 - * @return GList pointing to all registered CertificateSchemes . This value
8.686 - * is owned by libpurple
8.687 - */
8.688 -GList *
8.689 -purple_certificate_get_schemes(void);
8.690 -
8.691 -/** Register a CertificateScheme with libpurple
8.692 - *
8.693 - * No two schemes can be registered with the same name; this function enforces
8.694 - * that.
8.695 - *
8.696 - * @param scheme Pointer to the scheme to register.
8.697 - * @return TRUE if the scheme was successfully added, otherwise FALSE
8.698 - */
8.699 -gboolean
8.700 -purple_certificate_register_scheme(PurpleCertificateScheme *scheme);
8.701 -
8.702 -/** Unregister a CertificateScheme from libpurple
8.703 - *
8.704 - * @param scheme Scheme to unregister.
8.705 - * If the scheme is not registered, this is a no-op.
8.706 - *
8.707 - * @return TRUE if the unregister completed successfully
8.708 - */
8.709 -gboolean
8.710 -purple_certificate_unregister_scheme(PurpleCertificateScheme *scheme);
8.711 -
8.712 -/** Look up a registered PurpleCertificateVerifier by scheme and name
8.713 - * @param scheme_name Scheme name. Case insensitive.
8.714 - * @param ver_name The verifier name. Case insensitive.
8.715 - * @return Pointer to the located Verifier, or NULL if it isn't found.
8.716 - */
8.717 -PurpleCertificateVerifier *
8.718 -purple_certificate_find_verifier(const gchar *scheme_name, const gchar *ver_name);
8.719 -
8.720 -/**
8.721 - * Get the list of registered CertificateVerifiers
8.722 - *
8.723 - * @return GList of all registered PurpleCertificateVerifier. This value
8.724 - * is owned by libpurple
8.725 - */
8.726 -GList *
8.727 -purple_certificate_get_verifiers(void);
8.728 -
8.729 -/**
8.730 - * Register a CertificateVerifier with libpurple
8.731 - *
8.732 - * @param vr Verifier to register.
8.733 - * @return TRUE if register succeeded, otherwise FALSE
8.734 - */
8.735 -gboolean
8.736 -purple_certificate_register_verifier(PurpleCertificateVerifier *vr);
8.737 -
8.738 -/**
8.739 - * Unregister a CertificateVerifier with libpurple
8.740 - *
8.741 - * @param vr Verifier to unregister.
8.742 - * @return TRUE if unregister succeeded, otherwise FALSE
8.743 - */
8.744 -gboolean
8.745 -purple_certificate_unregister_verifier(PurpleCertificateVerifier *vr);
8.746 -
8.747 -/** Look up a registered PurpleCertificatePool by scheme and name
8.748 - * @param scheme_name Scheme name. Case insensitive.
8.749 - * @param pool_name Pool name. Case insensitive.
8.750 - * @return Pointer to the located Pool, or NULL if it isn't found.
8.751 - */
8.752 -PurpleCertificatePool *
8.753 -purple_certificate_find_pool(const gchar *scheme_name, const gchar *pool_name);
8.754 -
8.755 -/**
8.756 - * Get the list of registered Pools
8.757 - *
8.758 - * @return GList of all registered PurpleCertificatePool s. This value
8.759 - * is owned by libpurple
8.760 - */
8.761 -GList *
8.762 -purple_certificate_get_pools(void);
8.763 -
8.764 -/**
8.765 - * Register a CertificatePool with libpurple and call its init function
8.766 - *
8.767 - * @param pool Pool to register.
8.768 - * @return TRUE if the register succeeded, otherwise FALSE
8.769 - */
8.770 -gboolean
8.771 -purple_certificate_register_pool(PurpleCertificatePool *pool);
8.772 -
8.773 -/**
8.774 - * Unregister a CertificatePool with libpurple and call its uninit function
8.775 - *
8.776 - * @param pool Pool to unregister.
8.777 - * @return TRUE if the unregister succeeded, otherwise FALSE
8.778 - */
8.779 -gboolean
8.780 -purple_certificate_unregister_pool(PurpleCertificatePool *pool);
8.781 -
8.782 -/*@}*/
8.783 -
8.784 -
8.785 -/**
8.786 - * Displays a window showing X.509 certificate information
8.787 - *
8.788 - * @param crt Certificate under an "x509" Scheme
8.789 - * @todo Will break on CA certs, as they have no Common Name
8.790 - */
8.791 -void
8.792 -purple_certificate_display_x509(PurpleCertificate *crt);
8.793 -
8.794 -/**
8.795 - * Add a search path for certificates.
8.796 - *
8.797 - * @param path Path to search for certificates.
8.798 - */
8.799 -void purple_certificate_add_ca_search_path(const char *path);
8.800 -
8.801 -#ifdef __cplusplus
8.802 -}
8.803 -#endif /* __cplusplus */
8.804 -
8.805 -#endif /* _PURPLE_CERTIFICATE_H */
9.1 --- a/Frameworks/libpurple.framework/Versions/0.5.6/Headers/cipher.h Sun Jun 21 22:04:11 2009 -0400
9.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
9.3 @@ -1,505 +0,0 @@
9.4 -/**
9.5 - * @file cipher.h Purple Cipher API
9.6 - * @ingroup core
9.7 - * @see @ref cipher-signals
9.8 - */
9.9 -
9.10 -/* purple
9.11 - *
9.12 - * Purple is the legal property of its developers, whose names are too numerous
9.13 - * to list here. Please refer to the COPYRIGHT file distributed with this
9.14 - * source distribution.
9.15 - *
9.16 - * This program is free software; you can redistribute it and/or modify
9.17 - * it under the terms of the GNU General Public License as published by
9.18 - * the Free Software Foundation; either version 2 of the License, or
9.19 - * (at your option) any later version.
9.20 - *
9.21 - * This program is distributed in the hope that it will be useful,
9.22 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
9.23 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9.24 - * GNU General Public License for more details.
9.25 - *
9.26 - * You should have received a copy of the GNU General Public License
9.27 - * along with this program; if not, write to the Free Software
9.28 - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
9.29 - */
9.30 -#ifndef PURPLE_CIPHER_H
9.31 -#define PURPLE_CIPHER_H
9.32 -
9.33 -#include <glib.h>
9.34 -
9.35 -#define PURPLE_CIPHER(obj) ((PurpleCipher *)(obj)) /**< PurpleCipher typecast helper */
9.36 -#define PURPLE_CIPHER_OPS(obj) ((PurpleCipherOps *)(obj)) /**< PurpleCipherInfo typecase helper */
9.37 -#define PURPLE_CIPHER_CONTEXT(obj) ((PurpleCipherContext *)(obj)) /**< PurpleCipherContext typecast helper */
9.38 -
9.39 -typedef struct _PurpleCipher PurpleCipher; /**< A handle to a PurpleCipher */
9.40 -typedef struct _PurpleCipherOps PurpleCipherOps; /**< Ops for a PurpleCipher */
9.41 -typedef struct _PurpleCipherContext PurpleCipherContext; /**< A context for a PurpleCipher */
9.42 -
9.43 -/**
9.44 - * Modes for batch encrypters
9.45 - */
9.46 -typedef enum _PurpleCipherBatchMode {
9.47 - PURPLE_CIPHER_BATCH_MODE_ECB,
9.48 - PURPLE_CIPHER_BATCH_MODE_CBC
9.49 -} PurpleCipherBatchMode;
9.50 -
9.51 -/**
9.52 - * The operation flags for a cipher
9.53 - */
9.54 -typedef enum _PurpleCipherCaps {
9.55 - PURPLE_CIPHER_CAPS_SET_OPT = 1 << 1, /**< Set option flag */
9.56 - PURPLE_CIPHER_CAPS_GET_OPT = 1 << 2, /**< Get option flag */
9.57 - PURPLE_CIPHER_CAPS_INIT = 1 << 3, /**< Init flag */
9.58 - PURPLE_CIPHER_CAPS_RESET = 1 << 4, /**< Reset flag */
9.59 - PURPLE_CIPHER_CAPS_UNINIT = 1 << 5, /**< Uninit flag */
9.60 - PURPLE_CIPHER_CAPS_SET_IV = 1 << 6, /**< Set IV flag */
9.61 - PURPLE_CIPHER_CAPS_APPEND = 1 << 7, /**< Append flag */
9.62 - PURPLE_CIPHER_CAPS_DIGEST = 1 << 8, /**< Digest flag */
9.63 - PURPLE_CIPHER_CAPS_ENCRYPT = 1 << 9, /**< Encrypt flag */
9.64 - PURPLE_CIPHER_CAPS_DECRYPT = 1 << 10, /**< Decrypt flag */
9.65 - PURPLE_CIPHER_CAPS_SET_SALT = 1 << 11, /**< Set salt flag */
9.66 - PURPLE_CIPHER_CAPS_GET_SALT_SIZE = 1 << 12, /**< Get salt size flag */
9.67 - PURPLE_CIPHER_CAPS_SET_KEY = 1 << 13, /**< Set key flag */
9.68 - PURPLE_CIPHER_CAPS_GET_KEY_SIZE = 1 << 14, /**< Get key size flag */
9.69 - PURPLE_CIPHER_CAPS_SET_BATCH_MODE = 1 << 15, /**< Set batch mode flag */
9.70 - PURPLE_CIPHER_CAPS_GET_BATCH_MODE = 1 << 16, /**< Get batch mode flag */
9.71 - PURPLE_CIPHER_CAPS_GET_BLOCK_SIZE = 1 << 17, /**< The get block size flag */
9.72 - PURPLE_CIPHER_CAPS_SET_KEY_WITH_LEN = 1 << 18, /**< The set key with length flag */
9.73 - PURPLE_CIPHER_CAPS_UNKNOWN = 1 << 19 /**< Unknown */
9.74 -} PurpleCipherCaps;
9.75 -
9.76 -/**
9.77 - * The operations of a cipher. Every cipher must implement one of these.
9.78 - */
9.79 -struct _PurpleCipherOps {
9.80 - /** The set option function */
9.81 - void (*set_option)(PurpleCipherContext *context, const gchar *name, void *value);
9.82 -
9.83 - /** The get option function */
9.84 - void *(*get_option)(PurpleCipherContext *context, const gchar *name);
9.85 -
9.86 - /** The init function */
9.87 - void (*init)(PurpleCipherContext *context, void *extra);
9.88 -
9.89 - /** The reset function */
9.90 - void (*reset)(PurpleCipherContext *context, void *extra);
9.91 -
9.92 - /** The uninit function */
9.93 - void (*uninit)(PurpleCipherContext *context);
9.94 -
9.95 - /** The set initialization vector function */
9.96 - void (*set_iv)(PurpleCipherContext *context, guchar *iv, size_t len);
9.97 -
9.98 - /** The append data function */
9.99 - void (*append)(PurpleCipherContext *context, const guchar *data, size_t len);
9.100 -
9.101 - /** The digest function */
9.102 - gboolean (*digest)(PurpleCipherContext *context, size_t in_len, guchar digest[], size_t *out_len);
9.103 -
9.104 - /** The encrypt function */
9.105 - int (*encrypt)(PurpleCipherContext *context, const guchar data[], size_t len, guchar output[], size_t *outlen);
9.106 -
9.107 - /** The decrypt function */
9.108 - int (*decrypt)(PurpleCipherContext *context, const guchar data[], size_t len, guchar output[], size_t *outlen);
9.109 -
9.110 - /** The set salt function */
9.111 - void (*set_salt)(PurpleCipherContext *context, guchar *salt);
9.112 -
9.113 - /** The get salt size function */
9.114 - size_t (*get_salt_size)(PurpleCipherContext *context);
9.115 -
9.116 - /** The set key function */
9.117 - void (*set_key)(PurpleCipherContext *context, const guchar *key);
9.118 -
9.119 - /** The get key size function */
9.120 - size_t (*get_key_size)(PurpleCipherContext *context);
9.121 -
9.122 - /** The set batch mode function */
9.123 - void (*set_batch_mode)(PurpleCipherContext *context, PurpleCipherBatchMode mode);
9.124 -
9.125 - /** The get batch mode function */
9.126 - PurpleCipherBatchMode (*get_batch_mode)(PurpleCipherContext *context);
9.127 -
9.128 - /** The get block size function */
9.129 - size_t (*get_block_size)(PurpleCipherContext *context);
9.130 -
9.131 - /** The set key with length function */
9.132 - void (*set_key_with_len)(PurpleCipherContext *context, const guchar *key, size_t len);
9.133 -};
9.134 -
9.135 -#ifdef __cplusplus
9.136 -extern "C" {
9.137 -#endif /* __cplusplus */
9.138 -
9.139 -/*****************************************************************************/
9.140 -/** @name PurpleCipher API */
9.141 -/*****************************************************************************/
9.142 -/*@{*/
9.143 -
9.144 -/**
9.145 - * Gets a cipher's name
9.146 - *
9.147 - * @param cipher The cipher handle
9.148 - *
9.149 - * @return The cipher's name
9.150 - */
9.151 -const gchar *purple_cipher_get_name(PurpleCipher *cipher);
9.152 -
9.153 -/**
9.154 - * Gets a cipher's capabilities
9.155 - *
9.156 - * @param cipher The cipher handle
9.157 - *
9.158 - * @return The cipher's info
9.159 - */
9.160 -guint purple_cipher_get_capabilities(PurpleCipher *cipher);
9.161 -
9.162 -/**
9.163 - * Gets a digest from a cipher
9.164 - *
9.165 - * @param name The cipher's name
9.166 - * @param data The data to hash
9.167 - * @param data_len The length of the data
9.168 - * @param in_len The length of the buffer
9.169 - * @param digest The returned digest
9.170 - * @param out_len The length written
9.171 - *
9.172 - * @return @c TRUE if successful, @c FALSE otherwise
9.173 - */
9.174 -gboolean purple_cipher_digest_region(const gchar *name, const guchar *data, size_t data_len, size_t in_len, guchar digest[], size_t *out_len);
9.175 -
9.176 -/*@}*/
9.177 -/******************************************************************************/
9.178 -/** @name PurpleCiphers API */
9.179 -/******************************************************************************/
9.180 -/*@{*/
9.181 -
9.182 -/**
9.183 - * Finds a cipher by it's name
9.184 - *
9.185 - * @param name The name of the cipher to find
9.186 - *
9.187 - * @return The cipher handle or @c NULL
9.188 - */
9.189 -PurpleCipher *purple_ciphers_find_cipher(const gchar *name);
9.190 -
9.191 -/**
9.192 - * Registers a cipher as a usable cipher
9.193 - *
9.194 - * @param name The name of the new cipher
9.195 - * @param ops The cipher ops to register
9.196 - *
9.197 - * @return The handle to the new cipher or @c NULL if it failed
9.198 - */
9.199 -PurpleCipher *purple_ciphers_register_cipher(const gchar *name, PurpleCipherOps *ops);
9.200 -
9.201 -/**
9.202 - * Unregisters a cipher
9.203 - *
9.204 - * @param cipher The cipher handle to unregister
9.205 - *
9.206 - * @return Whether or not the cipher was successfully unloaded
9.207 - */
9.208 -gboolean purple_ciphers_unregister_cipher(PurpleCipher *cipher);
9.209 -
9.210 -/**
9.211 - * Gets the list of ciphers
9.212 - *
9.213 - * @return The list of available ciphers
9.214 - * @note This list should not be modified, it is owned by the cipher core
9.215 - */
9.216 -GList *purple_ciphers_get_ciphers(void);
9.217 -
9.218 -/*@}*/
9.219 -/******************************************************************************/
9.220 -/** @name PurpleCipher Subsystem API */
9.221 -/******************************************************************************/
9.222 -/*@{*/
9.223 -
9.224 -/**
9.225 - * Gets the handle to the cipher subsystem
9.226 - *
9.227 - * @return The handle to the cipher subsystem
9.228 - */
9.229 -gpointer purple_ciphers_get_handle(void);
9.230 -
9.231 -/**
9.232 - * Initializes the cipher core
9.233 - */
9.234 -void purple_ciphers_init(void);
9.235 -
9.236 -/**
9.237 - * Uninitializes the cipher core
9.238 - */
9.239 -void purple_ciphers_uninit(void);
9.240 -
9.241 -/*@}*/
9.242 -/******************************************************************************/
9.243 -/** @name PurpleCipherContext API */
9.244 -/******************************************************************************/
9.245 -/*@{*/
9.246 -
9.247 -/**
9.248 - * Sets the value an option on a cipher context
9.249 - *
9.250 - * @param context The cipher context
9.251 - * @param name The name of the option
9.252 - * @param value The value to set
9.253 - */
9.254 -void purple_cipher_context_set_option(PurpleCipherContext *context, const gchar *name, gpointer value);
9.255 -
9.256 -/**
9.257 - * Gets the vale of an option on a cipher context
9.258 - *
9.259 - * @param context The cipher context
9.260 - * @param name The name of the option
9.261 - * @return The value of the option
9.262 - */
9.263 -gpointer purple_cipher_context_get_option(PurpleCipherContext *context, const gchar *name);
9.264 -
9.265 -/**
9.266 - * Creates a new cipher context and initializes it
9.267 - *
9.268 - * @param cipher The cipher to use
9.269 - * @param extra Extra data for the specific cipher
9.270 - *
9.271 - * @return The new cipher context
9.272 - */
9.273 -PurpleCipherContext *purple_cipher_context_new(PurpleCipher *cipher, void *extra);
9.274 -
9.275 -/**
9.276 - * Creates a new cipher context by the cipher name and initializes it
9.277 - *
9.278 - * @param name The cipher's name
9.279 - * @param extra Extra data for the specific cipher
9.280 - *
9.281 - * @return The new cipher context
9.282 - */
9.283 -PurpleCipherContext *purple_cipher_context_new_by_name(const gchar *name, void *extra);
9.284 -
9.285 -/**
9.286 - * Resets a cipher context to it's default value
9.287 - * @note If you have set an IV you will have to set it after resetting
9.288 - *
9.289 - * @param context The context to reset
9.290 - * @param extra Extra data for the specific cipher
9.291 - */
9.292 -void purple_cipher_context_reset(PurpleCipherContext *context, gpointer extra);
9.293 -
9.294 -/**
9.295 - * Destorys a cipher context and deinitializes it
9.296 - *
9.297 - * @param context The cipher context to destory
9.298 - */
9.299 -void purple_cipher_context_destroy(PurpleCipherContext *context);
9.300 -
9.301 -/**
9.302 - * Sets the initialization vector for a context
9.303 - * @note This should only be called right after a cipher context is created or reset
9.304 - *
9.305 - * @param context The context to set the IV to
9.306 - * @param iv The initialization vector to set
9.307 - * @param len The len of the IV
9.308 - */
9.309 -void purple_cipher_context_set_iv(PurpleCipherContext *context, guchar *iv, size_t len);
9.310 -
9.311 -/**
9.312 - * Appends data to the context
9.313 - *
9.314 - * @param context The context to append data to
9.315 - * @param data The data to append
9.316 - * @param len The length of the data
9.317 - */
9.318 -void purple_cipher_context_append(PurpleCipherContext *context, const guchar *data, size_t len);
9.319 -
9.320 -/**
9.321 - * Digests a context
9.322 - *
9.323 - * @param context The context to digest
9.324 - * @param in_len The length of the buffer
9.325 - * @param digest The return buffer for the digest
9.326 - * @param out_len The length of the returned value
9.327 - */
9.328 -gboolean purple_cipher_context_digest(PurpleCipherContext *context, size_t in_len, guchar digest[], size_t *out_len);
9.329 -
9.330 -/**
9.331 - * Converts a guchar digest into a hex string
9.332 - *
9.333 - * @param context The context to get a digest from
9.334 - * @param in_len The length of the buffer
9.335 - * @param digest_s The return buffer for the string digest
9.336 - * @param out_len The length of the returned value
9.337 - */
9.338 -gboolean purple_cipher_context_digest_to_str(PurpleCipherContext *context, size_t in_len, gchar digest_s[], size_t *out_len);
9.339 -
9.340 -/**
9.341 - * Encrypts data using the context
9.342 - *
9.343 - * @param context The context
9.344 - * @param data The data to encrypt
9.345 - * @param len The length of the data
9.346 - * @param output The output buffer
9.347 - * @param outlen The len of data that was outputed
9.348 - *
9.349 - * @return A cipher specific status code
9.350 - */
9.351 -gint purple_cipher_context_encrypt(PurpleCipherContext *context, const guchar data[], size_t len, guchar output[], size_t *outlen);
9.352 -
9.353 -/**
9.354 - * Decrypts data using the context
9.355 - *
9.356 - * @param context The context
9.357 - * @param data The data to encrypt
9.358 - * @param len The length of the returned value
9.359 - * @param output The output buffer
9.360 - * @param outlen The len of data that was outputed
9.361 - *
9.362 - * @return A cipher specific status code
9.363 - */
9.364 -gint purple_cipher_context_decrypt(PurpleCipherContext *context, const guchar data[], size_t len, guchar output[], size_t *outlen);
9.365 -
9.366 -/**
9.367 - * Sets the salt on a context
9.368 - *
9.369 - * @param context The context whose salt to set
9.370 - * @param salt The salt
9.371 - */
9.372 -void purple_cipher_context_set_salt(PurpleCipherContext *context, guchar *salt);
9.373 -
9.374 -/**
9.375 - * Gets the size of the salt if the cipher supports it
9.376 - *
9.377 - * @param context The context whose salt size to get
9.378 - *
9.379 - * @return The size of the salt
9.380 - */
9.381 -size_t purple_cipher_context_get_salt_size(PurpleCipherContext *context);
9.382 -
9.383 -/**
9.384 - * Sets the key on a context
9.385 - *
9.386 - * @param context The context whose key to set
9.387 - * @param key The key
9.388 - */
9.389 -void purple_cipher_context_set_key(PurpleCipherContext *context, const guchar *key);
9.390 -
9.391 -/**
9.392 - * Gets the key size for a context
9.393 - *
9.394 - * @param context The context whose key size to get
9.395 - *
9.396 - * @return The size of the key
9.397 - */
9.398 -size_t purple_cipher_context_get_key_size(PurpleCipherContext *context);
9.399 -
9.400 -/**
9.401 - * Sets the batch mode of a context
9.402 - *
9.403 - * @param context The context whose batch mode to set
9.404 - * @param mode The batch mode under which the cipher should operate
9.405 - *
9.406 - */
9.407 -void purple_cipher_context_set_batch_mode(PurpleCipherContext *context, PurpleCipherBatchMode mode);
9.408 -
9.409 -/**
9.410 - * Gets the batch mode of a context
9.411 - *
9.412 - * @param context The context whose batch mode to get
9.413 - *
9.414 - * @return The batch mode under which the cipher is operating
9.415 - */
9.416 -PurpleCipherBatchMode purple_cipher_context_get_batch_mode(PurpleCipherContext *context);
9.417 -
9.418 -/**
9.419 - * Gets the block size of a context
9.420 - *
9.421 - * @param context The context whose block size to get
9.422 - *
9.423 - * @return The block size of the context
9.424 - */
9.425 -size_t purple_cipher_context_get_block_size(PurpleCipherContext *context);
9.426 -
9.427 -/**
9.428 - * Sets the key with a given length on a context
9.429 - *
9.430 - * @param context The context whose key to set
9.431 - * @param key The key
9.432 - * @param len The length of the key
9.433 - *
9.434 - */
9.435 -void purple_cipher_context_set_key_with_len(PurpleCipherContext *context, const guchar *key, size_t len);
9.436 -
9.437 -/**
9.438 - * Sets the cipher data for a context
9.439 - *
9.440 - * @param context The context whose cipher data to set
9.441 - * @param data The cipher data to set
9.442 - */
9.443 -void purple_cipher_context_set_data(PurpleCipherContext *context, gpointer data);
9.444 -
9.445 -/**
9.446 - * Gets the cipher data for a context
9.447 - *
9.448 - * @param context The context whose cipher data to get
9.449 - *
9.450 - * @return The cipher data
9.451 - */
9.452 -gpointer purple_cipher_context_get_data(PurpleCipherContext *context);
9.453 -
9.454 -/*@}*/
9.455 -/*****************************************************************************/
9.456 -/** @name Purple Cipher HTTP Digest Helper Functions */
9.457 -/*****************************************************************************/
9.458 -/*@{*/
9.459 -
9.460 -/**
9.461 - * Calculates a session key for HTTP Digest authentation
9.462 - *
9.463 - * See RFC 2617 for more information.
9.464 - *
9.465 - * @param algorithm The hash algorithm to use
9.466 - * @param username The username provided by the user
9.467 - * @param realm The authentication realm provided by the server
9.468 - * @param password The password provided by the user
9.469 - * @param nonce The nonce provided by the server
9.470 - * @param client_nonce The nonce provided by the client
9.471 - *
9.472 - * @return The session key, or @c NULL if an error occurred.
9.473 - */
9.474 -gchar *purple_cipher_http_digest_calculate_session_key(
9.475 - const gchar *algorithm, const gchar *username,
9.476 - const gchar *realm, const gchar *password,
9.477 - const gchar *nonce, const gchar *client_nonce);
9.478 -
9.479 -/** Calculate a response for HTTP Digest authentication
9.480 - *
9.481 - * See RFC 2617 for more information.
9.482 - *
9.483 - * @param algorithm The hash algorithm to use
9.484 - * @param method The HTTP method in use
9.485 - * @param digest_uri The URI from the initial request
9.486 - * @param qop The "quality of protection"
9.487 - * @param entity The entity body
9.488 - * @param nonce The nonce provided by the server
9.489 - * @param nonce_count The nonce count
9.490 - * @param client_nonce The nonce provided by the client
9.491 - * @param session_key The session key from purple_cipher_http_digest_calculate_session_key()
9.492 - *
9.493 - * @return The hashed response, or @c NULL if an error occurred.
9.494 - */
9.495 -gchar *purple_cipher_http_digest_calculate_response(
9.496 - const gchar *algorithm, const gchar *method,
9.497 - const gchar *digest_uri, const gchar *qop,
9.498 - const gchar *entity, const gchar *nonce,
9.499 - const gchar *nonce_count, const gchar *client_nonce,
9.500 - const gchar *session_key);
9.501 -
9.502 -/*@}*/
9.503 -
9.504 -#ifdef __cplusplus
9.505 -}
9.506 -#endif /* __cplusplus */
9.507 -
9.508 -#endif /* PURPLE_CIPHER_H */
10.1 --- a/Frameworks/libpurple.framework/Versions/0.5.6/Headers/circbuffer.h Sun Jun 21 22:04:11 2009 -0400
10.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
10.3 @@ -1,118 +0,0 @@
10.4 -/**
10.5 - * @file circbuffer.h Buffer Utility Functions
10.6 - * @ingroup core
10.7 - */
10.8 -
10.9 -/* Purple is the legal property of its developers, whose names are too numerous
10.10 - * to list here. Please refer to the COPYRIGHT file distributed with this
10.11 - * source distribution.
10.12 - *
10.13 - * This program is free software; you can redistribute it and/or modify
10.14 - * it under the terms of the GNU General Public License as published by
10.15 - * the Free Software Foundation; either version 2 of the License, or
10.16 - * (at your option) any later version.
10.17 - *
10.18 - * This program is distributed in the hope that it will be useful,
10.19 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
10.20 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10.21 - * GNU General Public License for more details.
10.22 - *
10.23 - * You should have received a copy of the GNU General Public License
10.24 - * along with this program; if not, write to the Free Software
10.25 - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
10.26 - */
10.27 -#ifndef _CIRCBUFFER_H
10.28 -#define _CIRCBUFFER_H
10.29 -
10.30 -#include <glib.h>
10.31 -
10.32 -#ifdef __cplusplus
10.33 -extern "C" {
10.34 -#endif
10.35 -
10.36 -typedef struct _PurpleCircBuffer {
10.37 -
10.38 - /** A pointer to the starting address of our chunk of memory. */
10.39 - gchar *buffer;
10.40 -
10.41 - /** The incremental amount to increase this buffer by when
10.42 - * the buffer is not big enough to hold incoming data, in bytes. */
10.43 - gsize growsize;
10.44 -
10.45 - /** The length of this buffer, in bytes. */
10.46 - gsize buflen;
10.47 -
10.48 - /** The number of bytes of this buffer that contain unread data. */
10.49 - gsize bufused;
10.50 -
10.51 - /** A pointer to the next byte where new incoming data is
10.52 - * buffered to. */
10.53 - gchar *inptr;
10.54 -
10.55 - /** A pointer to the next byte of buffered data that should be
10.56 - * read by the consumer. */
10.57 - gchar *outptr;
10.58 -
10.59 -} PurpleCircBuffer;
10.60 -
10.61 -/**
10.62 - * Creates a new circular buffer. This will not allocate any memory for the
10.63 - * actual buffer until data is appended to it.
10.64 - *
10.65 - * @param growsize The amount that the buffer should grow the first time data
10.66 - * is appended and every time more space is needed. Pass in
10.67 - * "0" to use the default of 256 bytes.
10.68 - *
10.69 - * @return The new PurpleCircBuffer. This should be freed with
10.70 - * purple_circ_buffer_destroy when you are done with it
10.71 - */
10.72 -PurpleCircBuffer *purple_circ_buffer_new(gsize growsize);
10.73 -
10.74 -/**
10.75 - * Dispose of the PurpleCircBuffer and free any memory used by it (including any
10.76 - * memory used by the internal buffer).
10.77 - *
10.78 - * @param buf The PurpleCircBuffer to free
10.79 - */
10.80 -void purple_circ_buffer_destroy(PurpleCircBuffer *buf);
10.81 -
10.82 -/**
10.83 - * Append data to the PurpleCircBuffer. This will grow the internal
10.84 - * buffer to fit the added data, if needed.
10.85 - *
10.86 - * @param buf The PurpleCircBuffer to which to append the data
10.87 - * @param src pointer to the data to copy into the buffer
10.88 - * @param len number of bytes to copy into the buffer
10.89 - */
10.90 -void purple_circ_buffer_append(PurpleCircBuffer *buf, gconstpointer src, gsize len);
10.91 -
10.92 -/**
10.93 - * Determine the maximum number of contiguous bytes that can be read from the
10.94 - * PurpleCircBuffer.
10.95 - * Note: This may not be the total number of bytes that are buffered - a
10.96 - * subsequent call after calling purple_circ_buffer_mark_read() may indicate more
10.97 - * data is available to read.
10.98 - *
10.99 - * @param buf the PurpleCircBuffer for which to determine the maximum contiguous
10.100 - * bytes that can be read.
10.101 - *
10.102 - * @return the number of bytes that can be read from the PurpleCircBuffer
10.103 - */
10.104 -gsize purple_circ_buffer_get_max_read(const PurpleCircBuffer *buf);
10.105 -
10.106 -/**
10.107 - * Mark the number of bytes that have been read from the buffer.
10.108 - *
10.109 - * @param buf The PurpleCircBuffer to mark bytes read from
10.110 - * @param len The number of bytes to mark as read
10.111 - *
10.112 - * @return TRUE if we successfully marked the bytes as having been read, FALSE
10.113 - * otherwise.
10.114 - */
10.115 -gboolean purple_circ_buffer_mark_read(PurpleCircBuffer *buf, gsize len);
10.116 -
10.117 -#ifdef __cplusplus
10.118 -}
10.119 -#endif
10.120 -
10.121 -#endif /* _CIRCBUFFER_H */
11.1 --- a/Frameworks/libpurple.framework/Versions/0.5.6/Headers/cmdproc.h Sun Jun 21 22:04:11 2009 -0400
11.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
11.3 @@ -1,76 +0,0 @@
11.4 -/**
11.5 - * @file cmdproc.h MSN command processor functions
11.6 - *
11.7 - * purple
11.8 - *
11.9 - * Purple is the legal property of its developers, whose names are too numerous
11.10 - * to list here. Please refer to the COPYRIGHT file distributed with this
11.11 - * source distribution.
11.12 - *
11.13 - * This program is free software; you can redistribute it and/or modify
11.14 - * it under the terms of the GNU General Public License as published by
11.15 - * the Free Software Foundation; either version 2 of the License, or
11.16 - * (at your option) any later version.
11.17 - *
11.18 - * This program is distributed in the hope that it will be useful,
11.19 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
11.20 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11.21 - * GNU General Public License for more details.
11.22 - *
11.23 - * You should have received a copy of the GNU General Public License
11.24 - * along with this program; if not, write to the Free Software
11.25 - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
11.26 - */
11.27 -#ifndef _MSN_CMDPROC_H_
11.28 -#define _MSN_CMDPROC_H_
11.29 -
11.30 -typedef struct _MsnCmdProc MsnCmdProc;
11.31 -
11.32 -#include "session.h"
11.33 -#include "servconn.h"
11.34 -#include "error.h"
11.35 -#include "command.h"
11.36 -#include "table.h"
11.37 -#include "history.h"
11.38 -
11.39 -struct _MsnCmdProc
11.40 -{
11.41 - MsnSession *session;
11.42 - MsnServConn *servconn;
11.43 -
11.44 - GQueue *txqueue;
11.45 -
11.46 - MsnCommand *last_cmd;
11.47 -
11.48 - MsnTable *cbs_table;
11.49 -
11.50 - MsnHistory *history;
11.51 -
11.52 - GHashTable *multiparts; /**< Multi-part message ID's */
11.53 -
11.54 - void *data; /**< Extra data, like the switchboard. */
11.55 -};
11.56 -
11.57 -MsnCmdProc *msn_cmdproc_new(MsnSession *session);
11.58 -void msn_cmdproc_destroy(MsnCmdProc *cmdproc);
11.59 -
11.60 -void msn_cmdproc_process_queue(MsnCmdProc *cmdproc);
11.61 -
11.62 -void msn_cmdproc_send_trans(MsnCmdProc *cmdproc, MsnTransaction *trans);
11.63 -void msn_cmdproc_queue_trans(MsnCmdProc *cmdproc,
11.64 - MsnTransaction *trans);
11.65 -void msn_cmdproc_send(MsnCmdProc *cmdproc, const char *command,
11.66 - const char *format, ...);
11.67 -void msn_cmdproc_send_quick(MsnCmdProc *cmdproc, const char *command,
11.68 - const char *format, ...);
11.69 -
11.70 -void msn_cmdproc_process_msg(MsnCmdProc *cmdproc,
11.71 - MsnMessage *msg);
11.72 -void msn_cmdproc_process_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd);
11.73 -void msn_cmdproc_process_cmd_text(MsnCmdProc *cmdproc, const char *command);
11.74 -void msn_cmdproc_process_payload(MsnCmdProc *cmdproc,
11.75 - char *payload, int payload_len);
11.76 -
11.77 -void msn_cmdproc_disconnect(MsnCmdProc *cmdproc);
11.78 -
11.79 -#endif /* _MSN_CMDPROC_H_ */
12.1 --- a/Frameworks/libpurple.framework/Versions/0.5.6/Headers/cmds.h Sun Jun 21 22:04:11 2009 -0400
12.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
12.3 @@ -1,250 +0,0 @@
12.4 -/**
12.5 - * @file cmds.h Commands API
12.6 - * @ingroup core
12.7 - * @see @ref cmd-signals
12.8 - */
12.9 -
12.10 -/* Copyright (C) 2003 Timothy Ringenbach <omarvo@hotmail.com>
12.11 - *
12.12 - * This program is free software; you can redistribute it and/or modify
12.13 - * it under the terms of the GNU General Public License as published by
12.14 - * the Free Software Foundation; either version 2 of the License, or
12.15 - * (at your option) any later version.
12.16 - *
12.17 - * This program is distributed in the hope that it will be useful,
12.18 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
12.19 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12.20 - * GNU General Public License for more details.
12.21 - *
12.22 - * You should have received a copy of the GNU General Public License
12.23 - * along with this program; if not, write to the Free Software
12.24 - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
12.25 - *
12.26 - */
12.27 -#ifndef _PURPLE_CMDS_H_
12.28 -#define _PURPLE_CMDS_H_
12.29 -
12.30 -#include "conversation.h"
12.31 -
12.32 -/**************************************************************************/
12.33 -/** @name Structures */
12.34 -/**************************************************************************/
12.35 -/*@{*/
12.36 -
12.37 -/** The possible results of running a command with purple_cmd_do_command(). */
12.38 -typedef enum _PurpleCmdStatus {
12.39 - PURPLE_CMD_STATUS_OK,
12.40 - PURPLE_CMD_STATUS_FAILED,
12.41 - PURPLE_CMD_STATUS_NOT_FOUND,
12.42 - PURPLE_CMD_STATUS_WRONG_ARGS,
12.43 - PURPLE_CMD_STATUS_WRONG_PRPL,
12.44 - PURPLE_CMD_STATUS_WRONG_TYPE
12.45 -} PurpleCmdStatus;
12.46 -
12.47 -/** Commands registered with the core return one of these values when run.
12.48 - * Normally, a command will want to return one of the first two; in some
12.49 - * unusual cases, you might want to have several functions called for a
12.50 - * particular command; in this case, they should return
12.51 - * #PURPLE_CMD_RET_CONTINUE to cause the core to fall through to other
12.52 - * commands with the same name.
12.53 - */
12.54 -typedef enum _PurpleCmdRet {
12.55 - PURPLE_CMD_RET_OK, /**< Everything's okay; Don't look for another command to call. */
12.56 - PURPLE_CMD_RET_FAILED, /**< The command failed, but stop looking.*/
12.57 - PURPLE_CMD_RET_CONTINUE /**< Continue, looking for other commands with the same name to call. */
12.58 -} PurpleCmdRet;
12.59 -
12.60 -#define PURPLE_CMD_FUNC(func) ((PurpleCmdFunc)func)
12.61 -
12.62 -/** A function implementing a command, as passed to purple_cmd_register().
12.63 - *
12.64 - * @todo document the arguments to these functions.
12.65 - * */
12.66 -typedef PurpleCmdRet (*PurpleCmdFunc)(PurpleConversation *, const gchar *cmd,
12.67 - gchar **args, gchar **error, void *data);
12.68 -/** A unique integer representing a command registered with
12.69 - * purple_cmd_register(), which can subsequently be passed to
12.70 - * purple_cmd_unregister() to unregister that command.
12.71 - */
12.72 -typedef guint PurpleCmdId;
12.73 -
12.74 -typedef enum _PurpleCmdPriority {
12.75 - PURPLE_CMD_P_VERY_LOW = -1000,
12.76 - PURPLE_CMD_P_LOW = 0,
12.77 - PURPLE_CMD_P_DEFAULT = 1000,
12.78 - PURPLE_CMD_P_PRPL = 2000,
12.79 - PURPLE_CMD_P_PLUGIN = 3000,
12.80 - PURPLE_CMD_P_ALIAS = 4000,
12.81 - PURPLE_CMD_P_HIGH = 5000,
12.82 - PURPLE_CMD_P_VERY_HIGH = 6000
12.83 -} PurpleCmdPriority;
12.84 -
12.85 -/** Flags used to set various properties of commands. Every command should
12.86 - * have at least one of #PURPLE_CMD_FLAG_IM and #PURPLE_CMD_FLAG_CHAT set in
12.87 - * order to be even slighly useful.
12.88 - *
12.89 - * @see purple_cmd_register
12.90 - */
12.91 -typedef enum _PurpleCmdFlag {
12.92 - /** Command is usable in IMs. */
12.93 - PURPLE_CMD_FLAG_IM = 0x01,
12.94 - /** Command is usable in multi-user chats. */
12.95 - PURPLE_CMD_FLAG_CHAT = 0x02,
12.96 - /** Command is usable only for a particular prpl. */
12.97 - PURPLE_CMD_FLAG_PRPL_ONLY = 0x04,
12.98 - /** Incorrect arguments to this command should be accepted anyway. */
12.99 - PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS = 0x08
12.100 -} PurpleCmdFlag;
12.101 -
12.102 -
12.103 -/*@}*/
12.104 -
12.105 -#ifdef __cplusplus
12.106 -extern "C" {
12.107 -#endif
12.108 -
12.109 -/**************************************************************************/
12.110 -/** @name Commands API */
12.111 -/**************************************************************************/
12.112 -/*@{*/
12.113 -
12.114 -/**
12.115 - * Register a new command with the core.
12.116 - *
12.117 - * The command will only happen if commands are enabled,
12.118 - * which is a UI pref. UIs don't have to support commands at all.
12.119 - *
12.120 - * @param cmd The command. This should be a UTF-8 (or ASCII) string, with no spaces
12.121 - * or other white space.
12.122 - * @param args A string of characters describing to libpurple how to parse this
12.123 - * command's arguments. If what the user types doesn't match this
12.124 - * pattern, libpurple will keep looking for another command, unless
12.125 - * the flag #PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS is passed in @a f.
12.126 - * This string should contain no whitespace, and use a single
12.127 - * character for each argument. The recognized characters are:
12.128 - * <ul>
12.129 - * <li><tt>'w'</tt>: Matches a single word.</li>
12.130 - * <li><tt>'W'</tt>: Matches a single word, with formatting.</li>
12.131 - * <li><tt>'s'</tt>: Matches the rest of the arguments after this
12.132 - * point, as a single string.</li>
12.133 - * <li><tt>'S'</tt>: Same as <tt>'s'</tt> but with formatting.</li>
12.134 - * </ul>
12.135 - * If args is the empty string, then the command accepts no arguments.
12.136 - * The args passed to the callback @a func will be a @c NULL
12.137 - * terminated array of @c NULL terminated strings, and will always
12.138 - * match the number of arguments asked for, unless
12.139 - * #PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS is passed.
12.140 - * @param p This is the priority. Higher priority commands will be run first,
12.141 - * and usually the first command will stop any others from being
12.142 - * called.
12.143 - * @param f Flags specifying various options about this command, combined with
12.144 - * <tt>|</tt> (bitwise OR). You need to at least pass one of
12.145 - * #PURPLE_CMD_FLAG_IM or #PURPLE_CMD_FLAG_CHAT (you may pass both) in
12.146 - * order for the command to ever actually be called.
12.147 - * @param prpl_id If the #PURPLE_CMD_FLAG_PRPL_ONLY flag is set, this is the id
12.148 - * of the prpl to which the command applies (such as
12.149 - * <tt>"prpl-msn"</tt>). If the flag is not set, this parameter
12.150 - * is ignored; pass @c NULL (or a humourous string of your
12.151 - * choice!).
12.152 - * @param func This is the function to call when someone enters this command.
12.153 - * @param helpstr a whitespace sensitive, UTF-8, HTML string describing how to
12.154 - * use the command. The preferred format of this string is the
12.155 - * command's name, followed by a space and any arguments it
12.156 - * accepts (if it takes any arguments, otherwise no space),
12.157 - * followed by a colon, two spaces, and a description of the
12.158 - * command in sentence form. Do not include a slash before the
12.159 - * command name.
12.160 - * @param data User defined data to pass to the #PurpleCmdFunc @a f.
12.161 - * @return A #PurpleCmdId, which is only used for calling
12.162 - * #purple_cmd_unregister, or @a 0 on failure.
12.163 - */
12.164 -PurpleCmdId purple_cmd_register(const gchar *cmd, const gchar *args, PurpleCmdPriority p, PurpleCmdFlag f,
12.165 - const gchar *prpl_id, PurpleCmdFunc func, const gchar *helpstr, void *data);
12.166 -
12.167 -/**
12.168 - * Unregister a command with the core.
12.169 - *
12.170 - * All registered commands must be unregistered, if they're registered by a plugin
12.171 - * or something else that might go away. Normally this is called when the plugin
12.172 - * unloads itself.
12.173 - *
12.174 - * @param id The #PurpleCmdId to unregister, as returned by #purple_cmd_register.
12.175 - */
12.176 -void purple_cmd_unregister(PurpleCmdId id);
12.177 -
12.178 -/**
12.179 - * Do a command.
12.180 - *
12.181 - * Normally the UI calls this to perform a command. This might also be useful
12.182 - * if aliases are ever implemented.
12.183 - *
12.184 - * @param conv The conversation the command was typed in.
12.185 - * @param cmdline The command the user typed (including all arguments) as a single string.
12.186 - * The caller doesn't have to do any parsing, except removing the command
12.187 - * prefix, which the core has no knowledge of. cmd should not contain any
12.188 - * formatting, and should be in plain text (no html entities).
12.189 - * @param markup This is the same as cmd, but is the formatted version. It should be in
12.190 - * HTML, with < > and &, at least, escaped to html entities, and should
12.191 - * include both the default formatting and any extra manual formatting.
12.192 - * @param errormsg If the command failed errormsg is filled in with the appropriate error
12.193 - * message. It must be freed by the caller with g_free().
12.194 - * @return A #PurpleCmdStatus indicating if the command succeeded or failed.
12.195 - */
12.196 -PurpleCmdStatus purple_cmd_do_command(PurpleConversation *conv, const gchar *cmdline,
12.197 - const gchar *markup, gchar **errormsg);
12.198 -
12.199 -/**
12.200 - * List registered commands.
12.201 - *
12.202 - * Returns a <tt>GList</tt> (which must be freed by the caller) of all commands
12.203 - * that are valid in the context of @a conv, or all commands, if @a conv is @c
12.204 - * NULL. Don't keep this list around past the main loop, or anything else that
12.205 - * might unregister a command, as the <tt>const char *</tt>'s used get freed
12.206 - * then.
12.207 - *
12.208 - * @param conv The conversation, or @c NULL.
12.209 - * @return A @c GList of <tt>const char *</tt>, which must be freed with
12.210 - * <tt>g_list_free()</tt>.
12.211 - */
12.212 -GList *purple_cmd_list(PurpleConversation *conv);
12.213 -
12.214 -/**
12.215 - * Get the help string for a command.
12.216 - *
12.217 - * Returns the help strings for a given command in the form of a GList,
12.218 - * one node for each matching command.
12.219 - *
12.220 - * @param conv The conversation, or @c NULL for no context.
12.221 - * @param cmd The command. No wildcards accepted, but returns help for all
12.222 - * commands if @c NULL.
12.223 - * @return A <tt>GList</tt> of <tt>const char *</tt>s, which is the help string
12.224 - * for that command.
12.225 - */
12.226 -GList *purple_cmd_help(PurpleConversation *conv, const gchar *cmd);
12.227 -
12.228 -/**
12.229 - * Get the handle for the commands API
12.230 - * @return The handle
12.231 - * @since 2.5.0
12.232 - */
12.233 -gpointer purple_cmds_get_handle(void);
12.234 -
12.235 -/**
12.236 - * Initialize the commands subsystem.
12.237 - * @since 2.5.0
12.238 - */
12.239 -void purple_cmds_init(void);
12.240 -
12.241 -/**
12.242 - * Uninitialize the commands subsystem.
12.243 - * @since 2.5.0
12.244 - */
12.245 -void purple_cmds_uninit(void);
12.246 -
12.247 -/*@}*/
12.248 -
12.249 -#ifdef __cplusplus
12.250 -}
12.251 -#endif
12.252 -
12.253 -#endif /* _PURPLE_CMDS_H_ */
13.1 --- a/Frameworks/libpurple.framework/Versions/0.5.6/Headers/command.h Sun Jun 21 22:04:11 2009 -0400
13.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
13.3 @@ -1,62 +0,0 @@
13.4 -/**
13.5 - * @file command.h MSN command functions
13.6 - *
13.7 - * purple
13.8 - *
13.9 - * Purple is the legal property of its developers, whose names are too numerous
13.10 - * to list here. Please refer to the COPYRIGHT file distributed with this
13.11 - * source distribution.
13.12 - *
13.13 - * This program is free software; you can redistribute it and/or modify
13.14 - * it under the terms of the GNU General Public License as published by
13.15 - * the Free Software Foundation; either version 2 of the License, or
13.16 - * (at your option) any later version.
13.17 - *
13.18 - * This program is distributed in the hope that it will be useful,
13.19 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
13.20 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13.21 - * GNU General Public License for more details.
13.22 - *
13.23 - * You should have received a copy of the GNU General Public License
13.24 - * along with this program; if not, write to the Free Software
13.25 - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
13.26 - */
13.27 -#ifndef _MSN_COMMAND_H
13.28 -#define _MSN_COMMAND_H
13.29 -
13.30 -typedef struct _MsnCommand MsnCommand;
13.31 -
13.32 -#include "cmdproc.h"
13.33 -#include "transaction.h"
13.34 -
13.35 -typedef void (*MsnPayloadCb)(MsnCmdProc *cmdproc, MsnCommand *cmd,
13.36 - char *payload, size_t len);
13.37 -
13.38 -/**
13.39 - * A received command.
13.40 - */
13.41 -struct _MsnCommand
13.42 -{
13.43 - unsigned int trId;
13.44 -
13.45 - char *command;
13.46 - char **params;
13.47 - int param_count;
13.48 -
13.49 - int ref_count;
13.50 -
13.51 - MsnTransaction *trans;
13.52 -
13.53 - char *payload;
13.54 - size_t payload_len;
13.55 -
13.56 - MsnPayloadCb payload_cb;
13.57 - void *payload_cbdata;
13.58 -};
13.59 -
13.60 -MsnCommand *msn_command_from_string(const char *string);
13.61 -void msn_command_destroy(MsnCommand *cmd);
13.62 -MsnCommand *msn_command_ref(MsnCommand *cmd);
13.63 -MsnCommand *msn_command_unref(MsnCommand *cmd);
13.64 -
13.65 -#endif /* _MSN_COMMAND_H */
14.1 --- a/Frameworks/libpurple.framework/Versions/0.5.6/Headers/connection.h Sun Jun 21 22:04:11 2009 -0400
14.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
14.3 @@ -1,582 +0,0 @@
14.4 -/**
14.5 - * @file connection.h Connection API
14.6 - * @ingroup core
14.7 - * @see @ref connection-signals
14.8 - */
14.9 -
14.10 -/* purple
14.11 - *
14.12 - * Purple is the legal property of its developers, whose names are too numerous
14.13 - * to list here. Please refer to the COPYRIGHT file distributed with this
14.14 - * source distribution.
14.15 - *
14.16 - * This program is free software; you can redistribute it and/or modify
14.17 - * it under the terms of the GNU General Public License as published by
14.18 - * the Free Software Foundation; either version 2 of the License, or
14.19 - * (at your option) any later version.
14.20 - *
14.21 - * This program is distributed in the hope that it will be useful,
14.22 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
14.23 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14.24 - * GNU General Public License for more details.
14.25 - *
14.26 - * You should have received a copy of the GNU General Public License
14.27 - * along with this program; if not, write to the Free Software
14.28 - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
14.29 - */
14.30 -#ifndef _PURPLE_CONNECTION_H_
14.31 -#define _PURPLE_CONNECTION_H_
14.32 -
14.33 -/** @copydoc _PurpleConnection */
14.34 -typedef struct _PurpleConnection PurpleConnection;
14.35 -
14.36 -/**
14.37 - * Flags to change behavior of the client for a given connection.
14.38 - */
14.39 -typedef enum
14.40 -{
14.41 - PURPLE_CONNECTION_HTML = 0x0001, /**< Connection sends/receives in 'HTML'. */
14.42 - PURPLE_CONNECTION_NO_BGCOLOR = 0x0002, /**< Connection does not send/receive
14.43 - background colors. */
14.44 - PURPLE_CONNECTION_AUTO_RESP = 0x0004, /**< Send auto responses when away. */
14.45 - PURPLE_CONNECTION_FORMATTING_WBFO = 0x0008, /**< The text buffer must be formatted as a whole */
14.46 - PURPLE_CONNECTION_NO_NEWLINES = 0x0010, /**< No new lines are allowed in outgoing messages */
14.47 - PURPLE_CONNECTION_NO_FONTSIZE = 0x0020, /**< Connection does not send/receive font sizes */
14.48 - PURPLE_CONNECTION_NO_URLDESC = 0x0040, /**< Connection does not support descriptions with links */
14.49 - PURPLE_CONNECTION_NO_IMAGES = 0x0080, /**< Connection does not support sending of images */
14.50 - PURPLE_CONNECTION_ALLOW_CUSTOM_SMILEY = 0x0100 /**< Connection supports sending and receiving custom smileys */
14.51 -
14.52 -} PurpleConnectionFlags;
14.53 -
14.54 -typedef enum
14.55 -{
14.56 - PURPLE_DISCONNECTED = 0, /**< Disconnected. */
14.57 - PURPLE_CONNECTED, /**< Connected. */
14.58 - PURPLE_CONNECTING /**< Connecting. */
14.59 -
14.60 -} PurpleConnectionState;
14.61 -
14.62 -/** Possible errors that can cause a connection to be closed.
14.63 - * @since 2.3.0
14.64 - */
14.65 -typedef enum
14.66 -{
14.67 - /** There was an error sending or receiving on the network socket, or
14.68 - * there was some protocol error (such as the server sending malformed
14.69 - * data).
14.70 - */
14.71 - PURPLE_CONNECTION_ERROR_NETWORK_ERROR = 0,
14.72 - /** The username supplied was not valid. */
14.73 - PURPLE_CONNECTION_ERROR_INVALID_USERNAME = 1,
14.74 - /** The username, password or some other credential was incorrect. Use
14.75 - * #PURPLE_CONNECTION_ERROR_INVALID_USERNAME instead if the username
14.76 - * is known to be invalid.
14.77 - */
14.78 - PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED = 2,
14.79 - /** libpurple doesn't speak any of the authentication methods the
14.80 - * server offered.
14.81 - */
14.82 - PURPLE_CONNECTION_ERROR_AUTHENTICATION_IMPOSSIBLE = 3,
14.83 - /** libpurple was built without SSL support, and the connection needs
14.84 - * SSL.
14.85 - */
14.86 - PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT = 4,
14.87 - /** There was an error negotiating SSL on this connection, or the
14.88 - * server does not support encryption but an account option was set to
14.89 - * require it.
14.90 - */
14.91 - PURPLE_CONNECTION_ERROR_ENCRYPTION_ERROR = 5,
14.92 - /** Someone is already connected to the server using the name you are
14.93 - * trying to connect with.
14.94 - */
14.95 - PURPLE_CONNECTION_ERROR_NAME_IN_USE = 6,
14.96 -
14.97 - /** The username/server/other preference for the account isn't valid.
14.98 - * For instance, on IRC the screen name cannot contain white space.
14.99 - * This reason should not be used for incorrect passwords etc: use
14.100 - * #PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED for that.
14.101 - *
14.102 - * @todo This reason really shouldn't be necessary. Usernames and
14.103 - * other account preferences should be validated when the
14.104 - * account is created.
14.105 - */
14.106 - PURPLE_CONNECTION_ERROR_INVALID_SETTINGS = 7,
14.107 -
14.108 - /** The server did not provide a SSL certificate. */
14.109 - PURPLE_CONNECTION_ERROR_CERT_NOT_PROVIDED = 8,
14.110 - /** The server's SSL certificate could not be trusted. */
14.111 - PURPLE_CONNECTION_ERROR_CERT_UNTRUSTED = 9,
14.112 - /** The server's SSL certificate has expired. */
14.113 - PURPLE_CONNECTION_ERROR_CERT_EXPIRED = 10,
14.114 - /** The server's SSL certificate is not yet valid. */
14.115 - PURPLE_CONNECTION_ERROR_CERT_NOT_ACTIVATED = 11,
14.116 - /** The server's SSL certificate did not match its hostname. */
14.117 - PURPLE_CONNECTION_ERROR_CERT_HOSTNAME_MISMATCH = 12,
14.118 - /** The server's SSL certificate does not have the expected
14.119 - * fingerprint.
14.120 - */
14.121 - PURPLE_CONNECTION_ERROR_CERT_FINGERPRINT_MISMATCH = 13,
14.122 - /** The server's SSL certificate is self-signed. */
14.123 - PURPLE_CONNECTION_ERROR_CERT_SELF_SIGNED = 14,
14.124 - /** There was some other error validating the server's SSL certificate.
14.125 - */
14.126 - PURPLE_CONNECTION_ERROR_CERT_OTHER_ERROR = 15,
14.127 -
14.128 - /** Some other error occurred which fits into none of the other
14.129 - * categories.
14.130 - */
14.131 - /* purple_connection_error_reason() in connection.c uses the fact that
14.132 - * this is the last member of the enum when sanity-checking; if other
14.133 - * reasons are added after it, the check must be updated.
14.134 - */
14.135 - PURPLE_CONNECTION_ERROR_OTHER_ERROR = 16
14.136 -} PurpleConnectionError;
14.137 -
14.138 -/** Holds the type of an error along with its description. */
14.139 -typedef struct
14.140 -{
14.141 - /** The type of error. */
14.142 - PurpleConnectionError type;
14.143 - /** A localised, human-readable description of the error. */
14.144 - char *description;
14.145 -} PurpleConnectionErrorInfo;
14.146 -
14.147 -#include <time.h>
14.148 -
14.149 -#include "account.h"
14.150 -#include "plugin.h"
14.151 -#include "status.h"
14.152 -#include "sslconn.h"
14.153 -
14.154 -/** Connection UI operations. Used to notify the user of changes to
14.155 - * connections, such as being disconnected, and to respond to the
14.156 - * underlying network connection appearing and disappearing. UIs should
14.157 - * call #purple_connections_set_ui_ops() with an instance of this struct.
14.158 - *
14.159 - * @see @ref ui-ops
14.160 - */
14.161 -typedef struct
14.162 -{
14.163 - /** When an account is connecting, this operation is called to notify
14.164 - * the UI of what is happening, as well as which @a step out of @a
14.165 - * step_count has been reached (which might be displayed as a progress
14.166 - * bar).
14.167 - * @see #purple_connection_update_progress
14.168 - */
14.169 - void (*connect_progress)(PurpleConnection *gc,
14.170 - const char *text,
14.171 - size_t step,
14.172 - size_t step_count);
14.173 -
14.174 - /** Called when a connection is established (just before the
14.175 - * @ref signed-on signal).
14.176 - */
14.177 - void (*connected)(PurpleConnection *gc);
14.178 - /** Called when a connection is ended (between the @ref signing-off
14.179 - * and @ref signed-off signals).
14.180 - */
14.181 - void (*disconnected)(PurpleConnection *gc);
14.182 -
14.183 - /** Used to display connection-specific notices. (Pidgin's Gtk user
14.184 - * interface implements this as a no-op; #purple_connection_notice(),
14.185 - * which uses this operation, is not used by any of the protocols
14.186 - * shipped with libpurple.)
14.187 - */
14.188 - void (*notice)(PurpleConnection *gc, const char *text);
14.189 -
14.190 - /** Called when an error causes a connection to be disconnected.
14.191 - * Called before #disconnected.
14.192 - * @param text a localized error message.
14.193 - * @see #purple_connection_error
14.194 - * @deprecated in favour of
14.195 - * #PurpleConnectionUiOps.report_disconnect_reason.
14.196 - */
14.197 - void (*report_disconnect)(PurpleConnection *gc, const char *text);
14.198 -
14.199 - /** Called when libpurple discovers that the computer's network
14.200 - * connection is active. On Linux, this uses Network Manager if
14.201 - * available; on Windows, it uses Win32's network change notification
14.202 - * infrastructure.
14.203 - */
14.204 - void (*network_connected)(void);
14.205 - /** Called when libpurple discovers that the computer's network
14.206 - * connection has gone away.
14.207 - */
14.208 - void (*network_disconnected)(void);
14.209 -
14.210 - /** Called when an error causes a connection to be disconnected.
14.211 - * Called before #disconnected. This op is intended to replace
14.212 - * #report_disconnect. If both are implemented, this will be called
14.213 - * first; however, there's no real reason to implement both.
14.214 - * @param reason why the connection ended, if known, or
14.215 - * #PURPLE_CONNECTION_ERROR_OTHER_ERROR, if not.
14.216 - * @param text a localized message describing the disconnection
14.217 - * in more detail to the user.
14.218 - * @see #purple_connection_error_reason
14.219 - * @since 2.3.0
14.220 - */
14.221 - void (*report_disconnect_reason)(PurpleConnection *gc,
14.222 - PurpleConnectionError reason,
14.223 - const char *text);
14.224 -
14.225 - void (*_purple_reserved1)(void);
14.226 - void (*_purple_reserved2)(void);
14.227 - void (*_purple_reserved3)(void);
14.228 -} PurpleConnectionUiOps;
14.229 -
14.230 -
14.231 -/* Represents an active connection on an account. */
14.232 -struct _PurpleConnection
14.233 -{
14.234 - PurplePlugin *prpl; /**< The protocol plugin. */
14.235 - PurpleConnectionFlags flags; /**< Connection flags. */
14.236 -
14.237 - PurpleConnectionState state; /**< The connection state. */
14.238 -
14.239 - PurpleAccount *account; /**< The account being connected to. */
14.240 - char *password; /**< The password used. */
14.241 - int inpa; /**< The input watcher. */
14.242 -
14.243 - GSList *buddy_chats; /**< A list of active chats
14.244 - (#PurpleConversation structs of type
14.245 - #PURPLE_CONV_TYPE_CHAT). */
14.246 - void *proto_data; /**< Protocol-specific data. */
14.247 -
14.248 - char *display_name; /**< How you appear to other people. */
14.249 - guint keepalive; /**< Keep-alive. */
14.250 -
14.251 - /** Wants to Die state. This is set when the user chooses to log out, or
14.252 - * when the protocol is disconnected and should not be automatically
14.253 - * reconnected (incorrect password, etc.). prpls should rely on
14.254 - * purple_connection_error_reason() to set this for them rather than
14.255 - * setting it themselves.
14.256 - * @see purple_connection_error_is_fatal
14.257 - */
14.258 - gboolean wants_to_die;
14.259 -
14.260 - guint disconnect_timeout; /**< Timer used for nasty stack tricks */
14.261 - time_t last_received; /**< When we last received a packet. Set by the
14.262 - prpl to avoid sending unneeded keepalives */
14.263 -};
14.264 -
14.265 -#ifdef __cplusplus
14.266 -extern "C" {
14.267 -#endif
14.268 -
14.269 -/**************************************************************************/
14.270 -/** @name Connection API */
14.271 -/**************************************************************************/
14.272 -/*@{*/
14.273 -
14.274 -#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_CONNECTION_C_)
14.275 -/**
14.276 - * This function should only be called by purple_account_connect()
14.277 - * in account.c. If you're trying to sign on an account, use that
14.278 - * function instead.
14.279 - *
14.280 - * Creates a connection to the specified account and either connects
14.281 - * or attempts to register a new account. If you are logging in,
14.282 - * the connection uses the current active status for this account.
14.283 - * So if you want to sign on as "away," for example, you need to
14.284 - * have called purple_account_set_status(account, "away").
14.285 - * (And this will call purple_account_connect() automatically).
14.286 - *
14.287 - * @param account The account the connection should be connecting to.
14.288 - * @param regist Whether we are registering a new account or just
14.289 - * trying to do a normal signon.
14.290 - * @param password The password to use.
14.291 - *
14.292 - * @deprecated As this is internal, we should make it private in 3.0.0.
14.293 - */
14.294 -void purple_connection_new(PurpleAccount *account, gboolean regist,
14.295 - const char *password);
14.296 -#endif
14.297 -
14.298 -#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_CONNECTION_C_)
14.299 -/**
14.300 - * This function should only be called by purple_account_unregister()
14.301 - * in account.c.
14.302 - *
14.303 - * Tries to unregister the account on the server. If the account is not
14.304 - * connected, also creates a new connection.
14.305 - *
14.306 - * @param account The account to unregister
14.307 - * @param password The password to use.
14.308 - * @param cb Optional callback to be called when unregistration is complete
14.309 - * @param user_data user data to pass to the callback
14.310 - *
14.311 - * @deprecated As this is internal, we should make it private in 3.0.0.
14.312 - */
14.313 -void purple_connection_new_unregister(PurpleAccount *account, const char *password, PurpleAccountUnregistrationCb cb, void *user_data);
14.314 -#endif
14.315 -
14.316 -#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_CONNECTION_C_)
14.317 -/**
14.318 - * Disconnects and destroys a PurpleConnection.
14.319 - *
14.320 - * This function should only be called by purple_account_disconnect()
14.321 - * in account.c. If you're trying to sign off an account, use that
14.322 - * function instead.
14.323 - *
14.324 - * @param gc The purple connection to destroy.
14.325 - *
14.326 - * @deprecated As this is internal, we should make it private in 3.0.0.
14.327 - */
14.328 -void purple_connection_destroy(PurpleConnection *gc);
14.329 -#endif
14.330 -
14.331 -/**
14.332 - * Sets the connection state. PRPLs should call this and pass in
14.333 - * the state #PURPLE_CONNECTED when the account is completely
14.334 - * signed on. What does it mean to be completely signed on? If
14.335 - * the core can call prpl->set_status, and it successfully changes
14.336 - * your status, then the account is online.
14.337 - *
14.338 - * @param gc The connection.
14.339 - * @param state The connection state.
14.340 - */
14.341 -void purple_connection_set_state(PurpleConnection *gc, PurpleConnectionState state);
14.342 -
14.343 -/**
14.344 - * Sets the connection's account.
14.345 - *
14.346 - * @param gc The connection.
14.347 - * @param account The account.
14.348 - */
14.349 -void purple_connection_set_account(PurpleConnection *gc, PurpleAccount *account);
14.350 -
14.351 -/**
14.352 - * Sets the connection's displayed name.
14.353 - *
14.354 - * @param gc The connection.
14.355 - * @param name The displayed name.
14.356 - */
14.357 -void purple_connection_set_display_name(PurpleConnection *gc, const char *name);
14.358 -
14.359 -/**
14.360 - * Returns the connection state.
14.361 - *
14.362 - * @param gc The connection.
14.363 - *
14.364 - * @return The connection state.
14.365 - */
14.366 -PurpleConnectionState purple_connection_get_state(const PurpleConnection *gc);
14.367 -
14.368 -/**
14.369 - * Returns TRUE if the account is connected, otherwise returns FALSE.
14.370 - *
14.371 - * @return TRUE if the account is connected, otherwise returns FALSE.
14.372 - */
14.373 -#define PURPLE_CONNECTION_IS_CONNECTED(gc) \
14.374 - (purple_connection_get_state(gc) == PURPLE_CONNECTED)
14.375 -
14.376 -/**
14.377 - * Returns the connection's account.
14.378 - *
14.379 - * @param gc The connection.
14.380 - *
14.381 - * @return The connection's account.
14.382 - */
14.383 -PurpleAccount *purple_connection_get_account(const PurpleConnection *gc);
14.384 -
14.385 -/**
14.386 - * Returns the protocol plugin managing a connection.
14.387 - *
14.388 - * @param gc The connection.
14.389 - *
14.390 - * @return The protocol plugin.
14.391 - * @since 2.4.0
14.392 - */
14.393 -PurplePlugin * purple_connection_get_prpl(const PurpleConnection *gc);
14.394 -
14.395 -/**
14.396 - * Returns the connection's password.
14.397 - *
14.398 - * @param gc The connection.
14.399 - *
14.400 - * @return The connection's password.
14.401 - */
14.402 -const char *purple_connection_get_password(const PurpleConnection *gc);
14.403 -
14.404 -/**
14.405 - * Returns the connection's displayed name.
14.406 - *
14.407 - * @param gc The connection.
14.408 - *
14.409 - * @return The connection's displayed name.
14.410 - */
14.411 -const char *purple_connection_get_display_name(const PurpleConnection *gc);
14.412 -
14.413 -/**
14.414 - * Updates the connection progress.
14.415 - *
14.416 - * @param gc The connection.
14.417 - * @param text Information on the current step.
14.418 - * @param step The current step.
14.419 - * @param count The total number of steps.
14.420 - */
14.421 -void purple_connection_update_progress(PurpleConnection *gc, const char *text,
14.422 - size_t step, size_t count);
14.423 -
14.424 -/**
14.425 - * Displays a connection-specific notice.
14.426 - *
14.427 - * @param gc The connection.
14.428 - * @param text The notice text.
14.429 - */
14.430 -void purple_connection_notice(PurpleConnection *gc, const char *text);
14.431 -
14.432 -/**
14.433 - * Closes a connection with an error.
14.434 - *
14.435 - * @param gc The connection.
14.436 - * @param reason The error text, which may not be @c NULL.
14.437 - * @deprecated in favour of #purple_connection_error_reason. Calling
14.438 - * @c purple_connection_error(gc, text) is equivalent to calling
14.439 - * @c purple_connection_error_reason(gc, reason, text) where @c reason is
14.440 - * #PURPLE_CONNECTION_ERROR_OTHER_ERROR if @c gc->wants_to_die is @c TRUE, and
14.441 - * #PURPLE_CONNECTION_ERROR_NETWORK_ERROR if not. (This is to keep
14.442 - * auto-reconnection behaviour the same when using old prpls which don't use
14.443 - * reasons yet.)
14.444 - */
14.445 -void purple_connection_error(PurpleConnection *gc, const char *reason);
14.446 -
14.447 -/**
14.448 - * Closes a connection with an error and a human-readable description of the
14.449 - * error. It also sets @c gc->wants_to_die to the value of
14.450 - * #purple_connection_error_is_fatal(@a reason), mainly for
14.451 - * backwards-compatibility.
14.452 - *
14.453 - * @param gc the connection which is closing.
14.454 - * @param reason why the connection is closing.
14.455 - * @param description a non-@c NULL localized description of the error.
14.456 - * @since 2.3.0
14.457 - */
14.458 -void
14.459 -purple_connection_error_reason (PurpleConnection *gc,
14.460 - PurpleConnectionError reason,
14.461 - const char *description);
14.462 -
14.463 -/**
14.464 - * Closes a connection due to an SSL error; this is basically a shortcut to
14.465 - * turning the #PurpleSslErrorType into a #PurpleConnectionError and a
14.466 - * human-readable string and then calling purple_connection_error_reason().
14.467 - * @since 2.3.0
14.468 - */
14.469 -void
14.470 -purple_connection_ssl_error (PurpleConnection *gc,
14.471 - PurpleSslErrorType ssl_error);
14.472 -
14.473 -/**
14.474 - * Reports whether a disconnection reason is fatal (in which case the account
14.475 - * should probably not be automatically reconnected) or transient (so
14.476 - * auto-reconnection is a good idea).
14.477 - * For instance, #PURPLE_CONNECTION_ERROR_NETWORK_ERROR is a temporary error,
14.478 - * which might be caused by losing the network connection, so <tt>
14.479 - * purple_connection_error_is_fatal (PURPLE_CONNECTION_ERROR_NETWORK_ERROR)</tt>
14.480 - * is @c FALSE. On the other hand,
14.481 - * #PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED probably indicates a
14.482 - * misconfiguration of the account which needs the user to go fix it up, so
14.483 - * <tt> purple_connection_error_is_fatal
14.484 - * (PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED)</tt> is @c TRUE.
14.485 - *
14.486 - * (This function is meant to replace checking PurpleConnection.wants_to_die.)
14.487 - *
14.488 - * @return @c TRUE if the account should not be automatically reconnected, and
14.489 - * @c FALSE otherwise.
14.490 - * @since 2.3.0
14.491 - */
14.492 -gboolean
14.493 -purple_connection_error_is_fatal (PurpleConnectionError reason);
14.494 -
14.495 -/*@}*/
14.496 -
14.497 -/**************************************************************************/
14.498 -/** @name Connections API */
14.499 -/**************************************************************************/
14.500 -/*@{*/
14.501 -
14.502 -/**
14.503 - * Disconnects from all connections.
14.504 - */
14.505 -void purple_connections_disconnect_all(void);
14.506 -
14.507 -/**
14.508 - * Returns a list of all active connections. This does not
14.509 - * include connections that are in the process of connecting.
14.510 - *
14.511 - * @constreturn A list of all active connections.
14.512 - */
14.513 -GList *purple_connections_get_all(void);
14.514 -
14.515 -/**
14.516 - * Returns a list of all connections in the process of connecting.
14.517 - *
14.518 - * @constreturn A list of connecting connections.
14.519 - */
14.520 -GList *purple_connections_get_connecting(void);
14.521 -
14.522 -/**
14.523 - * Checks if gc is still a valid pointer to a gc.
14.524 - *
14.525 - * @return @c TRUE if gc is valid.
14.526 - */
14.527 -/*
14.528 - * TODO: Eventually this bad boy will be removed, because it is
14.529 - * a gross fix for a crashy problem.
14.530 - */
14.531 -#define PURPLE_CONNECTION_IS_VALID(gc) (g_list_find(purple_connections_get_all(), (gc)) != NULL)
14.532 -
14.533 -/*@}*/
14.534 -
14.535 -/**************************************************************************/
14.536 -/** @name UI Registration Functions */
14.537 -/**************************************************************************/
14.538 -/*@{*/
14.539 -
14.540 -/**
14.541 - * Sets the UI operations structure to be used for connections.
14.542 - *
14.543 - * @param ops The UI operations structure.
14.544 - */
14.545 -void purple_connections_set_ui_ops(PurpleConnectionUiOps *ops);
14.546 -
14.547 -/**
14.548 - * Returns the UI operations structure used for connections.
14.549 - *
14.550 - * @return The UI operations structure in use.
14.551 - */
14.552 -PurpleConnectionUiOps *purple_connections_get_ui_ops(void);
14.553 -
14.554 -/*@}*/
14.555 -
14.556 -/**************************************************************************/
14.557 -/** @name Connections Subsystem */
14.558 -/**************************************************************************/
14.559 -/*@{*/
14.560 -
14.561 -/**
14.562 - * Initializes the connections subsystem.
14.563 - */
14.564 -void purple_connections_init(void);
14.565 -
14.566 -/**
14.567 - * Uninitializes the connections subsystem.
14.568 - */
14.569 -void purple_connections_uninit(void);
14.570 -
14.571 -/**
14.572 - * Returns the handle to the connections subsystem.
14.573 - *
14.574 - * @return The connections subsystem handle.
14.575 - */
14.576 -void *purple_connections_get_handle(void);
14.577 -
14.578 -/*@}*/
14.579 -
14.580 -
14.581 -#ifdef __cplusplus
14.582 -}
14.583 -#endif
14.584 -
14.585 -#endif /* _PURPLE_CONNECTION_H_ */
15.1 --- a/Frameworks/libpurple.framework/Versions/0.5.6/Headers/contact.h Sun Jun 21 22:04:11 2009 -0400
15.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
15.3 @@ -1,699 +0,0 @@
15.4 -/**
15.5 - * @file contact.h Header file for contact.c
15.6 - * Author
15.7 - * MaYuan<mayuan2006@gmail.com>
15.8 - * purple
15.9 - *
15.10 - * Purple is the legal property of its developers, whose names are too numerous
15.11 - * to list here. Please refer to the COPYRIGHT file distributed with this
15.12 - * source distribution.
15.13 - *
15.14 - * This program is free software; you can redistribute it and/or modify
15.15 - * it under the terms of the GNU General Public License as published by
15.16 - * the Free Software Foundation; either version 2 of the License, or
15.17 - * (at your option) any later version.
15.18 - *
15.19 - * This program is distributed in the hope that it will be useful,
15.20 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
15.21 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15.22 - * GNU General Public License for more details.
15.23 - *
15.24 - * You should have received a copy of the GNU General Public License
15.25 - * along with this program; if not, write to the Free Software
15.26 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15.27 - */
15.28 -#ifndef _MSN_CONTACT_H_
15.29 -#define _MSN_CONTACT_H_
15.30 -
15.31 -#include "session.h"
15.32 -#include "soap.h"
15.33 -
15.34 -#define MSN_APPLICATION_ID "CFE80F9D-180F-4399-82AB-413F33A1FA11"
15.35 -
15.36 -#define MSN_CONTACT_SERVER "omega.contacts.msn.com"
15.37 -
15.38 -/* Get Contact List */
15.39 -
15.40 -#define MSN_GET_CONTACT_POST_URL "/abservice/SharingService.asmx"
15.41 -#define MSN_GET_CONTACT_SOAP_ACTION "http://www.msn.com/webservices/AddressBook/FindMembership"
15.42 -
15.43 -#define MSN_GET_CONTACT_UPDATE_XML \
15.44 - "<View>Full</View>"\
15.45 - "<deltasOnly>true</deltasOnly>"\
15.46 - "<lastChange>%s</lastChange>"
15.47 -
15.48 -#define MSN_GET_CONTACT_TEMPLATE "<?xml version='1.0' encoding='utf-8'?>"\
15.49 -"<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">"\
15.50 - "<soap:Header xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">"\
15.51 - "<ABApplicationHeader xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
15.52 - "<ApplicationId xmlns=\"http://www.msn.com/webservices/AddressBook\">" MSN_APPLICATION_ID "</ApplicationId>"\
15.53 - "<IsMigration xmlns=\"http://www.msn.com/webservices/AddressBook\">false</IsMigration>"\
15.54 - "<PartnerScenario xmlns=\"http://www.msn.com/webservices/AddressBook\">%s</PartnerScenario>"\
15.55 - "</ABApplicationHeader>"\
15.56 - "<ABAuthHeader xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
15.57 - "<ManagedGroupRequest xmlns=\"http://www.msn.com/webservices/AddressBook\">false</ManagedGroupRequest>"\
15.58 - "<TicketToken>EMPTY</TicketToken>"\
15.59 - "</ABAuthHeader>"\
15.60 - "</soap:Header>"\
15.61 - "<soap:Body xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">"\
15.62 - "<FindMembership xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
15.63 - "<serviceFilter xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
15.64 - "<Types xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
15.65 - "<ServiceType xmlns=\"http://www.msn.com/webservices/AddressBook\">Messenger</ServiceType>"\
15.66 - "<ServiceType xmlns=\"http://www.msn.com/webservices/AddressBook\">Invitation</ServiceType>"\
15.67 - "<ServiceType xmlns=\"http://www.msn.com/webservices/AddressBook\">SocialNetwork</ServiceType>"\
15.68 - "<ServiceType xmlns=\"http://www.msn.com/webservices/AddressBook\">Space</ServiceType>"\
15.69 - "<ServiceType xmlns=\"http://www.msn.com/webservices/AddressBook\">Profile</ServiceType>"\
15.70 - "</Types>"\
15.71 - "</serviceFilter>"\
15.72 - "%s"\
15.73 - "</FindMembership>"\
15.74 - "</soap:Body>"\
15.75 -"</soap:Envelope>"
15.76 -
15.77 -/************************************************
15.78 - * Address Book SOAP
15.79 - * *********************************************/
15.80 -
15.81 -#define MSN_ADDRESS_BOOK_POST_URL "/abservice/abservice.asmx"
15.82 -
15.83 -/* Create AddressBook template */
15.84 -#define MSN_ADD_ADDRESSBOOK_SOAP_ACTION "http://www.msn.com/webservices/AddressBook/ABAdd"
15.85 -
15.86 -#define MSN_ADD_ADDRESSBOOK_TEMPLATE "<?xml version=\"1.0\" encoding=\"utf-8\"?>"\
15.87 -"<soap:Envelope"\
15.88 - " xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\""\
15.89 - " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\""\
15.90 - " xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\""\
15.91 - " xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\">"\
15.92 - "<soap:Header>"\
15.93 - "<ABApplicationHeader xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
15.94 - "<ApplicationId>" MSN_APPLICATION_ID "</ApplicationId>"\
15.95 - "<IsMigration>false</IsMigration>"\
15.96 - "<PartnerScenario>Initial</PartnerScenario>"\
15.97 - "</ABApplicationHeader>"\
15.98 - "<ABAuthHeader xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
15.99 - "<ManagedGroupRequest>false</ManagedGroupRequest>"\
15.100 - "<TicketToken>EMPTY</TicketToken>"\
15.101 - "</ABAuthHeader>"\
15.102 - "</soap:Header>"\
15.103 - "<soap:Body>"\
15.104 - "<ABAdd xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
15.105 - "<abInfo>"\
15.106 - "<name/>"\
15.107 - "<ownerPuid>0</ownerPuid>"\
15.108 - "<ownerEmail>%s</ownerEmail>"\
15.109 - "<fDefault>true</fDefault>"\
15.110 - "</abInfo>"\
15.111 - "</ABAdd>"\
15.112 - "</soap:Body>"\
15.113 -"</soap:Envelope>"
15.114 -
15.115 -/* Get AddressBook */
15.116 -#define MSN_GET_ADDRESS_SOAP_ACTION "http://www.msn.com/webservices/AddressBook/ABFindAll"
15.117 -#define MSN_GET_ADDRESS_FULL_TIME "0001-01-01T00:00:00.0000000-08:00"
15.118 -#define MSN_GET_ADDRESS_UPDATE_XML \
15.119 - "<deltasOnly>true</deltasOnly>"\
15.120 - "<lastChange>%s</lastChange>"
15.121 -
15.122 -#define MSN_GET_GLEAM_UPDATE_XML \
15.123 - "%s"\
15.124 - "<dynamicItemView>Gleam</dynamicItemView>"\
15.125 - "<dynamicItemLastChange>%s</dynamicItemLastChange>"
15.126 -
15.127 -#define MSN_GET_ADDRESS_TEMPLATE "<?xml version=\"1.0\" encoding=\"utf-8\"?>"\
15.128 -"<soap:Envelope"\
15.129 - " xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\""\
15.130 - " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\""\
15.131 - " xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\""\
15.132 - " xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\">"\
15.133 - "<soap:Header>"\
15.134 - "<ABApplicationHeader xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
15.135 - "<ApplicationId>" MSN_APPLICATION_ID "</ApplicationId>"\
15.136 - "<IsMigration>false</IsMigration>"\
15.137 - "<PartnerScenario>%s</PartnerScenario>"\
15.138 - "</ABApplicationHeader>"\
15.139 - "<ABAuthHeader xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
15.140 - "<ManagedGroupRequest>false</ManagedGroupRequest>"\
15.141 - "<TicketToken>EMPTY</TicketToken>"\
15.142 - "</ABAuthHeader>"\
15.143 - "</soap:Header>"\
15.144 - "<soap:Body>"\
15.145 - "<ABFindAll xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
15.146 - "<abId>00000000-0000-0000-0000-000000000000</abId>"\
15.147 - "<abView>Full</abView>"\
15.148 - "%s"\
15.149 - "</ABFindAll>"\
15.150 - "</soap:Body>"\
15.151 -"</soap:Envelope>"
15.152 -
15.153 -
15.154 -/*Gleams SOAP request template*/
15.155 -#define MSN_GET_GLEAMS_SOAP_ACTION "http://www.msn.com/webservices/AddressBook/ABFindAll"
15.156 -#define MSN_GLEAMS_TEMPLATE "<?xml version=\"1.0\" encoding=\"utf-8\"?>"\
15.157 -"<soap:Envelope"\
15.158 - " xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\""\
15.159 - " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\""\
15.160 - " xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\""\
15.161 - " xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\">"\
15.162 - "<soap:Header>"\
15.163 - "<ABApplicationHeader xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
15.164 - "<ApplicationId>" MSN_APPLICATION_ID "</ApplicationId>"\
15.165 - "<IsMigration>false</IsMigration>"\
15.166 - "<PartnerScenario>Initial</PartnerScenario>"\
15.167 - "</ABApplicationHeader>"\
15.168 - "<ABAuthHeader xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
15.169 - "<ManagedGroupRequest>false</ManagedGroupRequest>"\
15.170 - "<TicketToken>EMPTY</TicketToken>"\
15.171 - "</ABAuthHeader>"\
15.172 - "</soap:Header>"\
15.173 - "<soap:Body>"\
15.174 - "<ABFindAll xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
15.175 - "<abId>00000000-0000-0000-0000-000000000000</abId>"\
15.176 - "<abView>Full</abView>"\
15.177 - "<dynamicItemView>Gleam</dynamicItemView>"\
15.178 - "<dynamicItemLastChange>0001-01-01T00:00:00.0000000-08:00</dynamicItemLastChange>"\
15.179 - "</ABFindAll>"\
15.180 - "</soap:Body>"\
15.181 -"</soap:Envelope>"
15.182 -
15.183 -
15.184 -/*******************************************************
15.185 - * Contact Management SOAP actions
15.186 - *******************************************************/
15.187 -
15.188 -/* Add a new contact */
15.189 -#define MSN_CONTACT_ADD_SOAP_ACTION "http://www.msn.com/webservices/AddressBook/ABContactAdd"
15.190 -#define MSN_CONTACT_LIVE_PENDING_XML \
15.191 - "<Contact xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
15.192 - "<contactInfo>"\
15.193 - "<contactType>LivePending</contactType>"\
15.194 - "<passportName>%s</passportName>"\
15.195 - "<isMessengerUser>true</isMessengerUser>"\
15.196 - "</contactInfo>"\
15.197 - "</Contact>"
15.198 -
15.199 -#define MSN_CONTACT_XML \
15.200 - "<Contact xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
15.201 - "<contactInfo>"\
15.202 - "<passportName>%s</passportName>"\
15.203 - "<isSmtp>false</isSmtp>"\
15.204 - "<isMessengerUser>true</isMessengerUser>"\
15.205 - "</contactInfo>"\
15.206 - "</Contact>"
15.207 -
15.208 -#define MSN_CONTACT_DISPLAYNAME_XML \
15.209 - "<Contact xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
15.210 - "<contactInfo>"\
15.211 - "<displayName>%s</displayName>"\
15.212 - "<passportName>%s</passportName>"\
15.213 - "<isMessengerUser>true</isMessengerUser>"\
15.214 - "</contactInfo>"\
15.215 - "</Contact>"
15.216 -
15.217 -#define MSN_CONTACT_ID_XML \
15.218 - "<Contact>"\
15.219 - "<contactId>%s</contactId>"\
15.220 - "</Contact>"
15.221 -
15.222 -#define MSN_CONTACT_EMAIL_XML \
15.223 - "<Contact>"\
15.224 - "<contactInfo>"\
15.225 - "<emails>"\
15.226 - "<ContactEmail>"\
15.227 - "<contactEmailType>%s</contactEmailType>"\
15.228 - "<email>%s</email>"\
15.229 - "<isMessengerEnabled>true</isMessengerEnabled>"\
15.230 - "<Capability>%d</Capability>"\
15.231 - "<MessengerEnabledExternally>false</MessengerEnabledExternally>"\
15.232 - "<propertiesChanged/>"\
15.233 - "</ContactEmail>"\
15.234 - "</emails>"\
15.235 - "</contactInfo>"\
15.236 - "</Contact>"
15.237 -
15.238 -#define MSN_ADD_CONTACT_TEMPLATE "<?xml version=\"1.0\" encoding=\"utf-8\"?>"\
15.239 -"<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\""\
15.240 - " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\""\
15.241 - " xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\""\
15.242 - " xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\">"\
15.243 - "<soap:Header>"\
15.244 - "<ABApplicationHeader xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
15.245 - "<ApplicationId>" MSN_APPLICATION_ID "</ApplicationId>"\
15.246 - "<IsMigration>false</IsMigration>"\
15.247 - "<PartnerScenario>ContactSave</PartnerScenario>"\
15.248 - "</ABApplicationHeader>"\
15.249 - "<ABAuthHeader xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
15.250 - "<ManagedGroupRequest>false</ManagedGroupRequest>"\
15.251 - "<TicketToken>EMPTY</TicketToken>"\
15.252 - "</ABAuthHeader>"\
15.253 - "</soap:Header>"\
15.254 - "<soap:Body>"\
15.255 - "<ABContactAdd xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
15.256 - "<abId>00000000-0000-0000-0000-000000000000</abId>"\
15.257 - "<contacts>%s</contacts>"\
15.258 - "<options>"\
15.259 - "<EnableAllowListManagement>true</EnableAllowListManagement>"\
15.260 - "</options>"\
15.261 - "</ABContactAdd>"\
15.262 - "</soap:Body>"\
15.263 -"</soap:Envelope>"
15.264 -
15.265 -/* Add a contact to a group */
15.266 -#define MSN_ADD_CONTACT_GROUP_SOAP_ACTION "http://www.msn.com/webservices/AddressBook/ABGroupContactAdd"
15.267 -#define MSN_ADD_CONTACT_GROUP_TEMPLATE "<?xml version=\"1.0\" encoding=\"utf-8\"?>"\
15.268 -"<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\""\
15.269 - " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\""\
15.270 - " xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\""\
15.271 - " xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\">"\
15.272 - "<soap:Header>"\
15.273 - "<ABApplicationHeader xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
15.274 - "<ApplicationId>" MSN_APPLICATION_ID "</ApplicationId>"\
15.275 - "<IsMigration>false</IsMigration>"\
15.276 - "<PartnerScenario>ContactSave</PartnerScenario>"\
15.277 - "</ABApplicationHeader>"\
15.278 - "<ABAuthHeader xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
15.279 - "<ManagedGroupRequest>false</ManagedGroupRequest>"\
15.280 - "<TicketToken>EMPTY</TicketToken>"\
15.281 - "</ABAuthHeader>"\
15.282 - "</soap:Header>"\
15.283 - "<soap:Body>"\
15.284 - "<ABGroupContactAdd xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
15.285 - "<abId>00000000-0000-0000-0000-000000000000</abId>"\
15.286 - "<groupFilter>"\
15.287 - "<groupIds>"\
15.288 - "<guid>%s</guid>"\
15.289 - "</groupIds>"\
15.290 - "</groupFilter>"\
15.291 - "<contacts>%s</contacts>"\
15.292 - "<groupContactAddOptions>"\
15.293 - "<fGenerateMissingQuickName>true</fGenerateMissingQuickName>"\
15.294 - "<EnableAllowListManagement>true</EnableAllowListManagement>"\
15.295 - "</groupContactAddOptions>"\
15.296 - "</ABGroupContactAdd>"\
15.297 - "</soap:Body>"\
15.298 -"</soap:Envelope>"
15.299 -
15.300 -/* Delete a contact from the Contact List */
15.301 -#define MSN_CONTACT_DEL_SOAP_ACTION "http://www.msn.com/webservices/AddressBook/ABContactDelete"
15.302 -#define MSN_DEL_CONTACT_TEMPLATE "<?xml version=\"1.0\" encoding=\"utf-8\"?>"\
15.303 -"<soap:Envelope"\
15.304 - " xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\""\
15.305 - " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\""\
15.306 - " xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\""\
15.307 - " xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\">"\
15.308 - "<soap:Header>"\
15.309 - "<ABApplicationHeader xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
15.310 - "<ApplicationId>" MSN_APPLICATION_ID "</ApplicationId>"\
15.311 - "<IsMigration>false</IsMigration>"\
15.312 - "<PartnerScenario>Timer</PartnerScenario>"\
15.313 - "</ABApplicationHeader>"\
15.314 - "<ABAuthHeader xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
15.315 - "<ManagedGroupRequest>false</ManagedGroupRequest>"\
15.316 - "<TicketToken>EMPTY</TicketToken>"\
15.317 - "</ABAuthHeader>"\
15.318 - "</soap:Header>"\
15.319 - "<soap:Body>"\
15.320 - "<ABContactDelete xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
15.321 - "<abId>00000000-0000-0000-0000-000000000000</abId>"\
15.322 - "<contacts>%s</contacts>"\
15.323 - "</ABContactDelete>"\
15.324 - "</soap:Body>"\
15.325 -"</soap:Envelope>"
15.326 -
15.327 -/* Remove a contact from a group */
15.328 -#define MSN_CONTACT_DEL_GROUP_SOAP_ACTION "http://www.msn.com/webservices/AddressBook/ABGroupContactDelete"
15.329 -#define MSN_CONTACT_DEL_GROUP_TEMPLATE "<?xml version=\"1.0\" encoding=\"utf-8\"?>"\
15.330 -"<soap:Envelope"\
15.331 - " xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\""\
15.332 - " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\""\
15.333 - " xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\""\
15.334 - " xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\">"\
15.335 - "<soap:Header>"\
15.336 - "<ABApplicationHeader xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
15.337 - "<ApplicationId>" MSN_APPLICATION_ID "</ApplicationId>"\
15.338 - "<IsMigration>false</IsMigration>"\
15.339 - "<PartnerScenario>Timer</PartnerScenario>"\
15.340 - "</ABApplicationHeader>"\
15.341 - "<ABAuthHeader xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
15.342 - "<ManagedGroupRequest>false</ManagedGroupRequest>"\
15.343 - "<TicketToken>EMPTY</TicketToken>"\
15.344 - "</ABAuthHeader>"\
15.345 - "</soap:Header>"\
15.346 - "<soap:Body>"\
15.347 - "<ABGroupContactDelete xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
15.348 - "<abId>00000000-0000-0000-0000-000000000000</abId>"\
15.349 - "<contacts>%s</contacts>"\
15.350 - "<groupFilter>"\
15.351 - "<groupIds>"\
15.352 - "<guid>%s</guid>"\
15.353 - "</groupIds>"\
15.354 - "</groupFilter>"\
15.355 - "</ABGroupContactDelete>"\
15.356 - "</soap:Body>"\
15.357 -"</soap:Envelope>"
15.358 -
15.359 -
15.360 -/* Update Contact Information */
15.361 -#define MSN_CONTACT_UPDATE_SOAP_ACTION "http://www.msn.com/webservices/AddressBook/ABContactUpdate"
15.362 -#define MSN_CONTACT_UPDATE_TEMPLATE "<?xml version=\"1.0\" encoding=\"utf-8\"?>"\
15.363 -"<soap:Envelope"\
15.364 - " xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\""\
15.365 - " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\""\
15.366 - " xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\""\
15.367 - " xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\">"\
15.368 - "<soap:Header>"\
15.369 - "<ABApplicationHeader xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
15.370 - "<ApplicationId>" MSN_APPLICATION_ID "</ApplicationId>"\
15.371 - "<IsMigration>false</IsMigration>"\
15.372 - "<PartnerScenario>Timer</PartnerScenario>"\
15.373 - "</ABApplicationHeader>"\
15.374 - "<ABAuthHeader xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
15.375 - "<ManagedGroupRequest>false</ManagedGroupRequest>"\
15.376 - "<TicketToken>EMPTY</TicketToken>"\
15.377 - "</ABAuthHeader>"\
15.378 - "</soap:Header>"\
15.379 - "<soap:Body>"\
15.380 - "<ABContactUpdate xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
15.381 - "<abId>00000000-0000-0000-0000-000000000000</abId>"\
15.382 - "<contacts>"\
15.383 - "<Contact xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
15.384 - ""\
15.385 - "</Contact>"\
15.386 - "</contacts>"\
15.387 - "</ABContactUpdate>"\
15.388 - "</soap:Body>"\
15.389 -"</soap:Envelope>"
15.390 -
15.391 -/*******************************************************
15.392 - * Add/Delete contact from lists SOAP actions
15.393 - *******************************************************/
15.394 -
15.395 -/* block means delete from allow list and add contact to block list */
15.396 -#define MSN_SHARE_POST_URL "/abservice/SharingService.asmx"
15.397 -
15.398 -#define MSN_ADD_MEMBER_TO_LIST_SOAP_ACTION "http://www.msn.com/webservices/AddressBook/AddMember"
15.399 -#define MSN_DELETE_MEMBER_FROM_LIST_SOAP_ACTION "http://www.msn.com/webservices/AddressBook/DeleteMember"
15.400 -
15.401 -#define MSN_MEMBER_PASSPORT_XML \
15.402 - "<Member xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"%s\">"\
15.403 - "<Type>%s</Type>"\
15.404 - "<State>Accepted</State>"\
15.405 - "<%s>%s</%s>"\
15.406 - "</Member>"
15.407 -
15.408 -#define MSN_MEMBER_MEMBERSHIPID_XML \
15.409 - "<Member xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"%s\">"\
15.410 - "<Type>%s</Type>"\
15.411 - "<MembershipId>%u</MembershipId>"\
15.412 - "<State>Accepted</State>"\
15.413 - "</Member>"
15.414 -
15.415 -/* first delete contact from allow list */
15.416 -
15.417 -#define MSN_CONTACT_DELETE_FROM_LIST_TEMPLATE "<?xml version=\"1.0\" encoding=\"utf-8\"?>"\
15.418 -"<soap:Envelope"\
15.419 - " xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\""\
15.420 - " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\""\
15.421 - " xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\""\
15.422 - " xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\">"\
15.423 - "<soap:Header>"\
15.424 - "<ABApplicationHeader xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
15.425 - "<ApplicationId>" MSN_APPLICATION_ID "</ApplicationId>"\
15.426 - "<IsMigration>false</IsMigration>"\
15.427 - "<PartnerScenario>%s</PartnerScenario>"\
15.428 - "</ABApplicationHeader>"\
15.429 - "<ABAuthHeader xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
15.430 - "<ManagedGroupRequest>false</ManagedGroupRequest>"\
15.431 - "<TicketToken>EMPTY</TicketToken>"\
15.432 - "</ABAuthHeader>"\
15.433 - "</soap:Header>"\
15.434 - "<soap:Body>"\
15.435 - "<DeleteMember xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
15.436 - "<serviceHandle>"\
15.437 - "<Id>0</Id>"\
15.438 - "<Type>Messenger</Type>"\
15.439 - "<ForeignId></ForeignId>"\
15.440 - "</serviceHandle>"\
15.441 - "<memberships>"\
15.442 - "<Membership>"\
15.443 - "<MemberRole>%s</MemberRole>"\
15.444 - "<Members>"\
15.445 - "%s"\
15.446 - "</Members>"\
15.447 - "</Membership>"\
15.448 - "</memberships>"\
15.449 - "</DeleteMember>"\
15.450 - "</soap:Body>"\
15.451 -"</soap:Envelope>"
15.452 -
15.453 -#define MSN_CONTACT_ADD_TO_LIST_TEMPLATE "<?xml version=\"1.0\" encoding=\"utf-8\"?>"\
15.454 -"<soap:Envelope"\
15.455 - " xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\""\
15.456 - " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\""\
15.457 - " xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\""\
15.458 - " xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\">"\
15.459 - "<soap:Header>"\
15.460 - "<ABApplicationHeader xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
15.461 - "<ApplicationId>" MSN_APPLICATION_ID "</ApplicationId>"\
15.462 - "<IsMigration>false</IsMigration>"\
15.463 - "<PartnerScenario>%s</PartnerScenario>"\
15.464 - "</ABApplicationHeader>"\
15.465 - "<ABAuthHeader xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
15.466 - "<ManagedGroupRequest>false</ManagedGroupRequest>"\
15.467 - "<TicketToken>EMPTY</TicketToken>"\
15.468 - "</ABAuthHeader>"\
15.469 - "</soap:Header>"\
15.470 - "<soap:Body>"\
15.471 - "<AddMember xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
15.472 - "<serviceHandle>"\
15.473 - "<Id>0</Id>"\
15.474 - "<Type>Messenger</Type>"\
15.475 - "<ForeignId></ForeignId>"\
15.476 - "</serviceHandle>"\
15.477 - "<memberships>"\
15.478 - "<Membership>"\
15.479 - "<MemberRole>%s</MemberRole>"\
15.480 - "<Members>"\
15.481 - "%s"\
15.482 - "</Members>"\
15.483 - "</Membership>"\
15.484 - "</memberships>"\
15.485 - "</AddMember>"\
15.486 - "</soap:Body>"\
15.487 -"</soap:Envelope>"
15.488 -
15.489 -
15.490 -
15.491 -/*******************************************************
15.492 - * Group management SOAP actions
15.493 - *******************************************************/
15.494 -
15.495 -/* add a group */
15.496 -#define MSN_GROUP_ADD_SOAP_ACTION "http://www.msn.com/webservices/AddressBook/ABGroupAdd"
15.497 -#define MSN_GROUP_ADD_TEMPLATE "<?xml version=\"1.0\" encoding=\"utf-8\"?>"\
15.498 -"<soap:Envelope"\
15.499 - " xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\""\
15.500 - " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\""\
15.501 - " xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\""\
15.502 - " xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\">"\
15.503 - "<soap:Header>"\
15.504 - "<ABApplicationHeader xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
15.505 - "<ApplicationId>" MSN_APPLICATION_ID "</ApplicationId>"\
15.506 - "<IsMigration>false</IsMigration>"\
15.507 - "<PartnerScenario>GroupSave</PartnerScenario>"\
15.508 - "</ABApplicationHeader>"\
15.509 - "<ABAuthHeader xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
15.510 - "<ManagedGroupRequest>false</ManagedGroupRequest>"\
15.511 - "<TicketToken>EMPTY</TicketToken>"\
15.512 - "</ABAuthHeader>"\
15.513 - "</soap:Header>"\
15.514 - "<soap:Body>"\
15.515 - "<ABGroupAdd xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
15.516 - "<abId>00000000-0000-0000-0000-000000000000</abId>"\
15.517 - "<groupAddOptions>"\
15.518 - "<fRenameOnMsgrConflict>false</fRenameOnMsgrConflict>"\
15.519 - "</groupAddOptions>"\
15.520 - "<groupInfo>"\
15.521 - "<GroupInfo>"\
15.522 - "<name>%s</name>"\
15.523 - "<groupType>C8529CE2-6EAD-434d-881F-341E17DB3FF8</groupType>"\
15.524 - "<fMessenger>false</fMessenger>"\
15.525 - "<annotations>"\
15.526 - "<Annotation>"\
15.527 - "<Name>MSN.IM.Display</Name>"\
15.528 - "<Value>1</Value>"\
15.529 - "</Annotation>"\
15.530 - "</annotations>"\
15.531 - "</GroupInfo>"\
15.532 - "</groupInfo>"\
15.533 - "</ABGroupAdd>"\
15.534 - "</soap:Body>"\
15.535 -"</soap:Envelope>"
15.536 -
15.537 -/* delete a group */
15.538 -#define MSN_GROUP_DEL_SOAP_ACTION "http://www.msn.com/webservices/AddressBook/ABGroupDelete"
15.539 -#define MSN_GROUP_DEL_TEMPLATE "<?xml version=\"1.0\" encoding=\"utf-8\"?>"\
15.540 -"<soap:Envelope"\
15.541 - " xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\""\
15.542 - " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\""\
15.543 - " xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\""\
15.544 - " xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\">"\
15.545 - "<soap:Header>"\
15.546 - "<ABApplicationHeader xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
15.547 - "<ApplicationId>" MSN_APPLICATION_ID "</ApplicationId>"\
15.548 - "<IsMigration>false</IsMigration>"\
15.549 - "<PartnerScenario>Timer</PartnerScenario>"\
15.550 - "</ABApplicationHeader>"\
15.551 - "<ABAuthHeader xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
15.552 - "<ManagedGroupRequest>false</ManagedGroupRequest>"\
15.553 - "<TicketToken>EMPTY</TicketToken>"\
15.554 - "</ABAuthHeader>"\
15.555 - "</soap:Header>"\
15.556 - "<soap:Body>"\
15.557 - "<ABGroupDelete xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
15.558 - "<abId>00000000-0000-0000-0000-000000000000</abId>"\
15.559 - "<groupFilter>"\
15.560 - "<groupIds>"\
15.561 - "<guid>%s</guid>"\
15.562 - "</groupIds>"\
15.563 - "</groupFilter>"\
15.564 - "</ABGroupDelete>"\
15.565 - "</soap:Body>"\
15.566 -"</soap:Envelope>"
15.567 -
15.568 -/* change a group's name */
15.569 -#define MSN_GROUP_RENAME_SOAP_ACTION "http://www.msn.com/webservices/AddressBook/ABGroupUpdate"
15.570 -#define MSN_GROUP_RENAME_TEMPLATE "<?xml version=\"1.0\" encoding=\"utf-8\"?>"\
15.571 -"<soap:Envelope"\
15.572 - " xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\""\
15.573 - " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\""\
15.574 - " xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\""\
15.575 - " xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\">"\
15.576 - "<soap:Header>"\
15.577 - "<ABApplicationHeader xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
15.578 - "<ApplicationId>" MSN_APPLICATION_ID "</ApplicationId>"\
15.579 - "<IsMigration>false</IsMigration>"\
15.580 - "<PartnerScenario>Timer</PartnerScenario>"\
15.581 - "</ABApplicationHeader>"\
15.582 - "<ABAuthHeader xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
15.583 - "<ManagedGroupRequest>false</ManagedGroupRequest>"\
15.584 - "<TicketToken>EMPTY</TicketToken>"\
15.585 - "</ABAuthHeader>"\
15.586 - "</soap:Header>"\
15.587 - "<soap:Body>"\
15.588 - "<ABGroupUpdate xmlns=\"http://www.msn.com/webservices/AddressBook\">"\
15.589 - "<abId>00000000-0000-0000-0000-000000000000</abId>"\
15.590 - "<groups>"\
15.591 - "<Group>"\
15.592 - "<groupId>%s</groupId>"\
15.593 - "<groupInfo>"\
15.594 - "<name>%s</name>"\
15.595 - "</groupInfo>"\
15.596 - "<propertiesChanged>GroupName </propertiesChanged>"\
15.597 - "</Group>"\
15.598 - "</groups>"\
15.599 - "</ABGroupUpdate>"\
15.600 - "</soap:Body>"\
15.601 -"</soap:Envelope>"
15.602 -
15.603 -typedef enum
15.604 -{
15.605 - MSN_ADD_BUDDY = 0x01,
15.606 - MSN_MOVE_BUDDY = 0x02,
15.607 - MSN_ACCEPTED_BUDDY = 0x04,
15.608 - MSN_DENIED_BUDDY = 0x08,
15.609 - MSN_ADD_GROUP = 0x10,
15.610 - MSN_DEL_GROUP = 0x20,
15.611 - MSN_RENAME_GROUP = 0x40,
15.612 - MSN_UPDATE_INFO = 0x80
15.613 -} MsnCallbackAction;
15.614 -
15.615 -typedef enum
15.616 -{
15.617 - MSN_PS_INITIAL,
15.618 - MSN_PS_SAVE_CONTACT,
15.619 - MSN_PS_PENDING_LIST,
15.620 - MSN_PS_CONTACT_API,
15.621 - MSN_PS_BLOCK_UNBLOCK
15.622 -} MsnSoapPartnerScenario;
15.623 -
15.624 -typedef struct _MsnCallbackState MsnCallbackState;
15.625 -
15.626 -struct _MsnCallbackState
15.627 -{
15.628 - gchar * who;
15.629 - gchar * uid;
15.630 - gchar * old_group_name;
15.631 - gchar * new_group_name;
15.632 - gchar * guid;
15.633 - MsnListId list_id;
15.634 - MsnCallbackAction action;
15.635 - MsnSession *session;
15.636 - xmlnode *body;
15.637 - xmlnode *token;
15.638 - const gchar *post_action;
15.639 - const gchar *post_url;
15.640 - MsnSoapCallback cb;
15.641 - /* For msn_get_contact_list only */
15.642 - MsnSoapPartnerScenario partner_scenario;
15.643 -};
15.644 -
15.645 -typedef enum
15.646 -{
15.647 - MSN_UPDATE_DISPLAY, /* Real display name */
15.648 - MSN_UPDATE_ALIAS, /* Aliased display name */
15.649 - MSN_UPDATE_COMMENT
15.650 -} MsnContactUpdateType;
15.651 -
15.652 -/************************************************
15.653 - * function prototype
15.654 - ************************************************/
15.655 -MsnCallbackState * msn_callback_state_new(MsnSession *session);
15.656 -MsnCallbackState * msn_callback_state_dup(MsnCallbackState *state);
15.657 -void msn_callback_state_free(MsnCallbackState *state);
15.658 -void msn_callback_state_set_who(MsnCallbackState *state, const gchar *who);
15.659 -void msn_callback_state_set_uid(MsnCallbackState *state, const gchar *uid);
15.660 -void msn_callback_state_set_old_group_name(MsnCallbackState *state,
15.661 - const gchar *old_group_name);
15.662 -void msn_callback_state_set_new_group_name(MsnCallbackState *state,
15.663 - const gchar *new_group_name);
15.664 -void msn_callback_state_set_guid(MsnCallbackState *state, const gchar *guid);
15.665 -void msn_callback_state_set_list_id(MsnCallbackState *state, MsnListId list_id);
15.666 -void msn_callback_state_set_action(MsnCallbackState *state,
15.667 - MsnCallbackAction action);
15.668 -
15.669 -void msn_contact_connect(MsnSession *session);
15.670 -void msn_get_contact_list(MsnSession *session,
15.671 - const MsnSoapPartnerScenario partner_scenario,
15.672 - const char *update);
15.673 -void msn_get_address_book(MsnSession *session,
15.674 - const MsnSoapPartnerScenario partner_scenario,
15.675 - const char * update, const char * gupdate);
15.676 -
15.677 -/* contact SOAP operations */
15.678 -void msn_update_contact(MsnSession *session, const char *passport, MsnContactUpdateType type, const char* value);
15.679 -
15.680 -void msn_add_contact(MsnSession *session, MsnCallbackState *state,
15.681 - const char *passport);
15.682 -void msn_delete_contact(MsnSession *session, MsnUser *user);
15.683 -
15.684 -void msn_add_contact_to_group(MsnSession *session, MsnCallbackState *state,
15.685 - const char *passport, const char *groupId);
15.686 -void msn_del_contact_from_group(MsnSession *session, const char *passport,
15.687 - const char *group_name);
15.688 -/* group operations */
15.689 -void msn_add_group(MsnSession *session, MsnCallbackState *state,
15.690 - const char* group_name);
15.691 -void msn_del_group(MsnSession *session, const gchar *group_name);
15.692 -void msn_contact_rename_group(MsnSession *session, const char *old_group_name,
15.693 - const char *new_group_name);
15.694 -
15.695 -/* lists operations */
15.696 -void msn_add_contact_to_list(MsnSession *session, MsnCallbackState *state,
15.697 - const gchar *passport, const MsnListId list);
15.698 -void msn_del_contact_from_list(MsnSession *session, MsnCallbackState *state,
15.699 - const gchar *passport, const MsnListId list);
15.700 -
15.701 -#endif /* _MSN_CONTACT_H_ */
15.702 -
16.1 --- a/Frameworks/libpurple.framework/Versions/0.5.6/Headers/conversation.h Sun Jun 21 22:04:11 2009 -0400
16.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
16.3 @@ -1,1407 +0,0 @@
16.4 -/**
16.5 - * @file conversation.h Conversation API
16.6 - * @ingroup core
16.7 - * @see @ref conversation-signals
16.8 - */
16.9 -
16.10 -/* purple
16.11 - *
16.12 - * Purple is the legal property of its developers, whose names are too numerous
16.13 - * to list here. Please refer to the COPYRIGHT file distributed with this
16.14 - * source distribution.
16.15 - *
16.16 - * This program is free software; you can redistribute it and/or modify
16.17 - * it under the terms of the GNU General Public License as published by
16.18 - * the Free Software Foundation; either version 2 of the License, or
16.19 - * (at your option) any later version.
16.20 - *
16.21 - * This program is distributed in the hope that it will be useful,
16.22 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
16.23 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16.24 - * GNU General Public License for more details.
16.25 - *
16.26 - * You should have received a copy of the GNU General Public License
16.27 - * along with this program; if not, write to the Free Software
16.28 - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
16.29 - */
16.30 -#ifndef _PURPLE_CONVERSATION_H_
16.31 -#define _PURPLE_CONVERSATION_H_
16.32 -
16.33 -/**************************************************************************/
16.34 -/** Data Structures */
16.35 -/**************************************************************************/
16.36 -
16.37 -
16.38 -/** @copydoc _PurpleConversationUiOps */
16.39 -typedef struct _PurpleConversationUiOps PurpleConversationUiOps;
16.40 -/** @copydoc _PurpleConversation */
16.41 -typedef struct _PurpleConversation PurpleConversation;
16.42 -/** @copydoc _PurpleConvIm */
16.43 -typedef struct _PurpleConvIm PurpleConvIm;
16.44 -/** @copydoc _PurpleConvChat */
16.45 -typedef struct _PurpleConvChat PurpleConvChat;
16.46 -/** @copydoc _PurpleConvChatBuddy */
16.47 -typedef struct _PurpleConvChatBuddy PurpleConvChatBuddy;
16.48 -/** @copydoc _PurpleConvMessage */
16.49 -typedef struct _PurpleConvMessage PurpleConvMessage;
16.50 -
16.51 -/**
16.52 - * A type of conversation.
16.53 - */
16.54 -typedef enum
16.55 -{
16.56 - PURPLE_CONV_TYPE_UNKNOWN = 0, /**< Unknown conversation type. */
16.57 - PURPLE_CONV_TYPE_IM, /**< Instant Message. */
16.58 - PURPLE_CONV_TYPE_CHAT, /**< Chat room. */
16.59 - PURPLE_CONV_TYPE_MISC, /**< A misc. conversation. */
16.60 - PURPLE_CONV_TYPE_ANY /**< Any type of conversation. */
16.61 -
16.62 -} PurpleConversationType;
16.63 -
16.64 -/**
16.65 - * Conversation update type.
16.66 - */
16.67 -typedef enum
16.68 -{
16.69 - PURPLE_CONV_UPDATE_ADD = 0, /**< The buddy associated with the conversation
16.70 - was added. */
16.71 - PURPLE_CONV_UPDATE_REMOVE, /**< The buddy associated with the conversation
16.72 - was removed. */
16.73 - PURPLE_CONV_UPDATE_ACCOUNT, /**< The purple_account was changed. */
16.74 - PURPLE_CONV_UPDATE_TYPING, /**< The typing state was updated. */
16.75 - PURPLE_CONV_UPDATE_UNSEEN, /**< The unseen state was updated. */
16.76 - PURPLE_CONV_UPDATE_LOGGING, /**< Logging for this conversation was
16.77 - enabled or disabled. */
16.78 - PURPLE_CONV_UPDATE_TOPIC, /**< The topic for a chat was updated. */
16.79 - /*
16.80 - * XXX These need to go when we implement a more generic core/UI event
16.81 - * system.
16.82 - */
16.83 - PURPLE_CONV_ACCOUNT_ONLINE, /**< One of the user's accounts went online. */
16.84 - PURPLE_CONV_ACCOUNT_OFFLINE, /**< One of the user's accounts went offline. */
16.85 - PURPLE_CONV_UPDATE_AWAY, /**< The other user went away. */
16.86 - PURPLE_CONV_UPDATE_ICON, /**< The other user's buddy icon changed. */
16.87 - PURPLE_CONV_UPDATE_TITLE,
16.88 - PURPLE_CONV_UPDATE_CHATLEFT,
16.89 -
16.90 - PURPLE_CONV_UPDATE_FEATURES /**< The features for a chat have changed */
16.91 -
16.92 -} PurpleConvUpdateType;
16.93 -
16.94 -/**
16.95 - * The typing state of a user.
16.96 - */
16.97 -typedef enum
16.98 -{
16.99 - PURPLE_NOT_TYPING = 0, /**< Not typing. */
16.100 - PURPLE_TYPING, /**< Currently typing. */
16.101 - PURPLE_TYPED /**< Stopped typing momentarily. */
16.102 -
16.103 -} PurpleTypingState;
16.104 -
16.105 -/**
16.106 - * Flags applicable to a message. Most will have send, recv or system.
16.107 - */
16.108 -typedef enum
16.109 -{
16.110 - PURPLE_MESSAGE_SEND = 0x0001, /**< Outgoing message. */
16.111 - PURPLE_MESSAGE_RECV = 0x0002, /**< Incoming message. */
16.112 - PURPLE_MESSAGE_SYSTEM = 0x0004, /**< System message. */
16.113 - PURPLE_MESSAGE_AUTO_RESP = 0x0008, /**< Auto response. */
16.114 - PURPLE_MESSAGE_ACTIVE_ONLY = 0x0010, /**< Hint to the UI that this
16.115 - message should not be
16.116 - shown in conversations
16.117 - which are only open for
16.118 - internal UI purposes
16.119 - (e.g. for contact-aware
16.120 - conversations). */
16.121 - PURPLE_MESSAGE_NICK = 0x0020, /**< Contains your nick. */
16.122 - PURPLE_MESSAGE_NO_LOG = 0x0040, /**< Do not log. */
16.123 - PURPLE_MESSAGE_WHISPER = 0x0080, /**< Whispered message. */
16.124 - PURPLE_MESSAGE_ERROR = 0x0200, /**< Error message. */
16.125 - PURPLE_MESSAGE_DELAYED = 0x0400, /**< Delayed message. */
16.126 - PURPLE_MESSAGE_RAW = 0x0800, /**< "Raw" message - don't
16.127 - apply formatting */
16.128 - PURPLE_MESSAGE_IMAGES = 0x1000, /**< Message contains images */
16.129 - PURPLE_MESSAGE_NOTIFY = 0x2000, /**< Message is a notification */
16.130 - PURPLE_MESSAGE_NO_LINKIFY = 0x4000, /**< Message should not be auto-
16.131 - linkified @since 2.1.0 */
16.132 - PURPLE_MESSAGE_INVISIBLE = 0x8000 /**< Message should not be displayed */
16.133 -} PurpleMessageFlags;
16.134 -
16.135 -/**
16.136 - * Flags applicable to users in Chats.
16.137 - */
16.138 -typedef enum
16.139 -{
16.140 - PURPLE_CBFLAGS_NONE = 0x0000, /**< No flags */
16.141 - PURPLE_CBFLAGS_VOICE = 0x0001, /**< Voiced user or "Participant" */
16.142 - PURPLE_CBFLAGS_HALFOP = 0x0002, /**< Half-op */
16.143 - PURPLE_CBFLAGS_OP = 0x0004, /**< Channel Op or Moderator */
16.144 - PURPLE_CBFLAGS_FOUNDER = 0x0008, /**< Channel Founder */
16.145 - PURPLE_CBFLAGS_TYPING = 0x0010 /**< Currently typing */
16.146 -
16.147 -} PurpleConvChatBuddyFlags;
16.148 -
16.149 -#include "account.h"
16.150 -#include "buddyicon.h"
16.151 -#include "log.h"
16.152 -#include "server.h"
16.153 -
16.154 -/**
16.155 - * Conversation operations and events.
16.156 - *
16.157 - * Any UI representing a conversation must assign a filled-out
16.158 - * PurpleConversationUiOps structure to the PurpleConversation.
16.159 - */
16.160 -struct _PurpleConversationUiOps
16.161 -{
16.162 - /** Called when @a conv is created (but before the @ref
16.163 - * conversation-created signal is emitted).
16.164 - */
16.165 - void (*create_conversation)(PurpleConversation *conv);
16.166 -
16.167 - /** Called just before @a conv is freed. */
16.168 - void (*destroy_conversation)(PurpleConversation *conv);
16.169 - /** Write a message to a chat. If this field is @c NULL, libpurple will
16.170 - * fall back to using #write_conv.
16.171 - * @see purple_conv_chat_write()
16.172 - */
16.173 - void (*write_chat)(PurpleConversation *conv, const char *who,
16.174 - const char *message, PurpleMessageFlags flags,
16.175 - time_t mtime);
16.176 - /** Write a message to an IM conversation. If this field is @c NULL,
16.177 - * libpurple will fall back to using #write_conv.
16.178 - * @see purple_conv_im_write()
16.179 - */
16.180 - void (*write_im)(PurpleConversation *conv, const char *who,
16.181 - const char *message, PurpleMessageFlags flags,
16.182 - time_t mtime);
16.183 - /** Write a message to a conversation. This is used rather than the
16.184 - * chat- or im-specific ops for errors, system messages (such as "x is
16.185 - * now know as y"), and as the fallback if #write_im and #write_chat
16.186 - * are not implemented. It should be implemented, or the UI will miss
16.187 - * conversation error messages and your users will hate you.
16.188 - *
16.189 - * @see purple_conversation_write()
16.190 - */
16.191 - void (*write_conv)(PurpleConversation *conv,
16.192 - const char *name,
16.193 - const char *alias,
16.194 - const char *message,
16.195 - PurpleMessageFlags flags,
16.196 - time_t mtime);
16.197 -
16.198 - /** Add @a cbuddies to a chat.
16.199 - * @param cbuddies A @c GList of #PurpleConvChatBuddy structs.
16.200 - * @param new_arrivals Whether join notices should be shown.
16.201 - * (Join notices are actually written to the
16.202 - * conversation by #purple_conv_chat_add_users().)
16.203 - */
16.204 - void (*chat_add_users)(PurpleConversation *conv,
16.205 - GList *cbuddies,
16.206 - gboolean new_arrivals);
16.207 - /** Rename the user in this chat named @a old_name to @a new_name. (The
16.208 - * rename message is written to the conversation by libpurple.)
16.209 - * @param new_alias @a new_name's new alias, if they have one.
16.210 - * @see purple_conv_chat_add_users()
16.211 - */
16.212 - void (*chat_rename_user)(PurpleConversation *conv, const char *old_name,
16.213 - const char *new_name, const char *new_alias);
16.214 - /** Remove @a users from a chat.
16.215 - * @param users A @c GList of <tt>const char *</tt>s.
16.216 - * @see purple_conv_chat_rename_user()
16.217 - */
16.218 - void (*chat_remove_users)(PurpleConversation *conv, GList *users);
16.219 - /** Called when a user's flags are changed.
16.220 - * @see purple_conv_chat_user_set_flags()
16.221 - */
16.222 - void (*chat_update_user)(PurpleConversation *conv, const char *user);
16.223 -
16.224 - /** Present this conversation to the user; for example, by displaying
16.225 - * the IM dialog.
16.226 - */
16.227 - void (*present)(PurpleConversation *conv);
16.228 -
16.229 - /** If this UI has a concept of focus (as in a windowing system) and
16.230 - * this conversation has the focus, return @c TRUE; otherwise, return
16.231 - * @c FALSE.
16.232 - */
16.233 - gboolean (*has_focus)(PurpleConversation *conv);
16.234 -
16.235 - /* Custom Smileys */
16.236 - gboolean (*custom_smiley_add)(PurpleConversation *conv, const char *smile, gboolean remote);
16.237 - void (*custom_smiley_write)(PurpleConversation *conv, const char *smile,
16.238 - const guchar *data, gsize size);
16.239 - void (*custom_smiley_close)(PurpleConversation *conv, const char *smile);
16.240 -
16.241 - /** Prompt the user for confirmation to send @a message. This function
16.242 - * should arrange for the message to be sent if the user accepts. If
16.243 - * this field is @c NULL, libpurple will fall back to using
16.244 - * #purple_request_action().
16.245 - */
16.246 - void (*send_confirm)(PurpleConversation *conv, const char *message);
16.247 -
16.248 - void (*_purple_reserved1)(void);
16.249 - void (*_purple_reserved2)(void);
16.250 - void (*_purple_reserved3)(void);
16.251 - void (*_purple_reserved4)(void);
16.252 -};
16.253 -
16.254 -/**
16.255 - * Data specific to Instant Messages.
16.256 - */
16.257 -struct _PurpleConvIm
16.258 -{
16.259 - PurpleConversation *conv; /**< The parent conversation. */
16.260 -
16.261 - PurpleTypingState typing_state; /**< The current typing state. */
16.262 - guint typing_timeout; /**< The typing timer handle. */
16.263 - time_t type_again; /**< The type again time. */
16.264 - guint send_typed_timeout; /**< The type again timer handle. */
16.265 -
16.266 - PurpleBuddyIcon *icon; /**< The buddy icon. */
16.267 -};
16.268 -
16.269 -/**
16.270 - * Data specific to Chats.
16.271 - */
16.272 -struct _PurpleConvChat
16.273 -{
16.274 - PurpleConversation *conv; /**< The parent conversation. */
16.275 -
16.276 - GList *in_room; /**< The users in the room. */
16.277 - GList *ignored; /**< Ignored users. */
16.278 - char *who; /**< The person who set the topic. */
16.279 - char *topic; /**< The topic. */
16.280 - int id; /**< The chat ID. */
16.281 - char *nick; /**< Your nick in this chat. */
16.282 -
16.283 - gboolean left; /**< We left the chat and kept the window open */
16.284 -};
16.285 -
16.286 -/**
16.287 - * Data for "Chat Buddies"
16.288 - */
16.289 -struct _PurpleConvChatBuddy
16.290 -{
16.291 - char *name; /**< The chat participant's name in the chat. */
16.292 - char *alias; /**< The chat participant's alias, if known;
16.293 - * @a NULL otherwise.
16.294 - */
16.295 - char *alias_key; /**< A string by which this buddy will be sorted,
16.296 - * or @c NULL if the buddy should be sorted by
16.297 - * its @c name. (This is currently always @c
16.298 - * NULL.)
16.299 - */
16.300 - gboolean buddy; /**< @a TRUE if this chat participant is on the
16.301 - * buddy list; @a FALSE otherwise.
16.302 - */
16.303 - PurpleConvChatBuddyFlags flags; /**< A bitwise OR of flags for this participant,
16.304 - * such as whether they are a channel operator.
16.305 - */
16.306 -};
16.307 -
16.308 -/**
16.309 - * Description of a conversation message
16.310 - *
16.311 - * @since 2.2.0
16.312 - */
16.313 -struct _PurpleConvMessage
16.314 -{
16.315 - char *who;
16.316 - char *what;
16.317 - PurpleMessageFlags flags;
16.318 - time_t when;
16.319 - PurpleConversation *conv; /**< @since 2.3.0 */
16.320 - char *alias; /**< @since 2.3.0 */
16.321 -};
16.322 -
16.323 -/**
16.324 - * A core representation of a conversation between two or more people.
16.325 - *
16.326 - * The conversation can be an IM or a chat.
16.327 - */
16.328 -struct _PurpleConversation
16.329 -{
16.330 - PurpleConversationType type; /**< The type of conversation. */
16.331 -
16.332 - PurpleAccount *account; /**< The user using this conversation. */
16.333 -
16.334 -
16.335 - char *name; /**< The name of the conversation. */
16.336 - char *title; /**< The window title. */
16.337 -
16.338 - gboolean logging; /**< The status of logging. */
16.339 -
16.340 - GList *logs; /**< This conversation's logs */
16.341 -
16.342 - union
16.343 - {
16.344 - PurpleConvIm *im; /**< IM-specific data. */
16.345 - PurpleConvChat *chat; /**< Chat-specific data. */
16.346 - void *misc; /**< Misc. data. */
16.347 -
16.348 - } u;
16.349 -
16.350 - PurpleConversationUiOps *ui_ops; /**< UI-specific operations. */
16.351 - void *ui_data; /**< UI-specific data. */
16.352 -
16.353 - GHashTable *data; /**< Plugin-specific data. */
16.354 -
16.355 - PurpleConnectionFlags features; /**< The supported features */
16.356 - GList *message_history; /**< Message history, as a GList of PurpleConvMessage's */
16.357 -};
16.358 -
16.359 -#ifdef __cplusplus
16.360 -extern "C" {
16.361 -#endif
16.362 -
16.363 -/**************************************************************************/
16.364 -/** @name Conversation API */
16.365 -/**************************************************************************/
16.366 -/*@{*/
16.367 -
16.368 -/**
16.369 - * Creates a new conversation of the specified type.
16.370 - *
16.371 - * @param type The type of conversation.
16.372 - * @param account The account opening the conversation window on the purple
16.373 - * user's end.
16.374 - * @param name The name of the conversation.
16.375 - *
16.376 - * @return The new conversation.
16.377 - */
16.378 -PurpleConversation *purple_conversation_new(PurpleConversationType type,
16.379 - PurpleAccount *account,
16.380 - const char *name);
16.381 -
16.382 -/**
16.383 - * Destroys the specified conversation and removes it from the parent
16.384 - * window.
16.385 - *
16.386 - * If this conversation is the only one contained in the parent window,
16.387 - * that window is also destroyed.
16.388 - *
16.389 - * @param conv The conversation to destroy.
16.390 - */
16.391 -void purple_conversation_destroy(PurpleConversation *conv);
16.392 -
16.393 -
16.394 -/**
16.395 - * Present a conversation to the user. This allows core code to initiate a
16.396 - * conversation by displaying the IM dialog.
16.397 - * @param conv The conversation to present
16.398 - */
16.399 -void purple_conversation_present(PurpleConversation *conv);
16.400 -
16.401 -
16.402 -/**
16.403 - * Returns the specified conversation's type.
16.404 - *
16.405 - * @param conv The conversation.
16.406 - *
16.407 - * @return The conversation's type.
16.408 - */
16.409 -PurpleConversationType purple_conversation_get_type(const PurpleConversation *conv);
16.410 -
16.411 -/**
16.412 - * Sets the specified conversation's UI operations structure.
16.413 - *
16.414 - * @param conv The conversation.
16.415 - * @param ops The UI conversation operations structure.
16.416 - */
16.417 -void purple_conversation_set_ui_ops(PurpleConversation *conv,
16.418 - PurpleConversationUiOps *ops);
16.419 -
16.420 -/**
16.421 - * Sets the default conversation UI operations structure.
16.422 - *
16.423 - * @param ops The UI conversation operations structure.
16.424 - */
16.425 -void purple_conversations_set_ui_ops(PurpleConversationUiOps *ops);
16.426 -
16.427 -/**
16.428 - * Returns the specified conversation's UI operations structure.
16.429 - *
16.430 - * @param conv The conversation.
16.431 - *
16.432 - * @return The operations structure.
16.433 - */
16.434 -PurpleConversationUiOps *purple_conversation_get_ui_ops(
16.435 - const PurpleConversation *conv);
16.436 -
16.437 -/**
16.438 - * Sets the specified conversation's purple_account.
16.439 - *
16.440 - * This purple_account represents the user using purple, not the person the user
16.441 - * is having a conversation/chat/flame with.
16.442 - *
16.443 - * @param conv The conversation.
16.444 - * @param account The purple_account.
16.445 - */
16.446 -void purple_conversation_set_account(PurpleConversation *conv,
16.447 - PurpleAccount *account);
16.448 -
16.449 -/**
16.450 - * Returns the specified conversation's purple_account.
16.451 - *
16.452 - * This purple_account represents the user using purple, not the person the user
16.453 - * is having a conversation/chat/flame with.
16.454 - *
16.455 - * @param conv The conversation.
16.456 - *
16.457 - * @return The conversation's purple_account.
16.458 - */
16.459 -PurpleAccount *purple_conversation_get_account(const PurpleConversation *conv);
16.460 -
16.461 -/**
16.462 - * Returns the specified conversation's purple_connection.
16.463 - *
16.464 - * This is the same as purple_conversation_get_user(conv)->gc.
16.465 - *
16.466 - * @param conv The conversation.
16.467 - *
16.468 - * @return The conversation's purple_connection.
16.469 - */
16.470 -PurpleConnection *purple_conversation_get_gc(const PurpleConversation *conv);
16.471 -
16.472 -/**
16.473 - * Sets the specified conversation's title.
16.474 - *
16.475 - * @param conv The conversation.
16.476 - * @param title The title.
16.477 - */
16.478 -void purple_conversation_set_title(PurpleConversation *conv, const char *title);
16.479 -
16.480 -/**
16.481 - * Returns the specified conversation's title.
16.482 - *
16.483 - * @param conv The conversation.
16.484 - *
16.485 - * @return The title.
16.486 - */
16.487 -const char *purple_conversation_get_title(const PurpleConversation *conv);
16.488 -
16.489 -/**
16.490 - * Automatically sets the specified conversation's title.
16.491 - *
16.492 - * This function takes OPT_IM_ALIAS_TAB into account, as well as the
16.493 - * user's alias.
16.494 - *
16.495 - * @param conv The conversation.
16.496 - */
16.497 -void purple_conversation_autoset_title(PurpleConversation *conv);
16.498 -
16.499 -/**
16.500 - * Sets the specified conversation's name.
16.501 - *
16.502 - * @param conv The conversation.
16.503 - * @param name The conversation's name.
16.504 - */
16.505 -void purple_conversation_set_name(PurpleConversation *conv, const char *name);
16.506 -
16.507 -/**
16.508 - * Returns the specified conversation's name.
16.509 - *
16.510 - * @param conv The conversation.
16.511 - *
16.512 - * @return The conversation's name. If the conversation is an IM with a PurpleBuddy,
16.513 - * then it's the name of the PurpleBuddy.
16.514 - */
16.515 -const char *purple_conversation_get_name(const PurpleConversation *conv);
16.516 -
16.517 -/**
16.518 - * Enables or disables logging for this conversation.
16.519 - *
16.520 - * @param conv The conversation.
16.521 - * @param log @c TRUE if logging should be enabled, or @c FALSE otherwise.
16.522 - */
16.523 -void purple_conversation_set_logging(PurpleConversation *conv, gboolean log);
16.524 -
16.525 -/**
16.526 - * Returns whether or not logging is enabled for this conversation.
16.527 - *
16.528 - * @param conv The conversation.
16.529 - *
16.530 - * @return @c TRUE if logging is enabled, or @c FALSE otherwise.
16.531 - */
16.532 -gboolean purple_conversation_is_logging(const PurpleConversation *conv);
16.533 -
16.534 -/**
16.535 - * Closes any open logs for this conversation.
16.536 - *
16.537 - * Note that new logs will be opened as necessary (e.g. upon receipt of a
16.538 - * message, if the conversation has logging enabled. To disable logging for
16.539 - * the remainder of the conversation, use purple_conversation_set_logging().
16.540 - *
16.541 - * @param conv The conversation.
16.542 - */
16.543 -void purple_conversation_close_logs(PurpleConversation *conv);
16.544 -
16.545 -/**
16.546 - * Returns the specified conversation's IM-specific data.
16.547 - *
16.548 - * If the conversation type is not PURPLE_CONV_TYPE_IM, this will return @c NULL.
16.549 - *
16.550 - * @param conv The conversation.
16.551 - *
16.552 - * @return The IM-specific data.
16.553 - */
16.554 -PurpleConvIm *purple_conversation_get_im_data(const PurpleConversation *conv);
16.555 -
16.556 -#define PURPLE_CONV_IM(c) (purple_conversation_get_im_data(c))
16.557 -
16.558 -/**
16.559 - * Returns the specified conversation's chat-specific data.
16.560 - *
16.561 - * If the conversation type is not PURPLE_CONV_TYPE_CHAT, this will return @c NULL.
16.562 - *
16.563 - * @param conv The conversation.
16.564 - *
16.565 - * @return The chat-specific data.
16.566 - */
16.567 -PurpleConvChat *purple_conversation_get_chat_data(const PurpleConversation *conv);
16.568 -
16.569 -#define PURPLE_CONV_CHAT(c) (purple_conversation_get_chat_data(c))
16.570 -
16.571 -/**
16.572 - * Sets extra data for a conversation.
16.573 - *
16.574 - * @param conv The conversation.
16.575 - * @param key The unique key.
16.576 - * @param data The data to assign.
16.577 - */
16.578 -void purple_conversation_set_data(PurpleConversation *conv, const char *key,
16.579 - gpointer data);
16.580 -
16.581 -/**
16.582 - * Returns extra data in a conversation.
16.583 - *
16.584 - * @param conv The conversation.
16.585 - * @param key The unqiue key.
16.586 - *
16.587 - * @return The data associated with the key.
16.588 - */
16.589 -gpointer purple_conversation_get_data(PurpleConversation *conv, const char *key);
16.590 -
16.591 -/**
16.592 - * Returns a list of all conversations.
16.593 - *
16.594 - * This list includes both IMs and chats.
16.595 - *
16.596 - * @constreturn A GList of all conversations.
16.597 - */
16.598 -GList *purple_get_conversations(void);
16.599 -
16.600 -/**
16.601 - * Returns a list of all IMs.
16.602 - *
16.603 - * @constreturn A GList of all IMs.
16.604 - */
16.605 -GList *purple_get_ims(void);
16.606 -
16.607 -/**
16.608 - * Returns a list of all chats.
16.609 - *
16.610 - * @constreturn A GList of all chats.
16.611 - */
16.612 -GList *purple_get_chats(void);
16.613 -
16.614 -/**
16.615 - * Finds a conversation with the specified type, name, and Purple account.
16.616 - *
16.617 - * @param type The type of the conversation.
16.618 - * @param name The name of the conversation.
16.619 - * @param account The purple_account associated with the conversation.
16.620 - *
16.621 - * @return The conversation if found, or @c NULL otherwise.
16.622 - */
16.623 -PurpleConversation *purple_find_conversation_with_account(
16.624 - PurpleConversationType type, const char *name,
16.625 - const PurpleAccount *account);
16.626 -
16.627 -/**
16.628 - * Writes to a conversation window.
16.629 - *
16.630 - * This function should not be used to write IM or chat messages. Use
16.631 - * purple_conv_im_write() and purple_conv_chat_write() instead. Those functions will
16.632 - * most likely call this anyway, but they may do their own formatting,
16.633 - * sound playback, etc.
16.634 - *
16.635 - * This can be used to write generic messages, such as "so and so closed
16.636 - * the conversation window."
16.637 - *
16.638 - * @param conv The conversation.
16.639 - * @param who The user who sent the message.
16.640 - * @param message The message.
16.641 - * @param flags The message flags.
16.642 - * @param mtime The time the message was sent.
16.643 - *
16.644 - * @see purple_conv_im_write()
16.645 - * @see purple_conv_chat_write()
16.646 - */
16.647 -void purple_conversation_write(PurpleConversation *conv, const char *who,
16.648 - const char *message, PurpleMessageFlags flags,
16.649 - time_t mtime);
16.650 -
16.651 -
16.652 -/**
16.653 - Set the features as supported for the given conversation.
16.654 - @param conv The conversation
16.655 - @param features Bitset defining supported features
16.656 -*/
16.657 -void purple_conversation_set_features(PurpleConversation *conv,
16.658 - PurpleConnectionFlags features);
16.659 -
16.660 -
16.661 -/**
16.662 - Get the features supported by the given conversation.
16.663 - @param conv The conversation
16.664 -*/
16.665 -PurpleConnectionFlags purple_conversation_get_features(PurpleConversation *conv);
16.666 -
16.667 -/**
16.668 - * Determines if a conversation has focus
16.669 - *
16.670 - * @param conv The conversation.
16.671 - *
16.672 - * @return @c TRUE if the conversation has focus, @c FALSE if
16.673 - * it does not or the UI does not have a concept of conversation focus
16.674 - */
16.675 -gboolean purple_conversation_has_focus(PurpleConversation *conv);
16.676 -
16.677 -/**
16.678 - * Updates the visual status and UI of a conversation.
16.679 - *
16.680 - * @param conv The conversation.
16.681 - * @param type The update type.
16.682 - */
16.683 -void purple_conversation_update(PurpleConversation *conv, PurpleConvUpdateType type);
16.684 -
16.685 -/**
16.686 - * Calls a function on each conversation.
16.687 - *
16.688 - * @param func The function.
16.689 - */
16.690 -void purple_conversation_foreach(void (*func)(PurpleConversation *conv));
16.691 -
16.692 -/**
16.693 - * Retrieve the message history of a conversation.
16.694 - *
16.695 - * @param conv The conversation
16.696 - *
16.697 - * @return A GList of PurpleConvMessage's. The must not modify the list or the data within.
16.698 - * The list contains the newest message at the beginning, and the oldest message at
16.699 - * the end.
16.700 - *
16.701 - * @since 2.2.0
16.702 - */
16.703 -GList *purple_conversation_get_message_history(PurpleConversation *conv);
16.704 -
16.705 -/**
16.706 - * Clear the message history of a conversation.
16.707 - *
16.708 - * @param conv The conversation
16.709 - *
16.710 - * @since 2.2.0
16.711 - */
16.712 -void purple_conversation_clear_message_history(PurpleConversation *conv);
16.713 -
16.714 -/**
16.715 - * Get the sender from a PurpleConvMessage
16.716 - *
16.717 - * @param msg A PurpleConvMessage
16.718 - *
16.719 - * @return The name of the sender of the message
16.720 - *
16.721 - * @since 2.2.0
16.722 - */
16.723 -const char *purple_conversation_message_get_sender(PurpleConvMessage *msg);
16.724 -
16.725 -/**
16.726 - * Get the message from a PurpleConvMessage
16.727 - *
16.728 - * @param msg A PurpleConvMessage
16.729 - *
16.730 - * @return The name of the sender of the message
16.731 - *
16.732 - * @since 2.2.0
16.733 - */
16.734 -const char *purple_conversation_message_get_message(PurpleConvMessage *msg);
16.735 -
16.736 -/**
16.737 - * Get the message-flags of a PurpleConvMessage
16.738 - *
16.739 - * @param msg A PurpleConvMessage
16.740 - *
16.741 - * @return The message flags
16.742 - *
16.743 - * @since 2.2.0
16.744 - */
16.745 -PurpleMessageFlags purple_conversation_message_get_flags(PurpleConvMessage *msg);
16.746 -
16.747 -/**
16.748 - * Get the timestamp of a PurpleConvMessage
16.749 - *
16.750 - * @param msg A PurpleConvMessage
16.751 - *
16.752 - * @return The timestamp of the message
16.753 - *
16.754 - * @since 2.2.0
16.755 - */
16.756 -time_t purple_conversation_message_get_timestamp(PurpleConvMessage *msg);
16.757 -
16.758 -/*@}*/
16.759 -
16.760 -
16.761 -/**************************************************************************/
16.762 -/** @name IM Conversation API */
16.763 -/**************************************************************************/
16.764 -/*@{*/
16.765 -
16.766 -/**
16.767 - * Gets an IM's parent conversation.
16.768 - *
16.769 - * @param im The IM.
16.770 - *
16.771 - * @return The parent conversation.
16.772 - */
16.773 -PurpleConversation *purple_conv_im_get_conversation(const PurpleConvIm *im);
16.774 -
16.775 -/**
16.776 - * Sets the IM's buddy icon.
16.777 - *
16.778 - * This should only be called from within Purple. You probably want to
16.779 - * call purple_buddy_icon_set_data().
16.780 - *
16.781 - * @param im The IM.
16.782 - * @param icon The buddy icon.
16.783 - *
16.784 - * @see purple_buddy_icon_set_data()
16.785 - */
16.786 -void purple_conv_im_set_icon(PurpleConvIm *im, PurpleBuddyIcon *icon);
16.787 -
16.788 -/**
16.789 - * Returns the IM's buddy icon.
16.790 - *
16.791 - * @param im The IM.
16.792 - *
16.793 - * @return The buddy icon.
16.794 - */
16.795 -PurpleBuddyIcon *purple_conv_im_get_icon(const PurpleConvIm *im);
16.796 -
16.797 -/**
16.798 - * Sets the IM's typing state.
16.799 - *
16.800 - * @param im The IM.
16.801 - * @param state The typing state.
16.802 - */
16.803 -void purple_conv_im_set_typing_state(PurpleConvIm *im, PurpleTypingState state);
16.804 -
16.805 -/**
16.806 - * Returns the IM's typing state.
16.807 - *
16.808 - * @param im The IM.
16.809 - *
16.810 - * @return The IM's typing state.
16.811 - */
16.812 -PurpleTypingState purple_conv_im_get_typing_state(const PurpleConvIm *im);
16.813 -
16.814 -/**
16.815 - * Starts the IM's typing timeout.
16.816 - *
16.817 - * @param im The IM.
16.818 - * @param timeout The timeout.
16.819 - */
16.820 -void purple_conv_im_start_typing_timeout(PurpleConvIm *im, int timeout);
16.821 -
16.822 -/**
16.823 - * Stops the IM's typing timeout.
16.824 - *
16.825 - * @param im The IM.
16.826 - */
16.827 -void purple_conv_im_stop_typing_timeout(PurpleConvIm *im);
16.828 -
16.829 -/**
16.830 - * Returns the IM's typing timeout.
16.831 - *
16.832 - * @param im The IM.
16.833 - *
16.834 - * @return The timeout.
16.835 - */
16.836 -guint purple_conv_im_get_typing_timeout(const PurpleConvIm *im);
16.837 -
16.838 -/**
16.839 - * Sets the quiet-time when no PURPLE_TYPING messages will be sent.
16.840 - * Few protocols need this (maybe only MSN). If the user is still
16.841 - * typing after this quiet-period, then another PURPLE_TYPING message
16.842 - * will be sent.
16.843 - *
16.844 - * @param im The IM.
16.845 - * @param val The number of seconds to wait before allowing another
16.846 - * PURPLE_TYPING message to be sent to the user. Or 0 to
16.847 - * not send another PURPLE_TYPING message.
16.848 - */
16.849 -void purple_conv_im_set_type_again(PurpleConvIm *im, unsigned int val);
16.850 -
16.851 -/**
16.852 - * Returns the time after which another PURPLE_TYPING message should be sent.
16.853 - *
16.854 - * @param im The IM.
16.855 - *
16.856 - * @return The time in seconds since the epoch. Or 0 if no additional
16.857 - * PURPLE_TYPING message should be sent.
16.858 - */
16.859 -time_t purple_conv_im_get_type_again(const PurpleConvIm *im);
16.860 -
16.861 -/**
16.862 - * Starts the IM's type again timeout.
16.863 - *
16.864 - * @param im The IM.
16.865 - */
16.866 -void purple_conv_im_start_send_typed_timeout(PurpleConvIm *im);
16.867 -
16.868 -/**
16.869 - * Stops the IM's type again timeout.
16.870 - *
16.871 - * @param im The IM.
16.872 - */
16.873 -void purple_conv_im_stop_send_typed_timeout(PurpleConvIm *im);
16.874 -
16.875 -/**
16.876 - * Returns the IM's type again timeout interval.
16.877 - *
16.878 - * @param im The IM.
16.879 - *
16.880 - * @return The type again timeout interval.
16.881 - */
16.882 -guint purple_conv_im_get_send_typed_timeout(const PurpleConvIm *im);
16.883 -
16.884 -/**
16.885 - * Updates the visual typing notification for an IM conversation.
16.886 - *
16.887 - * @param im The IM.
16.888 - */
16.889 -void purple_conv_im_update_typing(PurpleConvIm *im);
16.890 -
16.891 -/**
16.892 - * Writes to an IM.
16.893 - *
16.894 - * @param im The IM.
16.895 - * @param who The user who sent the message.
16.896 - * @param message The message to write.
16.897 - * @param flags The message flags.
16.898 - * @param mtime The time the message was sent.
16.899 - */
16.900 -void purple_conv_im_write(PurpleConvIm *im, const char *who,
16.901 - const char *message, PurpleMessageFlags flags,
16.902 - time_t mtime);
16.903 -
16.904 -/**
16.905 - * Presents an IM-error to the user
16.906 - *
16.907 - * This is a helper function to find a conversation, write an error to it, and
16.908 - * raise the window. If a conversation with this user doesn't already exist,
16.909 - * the function will return FALSE and the calling function can attempt to present
16.910 - * the error another way (purple_notify_error, most likely)
16.911 - *
16.912 - * @param who The user this error is about
16.913 - * @param account The account this error is on
16.914 - * @param what The error
16.915 - * @return TRUE if the error was presented, else FALSE
16.916 - */
16.917 -gboolean purple_conv_present_error(const char *who, PurpleAccount *account, const char *what);
16.918 -
16.919 -/**
16.920 - * Sends a message to this IM conversation.
16.921 - *
16.922 - * @param im The IM.
16.923 - * @param message The message to send.
16.924 - */
16.925 -void purple_conv_im_send(PurpleConvIm *im, const char *message);
16.926 -
16.927 -/**
16.928 - * Sends a message to a conversation after confirming with
16.929 - * the user.
16.930 - *
16.931 - * This function is intended for use in cases where the user
16.932 - * hasn't explicitly and knowingly caused a message to be sent.
16.933 - * The confirmation ensures that the user isn't sending a
16.934 - * message by mistake.
16.935 - *
16.936 - * @param conv The conversation.
16.937 - * @param message The message to send.
16.938 - */
16.939 -void purple_conv_send_confirm(PurpleConversation *conv, const char *message);
16.940 -
16.941 -/**
16.942 - * Sends a message to this IM conversation with specified flags.
16.943 - *
16.944 - * @param im The IM.
16.945 - * @param message The message to send.
16.946 - * @param flags The PurpleMessageFlags flags to use in addition to PURPLE_MESSAGE_SEND.
16.947 - */
16.948 -void purple_conv_im_send_with_flags(PurpleConvIm *im, const char *message, PurpleMessageFlags flags);
16.949 -
16.950 -/**
16.951 - * Adds a smiley to the conversation's smiley tree. If this returns
16.952 - * @c TRUE you should call purple_conv_custom_smiley_write() one or more
16.953 - * times, and then purple_conv_custom_smiley_close(). If this returns
16.954 - * @c FALSE, either the conv or smile were invalid, or the icon was
16.955 - * found in the cache. In either case, calling write or close would
16.956 - * be an error.
16.957 - *
16.958 - * @param conv The conversation to associate the smiley with.
16.959 - * @param smile The text associated with the smiley
16.960 - * @param cksum_type The type of checksum.
16.961 - * @param chksum The checksum, as a NUL terminated base64 string.
16.962 - * @param remote @c TRUE if the custom smiley is set by the remote user (buddy).
16.963 - * @return @c TRUE if an icon is expected, else FALSE. Note that
16.964 - * it is an error to never call purple_conv_custom_smiley_close if
16.965 - * this function returns @c TRUE, but an error to call it if
16.966 - * @c FALSE is returned.
16.967 - */
16.968 -
16.969 -gboolean purple_conv_custom_smiley_add(PurpleConversation *conv, const char *smile,
16.970 - const char *cksum_type, const char *chksum,
16.971 - gboolean remote);
16.972 -
16.973 -
16.974 -/**
16.975 - * Updates the image associated with the current smiley.
16.976 - *
16.977 - * @param conv The conversation associated with the smiley.
16.978 - * @param smile The text associated with the smiley.
16.979 - * @param data The actual image data.
16.980 - * @param size The length of the data.
16.981 - */
16.982 -
16.983 -void purple_conv_custom_smiley_write(PurpleConversation *conv,
16.984 - const char *smile,
16.985 - const guchar *data,
16.986 - gsize size);
16.987 -
16.988 -/**
16.989 - * Close the custom smiley, all data has been written with
16.990 - * purple_conv_custom_smiley_write, and it is no longer valid
16.991 - * to call that function on that smiley.
16.992 - *
16.993 - * @param conv The purple conversation associated with the smiley.
16.994 - * @param smile The text associated with the smiley
16.995 - */
16.996 -
16.997 -void purple_conv_custom_smiley_close(PurpleConversation *conv, const char *smile);
16.998 -
16.999 -/*@}*/
16.1000 -
16.1001 -
16.1002 -/**************************************************************************/
16.1003 -/** @name Chat Conversation API */
16.1004 -/**************************************************************************/
16.1005 -/*@{*/
16.1006 -
16.1007 -/**
16.1008 - * Gets a chat's parent conversation.
16.100