From 460c52653ab0dcca6f19a4f492ed2c5e4e963ab0 Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- akregator/src/tagnode.h | 136 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 akregator/src/tagnode.h (limited to 'akregator/src/tagnode.h') diff --git a/akregator/src/tagnode.h b/akregator/src/tagnode.h new file mode 100644 index 000000000..51ee4879c --- /dev/null +++ b/akregator/src/tagnode.h @@ -0,0 +1,136 @@ + /* + This file is part of Akregator. + + Copyright (C) 2005 Frank Osterfeld + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + As a special exception, permission is given to link this program + with any edition of Qt, and distribute the resulting executable, + without including the source code for Qt in the source distribution. + */ + +#ifndef AKREGATOR_TAGNODE_H +#define AKREGATOR_TAGNODE_H + +#include + +class QDomDocument; +class QDomElement; +class QString; +class QStringList; +template class QValueList; + +namespace Akregator +{ + +class Article; +class Folder; +class FetchQueue; +class Tag; +class TreeNodeVisitor; + +class TagNode : public TreeNode +{ +Q_OBJECT + +public: + + /** creates a tag node, showing articles with a specific tag, from a given node. + @param tagId the identifier of the tag, as stored in the archive + @param observed the tag node will list the tagged articles of @c observed (usually "All Feeds" root node) + + */ + TagNode(const Tag& tag, TreeNode* observed); + + virtual ~TagNode(); + + virtual bool accept(TreeNodeVisitor* visitor); + + virtual Tag tag() const; + + virtual QString icon() const; + + /** The unread count, returns the number of new/unread articles in the node (for groups: the accumulated count of the subtree) + @return number of new/unread articles */ + + virtual int unread() const; + + + /** returns the number of total articles in the node (for groups: the accumulated count of the subtree) + @return number of articles */ + + virtual int totalCount() const; + + + /** 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 @c tag is not null, only articles tagged with @c tag are returned + @return sequence of articles */ + + virtual QValueList
articles(const QString& tag=QString::null); + + /** returns a list of all tags occurring in this node (sub tree for folders) */ + + virtual QStringList tags() const; + + /** 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. + @return whether the node is a feed group or not */ + + virtual bool isGroup() const {return false;} + + /** reimplemented to return an invalid element */ + + virtual QDomElement toOPML( QDomElement parent, QDomDocument document ) const; + + /** returns the next node in the tree. + Calling next() unless it returns 0 iterates through the tree in pre-order + */ + virtual TreeNode* next(); + + virtual void setTitle(const QString& title); + + /** called by @c TagNodeList when the tag of this node was changed */ + virtual void tagChanged(); + +public slots: + + + /** does nothing for TagNode */ + virtual void slotDeleteExpiredArticles(); + + /** marks all articles as read */ + virtual void slotMarkAllArticlesAsRead(); + + /** does nothing for TagNode */ + virtual void slotAddToFetchQueue(FetchQueue* queue, bool intervalFetchOnly=false); + + virtual void slotArticlesAdded(TreeNode* node, const QValueList
& list); + virtual void slotArticlesUpdated(TreeNode* node, const QValueList
& list); + virtual void slotArticlesRemoved(TreeNode* node, const QValueList
& list); + virtual void slotObservedDestroyed(TreeNode* node); + +protected: + + virtual void doArticleNotification(); + virtual void calcUnread(); + +private: + class TagNodePrivate; + TagNodePrivate* d; +}; + +} + +#endif // AKREGATOR_TAGNODE_H -- cgit v1.2.1