LibreOffice Module oox (master)  1
pptshape.hxx
Go to the documentation of this file.
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_PPTSHAPE_HXX
21 #define INCLUDED_OOX_PPT_PPTSHAPE_HXX
22 
23 #include <vector>
24 
25 #include <com/sun/star/uno/Reference.hxx>
26 #include <oox/drawingml/shape.hxx>
28 #include <oox/ppt/slidepersist.hxx>
29 #include <rtl/ustring.hxx>
30 #include <sal/types.h>
31 
32 namespace basegfx { class B2DHomMatrix; }
33 
34 namespace com::sun::star {
35  namespace awt { struct Rectangle; }
36  namespace drawing { class XShapes; }
37 }
38 
39 namespace oox {
40  namespace core { class XmlFilterBase; }
41  namespace drawingml { class Theme; }
42  template <typename Type> class OptValue;
43 }
44 
45 namespace oox::ppt {
46 
47 class PPTShape final : public oox::drawingml::Shape
48 {
49  OUString msModelId; // fallback dgs smartart shape reference
50  ShapeLocation meShapeLocation; // placeholdershapes (mnSubType != 0) on Master are never displayed
51  bool mbReferenced; // placeholdershapes on Layout are displayed only, if they are not referenced
52  // placeholdershapes on Slide are displayed always
56 
57  bool IsPlaceHolderCandidate(const SlidePersist& rSlidePersist) const;
58 
59 public:
60 
61  PPTShape( const oox::ppt::ShapeLocation eShapeLocation,
62  const char* pServiceType );
63  virtual ~PPTShape() override;
64 
66  // addShape is creating and inserting the corresponding XShape.
67  void addShape(
68  oox::core::XmlFilterBase& rFilterBase,
69  const SlidePersist& rPersist,
70  const oox::drawingml::Theme* pTheme,
71  const css::uno::Reference< css::drawing::XShapes >& rxShapes,
72  basegfx::B2DHomMatrix& aTransformation,
73  ::oox::drawingml::ShapeIdMap* pShapeMap );
74 
76  void setReferenced( bool bReferenced ){ mbReferenced = bReferenced; };
77  void setPlaceholder( oox::drawingml::ShapePtr pPlaceholder ) { mpPlaceholder = pPlaceholder; }
78  void setModelId( const OUString& rId ) { msModelId = rId; }
79 
81  void setHasNoninheritedShapeProperties() { mbHasNoninheritedShapeProperties = true; }
84 
85  static oox::drawingml::ShapePtr findPlaceholder( const sal_Int32 nFirstSubType,
86  const sal_Int32 nSecondSubType, const OptValue< sal_Int32 >& oSubTypeIndex,
87  std::vector< oox::drawingml::ShapePtr >& rShapes, bool bMasterOnly = false );
88  static oox::drawingml::ShapePtr findPlaceholderByIndex( const sal_Int32 nIdx,
89  std::vector< oox::drawingml::ShapePtr >& rShapes, bool bMasterOnly = false );
90 
91  static oox::drawingml::TextListStylePtr getSubTypeTextListStyle( const SlidePersist& rSlidePersist, sal_Int32 nSubType );
92 };
93 
94 }
95 
96 #endif // INCLUDED_OOX_PPT_PPTSHAPE_HXX
97 
98 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void setModelId(const OUString &rId)
Definition: pptshape.hxx:78
void setReferenced(bool bReferenced)
Definition: pptshape.hxx:76
exports com.sun.star. awt
bool hasNonInheritedShapeProperties() const
Returns whether or not the shape had a non-empty spPr tag.
Definition: pptshape.hxx:83
exports com.sun.star. drawing
ShapeLocation getShapeLocation() const
Definition: pptshape.hxx:75
static oox::drawingml::ShapePtr findPlaceholder(const sal_Int32 nFirstSubType, const sal_Int32 nSecondSubType, const OptValue< sal_Int32 > &oSubTypeIndex, std::vector< oox::drawingml::ShapePtr > &rShapes, bool bMasterOnly=false)
Definition: pptshape.cxx:560
void setPlaceholder(oox::drawingml::ShapePtr pPlaceholder)
Definition: pptshape.hxx:77
static oox::drawingml::TextListStylePtr getSubTypeTextListStyle(const SlidePersist &rSlidePersist, sal_Int32 nSubType)
Definition: pptshape.cxx:106
bool mbHasNoninheritedShapeProperties
Set if spPr tag is non empty for the shape.
Definition: pptshape.hxx:55
void addShape(::oox::core::XmlFilterBase &rFilterBase, const Theme *pTheme, const css::uno::Reference< css::drawing::XShapes > &rxShapes, const basegfx::B2DHomMatrix &aTransformation, FillProperties &rShapeOrParentShapeFillProps, ShapeIdMap *pShapeMap=nullptr, oox::drawingml::ShapePtr pParentGroupShape=nullptr)
Definition: shape.cxx:267
virtual ~PPTShape() override
Definition: pptshape.cxx:61
std::shared_ptr< TextListStyle > TextListStylePtr
static oox::drawingml::ShapePtr findPlaceholderByIndex(const sal_Int32 nIdx, std::vector< oox::drawingml::ShapePtr > &rShapes, bool bMasterOnly=false)
Definition: pptshape.cxx:660
OUString msModelId
Definition: pptshape.hxx:49
::std::map< OUString, ShapePtr > ShapeIdMap
Definition: shape.hxx:72
PPTShape(const oox::ppt::ShapeLocation eShapeLocation, const char *pServiceType)
Definition: pptshape.cxx:53
bool IsPlaceHolderCandidate(const SlidePersist &rSlidePersist) const
Definition: pptshape.cxx:131
std::shared_ptr< Shape > ShapePtr
ShapeLocation meShapeLocation
Definition: pptshape.hxx:50
void addShape(oox::core::XmlFilterBase &rFilterBase, const SlidePersist &rPersist, const oox::drawingml::Theme *pTheme, const css::uno::Reference< css::drawing::XShapes > &rxShapes, basegfx::B2DHomMatrix &aTransformation,::oox::drawingml::ShapeIdMap *pShapeMap)
Definition: pptshape.cxx:148
oox::drawingml::ShapePtr mpPlaceholder
Definition: pptshape.hxx:53
void setHasNoninheritedShapeProperties()
Flags shape as having a non-empty spPr tag.
Definition: pptshape.hxx:81