]> git.0d.be Git - empathy.git/blob - libempathy-gtk/empathy-account-chooser.h
Merge branch 'gnome-3-8'
[empathy.git] / libempathy-gtk / empathy-account-chooser.h
1 /*
2  * Copyright (C) 2005-2007 Imendio AB
3  * Copyright (C) 2007-2011 Collabora Ltd.
4  *
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.
9  *
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.
14  *
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
19  *
20  * Authors: Martyn Russell <martyn@imendio.com>
21  *          Xavier Claessens <xclaesse@gmail.com>
22  */
23
24 #ifndef __EMPATHY_ACCOUNT_CHOOSER_H__
25 #define __EMPATHY_ACCOUNT_CHOOSER_H__
26
27 #include <gtk/gtk.h>
28 #include <telepathy-glib/telepathy-glib.h>
29
30 G_BEGIN_DECLS
31
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))
38
39 /**
40  * EmpathyAccountChooserFilterResultCallback:
41  * @is_enabled: indicated whether the account should be enabled
42  * @user_data: user data passed to the callback
43  */
44 typedef void (* EmpathyAccountChooserFilterResultCallback) (gboolean is_enabled,
45     gpointer user_data);
46
47 /**
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
53  */
54 typedef void (* EmpathyAccountChooserFilterFunc) (
55   TpAccount *account,
56   EmpathyAccountChooserFilterResultCallback callback,
57   gpointer callback_data,
58   gpointer user_data);
59
60
61 typedef struct _EmpathyAccountChooser EmpathyAccountChooser;
62 typedef struct _EmpathyAccountChooserClass EmpathyAccountChooserClass;
63 typedef struct _EmpathyAccountChooserPriv EmpathyAccountChooserPriv;
64
65 struct _EmpathyAccountChooser
66 {
67   GtkComboBox parent;
68
69   /*<private>*/
70   EmpathyAccountChooserPriv *priv;
71 };
72
73 struct _EmpathyAccountChooserClass
74 {
75   GtkComboBoxClass parent_class;
76 };
77
78 GType empathy_account_chooser_get_type (void) G_GNUC_CONST;
79
80 GtkWidget * empathy_account_chooser_new (void);
81
82 TpAccount * empathy_account_chooser_dup_account (EmpathyAccountChooser *self);
83 TpAccount * empathy_account_chooser_get_account (EmpathyAccountChooser *self);
84
85 gboolean empathy_account_chooser_set_account (EmpathyAccountChooser *self,
86     TpAccount *account);
87
88 TpConnection * empathy_account_chooser_get_connection (
89     EmpathyAccountChooser *self);
90
91 void empathy_account_chooser_set_all (EmpathyAccountChooser *self);
92
93 TpAccountManager * empathy_account_chooser_get_account_manager (
94     EmpathyAccountChooser *self);
95
96 gboolean empathy_account_chooser_get_has_all_option (
97     EmpathyAccountChooser *self);
98
99 void empathy_account_chooser_set_has_all_option (EmpathyAccountChooser *self,
100     gboolean has_all_option);
101
102 gboolean empathy_account_chooser_has_all_selected (EmpathyAccountChooser *self);
103
104 void empathy_account_chooser_set_filter (EmpathyAccountChooser *self,
105     EmpathyAccountChooserFilterFunc filter,
106     gpointer user_data);
107
108 gboolean empathy_account_chooser_is_ready (EmpathyAccountChooser *self);
109
110 void empathy_account_chooser_refilter (EmpathyAccountChooser *self);
111
112 /* Pre-defined filters */
113
114 void empathy_account_chooser_filter_is_connected (TpAccount *account,
115     EmpathyAccountChooserFilterResultCallback callback,
116     gpointer callback_data,
117     gpointer user_data);
118
119 void empathy_account_chooser_filter_supports_chatrooms (TpAccount *account,
120     EmpathyAccountChooserFilterResultCallback callback,
121     gpointer callback_data,
122     gpointer user_data);
123
124 G_END_DECLS
125
126 #endif /* __EMPATHY_ACCOUNT_CHOOSER_H__ */