Skip to content

Class: SlideLayout ​

A deck's slide layout (slideLayoutN.xml) as a modeled object — the gallery entry a slide binds to. Exposes its name, its type (import-only; the writer authors none), its master (and, through it, the theme), its shapes and the placeholders subset of them, and its own background. Reachable from Slide.layout and SlideMaster.layouts.

The write API authors non-placeholder shapes into a layout: every defineSlideMaster({ objects }) member that is not a placeholder — a rect, a line, an image, a chart, a text box — lands in this tier's tree.

Extends ​

  • TemplatePart

Constructors ​

Constructor ​

new SlideLayout(opc, part): SlideLayout

Parameters ​

ParameterTypeDescription
opcOpcPackageThe package this part belongs to, for reaching related parts (theme, master, media).
partPartThis tier's OPC part.

Returns ​

SlideLayout

Inherited from ​

TemplatePart.constructor

Properties ​

opc ​

readonly opc: OpcPackage

The package this part belongs to, for reaching related parts (theme, master, media).

Inherited from ​

TemplatePart.opc


part ​

readonly part: Part

This tier's OPC part.

Inherited from ​

TemplatePart.part

Accessors ​

background ​

Get Signature ​

get background(): SlideBackground | null

The layout's own background (p:cSld/p:bg), decoded, or null when it defines none. A layout usually authors one — an explicit fill (p:bgPr) or a theme-indexed reference (p:bgRef). The slide's effective background is Slide.background.

Returns ​

SlideBackground | null

Overrides ​

TemplatePart.background


master ​

Get Signature ​

get master(): SlideMaster | null

The master this layout is built on (via its slideMaster relationship), or null when absent.

Returns ​

SlideMaster | null


name ​

Get Signature ​

get name(): string

The authoring name (p:cSld/@name), or '' when unnamed.

Returns ​

string

Inherited from ​

TemplatePart.name


partName ​

Get Signature ​

get partName(): string

Partname of this part.

Returns ​

string

Inherited from ​

TemplatePart.partName


placeholders ​

Get Signature ​

get placeholders(): Placeholder[]

This tier's placeholder shapes (p:sp carrying a p:ph), in document order.

Returns ​

Placeholder[]

Inherited from ​

TemplatePart.placeholders


relationships ​

Get Signature ​

get relationships(): Relationships

This part's relationships (its theme or master, image embeds, hyperlinks, …).

Returns ​

Relationships

Inherited from ​

TemplatePart.relationships


shapes ​

Get Signature ​

get shapes(): AnyShape[]

Every shape in this tier's p:cSld/p:spTree, in document order — the same AnyShape union Slide.shapes returns, so shape-walking code applies unchanged.

placeholders is the filtered view of the same tree.

Returns ​

AnyShape[]

Inherited from ​

TemplatePart.shapes


showMasterSp ​

Get Signature ​

get showMasterSp(): boolean

Whether this layout draws the master's non-placeholder shapes (p:sldLayout/@showMasterSp). xsd:boolean defaulting to true, so an absent attribute means shown — the layout-tier counterpart of Slide.showMasterSp, and the one PowerPoint actually writes on a section-divider or full-bleed layout. A renderer resolving what to paint under a slide's own shapes has to consult both: the slide's flag, then its layout's.

Returns ​

boolean


theme ​

Get Signature ​

get theme(): Theme | null

The theme this layout resolves against, via its master, or null.

Returns ​

Theme | null

Overrides ​

TemplatePart.theme


type ​

Get Signature ​

get type(): string | null

The layout type (p:sldLayout/@type, e.g. title | obj | blank), or null when the layout declares none. Import-only: the writer authors no @type, so an authored deck reads null; an imported deck carries PowerPoint's value.

Returns ​

string | null

Methods ​

shapeByIdDeep() ​

shapeByIdDeep(id): AnyShape | undefined

The shape anywhere in this tier's tree with the given drawing id, or undefined.

Parameters ​

ParameterType
idnumber

Returns ​

AnyShape | undefined

Inherited from ​

TemplatePart.shapeByIdDeep


themeContext() ​

themeContext(): ThemeContext

This tier's colour/font context, resolved once and cached. Backs each Placeholder's text frame.

Returns ​

ThemeContext

Inherited from ​

TemplatePart.themeContext