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