akregator/src

tagnodelist.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_TAGNODELIST_H
26 #define AKREGATOR_TAGNODELIST_H
27 
28 #include "tagfolder.h"
29 
30 class TQDomDocument;
31 template <class T> class TQValueList;
32 
33 namespace Akregator {
34 
35  class FeedList;
36  class Folder;
37  class TagFolder;
38  class TagNode;
39  class TreeNode;
40  class Tag;
41  class TagSet;
42 
43 
44  class TagNodeList : public NodeList
45  {
46  TQ_OBJECT
47 
48  public:
49 
50 
51  TagNodeList(FeedList* feedList, TagSet* tagSet);
52  virtual ~TagNodeList();
53 
54  FeedList* feedList() const;
55  bool insert(TagNode* tagNode);
56  bool remove(TagNode* tagNode);
57  bool containsTagId(const TQString& tagId);
58  TQValueList<TagNode*> toList() const;
59 
60  TagNode* findByTagID(const TQString& tagID);
61 
62  virtual bool readFromXML(const TQDomDocument& doc);
63  virtual TQDomDocument toXML() const;
64 
65  virtual TagFolder* rootNode() const;
66 
67  public slots:
68 
69  void slotTagAdded(const Tag& tag);
70  void slotTagUpdated(const Tag& tag);
71  void slotTagRemoved(const Tag& tag);
72 
73  signals:
74 
75  void signalDestroyed(TagNodeList*);
76  void signalTagNodeAdded(TagNode* node);
77  void signalTagNodeRemoved(TagNode* node);
78 
79  protected slots:
80 
81  virtual void slotNodeDestroyed(TreeNode* node);
82  virtual void slotNodeAdded(TreeNode* node);
83  virtual void slotNodeRemoved(Folder* parent, TreeNode* node);
84 
85  private:
86 
87  class TagNodeListPrivate;
88  TagNodeListPrivate* d;
89  };
90 
91 } // namespace Akregator
92 
93 #endif