1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef INCLUDED_PDFI_TREEVISITORFACTORY_HXX
25 #define INCLUDED_PDFI_TREEVISITORFACTORY_HXX
26 
27 #include "pdfihelper.hxx"
28 #include <boost/shared_ptr.hpp>
29 
30 namespace pdfi
31 {
32     struct ElementTreeVisitor;
33     struct EmitContext;
34     class PDFIProcessor;
35     class StyleContainer;
36 
37     /** Tree manipulation factory
38 
39         Creates visitor objects performing various operations on the
40         pdf parse tree
41      */
42     struct TreeVisitorFactory
43     {
~TreeVisitorFactorypdfi::TreeVisitorFactory44         virtual ~TreeVisitorFactory() {}
45 
46         /// Create visitor that combines tree nodes
47         virtual boost::shared_ptr<ElementTreeVisitor> createOptimizingVisitor(PDFIProcessor&) const = 0;
48         /// Create visitor that prepares style info
49         virtual boost::shared_ptr<ElementTreeVisitor> createStyleCollectingVisitor(
50             StyleContainer&, PDFIProcessor&) const = 0;
51         /// Create visitor that emits tree to an output target
52         virtual boost::shared_ptr<ElementTreeVisitor> createEmittingVisitor(EmitContext&, PDFIProcessor&) const = 0;
53     };
54 
55     typedef boost::shared_ptr<TreeVisitorFactory> TreeVisitorFactorySharedPtr;
56 
57     TreeVisitorFactorySharedPtr createWriterTreeVisitorFactory();
58     TreeVisitorFactorySharedPtr createImpressTreeVisitorFactory();
59     TreeVisitorFactorySharedPtr createDrawTreeVisitorFactory();
60 }
61 
62 #endif
63 
64