akregator/src

#include <articleviewer.h>

Inherits Akregator::Viewer.

Public Types

enum  ViewMode { NormalView, CombinedView, SummaryView }

Public Slots

void slotShowArticle (const Article &article)
void slotShowNode (TreeNode *node)
void slotSetFilter (const Akregator::Filters::ArticleMatcher &textFilter, const Akregator::Filters::ArticleMatcher &statusFilter)
void slotUpdateCombinedView ()
void slotClear ()
void slotShowSummary (TreeNode *node)
virtual void slotPaletteOrFontChanged ()
- Public Slots inherited from Akregator::Viewer
void slotScrollUp ()
void slotScrollDown ()
void slotZoomIn ()
void slotZoomOut ()
void slotSetZoomFactor (int percent)
void slotPrint ()
void setSafeMode ()
virtual void slotPaletteOrFontChanged ()=0

Public Member Functions

 ArticleViewer (TQWidget *parent, const char *name)
virtual bool openURL (const KURL &url)
void reload ()
void displayAboutPage ()
void renderContent (const TQString &body)
TQString formatArticleNormalMode (Feed *feed, const Article &article)
TQString formatArticleCombinedMode (Feed *feed, const Article &article)
void beginWriting ()
void endWriting ()
void generateNormalModeCSS ()
void generateCombinedModeCSS ()
void connectToNode (TreeNode *node)
void disconnectFromNode (TreeNode *node)
- Public Member Functions inherited from Akregator::Viewer
 Viewer (TQWidget *parent, const char *name)
virtual bool closeURL ()

Public Attributes

ShowSummaryVisitor * m_showSummaryVisitor
TQString m_normalModeCSS
TQString m_combinedModeCSS
TQString m_htmlFooter
TQString m_currentText
KURL m_imageDir
TreeNodem_node
Article m_article
KURL m_link
Akregator::Filters::ArticleMatcher m_textFilter
Akregator::Filters::ArticleMatcher m_statusFilter
ViewMode m_viewMode

Protected Slots

void slotArticlesUpdated (TreeNode *node, const TQValueList< Article > &list)
void slotArticlesAdded (TreeNode *node, const TQValueList< Article > &list)
void slotArticlesRemoved (TreeNode *node, const TQValueList< Article > &list)
- Protected Slots inherited from Akregator::Viewer
virtual void urlSelected (const TQString &url, int button, int state, const TQString &_target, KParts::URLArgs args)
virtual void slotOpenURLRequest (const KURL &url, const KParts::URLArgs &args)
virtual void slotPopupMenu (KXMLGUIClient *, const TQPoint &, const KURL &, const KParts::URLArgs &, KParts::BrowserExtension::PopupFlags, mode_t)
void slotCopyLinkAddress ()
virtual void slotCopy ()
virtual void slotOpenLinkInternal ()
virtual void slotOpenLinkInBrowser ()
virtual void slotOpenLinkInForegroundTab ()
virtual void slotOpenLinkInBackgroundTab ()
virtual void slotOpenLinkInThisTab ()
virtual void slotSaveLinkAs ()
void slotStarted (TDEIO::Job *)
void slotCompleted ()
virtual void slotSelectionChanged ()

Protected Member Functions

virtual void keyPressEvent (TQKeyEvent *e)
virtual void urlSelected (const TQString &url, int button, int state, const TQString &_target, KParts::URLArgs args)
- Protected Member Functions inherited from Akregator::Viewer
int pointsToPixel (int points) const

Friends

class ShowNodeSummaryVisitor

Additional Inherited Members

- Signals inherited from Akregator::Viewer
void urlClicked (const KURL &url, Viewer *viewer, bool newTab, bool background)
- Static Public Member Functions inherited from Akregator::Viewer
static void displayInExternalBrowser (const KURL &url, const TQString &mimetype=TQString())
- Protected Attributes inherited from Akregator::Viewer
KURL m_url

Detailed Description

This HTML viewer is used to display articles.

Use the high-level interface provided by the public slots whereever possible (and extend them when necessary instead of using low-level methods).

Definition at line 48 of file articleviewer.h.

Constructor & Destructor Documentation

Akregator::ArticleViewer::ArticleViewer ( TQWidget *  parent,
const char *  name 
)

Constructor.

Definition at line 161 of file articleviewer.cpp.

Member Function Documentation

void Akregator::ArticleViewer::beginWriting ( )

Resets the canvas and adds writes the HTML header to it.

Definition at line 594 of file articleviewer.cpp.

void Akregator::ArticleViewer::endWriting ( )

Finishes writing to the canvas and completes the HTML (by adding closing tags)

Definition at line 603 of file articleviewer.cpp.

TQString Akregator::ArticleViewer::formatArticleCombinedMode ( Feed feed,
const Article article 
)

Takes an article and renders it as HTML with settings for combined view.

Parameters
feedarticle's feed (used for feed icon atm) – article.feed() would do. better use a (No)Icon flag. -fo
articleThe article to render
Returns
the rendered article as HTML

Definition at line 497 of file articleviewer.cpp.

TQString Akregator::ArticleViewer::formatArticleNormalMode ( Feed feed,
const Article article 
)

Takes an article and renders it as HTML with settings for normal view and widescreen view.

Parameters
feedarticle's feed (used for feed icon atm) – article.feed() would do. better use a (No)Icon flag. -fo
articleThe article to render
Returns
the rendered article as HTML

Definition at line 404 of file articleviewer.cpp.

void Akregator::ArticleViewer::generateCombinedModeCSS ( )

generates the CSS for combined view mode

Definition at line 269 of file articleviewer.cpp.

void Akregator::ArticleViewer::generateNormalModeCSS ( )

generates the CSS used for rendering in single article mode (normal and wide screen view)

Definition at line 190 of file articleviewer.cpp.

void Akregator::ArticleViewer::reload ( )

Repaints the view.

Definition at line 348 of file articleviewer.cpp.

void Akregator::ArticleViewer::renderContent ( const TQString &  body)

renders body.

Use this method whereever possible.

Parameters
bodyhtml to render, without header and footer

Definition at line 584 of file articleviewer.cpp.

void Akregator::ArticleViewer::slotClear ( )
slot

Clears the canvas and disconnects from the currently observed node (if in combined view mode).

Definition at line 710 of file articleviewer.cpp.

void Akregator::ArticleViewer::slotSetFilter ( const Akregator::Filters::ArticleMatcher textFilter,
const Akregator::Filters::ArticleMatcher statusFilter 
)
slot

Set filters textFilter and statusFilter which will be used if the viewer is in combined view mode.

Parameters
textFiltertext filter
statusFilterstatus filter

Definition at line 643 of file articleviewer.cpp.

void Akregator::ArticleViewer::slotShowArticle ( const Article article)
slot

Show single article (normal view)

Parameters
articlethe article to render

Definition at line 630 of file articleviewer.cpp.

void Akregator::ArticleViewer::slotShowNode ( TreeNode node)
slot

Shows the articles of the tree node node (combined view).

Changes in the node will update the view automatically.

Parameters
nodeThe node to observe

Definition at line 719 of file articleviewer.cpp.

void Akregator::ArticleViewer::slotUpdateCombinedView ( )
slot

Update view if combined view mode is set.

Has to be called when the displayed node gets modified.

Definition at line 654 of file articleviewer.cpp.


The documentation for this class was generated from the following files: