2008-04-11 13:22:40 -04:00
|
|
|
/* ====================================================================
|
|
|
|
Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
contributor license agreements. See the NOTICE file distributed with
|
|
|
|
this work for additional information regarding copyright ownership.
|
|
|
|
The ASF licenses this file to You under the Apache License, Version 2.0
|
|
|
|
(the "License"); you may not use this file except in compliance with
|
|
|
|
the License. You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
==================================================================== */
|
2009-05-21 14:12:22 -04:00
|
|
|
|
2008-04-11 13:22:40 -04:00
|
|
|
package org.apache.poi.sl.usermodel;
|
|
|
|
|
2015-02-21 05:56:03 -05:00
|
|
|
import java.awt.Dimension;
|
2016-07-17 09:25:02 -04:00
|
|
|
import java.io.Closeable;
|
|
|
|
import java.io.File;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.InputStream;
|
|
|
|
import java.io.OutputStream;
|
2015-04-27 16:13:43 -04:00
|
|
|
import java.util.List;
|
2008-04-11 13:22:40 -04:00
|
|
|
|
2015-08-02 16:21:35 -04:00
|
|
|
import org.apache.poi.sl.usermodel.PictureData.PictureType;
|
|
|
|
|
2015-08-24 19:15:14 -04:00
|
|
|
public interface SlideShow<
|
|
|
|
S extends Shape<S,P>,
|
2015-08-26 17:25:58 -04:00
|
|
|
P extends TextParagraph<S,P,?>
|
2015-10-31 19:10:17 -04:00
|
|
|
> extends Closeable {
|
2015-08-24 19:15:14 -04:00
|
|
|
Slide<S,P> createSlide() throws IOException;
|
2009-05-21 14:12:22 -04:00
|
|
|
|
2015-08-24 19:15:14 -04:00
|
|
|
List<? extends Slide<S,P>> getSlides();
|
2015-04-27 16:13:43 -04:00
|
|
|
|
2015-08-24 19:15:14 -04:00
|
|
|
MasterSheet<S,P> createMasterSheet() throws IOException;
|
2015-04-27 16:13:43 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns all slide masters.
|
|
|
|
* This doesn't include notes master and other arbitrary masters.
|
|
|
|
*/
|
2015-08-24 19:15:14 -04:00
|
|
|
List<? extends MasterSheet<S,P>> getSlideMasters();
|
2009-05-21 14:12:22 -04:00
|
|
|
|
2015-02-21 05:56:03 -05:00
|
|
|
Resources getResources();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the current page size
|
|
|
|
*
|
|
|
|
* @return the page size
|
|
|
|
*/
|
2015-08-02 16:21:35 -04:00
|
|
|
Dimension getPageSize();
|
2015-10-28 21:05:27 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Change the current page size
|
|
|
|
*
|
|
|
|
* @param pgsize page size (in points)
|
|
|
|
*/
|
|
|
|
void setPageSize(Dimension pgsize);
|
2015-08-02 16:21:35 -04:00
|
|
|
|
2015-09-19 22:25:35 -04:00
|
|
|
/**
|
|
|
|
* Returns all Pictures of this slideshow.
|
|
|
|
* The returned {@link List} is unmodifiable.
|
|
|
|
* @return a {@link List} of {@link PictureData}.
|
|
|
|
*/
|
|
|
|
List<? extends PictureData> getPictureData();
|
2015-08-02 16:21:35 -04:00
|
|
|
|
|
|
|
/**
|
2016-05-22 12:08:51 -04:00
|
|
|
* Adds a picture to the presentation.
|
2015-08-02 16:21:35 -04:00
|
|
|
*
|
|
|
|
* @param pictureData The bytes of the picture
|
|
|
|
* @param format The format of the picture.
|
|
|
|
*
|
2016-05-22 12:08:51 -04:00
|
|
|
* @return the picture data reference.
|
2015-08-02 16:21:35 -04:00
|
|
|
*/
|
|
|
|
PictureData addPicture(byte[] pictureData, PictureType format) throws IOException;
|
2015-08-12 20:10:11 -04:00
|
|
|
|
2016-05-22 12:08:51 -04:00
|
|
|
/**
|
|
|
|
* Adds a picture to the presentation.
|
|
|
|
*
|
|
|
|
* @param is The stream to read the image from
|
|
|
|
* @param format The format of the picture.
|
|
|
|
*
|
|
|
|
* @return the picture data reference.
|
2016-09-14 01:41:40 -04:00
|
|
|
* @since 3.15 beta 1
|
2016-05-22 12:08:51 -04:00
|
|
|
*/
|
|
|
|
PictureData addPicture(InputStream is, PictureType format) throws IOException;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Adds a picture to the presentation.
|
|
|
|
*
|
|
|
|
* @param pict The file containing the image to add
|
|
|
|
* @param format The format of the picture.
|
|
|
|
*
|
|
|
|
* @return the picture data reference
|
2016-09-14 01:41:40 -04:00
|
|
|
* @since 3.15 beta 1
|
2016-05-22 12:08:51 -04:00
|
|
|
*/
|
|
|
|
PictureData addPicture(File pict, PictureType format) throws IOException;
|
2016-07-17 09:25:02 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* check if a picture with this picture data already exists in this presentation
|
|
|
|
*
|
|
|
|
* @param pictureData The picture data to find in the SlideShow
|
|
|
|
* @return {@code null} if picture data is not found in this slideshow
|
2016-09-14 01:41:40 -04:00
|
|
|
* @since 3.15 beta 3
|
2016-07-17 09:25:02 -04:00
|
|
|
*/
|
|
|
|
PictureData findPictureData(byte[] pictureData);
|
2016-05-22 12:08:51 -04:00
|
|
|
|
2015-08-12 20:10:11 -04:00
|
|
|
/**
|
|
|
|
* Writes out the slideshow file the is represented by an instance of this
|
|
|
|
* class
|
|
|
|
*
|
|
|
|
* @param out
|
|
|
|
* The OutputStream to write to.
|
|
|
|
* @throws IOException
|
|
|
|
* If there is an unexpected IOException from the passed in
|
|
|
|
* OutputStream
|
|
|
|
*/
|
|
|
|
void write(OutputStream out) throws IOException;
|
2008-04-11 13:22:40 -04:00
|
|
|
}
|