merge the formfield patch from ooo-build
[ooovba.git] / filter / source / svg / units.hxx
blobe48b5d592943bcc91d796948d3cf1f3bbde36098
1 /*************************************************************************
3 * OpenOffice.org - a multi-platform office productivity suite
5 * Author:
6 * Jan Holesovsky <kendy@suse.cz>
7 * Fridrich Strba <fridrich.strba@bluewin.ch>
8 * Thorsten Behrens <tbehrens@novell.com>
10 * Copyright (C) 2008, Novell Inc.
12 * The Contents of this file are made available subject to
13 * the terms of GNU Lesser General Public License Version 2.1.
15 ************************************************************************/
17 #ifndef INCLUDED_UNITS_HXX
18 #define INCLUDED_UNITS_HXX
20 #include <sal/config.h>
22 namespace rtl{ class OUString; }
23 namespace svgi
25 struct State;
26 enum SvgUnit
28 SVG_LENGTH_UNIT_CM,
29 SVG_LENGTH_UNIT_EM,
30 SVG_LENGTH_UNIT_EX,
31 SVG_LENGTH_UNIT_IN,
32 SVG_LENGTH_UNIT_MM,
33 SVG_LENGTH_UNIT_PC,
34 SVG_LENGTH_UNIT_PT,
35 SVG_LENGTH_UNIT_PX,
36 SVG_LENGTH_UNIT_PERCENTAGE,
37 SVG_LENGTH_UNIT_USER
40 /** return svg_length_t in 100th's of mm
41 @param fVal value to convert
42 @param unit unit the value is in
43 @param rState current state (needed for viewport dimensions etc.)
44 @param dir direction - either 'h' or 'v' for horizonal or vertical, resp.
46 double convLength( double fVal, SvgUnit unit, const State& rState, char dir );
48 /** return svg_length_t in 100th's of mm
49 @param sValue value to convert
50 @param rState current state (needed for viewport dimensions etc.)
51 @param dir direction - either 'h' or 'v' for horizonal or vertical, resp.
53 double convLength( const rtl::OUString& sValue, const State& rState, char dir );
55 inline double pt2mm(double fVal) { return fVal*25.4/72.0; }
56 inline double pt100thmm(double fVal) { return fVal*2540.0/72.0; }
58 } // namespace svgi
60 #endif