2012-09-12 [colin] 3.8.1cvs53
[claws.git] / src / addrselect.h
1 /*
2  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3  * Copyright (C) 2002-2012 Match Grun and the Claws Mail team
4  *
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.
9  *
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.
14  *
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/>.
17  * 
18  */
19
20 /*
21  * Address list item selection.
22  */
23
24 #ifndef __ADDR_SELECT_H__
25 #define __ADDR_SELECT_H__
26
27 #include "addritem.h"
28 #include "addressitem.h"
29 #include "addrcache.h"
30
31 /*
32 * Selection item data.
33 */
34 typedef struct _AddrSelectItem_ AddrSelectItem;
35 struct _AddrSelectItem_ {
36         ItemObjectType    objectType;
37         AddrItemObject    *addressItem;
38         gchar             *uid;
39         gchar             *cacheID;
40 };
41
42 /*
43  * Selection list object.
44  */
45 typedef struct _AddrSelectList_ AddrSelectList;
46 struct _AddrSelectList_ {
47         GList *listSelect;
48 };
49
50 AddrSelectItem *addrselect_create_node  ( AddressObject *obj );
51 AddrSelectItem *addrselect_item_copy    ( AddrSelectItem *item );
52 void addrselect_item_free               ( AddrSelectItem *item );
53 void addrselect_item_print              ( AddrSelectItem *item,
54                                           FILE *stream );
55 AddrSelectList *addrselect_list_create  ( void );
56 void addrselect_list_free               ( AddrSelectList *asl );
57 GList *addrselect_get_list              ( AddrSelectList *asl );
58 void addrselect_list_clear              ( AddrSelectList *asl );
59 gboolean addrselect_test_empty          ( AddrSelectList *asl );
60 void addrselect_list_add_obj            ( AddrSelectList *asl,
61                                           AddrItemObject *aio,
62                                           gchar *cacheID );
63 void addrselect_list_add                ( AddrSelectList *asl,
64                                           AddrSelectItem *item,
65                                           gchar *cacheID );
66 void addrselect_list_remove             ( AddrSelectList *asl,
67                                           AddrItemObject *aio );
68 GList *addrselect_build_list            ( AddrSelectList *asl );
69
70 #endif /* __ADDR_SELECT_H__ */
71