tag.h
00001 /* 00002 This file is part of Akregator. 00003 00004 Copyright (C) 2005 Frank Osterfeld <frank.osterfeld at kdemail.net> 00005 00006 This program is free software; you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation; either version 2 of the License, or 00009 (at your option) any later version. 00010 00011 This program is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with this program; if not, write to the Free Software 00018 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00019 00020 As a special exception, permission is given to link this program 00021 with any edition of TQt, and distribute the resulting executable, 00022 without including the source code for TQt in the source distribution. 00023 */ 00024 00025 #ifndef AKREGATOR_TAG_H 00026 #define AKREGATOR_TAG_H 00027 00028 #include <tqstring.h> 00029 00030 namespace Akregator { 00031 00032 class TagSet; 00033 00044 class Tag 00045 { 00046 friend class TagSet; 00047 00048 public: 00049 00051 Tag(const TQString& id, const TQString& name=TQString(), const TQString& scheme=TQString()); 00052 00054 Tag(); 00055 00056 Tag(const Tag& other); 00057 00076 static Tag fromCategory(const TQString& term, const TQString& scheme=TQString(), const TQString& name=TQString()); 00077 00078 virtual ~Tag(); 00079 00082 bool isNull() const; 00083 00085 TQString id() const; 00086 00088 TQString name() const; 00089 00091 TQString scheme() const; 00092 00093 void setName(const TQString& name); 00094 00095 TQString icon() const; 00096 void setIcon(const TQString& icon); 00097 00098 Tag& operator=(const Tag& other); 00099 00102 bool operator<(const Tag& other) const; 00103 00105 bool operator==(const Tag& other) const; 00106 00107 00108 protected: 00110 void addedToTagSet(TagSet* tagSet) const; 00111 00113 void removedFromTagSet(TagSet* tagSet) const; 00114 private: 00115 00116 class TagPrivate; 00117 TagPrivate* d; 00118 }; 00119 00120 00121 } // namespace Akregator 00122 00123 #endif // AKREGATOR_TAG_H