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 .
22 #include <basegfx/range/b2drange.hxx>
25 namespace svgio::svgreader
38 virtual ~InfoProvider() {}
39 virtual basegfx::B2DRange
getCurrentViewPort() const = 0;
40 /// return font size of node inherited from parents
41 virtual double getCurrentFontSizeInherited() const = 0;
42 /// return xheight of node inherited from parents
43 virtual double getCurrentXHeightInherited() const = 0;
48 em
= 0, // relative to current font size
49 ex
, // relative to current x-height
52 pt
, // points, 1/72 in
58 percent
, // relative to range
59 none
// for stroke-miterlimit, which has no unit
78 SvgNumber(double fNum
, SvgUnit aSvgUnit
= SvgUnit::px
, bool bSet
= true)
85 double getNumber() const
90 SvgUnit
getUnit() const
100 bool isPositive() const
102 return basegfx::fTools::moreOrEqual(mfNumber
, 0.0);
105 // Only usable in cases, when the unit is not SvgUnit::percent, otherwise use method solve
106 double solveNonPercentage(const InfoProvider
& rInfoProvider
) const;
108 double solve(const InfoProvider
& rInfoProvider
, NumberType aNumberType
= NumberType::length
) const;
111 typedef std::vector
<SvgNumber
> SvgNumberVector
;
113 } // end of namespace svgio::svgreader
115 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */