krop's commit fixes my problem in a better way, reverting
[kdepim.git] / kmail / filterimporterexporter.h
blob26c9352a0cf2934a6eed0e64a7c6cc33e78e99e0
1 /*
2 This file is part of KMail.
3 Copyright (c) 2007 Till Adam <adam@kde.org>
5 KMail is free software; you can redistribute it and/or modify it
6 under the terms of the GNU General Public License, version 2, as
7 published by the Free Software Foundation.
9 KMail is distributed in the hope that it will be useful, but
10 WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 In addition, as a special exception, the copyright holders give
19 permission to link the code of this program with any edition of
20 the Qt library by Trolltech AS, Norway (or with modified versions
21 of Qt that use the same license as Qt), and distribute linked
22 combinations including the two. You must obey the GNU General
23 Public License in all respects for all of the code used other than
24 Qt. If you modify this file, you may extend this exception to
25 your version of the file, but you are not obligated to do so. If
26 you do not wish to do so, delete this exception statement from
27 your version.
30 #ifndef __FILTERIMPORTEREXPORTER_H__
31 #define __FILTERIMPORTEREXPORTER_H__
33 #include <QList>
35 #include <KSharedConfig>
37 class KMFilter;
38 class QWidget;
40 namespace KMail
43 /**
44 @short Utility class that provides persisting of filters to/from KConfig.
45 @author Till Adam <till@kdab.net>
47 class FilterImporterExporter
49 public:
50 explicit FilterImporterExporter( QWidget *parent, bool popFilter = false );
51 virtual ~FilterImporterExporter();
53 /** Export the given filter rules to a file which
54 * is asked from the user. The list to export is also
55 * presented for confirmation/selection. */
56 void exportFilters( const QList<KMFilter *> & );
58 /** Import filters. Ask the user where to import them from
59 * and which filters to import. */
60 QList<KMFilter *> importFilters();
62 static void writeFiltersToConfig( const QList<KMFilter *> &filters,
63 KSharedConfig::Ptr config, bool bPopFilter );
64 static QList<KMFilter *> readFiltersFromConfig( KSharedConfig::Ptr config,
65 bool bPopFilter );
66 private:
67 QWidget *mParent;
68 bool mPopFilter;
73 #endif /* __FILTERIMPORTEREXPORTER_H__ */