| 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_PERSON_H |
| 9 | #define SYNDICATION_ATOM_PERSON_H |
| 10 | |
| 11 | #include <syndication/elementwrapper.h> |
| 12 | |
| 13 | class QDomElement; |
| 14 | class QString; |
| 15 | |
| 16 | namespace Syndication |
| 17 | { |
| 18 | namespace Atom |
| 19 | { |
| 20 | /*! |
| 21 | * \class Syndication::Atom::Person |
| 22 | * \inmodule Syndication |
| 23 | * \inheaderfile Syndication/Atom/Person |
| 24 | * |
| 25 | * \brief describes a person, with name and optional URI and e-mail address. |
| 26 | * Used to describe authors and contributors of feeds/entries. |
| 27 | */ |
| 28 | class SYNDICATION_EXPORT Person : public ElementWrapper |
| 29 | { |
| 30 | public: |
| 31 | /*! |
| 32 | * creates a null person object |
| 33 | */ |
| 34 | Person(); |
| 35 | |
| 36 | /*! |
| 37 | * creates a Person object wrapping an Atom Person Construct (atom:author, |
| 38 | * atom:contributor tags) |
| 39 | * |
| 40 | * \a element a DOM element, should be a Atom Person Construct |
| 41 | * (although not enforced), otherwise this object will not parse |
| 42 | * anything useful |
| 43 | */ |
| 44 | explicit Person(const QDomElement &element); |
| 45 | |
| 46 | /*! |
| 47 | * a human-readable name for the person. (required) |
| 48 | * The name is a required attribute of person constructs. |
| 49 | * |
| 50 | * Returns a human-readable name of the person |
| 51 | */ |
| 52 | Q_REQUIRED_RESULT QString name() const; |
| 53 | |
| 54 | /*! |
| 55 | * A URI associated with the person (optional). Usually the homepage. |
| 56 | * |
| 57 | * Returns the URI of the person, or a null string if not specified |
| 58 | */ |
| 59 | Q_REQUIRED_RESULT QString uri() const; |
| 60 | |
| 61 | /*! |
| 62 | * returns an e-mail address associated with the person. (optional) |
| 63 | * |
| 64 | * Returns an e-mail address, or a null string if not specified |
| 65 | */ |
| 66 | Q_REQUIRED_RESULT QString email() const; |
| 67 | |
| 68 | /*! |
| 69 | * description for debugging purposes |
| 70 | * |
| 71 | * Returns debug string |
| 72 | */ |
| 73 | Q_REQUIRED_RESULT QString debugInfo() const; |
| 74 | }; |
| 75 | |
| 76 | } // namespace Atom |
| 77 | } // namespace Syndication |
| 78 | |
| 79 | #endif // SYNDICATION_ATOM_PERSON_H |
| 80 | |