Syndication

dublincorevocab.cpp
1/*
2 This file is part of the syndication library
3 SPDX-FileCopyrightText: 2006 Frank Osterfeld <osterfeld@kde.org>
4
5 SPDX-License-Identifier: LGPL-2.0-or-later
6*/
7
8#include "dublincorevocab.h"
9#include "property.h"
10
11#include <QCoreApplication>
12#include <QString>
13
14namespace Syndication
15{
16namespace RDF
17{
18class SYNDICATION_NO_EXPORT DublinCoreVocab::DublinCoreVocabPrivate
19{
20public:
21 QString namespaceURI;
22 PropertyPtr contributor;
23 PropertyPtr coverage;
24 PropertyPtr creator;
25 PropertyPtr date;
26 PropertyPtr description;
27 PropertyPtr format;
28 PropertyPtr identifier;
29 PropertyPtr language;
30 PropertyPtr publisher;
31 PropertyPtr relation;
32 PropertyPtr rights;
33 PropertyPtr source;
34 PropertyPtr subject;
35 PropertyPtr title;
36 PropertyPtr type;
37
38 static DublinCoreVocab *sSelf;
39 static void cleanupDublinCoreVocab()
40 {
41 delete sSelf;
42 sSelf = nullptr;
43 }
44};
45DublinCoreVocab *DublinCoreVocab::DublinCoreVocabPrivate::sSelf = nullptr;
46
47DublinCoreVocab::DublinCoreVocab()
48 : d(new DublinCoreVocabPrivate)
49{
50 QString ns = QStringLiteral("http://purl.org/dc/elements/1.1/");
51
52 d->namespaceURI = ns;
53
54 d->contributor = PropertyPtr(new Property(ns + QLatin1String("contributor")));
55 d->coverage = PropertyPtr(new Property(ns + QLatin1String("coverage")));
56 d->creator = PropertyPtr(new Property(ns + QLatin1String("creator")));
57 d->date = PropertyPtr(new Property(ns + QLatin1String("date")));
58 d->description = PropertyPtr(new Property(ns + QLatin1String("description")));
59 d->format = PropertyPtr(new Property(ns + QLatin1String("format")));
60 d->identifier = PropertyPtr(new Property(ns + QLatin1String("identifier")));
61 d->language = PropertyPtr(new Property(ns + QLatin1String("language")));
62 d->publisher = PropertyPtr(new Property(ns + QLatin1String("publisher")));
63 d->relation = PropertyPtr(new Property(ns + QLatin1String("relation")));
64 d->rights = PropertyPtr(new Property(ns + QLatin1String("rights")));
65 d->source = PropertyPtr(new Property(ns + QLatin1String("source")));
66 d->subject = PropertyPtr(new Property(ns + QLatin1String("subject")));
67 d->title = PropertyPtr(new Property(ns + QLatin1String("title")));
68 d->type = PropertyPtr(new Property(ns + QLatin1String("type")));
69}
70
71DublinCoreVocab::~DublinCoreVocab() = default;
72
73DublinCoreVocab *DublinCoreVocab::self()
74{
75 static DublinCoreVocabPrivate p;
76 if (!p.sSelf) {
77 p.sSelf = new DublinCoreVocab;
78 qAddPostRoutine(DublinCoreVocabPrivate::cleanupDublinCoreVocab);
79 }
80 return p.sSelf;
81}
82
83const QString &DublinCoreVocab::namespaceURI() const
84{
85 return d->namespaceURI;
86}
87
88PropertyPtr DublinCoreVocab::contributor() const
89{
90 return d->contributor;
91}
92
93PropertyPtr DublinCoreVocab::creator() const
94{
95 return d->creator;
96}
97
98PropertyPtr DublinCoreVocab::coverage() const
99{
100 return d->coverage;
101}
102
103PropertyPtr DublinCoreVocab::date() const
104{
105 return d->date;
106}
107
108PropertyPtr DublinCoreVocab::description() const
109{
110 return d->description;
111}
112
113PropertyPtr DublinCoreVocab::format() const
114{
115 return d->format;
116}
117
118PropertyPtr DublinCoreVocab::identifier() const
119{
120 return d->identifier;
121}
122
123PropertyPtr DublinCoreVocab::language() const
124{
125 return d->language;
126}
127
128PropertyPtr DublinCoreVocab::publisher() const
129{
130 return d->publisher;
131}
132
133PropertyPtr DublinCoreVocab::relation() const
134{
135 return d->relation;
136}
137
138PropertyPtr DublinCoreVocab::rights() const
139{
140 return d->rights;
141}
142
143PropertyPtr DublinCoreVocab::source() const
144{
145 return d->source;
146}
147
148PropertyPtr DublinCoreVocab::subject() const
149{
150 return d->subject;
151}
152
153PropertyPtr DublinCoreVocab::title() const
154{
155 return d->title;
156}
157
158PropertyPtr DublinCoreVocab::type() const
159{
160 return d->type;
161}
162
163} // namespace RDF
164} // namespace Syndication
Singleton holding RDF class and property constants of the Dublin Core vocabulary.
Type type(const QSqlDatabase &db)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:03:18 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.