aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-filter-context.h
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-10-07 11:38:52 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-10-13 01:58:59 +0800
commita06e4484b8df804124b5bcf88d94dec5acfba270 (patch)
tree4fa42793d7dc461f2b3767296d76592182c48222 /mail/em-filter-context.h
parent5e0758bb6934a7859b1d8a247c8fb21c156772cf (diff)
downloadgsoc2013-evolution-a06e4484b8df804124b5bcf88d94dec5acfba270.tar
gsoc2013-evolution-a06e4484b8df804124b5bcf88d94dec5acfba270.tar.gz
gsoc2013-evolution-a06e4484b8df804124b5bcf88d94dec5acfba270.tar.bz2
gsoc2013-evolution-a06e4484b8df804124b5bcf88d94dec5acfba270.tar.lz
gsoc2013-evolution-a06e4484b8df804124b5bcf88d94dec5acfba270.tar.xz
gsoc2013-evolution-a06e4484b8df804124b5bcf88d94dec5acfba270.tar.zst
gsoc2013-evolution-a06e4484b8df804124b5bcf88d94dec5acfba270.zip
Give MailSession a permanent home.
Global variables in shared libraries are a bad idea. EMailBackend now owns the MailSession instance, which is actually now EMailSession. Move the blocking utility functions in mail-tools.c to e-mail-session.c and add asynchronous variants. Same approach as Camel. Replace EMailReader.get_shell_backend() with EMailReader.get_backend(), which returns an EMailBackend. Easier access to the EMailSession.
Diffstat (limited to 'mail/em-filter-context.h')
-rw-r--r--mail/em-filter-context.h61
1 files changed, 41 insertions, 20 deletions
diff --git a/mail/em-filter-context.h b/mail/em-filter-context.h
index 201f8ffde7..3545bf16eb 100644
--- a/mail/em-filter-context.h
+++ b/mail/em-filter-context.h
@@ -22,38 +22,59 @@
*
*/
-#ifndef _EM_FILTER_CONTEXT_H
-#define _EM_FILTER_CONTEXT_H
+#ifndef EM_FILTER_CONTEXT_H
+#define EM_FILTER_CONTEXT_H
-#include "filter/e-rule-context.h"
+#include <mail/e-mail-session.h>
+#include <filter/e-rule-context.h>
-#define EM_TYPE_FILTER_CONTEXT (em_filter_context_get_type ())
-#define EM_FILTER_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FILTER_TYPE_CONTEXT, EMFilterContext))
-#define EM_FILTER_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FILTER_TYPE_CONTEXT, EMFilterContextClass))
-#define EM_IS_FILTER_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FILTER_TYPE_CONTEXT))
-#define EM_IS_FILTER_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FILTER_TYPE_CONTEXT))
-#define EM_FILTER_CONTEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FILTER_TYPE_CONTEXT, EMFilterContextClass))
+/* Standard GObject macros */
+#define EM_TYPE_FILTER_CONTEXT \
+ (em_filter_context_get_type ())
+#define EM_FILTER_CONTEXT(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), EM_TYPE_FILTER_CONTEXT, EMFilterContext))
+#define EM_FILTER_CONTEXT_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), EM_TYPE_FILTER_CONTEXT, EMFilterContextClass))
+#define EM_IS_FILTER_CONTEXT(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), EM_TYPE_FILTER_CONTEXT))
+#define EM_IS_FILTER_CONTEXT_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), EM_TYPE_FILTER_CONTEXT))
+#define EM_FILTER_CONTEXT_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), EM_TYPE_FILTER_CONTEXT, EMFilterContextClass))
+
+G_BEGIN_DECLS
typedef struct _EMFilterContext EMFilterContext;
typedef struct _EMFilterContextClass EMFilterContextClass;
+typedef struct _EMFilterContextPrivate EMFilterContextPrivate;
struct _EMFilterContext {
- ERuleContext parent_object;
-
- GList *actions;
+ ERuleContext parent;
+ EMFilterContextPrivate *priv;
};
struct _EMFilterContextClass {
ERuleContextClass parent_class;
};
-GType em_filter_context_get_type (void);
-EMFilterContext *em_filter_context_new (void);
+GType em_filter_context_get_type (void);
+EMFilterContext *
+ em_filter_context_new (EMailSession *session);
+EMailSession * em_filter_context_get_session (EMFilterContext *context);
+void em_filter_context_add_action (EMFilterContext *context,
+ EFilterPart *action);
+EFilterPart * em_filter_context_find_action (EMFilterContext *context,
+ const gchar *name);
+EFilterPart * em_filter_context_create_action (EMFilterContext *context,
+ const gchar *name);
+EFilterPart * em_filter_context_next_action (EMFilterContext *context,
+ EFilterPart *last);
-/* methods */
-void em_filter_context_add_action (EMFilterContext *fc, EFilterPart *action);
-EFilterPart *em_filter_context_find_action (EMFilterContext *fc, const gchar *name);
-EFilterPart *em_filter_context_create_action (EMFilterContext *fc, const gchar *name);
-EFilterPart *em_filter_context_next_action (EMFilterContext *fc, EFilterPart *last);
+G_END_DECLS
-#endif /* _EM_FILTER_CONTEXT_H */
+#endif /* EM_FILTER_CONTEXT_H */