bump product version to 4.1.6.2
[LibreOffice.git] / filter / source / svg / units.hxx
bloba7eb40a02417a42c413d8d9e88c1a8168d5e8084
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/.
8 */
9 #ifndef INCLUDED_UNITS_HXX
10 #define INCLUDED_UNITS_HXX
12 #include <sal/config.h>
13 #include <rtl/ustring.hxx>
15 namespace svgi
17 struct State;
18 enum SvgUnit
20 SVG_LENGTH_UNIT_CM,
21 SVG_LENGTH_UNIT_EM,
22 SVG_LENGTH_UNIT_EX,
23 SVG_LENGTH_UNIT_IN,
24 SVG_LENGTH_UNIT_MM,
25 SVG_LENGTH_UNIT_PC,
26 SVG_LENGTH_UNIT_PT,
27 SVG_LENGTH_UNIT_PX,
28 SVG_LENGTH_UNIT_PERCENTAGE,
29 SVG_LENGTH_UNIT_USER
32 /** return svg_length_t in 100th's of mm
33 @param fVal value to convert
34 @param unit unit the value is in
35 @param rState current state (needed for viewport dimensions etc.)
36 @param dir direction - either 'h' or 'v' for horizonal or vertical, resp.
38 double convLength( double fVal, SvgUnit unit, const State& rState, char dir );
40 /** return svg_length_t in 100th's of mm
41 @param sValue value to convert
42 @param rState current state (needed for viewport dimensions etc.)
43 @param dir direction - either 'h' or 'v' for horizonal or vertical, resp.
45 double convLength( const OUString& sValue, const State& rState, char dir );
47 inline double pt2mm(double fVal) { return fVal*25.4/72.0; }
48 inline double pt100thmm(double fVal) { return fVal*2540.0/72.0; }
50 } // namespace svgi
52 #endif
54 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */