![]() |
![]() |
![]() |
Nautilus-Actions™ Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces |
#include <nautilus-actions/na-object-item.h> #define NA_OBJECT_ITEM_TYPE #define NA_OBJECT_ITEM (object) #define NA_IS_OBJECT_ITEM (object) NAObjectItem; enum NAItemTarget; gboolean na_object_item_are_equal (const NAObjectItem *a
,const NAObjectItem *b
); NAObjectId * na_object_item_get_item (const NAObjectItem *item
,const gchar *id
); gint na_object_item_get_position (const NAObjectItem *item
,const NAObjectId *child
); void na_object_item_append_item (NAObjectItem *item
,const NAObjectId *child
); void na_object_item_insert_at (NAObjectItem *item
,const NAObjectId *child
,gint pos
); void na_object_item_insert_item (NAObjectItem *item
,const NAObjectId *child
,const NAObjectId *before
); void na_object_item_remove_item (NAObjectItem *item
,const NAObjectId *child
); guint na_object_item_get_items_count (const NAObjectItem *item
); void na_object_item_count_items (GList *items
,gint *menus
,gint *actions
,gint *profiles
,gboolean recurse
); void na_object_item_unref_items (GList *items
); void na_object_item_unref_items_rec (GList *items
); void na_object_item_rebuild_children_slist (NAObjectItem *item
); void na_object_item_deals_with_version (NAObjectItem *item
);
GObject +----NAObject +----NAObjectId +----NAObjectItem +----NAObjectAction +----NAObjectMenu
This is a pure virtual class, i.e. not an instantiatable one, but serves as the base class for NAObjectAction and NAObjectMenu.
#define NA_OBJECT_ITEM( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, NA_OBJECT_ITEM_TYPE, NAObjectItem ))
#define NA_IS_OBJECT_ITEM( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, NA_OBJECT_ITEM_TYPE ))
typedef enum { ITEM_TARGET_SELECTION = 1, ITEM_TARGET_LOCATION, ITEM_TARGET_TOOLBAR, ITEM_TARGET_ANY } NAItemTarget;
The NAItemTarget mode is Nautilus-driven. It determines in which part of the Nautilus UI our actions will be displayed.
when targeting the selection context menu. | |
when targeting the background context menu. | |
when targeting the toolbar. | |
a wilcard target defined in order to be able to activate an action from a keyboard shortcut, while keeping this same action hidden from the UI. |
gboolean na_object_item_are_equal (const NAObjectItem *a
,const NAObjectItem *b
);
This function participates to the #na_iduplicable_check_status()
stack,
and is triggered after all comparable elementary data (in NAIFactoryObject
sense) have already been successfully compared.
We have to deal here with the subitems: comparing children by their ids
between a
and b
.
Note that, when called from na_object_check_status, the status of children have already been checked, and so we should be able to rely on them.
|
the first (original) NAObjectItem instance. |
|
the second NAObjectItem instance. |
Returns : |
TRUE if a is equal to b .
|
Since 2.30
NAObjectId * na_object_item_get_item (const NAObjectItem *item
,const gchar *id
);
|
the NAObjectItem from which we want retrieve a subitem. |
|
the id of the searched subitem. |
Returns : |
a pointer to the NAObjectId -derived child with the required id.
The returned NAObjectId is owned by the item object ; the
caller should not try to g_free() nor g_object_unref() it.
|
Since 2.30
gint na_object_item_get_position (const NAObjectItem *item
,const NAObjectId *child
);
|
this NAObjectItem object. |
|
a NAObjectId -derived child. |
Returns : |
the position of child in the subitems list of item ,
starting from zero, or -1 if not found.
|
Since 2.30
void na_object_item_append_item (NAObjectItem *item
,const NAObjectId *child
);
Appends a new child
to the list of subitems of item
,
and setup the parent pointer of the child to its new parent.
Doesn't modify the reference count on object
.
|
the NAObjectItem to which add the subitem. |
|
a NAObjectId to be added to list of subitems. |
Since 2.30
void na_object_item_insert_at (NAObjectItem *item
,const NAObjectId *child
,gint pos
);
Inserts a new child
in the list of subitems of item
.
Doesn't modify the reference count on child
.
|
the NAObjectItem in which add the subitem. |
|
a NAObjectId -derived to be inserted in the list of subitems. |
|
the position at which the child should be inserted.
|
Since 2.30
void na_object_item_insert_item (NAObjectItem *item
,const NAObjectId *child
,const NAObjectId *before
);
Inserts a new child
in the list of subitems of item
.
Doesn't modify the reference count on child
.
|
the NAObjectItem to which add the subitem. |
|
a NAObjectId to be inserted in the list of subitems. |
|
the NAObjectId before which the child should be inserted.
|
Since 2.30
void na_object_item_remove_item (NAObjectItem *item
,const NAObjectId *child
);
Removes a child
from the list of subitems of item
.
Doesn't modify the reference count on child
.
|
the NAObjectItem from which the subitem must be removed. |
|
a NAObjectId -derived to be removed from the list of subitems. |
Since 2.30
guint na_object_item_get_items_count (const NAObjectItem *item
);
|
the NAObjectItem from which we want a count of subitems. |
Returns : |
the count of subitems of item .
|
Since 2.30
void na_object_item_count_items (GList *items
,gint *menus
,gint *actions
,gint *profiles
,gboolean recurse
);
|
a list if NAObject -derived to be counted. |
|
will be set to the count of menus. |
|
will be set to the count of actions. |
|
will be set to the count of profiles. |
|
whether to recursively count all items, or only those in level zero of the list. |
Returns : |
the count the numbers of items if the provided list. As this function is recursive, the counters should be initialized by the caller before calling it. |
Since 2.30
void na_object_item_unref_items (GList *items
);
Unref only the first level the NAObject of the list, freeing the list at last.
This is rather only used by NAPivot.
|
a list of NAObject -derived items. |
Since 2.30
void na_object_item_unref_items_rec (GList *items
);
Recursively unref the NAObject's of the list, freeing the list at last.
This is heavily used by NACT.
|
a list of NAObject -derived items. |
Since 2.30
void na_object_item_rebuild_children_slist
(NAObjectItem *item
);
Rebuild the string list of children.
|
this NAObjectItem -derived object. |
Since 2.30
void na_object_item_deals_with_version (NAObjectItem *item
);
Just after the item
has been readen from NAIFactoryProvider, setup
the version. This is needed because some conversions may occur in
this object.
Note that there is only some 2.x versions where the version string
was not systematically written. If item
has been readen from a
.desktop file, then iversion is already set to (at least) 3.
|
this NAObjectItem -derived object. |
Since 2.30