1 /*
2  * e-mail-backend.h
3  *
4  * This program is free software; you can redistribute it and/or modify it
5  * under the terms of the GNU Lesser General Public License as published by
6  * the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
10  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
11  * for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this program; if not, see <http://www.gnu.org/licenses/>.
15  *
16  *
17  * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
18  *
19  */
20 
21 /* This is an abstract EShellBackend subclass that integrates
22  * with libevolution-mail.  It serves as a common base class
23  * for Evolution's mail module and Anjal. */
24 
25 #ifndef E_MAIL_BACKEND_H
26 #define E_MAIL_BACKEND_H
27 
28 #include <shell/e-shell-backend.h>
29 #include <libemail-engine/libemail-engine.h>
30 #include <mail/e-mail-remote-content.h>
31 #include <mail/e-mail-send-account-override.h>
32 #include <mail/e-mail-properties.h>
33 
34 /* Standard GObject macros */
35 #define E_TYPE_MAIL_BACKEND \
36 	(e_mail_backend_get_type ())
37 #define E_MAIL_BACKEND(obj) \
38 	(G_TYPE_CHECK_INSTANCE_CAST \
39 	((obj), E_TYPE_MAIL_BACKEND, EMailBackend))
40 #define E_MAIL_BACKEND_CLASS(cls) \
41 	(G_TYPE_CHECK_CLASS_CAST \
42 	((cls), E_TYPE_MAIL_BACKEND, EMailBackendClass))
43 #define E_IS_MAIL_BACKEND(obj) \
44 	(G_TYPE_CHECK_INSTANCE_TYPE \
45 	((obj), E_TYPE_MAIL_BACKEND))
46 #define E_IS_MAIL_BACKEND_CLASS(cls) \
47 	(G_TYPE_CHECK_CLASS_TYPE \
48 	((cls), E_TYPE_MAIL_BACKEND))
49 #define E_MAIL_BACKEND_GET_CLASS(obj) \
50 	(G_TYPE_INSTANCE_GET_CLASS \
51 	((obj), E_TYPE_MAIL_BACKEND, EMailBackendClass))
52 
53 G_BEGIN_DECLS
54 
55 typedef struct _EMailBackend EMailBackend;
56 typedef struct _EMailBackendClass EMailBackendClass;
57 typedef struct _EMailBackendPrivate EMailBackendPrivate;
58 
59 struct _EMailBackend {
60 	EShellBackend parent;
61 	EMailBackendPrivate *priv;
62 };
63 
64 struct _EMailBackendClass {
65 	EShellBackendClass parent_class;
66 
67 	/* Methods */
68 	gboolean	(*delete_junk_policy_decision)
69 						(EMailBackend *backend);
70 	gboolean	(*empty_trash_policy_decision)
71 						(EMailBackend *backend);
72 };
73 
74 GType		e_mail_backend_get_type		(void);
75 EMailSession *	e_mail_backend_get_session	(EMailBackend *backend);
76 EAlertSink *	e_mail_backend_get_alert_sink	(EMailBackend *backend);
77 gboolean	e_mail_backend_delete_junk_policy_decision
78 						(EMailBackend *backend);
79 gboolean	e_mail_backend_empty_trash_policy_decision
80 						(EMailBackend *backend);
81 EMailSendAccountOverride *
82 		e_mail_backend_get_send_account_override
83 						(EMailBackend *backend);
84 EMailRemoteContent *
85 		e_mail_backend_get_remote_content
86 						(EMailBackend *backend);
87 EMailProperties *
88 		e_mail_backend_get_mail_properties
89 						(EMailBackend *backend);
90 
91 G_END_DECLS
92 
93 #endif /* E_MAIL_BACKEND_H */
94