feedlist.h
00001 /* 00002 This file is part of Akregator. 00003 00004 Copyright (C) 2004 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 AKREGATORFEEDLIST_H 00026 #define AKREGATORFEEDLIST_H 00027 00028 #include "nodelist.h" 00029 00030 class TQDomDocument; 00031 class TQDomNode; 00032 class TQString; 00033 00034 namespace Akregator 00035 { 00036 00037 class Article; 00038 class Feed; 00039 class Folder; 00040 class TreeNode; 00041 00044 class FeedList : public NodeList 00045 { 00046 Q_OBJECT 00047 00048 public: 00049 00050 FeedList(TQObject *parent = 0, const char *name = 0); 00051 00053 ~FeedList(); 00054 00057 void append(FeedList* list, Folder* parent=0, TreeNode* after=0); 00058 00063 virtual bool readFromXML(const TQDomDocument& doc); 00064 00066 virtual TQDomDocument toXML() const; 00067 00069 Feed* findByURL(const TQString& feedURL) const; 00070 00071 Article findArticle(const TQString& feedURL, const TQString& guid) const; 00072 00073 signals: 00074 00075 void signalDestroyed(FeedList*); 00076 00077 protected: 00078 00079 virtual void addNode(TreeNode* node, bool preserveID); 00080 virtual void removeNode(TreeNode* node); 00081 00082 public: // compat with KDE-3.x assertions, remove for KDE 4 00083 // private: 00084 00085 void parseChildNodes(TQDomNode &node, Folder* parent); 00086 00087 // never call these 00088 FeedList(const FeedList&) : NodeList() {} 00089 FeedList& operator=(const FeedList&) { return *this; } 00090 00091 friend class AddNodeVisitor; 00092 class AddNodeVisitor; 00093 00094 friend class RemoveNodeVisitor; 00095 class RemoveNodeVisitor; 00096 00097 class FeedListPrivate; 00098 FeedListPrivate* d; 00099 }; 00100 00101 } 00102 00103 #endif