pidgin  2.14.11dev
gtkblist.h
Go to the documentation of this file.
1 
7 /* pidgin
8  *
9  * Pidgin is the legal property of its developers, whose names are too numerous
10  * to list here. Please refer to the COPYRIGHT file distributed with this
11  * source distribution.
12  *
13  * This program is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License as published by
15  * the Free Software Foundation; either version 2 of the License, or
16  * (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software
25  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
26  */
27 #ifndef _PIDGINBLIST_H_
28 #define _PIDGINBLIST_H_
29 
31 typedef struct _PidginBuddyList PidginBuddyList;
32 
33 enum {
34  STATUS_ICON_COLUMN,
35  STATUS_ICON_VISIBLE_COLUMN,
36  NAME_COLUMN,
37  IDLE_COLUMN,
38  IDLE_VISIBLE_COLUMN,
39  BUDDY_ICON_COLUMN,
40  BUDDY_ICON_VISIBLE_COLUMN,
41  NODE_COLUMN,
42  BGCOLOR_COLUMN,
43  GROUP_EXPANDER_COLUMN,
44  GROUP_EXPANDER_VISIBLE_COLUMN,
45  CONTACT_EXPANDER_COLUMN,
46  CONTACT_EXPANDER_VISIBLE_COLUMN,
47  EMBLEM_COLUMN,
48  EMBLEM_VISIBLE_COLUMN,
49  PROTOCOL_ICON_COLUMN,
50  PROTOCOL_ICON_VISIBLE_COLUMN,
51  BLIST_COLUMNS
52 
53 };
54 
55 typedef enum {
56  PIDGIN_STATUS_ICON_LARGE,
57  PIDGIN_STATUS_ICON_SMALL
58 
59 } PidginStatusIconSize;
60 
61 #include "pidgin.h"
62 #include "blist.h"
63 #include "gtkblist-theme.h"
64 
65 /**************************************************************************
66  * @name Structures
67  **************************************************************************/
72  GtkWidget *window;
73  GtkWidget *notebook;
75  GtkWidget *main_vbox;
76  GtkWidget *vbox;
79  GtkWidget *treeview;
80  GtkTreeStore *treemodel;
81  GtkTreeViewColumn *text_column;
83  GtkCellRenderer *text_rend;
84 
85  GtkItemFactory *ift;
86  GtkWidget *menutray;
87  GtkWidget *menutrayicon;
96  GHashTable *connection_errors;
97 
98  guint refresh_timer;
100  guint timeout;
101  guint drag_timeout;
102  GdkRectangle tip_rect;
105  GdkRectangle contact_rect;
110  GtkWidget *tipwindow;
111  GList *tooltipdata;
115  GdkCursor *hand_cursor;
116  GdkCursor *arrow_cursor;
118  GtkWidget *scrollbook;
119  GtkWidget *headline_hbox;
120  GtkWidget *headline_label;
121  GtkWidget *headline_image;
122  GdkPixbuf *headline_close;
123  GCallback headline_callback;
124  gpointer headline_data;
125  GDestroyNotify headline_destroy;
126  gboolean changing_style;
128  GtkWidget *error_buttons;
129  GtkWidget *statusbox;
130  GdkPixbuf *empty_avatar;
132  gpointer priv;
133 };
134 
135 #define PIDGIN_BLIST(list) ((PidginBuddyList *)purple_blist_get_ui_data())
136 #define PIDGIN_IS_PIDGIN_BLIST(list) \
137  (purple_blist_get_ui_ops() == pidgin_blist_get_ui_ops())
138 
139 /**************************************************************************
140  * @name GTK+ Buddy List API
141  **************************************************************************/
142 
149 
153 void pidgin_blist_init(void);
154 
159 
166 
177 
185 void pidgin_blist_make_buddy_menu(GtkWidget *menu, PurpleBuddy *buddy, gboolean sub);
186 
194 
195 void pidgin_blist_update_columns(void);
196 void pidgin_blist_update_refresh_timeout(void);
197 
208 GdkPixbuf *
210 
215  PidginStatusIconSize size);
216 
227 
234 
244 
250 
256 void pidgin_blist_add_alert(GtkWidget *widget);
257 
266 
275 
276 /**************************************************************************
277  * @name GTK+ Buddy List sorting functions
278  **************************************************************************/
279 
280 typedef void (*pidgin_blist_sort_function)(PurpleBlistNode *new, PurpleBuddyList *blist, GtkTreeIter group, GtkTreeIter *cur, GtkTreeIter *iter);
281 
288 
290  char *id;
291  char *name;
292  pidgin_blist_sort_function func;
293 };
294 
296 
305 void pidgin_blist_sort_method_reg(const char *id, const char *name, pidgin_blist_sort_function func);
306 
312 void pidgin_blist_sort_method_unreg(const char *id);
313 
319 void pidgin_blist_sort_method_set(const char *id);
320 
325 
330 
335 
340 
348 
353 
359 
365 
371 
384 void pidgin_blist_update_account_error_state(PurpleAccount *account, const char *message);
385 
398 void pidgin_blist_set_headline(const char *text, GdkPixbuf *pixbuf, GCallback callback, gpointer user_data,
399  GDestroyNotify destroy);
400 
411 gchar *pidgin_blist_get_name_markup(PurpleBuddy *buddy, gboolean selected, gboolean aliased);
412 
424 void pidgin_blist_draw_tooltip(PurpleBlistNode *node, GtkWidget *widget);
425 
432 
433 
434 #endif /* _PIDGINBLIST_H_ */
Buddy List API.
GTK+ Buddy List Theme API.
void pidgin_blist_init(void)
Initializes the GTK+ blist system.
void pidgin_append_blist_node_proto_menu(GtkWidget *menu, PurpleConnection *gc, PurpleBlistNode *node)
Appends the protocol specific menu items for a PurpleBlistNode TODO: Rename these.
void pidgin_blist_sort_method_unreg(const char *id)
Unregisters a buddy list sorting method.
GdkPixbuf * pidgin_blist_get_emblem(PurpleBlistNode *node)
Returns the blist emblem.
void pidgin_blist_visibility_manager_add(void)
Increases the reference count of visibility managers.
PidginBuddyList * pidgin_blist_get_default_gtk_blist(void)
Returns the default gtk buddy list.
void pidgin_blist_draw_tooltip(PurpleBlistNode *node, GtkWidget *widget)
Creates the Buddy List tooltip at the current pointer location for the given buddy list node.
void pidgin_blist_sort_method_set(const char *id)
Sets a buddy list sorting method.
void pidgin_blist_update_plugin_actions(void)
Updates the plugin actions menu on the GTK+ buddy list window.
void pidgin_blist_make_buddy_menu(GtkWidget *menu, PurpleBuddy *buddy, gboolean sub)
Populates a menu with the items shown on the buddy list for a buddy.
void pidgin_blist_add_alert(GtkWidget *widget)
Adds a mini-alert to the blist scrollbook.
void * pidgin_blist_get_handle(void)
Get the handle for the GTK+ blist system.
void pidgin_blist_visibility_manager_remove(void)
Decreases the reference count of visibility managers.
void pidgin_blist_sort_method_reg(const char *id, const char *name, pidgin_blist_sort_function func)
Registers a buddy list sorting method.
void pidgin_append_blist_node_extended_menu(GtkWidget *menu, PurpleBlistNode *node)
Appends the extended menu items for a PurpleBlistNode TODO: Rename these.
void pidgin_append_blist_node_privacy_menu(GtkWidget *menu, PurpleBlistNode *node)
Appends the privacy menu items for a PurpleBlistNode TODO: Rename these.
PurpleBlistUiOps * pidgin_blist_get_ui_ops(void)
Returns the UI operations structure for the buddy list.
gboolean pidgin_blist_joinchat_is_showable(void)
Determines if showing the join chat dialog is a valid action.
gchar * pidgin_blist_get_name_markup(PurpleBuddy *buddy, gboolean selected, gboolean aliased)
Returns a buddy's Pango markup appropriate for setting in a GtkCellRenderer.
void pidgin_blist_set_theme(PidginBlistTheme *theme)
Sets the current theme for Pidgin to use.
void pidgin_blist_tooltip_destroy(void)
Destroys the current (if any) Buddy List tooltip.
GList * pidgin_blist_get_sort_methods(void)
Gets the current list of sort methods.
void pidgin_blist_refresh(PurpleBuddyList *list)
Refreshes all the nodes of the buddy list.
void pidgin_blist_update_sort_methods(void)
Updates the Sorting menu on the GTK+ buddy list window.
void pidgin_blist_toggle_visibility(void)
Intelligently toggles the visibility of the buddy list.
void pidgin_blist_update_account_error_state(PurpleAccount *account, const char *message)
Was used by the connection API to tell the blist if an account has a connection error or no longer ha...
void pidgin_blist_set_headline(const char *text, GdkPixbuf *pixbuf, GCallback callback, gpointer user_data, GDestroyNotify destroy)
Sets a headline notification.
void pidgin_blist_uninit(void)
Uninitializes the GTK+ blist system.
void pidgin_blist_joinchat_show(void)
Shows the join chat dialog.
GdkPixbuf * pidgin_blist_get_status_icon(PurpleBlistNode *node, PidginStatusIconSize size)
Useful for the buddy ticker.
PidginBlistTheme * pidgin_blist_get_theme(void)
Gets Pidgin's current buddy list theme.
void pidgin_blist_update_accounts_menu(void)
Updates the accounts menu on the GTK+ buddy list window.
gboolean pidgin_blist_node_is_contact_expanded(PurpleBlistNode *node)
Returns a boolean indicating if node is part of an expanded contact.
void pidgin_blist_setup_sort_methods(void)
Sets up the programs default sort methods.
UI definitions and includes.
Like, everything you need to know about the gtk buddy list.
Definition: gtkblist.h:71
GDestroyNotify headline_destroy
Callback to use for destroying the headline-data.
Definition: gtkblist.h:125
GtkWidget * headline_image
Image for headline notifications.
Definition: gtkblist.h:121
GdkRectangle contact_rect
This is the bounding rectangle of the contact node and its children.
Definition: gtkblist.h:105
GtkWidget * main_vbox
This vbox contains the menu and notebook.
Definition: gtkblist.h:75
GtkWidget * treeview
It's a treeview...
Definition: gtkblist.h:79
GtkWidget * tipwindow
The window used by the tooltip.
Definition: gtkblist.h:110
GtkWidget * headline_label
Label for headline notifications.
Definition: gtkblist.h:120
GdkRectangle tip_rect
This is the bounding rectangle of the cell we're currently hovering over.
Definition: gtkblist.h:102
GList * tooltipdata
The data for each "chunk" of the tooltip.
Definition: gtkblist.h:111
GHashTable * connection_errors
Caches connection error messages; keys are PurpleAccount and values are non-NULL const char *s contai...
Definition: gtkblist.h:96
GtkWidget * menutrayicon
The menu tray icon.
Definition: gtkblist.h:87
GtkTreeStore * treemodel
This is the treemodel.
Definition: gtkblist.h:80
GtkWidget * vbox
This is the vbox that everything important gets packed into.
Definition: gtkblist.h:76
guint drag_timeout
The timeout for expanding contacts on drags.
Definition: gtkblist.h:101
guint timeout
The timeout for the tooltip.
Definition: gtkblist.h:100
GtkTreeViewColumn * text_column
Column.
Definition: gtkblist.h:81
GdkPixbuf * headline_close
Definition: gtkblist.h:122
GtkWidget * error_buttons
Box containing the connection error buttons.
Definition: gtkblist.h:128
gboolean changing_style
True when changing GTK+ theme style.
Definition: gtkblist.h:126
PurpleBlistNode * mouseover_contact
This is the contact currently mouse-over expanded.
Definition: gtkblist.h:108
GdkCursor * arrow_cursor
Arrow cursor.
Definition: gtkblist.h:116
GtkWidget * headline_hbox
Hbox for headline notification.
Definition: gtkblist.h:119
GdkPixbuf * empty_avatar
A 32x32 transparent pixbuf.
Definition: gtkblist.h:130
GtkWidget * scrollbook
Scrollbook for alerts.
Definition: gtkblist.h:118
GCallback headline_callback
Callback for headline notifications.
Definition: gtkblist.h:123
GtkWidget * notebook
The notebook that switches between the real buddy list and the helpful instructions page.
Definition: gtkblist.h:73
gpointer headline_data
User data for headline notifications.
Definition: gtkblist.h:124
PurpleBlistNode * selected_node
The currently selected node.
Definition: gtkblist.h:113
GdkCursor * hand_cursor
Hand cursor.
Definition: gtkblist.h:115
gpointer priv
Pointer to opaque private data.
Definition: gtkblist.h:132
GtkWidget * menutray
The menu tray widget.
Definition: gtkblist.h:86
guint refresh_timer
The timer for refreshing every 30 seconds.
Definition: gtkblist.h:98
GtkWidget * statusbox
The status selector dropdown.
Definition: gtkblist.h:129
Structure representing an account.
Definition: account.h:170
A Buddy list node.
Definition: blist.h:126
Buddy list UI operations.
Definition: blist.h:206
The Buddy List.
Definition: blist.h:191
A buddy.
Definition: blist.h:140