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 TQt, and distribute the resulting executable,
00022         without including the source code for TQt in the source distribution.
00023     */
00024 
00025 #ifndef AKREGATOR_TAGNODE_H
00026 #define AKREGATOR_TAGNODE_H
00027 
00028 #include <treenode.h>
00029 
00030 class TQDomDocument;
00031 class TQDomElement;
00032 class TQString;
00033 class TQStringList;
00034 template <class T> class TQValueList;
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 
00050 public:
00051 
00057     TagNode(const Tag& tag, TreeNode* observed);
00058     
00059     virtual ~TagNode();
00060 
00061     virtual bool accept(TreeNodeVisitor* visitor);
00062 
00063     virtual Tag tag() const;
00064 
00065     virtual TQString icon() const;
00066     
00070     virtual int unread() const;
00071     
00072 
00076     virtual int totalCount() const;
00077 
00078     
00083     virtual TQValueList<Article> articles(const TQString& tag=TQString());
00084 
00087     virtual TQStringList tags() const;
00088     
00092     virtual bool isGroup() const {return false;}
00093 
00096     virtual TQDomElement toOPML( TQDomElement parent, TQDomDocument document ) const;
00097     
00101     virtual TreeNode* next(); 
00102 
00103     virtual void setTitle(const TQString& title);
00104 
00106     virtual void tagChanged();
00107 
00108 public slots:
00109     
00110 
00112     virtual void slotDeleteExpiredArticles();
00113 
00115     virtual void slotMarkAllArticlesAsRead();
00116 
00118     virtual void slotAddToFetchQueue(FetchQueue* queue, bool intervalFetchOnly=false);
00119     
00120     virtual void slotArticlesAdded(TreeNode* node, const TQValueList<Article>& list);
00121     virtual void slotArticlesUpdated(TreeNode* node, const TQValueList<Article>& list);
00122     virtual void slotArticlesRemoved(TreeNode* node, const TQValueList<Article>& list);
00123     virtual void slotObservedDestroyed(TreeNode* node);
00124 
00125 protected:
00126 
00127     virtual void doArticleNotification();
00128     virtual void calcUnread();
00129     
00130 private:
00131     class TagNodePrivate;
00132     TagNodePrivate* d;
00133 };
00134 
00135 }
00136 
00137 #endif // AKREGATOR_TAGNODE_H