## EFilterRule EFilterRule |

## Synopsis

    enum                filter_grouping_t;
    enum                filter_threading_t;
    struct              EFilterRule;
    EFilterRule *       e_filter_rule_new                   (void);
    EFilterRule *       e_filter_rule_clone                 (EFilterRule *rule);
    void                e_filter_rule_set_name              (EFilterRule *rule,
                                                             const gchar *name);
    #define             E_FILTER_SOURCE_INCOMING
    #define             E_FILTER_SOURCE_DEMAND
    #define             E_FILTER_SOURCE_OUTGOING
    #define             E_FILTER_SOURCE_JUNKTEST
    void                e_filter_rule_set_source            (EFilterRule *rule,
                                                             const gchar *source);
    gint                e_filter_rule_validate              (EFilterRule *rule,
                                                             EAlert **alert);
    gint                e_filter_rule_eq                    (EFilterRule *rule_a,
                                                             EFilterRule *rule_b);
    xmlNodePtr          e_filter_rule_xml_encode            (EFilterRule *rule);
    gint                e_filter_rule_xml_decode            (EFilterRule *rule,
                                                             xmlNodePtr node,
                                                             struct _ERuleContext *context);
    void                e_filter_rule_copy                  (EFilterRule *dst_rule,
                                                             EFilterRule *src_rule);
    void                e_filter_rule_add_part              (EFilterRule *rule,
                                                             EFilterPart *part);
    void                e_filter_rule_remove_part           (EFilterRule *rule,
                                                             EFilterPart *part);
    void                e_filter_rule_replace_part          (EFilterRule *rule,
                                                             EFilterPart *old_part,
                                                             EFilterPart *new_part);
    GtkWidget *         e_filter_rule_get_widget            (EFilterRule *rule,
                                                             struct _ERuleContext *context);
    void                e_filter_rule_build_code            (EFilterRule *rule,
                                                             GString *out);
    void                e_filter_rule_emit_changed          (EFilterRule *rule);
    EFilterRule *       e_filter_rule_next_list             (GList *list,
                                                             EFilterRule *last,
                                                             const gchar *source);
    EFilterRule *       e_filter_rule_find_list             (GList *list,
                                                             const gchar *name,
                                                             const gchar *source);

## Object Hierarchy

      GObject
       +----EFilterRule

## Signals

      "changed"                                        : Run Last

## Description

## Details

### enum filter_grouping_t

    enum filter_grouping_t {
    	E_FILTER_GROUP_ALL, /* all rules must match */
    	E_FILTER_GROUP_ANY /* any rule must match */
    };

`E_FILTER_GROUP_ALL` |
`E_FILTER_GROUP_ANY` |

### enum filter_threading_t

    enum filter_threading_t {
    	E_FILTER_THREAD_NONE, /* don't add any thread matching */
    	E_FILTER_THREAD_ALL, /* add all possible threads */
    	E_FILTER_THREAD_REPLIES, /* add only replies */
    	E_FILTER_THREAD_REPLIES_PARENTS, /* replies plus parents */
    	E_FILTER_THREAD_SINGLE /* messages with no replies or parents */
    };

`E_FILTER_THREAD_NONE` |
`E_FILTER_THREAD_ALL` |
`E_FILTER_THREAD_REPLIES` |
`E_FILTER_THREAD_REPLIES_PARENTS` |
`E_FILTER_THREAD_SINGLE` |

### struct EFilterRule

    struct EFilterRule;

### e_filter_rule_new ()

    EFilterRule *       e_filter_rule_new                   (void);

### e_filter_rule_clone ()

    EFilterRule *       e_filter_rule_clone                 (EFilterRule *rule);

### e_filter_rule_set_name ()

    void                e_filter_rule_set_name              (EFilterRule *rule,
                                                             const gchar *name);

### E_FILTER_SOURCE_INCOMING

    #define E_FILTER_SOURCE_INCOMING "incoming" /* performed on incoming email */

### E_FILTER_SOURCE_DEMAND

    #define E_FILTER_SOURCE_DEMAND   "demand"   /* performed on the selected folder

### E_FILTER_SOURCE_OUTGOING

    #define E_FILTER_SOURCE_OUTGOING  "outgoing"/* performed on outgoing mail */

### E_FILTER_SOURCE_JUNKTEST

    #define E_FILTER_SOURCE_JUNKTEST  "junktest"/* check incoming mail for junk */

### e_filter_rule_set_source ()

    void                e_filter_rule_set_source            (EFilterRule *rule,
                                                             const gchar *source);

### e_filter_rule_validate ()

    gint                e_filter_rule_validate              (EFilterRule *rule,
                                                             EAlert **alert);

### e_filter_rule_eq ()

    gint                e_filter_rule_eq                    (EFilterRule *rule_a,
                                                             EFilterRule *rule_b);

### e_filter_rule_xml_encode ()

    xmlNodePtr          e_filter_rule_xml_encode            (EFilterRule *rule);

### e_filter_rule_xml_decode ()

    gint                e_filter_rule_xml_decode            (EFilterRule *rule,
                                                             xmlNodePtr node,
                                                             struct _ERuleContext *context);

### e_filter_rule_copy ()

    void                e_filter_rule_copy                  (EFilterRule *dst_rule,
                                                             EFilterRule *src_rule);

### e_filter_rule_add_part ()

    void                e_filter_rule_add_part              (EFilterRule *rule,
                                                             EFilterPart *part);

### e_filter_rule_remove_part ()

    void                e_filter_rule_remove_part           (EFilterRule *rule,
                                                             EFilterPart *part);

### e_filter_rule_replace_part ()

    void                e_filter_rule_replace_part          (EFilterRule *rule,
                                                             EFilterPart *old_part,
                                                             EFilterPart *new_part);

### e_filter_rule_get_widget ()

    GtkWidget *         e_filter_rule_get_widget            (EFilterRule *rule,
                                                             struct _ERuleContext *context);

### e_filter_rule_build_code ()

    void                e_filter_rule_build_code            (EFilterRule *rule,
                                                             GString *out);

### e_filter_rule_emit_changed ()

    void                e_filter_rule_emit_changed          (EFilterRule *rule);

### e_filter_rule_next_list ()

    EFilterRule *       e_filter_rule_next_list             (GList *list,
                                                             EFilterRule *last,
                                                             const gchar *source);

### e_filter_rule_find_list ()

    EFilterRule *       e_filter_rule_find_list             (GList *list,
                                                             const gchar *name,
                                                             const gchar *source);

## Signal Details

### The `"changed"` signal

    void                user_function                      (EFilterRule *efilterrule,
                                                            gpointer     user_data)        : Run Last