1 /*************************************************************************
3 * OpenOffice.org - a multi-platform office productivity suite
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
; }
36 SVG_LENGTH_UNIT_PERCENTAGE
,
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; }