gtkblist.h

Go to the documentation of this file.
00001 
00025 #ifndef _PIDGINBLIST_H_
00026 #define _PIDGINBLIST_H_
00027 
00028 typedef struct _PidginBuddyList PidginBuddyList;
00029 
00030 enum {
00031     STATUS_ICON_COLUMN,
00032     STATUS_ICON_VISIBLE_COLUMN,
00033     NAME_COLUMN,
00034     IDLE_COLUMN,
00035     IDLE_VISIBLE_COLUMN,
00036     BUDDY_ICON_COLUMN,
00037     BUDDY_ICON_VISIBLE_COLUMN,
00038     NODE_COLUMN,
00039     BGCOLOR_COLUMN,
00040     GROUP_EXPANDER_COLUMN,
00041     GROUP_EXPANDER_VISIBLE_COLUMN,
00042     CONTACT_EXPANDER_COLUMN,
00043     CONTACT_EXPANDER_VISIBLE_COLUMN,
00044     EMBLEM_COLUMN,
00045     EMBLEM_VISIBLE_COLUMN,
00046     BLIST_COLUMNS
00047 
00048 };
00049 
00050 typedef enum {
00051     PIDGIN_STATUS_ICON_LARGE,
00052     PIDGIN_STATUS_ICON_SMALL
00053 
00054 } PidginStatusIconSize;
00055 
00056 #include "pidgin.h"
00057 #include "blist.h"
00058 
00059 /**************************************************************************
00060  * @name Structures
00061  **************************************************************************/
00065 struct _PidginBuddyList {
00066     GtkWidget *window;
00067     GtkWidget *notebook;            
00069     GtkWidget *main_vbox;           
00070     GtkWidget *vbox;                
00073     GtkWidget *treeview;            
00074     GtkTreeStore *treemodel;        
00075     GtkTreeViewColumn *text_column; 
00077     GtkCellRenderer *text_rend;
00078 
00079     GtkItemFactory *ift;
00080     GtkWidget *menutray;            
00081     GtkWidget *menutrayicon;        
00083     GHashTable *connection_errors;  
00085     guint refresh_timer;            
00087     guint      timeout;              
00088     guint      drag_timeout;         
00089     GdkRectangle tip_rect;           
00092     GdkRectangle contact_rect;       
00095     PurpleBlistNode *mouseover_contact; 
00097     GtkWidget *tipwindow;            
00098     GList *tooltipdata;              
00100     PurpleBlistNode *selected_node;    
00102     GdkCursor *hand_cursor;         
00103     GdkCursor *arrow_cursor;        
00105     GtkWidget *scrollbook;          
00106     GtkWidget *headline_hbox;       
00107     GtkWidget *headline_label;  
00108     GtkWidget *headline_image;      
00109     GdkPixbuf *headline_close;      
00110     GCallback headline_callback;    
00111     gpointer headline_data;         
00112     GDestroyNotify headline_destroy; 
00113     gboolean changing_style;        
00115     GtkWidget *error_buttons;        
00116     GtkWidget *statusbox;            
00117     GdkPixbuf *empty_avatar;         
00118 };
00119 
00120 #define PIDGIN_BLIST(list) ((PidginBuddyList *)(list)->ui_data)
00121 #define PIDGIN_IS_PIDGIN_BLIST(list) \
00122     ((list)->ui_ops == pidgin_blist_get_ui_ops())
00123 
00124 /**************************************************************************
00125  * @name GTK+ Buddy List API
00126  **************************************************************************/
00127 
00133 void *pidgin_blist_get_handle(void);
00134 
00138 void pidgin_blist_init(void);
00139 
00143 void pidgin_blist_uninit(void);
00144 
00150 PurpleBlistUiOps *pidgin_blist_get_ui_ops(void);
00151 
00161 PidginBuddyList *pidgin_blist_get_default_gtk_blist(void);
00162 
00170 void pidgin_blist_make_buddy_menu(GtkWidget *menu, PurpleBuddy *buddy, gboolean sub);
00171 
00178 void pidgin_blist_refresh(PurpleBuddyList *list);
00179 
00180 void pidgin_blist_update_columns(void);
00181 void pidgin_blist_update_refresh_timeout(void);
00182 
00190 GdkPixbuf *
00191 pidgin_blist_get_emblem(PurpleBlistNode *node);
00192 
00196 GdkPixbuf *pidgin_blist_get_status_icon(PurpleBlistNode *node,
00197         PidginStatusIconSize size);
00198 
00208 gboolean pidgin_blist_node_is_contact_expanded(PurpleBlistNode *node);
00209 
00215 void pidgin_blist_toggle_visibility(void);
00216 
00225 void pidgin_blist_visibility_manager_add(void);
00226 
00231 void pidgin_blist_visibility_manager_remove(void);
00232 
00238 void pidgin_blist_add_alert(GtkWidget *widget);
00239 
00240 
00241 /**************************************************************************
00242  * @name GTK+ Buddy List sorting functions
00243  **************************************************************************/
00244 
00245 typedef void (*pidgin_blist_sort_function)(PurpleBlistNode *new, PurpleBuddyList *blist, GtkTreeIter group, GtkTreeIter *cur, GtkTreeIter *iter);
00246 
00252 GList *pidgin_blist_get_sort_methods(void);
00253 
00254 struct pidgin_blist_sort_method {
00255     char *id;
00256     char *name;
00257     pidgin_blist_sort_function func;
00258 };
00259 
00260 typedef struct pidgin_blist_sort_method PidginBlistSortMethod;
00261 
00270 void pidgin_blist_sort_method_reg(const char *id, const char *name, pidgin_blist_sort_function func);
00271 
00277 void pidgin_blist_sort_method_unreg(const char *id);
00278 
00284 void pidgin_blist_sort_method_set(const char *id);
00285 
00289 void pidgin_blist_setup_sort_methods(void);
00290 
00294 void pidgin_blist_update_accounts_menu(void);
00295 
00299 void pidgin_blist_update_plugin_actions(void);
00300 
00304 void pidgin_blist_update_sort_methods(void);
00305 
00312 gboolean pidgin_blist_joinchat_is_showable(void);
00313 
00317 void pidgin_blist_joinchat_show(void);
00318 
00323 void pidgin_append_blist_node_privacy_menu(GtkWidget *menu, PurpleBlistNode *node);
00324 
00329 void pidgin_append_blist_node_proto_menu (GtkWidget *menu, PurpleConnection *gc, PurpleBlistNode *node);
00330 
00335 void pidgin_append_blist_node_extended_menu(GtkWidget *menu, PurpleBlistNode *node);
00336 
00346 void pidgin_blist_update_account_error_state(PurpleAccount *account, const char *message);
00347 
00360 void pidgin_blist_set_headline(const char *text, GdkPixbuf *pixbuf, GCallback callback, gpointer user_data,
00361         GDestroyNotify destroy);
00362 
00371 gchar *pidgin_blist_get_name_markup(PurpleBuddy *buddy, gboolean selected, gboolean aliased);
00372 
00382 void pidgin_blist_draw_tooltip(PurpleBlistNode *node, GtkWidget *widget);
00383 
00387 void pidgin_blist_tooltip_destroy(void);
00388 
00389 
00390 #endif /* _PIDGINBLIST_H_ */