Top | ![]() |
![]() |
![]() |
![]() |
void (*CamelSessionCallback) (,
CamelSession *session,
GCancellable *cancellable,
gpointer user_data);
GError **error
This is the callback signature for jobs submitted to the CamelSession
via camel_session_submit_job()
. The error
pointer is always non-NULL
session |
a |
|
cancellable |
a |
|
user_data |
data passed to |
|
error |
return location for a |
Since: 3.2
GMainContext * camel_session_ref_main_context ();
CamelSession *session
Returns the session
are to
be attached.
Since: 3.8
constgchar * camel_session_get_user_data_dir ();
CamelSession *session
Returns the base directory under which to store user-specific mail data.
Since: 3.2
constgchar * camel_session_get_user_cache_dir ();
CamelSession *session
Returns the base directory under which to store user-specific mail cache.
Since: 3.4
void camel_session_set_network_monitor (,
CamelSession *session);
GNetworkMonitor *network_monitor
Sets a network monitor instance for the session
. This can be used
to override which
Since: 3.22
GNetworkMonitor * camel_session_ref_network_monitor ();
CamelSession *session
References a camel_session_set_network_monitor()
. If none is set, then the default
g_network_monitor_get_default()
g_object_unref()
A referenced
[transfer full]
Since: 3.22
CamelService * camel_session_add_service (,
CamelSession *sessionconst
,gchar *uidconst
,gchar *protocolCamelProviderType type
,);
GError **error
Instantiates a new session
. The uid
identifies the
service for future lookup. The protocol
indicates which type
explicitly designates the service as a
If the given uid
has already been added, the existing uid
is returned regardless of whether it agrees with the
given protocol
and type
.
If no protocol
, or
if the type
, the
function sets error
and returns NULL
The returned g_object_unref()
session |
a |
|
uid |
a unique identifier string |
|
protocol |
the service protocol |
|
type |
the service type |
|
error |
return location for a |
Since: 3.2
void camel_session_remove_service (,
CamelSession *session);
CamelService *service
Removes a camel_session_add_service()
.
Since: 3.2
CamelService * camel_session_ref_service (,
CamelSession *sessionconst
);gchar *uid
Looks up a camel_session_add_service()
.
The returned g_object_unref()
Since: 3.6
CamelService * camel_session_ref_service_by_url (,
CamelSession *session,
CamelURL *urlCamelProviderType type
);
Looks up a url
and then checking that the object is of the desired type
.
The service must have been previously added using
camel_session_add_service()
.
The returned g_object_unref()
Note this function is significantly slower than camel_session_ref_service()
.
Since: 3.6
GList * camel_session_list_services ();
CamelSession *session
Returns a list of all camel_session_add_service()
.
The services returned in the list are referenced for thread-safety.
They must each be unreferenced with g_object_unref()
g_list_free()
An easy way to free the list property in one step is as follows:
g_list_free_full (list, g_object_unref);
Since: 3.2
void camel_session_remove_services ();
CamelSession *session
Removes all camel_session_add_service()
.
This can be useful during application shutdown to ensure all
Since: 3.2
gchar * camel_session_get_password (,
CamelSession *session,
CamelService *serviceconst
,gchar *promptconst
,gchar *item,
guint32 flags);
GError **error
This function is used by a
service
and item
together uniquely identify the piece of data the
caller is concerned with.
prompt
is a question to ask the user (if the application doesn't
already have the answer cached). If CAMEL_SESSION_PASSWORD_SECRET
If CAMEL_SESSION_PASSWORD_STATIC
The authenticator should set error
to G_IO_ERROR_CANCELLED
g_free()
session |
a |
|
service |
the |
|
prompt |
prompt to provide to user |
|
item |
an identifier, unique within this service, for the information |
|
flags |
|
|
error |
return location for a |
gboolean camel_session_forget_password (,
CamelSession *session,
CamelService *serviceconst
,gchar *item);
GError **error
This function is used by a camel_session_get_password()
was rejected by the service. If the
application was caching this information, it should stop,
and if the service asks for it again, it should ask the user.
service
and item
identify the rejected authentication information,
as with camel_session_get_password()
.
CamelCertTrust camel_session_trust_prompt (,
CamelSession *session,
CamelService *service,
GTlsCertificate *certificate);
GTlsCertificateFlags errors
Prompts the user whether to accept certificate
for service
. The
set of flags given in errors
indicate why the certificate
failed
validation.
If an error occurs during prompting or if the user declines to respond, the function returns CAMEL_CERT_TRUST_UNKNOWN and the certificate will be rejected.
session |
a |
|
service |
a |
|
certificate |
the peer's |
|
errors |
the problems with |
Since: 3.8
void camel_session_user_alert (,
CamelSession *session,
CamelService *serviceCamelSessionAlertType type
,const
);gchar *message
Emits a
The purpose of the signal is to propagate a server-issued alert message
from service
to a user interface. The type
hints at the nature of the
alert message.
Since: 3.12
void camel_session_set_online (,
CamelSession *session);
gboolean online
Sets the online status of session
to online
.
CamelFilterDriver * camel_session_get_filter_driver (,
CamelSession *sessionconst
,gchar *type,
CamelFolder *for_folder);
GError **error
The optional for_folder
can be used to determine which filters
to add and which not.
CamelJunkFilter *
camel_session_get_junk_filter (CamelSession *session
);
Returns the CamelJunkFilter instance used to classify messages as junk or not junk during filtering.
Note that CamelJunkFilter itself is just an interface. The application must implement the interface and install a CamelJunkFilter instance for junk filtering to take place.
Since: 3.2
void camel_session_set_junk_filter (,
CamelSession *sessionCamelJunkFilter *junk_filter
);
Installs the CamelJunkFilter instance used to classify messages as junk or not junk during filtering.
Note that CamelJunkFilter itself is just an interface. The application must implement the interface and install a CamelJunkFilter instance for junk filtering to take place.
Since: 3.2
guint camel_session_idle_add (,
CamelSession *session,
gint priority,
GSourceFunc function,
gpointer data);
GDestroyNotify notify
Adds a function to be called whenever there are no higher priority events
pending. If function
returns FALSE
This internally creates a main loop source using g_idle_source_new()
session
's own g_source_attach()
The priority
is typically in the range between G_PRIORITY_DEFAULT_IDLE
G_PRIORITY_HIGH_IDLE
session |
a |
|
priority |
the priority of the idle source |
|
function |
a function to call |
|
data |
data to pass to |
|
notify |
function to call when the idle is removed, or |
Since: 3.6
void camel_session_submit_job (,
CamelSession *sessionconst
,gchar *descriptionCamelSessionCallback callback
,,
gpointer user_data);
GDestroyNotify notify
This function provides a simple mechanism for providers to initiate low-priority background jobs. Jobs can be submitted from any thread, but execution of the jobs is always as follows:
1) The session
was created. This is typically the same thread
that hosts the global default
2) The callback
function is invoked from a different thread where
it's safe to call synchronous functions.
3) Once callback
has returned, the
4) Finally if a notify
function was provided, it is invoked and
passed user_data
so that user_data
can be freed.
session |
a |
|
description |
human readable description of the job, shown to a user |
|
callback |
||
user_data |
user data passed to the callback |
|
notify |
a |
Since: 3.2
constGHashTable * camel_session_get_junk_headers ();
CamelSession *session
Currently used junk
headers as a hash table, previously set by camel_session_set_junk_headers()
.
[element-type utf8 utf8][transfer none]
Since: 2.22
void camel_session_set_junk_headers (,
CamelSession *sessionconst
,gchar **headersconst
,gchar **values);
gint len
session |
a |
|
headers |
. |
[array length=len] |
values |
. |
[array] |
len |
the length of the headers and values arrays |
Since: 2.22
gboolean camel_session_lookup_addressbook (,
CamelSession *sessionconst
);gchar *name
Looks up for the name
in address books.
Since: 2.22
gboolean camel_session_authenticate_sync (,
CamelSession *session,
CamelService *serviceconst
,gchar *mechanism,
GCancellable *cancellable);
GError **error
Authenticates service
, which may involve repeated calls to
camel_service_authenticate()
or camel_service_authenticate_sync()
.
A
If an error occurs, or if authentication is aborted, the function sets
error
and returns FALSE
session |
a |
|
service |
a |
|
mechanism |
a SASL mechanism name, or |
[nullable] |
cancellable |
optional |
|
error |
return location for a |
Since: 3.4
void camel_session_authenticate (,
CamelSession *session,
CamelService *serviceconst
,gchar *mechanism,
gint io_priority,
GCancellable *cancellable,
GAsyncReadyCallback callback);
gpointer user_data
Asynchronously authenticates service
, which may involve repeated calls
to camel_service_authenticate()
or camel_service_authenticate_sync()
.
A
When the operation is finished, callback
will be called. You can
then call camel_session_authenticate_finish()
to get the result of
the operation.
session |
a |
|
service |
a |
|
mechanism |
a SASL mechanism name, or |
[nullable] |
io_priority |
the I/O priority for the request |
|
cancellable |
optional |
|
callback |
a |
|
user_data |
data to pass to the callback function |
Since: 3.4
gboolean camel_session_authenticate_finish (,
CamelSession *session,
GAsyncResult *result);
GError **error
Finishes the operation started with camel_session_authenticate()
.
If an error occurred, or if authentication was aborted, the function
sets error
and returns FALSE
Since: 3.4
gboolean camel_session_forward_to_sync (,
CamelSession *session,
CamelFolder *folder,
CamelMimeMessage *messageconst
,gchar *address,
GCancellable *cancellable);
GError **error
Forwards message
in folder
to the email address(es) given by address
.
If an error occurs, the function sets error
and returns FALSE
session |
a |
|
folder |
the |
|
message |
the |
|
address |
the recipient's email address |
|
cancellable |
optional |
|
error |
return location for a |
Since: 3.6
void camel_session_forward_to (,
CamelSession *session,
CamelFolder *folder,
CamelMimeMessage *messageconst
,gchar *address,
gint io_priority,
GCancellable *cancellable,
GAsyncReadyCallback callback);
gpointer user_data
Asynchronously forwards message
in folder
to the email address(s)
given by address
.
When the operation is finished, callback
will be called. You can
then call camel_session_forward_to_finish()
to get the result of the
operation.
session |
a |
|
folder |
the |
|
message |
the |
|
address |
the recipient's email address |
|
io_priority |
the I/O priority for the request |
|
cancellable |
optional |
|
callback |
a |
|
user_data |
data to pass to the callback function |
Since: 3.6
gboolean camel_session_forward_to_finish (,
CamelSession *session,
GAsyncResult *result);
GError **error
Finishes the operation started with camel_session_forward_to()
.
If an error occurred, the function sets error
and returns FALSE
Since: 3.6