Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

account.h

Go to the documentation of this file.
00001 
00027 #ifndef _GAIM_ACCOUNTS_H_
00028 #define _GAIM_ACCOUNTS_H_
00029 
00030 #include <glib.h>
00031 
00032 typedef struct _GaimAccountUiOps GaimAccountUiOps;
00033 typedef struct _GaimAccount      GaimAccount;
00034 
00035 typedef gboolean (*GaimFilterAccountFunc)(GaimAccount *account);
00036 
00037 #include "connection.h"
00038 #include "proxy.h"
00039 #include "prpl.h"
00040 #include "log.h"
00041 
00042 struct _GaimAccountUiOps
00043 {
00044     void (*notify_added)(GaimAccount *account, const char *remote_user,
00045                          const char *id, const char *alias,
00046                          const char *message);
00047 };
00048 
00049 struct _GaimAccount
00050 {
00051     char *username;             
00052     char *alias;                
00053     char *password;             
00054     char *user_info;            
00056     char *buddy_icon;           
00058     gboolean remember_pass;     
00060     char *protocol_id;          
00062     GaimConnection *gc;         
00064     GHashTable *settings;       
00065     GHashTable *ui_settings;    
00067     char *ip;                   
00068     GaimProxyInfo *proxy_info;  
00069                                 /*   to NULL when the account inherits    */
00070                                 /*   proxy settings from global prefs.    */
00071 
00072     GSList *permit;             
00073     GSList *deny;               
00074     int perm_deny;              
00075     GaimLog *system_log;        
00076 };
00077 
00078 #ifdef __cplusplus
00079 extern "C" {
00080 #endif
00081 
00082 /**************************************************************************/
00084 /**************************************************************************/
00093 GaimAccount *gaim_account_new(const char *username, const char *protocol_id);
00094 
00100 void gaim_account_destroy(GaimAccount *account);
00101 
00109 GaimConnection *gaim_account_connect(GaimAccount *account);
00110 
00118 GaimConnection *gaim_account_register(GaimAccount *account);
00119 
00127 void gaim_account_disconnect(GaimAccount *account);
00128 
00142 void gaim_account_notify_added(GaimAccount *account, const char *remote_user,
00143                                const char *id, const char *alias,
00144                                const char *message);
00145 
00151 void gaim_account_request_change_password(GaimAccount *account);
00152 
00159 void gaim_account_request_change_user_info(GaimAccount *account);
00160 
00167 void gaim_account_set_username(GaimAccount *account, const char *username);
00168 
00175 void gaim_account_set_password(GaimAccount *account, const char *password);
00176 
00183 void gaim_account_set_alias(GaimAccount *account, const char *alias);
00184 
00191 void gaim_account_set_user_info(GaimAccount *account, const char *user_info);
00192 
00199 void gaim_account_set_buddy_icon(GaimAccount *account, const char *icon);
00200 
00207 void gaim_account_set_protocol(GaimAccount *account, GaimProtocol protocol);
00208 
00215 void gaim_account_set_protocol_id(GaimAccount *account,
00216                                   const char *protocol_id);
00217 
00224 void gaim_account_set_connection(GaimAccount *account, GaimConnection *gc);
00225 
00232 void gaim_account_set_remember_password(GaimAccount *account, gboolean value);
00233 
00240 void gaim_account_set_check_mail(GaimAccount *account, gboolean value);
00241 
00250 void gaim_account_set_auto_login(GaimAccount *account, const char *ui,
00251                                  gboolean value);
00252 
00260 void gaim_account_set_public_ip(GaimAccount *account, const char *ip);
00261 
00268 void gaim_account_set_proxy_info(GaimAccount *account, GaimProxyInfo *info);
00269 
00275 void gaim_account_clear_settings(GaimAccount *account);
00276 
00284 void gaim_account_set_int(GaimAccount *account, const char *name, int value);
00285 
00293 void gaim_account_set_string(GaimAccount *account, const char *name,
00294                              const char *value);
00295 
00303 void gaim_account_set_bool(GaimAccount *account, const char *name,
00304                            gboolean value);
00305 
00314 void gaim_account_set_ui_int(GaimAccount *account, const char *ui,
00315                              const char *name, int value);
00316 
00325 void gaim_account_set_ui_string(GaimAccount *account, const char *ui,
00326                                 const char *name, const char *value);
00327 
00336 void gaim_account_set_ui_bool(GaimAccount *account, const char *ui,
00337                               const char *name, gboolean value);
00338 
00346 gboolean gaim_account_is_connected(const GaimAccount *account);
00347 
00355 const char *gaim_account_get_username(const GaimAccount *account);
00356 
00364 const char *gaim_account_get_password(const GaimAccount *account);
00365 
00373 const char *gaim_account_get_alias(const GaimAccount *account);
00374 
00382 const char *gaim_account_get_user_info(const GaimAccount *account);
00383 
00391 const char *gaim_account_get_buddy_icon(const GaimAccount *account);
00392 
00400 GaimProtocol gaim_account_get_protocol(const GaimAccount *account);
00401 
00409 const char *gaim_account_get_protocol_id(const GaimAccount *account);
00410 
00418 GaimConnection *gaim_account_get_connection(const GaimAccount *account);
00419 
00427 gboolean gaim_account_get_remember_password(const GaimAccount *account);
00428 
00436 gboolean gaim_account_get_check_mail(const GaimAccount *account);
00437 
00447 gboolean gaim_account_get_auto_login(const GaimAccount *account,
00448                                      const char *ui);
00449 
00457 const char *gaim_account_get_public_ip(const GaimAccount *account);
00458 
00466 GaimProxyInfo *gaim_account_get_proxy_info(const GaimAccount *account);
00467 
00477 int gaim_account_get_int(const GaimAccount *account, const char *name,
00478                          int default_value);
00479 
00489 const char *gaim_account_get_string(const GaimAccount *account,
00490                                     const char *name,
00491                                     const char *default_value);
00492 
00502 gboolean gaim_account_get_bool(const GaimAccount *account, const char *name,
00503                                gboolean default_value);
00504 
00515 int gaim_account_get_ui_int(const GaimAccount *account, const char *ui,
00516                             const char *name, int default_value);
00517 
00528 const char *gaim_account_get_ui_string(const GaimAccount *account,
00529                                        const char *ui, const char *name,
00530                                        const char *default_value);
00531 
00542 gboolean gaim_account_get_ui_bool(const GaimAccount *account, const char *ui,
00543                                   const char *name, gboolean default_value);
00544 
00545 
00554 GaimLog *gaim_account_get_log(GaimAccount *account);
00555 
00561     void gaim_account_destroy_log(GaimAccount *account);
00562 
00565 /**************************************************************************/
00567 /**************************************************************************/
00573 gboolean gaim_accounts_load();
00574 
00578 void gaim_accounts_sync();
00579 
00585 void gaim_accounts_add(GaimAccount *account);
00586 
00592 void gaim_accounts_remove(GaimAccount *account);
00593 
00603 void gaim_accounts_delete(GaimAccount *account);
00604 
00610 void gaim_accounts_auto_login(const char *ui);
00611 
00618 void gaim_accounts_reorder(GaimAccount *account, size_t new_index);
00619 
00625 GList *gaim_accounts_get_all(void);
00626 
00635 GaimAccount *gaim_accounts_find(const char *name, const char *protocol);
00636 
00640 /**************************************************************************/
00642 /**************************************************************************/
00649 void gaim_accounts_set_ui_ops(GaimAccountUiOps *ops);
00650 
00656 GaimAccountUiOps *gaim_accounts_get_ui_ops(void);
00657 
00661 /**************************************************************************/
00663 /**************************************************************************/
00671 void *gaim_accounts_get_handle(void);
00672 
00676 void gaim_accounts_init(void);
00677 
00681 void gaim_accounts_uninit(void);
00682 
00685 #ifdef __cplusplus
00686 }
00687 #endif
00688 
00689 #endif /* _GAIM_ACCOUNTS_H_ */

Generated on Tue Aug 3 17:36:34 2004 for gaim by doxygen 1.3.4