lib Library API Documentation

KoFilterManager Class Reference

This class manages all filters for a KOffice application. The class managing all the filters. KoFilter. More...

#include <koFilterManager.h>

Inheritance diagram for KoFilterManager:

QObject List of all members.

Public Types

enum  Direction { Import = 1, Export = 2 }

Signals

void sigProgress (int)

Public Member Functions

 KoFilterManager (KoDocument *document)
 KoFilterManager (const QString &url, const QCString &mimetypeHint="", KoFilterChain *const parentChain=0)
QString import (const QString &url, KoFilter::ConversionStatus &status)
KoFilter::ConversionStatus exp0rt (const QString &url, QCString &mimeType)

Static Public Member Functions

QStringList mimeFilter (const QCString &mimetype, Direction direction)
QStringList mimeFilter ()
bool filterAvailable (KoFilterEntry::Ptr entry)

Friends

QString KoFilterChain::filterManagerImportFile () const
QString KoFilterChain::filterManagerExportFile () const
KoDocumentKoFilterChain::filterManagerKoDocument () const
int KoFilterChain::filterManagerDirection () const
KoFilterChain *const KoFilterChain::filterManagerParentChain () const

Detailed Description

This class manages all filters for a KOffice application. The class managing all the filters. KoFilter.

Normally you won't have to use it, since KoMainWindow takes care of loading and saving documents.

Author:
Kalle Dalheimer <kalle@kde.org>

Torben Weis <weis@kde.org>

Werner Trobin <trobin@kde.org>

Version:
Id
koFilterManager.h,v 1.56 2003/06/29 14:22:09 lukas Exp

Definition at line 43 of file koFilterManager.h.


Member Enumeration Documentation

enum KoFilterManager::Direction
 

This enum is used to distinguish the import/export cases.

Definition at line 50 of file koFilterManager.h.


Constructor & Destructor Documentation

KoFilterManager::KoFilterManager KoDocument document  ) 
 

Create a filter manager for a document.

Definition at line 109 of file koFilterManager.cc.

References KoFilterManager().

Referenced by KoFilterManager().

KoFilterManager::KoFilterManager const QString url,
const QCString mimetypeHint = "",
KoFilterChain *const  parentChain = 0
 

Create a filter manager for a filter which wants to embed something.

The url it passes is the file to convert, obviously. You can't use the import() method -- use exp0rt() to convert the file to the destination mimetype you prefer.

Parameters:
url The file you want to export
mimetypeHint The mimetype of the file you want to export. You have to specify this information only if the automatic detection will fail because e.g. you saved an embedded stream to a *.tmp file. Most likely you don't have to care about that.
parentChain The parent filter chain of this filter manager. Used to allow embedding for filters. Most likely you don't have to care.

Definition at line 118 of file koFilterManager.cc.

References KoFilterManager().


Member Function Documentation

QString KoFilterManager::import const QString url,
KoFilter::ConversionStatus status
 

Imports the passed URL and returns the resultant filename (most likely some file in /tmp).

The status vaiable signals the success/error of the conversion If the QString which is returned isEmpty() and the status is OK, then we imported the file directly into the document.

Definition at line 129 of file koFilterManager.cc.

References import(), KoDocument::isAutoErrorHandlingEnabled(), mimeFilter(), and KoDocument::nativeFormatMimeType().

Referenced by import().

KoFilter::ConversionStatus KoFilterManager::exp0rt const QString url,
QCString mimeType
 

Exports the given file/document to the specified URL/mimetype.

If mimetype.isEmpty() then the closest matching KOffice part is searched and when the method returns "mimetype" contains this mimetype. Oh, well, export is a C++ keyword ;)

Definition at line 220 of file koFilterManager.cc.

References exp0rt(), mimeFilter(), and KoDocument::nativeFormatMimeType().

Referenced by KoEmbeddingFilter::embedPart(), and exp0rt().

QStringList KoFilterManager::mimeFilter const QCString mimetype,
Direction  direction
[static]
 

Suitable for passing to KFileDialog::setMimeFilter.

The default mime gets set by the "users" of this method, as we don't have enough information here.

Definition at line 402 of file koFilterManager.cc.

Referenced by exp0rt(), and import().

QStringList KoFilterManager::mimeFilter  )  [static]
 

The same method as above but suited for KoShell.

We don't need the mimetype, as we will simply use all available KOffice mimetypes. The Direction enum is omitted, as we only call this for importing. When saving from KoShell we already know the KOffice part we're using.

Definition at line 409 of file koFilterManager.cc.

Referenced by KoMainWindow::saveDocument().

bool KoFilterManager::filterAvailable KoFilterEntry::Ptr  entry  )  [static]
 

Method used to check if that filter is available at all.

Note: Slow, but cached

Definition at line 443 of file koFilterManager.cc.

References filterAvailable().

Referenced by filterAvailable().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for lib Library Version 1.3.5.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Nov 17 06:54:22 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003