akregator/src

tagnodelist.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_TAGNODELIST_H
00026 #define AKREGATOR_TAGNODELIST_H
00027 
00028 #include "tagfolder.h"
00029 
00030 class TQDomDocument;
00031 template <class T> class TQValueList;
00032 
00033 namespace Akregator {
00034 
00035    class FeedList;
00036    class Folder;
00037    class TagFolder;
00038    class TagNode;
00039    class TreeNode;
00040    class Tag;
00041    class TagSet;
00042    
00043    
00044    class TagNodeList : public NodeList
00045    {
00046        Q_OBJECT
00047   
00048        public:
00049 
00050 
00051        TagNodeList(FeedList* feedList, TagSet* tagSet);
00052        virtual ~TagNodeList();
00053        
00054        FeedList* feedList() const;
00055        bool insert(TagNode* tagNode);
00056        bool remove(TagNode* tagNode);
00057        bool containsTagId(const TQString& tagId);
00058        TQValueList<TagNode*> toList() const;
00059        
00060        TagNode* findByTagID(const TQString& tagID);
00061 
00062        virtual bool readFromXML(const TQDomDocument& doc);
00063        virtual TQDomDocument toXML() const;
00064 
00065        virtual TagFolder* rootNode() const;
00066        
00067        public slots:
00068 
00069        void slotTagAdded(const Tag& tag);
00070        void slotTagUpdated(const Tag& tag);
00071        void slotTagRemoved(const Tag& tag);
00072        
00073        signals:
00074 
00075        void signalDestroyed(TagNodeList*);
00076        void signalTagNodeAdded(TagNode* node);
00077        void signalTagNodeRemoved(TagNode* node);
00078 
00079        protected slots:
00080 
00081        virtual void slotNodeDestroyed(TreeNode* node);
00082        virtual void slotNodeAdded(TreeNode* node);
00083        virtual void slotNodeRemoved(Folder* parent, TreeNode* node);
00084 
00085        private:
00086        
00087        class TagNodeListPrivate;
00088        TagNodeListPrivate* d;
00089    };
00090 
00091 } // namespace Akregator
00092 
00093 #endif