Skip to main content

Crate deckcraft_model

Crate deckcraft_model 

Source
Expand description

The DeckCraft document model.

A Presentation has slide masters (each with a theme and layouts) and slides. Each slide uses a layout; placeholders on a slide inherit position, formatting and text styles from the matching placeholder on its layout and master (resolve). Slides and masters sit behind Arcs so an undo snapshot of the whole deck costs one clone of the slide list.

Re-exports§

pub use anim::AnimClass;
pub use anim::AnimStart;
pub use anim::Animation;
pub use anim::Transition;
pub use chart::Chart;
pub use style::ColorBase;
pub use style::ColorRef;
pub use style::Effects;
pub use style::Fill;
pub use style::Line;
pub use style::ShapeStyle;
pub use table::Cell;
pub use table::Table;
pub use text::Paragraph;
pub use text::Run;
pub use text::RunProps;
pub use text::TextBody;
pub use theme::Theme;

Modules§

anim
Slide transitions and object animations.
chart
Charts: an embedded data grid plus type and element options.
defaults
A new presentation: one master with the standard set of layouts, master text styles, and a first title slide. Positions and sizes are our own (16:9 at 960 × 540 pt, 4:3 scaled).
edit
Text editing on a TextBody: positions are (paragraph, character offset). Inserting text with \n splits paragraphs; formatting a range splits runs at its ends.
resolve
Inheritance: effective position, fill, line, body and text properties of a shape, following slide → layout placeholder → master placeholder → master text styles → theme.
style
Colours, fills, lines and effects.
table
Tables (graphic frames with a:tbl).
text
Text bodies: body properties, paragraphs, runs, list styles.
theme
Themes: colour scheme, font scheme and format scheme (the fill/line/effect “style matrix”).
words
Word boundaries in a paragraph, as PowerPoint’s Ctrl+arrow, Ctrl+Backspace/Delete and double-click see them (observed black-box on PowerPoint for Windows, see docs/ui-parity.md, Text editing keys).

Structs§

ColorScheme
A colour scheme: the twelve theme colours.
Comment
CustomPath
One sub-path of a custom geometry: SVG-like commands in path units.
CustomShow
HeaderFooter
Which placeholders slides show in the footer row (Header & Footer dialog).
InkStroke
One ink stroke (Draw tab): points in slide coordinates with pressure.
Layout
LayoutId
Master
MasterId
MediaClip
Embedded audio or video on a slide.
MediaId
MediaItem
An embedded file (image, audio, video, font, workbook).
Placeholder
Presentation
Properties
Document properties (File ▸ Properties).
Rect
A rectangle.
Rgba
An sRGB colour with straight alpha, components 0–255.
Section
Shape
ShapeId
ShowSettings
Slide Show ▸ Set Up Slide Show.
Size
A 2D size.
Slide
SlideId
Xfrm
A shape’s placement on its slide (or in its group’s child space): offset, extent, rotation (degrees clockwise) and flips. Rotation and flips are about the centre.

Enums§

Background
Background of a slide, layout or master.
ColorTransform
One colour transform, in file units (percentages ×1000, angles ×60000), applied in order.
Geom
Shape geometry: a preset name with adjust values, or a custom path.
LayoutType
ModelError
PhType
Placeholder types.
SchemeSlot
The twelve theme colour slots, plus the mapped aliases (bg1, tx1…) and phClr (the placeholder colour a style matrix entry is applied with).
ShapeKind

Functions§

find_shape
find_shape_mut
map_slot
Resolve bg1/tx1/bg2/tx2 through the colour map map (the default mapping when it has no entry).
parent_of
The group directly holding id: Some(None) for a top-level shape, None when absent.
sibling_list_mut
The list holding id among its siblings: the tree’s top level, or a group’s children.
walk
Walk shapes depth-first (groups included).

Type Aliases§

Result