1 /**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23 #ifndef _SVX_ITEMTYPE_HXX
24 #define _SVX_ITEMTYPE_HXX
25
26 // include ---------------------------------------------------------------
27
28 #include <editeng/editrids.hrc>
29 #include <editeng/eerdll.hxx>
30
31 // forward ---------------------------------------------------------------
32 #include <tools/string.hxx>
33 #include <tools/resid.hxx>
34 #include <tools/bigint.hxx>
35 #include <svl/poolitem.hxx>
36 #include <tools/shl.hxx>
37 #include "editeng/editengdllapi.h"
38
39 class Color;
40 class IntlWrapper;
41 // static and prototypes -------------------------------------------------
42
43 static const sal_Unicode cDelim = ',';
44 static const sal_Unicode cpDelim[] = { ',' , ' ', '\0' };
45
46 EDITENG_DLLPUBLIC String GetSvxString( sal_uInt16 nId );
47 EDITENG_DLLPUBLIC String GetMetricText( long nVal, SfxMapUnit eSrcUnit, SfxMapUnit eDestUnit, const IntlWrapper * pIntl );
48 String GetColorString( const Color& rCol );
49 EDITENG_DLLPUBLIC sal_uInt16 GetMetricId( SfxMapUnit eUnit );
50
51 // -----------------------------------------------------------------------
52
GetBoolString(sal_Bool bVal)53 inline String GetBoolString( sal_Bool bVal )
54 {
55 return String( EditResId( bVal ? RID_SVXITEMS_TRUE : RID_SVXITEMS_FALSE ) );
56 }
57
58 // -----------------------------------------------------------------------
59
Scale(long nVal,long nMult,long nDiv)60 inline long Scale( long nVal, long nMult, long nDiv )
61 {
62 BigInt aVal( nVal );
63 aVal *= nMult;
64 aVal += nDiv/2;
65 aVal /= nDiv;
66 return aVal;
67 }
68
69 #endif
70
71