File indexing completed on 2024-04-21 15:07:26

0001 /*
0002     This file is part of the syndication library
0003     SPDX-FileCopyrightText: 2006 Frank Osterfeld <osterfeld@kde.org>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 
0008 #include "dublincorevocab.h"
0009 #include "property.h"
0010 
0011 #include <QCoreApplication>
0012 #include <QString>
0013 
0014 namespace Syndication
0015 {
0016 namespace RDF
0017 {
0018 class SYNDICATION_NO_EXPORT DublinCoreVocab::DublinCoreVocabPrivate
0019 {
0020 public:
0021     QString namespaceURI;
0022     PropertyPtr contributor;
0023     PropertyPtr coverage;
0024     PropertyPtr creator;
0025     PropertyPtr date;
0026     PropertyPtr description;
0027     PropertyPtr format;
0028     PropertyPtr identifier;
0029     PropertyPtr language;
0030     PropertyPtr publisher;
0031     PropertyPtr relation;
0032     PropertyPtr rights;
0033     PropertyPtr source;
0034     PropertyPtr subject;
0035     PropertyPtr title;
0036     PropertyPtr type;
0037 
0038     static DublinCoreVocab *sSelf;
0039     static void cleanupDublinCoreVocab()
0040     {
0041         delete sSelf;
0042         sSelf = nullptr;
0043     }
0044 };
0045 DublinCoreVocab *DublinCoreVocab::DublinCoreVocabPrivate::sSelf = nullptr;
0046 
0047 DublinCoreVocab::DublinCoreVocab()
0048     : d(new DublinCoreVocabPrivate)
0049 {
0050     QString ns = QStringLiteral("http://purl.org/dc/elements/1.1/");
0051 
0052     d->namespaceURI = ns;
0053 
0054     d->contributor = PropertyPtr(new Property(ns + QLatin1String("contributor")));
0055     d->coverage = PropertyPtr(new Property(ns + QLatin1String("coverage")));
0056     d->creator = PropertyPtr(new Property(ns + QLatin1String("creator")));
0057     d->date = PropertyPtr(new Property(ns + QLatin1String("date")));
0058     d->description = PropertyPtr(new Property(ns + QLatin1String("description")));
0059     d->format = PropertyPtr(new Property(ns + QLatin1String("format")));
0060     d->identifier = PropertyPtr(new Property(ns + QLatin1String("identifier")));
0061     d->language = PropertyPtr(new Property(ns + QLatin1String("language")));
0062     d->publisher = PropertyPtr(new Property(ns + QLatin1String("publisher")));
0063     d->relation = PropertyPtr(new Property(ns + QLatin1String("relation")));
0064     d->rights = PropertyPtr(new Property(ns + QLatin1String("rights")));
0065     d->source = PropertyPtr(new Property(ns + QLatin1String("source")));
0066     d->subject = PropertyPtr(new Property(ns + QLatin1String("subject")));
0067     d->title = PropertyPtr(new Property(ns + QLatin1String("title")));
0068     d->type = PropertyPtr(new Property(ns + QLatin1String("type")));
0069 }
0070 
0071 DublinCoreVocab::~DublinCoreVocab()
0072 {
0073     delete d;
0074 }
0075 
0076 DublinCoreVocab *DublinCoreVocab::self()
0077 {
0078     static DublinCoreVocabPrivate p;
0079     if (!p.sSelf) {
0080         p.sSelf = new DublinCoreVocab;
0081         qAddPostRoutine(DublinCoreVocabPrivate::cleanupDublinCoreVocab);
0082     }
0083     return p.sSelf;
0084 }
0085 
0086 const QString &DublinCoreVocab::namespaceURI() const
0087 {
0088     return d->namespaceURI;
0089 }
0090 
0091 PropertyPtr DublinCoreVocab::contributor() const
0092 {
0093     return d->contributor;
0094 }
0095 
0096 PropertyPtr DublinCoreVocab::creator() const
0097 {
0098     return d->creator;
0099 }
0100 
0101 PropertyPtr DublinCoreVocab::coverage() const
0102 {
0103     return d->coverage;
0104 }
0105 
0106 PropertyPtr DublinCoreVocab::date() const
0107 {
0108     return d->date;
0109 }
0110 
0111 PropertyPtr DublinCoreVocab::description() const
0112 {
0113     return d->description;
0114 }
0115 
0116 PropertyPtr DublinCoreVocab::format() const
0117 {
0118     return d->format;
0119 }
0120 
0121 PropertyPtr DublinCoreVocab::identifier() const
0122 {
0123     return d->identifier;
0124 }
0125 
0126 PropertyPtr DublinCoreVocab::language() const
0127 {
0128     return d->language;
0129 }
0130 
0131 PropertyPtr DublinCoreVocab::publisher() const
0132 {
0133     return d->publisher;
0134 }
0135 
0136 PropertyPtr DublinCoreVocab::relation() const
0137 {
0138     return d->relation;
0139 }
0140 
0141 PropertyPtr DublinCoreVocab::rights() const
0142 {
0143     return d->rights;
0144 }
0145 
0146 PropertyPtr DublinCoreVocab::source() const
0147 {
0148     return d->source;
0149 }
0150 
0151 PropertyPtr DublinCoreVocab::subject() const
0152 {
0153     return d->subject;
0154 }
0155 
0156 PropertyPtr DublinCoreVocab::title() const
0157 {
0158     return d->title;
0159 }
0160 
0161 PropertyPtr DublinCoreVocab::type() const
0162 {
0163     return d->type;
0164 }
0165 
0166 } // namespace RDF
0167 } // namespace Syndication