## ERuleContext

ERuleContext

## Synopsis

    struct              part_set_map;
    struct              rule_set_map;
    struct              ERuleContext;
    void                (*ERuleContextRegisterFunc)         (ERuleContext *context,
                                                             EFilterRule *rule,
                                                             gpointer user_data);
    void                (*ERuleContextPartFunc)             (ERuleContext *context,
                                                             EFilterPart *part);
    void                (*ERuleContextRuleFunc)             (ERuleContext *context,
                                                             EFilterRule *part);
    EFilterPart         (*ERuleContextNextPartFunc)         (ERuleContext *context,
                                                             EFilterPart *part);
    EFilterRule         (*ERuleContextNextRuleFunc)         (ERuleContext *context,
                                                             EFilterRule *rule,
                                                             const gchar *source);
    ERuleContext *      e_rule_context_new                  (void);
    gint                e_rule_context_load                 (ERuleContext *context,
                                                             const gchar *system,
                                                             const gchar *user);
    gint                e_rule_context_save                 (ERuleContext *context,
                                                             const gchar *user);
    gint                e_rule_context_revert               (ERuleContext *context,
                                                             const gchar *user);
    void                e_rule_context_add_part             (ERuleContext *context,
                                                             EFilterPart *part);
    EFilterPart *       e_rule_context_find_part            (ERuleContext *context,
                                                             const gchar *name);
    EFilterPart *       e_rule_context_create_part          (ERuleContext *context,
                                                             const gchar *name);
    EFilterPart *       e_rule_context_next_part            (ERuleContext *context,
                                                             EFilterPart *last);
    EFilterRule *       e_rule_context_next_rule            (ERuleContext *context,
                                                             EFilterRule *last,
                                                             const gchar *source);
    EFilterRule *       e_rule_context_find_rule            (ERuleContext *context,
                                                             const gchar *name,
                                                             const gchar *source);
    EFilterRule *       e_rule_context_find_rank_rule       (ERuleContext *context,
                                                             gint rank,
                                                             const gchar *source);
    void                e_rule_context_add_rule             (ERuleContext *context,
                                                             EFilterRule *rule);
    void                e_rule_context_add_rule_gui         (ERuleContext *context,
                                                             EFilterRule *rule,
                                                             const gchar *title,
                                                             const gchar *path);
    void                e_rule_context_remove_rule          (ERuleContext *context,
                                                             EFilterRule *rule);
    void                e_rule_context_rank_rule            (ERuleContext *context,
                                                             EFilterRule *rule,
                                                             const gchar *source,
                                                             gint rank);
    gint                e_rule_context_get_rank_rule        (ERuleContext *context,
                                                             EFilterRule *rule,
                                                             const gchar *source);
    void                e_rule_context_add_part_set         (ERuleContext *context,
                                                             const gchar *setname,
                                                             GType part_type,
                                                             ERuleContextPartFunc append,
                                                             ERuleContextNextPartFunc next);
    void                e_rule_context_add_rule_set         (ERuleContext *context,
                                                             const gchar *setname,
                                                             GType rule_type,
                                                             ERuleContextRuleFunc append,
                                                             ERuleContextNextRuleFunc next);
    EFilterElement *    e_rule_context_new_element          (ERuleContext *context,
                                                             const gchar *name);
    GList *             e_rule_context_delete_uri           (ERuleContext *context,
                                                             const gchar *uri,
                                                             GCompareFunc compare);
    GList *             e_rule_context_rename_uri           (ERuleContext *context,
                                                             const gchar *old_uri,
                                                             const gchar *new_uri,
                                                             GCompareFunc compare);
    void                e_rule_context_free_uri_list        (ERuleContext *context,
                                                             GList *uris);

## Object Hierarchy

      GObject
       +----ERuleContext

## Signals

      "changed"                                        : Run Last
      "rule-added"                                     : Run Last
      "rule-removed"                                   : Run Last

## Description

## Details

### struct part_set_map

    struct part_set_map {
    	gchar *name;
    	GType type;
    	ERuleContextPartFunc append;
    	ERuleContextNextPartFunc next;
    };

### struct rule_set_map

    struct rule_set_map {
    	gchar *name;
    	GType type;
    	ERuleContextRuleFunc append;
    	ERuleContextNextRuleFunc next;
    };

### struct ERuleContext

    struct ERuleContext;

### ERuleContextRegisterFunc ()

    void                (*ERuleContextRegisterFunc)         (ERuleContext *context,
                                                             EFilterRule *rule,
                                                             gpointer user_data);

### ERuleContextPartFunc ()

    void                (*ERuleContextPartFunc)             (ERuleContext *context,
                                                             EFilterPart *part);

### ERuleContextRuleFunc ()

    void                (*ERuleContextRuleFunc)             (ERuleContext *context,
                                                             EFilterRule *part);

### ERuleContextNextPartFunc ()

    EFilterPart         (*ERuleContextNextPartFunc)         (ERuleContext *context,
                                                             EFilterPart *part);

### ERuleContextNextRuleFunc ()

    EFilterRule         (*ERuleContextNextRuleFunc)         (ERuleContext *context,
                                                             EFilterRule *rule,
                                                             const gchar *source);

### e_rule_context_new ()

    ERuleContext *      e_rule_context_new                  (void);

Create a new ERuleContext object.

Returns : | A new ERuleContext object.

### e_rule_context_load ()

    gint                e_rule_context_load                 (ERuleContext *context,
                                                             const gchar *system,
                                                             const gchar *user);

Load a rule context from a system and user description file.

### e_rule_context_save ()

    gint                e_rule_context_save                 (ERuleContext *context,
                                                             const gchar *user);

Save a rule context to disk.

### e_rule_context_revert ()

    gint                e_rule_context_revert               (ERuleContext *context,
                                                             const gchar *user);

Reverts a rule context from a user description file. Assumes the system description file is unchanged from when it was loaded.

### e_rule_context_add_part ()

    void                e_rule_context_add_part             (ERuleContext *context,
                                                             EFilterPart *part);

### e_rule_context_find_part ()

    EFilterPart *       e_rule_context_find_part            (ERuleContext *context,
                                                             const gchar *name);

### e_rule_context_create_part ()

    EFilterPart *       e_rule_context_create_part          (ERuleContext *context,
                                                             const gchar *name);

### e_rule_context_next_part ()

    EFilterPart *       e_rule_context_next_part            (ERuleContext *context,
                                                             EFilterPart *last);

### e_rule_context_next_rule ()

    EFilterRule *       e_rule_context_next_rule            (ERuleContext *context,
                                                             EFilterRule *last,
                                                             const gchar *source);

### e_rule_context_find_rule ()

    EFilterRule *       e_rule_context_find_rule            (ERuleContext *context,
                                                             const gchar *name,
                                                             const gchar *source);

### e_rule_context_find_rank_rule ()

    EFilterRule *       e_rule_context_find_rank_rule       (ERuleContext *context,
                                                             gint rank,
                                                             const gchar *source);

### e_rule_context_add_rule ()

    void                e_rule_context_add_rule             (ERuleContext *context,
                                                             EFilterRule *rule);

### e_rule_context_add_rule_gui ()

    void                e_rule_context_add_rule_gui         (ERuleContext *context,
                                                             EFilterRule *rule,
                                                             const gchar *title,
                                                             const gchar *path);

### e_rule_context_remove_rule ()

    void                e_rule_context_remove_rule          (ERuleContext *context,
                                                             EFilterRule *rule);

### e_rule_context_rank_rule ()

    void                e_rule_context_rank_rule            (ERuleContext *context,
                                                             EFilterRule *rule,
                                                             const gchar *source,
                                                             gint rank);

### e_rule_context_get_rank_rule ()

    gint                e_rule_context_get_rank_rule        (ERuleContext *context,
                                                             EFilterRule *rule,
                                                             const gchar *source);

### e_rule_context_add_part_set ()

    void                e_rule_context_add_part_set         (ERuleContext *context,
                                                             const gchar *setname,
                                                             GType part_type,
                                                             ERuleContextPartFunc append,
                                                             ERuleContextNextPartFunc next);

### e_rule_context_add_rule_set ()

    void                e_rule_context_add_rule_set         (ERuleContext *context,
                                                             const gchar *setname,
                                                             GType rule_type,
                                                             ERuleContextRuleFunc append,
                                                             ERuleContextNextRuleFunc next);

### e_rule_context_new_element ()

    EFilterElement *    e_rule_context_new_element          (ERuleContext *context,
                                                             const gchar *name);

create a new filter element based on name.

### e_rule_context_delete_uri ()

    GList *             e_rule_context_delete_uri           (ERuleContext *context,
                                                             const gchar *uri,
                                                             GCompareFunc compare);

### e_rule_context_rename_uri ()

    GList *             e_rule_context_rename_uri           (ERuleContext *context,
                                                             const gchar *old_uri,
                                                             const gchar *new_uri,
                                                             GCompareFunc compare);

### e_rule_context_free_uri_list ()

    void                e_rule_context_free_uri_list        (ERuleContext *context,
                                                             GList *uris);

## Signal Details

### The `"changed"` signal

    void                user_function                      (ERuleContext *erulecontext,
                                                            gpointer      user_data)         : Run Last

### The `"rule-added"` signal

    void                user_function                      (ERuleContext *erulecontext,
                                                            gpointer      arg1,
                                                            gpointer      user_data)         : Run Last

### The `"rule-removed"` signal

    void                user_function                      (ERuleContext *erulecontext,
                                                            gpointer      arg1,
                                                            gpointer      user_data)         : Run Last