bump product version to 4.2.0.1
[LibreOffice.git] / include / unotools / fontdefs.hxx
blob68d35f06aba7ec34d2b85c33508f4ef222e5f814
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 .
19 #ifndef INCLUDED_UNOTOOLS_FONTDEFS_HXX
20 #define INCLUDED_UNOTOOLS_FONTDEFS_HXX
22 #include <unotools/unotoolsdllapi.h>
23 #include <sal/types.h>
24 #include <tools/solar.h>
25 #include <rtl/ustring.hxx>
26 #include <rtl/ustrbuf.hxx>
28 namespace utl {
29 class FontSubstConfiguration;
30 struct FontNameAttr;
33 // ----------------
34 // - SubsFontName -
35 // ----------------
37 #define SUBSFONT_ONLYONE ((sal_uLong)0x00000001)
38 #define SUBSFONT_MS ((sal_uLong)0x00000002)
39 #define SUBSFONT_PS ((sal_uLong)0x00000004)
40 #define SUBSFONT_HTML ((sal_uLong)0x00000008)
42 UNOTOOLS_DLLPUBLIC OUString GetSubsFontName( const OUString& rName, sal_uLong nFlags );
44 UNOTOOLS_DLLPUBLIC void AddTokenFontName( OUString& rName, const OUString& rNewToken );
46 struct UNOTOOLS_DLLPUBLIC FontNameHash { int operator()(const OUString&) const; };
48 // ---------------
49 // - ConvertChar -
50 // ---------------
52 class UNOTOOLS_DLLPUBLIC ConvertChar
54 public:
55 const sal_Unicode* mpCvtTab;
56 const char* mpSubsFontName;
57 sal_Unicode (*mpCvtFunc)( sal_Unicode );
58 sal_Unicode RecodeChar( sal_Unicode c ) const;
59 void RecodeString( OUString& rStra, sal_Int32 nIndex, sal_Int32 nLen ) const;
60 static const ConvertChar* GetRecodeData( const OUString& rOrgFontName, const OUString& rMapFontName );
64 // Default-Font
65 #define DEFAULTFONT_SANS_UNICODE ((sal_uInt16)1)
66 #define DEFAULTFONT_SANS ((sal_uInt16)2)
67 #define DEFAULTFONT_SERIF ((sal_uInt16)3)
68 #define DEFAULTFONT_FIXED ((sal_uInt16)4)
69 #define DEFAULTFONT_SYMBOL ((sal_uInt16)5)
70 #define DEFAULTFONT_UI_SANS ((sal_uInt16)1000)
71 #define DEFAULTFONT_UI_FIXED ((sal_uInt16)1001)
72 #define DEFAULTFONT_LATIN_TEXT ((sal_uInt16)2000)
73 #define DEFAULTFONT_LATIN_PRESENTATION ((sal_uInt16)2001)
74 #define DEFAULTFONT_LATIN_SPREADSHEET ((sal_uInt16)2002)
75 #define DEFAULTFONT_LATIN_HEADING ((sal_uInt16)2003)
76 #define DEFAULTFONT_LATIN_DISPLAY ((sal_uInt16)2004)
77 #define DEFAULTFONT_LATIN_FIXED ((sal_uInt16)2005)
78 #define DEFAULTFONT_CJK_TEXT ((sal_uInt16)3000)
79 #define DEFAULTFONT_CJK_PRESENTATION ((sal_uInt16)3001)
80 #define DEFAULTFONT_CJK_SPREADSHEET ((sal_uInt16)3002)
81 #define DEFAULTFONT_CJK_HEADING ((sal_uInt16)3003)
82 #define DEFAULTFONT_CJK_DISPLAY ((sal_uInt16)3004)
83 #define DEFAULTFONT_CTL_TEXT ((sal_uInt16)4000)
84 #define DEFAULTFONT_CTL_PRESENTATION ((sal_uInt16)4001)
85 #define DEFAULTFONT_CTL_SPREADSHEET ((sal_uInt16)4002)
86 #define DEFAULTFONT_CTL_HEADING ((sal_uInt16)4003)
87 #define DEFAULTFONT_CTL_DISPLAY ((sal_uInt16)4004)
89 UNOTOOLS_DLLPUBLIC OUString GetNextFontToken( const OUString& rTokenStr, sal_Int32& rIndex );
91 UNOTOOLS_DLLPUBLIC void GetEnglishSearchFontName( OUString& rName );
93 /** Determine if the font is the special Star|Open Symbol font
95 @param rFontName
96 The FontName to test for being Star|Open Symbol
98 @return true if this is Star|Open Symbol
100 // FIXME It's quite possible that code using this should instead check for RTL_TEXTENCODING_SYMBOL.
101 UNOTOOLS_DLLPUBLIC bool IsStarSymbol(const OUString &rFontName);
103 #endif
105 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */