File indexing completed on 2024-12-01 03:45:43
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 #ifndef SYNDICATION_RDF_RSSVOCAB_H 0009 #define SYNDICATION_RDF_RSSVOCAB_H 0010 0011 #include <QSharedPointer> 0012 #include <QStringList> 0013 0014 #include "../syndication_export.h" 0015 0016 #include <memory> 0017 0018 class QString; 0019 0020 namespace Syndication 0021 { 0022 namespace RDF 0023 { 0024 //@cond PRIVATE 0025 class Property; 0026 typedef QSharedPointer<Property> PropertyPtr; 0027 class Resource; 0028 typedef QSharedPointer<Resource> ResourcePtr; 0029 //@endcond 0030 0031 /** 0032 * Singleton holding RDF class and property constants of the RSS 1.0 0033 * vocabulary. See http://web.resource.org/rss/1.0/ for a specification. 0034 * 0035 * @author Frank Osterfeld 0036 */ 0037 class RSSVocab 0038 { 0039 public: 0040 /** 0041 * destructor 0042 */ 0043 ~RSSVocab(); 0044 0045 /** 0046 * returns the singleton instance 0047 */ 0048 static RSSVocab *self(); 0049 0050 /** 0051 * namespace URI of the RSS 1.0 vocabulary, 0052 * @c "http://web.resource.org/rss/1.0/" 0053 */ 0054 const QString &namespaceURI() const; 0055 0056 /** 0057 * RSS 1.0 title property, see Document::title() for 0058 * more details 0059 */ 0060 PropertyPtr title() const; 0061 0062 /** 0063 * RSS 1.0 description property, see Document::description() for 0064 * more details 0065 */ 0066 PropertyPtr description() const; 0067 0068 /** 0069 * RSS 1.0 link property, see Document::link() for 0070 * more details 0071 */ 0072 PropertyPtr link() const; 0073 0074 /** 0075 * RSS 1.0 name property, see Document::name() for 0076 * more details 0077 */ 0078 PropertyPtr name() const; 0079 0080 /** 0081 * RSS 1.0 url property, see Document::url() for 0082 * more details 0083 */ 0084 PropertyPtr url() const; 0085 0086 /** 0087 * RSS 1.0 channel class, the instance is represented by 0088 * Syndication::RDF::Document 0089 */ 0090 ResourcePtr channel() const; 0091 0092 /** 0093 * RSS 1.0 item class, the instance is represented by 0094 * Syndication::RDF::Item 0095 */ 0096 ResourcePtr item() const; 0097 0098 /** 0099 * RSS 1.0 items property, see Document::items() for 0100 * more details 0101 */ 0102 PropertyPtr items() const; 0103 0104 /** 0105 * RSS 1.0 image property, see Document::image() for 0106 * more details 0107 */ 0108 PropertyPtr image() const; 0109 0110 /** 0111 * RSS 1.0 textinput property, see Document::textinput() for 0112 * more details 0113 */ 0114 PropertyPtr textinput() const; 0115 0116 private: 0117 SYNDICATION_NO_EXPORT RSSVocab(); 0118 Q_DISABLE_COPY(RSSVocab) 0119 class RSSVocabPrivate; 0120 std::unique_ptr<RSSVocabPrivate> const d; 0121 }; 0122 0123 /** 0124 * Singleton holding RDF class and property constants of the RSS 0.9 0125 * vocabulary. Only used to map RSS 0.9 to 1.0. 0126 * 0127 * @author Frank Osterfeld 0128 */ 0129 0130 class SYNDICATION_EXPORT RSS09Vocab 0131 { 0132 public: 0133 /** 0134 * destructor 0135 */ 0136 ~RSS09Vocab(); 0137 0138 /** 0139 * returns the singleton instance 0140 */ 0141 static RSS09Vocab *self(); 0142 0143 /** 0144 * namespace URI of the RSS 0.9 vocabulary, 0145 * @c "http://web.resource.org/rss/0.9/" 0146 */ 0147 const QString &namespaceURI() const; 0148 0149 /** 0150 * RSS 0.9 title property, see Document::title() for 0151 * more details 0152 */ 0153 PropertyPtr title() const; 0154 0155 /** 0156 * RSS 0.9 description property, see Document::description() for 0157 * more details 0158 */ 0159 PropertyPtr description() const; 0160 0161 /** 0162 * RSS 0.9 link property, see Document::link() for 0163 * more details 0164 */ 0165 PropertyPtr link() const; 0166 0167 /** 0168 * RSS 0.9 name property, see Document::name() for 0169 * more details 0170 */ 0171 PropertyPtr name() const; 0172 0173 /** 0174 * RSS 0.9 url property, see Document::url() for 0175 * more details 0176 */ 0177 PropertyPtr url() const; 0178 0179 /** 0180 * RSS 0.9 channel class, the instance is represented by 0181 * Syndication::RDF::Document 0182 */ 0183 ResourcePtr channel() const; 0184 0185 /** 0186 * RSS 0.9 item class, see Document::items() for 0187 * more details 0188 */ 0189 ResourcePtr item() const; 0190 0191 /** 0192 * RSS 0.9 image property, see Document::image() for 0193 * more details 0194 */ 0195 PropertyPtr image() const; 0196 0197 /** 0198 * RSS 0.9 textinput property, see Document::textinput() for 0199 * more details 0200 */ 0201 PropertyPtr textinput() const; 0202 0203 /** 0204 * returns a list containing all URIs representing properties in this vocabulary 0205 */ 0206 QStringList properties() const; 0207 0208 /** 0209 * returns a list containing all URIs representing classes in this vocabulary 0210 */ 0211 QStringList classes() const; 0212 0213 private: 0214 RSS09Vocab(); 0215 Q_DISABLE_COPY(RSS09Vocab) 0216 class RSS09VocabPrivate; 0217 std::unique_ptr<RSS09VocabPrivate> const d; 0218 }; 0219 0220 } // namespace RDF 0221 } // namespace Syndication 0222 0223 #endif // SYNDICATION_RDF_RSSVOCAB_H