Update ChangeLog
[nautilus-actions.git] / src / api / na-data-def.h
blobf5cac00f08d98fc8535b985b0f34d135a5c9adfe
1 /*
2 * Nautilus-Actions
3 * A Nautilus extension which offers configurable context menu actions.
5 * Copyright (C) 2005 The GNOME Foundation
6 * Copyright (C) 2006, 2007, 2008 Frederic Ruaudel and others (see AUTHORS)
7 * Copyright (C) 2009, 2010, 2011 Pierre Wieser and others (see AUTHORS)
9 * This Program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of
12 * the License, or (at your option) any later version.
14 * This Program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public
20 * License along with this Library; see the file COPYING. If not,
21 * write to the Free Software Foundation, Inc., 59 Temple Place,
22 * Suite 330, Boston, MA 02111-1307, USA.
24 * Authors:
25 * Frederic Ruaudel <grumz@grumz.net>
26 * Rodrigo Moya <rodrigo@gnome-db.org>
27 * Pierre Wieser <pwieser@trychlos.org>
28 * ... and many others (see AUTHORS)
31 #ifndef __NAUTILUS_ACTIONS_API_NA_FACTORY_DATA_DEF_H__
32 #define __NAUTILUS_ACTIONS_API_NA_FACTORY_DATA_DEF_H__
34 /**
35 * SECTION: data-def
36 * @title: NADataDef, NADataGroup
37 * @short_description: The Data Factory Structure Definitions
38 * @include: nautilus-actions/na-data-def.h
40 * #NADataDef and #NADataGroup are structures which handle the list of
41 * elementary datas for each and every #NAObjectItem which happens to
42 * implement the #NAIFactoryObject interface.
45 #include <glib.h>
47 G_BEGIN_DECLS
49 /**
50 * NADataDef:
51 * @name: both the id and the canonical name.
52 * Used when getting/setting properties.
53 * Is defined in na-ifactory-object-data.h and must be globally unique.
54 * Must be an invariant as it is known from plugin extensions.
55 * @readable: whether the data should be read on unserialization operations.
56 * If FALSE, then no attempt will be made to read it
57 * and the data will have to be set dynamically.
58 * When a data has been written once (see below), and unless
59 * special cases (see e.g. type), it should remain readable
60 * even if it has becomen obsolete (for backward compatibility).
61 * @writable: whether the data is to be written on serialization operations.
62 * If FALSE, then no attempt will be made to write it.
63 * Mainly set to FALSE for dynamically set variables and
64 * obsoleted ones.
65 * @has_property: whether a property should be set for this variable ?
66 * Set to FALSE for obsolete variables.
67 * @short_label: short localizable descriptive name.
68 * Used in GParamSpec and in schemas.
69 * @long_label: long, if not complete, localizable description.
70 * Used in GParamSpec and in schemas?
71 * @type: the elementary NA_DATA_TYPE_xxx data type.
72 * @default_value: the default to assign when creating a new object.
73 * This default is also displayed in command-line help
74 * of nautilus-actions-new utility.
75 * @write_if_default: write this value even if it is the default value ?
76 * Should default to FALSE.
77 * @copyable: whether this data should be automatically copied when
78 * we are duplicating an object to another ?
79 * In all cases, the implementation is always triggered
80 * by the copy() interface method.
81 * @comparable: whether this data should be compared when we
82 * are testing two objects for equality.
83 * @mandatory: whether this data must be not null and not empty
84 * when we are testing for validity of an object.
85 * @localizable: whether this is a localizable data when serializing or exporting.
86 * @gconf_entry: same entry is also used for GConf-based XML docs.
87 * @desktop_entry: entry in .desktop files.
88 * @option_short: the short version of a command-line parameter in nautilus-actions-new,
89 * or 0.
90 * @option_long: the long version of the same command-line parameter in nautilus-actions-new,
91 * or NULL.
92 * @option_flags: #GOptionFlags for the command-line parameter, or 0.
93 * @option_arg: the type of the option, or 0.
94 * @option_label: the localizable description for the variable in nautilus-actions-new.
95 * Defaults to @short_label if NULL.
96 * @option_arg_label: the localizable description for the argument.
98 * This structure fully describes an elementary factory data.
99 * Each #NAIFactoryObject item definition may include several groups of
100 * this structure.
102 typedef struct {
103 gchar *name;
104 gboolean readable;
105 gboolean writable;
106 gboolean has_property;
107 gchar *short_label;
108 gchar *long_label;
109 guint type;
110 gchar *default_value;
111 gboolean write_if_default;
112 gboolean copyable;
113 gboolean comparable;
114 gboolean mandatory;
115 gboolean localizable;
116 gchar *gconf_entry;
117 gchar *desktop_entry;
118 gchar option_short;
119 gchar *option_long;
120 gint option_flags;
121 GOptionArg option_arg;
122 gchar *option_label;
123 gchar *option_arg_label;
125 NADataDef;
128 * NADataGroup:
129 * @group: the name of the group, as defined in na-ifactory-object-data.h.
130 * @def: the list of the corresponding data structures.
132 * This structure fully describes a logical group of data.
133 * Each #NAIFactoryObject item definition is built from a list of
134 * these groups.
136 typedef struct {
137 gchar *group;
138 NADataDef *def;
140 NADataGroup;
142 const NADataDef *na_data_def_get_data_def( const NADataGroup *group, const gchar *group_name, const gchar *name );
144 G_END_DECLS
146 #endif /* __NAUTILUS_ACTIONS_API_NA_FACTORY_DATA_DEF_H__ */