FolksDummyPersona

FolksDummyPersona — A persona subclass representing a single contact.

Functions

Properties

Types and Values

Object Hierarchy

    GObject
    ╰── FolksPersona
        ╰── FolksDummyPersona
            ╰── FolksDummyFullPersona

Description

This mocks up a ‘thin’ persona which implements none of the available property interfaces provided by libfolks, and is designed as a base class to be subclassed by personas which will implement one or more of these interfaces. For example, FolksDummyFullPersona is one such subclass which implements all available interfaces.

There are two sides to this class’ interface: the normal methods required by FolksPersona, such as folks_persona_linkable_property_to_links(), and the backend methods which should be called by test driver code to simulate changes in the backing store providing this persona, such as folks_dummy_persona_update_writeable_properties(). The update_, register_ and unregister_ prefixes are commonly used for backend methods.

All property changes for contact details of subclasses of FolksDummyPersona have a configurable delay before taking effect, which can be controlled by "property-change-delay".

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

Functions

FOLKS_DUMMY_TYPE_PERSONA

#define FOLKS_DUMMY_TYPE_PERSONA (folks_dummy_persona_get_type ())

The type for FolksDummyPersona.


folks_dummy_persona_update_writeable_properties ()

void
folks_dummy_persona_update_writeable_properties
                               (FolksDummyPersona *self,
                                gchar **writeable_properties,
                                int writeable_properties_length1);

Update the persona’s set of writeable properties.

Update the "writeable-properties" property to contain the union of "always-writeable-properties" from the persona’s store, and the given writeable_properties.

This should be used to simulate a change in the backing store for the persona which affects the writeability of one or more of its properties.

Parameters

self

the FolksDummyPersona instance

 

writeable_properties_length1

length of the writeable_properties array

 

writeable_properties

 

 

Since: 0.9.7


folks_dummy_persona_update_linkable_properties ()

void
folks_dummy_persona_update_linkable_properties
                               (FolksDummyPersona *self,
                                gchar **linkable_properties,
                                int linkable_properties_length1);

Update the persona’s set of linkable properties.

Update the "linkable-properties" property to contain the given linkable_properties.

Parameters

self

the FolksDummyPersona instance

 

linkable_properties

 .

new set of linkable property names, in lower case, hyphenated form

.

[in][array length=linkable_properties_length1]

linkable_properties_length1

length of the linkable_properties array

 

Since: 0.9.7


folks_dummy_persona_new ()

FolksDummyPersona *
folks_dummy_persona_new (FolksDummyPersonaStore *store,
                         const gchar *contact_id,
                         gboolean is_user,
                         gchar **linkable_properties,
                         int linkable_properties_length1);

Create a new persona.

Create a new persona for the FolksDummyPersonaStore store, with the given construct-only properties.

The persona’s "writeable-properties" are initialised to the given store’s "always-writeable-properties". They may be updated afterwards using folks_dummy_persona_update_writeable_properties().

Parameters

store

 .

the store which will contain the persona

.

[in]

contact_id

 .

a unique free-form string identifier for the persona

.

[in]

is_user

 .

true if the persona represents the user, false otherwise

.

[in]

linkable_properties

 .

an array of names of the properties which should be used for linking this persona to others

.

[in][array length=linkable_properties_length1]

linkable_properties_length1

length of the linkable_properties array

 

Since: 0.9.7

Types and Values

struct FolksDummyPersona

struct FolksDummyPersona;

A persona subclass representing a single contact.

This mocks up a ‘thin’ persona which implements none of the available property interfaces provided by libfolks, and is designed as a base class to be subclassed by personas which will implement one or more of these interfaces. For example, FolksDummyFullPersona is one such subclass which implements all available interfaces.

There are two sides to this class’ interface: the normal methods required by FolksPersona, such as folks_persona_linkable_property_to_links(), and the backend methods which should be called by test driver code to simulate changes in the backing store providing this persona, such as folks_dummy_persona_update_writeable_properties(). The update_, register_ and unregister_ prefixes are commonly used for backend methods.

All property changes for contact details of subclasses of FolksDummyPersona have a configurable delay before taking effect, which can be controlled by "property-change-delay".

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 FolksDummyPersonaClass

struct FolksDummyPersonaClass {
	FolksPersonaClass parent_class;
};

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

Members

FolksPersonaClass parent_class;

the parent class structure

 

Property Details

The “linkable-properties” property

  “linkable-properties”      GStrv

linkable-properties.

Flags: Read


The “property-change-delay” property

  “property-change-delay”    gint

property-change-delay.

Flags: Read / Write

Default value: 0


The “writeable-properties” property

  “writeable-properties”     GStrv

writeable-properties.

Flags: Read