com.aspose.slides
Class MasterLayoutSlideCollection

java.lang.Object
  extended by com.aspose.slides.LayoutSlideCollection
      extended by com.aspose.slides.MasterLayoutSlideCollection
All Implemented Interfaces:
com.aspose.ms.System.Collections.Generic.IGenericEnumerable<ILayoutSlide>, com.aspose.ms.System.Collections.IEnumerable<ILayoutSlide>, IGenericCollection<ILayoutSlide>, ILayoutSlideCollection, IMasterLayoutSlideCollection, java.lang.Iterable<ILayoutSlide>

public final class MasterLayoutSlideCollection
extends LayoutSlideCollection
implements IMasterLayoutSlideCollection

Represents a collections of all layout slides of defined master slide. Extends LayoutSlideCollection class with methods for adding/inserting/removing/cloning/reordering layout slides in context of the individual collections of master's layout slides.


Method Summary
 ILayoutSlide add(byte layoutType, java.lang.String layoutName)
           Adds a new layout slide to the end of the collection.
 ILayoutSlide addClone(ILayoutSlide sourceLayout)
           Adds a copy of a specified layout slide to the end of the collection.
 ILayoutSlide insert(int index, byte layoutType, java.lang.String layoutName)
           Inserts a new layout slide to specified position of the collection.
 ILayoutSlide insertClone(int index, ILayoutSlide sourceLayout)
           Inserts a copy of a specified layout slide to specified position of the collection.
 void removeAt(int index)
           Removes the element at the specified index of the collection.
 void reorder(int index, ILayoutSlide layoutSlide)
           Moves layout slide from the collection to the specified position.
 
Methods inherited from class com.aspose.slides.LayoutSlideCollection
copyTo, get_Item, getByType, getParent_Immediate, getSyncRoot, isSynchronized, iterator, remove, removeUnused, size
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.aspose.slides.ILayoutSlideCollection
get_Item, getByType, remove, removeUnused
 
Methods inherited from interface com.aspose.slides.IGenericCollection
copyTo, getSyncRoot, isSynchronized, size
 
Methods inherited from interface com.aspose.ms.System.Collections.Generic.IGenericEnumerable
iterator
 

Method Detail

addClone

public ILayoutSlide addClone(ILayoutSlide sourceLayout)

Adds a copy of a specified layout slide to the end of the collection.

Specified by:
addClone in interface IMasterLayoutSlideCollection
Parameters:
sourceLayout - Slide to clone.


1) New layout will be linked with parent master slide for this layout slides collection. So this is analogue of copy/paste with "Use Destination Theme" option in PowerPoint. 2) Analogue of this method is method IGlobalLayoutSlideCollection.AddClone(ILayoutSlide, IMasterSlide) accessed with IPresentation.LayoutSlides property.

Returns:
Added slide.

insertClone

public ILayoutSlide insertClone(int index,
                                ILayoutSlide sourceLayout)

Inserts a copy of a specified layout slide to specified position of the collection.

Specified by:
insertClone in interface IMasterLayoutSlideCollection
Parameters:
index - Index of new slide.
sourceLayout - Slide to clone.


New layout will be linked with parent master slide for this layout slides collection. So this is analogue of copy/paste with "Use Destination Theme" option in PowerPoint.

Returns:
Inserted slide.

add

public ILayoutSlide add(byte layoutType,
                        java.lang.String layoutName)

Adds a new layout slide to the end of the collection.

Specified by:
add in interface IMasterLayoutSlideCollection
Parameters:
layoutType - Layout type for a new layout. Supported layout types: Title, TitleOnly, Blank, TitleAndObject, VerticalText, VerticalTitleAndText, TwoObjects, SectionHeader, TwoTextAndTwoObjects, TitleObjectAndCaption, PictureAndCaption, Custom. Other layout types are not supported now: Text, TwoColumnText, Table, TextAndChart, ChartAndText, Diagram, Chart, TextAndClipArt, ClipArtAndText, TextAndObject, ObjectAndText, Object, TextAndMedia, MediaAndText, ObjectOverText, TextOverObject, TextAndTwoObjects, TwoObjectsAndText, TwoObjectsOverText, FourObjects, ClipArtAndVerticalText, VerticalTitleAndTextOverChart, ObjectAndTwoObject, TwoObjectsAndObject.
layoutName - Name for a new layout. If passed name is already in use the ArgumentException will be thrown. If null parameter is passed then name genarated atomatically in regards to passed layout type (for example "Title Slide" or "1_Title Slide", "2_..", etc.).


1) Added layout for value SlideLayoutType.Custom of layoutType contains no placeholders and no shapes. 2) Analogue of this method is method IGlobalLayoutSlideCollection.Add(IMasterSlide, SlideLayoutType, string) accessed with IPresentation.LayoutSlides property.

Returns:
Added slide.
Throws:
NotImplementedException - Thrown if unsupported value of parameter layoutType is passed. Layout types that are not supported now: Text, TwoColumnText, Table, TextAndChart, ChartAndText, Diagram, Chart, TextAndClipArt, ClipArtAndText, TextAndObject, ObjectAndText, Object, TextAndMedia, MediaAndText, ObjectOverText, TextOverObject, TextAndTwoObjects, TwoObjectsAndText, TwoObjectsOverText, FourObjects, ClipArtAndVerticalText, VerticalTitleAndTextOverChart, ObjectAndTwoObject, TwoObjectsAndObject.
com.aspose.ms.System.ArgumentException - Thrown if layout name value layoutName is already in use in this collection of the layouts.

insert

public ILayoutSlide insert(int index,
                           byte layoutType,
                           java.lang.String layoutName)

Inserts a new layout slide to specified position of the collection.

Specified by:
insert in interface IMasterLayoutSlideCollection
Parameters:
index - Index of new slide.
layoutType - Layout type for a new layout. Supported layout types: Title, TitleOnly, Blank, TitleAndObject, VerticalText, VerticalTitleAndText, TwoObjects, SectionHeader, TwoTextAndTwoObjects, TitleObjectAndCaption, PictureAndCaption, Custom. Other layout types are not supported now: Text, TwoColumnText, Table, TextAndChart, ChartAndText, Diagram, Chart, TextAndClipArt, ClipArtAndText, TextAndObject, ObjectAndText, Object, TextAndMedia, MediaAndText, ObjectOverText, TextOverObject, TextAndTwoObjects, TwoObjectsAndText, TwoObjectsOverText, FourObjects, ClipArtAndVerticalText, VerticalTitleAndTextOverChart, ObjectAndTwoObject, TwoObjectsAndObject.
layoutName - Name for a new layout. If passed name is already in use the ArgumentException will be thrown. If null parameter is passed then name genarated atomatically in regards to passed layout type (for example "Title Slide" or "1_Title Slide", "2_..", etc.).


Inserted layout for value SlideLayoutType.Custom of layoutType contains no placeholders and no shapes.

Returns:
Inserted slide.
Throws:
NotImplementedException - Thrown if unsupported value of parameter layoutType is passed. Layout types that are not supported now: Text, TwoColumnText, Table, TextAndChart, ChartAndText, Diagram, Chart, TextAndClipArt, ClipArtAndText, TextAndObject, ObjectAndText, Object, TextAndMedia, MediaAndText, ObjectOverText, TextOverObject, TextAndTwoObjects, TwoObjectsAndText, TwoObjectsOverText, FourObjects, ClipArtAndVerticalText, VerticalTitleAndTextOverChart, ObjectAndTwoObject, TwoObjectsAndObject.
com.aspose.ms.System.ArgumentException - Thrown if layout name value layoutName is already in use in this collection of the layouts.

removeAt

public void removeAt(int index)

Removes the element at the specified index of the collection.

Specified by:
removeAt in interface IMasterLayoutSlideCollection
Parameters:
index - The zero-based index of the element to remove.


1) To avoid throwing of the PptxEditException check layout's HasDependingSlides property before. 2) You can use also ILayoutSlide.Remove() method to simplify code.

Throws:
PptxEditException - Thrown if layout is used in presentation (its HasDependingSlides property is true).

reorder

public void reorder(int index,
                    ILayoutSlide layoutSlide)

Moves layout slide from the collection to the specified position.

Specified by:
reorder in interface IMasterLayoutSlideCollection
Parameters:
index - Target index.
layoutSlide - Slide to move.


Copyright © Copyright 2004-2016 Aspose Pty Ltd. All Rights Reserved.