## GdaQueryField

GdaQueryField — Parent class for any query's field

## Synopsis

                        GdaQueryField;
    enum                GdaQueryFieldState;
    GdaQueryField*      gda_query_field_new_from_xml        (GdaQuery *query,
                                                             xmlNodePtr node,
                                                             GError **error);
    GdaQueryField*      gda_query_field_new_copy            (GdaQueryField *orig);
    GdaQueryField*      gda_query_field_new_from_sql        (GdaQuery *query,
                                                             const gchar *sqlfield,
                                                             GError **error);
    void                gda_query_field_set_alias           (GdaQueryField *qfield,
                                                             const gchar *alias);
    const gchar*        gda_query_field_get_alias           (GdaQueryField *qfield);
    void                gda_query_field_set_visible         (GdaQueryField *qfield,
                                                             gboolean visible);
    gboolean            gda_query_field_is_visible          (GdaQueryField *qfield);
    void                gda_query_field_set_internal        (GdaQueryField *qfield,
                                                             gboolean internal);
    gboolean            gda_query_field_is_internal         (GdaQueryField *qfield);
    GdaDictType*        gda_query_field_get_dict_type       (GdaQueryField *qfield);
    GSList*             gda_query_field_get_parameters      (GdaQueryField *qfield);
    gboolean            gda_query_field_is_equal            (GdaQueryField *qfield1,
                                                             GdaQueryField *qfield2);
    gboolean            gda_query_field_is_list             (GdaQueryField *qfield);

## Object Hierarchy

      GObject
       +----GdaObject
             +----GdaQueryObject
                   +----GdaQueryField
                         +----GdaQueryFieldAgg
                         +----GdaQueryFieldAll
                         +----GdaQueryFieldField
                         +----GdaQueryFieldFunc
                         +----GdaQueryFieldValue

## Description

## Details

### GdaQueryField

    typedef struct _GdaQueryField GdaQueryField;

### enum GdaQueryFieldState

    typedef enum {
    	GDA_ENTITY_FIELD_VISIBLE   = 1 << 0,
    	GDA_ENTITY_FIELD_INVISIBLE = 1 << 1,
    	GDA_ENTITY_FIELD_ANY       = GDA_ENTITY_FIELD_VISIBLE | GDA_ENTITY_FIELD_INVISIBLE
    } GdaQueryFieldState;

### gda_query_field_new_from_xml ()

    GdaQueryField*      gda_query_field_new_from_xml        (GdaQuery *query,
                                                             xmlNodePtr node,
                                                             GError **error);

This is an object factory which does create instances of class inheritants of the GnomeDbDfield class. Ths GdaQueryField object MUST then be attached to `query`

`query` : | a GdaQuery object
`node` : | an XML node corresponding to a GDA_QUERY_FIELD tag
`error` : | location to store error, or `NULL`
Returns : | the newly created object

### gda_query_field_new_copy ()

    GdaQueryField*      gda_query_field_new_copy            (GdaQueryField *orig);

This is a copy constructor

`orig` : | a GdaQueryField to copy
Returns : | the new object

### gda_query_field_new_from_sql ()

    GdaQueryField*      gda_query_field_new_from_sql        (GdaQuery *query,
                                                             const gchar *sqlfield,
                                                             GError **error);

Creates a new GdaQueryField from its SQL representation

`query` : | a GdaQuery object
`sqlfield` : | a SQL statement representing a query field
`error` : | location to store error, or `NULL`
Returns : | a new GdaQueryField object, or `NULL` if an error occurred

### gda_query_field_set_alias ()

    void                gda_query_field_set_alias           (GdaQueryField *qfield,
                                                             const gchar *alias);

Sets `qfield`'s alias

`qfield` : | a GdaQueryField object
`alias` : | the alias to set `qfield` to

### gda_query_field_get_alias ()

    const gchar*        gda_query_field_get_alias           (GdaQueryField *qfield);

Get `qfield`'s alias

`qfield` : | a GdaQueryField object
Returns : | the alias

### gda_query_field_set_visible ()

    void                gda_query_field_set_visible         (GdaQueryField *qfield,
                                                             gboolean visible);

Sets the visibility of `qfield`. A visible field will appear in the query's corresponding (virtual) entity, whereas a non visible one will be hidden (and possibly not taking part in the query).

`qfield` : | a GdaQueryField object
`visible` : |

### gda_query_field_is_visible ()

    gboolean            gda_query_field_is_visible          (GdaQueryField *qfield);

`qfield` : | a GdaQueryField object
Returns : | TRUE if `field` is visible

### gda_query_field_set_internal ()

    void                gda_query_field_set_internal        (GdaQueryField *qfield,
                                                             gboolean internal);

Sets weather `qfield` is internal or not. Internal fields in a query are fields added or changed by libgnomedb itself, such fields may or may not be visible.

`qfield` : | a GdaQueryField object
`internal` : |

### gda_query_field_is_internal ()

    gboolean            gda_query_field_is_internal         (GdaQueryField *qfield);

`qfield` : | a GdaQueryField object
Returns : | TRUE if `field` is internal

### gda_query_field_get_dict_type ()

    GdaDictType*        gda_query_field_get_dict_type       (GdaQueryField *qfield);

Get the GdaDictType represented by the `qfield` object: for a function it returns the return type, for a value, it returns its type, etc.

`qfield` : | a GdaQueryField object
Returns : | the data type, or `NULL` if `qfield` does not have a data type.

### gda_query_field_get_parameters ()

    GSList*             gda_query_field_get_parameters      (GdaQueryField *qfield);

Get a list of all the parameters needed to `qfield` to be rendered as a valid statement

`qfield` : | a GdaQueryField object
Returns : | a new list of parameters for `qfield`

### gda_query_field_is_equal ()

    gboolean            gda_query_field_is_equal            (GdaQueryField *qfield1,
                                                             GdaQueryField *qfield2);

Compares the `qfield1` and `qfield2`. The name and aliases of the two fields are not compared, only the contents of the fields are.

`qfield1` : | a GdaQueryField object
`qfield2` : | a GdaQueryField object
Returns : | TRUE if they are equal and FALSE otherwise

### gda_query_field_is_list ()

    gboolean            gda_query_field_is_list             (GdaQueryField *qfield);

Tells if `qfield` can potentially represent a list of values.

`qfield` : | a GdaQueryField object
Returns : | TRUE if `field` can be a list of values