GdaReportItem

## GdaReportItem GdaReportItem — |

## Synopsis

                GdaReportItemPrivate;
    GdaReportItem* gda_report_item_new          (GdaReportValid *valid,
                                                 const gchar *name);
    GdaReportItem* gda_report_item_new_from_dom (xmlNodePtr node);
    gboolean    gda_report_item_remove          (GdaReportItem *item);
    gboolean    gda_report_item_add_previous    (GdaReportItem *item,
                                                 GdaReportItem *new_item);
    gboolean    gda_report_item_add_next        (GdaReportItem *item,
                                                 GdaReportItem *new_item);
    gboolean    gda_report_item_add_child       (GdaReportItem *parent,
                                                 GdaReportItem *child);
    gboolean    gda_report_item_replace         (GdaReportItem *item,
                                                 GdaReportItem *new_item);
    xmlNodePtr  gda_report_item_to_dom          (GdaReportItem *item);
    gchar*      gda_report_item_get_item_type   (GdaReportItem *item);
    gboolean    gda_report_item_set_attribute   (GdaReportItem *item,
                                                 const gchar *name,
                                                 const gchar *value);
    gchar*      gda_report_item_get_attribute   (GdaReportItem *item,
                                                 const gchar *name);
    gchar*      gda_report_item_get_inherit_attribute
                                                (GdaReportItem *item,
                                                 const gchar *name);
    GdaReportItem* gda_report_item_get_child_by_id
                                                (GdaReportItem *parent,
                                                 const gchar *id);
    GdaReportItem* gda_report_item_get_first_child
                                                (GdaReportItem *parent);
    GdaReportItem* gda_report_item_get_next_child
                                                (GdaReportItem *parent,
                                                 GdaReportItem *item);
    gboolean    gda_report_item_set_content     (GdaReportItem *item,
                                                 const gchar *content);
    gchar*      gda_report_item_get_content     (GdaReportItem *item);
    gboolean    gda_report_item_belongs_to_report_document
                                                (GdaReportItem *item);
    GdaReportItem* gda_report_item_get_report   (GdaReportItem *item);

## Description

## Details

### GdaReportItemPrivate

    typedef struct {
    	xmlNodePtr node;
    	GdaReportValid *valid;
    } GdaReportItemPrivate;

### gda_report_item_new ()

    GdaReportItem* gda_report_item_new          (GdaReportValid *valid,
                                                 const gchar *name);

Creates a new item with the given name, and using the given GdaReportValid object

`valid` : | a GdaReportValid object
`name` : | name of the item to be created
Returns : | the new GdaReportItem or NULL if there is some problem

### gda_report_item_new_from_dom ()

    GdaReportItem* gda_report_item_new_from_dom (xmlNodePtr node);

Creates a new item from a given xml node

`node` : | a xmlNodePtr, assumed to be a valid gda-report element
Returns : | the new GdaReportItem or NULL if there is some problem

### gda_report_item_remove ()

    gboolean    gda_report_item_remove          (GdaReportItem *item);

Remove the current item from the report

`item` : | the GdaReportItem to be removed
Returns : | TRUE if all is ok, FALSE otherwise

### gda_report_item_add_previous ()

    gboolean    gda_report_item_add_previous    (GdaReportItem *item,
                                                 GdaReportItem *new_item);

Sets new_item as the previous sibling of item

`item` : | the referential GdaReportItem
`new_item` : | the GdaReportItem to be added
Returns : | TRUE if all is ok, FALSE otherwise

### gda_report_item_add_next ()

    gboolean    gda_report_item_add_next        (GdaReportItem *item,
                                                 GdaReportItem *new_item);

Sets new_item as the next sibling of item

`item` : | the referential GdaReportItem
`new_item` : | the GdaReportItem to be added
Returns : | TRUE if all is ok, FALSE otherwise

### gda_report_item_add_child ()

    gboolean    gda_report_item_add_child       (GdaReportItem *parent,
                                                 GdaReportItem *child);

Sets child item as a child of parent item

`parent` : | a GdaReportItem
`child` : | an already created GdaReportItem
Returns : | TRUE if all is ok, FALSE otherwise

### gda_report_item_replace ()

    gboolean    gda_report_item_replace         (GdaReportItem *item,
                                                 GdaReportItem *new_item);

Replace item for new_item

`item` : | the GdaReportItem to be replaced
`new_item` : | the new GdaReportItem
Returns : | TRUE if all is ok, FALSE otherwise

### gda_report_item_to_dom ()

    xmlNodePtr  gda_report_item_to_dom          (GdaReportItem *item);

`item` : | a GdaReportItem
Returns : | the xml representation of the item, or NULL if there is some problem

### gda_report_item_get_item_type ()

    gchar*      gda_report_item_get_item_type   (GdaReportItem *item);

`item` : | a GdaReportItem object
Returns : | the type of the item

### gda_report_item_set_attribute ()

    gboolean    gda_report_item_set_attribute   (GdaReportItem *item,
                                                 const gchar *name,
                                                 const gchar *value);

Validates the attribute and the value and, if all is right, sets the given value to the attribute of given item

`item` : | a GdaReportItem object
`name` : | name of the attribute to be set
`value` : | value to be set
Returns : | TRUE if all is ok, FALSE otherwise

### gda_report_item_get_attribute ()

    gchar*      gda_report_item_get_attribute   (GdaReportItem *item,
                                                 const gchar *name);

`item` : | a GdaReportItem object
`name` : | an attribute name
Returns : | the value of given attribute in given item. If attribute is not set, but a default value is defined in the DTD, this defaults value is returned. If there is some problem, or attribute is not defined and there is no default value, NULL is returned

### gda_report_item_get_inherit_attribute ()

    gchar*      gda_report_item_get_inherit_attribute
                                                (GdaReportItem *item,
                                                 const gchar *name);

Searches for the attribute in all ancestors of the item

`item` : | a GdaReportItem object
`name` : | an attribute name
Returns : | the value of the attribute in the first ancestor where found, or NULL if not found or there is some problem

### gda_report_item_get_child_by_id ()

    GdaReportItem* gda_report_item_get_child_by_id
                                                (GdaReportItem *parent,
                                                 const gchar *id);

Searches recursively for a child item with the given Id

`parent` : | a GdaReportItem object
`id` : | the id of the searched child item
Returns : | the child item if found, or NULL otherwise

### gda_report_item_get_first_child ()

    GdaReportItem* gda_report_item_get_first_child
                                                (GdaReportItem *parent);

`parent` : | a GdaReportItem object
Returns : | the first child item found, or NULL if no child exists

### gda_report_item_get_next_child ()

    GdaReportItem* gda_report_item_get_next_child
                                                (GdaReportItem *parent,
                                                 GdaReportItem *item);

`parent` : | a GdaReportItem object
`item` : | the previous item to the searched one
Returns : | next child item to the given child item

### gda_report_item_set_content ()

    gboolean    gda_report_item_set_content     (GdaReportItem *item,
                                                 const gchar *content);

`item` : |
`content` : |
Returns : |

### gda_report_item_get_content ()

    gchar*      gda_report_item_get_content     (GdaReportItem *item);

`item` : |
Returns : |

### gda_report_item_belongs_to_report_document ()

    gboolean    gda_report_item_belongs_to_report_document
                                                (GdaReportItem *item);

`item` : |
Returns : |

### gda_report_item_get_report ()

    GdaReportItem* gda_report_item_get_report   (GdaReportItem *item);

`item` : | a GdaReportItem object
Returns : | The report to which current item is assigned to, or NULL if it is not assigned yet