kmail

filterimporterexporter.h
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 TQt library by Trolltech AS, Norway (or with modified versions
21  of TQt that use the same license as TQt), 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  TQt. 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 __FILTERIMPORTEREXPORTER_H__
31 #define __FILTERIMPORTEREXPORTER_H__
32 
33 #include <tqvaluelist.h>
34 #include <kdialogbase.h>
35 class KMFilter;
36 class TDEConfig;
37 class TQWidget;
38 class KPushButton;
39 
40 namespace KMail
41 {
42 
48 {
49 public:
50  FilterImporterExporter( TQWidget* parent, bool popFilter = false );
51  virtual ~FilterImporterExporter();
52 
56  void exportFilters( const TQValueList<KMFilter*> & );
57 
60  TQValueList<KMFilter*> importFilters();
61 
62  static void writeFiltersToConfig( const TQValueList<KMFilter*>& filters, TDEConfig* config, bool bPopFilter );
63  static TQValueList<KMFilter*> readFiltersFromConfig( TDEConfig* config, bool bPopFilter );
64 private:
65  TQWidget* mParent;
66  bool mPopFilter;
67 };
68 class FilterSelectionDialog : public KDialogBase
69 {
70  TQ_OBJECT
71 
72 public:
73  FilterSelectionDialog( TQWidget * parent = 0 );
74 
75  virtual ~FilterSelectionDialog();
76  virtual void slotCancel();
77  bool cancelled();
78  void setFilters( const TQValueList<KMFilter*>& filters );
79 
80  TQValueList<KMFilter*> selectedFilters() const;
81 public slots:
82  void slotUnselectAllButton();
83  void slotSelectAllButton();
84 private:
85  TDEListView *filtersListView;
86  TQValueList<KMFilter*> originalFilters;
87  bool wasCancelled;
88  KPushButton *selectAllButton;
89  KPushButton *unselectAllButton;
90 };
91 
92 }
93 
94 #endif /* __FILTERIMPORTEREXPORTER_H__ */
void exportFilters(const TQValueList< KMFilter * > &)
Export the given filter rules to a file which is asked from the user.
TQValueList< KMFilter * > importFilters()
Import filters.
Utility class that provides persisting of filters to/from TDEConfig.
folderdiaquotatab.h
Definition: aboutdata.cpp:40