1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: drawtreevisiting.hxx,v $
13 * This file is part of OpenOffice.org.
15 * OpenOffice.org is free software: you can redistribute it and/or modify
16 * it under the terms of the GNU Lesser General Public License version 3
17 * only, as published by the Free Software Foundation.
19 * OpenOffice.org is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU Lesser General Public License version 3 for more details
23 * (a copy is included in the LICENSE file that accompanied this code).
25 * You should have received a copy of the GNU Lesser General Public License
26 * version 3 along with OpenOffice.org. If not, see
27 * <http://www.openoffice.org/license.html>
28 * for a copy of the LGPLv3 License.
30 ************************************************************************/
32 #ifndef INCLUDED_PDFI_DRAWTREEVISITING_HXX
33 #define INCLUDED_PDFI_DRAWTREEVISITING_HXX
35 #include "treevisiting.hxx"
42 class DrawXmlOptimizer
: public ElementTreeVisitor
45 PDFIProcessor
& m_rProcessor
;
46 void optimizeTextElements(Element
& rParent
);
49 explicit DrawXmlOptimizer(PDFIProcessor
& rProcessor
) :
50 m_rProcessor(rProcessor
)
53 virtual void visit( HyperlinkElement
&, const std::list
< Element
* >::const_iterator
& );
54 virtual void visit( TextElement
&, const std::list
< Element
* >::const_iterator
& );
55 virtual void visit( ParagraphElement
&, const std::list
< Element
* >::const_iterator
& );
56 virtual void visit( FrameElement
&, const std::list
< Element
* >::const_iterator
& );
57 virtual void visit( PolyPolyElement
&, const std::list
< Element
* >::const_iterator
& );
58 virtual void visit( ImageElement
&, const std::list
< Element
* >::const_iterator
& );
59 virtual void visit( PageElement
&, const std::list
< Element
* >::const_iterator
& );
60 virtual void visit( DocumentElement
&, const std::list
< Element
* >::const_iterator
& );
63 class DrawXmlFinalizer
: public ElementTreeVisitor
66 StyleContainer
& m_rStyleContainer
;
67 PDFIProcessor
& m_rProcessor
;
70 explicit DrawXmlFinalizer(StyleContainer
& rStyleContainer
,
71 PDFIProcessor
& rProcessor
) :
72 m_rStyleContainer(rStyleContainer
),
73 m_rProcessor(rProcessor
)
76 virtual void visit( HyperlinkElement
&, const std::list
< Element
* >::const_iterator
& );
77 virtual void visit( TextElement
&, const std::list
< Element
* >::const_iterator
& );
78 virtual void visit( ParagraphElement
&, const std::list
< Element
* >::const_iterator
& );
79 virtual void visit( FrameElement
&, const std::list
< Element
* >::const_iterator
& );
80 virtual void visit( PolyPolyElement
&, const std::list
< Element
* >::const_iterator
& );
81 virtual void visit( ImageElement
&, const std::list
< Element
* >::const_iterator
& );
82 virtual void visit( PageElement
&, const std::list
< Element
* >::const_iterator
& );
83 virtual void visit( DocumentElement
&, const std::list
< Element
* >::const_iterator
& );
86 class DrawXmlEmitter
: public ElementTreeVisitor
89 EmitContext
& m_rEmitContext
;
90 /// writes Impress doc when false
91 const bool m_bWriteDrawDocument
;
93 void fillFrameProps( DrawElement
& rElem
,
95 const EmitContext
& rEmitContext
);
98 enum DocType
{ DRAW_DOC
, IMPRESS_DOC
};
99 explicit DrawXmlEmitter(EmitContext
& rEmitContext
, DocType eDocType
) :
100 m_rEmitContext(rEmitContext
),
101 m_bWriteDrawDocument(eDocType
==DRAW_DOC
)
104 virtual void visit( HyperlinkElement
&, const std::list
< Element
* >::const_iterator
& );
105 virtual void visit( TextElement
&, const std::list
< Element
* >::const_iterator
& );
106 virtual void visit( ParagraphElement
&, const std::list
< Element
* >::const_iterator
& );
107 virtual void visit( FrameElement
&, const std::list
< Element
* >::const_iterator
& );
108 virtual void visit( PolyPolyElement
&, const std::list
< Element
* >::const_iterator
& );
109 virtual void visit( ImageElement
&, const std::list
< Element
* >::const_iterator
& );
110 virtual void visit( PageElement
&, const std::list
< Element
* >::const_iterator
& );
111 virtual void visit( DocumentElement
&, const std::list
< Element
* >::const_iterator
& );