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__
28 #include <telepathy-glib/telepathy-glib.h>
32 #define EMPATHY_TYPE_ACCOUNT_CHOOSER (empathy_account_chooser_get_type ())
33 #define EMPATHY_ACCOUNT_CHOOSER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), EMPATHY_TYPE_ACCOUNT_CHOOSER, EmpathyAccountChooser))
34 #define EMPATHY_ACCOUNT_CHOOSER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), EMPATHY_TYPE_ACCOUNT_CHOOSER, EmpathyAccountChooserClass))
35 #define EMPATHY_IS_ACCOUNT_CHOOSER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), EMPATHY_TYPE_ACCOUNT_CHOOSER))
36 #define EMPATHY_IS_ACCOUNT_CHOOSER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), EMPATHY_TYPE_ACCOUNT_CHOOSER))
37 #define EMPATHY_ACCOUNT_CHOOSER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), EMPATHY_TYPE_ACCOUNT_CHOOSER, EmpathyAccountChooserClass))
40 * EmpathyAccountChooserFilterResultCallback:
41 * @is_enabled: indicated whether the account should be enabled
42 * @user_data: user data passed to the callback
44 typedef void (* EmpathyAccountChooserFilterResultCallback
) (gboolean is_enabled
,
48 * EmpathyAccountChooserFilterFunc:
49 * @account: a #TpAccount
50 * @callback: an #EmpathyAccountChooserFilterResultCallback accepting the result
51 * @callback_data: data passed to the @callback
52 * @user_data: user data passed to the callback
54 typedef void (* EmpathyAccountChooserFilterFunc
) (
56 EmpathyAccountChooserFilterResultCallback callback
,
57 gpointer callback_data
,
61 typedef struct _EmpathyAccountChooser EmpathyAccountChooser
;
62 typedef struct _EmpathyAccountChooserClass EmpathyAccountChooserClass
;
63 typedef struct _EmpathyAccountChooserPriv EmpathyAccountChooserPriv
;
65 struct _EmpathyAccountChooser
70 EmpathyAccountChooserPriv
*priv
;
73 struct _EmpathyAccountChooserClass
75 GtkComboBoxClass parent_class
;
78 GType
empathy_account_chooser_get_type (void) G_GNUC_CONST
;
80 GtkWidget
* empathy_account_chooser_new (void);
82 TpAccount
* empathy_account_chooser_dup_account (EmpathyAccountChooser
*self
);
83 TpAccount
* empathy_account_chooser_get_account (EmpathyAccountChooser
*self
);
85 gboolean
empathy_account_chooser_set_account (EmpathyAccountChooser
*self
,
88 TpConnection
* empathy_account_chooser_get_connection (
89 EmpathyAccountChooser
*self
);
91 void empathy_account_chooser_set_all (EmpathyAccountChooser
*self
);
93 TpAccountManager
* empathy_account_chooser_get_account_manager (
94 EmpathyAccountChooser
*self
);
96 gboolean
empathy_account_chooser_get_has_all_option (
97 EmpathyAccountChooser
*self
);
99 void empathy_account_chooser_set_has_all_option (EmpathyAccountChooser
*self
,
100 gboolean has_all_option
);
102 gboolean
empathy_account_chooser_has_all_selected (EmpathyAccountChooser
*self
);
104 void empathy_account_chooser_set_filter (EmpathyAccountChooser
*self
,
105 EmpathyAccountChooserFilterFunc filter
,
108 gboolean
empathy_account_chooser_is_ready (EmpathyAccountChooser
*self
);
110 void empathy_account_chooser_refilter (EmpathyAccountChooser
*self
);
112 /* Pre-defined filters */
114 void empathy_account_chooser_filter_is_connected (TpAccount
*account
,
115 EmpathyAccountChooserFilterResultCallback callback
,
116 gpointer callback_data
,
119 void empathy_account_chooser_filter_supports_chatrooms (TpAccount
*account
,
120 EmpathyAccountChooserFilterResultCallback callback
,
121 gpointer callback_data
,
126 #endif /* __EMPATHY_ACCOUNT_CHOOSER_H__ */