akregator/src
Akregator::TreeNode Class Reference
#include <treenode.h>
Inheritance diagram for Akregator::TreeNode:

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.
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 QValueList< Article > &guids) |
void | signalArticlesUpdated (TreeNode *, const QValueList< Article > &guids) |
void | signalArticlesRemoved (TreeNode *, const QValueList< 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 QString & | title () const |
virtual void | setTitle (const QString &title) |
virtual TreeNode * | nextSibling () const |
virtual TreeNode * | prevSibling () const |
virtual Folder * | parent () const |
virtual void | setParent (Folder *parent) |
virtual QValueList< Article > | articles (const QString &tag=QString::null)=0 |
virtual QStringList | tags () const=0 |
virtual bool | isGroup () const=0 |
virtual QDomElement | toOPML (QDomElement parent, QDomDocument document) const=0 |
virtual void | setNotificationMode (bool doNotify, bool notifyOccurredChanges=true) |
virtual TreeNode * | next ()=0 |
virtual uint | id () const |
virtual void | setId (uint id) |
Protected Member Functions | |
virtual void | nodeModified () |
virtual void | articlesModified () |
virtual void | doArticleNotification () |
void | emitSignalDestroyed () |
Constructor & Destructor Documentation
Akregator::TreeNode::TreeNode | ( | ) |
Akregator::TreeNode::~TreeNode | ( | ) | [virtual] |
Member Function Documentation
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::Feed, Akregator::Folder, and Akregator::TagNode.
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::Feed, Akregator::Folder, and Akregator::TagNode.
const QString & Akregator::TreeNode::title | ( | ) | const [virtual] |
void Akregator::TreeNode::setTitle | ( | const QString & | title | ) | [virtual] |
Sets the title of the node.
title
should not contain entities.
- Parameters:
-
title the title string
Reimplemented in Akregator::TagNode.
Definition at line 82 of file treenode.cpp.
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.
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.
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.
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.
virtual QValueList<Article> Akregator::TreeNode::articles | ( | const QString & | tag = QString::null |
) | [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::Feed, Akregator::Folder, and Akregator::TagNode.
virtual QStringList Akregator::TreeNode::tags | ( | ) | const [pure virtual] |
returns a list of all tags occurring in this node (sub tree for folders)
Implemented in Akregator::Feed, Akregator::Folder, and Akregator::TagNode.
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::Feed, Akregator::Folder, and Akregator::TagNode.
virtual QDomElement Akregator::TreeNode::toOPML | ( | QDomElement | parent, | |
QDomDocument | document | |||
) | const [pure virtual] |
exports node and child nodes to OPML (with akregator settings)
- Parameters:
-
parent the dom element the child node will be attached to document the opml document
Implemented in Akregator::Feed, Akregator::Folder, Akregator::TagFolder, and Akregator::TagNode.
void Akregator::TreeNode::setNotificationMode | ( | bool | doNotify, | |
bool | notifyOccurredChanges = true | |||
) | [virtual] |
- Parameters:
-
doNotify notification on changes on/off flag
- Parameters:
-
notifyOccurredChanges notify changes occurred while turn off when set to true again
Definition at line 125 of file treenode.cpp.
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, Akregator::Folder, and Akregator::TagNode.
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.
void Akregator::TreeNode::setId | ( | uint | id | ) | [virtual] |
virtual void Akregator::TreeNode::slotDeleteExpiredArticles | ( | ) | [pure virtual, slot] |
Deletes all expired articles in the node (depending on the expiry settings).
Works recursively for feed groups.
Implemented in Akregator::Feed, Akregator::Folder, and Akregator::TagNode.
virtual void Akregator::TreeNode::slotMarkAllArticlesAsRead | ( | ) | [pure virtual, slot] |
Marks all articles in this node as read.
Works recursively for feed groups.
Implemented in Akregator::Feed, Akregator::Folder, and Akregator::TagNode.
virtual void Akregator::TreeNode::slotAddToFetchQueue | ( | FetchQueue * | queue, | |
bool | intervalFetchesOnly = false | |||
) | [pure virtual, slot] |
adds node to a fetch queue
- Parameters:
-
a fetch queue intervalFetchesOnly
Implemented in Akregator::Feed, Akregator::Folder, and Akregator::TagNode.
void Akregator::TreeNode::signalDestroyed | ( | TreeNode * | ) | [signal] |
Emitted when this object is deleted.
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
void Akregator::TreeNode::signalArticlesAdded | ( | TreeNode * | node, | |
const QValueList< 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:
-
node the node articles were added to guids the guids of the articles added
void Akregator::TreeNode::signalArticlesUpdated | ( | TreeNode * | , | |
const QValueList< Article > & | guids | |||
) | [signal] |
emitted when articles were updated
void Akregator::TreeNode::signalArticlesRemoved | ( | TreeNode * | , | |
const QValueList< 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
void Akregator::TreeNode::nodeModified | ( | ) | [protected, virtual] |
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.
void Akregator::TreeNode::articlesModified | ( | ) | [protected, virtual] |
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.
void Akregator::TreeNode::doArticleNotification | ( | ) | [protected, virtual] |
reimplement this in subclasses to do the actual notification called by articlesModified
Reimplemented in Akregator::Feed, Akregator::Folder, and Akregator::TagNode.
Definition at line 171 of file treenode.cpp.
The documentation for this class was generated from the following files: