EDataFactory

EDataFactory — An abstract base class for a backend-based server

Synopsis

#include <libebackend/libebackend.h>

struct              EDataFactory;
struct              EDataFactoryClass;
EBackendFactory *   e_data_factory_ref_backend_factory  (EDataFactory *data_factory,
                                                         const gchar *backend_name,
                                                         const gchar *extension_name);
ESourceRegistry *   e_data_factory_get_registry         (EDataFactory *data_factory);
gchar *             e_data_factory_construct_path       (EDataFactory *data_factory);
void                e_data_factory_spawn_subprocess_backend
                                                        (EDataFactory *data_factory,
                                                         GDBusMethodInvocation *invocation,
                                                         const gchar *uid,
                                                         const gchar *extension_name,
                                                         const gchar *subprocess_path);

Description

Details

struct EDataFactory

struct EDataFactory {
	EDBusServer parent;
	EDataFactoryPrivate *priv;
};

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

Since 3.4


struct EDataFactoryClass

struct EDataFactoryClass {
	EDBusServerClass parent_class;

	GType backend_factory_type;

	const gchar *factory_object_path;
	const gchar *data_object_path_prefix;
	const gchar *subprocess_object_path_prefix;
	const gchar *subprocess_bus_name_prefix;

	/* Virtual methods */
	GDBusInterfaceSkeleton *
			(*get_dbus_interface_skeleton)
						(EDBusServer *server);
	const gchar * (*get_factory_name) (EBackendFactory *backend_factory);
	void		(*complete_open) (EDataFactory *data_factory,
						 GDBusMethodInvocation *invocation,
						 const gchar *object_path,
						 const gchar *bus_name,
						 const gchar *extension_name);

	gpointer reserved[15];
};

e_data_factory_ref_backend_factory ()

EBackendFactory *   e_data_factory_ref_backend_factory  (EDataFactory *data_factory,
                                                         const gchar *backend_name,
                                                         const gchar *extension_name);

Returns the EBackendFactory for "backend_name:extension_name", or NULL if no such factory is registered.

The returned EBackendFactory is referenced for thread-safety. Unreference the EBackendFactory with g_object_unref() when finished with it.

data_factory :

an EDataFactory

backend_name :

a backend name

extension_name :

an extension name

Returns :

the EBackendFactory for hash_key, or NULL

Since 3.6


e_data_factory_get_registry ()

ESourceRegistry *   e_data_factory_get_registry         (EDataFactory *data_factory);

Returns the ESourceRegistry owned by data_factory.

data_factory :

an EDataFactory

Returns :

the ESourceRegistry

Since 3.16


e_data_factory_construct_path ()

gchar *             e_data_factory_construct_path       (EDataFactory *data_factory);

Returns a new and unique object path for a D-Bus interface based in the data object path prefix of the data_factory

data_factory :

an EDataFactory

Returns :

a newly allocated string, representing the object path for the D-Bus interface.

Since 3.16


e_data_factory_spawn_subprocess_backend ()

void                e_data_factory_spawn_subprocess_backend
                                                        (EDataFactory *data_factory,
                                                         GDBusMethodInvocation *invocation,
                                                         const gchar *uid,
                                                         const gchar *extension_name,
                                                         const gchar *subprocess_path);

Spawns a new subprocess for a backend type and returns the object path of the new subprocess to the client, in the way the client can talk directly to the running backend. If the backend already has a subprocess running, the used object path is returned to the client.

data_factory :

an EDataFactory

invocation :

a GDBusMethodInvcation

uid :

an ESource UID

extension_name :

an extension name

subprocess_path :

a path of an executable responsible for running the subprocess

Since 3.16