• 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
articleviewer.h
Go to the documentation of this file.
1 /*
2  This file is part of Akregator.
3 
4  Copyright (C) 2004 Teemu Rytilahti <tpr@d5k.net>
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_ARTICLEVIEWER_H
26 #define AKREGATOR_ARTICLEVIEWER_H
27 
28 #include "article.h"
29 #include "akregator_export.h"
30 
31 #include <khtml_part.h>
32 
33 #include <QFrame>
34 #include <QPointer>
35 
36 #include <boost/shared_ptr.hpp>
37 #include <vector>
38 
39 class KJob;
40 class KUrl;
41 
42 namespace Akregator {
43 
44 namespace Filters {
45  class AbstractMatcher;
46 }
47 
48 class ArticleFormatter;
49 class ArticleListJob;
50 class OpenUrlRequest;
51 class TreeNode;
52 
53 class ArticleViewerPart;
54 
55 class AKREGATORPART_EXPORT ArticleViewer : public QWidget
56 {
57  Q_OBJECT
58  public:
59  explicit ArticleViewer(QWidget* parent);
60  ~ArticleViewer();
61 
62 
64  void reload();
65 
66  void displayAboutPage();
67 
68  KParts::ReadOnlyPart* part() const;
69 
70  void setNormalViewFormatter(const boost::shared_ptr<ArticleFormatter>& formatter);
71 
72  void setCombinedViewFormatter(const boost::shared_ptr<ArticleFormatter>& formatter);
73 
74  void showArticle( const Article& article );
75 
80  void showNode(Akregator::TreeNode* node);
81 
82  QSize sizeHint() const;
83 
84  public slots:
85 
86  void slotZoomIn(int);
87  void slotZoomOut(int);
88  void slotSetZoomFactor(int percent);
89  void slotPrint();
90 
93  void setFilters( const std::vector< boost::shared_ptr<const Akregator::Filters::AbstractMatcher> >& filters );
94 
98  void slotUpdateCombinedView();
99 
104  void slotClear();
105 
106  void slotShowSummary(Akregator::TreeNode *node);
107 
108  void slotPaletteOrFontChanged();
109 
110  signals:
111 
113  void signalOpenUrlRequest(Akregator::OpenUrlRequest&);
114 
115  void started(KIO::Job*);
116  void selectionChanged();
117  void completed();
118 
119  protected: // methods
120  int pointsToPixel(int points) const;
121 
122  bool openUrl(const KUrl &url);
123 
124  protected slots:
125 
126  void slotOpenUrlRequestDelayed(const KUrl&, const KParts::OpenUrlArguments&, const KParts::BrowserArguments&);
127 
128  void slotCreateNewWindow(const KUrl& url,
129  const KParts::OpenUrlArguments& args,
130  const KParts::BrowserArguments& browserArgs,
131  const KParts::WindowArgs& windowArgs,
132  KParts::ReadOnlyPart** part);
133 
134  void slotPopupMenu(const QPoint&, const KUrl&, mode_t, const KParts::OpenUrlArguments&, const KParts::BrowserArguments&, KParts::BrowserExtension::PopupFlags);
135 
137  void slotCopyLinkAddress();
138 
140  void slotCopy();
141 
143  void slotOpenLinkInternal();
144 
146  void slotOpenLinkInBrowser();
147 
149  void slotOpenLinkInForegroundTab();
150 
152  void slotOpenLinkInBackgroundTab();
153 
154  void slotSaveLinkAs();
155 
157  void slotStarted(KIO::Job *);
158 
160  void slotCompleted();
161 
162  void slotSelectionChanged();
163 
164  void slotArticlesListed(KJob* job);
165 
166  void slotArticlesUpdated(Akregator::TreeNode* node, const QList<Akregator::Article>& list);
167  void slotArticlesAdded(Akregator::TreeNode* node, const QList<Akregator::Article>& list);
168  void slotArticlesRemoved(Akregator::TreeNode* node, const QList<Akregator::Article>& list);
169 
170 
171  // from ArticleViewer
172  private:
173 
174  virtual void keyPressEvent(QKeyEvent* e);
175 
178  void renderContent(const QString& body);
179 
182  void beginWriting();
183 
185  void endWriting();
186 
187  void updateCss();
188 
189  void connectToNode(TreeNode* node);
190  void disconnectFromNode(TreeNode* node);
191 
192  void setArticleActionsEnabled(bool enabled);
193 
194  private:
195  KUrl m_url;
196  QString m_normalModeCSS;
197  QString m_combinedModeCSS;
198  QString m_htmlFooter;
199  QString m_currentText;
200  KUrl m_imageDir;
201  QPointer<TreeNode> m_node;
202  QPointer<ArticleListJob> m_listJob;
203  Article m_article;
204  QList<Article> m_articles;
205  KUrl m_link;
206  std::vector<boost::shared_ptr<const Filters::AbstractMatcher> > m_filters;
207  enum ViewMode { NormalView, CombinedView, SummaryView };
208  ViewMode m_viewMode;
209  ArticleViewerPart* m_part;
210  boost::shared_ptr<ArticleFormatter> m_normalViewFormatter;
211  boost::shared_ptr<ArticleFormatter> m_combinedViewFormatter;
212 };
213 
214 class ArticleViewerPart : public KHTMLPart
215 {
216  Q_OBJECT
217 
218  public:
219  explicit ArticleViewerPart(QWidget* parent);
220 
221  bool closeUrl();
222 
223  int button() const;
224 
225  protected:
226 
228  bool urlSelected(const QString &url, int button, int state, const QString &_target,
229  const KParts::OpenUrlArguments& args = KParts::OpenUrlArguments(),
230  const KParts::BrowserArguments& browserArgs = KParts::BrowserArguments());
231 
232  private:
233 
234  int m_button;
235 };
236 
237 } // namespace Akregator
238 
239 #endif // AKREGATOR_ARTICLEVIEWER_H
240 
Akregator::ArticleViewer
Definition: articleviewer.h:55
Akregator::ArticleViewerPart::button
int button() const
Definition: articleviewer.cpp:712
Akregator::OpenUrlRequest
Definition: openurlrequest.h:42
QWidget
KHTMLPart
Akregator::ArticleViewerPart::urlSelected
bool urlSelected(const QString &url, int button, int state, const QString &_target, const KParts::OpenUrlArguments &args=KParts::OpenUrlArguments(), const KParts::BrowserArguments &browserArgs=KParts::BrowserArguments())
reimplemented to get the mouse button
Definition: articleviewer.cpp:724
article.h
Akregator::ArticleViewerPart
Definition: articleviewer.h:214
Akregator::ArticleViewerPart::closeUrl
bool closeUrl()
Definition: articleviewer.cpp:717
akregator_export.h
Akregator::Article
A proxy class for Syndication::ItemPtr with some additional methods to assist sorting.
Definition: article.h:61
Akregator::ArticleViewerPart::ArticleViewerPart
ArticleViewerPart(QWidget *parent)
Definition: articleviewer.cpp:706
AKREGATORPART_EXPORT
#define AKREGATORPART_EXPORT
Definition: akregator_export.h:48
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
m_url
QString m_url
Definition: article.cpp:128
KJob
QList< Akregator::Article >
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