Commit d721ebdd authored by Pierre Wieser's avatar Pierre Wieser

Able to import a pre-v2 action

parent 4d12aae7
2009-02-24 Pierre Wieser <pwieser@trychlos.org>
* src/api/Makefile.am:
* src/api/na-data-boxed.h:
* src/api/na-data-types.h:
* src/api/na-gconf-utils.h:
* src/api/na-ifactory-object-data.h:
* src/api/na-ifactory-object.h:
* src/api/na-ifactory-provider.h:
* src/api/na-iimporter.h:
* src/api/na-object-api.h:
* src/api/na-object-profile.h:
* src/core/Makefile.am:
* src/core/na-data-boxed.c:
* src/core/na-factory-object.c:
* src/core/na-factory-object.h:
* src/core/na-factory-provider.c:
* src/core/na-factory-provider.h:
* src/core/na-gconf-utils.c:
* src/core/na-ifactory-object.c:
* src/core/na-ifactory-provider.c:
* src/core/na-importer.c:
* src/core/na-importer.h:
* src/core/na-io-provider.c:
* src/core/na-object-action-factory.c:
* src/core/na-object-action.c:
* src/core/na-object-id-factory.c:
* src/core/na-object-item-factory.c:
* src/core/na-object-menu-factory.c:
* src/core/na-object-menu.c:
* src/core/na-object-profile-factory.c:
* src/core/na-object-profile.c:
* src/io-desktop/nadp-desktop-file.c:
* src/io-desktop/nadp-desktop-file.h:
* src/io-desktop/nadp-desktop-provider.c:
* src/io-desktop/nadp-keys.c:
* src/io-desktop/nadp-keys.h:
* src/io-desktop/nadp-reader.c:
* src/io-gconf/nagp-gconf-provider.c:
* src/io-xml/naxml-keys.h:
* src/io-xml/naxml-provider.c:
* src/io-xml/naxml-reader.c:
* src/io-xml/naxml-reader.h:
* src/nact/nact-assistant-import.c:
* src/nact/nact-tree-model-dnd.c:
* src/test/test-include.c:
* src/test/test-reader.c: Able to import a pre-v2 action.
2009-02-22 Pierre Wieser <pwieser@trychlos.org>
* src/api/Makefile.am:
......
<?xml version="1.0" encoding="UTF-8"?>
<gconfschemafile>
<schemalist>
<schema>
<key>/schemas/apps/nautilus-actions/configurations/11111111/version</key>
<applyto>/apps/nautilus-actions/configurations/11111111/version</applyto>
<type>string</type>
<locale name="C">
<short>The version of the configuration format</short>
<long>The version of the configuration format that will be used to manage backward compatibility</long>
</locale>
<default>1.0</default>
<owner>nautilus-actions</owner>
</schema>
<schema>
<key>/schemas/apps/nautilus-actions/configurations/11111111/label</key>
<applyto>/apps/nautilus-actions/configurations/11111111/label</applyto>
<type>string</type>
<locale name="C">
<default>Action version 1.0</default>
<short>The label of the menu item</short>
<long>The label of the menu item that will appear in the Nautilus popup menu when the selection matches the appearance condition settings</long>
</locale>
<owner>nautilus-actions</owner>
</schema>
<schema>
<key>/schemas/apps/nautilus-actions/configurations/11111111/tooltip</key>
<applyto>/apps/nautilus-actions/configurations/11111111/tooltip</applyto>
<type>string</type>
<locale name="C">
<default>Let us test read/import/export/NACT v1.0 action</default>
<short>The tooltip of the menu item</short>
<long>The tooltip of the menu item that will appear in the Nautilus statusbar when the user points to the Nautilus popup menu item with his/her mouse</long>
</locale>
<owner>nautilus-actions</owner>
</schema>
<schema>
<key>/schemas/apps/nautilus-actions/configurations/11111111/icon</key>
<applyto>/apps/nautilus-actions/configurations/11111111/icon</applyto>
<type>string</type>
<locale name="C">
<short>The icon of the menu item</short>
<long>The icon of the menu item that will appear next to the label in the Nautilus popup menu when the selection matches the appearance conditions settings</long>
</locale>
<default>gtk-justify-center</default>
<owner>nautilus-actions</owner>
</schema>
<schema>
<key>/schemas/apps/nautilus-actions/configurations/11111111/path</key>
<applyto>/apps/nautilus-actions/configurations/11111111/path</applyto>
<type>string</type>
<locale name="C">
<short>The path of the command</short>
<long>The path of the command to start when the user select the menu item in the Nautilus popup menu</long>
</locale>
<default>/bin/ls</default>
<owner>nautilus-actions</owner>
</schema>
<schema>
<key>/schemas/apps/nautilus-actions/configurations/11111111/parameters</key>
<applyto>/apps/nautilus-actions/configurations/11111111/parameters</applyto>
<type>string</type>
<locale name="C">
<short>The parameters of the command</short>
<long>The parameters of the command to start when the user selects the menu item in the Nautilus popup menu.
The parameters can contain some special tokens which are replaced by Nautilus information before starting the command:
%d: base folder of the selected file(s)
%f: the name of the selected file or the first one if many are selected
%h: hostname of the URI
%m: space-separated list of the basenames of the selected file(s)/folder(s)
%M: space-separated list of the selected file(s)/folder(s), with their full paths
%s: scheme of the URI
%u: URI
%U: username of the URI
%%: a percent sign</long>
</locale>
<default>%h %M</default>
<owner>nautilus-actions</owner>
</schema>
<schema>
<key>/schemas/apps/nautilus-actions/configurations/11111111/basenames</key>
<applyto>/apps/nautilus-actions/configurations/11111111/basenames</applyto>
<type>list</type>
<list_type>string</list_type>
<locale name="C">
<short>The list of pattern to match the selected file(s)/folder(s)</short>
<long>A list of strings with joker '*' or '?' to match the name of the selected file(s)/folder(s). Each selected items must match at least one of the filename patterns for the action to appear</long>
</locale>
<default>[*.c]</default>
<owner>nautilus-actions</owner>
</schema>
<schema>
<key>/schemas/apps/nautilus-actions/configurations/11111111/isfile</key>
<applyto>/apps/nautilus-actions/configurations/11111111/isfile</applyto>
<type>bool</type>
<locale name="C">
<short>'true' if the selection can have files, 'false' otherwise</short>
<long>This setting is tied in with the 'isdir' setting. The valid combinations are:
isfile=TRUE and isdir=FALSE: the selection may hold only files
isfile=FALSE and isdir=TRUE: the selection may hold only folders
isfile=TRUE and isdir=TRUE: the selection may hold both files and folders
isfile=FALSE and isdir=FALSE: this is an invalid combination (your configuration will never appear)</long>
</locale>
<default>true</default>
<owner>nautilus-actions</owner>
</schema>
<schema>
<key>/schemas/apps/nautilus-actions/configurations/11111111/isdir</key>
<applyto>/apps/nautilus-actions/configurations/11111111/isdir</applyto>
<type>bool</type>
<locale name="C">
<short>'true' if the selection can have folders, 'false' otherwise</short>
<long>This setting is tied in with the 'isfile' setting. The valid combinations are:
isfile=TRUE and isdir=FALSE: the selection may hold only files
isfile=FALSE and isdir=TRUE: the selection may hold only folders
isfile=TRUE and isdir=TRUE: the selection may hold both files and folders
isfile=FALSE and isdir=FALSE: this is an invalid combination (your configuration will never appear)</long>
</locale>
<default>false</default>
<owner>nautilus-actions</owner>
</schema>
<schema>
<key>/schemas/apps/nautilus-actions/configurations/11111111/accept-multiple-files</key>
<applyto>/apps/nautilus-actions/configurations/11111111/accept-multiple-files</applyto>
<type>bool</type>
<locale name="C">
<short>'true' if the selection can have several items, 'false' otherwise</short>
<long>If you need one or more files or folders to be selected, set this key to 'true'. If you want just one file or folder, set 'false'</long>
</locale>
<default>false</default>
<owner>nautilus-actions</owner>
</schema>
<schema>
<key>/schemas/apps/nautilus-actions/configurations/11111111/schemes</key>
<applyto>/apps/nautilus-actions/configurations/11111111/schemes</applyto>
<type>list</type>
<list_type>string</list_type>
<locale name="C">
<short>The list of schemes where the selected files should be located</short>
<long>Defines the list of valid schemes to be matched against the selected items. The scheme is the protocol used to access the files. The keyword to use is the one used in the URI.
Examples of valid URI include:
file:///tmp/foo.txt
sftp:///root@test.example.net/tmp/foo.txt
The most common schemes are:
'file': local files
'sftp': files accessed via SSH
'ftp': files accessed via FTP
'smb': files accessed via Samba (Windows share)
'dav': files accessed via WebDAV
All schemes used by Nautilus can be used here.</long>
</locale>
<default>[smb]</default>
<owner>nautilus-actions</owner>
</schema>
</schemalist>
</gconfschemafile>
......@@ -39,12 +39,14 @@ api_include_HEADERS = \
na-iio-provider.h \
\
na-core-utils.h \
na-data-boxed.h \
na-data-def.h \
na-data-types.h \
na-gconf-monitor.h \
na-gconf-utils.h \
na-iduplicable.h \
na-ifactory-object.h \
na-ifactory-object-enum.h \
na-ifactory-object-str.h \
na-ifactory-object-data.h \
na-object-api.h \
na-object.h \
na-object-id.h \
......
......@@ -28,64 +28,70 @@
* ... and many others (see AUTHORS)
*/
#ifndef __CORE_NA_DATA_ELEMENT_H__
#define __CORE_NA_DATA_ELEMENT_H__
#ifndef __NAUTILUS_ACTIONS_API_NA_DATA_BOXED_H__
#define __NAUTILUS_ACTIONS_API_NA_DATA_BOXED_H__
/**
* SECTION: na_data_element
* @short_description: #NADataElement class definition.
* @include: core/na-data-element.h
* SECTION: na_data_boxed
* @short_description: #NADataBoxed class definition.
* @include: core/na-data-boxed.h
*
* The object which encapsulates an elementary data of #NAIFactoryObject.
* A #NADataElement object has a type and a value.
* A #NADataBoxed object has a type and a value.
*/
#include <glib-object.h>
#include <api/na-ifactory-object-str.h>
#include "na-data-def.h"
G_BEGIN_DECLS
#define NA_DATA_ELEMENT_TYPE ( na_data_element_get_type())
#define NA_DATA_ELEMENT( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, NA_DATA_ELEMENT_TYPE, NADataElement ))
#define NA_DATA_ELEMENT_CLASS( klass ) ( G_TYPE_CHECK_CLASS_CAST( klass, NA_DATA_ELEMENT_TYPE, NADataElementClass ))
#define NA_IS_DATA_ELEMENT( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, NA_DATA_ELEMENT_TYPE ))
#define NA_IS_DATA_ELEMENT_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE(( klass ), NA_DATA_ELEMENT_TYPE ))
#define NA_DATA_ELEMENT_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), NA_DATA_ELEMENT_TYPE, NADataElementClass ))
#define NA_DATA_BOXED_TYPE ( na_data_boxed_get_type())
#define NA_DATA_BOXED( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, NA_DATA_BOXED_TYPE, NADataBoxed ))
#define NA_DATA_BOXED_CLASS( klass ) ( G_TYPE_CHECK_CLASS_CAST( klass, NA_DATA_BOXED_TYPE, NADataBoxedClass ))
#define NA_IS_DATA_BOXED( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, NA_DATA_BOXED_TYPE ))
#define NA_IS_DATA_BOXED_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE(( klass ), NA_DATA_BOXED_TYPE ))
#define NA_DATA_BOXED_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), NA_DATA_BOXED_TYPE, NADataBoxedClass ))
typedef struct NADataElementPrivate NADataElementPrivate;
typedef struct NADataBoxedPrivate NADataBoxedPrivate;
typedef struct {
GObject parent;
NADataElementPrivate *private;
GObject parent;
NADataBoxedPrivate *private;
}
NADataElement;
NADataBoxed;
typedef struct NADataElementClassPrivate NADataElementClassPrivate;
typedef struct NADataBoxedClassPrivate NADataBoxedClassPrivate;
typedef struct {
GObjectClass parent;
NADataElementClassPrivate *private;
GObjectClass parent;
NADataBoxedClassPrivate *private;
}
NADataElementClass;
NADataBoxedClass;
GType na_data_element_get_type( void );
GType na_data_boxed_get_type( void );
NADataElement *na_data_element_new( const NadfIdType *iddef );
GParamSpec *na_data_boxed_get_param_spec ( const NADataDef *def );
void na_data_element_dump( const NADataElement *element );
NADataBoxed *na_data_boxed_new ( const NADataDef *def );
void *na_data_element_get ( const NADataElement *element );
void na_data_element_set_to_value ( const NADataElement *element, GValue *value );
NADataDef *na_data_boxed_get_data_def ( const NADataBoxed *boxed );
gboolean na_data_boxed_are_equal ( const NADataBoxed *a, const NADataBoxed *b );
gboolean na_data_boxed_is_valid ( const NADataBoxed *boxed );
void na_data_boxed_dump ( const NADataBoxed *boxed );
void na_data_element_set ( NADataElement *element, const NADataElement *value );
void na_data_element_set_from_string ( NADataElement *element, const gchar *value );
void na_data_element_set_from_value ( NADataElement *element, const GValue *value );
void na_data_element_set_from_void ( NADataElement *element, const void *value );
void *na_data_boxed_get_as_void ( const NADataBoxed *boxed );
void na_data_boxed_get_as_value ( const NADataBoxed *boxed, GValue *value );
gboolean na_data_element_are_equal ( const NADataElement *a, const NADataElement *b );
gboolean na_data_element_is_valid ( const NADataElement *element );
void na_data_boxed_set_default ( NADataBoxed *boxed );
void na_data_boxed_set_from_boxed ( NADataBoxed *boxed, const NADataBoxed *value );
void na_data_boxed_set_from_value ( NADataBoxed *boxed, const GValue *value );
void na_data_boxed_set_from_void ( NADataBoxed *boxed, const void *value );
/* -- */
void na_data_boxed_set_from_string( NADataBoxed *boxed, const gchar *value );
G_END_DECLS
#endif /* __CORE_NA_DATA_ELEMENT_H__ */
#endif /* __NAUTILUS_ACTIONS_API_NA_DATA_BOXED_H__ */
......@@ -28,8 +28,8 @@
* ... and many others (see AUTHORS)
*/
#ifndef __NAUTILUS_ACTIONS_API_NA_IFACTORY_OBJECT_STR_H__
#define __NAUTILUS_ACTIONS_API_NA_IFACTORY_OBJECT_STR_H__
#ifndef __NAUTILUS_ACTIONS_API_NA_FACTORY_DATA_DEF_H__
#define __NAUTILUS_ACTIONS_API_NA_FACTORY_DATA_DEF_H__
/**
* SECTION: na_ifactory_object
......@@ -42,63 +42,29 @@
G_BEGIN_DECLS
/**
* Elementary data types
* Each object data item must be typed as one of these
* IFactoryProvider implementations should provide a primitive for reading
* (resp. writing) a value for each of these elementary data types.
*
* IMPORTANT NOTE
* Please note that this enumeration may be compiled in by extensions.
* They must so remain fixed, unless you want see strange effects (e.g.
* an extension has been compiled with NADF_TYPE_STRING = 2, while you
* have inserted another element, making it to 3 !) - or you know what
* you are doing...
*/
enum {
NADF_TYPE_STRING = 1, /* an ASCII string */
NADF_TYPE_LOCALE_STRING, /* a localized UTF-8 string */
NADF_TYPE_BOOLEAN, /* a boolean
* can be initialized with "true" or "false" (case insensitive) */
NADF_TYPE_STRING_LIST, /* a list of ASCII strings */
NADF_TYPE_POINTER, /* a ( void * ) pointer
* should be initialized to NULL */
NADF_TYPE_UINT, /* an unsigned integer */
};
/* attach here a xml document root with the corresponding node for the data
*/
typedef struct {
gchar *doc_id;
gchar *key;
}
NadfDocKey;
/**
* The structure which fully describe an elementary data
* The structure which fully describes an elementary factory data
* Each #NAIFactoryObject item definition may include several groups of
* this structure
*/
typedef struct {
guint id; /* the id of the object data item
* must only be unique inside of the given group */
gchar *name; /* canonical name, used when getting/setting properties */
gchar *name; /* both the id and the canonical name
* used when getting/setting properties
* must be globally unique
* must also be an invariant as it is known from plugin extensions */
gboolean serializable; /* whether the data is serializable
* if FALSE, then no attempt will be made to read/write it
* and the data will must be set dynamically */
* and the data will must be set dynamically
* when a data has been set serializable once, it remains so
* even if it has becomen obsolete (for backward compatibility) */
gchar *short_label; /* short descriptive name, used in GParamSpec */
gchar *short_label; /* short descriptive name
* used in GParamSpec and in schemas */
gchar *long_label; /* long, if not complete, description, used in GParamSpec */
gchar *long_label; /* long, if not complete, description
* used in GParamSpec and in schemas */
guint type; /* the elementary NADF_TYPE_xxx data type */
guint type; /* the elementary NAFD_TYPE_xxx data type */
gchar *default_value; /* the default to assign when creating a new object
* this default is also displayed in command-line help
......@@ -129,20 +95,24 @@ typedef struct {
*
* This may be used mainly when POINTER type is used
* to cast e.g. a GList of items */
gboolean obsoleted; /* whether this data has been obsoleted ?
* if TRUE, then no property will be defined for it
* and the data will not be written when serializing */
}
NadfIdType;
NADataDef;
/**
* The structure which fully describe a logical group of data
* Each #NAIFactoryObject item may definition may be built from a list of
* The structure which fully describes a logical group of data
* Each #NAIFactoryObject item definition is built from a list of
* these groups
*/
typedef struct {
guint idgroup; /* cf. na-ifactory-object-enum.h */
NadfIdType *iddef;
gchar *group; /* defined in na-ifactory-object-data.h */
NADataDef *def;
}
NadfIdGroup;
NADataGroup;
G_END_DECLS
#endif /* __NAUTILUS_ACTIONS_API_NA_IFACTORY_OBJECT_STR_H__ */
#endif /* __NAUTILUS_ACTIONS_API_NA_FACTORY_DATA_DEF_H__ */
......@@ -28,71 +28,49 @@
* ... and many others (see AUTHORS)
*/
#ifndef __NAUTILUS_ACTIONS_API_NA_IFACTORY_OBJECT_ENUM_H__
#define __NAUTILUS_ACTIONS_API_NA_IFACTORY_OBJECT_ENUM_H__
#include <glib.h>
#ifndef __NAUTILUS_ACTIONS_API_NA_FACTORY_DATA_TYPES_H__
#define __NAUTILUS_ACTIONS_API_NA_FACTORY_DATA_TYPES_H__
/**
* SECTION: na_ifactory_object
* @short_description: Enumeration of all serializable elementary datas.
* @include: nautilus-actions/na-ifactory-object-enum.h
* SECTION: na_data
* @short_description: NADataBoxed type definitions.
* @include: nautilus-actions/na-data-types.h
*/
#include <glib-object.h>
G_BEGIN_DECLS
/*
/**
* Elementary factory data types
* Each elementary factory data must be typed as one of these
* IFactoryProvider implementations should provide a primitive for reading
* (resp. writing) a value for each of these elementary data types.
*
* IMPORTANT NOTE
* Please note that this enumeration may be compiled in by extensions.
* They must so remain fixed, unless you want see strange effects (e.g.
* an extension has been compiled with NADF_TYPE_STRING = 2, while you
* an extension has been compiled with NAFD_TYPE_STRING = 2, while you
* have inserted another element, making it to 3 !) - or you know what
* you are doing...
*/
enum {
NA_FACTORY_OBJECT_ID_GROUP = 1,
NADF_DATA_ID,
NADF_DATA_LABEL,
NADF_DATA_PARENT,
NAFD_TYPE_STRING = 1, /* an ASCII string */
NA_FACTORY_OBJECT_ITEM_GROUP = 20,
NADF_DATA_TOOLTIP,
NADF_DATA_ICON,
NADF_DATA_DESCRIPTION,
NADF_DATA_SUBITEMS,
NADF_DATA_SUBITEMS_SLIST,
NADF_DATA_ENABLED,
NADF_DATA_READONLY,
NADF_DATA_PROVIDER,
NADF_DATA_PROVIDER_DATA,
NAFD_TYPE_LOCALE_STRING, /* a localized UTF-8 string */
NA_FACTORY_OBJECT_ACTION_GROUP = 40,
NADF_DATA_VERSION,
NADF_DATA_TARGET_SELECTION,
NADF_DATA_TARGET_BACKGROUND,
NADF_DATA_TARGET_TOOLBAR,
NADF_DATA_TOOLBAR_LABEL,
NADF_DATA_TOOLBAR_SAME_LABEL,
NADF_DATA_LAST_ALLOCATED,
NAFD_TYPE_BOOLEAN, /* a boolean
* can be initialized with "true" or "false" (case insensitive) */
NA_FACTORY_OBJECT_MENU_GROUP = 60,
NAFD_TYPE_STRING_LIST, /* a list of ASCII strings */
NA_FACTORY_OBJECT_PROFILE_GROUP = 80,
NADF_DATA_PATH,
NADF_DATA_PARAMETERS,
NADF_DATA_BASENAMES,
NADF_DATA_MATCHCASE,
NADF_DATA_MIMETYPES,
NADF_DATA_ISFILE,
NADF_DATA_ISDIR,
NADF_DATA_MULTIPLE,
NADF_DATA_SCHEMES,
NADF_DATA_FOLDERS,
NAFD_TYPE_POINTER, /* a ( void * ) pointer
* should be initialized to NULL */
NA_FACTORY_OBJECT_CONDITIONS_GROUP = 100,
NAFD_TYPE_UINT, /* an unsigned integer */
};
G_END_DECLS
#endif /* __NAUTILUS_ACTIONS_API_NA_IFACTORY_OBJECT_ENUM_H__ */
#endif /* __NAUTILUS_ACTIONS_API_NA_FACTORY_DATA_TYPES_H__ */
......@@ -63,6 +63,8 @@ gboolean na_gconf_utils_write_string_list( GConfClient *gconf, const gchar *path
gboolean na_gconf_utils_remove_entry ( GConfClient *gconf, const gchar *path, gchar **message );
GSList *na_gconf_utils_slist_from_string( const gchar *string );
G_END_DECLS
#endif /* __NAUTILUS_ACTIONS_API_NA_GCONF_UTILS_H__ */
......@@ -28,34 +28,62 @@
* ... and many others (see AUTHORS)
*/
#ifndef __CORE_NA_IFACTORY_PROVIDER_PRIV_H__
#define __CORE_NA_IFACTORY_PROVIDER_PRIV_H__
#ifndef __NAUTILUS_ACTIONS_API_NA_IFACTORY_OBJECT_DATA_H__
#define __NAUTILUS_ACTIONS_API_NA_IFACTORY_OBJECT_DATA_H__
/**
* SECTION: na_ifactory_provider
* @short_description: #NAIFactoryProvider interface private structure declaration.
* @include: core/na-ifactory-priv.h
* SECTION: na_ifactory_object
* @short_description: Declaration of all serializable elementary datas.
* @include: nautilus-actions/na-ifactory-object-data.h
*/
#include <api/na-ifactory-object-str.h>
#include <glib.h>
G_BEGIN_DECLS
/* the structure of registered types
* a list of this structure is stored in #NAIFactoryObject interface
*/
typedef struct {
GType type;
NadfIdGroup *groups;
}
NadfImplement;
#define NA_FACTORY_OBJECT_ID_GROUP "na-factory-group-id"
#define NAFO_DATA_ID "na-factory-data-id"
#define NAFO_DATA_LABEL "na-factory-data-label"
#define NAFO_DATA_PARENT "na-factory-data-parent"
/* private interface data
*/
struct NAIFactoryProviderInterfacePrivate {
GList *registered;
};
#define NA_FACTORY_OBJECT_ITEM_GROUP "na-factory-group-item"
#define NAFO_DATA_TOOLTIP "na-factory-data-tooltip"
#define NAFO_DATA_ICON "na-factory-data-icon"
#define NAFO_DATA_DESCRIPTION "na-factory-data-description"
#define NAFO_DATA_SUBITEMS "na-factory-data-items"
#define NAFO_DATA_SUBITEMS_SLIST "na-factory-data-items-slist"
#define NAFO_DATA_ENABLED "na-factory-data-enabled"
#define NAFO_DATA_READONLY "na-factory-data-readonly"
#define NAFO_DATA_PROVIDER "na-factory-data-provider"
#define NAFO_DATA_PROVIDER_DATA "na-factory-data-provider-data"
#define NA_FACTORY_OBJECT_ACTION_GROUP "na-factory-group-action"
#define NAFO_DATA_VERSION "na-factory-data-version"
#define NAFO_DATA_TARGET_SELECTION "na-factory-data-target-selection"
#define NAFO_DATA_TARGET_BACKGROUND "na-factory-data-target-background"
#define NAFO_DATA_TARGET_TOOLBAR "na-factory-data-target-toolbar"
#define NAFO_DATA_TOOLBAR_LABEL "na-factory-data-toolbar-label"
#define NAFO_DATA_TOOLBAR_SAME_LABEL "na-factory-data-toolbar-same-label"
#define NAFO_DATA_LAST_ALLOCATED "na-factory-data-last-allocated"
#define NA_FACTORY_OBSOLETED_ACTION_GROUP "na-factory-group-action-obsoleted"
#define NA_FACTORY_OBJECT_MENU_GROUP "na-factory-group-menu"
#define NA_FACTORY_OBJECT_PROFILE_GROUP "na-factory-group-profile"
#define NAFO_DATA_PATH "na-factory-data-path"
#define NAFO_DATA_PARAMETERS "na-factory-data-parameters"
#define NAFO_DATA_BASENAMES "na-factory-data-basenames"
#define NAFO_DATA_MATCHCASE "na-factory-data-matchcase"
#define NAFO_DATA_MIMETYPES "na-factory-data-mimetypes"
#define NAFO_DATA_ISFILE "na-factory-data-isfile"
#define NAFO_DATA_ISDIR "na-factory-data-isdir"
#define NAFO_DATA_MULTIPLE "na-factory-data-multiple"
#define NAFO_DATA_SCHEMES "na-factory-data-schemes"
#define NAFO_DATA_FOLDERS "na-factory-data-folders"
#define NA_FACTORY_OBJECT_CONDITIONS_GROUP "na-factory-group-conditions"
G_END_DECLS
#endif /* __CORE_NA_IFACTORY_PROVIDER_PRIV_H__ */
#endif /* __NAUTILUS_ACTIONS_API_NA_IFACTORY_OBJECT_DATA_H__ */
......@@ -39,21 +39,22 @@
* This interface must be implemented by #NAObject-derived objects which
* should take advantage of data factory management system.
*
* A #NAObject which would implement this #NAIFactoryObject interface
* must meet following conditions:
* A #NAObject-derived which should implement this #NAIFactoryObject
* interface must meet following conditions:
* - must accept an empty constructor
*
* Elementary data are implemented as a GList of NADataBoxed objects.
*
* Nautilus-Actions v 2.30 - API version: 1
*/
#include "na-ifactory-object-enum.h"
#include "na-ifactory-object-str.h"
#include "na-data-def.h"
#include "na-ifactory-provider-provider.h"
G_BEGIN_DECLS
#define NA_IFACTORY_OBJECT_TYPE ( na_ifactory_object_get_type())
#define NA_IFACTORY_OBJECT( instance ) ( G_TYPE_CHECK_INSTANCE_CAST( instance, NA_IFACTORY_OBJECT_TYPE, NAIFactoryObject ))
#define NA_IFACTORY_OBJECT_TYPE ( na_ifactory_object_get_type())
#define NA_IFACTORY_OBJECT( instance ) ( G_TYPE_CHECK_INSTANCE_CAST( instance, NA_IFACTORY_OBJECT_TYPE, NAIFactoryObject ))
#define NA_IS_IFACTORY_OBJECT( instance ) ( G_TYPE_CHECK_INSTANCE_TYPE( instance, NA_IFACTORY_OBJECT_TYPE ))
#define NA_IFACTORY_OBJECT_GET_INTERFACE( instance ) ( G_TYPE_INSTANCE_GET_INTERFACE(( instance ), NA_IFACTORY_OBJECT_TYPE, NAIFactoryObjectInterface ))
......@@ -62,7 +63,7 @@ typedef struct NAIFactoryObject NAIFactoryObject;
typedef struct NAIFactoryObjectInterfacePrivate NAIFactoryObjectInterfacePrivate;
typedef struct {
GTypeInterface parent;
GTypeInterface parent;
NAIFactoryObjectInterfacePrivate *private;
/**
......@@ -73,22 +74,30 @@ typedef struct {
*
* Defaults to 1.
*/
guint ( *get_version )( const NAIFactoryObject *instance );
guint ( *get_version )( const NAIFactoryObject *instance );
/**
* get_groups:
* @instance: this #NAIFactoryObject instance.
*
* Returns: a pointer to the NADataGroup which defines this object.
*/
NADataGroup * ( *get_groups ) ( const NAIFactoryObject *instance );
/**
* get_default:
* @instance: this #NAIFactoryObject instance.
* @iddef: the #NadfIdType structure which defines the data whose
* @iddef: the #NADataDef structure which defines the data whose
* default value is searched for.
*
* The @instance may take advantage of this method to setup a default
* value for a specific instance, or even for instances of a class when
* several classes share some elementary data via common #NadfIdGroup.
* several classes share some elementary data via common #NADataGroup.
*
* Returns: a newly allocated string which defines the suitable
* default value, or %NULL.
*/
gchar * ( *get_default )( const NAIFactoryObject *instance, const NadfIdType *iddef );
gchar * ( *get_default )( const NAIFactoryObject *instance, const NADataDef *iddef );
/**
* copy:
......@@ -100,7 +109,7 @@ typedef struct {
* The target @instance may take advantage of this call to do some
* particular copy tasks.
*/
void ( *copy ) ( NAIFactoryObject *instance, const NAIFactoryObject *source );
void ( *copy ) ( NAIFactoryObject *instance, const NAIFactoryObject *source );
/**
* are_equal:
......@@ -112,7 +121,7 @@ typedef struct {
* This function is triggered after all elementary data comparisons
* have been sucessfully made.
*/
gboolean ( *are_equal ) ( const NAIFactoryObject *a, const NAIFactoryObject *b );
gboolean ( *are_equal ) ( const NAIFactoryObject *a, const NAIFactoryObject *b );