merge the formfield patch from ooo-build
[ooovba.git] / sdext / source / pdfimport / tree / treevisitorfactory.cxx
blob7892ffc0c4d8aaa1e270b07608f48ac412c74d94
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: treevisitorfactory.cxx,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 // MARKER(update_precomp.py): autogen include statement, do not remove
33 #include "precompiled_sdext.hxx"
35 #include "treevisitorfactory.hxx"
36 #include "writertreevisiting.hxx"
37 #include "drawtreevisiting.hxx"
39 namespace pdfi
41 struct WriterTreeVisitorFactory : public TreeVisitorFactory
43 WriterTreeVisitorFactory() {}
45 virtual boost::shared_ptr<ElementTreeVisitor> createOptimizingVisitor(PDFIProcessor& rProc) const
47 return boost::shared_ptr<ElementTreeVisitor>(new WriterXmlOptimizer(rProc));
50 virtual boost::shared_ptr<ElementTreeVisitor> createStyleCollectingVisitor(
51 StyleContainer& rStyles,
52 PDFIProcessor& rProc ) const
54 return boost::shared_ptr<ElementTreeVisitor>(new WriterXmlFinalizer(rStyles,rProc));
57 virtual boost::shared_ptr<ElementTreeVisitor> createEmittingVisitor(EmitContext& rEmitContext) const
59 return boost::shared_ptr<ElementTreeVisitor>(new WriterXmlEmitter(rEmitContext));
63 struct ImpressTreeVisitorFactory : public TreeVisitorFactory
65 ImpressTreeVisitorFactory() {}
67 virtual boost::shared_ptr<ElementTreeVisitor> createOptimizingVisitor(PDFIProcessor& rProc) const
69 return boost::shared_ptr<ElementTreeVisitor>(new DrawXmlOptimizer(rProc));
72 virtual boost::shared_ptr<ElementTreeVisitor> createStyleCollectingVisitor(
73 StyleContainer& rStyles,
74 PDFIProcessor& rProc ) const
76 return boost::shared_ptr<ElementTreeVisitor>(new DrawXmlFinalizer(rStyles,rProc));
79 virtual boost::shared_ptr<ElementTreeVisitor> createEmittingVisitor(EmitContext& rEmitContext) const
81 return boost::shared_ptr<ElementTreeVisitor>(new DrawXmlEmitter(rEmitContext,
82 DrawXmlEmitter::IMPRESS_DOC));
86 struct DrawTreeVisitorFactory : public TreeVisitorFactory
88 DrawTreeVisitorFactory() {}
90 virtual boost::shared_ptr<ElementTreeVisitor> createOptimizingVisitor(PDFIProcessor& rProc) const
92 return boost::shared_ptr<ElementTreeVisitor>(new DrawXmlOptimizer(rProc));
95 virtual boost::shared_ptr<ElementTreeVisitor> createStyleCollectingVisitor(
96 StyleContainer& rStyles,
97 PDFIProcessor& rProc ) const
99 return boost::shared_ptr<ElementTreeVisitor>(new DrawXmlFinalizer(rStyles,rProc));
102 virtual boost::shared_ptr<ElementTreeVisitor> createEmittingVisitor(EmitContext& rEmitContext) const
104 return boost::shared_ptr<ElementTreeVisitor>(new DrawXmlEmitter(rEmitContext,
105 DrawXmlEmitter::DRAW_DOC));
109 TreeVisitorFactorySharedPtr createWriterTreeVisitorFactory()
111 return TreeVisitorFactorySharedPtr(new WriterTreeVisitorFactory());
113 TreeVisitorFactorySharedPtr createImpressTreeVisitorFactory()
115 return TreeVisitorFactorySharedPtr(new ImpressTreeVisitorFactory());
117 TreeVisitorFactorySharedPtr createDrawTreeVisitorFactory()
119 return TreeVisitorFactorySharedPtr(new DrawTreeVisitorFactory());