]> git.0d.be Git - empathy.git/blob - libempathy/empathy-account-settings.h
ea0c5b0486ae7f3caf4dfdc43ad0c0d0920851ed
[empathy.git] / libempathy / empathy-account-settings.h
1 /*
2  * empathy-account-settings.h - Header for EmpathyAccountSettings
3  * Copyright (C) 2009 Collabora Ltd.
4  * @author Sjoerd Simons <sjoerd.simons@collabora.co.uk>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library 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  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19  */
20
21 #ifndef __EMPATHY_ACCOUNT_SETTINGS_H__
22 #define __EMPATHY_ACCOUNT_SETTINGS_H__
23
24 #include <glib-object.h>
25 #include <gio/gio.h>
26
27 #include <telepathy-glib/account.h>
28 #include <telepathy-glib/connection-manager.h>
29
30 G_BEGIN_DECLS
31
32 typedef struct _EmpathyAccountSettings EmpathyAccountSettings;
33 typedef struct _EmpathyAccountSettingsClass EmpathyAccountSettingsClass;
34
35 struct _EmpathyAccountSettingsClass {
36     GObjectClass parent_class;
37 };
38
39 struct _EmpathyAccountSettings {
40     GObject parent;
41     gpointer priv;
42 };
43
44 GType empathy_account_settings_get_type (void);
45
46 /* TYPE MACROS */
47 #define EMPATHY_TYPE_ACCOUNT_SETTINGS \
48   (empathy_account_settings_get_type ())
49 #define EMPATHY_ACCOUNT_SETTINGS(obj) \
50   (G_TYPE_CHECK_INSTANCE_CAST((obj), \
51     EMPATHY_TYPE_ACCOUNT_SETTINGS, EmpathyAccountSettings))
52 #define EMPATHY_ACCOUNT_SETTINGS_CLASS(klass) \
53   (G_TYPE_CHECK_CLASS_CAST((klass), EMPATHY_TYPE_ACCOUNT_SETTINGS, \
54     EmpathyAccountSettingsClass))
55 #define EMPATHY_IS_ACCOUNT_SETTINGS(obj) \
56   (G_TYPE_CHECK_INSTANCE_TYPE((obj), EMPATHY_TYPE_ACCOUNT_SETTINGS))
57 #define EMPATHY_IS_ACCOUNT_SETTINGS_CLASS(klass) \
58   (G_TYPE_CHECK_CLASS_TYPE((klass), EMPATHY_TYPE_ACCOUNT_SETTINGS))
59 #define EMPATHY_ACCOUNT_SETTINGS_GET_CLASS(obj) \
60   (G_TYPE_INSTANCE_GET_CLASS ((obj), EMPATHY_TYPE_ACCOUNT_SETTINGS, \
61     EmpathyAccountSettingsClass))
62
63 EmpathyAccountSettings * empathy_account_settings_new (
64     const gchar *connection_manager,
65     const gchar *protocol,
66     const gchar *service,
67     const char *display_name);
68
69 EmpathyAccountSettings * empathy_account_settings_new_for_account (
70     TpAccount *account);
71
72 gboolean empathy_account_settings_is_ready (EmpathyAccountSettings *settings);
73
74 const gchar *empathy_account_settings_get_cm (EmpathyAccountSettings *settings);
75 const gchar *empathy_account_settings_get_protocol (
76     EmpathyAccountSettings *settings);
77
78 const gchar *empathy_account_settings_get_service (
79     EmpathyAccountSettings *settings);
80
81 TpAccount *empathy_account_settings_get_account (
82     EmpathyAccountSettings *settings);
83
84 gboolean empathy_account_settings_has_account (
85     EmpathyAccountSettings *settings, TpAccount *account);
86
87 TpConnectionManagerParam *empathy_account_settings_get_tp_params (
88     EmpathyAccountSettings *settings);
89
90 gboolean empathy_account_settings_have_tp_param (
91     EmpathyAccountSettings *settings,
92     const gchar *param);
93
94 void empathy_account_settings_unset (EmpathyAccountSettings *settings,
95     const gchar *param);
96
97 void empathy_account_settings_discard_changes (
98     EmpathyAccountSettings *settings);
99
100 const GValue *empathy_account_settings_get (EmpathyAccountSettings *settings,
101   const gchar *param);
102
103 const gchar *
104 empathy_account_settings_get_dbus_signature (EmpathyAccountSettings *setting,
105   const gchar *param);
106
107 const GValue *
108 empathy_account_settings_get_default (EmpathyAccountSettings *settings,
109   const gchar *param);
110
111 const gchar *empathy_account_settings_get_string (
112     EmpathyAccountSettings *settings,
113     const gchar *param);
114 const gchar * const * empathy_account_settings_get_strv (
115     EmpathyAccountSettings *settings,
116     const gchar *param);
117
118 gint32 empathy_account_settings_get_int32 (EmpathyAccountSettings *settings,
119     const gchar *param);
120 gint64 empathy_account_settings_get_int64 (EmpathyAccountSettings *settings,
121     const gchar *param);
122 guint32 empathy_account_settings_get_uint32 (EmpathyAccountSettings *settings,
123     const gchar *param);
124 guint64 empathy_account_settings_get_uint64 (EmpathyAccountSettings *settings,
125     const gchar *param);
126 gboolean empathy_account_settings_get_boolean (EmpathyAccountSettings *settings,
127     const gchar *param);
128
129 void empathy_account_settings_set_string (EmpathyAccountSettings *settings,
130     const gchar *param, const gchar *value);
131 void empathy_account_settings_set_strv (EmpathyAccountSettings *settings,
132     const gchar *param, gchar **value);
133
134 void empathy_account_settings_set_int32 (EmpathyAccountSettings *settings,
135     const gchar *param, gint32 value);
136 void empathy_account_settings_set_int64 (EmpathyAccountSettings *settings,
137     const gchar *param, gint64 value);
138 void empathy_account_settings_set_uint32 (EmpathyAccountSettings *settings,
139     const gchar *param, guint32 value);
140 void empathy_account_settings_set_uint64 (EmpathyAccountSettings *settings,
141     const gchar *param, guint64 value);
142
143 void empathy_account_settings_set_boolean (EmpathyAccountSettings *settings,
144     const gchar *param, gboolean value);
145
146 gchar *empathy_account_settings_get_icon_name (
147   EmpathyAccountSettings *settings);
148
149 void empathy_account_settings_set_icon_name_async (
150   EmpathyAccountSettings *settings,
151   const gchar *name,
152   GAsyncReadyCallback callback,
153   gpointer user_data);
154
155 gboolean empathy_account_settings_set_icon_name_finish (
156   EmpathyAccountSettings *settings,
157   GAsyncResult *result,
158   GError **error);
159
160 const gchar *empathy_account_settings_get_display_name (
161   EmpathyAccountSettings *settings);
162
163 void empathy_account_settings_set_display_name_async (
164   EmpathyAccountSettings *settings,
165   const gchar *name,
166   GAsyncReadyCallback callback,
167   gpointer user_data);
168
169 gboolean empathy_account_settings_set_display_name_finish (
170   EmpathyAccountSettings *settings,
171   GAsyncResult *result,
172   GError **error);
173
174 void empathy_account_settings_apply_async (EmpathyAccountSettings *settings,
175   GAsyncReadyCallback callback,
176   gpointer user_data);
177
178 gboolean empathy_account_settings_apply_finish (
179   EmpathyAccountSettings *settings,
180   GAsyncResult *result,
181   gboolean *reconnect_required,
182   GError **error);
183
184 void empathy_account_settings_set_regex (EmpathyAccountSettings *settings,
185   const gchar *param,
186   const gchar *regex);
187
188 gboolean empathy_account_settings_parameter_is_valid (
189     EmpathyAccountSettings *settings,
190     const gchar *param);
191
192 gboolean empathy_account_settings_is_valid (EmpathyAccountSettings *settings);
193
194 const TpConnectionManagerProtocol * empathy_account_settings_get_tp_protocol (
195     EmpathyAccountSettings *settings);
196
197 gboolean empathy_account_settings_supports_sasl (EmpathyAccountSettings *self);
198
199 gboolean empathy_account_settings_param_is_supported (
200     EmpathyAccountSettings *self,
201     const gchar *param);
202
203 void empathy_account_settings_set_uri_scheme_tel (EmpathyAccountSettings *self,
204     gboolean associate);
205
206 gboolean empathy_account_settings_has_uri_scheme_tel (
207     EmpathyAccountSettings *self);
208
209 G_END_DECLS
210
211 #endif /* #ifndef __EMPATHY_ACCOUNT_SETTINGS_H__*/