4 * Copyright (c) 2000, 2001 Frerich Raabe <raabe@kde.org>
6 * This program is distributed in the hope that it will be useful, but WITHOUT
7 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
8 * FOR A PARTICULAR PURPOSE. For licensing and distribution details, check the
9 * accompanying file 'COPYING'.
11 #ifndef KCMNEWSTICKER_H
12 #define KCMNEWSTICKER_H
14 #include "knewstickerconfigwidget.h"
15 #include "configaccess.h"
16 #include "newsengine.h"
18 #include <kdialogbase.h>
22 #include <q3listview.h>
25 #include <QResizeEvent>
27 class KNewsTickerConfig
;
28 class KNewsTickerConfigWidget
;
33 class CategoryItem
: public Q3ListViewItem
36 CategoryItem(Q3ListView
*, const QString
&);
41 class NewsSourceItem
: public Q3CheckListItem
44 NewsSourceItem(KNewsTickerConfig
*, CategoryItem
*, const NewsSourceBase::Data
&);
46 NewsSourceBase::Data
data() const;
47 void setData(const NewsSourceBase::Data
&);
48 void setIcon(const QPixmap
&);
50 Q3ListViewItem
*parentItem() { return Q3CheckListItem::parent(); }
55 NewsSourceBase::Subject m_subject
;
56 CategoryItem
*m_parent
;
57 KNewsTickerConfig
*m_kcm
;
60 class KNewsTickerConfig
: public KDialogBase
63 friend class NewsSourceItem
;
65 KNewsTickerConfig(ConfigAccess
*, QWidget
* = 0, const char * = 0);
72 void addNewsSource(const NewsSourceBase::Data
&, bool = false);
73 void modifyNewsSource(Q3ListViewItem
*);
74 void removeNewsSource();
75 void addFilter(const ArticleFilter
&);
76 void removeFilter(Q3ListViewItem
*);
77 void resizeEvent(QResizeEvent
*);
78 void openModifyDialog();
79 bool eventFilter(QObject
*o
, QEvent
*e
);
80 void getNewsIcon(NewsSourceItem
*, const KURL
&);
83 void slotNewsSourceContextMenu(KListView
*, Q3ListViewItem
*, const QPoint
&);
84 void slotChooseFont();
85 void slotAddNewsSource();
87 void slotAddNewsSource(const NewsSourceBase::Data
&);
88 void slotRemoveNewsSource();
89 void slotRemoveFilter();
90 void slotModifyNewsSource();
91 void slotModifyNewsSource(const NewsSourceBase::Data
&);
92 void slotModifyNewsSource(Q3ListViewItem
*, const QPoint
&, int);
93 void slotNewsSourceSelectionChanged();
94 void slotFilterSelectionChanged(Q3ListViewItem
*);
95 void slotFilterActionChanged(const QString
&);
96 void slotFilterNewsSourceChanged(const QString
&);
97 void slotFilterConditionChanged(const QString
&);
98 void slotFilterExpressionChanged(const QString
&);
99 virtual void slotOk();
102 void slotGotNewsIcon(const KURL
&, const QPixmap
&);
106 KNewsTickerConfigWidget
*m_child
;
108 NewsSourceItem
*m_modifyItem
;
109 NewsIconMgr
*m_newsIconMgr
;
110 QMap
<QString
, NewsSourceItem
*> m_itemIconMap
;
113 #endif // KCMNEWSTICKER_H