More filter infrastructure
[kworship.git] / kworship / KwFilterManager.h
blob7c24ac846db7a93b62f2085895c5b8014bfad866
1 /***************************************************************************
2 * This file is part of KWorship. *
3 * Copyright 2008 James Hogan <james@albanarts.com> *
4 * *
5 * KWorship is free software: you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation, either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * KWorship is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with KWorship. If not, write to the Free Software Foundation, *
17 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
18 ***************************************************************************/
20 #ifndef _KwFilterManager_h_
21 #define _KwFilterManager_h_
23 /**
24 * @file KwFilterManager.h
25 * @brief Manages file filters.
26 * @author James Hogan <james@albanarts.com>
29 #include <kdemacros.h>
31 #include <QList>
32 #include <QStringList>
34 class KwImportFilter;
35 class KwExportFilter;
36 class KwLoadSaveFilter;
38 /// Manages file filter.
39 class KDE_EXPORT KwFilterManager
41 public:
44 * Constructors + destructor
47 /// Primary constructor.
48 KwFilterManager();
50 /// Destructor.
51 virtual ~KwFilterManager();
54 * Main interface
57 /// Add a load save filter.
58 void addLoadSaveFilter(KwLoadSaveFilter* loadSaveFilter, bool makeDefault = false);
60 /// Add an import filter.
61 void addImportFilter(KwImportFilter* importFilter);
63 /// Add an export filter.
64 void addExportFilter(KwExportFilter* exportFilter);
66 /// Get load mime types.
67 QStringList loadMimeTypes() const;
69 /// Get save mime types.
70 QStringList saveMimeTypes() const;
72 /// Get import mime types.
73 QStringList importMimeTypes() const;
75 /// Get export mime types.
76 QStringList exportMimeTypes() const;
78 private:
81 * Variables
84 /// Default load save filter.
85 KwLoadSaveFilter* m_defaultLoadSaveFilter;
87 /// List of load save filters.
88 QList<KwLoadSaveFilter*> m_loadSaveFilters;
90 /// List of import filters.
91 QList<KwImportFilter*> m_importFilters;
93 /// List of export filters.
94 QList<KwExportFilter*> m_exportFilters;
97 #endif // _KwFilterManager_h_