akregator/src

tagnode.h
1  /*
2  This file is part of Akregator.
3 
4  Copyright (C) 2005 Frank Osterfeld <frank.osterfeld at kdemail.net>
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program; if not, write to the Free Software
18  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 
20  As a special exception, permission is given to link this program
21  with any edition of TQt, and distribute the resulting executable,
22  without including the source code for TQt in the source distribution.
23  */
24 
25 #ifndef AKREGATOR_TAGNODE_H
26 #define AKREGATOR_TAGNODE_H
27 
28 #include <treenode.h>
29 
30 class TQDomDocument;
31 class TQDomElement;
32 class TQString;
33 class TQStringList;
34 template <class T> class TQValueList;
35 
36 namespace Akregator
37 {
38 
39 class Article;
40 class Folder;
41 class FetchQueue;
42 class Tag;
43 class TreeNodeVisitor;
44 
45 class TagNode : public TreeNode
46 {
47 TQ_OBJECT
48 
49 
50 public:
51 
57  TagNode(const Tag& tag, TreeNode* observed);
58 
59  virtual ~TagNode();
60 
61  virtual bool accept(TreeNodeVisitor* visitor);
62 
63  virtual Tag tag() const;
64 
65  virtual TQString icon() const;
66 
70  virtual int unread() const;
71 
72 
76  virtual int totalCount() const;
77 
78 
83  virtual TQValueList<Article> articles(const TQString& tag=TQString());
84 
87  virtual TQStringList tags() const;
88 
92  virtual bool isGroup() const {return false;}
93 
96  virtual TQDomElement toOPML( TQDomElement parent, TQDomDocument document ) const;
97 
101  virtual TreeNode* next();
102 
103  virtual void setTitle(const TQString& title);
104 
106  virtual void tagChanged();
107 
108 public slots:
109 
110 
112  virtual void slotDeleteExpiredArticles();
113 
115  virtual void slotMarkAllArticlesAsRead();
116 
118  virtual void slotAddToFetchQueue(FetchQueue* queue, bool intervalFetchOnly=false);
119 
120  virtual void slotArticlesAdded(TreeNode* node, const TQValueList<Article>& list);
121  virtual void slotArticlesUpdated(TreeNode* node, const TQValueList<Article>& list);
122  virtual void slotArticlesRemoved(TreeNode* node, const TQValueList<Article>& list);
123  virtual void slotObservedDestroyed(TreeNode* node);
124 
125 protected:
126 
127  virtual void doArticleNotification();
128  virtual void calcUnread();
129 
130 private:
131  class TagNodePrivate;
132  TagNodePrivate* d;
133 };
134 
135 }
136 
137 #endif // AKREGATOR_TAGNODE_H
TreeNode()
Standard constructor.
Definition: treenode.cpp:48