## GnomeDbQfValue

GnomeDbQfValue — Represents a single value (or a parameter)

## Synopsis

                GnomeDbQfValue;
    GType       gnome_db_qf_value_get_type      (void);
    GObject*    gnome_db_qf_value_new           (GnomeDbQuery *query,
                                                 GnomeDbServerDataType *type);
    void        gnome_db_qf_value_set_value     (GnomeDbQfValue *field,
                                                 const GdaValue *val);
    const GdaValue* gnome_db_qf_value_get_value (GnomeDbQfValue *field);
    void        gnome_db_qf_value_set_default_value
                                                (GnomeDbQfValue *field,
                                                 const GdaValue *default_val);
    const GdaValue* gnome_db_qf_value_get_default_value
                                                (GnomeDbQfValue *field);
    GdaValueType gnome_db_qf_value_get_value_type
                                                (GnomeDbQfValue *field);
    void        gnome_db_qf_value_set_server_data_type
                                                (GnomeDbQfValue *field,
                                                 GnomeDbServerDataType *type);
    GnomeDbServerDataType* gnome_db_qf_value_get_server_data_type
                                                (GnomeDbQfValue *field);
    void        gnome_db_qf_value_set_is_parameter
                                                (GnomeDbQfValue *field,
                                                 gboolean is_param);
    gboolean    gnome_db_qf_value_is_parameter  (GnomeDbQfValue *field);
    void        gnome_db_qf_value_set_not_null  (GnomeDbQfValue *field,
                                                 gboolean not_null);
    gboolean    gnome_db_qf_value_get_not_null  (GnomeDbQfValue *field);
    gboolean    gnome_db_qf_value_is_value_null (GnomeDbQfValue *field,
                                                 GnomeDbDataSet *context);
    gboolean    gnome_db_qf_value_restrict_with_field
                                                (GnomeDbQfValue *field,
                                                 GnomeDbQfield *provider,
                                                 GError **error);
    gboolean    gnome_db_qf_value_restrict_with_field_xml
                                                (GnomeDbQfValue *field,
                                                 const gchar *prov_xml_id,
                                                 GError **error);

## Object Hierarchy

      GObject
       +----GnomeDbBase
             +----GnomeDbQfield
                   +----GnomeDbQfValue

## Implemented Interfaces

GnomeDbQfValue implements GnomeDbXmlStorage, GnomeDbRenderer, GnomeDbReferer and GnomeDbField.

## Properties

      "handler-plugin"       gchararray            : Read / Write
      "query"                gpointer              : Read / Write
      "value-provider"       gpointer              : Read / Write
      "value-provider-xml-id" gchararray            : Read / Write

## Signals

    "templ-signal"
                void        user_function      (GnomeDbQfValue *dbqfvalue,
                                                gpointer user_data);

## Description

The value held in this object can be of any type (a GnomeDbServerDataType object must be provided when creating the object). If the value can be considered as a parameter, then the possible values for this parameter can be limited by the result of the execution of a sub query (use the "value_provider*" properties to tell from which query field the values will be taken).

## Details

### GnomeDbQfValue

    typedef struct _GnomeDbQfValue GnomeDbQfValue;

### gnome_db_qf_value_get_type ()

    GType       gnome_db_qf_value_get_type      (void);

Returns : |

### gnome_db_qf_value_new ()

    GObject*    gnome_db_qf_value_new           (GnomeDbQuery *query,
                                                 GnomeDbServerDataType *type);

Creates a new GnomeDbQfValue object which represents a value or a parameter.

`query` : | a GnomeDbQuery in which the new object will be
`type` : | the requested type for the value
Returns : | the new object

### gnome_db_qf_value_set_value ()

    void        gnome_db_qf_value_set_value     (GnomeDbQfValue *field,
                                                 const GdaValue *val);

Sets the value of `field`, or removes it (if `val` is `NULL`)

`field` : | a GnomeDbQfValue object
`val` : | the value to be set, or `NULL`

### gnome_db_qf_value_get_value ()

    const GdaValue* gnome_db_qf_value_get_value (GnomeDbQfValue *field);

Get the value stored by `field`. If there is no value, but a default value exists, then the default value is returned.n it's up to the caller to test if there is a default value for `field`. The default value can be of a different type than the one expected by `field`.

`field` : | a GnomeDbQfValue object
Returns : | the value or NULL

### gnome_db_qf_value_set_default_value ()

    void        gnome_db_qf_value_set_default_value
                                                (GnomeDbQfValue *field,
                                                 const GdaValue *default_val);

Sets the default value of `field`, or removes it (if `default_val` is `NULL`)

`field` : | a GnomeDbQfValue object
`default_val` : | the default value to be set, or `NULL`

### gnome_db_qf_value_get_default_value ()

    const GdaValue* gnome_db_qf_value_get_default_value
                                                (GnomeDbQfValue *field);

Get the default value stored by `field`.

`field` : | a GnomeDbQfValue object
Returns : | the value or NULL

### gnome_db_qf_value_get_value_type ()

    GdaValueType gnome_db_qf_value_get_value_type
                                                (GnomeDbQfValue *field);

Get the GDA type of value stored within `field`

`field` : | a GnomeDbQfValue object
Returns : | the type

### gnome_db_qf_value_set_server_data_type ()

    void        gnome_db_qf_value_set_server_data_type
                                                (GnomeDbQfValue *field,
                                                 GnomeDbServerDataType *type);

Set the GnomeDbserverDataType type of `field`

`field` : | a GnomeDbQfValue object
`type` : |

### gnome_db_qf_value_get_server_data_type ()

    GnomeDbServerDataType* gnome_db_qf_value_get_server_data_type
                                                (GnomeDbQfValue *field);

Get the GnomeDbserverDataType type of `field`

`field` : | a GnomeDbQfValue object
Returns : | the GnomeDbserverDataType type

### gnome_db_qf_value_set_is_parameter ()

    void        gnome_db_qf_value_set_is_parameter
                                                (GnomeDbQfValue *field,
                                                 gboolean is_param);

Sets wether `field` can be considered as a parameter

`field` : | a GnomeDbQfValue object
`is_param` : |

### gnome_db_qf_value_is_parameter ()

    gboolean    gnome_db_qf_value_is_parameter  (GnomeDbQfValue *field);

Tells if `field` can be considered as a parameter

`field` : | a GnomeDbQfValue object
Returns : | TRUE if `field` can be considered as a parameter

### gnome_db_qf_value_set_not_null ()

    void        gnome_db_qf_value_set_not_null  (GnomeDbQfValue *field,
                                                 gboolean not_null);

Sets if a NULL value is acceptable for `field`. If `not_null` is TRUE, then `field` can't have a NULL value.

`field` : | a GnomeDbQfValue object
`not_null` : |

### gnome_db_qf_value_get_not_null ()

    gboolean    gnome_db_qf_value_get_not_null  (GnomeDbQfValue *field);

Tells if `field` can receive a NULL value.

`field` : | a GnomeDbQfValue object
Returns : | TRUE if `field` can't have a NULL value

### gnome_db_qf_value_is_value_null ()

    gboolean    gnome_db_qf_value_is_value_null (GnomeDbQfValue *field,
                                                 GnomeDbDataSet *context);

Tells if `field` represents a NULL value.

`field` : | a GnomeDbQfValue object
`context` : | a GnomeDbDataSet object
Returns : |

### gnome_db_qf_value_restrict_with_field ()

    gboolean    gnome_db_qf_value_restrict_with_field
                                                (GnomeDbQfValue *field,
                                                 GnomeDbQfield *provider,
                                                 GError **error);

`field` : |
`provider` : |
`error` : |
Returns : |

### gnome_db_qf_value_restrict_with_field_xml ()

    gboolean    gnome_db_qf_value_restrict_with_field_xml
                                                (GnomeDbQfValue *field,
                                                 const gchar *prov_xml_id,
                                                 GError **error);

`field` : |
`prov_xml_id` : |
`error` : |
Returns : |

## Property Details

### The "`handler-plugin`" property

      "handler-plugin"       gchararray            : Read / Write

Default value: NULL

### The "`query`" property

      "query"                gpointer              : Read / Write

### The "`value-provider`" property

      "value-provider"       gpointer              : Read / Write

### The "`value-provider-xml-id`" property

      "value-provider-xml-id" gchararray            : Read / Write

Default value: NULL

## Signal Details

### The "templ-signal" signal

    void        user_function                  (GnomeDbQfValue *dbqfvalue,
                                                gpointer user_data);

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