Code

Pot and Dutch translation update
[inkscape.git] / src / rdf.h
1 /** @file
2  * @brief headers for RDF types
3  */
4 /* Authors:
5  *  Kees Cook <kees@outflux.net>
6  *
7  * Copyright (C) 2004 Authors
8  * Released under GNU GPL, read the file 'COPYING' for more information
9  */
10 #ifndef _RDF_H_
11 #define _RDF_H_
13 #include <glib.h>
14 #include <glibmm/i18n.h>
15 #include "document.h"
17 // yeah, it's not a triple yet...
18 /**
19  * \brief Holds license name/resource doubles for rdf_license_t entries
20  */
21 struct rdf_double_t {
22     gchar const *name;
23     gchar const *resource;
24 };
26 /**
27  * \brief Holds license name and RDF information
28  */
29 struct rdf_license_t {
30     gchar const *name;        /* localized name of this license */
31     gchar const *uri;         /* URL for the RDF/Work/license element */
32     struct rdf_double_t *details; /* the license details */
33 //    gchar const *fragment;    /* XML contents for the RDF/License tag */
34 };
36 extern rdf_license_t rdf_licenses [];
38 /**
39  * \brief Describes how a given RDF entity is stored in XML
40  */
41 enum RDFType {
42     RDF_CONTENT,  // direct between-XML-tags content
43     RDF_AGENT,    // requires the "Agent" hierarchy before doing content
44     RDF_RESOURCE, // stored in "rdf:resource" element
45     RDF_XML,      // literal XML
46     RDF_BAG       // rdf:Bag resources
47 };
49 /**
50  * \brief Describes how a given RDF entity should be edited
51  */
52 enum RDF_Format {
53     RDF_FORMAT_LINE,          // uses single line data (GtkEntry)
54     RDF_FORMAT_MULTILINE,     // uses multiline data (GtkTextView)
55     RDF_FORMAT_SPECIAL        // uses some other edit methods
56 };
58 enum RDF_Editable {
59     RDF_EDIT_GENERIC,       // editable via generic widgets
60     RDF_EDIT_SPECIAL,       // special widgets are needed
61     RDF_EDIT_HARDCODED      // isn't editable
62 };
64 /**
65  * \brief Holds known RDF/Work tags
66  */
67 struct rdf_work_entity_t {
68     char const *name;       /* unique name of this entity for internal reference */
69     gchar const *title;      /* localized title of this entity for data entry */
70     gchar const *tag;        /* namespace tag for the RDF/Work element */
71     RDFType datatype;   /* how to extract/inject the RDF information */
72     gchar const *tip;        /* tool tip to explain the meaning of the entity */
73     RDF_Format format;  /* in what format is this data edited? */
74     RDF_Editable editable;/* in what way is the data editable? */
75 };
77 extern rdf_work_entity_t rdf_work_entities [];
79 /**
80  * \brief Generic collection of RDF information for the RDF debug function
81  */
82 struct rdf_t {
83     gchar*                work_title;
84     gchar*                work_date;
85     gchar*                work_creator;
86     gchar*                work_owner;
87     gchar*                work_publisher;
88     gchar*                work_type;
89     gchar*                work_source;
90     gchar*                work_subject;
91     gchar*                work_description;
92     struct rdf_license_t* license;
93 };
95 struct rdf_work_entity_t * rdf_find_entity(gchar const * name);
97 const gchar * rdf_get_work_entity(SPDocument * doc,
98                                   struct rdf_work_entity_t * entity);
99 unsigned int  rdf_set_work_entity(SPDocument * doc,
100                                   struct rdf_work_entity_t * entity,
101                                   const gchar * text);
103 struct rdf_license_t * rdf_get_license(SPDocument * doc);
104 void                   rdf_set_license(SPDocument * doc,
105                                        struct rdf_license_t const * license);
107 void rdf_set_defaults ( SPDocument * doc );
109 #endif // _RDF_H_
111 /*
112   Local Variables:
113   mode:c++
114   c-file-style:"stroustrup"
115   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
116   indent-tabs-mode:nil
117   fill-column:99
118   End:
119 */
120 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :