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

akregator

  • sources
  • kde-4.14
  • 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 <QPointer>
34 
35 #ifndef Q_MOC_RUN
36 #include <boost/shared_ptr.hpp>
37 #endif
38 #include <vector>
39 
40 class KJob;
41 class KUrl;
42 
43 namespace Akregator {
44 
45 namespace Filters {
46  class AbstractMatcher;
47 }
48 
49 class ArticleFormatter;
50 class ArticleListJob;
51 class OpenUrlRequest;
52 class TreeNode;
53 
54 class ArticleViewerPart;
55 
56 class AKREGATORPART_EXPORT ArticleViewer : public QWidget
57 {
58  Q_OBJECT
59  public:
60  explicit ArticleViewer(QWidget* parent);
61  ~ArticleViewer();
62 
63 
65  void reload();
66 
67  void displayAboutPage();
68 
69  KParts::ReadOnlyPart* part() const;
70 
71  void setNormalViewFormatter(const boost::shared_ptr<ArticleFormatter>& formatter);
72 
73  void setCombinedViewFormatter(const boost::shared_ptr<ArticleFormatter>& formatter);
74 
75  void showArticle( const Article& article );
76 
81  void showNode(Akregator::TreeNode* node);
82 
83  QSize sizeHint() const;
84 
85  public slots:
86 
87  void slotZoomIn(int);
88  void slotZoomOut(int);
89  void slotSetZoomFactor(int percent);
90  void slotPrint();
91 
94  void setFilters( const std::vector< boost::shared_ptr<const Akregator::Filters::AbstractMatcher> >& filters );
95 
99  void slotUpdateCombinedView();
100 
105  void slotClear();
106 
107  void slotShowSummary(Akregator::TreeNode *node);
108 
109  void slotPaletteOrFontChanged();
110 
111  signals:
112 
114  void signalOpenUrlRequest(Akregator::OpenUrlRequest&);
115 
116  void started(KIO::Job*);
117  void selectionChanged();
118  void completed();
119 
120  protected: // methods
121  int pointsToPixel(int points) const;
122 
123  bool openUrl(const KUrl &url);
124 
125  protected slots:
126 
127  void slotOpenUrlRequestDelayed(const KUrl&, const KParts::OpenUrlArguments&, const KParts::BrowserArguments&);
128 
129  void slotCreateNewWindow(const KUrl& url,
130  const KParts::OpenUrlArguments& args,
131  const KParts::BrowserArguments& browserArgs,
132  const KParts::WindowArgs& windowArgs,
133  KParts::ReadOnlyPart** part);
134 
135  void slotPopupMenu(const QPoint&, const KUrl&, mode_t, const KParts::OpenUrlArguments&, const KParts::BrowserArguments&, KParts::BrowserExtension::PopupFlags);
136 
138  void slotCopyLinkAddress();
139 
141  void slotCopy();
142 
144  void slotOpenLinkInternal();
145 
147  void slotOpenLinkInBrowser();
148 
150  void slotOpenLinkInForegroundTab();
151 
153  void slotOpenLinkInBackgroundTab();
154 
155  void slotSaveLinkAs();
156 
158  void slotStarted(KIO::Job *);
159 
161  void slotCompleted();
162 
163  void slotSelectionChanged();
164 
165  void slotArticlesListed(KJob* job);
166 
167  void slotArticlesUpdated(Akregator::TreeNode* node, const QList<Akregator::Article>& list);
168  void slotArticlesAdded(Akregator::TreeNode* node, const QList<Akregator::Article>& list);
169  void slotArticlesRemoved(Akregator::TreeNode* node, const QList<Akregator::Article>& list);
170 
171 
172  // from ArticleViewer
173  private:
174 
175  virtual void keyPressEvent(QKeyEvent* e);
176 
179  void renderContent(const QString& body);
180 
183  void beginWriting();
184 
186  void endWriting();
187 
188  void updateCss();
189 
190  void connectToNode(TreeNode* node);
191  void disconnectFromNode(TreeNode* node);
192 
193  void setArticleActionsEnabled(bool enabled);
194 
195  private:
196  KUrl m_url;
197  QString m_normalModeCSS;
198  QString m_combinedModeCSS;
199  QString m_htmlFooter;
200  QString m_currentText;
201  KUrl m_imageDir;
202  QPointer<TreeNode> m_node;
203  QPointer<ArticleListJob> m_listJob;
204  Article m_article;
205  QList<Article> m_articles;
206  KUrl m_link;
207  std::vector<boost::shared_ptr<const Filters::AbstractMatcher> > m_filters;
208  enum ViewMode { NormalView, CombinedView, SummaryView };
209  ViewMode m_viewMode;
210  ArticleViewerPart* m_part;
211  boost::shared_ptr<ArticleFormatter> m_normalViewFormatter;
212  boost::shared_ptr<ArticleFormatter> m_combinedViewFormatter;
213 };
214 
215 class ArticleViewerPart : public KHTMLPart
216 {
217  Q_OBJECT
218 
219  public:
220  explicit ArticleViewerPart(QWidget* parent);
221 
222  bool closeUrl();
223 
224  int button() const;
225 
226  protected:
227 
229  bool urlSelected(const QString &url, int button, int state, const QString &_target,
230  const KParts::OpenUrlArguments& args = KParts::OpenUrlArguments(),
231  const KParts::BrowserArguments& browserArgs = KParts::BrowserArguments());
232 
233  private:
234 
235  int m_button;
236 };
237 
238 } // namespace Akregator
239 
240 #endif // AKREGATOR_ARTICLEVIEWER_H
241 
Akregator::ArticleViewer
Definition: articleviewer.h:56
QWidget
Akregator::ArticleViewerPart::button
int button() const
Definition: articleviewer.cpp:713
Akregator::OpenUrlRequest
Definition: openurlrequest.h:42
QPointer
KHTMLPart
QPoint
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:725
QString
QList< Akregator::Article >
article.h
QSize
Akregator::ArticleViewerPart
Definition: articleviewer.h:215
Akregator::ArticleViewerPart::closeUrl
bool closeUrl()
Definition: articleviewer.cpp:718
QKeyEvent
akregator_export.h
Akregator::Article
A proxy class for Syndication::ItemPtr with some additional methods to assist sorting.
Definition: article.h:63
Akregator::ArticleViewerPart::ArticleViewerPart
ArticleViewerPart(QWidget *parent)
Definition: articleviewer.cpp:707
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:58
m_url
QString m_url
Definition: article.cpp:128
KJob
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

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
  • pimprint

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