na-iduplicable

na-iduplicable

Synopsis

#define             NA_IDUPLICABLE_TYPE
#define             NA_IDUPLICABLE_GET_INTERFACE        (instance)
typedef             NAIDuplicable;
typedef             NAIDuplicableInterfacePrivate;
                    NAIDuplicableInterface;
#define             NA_IDUPLICABLE_SIGNAL_STATUS_CHANGED
void                na_iduplicable_dispose              (const NAIDuplicable *object);
void                na_iduplicable_dump                 (const NAIDuplicable *object);
NAIDuplicable *     na_iduplicable_duplicate            (const NAIDuplicable *object);
void                na_iduplicable_check_status         (const NAIDuplicable *object);
NAIDuplicable *     na_iduplicable_get_origin           (const NAIDuplicable *object);
gboolean            na_iduplicable_is_valid             (const NAIDuplicable *object);
gboolean            na_iduplicable_is_modified          (const NAIDuplicable *object);
void                na_iduplicable_set_origin           (NAIDuplicable *object,
                                                         const NAIDuplicable *origin);
void                na_iduplicable_set_modified         (NAIDuplicable *object,
                                                         gboolean modified);
void                na_iduplicable_register_consumer    (GObject *consumer);

Object Hierarchy

  GInterface
   +----NAIDuplicable

Prerequisites

NAIDuplicable requires GObject.

Known Implementations

NAIDuplicable is implemented by NAObject, NAObjectAction, NAObjectId, NAObjectItem, NAObjectMenu and NAObjectProfile.

Description

Details

NA_IDUPLICABLE_TYPE

#define NA_IDUPLICABLE_TYPE							( na_iduplicable_get_type())


NA_IDUPLICABLE_GET_INTERFACE()

#define NA_IDUPLICABLE_GET_INTERFACE( instance ) ( G_TYPE_INSTANCE_GET_INTERFACE(( instance ), NA_IDUPLICABLE_TYPE, NAIDuplicableInterface ))

instance :


NAIDuplicable

typedef struct NAIDuplicable                 NAIDuplicable;


NAIDuplicableInterfacePrivate

typedef struct NAIDuplicableInterfacePrivate NAIDuplicableInterfacePrivate;


NAIDuplicableInterface

typedef struct {
	GTypeInterface                 parent;
	NAIDuplicableInterfacePrivate *private;

	/**
	 * copy:
	 * @target: the #NAIDuplicable target of the copy.
	 * @source: the #NAIDuplicable source of the copy
	 *
	 * Copies data from @source to @ŧarget, so that @target becomes an
	 * exact copy of @source.
	 *
	 * Each derived class of the implementation should define this
	 * function to copy its own data. The implementation should take
	 * care itself of calling each function in the class hierarchy,
	 * from topmost base class to most-derived one.
	 */
	void     ( *copy )     ( NAIDuplicable *target, const NAIDuplicable *source );

	/**
	 * are_equal:
	 * @a: a first #NAIDuplicable object.
	 * @b: a second #NAIDuplicable object to be compared to the first
	 * one.
	 *
	 * Compares the two objects.
	 *
	 * Returns: %TRUE if @a and @b are identical, %FALSE else.
	 *
	 * Each derived class of the implementation should define this
	 * function to compare its own data. The implementation should take
	 * care itself of calling each function in the class hierarchy,
	 * from topmost base class to most-derived one.
	 */
	gboolean ( *are_equal )( const NAIDuplicable *a, const NAIDuplicable *b );

	/**
	 * is_valid:
	 * @object: the #NAIDuplicable object to be checked.
	 *
	 * Checks @object for validity.
	 *
	 * Returns: %TRUE if @object is valid, %FALSE else.
	 *
	 * Each derived class of the implementation should define this
	 * function to compare its own data. The implementation should take
	 * care itself of calling each function in the class hierarchy,
	 * from topmost base class to most-derived one.
	 */
	gboolean ( *is_valid )   ( const NAIDuplicable *object );
} NAIDuplicableInterface;


NA_IDUPLICABLE_SIGNAL_STATUS_CHANGED

#define NA_IDUPLICABLE_SIGNAL_STATUS_CHANGED "na-iduplicable-status-changed"


na_iduplicable_dispose ()

void                na_iduplicable_dispose              (const NAIDuplicable *object);

Releases resources.

object :

the NAIDuplicable object to be initialized.

na_iduplicable_dump ()

void                na_iduplicable_dump                 (const NAIDuplicable *object);

Dumps via g_debug the properties of the object.

We ouput here only the data we set ourselves againt the NAIDuplicable-implemented object.

This function should be called by the implementation when it dumps itself its own content.

object :

the NAIDuplicable object to be dumped.

na_iduplicable_duplicate ()

NAIDuplicable *     na_iduplicable_duplicate            (const NAIDuplicable *object);

Exactly duplicates a NAIDuplicable-implemented object, including modification and validity status which are copied from object to the duplicated one.

Though this function is not recursive by itself, it is widely supposed everywhere in the program that recursivity is provided but NAObject implementation.

+------------------------------------------------------------------------------+ | na_object_duplicate (aka na_iduplicable_duplicate) is definitively recursive | +------------------------------------------------------------------------------+

object :

the NAIDuplicable object to be duplicated.

Returns :

a new NAIDuplicable.

na_iduplicable_check_status ()

void                na_iduplicable_check_status         (const NAIDuplicable *object);

Checks the edition status of the NAIDuplicable object, and set up the corresponding properties.

This function is supposed to be called each time the object may have been modified in order to set the corresponding properties. Helper functions na_iduplicable_is_modified() and na_iduplicable_is_valid() will then only return the current value of the properties.

#na_iduplicable_check_status() is not, as itself, recursive. That is, the modification and validity status are only set on the specified object. NAObject implementation has choosen to handle itself the recursivity: #na_object_check_status() so first check status for childs, before calling this function.

object :

the NAIDuplicable object to be checked.

na_iduplicable_get_origin ()

NAIDuplicable *     na_iduplicable_get_origin           (const NAIDuplicable *object);

Returns the origin of a duplicated NAIDuplicable.

object :

the NAIDuplicable object whose origin is to be returned.

Returns :

the original NAIDuplicable, or NULL.

na_iduplicable_is_valid ()

gboolean            na_iduplicable_is_valid             (const NAIDuplicable *object);

Returns the current value of the relevant property without rechecking the edition status itself.

object :

the NAIDuplicable object whose status is to be returned.

Returns :

TRUE is the provided object is valid.

na_iduplicable_is_modified ()

gboolean            na_iduplicable_is_modified          (const NAIDuplicable *object);

Returns the current value of the PROP_IDUPLICABLE_ISMODIFIED property without rechecking the edition status itself.

object :

the NAIDuplicable object whose status is to be returned.

Returns :

TRUE is the provided object has been modified regarding of the original one.

na_iduplicable_set_origin ()

void                na_iduplicable_set_origin           (NAIDuplicable *object,
                                                         const NAIDuplicable *origin);

Sets the new origin of a duplicated NAIDuplicable.

object :

the NAIDuplicable object whose origin is to be set.

origin :

the new original NAIDuplicable.

na_iduplicable_set_modified ()

void                na_iduplicable_set_modified         (NAIDuplicable *object,
                                                         gboolean modified);

Sets the new modified of a duplicated NAIDuplicable.

object :

the NAIDuplicable object whose modification status is to be set.

modified :

the new modification status NAIDuplicable.

na_iduplicable_register_consumer ()

void                na_iduplicable_register_consumer    (GObject *consumer);

This function registers a consumer, i.e. an instance to which edition status signals will be propagated.

consumer :

the target instance.