LibreOffice Module svgio (master) 1
svgmarkernode.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#pragma once
21
22#include "svgnode.hxx"
24#include <memory>
25
26namespace svgio::svgreader
27 {
28 class SvgMarkerNode final : public SvgNode
29 {
30 public:
31 enum class MarkerUnits
32 {
33 strokeWidth,
35 };
36
37 enum class MarkerOrient
38 {
39 notset,
40 auto_start,
41 auto_start_reverse
42 };
43
44 private:
47
50
52 std::unique_ptr<basegfx::B2DRange>
60 double mfAngle;
62
63 public:
65 SvgDocument& rDocument,
66 SvgNode* pParent);
67 virtual ~SvgMarkerNode() override;
68
69 virtual const SvgStyleAttributes* getSvgStyleAttributes() const override;
70 virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent) override;
71
74
76 virtual basegfx::B2DRange getCurrentViewPort() const override;
77
79 const basegfx::B2DRange* getViewBox() const { return mpViewBox.get(); }
80 void setViewBox(const basegfx::B2DRange* pViewBox) { mpViewBox.reset(); if(pViewBox) mpViewBox.reset( new basegfx::B2DRange(*pViewBox) ); }
81
84
86 const SvgNumber& getRefX() const { return maRefX; }
87
89 const SvgNumber& getRefY() const { return maRefY; }
90
93 void setMarkerUnits(const MarkerUnits aMarkerUnits) { maMarkerUnits = aMarkerUnits; }
94
96 const SvgNumber& getMarkerWidth() const { return maMarkerWidth; }
97
99 const SvgNumber& getMarkerHeight() const { return maMarkerHeight; }
100
102 double getAngle() const { return mfAngle; }
103 void setAngle(double fAngle) { mfAngle = fAngle;}
104
107 void setMarkerOrient(const MarkerOrient aMarkerOrient) { maMarkerOrient = aMarkerOrient; }
108
109 };
110
111} // end of namespace svgio::svgreader
112
113/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void parseAttribute(const OUString &rTokenName, SVGToken aSVGToken, const OUString &aContent) override
const SvgNumber & getMarkerHeight() const
MarkerHeight content, set if found in current context.
const SvgNumber & getRefX() const
RefX content, set if found in current context.
virtual ~SvgMarkerNode() override
SvgStyleAttributes maSvgStyleAttributes
use styles
void setViewBox(const basegfx::B2DRange *pViewBox)
void setMarkerUnits(const MarkerUnits aMarkerUnits)
const SvgAspectRatio & getSvgAspectRatio() const
SvgAspectRatio content.
virtual basegfx::B2DRange getCurrentViewPort() const override
InfoProvider support for % values.
const drawinglayer::primitive2d::Primitive2DContainer & getMarkerPrimitives() const
get marker primitives buffered, uses decomposeSvgNode internally
const SvgNumber & getMarkerWidth() const
MarkerWidth content, set if found in current context.
drawinglayer::primitive2d::Primitive2DContainer aPrimitives
buffered decomposition
const basegfx::B2DRange * getViewBox() const
viewBox content
const SvgNumber & getRefY() const
RefY content, set if found in current context.
std::unique_ptr< basegfx::B2DRange > mpViewBox
variable scan values, dependent of given XAttributeList
double getAngle() const
Angle content, set if found in current context.
void setMarkerOrient(const MarkerOrient aMarkerOrient)
MarkerOrient getMarkerOrient() const
MarkerOrient content.
virtual const SvgStyleAttributes * getSvgStyleAttributes() const override
SvgMarkerNode(SvgDocument &rDocument, SvgNode *pParent)
MarkerUnits getMarkerUnits() const
MarkerUnits content.