## GnomeDbReferer

GnomeDbReferer — Interface to know when on object is completely defined

##

# Synopsis

    struct      GnomeDbReferer;
    GType       gnome_db_referer_get_type       (void);
    gboolean    gnome_db_referer_activate       (GnomeDbReferer *iface);
    void        gnome_db_referer_deactivate     (GnomeDbReferer *iface);
    gboolean    gnome_db_referer_is_active      (GnomeDbReferer *iface);
    GSList*     gnome_db_referer_get_ref_objects
                                                (GnomeDbReferer *iface);
    void        gnome_db_referer_replace_refs   (GnomeDbReferer *iface,
                                                 GHashTable *replacements);

## Object Hierarchy

      GInterface
       +----GnomeDbReferer

## Prerequisites

GnomeDbReferer requires GObject.

## Known Implementations

GnomeDbReferer is implemented by GnomeDbQuery, GnomeDbParameter, GnomeDbJoin, GnomeDbQfField, GnomeDbQfAll, GnomeDbQfValue, GnomeDbTarget, GnomeDbCustomLayout, GnomeDbCondition, GnomeDbConstraint, GnomeDbQfFunc and GnomeDbQfAgg.

## Signal Prototypes

    "activated" void        user_function      (GnomeDbReferer *dbreferer,
                                                gpointer user_data);
    "deactivated"
                void        user_function      (GnomeDbReferer *dbreferer,
                                                gpointer user_data);

## Description

Some objects can be initialized in an uncomplete state. This is the case for example of a primary key database constraint, when we don't know, at creation time, which field it applies to. These objects implement this interface to at least signal when they are ready to be used.

Some objects need to be created _before_ other objects they will need to be operational even exist. They also implement this interface.

## Details

### struct GnomeDbReferer

    struct GnomeDbReferer;

### gnome_db_referer_get_type ()

    GType       gnome_db_referer_get_type       (void);

Returns : |

### gnome_db_referer_activate ()

    gboolean    gnome_db_referer_activate       (GnomeDbReferer *iface);

Tries to activate the object, does nothing if the object is already active.

`iface` : | an object which implements the GnomeDbReferer interface
Returns : | TRUE if the object is active after the call

### gnome_db_referer_deactivate ()

    void        gnome_db_referer_deactivate     (GnomeDbReferer *iface);

Deactivates the object. This is the opposite to function `gnome_db_referer_activate()`. If the object is already non active, then nothing happens.

`iface` : | an object which implements the GnomeDbReferer interface

### gnome_db_referer_is_active ()

    gboolean    gnome_db_referer_is_active      (GnomeDbReferer *iface);

Get the status of an object

`iface` : | an object which implements the GnomeDbReferer interface
Returns : | TRUE if the object is active

### gnome_db_referer_get_ref_objects ()

    GSList*     gnome_db_referer_get_ref_objects
                                                (GnomeDbReferer *iface);

Get the list of objects which are referenced by `iface`. The returned list is a new list. If `iface` is not active, then the returned list is incomplete.

`iface` : | an object which implements the GnomeDbReferer interface
Returns : | a new list of referenced objects

### gnome_db_referer_replace_refs ()

    void        gnome_db_referer_replace_refs   (GnomeDbReferer *iface,
                                                 GHashTable *replacements);

Ask `iface` to replace references to objects listed as keys in the `replacements` hash table with references to objects of the corresponding value.

It's up to the caller to make sure each pair of (key, value) objects in `replacements` are of the same type, and that it makes sense to procede to the replacement.

The object implementing this interface will accept to do any work only if it is already active.

`iface` : | an object which implements the GnomeDbReferer interface
`replacements` : | a GHashTable

## Signals

### The "activated" signal

    void        user_function                  (GnomeDbReferer *dbreferer,
                                                gpointer user_data);

`dbreferer` : | the object which received the signal.
`user_data` : | user data set when the signal handler was connected.

### The "deactivated" signal

    void        user_function                  (GnomeDbReferer *dbreferer,
                                                gpointer user_data);

`dbreferer` : | the object which received the signal.
`user_data` : | user data set when the signal handler was connected.