akregator/src

tagset.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_TAGSET_H
26 #define AKREGATOR_TAGSET_H
27 
28 #include <tqobject.h>
29 
30 class TQDomDocument;
31 template <class K,class T> class TQMap;
32 class TQString;
33 class TQStringList;
34 
35 namespace Akregator {
36 
37 class Tag;
38 
47 class TagSet : public TQObject
48 {
49  friend class Tag;
50  Q_OBJECT
51 
52  public:
53 
54  TagSet(TQObject* parent=0);
55  virtual ~TagSet();
56 
58  void insert(const Tag& tag);
59 
61  void remove(const Tag& tag);
62 
64  TQMap<TQString,Tag> toMap() const;
65 
67  bool contains(const Tag& tag) const;
68 
70  bool containsID(const TQString& id) const;
71 
73  Tag findByID(const TQString& id) const;
74 
77  void readFromXML(const TQDomDocument& doc);
78 
91  TQDomDocument toXML() const;
92 
93  signals:
95  void signalTagAdded(const Tag&);
97  void signalTagRemoved(const Tag&);
99  void signalTagUpdated(const Tag&);
100 
101  protected:
103  void tagUpdated(const Tag& tag);
104 
105  private:
106  class TagSetPrivate;
107  TagSetPrivate* d;
108 };
109 
110 } // namespace Akregator
111 
112 #endif // AKREGATOR_TAGSET_H