File indexing completed on 2024-10-13 09:40:30

0001 /*
0002     This file is part of the syndication library
0003     SPDX-FileCopyrightText: 2006 Frank Osterfeld <osterfeld@kde.org>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 
0008 #ifndef SYNDICATION_PERSON_H
0009 #define SYNDICATION_PERSON_H
0010 
0011 #include <QSharedPointer>
0012 #include <QString>
0013 
0014 #include "syndication_export.h"
0015 
0016 namespace Syndication
0017 {
0018 class Person;
0019 
0020 //@cond PRIVATE
0021 typedef QSharedPointer<Person> PersonPtr;
0022 //@endcond
0023 
0024 /**
0025  * Person objects hold information about a person, such as the author of
0026  * the content syndicated in the feed. Depending on the feed format, different
0027  * information is available.
0028  * While according to the RSS2 spec, RSS2 author elements must contain only an
0029  * e-mail address, Atom requires the person's name and the e-mail address is
0030  * optional. Also, in reality, feeds often contain other information than what
0031  * is specified in the specs. Syndication tries to find out what author
0032  * information is contained and maps it to this representation.
0033  *
0034  * @author Frank Osterfeld
0035  */
0036 class SYNDICATION_EXPORT Person
0037 {
0038 public:
0039     /**
0040      * destructor
0041      */
0042     virtual ~Person();
0043 
0044     /**
0045      * returns whether this object is a null person
0046      */
0047     virtual bool isNull() const = 0;
0048 
0049     /**
0050      * the name of the person (optional)
0051      *
0052      * @return the name of the person as plain text,
0053      * or a null string if not specified
0054      */
0055     virtual QString name() const = 0;
0056 
0057     /**
0058      * a URI associated with the person. (optional)
0059      * This is usually the URL of the
0060      * person's homepage.
0061      *
0062      * @return URI of the person, or a null string if not specified
0063      */
0064     virtual QString uri() const = 0;
0065 
0066     /**
0067      * e-mail address of the person (optional)
0068      *
0069      * @return email address, or a null string if not specified
0070      */
0071     virtual QString email() const = 0;
0072 
0073     /**
0074      * description of the person for debugging purposes.
0075      *
0076      * @return debug string
0077      */
0078     virtual QString debugInfo() const;
0079 
0080     /**
0081      * compares two person instances. Persons are equal if and only if
0082      * their respective name(), uri() and email() values are equal.
0083      * @param other another person instance
0084      */
0085     virtual bool operator==(const Person &other) const;
0086 };
0087 
0088 } // namespace Syndication
0089 
0090 #endif // SYNDICATION_PERSON_H