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

akregator

  • sources
  • kde-4.12
  • 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 #include <QPointer>
34 
35 #include <boost/shared_ptr.hpp>
36 
37 class QDomDocument;
38 class QDomNode;
39 template <class T> class QList;
40 template <class K,class T> class QHash;
41 class QString;
42 
43 class KJob;
44 
45 namespace Akregator {
46 
47 class Article;
48 class Feed;
49 class FeedList;
50 class FetchQueue;
51 class Folder;
52 class TreeNode;
53 
54 namespace Backend {
55  class Storage;
56 }
57 
58 
59 class AKREGATOR_EXPORT FeedListManagementImpl : public FeedListManagementInterface {
60 public:
61  explicit FeedListManagementImpl( const boost::shared_ptr<FeedList>& list=boost::shared_ptr<FeedList>() );
62  void setFeedList( const boost::shared_ptr<FeedList>& list );
63 
64  /* reimp */ QStringList categories() const;
65  /* reimp */ QStringList feeds( const QString& catId ) const;
66  /* reimp */ void addFeed( const QString& url, const QString& catId );
67  /* reimp */ void removeFeed( const QString& url, const QString& catId );
68  /* reimp */ QString addCategory( const QString& name, const QString& parentId ) const;
69  /* reimp */ QString getCategoryName( const QString& catId ) const;
70 
71 private:
72  boost::shared_ptr<FeedList> m_feedList;
73 };
74 
77 class AKREGATOR_EXPORT FeedList : public QObject
78 {
79  Q_OBJECT
80 public:
81 
82  explicit FeedList(Akregator::Backend::Storage* storage);
83 
85  ~FeedList();
86 
87  const Folder* allFeedsFolder() const;
88  Folder* allFeedsFolder();
89 
90  bool isEmpty() const;
91 
92  const TreeNode* findByID(int id) const;
93  TreeNode* findByID(int id);
94 
95  QList<const TreeNode*> findByTitle(const QString &title) const;
96  QList<TreeNode*> findByTitle(const QString &title);
97 
98 
100  QString title() const;
101 
103  void setTitle(const QString& name);
104 
108  QVector<const Feed*> feeds() const;
109  QVector<Feed*> feeds();
110 
111  QVector<int> feedIds() const;
112 
116  QVector<const Folder*> folders() const;
117  QVector<Folder*> folders();
118 
121  void append(FeedList* list, Folder* parent=0, TreeNode* after=0);
122 
127  bool readFromOpml(const QDomDocument& doc);
128 
130  QDomDocument toOpml() const;
131 
133  const Feed* findByURL(const QString& feedURL) const;
134  Feed* findByURL(const QString& feedURL);
135 
136  const Article findArticle(const QString& feedURL, const QString& guid) const;
137 
138  int unread() const;
139 
140  void addToFetchQueue( FetchQueue* queue, bool intervalOnly=false );
141  KJob* createMarkAsReadJob();
142 
143 signals:
144 
145  void signalDestroyed(Akregator::FeedList*);
146 
148  void signalNodeAdded(Akregator::TreeNode*);
149 
151  void signalNodeRemoved(Akregator::TreeNode*);
152 
153  void signalAboutToRemoveNode( Akregator::TreeNode* );
154 
155  void signalNodeChanged( Akregator::TreeNode* );
156 
158  void fetchStarted(Akregator::Feed*);
159 
161  void fetched(Akregator::Feed *);
162 
164  void fetchError(Akregator::Feed *);
166  void fetchDiscovery(Akregator::Feed *);
167 
169  void fetchAborted(Akregator::Feed *);
170 
171  void unreadCountChanged( int unread );
172 
173 private:
174 
175  void addNode(TreeNode* node, bool preserveID);
176  void removeNode(TreeNode* node);
177 
178  int generateID() const;
179  void setRootNode(Folder* folder);
180 
181  void parseChildNodes(QDomNode &node, Folder* parent);
182 
183 private slots:
184 
185  void slotNodeDestroyed(Akregator::TreeNode* node);
186  void slotNodeAdded(Akregator::TreeNode* node);
187  void slotNodeRemoved(Akregator::Folder* parent, Akregator::TreeNode* node);
188  void rootNodeChanged();
189 
190 private:
191  friend class AddNodeVisitor;
192  class AddNodeVisitor;
193 
194  friend class RemoveNodeVisitor;
195  class RemoveNodeVisitor;
196 
197  class Private;
198  Private* const d;
199 };
200 
201 } // namespace Akregator
202 
203 #endif // AKREGATOR_FEEDLIST_H
Akregator::FeedListManagementImpl
Definition: feedlist.h:59
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
QHash
Definition: feedlist.h:40
QObject
Akregator::FeedListManagementInterface
Definition: feedlistmanagementinterface.h:35
Akregator::FeedList
The model of a feed tree, represents an OPML document.
Definition: feedlist.h:77
feedlistmanagementinterface.h
akregator_export.h
Akregator::Feed
represents a feed
Definition: feed.h:52
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:61
Akregator::TreeNode
Abstract base class for all kind of elements in the feed tree, like feeds and feed groups (and search...
Definition: treenode.h:59
KJob
Akregator::FetchQueue
Definition: fetchqueue.h:37
QList
Definition: article.h:39
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:58:14 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

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