| 1 /* |
|
| 2 * Pidgin - Internet Messenger |
|
| 3 * Copyright (C) Pidgin Developers <devel@pidgin.im> |
|
| 4 * |
|
| 5 * Pidgin is the legal property of its developers, whose names are too numerous |
|
| 6 * to list here. Please refer to the COPYRIGHT file distributed with this |
|
| 7 * source distribution. |
|
| 8 * |
|
| 9 * This program is free software; you can redistribute it and/or modify |
|
| 10 * it under the terms of the GNU General Public License as published by |
|
| 11 * the Free Software Foundation; either version 2 of the License, or |
|
| 12 * (at your option) any later version. |
|
| 13 * |
|
| 14 * This program is distributed in the hope that it will be useful, |
|
| 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 17 * GNU General Public License for more details. |
|
| 18 * |
|
| 19 * You should have received a copy of the GNU General Public License |
|
| 20 * along with this program; if not, see <https://www.gnu.org/licenses/>. |
|
| 21 */ |
|
| 22 |
|
| 23 #if !defined(PIDGIN_GLOBAL_HEADER_INSIDE) && !defined(PIDGIN_COMPILATION) |
|
| 24 # error "only <pidgin.h> may be included directly" |
|
| 25 #endif |
|
| 26 |
|
| 27 #ifndef PIDGIN_ACCOUNT_STORE_H |
|
| 28 #define PIDGIN_ACCOUNT_STORE_H |
|
| 29 |
|
| 30 #include <gtk/gtk.h> |
|
| 31 |
|
| 32 #include <purple.h> |
|
| 33 |
|
| 34 /** |
|
| 35 * PidginAccountStore: |
|
| 36 * |
|
| 37 * #PidginAccountStore is a #GtkListStore that automatically keeps track of |
|
| 38 * what accounts are currently available in libpurple. It's intended to be |
|
| 39 * used any time that you need to present an account selection to the user. |
|
| 40 * |
|
| 41 * Since: 3.0.0 |
|
| 42 */ |
|
| 43 |
|
| 44 /** |
|
| 45 * PidginAccountStoreColumn: |
|
| 46 * @PIDGIN_ACCOUNT_STORE_COLUMN_ACCOUNT: This column holds a reference to the |
|
| 47 * #PurpleAccount. |
|
| 48 * @PIDGIN_ACCOUNT_STORE_COLUMN_MARKUP: This column holds a pango markup to |
|
| 49 * display the account to the user. |
|
| 50 * @PIDGIN_ACCOUNT_STORE_COLUMN_ICON: This column holds an icon in a #GdkPixbuf |
|
| 51 * for the account. |
|
| 52 * |
|
| 53 * Constants for accessing columns in a #PidginAccountStore. |
|
| 54 * |
|
| 55 * Since: 3.0.0 |
|
| 56 */ |
|
| 57 typedef enum { |
|
| 58 PIDGIN_ACCOUNT_STORE_COLUMN_ACCOUNT, |
|
| 59 PIDGIN_ACCOUNT_STORE_COLUMN_MARKUP, |
|
| 60 PIDGIN_ACCOUNT_STORE_COLUMN_ICON_NAME, |
|
| 61 /*< private >*/ |
|
| 62 PIDGIN_ACCOUNT_STORE_N_COLUMNS, |
|
| 63 } PidginAccountStoreColumn; |
|
| 64 |
|
| 65 G_BEGIN_DECLS |
|
| 66 |
|
| 67 #define PIDGIN_TYPE_ACCOUNT_STORE pidgin_account_store_get_type() |
|
| 68 G_DECLARE_FINAL_TYPE(PidginAccountStore, pidgin_account_store, PIDGIN, |
|
| 69 ACCOUNT_STORE, GtkListStore) |
|
| 70 |
|
| 71 /** |
|
| 72 * pidgin_account_store_new: |
|
| 73 * |
|
| 74 * Creates a new #PidginAccountStore that can be used anywhere a #GtkListStore |
|
| 75 * can be used. |
|
| 76 * |
|
| 77 * Returns: (transfer full): The new #PidginAccountStore instance. |
|
| 78 * |
|
| 79 * Since: 3.0.0 |
|
| 80 */ |
|
| 81 GtkListStore *pidgin_account_store_new(void); |
|
| 82 |
|
| 83 /** |
|
| 84 * pidgin_account_store_filter_connected: |
|
| 85 * @model: The #GtkTreeModel that's being filtered. |
|
| 86 * @iter: The #GtkTreeIter to check. |
|
| 87 * @data: Userdata passed to gtk_tree_model_filter_set_visible_func(). |
|
| 88 * |
|
| 89 * pidgin_account_store_filter_connected() is a #GtkTreeModelFilterVisibleFunc |
|
| 90 * that can be set on a #GtkTreeModelFilter via |
|
| 91 * gtk_tree_model_filter_set_visible_func(), to only show accounts that are |
|
| 92 * currently connected. |
|
| 93 * |
|
| 94 * Returns: %TRUE if the account will be displayed, %FALSE otherwise. |
|
| 95 */ |
|
| 96 gboolean pidgin_account_store_filter_connected(GtkTreeModel *model, GtkTreeIter *iter, gpointer data); |
|
| 97 |
|
| 98 G_END_DECLS |
|
| 99 |
|
| 100 #endif /* PIDGIN_ACCOUNT_STORE_H */ |
|