1 | /* |
2 | * This file is part of the syndication library |
3 | * |
4 | * Copyright (C) 2006 Frank Osterfeld <osterfeld@kde.org> |
5 | * |
6 | * This library is free software; you can redistribute it and/or |
7 | * modify it under the terms of the GNU Library General Public |
8 | * License as published by the Free Software Foundation; either |
9 | * version 2 of the License, or (at your option) any later version. |
10 | * |
11 | * This library is distributed in the hope that it will be useful, |
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14 | * Library General Public License for more details. |
15 | * |
16 | * You should have received a copy of the GNU Library General Public License |
17 | * along with this library; see the file COPYING.LIB. If not, write to |
18 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
19 | * Boston, MA 02110-1301, USA. |
20 | * |
21 | */ |
22 | |
23 | #ifndef SYNDICATION_PERSON_H |
24 | #define SYNDICATION_PERSON_H |
25 | |
26 | #include <QtCore/QString> |
27 | #include <boost/shared_ptr.hpp> |
28 | |
29 | #include "ksyndication_export.h" |
30 | |
31 | namespace Syndication { |
32 | |
33 | class Person; |
34 | |
35 | //@cond PRIVATE |
36 | typedef boost::shared_ptr<Person> PersonPtr; |
37 | //@endcond |
38 | |
39 | /** |
40 | * Person objects hold information about a person, such as the author of |
41 | * the content syndicated in the feed. Depending on the feed format, different |
42 | * information is available. |
43 | * While according to the RSS2 spec, RSS2 author elements must contain only an |
44 | * e-mail address, Atom requires the person's name and the e-mail address is |
45 | * optional. Also, in reality, feeds often contain other information than what |
46 | * is specified in the specs. Syndication tries to find out what author |
47 | * information is contained and maps it to this representation. |
48 | * |
49 | * @author Frank Osterfeld |
50 | */ |
51 | class SYNDICATION_EXPORT Person |
52 | { |
53 | public: |
54 | |
55 | /** |
56 | * destructor |
57 | */ |
58 | virtual ~Person(); |
59 | |
60 | /** |
61 | * returns whether this object is a null person |
62 | */ |
63 | virtual bool isNull() const = 0; |
64 | |
65 | /** |
66 | * the name of the person (optional) |
67 | * |
68 | * @return the name of the person as plain text, |
69 | * or a null string if not specified |
70 | */ |
71 | virtual QString name() const = 0; |
72 | |
73 | /** |
74 | * a URI associated with the person. (optional) |
75 | * This is usually the URL of the |
76 | * person's homepage. |
77 | * |
78 | * @return URI of the person, or a null string if not specified |
79 | */ |
80 | virtual QString uri() const = 0; |
81 | |
82 | /** |
83 | * e-mail address of the person (optional) |
84 | * |
85 | * @return email address, or a null string if not specified |
86 | */ |
87 | virtual QString email() const = 0; |
88 | |
89 | /** |
90 | * description of the person for debugging purposes. |
91 | * |
92 | * @return debug string |
93 | */ |
94 | virtual QString debugInfo() const; |
95 | |
96 | /** |
97 | * compares two person instances. Persons are equal if and only if |
98 | * their respective name(), uri() and email() values are equal. |
99 | * @param other another person instance |
100 | */ |
101 | virtual bool operator==(const Person& other) const; |
102 | }; |
103 | |
104 | } // namespace Syndication |
105 | |
106 | #endif // SYNDICATION_PERSON_H |
107 | |