lib

KoFilterManager Class Reference

#include <KoFilterManager.h>

Inherits TQObject.

Public Types

enum  Direction { Import = 1 , Export = 2 }
 

Public Member Functions

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

Static API

void setBatchMode (const bool batch)
 
bool getBatchMode (void) const
 
static KOFFICECORE_EXPORT TQStringList mimeFilter (const TQCString &mimetype, Direction direction, const TQStringList &extraNativeMimeTypes=TQStringList())
 
static TQStringList mimeFilter ()
 
static bool filterAvailable (KoFilterEntry::Ptr entry)
 
void sigProgress (int)
 
TQString KoFilterChain::filterManagerImportFile () const
 
TQString KoFilterChain::filterManagerExportFile () const
 
KoDocument * KoFilterChain::filterManagerKoDocument () const
 
int KoFilterChain::filterManagerDirection () const
 
KoFilterChain *const KoFilterChain::filterManagerParentChain () const
 

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.nosp@m.@kde.nosp@m..org
Torben Weis weis@.nosp@m.kde..nosp@m.org
Werner Trobin trobi.nosp@m.n@kd.nosp@m.e.org

Definition at line 44 of file KoFilterManager.h.

Member Enumeration Documentation

◆ Direction

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

Definition at line 52 of file KoFilterManager.h.

Constructor & Destructor Documentation

◆ KoFilterManager() [1/2]

KoFilterManager::KoFilterManager ( KoDocument *  document)

Create a filter manager for a document.

Definition at line 116 of file KoFilterManager.cpp.

◆ KoFilterManager() [2/2]

KoFilterManager::KoFilterManager ( const TQString &  url,
const TQCString &  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
urlThe file you want to export
mimetypeHintThe 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.
parentChainThe 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.

◆ ~KoFilterManager()

KoFilterManager::~KoFilterManager ( )
virtual

Definition at line 136 of file KoFilterManager.cpp.

Member Function Documentation

◆ exp0rt()

KoFilter::ConversionStatus KoFilterManager::exp0rt ( const TQString &  url,
TQCString &  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.

◆ filterAvailable()

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.

◆ getBatchMode()

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.

◆ import()

TQString KoFilterManager::import ( const TQString &  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 TQString 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.

◆ mimeFilter() [1/2]

TQStringList 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.

◆ mimeFilter() [2/2]

TQStringList KoFilterManager::mimeFilter ( const TQCString &  mimetype,
Direction  direction,
const TQStringList &  extraNativeMimeTypes = TQStringList() 
)
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.

◆ setBatchMode()

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.


The documentation for this class was generated from the following files: