Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / include / oox / ppt / slidepersist.hxx
blob1e75c2c281bae072707c0fbaf3a16ccdfa6d92a6
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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
23 #include <memory>
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>
34 #include <list>
36 namespace oox { namespace vml { class Drawing; } }
38 namespace oox { namespace ppt {
40 enum ShapeLocation
42 Master,
43 Layout,
44 Slide
48 class TimeNode;
49 class SlidePersist;
51 typedef std::shared_ptr< SlidePersist > SlidePersistPtr;
53 class SlidePersist : public std::enable_shared_from_this< SlidePersist >
56 public:
57 SlidePersist( oox::core::XmlFilterBase& rFilter, bool bMaster, bool bNotes,
58 const css::uno::Reference< css::drawing::XDrawPage >&,
59 oox::drawingml::ShapePtr pShapesPtr, const ::oox::drawingml::TextListStylePtr & );
60 ~SlidePersist();
62 const css::uno::Reference< css::drawing::XDrawPage >& getPage() const { return mxPage; };
64 #if OSL_DEBUG_LEVEL > 0
65 static css::uno::WeakReference< css::drawing::XDrawPage > mxDebugPage;
66 #endif
68 void setMasterPersist( SlidePersistPtr pMasterPersistPtr ){ mpMasterPagePtr = pMasterPersistPtr; }
69 const 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 const oox::drawingml::ThemePtr& getTheme() const { return mpThemePtr; }
80 const oox::drawingml::ClrSchemePtr& getClrScheme() const { return mpClrSchemePtr; }
82 void setClrMap( const oox::drawingml::ClrMapPtr pClrMapPtr ){ mpClrMapPtr = pClrMapPtr; }
83 const oox::drawingml::ClrMapPtr& getClrMap() const { return mpClrMapPtr; }
85 void setBackgroundProperties( const oox::drawingml::FillPropertiesPtr& rFillPropertiesPtr ){ mpBackgroundPropertiesPtr = rFillPropertiesPtr; }
86 const oox::drawingml::FillPropertiesPtr& getBackgroundProperties() const { return mpBackgroundPropertiesPtr; }
87 oox::drawingml::Color& getBackgroundColor() { return maBackgroundColor; }
89 bool isMasterPage() const { return mbMaster; }
90 bool isNotesPage() const { return mbNotes; }
92 void setLayoutValueToken( sal_Int32 nLayoutValueToken ) { mnLayoutValueToken = nLayoutValueToken; }
93 short getLayoutFromValueToken();
96 const oox::drawingml::TextListStylePtr& getDefaultTextStyle() const { return maDefaultTextStylePtr; }
97 const oox::drawingml::TextListStylePtr& getTitleTextStyle() const { return maTitleTextStylePtr; }
98 const oox::drawingml::TextListStylePtr& getBodyTextStyle() const { return maBodyTextStylePtr; }
99 const oox::drawingml::TextListStylePtr& getNotesTextStyle() const { return maNotesTextStylePtr; }
100 const oox::drawingml::TextListStylePtr& getOtherTextStyle() const { return maOtherTextStylePtr; }
102 const oox::drawingml::ShapePtr& getShapes() { return maShapesPtr; }
103 void hideShapesAsMasterShapes();
104 ::std::list< std::shared_ptr< TimeNode > >& getTimeNodeList() { return maTimeNodeList; }
105 oox::ppt::HeaderFooter& getHeaderFooter(){ return maHeaderFooter; };
107 oox::vml::Drawing* getDrawing() { return mpDrawingPtr.get(); }
109 void createXShapes( oox::core::XmlFilterBase& rFilterBase );
110 void createBackground( const oox::core::XmlFilterBase& rFilterBase );
111 void applyTextStyles( const oox::core::XmlFilterBase& rFilterBase );
113 std::map< OUString, css::uno::Reference< css::animations::XAnimationNode > >& getAnimNodesMap() { return maAnimNodesMap; };
114 ::oox::drawingml::ShapePtr getShape( const OUString & id ) { return maShapeMap[ id ]; }
115 ::oox::drawingml::ShapeIdMap& getShapeMap() { return maShapeMap; }
117 CommentList& getCommentsList() { return maCommentsList; }
118 CommentAuthorList& getCommentAuthors() { return maCommentAuthors; }
120 private:
121 OUString maPath;
122 OUString maLayoutPath;
123 std::shared_ptr< oox::vml::Drawing > mpDrawingPtr;
124 css::uno::Reference< css::drawing::XDrawPage > mxPage;
125 oox::drawingml::ThemePtr mpThemePtr; // the theme that is used
126 oox::drawingml::ClrSchemePtr mpClrSchemePtr; // the local color scheme (if any)
127 oox::drawingml::ClrMapPtr mpClrMapPtr; // color mapping (if any)
128 SlidePersistPtr mpMasterPagePtr;
130 oox::drawingml::ShapePtr maShapesPtr;
131 oox::drawingml::Color maBackgroundColor;
132 oox::drawingml::FillPropertiesPtr mpBackgroundPropertiesPtr;
133 ::std::list< std::shared_ptr< TimeNode > > maTimeNodeList;
135 oox::ppt::HeaderFooter maHeaderFooter;
136 sal_Int32 mnLayoutValueToken;
137 bool mbMaster;
138 bool mbNotes;
140 oox::drawingml::TextListStylePtr maDefaultTextStylePtr;
141 oox::drawingml::TextListStylePtr maTitleTextStylePtr;
142 oox::drawingml::TextListStylePtr maBodyTextStylePtr;
143 oox::drawingml::TextListStylePtr maNotesTextStylePtr;
144 oox::drawingml::TextListStylePtr maOtherTextStylePtr;
146 std::map< OUString, css::uno::Reference< css::animations::XAnimationNode > > maAnimNodesMap;
147 std::map< OUString, ::oox::drawingml::ShapePtr > maShapeMap;
149 // slide comments
150 CommentList maCommentsList;
151 CommentAuthorList maCommentAuthors;
156 #endif // INCLUDED_OOX_PPT_SLIDEPERSIST_HXX
158 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */