1 /* 2 * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client 3 * Copyright (C) 2012 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 #ifndef ADVSEARCH_H 21 #define ADVSEARCH_H 1 22 23 #include "proctypes.h" 24 #include "folder.h" 25 26 // temporary 27 #include "matcher.h" 28 29 typedef enum 30 { 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; 38 39 40 typedef struct _AdvancedSearch AdvancedSearch; 41 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); 45 46 AdvancedSearch *advsearch_new(); 47 void advsearch_free(AdvancedSearch *search); 48 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); 52 53 gboolean advsearch_search_msgs_in_folders(AdvancedSearch* search, MsgInfoList **messages, 54 FolderItem* folderItem, gboolean recursive); 55 56 void advsearch_abort(AdvancedSearch *search); 57 58 gchar *advsearch_expand_search_string(const gchar *search_string); 59 60 #endif 61