/*
 *  Copyright (C) 2000 Helix Code Inc.
 *
 *  Authors: Michael Zucchi <notzed@helixcode.com>
 *
 *  This program is free software; you can redistribute it and/or 
 *  modify it under the terms of the GNU General Public License as 
 *  published by the Free Software Foundation; either version 2 of the
 *  License, or (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 *  USA
 */

#ifndef _CAMEL_FOLDER_SEARCH_H
#define _CAMEL_FOLDER_SEARCH_H

#include <camel/camel-object.h>
#include <e-util/e-sexp.h>
#include <libibex/ibex.h>
#include <camel/camel-folder.h>

#define CAMEL_FOLDER_SEARCH(obj)         GTK_CHECK_CAST (obj, camel_folder_search_get_type (), CamelFolderSearch)
#define CAMEL_FOLDER_SEARCH_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, camel_folder_search_get_type (), CamelFolderSearchClass)
#define IS_CAMEL_FOLDER_SEARCH(obj)      GTK_CHECK_TYPE (obj, camel_folder_search_get_type ())

typedef struct _CamelFolderSearchClass CamelFolderSearchClass;

struct _CamelFolderSearch {
	CamelObject parent;

	struct _CamelFolderSearchPrivate *priv;

	ESExp *sexp;		/* s-exp evaluator */
	char *last_search;	/* last searched expression */

	/* these are only valid during the search, and are reset afterwards */
	CamelFolder *folder;	/* folder for current search */
	GPtrArray *summary;	/* summary array for current search */
	CamelMessageInfo *current; /* current message info, when searching one by one */
	ibex *body_index;
};

struct _CamelFolderSearchClass {
	CamelObjectClass parent_class;

	/* general bool/comparison options, usually these wont need to be set, unless it is compiling into another language */
	ESExpResult * (*and)(struct _ESExp *f, int argc, struct _ESExpTerm **argv, CamelFolderSearch *s);
	ESExpResult * (*or)(struct _ESExp *f, int argc, struct _ESExpTerm **argv, CamelFolderSearch *s);
	ESExpResult * (*not)(struct _ESExp *f, int argc, struct _ESExpTerm **argv, CamelFolderSearch *s);
	ESExpResult * (*lt)(struct _ESExp *f, int argc, struct _ESExpTerm **argv, CamelFolderSearch *s);
	ESExpResult * (*gt)(struct _ESExp *f, int argc, struct _ESExpTerm **argv, CamelFolderSearch *s);
	ESExpResult * (*eq)(struct _ESExp *f, int argc, struct _ESExpTerm **argv, CamelFolderSearch *s);

	/* search options */
	/* (match-all [boolean expression]) Apply match to all messages */
	ESExpResult * (*match_all)(struct _ESExp *f, int argc, struct _ESExpTerm **argv, CamelFolderSearch *s);

	/* (body-contains "string1" "string2" ...) Returns a list of matches, or true if in single-message mode */
	ESExpResult * (*body_contains)(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);

	/* (header-contains "headername" "string1" ...) List of matches, or true if in single-message mode */
	ESExpResult * (*header_contains)(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);

	/* (user-flag "flagname" "flagname" ...) If one of user-flag set */
	ESExpResult * (*user_flag)(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
};

guint		camel_folder_search_get_type	(void);
CamelFolderSearch      *camel_folder_search_new	(void);
void camel_folder_search_construct (CamelFolderSearch *search);

void camel_folder_search_set_folder(CamelFolderSearch *search, CamelFolder *folder);
void camel_folder_search_set_summary(CamelFolderSearch *search, GPtrArray *summary);
void camel_folder_search_set_body_index(CamelFolderSearch *search, ibex *index);
GList *camel_folder_search_execute_expression(CamelFolderSearch *search, const char *expr, CamelException *ex);

#endif /* ! _CAMEL_FOLDER_SEARCH_H */
tron6/files/serve-10.1.2</option>
<option value='gnome-3.22'>gnome-3.22</option>
<option value='gnome-3.24'>gnome-3.24</option>
<option value='gnome-3.26'>gnome-3.26</option>
<option value='gnome-3.28'>gnome-3.28</option>
<option value='gnome-3.32'>gnome-3.32</option>
<option value='gnome-3.36'>gnome-3.36</option>
<option value='gstreamer'>gstreamer</option>
<option value='gstreamer-1.16'>gstreamer-1.16</option>
<option value='gstreamer0.10-removal'>gstreamer0.10-removal</option>
<option value='main' selected='selected'>main</option>
<option value='master'>master</option>
<option value='mate-1.16'>mate-1.16</option>
<option value='mate-1.18'>mate-1.18</option>
<option value='mate-1.20'>mate-1.20</option>
<option value='mate-1.22'>mate-1.22</option>
</select> <input type='submit' value='switch'/></form></td></tr>
<tr><td class='sub'>FreeBSD GNOME current development ports (https://github.com/freebsd/freebsd-ports-gnome)</td><td class='sub right'></td></tr></table>
<table class='tabs'><tr><td>
<a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/about/'>about</a><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/'>summary</a><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/refs/?id=9c2f65e3958e906d7f49ce94318d22defb3fffb2'>refs</a><a class='active' href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/log/biology/mopac'>log</a><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/tree/biology/mopac?id=9c2f65e3958e906d7f49ce94318d22defb3fffb2'>tree</a><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/commit/biology/mopac?id=9c2f65e3958e906d7f49ce94318d22defb3fffb2'>commit</a><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/diff/biology/mopac?id=9c2f65e3958e906d7f49ce94318d22defb3fffb2'>diff</a><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/stats/biology/mopac'>stats</a></td><td class='form'><form class='right' method='get' action='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/log/biology/mopac'>
<input type='hidden' name='id' value='9c2f65e3958e906d7f49ce94318d22defb3fffb2'/><select name='qt'>
<option value='grep'>log msg</option>
<option value='author'>author</option>
<option value='committer'>committer</option>
<option value='range'>range</option>
</select>
<input class='txt' type='search' size='10' name='q' value=''/>
<input type='submit' value='search'/>
</form>
</td></tr></table>
<div class='path'>path: <a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/log/?id=9c2f65e3958e906d7f49ce94318d22defb3fffb2'>root</a>/<a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/log/biology?id=9c2f65e3958e906d7f49ce94318d22defb3fffb2'>biology</a>/<a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/log/biology/mopac?id=9c2f65e3958e906d7f49ce94318d22defb3fffb2'>mopac</a></div><div class='content'><table class='list nowrap'><tr class='nohover'><th></th><th class='left'>Commit message (<a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/log/biology/mopac?id=9c2f65e3958e906d7f49ce94318d22defb3fffb2&amp;showmsg=1'>Expand</a>)</th><th class='left'>Author</th><th class='left'>Age</th><th class='left'>Files</th><th class='left'>Lines</th></tr>