akregator/src

fetchqueue.h
1 /*
2  This file is part of Akregator.
3 
4  Copyright (C) 2004 Sashmit Bhaduri <smt@vfemail.net>
5  2005 Frank Osterfeld <frank.osterfeld at kdemail.net>
6 
7  This program is free software; you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation; either version 2 of the License, or
10  (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 
21  As a special exception, permission is given to link this program
22  with any edition of TQt, and distribute the resulting executable,
23  without including the source code for TQt in the source distribution.
24 */
25 
26 #ifndef AKREGATOR_FETCHQUEUE_H
27 #define AKREGATOR_FETCHQUEUE_H
28 
29 #include <tqobject.h>
30 
31 namespace Akregator {
32 
33 class Feed;
34 class TreeNode;
35 
36 class FetchQueue : public TQObject
37 {
38  TQ_OBJECT
39 
40 
41  public:
42 
43  FetchQueue(TQObject* parent=0, const char* name=0);
44  virtual ~FetchQueue();
45 
47  bool isEmpty() const;
48 
50  void addFeed(Feed *f);
51 
52  public slots:
53 
55  void slotAbort();
56 
57  signals:
58 
59  void signalStarted();
60  void signalStopped();
61  void fetched(Feed*);
62  void fetchError(Feed*);
63 
64  protected:
65 
67  void fetchNextFeed();
68 
69  void feedDone(Feed *f);
70  void connectToFeed(Feed* feed);
71  void disconnectFromFeed(Feed* feed);
72 
73  protected slots:
74 
75  void slotNodeDestroyed(TreeNode* node);
76  void slotFeedFetched(Feed *);
77  void slotFetchError(Feed *);
78  void slotFetchAborted(Feed *);
79 
80  private:
81 
82  class FetchQueuePrivate;
83  FetchQueuePrivate* d;
84 };
85 
86 } // namespace Akregator
87 
88 #endif