30#include <tqvaluelist.h>
34class Tag::TagPrivate : public Shared
42 TQValueList<TagSet*> tagSets;
43 bool operator==( const TagPrivate& other) const
45 return id == other.id;
49Tag::Tag() : d(new TagPrivate)
52Tag::Tag( const TQString& id, const TQString& name, const TQString& scheme) : d(new TagPrivate)
55 d->name = name.isNull() ? id : name;
60Tag Tag::fromCategory( const TQString& term, const TQString& scheme, const TQString& name)
62 Tag tag(scheme + "/" + term, name, scheme);
67Tag::Tag( const Tag& other) : d(0)
81Tag& Tag::operator=( const Tag& other)
94bool Tag::operator==( const Tag& other) const
96 return *(other.d) == *d;
99bool Tag::operator<( const Tag& other) const
101 return (name() < other.name()) || (name() == other.name() && id() < other.id());
104bool Tag::isNull() const
106 return d->id.isNull();
109TQString Tag::name() const
114TQString Tag::scheme() const
119TQString Tag::icon() const
124void Tag::setIcon( const TQString& icon)
129 for (TQValueList<TagSet*>::ConstIterator it = d->tagSets.begin(); it != d->tagSets.end(); ++it)
130 (*it)->tagUpdated(* this);
135void Tag::setName( const TQString& name)
140 for (TQValueList<TagSet*>::ConstIterator it = d->tagSets.begin(); it != d->tagSets.end(); ++it)
141 (*it)->tagUpdated(* this);
145void Tag::addedToTagSet(TagSet* tagSet) const
147 d->tagSets.append(tagSet);
150void Tag::removedFromTagSet(TagSet* tagSet) const
152 d->tagSets.remove(tagSet);
155TQString Tag::id() const
|