2013-02-27 [mones] 3.9.0cvs104
[claws.git] / src / advsearch.h
blobbb6803234f82779fa8c91164a72c4e1358aaaf8e
1 /*
2 * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
3 * Copyright (C) 2012 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/>.
20 #ifndef ADVSEARCH_H
21 #define ADVSEARCH_H 1
23 #include "proctypes.h"
24 #include "folder.h"
26 // temporary
27 #include "matcher.h"
29 typedef enum
31 ADVANCED_SEARCH_SUBJECT,
32 ADVANCED_SEARCH_FROM,
33 ADVANCED_SEARCH_TO,
34 ADVANCED_SEARCH_EXTENDED,
35 ADVANCED_SEARCH_MIXED,
36 ADVANCED_SEARCH_TAG,
37 } AdvancedSearchType;
40 typedef struct _AdvancedSearch AdvancedSearch;
42 void advsearch_set_on_progress_cb(AdvancedSearch* search,
43 gboolean (*cb)(gpointer data, guint at, guint matched, guint total), gpointer data);
44 void advsearch_set_on_error_cb(AdvancedSearch* search, void (*cb)(gpointer data), gpointer data);
46 AdvancedSearch *advsearch_new();
47 void advsearch_free(AdvancedSearch *search);
49 void advsearch_set(AdvancedSearch *search, AdvancedSearchType type, const gchar *matchstring);
50 gboolean advsearch_is_fast(AdvancedSearch *search);
51 gboolean advsearch_has_proper_predicate(AdvancedSearch *search);
53 gboolean advsearch_search_msgs_in_folders(AdvancedSearch* search, MsgInfoList **messages,
54 FolderItem* folderItem, gboolean recursive);
56 void advsearch_abort(AdvancedSearch *search);
58 gchar *advsearch_expand_search_string(const gchar *search_string);
60 #endif