19#include <tqmetaobject.h>
20#include <tdetempfile.h>
22#include <KoFilterChain.h>
23#include <KoQueryTrader.h>
24#include <KoFilterManager.h>
25#include <KoDocument.h>
28#include <priorityqueue.h>
35 const char*
const SIGNAL_PREFIX =
"commSignal";
36 const int SIGNAL_PREFIX_LEN = 10;
37 const char*
const SLOT_PREFIX =
"commSlot";
38 const int SLOT_PREFIX_LEN = 8;
42KoFilterChain::ChainLink::ChainLink(
KoFilterChain* chain, KoFilterEntry::Ptr filterEntry,
43 const TQCString& from,
const TQCString& to ) :
44 m_chain( chain ), m_filterEntry( filterEntry ), m_from( from ), m_to( to ),
51 if ( !m_filterEntry ) {
52 kdError( 30500 ) <<
"This filter entry is null. Strange stuff going on." << endl;
53 return KoFilter::CreationError;
56 m_filter = m_filterEntry->createFilter( m_chain, 0, 0 );
59 kdError( 30500 ) <<
"Couldn't create the filter." << endl;
60 return KoFilter::CreationError;
63 if ( parentChainLink )
64 setupCommunication( parentChainLink->m_filter );
72void KoFilterChain::ChainLink::dump()
const
74 kdDebug( 30500 ) <<
" Link: " << m_filterEntry->service()->name() << endl;
77int KoFilterChain::ChainLink::lruPartIndex()
const
79 if ( m_filter && m_filter->inherits(
"KoEmbeddingFilter" ) )
84void KoFilterChain::ChainLink::setupCommunication(
const KoFilter*
const parentFilter )
const
87 TQObject::connect( m_filter, TQ_SIGNAL( sigProgress(
int ) ),
88 m_chain->manager(), TQ_SIGNAL( sigProgress(
int ) ) );
93 const TQMetaObject*
const parent = parentFilter->metaObject();
94 const TQMetaObject*
const child = m_filter->metaObject();
95 if ( !parent || !child )
98 setupConnections( parentFilter, parent->signalNames(), m_filter, child->slotNames() );
99 setupConnections( m_filter, child->signalNames(), parentFilter, parent->slotNames() );
102void KoFilterChain::ChainLink::setupConnections(
const KoFilter* sender,
const TQStrList& sigs,
103 const KoFilter* receiver,
const TQStrList& sl0ts )
const
105 TQStrListIterator signalIt( sigs );
106 for ( ; signalIt.current(); ++signalIt ) {
107 if ( strncmp( signalIt.current(), SIGNAL_PREFIX, SIGNAL_PREFIX_LEN ) == 0 ) {
108 TQStrListIterator slotIt( sl0ts );
109 for ( ; slotIt.current(); ++slotIt ) {
110 if ( strncmp( slotIt.current(), SLOT_PREFIX, SLOT_PREFIX_LEN ) == 0 ) {
111 if ( strcmp( signalIt.current() + SIGNAL_PREFIX_LEN, slotIt.current() + SLOT_PREFIX_LEN ) == 0 ) {
112 TQCString signalString;
113 signalString.setNum( TQ_SIGNAL_CODE );
114 signalString += signalIt.current();
115 TQCString slotString;
116 slotString.setNum( TQ_SLOT_CODE );
117 slotString += slotIt.current();
118 TQObject::connect( sender, signalString, receiver, slotString );
127KoFilterChain::~KoFilterChain()
129 if ( filterManagerParentChain() && filterManagerParentChain()->m_outputStorage )
139 int count = m_chainLinks.count();
142 const ChainLink* parentChainLink = 0;
143 if ( filterManagerParentChain() )
144 parentChainLink = filterManagerParentChain()->m_chainLinks.current();
147 m_chainLinks.first();
148 for ( ; count > 1 && m_chainLinks.current() && status == KoFilter::OK;
149 m_chainLinks.next(), --count ) {
150 status = m_chainLinks.current()->invokeFilter( parentChainLink );
155 if ( !m_chainLinks.current() ) {
156 kdWarning( 30500 ) <<
"Huh?? Found a null pointer in the chain" << endl;
157 return KoFilter::StupidError;
160 if ( status == KoFilter::OK ) {
161 if ( m_state & Beginning )
165 status = m_chainLinks.current()->invokeFilter( parentChainLink );
170 if (status == KoFilter::OK)
177 if ( m_state == Done )
184 if ( m_inputQueried == File )
186 else if ( m_inputQueried != Nil ) {
187 kdWarning( 30500 ) <<
"You already asked for some different source." << endl;
190 m_inputQueried = File;
192 if ( m_state & Beginning ) {
194 KoFilterManager::Import )
195 m_inputFile = filterManagerImportFile();
197 inputFileHelper( filterManagerKoDocument(), filterManagerImportFile() );
200 if ( m_inputFile.isEmpty() )
201 inputFileHelper( m_inputDocument, TQString() );
210 if ( filterManagerParentChain() )
211 kdWarning( 30500 )<<
"An embedded filter has to use storageFile()!" << endl;
213 if ( m_outputQueried == File )
215 else if ( m_outputQueried != Nil ) {
216 kdWarning( 30500 ) <<
"You already asked for some different destination." << endl;
219 m_outputQueried = File;
221 if ( m_state & End ) {
223 KoFilterManager::Import )
224 outputFileHelper(
false );
226 m_outputFile = filterManagerExportFile();
229 outputFileHelper(
true );
238 if ( m_outputQueried == Nil && mode == KoStore::Write && filterManagerParentChain() )
239 return storageInitEmbedding( name );
242 if ( m_inputQueried == Storage && mode == KoStore::Read &&
243 m_inputStorage && m_inputStorage->
mode() == KoStore::Read )
244 return storageNewStreamHelper( &m_inputStorage, &m_inputStorageDevice, name );
245 else if ( m_outputQueried == Storage && mode == KoStore::Write &&
246 m_outputStorage && m_outputStorage->
mode() == KoStore::Write )
247 return storageNewStreamHelper( &m_outputStorage, &m_outputStorageDevice, name );
248 else if ( m_inputQueried == Nil && mode == KoStore::Read )
249 return storageHelper(
inputFile(), name, KoStore::Read,
250 &m_inputStorage, &m_inputStorageDevice );
251 else if ( m_outputQueried == Nil && mode == KoStore::Write )
252 return storageHelper(
outputFile(), name, KoStore::Write,
253 &m_outputStorage, &m_outputStorageDevice );
255 kdWarning( 30500 ) <<
"Oooops, how did we get here? You already asked for a"
256 <<
" different source/destination?" << endl;
264 return m_inputDocument;
265 else if ( m_inputQueried != Nil ) {
266 kdWarning( 30500 ) <<
"You already asked for some different source." << endl;
270 if ( ( m_state & Beginning ) &&
272 filterManagerKoDocument() )
273 m_inputDocument = filterManagerKoDocument();
274 else if ( !m_inputDocument )
275 m_inputDocument = createDocument(
inputFile() );
278 return m_inputDocument;
285 if ( filterManagerParentChain() ) {
286 kdWarning( 30500 )<<
"An embedded filter has to use storageFile()!" << endl;
291 return m_outputDocument;
292 else if ( m_outputQueried != Nil ) {
293 kdWarning( 30500 ) <<
"You already asked for some different destination." << endl;
297 if ( ( m_state & End ) &&
299 filterManagerKoDocument() )
300 m_outputDocument = filterManagerKoDocument();
302 m_outputDocument = createDocument( m_chainLinks.current()->to() );
305 return m_outputDocument;
308void KoFilterChain::dump()
const
310 kdDebug( 30500 ) <<
"########## KoFilterChain with " << m_chainLinks.count() <<
" members:" << endl;
311 TQPtrListIterator<ChainLink> it( m_chainLinks );
312 for ( ; it.current(); ++it )
313 it.current()->dump();
314 kdDebug( 30500 ) <<
"########## KoFilterChain (done) ##########" << endl;
318 m_manager( manager ), m_state( Beginning ), m_inputStorage( 0 ),
319 m_inputStorageDevice( 0 ), m_outputStorage( 0 ), m_outputStorageDevice( 0 ),
320 m_inputDocument( 0 ), m_outputDocument( 0 ), m_inputTempFile( 0 ),
321 m_outputTempFile( 0 ), m_inputQueried( Nil ), m_outputQueried( Nil ), d( 0 )
324 m_chainLinks.setAutoDelete(
true );
327void KoFilterChain::appendChainLink( KoFilterEntry::Ptr filterEntry,
const TQCString& from,
const TQCString& to )
329 m_chainLinks.append(
new ChainLink(
this, filterEntry, from, to ) );
332void KoFilterChain::prependChainLink( KoFilterEntry::Ptr filterEntry,
const TQCString& from,
const TQCString& to )
334 m_chainLinks.prepend(
new ChainLink(
this, filterEntry, from, to ) );
337void KoFilterChain::enterDirectory(
const TQString& directory )
341 if ( m_outputStorage )
343 m_internalEmbeddingDirectories.append( directory );
346void KoFilterChain::leaveDirectory()
348 if ( m_outputStorage )
350 if ( !m_internalEmbeddingDirectories.isEmpty() )
351 m_internalEmbeddingDirectories.pop_back();
354TQString KoFilterChain::filterManagerImportFile()
const
356 return m_manager->importFile();
359TQString KoFilterChain::filterManagerExportFile()
const
361 return m_manager->exportFile();
364KoDocument* KoFilterChain::filterManagerKoDocument()
const
366 return m_manager->document();
369int KoFilterChain::filterManagerDirection()
const
371 return m_manager->direction();
374KoFilterChain*
const KoFilterChain::filterManagerParentChain()
const
376 return m_manager->parentChain();
379void KoFilterChain::manageIO()
381 m_inputQueried = Nil;
382 m_outputQueried = Nil;
384 delete m_inputStorageDevice;
385 m_inputStorageDevice = 0;
386 if ( m_inputStorage ) {
387 m_inputStorage->
close();
388 delete m_inputStorage;
391 if ( m_inputTempFile ) {
392 m_inputTempFile->close();
393 delete m_inputTempFile;
396 m_inputFile = TQString();
398 if ( !m_outputFile.isEmpty() ) {
399 m_inputFile = m_outputFile;
400 m_outputFile = TQString();
401 m_inputTempFile = m_outputTempFile;
402 m_outputTempFile = 0;
404 delete m_outputStorageDevice;
405 m_outputStorageDevice = 0;
406 if ( m_outputStorage ) {
407 m_outputStorage->
close();
410 if ( !filterManagerParentChain() || m_outputStorage->
mode() != KoStore::Write )
411 delete m_outputStorage;
416 if ( m_inputDocument != filterManagerKoDocument() )
417 delete m_inputDocument;
418 m_inputDocument = m_outputDocument;
419 m_outputDocument = 0;
422void KoFilterChain::finalizeIO()
428 if ( m_inputDocument &&
430 kdDebug( 30500 ) <<
"Saving the output document to the export file" << endl;
432 m_inputFile = filterManagerExportFile();
436bool KoFilterChain::createTempFile( KTempFile** tempFile,
bool autoDelete )
439 kdError( 30500 ) <<
"Ooops, why is there already a temp file???" << endl;
442 *tempFile =
new KTempFile();
443 ( *tempFile )->setAutoDelete( autoDelete );
444 return ( *tempFile )->status() == 0;
447void KoFilterChain::inputFileHelper(
KoDocument* document,
const TQString& alternativeFile )
450 if ( !createTempFile( &m_inputTempFile ) ) {
451 delete m_inputTempFile;
453 m_inputFile = TQString();
457 delete m_inputTempFile;
459 m_inputFile = TQString();
462 m_inputFile = m_inputTempFile->name();
465 m_inputFile = alternativeFile;
468void KoFilterChain::outputFileHelper(
bool autoDelete )
470 if ( !createTempFile( &m_outputTempFile, autoDelete ) ) {
471 delete m_outputTempFile;
472 m_outputTempFile = 0;
473 m_outputFile = TQString();
476 m_outputFile = m_outputTempFile->name();
480 const TQString& name )
484 if ( ( *storage )->isOpen() )
485 ( *storage )->close();
486 if ( ( *storage )->bad() )
487 return storageCleanupHelper( storage );
488 if ( !( *storage )->open( name ) )
495KoStoreDevice* KoFilterChain::storageHelper(
const TQString& file,
const TQString& streamName,
496 KoStore::Mode mode,
KoStore** storage,
499 if ( file.isEmpty() )
502 kdDebug( 30500 ) <<
"Uh-oh, we forgot to clean up..." << endl;
506 storageInit( file, mode, storage );
508 if ( ( *storage )->bad() )
509 return storageCleanupHelper( storage );
514 if ( mode == KoStore::Read )
515 m_inputQueried = Storage;
517 m_outputQueried = Storage;
519 return storageCreateFirstStream( streamName, storage, device );
522void KoFilterChain::storageInit(
const TQString& file, KoStore::Mode mode,
KoStore** storage )
524 TQCString appIdentification(
"" );
525 if ( mode == KoStore::Write ) {
532 appIdentification = m_chainLinks.current()->to();
537KoStoreDevice* KoFilterChain::storageInitEmbedding(
const TQString& name )
539 if ( m_outputStorage ) {
540 kdWarning( 30500 ) <<
"Ooops! Something's really screwed here." << endl;
544 m_outputStorage = filterManagerParentChain()->m_outputStorage;
546 if ( !m_outputStorage ) {
549 storageInit( filterManagerParentChain()->
outputFile(), KoStore::Write, &m_outputStorage );
552 filterManagerParentChain()->m_outputStorage = m_outputStorage;
553 filterManagerParentChain()->m_outputQueried = Storage;
556 if ( m_outputStorage->
isOpen() )
557 m_outputStorage->
close();
558 if ( m_outputStorage->
bad() )
559 return storageCleanupHelper( &m_outputStorage );
561 m_outputQueried = Storage;
565 const int lruPartIndex = filterManagerParentChain()->m_chainLinks.current()->lruPartIndex();
566 if ( lruPartIndex == -1 ) {
567 kdError( 30500 ) <<
"Huh! You want to use embedding features w/o inheriting KoEmbeddingFilter?" << endl;
568 return storageCleanupHelper( &m_outputStorage );
571 if ( !m_outputStorage->
enterDirectory( TQString(
"part%1" ).arg( lruPartIndex ) ) )
572 return storageCleanupHelper( &m_outputStorage );
574 return storageCreateFirstStream( name, &m_outputStorage, &m_outputStorageDevice );
577KoStoreDevice* KoFilterChain::storageCreateFirstStream(
const TQString& streamName,
KoStore** storage,
583 if ( !m_internalEmbeddingDirectories.isEmpty() ) {
584 TQStringList::ConstIterator it = m_internalEmbeddingDirectories.begin();
585 TQStringList::ConstIterator end = m_internalEmbeddingDirectories.end();
586 for ( ; it != end && ( *storage )->enterDirectory( *it ); ++it );
589 if ( !( *storage )->open( streamName ) )
593 kdDebug( 30500 ) <<
"Uh-oh, we forgot to clean up the storage device!" << endl;
594 ( *storage )->close();
595 return storageCleanupHelper( storage );
604 if ( *storage != m_outputStorage || !filterManagerParentChain() ||
605 ( *storage )->mode() != KoStore::Write )
611KoDocument* KoFilterChain::createDocument(
const TQString& file )
615 KMimeType::Ptr t = KMimeType::findByURL( url, 0,
true );
616 if ( t->name() == KMimeType::defaultMimeType() ) {
617 kdError( 30500 ) <<
"No mimetype found for " << file << endl;
621 KoDocument *doc = createDocument( TQCString( t->name().latin1() ) );
624 kdError( 30500 ) <<
"Couldn't load from the file" << endl;
631KoDocument* KoFilterChain::createDocument(
const TQCString& mimeType )
637 kdError( 30500 ) <<
"Couldn't find a part that can handle mimetype " << mimeType << endl;
642 kdError( 30500 ) <<
"Couldn't create the document" << endl;
651 Edge::Edge( Vertex* vertex, KoFilterEntry::Ptr filterEntry ) :
652 m_vertex( vertex ), m_filterEntry( filterEntry ), d( 0 )
656 void Edge::relax(
const Vertex* predecessor, PriorityQueue<Vertex>& queue )
658 if ( !m_vertex || !predecessor || !m_filterEntry )
660 if ( m_vertex->setKey( predecessor->key() + m_filterEntry->weight ) ) {
661 queue.keyDecreased( m_vertex );
662 m_vertex->setPredecessor( predecessor );
666 void Edge::dump(
const TQCString& indent )
const
669 kdDebug( 30500 ) << indent <<
"Edge -> '" << m_vertex->mimeType()
670 <<
"' (" << m_filterEntry->weight <<
")" << endl;
672 kdDebug( 30500 ) << indent <<
"Edge -> '(null)' ("
673 << m_filterEntry->weight <<
")" << endl;
677 Vertex::Vertex(
const TQCString& mimeType ) : m_predecessor( 0 ), m_mimeType( mimeType ),
678 m_weight( UINT_MAX ), m_index( -1 ), d( 0 )
680 m_edges.setAutoDelete(
true );
683 bool Vertex::setKey(
unsigned int key )
685 if ( m_weight > key ) {
698 void Vertex::addEdge(
const Edge* edge )
700 if ( !edge || edge->weight() == 0 )
702 m_edges.append( edge );
705 const Edge* Vertex::findEdge(
const Vertex* vertex )
const
709 const Edge* edge = 0;
710 TQPtrListIterator<Edge> it( m_edges );
712 for ( ; it.current(); ++it ) {
713 if ( it.current()->vertex() == vertex &&
714 ( !edge || it.current()->weight() < edge->weight() ) )
720 void Vertex::relaxVertices( PriorityQueue<Vertex>& queue )
722 for ( Edge *e = m_edges.first(); e; e = m_edges.next() )
723 e->relax(
this, queue );
726 void Vertex::dump(
const TQCString& indent )
const
728 kdDebug( 30500 ) << indent <<
"Vertex: " << m_mimeType <<
" (" << m_weight <<
"):" << endl;
729 const TQCString i( indent +
" " );
730 TQPtrListIterator<Edge> it( m_edges );
731 for ( ; it.current(); ++it )
732 it.current()->dump( i );
736 Graph::Graph(
const TQCString& from ) : m_vertices( 47 ), m_from( from ),
737 m_graphValid( false ), d( 0 )
739 m_vertices.setAutoDelete(
true );
744 void Graph::setSourceMimeType(
const TQCString& from )
746 if ( from == m_from )
749 m_graphValid =
false;
752 TQAsciiDictIterator<Vertex> it( m_vertices );
753 for ( ; it.current(); ++it )
754 it.current()->reset();
760 KoFilterChain::Ptr Graph::chain(
const KoFilterManager* manager, TQCString& to )
const
762 if ( !isValid() || !manager )
765 if ( to.isEmpty() ) {
766 to = findKOfficePart();
771 const Vertex* vertex = m_vertices[ to ];
772 if ( !vertex || vertex->key() == UINT_MAX )
778 const Vertex* tmp = vertex->predecessor();
780 const Edge*
const edge = tmp->findEdge( vertex );
782 ret->prependChainLink( edge->filterEntry(), tmp->mimeType(), vertex->mimeType() );
784 tmp = tmp->predecessor();
789 void Graph::dump()
const
791 kdDebug( 30500 ) <<
"+++++++++ Graph::dump +++++++++" << endl;
792 kdDebug( 30500 ) <<
"From: " << m_from << endl;
793 TQAsciiDictIterator<Vertex> it( m_vertices );
794 for ( ; it.current(); ++it )
795 it.current()->dump(
" " );
796 kdDebug( 30500 ) <<
"+++++++++ Graph::dump (done) +++++++++" << endl;
801 void Graph::buildGraph()
805 TQValueList<KoDocumentEntry>::ConstIterator partIt( parts.begin() );
806 TQValueList<KoDocumentEntry>::ConstIterator partEnd( parts.end() );
808 while ( partIt != partEnd ) {
809 TQStringList nativeMimeTypes = ( *partIt ).service()->property(
"X-TDE-ExtraNativeMimeTypes" ).toStringList();
810 nativeMimeTypes += ( *partIt ).service()->property(
"X-TDE-NativeMimeType" ).toString();
811 TQStringList::ConstIterator it = nativeMimeTypes.begin();
812 TQStringList::ConstIterator end = nativeMimeTypes.end();
813 for ( ; it != end; ++it )
814 if ( !(*it).isEmpty() )
815 m_vertices.insert( (*it).latin1(),
new Vertex( (*it).latin1() ) );
820 TQValueList<KoFilterEntry::Ptr>::ConstIterator it = filters.begin();
821 TQValueList<KoFilterEntry::Ptr>::ConstIterator end = filters.end();
823 for ( ; it != end; ++it ) {
825 TQStringList::ConstIterator importIt = ( *it )->import.begin();
826 TQStringList::ConstIterator importEnd = ( *it )->import.end();
827 for ( ; importIt != importEnd; ++importIt ) {
828 const TQCString key = ( *importIt ).latin1();
830 if ( !m_vertices[ key ] )
831 m_vertices.insert( key,
new Vertex( key ) );
836 TQStringList::ConstIterator exportIt = ( *it )->export_.begin();
837 TQStringList::ConstIterator exportEnd = ( *it )->export_.end();
839 for ( ; exportIt != exportEnd; ++exportIt ) {
841 const TQCString key = ( *exportIt ).latin1();
842 Vertex* exp = m_vertices[ key ];
844 exp =
new Vertex( key );
845 m_vertices.insert( key, exp );
848 importIt = ( *it )->import.begin();
849 for ( ; importIt != importEnd; ++importIt )
850 m_vertices[ ( *importIt ).latin1() ]->addEdge(
new Edge( exp, *it ) );
854 kdDebug( 30500 ) <<
"Filter: " << ( *it )->service()->name() <<
" doesn't apply." << endl;
866 void Graph::shortestPaths()
869 Vertex* from = m_vertices[ m_from ];
877 PriorityQueue<Vertex> queue( m_vertices );
879 while ( !queue.isEmpty() ) {
880 Vertex *min = queue.extractMinimum();
882 if ( min->key() == UINT_MAX )
884 min->relaxVertices( queue );
889 TQCString Graph::findKOfficePart()
const
893 TQValueList<KoDocumentEntry>::ConstIterator partIt( parts.begin() );
894 TQValueList<KoDocumentEntry>::ConstIterator partEnd( parts.end() );
899 while ( !v && partIt != partEnd ) {
900 TQStringList nativeMimeTypes = ( *partIt ).service()->property(
"X-TDE-ExtraNativeMimeTypes" ).toStringList();
901 nativeMimeTypes += ( *partIt ).service()->property(
"X-TDE-NativeMimeType" ).toString();
902 TQStringList::ConstIterator it = nativeMimeTypes.begin();
903 TQStringList::ConstIterator end = nativeMimeTypes.end();
904 for ( ; !v && it != end; ++it )
905 if ( !(*it).isEmpty() )
906 v = m_vertices[ ( *it ).latin1() ];
913 while ( partIt != partEnd ) {
914 TQStringList nativeMimeTypes = ( *partIt ).service()->property(
"X-TDE-ExtraNativeMimeTypes" ).toStringList();
915 nativeMimeTypes += ( *partIt ).service()->property(
"X-TDE-NativeMimeType" ).toString();
916 TQStringList::ConstIterator it = nativeMimeTypes.begin();
917 TQStringList::ConstIterator end = nativeMimeTypes.end();
918 for ( ; !v && it != end; ++it ) {
920 if ( !key.isEmpty() ) {
921 Vertex* tmp = m_vertices[ key.latin1() ];
922 if ( !v || ( tmp && tmp->key() < v->key() ) )
933 return v->mimeType();
A document that can contain a lot of formulas (container).
Represents an available KOffice component that supports the document interface.
static KoDocumentEntry queryByMimeType(const TQString &mimetype)
This is a convenience function.
static TQValueList< KoDocumentEntry > query(const TQString &_constr=TQString())
This function will query tdesycoca to find all available components.
KoDocument * createDoc(KoDocument *parent=0, const char *name=0) const
Uses the factory of the component to create a document.
The KOffice document class.
virtual bool loadNativeFormat(const TQString &file)
Loads a document in the native format from a given URL.
virtual bool saveNativeFormat(const TQString &file)
Saves the document in native format, to a given file You should never have to reimplement.
The base class for all import filters embedding other filters.
This class represents a chain of plain KoFilter instances.
TQString inputFile()
Get the current file to read from.
KoFilter::ConversionStatus invokeChain()
Starts the filtering process.
TQString outputFile()
Get the current file to write to.
KoStoreDevice * storageFile(const TQString &name="root", KoStore::Mode mode=KoStore::Read)
Get a file from a storage.
KoDocument * inputDocument()
This method allows your filter to work directly on the KoDocument of the application.
TQString chainOutput() const
Tells the KoFilterManager the output file of the filter chain in case of an import operation.
KoDocument * outputDocument()
This method allows your filter to work directly on the KoDocument of the application.
static TQValueList< KoFilterEntry::Ptr > query(const TQString &_constr=TQString())
This function will query KDED to find all available filters.
The class managing all the filters.
Direction
This enum is used to distinguish the import/export cases.
static bool filterAvailable(KoFilterEntry::Ptr entry)
Method used to check if that filter is available at all.
The base class for import and export filters.
ConversionStatus
This enum is used to signal the return state of your filter.
This class implements a TQIODevice around KoStore, so that it can be used to create a TQDomDocument f...
Saves and loads KOffice documents using various backends.
bool close()
Close the file inside the store.
bool isOpen() const
Check whether a file inside the store is currently opened with open(), ready to be read or written.
bool leaveDirectory()
Leaves a directory.
static KoStore * createStore(const TQString &fileName, Mode mode, const TQCString &appIdentification="", Backend backend=Auto)
Open a store (i.e.
bool enterDirectory(const TQString &directory)
Enters one or multiple directories.
Namespace for general KOFFICE functions.