1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_OOX_SOURCE_DRAWINGML_DIAGRAM_DATAMODEL_HXX
21 #define INCLUDED_OOX_SOURCE_DRAWINGML_DIAGRAM_DATAMODEL_HXX
27 #include <rtl/ustring.hxx>
29 #include <svx/diagram/datamodel.hxx>
30 #include <oox/drawingml/drawingmltypes.hxx>
31 #include <oox/helper/helper.hxx>
32 #include <oox/token/tokens.hxx>
34 namespace oox::drawingml
{
36 class DiagramData
: public svx::diagram::DiagramData
39 typedef std::map
< OUString
, ShapePtr
> PointShapeMap
;
42 virtual ~DiagramData();
44 // creates temporary processing data from model data
45 virtual void buildDiagramDataModel(bool bClearOoxShapes
);
47 FillPropertiesPtr
& getBackgroundShapeFillProperties() { return mpBackgroundShapeFillProperties
; }
48 virtual void dump() const;
50 Shape
* getOrCreateAssociatedShape(const svx::diagram::Point
& rPoint
, bool bCreateOnDemand
= false) const;
52 // get/set data between Diagram DataModel and oox::drawingml::Shape
53 void secureDataFromShapeToModelAfterDiagramImport(::oox::drawingml::Shape
& rRootShape
);
54 void restoreDataFromShapeToModelAfterDiagramImport(::oox::drawingml::Shape
& rRootShape
);
55 static void restoreDataFromModelToShapeAfterReCreation(const svx::diagram::Point
& rPoint
, Shape
& rNewShape
);
58 void secureStyleDataFromShapeToModel(::oox::drawingml::Shape
& rShape
);
59 void restoreStyleDataFromShapeToModel(::oox::drawingml::Shape
& rShape
);
62 // The model definition, the parts *only* available in oox. Also look for already
63 // defined ModelData in svx::diagram::DiagramData
65 // - FillStyle for Diagram Background (empty constructed, may stay empty)
66 FillPropertiesPtr mpBackgroundShapeFillProperties
;
68 // temporary processing data, deleted when using build(). Association
69 // map between oox::drawingml::Shape and svx::diagram::Point ModelData
70 PointShapeMap maPointShapeMap
;
73 // Oox-local definition of DiagramData. Doing and using this on Oox
74 // allows to do much less static_cast(s) - if at all from svx::diagram::DiagramData
75 typedef std::shared_ptr
< DiagramData
> OoxDiagramDataPtr
;
81 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */