1 /*
2  * e-source-mail-signature.h
3  *
4  * This library 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 library 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 Lesser 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 library. If not, see <http://www.gnu.org/licenses/>.
15  *
16  */
17 
18 #if !defined (__LIBEDATASERVER_H_INSIDE__) && !defined (LIBEDATASERVER_COMPILATION)
19 #error "Only <libedataserver/libedataserver.h> should be included directly."
20 #endif
21 
22 #ifndef E_SOURCE_MAIL_SIGNATURE_H
23 #define E_SOURCE_MAIL_SIGNATURE_H
24 
25 #include <libedataserver/e-source-extension.h>
26 
27 /* Standard GObject macros */
28 #define E_TYPE_SOURCE_MAIL_SIGNATURE \
29 	(e_source_mail_signature_get_type ())
30 #define E_SOURCE_MAIL_SIGNATURE(obj) \
31 	(G_TYPE_CHECK_INSTANCE_CAST \
32 	((obj), E_TYPE_SOURCE_MAIL_SIGNATURE, ESourceMailSignature))
33 #define E_SOURCE_MAIL_SIGNATURE_CLASS(cls) \
34 	(G_TYPE_CHECK_CLASS_CAST \
35 	((cls), E_TYPE_SOURCE_MAIL_SIGNATURE, ESourceMailSignatureClass))
36 #define E_IS_SOURCE_MAIL_SIGNATURE(obj) \
37 	(G_TYPE_CHECK_INSTANCE_TYPE \
38 	((obj), E_TYPE_SOURCE_MAIL_SIGNATURE))
39 #define E_IS_SOURCE_MAIL_SIGNATURE_CLASS(cls) \
40 	(G_TYPE_CHECK_CLASS_TYPE \
41 	((cls), E_TYPE_SOURCE_MAIL_SIGNATURE))
42 #define E_SOURCE_MAIL_SIGNATURE_GET_CLASS(obj) \
43 	(G_TYPE_INSTANCE_GET_CLASS \
44 	((obj), E_TYPE_SOURCE_MAIL_SIGNATURE, ESourceMailSignatureClass))
45 
46 /**
47  * E_SOURCE_EXTENSION_MAIL_SIGNATURE:
48  *
49  * Pass this extension name to e_source_get_extension() to access
50  * #ESourceMailSignature.  This is also used as a group name in key files.
51  *
52  * Since: 3.6
53  **/
54 #define E_SOURCE_EXTENSION_MAIL_SIGNATURE "Mail Signature"
55 
56 G_BEGIN_DECLS
57 
58 typedef struct _ESourceMailSignature ESourceMailSignature;
59 typedef struct _ESourceMailSignatureClass ESourceMailSignatureClass;
60 typedef struct _ESourceMailSignaturePrivate ESourceMailSignaturePrivate;
61 
62 /**
63  * ESourceMailSignature:
64  *
65  * Contains only private data that should be read and manipulated using the
66  * function below.
67  *
68  * Since: 3.6
69  **/
70 struct _ESourceMailSignature {
71 	/*< private >*/
72 	ESourceExtension parent;
73 	ESourceMailSignaturePrivate *priv;
74 };
75 
76 struct _ESourceMailSignatureClass {
77 	ESourceExtensionClass parent_class;
78 };
79 
80 GType		e_source_mail_signature_get_type
81 					(void) G_GNUC_CONST;
82 GFile *		e_source_mail_signature_get_file
83 					(ESourceMailSignature *extension);
84 const gchar *	e_source_mail_signature_get_mime_type
85 					(ESourceMailSignature *extension);
86 gchar *		e_source_mail_signature_dup_mime_type
87 					(ESourceMailSignature *extension);
88 void		e_source_mail_signature_set_mime_type
89 					(ESourceMailSignature *extension,
90 					 const gchar *mime_type);
91 
92 gboolean	e_source_mail_signature_load_sync
93 					(ESource *source,
94 					 gchar **contents,
95 					 gsize *length,
96 					 GCancellable *cancellable,
97 					 GError **error);
98 void		e_source_mail_signature_load
99 					(ESource *source,
100 					 gint io_priority,
101 					 GCancellable *cancellable,
102 					 GAsyncReadyCallback callback,
103 					 gpointer user_data);
104 gboolean	e_source_mail_signature_load_finish
105 					(ESource *source,
106 					 GAsyncResult *result,
107 					 gchar **contents,
108 					 gsize *length,
109 					 GError **error);
110 gboolean	e_source_mail_signature_replace_sync
111 					(ESource *source,
112 					 const gchar *contents,
113 					 gsize length,
114 					 GCancellable *cancellable,
115 					 GError **error);
116 void		e_source_mail_signature_replace
117 					(ESource *source,
118 					 const gchar *contents,
119 					 gsize length,
120 					 gint io_priority,
121 					 GCancellable *cancellable,
122 					 GAsyncReadyCallback callback,
123 					 gpointer user_data);
124 gboolean	e_source_mail_signature_replace_finish
125 					(ESource *source,
126 					 GAsyncResult *result,
127 					 GError **error);
128 gboolean	e_source_mail_signature_symlink_sync
129 					(ESource *source,
130 					 const gchar *symlink_target,
131 					 GCancellable *cancellable,
132 					 GError **error);
133 void		e_source_mail_signature_symlink
134 					(ESource *source,
135 					 const gchar *symlink_target,
136 					 gint io_priority,
137 					 GCancellable *cancellable,
138 					 GAsyncReadyCallback callback,
139 					 gpointer user_data);
140 gboolean	e_source_mail_signature_symlink_finish
141 					(ESource *source,
142 					 GAsyncResult *result,
143 					 GError **error);
144 
145 G_END_DECLS
146 
147 #endif /* E_SOURCE_MAIL_SIGNATURE_H */
148