|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.odftoolkit.odfdom.doc.OdfDocument
org.odftoolkit.odfdom.doc.OdfPresentationDocument
public class OdfPresentationDocument
This class represents an empty ODF presentation.
| Nested Class Summary | |
|---|---|
static class |
OdfPresentationDocument.OdfMediaType
This enum contains all possible media types of OdfPresentationDocument documents. |
| Nested classes/interfaces inherited from class org.odftoolkit.odfdom.doc.OdfDocument |
|---|
OdfDocument.OdfXMLFile, OdfDocument.Resource |
| Constructor Summary | |
|---|---|
protected |
OdfPresentationDocument()
|
| Method Summary | |
|---|---|
void |
appendPresentation(OdfPresentationDocument srcDoc)
Append all the slides of the specified presentation document to the current document. |
void |
changeMode(OdfPresentationDocument.OdfMediaType type)
Switches this instance to the given type. |
org.w3c.dom.Node |
cloneForeignElement(org.w3c.dom.Node element,
OdfFileDom dom,
boolean deep)
Make a content copy of the specified element, and the returned element should have the specified ownerDocument. |
OdfDrawPage |
copyForeignSlide(int destIndex,
OdfPresentationDocument srcDoc,
int srcIndex)
Make a copy of slide which locates at the specified position of the source presentation document and insert it to the current presentation document at the new position. |
OdfDrawPage |
copySlide(int source,
int dest,
java.lang.String newName)
Make a copy of the slide at a specified position to another position in this presentation. |
void |
deleteSlideByIndex(int index)
Delete the slide at a specified position in this presentation. |
void |
deleteSlideByName(java.lang.String name)
Delete all the slides with a specified name in this presentation. |
OfficePresentationElement |
getContentRoot()
Get the content root of a presentation document. |
OdfDrawPage |
getSlideByIndex(int index)
Return the slide at a specified position in this presentation. |
OdfDrawPage |
getSlideByName(java.lang.String name)
Return the slide which have a specified slide name in this presentation. |
int |
getSlideCount()
Get the number of the slides in this presentation. |
java.util.Iterator<OdfDrawPage> |
getSlides()
Return a list iterator containing all slides in this presentation. |
void |
moveSlide(int source,
int dest)
Move the slide at a specified position to the destination position. |
static OdfPresentationDocument |
newPresentationDocument()
Creates an empty presentation document. |
static OdfPresentationDocument |
newPresentationTemplateDocument()
Creates an empty presentation template. |
OdfDrawPage |
newSlide(int index,
java.lang.String name,
OdfDrawPage.SlideLayout slideLayout)
New a slide at the specified position with the specified name, and use the specified slide template. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected OdfPresentationDocument()
| Method Detail |
|---|
public static OdfPresentationDocument newPresentationDocument()
throws java.lang.Exception
java.lang.Exception - - if the document could not be created
public static OdfPresentationDocument newPresentationTemplateDocument()
throws java.lang.Exception
java.lang.Exception - - if the template could not be created
public OfficePresentationElement getContentRoot()
throws java.lang.Exception
java.lang.Exception - if the file DOM could not be created.public void changeMode(OdfPresentationDocument.OdfMediaType type)
type - public OdfDrawPage getSlideByIndex(int index)
index - the index of the slide to be returned
public int getSlideCount()
public OdfDrawPage getSlideByName(java.lang.String name)
According to the odf specification "The draw:name attribute specifies a name by which this element can be referenced. It is optional but if present, must be unique within the document instance. If not present, an application may generate a unique name."
If the name is null, then return null because all the slide must has its own unique name.
name - the specified slide name
public java.util.Iterator<OdfDrawPage> getSlides()
public void deleteSlideByIndex(int index)
index - the index of the slide that need to be delete
Throw IndexOutOfBoundsException if the slide index is out of the presentation document slide count.
public void deleteSlideByName(java.lang.String name)
name - the name of the slide that need to be delete
public OdfDrawPage copySlide(int source,
int dest,
java.lang.String newName)
source - the source position of the slide need to be copieddest - the destination position of the slide need to be copiednewName - the new name of the copied slide
Throw IndexOutOfBoundsException if the slide index is out of the presentation document slide count. If copy the slide at the end of document, destIndex should set the same value with the slide count.
public void moveSlide(int source,
int dest)
source - the current index of the slide that need to be moveddest - The index of the destination position before the move action
Throw IndexOutOfBoundsException if the slide index is out of the presentation document slide count.
public void appendPresentation(OdfPresentationDocument srcDoc)
srcDoc - the specified OdfPresentationDocument that need to be appended
public OdfDrawPage copyForeignSlide(int destIndex,
OdfPresentationDocument srcDoc,
int srcIndex)
destIndex - the new position of the copied slide in the current documentsrcDoc - the source document of the copied slidesrcIndex - the slide index of the source document that need to be copied
Throw IndexOutOfBoundsException if the slide index is out of the presentation document slide count If insert the foreign slide at the end of document, destIndex should set the same value with the slide count of the current presentation document.
public org.w3c.dom.Node cloneForeignElement(org.w3c.dom.Node element,
OdfFileDom dom,
boolean deep)
element - The element that need to be copieddom - The specified DOM tree that the returned element belong todeep - If true, recursively clone the subtree under the element,
false, only clone the element itself
public OdfDrawPage newSlide(int index,
java.lang.String name,
OdfDrawPage.SlideLayout slideLayout)
OdfDrawPage.SlideLayout.
If index is invalid, such as larger than the current document slide number or is negative, then append the new slide at the end of the document.
The slide name can be null.
index - the new slide positionname - the new slide nameslideLayout - the new slide template
Throw IndexOutOfBoundsException if index is out of the presentation document slide count.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||