xref: /aoo41x/main/unotools/inc/unotools/fontdefs.hxx (revision bae3752e)
1*bae3752eSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*bae3752eSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*bae3752eSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*bae3752eSAndrew Rist  * distributed with this work for additional information
6*bae3752eSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*bae3752eSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*bae3752eSAndrew Rist  * "License"); you may not use this file except in compliance
9*bae3752eSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*bae3752eSAndrew Rist  *
11*bae3752eSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*bae3752eSAndrew Rist  *
13*bae3752eSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*bae3752eSAndrew Rist  * software distributed under the License is distributed on an
15*bae3752eSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*bae3752eSAndrew Rist  * KIND, either express or implied.  See the License for the
17*bae3752eSAndrew Rist  * specific language governing permissions and limitations
18*bae3752eSAndrew Rist  * under the License.
19*bae3752eSAndrew Rist  *
20*bae3752eSAndrew Rist  *************************************************************/
21*bae3752eSAndrew Rist 
22*bae3752eSAndrew Rist 
23cdf0e10cSrcweir #ifndef _UNOTOOLS_FONTDEFS_HXX
24cdf0e10cSrcweir #define _UNOTOOLS_FONTDEFS_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include <unotools/unotoolsdllapi.h>
27cdf0e10cSrcweir #include <sal/types.h>
28cdf0e10cSrcweir #include <tools/string.hxx>
29cdf0e10cSrcweir 
30cdf0e10cSrcweir namespace utl {
31cdf0e10cSrcweir   class FontSubstConfiguration;
32cdf0e10cSrcweir   struct FontNameAttr;
33cdf0e10cSrcweir }
34cdf0e10cSrcweir 
35cdf0e10cSrcweir // ----------------
36cdf0e10cSrcweir // - SubsFontName -
37cdf0e10cSrcweir // ----------------
38cdf0e10cSrcweir 
39cdf0e10cSrcweir #define SUBSFONT_ONLYONE    ((sal_uLong)0x00000001)
40cdf0e10cSrcweir #define SUBSFONT_MS         ((sal_uLong)0x00000002)
41cdf0e10cSrcweir #define SUBSFONT_PS         ((sal_uLong)0x00000004)
42cdf0e10cSrcweir #define SUBSFONT_HTML       ((sal_uLong)0x00000008)
43cdf0e10cSrcweir 
44cdf0e10cSrcweir UNOTOOLS_DLLPUBLIC String GetSubsFontName( const String& rName, sal_uLong nFlags );
45cdf0e10cSrcweir 
46cdf0e10cSrcweir // -----------------
47cdf0e10cSrcweir // - FontTokenName -
48cdf0e10cSrcweir // -----------------
49cdf0e10cSrcweir 
50cdf0e10cSrcweir UNOTOOLS_DLLPUBLIC String GetFontToken( const String& rName, xub_StrLen nToken, xub_StrLen& rIndex );
GetFontToken(const String & rName,xub_StrLen nToken)51cdf0e10cSrcweir inline String GetFontToken( const String& rName, xub_StrLen nToken )
52cdf0e10cSrcweir {
53cdf0e10cSrcweir     xub_StrLen nTempIndex = 0;
54cdf0e10cSrcweir     return GetFontToken( rName, nToken, nTempIndex );
55cdf0e10cSrcweir }
56cdf0e10cSrcweir 
57cdf0e10cSrcweir UNOTOOLS_DLLPUBLIC void AddTokenFontName( String& rName, const String& rNewToken );
58cdf0e10cSrcweir 
59cdf0e10cSrcweir struct UNOTOOLS_DLLPUBLIC FontNameHash { int operator()(const String&) const; };
60cdf0e10cSrcweir 
61cdf0e10cSrcweir // ---------------
62cdf0e10cSrcweir // - ConvertChar -
63cdf0e10cSrcweir // ---------------
64cdf0e10cSrcweir 
65cdf0e10cSrcweir class UNOTOOLS_DLLPUBLIC ConvertChar
66cdf0e10cSrcweir {
67cdf0e10cSrcweir public:
68cdf0e10cSrcweir     const sal_Unicode*  mpCvtTab;
69cdf0e10cSrcweir     const char*         mpSubsFontName;
70cdf0e10cSrcweir     sal_Unicode         (*mpCvtFunc)( sal_Unicode );
71cdf0e10cSrcweir 	sal_Unicode			RecodeChar( sal_Unicode c ) const;
72cdf0e10cSrcweir 	void				RecodeString( String& rStra, xub_StrLen nIndex, xub_StrLen nLen ) const;
73cdf0e10cSrcweir 	static const ConvertChar* GetRecodeData( const String& rOrgFontName, const String& rMapFontName );
74cdf0e10cSrcweir };
75cdf0e10cSrcweir 
76cdf0e10cSrcweir 
77cdf0e10cSrcweir // Default-Font
78cdf0e10cSrcweir #define DEFAULTFONT_SANS_UNICODE        ((sal_uInt16)1)
79cdf0e10cSrcweir #define DEFAULTFONT_SANS                ((sal_uInt16)2)
80cdf0e10cSrcweir #define DEFAULTFONT_SERIF               ((sal_uInt16)3)
81cdf0e10cSrcweir #define DEFAULTFONT_FIXED               ((sal_uInt16)4)
82cdf0e10cSrcweir #define DEFAULTFONT_SYMBOL              ((sal_uInt16)5)
83cdf0e10cSrcweir #define DEFAULTFONT_UI_SANS             ((sal_uInt16)1000)
84cdf0e10cSrcweir #define DEFAULTFONT_UI_FIXED            ((sal_uInt16)1001)
85cdf0e10cSrcweir #define DEFAULTFONT_LATIN_TEXT          ((sal_uInt16)2000)
86cdf0e10cSrcweir #define DEFAULTFONT_LATIN_PRESENTATION  ((sal_uInt16)2001)
87cdf0e10cSrcweir #define DEFAULTFONT_LATIN_SPREADSHEET   ((sal_uInt16)2002)
88cdf0e10cSrcweir #define DEFAULTFONT_LATIN_HEADING       ((sal_uInt16)2003)
89cdf0e10cSrcweir #define DEFAULTFONT_LATIN_DISPLAY       ((sal_uInt16)2004)
90cdf0e10cSrcweir #define DEFAULTFONT_LATIN_FIXED         ((sal_uInt16)2005)
91cdf0e10cSrcweir #define DEFAULTFONT_CJK_TEXT            ((sal_uInt16)3000)
92cdf0e10cSrcweir #define DEFAULTFONT_CJK_PRESENTATION    ((sal_uInt16)3001)
93cdf0e10cSrcweir #define DEFAULTFONT_CJK_SPREADSHEET     ((sal_uInt16)3002)
94cdf0e10cSrcweir #define DEFAULTFONT_CJK_HEADING         ((sal_uInt16)3003)
95cdf0e10cSrcweir #define DEFAULTFONT_CJK_DISPLAY         ((sal_uInt16)3004)
96cdf0e10cSrcweir #define DEFAULTFONT_CTL_TEXT            ((sal_uInt16)4000)
97cdf0e10cSrcweir #define DEFAULTFONT_CTL_PRESENTATION    ((sal_uInt16)4001)
98cdf0e10cSrcweir #define DEFAULTFONT_CTL_SPREADSHEET     ((sal_uInt16)4002)
99cdf0e10cSrcweir #define DEFAULTFONT_CTL_HEADING         ((sal_uInt16)4003)
100cdf0e10cSrcweir #define DEFAULTFONT_CTL_DISPLAY         ((sal_uInt16)4004)
101cdf0e10cSrcweir 
102cdf0e10cSrcweir UNOTOOLS_DLLPUBLIC String GetNextFontToken( const String& rTokenStr, xub_StrLen& rIndex );
103cdf0e10cSrcweir 
104cdf0e10cSrcweir UNOTOOLS_DLLPUBLIC void GetEnglishSearchFontName( String& rName );
105cdf0e10cSrcweir 
106cdf0e10cSrcweir #endif
107