00001 /* 00002 * $Id: filter.h,v 1.2 2005/06/25 01:37:42 daichik Exp $ 00003 * 00004 * Copyright (c) 2001-2003, Richard Eckart 00005 * 00006 *---------------------------------------------------------------------- 00007 * This file is part of gtk-gnutella. 00008 * 00009 * gtk-gnutella is free software; you can redistribute it and/or modify 00010 * it under the terms of the GNU General Public License as published by 00011 * the Free Software Foundation; either version 2 of the License, or 00012 * (at your option) any later version. 00013 * 00014 * gtk-gnutella is distributed in the hope that it will be useful, 00015 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 * GNU General Public License for more details. 00018 * 00019 * You should have received a copy of the GNU General Public License 00020 * along with gtk-gnutella; if not, write to the Free Software 00021 * Foundation, Inc.: 00022 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00023 *---------------------------------------------------------------------- 00024 */ 00025 00026 #ifndef _if_core_filter_h_ 00027 #define _if_core_filter_h_ 00028 00029 /* 00030 * XXX Currently, filters are part of the GUI sources, but they should be 00031 * XXX move to the core, because it is the core who will decide on 00032 * XXX creating a new download when auto-download is set, or which knows 00033 * XXX the set of files it downloaded and which should be ignored. 00034 * XXX Because I anticipate that move, I'm putting this interface file here. 00035 * XXX --RAM, 2004-08-22 00036 */ 00037 00038 /*** 00039 *** Filters 00040 ***/ 00041 enum rule_type { 00042 RULE_TEXT = 0, 00043 RULE_IP, 00044 RULE_SIZE, 00045 RULE_JUMP, 00046 RULE_SHA1, 00047 RULE_FLAG, 00048 RULE_STATE 00049 }; 00050 00051 enum rule_text_type { 00052 RULE_TEXT_PREFIX, 00053 RULE_TEXT_WORDS, 00054 RULE_TEXT_SUFFIX, 00055 RULE_TEXT_SUBSTR, 00056 RULE_TEXT_REGEXP, 00057 RULE_TEXT_EXACT 00058 }; 00059 00060 enum rule_flag_action { 00061 RULE_FLAG_SET = 0, 00062 RULE_FLAG_UNSET = 1, 00063 RULE_FLAG_IGNORE = 2 00064 }; 00065 00069 typedef enum filter_prop { 00070 FILTER_PROP_DISPLAY = 0, 00071 FILTER_PROP_DOWNLOAD, 00072 MAX_FILTER_PROP 00073 } filter_prop_t; 00074 00082 typedef enum filter_prop_state { 00083 FILTER_PROP_STATE_UNKNOWN = 0, 00084 FILTER_PROP_STATE_DO, 00085 FILTER_PROP_STATE_DONT, 00086 MAX_FILTER_PROP_STATE, 00087 FILTER_PROP_STATE_IGNORE 00088 } filter_prop_state_t; 00089 00090 #endif /* _if_core_filter_h_ */ 00091