Syndication

atom/source.h
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
15class QDomElement;
16class QString;
17
18template<class T>
19class QList;
20
21namespace Syndication
22{
23namespace Atom
24{
25class Category;
26class Generator;
27class Link;
28class 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 */
36class SYNDICATION_EXPORT Source : public ElementWrapper
37{
38public:
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
A category for categorizing items or whole feeds.
Description of the agent used to generate the feed.
Definition generator.h:26
describes a person, with name and optional URI and e-mail address.
Definition atom/person.h:27
time_t updated() const
The datetime of the last modification of the source feed content.
QList< Person > contributors() const
contributors to the original content (optional)
QString id() const
a string that unambiguously identifies the source feed (optional)
QString title() const
source feed title (optional).
QList< Person > authors() const
authors of the original content (optional)
QString debugInfo() const
description of this source object for debugging purposes
QString subtitle() const
description or subtitle of the source feed (optional).
QString rights() const
copyright information (optional)
QString icon() const
URL of an image serving as a feed icon (optional)
Source()
creates a null source object
Generator generator() const
description of the software which generated the source feed (optional)
QString logo() const
URL of an image, the logo of the source feed (optional)
QList< Category > categories() const
categories the source feed is assigned to (optional)
QList< Link > links() const
a list of links.
const QDomElement & element() const
returns the wrapped resource.
ElementWrapper()
creates a element wrapper wrapping a null element.
Atom parser and model classes, representing Atom 1.0 documents (Atom 0.3 documents are converted by t...
Definition atom.h:30
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:48:38 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.