|  |  |  | Caja-Actions™ Reference Manual |  | 
|---|---|---|---|---|
| Top | Description | Object Hierarchy | Implemented Interfaces | ||||
#include <caja-actions/na-object-id.h> #define NA_TYPE_OBJECT_ID #define NA_OBJECT_ID (object) #define NA_IS_OBJECT_ID (object) NAObjectId; NAObjectIdClass; gint na_object_id_sort_alpha_asc (const NAObjectId *a,const NAObjectId *b); gint na_object_id_sort_alpha_desc (const NAObjectId *a,const NAObjectId *b); void na_object_id_prepare_for_paste (NAObjectId *object,gboolean relabel,gboolean renumber,NAObjectId *parent); void na_object_id_set_copy_of_label (NAObjectId *object); void na_object_id_set_new_id (NAObjectId *object,const NAObjectId *new_parent);
This is a pure virtual class, i.e. not an instantiatable one. It serves as the base class for NAObject -derived object which have a unique Id, i.e. for NAObjectItem and NAObjectProfile.
#define NA_OBJECT_ID( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, NA_TYPE_OBJECT_ID, NAObjectId ))
#define NA_IS_OBJECT_ID( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, NA_TYPE_OBJECT_ID ))
typedef struct {
	/**
	 * new_id:
	 * @object: a NAObjectId object.
	 * @new_parent: possibly the new NAObjectId parent, or NULL.
	 * If not NULL, this should actually be a NAObjectItem.
	 *
	 * If @object is a NAObjectProfile, then @new_parent must be a
	 * not null NAObjectAction. This function ensures that the new
	 * profile name does not already exist in the given @new_parent.
	 *
	 * This is a pure virtual function which should be implemented by
	 * the actual class. Actually, we asks for the most-derived class
	 * which implements this function.
	 *
	 * Returns: a new id suitable for this @object.
	 *
	 * Since: 2.30
	 */
	gchar * ( *new_id )( const NAObjectId *object, const NAObjectId *new_parent );
} NAObjectIdClass;
The NAObjectIdClass defines some methods available to derived classes.
gint na_object_id_sort_alpha_asc (const NAObjectId *a,const NAObjectId *b);
Sort the objects in alphabetical ascending order of their label.
| 
 | first NAObjectId. | 
| 
 | second NAObjectId. | 
| Returns : | 
 | 
Since 2.30
gint na_object_id_sort_alpha_desc (const NAObjectId *a,const NAObjectId *b);
Sort the objects in alphabetical descending order of their label.
| 
 | first NAObjectId. | 
| 
 | second NAObjectId. | 
| Returns : | 
 | 
Since 2.30
void na_object_id_prepare_for_paste (NAObjectId *object,gboolean relabel,gboolean renumber,NAObjectId *parent);
Prepares object to be pasted.
If a NAObjectProfile, then object is attached to the specified
NAObjectAction action. The identifier is always renumbered to be
suitable with the already existing profiles.
If a NAObjectAction or a NAObjectMenu, a new identifier is allocated
if and only if relabel is TRUE.
Actual relabeling takes place if relabel is TRUE, depending of the
user preferences.
| 
 | the NAObjectId object to be pasted. | 
| 
 | whether this object should be relabeled when pasted. | 
| 
 | whether this item should be renumbered ? | 
| 
 | the parent of object, orNULL. | 
Since 2.30
void                na_object_id_set_copy_of_label      (NAObjectId *object);
Sets the 'Copy of' label.
| 
 | the NAObjectId object whose label is to be changed. | 
Since 2.30
void na_object_id_set_new_id (NAObjectId *object,const NAObjectId *new_parent);
Request a new id to the derived class, and set it.
| 
 | the NAObjectId object whose internal identifier is to be set. | 
| 
 | if objectis a NAObjectProfile, thennew_parentshould be set to the NAObjectAction new parent. Else, it would not
be possible to allocate a new profile id compatible with already
existing ones. | 
Since 2.30