merge the formfield patch from ooo-build
[ooovba.git] / sdext / source / pdfimport / tree / drawtreevisiting.hxx
blob198e1b0c581d9e94cc59537aee0108347e53fb60
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: drawtreevisiting.hxx,v $
11 * $Revision: 1.2 $
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"
38 namespace pdfi
40 struct DrawElement;
42 class DrawXmlOptimizer : public ElementTreeVisitor
44 private:
45 PDFIProcessor& m_rProcessor;
46 void optimizeTextElements(Element& rParent);
48 public:
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
65 private:
66 StyleContainer& m_rStyleContainer;
67 PDFIProcessor& m_rProcessor;
69 public:
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
88 private:
89 EmitContext& m_rEmitContext ;
90 /// writes Impress doc when false
91 const bool m_bWriteDrawDocument;
93 void fillFrameProps( DrawElement& rElem,
94 PropertyMap& rProps,
95 const EmitContext& rEmitContext );
97 public:
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& );
115 #endif