lib

KoFilterManager Class Reference

#include <KoFilterManager.h>

List of all members.


Detailed Description

The class managing all the filters.

This class manages all filters for a KOffice application. Normally you will not have to use it, since KoMainWindow takes care of loading and saving documents.

KoFilter

Author:
Kalle Dalheimer <kalle@kde.org>

Torben Weis <weis@kde.org>

Werner Trobin <trobin@kde.org>

Definition at line 44 of file KoFilterManager.h.


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)
virtual ~KoFilterManager ()
QString import (const QString &url, KoFilter::ConversionStatus &status)
KoFilter::ConversionStatus exp0rt (const QString &url, QCString &mimeType)
void setBatchMode (const bool batch)
bool getBatchMode (void) const

Static Public Member Functions

Static API
static KOFFICECORE_EXPORT
QStringList 
mimeFilter (const QCString &mimetype, Direction direction, const QStringList &extraNativeMimeTypes=QStringList())
static QStringList mimeFilter ()
static 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

Member Enumeration Documentation

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

Definition at line 51 of file KoFilterManager.h.


Constructor & Destructor Documentation

KoFilterManager::KoFilterManager ( KoDocument document  ) 

Create a filter manager for a document.

Definition at line 116 of file KoFilterManager.cpp.

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 cannot 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 do not have to care about that.
parentChain The parent filter chain of this filter manager. Used to allow embedding for filters. Most likely you do not have to care.

Definition at line 127 of file KoFilterManager.cpp.


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 variable 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 141 of file KoFilterManager.cpp.

KoFilter::ConversionStatus KoFilterManager::exp0rt ( const QString &  url,
QCString &  mimeType 
)

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

If mimeType is empty, 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 234 of file KoFilterManager.cpp.

QStringList KoFilterManager::mimeFilter ( const QCString &  mimetype,
Direction  direction,
const QStringList &  extraNativeMimeTypes = QStringList() 
) [static]

Suitable for passing to KFileDialog::setMimeFilter.

The default mime gets set by the "users" of this method, as we do not have enough information here. Optionally, extraNativeMimeTypes are added after the native mimetype.

Definition at line 476 of file KoFilterManager.cpp.

QStringList KoFilterManager::mimeFilter (  )  [static]

The same method as KoFilterManager::mimeFilter but suited for KoShell.

We do not 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 are using.

Definition at line 502 of file KoFilterManager.cpp.

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 540 of file KoFilterManager.cpp.

void KoFilterManager::setBatchMode ( const bool  batch  ) 

Set the filter manager is batch mode (no dialog shown) instead of the interactive mode (dialog shown).

Since:
1.4

Definition at line 591 of file KoFilterManager.cpp.

bool KoFilterManager::getBatchMode ( void   )  const

Get if the filter manager is batch mode (true) or in interactive mode (true).

Since:
1.4

Definition at line 596 of file KoFilterManager.cpp.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys