revert Makefile.am
[kdenetwork.git] / knewsticker / knewstickerconfig.h
blobabd01f520cee825cb554e8f5b349d53278680b28
1 /*
2 * knewstickerconfig.h
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>
20 #include <qevent.h>
21 #include <qfont.h>
22 #include <q3listview.h>
23 //Added by qt3to4:
24 #include <QPixmap>
25 #include <QResizeEvent>
27 class KNewsTickerConfig;
28 class KNewsTickerConfigWidget;
29 class KConfig;
30 class NewsIconMgr;
31 class ConfigAccess;
33 class CategoryItem : public Q3ListViewItem
35 public:
36 CategoryItem(Q3ListView *, const QString &);
38 void setOpen(bool);
41 class NewsSourceItem : public Q3CheckListItem
43 public:
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(); }
52 private:
53 QString m_icon;
54 bool m_isProgram;
55 NewsSourceBase::Subject m_subject;
56 CategoryItem *m_parent;
57 KNewsTickerConfig *m_kcm;
60 class KNewsTickerConfig : public KDialogBase
62 Q_OBJECT
63 friend class NewsSourceItem;
64 public:
65 KNewsTickerConfig(ConfigAccess *, QWidget * = 0, const char * = 0);
67 void load();
68 void save();
69 void defaults();
71 protected:
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 &);
82 protected slots:
83 void slotNewsSourceContextMenu(KListView *, Q3ListViewItem *, const QPoint &);
84 void slotChooseFont();
85 void slotAddNewsSource();
86 void slotAddFilter();
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();
101 private slots:
102 void slotGotNewsIcon(const KURL &, const QPixmap &);
104 private:
105 ConfigAccess *m_cfg;
106 KNewsTickerConfigWidget *m_child;
107 QFont m_font;
108 NewsSourceItem *m_modifyItem;
109 NewsIconMgr *m_newsIconMgr;
110 QMap<QString, NewsSourceItem *> m_itemIconMap;
113 #endif // KCMNEWSTICKER_H