Code

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