FolksDummyBackend

FolksDummyBackend — A backend which allows FolksDummyPersonaStores and FolksDummyPersonas to be programmatically created and manipulated, for the purposes of testing the core of libfolks itself.

Functions

Properties

Types and Values

Object Hierarchy

    GObject
    ╰── FolksBackend
        ╰── FolksDummyBackend

Description

This backend is not meant to be enabled in production use. The methods on FolksDummyBackend (and other classes) for programmatically manipulating the backend's state are considered internal to libfolks and are not stable.

This backend maintains two sets of persona stores: the set of all persona stores, and the set of enabled persona stores (which must be a subset of the former). folks_dummy_backend_register_persona_stores() adds persona stores to the set of all stores. Optionally it also enables them, adding them to the set of enabled stores. The set of persona stores advertised by the backend as "persona-stores" is the set of enabled stores. libfolks may internally enable or disable stores using folks_backend_enable_persona_store(), folks_backend_disable_persona_store() and folks_backend_set_persona_stores(). The register_ and unregister_ prefixes are commonly used for backend methods.

The API in FolksDummy is unstable and may change wildly. It is designed mostly for use by libfolks unit tests.

Functions

FOLKS_DUMMY_TYPE_BACKEND

#define FOLKS_DUMMY_TYPE_BACKEND (folks_dummy_backend_get_type ())

The type for FolksDummyBackend.


folks_dummy_backend_register_persona_stores ()

void
folks_dummy_backend_register_persona_stores
                               (FolksDummyBackend *self,
                                GeeSet *stores,
                                gboolean enable_stores);

Register and enable some FolksDummyPersonaStores.

For each of the persona stores in stores, register it with this backend. If enable_stores is true, added stores will also be enabled, emitting "persona-store-added" for each newly-enabled store. After all addition signals are emitted, a change notification for "persona-stores" will be emitted (but only if at least one addition signal is emitted).

Persona stores are identified by their "id"; if a store in stores has the same ID as a store previously registered through this method, the duplicate will be ignored (so "persona-store-added" won't be emitted for that store).

Persona stores must be instances of FolksDummyPersonaStore or subclasses of it, allowing for different persona store implementations to be tested.

Parameters

self

the FolksDummyBackend instance

 

stores

 .

set of persona stores to register

.

[in]

enable_stores

 .

whether to automatically enable the stores

.

[in]

Since: 0.9.7


folks_dummy_backend_unregister_persona_stores ()

void
folks_dummy_backend_unregister_persona_stores
                               (FolksDummyBackend *self,
                                GeeSet *stores);

Disable and unregister some FolksDummyPersonaStores.

For each of the persona stores in stores, disable it (if it was enabled) and unregister it from the backend so that it cannot be re-enabled using folks_backend_enable_persona_store() or folks_backend_set_persona_stores().

"persona-store-removed" will be emitted for all persona stores in stores which were previously enabled. After all removal signals are emitted, a change notification for "persona-stores" will be emitted (but only if at least one removal signal is emitted).

Parameters

self

the FolksDummyBackend instance

 

stores

 

 

Since: 0.9.7


folks_dummy_backend_new ()

FolksDummyBackend *
folks_dummy_backend_new (void);

Since: 0.9.7

Types and Values

struct FolksDummyBackend

struct FolksDummyBackend;

A backend which allows FolksDummyPersonaStores and FolksDummyPersonas to be programmatically created and manipulated, for the purposes of testing the core of libfolks itself.

This backend is not meant to be enabled in production use. The methods on FolksDummyBackend (and other classes) for programmatically manipulating the backend's state are considered internal to libfolks and are not stable.

This backend maintains two sets of persona stores: the set of all persona stores, and the set of enabled persona stores (which must be a subset of the former). folks_dummy_backend_register_persona_stores() adds persona stores to the set of all stores. Optionally it also enables them, adding them to the set of enabled stores. The set of persona stores advertised by the backend as "persona-stores" is the set of enabled stores. libfolks may internally enable or disable stores using folks_backend_enable_persona_store(), folks_backend_disable_persona_store() and folks_backend_set_persona_stores(). The register_ and unregister_ prefixes are commonly used for backend methods.

The API in FolksDummy is unstable and may change wildly. It is designed mostly for use by libfolks unit tests.

Since: 0.9.7


struct FolksDummyBackendClass

struct FolksDummyBackendClass {
	FolksBackendClass parent_class;
};

The class structure for FOLKS_DUMMY_TYPE_BACKEND. All the fields in this structure are private and should never be accessed directly.

Members

FolksBackendClass parent_class;

the parent class structure

 

Property Details

The “is-prepared” property

  “is-prepared”              gboolean

is-prepared.

Flags: Read

Default value: FALSE


The “is-quiescent” property

  “is-quiescent”             gboolean

is-quiescent.

Flags: Read

Default value: FALSE


The “name” property

  “name”                     gchar *

name.

Flags: Read

Default value: NULL


The “persona-stores” property

  “persona-stores”           GeeMap *

persona-stores.

Flags: Read