Add gtkut_tree_view_get_selected_pointer() helper function.
[claws.git] / src / addrharvest.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  * Definitions for an E-Mail address harvester.
22  */
23
24 #ifndef __ADDRHARVEST_H__
25 #define __ADDRHARVEST_H__
26
27 #include <stdio.h>
28 #include <glib.h>
29 #include "addrbook.h"
30
31 /* Headers that will be recognized */
32 #define HEADER_FROM      "From"
33 #define HEADER_REPLY_TO  "Reply-to"
34 #define HEADER_SENDER    "Sender"
35 #define HEADER_ERRORS_TO "Errors-to"
36 #define HEADER_CC        "Cc"
37 #define HEADER_TO        "To"
38
39 /* Harvester file object */
40 typedef struct _AddressHarvester AddressHarvester;
41 struct _AddressHarvester {
42         GList      *headerTable;
43         gchar      *path;
44         GHashTable *dupTable;
45         gint       folderSize;
46         gint       retVal;
47         gboolean   folderRecurse;
48 };
49
50 #ifdef USE_ALT_ADDRBOOK
51 typedef struct {
52     gchar* first_name;
53     gchar* last_name;
54     gchar* email;
55 } ContactEntry;
56 #endif
57
58 /* Function prototypes */
59 AddressHarvester *addrharvest_create    ( void );
60 void addrharvest_free                   ( AddressHarvester *harvester );
61 void addrharvest_set_path               ( AddressHarvester *harvester,
62                                           const gchar *value );
63 void addrharvest_set_folder_size        ( AddressHarvester* harvester,
64                                           const gint value );
65 void addrharvest_set_header             ( AddressHarvester* harvester,
66                                           const gchar *name,
67                                           const gboolean value );
68 void addrharvest_set_recurse            ( AddressHarvester* harvester,
69                                           const gboolean value );
70 gint addrharvest_get_count              ( AddressHarvester* harvester,
71                                           const gchar *name );
72 gint addrharvest_harvest                ( AddressHarvester *harvester,
73                                           AddressCache *cache,
74                                           GList *msgList );
75 gboolean addrharvest_check_header       ( AddressHarvester *harvester );
76
77 #endif /* __ADDRHARVEST_H__ */
78