Update ooo320-m1
[ooovba.git] / vcl / source / gdi / pdffontcache.hxx
blob66c5c3864678d306e4dc7da8f54c43157c8b4ab4
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: pdffontcache.hxx,v $
10 * $Revision: 1.4 $
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 ************************************************************************/
31 #ifndef VCL_PDFFONTCACHE_HXX
32 #define VCL_PDFFONTCACHE_HXX
34 #include <sal/types.h>
36 #include <vcl/sallayout.hxx>
37 #include <vcl/salgdi.hxx>
39 namespace vcl
41 class PDFFontCache
43 struct FontIdentifier
45 sal_IntPtr m_nFontId;
46 int m_nMagic;
47 bool m_bVertical;
49 FontIdentifier( const ImplFontData*, bool bVertical );
50 FontIdentifier() : m_nFontId(0), m_nMagic(0), m_bVertical( false ) {}
52 bool operator==( const FontIdentifier& rRight ) const
54 return m_nFontId == rRight.m_nFontId &&
55 m_nMagic == rRight.m_nMagic &&
56 m_bVertical == rRight.m_bVertical;
58 bool operator<( const FontIdentifier& rRight ) const
60 return m_nFontId < rRight.m_nFontId ||
61 m_nMagic < rRight.m_nMagic ||
62 m_bVertical < rRight.m_bVertical;
65 struct FontData
67 Int32Vector m_nWidths;
68 Ucs2UIntMap m_aGlyphIdToIndex;
70 typedef std::map< FontIdentifier, sal_uInt32 > FontToIndexMap;
72 std::vector< FontData > m_aFonts;
73 FontToIndexMap m_aFontToIndex;
75 FontData& getFont( const ImplFontData*, bool bVertical );
76 public:
77 PDFFontCache() {}
78 ~PDFFontCache() {}
80 sal_Int32 getGlyphWidth( const ImplFontData*, sal_GlyphId, bool bVertical, SalGraphics* );
84 #endif