File indexing completed on 2024-04-14 03:58:29

0001 /*
0002     This file is part of the syndication library
0003     SPDX-FileCopyrightText: 2005 Frank Osterfeld <osterfeld@kde.org>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 
0008 #ifndef SYNDICATION_RSS2_SOURCE_H
0009 #define SYNDICATION_RSS2_SOURCE_H
0010 
0011 #include <syndication/elementwrapper.h>
0012 
0013 class QDomElement;
0014 class QString;
0015 
0016 namespace Syndication
0017 {
0018 namespace RSS2
0019 {
0020 /**
0021  * Class representing the @c &lt;source&gt; element in RSS2.
0022  * "The purpose of this element is to propagate credit for links, to publicize
0023  * the sources of news items. It's used in the post command in the Radio
0024  * UserLand aggregator. It should be generated automatically when forwarding an
0025  * item from an aggregator to a weblog authoring tool."
0026  *
0027  * @author Frank Osterfeld
0028  */
0029 class Source : public ElementWrapper
0030 {
0031 public:
0032     /**
0033      * Default constructor, creates a null object, for which isNull() is
0034      * @c true.
0035      */
0036     Source();
0037 
0038     /**
0039      * Creates a source object wrapping a @c &lt;source&gt; XML element.
0040      *
0041      * @param element The @c &lt;source&gt; element to wrap
0042      */
0043     explicit Source(const QDomElement &element);
0044 
0045     /**
0046      * The name of the RSS channel that the item came from, derived from
0047      * its &lt;title>. Example: "Tomalak's Realm"
0048      *
0049      * @return A string containing the source, or a null string if not set
0050      * (and for null objects)
0051      */
0052     QString source() const;
0053 
0054     /**
0055      * Required attribute, links to the XMLization of the source.
0056      *
0057      * @return A URL, or a null string if not set (though required from
0058      * the spec), and for null objects
0059      */
0060     QString url() const;
0061 
0062     /**
0063      * Returns a description of the object for debugging purposes.
0064      *
0065      * @return debug string
0066      */
0067     QString debugInfo() const;
0068 };
0069 
0070 } // namespace RSS2
0071 } // namespace Syndication
0072 
0073 #endif // SYNDICATION_RSS2_SOURCE_H