[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: filters and filter webpage news
From:       shaheed <srhaque () iee ! org>
Date:       2001-04-02 22:26:38
[Download RAW message or body]


> > > > > Maybe you are not the right one for this, but at this discussion I
> > > > > would like to have a add part on our filter page where a a little
> > > > > advise for importing embedeed documents and ole importing.
> > > > > I thing Werner could do this.
> > > > > for e.g. I have to this at my applix import filters.
> > > > > But it would be nice if everyone else could grow from those
> > > > > informations.

I've read what's on the web page - it is a good start, but here is some more 
info regarding embedding and import filters. I have tried to follow the 
current section 5.4 into this writeup. I'm sure Werner will fix the holes...

====================
5.4.1 Import filters which support embedded objects

In order to correctly insert a child within the tar'd structure, a filter F 
which is capable of supporting embedded objects has to know where in the 
tar'd hierarchy F itself is (i.e. its "path" in the tar). Then, when it 
invokes filter C to process a child object, it can name it correctly by 
simply prefixing its chosen name for C with its own path.

The filter infrastructure in koFilter.h support such filters, F has to do the 
following in a subclass of KoFilter:
	
1. Override this method:

    virtual bool supportsEmbedding();

to return "true". This causes the filter infrastructure to invoke an 
overloaded version of the filter() function which supports the passing of the 
path for F (as a prefix for C).

2. Implement the filter by implementing this version of the filter:

    virtual bool filter(const QString &fileIn,
                        const QString &fileOut, const QString &prefixOut,
                        const QString &from, const QString &to,
                        const QString &config);
 
rather than this version:

    virtual bool filter(const QString &fileIn,
                        const QString &fileOut,
                        const QString &from, const QString &to,
                        const QString &config);

which is used by export filters, and import filters which do not care about 
embedded children.

3. When F decides it wants to create C, it should use prefixOut as a prefix 
to the name it wants to use for C in the tar. Typically, this name will also 
be included in the body of the XML output of F to refer to the embedded 
object.


_______________________________________________
Koffice-devel mailing list
Koffice-devel@master.kde.org
http://master.kde.org/mailman/listinfo/koffice-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic