MidgardReflectionProperty


Data Structures

struct  _MidgardReflectionPropertyClass

Functions

GType midgard_reflection_property_get_type (void)
GType midgard_reflection_property_get_midgard_type (MidgardReflectionProperty *object, const gchar *name)
gboolean midgard_reflection_property_is_link (MidgardReflectionProperty *object, const gchar *name)
gboolean midgard_reflection_property_is_linked (MidgardReflectionProperty *object, const gchar *name)
MidgardObjectClassmidgard_reflection_property_get_link_class (MidgardReflectionProperty *object, const gchar *name)
const gchar * midgard_reflection_property_get_link_name (MidgardReflectionProperty *object, const gchar *name)
const gchar * midgard_reflection_property_get_link_target (MidgardReflectionProperty *object, const gchar *name)
const gchar * midgard_reflection_property_description (MidgardReflectionProperty *object, const gchar *name)
gboolean midgard_reflection_property_is_multilang (MidgardReflectionProperty *object, const gchar *name)

Detailed Description

Midgard Reflection is designed for developers who need to write "schema aware" applications without any knowledge about schema registered for application. Property's or type's attributes defined in schema files are easily accessible with Midgard Reflection objects.

Function Documentation

const gchar* midgard_reflection_property_description MidgardReflectionProperty object,
const gchar *  name
 

Gets description of the property.

Parameters:
object MidgardReflectionProperty
[in] name property name registered for the given MidgardObjectClass
Returns:
description of the property.
Description should be defined in application's xml schema file. This function is a simple wrapper to g_param_spec_get_blurb.

NULL is returned when property is not found as member of a class or if class is not registered within GType system.

Definition at line 154 of file midgard_reflection_property.c.

References _MidgardReflectionProperty::klass.

MidgardObjectClass* midgard_reflection_property_get_link_class MidgardReflectionProperty object,
const gchar *  name
 

Returns the class that the named property is linked to. Returns NULL if the named property is not a link.

Parameters:
object MidgardReflectionProperty
[in] name property name registered for the given MidgardObjectClass
Returns:
the link target class, or NULL
NULL is returned when property is not found as member of a class or if class is not registered within GType system.

Definition at line 184 of file midgard_reflection_property.c.

References _MidgardObjectClass::data, _MgdSchemaPropertyAttr::is_link, _MidgardReflectionProperty::klass, _MgdSchemaPropertyAttr::link, and _MgdSchemaTypeAttr::prophash.

const gchar* midgard_reflection_property_get_link_name MidgardReflectionProperty object,
const gchar *  name
 

Gets the class name of type which property is linked to.

Parameters:
object MidgardReflectionProperty
[in] name property name registered for the given MidgardObjectClass
Returns:
class name or NULL if property is not linked with other type.
NULL is returned when property is not found as member of a class or if class is not registered within GType system.

Definition at line 125 of file midgard_reflection_property.c.

References _MidgardObjectClass::data, _MidgardReflectionProperty::klass, _MgdSchemaPropertyAttr::link, and _MgdSchemaTypeAttr::prophash.

const gchar* midgard_reflection_property_get_link_target MidgardReflectionProperty object,
const gchar *  name
 

Gets the name of target property.

Parameters:
object MidgardReflectionProperty instance
[in] name property name registered for the given MidgardObjectClass
Returns:
target property name for which given property name is linked to.
NULL is returned if:
  • property name is not member of the class
  • property name is not defined as link in MgdSchema

Definition at line 139 of file midgard_reflection_property.c.

References _MidgardObjectClass::data, _MidgardReflectionProperty::klass, _MgdSchemaPropertyAttr::link_target, and _MgdSchemaTypeAttr::prophash.

GType midgard_reflection_property_get_midgard_type MidgardReflectionProperty object,
const gchar *  name
 

Get Midgard Type of the property.

Parameters:
object MidgardReflectionProperty
[in] name property name registered for the given MidgardObjectClass
Returns:
Gtype
Returned Gtype is registered as Midgard type.

MGD_TYPE_NONE is returned if property is not found as member of a class or if class is not registered within GType system.

Definition at line 83 of file midgard_reflection_property.c.

References _MidgardObjectClass::data, _MgdSchemaPropertyAttr::gtype, _MidgardReflectionProperty::klass, and _MgdSchemaTypeAttr::prophash.

Referenced by _midgard_core_object_is_valid().

GType midgard_reflection_property_get_type void   ) 
 

Returns the MidgardReflectionProperty value type. Registers the type as a fundamental GType unless already registered.

Definition at line 49 of file midgard_reflection_property.c.

gboolean midgard_reflection_property_is_link MidgardReflectionProperty object,
const gchar *  name
 

Checks if property is a link to another type.

Parameters:
object MidgardReflectionProperty
[in] name property name registered for the given MidgardObjectClass
Returns:
TRUE when property is a link to another type, FALSE otherwise
FALSE is returned when property is not found as member of a class or if class is not registered within GType system.

Definition at line 97 of file midgard_reflection_property.c.

References _MidgardObjectClass::data, _MgdSchemaPropertyAttr::is_link, _MidgardReflectionProperty::klass, and _MgdSchemaTypeAttr::prophash.

gboolean midgard_reflection_property_is_linked MidgardReflectionProperty object,
const gchar *  name
 

Checks if property is linked with another type.

Parameters:
object MidgardReflectionProperty
[in] name property name registered for the given MidgardObjectClass
Returns:
TRUE when property is linked to another type, FALSE otherwise
FALSE is returned when property is not found as member of a class or if class is not registered within GType system.

Definition at line 111 of file midgard_reflection_property.c.

References _MidgardObjectClass::data, _MgdSchemaPropertyAttr::is_linked, _MidgardReflectionProperty::klass, and _MgdSchemaTypeAttr::prophash.

gboolean midgard_reflection_property_is_multilang MidgardReflectionProperty object,
const gchar *  name
 

Checks if property is multilingual.

Parameters:
object MidgardReflectionProperty
[in] name property name registered for the given MidgardObjectClass
Returns:
TRUE if property is multilingual , FALSE otherwise
FALSE is returned when property is not found as member of a class or if class is not registered within GType system.

Property's multilang attribute should be defined in xml schema file.

Definition at line 170 of file midgard_reflection_property.c.

References _MidgardObjectClass::data, _MgdSchemaPropertyAttr::is_multilang, _MidgardReflectionProperty::klass, and _MgdSchemaTypeAttr::prophash.


Generated on Thu Feb 22 06:15:21 2007 for midgard-core by  doxygen 1.4.6