Warning, file /office/calligra/libs/main/KoFilterEntry.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /* This file is part of the KDE project
0002    Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
0003    Copyright     2007       David Faure <faure@kde.org>
0004 
0005 This library is free software; you can redistribute it and/or
0006 modify it under the terms of the GNU Library General Public
0007 License as published by the Free Software Foundation; either
0008 version 2 of the License, or (at your option) any later version.
0009 
0010 This library is distributed in the hope that it will be useful,
0011 but WITHOUT ANY WARRANTY; without even the implied warranty of
0012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0013 Library General Public License for more details.
0014 
0015 You should have received a copy of the GNU Library General Public License
0016 along with this library; see the file COPYING.LIB.  If not, write to
0017 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0018 Boston, MA 02110-1301, USA.
0019 */
0020 
0021 #ifndef __ko_filter_entry_h__
0022 #define __ko_filter_entry_h__
0023 
0024 #include <QExplicitlySharedDataPointer>
0025 #include <QList>
0026 #include <QStringList>
0027 #include "komain_export.h"
0028 
0029 class QObject;
0030 class QPluginLoader;
0031 class KoFilter;
0032 class KoFilterChain;
0033 /**
0034  *  Represents an available filter.
0035  */
0036 class KOMAIN_TEST_EXPORT KoFilterEntry : public QSharedData
0037 {
0038 
0039 public:
0040     typedef QExplicitlySharedDataPointer<KoFilterEntry> Ptr;
0041 
0042     //KoFilterEntry() : weight( 0 ) { m_service = 0; } // for QList
0043     /**
0044      * @param loader pluginloader for the filter, KoFilterEntry takes ownership
0045      */
0046     explicit KoFilterEntry(QPluginLoader *loader);
0047     ~KoFilterEntry();
0048 
0049     KoFilter* createFilter(KoFilterChain* chain, QObject* parent = 0);
0050 
0051     /**
0052      *  The imported mimetype(s).
0053      */
0054     QStringList import;
0055 
0056     /**
0057      *  The exported mimetype(s).
0058      */
0059     QStringList export_;
0060 
0061     /**
0062      *  The "weight" of this filter path. Has to be > 0 to be valid.
0063      */
0064     unsigned int weight;
0065 
0066     /**
0067      *  Do we have to check during runtime?
0068      */
0069     QString available;
0070 
0071     /**
0072      *  @return TRUE if the filter can import the requested mimetype.
0073      */
0074     bool imports(const QString& _mimetype) const {
0075         return (import.contains(_mimetype));
0076     }
0077 
0078     /**
0079      *  @return TRUE if the filter can export the requested mimetype.
0080      */
0081     bool exports(const QString& _m) const {
0082         return (export_.contains(_m));
0083     }
0084 
0085     QString fileName() const;
0086 
0087     /**
0088      *  This function will query KDED to find all available filters.
0089      */
0090     static QList<KoFilterEntry::Ptr> query();
0091 
0092 
0093 private:
0094     QPluginLoader * const m_loader;
0095 };
0096 
0097 #endif