gtkblist.h

Go to the documentation of this file.
00001 
00006 /* pidgin
00007  *
00008  * Pidgin is the legal property of its developers, whose names are too numerous
00009  * to list here.  Please refer to the COPYRIGHT file distributed with this
00010  * source distribution.
00011  *
00012  * This program is free software; you can redistribute it and/or modify
00013  * it under the terms of the GNU General Public License as published by
00014  * the Free Software Foundation; either version 2 of the License, or
00015  * (at your option) any later version.
00016  *
00017  * This program is distributed in the hope that it will be useful,
00018  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00019  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020  * GNU General Public License for more details.
00021  *
00022  * You should have received a copy of the GNU General Public License
00023  * along with this program; if not, write to the Free Software
00024  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
00025  */
00026 #ifndef _PIDGINBLIST_H_
00027 #define _PIDGINBLIST_H_
00028 
00029 typedef struct _PidginBuddyList PidginBuddyList;
00030 
00031 enum {
00032     STATUS_ICON_COLUMN,
00033     STATUS_ICON_VISIBLE_COLUMN,
00034     NAME_COLUMN,
00035     IDLE_COLUMN,
00036     IDLE_VISIBLE_COLUMN,
00037     BUDDY_ICON_COLUMN,
00038     BUDDY_ICON_VISIBLE_COLUMN,
00039     NODE_COLUMN,
00040     BGCOLOR_COLUMN,
00041     GROUP_EXPANDER_COLUMN,
00042     GROUP_EXPANDER_VISIBLE_COLUMN,
00043     CONTACT_EXPANDER_COLUMN,
00044     CONTACT_EXPANDER_VISIBLE_COLUMN,
00045     EMBLEM_COLUMN,
00046     EMBLEM_VISIBLE_COLUMN,
00047     PROTOCOL_ICON_COLUMN,
00048     PROTOCOL_ICON_VISIBLE_COLUMN,
00049     BLIST_COLUMNS
00050 
00051 };
00052 
00053 typedef enum {
00054     PIDGIN_STATUS_ICON_LARGE,
00055     PIDGIN_STATUS_ICON_SMALL
00056 
00057 } PidginStatusIconSize;
00058 
00059 #include "pidgin.h"
00060 #include "blist.h"
00061 
00062 /**************************************************************************
00063  * @name Structures
00064  **************************************************************************/
00068 struct _PidginBuddyList {
00069     GtkWidget *window;
00070     GtkWidget *notebook;            
00072     GtkWidget *main_vbox;           
00073     GtkWidget *vbox;                
00076     GtkWidget *treeview;            
00077     GtkTreeStore *treemodel;        
00078     GtkTreeViewColumn *text_column; 
00080     GtkCellRenderer *text_rend;
00081 
00082     GtkItemFactory *ift;
00083     GtkWidget *menutray;            
00084     GtkWidget *menutrayicon;        
00086     GHashTable *connection_errors;  
00088     guint refresh_timer;            
00090     guint      timeout;              
00091     guint      drag_timeout;         
00092     GdkRectangle tip_rect;           
00095     GdkRectangle contact_rect;       
00098     PurpleBlistNode *mouseover_contact; 
00100     GtkWidget *tipwindow;            
00101     GList *tooltipdata;              
00103     PurpleBlistNode *selected_node;    
00105     GdkCursor *hand_cursor;         
00106     GdkCursor *arrow_cursor;        
00108     GtkWidget *scrollbook;          
00109     GtkWidget *headline_hbox;       
00110     GtkWidget *headline_label;  
00111     GtkWidget *headline_image;      
00112     GdkPixbuf *headline_close;      
00113     GCallback headline_callback;    
00114     gpointer headline_data;         
00115     GDestroyNotify headline_destroy; 
00116     gboolean changing_style;        
00118     GtkWidget *error_buttons;        
00119     GtkWidget *statusbox;            
00120     GdkPixbuf *empty_avatar;         
00121 };
00122 
00123 #define PIDGIN_BLIST(list) ((PidginBuddyList *)(list)->ui_data)
00124 #define PIDGIN_IS_PIDGIN_BLIST(list) \
00125     ((list)->ui_ops == pidgin_blist_get_ui_ops())
00126 
00127 /**************************************************************************
00128  * @name GTK+ Buddy List API
00129  **************************************************************************/
00130 
00136 void *pidgin_blist_get_handle(void);
00137 
00141 void pidgin_blist_init(void);
00142 
00146 void pidgin_blist_uninit(void);
00147 
00153 PurpleBlistUiOps *pidgin_blist_get_ui_ops(void);
00154 
00164 PidginBuddyList *pidgin_blist_get_default_gtk_blist(void);
00165 
00173 void pidgin_blist_make_buddy_menu(GtkWidget *menu, PurpleBuddy *buddy, gboolean sub);
00174 
00181 void pidgin_blist_refresh(PurpleBuddyList *list);
00182 
00183 void pidgin_blist_update_columns(void);
00184 void pidgin_blist_update_refresh_timeout(void);
00185 
00193 GdkPixbuf *
00194 pidgin_blist_get_emblem(PurpleBlistNode *node);
00195 
00199 GdkPixbuf *pidgin_blist_get_status_icon(PurpleBlistNode *node,
00200         PidginStatusIconSize size);
00201 
00211 gboolean pidgin_blist_node_is_contact_expanded(PurpleBlistNode *node);
00212 
00218 void pidgin_blist_toggle_visibility(void);
00219 
00228 void pidgin_blist_visibility_manager_add(void);
00229 
00234 void pidgin_blist_visibility_manager_remove(void);
00235 
00241 void pidgin_blist_add_alert(GtkWidget *widget);
00242 
00243 
00244 /**************************************************************************
00245  * @name GTK+ Buddy List sorting functions
00246  **************************************************************************/
00247 
00248 typedef void (*pidgin_blist_sort_function)(PurpleBlistNode *new, PurpleBuddyList *blist, GtkTreeIter group, GtkTreeIter *cur, GtkTreeIter *iter);
00249 
00255 GList *pidgin_blist_get_sort_methods(void);
00256 
00257 struct pidgin_blist_sort_method {
00258     char *id;
00259     char *name;
00260     pidgin_blist_sort_function func;
00261 };
00262 
00263 typedef struct pidgin_blist_sort_method PidginBlistSortMethod;
00264 
00273 void pidgin_blist_sort_method_reg(const char *id, const char *name, pidgin_blist_sort_function func);
00274 
00280 void pidgin_blist_sort_method_unreg(const char *id);
00281 
00287 void pidgin_blist_sort_method_set(const char *id);
00288 
00292 void pidgin_blist_setup_sort_methods(void);
00293 
00297 void pidgin_blist_update_accounts_menu(void);
00298 
00302 void pidgin_blist_update_plugin_actions(void);
00303 
00307 void pidgin_blist_update_sort_methods(void);
00308 
00315 gboolean pidgin_blist_joinchat_is_showable(void);
00316 
00320 void pidgin_blist_joinchat_show(void);
00321 
00326 void pidgin_append_blist_node_privacy_menu(GtkWidget *menu, PurpleBlistNode *node);
00327 
00332 void pidgin_append_blist_node_proto_menu (GtkWidget *menu, PurpleConnection *gc, PurpleBlistNode *node);
00333 
00338 void pidgin_append_blist_node_extended_menu(GtkWidget *menu, PurpleBlistNode *node);
00339 
00349 void pidgin_blist_update_account_error_state(PurpleAccount *account, const char *message);
00350 
00363 void pidgin_blist_set_headline(const char *text, GdkPixbuf *pixbuf, GCallback callback, gpointer user_data,
00364         GDestroyNotify destroy);
00365 
00374 gchar *pidgin_blist_get_name_markup(PurpleBuddy *buddy, gboolean selected, gboolean aliased);
00375 
00385 void pidgin_blist_draw_tooltip(PurpleBlistNode *node, GtkWidget *widget);
00386 
00390 void pidgin_blist_tooltip_destroy(void);
00391 
00392 
00393 #endif /* _PIDGINBLIST_H_ */