1 | /* |
2 | This file is part of the syndication library |
3 | SPDX-FileCopyrightText: 2006 Frank Osterfeld <osterfeld@kde.org> |
4 | |
5 | SPDX-License-Identifier: LGPL-2.0-or-later |
6 | */ |
7 | |
8 | #ifndef SYNDICATION_ATOM_SOURCE_H |
9 | #define SYNDICATION_ATOM_SOURCE_H |
10 | |
11 | #include <syndication/elementwrapper.h> |
12 | |
13 | #include <ctime> |
14 | |
15 | class QDomElement; |
16 | class QString; |
17 | |
18 | template<class T> |
19 | class QList; |
20 | |
21 | namespace Syndication |
22 | { |
23 | namespace Atom |
24 | { |
25 | class Category; |
26 | class Generator; |
27 | class Link; |
28 | class Person; |
29 | |
30 | /** |
31 | * If an entry was copied from another feed, this class contains |
32 | * a description of the source feed. |
33 | * |
34 | * @author Frank Osterfeld |
35 | */ |
36 | class SYNDICATION_EXPORT Source : public ElementWrapper |
37 | { |
38 | public: |
39 | /** |
40 | * creates a null source object |
41 | */ |
42 | Source(); |
43 | |
44 | /** |
45 | * creates a Source object wrapping a atom:source element. |
46 | * |
47 | * @param element a DOM element, should be a atom:source element |
48 | * (although not enforced), otherwise this object will not parse |
49 | * anything useful |
50 | */ |
51 | explicit Source(const QDomElement &element); |
52 | |
53 | /** |
54 | * authors of the original content (optional) |
55 | */ |
56 | Q_REQUIRED_RESULT QList<Person> authors() const; |
57 | |
58 | /** |
59 | * contributors to the original content (optional) |
60 | */ |
61 | Q_REQUIRED_RESULT QList<Person> contributors() const; |
62 | |
63 | /** |
64 | * categories the source feed is assigned to (optional) |
65 | */ |
66 | Q_REQUIRED_RESULT QList<Category> categories() const; |
67 | |
68 | /** |
69 | * description of the software which generated the source feed |
70 | * (optional) |
71 | */ |
72 | Q_REQUIRED_RESULT Generator generator() const; |
73 | |
74 | /** |
75 | * URL of an image serving as a feed icon (optional) |
76 | * |
77 | * @return icon URL, or a null string if not specified |
78 | */ |
79 | Q_REQUIRED_RESULT QString icon() const; |
80 | |
81 | /** |
82 | * a string that unambiguously identifies the source feed (optional) |
83 | * |
84 | * @return the ID of the source feed, or a null string if not |
85 | * specified. |
86 | */ |
87 | Q_REQUIRED_RESULT QString id() const; |
88 | |
89 | /** |
90 | * a list of links. See Link for more information on |
91 | * link types. |
92 | */ |
93 | Q_REQUIRED_RESULT QList<Link> links() const; |
94 | |
95 | /** |
96 | * URL of an image, the logo of the source feed (optional) |
97 | * |
98 | * @return image URL, or a null string if not specified in the feed. |
99 | */ |
100 | Q_REQUIRED_RESULT QString logo() const; |
101 | |
102 | /** |
103 | * copyright information (optional) |
104 | * |
105 | * @return copyright information for the source, |
106 | * or a null string if not specified |
107 | */ |
108 | Q_REQUIRED_RESULT QString rights() const; |
109 | |
110 | /** |
111 | * description or subtitle of the source feed (optional). |
112 | * |
113 | * @return subtitle string as HTML, or a null string |
114 | * if not specified. |
115 | */ |
116 | Q_REQUIRED_RESULT QString subtitle() const; |
117 | |
118 | /** |
119 | * source feed title (optional). |
120 | * |
121 | * @return title string as HTML, or a null string if not specified |
122 | */ |
123 | Q_REQUIRED_RESULT QString title() const; |
124 | |
125 | /** |
126 | * The datetime of the last modification of the source feed |
127 | * content. (optional) |
128 | * |
129 | * @return the modification date in seconds since epoch |
130 | */ |
131 | Q_REQUIRED_RESULT time_t updated() const; |
132 | |
133 | /** |
134 | * description of this source object for debugging purposes |
135 | * |
136 | * @return debug string |
137 | */ |
138 | Q_REQUIRED_RESULT QString debugInfo() const; |
139 | }; |
140 | |
141 | } // namespace Atom |
142 | } // namespace Syndication |
143 | |
144 | #endif // SYNDICATION_ATOM_SOURCE_H |
145 | |