akregator
articleformatter.cpp
Go to the documentation of this file.
103 text = QString("<div class=\"headerbox\" dir=\"%1\">\n").arg(QApplication::isRightToLeft() ? "rtl" : "ltr");
105 text += QString("<div class=\"headertitle\" dir=\"%1\">").arg(Utils::directionOf(strippedTitle));
120 text += QString("<a href=\"%1\"><img class=\"headimage\" src=\"%2.png\"></a>\n").arg(node->htmlUrl(), u.url());
127 text += QString("<div dir=\"%1\">").arg(Utils::stripTags(Utils::directionOf(node->description())));
147 text = QString("<div class=\"headerbox\" dir=\"%1\">\n").arg(QApplication::isRightToLeft() ? "rtl" : "ltr");
148 text += QString("<div class=\"headertitle\" dir=\"%1\">%2").arg(Utils::directionOf(Utils::stripTags(node->title())), node->title());
170 QString DefaultNormalViewFormatter::formatArticle(const Article& article, IconOption icon) const
173 text = QString("<div class=\"headerbox\" dir=\"%1\">\n").arg(QApplication::isRightToLeft() ? "rtl" : "ltr");
179 text += QString("<div class=\"headertitle\" dir=\"%1\">\n").arg(Utils::directionOf(strippedTitle));
192 text += KGlobal::locale()->formatDateTime(article.pubDate(), KLocale::FancyLongDate) +"</span>\n"; // TODO: might need RTL?
197 text += QString("<br/><span class=\"header\" dir=\"%1\">").arg(Utils::directionOf(i18n("Author")));
205 text += QString("<br/><span class=\"header\" dir=\"%1\">").arg(Utils::directionOf(i18n("Enclosure")));
220 text += QString("<a href=\"%1\"><img class=\"headimage\" src=\"%2.png\"></a>\n").arg(feed->htmlUrl(), u.url());
300 css += QString(".headertitle a:link { color: %1 ! important;\n text-decoration: none ! important;\n }\n"
335 // these rules make sure that there is no leading space between the header and the first of the text
349 DefaultCombinedViewFormatter::DefaultCombinedViewFormatter(const KUrl& imageDir, QPaintDevice* device ) : ArticleFormatter( device ), m_imageDir(imageDir)
353 DefaultNormalViewFormatter::DefaultNormalViewFormatter(const KUrl& imageDir, QPaintDevice* device )
365 QString DefaultCombinedViewFormatter::formatArticle(const Article& article, IconOption icon) const
369 text = QString("<div class=\"headerbox\" dir=\"%1\">\n").arg(QApplication::isRightToLeft() ? "rtl" : "ltr");
375 text += QString("<div class=\"headertitle\" dir=\"%1\">\n").arg(Utils::directionOf(strippedTitle));
388 text += KGlobal::locale()->formatDateTime(article.pubDate(), KLocale::FancyLongDate) + "</span>\n"; // TODO: might need RTL?
394 text += QString("<br/><span class=\"header\" dir=\"%1\">").arg(Utils::directionOf(i18n("Author")));
402 text += QString("<br/><span class=\"header\" dir=\"%1\">").arg(Utils::directionOf(i18n("Enclosure")));
416 text += QString("<a href=\"%1\"><img class=\"headimage\" src=\"%2.png\"></a>\n").arg(feed->htmlUrl(), u.url());
499 css += QString(".headertitle a:link { color: %1 ! important; text-decoration: none ! important;\n }\n"
533 // these rules make sure that there is no leading space between the header and the first of the text
static QString stripTags(const QString &str)
removes HTML/XML tags (everything between < and >) from a string.
Definition: utils.cpp:31
bool isRightToLeft()
QString name() const
static QString fileNameForUrl(const QString &url)
returns a file name for a URL, with chars like "/" ":" replaced by "_".
Definition: utils.cpp:42
const QColor & color(ColorGroup group, ColorRole role) const
~DefaultNormalViewFormatter()
Definition: articleformatter.cpp:360
QString getCss() const
Definition: articleformatter.cpp:466
bool isNull() const
void clear()
QString formatArticle(const Article &article, IconOption option) const
Definition: articleformatter.cpp:365
QString number(int n, int base)
QString content(ContentOption opt=ContentAndOnlyContent) const
Definition: article.cpp:457
bool isEmpty() const
QString xmlUrl() const
returns the url of the actual feed source (rss/rdf/atom file)
Definition: feed.cpp:372
QString formatSummary(TreeNode *node) const
Definition: articleformatter.cpp:551
QPalette palette()
QString formatSummary(TreeNode *node) const
Definition: articleformatter.cpp:546
bool isNull() const
bool isValid() const
QString getCss() const
Definition: articleformatter.cpp:268
void setPaintDevice(QPaintDevice *device)
Definition: articleformatter.cpp:87
Definition: treenodevisitor.h:35
Represents a folder (containing feeds and/or other folders)
Definition: folder.h:44
virtual ~ArticleFormatter()
Definition: articleformatter.cpp:82
boost::shared_ptr< const Syndication::Enclosure > enclosure() const
Definition: article.cpp:516
int pointsToPixel(int pointSize) const
Definition: articleformatter.cpp:92
A proxy class for Syndication::ItemPtr with some additional methods to assist sorting.
Definition: article.h:63
Definition: articleformatter.h:38
Abstract base class for all kind of elements in the feed tree, like feeds and feed groups (and search...
Definition: treenode.h:58
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const
QString formatArticle(const Article &article, IconOption option) const
Definition: articleformatter.cpp:170
ArticleFormatter(QPaintDevice *device=0)
Definition: articleformatter.cpp:78
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:34:00 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:34:00 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.