Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / include / oox / ppt / slidepersist.hxx
blobae6d8b2b168041ebf311526a6726a459ab94fa72
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 <list>
24 #include <map>
25 #include <memory>
27 #include <cppuhelper/weakref.hxx>
28 #include <com/sun/star/uno/Reference.hxx>
29 #include <oox/drawingml/clrscheme.hxx>
30 #include <oox/drawingml/color.hxx>
31 #include <oox/drawingml/drawingmltypes.hxx>
32 #include <oox/drawingml/shape.hxx>
33 #include <oox/ppt/comments.hxx>
34 #include <oox/ppt/headerfooter.hxx>
35 #include <rtl/ustring.hxx>
36 #include <sal/types.h>
38 namespace com { namespace sun { namespace star {
39 namespace animations { class XAnimationNode; }
40 namespace drawing { class XDrawPage; }
41 } } }
43 namespace oox { namespace core { class XmlFilterBase; } }
44 namespace oox { namespace vml { class Drawing; } }
46 namespace oox { namespace ppt {
48 enum ShapeLocation
50 Master,
51 Layout,
52 Slide
56 class TimeNode;
57 class SlidePersist;
59 typedef std::shared_ptr< SlidePersist > SlidePersistPtr;
61 class SlidePersist : public std::enable_shared_from_this< SlidePersist >
64 public:
65 SlidePersist( oox::core::XmlFilterBase& rFilter, bool bMaster, bool bNotes,
66 const css::uno::Reference< css::drawing::XDrawPage >&,
67 oox::drawingml::ShapePtr const & pShapesPtr, const ::oox::drawingml::TextListStylePtr & );
68 ~SlidePersist();
70 const css::uno::Reference< css::drawing::XDrawPage >& getPage() const { return mxPage; };
72 #if OSL_DEBUG_LEVEL > 0
73 static css::uno::WeakReference< css::drawing::XDrawPage > mxDebugPage;
74 #endif
76 void setMasterPersist( SlidePersistPtr pMasterPersistPtr ){ mpMasterPagePtr = pMasterPersistPtr; }
77 const SlidePersistPtr& getMasterPersist() const { return mpMasterPagePtr; }
79 void setPath( const OUString& rPath ) { maPath = rPath; }
80 const OUString& getPath() const { return maPath; }
82 void setLayoutPath( const OUString& rLayoutPath ) { maLayoutPath = rLayoutPath; }
83 const OUString& getLayoutPath() const { return maLayoutPath; }
85 void setTheme( const oox::drawingml::ThemePtr& rThemePtr ){ mpThemePtr = rThemePtr; }
86 const oox::drawingml::ThemePtr& getTheme() const { return mpThemePtr; }
88 const oox::drawingml::ClrSchemePtr& getClrScheme() const { return mpClrSchemePtr; }
90 void setClrMap( const oox::drawingml::ClrMapPtr pClrMapPtr ){ mpClrMapPtr = pClrMapPtr; }
91 const oox::drawingml::ClrMapPtr& getClrMap() const { return mpClrMapPtr; }
93 void setBackgroundProperties( const oox::drawingml::FillPropertiesPtr& rFillPropertiesPtr ){ mpBackgroundPropertiesPtr = rFillPropertiesPtr; }
94 const oox::drawingml::FillPropertiesPtr& getBackgroundProperties() const { return mpBackgroundPropertiesPtr; }
95 oox::drawingml::Color& getBackgroundColor() { return maBackgroundColor; }
97 bool isMasterPage() const { return mbMaster; }
98 bool isNotesPage() const { return mbNotes; }
100 void setLayoutValueToken( sal_Int32 nLayoutValueToken ) { mnLayoutValueToken = nLayoutValueToken; }
101 short getLayoutFromValueToken();
104 const oox::drawingml::TextListStylePtr& getDefaultTextStyle() const { return maDefaultTextStylePtr; }
105 const oox::drawingml::TextListStylePtr& getTitleTextStyle() const { return maTitleTextStylePtr; }
106 const oox::drawingml::TextListStylePtr& getBodyTextStyle() const { return maBodyTextStylePtr; }
107 const oox::drawingml::TextListStylePtr& getNotesTextStyle() const { return maNotesTextStylePtr; }
108 const oox::drawingml::TextListStylePtr& getOtherTextStyle() const { return maOtherTextStylePtr; }
110 const oox::drawingml::ShapePtr& getShapes() { return maShapesPtr; }
111 void hideShapesAsMasterShapes();
112 ::std::list< std::shared_ptr< TimeNode > >& getTimeNodeList() { return maTimeNodeList; }
113 oox::ppt::HeaderFooter& getHeaderFooter(){ return maHeaderFooter; };
115 oox::vml::Drawing* getDrawing() { return mpDrawingPtr.get(); }
117 void createXShapes( oox::core::XmlFilterBase& rFilterBase );
118 void createBackground( const oox::core::XmlFilterBase& rFilterBase );
119 void applyTextStyles( const oox::core::XmlFilterBase& rFilterBase );
121 std::map< OUString, css::uno::Reference< css::animations::XAnimationNode > >& getAnimNodesMap() { return maAnimNodesMap; };
122 ::oox::drawingml::ShapePtr getShape( const OUString & id ) { return maShapeMap[ id ]; }
123 ::oox::drawingml::ShapeIdMap& getShapeMap() { return maShapeMap; }
125 CommentList& getCommentsList() { return maCommentsList; }
126 CommentAuthorList& getCommentAuthors() { return maCommentAuthors; }
128 private:
129 OUString maPath;
130 OUString maLayoutPath;
131 std::shared_ptr< oox::vml::Drawing > mpDrawingPtr;
132 css::uno::Reference< css::drawing::XDrawPage > mxPage;
133 oox::drawingml::ThemePtr mpThemePtr; // the theme that is used
134 oox::drawingml::ClrSchemePtr mpClrSchemePtr; // the local color scheme (if any)
135 oox::drawingml::ClrMapPtr mpClrMapPtr; // color mapping (if any)
136 SlidePersistPtr mpMasterPagePtr;
138 oox::drawingml::ShapePtr maShapesPtr;
139 oox::drawingml::Color maBackgroundColor;
140 oox::drawingml::FillPropertiesPtr mpBackgroundPropertiesPtr;
141 ::std::list< std::shared_ptr< TimeNode > > maTimeNodeList;
143 oox::ppt::HeaderFooter maHeaderFooter;
144 sal_Int32 mnLayoutValueToken;
145 bool mbMaster;
146 bool mbNotes;
148 oox::drawingml::TextListStylePtr maDefaultTextStylePtr;
149 oox::drawingml::TextListStylePtr maTitleTextStylePtr;
150 oox::drawingml::TextListStylePtr maBodyTextStylePtr;
151 oox::drawingml::TextListStylePtr maNotesTextStylePtr;
152 oox::drawingml::TextListStylePtr maOtherTextStylePtr;
154 std::map< OUString, css::uno::Reference< css::animations::XAnimationNode > > maAnimNodesMap;
155 std::map< OUString, ::oox::drawingml::ShapePtr > maShapeMap;
157 // slide comments
158 CommentList maCommentsList;
159 CommentAuthorList maCommentAuthors;
164 #endif // INCLUDED_OOX_PPT_SLIDEPERSIST_HXX
166 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */