doc fixes found while translating
[kdepim.git] / knode / knfiltermanager.h
blob6a8475c96ddcc15c52fd1d741e7c67bca24d6b2b
1 /*
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
18 #include <qglobal.h>
19 #include <QList>
21 #include <kactionmenu.h>
22 #include <kactioncollection.h>
24 namespace KNode {
25 class FilterListWidget;
28 class KNArticleFilter;
31 /** Filter selection action. */
32 class KNFilterSelectAction : public KActionMenu
34 Q_OBJECT
36 public:
37 KNFilterSelectAction( const QString& text, const QString& pix,
38 KActionCollection* parent, const char *name );
39 ~KNFilterSelectAction();
41 void setCurrentItem(int id);
43 protected slots:
44 void slotMenuActivated(int id);
46 signals:
47 void activated(int id);
49 private:
50 int currentItem;
54 /** Filter manager. */
55 class KNFilterManager : public QObject
57 Q_OBJECT
59 public:
60 KNFilterManager( QObject * parent = 0 );
61 ~KNFilterManager();
63 void readOptions();
64 void saveOptions();
66 void prepareShutdown();
68 KNArticleFilter* currentFilter() { return currFilter; }
70 void startConfig(KNode::FilterListWidget *fs);
71 void endConfig();
72 void commitChanges();
73 void newFilter();
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);
85 protected:
86 void loadFilters();
87 void saveFilterLists();
88 KNArticleFilter* setFilter(const int id);
89 KNArticleFilter* byID(int id);
90 void updateMenu();
92 QList<KNArticleFilter*> mFilterList;
93 KNode::FilterListWidget *fset;
94 KNArticleFilter *currFilter;
95 KNFilterSelectAction *a_ctFilter;
96 QList<int> menuOrder;
97 bool commitNeeded;
99 protected slots:
100 void slotMenuActivated(int id);
101 void slotShowFilterChooser();
103 signals:
104 void filterChanged(KNArticleFilter *f);
108 #endif