NAIContext

NAIContext — The Contextual Interface

Synopsis

#include <nautilus-actions/na-icontext.h>

#define             NA_ICONTEXT_TYPE
#define             NA_ICONTEXT_GET_INTERFACE           (instance)
                    NAIContext;
                    NAIContextInterfacePrivate;
                    NAIContextInterface;
gboolean            na_icontext_is_candidate            (const NAIContext *context,
                                                         guint target,
                                                         GList *selection);
gboolean            na_icontext_is_valid                (const NAIContext *context);
gboolean            na_icontext_is_all_mimetypes        (const NAIContext *context);
void                na_icontext_read_done               (NAIContext *context);
void                na_icontext_set_scheme              (NAIContext *context,
                                                         const gchar *scheme,
                                                         gboolean selected);
void                na_icontext_set_only_desktop        (NAIContext *context,
                                                         const gchar *desktop,
                                                         gboolean selected);
void                na_icontext_set_not_desktop         (NAIContext *context,
                                                         const gchar *desktop,
                                                         gboolean selected);
void                na_icontext_replace_folder          (NAIContext *context,
                                                         const gchar *old,
                                                         const gchar *new);

Object Hierarchy

  GInterface
   +----NAIContext

Prerequisites

NAIContext requires GObject.

Known Implementations

NAIContext is implemented by NAObjectAction, NAObjectMenu and NAObjectProfile.

Description

This interface is implemented by all NAObject -derived objects whose the display in the Nautilus context menu is subject to some conditions.

Implementors, typically NAObjectAction, NAObjectProfile and NAObjectMenu, host the required data as NADataBoxed in a dedicated NA_FACTORY_CONDITIONS_GROUP data group.

Details

NA_ICONTEXT_TYPE

#define NA_ICONTEXT_TYPE                       ( na_icontext_get_type())

NA_ICONTEXT_GET_INTERFACE()

#define NA_ICONTEXT_GET_INTERFACE( instance )  ( G_TYPE_INSTANCE_GET_INTERFACE(( instance ), NA_ICONTEXT_TYPE, NAIContextInterface ))

NAIContext

typedef struct _NAIContext NAIContext;

NAIContextInterfacePrivate

typedef struct _NAIContextInterfacePrivate NAIContextInterfacePrivate;

NAIContextInterface

typedef struct {
	/**
	 * is_candidate:
	 * @object: this NAIContext object.
	 * @target: the initial target which triggered this function's stack.
	 *  This target is defined in na-object-item.h.
	 * @selection: the current selection as a GList of NautilusFileInfo.
	 *
	 * The NAIContext implementor may take advantage of this
	 * virtual function to check for its own specific data. Only if the
	 * implementor does return %TRUE (or just doesn't implement this
	 * virtual), the conditions themselves will be checked.
	 *
	 * Returns: %TRUE if the @object may be a potential candidate, %FALSE
	 * else.
	 *
	 * Since: 2.30
	 */
	gboolean ( *is_candidate )( NAIContext *object, guint target, GList *selection );
} NAIContextInterface;

This interface manages all conditions relevant to a displayable status in Nautilus.

is_candidate ()

determines if the given NAObject-derived object is candidate to display in Nautilus.

na_icontext_is_candidate ()

gboolean            na_icontext_is_candidate            (const NAIContext *context,
                                                         guint target,
                                                         GList *selection);

na_icontext_is_valid ()

gboolean            na_icontext_is_valid                (const NAIContext *context);

na_icontext_is_all_mimetypes ()

gboolean            na_icontext_is_all_mimetypes        (const NAIContext *context);

na_icontext_read_done ()

void                na_icontext_read_done               (NAIContext *context);

na_icontext_set_scheme ()

void                na_icontext_set_scheme              (NAIContext *context,
                                                         const gchar *scheme,
                                                         gboolean selected);

na_icontext_set_only_desktop ()

void                na_icontext_set_only_desktop        (NAIContext *context,
                                                         const gchar *desktop,
                                                         gboolean selected);

na_icontext_set_not_desktop ()

void                na_icontext_set_not_desktop         (NAIContext *context,
                                                         const gchar *desktop,
                                                         gboolean selected);

na_icontext_replace_folder ()

void                na_icontext_replace_folder          (NAIContext *context,
                                                         const gchar *old,
                                                         const gchar *new);