Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

BlockLevelEventProducer.java 8.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  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. /* $Id$ */
  18. package org.apache.fop.layoutmgr;
  19. import org.xml.sax.Locator;
  20. import org.apache.fop.events.EventBroadcaster;
  21. import org.apache.fop.events.EventProducer;
  22. import org.apache.fop.fo.pagination.PageProductionException;
  23. /**
  24. * Event producer interface for block-level layout managers.
  25. */
  26. public interface BlockLevelEventProducer extends EventProducer {
  27. /**
  28. * Provider class for the event producer.
  29. */
  30. final class Provider {
  31. private Provider() { }
  32. /**
  33. * Returns an event producer.
  34. * @param broadcaster the event broadcaster to use
  35. * @return the event producer
  36. */
  37. public static BlockLevelEventProducer get(EventBroadcaster broadcaster) {
  38. return broadcaster.getEventProducerFor(BlockLevelEventProducer.class);
  39. }
  40. }
  41. /**
  42. * The contents of a table-row are too big to fit in the constraints.
  43. * @param source the event source
  44. * @param row the row number
  45. * @param effCellBPD the effective extent in block-progression direction of the cell
  46. * @param maxCellBPD the maximum extent in block-progression direction of the cell
  47. * @param loc the location of the error or null
  48. * @event.severity WARN
  49. */
  50. void rowTooTall(Object source, int row, int effCellBPD, int maxCellBPD, Locator loc);
  51. /**
  52. * Auto-table layout is not supported, yet.
  53. * @param source the event source
  54. * @param loc the location of the error or null
  55. * @event.severity INFO
  56. */
  57. void tableFixedAutoWidthNotSupported(Object source, Locator loc);
  58. /**
  59. * An formatting object is too wide.
  60. * @param source the event source
  61. * @param elementName the formatting object
  62. * @param effIPD the effective extent in inline-progression direction of the table contents
  63. * @param maxIPD the maximum extent in inline-progression direction available
  64. * @param loc the location of the error or null
  65. * @event.severity WARN
  66. */
  67. void objectTooWide(Object source, String elementName, int effIPD, int maxIPD, Locator loc);
  68. /**
  69. * An overconstrained geometry adjustment rule was triggered (5.3.4, XSL 1.0).
  70. * @param source the event source
  71. * @param elementName the formatting object
  72. * @param amount the amount of the adjustment (in mpt)
  73. * @param loc the location of the error or null
  74. * @event.severity INFO
  75. */
  76. void overconstrainedAdjustEndIndent(Object source, String elementName, int amount, Locator loc);
  77. /**
  78. * Contents IPD overflow a viewport.
  79. * @param source the event source
  80. * @param elementName the formatting object
  81. * @param amount the amount by which the contents overflow (in mpt)
  82. * @param clip true if the content will be clipped
  83. * @param canRecover indicates whether FOP can recover from this problem and continue working
  84. * @param loc the location of the error or null
  85. * @event.severity ERROR
  86. */
  87. void viewportIPDOverflow(Object source, String elementName, int amount, boolean clip,
  88. boolean canRecover, Locator loc);
  89. /**
  90. * Contents BPD overflow a viewport.
  91. * @param source the event source
  92. * @param elementName the formatting object
  93. * @param amount the amount by which the contents overflow (in mpt)
  94. * @param clip true if the content will be clipped
  95. * @param canRecover indicates whether FOP can recover from this problem and continue working
  96. * @param loc the location of the error or null
  97. * @event.severity ERROR
  98. */
  99. void viewportBPDOverflow(Object source, String elementName, int amount, boolean clip,
  100. boolean canRecover, Locator loc);
  101. /**
  102. * Contents overflow a region viewport.
  103. * @param source the event source
  104. * @param elementName the formatting object
  105. * @param page the page number/name where the overflow happened
  106. * @param amount the amount by which the contents overflow (in mpt)
  107. * @param clip true if the content will be clipped
  108. * @param canRecover indicates whether FOP can recover from this problem and continue working
  109. * @param loc the location of the error or null
  110. * @throws LayoutException the layout error provoked by the method call
  111. * @event.severity FATAL
  112. */
  113. void regionOverflow(Object source, String elementName,
  114. String page,
  115. int amount, boolean clip, boolean canRecover,
  116. Locator loc) throws LayoutException;
  117. /**
  118. * Contents overflow a static region viewport.
  119. * @param source the event source
  120. * @param elementName the formatting object
  121. * @param page the page number/name where the overflow happened
  122. * @param amount the amount by which the contents overflow (in mpt)
  123. * @param clip true if the content will be clipped
  124. * @param canRecover indicates whether FOP can recover from this problem and continue working
  125. * @param loc the location of the error or null
  126. * @throws LayoutException the layout error provoked by the method call
  127. * @event.severity FATAL
  128. */
  129. void staticRegionOverflow(Object source, String elementName,
  130. String page,
  131. int amount, boolean clip, boolean canRecover,
  132. Locator loc) throws LayoutException;
  133. /**
  134. * Indicates that FOP doesn't support flows that are not mapped to region-body, yet.
  135. * @param source the event source
  136. * @param flowName the flow name
  137. * @param masterName the page master name
  138. * @param loc the location of the error or null
  139. * @throws UnsupportedOperationException the layout error provoked by the method call
  140. * @event.severity FATAL
  141. */
  142. void flowNotMappingToRegionBody(Object source, String flowName, String masterName,
  143. Locator loc) throws UnsupportedOperationException;
  144. /**
  145. * A page sequence master is exhausted.
  146. * @param source the event source
  147. * @param pageSequenceMasterName the name of the page sequence master
  148. * @param canRecover indicates whether FOP can recover from this problem and continue working
  149. * @param loc the location of the error or null
  150. * @throws PageProductionException the error provoked by the method call
  151. * @event.severity FATAL
  152. */
  153. void pageSequenceMasterExhausted(Object source, String pageSequenceMasterName,
  154. boolean canRecover, Locator loc) throws PageProductionException;
  155. /**
  156. * No subsequences in page sequence master.
  157. * @param source the event source
  158. * @param pageSequenceMasterName the name of the page sequence master
  159. * @param loc the location of the error or null
  160. * @throws PageProductionException the error provoked by the method call
  161. * @event.severity FATAL
  162. */
  163. void missingSubsequencesInPageSequenceMaster(Object source, String pageSequenceMasterName,
  164. Locator loc) throws PageProductionException;
  165. /**
  166. * No single-page-master matching in page sequence master.
  167. * @param source the event source
  168. * @param pageSequenceMasterName the name of the page sequence master
  169. * @param pageMasterName the name of the page master not matching
  170. * @param loc the location of the error or null
  171. * @throws PageProductionException the error provoked by the method call
  172. * @event.severity FATAL
  173. */
  174. void noMatchingPageMaster(Object source, String pageSequenceMasterName,
  175. String pageMasterName, Locator loc) throws PageProductionException;
  176. /**
  177. * An element that cannot handle changing IPD (list, table) is flowing to a narrower
  178. * page. Some content may be lost.
  179. *
  180. * @param source the event source
  181. * @event.severity WARN
  182. */
  183. void nonRestartableContentFlowingToNarrowerPage(Object source);
  184. /**
  185. * A feasible layout has reached the given number of parts (columns or pages).
  186. *
  187. * @param source the event source
  188. * @param partCount the number of parts that the layout has reached
  189. * @event.severity INFO
  190. */
  191. void layoutHasReachedParts(Object source, int partCount);
  192. /**
  193. * Last page master reference missing.
  194. *
  195. * @param source the event source
  196. * @event.severity WARN
  197. */
  198. void lastPageMasterReferenceMissing(Object source, Locator loc);
  199. }