• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

akregator

  • sources
  • kde-4.12
  • kdepim
  • akregator
  • src
articleformatter.h
Go to the documentation of this file.
1 /*
2  This file is part of Akregator.
3 
4  Copyright (C) 2006 Frank Osterfeld <osterfeld@kde.org>
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program; if not, write to the Free Software
18  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 
20  As a special exception, permission is given to link this program
21  with any edition of Qt, and distribute the resulting executable,
22  without including the source code for Qt in the source distribution.
23 */
24 
25 #ifndef AKREGATOR_ARTICLEFORMATTER_H
26 #define AKREGATOR_ARTICLEFORMATTER_H
27 
28 #include <kurl.h>
29 
30 class QPaintDevice;
31 class QString;
32 
33 namespace Akregator {
34 
35 class Article;
36 class TreeNode;
37 
38 class ArticleFormatter
39 {
40  public:
41 
42  enum IconOption {
43  NoIcon,
44  ShowIcon
45  };
46 
47  explicit ArticleFormatter( QPaintDevice* device = 0 );
48 
49  virtual ~ArticleFormatter();
50 
51  void setPaintDevice(QPaintDevice* device);
52 
53  virtual QString formatArticle(const Article& article, IconOption icon) const = 0;
54 
55  virtual QString formatSummary(TreeNode* node) const = 0;
56 
57  virtual QString getCss() const = 0;
58 
59  protected:
60 
61  int pointsToPixel(int pointSize) const;
62 
63  private:
64  class Private;
65  Private* const d;
66  Q_DISABLE_COPY( ArticleFormatter )
67 };
68 
69 class DefaultNormalViewFormatter : public ArticleFormatter
70 {
71  public:
72 
73  explicit DefaultNormalViewFormatter( const KUrl& imageDir, QPaintDevice* device = 0 );
74  ~DefaultNormalViewFormatter();
75 
76  QString formatArticle(const Article& article, IconOption option) const;
77 
78  QString formatSummary(TreeNode* node) const;
79 
80  QString getCss() const;
81 
82  private:
83  DefaultNormalViewFormatter();
84 
85  KUrl m_imageDir;
86  class SummaryVisitor;
87  SummaryVisitor* m_summaryVisitor;
88 };
89 
90 class DefaultCombinedViewFormatter : public ArticleFormatter
91 {
92 
93  public:
94 
95  explicit DefaultCombinedViewFormatter( const KUrl& imageDir, QPaintDevice* device = 0 );
96 
97  QString formatArticle(const Article& article, IconOption option) const;
98 
99  QString formatSummary(TreeNode* node) const;
100 
101  QString getCss() const;
102 
103  private:
104  DefaultCombinedViewFormatter();
105 
106  KUrl m_imageDir;
107 };
108 
109 } // namespace Akregator
110 
111 #endif // AKREGATOR_ARTICLEFORMATTER_H
Akregator::ArticleFormatter::formatSummary
virtual QString formatSummary(TreeNode *node) const =0
Akregator::ArticleFormatter::ShowIcon
Definition: articleformatter.h:44
Akregator::DefaultNormalViewFormatter::~DefaultNormalViewFormatter
~DefaultNormalViewFormatter()
Definition: articleformatter.cpp:360
Akregator::DefaultCombinedViewFormatter::getCss
QString getCss() const
Definition: articleformatter.cpp:466
Akregator::ArticleFormatter::IconOption
IconOption
Definition: articleformatter.h:42
Akregator::DefaultCombinedViewFormatter::formatArticle
QString formatArticle(const Article &article, IconOption option) const
Definition: articleformatter.cpp:365
Akregator::DefaultCombinedViewFormatter::formatSummary
QString formatSummary(TreeNode *node) const
Definition: articleformatter.cpp:551
Akregator::DefaultNormalViewFormatter::formatSummary
QString formatSummary(TreeNode *node) const
Definition: articleformatter.cpp:546
Akregator::DefaultNormalViewFormatter::getCss
QString getCss() const
Definition: articleformatter.cpp:268
Akregator::ArticleFormatter::setPaintDevice
void setPaintDevice(QPaintDevice *device)
Definition: articleformatter.cpp:87
Akregator::ArticleFormatter::~ArticleFormatter
virtual ~ArticleFormatter()
Definition: articleformatter.cpp:82
Akregator::DefaultCombinedViewFormatter
Definition: articleformatter.h:90
Akregator::ArticleFormatter::pointsToPixel
int pointsToPixel(int pointSize) const
Definition: articleformatter.cpp:92
Akregator::Article
A proxy class for Syndication::ItemPtr with some additional methods to assist sorting.
Definition: article.h:61
Akregator::ArticleFormatter
Definition: articleformatter.h:38
Akregator::DefaultNormalViewFormatter
Definition: articleformatter.h:69
Akregator::ArticleFormatter::getCss
virtual QString getCss() const =0
Akregator::ArticleFormatter::NoIcon
Definition: articleformatter.h:43
Akregator::TreeNode
Abstract base class for all kind of elements in the feed tree, like feeds and feed groups (and search...
Definition: treenode.h:59
Akregator::DefaultNormalViewFormatter::formatArticle
QString formatArticle(const Article &article, IconOption option) const
Definition: articleformatter.cpp:170
Akregator::ArticleFormatter::ArticleFormatter
ArticleFormatter(QPaintDevice *device=0)
Definition: articleformatter.cpp:78
Akregator::ArticleFormatter::formatArticle
virtual QString formatArticle(const Article &article, IconOption icon) const =0
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:58:14 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

akregator

Skip menu "akregator"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal