EConfigLookup

EConfigLookup — Configuration lookup

Functions

Types and Values

Includes

#include <e-util/e-util.h>

Description

EConfigLookup is used to search for configuration of an account, which is identified by an e-mail address, server address or such. It is an EExtensible object, where the extensions connect to the “run” signal to run the configuration lookup.

Functions

EConfigLookupThreadFunc ()

void
(*EConfigLookupThreadFunc) (EConfigLookup *config_lookup,
                            const ENamedParameters *params,
                            gpointer user_data,
                            GCancellable *cancellable);

A function executed in a dedicated thread.

Parameters

config_lookup

an EConfigLookup

 

params

an ENamedParameters with additional parameters

 

user_data

user data passed to e_config_lookup_create_thread()

 

cancellable

a GCancellable

 

Since: 3.26


e_config_lookup_new ()

EConfigLookup *
e_config_lookup_new (ESourceRegistry *registry);

Creates a new EConfigLookup instance.

Parameters

registry

an ESourceRegistry

 

Returns

a new EConfigLookup.

[transfer full]

Since: 3.26


e_config_lookup_get_registry ()

ESourceRegistry *
e_config_lookup_get_registry (EConfigLookup *config_lookup);

Returns the ESourceRegistry passed to e_config_lookup_new().

Parameters

config_lookup

an EConfigLookup

 

Returns

an ESourceRegistry.

[transfer none]

Since: 3.26


e_config_lookup_get_source ()

ESource *
e_config_lookup_get_source (EConfigLookup *config_lookup,
                            EConfigLookupSourceKind kind);

Emits the “get-source” signal and any listener can provide the source. The function can return NULL, when there are no listeners or when such source is not available.

Parameters

config_lookup

an EConfigLookup

 

kind

one of EConfigLookupSourceKind, except of the E_CONFIG_LOOKUP_SOURCE_UNKNOWN

 

Returns

an ESource of the given kind , or NULL, if not found.

[transfer none][nullable]

Since: 3.26


e_config_lookup_run ()

void
e_config_lookup_run (EConfigLookup *config_lookup,
                     const ENamedParameters *params,
                     GCancellable *cancellable,
                     GAsyncReadyCallback callback,
                     gpointer user_data);

Runs configuration lookup asynchronously, by emitting the “run” signal. Once the run is done, the callback is called, and the call can be finished with e_config_lookup_run_finish(). The callback is always called from the main thread.

Note that there cannot be run two lookups at the same time, thus if it happens, then the callback is called immediately with a NULL result.

Parameters

config_lookup

an EConfigLookup

 

params

an ENamedParameters with lookup parameters

 

cancellable

an optional GCancellable, or NULL

 

callback

a callback to call, when the run is finished

 

user_data

user data for the callback

 

Since: 3.26


e_config_lookup_run_finish ()

void
e_config_lookup_run_finish (EConfigLookup *config_lookup,
                            GAsyncResult *result);

Finishes the configuration lookup previously run by e_config_lookup_run(). It's expected that the extensions may fail, thus it doesn't return anything and is provided mainly for consistency with asynchronous API.

Parameters

config_lookup

an EConfigLookup

 

result

result of the operation

 

Since: 3.26


e_config_lookup_create_thread ()

void
e_config_lookup_create_thread (EConfigLookup *config_lookup,
                               const ENamedParameters *params,
                               EActivity *activity,
                               EConfigLookupThreadFunc thread_func,
                               gpointer user_data,
                               GDestroyNotify user_data_free);

Creates a new thread and calls thread_func in it. It also references activity and unreferences it once the thread_func is done.

This function might be usually called by extensions in a signal handler for the “run” signal.

Parameters

config_lookup

an EConfigLookup

 

params

an ENamedParameters with lookup parameters

 

activity

an EActivity

 

thread_func

function to call in a new thread

 

user_data

optional user data for thread_func , or NULL.

[nullable]

user_data_free

optional free function for user_data , or NULL.

[nullable]

Since: 3.26


e_config_lookup_add_result ()

void
e_config_lookup_add_result (EConfigLookup *config_lookup,
                            EConfigLookupResult *result);

Adds a new result in a list of known configuration lookup results. The config_lookup assumes ownership of the result and frees it when no longer needed.

The list of results can be obtained with e_config_lookup_get_results().

Parameters

config_lookup

an EConfigLookup

 

result

an EConfigLookupResult.

[transfer full]

Since: 3.26


e_config_lookup_get_results ()

GSList *
e_config_lookup_get_results (EConfigLookup *config_lookup,
                             EConfigLookupResultKind kind,
                             const gchar *protocol);

Returns a GSList with EConfigLookupResult objects satisfying the kind and protocol filtering conditions. To receive all gathered results use E_CONFIG_LOOKUP_RESULT_UNKNOWN for kind and NULL for the protocol .

Free the returned GSList with g_slist_free_full (results, g_object_unref); when no longer needed.

Parameters

config_lookup

an EConfigLookup

 

kind

an EConfigLookupResultKind to filter the results with

 

protocol

optional protocol to filter the results with, or NULL.

[nullable]

Returns

a GSList with results satisfying the kind and protocol filtering conditions.

[element-type EConfigLookupResult][transfer full]

Since: 3.26

Types and Values

E_CONFIG_LOOKUP_PARAM_USER

#define E_CONFIG_LOOKUP_PARAM_USER		"user"

E_CONFIG_LOOKUP_PARAM_PASSWORD

#define E_CONFIG_LOOKUP_PARAM_PASSWORD		"password"

E_CONFIG_LOOKUP_PARAM_EMAIL_ADDRESS

#define E_CONFIG_LOOKUP_PARAM_EMAIL_ADDRESS "email-address"

E_CONFIG_LOOKUP_PARAM_SERVERS

#define E_CONFIG_LOOKUP_PARAM_SERVERS		"servers"

struct EConfigLookup

struct EConfigLookup {
};

Contains only private data that should be read and manipulated using the functions below.

Since: 3.26