diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-10-07 11:38:52 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-10-13 01:58:59 +0800 |
commit | a06e4484b8df804124b5bcf88d94dec5acfba270 (patch) | |
tree | 4fa42793d7dc461f2b3767296d76592182c48222 /mail/em-vfolder-rule.h | |
parent | 5e0758bb6934a7859b1d8a247c8fb21c156772cf (diff) | |
download | gsoc2013-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-vfolder-rule.h')
-rw-r--r-- | mail/em-vfolder-rule.h | 55 |
1 files changed, 39 insertions, 16 deletions
diff --git a/mail/em-vfolder-rule.h b/mail/em-vfolder-rule.h index 8e77986e2c..136c29a52b 100644 --- a/mail/em-vfolder-rule.h +++ b/mail/em-vfolder-rule.h @@ -21,16 +21,32 @@ * */ -#ifndef _EM_VFOLDER_RULE_H -#define _EM_VFOLDER_RULE_H +#ifndef EM_VFOLDER_RULE_H +#define EM_VFOLDER_RULE_H -#include "filter/e-filter-rule.h" +#include <mail/e-mail-session.h> +#include <filter/e-filter-rule.h> -#define EM_VFOLDER_RULE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), em_vfolder_rule_get_type(), EMVFolderRule)) -#define EM_VFOLDER_RULE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), em_vfolder_rule_get_type(), EMVFolderRuleClass)) -#define EM_IS_VFOLDER_RULE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), em_vfolder_rule_get_type())) -#define EM_IS_VFOLDER_RULE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), em_vfolder_rule_get_type())) -#define EM_VFOLDER_RULE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), em_vfolder_rule_get_type(), EMVFolderRuleClass)) +/* Standard GObject macros */ +#define EM_TYPE_VFOLDER_RULE \ + (em_vfolder_rule_get_type ()) +#define EM_VFOLDER_RULE(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST \ + ((obj), EM_TYPE_VFOLDER_RULE, EMVFolderRule)) +#define EM_VFOLDER_RULE_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_CAST \ + ((cls), EM_TYPE_VFOLDER_RULE, EMVFolderRuleClass)) +#define EM_IS_VFOLDER_RULE(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE \ + ((obj), EM_TYPE_VFOLDER_RULE)) +#define EM_IS_VFOLDER_RULE_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_TYPE \ + ((cls), EM_TYPE_VFOLDER_RULE)) +#define EM_VFOLDER_RULE_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS \ + ((obj), EM_TYPE_VFOLDER_RULE, EMVFolderRuleClass)) + +G_BEGIN_DECLS /* perhaps should be bits? */ enum _em_vfolder_rule_with_t { @@ -42,11 +58,13 @@ enum _em_vfolder_rule_with_t { typedef struct _EMVFolderRule EMVFolderRule; typedef struct _EMVFolderRuleClass EMVFolderRuleClass; +typedef struct _EMVFolderRulePrivate EMVFolderRulePrivate; typedef enum _em_vfolder_rule_with_t em_vfolder_rule_with_t; struct _EMVFolderRule { EFilterRule rule; + EMVFolderRulePrivate *priv; em_vfolder_rule_with_t with; GList *sources; /* uri's of the source folders */ @@ -56,13 +74,18 @@ struct _EMVFolderRuleClass { EFilterRuleClass parent_class; }; -GType em_vfolder_rule_get_type (void); -EMVFolderRule *em_vfolder_rule_new (void); +GType em_vfolder_rule_get_type (void); +EFilterRule * em_vfolder_rule_new (EMailSession *session); +EMailSession * em_vfolder_rule_get_session (EMVFolderRule *rule); +void em_vfolder_rule_add_source (EMVFolderRule *rule, + const gchar *uri); +void em_vfolder_rule_remove_source (EMVFolderRule *rule, + const gchar *uri); +const gchar * em_vfolder_rule_find_source (EMVFolderRule *rule, + const gchar *uri); +const gchar * em_vfolder_rule_next_source (EMVFolderRule *rule, + const gchar *last); -/* methods */ -void em_vfolder_rule_add_source (EMVFolderRule *vr, const gchar *uri); -void em_vfolder_rule_remove_source (EMVFolderRule *vr, const gchar *uri); -const gchar *em_vfolder_rule_find_source (EMVFolderRule *vr, const gchar *uri); -const gchar *em_vfolder_rule_next_source (EMVFolderRule *vr, const gchar *last); +G_END_DECLS -#endif /* _EM_VFOLDER_RULE_H */ +#endif /* EM_VFOLDER_RULE_H */ |