MgQfield

Name

MgQfield -- Parent class for any query's field

Synopsis



#define     MG_QFIELD_TYPE
#define     MG_QFIELD                       (obj)
#define     IS_MG_QFIELD                    (obj)
#define     MG_QFIELD_CLASS                 (klass)
struct      MgQfield;
guint       mg_qfield_get_type              (void);
GObject*    mg_qfield_new_from_xml          (MgQuery *query,
                                             xmlNodePtr node,
                                             GError **error);
GObject*    mg_qfield_new_copy              (MgQfield *orig);
MgServerDataType* mg_qfield_get_data_type   (MgQfield *qfield);
GSList*     mg_qfield_get_parameters        (MgQfield *qfield);
void        mg_qfield_set_alias             (MgQfield *qfield,
                                             const gchar *alias);
const gchar* mg_qfield_get_alias            (MgQfield *qfield);
void        mg_qfield_set_visible           (MgQfield *qfield,
                                             gboolean visible);
gboolean    mg_qfield_is_visible            (MgQfield *qfield);
void        mg_qfield_set_internal          (MgQfield *qfield,
                                             gboolean internal);
gboolean    mg_qfield_is_internal           (MgQfield *qfield);
gboolean    mg_qfield_is_equal              (MgQfield *qfield1,
                                             MgQfield *qfield2);
gboolean    mg_qfield_is_list               (MgQfield *qfield);

Object Hierarchy


  GObject
   +----MgBase
         +----MgQfield

Properties


  "prop"                 gpointer             : Read / Write

Description

Details

MG_QFIELD_TYPE

#define MG_QFIELD_TYPE          (mg_qfield_get_type())


MG_QFIELD()

#define MG_QFIELD(obj)          G_TYPE_CHECK_INSTANCE_CAST (obj, mg_qfield_get_type(), MgQfield)

obj :


IS_MG_QFIELD()

#define IS_MG_QFIELD(obj)       G_TYPE_CHECK_INSTANCE_TYPE (obj, mg_qfield_get_type ())

obj :


MG_QFIELD_CLASS()

#define MG_QFIELD_CLASS(klass)  G_TYPE_CHECK_CLASS_CAST (klass, mg_qfield_get_type (), MgQfieldClass)

klass :


struct MgQfield

struct MgQfield;


mg_qfield_get_type ()

guint       mg_qfield_get_type              (void);

Returns :


mg_qfield_new_from_xml ()

GObject*    mg_qfield_new_from_xml          (MgQuery *query,
                                             xmlNodePtr node,
                                             GError **error);

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

query :

a MgQuery object

node :

an XML node corresponding to a <MG_QFIELD> tag

error :

location to store error, or NULL

Returns :

the newly created object


mg_qfield_new_copy ()

GObject*    mg_qfield_new_copy              (MgQfield *orig);

This is a copy constructor

orig :

a MgQfield to copy

Returns :

the new object


mg_qfield_get_data_type ()

MgServerDataType* mg_qfield_get_data_type   (MgQfield *qfield);

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

qfield :

a MgQfield object

Returns :

the data type, or NULL if qfield does not have a data type.


mg_qfield_get_parameters ()

GSList*     mg_qfield_get_parameters        (MgQfield *qfield);

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

qfield :

a MgQfield object

Returns :

a new list of parameters for qfield


mg_qfield_set_alias ()

void        mg_qfield_set_alias             (MgQfield *qfield,
                                             const gchar *alias);

Sets qfield's alias

qfield :

a MgQfield object

alias :

the alias to set qfield to


mg_qfield_get_alias ()

const gchar* mg_qfield_get_alias            (MgQfield *qfield);

Get qfield's alias

qfield :

a MgQfield object

Returns :

the alias


mg_qfield_set_visible ()

void        mg_qfield_set_visible           (MgQfield *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 MgQfield object

visible :


mg_qfield_is_visible ()

gboolean    mg_qfield_is_visible            (MgQfield *qfield);

qfield :

a MgQfield object

Returns :

TRUE if field is visible


mg_qfield_set_internal ()

void        mg_qfield_set_internal          (MgQfield *qfield,
                                             gboolean internal);

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

qfield :

a MgQfield object

internal :


mg_qfield_is_internal ()

gboolean    mg_qfield_is_internal           (MgQfield *qfield);

qfield :

a MgQfield object

Returns :

TRUE if field is internal


mg_qfield_is_equal ()

gboolean    mg_qfield_is_equal              (MgQfield *qfield1,
                                             MgQfield *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 MgQfield object

qfield2 :

a MgQfield object

Returns :

TRUE if they are equal and FALSE otherwise


mg_qfield_is_list ()

gboolean    mg_qfield_is_list               (MgQfield *qfield);

Tells if qfield can potentially represent a list of values.

qfield :

a MgQfield object

Returns :

TRUE if field can be a list of values

Properties

"prop" (gpointer : Read / Write)