]> git.0d.be Git - empathy.git/blob - tp-account-widgets/empathy-account-widget.h
261901fe782ff14bb680c265271d4310e8a48c62
[empathy.git] / tp-account-widgets / empathy-account-widget.h
1 /*
2  * Copyright (C) 2006-2007 Imendio AB
3  * Copyright (C) 2007-2008 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: Xavier Claessens <xclaesse@gmail.com>
21  *          Martyn Russell <martyn@imendio.com>
22  */
23
24 #ifndef __TPAW_ACCOUNT_WIDGET_H__
25 #define __TPAW_ACCOUNT_WIDGET_H__
26
27 #include <gtk/gtk.h>
28
29 #include "empathy-account-settings.h"
30
31 G_BEGIN_DECLS
32
33 #define TPAW_TYPE_ACCOUNT_WIDGET tpaw_account_widget_get_type()
34 #define TPAW_ACCOUNT_WIDGET(obj) \
35   (G_TYPE_CHECK_INSTANCE_CAST ((obj), TPAW_TYPE_ACCOUNT_WIDGET, TpawAccountWidget))
36 #define TPAW_ACCOUNT_WIDGET_CLASS(klass) \
37   (G_TYPE_CHECK_CLASS_CAST ((klass), TPAW_TYPE_ACCOUNT_WIDGET, TpawAccountWidgetClass))
38 #define TPAW_IS_ACCOUNT_WIDGET(obj) \
39   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TPAW_TYPE_ACCOUNT_WIDGET))
40 #define TPAW_IS_ACCOUNT_WIDGET_CLASS(klass) \
41   (G_TYPE_CHECK_CLASS_TYPE ((klass), TPAW_TYPE_ACCOUNT_WIDGET))
42 #define TPAW_ACCOUNT_WIDGET_GET_CLASS(obj) \
43   (G_TYPE_INSTANCE_GET_CLASS ((obj), TPAW_TYPE_ACCOUNT_WIDGET, TpawAccountWidgetClass))
44
45 typedef struct _TpawAccountWidgetPriv TpawAccountWidgetPriv;
46 typedef struct _TpawAccountWidgetUIDetails TpawAccountWidgetUIDetails;
47
48 typedef struct {
49   GtkBox parent;
50
51   TpawAccountWidgetUIDetails *ui_details;
52
53   TpawAccountWidgetPriv *priv;
54 } TpawAccountWidget;
55
56 typedef struct {
57   GtkBoxClass parent_class;
58 } TpawAccountWidgetClass;
59
60 GType tpaw_account_widget_get_type (void);
61
62 TpawAccountWidget * tpaw_account_widget_new_for_protocol (
63     EmpathyAccountSettings *settings,
64     gboolean simple);
65
66 gboolean tpaw_account_widget_contains_pending_changes
67     (TpawAccountWidget *widget);
68 void tpaw_account_widget_discard_pending_changes
69     (TpawAccountWidget *widget);
70
71 gchar * tpaw_account_widget_get_default_display_name (
72     TpawAccountWidget *widget);
73
74 void tpaw_account_widget_set_account_param (TpawAccountWidget *widget,
75     const gchar *account);
76
77 void tpaw_account_widget_set_password_param (TpawAccountWidget *self,
78     const gchar *password);
79
80 void tpaw_account_widget_set_other_accounts_exist (
81     TpawAccountWidget *self, gboolean others_exist);
82
83 void tpaw_account_widget_hide_buttons (TpawAccountWidget *self);
84
85 void tpaw_account_widget_apply_and_log_in (TpawAccountWidget *self);
86
87 /* protected methods */
88 void tpaw_account_widget_changed (TpawAccountWidget *widget);
89
90 EmpathyAccountSettings * tpaw_account_widget_get_settings (
91     TpawAccountWidget *self);
92
93 G_END_DECLS
94
95 #endif /* __TPAW_ACCOUNT_WIDGET_H__ */