FMAObjectId

FMAObjectId — The Identified Object Base Class Definition

Functions

Types and Values

Includes

#include <filemanager-actions/fma-object-id.h>

Description

This is a pure virtual class, i.e. not an instantiatable one. It serves as the base class for FMAObject -derived object which have a unique Id, i.e. for FMAObjectItem and FMAObjectProfile.

Functions

FMA_OBJECT_ID()

#define FMA_OBJECT_ID( object )           ( G_TYPE_CHECK_INSTANCE_CAST( object, FMA_TYPE_OBJECT_ID, FMAObjectId ))

FMA_IS_OBJECT_ID()

#define FMA_IS_OBJECT_ID( object )        ( G_TYPE_CHECK_INSTANCE_TYPE( object, FMA_TYPE_OBJECT_ID ))

fma_object_id_sort_alpha_asc ()

gint
fma_object_id_sort_alpha_asc (const FMAObjectId *a,
                              const FMAObjectId *b);

Sort the objects in alphabetical ascending order of their label.

Parameters

a

first FMAObjectId.

 

b

second FMAObjectId.

 

Returns

  • -1 if a must be sorted before b,

  • 0 if a and b are equal from the local point of view,

  • 1 if a must be sorted after b.

Since: 2.30


fma_object_id_sort_alpha_desc ()

gint
fma_object_id_sort_alpha_desc (const FMAObjectId *a,
                               const FMAObjectId *b);

Sort the objects in alphabetical descending order of their label.

Parameters

a

first FMAObjectId.

 

b

second FMAObjectId.

 

Returns

  • -1 if a must be sorted before b,

  • 0 if a and b are equal from the local point of view,

  • 1 if a must be sorted after b.

Since: 2.30


fma_object_id_prepare_for_paste ()

void
fma_object_id_prepare_for_paste (FMAObjectId *object,
                                 gboolean relabel,
                                 gboolean renumber,
                                 FMAObjectId *parent);

Prepares object to be pasted.

If a FMAObjectProfile, then object is attached to the specified FMAObjectAction action . The identifier is always renumbered to be suitable with the already existing profiles.

If a FMAObjectAction or a FMAObjectMenu, 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.

Parameters

object

the FMAObjectId object to be pasted.

 

relabel

whether this object should be relabeled when pasted.

 

renumber

whether this item should be renumbered ?

 

parent

the parent of object , or NULL.

 

Since: 2.30


fma_object_id_set_copy_of_label ()

void
fma_object_id_set_copy_of_label (FMAObjectId *object);

Sets the 'Copy of' label.

Parameters

object

the FMAObjectId object whose label is to be changed.

 

Since: 2.30


fma_object_id_set_new_id ()

void
fma_object_id_set_new_id (FMAObjectId *object,
                          const FMAObjectId *new_parent);

Request a new id to the derived class, and set it.

Parameters

object

the FMAObjectId object whose internal identifier is to be set.

 

new_parent

if object is a FMAObjectProfile, then new_parent should be set to the FMAObjectAction new parent. Else, it would not be possible to allocate a new profile id compatible with already existing ones.

 

Since: 2.30

Types and Values

FMA_TYPE_OBJECT_ID

#define FMA_TYPE_OBJECT_ID                ( fma_object_id_get_type())

FMAObjectId

typedef struct {
} FMAObjectId;

FMAObjectIdClass

typedef struct {
	/**
	 * new_id:
	 * @object: a FMAObjectId object.
	 * @new_parent: possibly the new FMAObjectId parent, or NULL.
	 * If not NULL, this should actually be a FMAObjectItem.
	 *
	 * If @object is a FMAObjectProfile, then @new_parent must be a
	 * not null FMAObjectAction. 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 FMAObjectId *object, const FMAObjectId *new_parent );
} FMAObjectIdClass;

The FMAObjectIdClass defines some methods available to derived classes.

Members

new_id ()

Allocate a new id to an existing FMAObjectId.