bool KPrDocument::saveOdfEpilogue( KoPASavingContext & context ) { context.xmlWriter().startElement( "presentation:settings" ); if ( !m_activeCustomSlideShow.isEmpty() && m_customSlideShows->names().contains( m_activeCustomSlideShow ) ) { context.xmlWriter().addAttribute( "presentation:show", m_activeCustomSlideShow ); } m_customSlideShows->saveOdf( context ); context.xmlWriter().endElement();//presentation:settings return true; }
bool KPrShapeAnimation::saveOdf(KoPASavingContext &paContext, bool startStep, bool startSubStep) const { KoXmlWriter &writer = paContext.xmlWriter(); writer.startElement("anim:par"); QString nodeType; if (startStep && startSubStep) { nodeType = QString("on-click"); } else if (startSubStep) { nodeType = QString("after-previous"); } else { nodeType = QString("with-previous"); } writer.addAttribute("presentation:node-type", nodeType); for(int i=0;i < this->animationCount(); i++) { QAbstractAnimation * animation = this->animationAt(i); if (KPrAnimationBase * a = dynamic_cast<KPrAnimationBase *>(animation)) { a->saveOdf(paContext); } } writer.endElement(); return true; }
bool KPrAnimSet::saveOdf(KoPASavingContext &paContext) const { KoXmlWriter &writer = paContext.xmlWriter(); writer.startElement("anim:set"); saveAttribute(paContext); writer.endElement(); return true; }
bool KPrAnimSet::saveAttribute(KoPASavingContext &paContext) const { KPrAnimationBase::saveAttribute(paContext); KoXmlWriter &writer = paContext.xmlWriter(); // Anim set allow only visibility change currently writer.addAttribute("smil:attributeName","visibility"); writer.addAttribute("smil:to", m_visible ? "visible" : "hidden"); return true; }
bool KPrAnimationStep::saveOdf(KoPASavingContext & paContext) const { KoXmlWriter &writer = paContext.xmlWriter(); writer.startElement("anim:par"); for (int i=0; i < this->animationCount(); i++) { bool startStep = !i; QAbstractAnimation *animation = this->animationAt(i); if (KPrAnimationSubStep *a = dynamic_cast<KPrAnimationSubStep*>(animation)) { a->saveOdf(paContext, startStep); } } writer.endElement(); return true; }
void KPrCustomSlideShows::saveOdf( KoPASavingContext & context ) { QMap<QString, QList<KoPAPageBase*> >::ConstIterator it = m_customSlideShows.constBegin(); const QMap<QString, QList<KoPAPageBase*> >::ConstIterator end = m_customSlideShows.constEnd(); for (; it != end; ++it) { const QString &name = it.key(); const QList<KoPAPageBase*> &slideList = it.value(); context.xmlWriter().startElement( "presentation:show" ); context.xmlWriter().addAttribute( "presentation:name", name ); QString pages; foreach( KoPAPageBase* page, slideList ) { KoPAPage * p = dynamic_cast<KoPAPage *>( page ); if ( p ) { pages += context.pageName( p ) + ','; } } if( !slideList.isEmpty() ) { pages.chop(1); //remove the last comma } context.xmlWriter().addAttribute( "presentation:pages", pages ); context.xmlWriter().endElement();//presentation:show }
bool KPrDeclarations::saveOdf(KoPASavingContext &paContext) const { /* <presentation:header-decl presentation:name="hdr1">header</presentation:header-decl> <presentation:footer-decl presentation:name="ftr1">Footer for the slide</presentation:footer-decl> <presentation:footer-decl presentation:name="ftr2">footer</presentation:footer-decl> <presentation:date-time-decl presentation:name="dtd1" presentation:source="current-date" style:data-style-name="D3"/> */ KoXmlWriter &writer(paContext.xmlWriter()); QHash<Type, QHash<QString, QVariant> >::const_iterator typeIt(m_declarations.constBegin()); for (; typeIt != m_declarations.constEnd(); ++typeIt) { QHash<QString, QVariant>::const_iterator keyIt(typeIt.value().begin()); for (; keyIt != typeIt.value().constEnd(); ++keyIt) { switch (typeIt.key()) { case Footer: writer.startElement("presentation:footer-decl"); break; case Header: writer.startElement("presentation:header-decl"); break; case DateTime: writer.startElement("presentation:date-time-decl"); break; } writer.addAttribute("presentation:name", keyIt.key()); if (typeIt.key() == DateTime) { //TODO } else { writer.addTextNode(keyIt.value().value<QString>()); } writer.endElement(); } } return true; }