lib Library API Documentation

koFilterManager.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
00003                  2000, 2001 Werner Trobin <trobin@kde.org>
00004    Copyright (C) 2004 Nicolas Goutte <goutte@kde.org>
00005 
00006    This library is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Library General Public
00008    License as published by the Free Software Foundation; either
00009    version 2 of the License, or (at your option) any later version.
00010 
00011    This library is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014    Library General Public License for more details.
00015 
00016    You should have received a copy of the GNU Library General Public License
00017    along with this library; see the file COPYING.LIB.  If not, write to
00018    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00019    Boston, MA 02111-1307, USA.
00020 */
00021 
00022 #ifndef __koffice_filter_manager_h__
00023 #define __koffice_filter_manager_h__
00024 
00025 #include <qobject.h>
00026 #include <qmap.h>
00027 #include <koFilterChain.h>
00028 #include <koffice_export.h>
00029 class KoDocument;
00030 
00044 class KOFFICECORE_EXPORT KoFilterManager : public QObject
00045 {
00046     Q_OBJECT
00047 public:
00051     enum Direction { Import = 1,  Export = 2 };
00052 
00056     KoFilterManager( KoDocument* document );
00071     KoFilterManager( const QString& url, const QCString& mimetypeHint = "",
00072                      KoFilterChain* const parentChain = 0 );
00073 
00074     virtual ~KoFilterManager();
00075 
00083     QString import( const QString& url, KoFilter::ConversionStatus& status );
00091     KoFilter::ConversionStatus exp0rt( const QString& url, QCString& mimeType );
00092 
00093 
00094     // === Static API ===
00101     KOFFICECORE_EXPORT static QStringList mimeFilter( const QCString& mimetype, Direction direction,
00102                                                       const QStringList& extraNativeMimeTypes = QStringList() );
00103 
00111     static QStringList mimeFilter();
00112 
00117     static bool filterAvailable( KoFilterEntry::Ptr entry );
00118 
00124     void setBatchMode ( const bool batch );
00125 
00131     bool getBatchMode ( void ) const;
00132 
00133 signals:
00134     void sigProgress( int );
00135 
00136 private:
00137     // === API for KoFilterChains === (internal)
00138     // The friend methods are private in KoFilterChain and
00139     // just forward calls to the methods here. Should be
00140     // pretty save.
00141     friend QString KoFilterChain::filterManagerImportFile() const;
00142     QString importFile() const { return m_importUrl; }
00143     friend QString KoFilterChain::filterManagerExportFile() const;
00144     QString exportFile() const { return m_exportUrl; }
00145     friend KoDocument* KoFilterChain::filterManagerKoDocument() const;
00146     KoDocument* document() const { return m_document; }
00147     friend int KoFilterChain::filterManagerDirection() const;
00148     int direction() const { return static_cast<int>( m_direction ); }
00149     friend KoFilterChain* const KoFilterChain::filterManagerParentChain() const;
00150     KoFilterChain* const parentChain() const { return m_parentChain; }
00151 
00152     // Private API
00153     KoFilterManager( const KoFilterManager& rhs );
00154     KoFilterManager &operator=( const KoFilterManager& rhs );
00155 
00156     void importErrorHelper( const QString& mimeType, const bool suppressDialog = false );
00157 
00158     static const int s_area;
00159 
00160     KoDocument* m_document;
00161     KoFilterChain* const m_parentChain;
00162     QString m_importUrl, m_exportUrl;
00163     QCString m_importUrlMimetypeHint;  
00164     KOffice::Graph m_graph;
00165     Direction m_direction;
00166 
00168     static QMap<QString, bool> m_filterAvailable;
00169 
00170     class Private;
00171     Private *d;
00172 };
00173 
00174 #endif  // __koffice_filter_manager_h__
KDE Logo
This file is part of the documentation for lib Library Version 1.4.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Mon Feb 13 09:40:00 2006 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003