/* * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client * Copyright (C) 1999-2004 Hiroyuki Yamamoto * * 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 __PREFS_FILTER_EDIT_H__ #define __PREFS_FILTER_EDIT_H__ #include #include "filter.h" typedef enum { PF_COND_HEADER, PF_COND_TO_OR_CC, PF_COND_ANY_HEADER, PF_COND_BODY, PF_COND_CMD_TEST, PF_COND_SIZE, PF_COND_AGE, PF_COND_ACCOUNT, PF_COND_EDIT_HEADER, PF_COND_SEPARATOR, PF_COND_NONE } CondMenuType; typedef enum { PF_MATCH_CONTAIN, PF_MATCH_NOT_CONTAIN, PF_MATCH_EQUAL, PF_MATCH_NOT_EQUAL, PF_MATCH_REGEX, PF_MATCH_NOT_REGEX, PF_MATCH_NONE } MatchMenuType; typedef enum { PF_SIZE_LARGER, PF_SIZE_SMALLER } SizeMatchType; typedef enum { PF_AGE_LONGER, PF_AGE_SHORTER } AgeMatchType; typedef enum { PF_ACTION_MOVE, PF_ACTION_COPY, PF_ACTION_NOT_RECEIVE, PF_ACTION_DELETE, PF_ACTION_EXEC, PF_ACTION_EXEC_ASYNC, PF_ACTION_MARK, PF_ACTION_COLOR_LABEL, PF_ACTION_MARK_READ, PF_ACTION_FORWARD, PF_ACTION_FORWARD_AS_ATTACHMENT, PF_ACTION_REDIRECT, PF_ACTION_STOP_EVAL, PF_ACTION_SEPARATOR, PF_ACTION_NONE } ActionMenuType; typedef struct _CondHBox { GtkWidget *hbox; GtkWidget *cond_type_optmenu; GtkWidget *match_type_optmenu; GtkWidget *size_match_optmenu; GtkWidget *age_match_optmenu; GtkWidget *key_entry; GtkWidget *spin_btn; GtkWidget *label; GtkWidget *del_btn; GtkWidget *add_btn; CondMenuType cur_type; gchar *cur_header_name; } CondHBox; typedef struct _ActionHBox { GtkWidget *hbox; GtkWidget *action_type_optmenu; GtkWidget *label; GtkWidget *folder_entry; GtkWidget *cmd_entry; GtkWidget *address_entry; GtkWidget *clabel_optmenu; GtkWidget *folder_sel_btn; GtkWidget *action_type_menu_items[PF_ACTION_NONE]; GtkWidget *del_btn; GtkWidget *add_btn; } ActionHBox; FilterRule *prefs_filter_edit_open (FilterRule *rule, const gchar *header); CondHBox *prefs_filter_edit_cond_hbox_create (void); ActionHBox *prefs_filter_edit_action_hbox_create (void); void prefs_filter_edit_cond_hbox_set (CondHBox *hbox, FilterCond *cond); void prefs_filter_edit_action_hbox_set (ActionHBox *hbox, FilterAction *action); void prefs_filter_edit_cond_hbox_select (CondHBox *hbox, CondMenuType type, const gchar *header_name); void prefs_filter_edit_set_cond_hbox_widgets (CondHBox *hbox, CondMenuType type); void prefs_filter_edit_set_action_hbox_widgets (ActionHBox *hbox, ActionMenuType type); #endif /* __PREFS_FILTER_EDIT_H__ */