akregator
article.h
Go to the documentation of this file.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 #include "akregator_export.h"
00030 #include "types.h"
00031
00032 #include <syndication/person.h>
00033
00034 #include <boost/shared_ptr.hpp>
00035
00036 class QDateTime;
00037 class QString;
00038
00039 template <class T> class QList;
00040
00041 typedef unsigned int uint;
00042
00043 class KUrl;
00044
00045 namespace Syndication
00046 {
00047 class Item;
00048 typedef boost::shared_ptr<Item> ItemPtr;
00049 }
00050
00051 namespace Akregator {
00052
00053 namespace Backend
00054 {
00055 class FeedStorage;
00056 }
00057 class Feed;
00059 class AKREGATORPART_EXPORT Article
00060 {
00061 friend class ArticleDeleteJob;
00062 friend class ArticleModifyJob;
00063 friend class Feed;
00064
00065 public:
00066 enum ContentOption {
00067 ContentAndOnlyContent,
00068 DescriptionAsFallback
00069 };
00070
00071 Article();
00075 Article(const QString& guid, Feed* feed);
00079 Article(const Syndication::ItemPtr& article, Feed* feed);
00080
00081 Article(const Syndication::ItemPtr& article, Backend::FeedStorage* archive);
00082 Article(const Article &other);
00083 ~Article();
00084
00085 void swap( Article & other ) {
00086 std::swap( d, other.d );
00087 }
00088
00089 Article &operator=(const Article &other);
00090 bool operator==(const Article &other) const;
00091 bool operator!=(const Article &other) const;
00092
00093
00094 bool isNull() const;
00095
00096 int status() const;
00097
00098 QString title() const;
00099 KUrl link() const;
00100 QString description() const;
00101
00102 QString content( ContentOption opt = ContentAndOnlyContent ) const;
00103
00104 QString guid() const;
00106 bool keep() const;
00107
00108 bool isDeleted() const;
00109
00110 void offsetPubDate(int secs);
00111
00112 Feed* feed() const;
00113
00116 uint hash() const;
00117
00120 bool guidIsHash() const;
00121
00122 bool guidIsPermaLink() const;
00123
00124 const QDateTime& pubDate() const;
00125
00126 KUrl commentsLink() const;
00127
00128 int comments() const;
00129
00130 QString authorName() const;
00131 QString authorUri() const;
00132 QString authorEMail() const;
00133 QString authorAsHtml() const;
00134 QString authorShort() const;
00135
00136 bool operator<(const Article &other) const;
00137 bool operator<=(const Article &other) const;
00138 bool operator>(const Article &other) const;
00139 bool operator>=(const Article &other) const;
00140
00141 private:
00142 void setStatus(int s);
00143 void setDeleted();
00144 void setKeep(bool keep);
00145
00146 private:
00147 struct Private;
00148 Private* d;
00149 };
00150
00151 }
00152
00153 #endif // AKREGATOR_ARTICLE_H