AlarmdObject

AlarmdObject — Base class for all alarmd objects.

Synopsis




            AlarmdObject;
GParameter* alarmd_object_get_properties    (AlarmdObject *object,
                                             guint *n_objects);
GSList*     alarmd_object_get_saved_properties
                                            (AlarmdObject *object);
xmlNode*    alarmd_object_to_xml            (AlarmdObject *object);
void        alarmd_object_to_dbus           (AlarmdObject *object,
                                             DBusMessageIter *iter);
void        alarmd_object_changed           (AlarmdObject *object);
void        alarmd_object_time_changed      (AlarmdObject *object);
void        alarmd_gparameterv_free         (GParameter *paramv,
                                             guint n_objects);

Description

Base class for all objects in alarmd. Idea is to centralize the serialization and to ease spreading the time-changed signal.

Details

AlarmdObject

typedef struct {
	GObject parent_instance;
} AlarmdObject;


alarmd_object_get_properties ()

GParameter* alarmd_object_get_properties    (AlarmdObject *object,
                                             guint *n_objects);

Gets all properties of an object that should be saved; mostly a helper function for alarmd_object_to_xml and alarmd_object_to_dbus to avoid code duplication.

object : The object whose properties should be gotten.
n_objects : Pointer to integer that should hold the size of the returned array.
Returns : An array of GParameter.

alarmd_object_get_saved_properties ()

GSList*     alarmd_object_get_saved_properties
                                            (AlarmdObject *object);

An helper function for alarmd_object_get_properties to reduce code duplication. Each subclass overriding this should call their parent to get their saved properties too.

object : The AlarmdObject whose saved properties should be get.
Returns : A GSList of property names (as const char *). The names should be owned by the appropriate class and will not be free'd.

alarmd_object_to_xml ()

xmlNode*    alarmd_object_to_xml            (AlarmdObject *object);

Creates a xml representation of the object.

object : The AlarmdObject that should be serialized into xml.
Returns : A tree of xmlNode describing the object.

alarmd_object_to_dbus ()

void        alarmd_object_to_dbus           (AlarmdObject *object,
                                             DBusMessageIter *iter);

Creates a dbus message representation of the object.

object : The AlarmdObject that should be serialized into dbus message.
iter : The iter that should hould the representation of the object.

alarmd_object_changed ()

void        alarmd_object_changed           (AlarmdObject *object);

Emits AlarmdObject::changed signal on the object.

object : The object that has changed.

alarmd_object_time_changed ()

void        alarmd_object_time_changed      (AlarmdObject *object);

Emits AlarmdObject::time-changed signal on the object.

object : The object that should receive the signal.

alarmd_gparameterv_free ()

void        alarmd_gparameterv_free         (GParameter *paramv,
                                             guint n_objects);

Frees the paramv array and all data associated with it.

paramv : The GParameter array.
n_objects : The size of the paramv.

See Also

AlarmdEvent, AlarmdAction, AlarmdQueue