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.

SlideShow.java 4.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. ==================================================================== */
  15. package org.apache.poi.sl.usermodel;
  16. import java.awt.Dimension;
  17. import java.io.Closeable;
  18. import java.io.File;
  19. import java.io.IOException;
  20. import java.io.InputStream;
  21. import java.io.OutputStream;
  22. import java.util.List;
  23. import org.apache.poi.POITextExtractor;
  24. import org.apache.poi.sl.usermodel.PictureData.PictureType;
  25. public interface SlideShow<
  26. S extends Shape<S,P>,
  27. P extends TextParagraph<S,P,? extends TextRun>
  28. > extends Closeable {
  29. Slide<S,P> createSlide() throws IOException;
  30. List<? extends Slide<S,P>> getSlides();
  31. MasterSheet<S,P> createMasterSheet() throws IOException;
  32. /**
  33. * Returns all slide masters.
  34. * This doesn't include notes master and other arbitrary masters.
  35. */
  36. List<? extends MasterSheet<S,P>> getSlideMasters();
  37. Resources getResources();
  38. /**
  39. * Returns the current page size
  40. *
  41. * @return the page size
  42. */
  43. Dimension getPageSize();
  44. /**
  45. * Change the current page size
  46. *
  47. * @param pgsize page size (in points)
  48. */
  49. void setPageSize(Dimension pgsize);
  50. /**
  51. * Returns all Pictures of this slideshow.
  52. * The returned {@link List} is unmodifiable.
  53. * @return a {@link List} of {@link PictureData}.
  54. */
  55. List<? extends PictureData> getPictureData();
  56. /**
  57. * Adds a picture to the presentation.
  58. *
  59. * @param pictureData The bytes of the picture
  60. * @param format The format of the picture.
  61. *
  62. * @return the picture data reference.
  63. */
  64. PictureData addPicture(byte[] pictureData, PictureType format) throws IOException;
  65. /**
  66. * Adds a picture to the presentation.
  67. *
  68. * @param is The stream to read the image from
  69. * @param format The format of the picture.
  70. *
  71. * @return the picture data reference.
  72. * @since 3.15 beta 1
  73. */
  74. PictureData addPicture(InputStream is, PictureType format) throws IOException;
  75. /**
  76. * Adds a picture to the presentation.
  77. *
  78. * @param pict The file containing the image to add
  79. * @param format The format of the picture.
  80. *
  81. * @return the picture data reference
  82. * @since 3.15 beta 1
  83. */
  84. PictureData addPicture(File pict, PictureType format) throws IOException;
  85. /**
  86. * check if a picture with this picture data already exists in this presentation
  87. *
  88. * @param pictureData The picture data to find in the SlideShow
  89. * @return {@code null} if picture data is not found in this slideshow
  90. * @since 3.15 beta 3
  91. */
  92. PictureData findPictureData(byte[] pictureData);
  93. /**
  94. * Writes out the slideshow file the is represented by an instance of this
  95. * class
  96. *
  97. * @param out
  98. * The OutputStream to write to.
  99. * @throws IOException
  100. * If there is an unexpected IOException from the passed in
  101. * OutputStream
  102. */
  103. void write(OutputStream out) throws IOException;
  104. /**
  105. * @return an extractor for the slideshow metadata
  106. *
  107. * @since POI 4.0.0
  108. */
  109. POITextExtractor getMetadataTextExtractor();
  110. }