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_PPT_PRESENTATION_PPTSHAPE_HXX 25 #define OOX_PPT_PRESENTATION_PPTSHAPE_HXX 26 27 #include "oox/drawingml/shape.hxx" 28 #include "oox/ppt/slidepersist.hxx" 29 30 namespace oox { namespace ppt { 31 32 class PPTShape : public oox::drawingml::Shape 33 { 34 ShapeLocation meShapeLocation; // placeholdershapes (mnSubType != 0) on Master are never displayed 35 sal_Bool mbReferenced; // placeholdershapes on Layout are displayed only, if they are not referenced 36 // placeholdershapes on Slide are displayed always 37 38 public: 39 40 PPTShape( const oox::ppt::ShapeLocation eShapeLocation, 41 const sal_Char* pServiceType = NULL ); 42 virtual ~PPTShape(); 43 44 using oox::drawingml::Shape::addShape; 45 // addShape is creating and inserting the corresponding XShape. 46 void addShape( 47 oox::core::XmlFilterBase& rFilterBase, 48 const SlidePersist& rPersist, 49 const oox::drawingml::Theme* pTheme, 50 const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes, 51 const com::sun::star::awt::Rectangle* pShapeRect = 0, 52 ::oox::drawingml::ShapeIdMap* pShapeMap = 0 ); 53 54 virtual void applyShapeReference( const oox::drawingml::Shape& rReferencedShape ); 55 setShapeLocation(const oox::ppt::ShapeLocation eShapeLocation)56 void setShapeLocation( const oox::ppt::ShapeLocation eShapeLocation ) { meShapeLocation = eShapeLocation; }; getShapeLocation() const57 ShapeLocation getShapeLocation() const { return meShapeLocation; }; isReferenced() const58 sal_Bool isReferenced() const { return mbReferenced; }; setReferenced(sal_Bool bReferenced)59 void setReferenced( sal_Bool bReferenced ){ mbReferenced = bReferenced; }; 60 61 static oox::drawingml::ShapePtr findPlaceholder( const sal_Int32 nMasterPlaceholder, std::vector< oox::drawingml::ShapePtr >& rShapes ); 62 static oox::drawingml::ShapePtr findPlaceholderByIndex( const sal_Int32 nIdx, std::vector< oox::drawingml::ShapePtr >& rShapes ); 63 static oox::drawingml::ShapePtr findPlaceholder( sal_Int32 nFirstPlaceholder, sal_Int32 nSecondPlaceholder, std::vector< oox::drawingml::ShapePtr >& rShapes ); 64 }; 65 66 } } 67 68 #endif // OOX_PPT_PRESENTATION_PPTSHAPE_HXX 69