pidgin/gtkutils.h

changeset 18966
6a0715b72b6b
parent 18672
da4db1be5d98
child 19240
34cf5e1a241b
child 19547
0c3fcdc6a025
equal deleted inserted replaced
18965:5c943654d258 18966:6a0715b72b6b
27 27
28 #include "gtkconv.h" 28 #include "gtkconv.h"
29 #include "pidgin.h" 29 #include "pidgin.h"
30 #include "prpl.h" 30 #include "prpl.h"
31 #include "util.h" 31 #include "util.h"
32
33
34
35
32 36
33 typedef enum 37 typedef enum
34 { 38 {
35 PIDGIN_BUTTON_HORIZONTAL, 39 PIDGIN_BUTTON_HORIZONTAL,
36 PIDGIN_BUTTON_VERTICAL 40 PIDGIN_BUTTON_VERTICAL
61 PIDGIN_BROWSER_NEW_WINDOW, 65 PIDGIN_BROWSER_NEW_WINDOW,
62 PIDGIN_BROWSER_NEW_TAB 66 PIDGIN_BROWSER_NEW_TAB
63 67
64 } PidginBrowserPlace; 68 } PidginBrowserPlace;
65 #endif /* _WIN32 */ 69 #endif /* _WIN32 */
70
71 typedef struct {
72 gboolean is_buddy;
73 union {
74 PurpleBuddy *buddy;
75 PurpleLogSet *logged_buddy;
76 } entry;
77 } PidginBuddyCompletionEntry;
78
79 typedef gboolean (*PidginFilterBuddyCompletionEntryFunc) (const PidginBuddyCompletionEntry *completion_entry, gpointer user_data);
80
66 81
67 /** 82 /**
68 * Sets up a gtkimhtml widget, loads it with smileys, and sets the 83 * Sets up a gtkimhtml widget, loads it with smileys, and sets the
69 * default signal handlers. 84 * default signal handlers.
70 * 85 *
278 * @param account The PurpleAccount to select. 293 * @param account The PurpleAccount to select.
279 */ 294 */
280 void pidgin_account_option_menu_set_selected(GtkWidget *optmenu, PurpleAccount *account); 295 void pidgin_account_option_menu_set_selected(GtkWidget *optmenu, PurpleAccount *account);
281 296
282 /** 297 /**
298 * Add autocompletion of screenames to an entry, supporting a filtering function.
299 *
300 * @param entry The GtkEntry on which to setup autocomplete.
301 * @param optmenu A menu for accounts, returned by gaim_gtk_account_option_menu_new().
302 * If @a optmenu is not @c NULL, it'll be updated when a screenname is chosen
303 * from the autocomplete list.
304 * @param filter_func A function for checking if an autocomplete entry
305 * should be shown. This can be @c NULL.
306 * @param user_data The data to be passed to the filter_func function.
307 */
308 void pidgin_setup_screenname_autocomplete_with_filter(GtkWidget *entry, GtkWidget *optmenu, PidginFilterBuddyCompletionEntryFunc filter_func, gpointer user_data);
309
310 /**
311 * The default filter function for screenname autocomplete.
312 *
313 * @param completion_entry The completion entry to filter.
314 * @param online_accounts If this is @c FALSE, only the autocompletion entries
315 * which belong to an online account will be filtered.
316 * @return Returns @c TRUE if the autocompletion entry is filtered.
317 */
318 gboolean pidgin_screenname_autocomplete_default_filter(const PidginBuddyCompletionEntry *completion_entry, gpointer all_accounts);
319
320 /**
321 * @deprecated
283 * Add autocompletion of screenames to an entry. 322 * Add autocompletion of screenames to an entry.
323 * The usage of this function is deprecated. For new code, use the equivalent:
324 * pidgin_setup_screenname_autocomplete_with_filter(entry, optmenu, pidgin_screenname_autocomplete_default_filter, GINT_TO_POINTER(all))
284 * 325 *
285 * @param entry The GtkEntry on which to setup autocomplete. 326 * @param entry The GtkEntry on which to setup autocomplete.
286 * @param optmenu A menu for accounts, returned by pidgin_account_option_menu_new(). 327 * @param optmenu A menu for accounts, returned by pidgin_account_option_menu_new().
287 * If @a optmenu is not @c NULL, it'll be updated when a screenname is chosen 328 * If @a optmenu is not @c NULL, it'll be updated when a screenname is chosen
288 * from the autocomplete list. 329 * from the autocomplete list.
289 * @param all Whether to include screennames from disconnected accounts. 330 * @param all Whether to include screennames from disconnected accounts.
290 */ 331 */
291 void pidgin_setup_screenname_autocomplete(GtkWidget *entry, GtkWidget *optmenu, gboolean all); 332 void pidgin_setup_screenname_autocomplete(GtkWidget *entry, GtkWidget *optmenu, gboolean all);
292 333
293 /** 334 /**
294 * Check if the given path is a directory or not. If it is, then modify 335 * Check if the given path is a directory or not. If it is, then modify

mercurial