2 * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3 * Copyright (C) 2001-2012 Match Grun and the Claws Mail team
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or
8 * (at your option) any later version.
10 * This program 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
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
21 * Definitions for address cache.
24 #ifndef __ADDRCACHE_H__
25 #define __ADDRCACHE_H__
33 typedef struct _AddressCache AddressCache
;
35 struct _AddressCache
{
42 ItemFolder
*rootFolder
;
49 /* Function prototypes */
50 AddressCache
*addrcache_create ( void );
51 ItemFolder
*addrcache_get_root_folder ( AddressCache
*cache
);
52 GList
*addrcache_get_list_folder ( AddressCache
*cache
);
53 GList
*addrcache_get_list_person ( AddressCache
*cache
);
54 gboolean
addrcache_get_dirty ( AddressCache
*cache
);
55 void addrcache_set_dirty ( AddressCache
*cache
,
56 const gboolean value
);
57 gchar
*addrcache_get_name ( AddressCache
*cache
);
58 void addrcache_set_name ( AddressCache
*cache
,
61 void addrcache_refresh ( AddressCache
*cache
);
62 void addrcache_clear ( AddressCache
*cache
);
63 void addrcache_free ( AddressCache
*cache
);
64 gboolean
addrcache_check_file ( AddressCache
*cache
, gchar
*path
);
65 gboolean
addrcache_mark_file ( AddressCache
*cache
, gchar
*path
);
67 void addrcache_print ( AddressCache
*cache
, FILE *stream
);
69 void addrcache_id_person ( AddressCache
*cache
, ItemPerson
*person
);
70 void addrcache_id_group ( AddressCache
*cache
, ItemGroup
*group
);
71 void addrcache_id_folder ( AddressCache
*cache
, ItemFolder
*folder
);
72 void addrcache_id_email ( AddressCache
*cache
, ItemEMail
*email
);
73 void addrcache_id_attribute ( AddressCache
*cache
, UserAttribute
*attrib
);
75 gboolean
addrcache_hash_add_person ( AddressCache
*cache
, ItemPerson
*person
);
76 gboolean
addrcache_hash_add_group ( AddressCache
*cache
, ItemGroup
*group
);
77 gboolean
addrcache_hash_add_folder ( AddressCache
*cache
, ItemFolder
*folder
);
79 gboolean
addrcache_folder_add_person ( AddressCache
*cache
,
82 gboolean
addrcache_folder_add_folder ( AddressCache
*cache
,
85 gboolean
addrcache_folder_add_group ( AddressCache
*cache
,
89 gboolean
addrcache_add_person ( AddressCache
*cache
,
91 gboolean
addrcache_add_group ( AddressCache
*cache
,
93 gboolean
addrcache_person_add_email ( AddressCache
*cache
,
96 gboolean
addrcache_group_add_email ( AddressCache
*cache
,
99 gboolean
addrcache_add_folder ( AddressCache
*cache
,
100 ItemFolder
*folder
);
102 void addrcache_folder_move_person ( AddressCache
*cache
,
104 ItemFolder
*target
);
105 void addrcache_folder_move_group ( AddressCache
*cache
,
107 ItemFolder
*target
);
108 void addrcache_folder_move_folder ( AddressCache
*cache
,
110 ItemFolder
*target
);
112 AddrItemObject
*addrcache_get_object ( AddressCache
*cache
, const gchar
*uid
);
113 ItemEMail
*addrcache_get_email ( AddressCache
*cache
, const gchar
*eid
);
116 ItemGroup
*addrcache_remove_group ( AddressCache
*cache
, ItemGroup
*group
);
117 ItemPerson
*addrcache_remove_person ( AddressCache
*cache
, ItemPerson
*person
);
118 ItemEMail
*addrcache_remove_email ( AddressCache
*cache
, ItemEMail
*email
);
120 ItemEMail
*addrcache_person_remove_email( AddressCache
*cache
,
124 GList
*addrcache_get_group_for_person ( AddressCache
*cache
, ItemPerson
*person
);
126 GList
*addrcache_get_all_persons ( AddressCache
*cache
);
127 GList
*addrcache_get_all_groups ( AddressCache
*cache
);
129 ItemFolder
*addrcache_remove_folder ( AddressCache
*cache
,
130 ItemFolder
*folder
);
131 ItemFolder
*addrcache_remove_folder_delete ( AddressCache
*cache
,
132 ItemFolder
*folder
);
134 ItemPerson
*addrcache_add_contact ( AddressCache
*cache
,
137 const gchar
*address
,
138 const gchar
*remarks
);
140 ItemFolder
*addrcache_add_new_folder ( AddressCache
*cache
,
141 ItemFolder
*parent
);
143 #endif /* __ADDRCACHE_H__ */