Fix FSF address (Tobias Mueller, #470445)
[platform/upstream/evolution-data-server.git] / libedataserver / e-account-list.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /* 
3  * Copyright (C) 2003 Ximian, Inc.
4  *
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.
8  *
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.
13  *
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.
18  */
19
20 #ifndef __E_ACCOUNT_LIST__
21 #define __E_ACCOUNT_LIST__
22
23 #include "e-list.h"
24 #include "e-account.h"
25 #include <gconf/gconf-client.h>
26
27 G_BEGIN_DECLS
28
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))
34
35 typedef struct EAccountListPrivate EAccountListPrivate;
36
37 /* search options for the find command */
38 typedef enum _e_account_find_t {
39         E_ACCOUNT_FIND_NAME,
40         E_ACCOUNT_FIND_UID,
41         E_ACCOUNT_FIND_ID_NAME,
42         E_ACCOUNT_FIND_ID_ADDRESS,
43         E_ACCOUNT_FIND_PARENT_UID,
44 } e_account_find_t;
45
46 typedef struct _EAccountList {
47         EList parent_object;
48
49         EAccountListPrivate *priv;
50 } EAccountList;
51
52 typedef struct {
53         EListClass parent_class;
54
55         /* signals */
56         void (*account_added)   (EAccountList *, EAccount *);
57         void (*account_changed) (EAccountList *, EAccount *);
58         void (*account_removed) (EAccountList *, EAccount *);
59 } EAccountListClass;
60
61
62 GType           e_account_list_get_type (void);
63
64 EAccountList   *e_account_list_new       (GConfClient  *gconf);
65 void            e_account_list_construct (EAccountList *account_list,
66                                           GConfClient  *gconf);
67
68 void            e_account_list_save      (EAccountList *account_list);
69
70 void            e_account_list_add       (EAccountList *, EAccount *);
71 void            e_account_list_change    (EAccountList *, EAccount *);
72 void            e_account_list_remove    (EAccountList *, EAccount *);
73
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);
77
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 *);
81
82 G_END_DECLS
83
84 #endif /* __E_ACCOUNT_LIST__ */