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 OOX_POWERPOINT_SLIDEPERSIST_HXX
21 : #define OOX_POWERPOINT_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/drawingml/textliststyle.hxx"
28 : #include "oox/drawingml/textparagraphproperties.hxx"
29 : #include <oox/ppt/headerfooter.hxx>
30 : #include <com/sun/star/frame/XModel.hpp>
31 : #include <com/sun/star/drawing/XDrawPage.hpp>
32 : #include <com/sun/star/animations/XAnimationNode.hpp>
33 : #include "oox/core/fragmenthandler.hxx"
34 :
35 : #include <list>
36 :
37 : namespace oox { namespace vml { class Drawing; } }
38 :
39 : namespace oox { namespace ppt {
40 :
41 : enum ShapeLocation
42 : {
43 : Master,
44 : Layout,
45 : Slide
46 : };
47 :
48 : // ---------------------------------------------------------------------
49 : class TimeNode;
50 : class SlidePersist;
51 :
52 : typedef boost::shared_ptr< SlidePersist > SlidePersistPtr;
53 :
54 : class SlidePersist : public boost::enable_shared_from_this< SlidePersist >
55 : {
56 :
57 : public:
58 : SlidePersist( oox::core::XmlFilterBase& rFilter, sal_Bool bMaster, sal_Bool bNotes,
59 : const com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage >&,
60 : oox::drawingml::ShapePtr pShapesPtr, const ::oox::drawingml::TextListStylePtr & );
61 : ~SlidePersist();
62 :
63 73 : com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage > getPage() const { return mxPage; };
64 :
65 : #if OSL_DEBUG_LEVEL > 0
66 : static com::sun::star::uno::WeakReference< com::sun::star::drawing::XDrawPage > mxDebugPage;
67 : #endif
68 :
69 5 : void setMasterPersist( SlidePersistPtr pMasterPersistPtr ){ mpMasterPagePtr = pMasterPersistPtr; }
70 82 : SlidePersistPtr getMasterPersist() const { return mpMasterPagePtr; }
71 :
72 10 : void setPath( const rtl::OUString& rPath ) { maPath = rPath; }
73 1 : const rtl::OUString getPath() const { return maPath; }
74 :
75 4 : void setLayoutPath( const rtl::OUString& rLayoutPath ) { maLayoutPath = rLayoutPath; }
76 0 : const rtl::OUString getLayoutPath() const { return maLayoutPath; }
77 :
78 8 : void setTheme( const oox::drawingml::ThemePtr pThemePtr ){ mpThemePtr = pThemePtr; }
79 507 : oox::drawingml::ThemePtr getTheme() const { return mpThemePtr; }
80 :
81 : void setClrScheme( const oox::drawingml::ClrSchemePtr pClrSchemePtr ){ mpClrSchemePtr = pClrSchemePtr; }
82 48 : oox::drawingml::ClrSchemePtr getClrScheme() const { return mpClrSchemePtr; }
83 :
84 5 : void setClrMap( const oox::drawingml::ClrMapPtr pClrMapPtr ){ mpClrMapPtr = pClrMapPtr; }
85 56 : oox::drawingml::ClrMapPtr getClrMap() const { return mpClrMapPtr; }
86 :
87 5 : void setBackgroundProperties( const oox::drawingml::FillPropertiesPtr pFillPropertiesPtr ){ mpBackgroundPropertiesPtr = pFillPropertiesPtr; }
88 : oox::drawingml::FillPropertiesPtr getBackgroundProperties() const { return mpBackgroundPropertiesPtr; }
89 3 : oox::drawingml::Color& getBackgroundColor() { return maBackgroundColor; }
90 :
91 33 : sal_Bool isMasterPage() const { return mbMaster; }
92 28 : sal_Bool isNotesPage() const { return mbNotes; }
93 :
94 4 : void setLayoutValueToken( sal_Int32 nLayoutValueToken ) { mnLayoutValueToken = nLayoutValueToken; }
95 : short getLayoutFromValueToken();
96 :
97 :
98 15 : oox::drawingml::TextListStylePtr getDefaultTextStyle() const { return maDefaultTextStylePtr; }
99 8 : oox::drawingml::TextListStylePtr getTitleTextStyle() const { return maTitleTextStylePtr; }
100 7 : oox::drawingml::TextListStylePtr getBodyTextStyle() const { return maBodyTextStylePtr; }
101 2 : oox::drawingml::TextListStylePtr getNotesTextStyle() const { return maNotesTextStylePtr; }
102 13 : oox::drawingml::TextListStylePtr getOtherTextStyle() const { return maOtherTextStylePtr; }
103 :
104 59 : oox::drawingml::ShapePtr getShapes() { return maShapesPtr; }
105 : void hideShapesAsMasterShapes();
106 4 : ::std::list< boost::shared_ptr< TimeNode > >& getTimeNodeList() { return maTimeNodeList; }
107 10 : oox::ppt::HeaderFooter& getHeaderFooter(){ return maHeaderFooter; };
108 :
109 14 : oox::vml::Drawing* getDrawing() { return mpDrawingPtr.get(); }
110 :
111 : void createXShapes( oox::core::XmlFilterBase& rFilterBase );
112 : void createBackground( const oox::core::XmlFilterBase& rFilterBase );
113 : void applyTextStyles( const oox::core::XmlFilterBase& rFilterBase );
114 :
115 0 : std::map< ::rtl::OUString, ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode > >& getAnimNodesMap() { return maAnimNodesMap; };
116 0 : ::oox::drawingml::ShapePtr getShape( const ::rtl::OUString & id ) { return maShapeMap[ id ]; }
117 43 : ::oox::drawingml::ShapeIdMap& getShapeMap() { return maShapeMap; }
118 :
119 : private:
120 : rtl::OUString maPath;
121 : rtl::OUString maLayoutPath;
122 : ::boost::shared_ptr< oox::vml::Drawing > mpDrawingPtr;
123 : com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage > mxPage;
124 : oox::drawingml::ThemePtr mpThemePtr; // the theme that is used
125 : oox::drawingml::ClrSchemePtr mpClrSchemePtr; // the local color scheme (if any)
126 : oox::drawingml::ClrMapPtr mpClrMapPtr; // color mapping (if any)
127 : SlidePersistPtr mpMasterPagePtr;
128 :
129 : oox::drawingml::ShapePtr maShapesPtr;
130 : oox::drawingml::Color maBackgroundColor;
131 : oox::drawingml::FillPropertiesPtr mpBackgroundPropertiesPtr;
132 : ::std::list< boost::shared_ptr< TimeNode > > maTimeNodeList;
133 :
134 : oox::ppt::HeaderFooter maHeaderFooter;
135 : sal_Int32 mnLayoutValueToken;
136 : sal_Bool mbMaster;
137 : sal_Bool mbNotes;
138 :
139 : oox::drawingml::TextListStylePtr maDefaultTextStylePtr;
140 : oox::drawingml::TextListStylePtr maTitleTextStylePtr;
141 : oox::drawingml::TextListStylePtr maBodyTextStylePtr;
142 : oox::drawingml::TextListStylePtr maNotesTextStylePtr;
143 : oox::drawingml::TextListStylePtr maOtherTextStylePtr;
144 :
145 : std::map< ::rtl::OUString, ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode > > maAnimNodesMap;
146 : std::map< ::rtl::OUString, ::oox::drawingml::ShapePtr > maShapeMap;
147 : };
148 :
149 : } }
150 :
151 : #endif // OOX_POWERPOINT_SLIDEPERSIST_HXX
152 :
153 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|