Mercurial > pidgin
comparison libpurple/account.h @ 32819:2c6510167895 default tip
propagate from branch 'im.pidgin.pidgin.2.x.y' (head 3315c5dfbd0ad16511bdcf865e5b07c02d07df24)
to branch 'im.pidgin.pidgin' (head cbd1eda6bcbf0565ae7766396bb8f6f419cb6a9a)
author | Elliott Sales de Andrade <qulogic@pidgin.im> |
---|---|
date | Sat, 02 Jun 2012 02:30:49 +0000 |
parents | 98520ee78f12 |
children |
comparison
equal
deleted
inserted
replaced
32818:01ff09d4a463 | 32819:2c6510167895 |
---|---|
166 | 166 |
167 void *ui_data; /**< The UI can put data here. */ | 167 void *ui_data; /**< The UI can put data here. */ |
168 PurpleAccountRegistrationCb registration_cb; | 168 PurpleAccountRegistrationCb registration_cb; |
169 void *registration_cb_user_data; | 169 void *registration_cb_user_data; |
170 | 170 |
171 gpointer priv; /**< Pointer to opaque private data. */ | 171 PurpleConnectionErrorInfo *current_error; /**< Errors */ |
172 }; | 172 }; |
173 | 173 |
174 #ifdef __cplusplus | 174 G_BEGIN_DECLS |
175 extern "C" { | |
176 #endif | |
177 | 175 |
178 /**************************************************************************/ | 176 /**************************************************************************/ |
179 /** @name Account API */ | 177 /** @name Account API */ |
180 /**************************************************************************/ | 178 /**************************************************************************/ |
181 /*@{*/ | 179 /*@{*/ |
219 * @param account The account to register. | 217 * @param account The account to register. |
220 */ | 218 */ |
221 void purple_account_register(PurpleAccount *account); | 219 void purple_account_register(PurpleAccount *account); |
222 | 220 |
223 /** | 221 /** |
222 * Registration of the account was completed. | |
223 * Calls the registration call-back set with purple_account_set_register_callback(). | |
224 * | |
225 * @param account The account being registered. | |
226 * @param succeeded Was the account registration successful? | |
227 */ | |
228 void purple_account_register_completed(PurpleAccount *account, gboolean succeeded); | |
229 | |
230 /** | |
224 * Unregisters an account (deleting it from the server). | 231 * Unregisters an account (deleting it from the server). |
225 * | 232 * |
226 * @param account The account to unregister. | 233 * @param account The account to unregister. |
227 * @param cb Optional callback to be called when unregistration is complete | 234 * @param cb Optional callback to be called when unregistration is complete |
228 * @param user_data user data to pass to the callback | 235 * @param user_data user data to pass to the callback |
233 * Disconnects from an account. | 240 * Disconnects from an account. |
234 * | 241 * |
235 * @param account The account to disconnect from. | 242 * @param account The account to disconnect from. |
236 */ | 243 */ |
237 void purple_account_disconnect(PurpleAccount *account); | 244 void purple_account_disconnect(PurpleAccount *account); |
245 | |
246 /** | |
247 * Indicates if the account is currently being disconnected. | |
248 * | |
249 * @param account The account | |
250 * | |
251 * @return TRUE if the account is being disconnected. | |
252 */ | |
253 gboolean purple_account_is_disconnecting(const PurpleAccount *account); | |
238 | 254 |
239 /** | 255 /** |
240 * Notifies the user that the account was added to a remote user's | 256 * Notifies the user that the account was added to a remote user's |
241 * buddy list. | 257 * buddy list. |
242 * | 258 * |
431 /** | 447 /** |
432 * Sets the account's privacy type. | 448 * Sets the account's privacy type. |
433 * | 449 * |
434 * @param account The account. | 450 * @param account The account. |
435 * @param privacy_type The privacy type. | 451 * @param privacy_type The privacy type. |
436 * | |
437 * @since 2.7.0 | |
438 */ | 452 */ |
439 void purple_account_set_privacy_type(PurpleAccount *account, PurplePrivacyType privacy_type); | 453 void purple_account_set_privacy_type(PurpleAccount *account, PurplePrivacyType privacy_type); |
440 | 454 |
441 /** | 455 /** |
442 * Sets the account's status types. | 456 * Sets the account's status types. |
489 * a protocol-specific "default", like the username) | 503 * a protocol-specific "default", like the username) |
490 * @param success_cb A callback which will be called if the alias | 504 * @param success_cb A callback which will be called if the alias |
491 * is successfully set on the server (or NULL). | 505 * is successfully set on the server (or NULL). |
492 * @param failure_cb A callback which will be called if the alias | 506 * @param failure_cb A callback which will be called if the alias |
493 * is not successfully set on the server (or NULL). | 507 * is not successfully set on the server (or NULL). |
494 * | |
495 * @since 2.7.0 | |
496 */ | 508 */ |
497 void purple_account_set_public_alias(PurpleAccount *account, | 509 void purple_account_set_public_alias(PurpleAccount *account, |
498 const char *alias, PurpleSetPublicAliasSuccessCallback success_cb, | 510 const char *alias, PurpleSetPublicAliasSuccessCallback success_cb, |
499 PurpleSetPublicAliasFailureCallback failure_cb); | 511 PurpleSetPublicAliasFailureCallback failure_cb); |
500 | 512 |
504 * | 516 * |
505 * @param account The account | 517 * @param account The account |
506 * @param success_cb A callback which will be called with the alias | 518 * @param success_cb A callback which will be called with the alias |
507 * @param failure_cb A callback which will be called if the prpl is | 519 * @param failure_cb A callback which will be called if the prpl is |
508 * unable to retrieve the server-side alias. | 520 * unable to retrieve the server-side alias. |
509 * @since 2.7.0 | |
510 */ | 521 */ |
511 void purple_account_get_public_alias(PurpleAccount *account, | 522 void purple_account_get_public_alias(PurpleAccount *account, |
512 PurpleGetPublicAliasSuccessCallback success_cb, | 523 PurpleGetPublicAliasSuccessCallback success_cb, |
513 PurpleGetPublicAliasFailureCallback failure_cb); | 524 PurpleGetPublicAliasFailureCallback failure_cb); |
514 | 525 |
540 /** | 551 /** |
541 * Removes an account-specific setting by name. | 552 * Removes an account-specific setting by name. |
542 * | 553 * |
543 * @param account The account. | 554 * @param account The account. |
544 * @param setting The setting to remove. | 555 * @param setting The setting to remove. |
545 * | |
546 * @since 2.6.0 | |
547 */ | 556 */ |
548 void purple_account_remove_setting(PurpleAccount *account, const char *setting); | 557 void purple_account_remove_setting(PurpleAccount *account, const char *setting); |
549 | 558 |
550 /** | 559 /** |
551 * Sets a protocol-specific integer setting for an account. | 560 * Sets a protocol-specific integer setting for an account. |
606 * @param name The name of the setting. | 615 * @param name The name of the setting. |
607 * @param value The setting's value. | 616 * @param value The setting's value. |
608 */ | 617 */ |
609 void purple_account_set_ui_bool(PurpleAccount *account, const char *ui, | 618 void purple_account_set_ui_bool(PurpleAccount *account, const char *ui, |
610 const char *name, gboolean value); | 619 const char *name, gboolean value); |
620 | |
621 /** | |
622 * Returns the UI data associated with this account. | |
623 * | |
624 * @param account The account. | |
625 * | |
626 * @return The UI data associated with this object. This is a | |
627 * convenience field provided to the UIs--it is not | |
628 * used by the libuprple core. | |
629 */ | |
630 gpointer purple_account_get_ui_data(const PurpleAccount *account); | |
631 | |
632 /** | |
633 * Set the UI data associated with this account. | |
634 * | |
635 * @param account The account. | |
636 * @param ui_data A pointer to associate with this object. | |
637 */ | |
638 void purple_account_set_ui_data(PurpleAccount *account, gpointer ui_data); | |
611 | 639 |
612 /** | 640 /** |
613 * Returns whether or not the account is connected. | 641 * Returns whether or not the account is connected. |
614 * | 642 * |
615 * @param account The account. | 643 * @param account The account. |
715 * the account's username. | 743 * the account's username. |
716 * | 744 * |
717 * @param account The account. | 745 * @param account The account. |
718 * | 746 * |
719 * @return The name to display. | 747 * @return The name to display. |
720 * | |
721 * @since 2.7.0 | |
722 */ | 748 */ |
723 const gchar *purple_account_get_name_for_display(const PurpleAccount *account); | 749 const gchar *purple_account_get_name_for_display(const PurpleAccount *account); |
724 | 750 |
725 /** | 751 /** |
726 * Returns whether or not this account should save its password. | 752 * Returns whether or not this account should save its password. |
765 * Returns the account's privacy type. | 791 * Returns the account's privacy type. |
766 * | 792 * |
767 * @param account The account. | 793 * @param account The account. |
768 * | 794 * |
769 * @return The privacy type. | 795 * @return The privacy type. |
770 * | |
771 * @since 2.7.0 | |
772 */ | 796 */ |
773 PurplePrivacyType purple_account_get_privacy_type(const PurpleAccount *account); | 797 PurplePrivacyType purple_account_get_privacy_type(const PurpleAccount *account); |
774 | 798 |
775 /** | 799 /** |
776 * Returns the active status for this account. This looks through | 800 * Returns the active status for this account. This looks through |
956 /** | 980 /** |
957 * Adds a buddy to the server-side buddy list for the specified account. | 981 * Adds a buddy to the server-side buddy list for the specified account. |
958 * | 982 * |
959 * @param account The account. | 983 * @param account The account. |
960 * @param buddy The buddy to add. | 984 * @param buddy The buddy to add. |
961 * | |
962 * @deprecated Use purple_account_add_buddy_with_invite and \c NULL message. | |
963 */ | |
964 void purple_account_add_buddy(PurpleAccount *account, PurpleBuddy *buddy); | |
965 /** | |
966 * Adds a buddy to the server-side buddy list for the specified account. | |
967 * | |
968 * @param account The account. | |
969 * @param buddy The buddy to add. | |
970 * @param message The invite message. This may be ignored by a prpl. | 985 * @param message The invite message. This may be ignored by a prpl. |
971 * | 986 */ |
972 * @since 2.8.0 | 987 void purple_account_add_buddy(PurpleAccount *account, PurpleBuddy *buddy, const char *message); |
973 */ | 988 |
974 void purple_account_add_buddy_with_invite(PurpleAccount *account, PurpleBuddy *buddy, const char *message); | |
975 | |
976 /** | |
977 * Adds a list of buddies to the server-side buddy list. | |
978 * | |
979 * @param account The account. | |
980 * @param buddies The list of PurpleBlistNodes representing the buddies to add. | |
981 * | |
982 * @deprecated Use purple_account_add_buddies_with_invite and \c NULL message. | |
983 */ | |
984 void purple_account_add_buddies(PurpleAccount *account, GList *buddies); | |
985 /** | 989 /** |
986 * Adds a list of buddies to the server-side buddy list. | 990 * Adds a list of buddies to the server-side buddy list. |
987 * | 991 * |
988 * @param account The account. | 992 * @param account The account. |
989 * @param buddies The list of PurpleBlistNodes representing the buddies to add. | 993 * @param buddies The list of PurpleBlistNodes representing the buddies to add. |
990 * @param message The invite message. This may be ignored by a prpl. | 994 * @param message The invite message. This may be ignored by a prpl. |
991 * | 995 */ |
992 * @since 2.8.0 | 996 void purple_account_add_buddies(PurpleAccount *account, GList *buddies, const char *message); |
993 */ | |
994 void purple_account_add_buddies_with_invite(PurpleAccount *account, GList *buddies, const char *message); | |
995 | 997 |
996 /** | 998 /** |
997 * Removes a buddy from the server-side buddy list. | 999 * Removes a buddy from the server-side buddy list. |
998 * | 1000 * |
999 * @param account The account. | 1001 * @param account The account. |
1185 */ | 1187 */ |
1186 void purple_accounts_uninit(void); | 1188 void purple_accounts_uninit(void); |
1187 | 1189 |
1188 /*@}*/ | 1190 /*@}*/ |
1189 | 1191 |
1190 #ifdef __cplusplus | 1192 G_END_DECLS |
1191 } | |
1192 #endif | |
1193 | 1193 |
1194 #endif /* _PURPLE_ACCOUNT_H_ */ | 1194 #endif /* _PURPLE_ACCOUNT_H_ */ |