KoEmbeddingFilter Class Reference
The base class for all import filters embedding other filters. More...
#include <koFilter.h>
Inheritance diagram for KoEmbeddingFilter:


Public Member Functions | |
int | lruPartIndex () const |
Static Public Member Functions | |
QString | mimeTypeByExtension (const QString &extension) |
Protected Member Functions | |
KoEmbeddingFilter () | |
int | embedPart (const QCString &from, QCString &to, KoFilter::ConversionStatus &status, const QString &key=QString::null) |
void | startInternalEmbedding (const QString &key, const QCString &mimeType) |
void | endInternalEmbedding () |
int | internalPartReference (const QString &key) const |
QCString | internalPartMimeType (const QString &key) const |
Friends | |
class | KoFilterChain |
Detailed Description
The base class for all import filters embedding other filters.Right now we don't support embedding for export filters, but if there's a request for that feature please don't hesitate to contact Werner Trobin <trobin@kde.org>.
To make use of embedding features you have to know that there are two kinds of embedding for filters: embedding the output of a different filter (library) or embedding the output of several internal filters (no separate library). The first case is the simpler one. You just have to override savePartContents and call embedPart to trigger the embedding process. One example for such a filter is Kontour's MSOD (MS Office Drawing) filter.
The more complex case is embedding various streams from within the same filter library. This is neccesary for OLE like files (at least with the current design of the OLEFilter). In this case you have to use startInternalEmbedding and endInternalEmbedding accordingly. Try to use the previous method if possible.
If you're using this class you can also setup a signal/slot communication between parent and child filter. To make that work you simply have to define signals and slots along the following rules: Signals should be named "commSignal<name>" where <name> is the name of the signal, slots should be named "commSlot<name>". The connection will be done automatically if names and signatures are matching.
- Author:
- Werner Trobin
Definition at line 142 of file koFilter.h.
Constructor & Destructor Documentation
|
Constructs a filter. Note that the m_chain pointer is 0 inside the constructor. Most likely your constructor will be empty. Definition at line 62 of file koFilter.cc. |
Member Function Documentation
|
A static helper method to determine the mimetype via the file extension. It allows to go from "wmf" to image/x-wmf and so on. Note that you should only pass the pure extension and not a whole pattern like "*.doc" or so. Definition at line 52 of file koFilter.cc. |
|
Embed some document using an external filter (i.e. a different filter library). This method works according to the template method pattern and calls savePartContents during execution. Call this method when you want to convert some data using one or more KOffice filters selected via the filter manager. This is the way to go when it comes to embedding unless you have very special requirements.
Definition at line 67 of file koFilter.cc. References KoFilterManager::exp0rt(). |
|
Method to perform "internal" embedding of parts in olefilter-style. This method can be used to signal the start of a new embedding level within your filter. Very evil, but what shall I say ;) Unless you really have to you should always use embedPart as it's easier to use and not as hacky.
Definition at line 89 of file koFilter.cc. |
|
This method signals the end of an internal embedding session. You have to call that exactly as often as you call startInternalEmbedding or you'll mess up the internal stack and your file will be invalid. Again: use embedPart if you can :-) Definition at line 97 of file koFilter.cc. |
|
Query the internal part map for the reference of the part matching the given key. Note that you can use that plain simple int to refer to the respective part (when used as string).
Definition at line 107 of file koFilter.cc. |
|
Query the internal part map for the mimetype of the part matching the given key.
Definition at line 115 of file koFilter.cc. |
The documentation for this class was generated from the following files: