diff options
| author | Krzysztof Kosi??ski <tweenk.pl@gmail.com> | 2009-02-21 01:59:56 +0000 |
|---|---|---|
| committer | tweenk <tweenk@users.sourceforge.net> | 2009-02-21 01:59:56 +0000 |
| commit | 154165799998cb2cb7491bbd97b0511943a0228e (patch) | |
| tree | 878507e5e42b4651f1bb0805a42c0837528eb314 /src/rdf.h | |
| parent | Only build static libraries for subdirs than actually contain libraries, (diff) | |
| download | inkscape-154165799998cb2cb7491bbd97b0511943a0228e.tar.gz inkscape-154165799998cb2cb7491bbd97b0511943a0228e.zip | |
Move files from the src/dialogs/ directory to the places where they
should be. Build libinkscape.a - should reduce link time.
(bzr r7337)
Diffstat (limited to 'src/rdf.h')
| -rw-r--r-- | src/rdf.h | 120 |
1 files changed, 120 insertions, 0 deletions
diff --git a/src/rdf.h b/src/rdf.h new file mode 100644 index 000000000..a98f5a1e4 --- /dev/null +++ b/src/rdf.h @@ -0,0 +1,120 @@ +/** @file + * @brief headers for RDF types + */ +/* Authors: + * Kees Cook <kees@outflux.net> + * + * Copyright (C) 2004 Authors + * Released under GNU GPL, read the file 'COPYING' for more information + */ +#ifndef _RDF_H_ +#define _RDF_H_ + +#include <glib.h> +#include <glibmm/i18n.h> +#include "document.h" + +// yeah, it's not a triple yet... +/** + * \brief Holds license name/resource doubles for rdf_license_t entries + */ +struct rdf_double_t { + gchar const *name; + gchar const *resource; +}; + +/** + * \brief Holds license name and RDF information + */ +struct rdf_license_t { + gchar const *name; /* localized name of this license */ + gchar const *uri; /* URL for the RDF/Work/license element */ + struct rdf_double_t *details; /* the license details */ +// gchar const *fragment; /* XML contents for the RDF/License tag */ +}; + +extern rdf_license_t rdf_licenses []; + +/** + * \brief Describes how a given RDF entity is stored in XML + */ +enum RDFType { + RDF_CONTENT, // direct between-XML-tags content + RDF_AGENT, // requires the "Agent" hierarchy before doing content + RDF_RESOURCE, // stored in "rdf:resource" element + RDF_XML, // literal XML + RDF_BAG // rdf:Bag resources +}; + +/** + * \brief Describes how a given RDF entity should be edited + */ +enum RDF_Format { + RDF_FORMAT_LINE, // uses single line data (GtkEntry) + RDF_FORMAT_MULTILINE, // uses multiline data (GtkTextView) + RDF_FORMAT_SPECIAL // uses some other edit methods +}; + +enum RDF_Editable { + RDF_EDIT_GENERIC, // editable via generic widgets + RDF_EDIT_SPECIAL, // special widgets are needed + RDF_EDIT_HARDCODED // isn't editable +}; + +/** + * \brief Holds known RDF/Work tags + */ +struct rdf_work_entity_t { + char const *name; /* unique name of this entity for internal reference */ + gchar const *title; /* localized title of this entity for data entry */ + gchar const *tag; /* namespace tag for the RDF/Work element */ + RDFType datatype; /* how to extract/inject the RDF information */ + gchar const *tip; /* tool tip to explain the meaning of the entity */ + RDF_Format format; /* in what format is this data edited? */ + RDF_Editable editable;/* in what way is the data editable? */ +}; + +extern rdf_work_entity_t rdf_work_entities []; + +/** + * \brief Generic collection of RDF information for the RDF debug function + */ +struct rdf_t { + gchar* work_title; + gchar* work_date; + gchar* work_creator; + gchar* work_owner; + gchar* work_publisher; + gchar* work_type; + gchar* work_source; + gchar* work_subject; + gchar* work_description; + struct rdf_license_t* license; +}; + +struct rdf_work_entity_t * rdf_find_entity(gchar const * name); + +const gchar * rdf_get_work_entity(SPDocument * doc, + struct rdf_work_entity_t * entity); +unsigned int rdf_set_work_entity(SPDocument * doc, + struct rdf_work_entity_t * entity, + const gchar * text); + +struct rdf_license_t * rdf_get_license(SPDocument * doc); +void rdf_set_license(SPDocument * doc, + struct rdf_license_t const * license); + +void rdf_set_defaults ( SPDocument * doc ); + +#endif // _RDF_H_ + +/* + Local Variables: + mode:c++ + c-file-style:"stroustrup" + c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) + indent-tabs-mode:nil + fill-column:99 + End: +*/ +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : |
