Share karbon format filters between karbon and flow
Cyrille Berger
cberger at cberger.net
Tue Oct 23 14:16:41 BST 2012
On Sun, 21 Oct 2012 22:51:18 -0400, Yue Liu <yue.liu at mail.com> wrote:
> Hi,
>
> I'm trying to find a way to make Karbon format filters work also in
Flow.
> After KoPart/KoDocument split, Karbon filters ImageExport, SvgExport,
> SvgImport, and WmfExport still require Karbon object KarbonDocument
> and KarbonKoDocument (derived from KoDocument). So those cannot be
> used by Flow.
>
> First I think KarbonDocument and KarbonKoDocument can be merged to
> single KarbonDocument.
>
> Then we can create an abstract class KoGraphicsDocument, define the
> interface with methods used in filters, then derive FlowDocument from
> KoPADocument and KoGraphicsDocument, make KarbonDocument also inherit
> KoGraphicsDocument.
>
> Now the problem is filters require access of shapes(layers) of a page,
> but I'm not sure how to access shapes(layers) from KoPAPage. What is
> the recommended way to do that?
For ImageExport and WmfExport, it seems to me that the way to go would be
to add methods in KoDocument to access the shapes and that would solved the
problem. And make it possible to export other document (.odt, .odp...) to
images as well. And we could have an other method in KoDocument that return
the number of pages/slides (it would return 1 for mono-pages application),
so that the user can choose which pages to export.
The tricky bit will be for the SVG filter, since there is not a one-to-one
mapping between SVG and ODG (some features are missing in each other), that
is why to support SVG, Karbon needs to construct a KarbonDocument directly
from the SVG. There you would indeed need to have an abstract like
KoGraphicsDocument. But not for the other filters.
--
Cyrille Berger
More information about the calligra-devel
mailing list