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_PERSON_H
9#define SYNDICATION_PERSON_H
10
11#include <QSharedPointer>
12#include <QString>
13
14#include "syndication_export.h"
15
16namespace Syndication
17{
18class Person;
19
20typedef QSharedPointer<Person> PersonPtr;
21
22/*!
23 * \class Syndication::Person
24 * \inmodule Syndication
25 * \inheaderfile Syndication/Person
26 *
27 * \brief Person objects hold information about a person, such as the author of
28 * the content syndicated in the feed.
29 *
30 * Depending on the feed format, different
31 * information is available.
32 *
33 * While according to the RSS2 spec, RSS2 author elements must contain only an
34 * e-mail address, Atom requires the person's name and the e-mail address is
35 * optional. Also, in reality, feeds often contain other information than what
36 * is specified in the specs. Syndication tries to find out what author
37 * information is contained and maps it to this representation.
38 */
39class SYNDICATION_EXPORT Person
40{
41public:
42 virtual ~Person();
43
44 /*!
45 * returns whether this object is a null person
46 */
47 virtual bool isNull() const = 0;
48
49 /*!
50 * Returns the name of the person as plain text,
51 * or a null string if not specified
52 */
53 virtual QString name() const = 0;
54
55 /*!
56 * a URI associated with the person. (optional)
57 * This is usually the URL of the
58 * person's homepage.
59 */
60 virtual QString uri() const = 0;
61
62 /*!
63 * e-mail address of the person (optional)
64 */
65 virtual QString email() const = 0;
66
67 /*!
68 * description of the person for debugging purposes.
69 */
70 virtual QString debugInfo() const;
71
72 /*!
73 * compares two person instances. Persons are equal if and only if
74 * their respective name(), uri() and email() values are equal.
75 *
76 * \a other another person instance
77 */
78 virtual bool operator==(const Person &other) const;
79};
80
81} // namespace Syndication
82
83#endif // SYNDICATION_PERSON_H
84

source code of syndication/src/person.h