Top | ![]() |
![]() |
![]() |
![]() |
#define | E_SOURCE_REGISTRY_SERVER_OBJECT_PATH |
#define | EDS_REGISTRY_MODULES |
struct | ESourceRegistryServer |
The ESourceRegistryServer is the heart of the registry D-Bus service. Acting as a global singleton store for all EServerSideSource instances, its responsibilities include loading data source content from key files, exporting data sources to clients over D-Bus, handling content change requests from clients, and saving content changes back to key files.
It also hosts any number of built-in or 3rd party data source collection backends, which coordinate with ESourceRegistryServer to automatically advertise available data sources on a remote server.
EDBusServer *
e_source_registry_server_new (void
);
Creates a new instance of ESourceRegistryServer.
Since: 3.6
ESourceCredentialsProvider *
e_source_registry_server_ref_credentials_provider
(ESourceRegistryServer *server
);
Returns a referenced
A referenced g_object_unref()
Since: 3.16
void e_source_registry_server_add_source (ESourceRegistryServer *server
,ESource *source
);
Adds source
to server
.
Since: 3.6
void e_source_registry_server_remove_source (ESourceRegistryServer *server
,ESource *source
);
Removes source
and all of its descendants from server
.
Since: 3.6
gboolean e_source_registry_server_load_directory (ESourceRegistryServer *server
,const
,gchar *pathESourcePermissionFlags flags
,);
GError **error
Loads data source key files in path
. Because multiple errors can
occur when loading multiple files, error
is only set if path
can
not be opened. If a key file fails to load, the error is broadcast
through the
If the server
will emit signals on the D-Bus interface when key files are created or
deleted in path
.
server |
||
path |
the path to the directory to load |
|
flags |
permission flags for files loaded from |
|
error |
return location for a |
TRUE
path
was successfully opened, but this
does not imply the key files were successfully loaded
Since: 3.6
gboolean e_source_registry_server_load_resource (ESourceRegistryServer *server
,,
GResource *resourceconst
,gchar *pathESourcePermissionFlags flags
,);
GError **error
Loads data source key files from resource
by enumerating the children
at path
and calling e_source_registry_server_load_file()
on each child.
Because multiple errors can occur when loading multiple files, error
is
only set if path
is invalid. If a key file fails to load, the error is
broadcast through the
server |
||
resource |
a |
|
path |
the path to the data source key files inside |
|
flags |
permission flags for files loaded from |
|
error |
return location for a |
TRUE
path
was successfully located, but this does not
imply the key files were successfully loaded
Since: 3.8
ESource * e_source_registry_server_load_file (ESourceRegistryServer *server
,,
GFile *fileESourcePermissionFlags flags
,);
GError **error
Creates an ESource for a native key file and adds it to server
.
If an error occurs, the function returns NULL
error
.
The returned ESource is referenced for thread-safety. Unreference
the ESource with g_object_unref()
server |
||
file |
the data source key file to load |
|
flags |
initial permission flags for the data source |
|
error |
return location for a |
Since: 3.6
void e_source_registry_server_load_error (ESourceRegistryServer *server
,,
GFile *fileconst
);GError *error
Emits the
server |
an |
|
file |
the |
|
error |
a |
Since: 3.6
ESource * e_source_registry_server_ref_source (ESourceRegistryServer *server
,const
);gchar *uid
Looks up an ESource in server
by its unique identifier string.
The returned ESource is referenced for thread-safety and must be
unreferenced with g_object_unref()
Since: 3.6
GList * e_source_registry_server_list_sources (ESourceRegistryServer *server
,const
);gchar *extension_name
Returns a list of registered sources, sorted by display name. If
extension_name
is given, restrict the list to sources having that
extension name.
The sources 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 properly in one step is as follows:
g_list_free_full (list, g_object_unref);
Since: 3.6
ESource * e_source_registry_server_find_extension (ESourceRegistryServer *server
,ESource *source
,const
);gchar *extension_name
Examines source
and its ancestors and returns the "deepest" ESource
having an ESourceExtension with the given extension_name
. If neither
source
nor any of its ancestors have such an extension, the function
returns NULL
This function is useful in cases when an ESourceExtension is meant to apply to both the ESource it belongs to and the ESource's descendants.
A common example is the ESourceCollection extension, where descendants
of an ESource having an ESourceCollection extension are implied to be
members of that collection. In that example, this function can be used
to test whether source
is a member of a collection.
The returned ESource is referenced for thread-safety and must be
unreferenced with g_object_unref()
Note the function returns the ESource containing the ESourceExtension
instead of the ESourceExtension itself because extension instances are
not to be referenced directly (see e_source_get_extension()
).
Since: 3.8
ECollectionBackend * e_source_registry_server_ref_backend (ESourceRegistryServer *server
,ESource *source
);
Returns the ECollectionBackend associated with source
, or NULL
source
.
An ESource is associated with an ECollectionBackend if the ESource has an ESourceCollection extension, or if it is a hierarchical descendant of another ESource which has an ESourceCollection extension.
The returned ECollectionBackend is referenced for thread-safety.
Unreference the ECollectionBackend with g_object_unref()
Since: 3.6
ECollectionBackendFactory * e_source_registry_server_ref_backend_factory (ESourceRegistryServer *server
,ESource *source
);
Returns the ECollectionBackendFactory for source
, if available.
If source
does not have an ESourceCollection extension, or if the
ESourceCollection extension names a NULL
The returned ECollectionBackendFactory is referenced for thread-safety.
Unreference the ECollectionBackendFactory with g_object_unref()
Since: 3.6
gboolean e_source_registry_server_load_all (ESourceRegistryServer *server
,);
GError **error
e_source_registry_server_load_all
has been deprecated since version 3.8 and should not be used in newly-written code.
Instead, implement an equivalent function yourself. It was a mistake to encode this much file location policy directly into the library API.
Loads data source key files from standard system-wide and user-specific
locations. Because multiple errors can occur when loading multiple files,
error
is only set if a directory can not be opened. If a data source key
file fails to load, the error is broadcast through the
TRUE
Since: 3.6
#define E_SOURCE_REGISTRY_SERVER_OBJECT_PATH
D-Bus object path of the data source server.
Since: 3.6
#define EDS_REGISTRY_MODULES "EDS_REGISTRY_MODULES"
This environment variable configures where the registry server loads it's backend modules from.
struct ESourceRegistryServer { };
Contains only private data that should be read and manipulated using the functions below.
Since: 3.6