1 /*
2  * account-manager.h - proxy for the Telepathy account manager
3  *
4  * Copyright (C) 2009 Collabora Ltd. <http://www.collabora.co.uk/>
5  * Copyright (C) 2009 Nokia Corporation
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
20  */
21 
22 #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION)
23 #error "Only <telepathy-glib/telepathy-glib.h> and <telepathy-glib/telepathy-glib-dbus.h> can be included directly."
24 #endif
25 
26 #ifndef TP_ACCOUNT_MANAGER_H
27 #define TP_ACCOUNT_MANAGER_H
28 
29 #include <telepathy-glib/account.h>
30 #include <telepathy-glib/dbus.h>
31 #include <telepathy-glib/defs.h>
32 #include <telepathy-glib/proxy.h>
33 
34 G_BEGIN_DECLS
35 
36 typedef struct _TpAccountManager TpAccountManager;
37 typedef struct _TpAccountManagerClass TpAccountManagerClass;
38 typedef struct _TpAccountManagerPrivate TpAccountManagerPrivate;
39 typedef struct _TpAccountManagerClassPrivate TpAccountManagerClassPrivate;
40 
41 struct _TpAccountManager {
42     /*<private>*/
43     TpProxy parent;
44     TpAccountManagerPrivate *priv;
45 };
46 
47 struct _TpAccountManagerClass {
48     /*<private>*/
49     TpProxyClass parent_class;
50     GCallback _padding[7];
51     TpAccountManagerClassPrivate *priv;
52 };
53 
54 GType tp_account_manager_get_type (void);
55 
56 #define TP_TYPE_ACCOUNT_MANAGER \
57   (tp_account_manager_get_type ())
58 #define TP_ACCOUNT_MANAGER(obj) \
59   (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_ACCOUNT_MANAGER, \
60                                TpAccountManager))
61 #define TP_ACCOUNT_MANAGER_CLASS(klass) \
62   (G_TYPE_CHECK_CLASS_CAST ((klass), TP_TYPE_ACCOUNT_MANAGER, \
63                             TpAccountManagerClass))
64 #define TP_IS_ACCOUNT_MANAGER(obj) \
65   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_ACCOUNT_MANAGER))
66 #define TP_IS_ACCOUNT_MANAGER_CLASS(klass) \
67   (G_TYPE_CHECK_CLASS_TYPE ((klass), TP_TYPE_ACCOUNT_MANAGER))
68 #define TP_ACCOUNT_MANAGER_GET_CLASS(obj) \
69   (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_ACCOUNT_MANAGER, \
70                               TpAccountManagerClass))
71 
72 #define TP_ACCOUNT_MANAGER_FEATURE_CORE \
73   tp_account_manager_get_feature_quark_core ()
74 
75 GQuark tp_account_manager_get_feature_quark_core (void) G_GNUC_CONST;
76 
77 TpAccountManager *tp_account_manager_new (TpDBusDaemon *bus_daemon)
78   G_GNUC_WARN_UNUSED_RESULT;
79 
80 TpAccountManager *tp_account_manager_new_with_factory (
81     TpSimpleClientFactory *factory) G_GNUC_WARN_UNUSED_RESULT;
82 
83 _TP_AVAILABLE_IN_0_16
84 void tp_account_manager_set_default (TpAccountManager *manager);
85 
86 _TP_AVAILABLE_IN_0_20
87 gboolean tp_account_manager_can_set_default (void);
88 
89 TpAccountManager *tp_account_manager_dup (void) G_GNUC_WARN_UNUSED_RESULT;
90 
91 void tp_account_manager_init_known_interfaces (void);
92 
93 #ifndef TP_DISABLE_DEPRECATED
94 _TP_DEPRECATED_IN_0_16_FOR (tp_simple_client_factory_ensure_account)
95 TpAccount *tp_account_manager_ensure_account (TpAccountManager *manager,
96     const gchar *path);
97 #endif
98 
99 #ifndef TP_DISABLE_DEPRECATED
100 _TP_DEPRECATED_IN_0_20_FOR (tp_account_manager_dup_valid_accounts)
101 GList *tp_account_manager_get_valid_accounts (TpAccountManager *manager)
102   G_GNUC_WARN_UNUSED_RESULT;
103 #endif
104 
105 _TP_AVAILABLE_IN_0_20
106 GList *tp_account_manager_dup_valid_accounts (TpAccountManager *manager)
107   G_GNUC_WARN_UNUSED_RESULT;
108 
109 void tp_account_manager_set_all_requested_presences (TpAccountManager *manager,
110     TpConnectionPresenceType type, const gchar *status, const gchar *message);
111 
112 TpConnectionPresenceType tp_account_manager_get_most_available_presence (
113     TpAccountManager *manager, gchar **status, gchar **message);
114 
115 void tp_account_manager_create_account_async (TpAccountManager *manager,
116     const gchar *connection_manager, const gchar *protocol,
117     const gchar *display_name, GHashTable *parameters, GHashTable *properties,
118     GAsyncReadyCallback callback, gpointer user_data);
119 
120 TpAccount * tp_account_manager_create_account_finish (
121     TpAccountManager *manager, GAsyncResult *result, GError **error)
122   G_GNUC_WARN_UNUSED_RESULT;
123 
124 #ifndef TP_DISABLE_DEPRECATED
125 _TP_DEPRECATED_IN_0_24_FOR(tp_proxy_is_prepared)
126 gboolean tp_account_manager_is_prepared (TpAccountManager *manager,
127     GQuark feature);
128 
129 _TP_DEPRECATED_IN_0_16_FOR (tp_proxy_prepare_async)
130 void tp_account_manager_prepare_async (TpAccountManager *manager,
131     const GQuark *features,
132     GAsyncReadyCallback callback,
133     gpointer user_data);
134 
135 _TP_DEPRECATED_IN_0_16_FOR (tp_proxy_prepare_finish)
136 gboolean tp_account_manager_prepare_finish (TpAccountManager *manager,
137     GAsyncResult *result,
138     GError **error);
139 #endif
140 
141 void tp_account_manager_enable_restart (TpAccountManager *manager);
142 
143 G_END_DECLS
144 
145 #include <telepathy-glib/_gen/tp-cli-account-manager.h>
146 
147 #endif
148