27#ifndef _PURPLE_ACCOUNT_H_
28#define _PURPLE_ACCOUNT_H_
31#include <glib-object.h>
40typedef gboolean (*PurpleFilterAccountFunc)(
PurpleAccount *account);
41typedef void (*PurpleAccountRequestAuthorizationCb)(
void *);
42typedef void (*PurpleAccountRegistrationCb)(
PurpleAccount *account, gboolean succeeded,
void *user_data);
43typedef void (*PurpleAccountUnregistrationCb)(
PurpleAccount *account, gboolean succeeded,
void *user_data);
44typedef void (*PurpleSetPublicAliasSuccessCallback)(
PurpleAccount *account,
const char *new_alias);
45typedef void (*PurpleSetPublicAliasFailureCallback)(
PurpleAccount *account,
const char *error);
46typedef void (*PurpleGetPublicAliasSuccessCallback)(
PurpleAccount *account,
const char *
alias);
47typedef void (*PurpleGetPublicAliasFailureCallback)(
PurpleAccount *account,
const char *error);
61 PURPLE_ACCOUNT_REQUEST_AUTHORIZATION = 0
69 PURPLE_ACCOUNT_RESPONSE_IGNORE = -2,
70 PURPLE_ACCOUNT_RESPONSE_DENY = -1,
71 PURPLE_ACCOUNT_RESPONSE_PASS = 0,
72 PURPLE_ACCOUNT_RESPONSE_ACCEPT = 1
84 const char *remote_user,
91 PurpleStatus *status);
95 const char *remote_user,
106 const char *remote_user,
111 PurpleAccountRequestAuthorizationCb authorize_cb,
112 PurpleAccountRequestAuthorizationCb deny_cb,
120 void (*_purple_reserved1)(void);
121 void (*_purple_reserved2)(void);
122 void (*_purple_reserved3)(void);
123 void (*_purple_reserved4)(void);
161 void (*_purple_reserved1)(void);
162 void (*_purple_reserved2)(void);
163 void (*_purple_reserved3)(void);
164 void (*_purple_reserved4)(void);
211 PurpleAccountRegistrationCb registration_cb;
212 void *registration_cb_user_data;
296 const char *
id,
const char *alias,
297 const char *message);
315 const char *
id,
const char *alias,
316 const char *message);
338 const char *
id,
const char *alias,
const char *message, gboolean on_list,
339 PurpleAccountRequestAuthorizationCb auth_cb, PurpleAccountRequestAuthorizationCb deny_cb,
void *user_data);
365 GCallback cancel_cb,
void *user_data);
429 const char *protocol_id);
499 gboolean active, ...) G_GNUC_NULL_TERMINATED;
520 const
char *status_id, gboolean active, GList *attrs);
541 const
char *alias, PurpleSetPublicAliasSuccessCallback success_cb,
542 PurpleSetPublicAliasFailureCallback failure_cb);
555 PurpleGetPublicAliasSuccessCallback success_cb,
556 PurpleGetPublicAliasFailureCallback failure_cb);
631 const
char *name,
int value);
642 const
char *name, const
char *value);
653 const
char *name, gboolean value);
842 const
char *status_id);
888 const
char *status_id);
922 const
char *default_value);
934 gboolean default_value);
947 const
char *name,
int default_value);
960 const
char *ui, const
char *name,
961 const
char *default_value);
974 const
char *name, gboolean default_value);
1079 const
char *new_pw);
const char * purple_account_get_alias(const PurpleAccount *account)
Returns the account's alias.
void purple_account_set_status_types(PurpleAccount *account, GList *status_types)
Sets the account's status types.
const char * purple_account_get_buddy_icon_path(const PurpleAccount *account)
Gets the account's buddy icon path.
void purple_account_set_user_info(PurpleAccount *account, const char *user_info)
Sets the account's user information.
void purple_account_set_proxy_info(PurpleAccount *account, PurpleProxyInfo *info)
Sets the account's proxy information.
PurplePrivacyType purple_account_get_privacy_type(const PurpleAccount *account)
Returns the account's privacy type.
PurpleLog * purple_account_get_log(PurpleAccount *account, gboolean create)
Returns the system log for an account.
void purple_account_set_status_list(PurpleAccount *account, const char *status_id, gboolean active, GList *attrs)
Activates or deactivates a status.
PurpleAccount * purple_account_new(const char *username, const char *protocol_id)
Creates a new account.
gboolean purple_account_is_status_active(const PurpleAccount *account, const char *status_id)
Returns whether or not an account status is active.
void purple_account_request_close(void *ui_handle)
Close the account request for the given ui handle.
PurpleStatusType * purple_account_get_status_type_with_primitive(const PurpleAccount *account, PurpleStatusPrimitive primitive)
Returns the account status type with the specified primitive.
PurpleProxyInfo * purple_account_get_proxy_info(const PurpleAccount *account)
Returns the account's proxy information.
void purple_account_set_buddy_icon_path(PurpleAccount *account, const char *path)
Sets the account's buddy icon path.
void purple_accounts_add(PurpleAccount *account)
Adds an account to the list of accounts.
void purple_account_set_ui_int(PurpleAccount *account, const char *ui, const char *name, int value)
Sets a UI-specific integer setting for an account.
const char * purple_account_get_user_info(const PurpleAccount *account)
Returns the account's user information.
const char * purple_account_get_protocol_id(const PurpleAccount *account)
Returns the account's protocol ID.
const char * purple_account_get_username(const PurpleAccount *account)
Returns the account's username.
void purple_account_get_public_alias(PurpleAccount *account, PurpleGetPublicAliasSuccessCallback success_cb, PurpleGetPublicAliasFailureCallback failure_cb)
Fetch the server-side (public) alias for this account.
void purple_account_set_ui_bool(PurpleAccount *account, const char *ui, const char *name, gboolean value)
Sets a UI-specific boolean setting for an account.
void purple_account_change_password(PurpleAccount *account, const char *orig_pw, const char *new_pw)
Changes the password on the specified account.
void purple_account_set_register_callback(PurpleAccount *account, PurpleAccountRegistrationCb cb, void *user_data)
Sets the callback for successful registration.
void purple_account_destroy(PurpleAccount *account)
Destroys an account.
void purple_account_set_enabled(PurpleAccount *account, const char *ui, gboolean value)
Sets whether or not this account is enabled for the specified UI.
void purple_accounts_init(void)
Initializes the accounts subsystem.
gboolean purple_account_is_connected(const PurpleAccount *account)
Returns whether or not the account is connected.
const char * purple_account_get_protocol_name(const PurpleAccount *account)
Returns the account's protocol name.
void purple_account_unregister(PurpleAccount *account, PurpleAccountUnregistrationCb cb, void *user_data)
Unregisters an account (deleting it from the server).
void purple_account_set_alias(PurpleAccount *account, const char *alias)
Sets the account's alias.
PurplePresence * purple_account_get_presence(const PurpleAccount *account)
Returns the account's presence.
void purple_account_set_privacy_type(PurpleAccount *account, PurplePrivacyType privacy_type)
Sets the account's privacy type.
void purple_accounts_remove(PurpleAccount *account)
Removes an account from the list of accounts.
void purple_account_register(PurpleAccount *account)
Registers an account.
int purple_account_get_int(const PurpleAccount *account, const char *name, int default_value)
Returns a protocol-specific integer setting for an account.
gboolean purple_account_supports_offline_message(PurpleAccount *account, PurpleBuddy *buddy)
Whether the account supports sending offline messages to buddy.
PurpleAccount * purple_accounts_find(const char *name, const char *protocol)
Finds an account with the specified name and protocol id.
void purple_account_set_connection(PurpleAccount *account, PurpleConnection *gc)
Sets the account's connection.
void purple_account_clear_settings(PurpleAccount *account)
Clears all protocol-specific settings on an account.
const PurpleConnectionErrorInfo * purple_account_get_current_error(PurpleAccount *account)
Get the error that caused the account to be disconnected, or NULL if the account is happily connected...
void purple_account_set_status(PurpleAccount *account, const char *status_id, gboolean active,...) G_GNUC_NULL_TERMINATED
Variadic version of purple_account_set_status_list(); the variadic list replaces attrs,...
PurpleStatus * purple_account_get_active_status(const PurpleAccount *account)
Returns the active status for this account.
void purple_accounts_reorder(PurpleAccount *account, gint new_index)
Reorders an account.
PurpleConnection * purple_account_get_connection(const PurpleAccount *account)
Returns the account's connection.
gboolean purple_account_get_enabled(const PurpleAccount *account, const char *ui)
Returns whether or not this account is enabled for the specified UI.
void purple_account_add_buddies_with_invite(PurpleAccount *account, GList *buddies, const char *message)
Adds a list of buddies to the server-side buddy list.
void purple_account_remove_buddy(PurpleAccount *account, PurpleBuddy *buddy, PurpleGroup *group)
Removes a buddy from the server-side buddy list.
void purple_account_connect(PurpleAccount *account)
Connects to an account.
gboolean purple_account_get_ui_bool(const PurpleAccount *account, const char *ui, const char *name, gboolean default_value)
Returns a UI-specific boolean setting for an account.
PurpleStatus * purple_account_get_status(const PurpleAccount *account, const char *status_id)
Returns the account status with the specified ID.
void purple_account_set_ui_string(PurpleAccount *account, const char *ui, const char *name, const char *value)
Sets a UI-specific string setting for an account.
const char * purple_account_get_password(const PurpleAccount *account)
Returns the account's password.
void purple_account_remove_group(PurpleAccount *account, PurpleGroup *group)
Removes a group from the server-side buddy list.
const char * purple_account_get_string(const PurpleAccount *account, const char *name, const char *default_value)
Returns a protocol-specific string setting for an account.
void purple_account_set_password(PurpleAccount *account, const char *password)
Sets the account's password.
GList * purple_account_get_status_types(const PurpleAccount *account)
Returns the account's status types.
void purple_account_set_public_alias(PurpleAccount *account, const char *alias, PurpleSetPublicAliasSuccessCallback success_cb, PurpleSetPublicAliasFailureCallback failure_cb)
Set a server-side (public) alias for this account.
void purple_account_request_close_with_account(PurpleAccount *account)
Close account requests registered for the given PurpleAccount.
GList * purple_accounts_get_all(void)
Returns a list of all accounts.
void purple_account_request_change_password(PurpleAccount *account)
Requests information from the user to change the account's password.
void purple_account_remove_buddies(PurpleAccount *account, GList *buddies, GList *groups)
Removes a list of buddies from the server-side buddy list.
void purple_account_set_bool(PurpleAccount *account, const char *name, gboolean value)
Sets a protocol-specific boolean setting for an account.
void purple_accounts_set_ui_ops(PurpleAccountUiOps *ops)
Sets the UI operations structure to be used for accounts.
const gchar * purple_account_get_name_for_display(const PurpleAccount *account)
Returns a name for this account appropriate for display to the user.
void purple_account_set_silence_suppression(PurpleAccount *account, gboolean value)
Sets whether silence suppression is used during voice call.
void purple_account_set_string(PurpleAccount *account, const char *name, const char *value)
Sets a protocol-specific string setting for an account.
const char * purple_account_get_ui_string(const PurpleAccount *account, const char *ui, const char *name, const char *default_value)
Returns a UI-specific string setting for an account.
void purple_account_set_protocol_id(PurpleAccount *account, const char *protocol_id)
Sets the account's protocol ID.
void purple_account_disconnect(PurpleAccount *account)
Disconnects from an account.
gboolean purple_account_is_disconnected(const PurpleAccount *account)
Returns whether or not the account is disconnected.
void purple_account_destroy_log(PurpleAccount *account)
Frees the system log of an account.
void purple_accounts_uninit(void)
Uninitializes the accounts subsystem.
int purple_account_get_ui_int(const PurpleAccount *account, const char *ui, const char *name, int default_value)
Returns a UI-specific integer setting for an account.
void purple_account_remove_setting(PurpleAccount *account, const char *setting)
Removes an account-specific setting by name.
void purple_account_set_username(PurpleAccount *account, const char *username)
Sets the account's username.
void purple_account_prefs_set_ui_ops(PurpleAccountPrefsUiOps *ops)
Sets the UI operations structure to be used for account preferences.
gboolean purple_account_get_silence_suppression(const PurpleAccount *account)
Return whether silence suppression is used during voice call.
PurpleAccountPrefsUiOps * purple_account_prefs_get_ui_ops(void)
Returns the UI operations structure used for account preferences.
void purple_account_add_buddy_with_invite(PurpleAccount *account, PurpleBuddy *buddy, const char *message)
Adds a buddy to the server-side buddy list for the specified account.
GList * purple_accounts_get_all_active(void)
Returns a list of all enabled accounts.
void purple_account_add_buddies(PurpleAccount *account, GList *buddies)
Adds a list of buddies to the server-side buddy list.
void purple_account_set_check_mail(PurpleAccount *account, gboolean value)
Sets whether or not this account should check for mail.
void purple_account_notify_added(PurpleAccount *account, const char *remote_user, const char *id, const char *alias, const char *message)
Notifies the user that the account was added to a remote user's buddy list.
void purple_accounts_delete(PurpleAccount *account)
Deletes an account.
PurpleAccountUiOps * purple_accounts_get_ui_ops(void)
Returns the UI operations structure used for accounts.
gboolean purple_account_is_connecting(const PurpleAccount *account)
Returns whether or not the account is connecting.
void purple_account_set_remember_password(PurpleAccount *account, gboolean value)
Sets whether or not this account should save its password.
gboolean purple_account_get_bool(const PurpleAccount *account, const char *name, gboolean default_value)
Returns a protocol-specific boolean setting for an account.
void * purple_accounts_get_handle(void)
Returns the accounts subsystem handle.
void purple_account_request_add(PurpleAccount *account, const char *remote_user, const char *id, const char *alias, const char *message)
Notifies the user that the account was addded to a remote user's buddy list and asks ther user if the...
PurpleAccountRequestResponse
Account request response types.
void purple_account_clear_current_error(PurpleAccount *account)
Clear an account's current error state, resetting it to NULL.
gboolean purple_account_get_check_mail(const PurpleAccount *account)
Returns whether or not this account should check for mail.
PurpleStatusType * purple_account_get_status_type(const PurpleAccount *account, const char *id)
Returns the account status type with the specified ID.
void purple_accounts_restore_current_statuses(void)
This is called by the core after all subsystems and what not have been initialized.
void purple_account_add_buddy(PurpleAccount *account, PurpleBuddy *buddy)
Adds a buddy to the server-side buddy list for the specified account.
void purple_account_set_int(PurpleAccount *account, const char *name, int value)
Sets a protocol-specific integer setting for an account.
void * purple_account_request_authorization(PurpleAccount *account, const char *remote_user, const char *id, const char *alias, const char *message, gboolean on_list, PurpleAccountRequestAuthorizationCb auth_cb, PurpleAccountRequestAuthorizationCb deny_cb, void *user_data)
Notifies the user that a remote user has wants to add the local user to his or her buddy list and req...
void purple_account_request_change_user_info(PurpleAccount *account)
Requests information from the user to change the account's user information.
PurpleAccountRequestType
Account request types.
void purple_account_request_password(PurpleAccount *account, GCallback ok_cb, GCallback cancel_cb, void *user_data)
Requests a password from the user for the account.
gboolean purple_account_get_remember_password(const PurpleAccount *account)
Returns whether or not this account should save its password.
enum _PurplePrivacyType PurplePrivacyType
Privacy data types.
Protocol Plugin functions.
struct _PurpleStatusType PurpleStatusType
PurpleStatusType's are created by each PRPL.
PurpleStatusPrimitive
A primitive defining the basic structure of a status type.
Holds the type of an error along with its description.
Information on proxy settings.
Account prefs UI operations, to allow the UI to catch account preference changes.
void(* set_int)(PurpleAccount *account, const char *name, int value)
Notifies the UI that an integer account setting was set.
void(* load)(void)
If this is set, accounts.xml loading will be disabled and this function will be called instead.
void(* save)(void)
If this is set, accounts.xml saving will be disabled and this function will be called instead.
void(* schedule_save)(void)
If this is set, the UI will handle scheduling the timer to call the save function,...
void(* set_bool)(PurpleAccount *account, const char *name, gboolean value)
Notifies the UI that a boolean account setting was set.
void(* set_string)(PurpleAccount *account, const char *name, const char *value)
Notifies the UI that a string account setting was set.
Account UI operations, used to notify the user of status changes and when buddies add this account to...
void(* request_add)(PurpleAccount *account, const char *remote_user, const char *id, const char *alias, const char *message)
Someone we don't have on our list added us; prompt to add them.
void(* notify_added)(PurpleAccount *account, const char *remote_user, const char *id, const char *alias, const char *message)
A buddy who is already on this account's buddy list added this account to their buddy list.
void(* status_changed)(PurpleAccount *account, PurpleStatus *status)
This account's status changed.
void(* close_account_request)(void *ui_handle)
Close a pending request for authorization.
Structure representing an account.
char * username
The username.
gpointer priv
Pointer to opaque private data.
char * user_info
User information.
gboolean remember_pass
Remember the password.
char * alias
How you appear to yourself.
PurpleProxyInfo * proxy_info
Proxy information.
PurpleLog * system_log
The system log
GList * status_types
Status types.
GHashTable * settings
Protocol-specific settings.
PurplePresence * presence
Presence.
char * buddy_icon_path
The buddy icon's non-cached path.
GSList * permit
Permit list.
PurpleConnection * gc
The connection handle.
void * ui_data
The UI can put data here.
GHashTable * ui_settings
UI-specific settings.
PurplePrivacyType perm_deny
The permit/deny setting.
char * password
The account password.
gboolean disconnecting
The account is currently disconnecting.
char * protocol_id
The ID of the protocol.