From bcb704366cb5e333a626c18c308c7e0448a8e69f Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- knewsticker/knewstickerconfig.h | 110 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 knewsticker/knewstickerconfig.h (limited to 'knewsticker/knewstickerconfig.h') diff --git a/knewsticker/knewstickerconfig.h b/knewsticker/knewstickerconfig.h new file mode 100644 index 00000000..ec475236 --- /dev/null +++ b/knewsticker/knewstickerconfig.h @@ -0,0 +1,110 @@ +/* + * knewstickerconfig.h + * + * Copyright (c) 2000, 2001 Frerich Raabe + * + * 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 + +#include +#include +#include + +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 m_itemIconMap; +}; + +#endif // KCMNEWSTICKER_H -- cgit v1.2.1