2 * Copyright (C) 2005-2007 Imendio AB
3 * Copyright (C) 2007-2011 Collabora Ltd.
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 2 of the
8 * License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
15 * You should have received a copy of the GNU General Public
16 * License along with this program; if not, write to the
17 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
18 * Boston, MA 02110-1301 USA
20 * Authors: Martyn Russell <martyn@imendio.com>
21 * Xavier Claessens <xclaesse@gmail.com>
24 #ifndef __EMPATHY_ACCOUNT_CHOOSER_H__
25 #define __EMPATHY_ACCOUNT_CHOOSER_H__
29 #include <telepathy-glib/telepathy-glib.h>
33 #define EMPATHY_TYPE_ACCOUNT_CHOOSER (empathy_account_chooser_get_type ())
34 #define EMPATHY_ACCOUNT_CHOOSER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), EMPATHY_TYPE_ACCOUNT_CHOOSER, EmpathyAccountChooser))
35 #define EMPATHY_ACCOUNT_CHOOSER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), EMPATHY_TYPE_ACCOUNT_CHOOSER, EmpathyAccountChooserClass))
36 #define EMPATHY_IS_ACCOUNT_CHOOSER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), EMPATHY_TYPE_ACCOUNT_CHOOSER))
37 #define EMPATHY_IS_ACCOUNT_CHOOSER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), EMPATHY_TYPE_ACCOUNT_CHOOSER))
38 #define EMPATHY_ACCOUNT_CHOOSER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), EMPATHY_TYPE_ACCOUNT_CHOOSER, EmpathyAccountChooserClass))
41 * EmpathyAccountChooserFilterResultCallback:
42 * @is_enabled: indicated whether the account should be enabled
43 * @user_data: user data passed to the callback
45 typedef void (* EmpathyAccountChooserFilterResultCallback) (gboolean is_enabled,
49 * EmpathyAccountChooserFilterFunc:
50 * @account: a #TpAccount
51 * @callback: an #EmpathyAccountChooserFilterResultCallback accepting the result
52 * @callback_data: data passed to the @callback
53 * @user_data: user data passed to the callback
55 typedef void (* EmpathyAccountChooserFilterFunc) (
57 EmpathyAccountChooserFilterResultCallback callback,
58 gpointer callback_data,
62 typedef struct _EmpathyAccountChooser EmpathyAccountChooser;
63 typedef struct _EmpathyAccountChooserClass EmpathyAccountChooserClass;
64 typedef struct _EmpathyAccountChooserPriv EmpathyAccountChooserPriv;
66 struct _EmpathyAccountChooser
71 EmpathyAccountChooserPriv *priv;
74 struct _EmpathyAccountChooserClass
76 GtkComboBoxClass parent_class;
79 GType empathy_account_chooser_get_type (void) G_GNUC_CONST;
81 GtkWidget * empathy_account_chooser_new (void);
83 TpAccount * empathy_account_chooser_dup_account (EmpathyAccountChooser *self);
84 TpAccount * empathy_account_chooser_get_account (EmpathyAccountChooser *self);
86 gboolean empathy_account_chooser_set_account (EmpathyAccountChooser *self,
89 TpConnection * empathy_account_chooser_get_connection (
90 EmpathyAccountChooser *self);
92 void empathy_account_chooser_set_all (EmpathyAccountChooser *self);
94 TpAccountManager * empathy_account_chooser_get_account_manager (
95 EmpathyAccountChooser *self);
97 gboolean empathy_account_chooser_get_has_all_option (
98 EmpathyAccountChooser *self);
100 void empathy_account_chooser_set_has_all_option (EmpathyAccountChooser *self,
101 gboolean has_all_option);
103 gboolean empathy_account_chooser_has_all_selected (EmpathyAccountChooser *self);
105 void empathy_account_chooser_set_filter (EmpathyAccountChooser *self,
106 EmpathyAccountChooserFilterFunc filter,
109 gboolean empathy_account_chooser_is_ready (EmpathyAccountChooser *self);
111 void empathy_account_chooser_refilter (EmpathyAccountChooser *self);
113 /* Pre-defined filters */
115 void empathy_account_chooser_filter_is_connected (TpAccount *account,
116 EmpathyAccountChooserFilterResultCallback callback,
117 gpointer callback_data,
120 void empathy_account_chooser_filter_supports_chatrooms (TpAccount *account,
121 EmpathyAccountChooserFilterResultCallback callback,
122 gpointer callback_data,
127 #endif /* __EMPATHY_ACCOUNT_CHOOSER_H__ */