akregator/src

Akregator::TreeNode Class Referenceabstract

#include <treenode.h>

Inheritance diagram for Akregator::TreeNode:
Akregator::Feed Akregator::Folder

Public Slots

virtual void slotDeleteExpiredArticles ()=0
 
virtual void slotMarkAllArticlesAsRead ()=0
 
virtual void slotAddToFetchQueue (FetchQueue *queue, bool intervalFetchesOnly=false)=0
 

Signals

void signalDestroyed (TreeNode *)
 
void signalChanged (TreeNode *)
 
void signalArticlesAdded (TreeNode *node, const TQValueList< Article > &guids)
 
void signalArticlesUpdated (TreeNode *, const TQValueList< Article > &guids)
 
void signalArticlesRemoved (TreeNode *, const TQValueList< Article > &guids)
 

Public Member Functions

 TreeNode ()
 
virtual ~TreeNode ()
 
virtual bool accept (TreeNodeVisitor *visitor)=0
 
virtual int unread () const =0
 
virtual int totalCount () const =0
 
virtual const TQString & title () const
 
virtual void setTitle (const TQString &title)
 
virtual TreeNodenextSibling () const
 
virtual TreeNodeprevSibling () const
 
virtual Folderparent () const
 
virtual void setParent (Folder *parent)
 
virtual TQValueList< Articlearticles (const TQString &tag=TQString())=0
 
virtual TQStringList tags () const =0
 
virtual bool isGroup () const =0
 
virtual TQDomElement toOPML (TQDomElement parent, TQDomDocument document) const =0
 
virtual void setNotificationMode (bool doNotify, bool notifyOccurredChanges=true)
 
virtual TreeNodenext ()=0
 
virtual uint id () const
 
virtual void setId (uint id)
 

Protected Member Functions

virtual void nodeModified ()
 
virtual void articlesModified ()
 
virtual void doArticleNotification ()
 
void emitSignalDestroyed ()
 

Detailed Description

Abstract base class for all kind of elements in the feed tree, like feeds and feed groups (and search folders later).

TODO: detailed description goes here

Definition at line 51 of file treenode.h.

Constructor & Destructor Documentation

◆ TreeNode()

Akregator::TreeNode::TreeNode ( )

Standard constructor.

Definition at line 48 of file treenode.cpp.

◆ ~TreeNode()

Akregator::TreeNode::~TreeNode ( )
virtual

Standard destructor.

Definition at line 70 of file treenode.cpp.

Member Function Documentation

◆ articles()

virtual TQValueList<Article> Akregator::TreeNode::articles ( const TQString &  tag = TQString())
pure virtual

Returns a sequence of the articles this node contains.

For feed groups, this returns a concatenated list of all articles in the sub tree. If tag is not null, only articles tagged with tag are returned

Returns
sequence of articles

Implemented in Akregator::Folder, and Akregator::Feed.

◆ articlesModified()

void Akregator::TreeNode::articlesModified ( )
protectedvirtual

call this if the articles in the node were changed.

Sends signalArticlesAdded/Updated/Removed signals Will do notification immediately or cache it, depending on m_doNotify.

Definition at line 163 of file treenode.cpp.

◆ doArticleNotification()

void Akregator::TreeNode::doArticleNotification ( )
protectedvirtual

reimplement this in subclasses to do the actual notification called by articlesModified

Reimplemented in Akregator::Folder, and Akregator::Feed.

Definition at line 171 of file treenode.cpp.

◆ id()

uint Akregator::TreeNode::id ( ) const
virtual

returns the ID of this node.

IDs are managed by FeedList objects and must be unique within the list. Some IDs have a special meaning: 0 is the default value and indicates that no ID was set 1 is reserved for the "All Feeds" root node

Definition at line 145 of file treenode.cpp.

◆ isGroup()

virtual bool Akregator::TreeNode::isGroup ( ) const
pure virtual

Helps the rest of the app to decide if node should be handled as group or not.

Only use where necessary, use polymorphism where possible.

Returns
whether the node is a feed group or not

Implemented in Akregator::Folder, and Akregator::Feed.

◆ next()

virtual TreeNode* Akregator::TreeNode::next ( )
pure virtual

returns the next node in the tree.

Calling next() unless it returns 0 iterates through the tree in pre-order

Implemented in Akregator::Feed.

◆ nextSibling()

TreeNode * Akregator::TreeNode::nextSibling ( ) const
virtual

Get the next sibling.

Returns
the next sibling, 0 if there is none

Definition at line 92 of file treenode.cpp.

◆ nodeModified()

void Akregator::TreeNode::nodeModified ( )
protectedvirtual

call this if you modified the actual node (title, unread count).

Call this only when the actual node has changed, i.e. title, unread count. Don't use for article changes! Will do notification immediately or cache it, depending on m_doNotify.

Definition at line 155 of file treenode.cpp.

◆ parent()

Folder * Akregator::TreeNode::parent ( ) const
virtual

Returns the parent node.

Returns
the parent feed group, 0 if there is none

Definition at line 115 of file treenode.cpp.

◆ prevSibling()

TreeNode * Akregator::TreeNode::prevSibling ( ) const
virtual

Get the previous sibling.

Returns
the previous sibling, 0 if there is none

Definition at line 104 of file treenode.cpp.

◆ setId()

void Akregator::TreeNode::setId ( uint  id)
virtual

sets the ID

Definition at line 150 of file treenode.cpp.

◆ setNotificationMode()

void Akregator::TreeNode::setNotificationMode ( bool  doNotify,
bool  notifyOccurredChanges = true 
)
virtual
Parameters
doNotifynotification on changes on/off flag
notifyOccurredChangesnotify changes occurred while turn off when set to true again

Definition at line 125 of file treenode.cpp.

◆ setParent()

void Akregator::TreeNode::setParent ( Folder parent)
virtual

Sets parent node; Don't call this directly, is done automatically by insertChild-methods in Folder.

Definition at line 120 of file treenode.cpp.

◆ setTitle()

void Akregator::TreeNode::setTitle ( const TQString &  title)
virtual

Sets the title of the node.

title should not contain entities.

Parameters
titlethe title string

Definition at line 82 of file treenode.cpp.

◆ signalArticlesAdded

void Akregator::TreeNode::signalArticlesAdded ( TreeNode node,
const TQValueList< Article > &  guids 
)
signal

emitted when new articles were added to this node or any node in the subtree (for folders).

Note that this has nothing to do with fetching, the article might have been moved from somewhere else in the tree into this subtree, e.g. by moving the feed the article is in. For listening to newly fetched articles, you have to register yourself at ArticleInterceptorManager

Parameters
nodethe node articles were added to
guidsthe guids of the articles added

◆ signalArticlesRemoved

void Akregator::TreeNode::signalArticlesRemoved ( TreeNode ,
const TQValueList< Article > &  guids 
)
signal

emitted when articles were removed from this subtree.

Note that this has nothing to do with actual article deletion! The article might have moved somewhere else in the tree, e.g. if the user moved the feed

◆ signalArticlesUpdated

void Akregator::TreeNode::signalArticlesUpdated ( TreeNode ,
const TQValueList< Article > &  guids 
)
signal

emitted when articles were updated

◆ signalChanged

void Akregator::TreeNode::signalChanged ( TreeNode )
signal

Notification mechanism: emitted, when the node was modified and notification is enabled.

A node change is renamed title, icon, unread count. Added, updated or removed articles are not notified via this signal

◆ signalDestroyed

void Akregator::TreeNode::signalDestroyed ( TreeNode )
signal

Emitted when this object is deleted.

◆ slotAddToFetchQueue

virtual void Akregator::TreeNode::slotAddToFetchQueue ( FetchQueue *  queue,
bool  intervalFetchesOnly = false 
)
pure virtualslot

adds node to a fetch queue

Parameters
afetch queue
intervalFetchesOnly

◆ slotDeleteExpiredArticles

virtual void Akregator::TreeNode::slotDeleteExpiredArticles ( )
pure virtualslot

Deletes all expired articles in the node (depending on the expiry settings).

Works recursively for feed groups.

◆ slotMarkAllArticlesAsRead

virtual void Akregator::TreeNode::slotMarkAllArticlesAsRead ( )
pure virtualslot

Marks all articles in this node as read.

Works recursively for feed groups.

◆ tags()

virtual TQStringList Akregator::TreeNode::tags ( ) const
pure virtual

returns a list of all tags occurring in this node (sub tree for folders)

Implemented in Akregator::Folder, and Akregator::Feed.

◆ title()

const TQString & Akregator::TreeNode::title ( ) const
virtual

Get title of node.

Returns
the title of the node

Definition at line 77 of file treenode.cpp.

◆ toOPML()

virtual TQDomElement Akregator::TreeNode::toOPML ( TQDomElement  parent,
TQDomDocument  document 
) const
pure virtual

exports node and child nodes to OPML (with akregator settings)

Parameters
parentthe dom element the child node will be attached to
documentthe opml document

Implemented in Akregator::Folder, and Akregator::Feed.

◆ totalCount()

virtual int Akregator::TreeNode::totalCount ( ) const
pure virtual

returns the number of total articles in the node (for groups: the accumulated count of the subtree)

Returns
number of articles

Implemented in Akregator::Folder, and Akregator::Feed.

◆ unread()

virtual int Akregator::TreeNode::unread ( ) const
pure virtual

The unread count, returns the number of new/unread articles in the node (for groups: the accumulated count of the subtree)

Returns
number of new/unread articles

Implemented in Akregator::Folder, and Akregator::Feed.


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