Difference between revisions of "PresentationML"
(final polish of transition list) |
(more explanation from sj) |
||
Line 12: | Line 12: | ||
== Data Model == | == 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< sal_uInt32, ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode > > maAnimNodesMap; | ||
+ | |||
+ | Map of the Animation nodes by idea. (might change) | ||
+ | |||
+ | 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. | 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 | ||
+ | |||
+ | // and this is important for you, each slide is containing four TextListStyles, | ||
+ | // tilte, master, body and notes, the TextListStyle is storing information | ||
+ | // about the default paragraph/character formatting | ||
+ | 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. | ||
+ | |||
+ | === XModel === | ||
+ | |||
+ | The objects itself are created in | ||
+ | SlideFragmentHandler::~SlideFragmentHandler | ||
+ | |||
+ | while( aIter != rShapes.end() ) | ||
+ | (*aIter++)->addShape( mxFilter->getModel(), xShapes ); | ||
+ | |||
+ | See [http://api.openoffice.org/docs/common/ref/com/sun/star/frame/XModel.html XModel]. | ||
=== Animation === | === Animation === |
Revision as of 21:25, 9 May 2007
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< sal_uInt32, ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode > > maAnimNodesMap;
Map of the Animation nodes by idea. (might change)
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
// and this is important for you, each slide is containing four TextListStyles, // tilte, master, body and notes, the TextListStyle is storing information // about the default paragraph/character formatting 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.
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.