| 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 | * \class Syndication::Atom::Source |
| 32 | * \inmodule Syndication |
| 33 | * \inheaderfile Syndication/Atom/Source |
| 34 | * |
| 35 | * \brief If an entry was copied from another feed, this class contains |
| 36 | * a description of the source feed. |
| 37 | */ |
| 38 | class SYNDICATION_EXPORT Source : public ElementWrapper |
| 39 | { |
| 40 | public: |
| 41 | /*! |
| 42 | * creates a null source object |
| 43 | */ |
| 44 | Source(); |
| 45 | |
| 46 | /*! |
| 47 | * creates a Source object wrapping a atom:source element. |
| 48 | * |
| 49 | * \a element a DOM element, should be a atom:source element |
| 50 | * (although not enforced), otherwise this object will not parse |
| 51 | * anything useful |
| 52 | */ |
| 53 | explicit Source(const QDomElement &element); |
| 54 | |
| 55 | /*! |
| 56 | * authors of the original content (optional) |
| 57 | */ |
| 58 | Q_REQUIRED_RESULT QList<Person> authors() const; |
| 59 | |
| 60 | /*! |
| 61 | * contributors to the original content (optional) |
| 62 | */ |
| 63 | Q_REQUIRED_RESULT QList<Person> contributors() const; |
| 64 | |
| 65 | /*! |
| 66 | * categories the source feed is assigned to (optional) |
| 67 | */ |
| 68 | Q_REQUIRED_RESULT QList<Category> categories() const; |
| 69 | |
| 70 | /*! |
| 71 | * description of the software which generated the source feed |
| 72 | * (optional) |
| 73 | */ |
| 74 | Q_REQUIRED_RESULT Generator generator() const; |
| 75 | |
| 76 | /*! |
| 77 | * URL of an image serving as a feed icon (optional) |
| 78 | * |
| 79 | * Returns icon URL, or a null string if not specified |
| 80 | */ |
| 81 | Q_REQUIRED_RESULT QString icon() const; |
| 82 | |
| 83 | /*! |
| 84 | * a string that unambiguously identifies the source feed (optional) |
| 85 | * |
| 86 | * Returns the ID of the source feed, or a null string if not |
| 87 | * specified. |
| 88 | */ |
| 89 | Q_REQUIRED_RESULT QString id() const; |
| 90 | |
| 91 | /*! |
| 92 | * a list of links. See Link for more information on |
| 93 | * link types. |
| 94 | */ |
| 95 | Q_REQUIRED_RESULT QList<Link> links() const; |
| 96 | |
| 97 | /*! |
| 98 | * URL of an image, the logo of the source feed (optional) |
| 99 | * |
| 100 | * Returns image URL, or a null string if not specified in the feed. |
| 101 | */ |
| 102 | Q_REQUIRED_RESULT QString logo() const; |
| 103 | |
| 104 | /*! |
| 105 | * copyright information (optional) |
| 106 | * |
| 107 | * Returns copyright information for the source, |
| 108 | * or a null string if not specified |
| 109 | */ |
| 110 | Q_REQUIRED_RESULT QString rights() const; |
| 111 | |
| 112 | /*! |
| 113 | * description or subtitle of the source feed (optional). |
| 114 | * |
| 115 | * Returns subtitle string as HTML, or a null string |
| 116 | * if not specified. |
| 117 | */ |
| 118 | Q_REQUIRED_RESULT QString subtitle() const; |
| 119 | |
| 120 | /*! |
| 121 | * source feed title (optional). |
| 122 | * |
| 123 | * Returns title string as HTML, or a null string if not specified |
| 124 | */ |
| 125 | Q_REQUIRED_RESULT QString title() const; |
| 126 | |
| 127 | /*! |
| 128 | * The datetime of the last modification of the source feed |
| 129 | * content. (optional) |
| 130 | * |
| 131 | * Returns the modification date in seconds since epoch |
| 132 | */ |
| 133 | Q_REQUIRED_RESULT time_t updated() const; |
| 134 | |
| 135 | /*! |
| 136 | * description of this source object for debugging purposes |
| 137 | * |
| 138 | * Returns debug string |
| 139 | */ |
| 140 | Q_REQUIRED_RESULT QString debugInfo() const; |
| 141 | }; |
| 142 | |
| 143 | } // namespace Atom |
| 144 | } // namespace Syndication |
| 145 | |
| 146 | #endif // SYNDICATION_ATOM_SOURCE_H |
| 147 | |