1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: dlgutil.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _SVX_DLGUTIL_HXX
31 #define _SVX_DLGUTIL_HXX
33 // include ---------------------------------------------------------------
35 #include <vcl/field.hxx>
37 #include <svtools/poolitem.hxx>
38 #include <svtools/intitem.hxx>
39 #include "svx/svxdllapi.h"
41 // macro -----------------------------------------------------------------
43 // typedef ---------------------------------------------------------------
45 typedef long (*FUNC_CONVERT
)(long);
47 // Functions -------------------------------------------------------------
49 // HM- und LanguageStrings aus der Resource laden
50 SVX_DLLPUBLIC String
GetLanguageString( LanguageType eType
);
51 SVX_DLLPUBLIC String
GetDicInfoStr( const String
& rName
, const USHORT nLang
,
54 // FieldUnit im MetricField oder -Box umsetzen
55 SVX_DLLPUBLIC
void SetFieldUnit( MetricField
& rCtrl
,
56 FieldUnit eUnit
, BOOL bAll
= FALSE
);
57 SVX_DLLPUBLIC
void SetFieldUnit( MetricBox
& rCtrl
,
58 FieldUnit eUnit
, BOOL bAll
= FALSE
);
60 SVX_DLLPUBLIC FieldUnit
GetModuleFieldUnit( const SfxItemSet
* pSet
= NULL
);
61 SVX_DLLPUBLIC BOOL
GetApplyCharUnit( const SfxItemSet
* pSet
= NULL
);
64 SVX_DLLPUBLIC
long CalcToUnit( float nIn
, SfxMapUnit eUnit
);
65 SVX_DLLPUBLIC
long CalcToPoint( long nIn
, SfxMapUnit eUnit
, USHORT nFaktor
);
67 SVX_DLLPUBLIC
long ItemToControl( long nIn
, SfxMapUnit eItem
, SfxFieldUnit eCtrl
);
68 long ControlToItem( long nIn
, SfxFieldUnit eCtrl
, SfxMapUnit eItem
);
70 SVX_DLLPUBLIC FieldUnit
MapToFieldUnit( const SfxMapUnit eUnit
);
71 MapUnit
FieldToMapUnit( const SfxFieldUnit eUnit
);
73 long ConvertValueToMap( long nVal
, SfxMapUnit eUnit
);
74 long ConvertValueToUnit( long nVal
, SfxMapUnit eUnit
);
76 SVX_DLLPUBLIC
void SetMetricValue( MetricField
& rField
,
77 long lCoreValue
, SfxMapUnit eUnit
);
78 SVX_DLLPUBLIC
long GetCoreValue( const MetricField
& rField
, SfxMapUnit eUnit
);
81 long CMToTwips( long nIn
);
82 long MMToTwips( long nIn
);
83 long InchToTwips( long nIn
);
84 SVX_DLLPUBLIC
long PointToTwips( long nIn
);
85 long PicaToTwips( long nIn
);
88 long TwipsToCM( long nIn
);
89 long InchToCM( long nIn
);
90 long MMToCM( long nIn
);
91 long PointToCM( long nIn
);
92 long PicaToCM( long nIn
);
95 long TwipsToMM( long nIn
);
96 long CMToMM( long nIn
);
97 long InchToMM( long nIn
);
98 long PointToMM( long nIn
);
99 long PicaToMM( long nIn
);
102 long TwipsToInch(long nIn
);
103 long CMToInch(long nIn
);
104 long MMToInch(long nIn
);
105 long PointToInch(long nIn
);
106 long PicaToInch(long nIn
);
109 long TwipsToPoint(long nIn
);
110 long InchToPoint(long nIn
);
111 long CMToPoint(long nIn
);
112 long MMToPoint(long nIn
);
113 long PicaToPoint(long nIn
);
116 long TwipsToPica(long nIn
);
117 long InchToPica(long nIn
);
118 long PointToPica(long nIn
);
119 long CMToPica(long nIn
);
120 long MMToPica(long nIn
);
122 // generische Wandlung
123 long TransformMetric( long nVal
, FieldUnit aOld
, FieldUnit aNew
);
125 // replacement of the SfxIniManager
126 String
ConvertPosSizeToIniString( const Point
& rPos
, const Size
& rSize
);
127 sal_Bool
ConvertIniStringToPosSize( const String
& rIniStr
, Point
& rPos
, Size
& rSize
);
130 #define OUTPUT_DRAWMODE_COLOR (DRAWMODE_DEFAULT)
131 #define OUTPUT_DRAWMODE_CONTRAST (DRAWMODE_SETTINGSLINE | DRAWMODE_SETTINGSFILL | DRAWMODE_SETTINGSTEXT | DRAWMODE_SETTINGSGRADIENT)