From b9337e22ce1dbf2eba0e8c8db294ae99f4111f91 Mon Sep 17 00:00:00 2001 From: Bjoern Michaelsen Date: Thu, 18 Apr 2013 18:26:28 +0200 Subject: execute move of global headers see https://gerrit.libreoffice.org/#/c/3367/ and Change-Id: I00c96fa77d04b33a6f8c8cd3490dfcd9bdc9e84a for details Change-Id: I199a75bc4042af20817265d5ef85b1134a96ff5a --- include/oox/ppt/animationspersist.hxx | 126 ++++++++++++++++++ include/oox/ppt/backgroundproperties.hxx | 44 +++++++ include/oox/ppt/comments.hxx | 139 +++++++++++++++++++ include/oox/ppt/customshowlistcontext.hxx | 53 ++++++++ include/oox/ppt/dgmimport.hxx | 62 +++++++++ include/oox/ppt/dgmlayout.hxx | 63 +++++++++ include/oox/ppt/headerfooter.hxx | 45 +++++++ include/oox/ppt/layoutfragmenthandler.hxx | 42 ++++++ include/oox/ppt/pptgraphicshapecontext.hxx | 40 ++++++ include/oox/ppt/pptimport.hxx | 91 +++++++++++++ include/oox/ppt/pptshape.hxx | 73 ++++++++++ include/oox/ppt/pptshapecontext.hxx | 40 ++++++ include/oox/ppt/pptshapegroupcontext.hxx | 56 ++++++++ include/oox/ppt/pptshapepropertiescontext.hxx | 40 ++++++ include/oox/ppt/presentationfragmenthandler.hxx | 72 ++++++++++ include/oox/ppt/slidefragmenthandler.hxx | 60 +++++++++ include/oox/ppt/slidemastertextstylescontext.hxx | 45 +++++++ include/oox/ppt/slidepersist.hxx | 161 +++++++++++++++++++++++ include/oox/ppt/slidetimingcontext.hxx | 48 +++++++ include/oox/ppt/slidetransition.hxx | 72 ++++++++++ include/oox/ppt/slidetransitioncontext.hxx | 52 ++++++++ include/oox/ppt/soundactioncontext.hxx | 55 ++++++++ include/oox/ppt/timenode.hxx | 128 ++++++++++++++++++ include/oox/ppt/timenodelistcontext.hxx | 65 +++++++++ 24 files changed, 1672 insertions(+) create mode 100644 include/oox/ppt/animationspersist.hxx create mode 100644 include/oox/ppt/backgroundproperties.hxx create mode 100644 include/oox/ppt/comments.hxx create mode 100644 include/oox/ppt/customshowlistcontext.hxx create mode 100644 include/oox/ppt/dgmimport.hxx create mode 100644 include/oox/ppt/dgmlayout.hxx create mode 100644 include/oox/ppt/headerfooter.hxx create mode 100644 include/oox/ppt/layoutfragmenthandler.hxx create mode 100644 include/oox/ppt/pptgraphicshapecontext.hxx create mode 100644 include/oox/ppt/pptimport.hxx create mode 100644 include/oox/ppt/pptshape.hxx create mode 100644 include/oox/ppt/pptshapecontext.hxx create mode 100644 include/oox/ppt/pptshapegroupcontext.hxx create mode 100644 include/oox/ppt/pptshapepropertiescontext.hxx create mode 100644 include/oox/ppt/presentationfragmenthandler.hxx create mode 100644 include/oox/ppt/slidefragmenthandler.hxx create mode 100644 include/oox/ppt/slidemastertextstylescontext.hxx create mode 100644 include/oox/ppt/slidepersist.hxx create mode 100644 include/oox/ppt/slidetimingcontext.hxx create mode 100644 include/oox/ppt/slidetransition.hxx create mode 100644 include/oox/ppt/slidetransitioncontext.hxx create mode 100644 include/oox/ppt/soundactioncontext.hxx create mode 100644 include/oox/ppt/timenode.hxx create mode 100644 include/oox/ppt/timenodelistcontext.hxx (limited to 'include/oox/ppt') diff --git a/include/oox/ppt/animationspersist.hxx b/include/oox/ppt/animationspersist.hxx new file mode 100644 index 000000000000..ba63991def2a --- /dev/null +++ b/include/oox/ppt/animationspersist.hxx @@ -0,0 +1,126 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + + +#ifndef OOX_PPT_ANIMATIONPERSIST +#define OOX_PPT_ANIMATIONPERSIST + +#include +#include +#include + +#include + +#include +#include + +#include "oox/drawingml/drawingmltypes.hxx" +#include "oox/ppt/slidepersist.hxx" + +namespace oox { namespace ppt { + + enum { + NP_TO = 0, + NP_FROM, NP_BY, NP_USERDATA, NP_ATTRIBUTENAME, + NP_ACCELERATION, NP_AUTOREVERSE, NP_DECELERATE, NP_DURATION, NP_FILL, + NP_REPEATCOUNT, NP_REPEATDURATION, NP_RESTART, + NP_DIRECTION, NP_COLORINTERPOLATION, NP_CALCMODE, NP_TRANSFORMTYPE, + NP_PATH, + NP_ENDSYNC, NP_ITERATETYPE, NP_ITERATEINTERVAL, + NP_SUBITEM, NP_TARGET, NP_COMMAND, NP_PARAMETER, + NP_VALUES, NP_FORMULA, NP_KEYTIMES, NP_DISPLAY, + _NP_SIZE + }; + + typedef boost::array< ::com::sun::star::uno::Any, _NP_SIZE > NodePropertyMap; + + + /** data for CT_TLShapeTargetElement */ + struct ShapeTargetElement + { + ShapeTargetElement() + : mnType( 0 ) + {} + void convert( ::com::sun::star::uno::Any & aAny, sal_Int16 & rSubType ) const; + + sal_Int32 mnType; + sal_Int32 mnRangeType; + drawingml::IndexRange maRange; + OUString msSubShapeId; + }; + + + /** data for CT_TLTimeTargetElement */ + struct AnimTargetElement + { + AnimTargetElement() + : mnType( 0 ) + {} + /** convert to a set of properties */ + ::com::sun::star::uno::Any convert(const SlidePersistPtr & pSlide, sal_Int16 & nSubType) const; + + sal_Int32 mnType; + OUString msValue; + + ShapeTargetElement maShapeTarget; + }; + + typedef boost::shared_ptr< AnimTargetElement > AnimTargetElementPtr; + + struct AnimationCondition; + + typedef ::std::list< AnimationCondition > AnimationConditionList; + + /** data for CT_TLTimeCondition */ + struct AnimationCondition + { + AnimationCondition() + : mnType( 0 ) + {} + + ::com::sun::star::uno::Any convert(const SlidePersistPtr & pSlide) const; + static ::com::sun::star::uno::Any convertList(const SlidePersistPtr & pSlide, const AnimationConditionList & l); + + AnimTargetElementPtr & getTarget() + { if(!mpTarget) mpTarget.reset( new AnimTargetElement ); return mpTarget; } + ::com::sun::star::uno::Any maValue; + sal_Int32 mnType; + private: + AnimTargetElementPtr mpTarget; + }; + + + struct TimeAnimationValue + { + OUString msFormula; + OUString msTime; + ::com::sun::star::uno::Any maValue; + }; + + typedef ::std::list< TimeAnimationValue > TimeAnimationValueList; + +} } + + + + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/oox/ppt/backgroundproperties.hxx b/include/oox/ppt/backgroundproperties.hxx new file mode 100644 index 000000000000..05926d44b796 --- /dev/null +++ b/include/oox/ppt/backgroundproperties.hxx @@ -0,0 +1,44 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef OOX_POWERPOINT_BACKGROUNDPROPERTIES_HXX +#define OOX_POWERPOINT_BACKGROUNDPROPERTIES_HXX + +#include "oox/core/fragmenthandler2.hxx" +#include "oox/drawingml/fillproperties.hxx" + +namespace oox { namespace ppt { + +// --------------------------------------------------------------------- + +class BackgroundPropertiesContext : public ::oox::core::FragmentHandler2 +{ +public: + BackgroundPropertiesContext( ::oox::core::FragmentHandler2& rParent, ::oox::drawingml::FillProperties& rFillProperties ); + virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs ); + +protected: + ::oox::drawingml::FillProperties& mrFillProperties; +}; + +} } + +#endif // OOX_POWERPOINT_BACKGROUNDPROPERTIES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/oox/ppt/comments.hxx b/include/oox/ppt/comments.hxx new file mode 100644 index 000000000000..1095cd0223db --- /dev/null +++ b/include/oox/ppt/comments.hxx @@ -0,0 +1,139 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + + +#ifndef OOX_PPT_COMMENTS_HXX +#define OOX_PPT_COMMENTS_HXX + +#include +#include + +namespace oox { namespace ppt { + +struct CommentAuthor +{ + OUString clrIdx; + OUString id; + OUString initials; + OUString lastIdx; + OUString name; +}; + +class CommentAuthorList +{ + private: + std::vector cmAuthorLst; + + public: + void setValues(const CommentAuthorList& list); + + const std::vector& getCmAuthorLst() const + { + return cmAuthorLst; + } + + void addAuthor(const CommentAuthor& _author) + { + cmAuthorLst.push_back(_author); + } + + friend class Comment; +}; + +class Comment +{ + private: + OUString authorId; + OUString dt; + OUString idx; + OUString x; + OUString y; + OUString text; + ::com::sun::star::util::DateTime aDateTime; + + void setDateTime (OUString datetime); + + public: + void setAuthorId(const OUString& _aId) + { + authorId = _aId; + } + void setdt(const OUString& _dt) + { + dt=_dt; + setDateTime(_dt); + } + void setidx(const OUString& _idx) + { + idx=_idx; + } + void setPoint(const OUString& _x, const OUString& _y) + { + x=_x; + y=_y; + } + void setText(const OUString& _text) + { + text = _text; + } + OUString getAuthorId() + { + return authorId; + } + OUString getdt() + { + return dt; + } + OUString getidx() + { + return idx; + } + OUString get_X() + { + return x; + } + OUString get_Y() + { + return y; + } + OUString get_text() + { + return text; + } + ::com::sun::star::util::DateTime getDateTime() + { + return aDateTime; + } + sal_Int32 getIntX() + { + return x.toInt32(); + } + sal_Int32 getIntY() + { + return y.toInt32(); + } + OUString getAuthor ( const CommentAuthorList& list ); +}; + +class CommentList +{ + public: + std::vector cmLst; + int getSize () + { + return (int)cmLst.size(); + } + const Comment& getCommentAtIndex (int index); +}; + +} } + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/oox/ppt/customshowlistcontext.hxx b/include/oox/ppt/customshowlistcontext.hxx new file mode 100644 index 000000000000..ed913c8bbe2c --- /dev/null +++ b/include/oox/ppt/customshowlistcontext.hxx @@ -0,0 +1,53 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef OOX_POWERPOINT_CUSTOMSHOWLISTCONTEXT_HXX +#define OOX_POWERPOINT_CUSTOMSHOWLISTCONTEXT_HXX + +#include "oox/core/fragmenthandler2.hxx" +#include + +namespace oox { namespace ppt { + + + struct CustomShow + { + OUString maName; + OUString mnId; + std::vector< OUString >maSldLst; + }; + + /** CT_ */ + class CustomShowListContext : public ::oox::core::FragmentHandler2 + { + std::vector< CustomShow >& mrCustomShowList; + + public: + CustomShowListContext( ::oox::core::FragmentHandler2& rParent, + std::vector< CustomShow >& rCustomShowList ); + + ~CustomShowListContext( ); + virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs ); + }; + +} } + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/oox/ppt/dgmimport.hxx b/include/oox/ppt/dgmimport.hxx new file mode 100644 index 000000000000..f369c5e526b8 --- /dev/null +++ b/include/oox/ppt/dgmimport.hxx @@ -0,0 +1,62 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef OOX_POWERPOINT_QUICKDIAGRAMMINGIMPORT_HXX +#define OOX_POWERPOINT_QUICKDIAGRAMMINGIMPORT_HXX + +#include "oox/core/xmlfilterbase.hxx" + +#include +#include +#include "oox/ppt/presentationfragmenthandler.hxx" +#include "oox/ppt/slidepersist.hxx" +#include +#include + +namespace oox { namespace ppt { + +// --------------------------------------------------------------------- + +class QuickDiagrammingImport : public oox::core::XmlFilterBase +{ +public: + + QuickDiagrammingImport( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ); + + // from FilterBase + virtual bool importDocument() throw(); + virtual bool exportDocument() throw(); + + virtual const ::oox::drawingml::Theme* getCurrentTheme() const; + virtual sal_Int32 getSchemeClr( sal_Int32 nColorSchemeToken ) const; + virtual const oox::drawingml::table::TableStyleListPtr getTableStyles(); + + virtual oox::vml::Drawing* getVmlDrawing(); + virtual oox::drawingml::chart::ChartConverter* getChartConverter(); + +private: + virtual OUString implGetImplementationName() const; + virtual ::oox::ole::VbaProject* implCreateVbaProject() const; +}; + +} } + +#endif // OOX_POWERPOINT_QUICKDIAGRAMMINGIMPORT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/oox/ppt/dgmlayout.hxx b/include/oox/ppt/dgmlayout.hxx new file mode 100644 index 000000000000..bf964fe5d310 --- /dev/null +++ b/include/oox/ppt/dgmlayout.hxx @@ -0,0 +1,63 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef OOX_POWERPOINT_QUICKDIAGRAMMINGLAYOUT_HXX +#define OOX_POWERPOINT_QUICKDIAGRAMMINGLAYOUT_HXX + +#include "oox/core/xmlfilterbase.hxx" + +#include +#include +#include "oox/ppt/presentationfragmenthandler.hxx" +#include "oox/ppt/slidepersist.hxx" +#include +#include + +namespace oox { namespace ppt { + +// --------------------------------------------------------------------- + +class QuickDiagrammingLayout : public oox::core::XmlFilterBase +{ +public: + + QuickDiagrammingLayout( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ); + + // from FilterBase + virtual bool importDocument() throw(); + virtual bool exportDocument() throw(); + + virtual const ::oox::drawingml::Theme* getCurrentTheme() const; + virtual sal_Int32 getSchemeClr( sal_Int32 nColorSchemeToken ) const; + virtual const oox::drawingml::table::TableStyleListPtr getTableStyles(); + + virtual ::oox::vml::Drawing* getVmlDrawing(); + virtual ::oox::drawingml::chart::ChartConverter* getChartConverter(); + +private: + virtual OUString implGetImplementationName() const; + virtual ::oox::ole::VbaProject* implCreateVbaProject() const; + drawingml::ThemePtr mpThemePtr; +}; + +} } + +#endif // OOX_POWERPOINT_QUICKDIAGRAMMINGLAYOUT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/oox/ppt/headerfooter.hxx b/include/oox/ppt/headerfooter.hxx new file mode 100644 index 000000000000..4d0a3cb65f1d --- /dev/null +++ b/include/oox/ppt/headerfooter.hxx @@ -0,0 +1,45 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef OOX_PPT_HEADERFOOTER +#define OOX_PPT_HEADERFOOTER + +#include + +namespace oox { namespace ppt { + + struct HeaderFooter + { + sal_Bool mbSlideNumber; + sal_Bool mbHeader; + sal_Bool mbFooter; + sal_Bool mbDateTime; + + HeaderFooter() + : mbSlideNumber( sal_True ) + , mbHeader( sal_True ) + , mbFooter( sal_True ) + , mbDateTime( sal_True ) {}; + }; + +} } + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/oox/ppt/layoutfragmenthandler.hxx b/include/oox/ppt/layoutfragmenthandler.hxx new file mode 100644 index 000000000000..80983182b73d --- /dev/null +++ b/include/oox/ppt/layoutfragmenthandler.hxx @@ -0,0 +1,42 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef OOX_PPT_LAYOUTFRAGMENTHANDLER +#define OOX_PPT_LAYOUTFRAGMENTHANDLER + +#include "oox/ppt/slidefragmenthandler.hxx" + +#include + +namespace oox { namespace ppt { + +class LayoutFragmentHandler : public SlideFragmentHandler +{ +public: + LayoutFragmentHandler( ::oox::core::XmlFilterBase& rFilter, const OUString& rFragmentPath, SlidePersistPtr pMasterPersistPtr ) throw(); + virtual ~LayoutFragmentHandler() throw(); + + virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs ); +}; + +} } + +#endif // OOX_PPT_LAYOUTFRAGMENTHANDLER + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/oox/ppt/pptgraphicshapecontext.hxx b/include/oox/ppt/pptgraphicshapecontext.hxx new file mode 100644 index 000000000000..180098a67166 --- /dev/null +++ b/include/oox/ppt/pptgraphicshapecontext.hxx @@ -0,0 +1,40 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef OOX_PPT_PPTGRAPHICSHAPECONTEXT_HXX +#define OOX_PPT_PPTGRAPHICSHAPECONTEXT_HXX + +#include "oox/drawingml/graphicshapecontext.hxx" + +namespace oox { namespace ppt { + +class PPTGraphicShapeContext : public ::oox::drawingml::GraphicShapeContext +{ + SlidePersistPtr mpSlidePersistPtr; + +public: + PPTGraphicShapeContext( ::oox::core::ContextHandler& rParent, const SlidePersistPtr pSlidePersistPtr, oox::drawingml::ShapePtr pMasterShapePtr, oox::drawingml::ShapePtr pShapePtr ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException); +}; + +} } + +#endif // OOX_PPT_PPTGRAPHICSHAPEGROUPCONTEXT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/oox/ppt/pptimport.hxx b/include/oox/ppt/pptimport.hxx new file mode 100644 index 000000000000..035ea8cdc5c1 --- /dev/null +++ b/include/oox/ppt/pptimport.hxx @@ -0,0 +1,91 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef OOX_POWERPOINT_POWERPOINTIMPORT_HXX +#define OOX_POWERPOINT_POWERPOINTIMPORT_HXX + +#include "oox/core/xmlfilterbase.hxx" + +#include +#include +#include "oox/ppt/presentationfragmenthandler.hxx" +#include "oox/ppt/slidepersist.hxx" +#include +#include + +namespace oox { namespace ppt { + +// --------------------------------------------------------------------- + +class PowerPointImport : public oox::core::XmlFilterBase +{ +public: + + PowerPointImport( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext ) + throw( ::com::sun::star::uno::RuntimeException ); + virtual ~PowerPointImport(); + + // from FilterBase + virtual bool importDocument() throw(); + virtual bool exportDocument() throw(); + + virtual const ::oox::drawingml::Theme* getCurrentTheme() const; + virtual ::oox::vml::Drawing* getVmlDrawing(); + virtual const oox::drawingml::table::TableStyleListPtr getTableStyles(); + virtual ::oox::drawingml::chart::ChartConverter* getChartConverter(); + + void setActualSlidePersist( SlidePersistPtr pActualSlidePersist ){ mpActualSlidePersist = pActualSlidePersist; }; + std::map< OUString, oox::drawingml::ThemePtr >& getThemes(){ return maThemes; }; + std::vector< SlidePersistPtr >& getDrawPages(){ return maDrawPages; }; + std::vector< SlidePersistPtr >& getMasterPages(){ return maMasterPages; }; + std::vector< SlidePersistPtr >& getNotesPages(){ return maNotesPages; }; + + virtual sal_Bool SAL_CALL filter( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rDescriptor ) + throw( ::com::sun::star::uno::RuntimeException ); + + sal_Int32 getSchemeColor( sal_Int32 nToken ) const; + +#if OSL_DEBUG_LEVEL > 0 + static XmlFilterBase* mpDebugFilterBase; +#endif + +private: + virtual GraphicHelper* implCreateGraphicHelper() const; + virtual ::oox::ole::VbaProject* implCreateVbaProject() const; + virtual OUString implGetImplementationName() const; + +private: + OUString maTableStyleListPath; + oox::drawingml::table::TableStyleListPtr mpTableStyleList; + + SlidePersistPtr mpActualSlidePersist; + std::map< OUString, oox::drawingml::ThemePtr > maThemes; + + std::vector< SlidePersistPtr > maDrawPages; + std::vector< SlidePersistPtr > maMasterPages; + std::vector< SlidePersistPtr > maNotesPages; + + ::boost::shared_ptr< ::oox::drawingml::chart::ChartConverter > mxChartConv; +}; + +} } + +#endif // OOX_POWERPOINT_POWERPOINTIMPORT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/oox/ppt/pptshape.hxx b/include/oox/ppt/pptshape.hxx new file mode 100644 index 000000000000..aa485adf9347 --- /dev/null +++ b/include/oox/ppt/pptshape.hxx @@ -0,0 +1,73 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef OOX_PPT_PRESENTATION_PPTSHAPE_HXX +#define OOX_PPT_PRESENTATION_PPTSHAPE_HXX + +#include "oox/drawingml/shape.hxx" +#include "oox/ppt/slidepersist.hxx" + +namespace oox { namespace ppt { + +class PPTShape : public oox::drawingml::Shape +{ + ShapeLocation meShapeLocation; // placeholdershapes (mnSubType != 0) on Master are never displayed + sal_Bool mbReferenced; // placeholdershapes on Layout are displayed only, if they are not referenced + // placeholdershapes on Slide are displayed always + +public: + + PPTShape( const oox::ppt::ShapeLocation eShapeLocation, + const sal_Char* pServiceType = NULL ); + virtual ~PPTShape(); + + using oox::drawingml::Shape::addShape; + // addShape is creating and inserting the corresponding XShape. + void addShape( + oox::core::XmlFilterBase& rFilterBase, + SlidePersist& rPersist, + const oox::drawingml::Theme* pTheme, + const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes, + basegfx::B2DHomMatrix& aTransformation, + const com::sun::star::awt::Rectangle* pShapeRect = 0, + ::oox::drawingml::ShapeIdMap* pShapeMap = 0 ); + + virtual void applyShapeReference( const oox::drawingml::Shape& rReferencedShape, bool bUseText = true ); + + void setShapeLocation( const oox::ppt::ShapeLocation eShapeLocation ) { meShapeLocation = eShapeLocation; }; + ShapeLocation getShapeLocation() const { return meShapeLocation; }; + sal_Bool isReferenced() const { return mbReferenced; }; + void setReferenced( sal_Bool bReferenced ){ mbReferenced = bReferenced; }; + void setPlaceholder( oox::drawingml::ShapePtr pPlaceholder ) { mpPlaceholder = pPlaceholder; } + + static oox::drawingml::ShapePtr findPlaceholder( const sal_Int32 nMasterPlaceholder, std::vector< oox::drawingml::ShapePtr >& rShapes, bool bMasterOnly = false ); + static oox::drawingml::ShapePtr findPlaceholderByIndex( const sal_Int32 nIdx, std::vector< oox::drawingml::ShapePtr >& rShapes, bool bMasterOnly = false ); + + static oox::drawingml::TextListStylePtr getSubTypeTextListStyle( const SlidePersist& rSlidePersist, sal_Int32 nSubType ); + +protected: + + oox::drawingml::ShapePtr mpPlaceholder; +}; + +} } + +#endif // OOX_PPT_PRESENTATION_PPTSHAPE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/oox/ppt/pptshapecontext.hxx b/include/oox/ppt/pptshapecontext.hxx new file mode 100644 index 000000000000..59e46b3d54b5 --- /dev/null +++ b/include/oox/ppt/pptshapecontext.hxx @@ -0,0 +1,40 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef OOX_PPT_PPTSHAPECONTEXT_HXX +#define OOX_PPT_PPTSHAPECONTEXT_HXX + +#include "oox/drawingml/shapecontext.hxx" + +namespace oox { namespace ppt { + +class PPTShapeContext : public ::oox::drawingml::ShapeContext +{ + SlidePersistPtr mpSlidePersistPtr; + +public: + PPTShapeContext( ::oox::core::ContextHandler& rParent, const SlidePersistPtr pSlidePersistPtr, oox::drawingml::ShapePtr pMasterShapePtr, oox::drawingml::ShapePtr pShapePtr ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException); +}; + +} } + +#endif // OOX_PPT_PPTSHAPEGROUPCONTEXT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/oox/ppt/pptshapegroupcontext.hxx b/include/oox/ppt/pptshapegroupcontext.hxx new file mode 100644 index 000000000000..c7e60c76e823 --- /dev/null +++ b/include/oox/ppt/pptshapegroupcontext.hxx @@ -0,0 +1,56 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef OOX_PPT_PPTSHAPEGROUPCONTEXT_HXX +#define OOX_PPT_PPTSHAPEGROUPCONTEXT_HXX + +#include "oox/drawingml/shapegroupcontext.hxx" +#include "oox/ppt/slidepersist.hxx" + +namespace oox { namespace ppt { + +class PPTShapeGroupContext : public ::oox::drawingml::ShapeGroupContext +{ + SlidePersistPtr mpSlidePersistPtr; + ShapeLocation meShapeLocation; + oox::drawingml::ShapePtr pGraphicShape; + void importExtDrawings(); + +public: + PPTShapeGroupContext( + ::oox::core::ContextHandler& rParent, + const oox::ppt::SlidePersistPtr pSlidePersistPtr, + const oox::ppt::ShapeLocation eShapeLocation, + oox::drawingml::ShapePtr pMasterShapePtr, + oox::drawingml::ShapePtr pGroupShapePtr ); + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL + createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL endFastElement( ::sal_Int32 Element ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException); + +protected: + +}; + +} } + +#endif // OOX_PPT_PPTSHAPEGROUPCONTEXT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/oox/ppt/pptshapepropertiescontext.hxx b/include/oox/ppt/pptshapepropertiescontext.hxx new file mode 100644 index 000000000000..f979c6efd3db --- /dev/null +++ b/include/oox/ppt/pptshapepropertiescontext.hxx @@ -0,0 +1,40 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef OOX_PPT_PPTSHAPEPROPERTIESCONTEXT_HXX +#define OOX_PPT_PPTSHAPEPROPERTIESCONTEXT_HXX + +#include "oox/drawingml/shapepropertiescontext.hxx" + +namespace oox { namespace ppt { + +class PPTShapePropertiesContext : public ::oox::drawingml::ShapePropertiesContext +{ +public: + PPTShapePropertiesContext( ::oox::core::ContextHandler& rParent, ::oox::drawingml::Shape& rShape ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL + createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) + throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException); +}; + +} } + +#endif // OOX_PPT_PPTSHAPEGROUPCONTEXT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/oox/ppt/presentationfragmenthandler.hxx b/include/oox/ppt/presentationfragmenthandler.hxx new file mode 100644 index 000000000000..ae26cb233e8c --- /dev/null +++ b/include/oox/ppt/presentationfragmenthandler.hxx @@ -0,0 +1,72 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef OOX_PPT_PRESENTATION_FRAGMENTHANDLER +#define OOX_PPT_PRESENTATION_FRAGMENTHANDLER + +#include +#include +#include "oox/drawingml/textliststyle.hxx" +#include "oox/ppt/slidepersist.hxx" +#include "oox/core/contexthandler.hxx" +#include "oox/core/fragmenthandler.hxx" +#include "oox/core/fragmenthandler2.hxx" +#include "oox/core/relations.hxx" +#include "oox/ppt/customshowlistcontext.hxx" +#include "oox/ppt/comments.hxx" +#include +#include + +namespace oox { namespace ppt { + +class PresentationFragmentHandler : public ::oox::core::FragmentHandler2 +{ +public: + PresentationFragmentHandler( ::oox::core::XmlFilterBase& rFilter, const OUString& rFragmentPath ) throw(); + virtual ~PresentationFragmentHandler() throw(); + virtual void finalizeImport(); + virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs ); + +protected: + bool importSlide( const ::oox::core::FragmentHandlerRef& rxSlideFragmentHandler, + const oox::ppt::SlidePersistPtr pPersist ); + +private: + + void importSlide(sal_uInt32 nSlide, sal_Bool bFirstSlide, sal_Bool bImportNotes); + + std::vector< OUString > maSlideMasterVector; + std::vector< OUString > maSlidesVector; + std::vector< OUString > maNotesMasterVector; + ::oox::drawingml::TextListStylePtr mpTextListStyle; + + ::com::sun::star::awt::Size maSlideSize; + ::com::sun::star::awt::Size maNotesSize; + + std::vector< CustomShow > maCustomShowList; + + CommentAuthorList maAuthorList; + bool mbCommentAuthorsRead; // read commentAuthors.xml only once +}; + +} } + +#endif // OOX_PPT_PRESENTATION_FRAGMENTHANDLER + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/oox/ppt/slidefragmenthandler.hxx b/include/oox/ppt/slidefragmenthandler.hxx new file mode 100644 index 000000000000..045f6ff1ccda --- /dev/null +++ b/include/oox/ppt/slidefragmenthandler.hxx @@ -0,0 +1,60 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef OOX_PPT_SLIDEFRAGMENTHANDLER +#define OOX_PPT_SLIDEFRAGMENTHANDLER + +#include +#include "oox/helper/propertymap.hxx" +#include "oox/core/fragmenthandler2.hxx" +#include "oox/ppt/slidepersist.hxx" + +#include +#include +#include + +namespace oox { namespace ppt { + +class SlideFragmentHandler : public ::oox::core::FragmentHandler2 +{ +public: + SlideFragmentHandler( ::oox::core::XmlFilterBase& rFilter, const OUString& rFragmentPath, SlidePersistPtr pPersistPtr, const ShapeLocation eShapeLocation ) throw(); + virtual ~SlideFragmentHandler() throw(); + + virtual void finalizeImport(); + virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs ); + virtual void onCharacters( const OUString& rChars ); + + const ::std::vector< OUString>& getCharVector() { return maCharVector; } + +protected: + SlidePersistPtr mpSlidePersistPtr; + ShapeLocation meShapeLocation; + +private: + OUString maSlideName; + PropertyMap maSlideProperties; + ::std::vector< OUString> maCharVector; // handle char in OnCharacters +}; + +} } + +#endif // OOX_PPT_SLIDEFRAGMENTHANDLER + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/oox/ppt/slidemastertextstylescontext.hxx b/include/oox/ppt/slidemastertextstylescontext.hxx new file mode 100644 index 000000000000..c1e9c1478ec6 --- /dev/null +++ b/include/oox/ppt/slidemastertextstylescontext.hxx @@ -0,0 +1,45 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef OOX_DRAWINGML_SLIDEMASTERTEXTSTYLESCONTEXT_HXX +#define OOX_DRAWINGML_SLIDEMASTERTEXTSTYLESCONTEXT_HXX + +#include "oox/drawingml/theme.hxx" +#include "oox/core/contexthandler.hxx" +#include "oox/core/fragmenthandler2.hxx" +#include "oox/ppt/slidepersist.hxx" + +namespace oox { namespace ppt { + +class SlideMasterTextStylesContext : public oox::core::FragmentHandler2 +{ +public: + SlideMasterTextStylesContext( ::oox::core::FragmentHandler2& rParent, SlidePersistPtr pSlidePersistPtr ); + ~SlideMasterTextStylesContext(); + virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs ); + +protected: + SlidePersistPtr mpSlidePersistPtr; +}; + +} } + +#endif // OOX_DRAWINGML_SLIDEMASTERTEXTSTYLESCONTEXT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/oox/ppt/slidepersist.hxx b/include/oox/ppt/slidepersist.hxx new file mode 100644 index 000000000000..6f58d81813c3 --- /dev/null +++ b/include/oox/ppt/slidepersist.hxx @@ -0,0 +1,161 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef OOX_POWERPOINT_SLIDEPERSIST_HXX +#define OOX_POWERPOINT_SLIDEPERSIST_HXX + +#include +#include "oox/drawingml/shape.hxx" +#include "oox/drawingml/theme.hxx" +#include "oox/drawingml/clrscheme.hxx" +#include "oox/drawingml/textliststyle.hxx" +#include "oox/drawingml/textparagraphproperties.hxx" +#include +#include +#include +#include +#include "oox/core/fragmenthandler.hxx" +#include "oox/ppt/comments.hxx" + +#include + +namespace oox { namespace vml { class Drawing; } } + +namespace oox { namespace ppt { + +enum ShapeLocation +{ + Master, + Layout, + Slide +}; + +// --------------------------------------------------------------------- +class TimeNode; +class SlidePersist; + +typedef boost::shared_ptr< SlidePersist > SlidePersistPtr; + +class SlidePersist : public boost::enable_shared_from_this< SlidePersist > +{ + +public: + SlidePersist( oox::core::XmlFilterBase& rFilter, sal_Bool bMaster, sal_Bool bNotes, + const com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage >&, + oox::drawingml::ShapePtr pShapesPtr, const ::oox::drawingml::TextListStylePtr & ); + ~SlidePersist(); + + com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage > getPage() const { return mxPage; }; + +#if OSL_DEBUG_LEVEL > 0 + static com::sun::star::uno::WeakReference< com::sun::star::drawing::XDrawPage > mxDebugPage; +#endif + + void setMasterPersist( SlidePersistPtr pMasterPersistPtr ){ mpMasterPagePtr = pMasterPersistPtr; } + SlidePersistPtr getMasterPersist() const { return mpMasterPagePtr; } + + void setPath( const OUString& rPath ) { maPath = rPath; } + const OUString getPath() const { return maPath; } + + void setLayoutPath( const OUString& rLayoutPath ) { maLayoutPath = rLayoutPath; } + const OUString getLayoutPath() const { return maLayoutPath; } + + void setTheme( const oox::drawingml::ThemePtr pThemePtr ){ mpThemePtr = pThemePtr; } + oox::drawingml::ThemePtr getTheme() const { return mpThemePtr; } + + void setClrScheme( const oox::drawingml::ClrSchemePtr pClrSchemePtr ){ mpClrSchemePtr = pClrSchemePtr; } + oox::drawingml::ClrSchemePtr getClrScheme() const { return mpClrSchemePtr; } + + void setClrMap( const oox::drawingml::ClrMapPtr pClrMapPtr ){ mpClrMapPtr = pClrMapPtr; } + oox::drawingml::ClrMapPtr getClrMap() const { return mpClrMapPtr; } + + void setBackgroundProperties( const oox::drawingml::FillPropertiesPtr pFillPropertiesPtr ){ mpBackgroundPropertiesPtr = pFillPropertiesPtr; } + oox::drawingml::FillPropertiesPtr getBackgroundProperties() const { return mpBackgroundPropertiesPtr; } + oox::drawingml::Color& getBackgroundColor() { return maBackgroundColor; } + + sal_Bool isMasterPage() const { return mbMaster; } + sal_Bool isNotesPage() const { return mbNotes; } + + void setLayoutValueToken( sal_Int32 nLayoutValueToken ) { mnLayoutValueToken = nLayoutValueToken; } + short getLayoutFromValueToken(); + + + oox::drawingml::TextListStylePtr getDefaultTextStyle() const { return maDefaultTextStylePtr; } + oox::drawingml::TextListStylePtr getTitleTextStyle() const { return maTitleTextStylePtr; } + oox::drawingml::TextListStylePtr getBodyTextStyle() const { return maBodyTextStylePtr; } + oox::drawingml::TextListStylePtr getNotesTextStyle() const { return maNotesTextStylePtr; } + oox::drawingml::TextListStylePtr getOtherTextStyle() const { return maOtherTextStylePtr; } + + oox::drawingml::ShapePtr getShapes() { return maShapesPtr; } + void hideShapesAsMasterShapes(); + ::std::list< boost::shared_ptr< TimeNode > >& getTimeNodeList() { return maTimeNodeList; } + oox::ppt::HeaderFooter& getHeaderFooter(){ return maHeaderFooter; }; + + oox::vml::Drawing* getDrawing() { return mpDrawingPtr.get(); } + + void createXShapes( oox::core::XmlFilterBase& rFilterBase ); + void createBackground( const oox::core::XmlFilterBase& rFilterBase ); + void applyTextStyles( const oox::core::XmlFilterBase& rFilterBase ); + + std::map< OUString, ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode > >& getAnimNodesMap() { return maAnimNodesMap; }; + ::oox::drawingml::ShapePtr getShape( const OUString & id ) { return maShapeMap[ id ]; } + ::oox::drawingml::ShapeIdMap& getShapeMap() { return maShapeMap; } + + CommentList& getCommentsList() { return maCommentsList; } + CommentAuthorList& getCommentAuthors() { return maCommentAuthors; } + +private: + OUString maPath; + OUString maLayoutPath; + ::boost::shared_ptr< oox::vml::Drawing > mpDrawingPtr; + com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage > mxPage; + oox::drawingml::ThemePtr mpThemePtr; // the theme that is used + oox::drawingml::ClrSchemePtr mpClrSchemePtr; // the local color scheme (if any) + oox::drawingml::ClrMapPtr mpClrMapPtr; // color mapping (if any) + SlidePersistPtr mpMasterPagePtr; + + oox::drawingml::ShapePtr maShapesPtr; + oox::drawingml::Color maBackgroundColor; + oox::drawingml::FillPropertiesPtr mpBackgroundPropertiesPtr; + ::std::list< boost::shared_ptr< TimeNode > > maTimeNodeList; + + oox::ppt::HeaderFooter maHeaderFooter; + sal_Int32 mnLayoutValueToken; + sal_Bool mbMaster; + sal_Bool mbNotes; + + oox::drawingml::TextListStylePtr maDefaultTextStylePtr; + oox::drawingml::TextListStylePtr maTitleTextStylePtr; + oox::drawingml::TextListStylePtr maBodyTextStylePtr; + oox::drawingml::TextListStylePtr maNotesTextStylePtr; + oox::drawingml::TextListStylePtr maOtherTextStylePtr; + + std::map< OUString, ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode > > maAnimNodesMap; + std::map< OUString, ::oox::drawingml::ShapePtr > maShapeMap; + + // slide comments + CommentList maCommentsList; + CommentAuthorList maCommentAuthors; +}; + +} } + +#endif // OOX_POWERPOINT_SLIDEPERSIST_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/oox/ppt/slidetimingcontext.hxx b/include/oox/ppt/slidetimingcontext.hxx new file mode 100644 index 000000000000..a50e8be60fd3 --- /dev/null +++ b/include/oox/ppt/slidetimingcontext.hxx @@ -0,0 +1,48 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef OOX_PPT_SLIDETIMINGCONTEXT +#define OOX_PPT_SLIDETIMINGCONTEXT + +#include +#include "oox/ppt/timenode.hxx" +#include "oox/core/fragmenthandler2.hxx" + +#include +#include + +namespace oox { namespace ppt { + +class SlideTimingContext : public ::oox::core::FragmentHandler2 +{ +public: + SlideTimingContext( ::oox::core::FragmentHandler2& rParent, TimeNodePtrList & aTimeNodeList ) throw(); + virtual ~SlideTimingContext() throw(); + + virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs ); + +private: + TimeNodePtrList & maTimeNodeList; +}; + +} } + +#endif // OOX_PPT_SLIDETIMINGCONTEXT + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/oox/ppt/slidetransition.hxx b/include/oox/ppt/slidetransition.hxx new file mode 100644 index 000000000000..01f701d63dfe --- /dev/null +++ b/include/oox/ppt/slidetransition.hxx @@ -0,0 +1,72 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + + +#ifndef OOX_PPT_SLIDETRANSITION +#define OOX_PPT_SLIDETRANSITION + +#include + +#include + +namespace oox { class PropertyMap; } + +namespace oox { namespace ppt { + + class SlideTransition + { + public: + SlideTransition(); + explicit SlideTransition(const OUString & ); + + void setSlideProperties( PropertyMap& props ); + void setTransitionFilterProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XTransitionFilter > & xFilter ); + + void setOoxTransitionSpeed( sal_Int32 nToken ); + void setFadeColor( sal_Int32 nColor ) + { mnFadeColor = nColor; } + void setMode( sal_Bool bMode ) + { mbMode = bMode; } + void setOoxAdvanceTime( sal_Int32 nAdvanceTime ) + { mnAdvanceTime = nAdvanceTime; } + + static sal_Int16 ooxToOdpDirection( ::sal_Int32 nOoxType ); + static sal_Int16 ooxToOdpEightDirections( ::sal_Int32 nOoxType ); + static sal_Int16 ooxToOdpCornerDirections( ::sal_Int32 nOoxType ); + static sal_Int16 ooxToOdpBorderDirections( ::sal_Int32 nOoxType ); + static sal_Int16 ooxToOdpSideDirections( ::sal_Int32 nOoxType ); + static sal_Bool ooxToOdpSideDirectionsDirectionNormal( ::sal_Int32 nOoxType ); + + void setOoxTransitionType( ::sal_Int32 OoxType, + ::sal_Int32 param1, ::sal_Int32 param2 ); + private: + ::sal_Int16 mnTransitionType; + ::sal_Int16 mnTransitionSubType; + ::sal_Bool mbTransitionDirectionNormal; + ::sal_Int16 mnAnimationSpeed; + ::sal_Int32 mnFadeColor; + ::sal_Bool mbMode; /**< http://api.libreoffice.org/docs/common/ref/com/sun/star/animations/XTransitionFilter.html Mode property */ + ::sal_Int32 mnAdvanceTime; + }; + +} } + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/oox/ppt/slidetransitioncontext.hxx b/include/oox/ppt/slidetransitioncontext.hxx new file mode 100644 index 000000000000..077d5a8f5813 --- /dev/null +++ b/include/oox/ppt/slidetransitioncontext.hxx @@ -0,0 +1,52 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef OOX_PPT_SLIDETRANSITIONCONTEXT +#define OOX_PPT_SLIDETRANSITIONCONTEXT + +#include "oox/core/fragmenthandler2.hxx" +#include "oox/ppt/slidetransition.hxx" + +namespace oox { class PropertyMap; } + +namespace oox { namespace ppt { + + class SlideTransitionContext : public ::oox::core::FragmentHandler2 + { + public: + SlideTransitionContext( ::oox::core::FragmentHandler2& rParent, + const AttributeList& rAttributes, + PropertyMap & aProperties ) throw(); + virtual ~SlideTransitionContext() throw(); + + virtual void onEndElement(); + virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs ); + + + private: + PropertyMap& maSlideProperties; + ::sal_Bool mbHasTransition; + SlideTransition maTransition; + }; + +} } + +#endif // OOX_PPT_SLIDEFRAGMENTHANDLER + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/oox/ppt/soundactioncontext.hxx b/include/oox/ppt/soundactioncontext.hxx new file mode 100644 index 000000000000..d1f1040c75ba --- /dev/null +++ b/include/oox/ppt/soundactioncontext.hxx @@ -0,0 +1,55 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + + +#ifndef OOX_PPT_SOUNDACTIONCONTEXT +#define OOX_PPT_SOUNDACTIONCONTEXT + +#include "oox/core/fragmenthandler2.hxx" + +namespace oox { class PropertyMap; } + +namespace oox { namespace ppt { + +class SoundActionContext : public ::oox::core::FragmentHandler2 +{ +public: + SoundActionContext( ::oox::core::FragmentHandler2& rParent, PropertyMap & aProperties ) throw(); + virtual ~SoundActionContext() throw(); + + virtual void onEndElement(); + virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs ); + +private: + PropertyMap& maSlideProperties; + bool mbHasStartSound; + bool mbLoopSound; + bool mbStopSound; + OUString msEmbedded; + OUString msLink; + OUString msSndName; +}; + +} } + + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/oox/ppt/timenode.hxx b/include/oox/ppt/timenode.hxx new file mode 100644 index 000000000000..769cc0e03943 --- /dev/null +++ b/include/oox/ppt/timenode.hxx @@ -0,0 +1,128 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + + +#ifndef OOX_DRAWINGML_TIMENODE_HXX +#define OOX_DRAWINGML_TIMENODE_HXX + +#include +#include +#include +#include + +#include +#include +#include "oox/helper/propertymap.hxx" +#include "oox/ppt/slidetransition.hxx" +#include "oox/ppt/slidepersist.hxx" +#include "oox/ppt/animationspersist.hxx" +#include "oox/ppt/timenode.hxx" + +namespace oox { namespace ppt { + + class TimeNode; + class SlideTransition; + + typedef boost::shared_ptr< TimeNode > TimeNodePtr; + typedef ::std::list< TimeNodePtr > TimeNodePtrList; + + class TimeNode + { + public: + typedef ::std::map< OUString, ::com::sun::star::uno::Any > UserDataMap; + + TimeNode( sal_Int16 nNodeType ); + virtual ~TimeNode(); + + NodePropertyMap & getNodeProperties() { return maNodeProperties; } + UserDataMap & getUserData() { return maUserData; } + void addChild( const TimeNodePtr & pChildPtr ) + { maChildren.push_back( pChildPtr ); } + + TimeNodePtrList & getChildren() + { return maChildren; } + + void setId( sal_Int32 nId ); + const OUString & getId() const { return msId; } + + void addNode( + const ::oox::core::XmlFilterBase& rFilter, + const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& rxNode, + const SlidePersistPtr & slide); + // data setters + void setTo( const ::com::sun::star::uno::Any & aTo ); + void setFrom( const ::com::sun::star::uno::Any & aFrom ); + void setBy( const ::com::sun::star::uno::Any & aBy ); + void setTransitionFilter( const SlideTransition & aTransition) + { maTransitionFilter = aTransition; } + + void setNode( + const ::oox::core::XmlFilterBase& rFilter, + const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& xNode, + const SlidePersistPtr & pSlide ); + + AnimTargetElementPtr getTarget() + { + if( !mpTarget ) + mpTarget.reset( new AnimTargetElement ); + return mpTarget; + } + + AnimationConditionList &getStartCondition() + { return maStCondList; } + AnimationConditionList &getEndCondition() + { return maEndCondList; } + AnimationConditionList &getNextCondition() + { return maNextCondList; } + AnimationConditionList &getPrevCondition() + { return maPrevCondList; } + AnimationCondition & getEndSyncValue() + { mbHasEndSyncValue = true; return maEndSyncValue; } + protected: + + static OUString getServiceName( sal_Int16 nNodeType ); + + ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode > + createAndInsert( + const ::oox::core::XmlFilterBase& rFilter, + const OUString& rServiceName, + const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& rxNode ); + + private: + const sal_Int16 mnNodeType; + + TimeNodePtrList maChildren; + + OUString msId; + NodePropertyMap maNodeProperties; + UserDataMap maUserData; // a sequence to be stored as "UserData" property + SlideTransition maTransitionFilter; + AnimTargetElementPtr mpTarget; + bool mbHasEndSyncValue; // set to true if we try to get the endSync. + AnimationCondition maEndSyncValue; + AnimationConditionList maStCondList, maEndCondList; + AnimationConditionList maPrevCondList, maNextCondList; + }; + +} } + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/oox/ppt/timenodelistcontext.hxx b/include/oox/ppt/timenodelistcontext.hxx new file mode 100644 index 000000000000..baacbc94add4 --- /dev/null +++ b/include/oox/ppt/timenodelistcontext.hxx @@ -0,0 +1,65 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef OOX_PPT_TIMENODELISTCONTEXT +#define OOX_PPT_TIMENODELISTCONTEXT + +#include "oox/core/fragmenthandler2.hxx" +#include "oox/ppt/timenode.hxx" + +#include + +namespace oox { namespace ppt { + + + class TimeNodeContext : public ::oox::core::FragmentHandler2 + { + public: + virtual ~TimeNodeContext() throw(); + + static TimeNodeContext * SAL_CALL makeContext( ::oox::core::FragmentHandler2& rParent, sal_Int32 aElement, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttribs, const TimeNodePtr & pNode ); + + protected: + TimeNodeContext( ::oox::core::FragmentHandler2& rParent, sal_Int32 aElement, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttribs, const TimeNodePtr & pNode ) throw(); + + sal_Int32 mnElement; + TimeNodePtr mpNode; + }; + + + +/** FastParser context for XML_tnLst, XML_subTnLst and XML_childTnLst */ +class TimeNodeListContext : public ::oox::core::FragmentHandler2 +{ +public: + TimeNodeListContext( ::oox::core::FragmentHandler2& rParent, TimeNodePtrList & aList ) throw(); + + virtual ~TimeNodeListContext() throw(); + virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs ); + + +private: + TimeNodePtrList & maList; +}; + +} } + +#endif // OOX_PPT_SLIDEFRAGMENTHANDLER + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit