1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements.  See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License.  You may obtain a copy of the License at
8  *
9  *      http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 /* $Id: LayoutManagerMaker.java 1296526 2012-03-03 00:18:45Z gadams $ */
19 
20 package org.apache.fop.layoutmgr;
21 
22 import java.util.List;
23 
24 import org.apache.fop.area.AreaTreeHandler;
25 import org.apache.fop.area.Block;
26 import org.apache.fop.fo.FONode;
27 import org.apache.fop.fo.extensions.ExternalDocument;
28 import org.apache.fop.fo.pagination.Flow;
29 import org.apache.fop.fo.pagination.PageSequence;
30 import org.apache.fop.fo.pagination.SideRegion;
31 import org.apache.fop.fo.pagination.StaticContent;
32 import org.apache.fop.fo.pagination.Title;
33 import org.apache.fop.layoutmgr.inline.ContentLayoutManager;
34 
35 /**
36  * The interface for all LayoutManager makers
37  */
38 public interface LayoutManagerMaker {
39 
40     /**
41      * Make LayoutManagers for the node and add them to the list lms.
42      * @param node the FO node for which the LayoutManagers are made
43      * @param lms the list to which the LayoutManagers are added
44      */
makeLayoutManagers(FONode node, List lms)45     void makeLayoutManagers(FONode node, List lms);
46 
47     /**
48      * Make a specific LayoutManager for the node.
49      * If not exactly one LayoutManagers is available,
50      * an IllegalStateException is thrown.
51      * @param node the FO node for which the LayoutManagers are made
52      * @return The created LayoutManager
53      */
makeLayoutManager(FONode node)54     LayoutManager makeLayoutManager(FONode node);
55 
56     /**
57      * Make a PageSequenceLayoutManager object.
58      * @param ath the AreaTreeHandler object the PSLM interacts with
59      * @param ps the fo:page-sequence object this PSLM will process
60      * @return The created PageSequenceLayoutManager object
61      */
makePageSequenceLayoutManager( AreaTreeHandler ath, PageSequence ps)62     PageSequenceLayoutManager makePageSequenceLayoutManager(
63         AreaTreeHandler ath, PageSequence ps);
64 
65     /**
66      * Make a ExternalDocumentLayoutManager object for the fox:external-document extension.
67      * @param ath the AreaTreeHandler object the external-document interacts with
68      * @param ed the fox:external-document object to be processed
69      * @return The created ExternalDocumentLayoutManager object
70      */
makeExternalDocumentLayoutManager( AreaTreeHandler ath, ExternalDocument ed)71     ExternalDocumentLayoutManager makeExternalDocumentLayoutManager(
72         AreaTreeHandler ath, ExternalDocument ed);
73 
74     /**
75      * Make a FlowLayoutManager object.
76      * @param pslm the parent PageSequenceLayoutManager object
77      * @param flow the fo:flow object this FLM will process
78      * @return The created FlowLayoutManager object
79      */
makeFlowLayoutManager( PageSequenceLayoutManager pslm, Flow flow)80     FlowLayoutManager makeFlowLayoutManager(
81         PageSequenceLayoutManager pslm, Flow flow);
82 
83     /**
84      * Make a ContentLayoutManager object.
85      * @param pslm the parent PageSequenceLayoutManager object
86      * @param title the fo:title object this CLM will process
87      * @return The created ContentLayoutManager object
88      */
makeContentLayoutManager( PageSequenceLayoutManager pslm, Title title)89     ContentLayoutManager makeContentLayoutManager(
90         PageSequenceLayoutManager pslm, Title title);
91 
92     /**
93      * Make a StaticContentLayoutManager object.
94      * @param pslm the parent PageSequenceLayoutManager object
95      * @param sc the fo:static-content object this SCLM will process
96      * @param reg the side region indicating where the static content
97      *     needs to be processed.
98      * @return The created StaticContentLayoutManager object
99      */
makeStaticContentLayoutManager( PageSequenceLayoutManager pslm, StaticContent sc, SideRegion reg)100     StaticContentLayoutManager makeStaticContentLayoutManager(
101         PageSequenceLayoutManager pslm, StaticContent sc, SideRegion reg);
102 
103     /**
104      * Make a StaticContentLayoutManager object for a footnote-separator.
105      * @param pslm the parent PageSequenceLayoutManager object
106      * @param sc the fo:static-content object this SCLM will process
107      * @param block the Block area this SCLM must add its areas to
108      * @return The created StaticContentLayoutManager object
109      */
makeStaticContentLayoutManager( PageSequenceLayoutManager pslm, StaticContent sc, Block block)110     StaticContentLayoutManager makeStaticContentLayoutManager(
111         PageSequenceLayoutManager pslm, StaticContent sc, Block block);
112 
113 }
114 
115