## org.apache.poi.hslf
Class HSLFSlideShow

    java.lang.Object
      org.apache.poi.POIDocument
          org.apache.poi.hslf.HSLFSlideShow

    public final class HSLFSlideShow

extends POIDocument

This class contains the main functionality for the Powerpoint file "reader". It is only a very basic class for now

Author:
  Nick Burch

Field Summary

Fields inherited from class org.apache.poi.POIDocument
`directory`

Constructor Summary
`HSLFSlideShow(DirectoryNode dir)` Constructs a Powerpoint document from a specific point in a POIFS Filesystem.
`HSLFSlideShow(DirectoryNode dir, POIFSFileSystem filesystem)` Deprecated. Use `HSLFSlideShow(DirectoryNode)` instead
`HSLFSlideShow(java.io.InputStream inputStream)` Constructs a Powerpoint document from an input stream.
`HSLFSlideShow(NPOIFSFileSystem filesystem)` Constructs a Powerpoint document from a POIFS Filesystem.
`HSLFSlideShow(POIFSFileSystem filesystem)` Constructs a Powerpoint document from a POIFS Filesystem.
`HSLFSlideShow(java.lang.String fileName)` Constructs a Powerpoint document from fileName.

Method Summary
`int` `addPicture(PictureData img)` Add a new picture to this presentation.
`int` `appendRootLevelRecord(Record newRecord)` Adds a new root level record, at the end, but before the last PersistPtrIncrementalBlock.
`static HSLFSlideShow` `create()` Constructs a new, empty, Powerpoint document.
`CurrentUserAtom` `getCurrentUserAtom()` Fetch the Current User Atom of the document
`ObjectData[]` `getEmbeddedObjects()` Gets embedded object data from the slide show.
`PictureData[]` `getPictures()` Return array of pictures contained in this presentation
`protected DirectoryNode` `getPOIFSDirectory()` Returns the directory in the underlying POIFSFileSystem for the document that is open.
`protected POIFSFileSystem` `getPOIFSFileSystem()` Returns the underlying POIFSFileSystem for the document that is open.
`Record[]` `getRecords()` Returns an array of all the records found in the slideshow
`byte[]` `getUnderlyingBytes()` Returns an array of the bytes of the file.
`void` `write(java.io.OutputStream out)` Writes out the slideshow file the is represented by an instance of this class.
`void` `write(java.io.OutputStream out, boolean preserveNodes)` Writes out the slideshow file the is represented by an instance of this class.

Methods inherited from class org.apache.poi.POIDocument
`copyNodeRecursively, copyNodes, copyNodes, createInformationProperties, getDocumentSummaryInformation, getPropertySet, getSummaryInformation, readProperties, writeProperties, writeProperties, writePropertySet`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### HSLFSlideShow

    public HSLFSlideShow(java.lang.String fileName)
                  throws java.io.IOException

  Constructs a Powerpoint document from fileName. Parses the document and places all the important stuff into data structures.

  Parameters:
    `fileName` - The name of the file to read.
  Throws:
    `java.io.IOException` - if there is a problem while parsing the document.

### HSLFSlideShow

    public HSLFSlideShow(java.io.InputStream inputStream)
                  throws java.io.IOException

  Constructs a Powerpoint document from an input stream. Parses the document and places all the important stuff into data structures.

  Parameters:
    `inputStream` - the source of the data
  Throws:
    `java.io.IOException` - if there is a problem while parsing the document.

### HSLFSlideShow

    public HSLFSlideShow(POIFSFileSystem filesystem)
                  throws java.io.IOException

  Constructs a Powerpoint document from a POIFS Filesystem. Parses the document and places all the important stuff into data structures.

  Parameters:
    `filesystem` - the POIFS FileSystem to read from
  Throws:
    `java.io.IOException` - if there is a problem while parsing the document.

### HSLFSlideShow

    public HSLFSlideShow(NPOIFSFileSystem filesystem)
                  throws java.io.IOException

  Constructs a Powerpoint document from a POIFS Filesystem. Parses the document and places all the important stuff into data structures.

  Parameters:
    `filesystem` - the POIFS FileSystem to read from
  Throws:
    `java.io.IOException` - if there is a problem while parsing the document.

### HSLFSlideShow

    @Deprecated
    public HSLFSlideShow(DirectoryNode dir,
                                    POIFSFileSystem filesystem)
                  throws java.io.IOException

  Deprecated. Use `HSLFSlideShow(DirectoryNode)` instead

  Constructs a Powerpoint document from a specific point in a POIFS Filesystem. Parses the document and places all the important stuff into data structures.

  Parameters:
    `dir` - the POIFS directory to read from
    `filesystem` - the POIFS FileSystem to read from
  Throws:
    `java.io.IOException` - if there is a problem while parsing the document.

### HSLFSlideShow

    public HSLFSlideShow(DirectoryNode dir)
                  throws java.io.IOException

  Constructs a Powerpoint document from a specific point in a POIFS Filesystem. Parses the document and places all the important stuff into data structures.

  Parameters:
    `dir` - the POIFS directory to read from
  Throws:
    `java.io.IOException` - if there is a problem while parsing the document.

Method Detail

### getPOIFSFileSystem

    protected POIFSFileSystem getPOIFSFileSystem()

  Returns the underlying POIFSFileSystem for the document that is open.

### getPOIFSDirectory

    protected DirectoryNode getPOIFSDirectory()

  Returns the directory in the underlying POIFSFileSystem for the document that is open.

### create

    public static final HSLFSlideShow create()

  Constructs a new, empty, Powerpoint document.

### write

    public void write(java.io.OutputStream out)
               throws java.io.IOException

  Writes out the slideshow file the is represented by an instance of this class. It will write out the common OLE2 streams. If you require all streams to be written out, pass in preserveNodes

  Specified by:
    `write` in class `POIDocument`
  Parameters:
    `out` - The OutputStream to write to.
  Throws:
    `java.io.IOException` - If there is an unexpected IOException from the passed in OutputStream

### write

    public void write(java.io.OutputStream out,
                      boolean preserveNodes)
               throws java.io.IOException

  Writes out the slideshow file the is represented by an instance of this class. If you require all streams to be written out (eg Marcos, embeded documents), then set preserveNodes to true

  Parameters:
    `out` - The OutputStream to write to.
    `preserveNodes` - Should all OLE2 streams be written back out, or only the common ones?
  Throws:
    `java.io.IOException` - If there is an unexpected IOException from the passed in OutputStream

### appendRootLevelRecord

    public int appendRootLevelRecord(Record newRecord)

  Adds a new root level record, at the end, but before the last PersistPtrIncrementalBlock.

### addPicture

    public int addPicture(PictureData img)

  Add a new picture to this presentation.

  Returns:
    offset of this picture in the Pictures stream

### getRecords

    public Record[] getRecords()

  Returns an array of all the records found in the slideshow

### getUnderlyingBytes

    public byte[] getUnderlyingBytes()

  Returns an array of the bytes of the file. Only correct after a call to open or write - at all other times might be wrong!

### getCurrentUserAtom

    public CurrentUserAtom getCurrentUserAtom()

  Fetch the Current User Atom of the document

### getPictures

    public PictureData[] getPictures()

  Return array of pictures contained in this presentation

  Returns:
    array with the read pictures or `null` if the presentation doesn't contain pictures.

### getEmbeddedObjects

    public ObjectData[] getEmbeddedObjects()

  Gets embedded object data from the slide show.

  Returns:
    the embedded objects.

Copyright 2012 The Apache Software Foundation or its licensors, as applicable.