xref: /aoo4110/main/oox/inc/oox/ppt/slidepersist.hxx (revision b1cdbd2c)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef OOX_POWERPOINT_SLIDEPERSIST_HXX
25 #define OOX_POWERPOINT_SLIDEPERSIST_HXX
26 
27 #include <boost/shared_ptr.hpp>
28 #include "oox/drawingml/shape.hxx"
29 #include "oox/drawingml/theme.hxx"
30 #include "oox/drawingml/clrscheme.hxx"
31 #include "oox/drawingml/textliststyle.hxx"
32 #include "oox/drawingml/textparagraphproperties.hxx"
33 #include <oox/ppt/headerfooter.hxx>
34 #include <com/sun/star/frame/XModel.hpp>
35 #include <com/sun/star/drawing/XDrawPage.hpp>
36 #include <com/sun/star/animations/XAnimationNode.hpp>
37 #include "oox/core/fragmenthandler.hxx"
38 
39 #include <list>
40 
41 namespace oox { namespace vml { class Drawing; } }
42 
43 namespace oox { namespace ppt {
44 
45 enum ShapeLocation
46 {
47 	Master,
48 	Layout,
49 	Slide
50 };
51 
52 // ---------------------------------------------------------------------
53 class TimeNode;
54 class SlidePersist;
55 
56 typedef boost::shared_ptr< SlidePersist > SlidePersistPtr;
57 
58 class SlidePersist : public boost::enable_shared_from_this< SlidePersist >
59 {
60 
61 public:
62     SlidePersist( oox::core::XmlFilterBase& rFilter, sal_Bool bMaster, sal_Bool bNotes,
63                     const com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage >&,
64 					oox::drawingml::ShapePtr pShapesPtr, const ::oox::drawingml::TextListStylePtr & );
65 	~SlidePersist();
66 
getPage() const67     com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage >    getPage() const { return mxPage; };
68 
setMasterPersist(SlidePersistPtr pMasterPersistPtr)69     void setMasterPersist( SlidePersistPtr pMasterPersistPtr ){ mpMasterPagePtr = pMasterPersistPtr; }
getMasterPersist() const70     SlidePersistPtr getMasterPersist() const { return mpMasterPagePtr; }
71 
setPath(const rtl::OUString & rPath)72     void setPath( const rtl::OUString& rPath ) { maPath = rPath; }
getPath() const73     const rtl::OUString getPath() const { return maPath; }
74 
setLayoutPath(const rtl::OUString & rLayoutPath)75     void setLayoutPath( const rtl::OUString& rLayoutPath ) { maLayoutPath = rLayoutPath; }
getLayoutPath() const76     const rtl::OUString getLayoutPath() const { return maLayoutPath; }
77 
setTheme(const oox::drawingml::ThemePtr pThemePtr)78     void setTheme( const oox::drawingml::ThemePtr pThemePtr ){ mpThemePtr = pThemePtr; }
getTheme() const79     oox::drawingml::ThemePtr getTheme() const { return mpThemePtr; }
80 
setClrScheme(const oox::drawingml::ClrSchemePtr pClrSchemePtr)81     void setClrScheme( const oox::drawingml::ClrSchemePtr pClrSchemePtr ){ mpClrSchemePtr = pClrSchemePtr; }
getClrScheme() const82     oox::drawingml::ClrSchemePtr getClrScheme() const { return mpClrSchemePtr; }
83 
setClrMap(const oox::drawingml::ClrMapPtr pClrMapPtr)84     void setClrMap( const oox::drawingml::ClrMapPtr pClrMapPtr ){ mpClrMapPtr = pClrMapPtr; }
getClrMap() const85     oox::drawingml::ClrMapPtr getClrMap() const { return mpClrMapPtr; }
86 
setBackgroundProperties(const oox::drawingml::FillPropertiesPtr pFillPropertiesPtr)87     void setBackgroundProperties( const oox::drawingml::FillPropertiesPtr pFillPropertiesPtr ){ mpBackgroundPropertiesPtr = pFillPropertiesPtr; }
getBackgroundProperties() const88     oox::drawingml::FillPropertiesPtr getBackgroundProperties() const { return mpBackgroundPropertiesPtr; }
getBackgroundColor()89 	oox::drawingml::Color& getBackgroundColor() { return maBackgroundColor; }
90 
isMasterPage() const91     sal_Bool isMasterPage() const { return mbMaster; }
isNotesPage() const92     sal_Bool isNotesPage() const { return mbNotes; }
93 
setLayoutValueToken(sal_Int32 nLayoutValueToken)94     void setLayoutValueToken( sal_Int32 nLayoutValueToken ) { mnLayoutValueToken = nLayoutValueToken; }
95     short getLayoutFromValueToken();
96 
97 
getDefaultTextStyle() const98     oox::drawingml::TextListStylePtr getDefaultTextStyle() const { return maDefaultTextStylePtr; }
getTitleTextStyle() const99     oox::drawingml::TextListStylePtr getTitleTextStyle() const { return maTitleTextStylePtr; }
getBodyTextStyle() const100     oox::drawingml::TextListStylePtr getBodyTextStyle() const { return maBodyTextStylePtr; }
getNotesTextStyle() const101     oox::drawingml::TextListStylePtr getNotesTextStyle() const { return maNotesTextStylePtr; }
getOtherTextStyle() const102     oox::drawingml::TextListStylePtr getOtherTextStyle() const { return maOtherTextStylePtr; }
103 
getShapes()104     oox::drawingml::ShapePtr getShapes() { return maShapesPtr; }
getTimeNodeList()105     ::std::list< boost::shared_ptr< TimeNode > >& getTimeNodeList() { return maTimeNodeList; }
getHeaderFooter()106 	oox::ppt::HeaderFooter& getHeaderFooter(){ return maHeaderFooter; };
107 
getDrawing()108     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 
getAnimNodesMap()114     std::map< ::rtl::OUString, ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode > >& getAnimNodesMap() { return maAnimNodesMap; };
getShape(const::rtl::OUString & id)115     ::oox::drawingml::ShapePtr getShape( const ::rtl::OUString & id ) { return maShapeMap[ id ]; }
getShapeMap()116     ::oox::drawingml::ShapeIdMap& getShapeMap() { return maShapeMap; }
117 
118 private:
119 	rtl::OUString															maPath;
120 	rtl::OUString															maLayoutPath;
121     ::boost::shared_ptr< oox::vml::Drawing >                                mpDrawingPtr;
122 	com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage >	mxPage;
123 	oox::drawingml::ThemePtr												mpThemePtr;			// the theme that is used
124 	oox::drawingml::ClrSchemePtr											mpClrSchemePtr;		// the local color scheme (if any)
125 	oox::drawingml::ClrMapPtr												mpClrMapPtr;		// color mapping (if any)
126 	SlidePersistPtr															mpMasterPagePtr;
127 
128 	oox::drawingml::ShapePtr												maShapesPtr;
129 	oox::drawingml::Color													maBackgroundColor;
130 	oox::drawingml::FillPropertiesPtr										mpBackgroundPropertiesPtr;
131 	::std::list< boost::shared_ptr< TimeNode > >							maTimeNodeList;
132 
133 	oox::ppt::HeaderFooter													maHeaderFooter;
134 	sal_Int32																mnLayoutValueToken;
135 	sal_Bool                                                                mbMaster;
136 	sal_Bool																mbNotes;
137 
138 	oox::drawingml::TextListStylePtr										maDefaultTextStylePtr;
139 	oox::drawingml::TextListStylePtr										maTitleTextStylePtr;
140 	oox::drawingml::TextListStylePtr										maBodyTextStylePtr;
141 	oox::drawingml::TextListStylePtr										maNotesTextStylePtr;
142 	oox::drawingml::TextListStylePtr										maOtherTextStylePtr;
143 
144 	std::map< ::rtl::OUString, ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode > > maAnimNodesMap;
145 	std::map< ::rtl::OUString, ::oox::drawingml::ShapePtr > maShapeMap;
146 };
147 
148 } }
149 
150 #endif // OOX_POWERPOINT_SLIDEPERSIST_HXX
151