1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
|
/*
* knewstickerconfig.h
*
* Copyright (c) 2000, 2001 Frerich Raabe <raabe@kde.org>
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. For licensing and distribution details, check the
* accompanying file 'COPYING'.
*/
#ifndef KCMNEWSTICKER_H
#define KCMNEWSTICKER_H
#include "knewstickerconfigwidget.h"
#include "configaccess.h"
#include "newsengine.h"
#include <kdialogbase.h>
#include <qevent.h>
#include <qfont.h>
#include <qlistview.h>
class KNewsTickerConfig;
class KNewsTickerConfigWidget;
class KConfig;
class NewsIconMgr;
class ConfigAccess;
class CategoryItem : public QListViewItem
{
public:
CategoryItem(QListView *, const QString &);
void setOpen(bool);
};
class NewsSourceItem : public QCheckListItem
{
public:
NewsSourceItem(KNewsTickerConfig *, CategoryItem *, const NewsSourceBase::Data &);
NewsSourceBase::Data data() const;
void setData(const NewsSourceBase::Data &);
void setIcon(const QPixmap &);
QListViewItem *parentItem() { return QCheckListItem::parent(); }
private:
QString m_icon;
bool m_isProgram;
NewsSourceBase::Subject m_subject;
CategoryItem *m_parent;
KNewsTickerConfig *m_kcm;
};
class KNewsTickerConfig : public KDialogBase
{
Q_OBJECT
friend class NewsSourceItem;
public:
KNewsTickerConfig(ConfigAccess *, QWidget * = 0, const char * = 0);
void load();
void save();
void defaults();
protected:
void addNewsSource(const NewsSourceBase::Data &, bool = false);
void modifyNewsSource(QListViewItem *);
void removeNewsSource();
void addFilter(const ArticleFilter &);
void removeFilter(QListViewItem *);
void resizeEvent(QResizeEvent *);
void openModifyDialog();
bool eventFilter(QObject *o, QEvent *e);
void getNewsIcon(NewsSourceItem *, const KURL &);
protected slots:
void slotNewsSourceContextMenu(KListView *, QListViewItem *, const QPoint &);
void slotChooseFont();
void slotAddNewsSource();
void slotAddFilter();
void slotAddNewsSource(const NewsSourceBase::Data &);
void slotRemoveNewsSource();
void slotRemoveFilter();
void slotModifyNewsSource();
void slotModifyNewsSource(const NewsSourceBase::Data &);
void slotModifyNewsSource(QListViewItem *, const QPoint &, int);
void slotNewsSourceSelectionChanged();
void slotFilterSelectionChanged(QListViewItem *);
void slotFilterActionChanged(const QString &);
void slotFilterNewsSourceChanged(const QString &);
void slotFilterConditionChanged(const QString &);
void slotFilterExpressionChanged(const QString &);
virtual void slotOk();
private slots:
void slotGotNewsIcon(const KURL &, const QPixmap &);
private:
ConfigAccess *m_cfg;
KNewsTickerConfigWidget *m_child;
QFont m_font;
NewsSourceItem *m_modifyItem;
NewsIconMgr *m_newsIconMgr;
QMap<QString, NewsSourceItem *> m_itemIconMap;
};
#endif // KCMNEWSTICKER_H
|