1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef OOX_POWERPOINT_SLIDEPERSIST_HXX
21 #define OOX_POWERPOINT_SLIDEPERSIST_HXX
23 #include <boost/shared_ptr.hpp>
24 #include "oox/drawingml/shape.hxx"
25 #include "oox/drawingml/theme.hxx"
26 #include "oox/drawingml/clrscheme.hxx"
27 #include "oox/drawingml/textliststyle.hxx"
28 #include "oox/drawingml/textparagraphproperties.hxx"
29 #include <oox/ppt/headerfooter.hxx>
30 #include <com/sun/star/frame/XModel.hpp>
31 #include <com/sun/star/drawing/XDrawPage.hpp>
32 #include <com/sun/star/animations/XAnimationNode.hpp>
33 #include "oox/core/fragmenthandler.hxx"
34 #include "oox/ppt/comments.hxx"
38 namespace oox
{ namespace vml
{ class Drawing
; } }
40 namespace oox
{ namespace ppt
{
49 // ---------------------------------------------------------------------
53 typedef boost::shared_ptr
< SlidePersist
> SlidePersistPtr
;
55 class SlidePersist
: public boost::enable_shared_from_this
< SlidePersist
>
59 SlidePersist( oox::core::XmlFilterBase
& rFilter
, sal_Bool bMaster
, sal_Bool bNotes
,
60 const com::sun::star::uno::Reference
< com::sun::star::drawing::XDrawPage
>&,
61 oox::drawingml::ShapePtr pShapesPtr
, const ::oox::drawingml::TextListStylePtr
& );
64 com::sun::star::uno::Reference
< com::sun::star::drawing::XDrawPage
> getPage() const { return mxPage
; };
66 #if OSL_DEBUG_LEVEL > 0
67 static com::sun::star::uno::WeakReference
< com::sun::star::drawing::XDrawPage
> mxDebugPage
;
70 void setMasterPersist( SlidePersistPtr pMasterPersistPtr
){ mpMasterPagePtr
= pMasterPersistPtr
; }
71 SlidePersistPtr
getMasterPersist() const { return mpMasterPagePtr
; }
73 void setPath( const OUString
& rPath
) { maPath
= rPath
; }
74 const OUString
getPath() const { return maPath
; }
76 void setLayoutPath( const OUString
& rLayoutPath
) { maLayoutPath
= rLayoutPath
; }
77 const OUString
getLayoutPath() const { return maLayoutPath
; }
79 void setTheme( const oox::drawingml::ThemePtr pThemePtr
){ mpThemePtr
= pThemePtr
; }
80 oox::drawingml::ThemePtr
getTheme() const { return mpThemePtr
; }
82 void setClrScheme( const oox::drawingml::ClrSchemePtr pClrSchemePtr
){ mpClrSchemePtr
= pClrSchemePtr
; }
83 oox::drawingml::ClrSchemePtr
getClrScheme() const { return mpClrSchemePtr
; }
85 void setClrMap( const oox::drawingml::ClrMapPtr pClrMapPtr
){ mpClrMapPtr
= pClrMapPtr
; }
86 oox::drawingml::ClrMapPtr
getClrMap() const { return mpClrMapPtr
; }
88 void setBackgroundProperties( const oox::drawingml::FillPropertiesPtr pFillPropertiesPtr
){ mpBackgroundPropertiesPtr
= pFillPropertiesPtr
; }
89 oox::drawingml::FillPropertiesPtr
getBackgroundProperties() const { return mpBackgroundPropertiesPtr
; }
90 oox::drawingml::Color
& getBackgroundColor() { return maBackgroundColor
; }
92 sal_Bool
isMasterPage() const { return mbMaster
; }
93 sal_Bool
isNotesPage() const { return mbNotes
; }
95 void setLayoutValueToken( sal_Int32 nLayoutValueToken
) { mnLayoutValueToken
= nLayoutValueToken
; }
96 short getLayoutFromValueToken();
99 oox::drawingml::TextListStylePtr
getDefaultTextStyle() const { return maDefaultTextStylePtr
; }
100 oox::drawingml::TextListStylePtr
getTitleTextStyle() const { return maTitleTextStylePtr
; }
101 oox::drawingml::TextListStylePtr
getBodyTextStyle() const { return maBodyTextStylePtr
; }
102 oox::drawingml::TextListStylePtr
getNotesTextStyle() const { return maNotesTextStylePtr
; }
103 oox::drawingml::TextListStylePtr
getOtherTextStyle() const { return maOtherTextStylePtr
; }
105 oox::drawingml::ShapePtr
getShapes() { return maShapesPtr
; }
106 void hideShapesAsMasterShapes();
107 ::std::list
< boost::shared_ptr
< TimeNode
> >& getTimeNodeList() { return maTimeNodeList
; }
108 oox::ppt::HeaderFooter
& getHeaderFooter(){ return maHeaderFooter
; };
110 oox::vml::Drawing
* getDrawing() { return mpDrawingPtr
.get(); }
112 void createXShapes( oox::core::XmlFilterBase
& rFilterBase
);
113 void createBackground( const oox::core::XmlFilterBase
& rFilterBase
);
114 void applyTextStyles( const oox::core::XmlFilterBase
& rFilterBase
);
116 std::map
< OUString
, ::com::sun::star::uno::Reference
< ::com::sun::star::animations::XAnimationNode
> >& getAnimNodesMap() { return maAnimNodesMap
; };
117 ::oox::drawingml::ShapePtr
getShape( const OUString
& id
) { return maShapeMap
[ id
]; }
118 ::oox::drawingml::ShapeIdMap
& getShapeMap() { return maShapeMap
; }
120 CommentList
& getCommentsList() { return maCommentsList
; }
121 CommentAuthorList
& getCommentAuthors() { return maCommentAuthors
; }
125 OUString maLayoutPath
;
126 ::boost::shared_ptr
< oox::vml::Drawing
> mpDrawingPtr
;
127 com::sun::star::uno::Reference
< com::sun::star::drawing::XDrawPage
> mxPage
;
128 oox::drawingml::ThemePtr mpThemePtr
; // the theme that is used
129 oox::drawingml::ClrSchemePtr mpClrSchemePtr
; // the local color scheme (if any)
130 oox::drawingml::ClrMapPtr mpClrMapPtr
; // color mapping (if any)
131 SlidePersistPtr mpMasterPagePtr
;
133 oox::drawingml::ShapePtr maShapesPtr
;
134 oox::drawingml::Color maBackgroundColor
;
135 oox::drawingml::FillPropertiesPtr mpBackgroundPropertiesPtr
;
136 ::std::list
< boost::shared_ptr
< TimeNode
> > maTimeNodeList
;
138 oox::ppt::HeaderFooter maHeaderFooter
;
139 sal_Int32 mnLayoutValueToken
;
143 oox::drawingml::TextListStylePtr maDefaultTextStylePtr
;
144 oox::drawingml::TextListStylePtr maTitleTextStylePtr
;
145 oox::drawingml::TextListStylePtr maBodyTextStylePtr
;
146 oox::drawingml::TextListStylePtr maNotesTextStylePtr
;
147 oox::drawingml::TextListStylePtr maOtherTextStylePtr
;
149 std::map
< OUString
, ::com::sun::star::uno::Reference
< ::com::sun::star::animations::XAnimationNode
> > maAnimNodesMap
;
150 std::map
< OUString
, ::oox::drawingml::ShapePtr
> maShapeMap
;
153 CommentList maCommentsList
;
154 CommentAuthorList maCommentAuthors
;
159 #endif // OOX_POWERPOINT_SLIDEPERSIST_HXX
161 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */