akregator/src

notificationmanager.h
1 /*
2  This file is part of Akregator.
3 
4  Copyright (C) 2005 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 AKREGATORNOTIFICATIONMANAGER_H
26 #define AKREGATORNOTIFICATIONMANAGER_H
27 
28 #include <tqobject.h>
29 
30 #include "article.h"
31 
32 namespace Akregator
33 {
34 
36 class NotificationManager : public TQObject
37 {
38  TQ_OBJECT
39 
40  public:
42  static NotificationManager* self();
43 
45 
47  void setWidget(TQWidget* widget, TDEInstance* inst=0);
48 
49  public slots:
50 
53  void slotNotifyArticle(const Article& article);
54 
56  void slotNotifyFeeds(const TQStringList& feeds);
57 
58  protected:
59 
60  void doNotify();
61 
62  protected slots:
63 
64  void slotIntervalCheck();
65 
66  private:
68  NotificationManager(const NotificationManager&) : TQObject(){}
69 
70  uint m_checkInterval;
71  uint m_intervalsLapsed;
72  uint m_maxIntervals;
73  uint m_maxArticles;
74  bool m_running;
75  bool m_addedInLastInterval;
76  TQWidget* m_widget;
77  TDEInstance* m_instance;
78 
79  TQValueList<Article> m_articles;
80 
81  static NotificationManager* m_self;
82 };
83 
84 } // namespace
85 
86 #endif
A proxy class for RSS::Article with some additional methods to assist sorting.
Definition: article.h:58
this class collects notification requests (new articles etc.) and processes them using KNotify.
void slotNotifyFeeds(const TQStringList &feeds)
notifies the addition of feeds (used when added via DCOP or command line)
void setWidget(TQWidget *widget, TDEInstance *inst=0)
the widget used for notification, normally either the mainwindow or the tray icon
void slotNotifyArticle(const Article &article)
notifies an article.