akregator/src
article.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef AKREGATOR_ARTICLE_H
00027 #define AKREGATOR_ARTICLE_H
00028
00029 class QDateTime;
00030 class QDomDocument;
00031 class QDomElement;
00032 class QString;
00033 class QStringList;
00034 class QWidget;
00035
00036 template <class T> class QValueList;
00037
00038 typedef unsigned int uint;
00039
00040 class KURL;
00041 class KURLLabel;
00042
00043 namespace RSS
00044 {
00045 class Article;
00046 class Enclosure;
00047 }
00048
00049 namespace Akregator
00050 {
00051 namespace Backend
00052 {
00053 class FeedStorage;
00054 }
00055 class Feed;
00057 class Article
00058 {
00059 public:
00060 enum Status { Unread=0, Read, New };
00061 typedef QValueList<Article> List;
00062
00063 Article();
00067 Article(const QString& guid, Feed* feed);
00071 Article(RSS::Article article, Feed* feed);
00072
00073 Article(RSS::Article article, Backend::FeedStorage* archive);
00074 Article(const Article &other);
00075 Article &operator=(const Article &other);
00076 bool operator==(const Article &other) const;
00077 bool operator!=(const Article &other) const { return !operator==(other); }
00078 virtual ~Article();
00079
00080 bool isNull() const;
00081
00082 int status() const;
00083 void setStatus(int s);
00084
00085 void offsetPubDate(int secs);
00086
00087 QString title() const;
00088 KURL link() const;
00089
00090 QString author() const;
00091
00092 QString description() const;
00093 QString guid() const;
00095 bool keep() const;
00096 void setKeep(bool keep);
00097 bool isDeleted() const;
00098
00099 RSS::Enclosure enclosure() const;
00100
00101 void setDeleted();
00102
00103
00104 Feed* feed() const;
00105
00108 uint hash() const;
00109
00112 bool guidIsHash() const;
00113
00114 bool guidIsPermaLink() const;
00115
00116 const QDateTime& pubDate() const;
00117
00118 KURL commentsLink() const;
00119
00120 int comments() const;
00121
00122 void addTag(const QString& tag);
00123 void removeTag(const QString& tag);
00124 bool hasTag(const QString& tag) const;
00125 QStringList tags() const;
00126
00127 bool operator<(const Article &other) const;
00128 bool operator<=(const Article &other) const;
00129 bool operator>(const Article &other) const;
00130 bool operator>=(const Article &other) const;
00131
00132
00133 private:
00134 void initialize(RSS::Article article, Backend::FeedStorage* archive);
00135 static QString buildTitle(const QString& description);
00136
00137 struct Private;
00138 Private *d;
00139 };
00140 }
00141
00142 #endif
|