2 KNode, the KDE newsreader
3 Copyright (c) 1999-2005 the KNode authors.
4 See file AUTHORS for details
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 You should have received a copy of the GNU General Public License
11 along with this program; if not, write to the Free Software Foundation,
12 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, US
15 #ifndef KNFILTERMANAGER_H
16 #define KNFILTERMANAGER_H
21 #include <kactionmenu.h>
22 #include <kactioncollection.h>
25 class FilterListWidget
;
28 class KNArticleFilter
;
31 /** Filter selection action. */
32 class KNFilterSelectAction
: public KActionMenu
37 KNFilterSelectAction( const QString
& text
, const QString
& pix
,
38 KActionCollection
* parent
, const char *name
);
39 ~KNFilterSelectAction();
41 void setCurrentItem(int id
);
44 void slotMenuActivated(int id
);
47 void activated(int id
);
54 /** Filter manager. */
55 class KNFilterManager
: public QObject
60 KNFilterManager( QObject
* parent
= 0 );
66 void prepareShutdown();
68 KNArticleFilter
* currentFilter() { return currFilter
; }
70 void startConfig(KNode::FilterListWidget
*fs
);
74 void editFilter(KNArticleFilter
*f
);
75 void copyFilter(KNArticleFilter
*f
);
76 void addFilter(KNArticleFilter
*f
);
77 void deleteFilter(KNArticleFilter
*f
);
78 bool newNameIsOK(KNArticleFilter
*f
, const QString
&newName
);
80 /** Allow to delay the setup of UI elements, since the knode part may not
81 * be available when the config dialog is called.
83 void setMenuAction(KNFilterSelectAction
*a
, QAction
*keybA
);
87 void saveFilterLists();
88 KNArticleFilter
* setFilter(const int id
);
89 KNArticleFilter
* byID(int id
);
92 QList
<KNArticleFilter
*> mFilterList
;
93 KNode::FilterListWidget
*fset
;
94 KNArticleFilter
*currFilter
;
95 KNFilterSelectAction
*a_ctFilter
;
100 void slotMenuActivated(int id
);
101 void slotShowFilterChooser();
104 void filterChanged(KNArticleFilter
*f
);