Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #ifndef INCLUDED_OOX_PPT_SLIDEPERSIST_HXX
21 : #define INCLUDED_OOX_PPT_SLIDEPERSIST_HXX
22 :
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/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>
33 :
34 : #include <list>
35 :
36 : namespace oox { namespace vml { class Drawing; } }
37 :
38 : namespace oox { namespace ppt {
39 :
40 : enum ShapeLocation
41 : {
42 : Master,
43 : Layout,
44 : Slide
45 : };
46 :
47 :
48 : class TimeNode;
49 : class SlidePersist;
50 :
51 : typedef boost::shared_ptr< SlidePersist > SlidePersistPtr;
52 :
53 : class SlidePersist : public boost::enable_shared_from_this< SlidePersist >
54 : {
55 :
56 : public:
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 & );
60 : ~SlidePersist();
61 :
62 2374 : com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage > getPage() const { return mxPage; };
63 :
64 : #if OSL_DEBUG_LEVEL > 0
65 : static com::sun::star::uno::WeakReference< com::sun::star::drawing::XDrawPage > mxDebugPage;
66 : #endif
67 :
68 132 : void setMasterPersist( SlidePersistPtr pMasterPersistPtr ){ mpMasterPagePtr = pMasterPersistPtr; }
69 6378 : SlidePersistPtr getMasterPersist() const { return mpMasterPagePtr; }
70 :
71 252 : void setPath( const OUString& rPath ) { maPath = rPath; }
72 36 : const OUString getPath() const { return maPath; }
73 :
74 104 : void setLayoutPath( const OUString& rLayoutPath ) { maLayoutPath = rLayoutPath; }
75 18 : const OUString getLayoutPath() const { return maLayoutPath; }
76 :
77 220 : void setTheme( const oox::drawingml::ThemePtr pThemePtr ){ mpThemePtr = pThemePtr; }
78 32448 : oox::drawingml::ThemePtr getTheme() const { return mpThemePtr; }
79 :
80 : void setClrScheme( const oox::drawingml::ClrSchemePtr pClrSchemePtr ){ mpClrSchemePtr = pClrSchemePtr; }
81 7172 : oox::drawingml::ClrSchemePtr getClrScheme() const { return mpClrSchemePtr; }
82 :
83 128 : void setClrMap( const oox::drawingml::ClrMapPtr pClrMapPtr ){ mpClrMapPtr = pClrMapPtr; }
84 11034 : oox::drawingml::ClrMapPtr getClrMap() const { return mpClrMapPtr; }
85 :
86 118 : void setBackgroundProperties( const oox::drawingml::FillPropertiesPtr pFillPropertiesPtr ){ mpBackgroundPropertiesPtr = pFillPropertiesPtr; }
87 : oox::drawingml::FillPropertiesPtr getBackgroundProperties() const { return mpBackgroundPropertiesPtr; }
88 72 : oox::drawingml::Color& getBackgroundColor() { return maBackgroundColor; }
89 :
90 1328 : bool isMasterPage() const { return mbMaster; }
91 572 : bool isNotesPage() const { return mbNotes; }
92 :
93 104 : void setLayoutValueToken( sal_Int32 nLayoutValueToken ) { mnLayoutValueToken = nLayoutValueToken; }
94 : short getLayoutFromValueToken();
95 :
96 :
97 636 : oox::drawingml::TextListStylePtr getDefaultTextStyle() const { return maDefaultTextStylePtr; }
98 184 : oox::drawingml::TextListStylePtr getTitleTextStyle() const { return maTitleTextStylePtr; }
99 210 : oox::drawingml::TextListStylePtr getBodyTextStyle() const { return maBodyTextStylePtr; }
100 28 : oox::drawingml::TextListStylePtr getNotesTextStyle() const { return maNotesTextStylePtr; }
101 962 : oox::drawingml::TextListStylePtr getOtherTextStyle() const { return maOtherTextStylePtr; }
102 :
103 1292 : oox::drawingml::ShapePtr getShapes() { return maShapesPtr; }
104 : void hideShapesAsMasterShapes();
105 46 : ::std::list< boost::shared_ptr< TimeNode > >& getTimeNodeList() { return maTimeNodeList; }
106 240 : oox::ppt::HeaderFooter& getHeaderFooter(){ return maHeaderFooter; };
107 :
108 366 : oox::vml::Drawing* getDrawing() { return mpDrawingPtr.get(); }
109 :
110 : void createXShapes( oox::core::XmlFilterBase& rFilterBase );
111 : void createBackground( const oox::core::XmlFilterBase& rFilterBase );
112 : void applyTextStyles( const oox::core::XmlFilterBase& rFilterBase );
113 :
114 146 : std::map< OUString, ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode > >& getAnimNodesMap() { return maAnimNodesMap; };
115 34 : ::oox::drawingml::ShapePtr getShape( const OUString & id ) { return maShapeMap[ id ]; }
116 1546 : ::oox::drawingml::ShapeIdMap& getShapeMap() { return maShapeMap; }
117 :
118 0 : CommentList& getCommentsList() { return maCommentsList; }
119 0 : CommentAuthorList& getCommentAuthors() { return maCommentAuthors; }
120 :
121 : private:
122 : OUString maPath;
123 : OUString maLayoutPath;
124 : ::boost::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;
130 :
131 : oox::drawingml::ShapePtr maShapesPtr;
132 : oox::drawingml::Color maBackgroundColor;
133 : oox::drawingml::FillPropertiesPtr mpBackgroundPropertiesPtr;
134 : ::std::list< boost::shared_ptr< TimeNode > > maTimeNodeList;
135 :
136 : oox::ppt::HeaderFooter maHeaderFooter;
137 : sal_Int32 mnLayoutValueToken;
138 : bool mbMaster;
139 : bool mbNotes;
140 :
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;
146 :
147 : std::map< OUString, ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode > > maAnimNodesMap;
148 : std::map< OUString, ::oox::drawingml::ShapePtr > maShapeMap;
149 :
150 : // slide comments
151 : CommentList maCommentsList;
152 : CommentAuthorList maCommentAuthors;
153 : };
154 :
155 : } }
156 :
157 : #endif // INCLUDED_OOX_PPT_SLIDEPERSIST_HXX
158 :
159 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|