xref: /aoo41x/main/unotools/inc/unotools/fontdefs.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef _UNOTOOLS_FONTDEFS_HXX
28 #define _UNOTOOLS_FONTDEFS_HXX
29 
30 #include <unotools/unotoolsdllapi.h>
31 #include <sal/types.h>
32 #include <tools/string.hxx>
33 
34 namespace utl {
35   class FontSubstConfiguration;
36   struct FontNameAttr;
37 }
38 
39 // ----------------
40 // - SubsFontName -
41 // ----------------
42 
43 #define SUBSFONT_ONLYONE    ((sal_uLong)0x00000001)
44 #define SUBSFONT_MS         ((sal_uLong)0x00000002)
45 #define SUBSFONT_PS         ((sal_uLong)0x00000004)
46 #define SUBSFONT_HTML       ((sal_uLong)0x00000008)
47 
48 UNOTOOLS_DLLPUBLIC String GetSubsFontName( const String& rName, sal_uLong nFlags );
49 
50 // -----------------
51 // - FontTokenName -
52 // -----------------
53 
54 UNOTOOLS_DLLPUBLIC String GetFontToken( const String& rName, xub_StrLen nToken, xub_StrLen& rIndex );
55 inline String GetFontToken( const String& rName, xub_StrLen nToken )
56 {
57     xub_StrLen nTempIndex = 0;
58     return GetFontToken( rName, nToken, nTempIndex );
59 }
60 
61 UNOTOOLS_DLLPUBLIC void AddTokenFontName( String& rName, const String& rNewToken );
62 
63 struct UNOTOOLS_DLLPUBLIC FontNameHash { int operator()(const String&) const; };
64 
65 // ---------------
66 // - ConvertChar -
67 // ---------------
68 
69 class UNOTOOLS_DLLPUBLIC ConvertChar
70 {
71 public:
72     const sal_Unicode*  mpCvtTab;
73     const char*         mpSubsFontName;
74     sal_Unicode         (*mpCvtFunc)( sal_Unicode );
75 	sal_Unicode			RecodeChar( sal_Unicode c ) const;
76 	void				RecodeString( String& rStra, xub_StrLen nIndex, xub_StrLen nLen ) const;
77 	static const ConvertChar* GetRecodeData( const String& rOrgFontName, const String& rMapFontName );
78 };
79 
80 
81 // Default-Font
82 #define DEFAULTFONT_SANS_UNICODE        ((sal_uInt16)1)
83 #define DEFAULTFONT_SANS                ((sal_uInt16)2)
84 #define DEFAULTFONT_SERIF               ((sal_uInt16)3)
85 #define DEFAULTFONT_FIXED               ((sal_uInt16)4)
86 #define DEFAULTFONT_SYMBOL              ((sal_uInt16)5)
87 #define DEFAULTFONT_UI_SANS             ((sal_uInt16)1000)
88 #define DEFAULTFONT_UI_FIXED            ((sal_uInt16)1001)
89 #define DEFAULTFONT_LATIN_TEXT          ((sal_uInt16)2000)
90 #define DEFAULTFONT_LATIN_PRESENTATION  ((sal_uInt16)2001)
91 #define DEFAULTFONT_LATIN_SPREADSHEET   ((sal_uInt16)2002)
92 #define DEFAULTFONT_LATIN_HEADING       ((sal_uInt16)2003)
93 #define DEFAULTFONT_LATIN_DISPLAY       ((sal_uInt16)2004)
94 #define DEFAULTFONT_LATIN_FIXED         ((sal_uInt16)2005)
95 #define DEFAULTFONT_CJK_TEXT            ((sal_uInt16)3000)
96 #define DEFAULTFONT_CJK_PRESENTATION    ((sal_uInt16)3001)
97 #define DEFAULTFONT_CJK_SPREADSHEET     ((sal_uInt16)3002)
98 #define DEFAULTFONT_CJK_HEADING         ((sal_uInt16)3003)
99 #define DEFAULTFONT_CJK_DISPLAY         ((sal_uInt16)3004)
100 #define DEFAULTFONT_CTL_TEXT            ((sal_uInt16)4000)
101 #define DEFAULTFONT_CTL_PRESENTATION    ((sal_uInt16)4001)
102 #define DEFAULTFONT_CTL_SPREADSHEET     ((sal_uInt16)4002)
103 #define DEFAULTFONT_CTL_HEADING         ((sal_uInt16)4003)
104 #define DEFAULTFONT_CTL_DISPLAY         ((sal_uInt16)4004)
105 
106 UNOTOOLS_DLLPUBLIC String GetNextFontToken( const String& rTokenStr, xub_StrLen& rIndex );
107 
108 UNOTOOLS_DLLPUBLIC void GetEnglishSearchFontName( String& rName );
109 
110 #endif
111