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 INCLUDED_OOX_PPT_SLIDEPERSIST_HXX
21 #define INCLUDED_OOX_PPT_SLIDEPERSIST_HXX
24 #include <oox/drawingml/shape.hxx>
25 #include <oox/drawingml/theme.hxx>
26 #include <oox/drawingml/clrscheme.hxx>
27 #include <oox/ppt/headerfooter.hxx>
28 #include <com/sun/star/frame/XModel.hpp>
29 #include <com/sun/star/drawing/XDrawPage.hpp>
30 #include <com/sun/star/animations/XAnimationNode.hpp>
31 #include <oox/core/fragmenthandler.hxx>
32 #include <oox/ppt/comments.hxx>
36 namespace oox
{ namespace vml
{ class Drawing
; } }
38 namespace oox
{ namespace ppt
{
51 typedef std::shared_ptr
< SlidePersist
> SlidePersistPtr
;
53 class SlidePersist
: public std::enable_shared_from_this
< SlidePersist
>
57 SlidePersist( oox::core::XmlFilterBase
& rFilter
, bool bMaster
, bool bNotes
,
58 const com::sun::star::uno::Reference
< com::sun::star::drawing::XDrawPage
>&,
59 oox::drawingml::ShapePtr pShapesPtr
, const ::oox::drawingml::TextListStylePtr
& );
62 com::sun::star::uno::Reference
< com::sun::star::drawing::XDrawPage
> getPage() const { return mxPage
; };
64 #if OSL_DEBUG_LEVEL > 0
65 static com::sun::star::uno::WeakReference
< com::sun::star::drawing::XDrawPage
> mxDebugPage
;
68 void setMasterPersist( SlidePersistPtr pMasterPersistPtr
){ mpMasterPagePtr
= pMasterPersistPtr
; }
69 SlidePersistPtr
getMasterPersist() const { return mpMasterPagePtr
; }
71 void setPath( const OUString
& rPath
) { maPath
= rPath
; }
72 const OUString
getPath() const { return maPath
; }
74 void setLayoutPath( const OUString
& rLayoutPath
) { maLayoutPath
= rLayoutPath
; }
75 const OUString
getLayoutPath() const { return maLayoutPath
; }
77 void setTheme( const oox::drawingml::ThemePtr
& rThemePtr
){ mpThemePtr
= rThemePtr
; }
78 oox::drawingml::ThemePtr
getTheme() const { return mpThemePtr
; }
80 void setClrScheme( const oox::drawingml::ClrSchemePtr
& rClrSchemePtr
){ mpClrSchemePtr
= rClrSchemePtr
; }
81 oox::drawingml::ClrSchemePtr
getClrScheme() const { return mpClrSchemePtr
; }
83 void setClrMap( const oox::drawingml::ClrMapPtr pClrMapPtr
){ mpClrMapPtr
= pClrMapPtr
; }
84 oox::drawingml::ClrMapPtr
getClrMap() const { return mpClrMapPtr
; }
86 void setBackgroundProperties( const oox::drawingml::FillPropertiesPtr
& rFillPropertiesPtr
){ mpBackgroundPropertiesPtr
= rFillPropertiesPtr
; }
87 oox::drawingml::FillPropertiesPtr
getBackgroundProperties() const { return mpBackgroundPropertiesPtr
; }
88 oox::drawingml::Color
& getBackgroundColor() { return maBackgroundColor
; }
90 bool isMasterPage() const { return mbMaster
; }
91 bool isNotesPage() const { return mbNotes
; }
93 void setLayoutValueToken( sal_Int32 nLayoutValueToken
) { mnLayoutValueToken
= nLayoutValueToken
; }
94 short getLayoutFromValueToken();
97 oox::drawingml::TextListStylePtr
getDefaultTextStyle() const { return maDefaultTextStylePtr
; }
98 oox::drawingml::TextListStylePtr
getTitleTextStyle() const { return maTitleTextStylePtr
; }
99 oox::drawingml::TextListStylePtr
getBodyTextStyle() const { return maBodyTextStylePtr
; }
100 oox::drawingml::TextListStylePtr
getNotesTextStyle() const { return maNotesTextStylePtr
; }
101 oox::drawingml::TextListStylePtr
getOtherTextStyle() const { return maOtherTextStylePtr
; }
103 oox::drawingml::ShapePtr
getShapes() { return maShapesPtr
; }
104 void hideShapesAsMasterShapes();
105 ::std::list
< std::shared_ptr
< TimeNode
> >& getTimeNodeList() { return maTimeNodeList
; }
106 oox::ppt::HeaderFooter
& getHeaderFooter(){ return maHeaderFooter
; };
108 oox::vml::Drawing
* getDrawing() { return mpDrawingPtr
.get(); }
110 void createXShapes( oox::core::XmlFilterBase
& rFilterBase
);
111 void createBackground( const oox::core::XmlFilterBase
& rFilterBase
);
112 void applyTextStyles( const oox::core::XmlFilterBase
& rFilterBase
);
114 std::map
< OUString
, ::com::sun::star::uno::Reference
< ::com::sun::star::animations::XAnimationNode
> >& getAnimNodesMap() { return maAnimNodesMap
; };
115 ::oox::drawingml::ShapePtr
getShape( const OUString
& id
) { return maShapeMap
[ id
]; }
116 ::oox::drawingml::ShapeIdMap
& getShapeMap() { return maShapeMap
; }
118 CommentList
& getCommentsList() { return maCommentsList
; }
119 CommentAuthorList
& getCommentAuthors() { return maCommentAuthors
; }
123 OUString maLayoutPath
;
124 std::shared_ptr
< oox::vml::Drawing
> mpDrawingPtr
;
125 com::sun::star::uno::Reference
< com::sun::star::drawing::XDrawPage
> mxPage
;
126 oox::drawingml::ThemePtr mpThemePtr
; // the theme that is used
127 oox::drawingml::ClrSchemePtr mpClrSchemePtr
; // the local color scheme (if any)
128 oox::drawingml::ClrMapPtr mpClrMapPtr
; // color mapping (if any)
129 SlidePersistPtr mpMasterPagePtr
;
131 oox::drawingml::ShapePtr maShapesPtr
;
132 oox::drawingml::Color maBackgroundColor
;
133 oox::drawingml::FillPropertiesPtr mpBackgroundPropertiesPtr
;
134 ::std::list
< std::shared_ptr
< TimeNode
> > maTimeNodeList
;
136 oox::ppt::HeaderFooter maHeaderFooter
;
137 sal_Int32 mnLayoutValueToken
;
141 oox::drawingml::TextListStylePtr maDefaultTextStylePtr
;
142 oox::drawingml::TextListStylePtr maTitleTextStylePtr
;
143 oox::drawingml::TextListStylePtr maBodyTextStylePtr
;
144 oox::drawingml::TextListStylePtr maNotesTextStylePtr
;
145 oox::drawingml::TextListStylePtr maOtherTextStylePtr
;
147 std::map
< OUString
, ::com::sun::star::uno::Reference
< ::com::sun::star::animations::XAnimationNode
> > maAnimNodesMap
;
148 std::map
< OUString
, ::oox::drawingml::ShapePtr
> maShapeMap
;
151 CommentList maCommentsList
;
152 CommentAuthorList maCommentAuthors
;
157 #endif // INCLUDED_OOX_PPT_SLIDEPERSIST_HXX
159 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */