Mime type based filter loading
[kworship.git] / kworship / KwExportFilter.h
blobdd57c1e6c01ef1b1ce5a4c7fa41493a429ed4747
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 _KwExportFilter_h_
21 #define _KwExportFilter_h_
23 /**
24 * @file KwExportFilter.h
25 * @brief Export file filter.
26 * @author James Hogan <james@albanarts.com>
29 #include "KwFilter.h"
31 #include <kdemacros.h>
33 #include <QStringList>
34 #include <QString>
35 #include <QList>
37 class KwDocument;
38 class KUrl;
40 /// Export file filter.
41 class KDE_EXPORT KwExportFilter : public virtual KwFilter
43 public:
46 * Types
49 /// Abstract description of something that cannot be saved.
50 class Limitation
52 public:
55 * Constructors + destructor
58 /// Default constructor.
59 Limitation();
61 /// Destructor.
62 virtual ~Limitation();
65 * Main interface
68 /// Get a short description of what won't be saved
69 virtual QString briefDescription() = 0;
71 /// Get a detailed description of what won't be saved
72 virtual QString detailedDescription() = 0;
75 /// Container class of limitations.
76 class Limitations
78 public:
81 * Constructors + destructor
84 /// Default constructor.
85 Limitations();
87 /// Destructor.
88 virtual ~Limitations();
90 private:
93 * Variables
96 /// List of limitations.
97 QList<Limitation*> m_limitations;
101 * Constructors + destructor
104 /// Primary constructor.
105 KwExportFilter();
107 /// Destructor.
108 virtual ~KwExportFilter();
111 * Main interface
114 /// Obtain information about any data that can not be saved.
115 void saveLimitations(KwDocument* doc, Limitations* o_limitations);
117 /// Save the document to file.
118 virtual bool save(KwDocument* doc, const KUrl& url) = 0;
121 * Accessors
124 /// Get a list of export mime types.
125 QStringList exportMimeTypes() const;
127 protected:
130 * Virtual interface
133 /// Obtain information about any data that can not be saved.
134 virtual void v_saveLimitations(KwDocument* doc, Limitations* o_limitations) = 0;
137 * Variables
140 /// List of export mime types.
141 QStringList m_exportMimeTypes;
144 #endif // _KwExportFilter_h_