akregator/src

tag.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_TAG_H
26#define AKREGATOR_TAG_H
27
28#include <tqstring.h>
29
30namespace Akregator {
31
32class TagSet;
33
44class Tag
45{
46 friend class TagSet;
47
48 public:
49
51 Tag(const TQString& id, const TQString& name=TQString(), const TQString& scheme=TQString());
52
54 Tag();
55
56 Tag(const Tag& other);
57
76 static Tag fromCategory(const TQString& term, const TQString& scheme=TQString(), const TQString& name=TQString());
77
78 virtual ~Tag();
79
82 bool isNull() const;
83
85 TQString id() const;
86
88 TQString name() const;
89
91 TQString scheme() const;
92
93 void setName(const TQString& name);
94
95 TQString icon() const;
96 void setIcon(const TQString& icon);
97
98 Tag& operator=(const Tag& other);
99
102 bool operator<(const Tag& other) const;
103
105 bool operator==(const Tag& other) const;
106
107
108 protected:
110 void addedToTagSet(TagSet* tagSet) const;
111
113 void removedFromTagSet(TagSet* tagSet) const;
114 private:
115
116 class TagPrivate;
117 TagPrivate* d;
118};
119
120
121} // namespace Akregator
122
123#endif // AKREGATOR_TAG_H