~ubuntu-branches/ubuntu/raring/kdepim/raring-proposed

« back to all changes in this revision

Viewing changes to mailcommon/filterimporterexporter.h

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2012-06-07 07:56:38 UTC
  • mfrom: (0.2.27)
  • Revision ID: package-import@ubuntu.com-20120607075638-0luhdq11z7sgvs4m
Tags: 4:4.8.80-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
    This file is part of KMail.
3
 
    Copyright (c) 2007 Till Adam <adam@kde.org>
4
 
 
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.
8
 
 
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.
13
 
 
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
17
 
 
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.
28
 
*/
29
 
 
30
 
#ifndef MAILCOMMON_FILTERIMPORTEREXPORTER_H
31
 
#define MAILCOMMON_FILTERIMPORTEREXPORTER_H
32
 
 
33
 
#include "mailcommon_export.h"
34
 
 
35
 
#include <KSharedConfig>
36
 
 
37
 
#include <QtCore/QList>
38
 
 
39
 
class QWidget;
40
 
 
41
 
namespace MailCommon
42
 
{
43
 
 
44
 
class MailFilter;
45
 
 
46
 
/**
47
 
 * @short Utility class that provides persisting of filters to/from KConfig.
48
 
 *
49
 
 * @author Till Adam <till@kdab.net>
50
 
 */
51
 
class MAILCOMMON_EXPORT FilterImporterExporter
52
 
{
53
 
  public:
54
 
    /**
55
 
     * Creates a new filter importer/exporter.
56
 
     *
57
 
     * @param parent The parent widget.
58
 
     */
59
 
    FilterImporterExporter( QWidget *parent = 0 );
60
 
 
61
 
    /**
62
 
     * Destroys the filter importer/exporter.
63
 
     */
64
 
    virtual ~FilterImporterExporter();
65
 
 
66
 
    /**
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.
70
 
     */
71
 
    void exportFilters( const QList<MailFilter*> &filters );
72
 
 
73
 
    /**
74
 
     * Imports filters. Ask the user where to import them from
75
 
     * and which filters to import.
76
 
     */
77
 
    QList<MailFilter*> importFilters( bool & canceled );
78
 
 
79
 
    /**
80
 
     * Writes the given list of @p filters to the given @p config file.
81
 
     */
82
 
    static void writeFiltersToConfig( const QList<MailFilter*> &filters, KSharedConfig::Ptr config, bool exportFilter = false );
83
 
 
84
 
    /**
85
 
     * Reads a list of filters from the given @p config file.
86
 
     */
87
 
    static QList<MailFilter*> readFiltersFromConfig( const KSharedConfig::Ptr config );
88
 
 
89
 
  private:
90
 
    //@cond PRIVATE
91
 
    Q_DISABLE_COPY( FilterImporterExporter )
92
 
 
93
 
    class Private;
94
 
    Private* const d;
95
 
    //@endcond
96
 
};
97
 
 
98
 
}
99
 
 
100
 
#endif