• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

akregator

  • sources
  • kde-4.14
  • kdepim
  • akregator
  • src
feedlist.h
Go to the documentation of this file.
1 /*
2  This file is part of Akregator.
3 
4  Copyright (C) 2004 Frank Osterfeld <osterfeld@kde.org>
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 Qt, and distribute the resulting executable,
22  without including the source code for Qt in the source distribution.
23 */
24 
25 #ifndef AKREGATOR_FEEDLIST_H
26 #define AKREGATOR_FEEDLIST_H
27 
28 #include "akregator_export.h"
29 
30 #include "feedlistmanagementinterface.h"
31 
32 #include <QObject>
33 
34 #ifndef Q_MOC_RUN
35 #include <boost/shared_ptr.hpp>
36 #endif
37 
38 class QDomDocument;
39 class QDomNode;
40 template <class T> class QList;
41 template <class K,class T> class QHash;
42 class QString;
43 
44 class KJob;
45 
46 namespace Akregator {
47 
48 class Article;
49 class Feed;
50 class FeedList;
51 class FetchQueue;
52 class Folder;
53 class TreeNode;
54 
55 namespace Backend {
56  class Storage;
57 }
58 
59 
60 class AKREGATOR_EXPORT FeedListManagementImpl : public FeedListManagementInterface {
61 public:
62  explicit FeedListManagementImpl( const boost::shared_ptr<FeedList>& list=boost::shared_ptr<FeedList>() );
63  void setFeedList( const boost::shared_ptr<FeedList>& list );
64 
65  /* reimp */ QStringList categories() const;
66  /* reimp */ QStringList feeds( const QString& catId ) const;
67  /* reimp */ void addFeed( const QString& url, const QString& catId );
68  /* reimp */ void removeFeed( const QString& url, const QString& catId );
69  /* reimp */ QString addCategory( const QString& name, const QString& parentId ) const;
70  /* reimp */ QString getCategoryName( const QString& catId ) const;
71 
72 private:
73  boost::shared_ptr<FeedList> m_feedList;
74 };
75 
78 class AKREGATOR_EXPORT FeedList : public QObject
79 {
80  Q_OBJECT
81 public:
82 
83  explicit FeedList(Akregator::Backend::Storage* storage);
84 
86  ~FeedList();
87 
88  const Folder* allFeedsFolder() const;
89  Folder* allFeedsFolder();
90 
91  bool isEmpty() const;
92 
93  const TreeNode* findByID(int id) const;
94  TreeNode* findByID(int id);
95 
96  QList<const TreeNode*> findByTitle(const QString &title) const;
97  QList<TreeNode*> findByTitle(const QString &title);
98 
99 
101  QString title() const;
102 
104  void setTitle(const QString& name);
105 
109  QVector<const Feed*> feeds() const;
110  QVector<Feed*> feeds();
111 
112  QVector<int> feedIds() const;
113 
117  QVector<const Folder*> folders() const;
118  QVector<Folder*> folders();
119 
122  void append(FeedList* list, Folder* parent=0, TreeNode* after=0);
123 
128  bool readFromOpml(const QDomDocument& doc);
129 
131  QDomDocument toOpml() const;
132 
134  const Feed* findByURL(const QString& feedURL) const;
135  Feed* findByURL(const QString& feedURL);
136 
137  const Article findArticle(const QString& feedURL, const QString& guid) const;
138 
139  int unread() const;
140 
141  void addToFetchQueue( FetchQueue* queue, bool intervalOnly=false );
142  KJob* createMarkAsReadJob();
143 
144 signals:
145 
146  void signalDestroyed(Akregator::FeedList*);
147 
149  void signalNodeAdded(Akregator::TreeNode*);
150 
152  void signalNodeRemoved(Akregator::TreeNode*);
153 
154  void signalAboutToRemoveNode( Akregator::TreeNode* );
155 
156  void signalNodeChanged( Akregator::TreeNode* );
157 
159  void fetchStarted(Akregator::Feed*);
160 
162  void fetched(Akregator::Feed *);
163 
165  void fetchError(Akregator::Feed *);
167  void fetchDiscovery(Akregator::Feed *);
168 
170  void fetchAborted(Akregator::Feed *);
171 
172  void unreadCountChanged( int unread );
173 
174 private:
175 
176  void addNode(TreeNode* node, bool preserveID);
177  void removeNode(TreeNode* node);
178 
179  int generateID() const;
180  void setRootNode(Folder* folder);
181 
182  void parseChildNodes(QDomNode &node, Folder* parent);
183 
184 private slots:
185 
186  void slotNodeDestroyed(Akregator::TreeNode* node);
187  void slotNodeAdded(Akregator::TreeNode* node);
188  void slotNodeRemoved(Akregator::Folder* parent, Akregator::TreeNode* node);
189  void rootNodeChanged();
190 
191 private:
192  friend class AddNodeVisitor;
193  class AddNodeVisitor;
194 
195  friend class RemoveNodeVisitor;
196  class RemoveNodeVisitor;
197 
198  class Private;
199  Private* const d;
200 };
201 
202 } // namespace Akregator
203 
204 #endif // AKREGATOR_FEEDLIST_H
Akregator::FeedListManagementImpl
Definition: feedlist.h:60
AKREGATOR_EXPORT
#define AKREGATOR_EXPORT
Definition: akregator_export.h:35
Akregator::Backend::Storage
Storage is the main interface to the article archive.
Definition: storage.h:43
QDomNode
Akregator::FeedListManagementInterface
Definition: feedlistmanagementinterface.h:35
Akregator::FeedList
The model of a feed tree, represents an OPML document.
Definition: feedlist.h:78
QHash
Definition: feedlist.h:41
QObject
feedlistmanagementinterface.h
QString
QList
Definition: article.h:41
QStringList
QDomDocument
QVector
akregator_export.h
Akregator::Feed
represents a feed
Definition: feed.h:53
Akregator::Folder
Represents a folder (containing feeds and/or other folders)
Definition: folder.h:44
Akregator::Article
A proxy class for Syndication::ItemPtr with some additional methods to assist sorting.
Definition: article.h:63
Akregator::TreeNode
Abstract base class for all kind of elements in the feed tree, like feeds and feed groups (and search...
Definition: treenode.h:58
KJob
Akregator::FetchQueue
Definition: fetchqueue.h:37
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:34:00 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

akregator

Skip menu "akregator"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer
  • pimprint

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal