## GnomeDbDataEntry

GnomeDbDataEntry — Interface which provides the user with specific widgets to manipulate data

## Synopsis

                GnomeDbDataEntry;
                GnomeDbDataEntryIface;
    GType       gnome_db_data_entry_get_type    (void);
    void        gnome_db_data_entry_set_value_type
                                                (GnomeDbDataEntry *de,
                                                 GdaValueType type);
    GdaValueType gnome_db_data_entry_get_value_type
                                                (GnomeDbDataEntry *de);
    void        gnome_db_data_entry_set_value   (GnomeDbDataEntry *de,
                                                 const GdaValue *value);
    GdaValue*   gnome_db_data_entry_get_value   (GnomeDbDataEntry *de);
    void        gnome_db_data_entry_set_value_orig
                                                (GnomeDbDataEntry *de,
                                                 const GdaValue *value);
    const GdaValue* gnome_db_data_entry_get_value_orig
                                                (GnomeDbDataEntry *de);
    void        gnome_db_data_entry_set_current_as_orig
                                                (GnomeDbDataEntry *de);
    void        gnome_db_data_entry_set_value_default
                                                (GnomeDbDataEntry *de,
                                                 const GdaValue *value);
    void        gnome_db_data_entry_set_attributes
                                                (GnomeDbDataEntry *de,
                                                 guint attrs,
                                                 guint mask);
    guint       gnome_db_data_entry_get_attributes
                                                (GnomeDbDataEntry *de);
    GnomeDbDataHandler* gnome_db_data_entry_get_handler
                                                (GnomeDbDataEntry *de);
    gboolean    gnome_db_data_entry_expand_in_layout
                                                (GnomeDbDataEntry *de);

## Object Hierarchy

      GInterface
       +----GnomeDbDataEntry

## Known Implementations

GnomeDbDataEntry is implemented by GnomeDbEntryPassmd5, GnomeDbEntryNone, GnomeDbEntryWrapper, GnomeDbEntryBoolean, GnomeDbEntryTime, GnomeDbEntryCombo, GnomeDbEntryString and GnomeDbEntryCidr.

## Signals

    "contents-modified"
                void        user_function      (GnomeDbDataEntry *dbdataentry,
                                                gpointer user_data);
    "status-changed"
                void        user_function      (GnomeDbDataEntry *dbdataentry,
                                                gpointer user_data);

## Description

This interface is implemented by widgets to enable users to manipulate data of different types. Such widgets are created by objects implementing the GnomeDbDataHandler interface.

## Details

### GnomeDbDataEntry

    typedef struct _GnomeDbDataEntry GnomeDbDataEntry;

### GnomeDbDataEntryIface

    typedef struct {
    	GTypeInterface           g_iface;

    	/* signals */
    	void            (* contents_modified)     (GnomeDbDataEntry *de);
    	void            (* status_changed)        (GnomeDbDataEntry *de);

    	/* virtual table */
    	void            ( *set_value_type)        (GnomeDbDataEntry *de, GdaValueType type);
    	GdaValueType    ( *get_value_type)        (GnomeDbDataEntry *de);
    	void            ( *set_value)             (GnomeDbDataEntry *de, const GdaValue * value);
    	GdaValue       *( *get_value)             (GnomeDbDataEntry *de);
    	void            ( *set_value_orig)        (GnomeDbDataEntry *de, const GdaValue * value);
    	const GdaValue *( *get_value_orig)        (GnomeDbDataEntry *de);
    	void            ( *set_value_default)     (GnomeDbDataEntry *de, const GdaValue * value);
    	void            ( *set_attributes)        (GnomeDbDataEntry *de, guint attrs, guint mask);
    	guint           ( *get_attributes)        (GnomeDbDataEntry *de);
    	GnomeDbDataHandler  *( *get_handler)           (GnomeDbDataEntry *de);
    	gboolean        ( *expand_in_layout)      (GnomeDbDataEntry *de);
    } GnomeDbDataEntryIface;

### gnome_db_data_entry_get_type ()

    GType       gnome_db_data_entry_get_type    (void);

Returns : |

### gnome_db_data_entry_set_value_type ()

    void        gnome_db_data_entry_set_value_type
                                                (GnomeDbDataEntry *de,
                                                 GdaValueType type);

Sets the type of value the GnomeDbDataEntry will handle. The type must be compatible with what the widget can handle.

`de` : | a GtkWidget object which implements the GnomeDbDataEntry interface
`type` : |

### gnome_db_data_entry_get_value_type ()

    GdaValueType gnome_db_data_entry_get_value_type
                                                (GnomeDbDataEntry *de);

Fetch the type of data the GnomeDbDataEntry handles

`de` : | a GtkWidget object which implements the GnomeDbDataEntry interface
Returns : | the GdaValueType type

### gnome_db_data_entry_set_value ()

    void        gnome_db_data_entry_set_value   (GnomeDbDataEntry *de,
                                                 const GdaValue *value);

Push a value into the GnomeDbDataEntry. The value parameter must either be: - NULL or of type GDA_VALUE_TYPE_NULL, or - of type specified using gnome_db_data_entry_set_value_type.

`de` : | a GtkWidget object which implements the GnomeDbDataEntry interface
`value` : |

### gnome_db_data_entry_get_value ()

    GdaValue*   gnome_db_data_entry_get_value   (GnomeDbDataEntry *de);

Fetch the value held in the GnomeDbDataEntry widget. If the value is set to NULL, the returned value is of type GDA_VALUE_TYPE_NULL. If the value is set to default, then the returned value is of type GDA_VALUE_TYPE_NULL or is the default value if it has been provided to the widget (and is of the same type as the one provided by `de`).

`de` : | a GtkWidget object which implements the GnomeDbDataEntry interface
Returns : | a new GdaValue

### gnome_db_data_entry_set_value_orig ()

    void        gnome_db_data_entry_set_value_orig
                                                (GnomeDbDataEntry *de,
                                                 const GdaValue *value);

Push a value into the GnomeDbDataEntry in the same way as `gnome_db_data_entry_set_value()` but also sets this value as the original value.

`de` : | a GtkWidget object which implements the GnomeDbDataEntry interface
`value` : |

### gnome_db_data_entry_get_value_orig ()

    const GdaValue* gnome_db_data_entry_get_value_orig
                                                (GnomeDbDataEntry *de);

Fetch the original value held in the GnomeDbDataEntry widget

`de` : | a GtkWidget object which implements the GnomeDbDataEntry interface
Returns : | the GdaValue

### gnome_db_data_entry_set_current_as_orig ()

    void        gnome_db_data_entry_set_current_as_orig
                                                (GnomeDbDataEntry *de);

Tells that the current value in `de` is to be considered as the original value

`de` : | a GtkWidget object which implements the GnomeDbDataEntry interface

### gnome_db_data_entry_set_value_default ()

    void        gnome_db_data_entry_set_value_default
                                                (GnomeDbDataEntry *de,
                                                 const GdaValue *value);

Sets the default value for the GnomeDbDataEntry which gets displayed when the user forces the default value. If it is not set then it is set to type GDA_VALUE_TYPE_NULL. The value parameter must either be: - NULL or of type GDA_VALUE_TYPE_NULL, or - of type specified using gnome_db_data_entry_set_value_type.

`de` : | a GtkWidget object which implements the GnomeDbDataEntry interface
`value` : |

### gnome_db_data_entry_set_attributes ()

    void        gnome_db_data_entry_set_attributes
                                                (GnomeDbDataEntry *de,
                                                 guint attrs,
                                                 guint mask);

Sets the parameters of the GnomeDbDataEntry. Only the attributes corresponding to the mask are set, the other ones are ignored.

`de` : | a GtkWidget object which implements the GnomeDbDataEntry interface
`attrs` : | the attributes to set (OR'ed between them)
`mask` : | the mask corresponding to the considered attributes

### gnome_db_data_entry_get_attributes ()

    guint       gnome_db_data_entry_get_attributes
                                                (GnomeDbDataEntry *de);

Retreives the parameters of the GnomeDbDataEntry widget.

`de` : | a GtkWidget object which implements the GnomeDbDataEntry interface
Returns : | the OR'ed bits corresponding to the attributes.

### gnome_db_data_entry_get_handler ()

    GnomeDbDataHandler* gnome_db_data_entry_get_handler
                                                (GnomeDbDataEntry *de);

Fetch the GnomeDbDataHandler the GnomeDbDataEntry is using

`de` : | a GtkWidget object which implements the GnomeDbDataEntry interface
Returns : | the GnomeDbDataHandler object

### gnome_db_data_entry_expand_in_layout ()

    gboolean    gnome_db_data_entry_expand_in_layout
                                                (GnomeDbDataEntry *de);

Used for the layout of the widget in containers.

`de` : | a GtkWidget object which implements the GnomeDbDataEntry interface
Returns : | TRUE if the widget should expand

## Signal Details

### The "contents-modified" signal

    void        user_function                  (GnomeDbDataEntry *dbdataentry,
                                                gpointer user_data);

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

### The "status-changed" signal

    void        user_function                  (GnomeDbDataEntry *dbdataentry,
                                                gpointer user_data);

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

## See Also

The GnomeDbServerDataType class and GnomeDbDataHandler interface.