GdaDataModel columns

GdaDataModel columns — Management of GdaDataModel column attributes

Synopsis

                    GdaColumn;
GdaColumn*          gda_column_new                      (void);
GdaColumn*          gda_column_copy                     (GdaColumn *column);
const gchar*        gda_column_get_name                 (GdaColumn *column);
void                gda_column_set_name                 (GdaColumn *column,
                                                         const gchar *name);
const gchar*        gda_column_get_description          (GdaColumn *column);
void                gda_column_set_description          (GdaColumn *column,
                                                         const gchar *title);
const gchar*        gda_column_get_dbms_type            (GdaColumn *column);
void                gda_column_set_dbms_type            (GdaColumn *column,
                                                         const gchar *dbms_type);
GType               gda_column_get_g_type               (GdaColumn *column);
void                gda_column_set_g_type               (GdaColumn *column,
                                                         GType type);
gboolean            gda_column_get_allow_null           (GdaColumn *column);
void                gda_column_set_allow_null           (GdaColumn *column,
                                                         gboolean allow);
gboolean            gda_column_get_auto_increment       (GdaColumn *column);
void                gda_column_set_auto_increment       (GdaColumn *column,
                                                         gboolean is_auto);
gint                gda_column_get_position             (GdaColumn *column);
void                gda_column_set_position             (GdaColumn *column,
                                                         gint position);
const GValue*       gda_column_get_default_value        (GdaColumn *column);
void                gda_column_set_default_value        (GdaColumn *column,
                                                         const GValue *default_value);
const GValue*       gda_column_get_attribute            (GdaColumn *column,
                                                         const gchar *attribute);
void                gda_column_set_attribute            (GdaColumn *column,
                                                         const gchar *attribute,
                                                         const GValue *value);

Object Hierarchy

  GObject
   +----GdaColumn

Properties

  "id"                       gchar*                : Read / Write

Signals

  "g-type-changed"                                 : Run Last
  "name-changed"                                   : Run Last

Description

Details

GdaColumn

typedef struct _GdaColumn GdaColumn;


gda_column_new ()

GdaColumn*          gda_column_new                      (void);

Returns :

a newly allocated GdaColumn object.

gda_column_copy ()

GdaColumn*          gda_column_copy                     (GdaColumn *column);

Creates a new GdaColumn object from an existing one.

column :

column to get a copy from.

Returns :

a newly allocated GdaColumn with a copy of the data in column.

gda_column_get_name ()

const gchar*        gda_column_get_name                 (GdaColumn *column);

column :

a GdaColumn.

Returns :

the name of column.

gda_column_set_name ()

void                gda_column_set_name                 (GdaColumn *column,
                                                         const gchar *name);

Sets the name of column to name.

column :

a GdaColumn.

name :

the new name of column.

gda_column_get_description ()

const gchar*        gda_column_get_description          (GdaColumn *column);

column :

a GdaColumn.

Returns :

the column's description, in any

gda_column_set_description ()

void                gda_column_set_description          (GdaColumn *column,
                                                         const gchar *title);

Sets the column's description

column :

a GdaColumn.

title :

title name.

gda_column_get_dbms_type ()

const gchar*        gda_column_get_dbms_type            (GdaColumn *column);

column :

a GdaColumn.

Returns :

the dbms_type of column.

gda_column_set_dbms_type ()

void                gda_column_set_dbms_type            (GdaColumn *column,
                                                         const gchar *dbms_type);

column :

dbms_type :


gda_column_get_g_type ()

GType               gda_column_get_g_type               (GdaColumn *column);

column :

a GdaColumn.

Returns :

the type of column.

gda_column_set_g_type ()

void                gda_column_set_g_type               (GdaColumn *column,
                                                         GType type);

Sets the type of column to type.

column :

a GdaColumn.

type :

the new type of column.

gda_column_get_allow_null ()

gboolean            gda_column_get_allow_null           (GdaColumn *column);

Gets the 'allow null' flag of the given column.

column :

a GdaColumn.

Returns :

whether the given column allows null values or not (TRUE or FALSE).

gda_column_set_allow_null ()

void                gda_column_set_allow_null           (GdaColumn *column,
                                                         gboolean allow);

Sets the 'allow null' flag of the given column.

column :

a GdaColumn.

allow :

whether the given column should allows null values or not.

gda_column_get_auto_increment ()

gboolean            gda_column_get_auto_increment       (GdaColumn *column);

column :

a GdaColumn.

Returns :

whether the given column is an auto incremented one (TRUE or FALSE).

gda_column_set_auto_increment ()

void                gda_column_set_auto_increment       (GdaColumn *column,
                                                         gboolean is_auto);

Sets the auto increment flag for the given column.

column :

a GdaColumn.

is_auto :

auto increment status.

gda_column_get_position ()

gint                gda_column_get_position             (GdaColumn *column);

column :

a GdaColumn.

Returns :

the position of the column refer to in the containing data model.

gda_column_set_position ()

void                gda_column_set_position             (GdaColumn *column,
                                                         gint position);

Sets the position of the column refer to in the containing data model.

column :

a GdaColumn.

position :

the wanted position of the column in the containing data model.

gda_column_get_default_value ()

const GValue*       gda_column_get_default_value        (GdaColumn *column);

column :

a GdaColumn.

Returns :

column's default value, as a GValue object.

gda_column_set_default_value ()

void                gda_column_set_default_value        (GdaColumn *column,
                                                         const GValue *default_value);

Sets column's default GValue.

column :

a GdaColumn.

default_value :

default GValue for the column

gda_column_get_attribute ()

const GValue*       gda_column_get_attribute            (GdaColumn *column,
                                                         const gchar *attribute);

Get the value associated to a named attribute.

Attributes can have any name, but Libgda proposes some default names, see this section.

column :

a GdaColumn

attribute :

attribute name as a string

Returns :

a read-only GValue, or NULL if not attribute named attribute has been set for column

gda_column_set_attribute ()

void                gda_column_set_attribute            (GdaColumn *column,
                                                         const gchar *attribute,
                                                         const GValue *value);

Set the value associated to a named attribute.

Attributes can have any name, but Libgda proposes some default names, see this section. If there is already an attribute named attribute set, then its value is replaced with the new value, except if value is NULL, in which case the attribute is removed.

Warning: sttribute should be a static string (no copy of it is made), so the string should exist as long as the column object exists.

column :

a GdaColumn

attribute :

attribute name as a static string

value :

a GValue, or NULL

Property Details

The "id" property

  "id"                       gchar*                : Read / Write

Default value: NULL

Signal Details

The "g-type-changed" signal

void                user_function                      (GdaColumn *gdacolumn,
                                                        GType     *arg1,
                                                        GType     *arg2,
                                                        gpointer   user_data)      : Run Last

gdacolumn :

the object which received the signal.

arg1 :

arg2 :

user_data :

user data set when the signal handler was connected.

The "name-changed" signal

void                user_function                      (GdaColumn *gdacolumn,
                                                        gchar     *arg1,
                                                        gpointer   user_data)      : Run Last

gdacolumn :

the object which received the signal.

arg1 :

user_data :

user data set when the signal handler was connected.