vcl: 'horizontically'
[LibreOffice.git] / include / vcl / fieldvalues.hxx
blobe8f78bd5e119e81daae6d70d2bfff708da19366d
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/.
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 .
20 #ifndef INCLUDED_VCL_FIELDVALUES_HXX
21 #define INCLUDED_VCL_FIELDVALUES_HXX
23 #include <vcl/dllapi.h>
24 #include <rtl/ustring.hxx>
25 #include <tools/fldunit.hxx>
26 #include <tools/mapunit.hxx>
28 class LocaleDataWrapper;
30 namespace vcl
32 VCL_DLLPUBLIC FieldUnit StringToMetric(const OUString& rMetricString);
33 VCL_DLLPUBLIC bool TextToValue(const OUString& rStr, double& rValue, sal_Int64 nBaseValue,
34 sal_uInt16 nDecDigits, const LocaleDataWrapper& rLocaleDataWrapper,
35 FieldUnit eUnit);
37 VCL_DLLPUBLIC sal_Int64 ConvertValue(sal_Int64 nValue, sal_Int64 mnBaseValue, sal_uInt16 nDecDigits,
38 FieldUnit eInUnit, FieldUnit eOutUnit);
39 VCL_DLLPUBLIC sal_Int64 ConvertValue(sal_Int64 nValue, sal_uInt16 nDecDigits, MapUnit eInUnit,
40 FieldUnit eOutUnit);
42 // for backwards compatibility
43 // caution: conversion to double loses precision
44 VCL_DLLPUBLIC double ConvertDoubleValue(double nValue, sal_Int64 mnBaseValue, sal_uInt16 nDecDigits,
45 FieldUnit eInUnit, FieldUnit eOutUnit);
46 VCL_DLLPUBLIC double ConvertDoubleValue(double nValue, sal_uInt16 nDecDigits, FieldUnit eInUnit,
47 MapUnit eOutUnit);
48 VCL_DLLPUBLIC double ConvertDoubleValue(double nValue, sal_uInt16 nDecDigits, MapUnit eInUnit,
49 FieldUnit eOutUnit);
51 // for backwards compatibility
52 // caution: conversion to double loses precision
53 inline double ConvertDoubleValue(sal_Int64 nValue, sal_Int64 nBaseValue, sal_uInt16 nDecDigits,
54 FieldUnit eInUnit, FieldUnit eOutUnit)
56 return ConvertDoubleValue(static_cast<double>(nValue), nBaseValue, nDecDigits, eInUnit,
57 eOutUnit);
60 inline double ConvertDoubleValue(sal_Int64 nValue, sal_uInt16 nDecDigits, FieldUnit eInUnit,
61 MapUnit eOutUnit)
63 return ConvertDoubleValue(static_cast<double>(nValue), nDecDigits, eInUnit, eOutUnit);
66 inline double ConvertDoubleValue(sal_Int64 nValue, sal_uInt16 nDecDigits, MapUnit eInUnit,
67 FieldUnit eOutUnit)
69 return ConvertDoubleValue(static_cast<double>(nValue), nDecDigits, eInUnit, eOutUnit);
73 #endif // INCLUDED_VCL_FIELDVALUES_HXX
75 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */