You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

InlineLevelLayoutManager.java 3.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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.inline;
  19. import java.util.List;
  20. import org.apache.fop.layoutmgr.LayoutManager;
  21. import org.apache.fop.layoutmgr.Position;
  22. /**
  23. * The interface for LayoutManagers which generate inline areas
  24. */
  25. public interface InlineLevelLayoutManager extends LayoutManager {
  26. /**
  27. * Tell the LM to modify its data, adding a letter space
  28. * to the word fragment represented by the given elements,
  29. * and returning the corrected elements
  30. *
  31. * @param oldList the elements which must be given one more letter space
  32. * @return the new elements replacing the old ones
  33. */
  34. List addALetterSpaceTo(List oldList);
  35. /**
  36. * Tell the LM to modify its data, adding a letter space
  37. * to the word fragment represented by the given elements,
  38. * and returning the corrected elements
  39. *
  40. * @param oldList the elements which must be given one more letter space
  41. * @param depth the depth at which the Positions for this LM in oldList are found
  42. * @return the new elements replacing the old ones
  43. */
  44. List addALetterSpaceTo(List oldList, int depth);
  45. /**
  46. * Get the word chars corresponding to the given position.
  47. *
  48. * @param pos the position referring to the needed word chars.
  49. * @return the word chars
  50. */
  51. String getWordChars(Position pos);
  52. /**
  53. * Tell the LM to hyphenate a word
  54. *
  55. * @param pos the Position referring to the word
  56. * @param hyphContext the HyphContext storing hyphenation information
  57. */
  58. void hyphenate(Position pos, HyphContext hyphContext);
  59. /**
  60. * Tell the LM to apply the changes due to hyphenation
  61. *
  62. * @param oldList the list of the old elements the changes refer to
  63. * @return true if the LM had to change its data, false otherwise
  64. */
  65. boolean applyChanges(List oldList);
  66. /**
  67. * Tell the LM to apply the changes due to hyphenation
  68. *
  69. * @param oldList the list of the old elements the changes refer to
  70. * @param depth the depth at which the Positions for this LM in oldList are found
  71. * @return true if the LM had to change its data, false otherwise
  72. */
  73. boolean applyChanges(List oldList, int depth);
  74. /**
  75. * Get a sequence of KnuthElements representing the content
  76. * of the node assigned to the LM, after changes have been applied
  77. * @param oldList the elements to replace
  78. * @param alignment the desired text alignment
  79. * @param depth the depth at which the Positions for this LM in oldList are found
  80. * @return the updated list of KnuthElements
  81. **/
  82. List getChangedKnuthElements(List oldList, int alignment, int depth);
  83. }