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 3.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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.sl.usermodel.PictureData.PictureType;
  24. public interface SlideShow<
  25. S extends Shape<S,P>,
  26. P extends TextParagraph<S,P,?>
  27. > extends Closeable {
  28. Slide<S,P> createSlide() throws IOException;
  29. List<? extends Slide<S,P>> getSlides();
  30. MasterSheet<S,P> createMasterSheet() throws IOException;
  31. /**
  32. * Returns all slide masters.
  33. * This doesn't include notes master and other arbitrary masters.
  34. */
  35. List<? extends MasterSheet<S,P>> getSlideMasters();
  36. Resources getResources();
  37. /**
  38. * Returns the current page size
  39. *
  40. * @return the page size
  41. */
  42. Dimension getPageSize();
  43. /**
  44. * Change the current page size
  45. *
  46. * @param pgsize page size (in points)
  47. */
  48. void setPageSize(Dimension pgsize);
  49. /**
  50. * Returns all Pictures of this slideshow.
  51. * The returned {@link List} is unmodifiable.
  52. * @return a {@link List} of {@link PictureData}.
  53. */
  54. List<? extends PictureData> getPictureData();
  55. /**
  56. * Adds a picture to the presentation.
  57. *
  58. * @param pictureData The bytes of the picture
  59. * @param format The format of the picture.
  60. *
  61. * @return the picture data reference.
  62. */
  63. PictureData addPicture(byte[] pictureData, PictureType format) throws IOException;
  64. /**
  65. * Adds a picture to the presentation.
  66. *
  67. * @param is The stream to read the image from
  68. * @param format The format of the picture.
  69. *
  70. * @return the picture data reference.
  71. * @since 3.15 beta 1
  72. */
  73. PictureData addPicture(InputStream is, PictureType format) throws IOException;
  74. /**
  75. * Adds a picture to the presentation.
  76. *
  77. * @param pict The file containing the image to add
  78. * @param format The format of the picture.
  79. *
  80. * @return the picture data reference
  81. * @since 3.15 beta 1
  82. */
  83. PictureData addPicture(File pict, PictureType format) throws IOException;
  84. /**
  85. * check if a picture with this picture data already exists in this presentation
  86. *
  87. * @param pictureData The picture data to find in the SlideShow
  88. * @return {@code null} if picture data is not found in this slideshow
  89. * @since 3.15 beta 3
  90. */
  91. PictureData findPictureData(byte[] pictureData);
  92. /**
  93. * Writes out the slideshow file the is represented by an instance of this
  94. * class
  95. *
  96. * @param out
  97. * The OutputStream to write to.
  98. * @throws IOException
  99. * If there is an unexpected IOException from the passed in
  100. * OutputStream
  101. */
  102. void write(OutputStream out) throws IOException;
  103. }