1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 * Copyright (C) 2003 Ximian, Inc.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of version 2 of the GNU Lesser General Public
7 * License as published by the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
20 #ifndef __E_ACCOUNT_LIST__
21 #define __E_ACCOUNT_LIST__
24 #include "e-account.h"
25 #include <gconf/gconf-client.h>
29 #define E_TYPE_ACCOUNT_LIST (e_account_list_get_type ())
30 #define E_ACCOUNT_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_ACCOUNT_LIST, EAccountList))
31 #define E_ACCOUNT_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_ACCOUNT_LIST, EAccountListClass))
32 #define E_IS_ACCOUNT_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_ACCOUNT_LIST))
33 #define E_IS_ACCOUNT_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_ACCOUNT_LIST))
35 typedef struct EAccountListPrivate EAccountListPrivate;
37 /* search options for the find command */
38 typedef enum _e_account_find_t {
41 E_ACCOUNT_FIND_ID_NAME,
42 E_ACCOUNT_FIND_ID_ADDRESS,
43 E_ACCOUNT_FIND_PARENT_UID,
46 typedef struct _EAccountList {
49 EAccountListPrivate *priv;
53 EListClass parent_class;
56 void (*account_added) (EAccountList *, EAccount *);
57 void (*account_changed) (EAccountList *, EAccount *);
58 void (*account_removed) (EAccountList *, EAccount *);
62 GType e_account_list_get_type (void);
64 EAccountList *e_account_list_new (GConfClient *gconf);
65 void e_account_list_construct (EAccountList *account_list,
68 void e_account_list_save (EAccountList *account_list);
70 void e_account_list_add (EAccountList *, EAccount *);
71 void e_account_list_change (EAccountList *, EAccount *);
72 void e_account_list_remove (EAccountList *, EAccount *);
74 const EAccount *e_account_list_get_default(EAccountList *);
75 void e_account_list_set_default(EAccountList *, EAccount *);
76 const EAccount *e_account_list_find (EAccountList *, e_account_find_t type, const char *key);
78 void e_account_list_prune_proxies (EAccountList *);
79 void e_account_list_remove_account_proxies (EAccountList *, EAccount *);
80 int e_account_list_account_has_proxies (EAccountList *, EAccount *);
84 #endif /* __E_ACCOUNT_LIST__ */