File indexing completed on 2024-04-28 15:34:25

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