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.

AreaTreeModel.java 2.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*
  2. * Copyright 1999-2004 The Apache Software Foundation.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. /* $Id$ */
  17. package org.apache.fop.area;
  18. /**
  19. * This is the model for the area tree object.
  20. * The model implementation can handle the page sequence,
  21. * page and extensions.
  22. * The mathods to acces the page viewports can only
  23. * assume the PageViewport is valid as it remains for
  24. * the life of the area tree model.
  25. */
  26. public abstract class AreaTreeModel {
  27. /**
  28. * Start a page sequence on this model.
  29. * @param title the title of the new page sequence
  30. */
  31. public abstract void startPageSequence(Title title);
  32. /**
  33. * Add a page to this moel.
  34. * @param page the page to add to the model.
  35. */
  36. public abstract void addPage(PageViewport page);
  37. /**
  38. * Add an extension to this model.
  39. * @param ext the extension to add
  40. * @param when when the extension should be handled
  41. */
  42. public abstract void addExtension(TreeExt ext, int when);
  43. /**
  44. * Signal the end of the document for any processing.
  45. */
  46. public abstract void endDocument();
  47. /**
  48. * Get the page sequence count.
  49. * @return the number of page sequences in the document.
  50. */
  51. public abstract int getPageSequenceCount();
  52. /**
  53. * Get the title for a page sequence.
  54. * @param count the page sequence count
  55. * @return the title of the page sequence
  56. */
  57. public abstract Title getTitle(int count);
  58. /**
  59. * Get the page count.
  60. * @param seq the page sequence to count.
  61. * @return returns the number of pages in a page sequence
  62. */
  63. public abstract int getPageCount(int seq);
  64. /**
  65. * Get the page for a position in the document.
  66. * @param seq the page sequence number
  67. * @param count the page count in the sequence
  68. * @return the PageViewport for the particular page
  69. */
  70. public abstract PageViewport getPage(int seq, int count);
  71. }