1 /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
3 * Copyright (C) 2008 Collabora Ltd.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library 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 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 * Authors: Cosimo Cecchi <cosimo.cecchi@collabora.co.uk>
22 #ifndef __EMPATHY_ACCOUNT_MANAGER_H__
23 #define __EMPATHY_ACCOUNT_MANAGER_H__
25 #include <glib-object.h>
27 #include "empathy-account.h"
31 #define EMPATHY_TYPE_ACCOUNT_MANAGER (empathy_account_manager_get_type ())
32 #define EMPATHY_ACCOUNT_MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), \
33 EMPATHY_TYPE_ACCOUNT_MANAGER, EmpathyAccountManager))
34 #define EMPATHY_ACCOUNT_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), \
35 EMPATHY_TYPE_ACCOUNT_MANAGER, EmpathyAccountManagerClass))
36 #define EMPATHY_IS_ACCOUNT_MANAGER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), \
37 EMPATHY_TYPE_ACCOUNT_MANAGER))
38 #define EMPATHY_IS_ACCOUNT_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), \
39 EMPATHY_TYPE_ACCOUNT_MANAGER))
40 #define EMPATHY_ACCOUNT_MANAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), \
41 EMPATHY_TYPE_ACCOUNT_MANAGER, EmpathyAccountManagerClass))
43 typedef struct _EmpathyAccountManager EmpathyAccountManager;
44 typedef struct _EmpathyAccountManagerClass EmpathyAccountManagerClass;
46 struct _EmpathyAccountManager {
51 struct _EmpathyAccountManagerClass {
52 GObjectClass parent_class;
55 GType empathy_account_manager_get_type (void);
59 EmpathyAccountManager * empathy_account_manager_dup_singleton (void);
61 gboolean empathy_account_manager_is_ready (EmpathyAccountManager *manager);
63 int empathy_account_manager_get_connected_accounts
64 (EmpathyAccountManager *manager);
65 int empathy_account_manager_get_connecting_accounts
66 (EmpathyAccountManager *manager);
67 int empathy_account_manager_get_count
68 (EmpathyAccountManager *manager);
69 EmpathyAccount * empathy_account_manager_get_account_for_connection
70 (EmpathyAccountManager *manager,
71 TpConnection *connection);
72 EmpathyAccount * empathy_account_manager_get_account
73 (EmpathyAccountManager *manager,
74 const gchar *unique_name);
75 GList * empathy_account_manager_dup_accounts
76 (EmpathyAccountManager *manager);
77 GList * empathy_account_manager_dup_connections
78 (EmpathyAccountManager *manager);
79 void empathy_account_manager_remove (
80 EmpathyAccountManager *manager,
81 EmpathyAccount *account);
83 void empathy_account_manager_request_global_presence (
84 EmpathyAccountManager *manager,
85 TpConnectionPresenceType type,
87 const gchar *message);
89 TpConnectionPresenceType empathy_account_manager_get_requested_global_presence (
90 EmpathyAccountManager *manager,
94 TpConnectionPresenceType empathy_account_manager_get_global_presence (
95 EmpathyAccountManager *manager,
99 void empathy_account_manager_create_account_async (
100 EmpathyAccountManager *manager, const gchar *connection_manager,
101 const gchar *protocol, const gchar *display_name,
102 GHashTable *parameters, GHashTable *properties,
103 GAsyncReadyCallback callback, gpointer user_data);
105 EmpathyAccount * empathy_account_manager_create_account_finish (
106 EmpathyAccountManager *settings, GAsyncResult *result, GError **error);
110 #endif /* __EMPATHY_ACCOUNT_MANAGER_H__ */