blob: 82126380471360ed5083b5e578e64792757dc607 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
|
/*
* $Id$
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
*/
package org.apache.fop.layoutmgr;
import org.apache.fop.fo.FOUserAgent;
import org.apache.fop.area.Area;
import org.apache.fop.area.Resolveable;
import org.apache.fop.area.PageViewport;
/**
* The interface for all LayoutManagers.
*/
public interface LayoutManager {
/**
* Set the user agent.
*
* @param ua the user agent
*/
public void setUserAgent(FOUserAgent ua);
/**
* Get the user agent.
*
* @return the user agent
*/
public FOUserAgent getUserAgent();
/**
* Set the parent layout manager.
* The parent layout manager is required for adding areas.
*
* @param lm the parent layout manager
*/
public void setParentLM(LayoutManager lm);
public void init();
/**
* Generates inline areas.
* This is used to check if the layout manager generates inline
* areas.
*
* @return true if the layout manager generates inline areas
*/
public boolean generatesInlineAreas();
/**
* Return true if the next area which would be generated by this
* LayoutManager could start a new line (or flow for block-level FO).
*/
public boolean canBreakBefore(LayoutContext lc);
/**
* Generate and return the next break possibility.
* @param context The layout context contains information about pending
* space specifiers from ancestor areas or previous areas, reference
* area inline-progression-dimension and various other layout-related
* information.
*/
public BreakPoss getNextBreakPoss(LayoutContext context);
public void resetPosition(Position position);
public void getWordChars(StringBuffer sbChars, Position bp1,
Position bp2);
/**
* Return a value indicating whether this LayoutManager has laid out
* all its content (or generated BreakPossibilities for all content.)
*/
public boolean isFinished();
/**
* Set a flag indicating whether the LayoutManager has laid out all
* its content. This is generally called by the LM itself, but can
* be called by a parentLM when backtracking.
*/
public void setFinished(boolean isFinished);
public Area getParentArea(Area childArea);
public void addChild(Area childArea);
/**
* Tell the layout manager to add all the child areas implied
* by Position objects which will be returned by the
* Iterator.
*/
public void addAreas(PositionIterator posIter, LayoutContext context);
/**
* Get the string of the current page number.
*
* @return the string for the current page number
*/
public String getCurrentPageNumber();
/**
* Resolve the id reference.
* This is called by an area looking for an id reference.
* If the id reference is not found then it should add a resolveable object.
*
* @param ref the id reference
* @return the page containing the id reference or null if not found
*/
public PageViewport resolveRefID(String ref);
/**
* Add an id to the page.
* @todo add the location of the area on the page
*
* @param id the id reference to add.
*/
public void addIDToPage(String id);
/**
* Add an unresolved area.
* The is used to add a resolveable object to the page for a given id.
*
* @param id the id reference this object needs for resolving
* @param res the resolveable object
*/
public void addUnresolvedArea(String id, Resolveable res);
/**
* Add the marker.
* A number of formatting objects may contain markers. This
* method is used to add those markers to the page.
*
* @param name the marker class name
* @param lm the layout manager of the marker child
* @param start true if the formatting object is starting false is finishing
*/
public void addMarker(String name, LayoutManager lm, boolean start);
/**
* Retrieve a marker.
* This method is used when retrieve a marker.
*
* @param name the class name of the marker
* @param pos the retrieve position
* @param boundary the boundary for retrieving the marker
* @return the layout manaager of the retrieved marker if any
*/
public LayoutManager retrieveMarker(String name, int pos, int boundary);
}
|