Fix typo found by Yuri Chornoivan
[kdepim.git] / knode / knstringfilter.h
blobe510c55d0910d5b1854ad4666875ccbc4215c822
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 KNODE_KNSTRINGFILTER_H
16 #define KNODE_KNSTRINGFILTER_H
18 #include <QGroupBox>
20 class QCheckBox;
21 class QComboBox;
23 class KLineEdit;
24 class KConfig;
26 class KNGroup;
28 namespace KNode {
30 /** Filter for string values. */
31 class StringFilter
33 friend class StringFilterWidget;
35 public:
36 StringFilter() { con=true; regExp=false;}
37 ~StringFilter() {}
39 StringFilter& operator=( const StringFilter &sf );
40 /** replace placeholders */
41 void expand(KNGroup *g);
43 void load(const KConfigGroup &group);
44 void save(KConfigGroup &conf);
46 bool doFilter(const QString &s);
48 protected:
49 QString data, expanded;
50 bool con, regExp;
55 //===============================================================================
58 /** Configuration widget for KNode::StringFilter. */
59 class StringFilterWidget : public QGroupBox
61 Q_OBJECT
63 public:
64 /** Create a new configuration widget for StringFilter.
65 * @param title Name of the value that is filtered.
66 * @param parent The parent widget.
68 StringFilterWidget( const QString& title, QWidget *parent );
69 ~StringFilterWidget();
71 StringFilter filter();
72 void setFilter( StringFilter &f );
73 void clear();
75 /** usablity hack for the search dialog */
76 void setStartFocus();
78 protected:
79 QCheckBox *regExp;
80 QComboBox *fType;
81 KLineEdit *fString;
87 #endif // KNODE_KNSTRINGFILTER_H