merge the formfield patch from ooo-build
[ooovba.git] / sdext / source / pdfimport / tree / writertreevisiting.hxx
blobb723a316462e4c8b5fef5c49eef05e15b110f65d
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: writertreevisiting.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_WRITERTREEVISITING_HXX
33 #define INCLUDED_PDFI_WRITERTREEVISITING_HXX
35 #include "treevisiting.hxx"
37 namespace pdfi
39 struct DrawElement;
41 class WriterXmlOptimizer : public ElementTreeVisitor
43 private:
44 PDFIProcessor& m_rProcessor;
45 void optimizeTextElements(Element& rParent);
46 void checkHeaderAndFooter( PageElement& rElem );
48 public:
49 explicit WriterXmlOptimizer(PDFIProcessor& rProcessor) :
50 m_rProcessor(rProcessor)
52 virtual ~WriterXmlOptimizer()
55 virtual void visit( HyperlinkElement&, const std::list< Element* >::const_iterator& );
56 virtual void visit( TextElement&, const std::list< Element* >::const_iterator& );
57 virtual void visit( ParagraphElement&, const std::list< Element* >::const_iterator& );
58 virtual void visit( FrameElement&, const std::list< Element* >::const_iterator& );
59 virtual void visit( PolyPolyElement&, const std::list< Element* >::const_iterator& );
60 virtual void visit( ImageElement&, const std::list< Element* >::const_iterator& );
61 virtual void visit( PageElement&, const std::list< Element* >::const_iterator& );
62 virtual void visit( DocumentElement&, const std::list< Element* >::const_iterator& );
65 class WriterXmlFinalizer : public ElementTreeVisitor
67 private:
68 StyleContainer& m_rStyleContainer;
69 PDFIProcessor& m_rProcessor;
71 void setFirstOnPage( ParagraphElement& rElem,
72 StyleContainer& rStyles,
73 const rtl::OUString& rMasterPageName );
75 public:
76 explicit WriterXmlFinalizer(StyleContainer& rStyleContainer,
77 PDFIProcessor& rProcessor) :
78 m_rStyleContainer(rStyleContainer),
79 m_rProcessor(rProcessor)
81 virtual ~WriterXmlFinalizer()
84 virtual void visit( HyperlinkElement&, const std::list< Element* >::const_iterator& );
85 virtual void visit( TextElement&, const std::list< Element* >::const_iterator& );
86 virtual void visit( ParagraphElement&, const std::list< Element* >::const_iterator& );
87 virtual void visit( FrameElement&, const std::list< Element* >::const_iterator& );
88 virtual void visit( PolyPolyElement&, const std::list< Element* >::const_iterator& );
89 virtual void visit( ImageElement&, const std::list< Element* >::const_iterator& );
90 virtual void visit( PageElement&, const std::list< Element* >::const_iterator& );
91 virtual void visit( DocumentElement&, const std::list< Element* >::const_iterator& );
94 class WriterXmlEmitter : public ElementTreeVisitor
96 private:
97 EmitContext& m_rEmitContext ;
98 void fillFrameProps( DrawElement& rElem,
99 PropertyMap& rProps,
100 const EmitContext& rEmitContext );
102 public:
103 explicit WriterXmlEmitter(EmitContext& rEmitContext) :
104 m_rEmitContext(rEmitContext)
106 virtual ~WriterXmlEmitter()
109 virtual void visit( HyperlinkElement&, const std::list< Element* >::const_iterator& );
110 virtual void visit( TextElement&, const std::list< Element* >::const_iterator& );
111 virtual void visit( ParagraphElement&, const std::list< Element* >::const_iterator& );
112 virtual void visit( FrameElement&, const std::list< Element* >::const_iterator& );
113 virtual void visit( PolyPolyElement&, const std::list< Element* >::const_iterator& );
114 virtual void visit( ImageElement&, const std::list< Element* >::const_iterator& );
115 virtual void visit( PageElement&, const std::list< Element* >::const_iterator& );
116 virtual void visit( DocumentElement&, const std::list< Element* >::const_iterator& );
120 #endif