gtkblist.h

Go to the documentation of this file.
00001 
00007 /* pidgin
00008  *
00009  * Pidgin is the legal property of its developers, whose names are too numerous
00010  * to list here.  Please refer to the COPYRIGHT file distributed with this
00011  * source distribution.
00012  *
00013  * This program is free software; you can redistribute it and/or modify
00014  * it under the terms of the GNU General Public License as published by
00015  * the Free Software Foundation; either version 2 of the License, or
00016  * (at your option) any later version.
00017  *
00018  * This program is distributed in the hope that it will be useful,
00019  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00020  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00021  * GNU General Public License for more details.
00022  *
00023  * You should have received a copy of the GNU General Public License
00024  * along with this program; if not, write to the Free Software
00025  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
00026  */
00027 #ifndef _PIDGINBLIST_H_
00028 #define _PIDGINBLIST_H_
00029 
00031 typedef struct _PidginBuddyList PidginBuddyList;
00032 
00033 enum {
00034     STATUS_ICON_COLUMN,
00035     STATUS_ICON_VISIBLE_COLUMN,
00036     NAME_COLUMN,
00037     IDLE_COLUMN,
00038     IDLE_VISIBLE_COLUMN,
00039     BUDDY_ICON_COLUMN,
00040     BUDDY_ICON_VISIBLE_COLUMN,
00041     NODE_COLUMN,
00042     BGCOLOR_COLUMN,
00043     GROUP_EXPANDER_COLUMN,
00044     GROUP_EXPANDER_VISIBLE_COLUMN,
00045     CONTACT_EXPANDER_COLUMN,
00046     CONTACT_EXPANDER_VISIBLE_COLUMN,
00047     EMBLEM_COLUMN,
00048     EMBLEM_VISIBLE_COLUMN,
00049     PROTOCOL_ICON_COLUMN,
00050     PROTOCOL_ICON_VISIBLE_COLUMN,
00051     BLIST_COLUMNS
00052 
00053 };
00054 
00055 typedef enum {
00056     PIDGIN_STATUS_ICON_LARGE,
00057     PIDGIN_STATUS_ICON_SMALL
00058 
00059 } PidginStatusIconSize;
00060 
00061 #include "pidgin.h"
00062 #include "blist.h"
00063 
00064 /**************************************************************************
00065  * @name Structures
00066  **************************************************************************/
00070 struct _PidginBuddyList {
00071     GtkWidget *window;
00072     GtkWidget *notebook;            
00074     GtkWidget *main_vbox;           
00075     GtkWidget *vbox;                
00078     GtkWidget *treeview;            
00079     GtkTreeStore *treemodel;        
00080     GtkTreeViewColumn *text_column; 
00082     GtkCellRenderer *text_rend;
00083 
00084     GtkItemFactory *ift;
00085     GtkWidget *menutray;            
00086     GtkWidget *menutrayicon;        
00095     GHashTable *connection_errors;
00096 
00097     guint refresh_timer;            
00099     guint      timeout;              
00100     guint      drag_timeout;         
00101     GdkRectangle tip_rect;           
00104     GdkRectangle contact_rect;       
00107     PurpleBlistNode *mouseover_contact; 
00109     GtkWidget *tipwindow;            
00110     GList *tooltipdata;              
00112     PurpleBlistNode *selected_node;    
00114     GdkCursor *hand_cursor;         
00115     GdkCursor *arrow_cursor;        
00117     GtkWidget *scrollbook;          
00118     GtkWidget *headline_hbox;       
00119     GtkWidget *headline_label;  
00120     GtkWidget *headline_image;      
00121     GdkPixbuf *headline_close;      
00122     GCallback headline_callback;    
00123     gpointer headline_data;         
00124     GDestroyNotify headline_destroy; 
00125     gboolean changing_style;        
00127     GtkWidget *error_buttons;        
00128     GtkWidget *statusbox;            
00129     GdkPixbuf *empty_avatar;         
00131     gpointer priv;                   
00132 };
00133 
00134 #define PIDGIN_BLIST(list) ((PidginBuddyList *)(list)->ui_data)
00135 #define PIDGIN_IS_PIDGIN_BLIST(list) \
00136     ((list)->ui_ops == pidgin_blist_get_ui_ops())
00137 
00138 /**************************************************************************
00139  * @name GTK+ Buddy List API
00140  **************************************************************************/
00141 
00147 void *pidgin_blist_get_handle(void);
00148 
00152 void pidgin_blist_init(void);
00153 
00157 void pidgin_blist_uninit(void);
00158 
00164 PurpleBlistUiOps *pidgin_blist_get_ui_ops(void);
00165 
00175 PidginBuddyList *pidgin_blist_get_default_gtk_blist(void);
00176 
00184 void pidgin_blist_make_buddy_menu(GtkWidget *menu, PurpleBuddy *buddy, gboolean sub);
00185 
00192 void pidgin_blist_refresh(PurpleBuddyList *list);
00193 
00194 void pidgin_blist_update_columns(void);
00195 void pidgin_blist_update_refresh_timeout(void);
00196 
00204 GdkPixbuf *
00205 pidgin_blist_get_emblem(PurpleBlistNode *node);
00206 
00210 GdkPixbuf *pidgin_blist_get_status_icon(PurpleBlistNode *node,
00211         PidginStatusIconSize size);
00212 
00222 gboolean pidgin_blist_node_is_contact_expanded(PurpleBlistNode *node);
00223 
00229 void pidgin_blist_toggle_visibility(void);
00230 
00239 void pidgin_blist_visibility_manager_add(void);
00240 
00245 void pidgin_blist_visibility_manager_remove(void);
00246 
00252 void pidgin_blist_add_alert(GtkWidget *widget);
00253 
00254 
00255 /**************************************************************************
00256  * @name GTK+ Buddy List sorting functions
00257  **************************************************************************/
00258 
00259 typedef void (*pidgin_blist_sort_function)(PurpleBlistNode *new, PurpleBuddyList *blist, GtkTreeIter group, GtkTreeIter *cur, GtkTreeIter *iter);
00260 
00266 GList *pidgin_blist_get_sort_methods(void);
00267 
00268 struct pidgin_blist_sort_method {
00269     char *id;
00270     char *name;
00271     pidgin_blist_sort_function func;
00272 };
00273 
00274 typedef struct pidgin_blist_sort_method PidginBlistSortMethod;
00275 
00284 void pidgin_blist_sort_method_reg(const char *id, const char *name, pidgin_blist_sort_function func);
00285 
00291 void pidgin_blist_sort_method_unreg(const char *id);
00292 
00298 void pidgin_blist_sort_method_set(const char *id);
00299 
00303 void pidgin_blist_setup_sort_methods(void);
00304 
00308 void pidgin_blist_update_accounts_menu(void);
00309 
00313 void pidgin_blist_update_plugin_actions(void);
00314 
00318 void pidgin_blist_update_sort_methods(void);
00319 
00326 gboolean pidgin_blist_joinchat_is_showable(void);
00327 
00331 void pidgin_blist_joinchat_show(void);
00332 
00337 void pidgin_append_blist_node_privacy_menu(GtkWidget *menu, PurpleBlistNode *node);
00338 
00343 void pidgin_append_blist_node_proto_menu (GtkWidget *menu, PurpleConnection *gc, PurpleBlistNode *node);
00344 
00349 void pidgin_append_blist_node_extended_menu(GtkWidget *menu, PurpleBlistNode *node);
00350 
00363 void pidgin_blist_update_account_error_state(PurpleAccount *account, const char *message);
00364 
00377 void pidgin_blist_set_headline(const char *text, GdkPixbuf *pixbuf, GCallback callback, gpointer user_data,
00378         GDestroyNotify destroy);
00379 
00390 gchar *pidgin_blist_get_name_markup(PurpleBuddy *buddy, gboolean selected, gboolean aliased);
00391 
00403 void pidgin_blist_draw_tooltip(PurpleBlistNode *node, GtkWidget *widget);
00404 
00410 void pidgin_blist_tooltip_destroy(void);
00411 
00412 
00413 #endif /* _PIDGINBLIST_H_ */