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 #include "gtkblist-theme.h"
00064 
00065 /**************************************************************************
00066  * @name Structures
00067  **************************************************************************/
00071 struct _PidginBuddyList {
00072     GtkWidget *window;
00073     GtkWidget *notebook;            
00075     GtkWidget *main_vbox;           
00076     GtkWidget *vbox;                
00079     GtkWidget *treeview;            
00080     GtkTreeStore *treemodel;        
00081     GtkTreeViewColumn *text_column; 
00083     GtkCellRenderer *text_rend;
00084 
00085     GtkItemFactory *ift;
00086     GtkWidget *menutray;            
00087     GtkWidget *menutrayicon;        
00096     GHashTable *connection_errors;
00097 
00098     guint refresh_timer;            
00100     guint      timeout;              
00101     guint      drag_timeout;         
00102     GdkRectangle tip_rect;           
00105     GdkRectangle contact_rect;       
00108     PurpleBlistNode *mouseover_contact; 
00110     GtkWidget *tipwindow;            
00111     GList *tooltipdata;              
00113     PurpleBlistNode *selected_node;    
00115     GdkCursor *hand_cursor;         
00116     GdkCursor *arrow_cursor;        
00118     GtkWidget *scrollbook;          
00119     GtkWidget *headline_hbox;       
00120     GtkWidget *headline_label;  
00121     GtkWidget *headline_image;      
00122     GdkPixbuf *headline_close;      
00123     GCallback headline_callback;    
00124     gpointer headline_data;         
00125     GDestroyNotify headline_destroy; 
00126     gboolean changing_style;        
00128     GtkWidget *error_buttons;        
00129     GtkWidget *statusbox;            
00130     GdkPixbuf *empty_avatar;         
00132     gpointer priv;                   
00133 };
00134 
00135 #define PIDGIN_BLIST(list) ((PidginBuddyList *)(list)->ui_data)
00136 #define PIDGIN_IS_PIDGIN_BLIST(list) \
00137     ((list)->ui_ops == pidgin_blist_get_ui_ops())
00138 
00139 /**************************************************************************
00140  * @name GTK+ Buddy List API
00141  **************************************************************************/
00142 
00148 void *pidgin_blist_get_handle(void);
00149 
00153 void pidgin_blist_init(void);
00154 
00158 void pidgin_blist_uninit(void);
00159 
00165 PurpleBlistUiOps *pidgin_blist_get_ui_ops(void);
00166 
00176 PidginBuddyList *pidgin_blist_get_default_gtk_blist(void);
00177 
00185 void pidgin_blist_make_buddy_menu(GtkWidget *menu, PurpleBuddy *buddy, gboolean sub);
00186 
00193 void pidgin_blist_refresh(PurpleBuddyList *list);
00194 
00195 void pidgin_blist_update_columns(void);
00196 void pidgin_blist_update_refresh_timeout(void);
00197 
00205 GdkPixbuf *
00206 pidgin_blist_get_emblem(PurpleBlistNode *node);
00207 
00211 GdkPixbuf *pidgin_blist_get_status_icon(PurpleBlistNode *node,
00212         PidginStatusIconSize size);
00213 
00223 gboolean pidgin_blist_node_is_contact_expanded(PurpleBlistNode *node);
00224 
00230 void pidgin_blist_toggle_visibility(void);
00231 
00240 void pidgin_blist_visibility_manager_add(void);
00241 
00246 void pidgin_blist_visibility_manager_remove(void);
00247 
00253 void pidgin_blist_add_alert(GtkWidget *widget);
00254 
00262 void pidgin_blist_set_theme(PidginBlistTheme *theme);
00263 
00271 PidginBlistTheme *pidgin_blist_get_theme(void);
00272 
00273 /**************************************************************************
00274  * @name GTK+ Buddy List sorting functions
00275  **************************************************************************/
00276 
00277 typedef void (*pidgin_blist_sort_function)(PurpleBlistNode *new, PurpleBuddyList *blist, GtkTreeIter group, GtkTreeIter *cur, GtkTreeIter *iter);
00278 
00284 GList *pidgin_blist_get_sort_methods(void);
00285 
00286 struct pidgin_blist_sort_method {
00287     char *id;
00288     char *name;
00289     pidgin_blist_sort_function func;
00290 };
00291 
00292 typedef struct pidgin_blist_sort_method PidginBlistSortMethod;
00293 
00302 void pidgin_blist_sort_method_reg(const char *id, const char *name, pidgin_blist_sort_function func);
00303 
00309 void pidgin_blist_sort_method_unreg(const char *id);
00310 
00316 void pidgin_blist_sort_method_set(const char *id);
00317 
00321 void pidgin_blist_setup_sort_methods(void);
00322 
00326 void pidgin_blist_update_accounts_menu(void);
00327 
00331 void pidgin_blist_update_plugin_actions(void);
00332 
00336 void pidgin_blist_update_sort_methods(void);
00337 
00344 gboolean pidgin_blist_joinchat_is_showable(void);
00345 
00349 void pidgin_blist_joinchat_show(void);
00350 
00355 void pidgin_append_blist_node_privacy_menu(GtkWidget *menu, PurpleBlistNode *node);
00356 
00361 void pidgin_append_blist_node_proto_menu (GtkWidget *menu, PurpleConnection *gc, PurpleBlistNode *node);
00362 
00367 void pidgin_append_blist_node_extended_menu(GtkWidget *menu, PurpleBlistNode *node);
00368 
00381 void pidgin_blist_update_account_error_state(PurpleAccount *account, const char *message);
00382 
00395 void pidgin_blist_set_headline(const char *text, GdkPixbuf *pixbuf, GCallback callback, gpointer user_data,
00396         GDestroyNotify destroy);
00397 
00408 gchar *pidgin_blist_get_name_markup(PurpleBuddy *buddy, gboolean selected, gboolean aliased);
00409 
00421 void pidgin_blist_draw_tooltip(PurpleBlistNode *node, GtkWidget *widget);
00422 
00428 void pidgin_blist_tooltip_destroy(void);
00429 
00430 
00431 #endif /* _PIDGINBLIST_H_ */