File indexing completed on 2024-07-21 03:46:01

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() = default;
0072 
0073 DublinCoreVocab *DublinCoreVocab::self()
0074 {
0075     static DublinCoreVocabPrivate p;
0076     if (!p.sSelf) {
0077         p.sSelf = new DublinCoreVocab;
0078         qAddPostRoutine(DublinCoreVocabPrivate::cleanupDublinCoreVocab);
0079     }
0080     return p.sSelf;
0081 }
0082 
0083 const QString &DublinCoreVocab::namespaceURI() const
0084 {
0085     return d->namespaceURI;
0086 }
0087 
0088 PropertyPtr DublinCoreVocab::contributor() const
0089 {
0090     return d->contributor;
0091 }
0092 
0093 PropertyPtr DublinCoreVocab::creator() const
0094 {
0095     return d->creator;
0096 }
0097 
0098 PropertyPtr DublinCoreVocab::coverage() const
0099 {
0100     return d->coverage;
0101 }
0102 
0103 PropertyPtr DublinCoreVocab::date() const
0104 {
0105     return d->date;
0106 }
0107 
0108 PropertyPtr DublinCoreVocab::description() const
0109 {
0110     return d->description;
0111 }
0112 
0113 PropertyPtr DublinCoreVocab::format() const
0114 {
0115     return d->format;
0116 }
0117 
0118 PropertyPtr DublinCoreVocab::identifier() const
0119 {
0120     return d->identifier;
0121 }
0122 
0123 PropertyPtr DublinCoreVocab::language() const
0124 {
0125     return d->language;
0126 }
0127 
0128 PropertyPtr DublinCoreVocab::publisher() const
0129 {
0130     return d->publisher;
0131 }
0132 
0133 PropertyPtr DublinCoreVocab::relation() const
0134 {
0135     return d->relation;
0136 }
0137 
0138 PropertyPtr DublinCoreVocab::rights() const
0139 {
0140     return d->rights;
0141 }
0142 
0143 PropertyPtr DublinCoreVocab::source() const
0144 {
0145     return d->source;
0146 }
0147 
0148 PropertyPtr DublinCoreVocab::subject() const
0149 {
0150     return d->subject;
0151 }
0152 
0153 PropertyPtr DublinCoreVocab::title() const
0154 {
0155     return d->title;
0156 }
0157 
0158 PropertyPtr DublinCoreVocab::type() const
0159 {
0160     return d->type;
0161 }
0162 
0163 } // namespace RDF
0164 } // namespace Syndication