1 | /* |
2 | This file is part of the syndication library |
3 | SPDX-FileCopyrightText: 2005 Frank Osterfeld <osterfeld@kde.org> |
4 | |
5 | SPDX-License-Identifier: LGPL-2.0-or-later |
6 | */ |
7 | |
8 | #ifndef SYNDICATION_RSS2_SOURCE_H |
9 | #define |
10 | |
11 | #include <syndication/elementwrapper.h> |
12 | |
13 | class QDomElement; |
14 | class QString; |
15 | |
16 | namespace Syndication |
17 | { |
18 | namespace RSS2 |
19 | { |
20 | /** |
21 | * Class representing the @c <source> element in RSS2. |
22 | * "The purpose of this element is to propagate credit for links, to publicize |
23 | * the sources of news items. It's used in the post command in the Radio |
24 | * UserLand aggregator. It should be generated automatically when forwarding an |
25 | * item from an aggregator to a weblog authoring tool." |
26 | * |
27 | * @author Frank Osterfeld |
28 | */ |
29 | class : public ElementWrapper |
30 | { |
31 | public: |
32 | /** |
33 | * Default constructor, creates a null object, for which isNull() is |
34 | * @c true. |
35 | */ |
36 | (); |
37 | |
38 | /** |
39 | * Creates a source object wrapping a @c <source> XML element. |
40 | * |
41 | * @param element The @c <source> element to wrap |
42 | */ |
43 | explicit (const QDomElement &element); |
44 | |
45 | /** |
46 | * The name of the RSS channel that the item came from, derived from |
47 | * its <title>. Example: "Tomalak's Realm" |
48 | * |
49 | * @return A string containing the source, or a null string if not set |
50 | * (and for null objects) |
51 | */ |
52 | QString () const; |
53 | |
54 | /** |
55 | * Required attribute, links to the XMLization of the source. |
56 | * |
57 | * @return A URL, or a null string if not set (though required from |
58 | * the spec), and for null objects |
59 | */ |
60 | QString () const; |
61 | |
62 | /** |
63 | * Returns a description of the object for debugging purposes. |
64 | * |
65 | * @return debug string |
66 | */ |
67 | QString () const; |
68 | }; |
69 | |
70 | } // namespace RSS2 |
71 | } // namespace Syndication |
72 | |
73 | #endif // SYNDICATION_RSS2_SOURCE_H |
74 | |