akregator/src

feedlist.h
1/*
2 This file is part of Akregator.
3
4 Copyright (C) 2004 Frank Osterfeld <frank.osterfeld at kdemail.net>
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19
20 As a special exception, permission is given to link this program
21 with any edition of TQt, and distribute the resulting executable,
22 without including the source code for TQt in the source distribution.
23*/
24
25#ifndef AKREGATORFEEDLIST_H
26#define AKREGATORFEEDLIST_H
27
28#include "nodelist.h"
29
30class TQDomDocument;
31class TQDomNode;
32class TQString;
33
34namespace Akregator
35{
36
37class Article;
38class Feed;
39class Folder;
40class TreeNode;
41
44class FeedList : public NodeList
45{
46TQ_OBJECT
47
48public:
49
50 FeedList(TQObject *parent = 0, const char *name = 0);
51
53 ~FeedList();
54
57 void append(FeedList* list, Folder* parent=0, TreeNode* after=0);
58
63 virtual bool readFromXML(const TQDomDocument& doc);
64
66 virtual TQDomDocument toXML() const;
67
69 Feed* findByURL(const TQString& feedURL) const;
70
71 Article findArticle(const TQString& feedURL, const TQString& guid) const;
72
73signals:
74
75 void signalDestroyed(FeedList*);
76
77protected:
78
79 virtual void addNode(TreeNode* node, bool preserveID);
80 virtual void removeNode(TreeNode* node);
81
82public: // compat with KDE-3.x assertions, remove for KDE 4
83// private:
84
85 void parseChildNodes(TQDomNode &node, Folder* parent);
86
87 // never call these
88 FeedList(const FeedList&) : NodeList() {}
89 FeedList& operator=(const FeedList&) { return *this; }
90
91 friend class AddNodeVisitor;
92 class AddNodeVisitor;
93
94 friend class RemoveNodeVisitor;
95 class RemoveNodeVisitor;
96
97 class FeedListPrivate;
98 FeedListPrivate* d;
99};
100
101}
102
103#endif
A proxy class for RSS::Article with some additional methods to assist sorting.
Definition: article.h:58
The model of a feed tree, represents an OPML document.
Definition: feedlist.h:45
virtual TQDomDocument toXML() const
exports the feed list as OPML.
Definition: feedlist.cpp:238
virtual bool readFromXML(const TQDomDocument &doc)
reads an OPML document and appends the items to this list
Definition: feedlist.cpp:145
Feed * findByURL(const TQString &feedURL) const
returns a feed object for a given feed URL.
Definition: feedlist.cpp:204
void append(FeedList *list, Folder *parent=0, TreeNode *after=0)
appends another feed list as sub tree.
Definition: feedlist.cpp:219
~FeedList()
Destructor.
Definition: feedlist.cpp:194
represents a feed
Definition: feed.h:63
Represents a folder (containing feeds and/or other folders)
Definition: folder.h:45
Abstract base class for all kind of elements in the feed tree, like feeds and feed groups (and search...
Definition: treenode.h:52