Top |
ESourceMailSignatureESourceMailSignature — ESource extension for email signatures |
Functions
Description
The ESourceMailSignature extension refers to a personalized email signature.
Access the extension as follows:
1 2 3 4 5 |
#include <libedataserver/libedataserver.h> ESourceMailSignature *extension; extension = e_source_get_extension (source, E_SOURCE_EXTENSION_MAIL_SIGNATURE); |
Functions
e_source_mail_signature_get_file ()
GFile *
e_source_mail_signature_get_file (ESourceMailSignature *extension
);
Returns a GFile instance pointing to the signature file for extension
.
The signature file may be a regular file containing the static signature
content, or it may be a symbolic link to an executable file that produces
the signature content.
e_source_mail_signature_load() uses this to load the signature content.
Since: 3.6
e_source_mail_signature_get_mime_type ()
const gchar *
e_source_mail_signature_get_mime_type (ESourceMailSignature *extension
);
Returns the MIME type of the signature content for extension
, or NULL
if it has not yet been determined.
e_source_mail_signature_load() sets this automatically if the MIME type has not yet been determined.
Since: 3.6
e_source_mail_signature_dup_mime_type ()
gchar *
e_source_mail_signature_dup_mime_type (ESourceMailSignature *extension
);
Thread-safe variation of e_source_mail_signature_get_mime_type()
.
Use this function when accessing extension
from multiple threads.
The returned string should be freed with g_free()
when no longer needed.
Since: 3.6
e_source_mail_signature_set_mime_type ()
void e_source_mail_signature_set_mime_type (ESourceMailSignature *extension
,const gchar *mime_type
);
Sets the MIME type of the signature content for extension
.
e_source_mail_signature_load() sets this automatically if the MIME type has not yet been determined.
The internal copy of mime_type
is automatically stripped of leading
and trailing whitespace. If the resulting string is empty, NULL
is
set instead.
Since: 3.6
e_source_mail_signature_load_sync ()
gboolean e_source_mail_signature_load_sync (ESource *source
,gchar **contents
,gsize *length
,GCancellable *cancellable
,GError **error
);
Loads a signature from the signature file for source
, which is
given by e_source_mail_signature_get_file()
. The signature contents
are placed in contents
, and length
is set to the size of the contents
string. The contents
string should be freed with g_free()
when no
longer needed.
If the signature file is executable, it will be executed and its output captured as the email signature content. If the signature file is not executable, the email signature content is read directly from the file.
Parameters
source |
an ESource |
|
contents |
return location for the signature content. |
[out] |
length |
return location for the length of the signature
content, or |
[allow-none][out] |
cancellable |
optional GCancellable object, or |
[allow-none] |
error |
Since: 3.6
e_source_mail_signature_load ()
void e_source_mail_signature_load (ESource *source
,gint io_priority
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously loads a signature from the signature file for source
,
which is given by e_source_mail_signature_get_file()
.
If the signature file is executable, it will be executed and its output captured as the email signature content. If the signature file is not executable, the email signature content is read directly from the file.
When the operation is finished, callback
will be called. You can
then call e_source_mail_signature_load_finish()
to get the result of
the operation.
Parameters
source |
an ESource |
|
io_priority |
the I/O priority of the request |
|
cancellable |
optional GCancellable object, or |
[allow-none] |
callback |
a GAsyncReadyCallback to call when the request is satisfied. |
[scope async] |
user_data |
data to pass to the callback function. |
[closure] |
Since: 3.6
e_source_mail_signature_load_finish ()
gboolean e_source_mail_signature_load_finish (ESource *source
,GAsyncResult *result
,gchar **contents
,gsize *length
,GError **error
);
Finishes an operation started with e_source_mail_signature_load()
. The
signature file contents are placed in contents
, and length
is set to
the size of the contents
string. The contents
string should be freed
with g_free()
when no longer needed.
Parameters
Since: 3.6
e_source_mail_signature_replace_sync ()
gboolean e_source_mail_signature_replace_sync (ESource *source
,const gchar *contents
,gsize length
,GCancellable *cancellable
,GError **error
);
Replaces the signature file for source
with the given contents
of length
bytes. The signature file for source
is given by
e_source_mail_signature_get_file()
.
Parameters
source |
an ESource |
|
contents |
the signature contents |
|
length |
the length of |
|
cancellable |
optional GCancellable object, or |
[allow-none] |
error |
Since: 3.6
e_source_mail_signature_replace ()
void e_source_mail_signature_replace (ESource *source
,const gchar *contents
,gsize length
,gint io_priority
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchrously replaces the signature file for source
with the given
contents
of length
bytes. The signature file for source
is given
by e_source_mail_signature_get_file()
.
When the operation is finished, callback
will be called. You can
then call e_source_mail_signature_replace_finish()
to get the result
of the operation.
Parameters
source |
an ESource |
|
contents |
the signature contents |
|
length |
the length of |
|
io_priority |
the I/O priority of the request |
|
cancellable |
optional GCancellable object, or |
[allow-none] |
callback |
a GAsyncReadyCallback to call when the request is satisfied. |
[scope async] |
user_data |
data to pass to the callback function. |
[closure] |
Since: 3.6
e_source_mail_signature_replace_finish ()
gboolean e_source_mail_signature_replace_finish (ESource *source
,GAsyncResult *result
,GError **error
);
Finishes an operation started with e_source_mail_signature_replace()
.
Since: 3.6
e_source_mail_signature_symlink_sync ()
gboolean e_source_mail_signature_symlink_sync (ESource *source
,const gchar *symlink_target
,GCancellable *cancellable
,GError **error
);
Replaces the signature file for source
with a symbolic link to
symlink_target
, which should be an executable file that prints
a mail signature to standard output. The signature file for
source
is given by e_source_mail_signature_get_file()
.
Parameters
source |
an ESource |
|
symlink_target |
executable filename to link to |
|
cancellable |
optional GCancellable object, or |
[allow-none] |
error |
Since: 3.6
e_source_mail_signature_symlink ()
void e_source_mail_signature_symlink (ESource *source
,const gchar *symlink_target
,gint io_priority
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously replaces the signature file for source
with a symbolic
link to symlink_target
, which should be an executable file that prints
a mail signature to standard output. The signature file for source
is given by e_source_mail_signature_get_file()
.
When the operation is finished, callback
will be called. You can
then call e_source_mail_signature_symlink_finish()
to get the result
of the operation.
Parameters
source |
an ESource |
|
symlink_target |
executable filename to link to |
|
io_priority |
the I/O priority of the request |
|
cancellable |
optional GCancellable object, or |
[allow-none] |
callback |
a GAsyncReadyCallback to call when the request is satisfied. |
[scope async] |
user_data |
data to pass to the callback function. |
[closure] |
Since: 3.6
e_source_mail_signature_symlink_finish ()
gboolean e_source_mail_signature_symlink_finish (ESource *source
,GAsyncResult *result
,GError **error
);
Finishes an operation started with e_source_mail_signature_symlink()
.
Since: 3.6
Types and Values
E_SOURCE_EXTENSION_MAIL_SIGNATURE
#define E_SOURCE_EXTENSION_MAIL_SIGNATURE "Mail Signature"
Pass this extension name to e_source_get_extension()
to access
ESourceMailSignature. This is also used as a group name in key files.
Since: 3.6
struct ESourceMailSignature
struct ESourceMailSignature;
Contains only private data that should be read and manipulated using the function below.
Since: 3.6