Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / oox / source / drawingml / diagram / layoutatomvisitors.hxx
blob656f61d79e6a77242103b6506e5a30ad478e6523
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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_LAYOUTATOMVISITORS_HXX
21 #define INCLUDED_OOX_SOURCE_DRAWINGML_DIAGRAM_LAYOUTATOMVISITORS_HXX
23 #include <memory>
25 #include <oox/drawingml/shape.hxx>
26 #include "diagram.hxx"
27 #include "diagramlayoutatoms.hxx"
28 #include "layoutatomvisitorbase.hxx"
30 namespace oox { namespace drawingml {
32 class ShapeCreationVisitor : public LayoutAtomVisitorBase
34 public:
35 ShapeCreationVisitor(const Diagram& rDgm,
36 const dgm::Point* pRootPoint,
37 const ShapePtr& rParentShape) :
38 LayoutAtomVisitorBase(rDgm, pRootPoint),
39 mpParentShape(rParentShape)
42 using LayoutAtomVisitorBase::visit;
43 virtual void visit(ConstraintAtom& rAtom) override;
44 virtual void visit(AlgAtom& rAtom) override;
45 virtual void visit(LayoutNode& rAtom) override;
46 virtual void visit(ShapeAtom& rAtom) override;
48 private:
49 ShapePtr mpParentShape;
52 class ShapeTemplateVisitor : public LayoutAtomVisitorBase
54 public:
55 ShapeTemplateVisitor(const Diagram& rDgm, const dgm::Point* pRootPoint)
56 : LayoutAtomVisitorBase(rDgm, pRootPoint)
59 using LayoutAtomVisitorBase::visit;
60 virtual void visit(ConstraintAtom& rAtom) override;
61 virtual void visit(AlgAtom& rAtom) override;
62 virtual void visit(ForEachAtom& rAtom) override;
63 virtual void visit(LayoutNode& rAtom) override;
64 virtual void visit(ShapeAtom& rAtom) override;
66 ShapePtr const & getShapeCopy() const
67 { return mpShape; }
69 private:
70 ShapePtr mpShape;
73 class ShapeLayoutingVisitor : public LayoutAtomVisitorBase
75 public:
76 ShapeLayoutingVisitor(const Diagram& rDgm, const dgm::Point* pRootPoint) :
77 LayoutAtomVisitorBase(rDgm, pRootPoint)
80 using LayoutAtomVisitorBase::visit;
81 virtual void visit(ConstraintAtom& rAtom) override;
82 virtual void visit(AlgAtom& rAtom) override;
83 virtual void visit(LayoutNode& rAtom) override;
84 virtual void visit(ShapeAtom& rAtom) override;
86 private:
87 std::vector<Constraint> maConstraints;
90 } }
92 #endif
94 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */