PresentationML

From Apache OpenOffice Wiki
Jump to: navigation, search

PresentationML is the XML format used by Microsoft PowerPoint 2007 and that is part of the Office Open XML specification. It defines all the structure for the presentation related data. Pure graphic data (ie the content of the slide) is described using DrawingML.

Finding sample files

Use google and look for "download pptx".

Code organisation

oox/source/ppt/ contain the PresentationML specific code for the importer as well as dealing with presentation specific data.

oox/source/drawingml is for DrawingML. Most of the slide content is actually DrawingML.

Data Model

Importer

The importer is the class PowerPointImport.

SlidePersistPtr mpActualSlidePersist;   

The actual slide that is imported

   std::map< rtl::OUString, oox::drawingml::ThemePtr > maThemes; 

Storing every theme that is used so far, the theme is imported before the slide.

   	std::map< ::rtl::OUString, ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode > > maAnimNodesMap;

Map of the Animation nodes by idea. (already change to class SlidePersist)

   std::vector< SlidePersistPtr > maDrawPages; 

Access to every page loaded so far.

   std::vector< SlidePersistPtr > maMasterPages;
   std::vector< SlidePersistPtr > maNotesPages;

Master pages and notes.

Slides

SlidePersist is the class that contain the slide data, including reference to the associated theme and color scheme. It can be a slide, a master slide, note page or handout master.

com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage > mxPage; 

(the corresponding page where the shapes are to be inserted)

   oox::drawingml::ThemePtr mpThemePtr; 

(the actual theme that is used for this page)

   oox::drawingml::ClrSchemePtr mpClrSchemePtr; 

(the local color scheme (if any))

   SlidePersistPtr mpMasterPagePtr; 

This is the masterpage of this slide, it is only set if this slide is not a master by itself

   oox::drawingml::TextListStylePtr  maTitleTextStylePtr;
   oox::drawingml::TextListStylePtr  maBodyTextStylePtr;
   oox::drawingml::TextListStylePtr  maNotesTextStylePtr;
   oox::drawingml::TextListStylePtr  maOtherTextStylePtr;

so when importing a shape, we have access to the corresponding theme and text styles.

See DrawingML for more information.

XModel

The objects itself are created in SlideFragmentHandler::~SlideFragmentHandler

   while( aIter != rShapes.end() )
       (*aIter++)->addShape( mxFilter->getModel(), xShapes );

See XModel.

Animation

Animation are heavily based on SMIL, much like the internals of Impress. There are 3 parts: slide transition, slide timing and shape animations

Transitions

Transition in OOx and OpenDocument are not exactly the same but there is almost a 1 to 1 mapping. They are both based on SMIL transitions. See also: http://www.w3.org/TR/2005/REC-SMIL2-20050107/smil-transitions.html#Table%201:%20Taxonomy%20Table

  • ID: the XML token
  • OOo Status: Yes or No.
  • Type: the type as defined in com/sun/star/animations/TransitionType.hpp
  • SubType: the type as defined in com/sun/star/animations/TransitionSubType.hpp


PowerPoint 2007 Name ID Param OOo Status Type Subtype Note
blinds blinds vert Y BLINDSWIPE VERTICAL
horz Y BLINDSWIPE HORIZONTAL
checker checker vert Y CHECKERBOARDWIPE VERTICAL
horz Y CHECKERBOARDWIPE HORIZONTAL
comb comb vert Y PUSHWIPE COMBVERTICAL
horz Y PUSHWIPE COMBHORIZONTAL
cover cover Y SLIDEWIPE
pull pull Y SLIDEWIPE (reversed)
cut cut N the bin filter ignore this too. the closest thing is not transition
cut cut thruBlk N FADE FADEOVERCOLOR will be slower than in PPT. But the binfilter ignore it too.
fade fade Y FADE CROSSFADE
fade fade thruBlk Y FADE FADEOVERCOLOR
push push d Y PUSHWIPE FROMTOP
l Y PUSHWIPE FROMLEFT
r Y PUSHWIPE FROMRIGHT
u Y PUSHWIPE FROMBOTTOM
wipe wipe d Y BARWIPE FROMTOP
l Y BARWIPE FROMLEFT
r Y BARWIPE FROMRIGHT
u Y BARWIPE FROMBOTTOM
split split Y BARNDOORWIPE HORIZONTAL or VERTICAL (reverse for IN)
wheel wheel "1" Y PINWHEELWIPE ONEBLADE
wheel wheel "2" Y PINWHEELWIPE TWOBLADEVERTICAL
wheel wheel "3" Y PINWHEELWIPE THREEBLADE
wheel wheel "4" Y PINWHEELWIPE FOURBLADE
wheel wheel "8" Y PINWHEELWIPE EIGHTBLADE
wheel wheel * Y PINWHEELWIPE the number is converted to 1, 2, 3, 4, 8 depending on the match. I don't see how to get different numbers from PPT2007
randomBar randomBar horz Y RANDOMBARWIPE HORIZONTAL
randomBar randomBar vert Y RANDOMBARWIPE VERTICAL
circle circle Y ELLIPSEWIPE CIRCLE
diamond diamond Y IRISWIPE DIAMOND
dissolve dissolve Y DISSOLVE DEFAULT
newsflash newsflash N The binfilter ignore it too. It seems to use the previous transition instead. Or maybe it is just a coincidence that it is crossbar.
plus plus Y FOURBOXWIPE CORNERSOUT
random random Y RANDOM DEFAULT
wedge wedge Y FANWIPE CENTERTOP
zoom zoom Y ZOOM DEFAULT Couldn't find it in PPT

There are also some limitations: OOo does not seem to support "stopping sound". Neither does it support embedded sound (see below).

Timing

Shape Animations

Limitations

Office Open XML specify that sound can be embedded in the file (in the container) and use relationships to refer to it. Unfortunately as of today OpenOffice is unable to do so. To that effect sounds are copied in the gallery and opened from there. For standard built-in sound, just refer to it. For none built-in sound, discard it.

Development

Feature SubFeature Developer Status Comments/Missing
Presentation MasterPages sj done
NotesPages sj done
SlidePages sj done
SlideLayouts sj done
CustomShow sj done
SlideTransitions hub done
ObjectAnimations hub done
SlideTimings hub done
ColorMapping sj done
Handout not started
PhotoAlbum not started missing Impress Feature
SlideMasterTextStyles Title sj done
Body sj done
Notes sj done
Other sj done
Themes FillStyles sj done
LineStyles sj done
BackgroundStyles sj done
EffectStyles not started missing Impress Feature
Shapes Shape sj done
GroupShapes sj done
GraphicalObjectFrame (ole) sj done
GraphicalObjectFrame (diagram) hub done
GraphicalObjectFrame (table) sj done (not part of the beta)
GraphicShape sj done
Scene3d not started not supported by Impress
Shape3d not started not supported by Impress
ConnectorShape sj in progress
ShapeStyles sj done (effect style is not supported)
ShapeProperties ShapeTransformation sj done
PresetShapeGeometry sj in progress (adjustment values needs to be mapped)
PresetTextShapeGeometry (Fontwork) sj in progress (adjustment values needs to be mapped)
CustomShapeGeometry sj in progress
TextBodyProperties TextAutofit hub/sj done
TextAutofit hub/sj done
WordWrapping hub/sj done
TextDistances hub/sj done
TextParagraphProperties ParaAdjust hub/sj done
Hyphenation hub/sj done
HangingPunctuation hub/sj done
FirstLineIndent hub/sj done
Text/LineSpacings hub/sj done
TabStops hub/sj done
Numberings hub/sj done
Bullets hub/sj done
TextCharacterProperties GeneralFontSettings (+Asian/Complex) hub/sj done
CharUnderline hub/sj done
CharStrikeout hub/sj done
TextCapsType hub/sj done
CharLocale hub/sj done
TextRangeHyperlink hub done
Highlight hub/sj done
FillProperties NoFill sj done
SolidFill sj done
GradientFill sj done (gradient path is not supported by Impress)
GraphicFill sj done (patters are not supported)
LineProperties LineCap sj done
LineWidth sj done
LineFills sj in progress (line fills are mapped to solid fill)
PresetDashes sj done
CustomDashes not started
LineJointProperties sj done
LineEndProperties sj done

Open Issues

Personal tools