akregator/src

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 Qt, and distribute the resulting executable,
00022     without including the source code for Qt in the source distribution.
00023 */
00024 
00025 #ifndef AKREGATORFEEDLIST_H
00026 #define AKREGATORFEEDLIST_H
00027 
00028 #include "nodelist.h"
00029 
00030 class QDomDocument;
00031 class QDomNode;
00032 class QString;
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 public:
00048 
00049     FeedList(QObject *parent = 0, const char *name = 0);
00050 
00052     ~FeedList();
00053 
00056     void append(FeedList* list, Folder* parent=0, TreeNode* after=0);
00057 
00062     virtual bool readFromXML(const QDomDocument& doc);
00063 
00065     virtual QDomDocument toXML() const;
00066 
00068     Feed* findByURL(const QString& feedURL) const;
00069 
00070     Article findArticle(const QString& feedURL, const QString& guid) const;
00071 
00072 signals:
00073 
00074     void signalDestroyed(FeedList*);
00075 
00076 protected:
00077 
00078     virtual void addNode(TreeNode* node, bool preserveID);
00079     virtual void removeNode(TreeNode* node);
00080 
00081 public:         // compat with KDE-3.x assertions, remove for KDE 4
00082 // private:
00083 
00084     void parseChildNodes(QDomNode &node, Folder* parent);
00085 
00086     // never call these
00087     FeedList(const FeedList&) : NodeList() {}
00088     FeedList& operator=(const FeedList&) { return *this; }
00089 
00090     friend class AddNodeVisitor;
00091     class AddNodeVisitor;
00092 
00093     friend class RemoveNodeVisitor;
00094     class RemoveNodeVisitor;
00095     
00096     class FeedListPrivate;
00097     FeedListPrivate* d;
00098 };
00099 
00100 }
00101 
00102 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys