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/e-mail-session.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/e-mail-session.h')
-rw-r--r-- | mail/e-mail-session.h | 123 |
1 files changed, 123 insertions, 0 deletions
diff --git a/mail/e-mail-session.h b/mail/e-mail-session.h new file mode 100644 index 0000000000..71a5d73eb4 --- /dev/null +++ b/mail/e-mail-session.h @@ -0,0 +1,123 @@ +/* + * e-mail-session.h + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) version 3. + * + * 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with the program; if not, see <http://www.gnu.org/licenses/> + * + * + * Authors: + * Jeffrey Stedfast <fejj@ximian.com> + * + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + * + */ + +#ifndef E_MAIL_SESSION_H +#define E_MAIL_SESSION_H + +#include <camel/camel.h> + +/* Standard GObject macros */ +#define E_TYPE_MAIL_SESSION \ + (e_mail_session_get_type ()) +#define E_MAIL_SESSION(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST \ + ((obj), E_TYPE_MAIL_SESSION, EMailSession)) +#define E_MAIL_SESSION_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_CAST \ + ((cls), E_TYPE_MAIL_SESSION, EMailSessionClass)) +#define E_IS_MAIL_SESSION(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE \ + ((obj), E_TYPE_MAIL_SESSION)) +#define E_IS_MAIL_SESSION_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_TYPE \ + ((cls), E_TYPE_MAIL_SESSION)) +#define E_MAIL_SESSION_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS \ + ((obj), E_TYPE_MAIL_SESSION, EMailSessionClass)) + +G_BEGIN_DECLS + +typedef struct _EMailSession EMailSession; +typedef struct _EMailSessionClass EMailSessionClass; +typedef struct _EMailSessionPrivate EMailSessionPrivate; + +struct _EMailSession { + CamelSession parent; + EMailSessionPrivate *priv; +}; + +struct _EMailSessionClass { + CamelSessionClass parent_class; +}; + +GType e_mail_session_get_type (void); +EMailSession * e_mail_session_new (void); +CamelFolder * e_mail_session_get_inbox_sync (EMailSession *session, + const gchar *service_uri, + GCancellable *cancellable, + GError **error); +void e_mail_session_get_inbox (EMailSession *session, + const gchar *service_uri, + gint io_priority, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +CamelFolder * e_mail_session_get_inbox_finish (EMailSession *session, + GAsyncResult *result, + GError **error); +CamelFolder * e_mail_session_get_trash_sync (EMailSession *session, + const gchar *service_uri, + GCancellable *cancellable, + GError **error); +void e_mail_session_get_trash (EMailSession *session, + const gchar *service_uri, + gint io_priority, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +CamelFolder * e_mail_session_get_trash_finish (EMailSession *session, + GAsyncResult *result, + GError **error); +CamelFolder * e_mail_session_uri_to_folder_sync + (EMailSession *session, + const gchar *folder_uri, + CamelStoreGetFolderFlags flags, + GCancellable *cancellable, + GError **error); +void e_mail_session_uri_to_folder (EMailSession *session, + const gchar *folder_uri, + CamelStoreGetFolderFlags flags, + gint io_priority, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +CamelFolder * e_mail_session_uri_to_folder_finish + (EMailSession *session, + GAsyncResult *result, + GError **error); + + +/*** Legacy API ***/ + +void mail_session_flush_filter_log (EMailSession *session); +void mail_session_add_junk_plugin (EMailSession *session, + const gchar *plugin_name, + CamelJunkPlugin *junk_plugin); +const GList * mail_session_get_junk_plugins (EMailSession *session); +const gchar * mail_session_get_data_dir (void); +const gchar * mail_session_get_config_dir (void); + +G_END_DECLS + +#endif /* E_MAIL_SESSION_H */ |