Merge remote-tracking branch 'origin/Applications/16.08'
[kdepim.git] / akregator / src / progressmanager.h
blob9f0055981070fc6a5ed5d3554fd6e6d65e2d1191
1 /*
2 This file is part of Akregator.
4 Copyright (C) 2005 Frank Osterfeld <osterfeld@kde.org>
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.
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.
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.
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.
25 #ifndef AKREGATOR_PROGRESSMANAGER_H
26 #define AKREGATOR_PROGRESSMANAGER_H
28 #include "feedlist.h"
29 #include <QObject>
30 #include <QSharedPointer>
32 namespace Akregator
35 class Feed;
36 class ProgressItemHandler;
37 class TreeNode;
39 /** This class manages the progress items for all feeds */
41 class ProgressManager : public QObject
43 Q_OBJECT
44 public:
46 static ProgressManager *self();
48 ProgressManager();
49 ~ProgressManager();
51 /** sets the feed list to be managed */
52 void setFeedList(const QSharedPointer<FeedList> &feedList);
54 protected Q_SLOTS:
56 void slotNodeAdded(Akregator::TreeNode *node);
57 void slotNodeRemoved(Akregator::TreeNode *node);
58 void slotNodeDestroyed(Akregator::TreeNode *node);
60 private:
62 static ProgressManager *m_self;
64 class ProgressManagerPrivate;
65 ProgressManagerPrivate *d;
68 /** this class handles the creation and deletion of progress items for one feed.
69 This is an internal class intended to be used in ProgressManager only */
71 class ProgressItemHandler : public QObject
73 Q_OBJECT
74 public:
75 explicit ProgressItemHandler(Feed *feed);
76 ~ProgressItemHandler();
78 public Q_SLOTS:
80 void slotFetchStarted();
81 void slotFetchCompleted();
82 void slotFetchAborted();
83 void slotFetchError();
85 private:
86 class ProgressItemHandlerPrivate;
87 ProgressItemHandlerPrivate *d;
90 } // namespace Akregator
92 #endif // AKREGATOR_PROGRESSMANAGER_H