public final class SlideCollection extends java.lang.Object implements ISlideCollection
Represents a collection of a slides.
Modifier and Type | Method and Description |
---|---|
ISlide |
addClone(ISlide sourceSlide)
Adds a copy of a specified slide to the end of the collection.
|
ISlide |
addClone(ISlide sourceSlide,
ILayoutSlide destLayout)
Adds a copy of a specified slide to the end of the collection.
|
ISlide |
addClone(ISlide sourceSlide,
IMasterSlide destMaster,
boolean allowCloneMissingLayout)
Adds a copy of a specified source slide to the end of the collection.
|
ISlide |
addClone(ISlide sourceSlide,
ISection section)
Adds a copy of a specified slide to the end of the specified section.
|
ISlide |
addEmptySlide(ILayoutSlide layout)
Adds a new empty slide to the end of the collection.
|
ISlide[] |
addFromHtml(java.io.InputStream htmlStream)
Creates slides from HTML text and adds them to the end of the collection.
|
ISlide[] |
addFromHtml(java.io.InputStream htmlStream,
IExternalResourceResolver resolver,
java.lang.String uri)
Creates slides from HTML text and adds them to the end of the collection.
|
ISlide[] |
addFromHtml(java.lang.String htmlText)
Creates slides from HTML text and adds them to the end of the collection.
|
ISlide[] |
addFromHtml(java.lang.String htmlText,
IExternalResourceResolver resolver,
java.lang.String uri)
Creates slides from HTML text and adds them to the end of the collection.
|
void |
copyTo(com.aspose.ms.System.Array array,
int index)
Copies all elements from the collection to the specified array.
|
ISlide |
get_Item(int index)
Gets the element at the specified index.
|
com.aspose.slides.IDOMObject |
getParent_Immediate()
Returns Parent_Immediate object.
|
java.lang.Object |
getSyncRoot()
Returns a synchronization root.
|
int |
indexOf(ISlide slide)
Returns an index of the specified slide in the collection.
|
ISlide |
insertClone(int index,
ISlide sourceSlide)
Inserts a copy of a specified slide to specified position of the collection.
|
ISlide |
insertClone(int index,
ISlide sourceSlide,
ILayoutSlide destLayout)
Inserts a copy of a specified slide to specified position of the collection.
|
ISlide |
insertClone(int index,
ISlide sourceSlide,
IMasterSlide destMaster,
boolean allowCloneMissingLayout)
Inserts a copy of a specified source slide to specified position of the collection.
|
ISlide |
insertEmptySlide(int index,
ILayoutSlide layout)
Inserts a copy of a specified slide to specified position of the collection.
|
ISlide[] |
insertFromHtml(int index,
java.io.InputStream htmlStream)
Creates slides from HTML text and inserts them to the collection at the specified position.
|
ISlide[] |
insertFromHtml(int index,
java.io.InputStream htmlStream,
IExternalResourceResolver resolver,
java.lang.String uri)
Creates slides from HTML text and inserts them to the collection at the specified position.
|
ISlide[] |
insertFromHtml(int index,
java.lang.String htmlText)
Creates slides from HTML text and inserts them to the collection at the specified position.
|
ISlide[] |
insertFromHtml(int index,
java.lang.String htmlText,
IExternalResourceResolver resolver,
java.lang.String uri)
Creates slides from HTML text and inserts them to the collection at the specified position.
|
boolean |
isSynchronized()
Returns a value indicating whether access to the collection is synchronized (thread-safe).
|
com.aspose.ms.System.Collections.Generic.IGenericEnumerator<ISlide> |
iterator()
Returns an enumerator that iterates through the collection.
|
void |
remove(ISlide value)
Removes the first occurrence of a specific object from the collection.
|
void |
removeAt(int index)
Removes the element at the specified index of the collection.
|
void |
reorder(int index,
ISlide... slides)
Moves slides from the collection to the specified position.
|
void |
reorder(int index,
ISlide slide)
Moves slide from the collection to the specified position.
|
int |
size()
Gets the number of elements actually contained in the collection.
|
ISlide[] |
toArray()
Creates and returns an array with all slides in it.
|
ISlide[] |
toArray(int startIndex,
int count)
Creates and returns an array with all slides from the specified range in it.
|
public final int size()
Gets the number of elements actually contained in the collection.
Read-only int
.
size
in interface com.aspose.ms.System.Collections.ICollection<ISlide>
public final ISlide get_Item(int index)
Gets the element at the specified index.
Read-only Slide
.
get_Item
in interface ISlideCollection
public final ISlide addClone(ISlide sourceSlide)
Adds a copy of a specified slide to the end of the collection.
addClone
in interface ISlideCollection
sourceSlide
- Slide to clone.
addClone(ISlide,ILayoutSlide)
or
addClone(ISlide,IMasterSlide,boolean)
for cloning slides,
IGlobalLayoutSlideCollection.addClone(ILayoutSlide)
or
IGlobalLayoutSlideCollection.addClone(ILayoutSlide,IMasterSlide)
for cloning layouts and
IMasterSlideCollection.addClone(IMasterSlide)
for cloning masters.
public final ISlide addClone(ISlide sourceSlide, ISection section)
Adds a copy of a specified slide to the end of the specified section.
IPresentation presentation = new Presentation(); try { presentation.getSlides().get_Item(0).getShapes().addAutoShape(ShapeType.Rectangle, 200, 50, 300, 100); presentation.getSections().addSection("Section 1", presentation.getSlides().get_Item(0)); ISection section2 = presentation.getSections().appendEmptySection("Section 2"); presentation.getSlides().addClone(presentation.getSlides().get_Item(0), section2); // Now the second section contains a copy of the first slide. } finally { if (presentation != null) presentation.dispose(); }
addClone
in interface ISlideCollection
sourceSlide
- Slide to clone.section
- Section for a new slide.com.aspose.ms.System.ArgumentNullException
- When sourceSlide or section parameter is null.PptxEditException
- When section parameter contains wrong or invalid value.public final ISlide insertClone(int index, ISlide sourceSlide)
Inserts a copy of a specified slide to specified position of the collection.
insertClone
in interface ISlideCollection
index
- Index of new slide.sourceSlide
- Slide to clone.
insertClone(int,ISlide,ILayoutSlide)
or
insertClone(int,ISlide,IMasterSlide,boolean)
for cloning slides and
IMasterSlideCollection.addClone(IMasterSlide)
for cloning masters.
public final ISlide addEmptySlide(ILayoutSlide layout)
Adds a new empty slide to the end of the collection.
addEmptySlide
in interface ISlideCollection
layout
- Layout for a slide.public final ISlide insertEmptySlide(int index, ILayoutSlide layout)
Inserts a copy of a specified slide to specified position of the collection.
insertEmptySlide
in interface ISlideCollection
index
- Index of a new slide.layout
- Layout for a slide.public final ISlide addClone(ISlide sourceSlide, ILayoutSlide destLayout)
Adds a copy of a specified slide to the end of the collection.
addClone
in interface ISlideCollection
sourceSlide
- Slide to clone.destLayout
- Layout slide for a new slide.public final ISlide insertClone(int index, ISlide sourceSlide, ILayoutSlide destLayout)
Inserts a copy of a specified slide to specified position of the collection.
insertClone
in interface ISlideCollection
index
- Index of new slide.sourceSlide
- Slide to clone.destLayout
- Layout slide for a new slide.public final ISlide addClone(ISlide sourceSlide, IMasterSlide destMaster, boolean allowCloneMissingLayout)
Adds a copy of a specified source slide to the end of the collection. Appropriate layout will be selected automatically from the specified master (appropriate layout is the layout with the same Type or Name as of layout of the source slide). If there is no appropriate layout then layout of the source slide will be cloned (if allowCloneMissingLayout is true) or PptxEditException will be thrown (if allowCloneMissingLayout is false).
addClone
in interface ISlideCollection
sourceSlide
- Slide to clone.destMaster
- Master slide for a new slide.allowCloneMissingLayout
- If there is no appropriate layout in specified master then layout of the
source slide will be cloned (if allowCloneMissingLayout is true) or
PptxEditException will be thrown (if allowCloneMissingLayout is false).PptxEditException
- Thrown if there is no appropriate layout in specified master and
allowCloneMissingLayout is false.public final ISlide insertClone(int index, ISlide sourceSlide, IMasterSlide destMaster, boolean allowCloneMissingLayout)
Inserts a copy of a specified source slide to specified position of the collection. Appropriate layout will be selected automatically from the specified master (appropriate layout is the layout with the same Type or Name as of layout of the source slide). If there is no appropriate layout then layout of the source slide will be cloned (if allowCloneMissingLayout is true) or PptxEditException will be thrown (if allowCloneMissingLayout is false).
insertClone
in interface ISlideCollection
index
- Index of new slide.sourceSlide
- Slide to clone.destMaster
- Master slide for a new slide.allowCloneMissingLayout
- If there is no appropriate layout in specified master then layout of the
source slide will be cloned (if allowCloneMissingLayout is true) or
PptxEditException will be thrown (if allowCloneMissingLayout is false).PptxEditException
- Thrown if there is no appropriate layout in specified master and
allowCloneMissingLayout is false.public final void remove(ISlide value)
Removes the first occurrence of a specific object from the collection.
remove
in interface ISlideCollection
value
- The slide to remove from the collection.public final void removeAt(int index)
Removes the element at the specified index of the collection.
removeAt
in interface ISlideCollection
index
- The zero-based index of the element to remove.com.aspose.ms.System.ArgumentOutOfRangeException
- When index parameter contains wrong section number.public final com.aspose.ms.System.Collections.Generic.IGenericEnumerator<ISlide> iterator()
Returns an enumerator that iterates through the collection.
iterator
in interface com.aspose.ms.System.Collections.Generic.IGenericEnumerable<ISlide>
iterator
in interface com.aspose.ms.System.Collections.IEnumerable<ISlide>
iterator
in interface java.lang.Iterable<ISlide>
System.Collections.Generic.IEnumerator`1
that can be used to iterate through the collection.public final ISlide[] toArray()
Creates and returns an array with all slides in it.
toArray
in interface ISlideCollection
Slide
public final ISlide[] toArray(int startIndex, int count)
Creates and returns an array with all slides from the specified range in it.
toArray
in interface ISlideCollection
startIndex
- An index of a first slide to add.count
- A number of slides to add.Slide
public final void reorder(int index, ISlide slide)
Moves slide from the collection to the specified position.
reorder
in interface ISlideCollection
index
- Target index.slide
- Slide to move.public final void reorder(int index, ISlide... slides)
Moves slides from the collection to the specified position. Slides will be placed starting from index in order they appear in list.
reorder
in interface ISlideCollection
index
- Target index.slides
- Slides to move.public final int indexOf(ISlide slide)
Returns an index of the specified slide in the collection.
indexOf
in interface ISlideCollection
slide
- Slide to find.public final ISlide[] addFromHtml(java.lang.String htmlText, IExternalResourceResolver resolver, java.lang.String uri)
Creates slides from HTML text and adds them to the end of the collection.
addFromHtml
in interface ISlideCollection
htmlText
- Html to add.resolver
- A callback object used to fetch external objects. If this parameter is null all external objects will be ignored.uri
- An URI of the specified HTML. Used to resolve relative links.public final ISlide[] addFromHtml(java.lang.String htmlText)
Creates slides from HTML text and adds them to the end of the collection.
addFromHtml
in interface ISlideCollection
htmlText
- Html to add.public final ISlide[] addFromHtml(java.io.InputStream htmlStream, IExternalResourceResolver resolver, java.lang.String uri)
Creates slides from HTML text and adds them to the end of the collection.
addFromHtml
in interface ISlideCollection
htmlStream
- A Stream object which will be used as a source of a HTML file.resolver
- A callback object used to fetch external objects. If this parameter is null all external objects will be ignored.uri
- An URI of the specified HTML. Used to resolve relative links.public final ISlide[] addFromHtml(java.io.InputStream htmlStream)
Creates slides from HTML text and adds them to the end of the collection.
addFromHtml
in interface ISlideCollection
htmlStream
- A Stream object which will be used as a source of a HTML file.public final ISlide[] insertFromHtml(int index, java.lang.String htmlText, IExternalResourceResolver resolver, java.lang.String uri)
Creates slides from HTML text and inserts them to the collection at the specified position.
insertFromHtml
in interface ISlideCollection
index
- Position to insert.htmlText
- Html to add.resolver
- A callback object used to fetch external objects. If this parameter is null all external objects will be ignored.uri
- An URI of the specified HTML. Used to resolve relative links.public final ISlide[] insertFromHtml(int index, java.lang.String htmlText)
Creates slides from HTML text and inserts them to the collection at the specified position.
insertFromHtml
in interface ISlideCollection
index
- Position to insert.htmlText
- Html to add.public final ISlide[] insertFromHtml(int index, java.io.InputStream htmlStream, IExternalResourceResolver resolver, java.lang.String uri)
Creates slides from HTML text and inserts them to the collection at the specified position.
insertFromHtml
in interface ISlideCollection
index
- Position to insert.htmlStream
- A Stream object which will be used as a source of a HTML file.resolver
- A callback object used to fetch external objects. If this parameter is null all external objects will be ignored.uri
- An URI of the specified HTML. Used to resolve relative links.public final ISlide[] insertFromHtml(int index, java.io.InputStream htmlStream)
Creates slides from HTML text and inserts them to the collection at the specified position.
insertFromHtml
in interface ISlideCollection
index
- Position to insert.htmlStream
- A Stream object which will be used as a source of a HTML file.public final void copyTo(com.aspose.ms.System.Array array, int index)
Copies all elements from the collection to the specified array.
copyTo
in interface com.aspose.ms.System.Collections.ICollection<ISlide>
array
- Target array.index
- Starting index in the target array.public final boolean isSynchronized()
Returns a value indicating whether access to the collection is synchronized (thread-safe).
Read-only boolean
.
isSynchronized
in interface com.aspose.ms.System.Collections.ICollection<ISlide>
public final java.lang.Object getSyncRoot()
Returns a synchronization root.
Read-only Object
.
getSyncRoot
in interface com.aspose.ms.System.Collections.ICollection<ISlide>
public final com.aspose.slides.IDOMObject getParent_Immediate()
Returns Parent_Immediate object.
Read-only IDOMObject
.