| Top |  |  |  |  | 
| FMAIFactoryObjectFMAIFactoryObject — The FMAObjectItem Interface v 1 | 
| #define | FMA_IFACTORY_OBJECT() | 
| #define | FMA_IS_IFACTORY_OBJECT() | 
| #define | FMA_IFACTORY_OBJECT_GET_INTERFACE() | 
| FMADataBoxed * | fma_ifactory_object_get_data_boxed () | 
| FMADataGroup * | fma_ifactory_object_get_data_groups () | 
| void * | fma_ifactory_object_get_as_void () | 
| void | fma_ifactory_object_set_from_void () | 
This interface is implemented by FMAObjectItem derived objects so that they can take advantage of our data factory management system.
A FMAObjectItem derived object which would implement this FMAIFactoryObject interface must meet following conditions:
accept an empty constructor
Table 8. Historic of the versions of the FMAIFactoryObject interface
| FileManager-Actions™ version | FMAIFactoryObject interface version | |
|---|---|---|
| since 2.30 | 1 | current version | 
#define FMA_IFACTORY_OBJECT( instance ) ( G_TYPE_CHECK_INSTANCE_CAST( instance, FMA_TYPE_IFACTORY_OBJECT, FMAIFactoryObject ))
#define FMA_IS_IFACTORY_OBJECT( instance ) ( G_TYPE_CHECK_INSTANCE_TYPE( instance, FMA_TYPE_IFACTORY_OBJECT ))
#define FMA_IFACTORY_OBJECT_GET_INTERFACE( instance ) ( G_TYPE_INSTANCE_GET_INTERFACE(( instance ), FMA_TYPE_IFACTORY_OBJECT, FMAIFactoryObjectInterface ))
FMADataBoxed * fma_ifactory_object_get_data_boxed (const FMAIFactoryObject *object,const gchar *name);
The returned FMADataBoxed is owned by FMAIFactoryObject object
, and
should not be released by the caller.
| object | a FMAIFactoryObject object. | |
| name | the name of the elementary data we are searching for. | 
Since: 2.30
FMADataGroup *
fma_ifactory_object_get_data_groups (const FMAIFactoryObject *object);
The returned FMADataGroup is owned by the FMAIFactoryObject object
,
and should not be released by the caller.
Since: 2.30
void * fma_ifactory_object_get_as_void (const FMAIFactoryObject *object,const gchar *name);
If the type of the value is FMA_DATA_TYPE_STRING, FMA_DATA_TYPE_LOCALE_STRING,
or FMA_DATA_TYPE_STRING_LIST, then the returned value is a newly allocated
one and should be g_free() (resp. fma_core_utils_slist_free()) by the
caller.
| object | this FMAIFactoryObject instance. | |
| name | the elementary data whose value is to be got. | 
Since: 2.30
void fma_ifactory_object_set_from_void (FMAIFactoryObject *object,const gchar *name,const void *data);
Set the elementary data with the given value.
| object | this FMAIFactoryObject instance. | |
| name | the name of the elementary data whose value is to be set. | |
| data | the value to set. | 
Since: 2.30
typedef struct {
	/**
	 * get_version:
	 * @instance: this #FMAIFactoryObject instance.
	 *
	 * Defaults to 1.
	 *
	 * Returns: the version of this interface supported by @instance implementation.
	 *
	 * Since: 2.30
	 */
	guint         ( *get_version )( const FMAIFactoryObject *instance );
	/**
	 * get_groups:
	 * @instance: this #FMAIFactoryObject instance.
	 *
	 * Returns: a pointer to the FMADataGroup which defines this object.
	 *
	 * Since: 2.30
	 */
	FMADataGroup * ( *get_groups ) ( const FMAIFactoryObject *instance );
	/**
	 * copy:
	 * @instance: the target #FMAIFactoryObject instance.
	 * @source: the source #FMAIFactoryObject instance.
	 *
	 * This function is triggered after having copied @source to
	 * @instance target. This later may take advantage of this call
	 * to do some particular copy tasks.
	 *
	 * Since: 2.30
	 */
	void          ( *copy )       ( FMAIFactoryObject *instance,
										const FMAIFactoryObject *source );
	/**
	 * are_equal:
	 * @a: the first #FMAIFactoryObject instance.
	 * @b: the second #FMAIFactoryObject instance.
	 *
	 * This function is triggered after all elementary data comparisons
	 * have been sucessfully made.
	 *
	 * Returns: %TRUE if @a is equal to @b.
	 *
	 * Since: 2.30
	 */
	gboolean      ( *are_equal )  ( const FMAIFactoryObject *a,
										const FMAIFactoryObject *b );
	/**
	 * is_valid:
	 * @object: the #FMAIFactoryObject instance whose validity is to be checked.
	 *
	 * This function is triggered after all elementary data comparisons
	 * have been sucessfully made.
	 *
	 * Returns: %TRUE if @object is valid.
	 *
	 * Since: 2.30
	 */
	gboolean      ( *is_valid )   ( const FMAIFactoryObject *object );
	/**
	 * read_start:
	 * @instance: this #FMAIFactoryObject instance.
	 * @reader: the instance which has provided read services.
	 * @reader_data: the data associated to @reader.
	 * @messages: a pointer to a #GSList list of strings; the instance
	 *  may append messages to this list, but shouldn't reinitialize it.
	 *
	 * Called just before the object is unserialized.
	 *
	 * Since: 2.30
	 */
	void          ( *read_start ) ( FMAIFactoryObject *instance,
										const FMAIFactoryProvider *reader,
										void *reader_data,
										GSList **messages );
	/**
	 * read_done:
	 * @instance: this #FMAIFactoryObject instance.
	 * @reader: the instance which has provided read services.
	 * @reader_data: the data associated to @reader.
	 * @messages: a pointer to a #GSList list of strings; the instance
	 *  may append messages to this list, but shouldn't reinitialize it.
	 *
	 * Called when the object has been unserialized.
	 *
	 * Since: 2.30
	 */
	void          ( *read_done )  ( FMAIFactoryObject *instance,
										const FMAIFactoryProvider *reader,
										void *reader_data,
										GSList **messages );
	/**
	 * write_start:
	 * @instance: this #FMAIFactoryObject instance.
	 * @writer: the instance which has provided writing services.
	 * @writer_data: the data associated to @writer.
	 * @messages: a pointer to a #GSList list of strings; the instance
	 *  may append messages to this list, but shouldn't reinitialize it.
	 *
	 * Called just before the object is serialized.
	 *
	 * Returns: a FMAIIOProvider operation return code.
	 *
	 * Since: 2.30
	 */
	guint         ( *write_start )( FMAIFactoryObject *instance,
										const FMAIFactoryProvider *writer,
										void *writer_data,
										GSList **messages );
	/**
	 * write_done:
	 * @instance: this #FMAIFactoryObject instance.
	 * @writer: the instance which has provided writing services.
	 * @writer_data: the data associated to @writer.
	 * @messages: a pointer to a #GSList list of strings; the instance
	 *  may append messages to this list, but shouldn't reinitialize it.
	 *
	 * Called when the object has been serialized.
	 *
	 * Returns: a FMAIIOProvider operation return code.
	 *
	 * Since: 2.30
	 */
	guint         ( *write_done ) ( FMAIFactoryObject *instance,
										const FMAIFactoryProvider *writer,
										void *writer_data,
										GSList **messages );
} FMAIFactoryObjectInterface;
In order to take full advantage of our data managament system, FMAObjectItem-derived objects all implement this FMAIFactoryObject interface.
| returns the version of this interface the FMAObjectItem implements. | ||
| returns a pointer to the FMADataGroup which defines this object. | ||
| post copy callback. | ||
| tests if two FMAObjectItem are equals. | ||
| tests if one FMAObjectItem is valid. | ||
| triggered before serializing a FMAObjectItem. | ||
| triggered after a FMAObjectItem has been serialized. | ||
| triggered before unserializing a FMAObjectItem. | ||
| triggered after a FMAObjectItem has been unserialized. |