00001
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 TQDateTime;
00030 class TQDomDocument;
00031 class TQDomElement;
00032 class TQString;
00033 class TQStringList;
00034 class TQWidget;
00035
00036 template <class T> class TQValueList;
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 TQValueList<Article> List;
00062
00063 Article();
00067 Article(const TQString& 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 TQString title() const;
00088 KURL link() const;
00089
00090 TQString author() const;
00091
00092 TQString description() const;
00093 TQString 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 TQDateTime& pubDate() const;
00117
00118 KURL commentsLink() const;
00119
00120 int comments() const;
00121
00122 void addTag(const TQString& tag);
00123 void removeTag(const TQString& tag);
00124 bool hasTag(const TQString& tag) const;
00125 TQStringList 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 TQString buildTitle(const TQString& description);
00136
00137 int statusBits() const;
00138
00139
00140
00141
00142 struct Private;
00143 Private *d;
00144 };
00145 }
00146
00147 #endif