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
30 #ifndef MAILCOMMON_FILTERIMPORTEREXPORTER_H
31 #define MAILCOMMON_FILTERIMPORTEREXPORTER_H
33 #include "mailcommon_export.h"
35 #include <KSharedConfig>
37 #include <QtCore/QList>
47 * @short Utility class that provides persisting of filters to/from KConfig.
49 * @author Till Adam <till@kdab.net>
51 class MAILCOMMON_EXPORT FilterImporterExporter
55 * Creates a new filter importer/exporter.
57 * @param parent The parent widget.
59 FilterImporterExporter( QWidget
*parent
= 0 );
62 * Destroys the filter importer/exporter.
64 virtual ~FilterImporterExporter();
67 * Exports the given @p filters to a file which
68 * is asked from the user. The list to export is also
69 * presented for confirmation/selection.
71 void exportFilters( const QList
<MailFilter
*> &filters
);
74 * Imports filters. Ask the user where to import them from
75 * and which filters to import.
77 QList
<MailFilter
*> importFilters();
80 * Writes the given list of @p filters to the given @p config file.
82 static void writeFiltersToConfig( const QList
<MailFilter
*> &filters
, KSharedConfig::Ptr config
);
85 * Reads a list of filters from the given @p config file.
87 static QList
<MailFilter
*> readFiltersFromConfig( const KSharedConfig::Ptr config
);
91 Q_DISABLE_COPY( FilterImporterExporter
)