]> git.0d.be Git - empathy.git/blob - libempathy-gtk/empathy-account-chooser.h
theme_adium_parse_body: use the cache GSettings chat
[empathy.git] / libempathy-gtk / empathy-account-chooser.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3  * Copyright (C) 2005-2007 Imendio AB
4  * Copyright (C) 2007-2008 Collabora Ltd.
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License as
8  * published by the Free Software Foundation; either version 2 of the
9  * License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public
17  * License along with this program; if not, write to the
18  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
19  * Boston, MA  02110-1301  USA
20  *
21  * Authors: Martyn Russell <martyn@imendio.com>
22  *          Xavier Claessens <xclaesse@gmail.com>
23  */
24
25 #ifndef __EMPATHY_ACCOUNT_CHOOSER_H__
26 #define __EMPATHY_ACCOUNT_CHOOSER_H__
27
28 #include <gtk/gtk.h>
29
30 #include <telepathy-glib/account.h>
31
32 G_BEGIN_DECLS
33
34 #define EMPATHY_TYPE_ACCOUNT_CHOOSER (empathy_account_chooser_get_type ())
35 #define EMPATHY_ACCOUNT_CHOOSER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), EMPATHY_TYPE_ACCOUNT_CHOOSER, EmpathyAccountChooser))
36 #define EMPATHY_ACCOUNT_CHOOSER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), EMPATHY_TYPE_ACCOUNT_CHOOSER, EmpathyAccountChooserClass))
37 #define EMPATHY_IS_ACCOUNT_CHOOSER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), EMPATHY_TYPE_ACCOUNT_CHOOSER))
38 #define EMPATHY_IS_ACCOUNT_CHOOSER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), EMPATHY_TYPE_ACCOUNT_CHOOSER))
39 #define EMPATHY_ACCOUNT_CHOOSER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), EMPATHY_TYPE_ACCOUNT_CHOOSER, EmpathyAccountChooserClass))
40
41 /**
42  * EmpathyAccountChooserFilterResultCallback:
43  * @is_enabled: indicated whether the account should be enabled
44  * @user_data: user data passed to the callback
45  */
46 typedef void (* EmpathyAccountChooserFilterResultCallback) (gboolean is_enabled,
47                                                             gpointer user_data);
48
49 /**
50  * EmpathyAccountChooserFilterFunc:
51  * @account: a #TpAccount
52  * @callback: an #EmpathyAccountChooserFilterResultCallback accepting the result
53  * @callback_data: data passed to the @callback
54  * @user_data: user data passed to the callback
55  */
56 typedef void (* EmpathyAccountChooserFilterFunc) (
57         TpAccount                                 *account,
58         EmpathyAccountChooserFilterResultCallback  callback,
59         gpointer                                   callback_data,
60         gpointer                                   user_data);
61
62
63 typedef struct _EmpathyAccountChooser      EmpathyAccountChooser;
64 typedef struct _EmpathyAccountChooserClass EmpathyAccountChooserClass;
65
66 struct _EmpathyAccountChooser {
67         GtkComboBox parent;
68
69         /*<private>*/
70         gpointer priv;
71 };
72
73 struct _EmpathyAccountChooserClass {
74         GtkComboBoxClass parent_class;
75 };
76
77 GType          empathy_account_chooser_get_type           (void) G_GNUC_CONST;
78 GtkWidget *    empathy_account_chooser_new                (void);
79 TpAccount *    empathy_account_chooser_dup_account        (EmpathyAccountChooser *chooser);
80 TpAccount *    empathy_account_chooser_get_account        (EmpathyAccountChooser *chooser);
81 TpConnection * empathy_account_chooser_get_connection     (EmpathyAccountChooser *chooser);
82 gboolean       empathy_account_chooser_set_account        (EmpathyAccountChooser *chooser,
83                                                            TpAccount             *account);
84 gboolean       empathy_account_chooser_get_has_all_option (EmpathyAccountChooser *chooser);
85 void           empathy_account_chooser_set_has_all_option (EmpathyAccountChooser *chooser,
86                                                            gboolean               has_all_option);
87 void           empathy_account_chooser_set_filter         (EmpathyAccountChooser *chooser,
88                                                            EmpathyAccountChooserFilterFunc filter,
89                                                            gpointer               user_data);
90 void           empathy_account_chooser_filter_is_connected (TpAccount             *account,
91                                                            EmpathyAccountChooserFilterResultCallback callback,
92                                                            gpointer               callback_data,
93                                                            gpointer               user_data);
94 gboolean       empathy_account_chooser_is_ready (EmpathyAccountChooser *chooser);
95
96 G_END_DECLS
97
98 #endif /* __EMPATHY_ACCOUNT_CHOOSER_H__ */
99