akregator/src

tagnode.h

00001     /*
00002         This file is part of Akregator.
00003     
00004         Copyright (C) 2005 Frank Osterfeld <frank.osterfeld at kdemail.net>
00005     
00006         This program is free software; you can redistribute it and/or modify
00007         it under the terms of the GNU General Public License as published by
00008         the Free Software Foundation; either version 2 of the License, or
00009         (at your option) any later version.
00010     
00011         This program is distributed in the hope that it will be useful,
00012         but WITHOUT ANY WARRANTY; without even the implied warranty of
00013         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00014         GNU General Public License for more details.
00015     
00016         You should have received a copy of the GNU General Public License
00017         along with this program; if not, write to the Free Software
00018         Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019     
00020         As a special exception, permission is given to link this program
00021         with any edition of Qt, and distribute the resulting executable,
00022         without including the source code for Qt in the source distribution.
00023     */
00024 
00025 #ifndef AKREGATOR_TAGNODE_H
00026 #define AKREGATOR_TAGNODE_H
00027 
00028 #include <treenode.h>
00029 
00030 class QDomDocument;
00031 class QDomElement;
00032 class QString;
00033 class QStringList;
00034 template <class T> class QValueList;
00035 
00036 namespace Akregator 
00037 {
00038 
00039 class Article;
00040 class Folder;
00041 class FetchQueue;
00042 class Tag;
00043 class TreeNodeVisitor;
00044 
00045 class TagNode : public TreeNode
00046 {
00047 Q_OBJECT
00048 
00049 public:
00050 
00056     TagNode(const Tag& tag, TreeNode* observed);
00057     
00058     virtual ~TagNode();
00059 
00060     virtual bool accept(TreeNodeVisitor* visitor);
00061 
00062     virtual Tag tag() const;
00063 
00064     virtual QString icon() const;
00065     
00069     virtual int unread() const;
00070     
00071 
00075     virtual int totalCount() const;
00076 
00077     
00082     virtual QValueList<Article> articles(const QString& tag=QString::null);
00083 
00086     virtual QStringList tags() const;
00087     
00091     virtual bool isGroup() const {return false;}
00092 
00095     virtual QDomElement toOPML( QDomElement parent, QDomDocument document ) const;
00096     
00100     virtual TreeNode* next(); 
00101 
00102     virtual void setTitle(const QString& title);
00103 
00105     virtual void tagChanged();
00106 
00107 public slots:
00108     
00109 
00111     virtual void slotDeleteExpiredArticles();
00112 
00114     virtual void slotMarkAllArticlesAsRead();
00115 
00117     virtual void slotAddToFetchQueue(FetchQueue* queue, bool intervalFetchOnly=false);
00118     
00119     virtual void slotArticlesAdded(TreeNode* node, const QValueList<Article>& list);
00120     virtual void slotArticlesUpdated(TreeNode* node, const QValueList<Article>& list);
00121     virtual void slotArticlesRemoved(TreeNode* node, const QValueList<Article>& list);
00122     virtual void slotObservedDestroyed(TreeNode* node);
00123 
00124 protected:
00125 
00126     virtual void doArticleNotification();
00127     virtual void calcUnread();
00128     
00129 private:
00130     class TagNodePrivate;
00131     TagNodePrivate* d;
00132 };
00133 
00134 }
00135 
00136 #endif // AKREGATOR_TAGNODE_H
KDE Home | KDE Accessibility Home | Description of Access Keys