Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / vcl / inc / unx / cairotextrender.hxx
blob2e6d1a57d63eae988b30def453665757bf46f3e4
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 .
20 #ifndef INCLUDED_VCL_INC_UNX_CAIROTEXTRENDER_HXX
21 #define INCLUDED_VCL_INC_UNX_CAIROTEXTRENDER_HXX
23 #include <vcl/region.hxx>
25 #include "textrender.hxx"
27 #include <deque>
29 class FreetypeFont;
30 class GlyphCache;
31 typedef struct _cairo cairo_t;
33 class VCL_DLLPUBLIC CairoTextRender : public TextRenderImpl
35 FreetypeFont* mpFreetypeFont[ MAX_FALLBACK ];
37 SalColor mnTextColor;
39 protected:
40 virtual GlyphCache& getPlatformGlyphCache() = 0;
41 virtual cairo_t* getCairoContext() = 0;
42 virtual void getSurfaceOffset(double& nDX, double& nDY) = 0;
43 virtual void releaseCairoContext(cairo_t* cr) = 0;
45 bool setFont( const FontSelectPattern *pEntry, int nFallbackLevel );
47 virtual void clipRegion(cairo_t* cr) = 0;
49 public:
50 CairoTextRender();
53 virtual void SetTextColor( SalColor nSalColor ) override;
54 virtual void SetFont( FontSelectPattern*, int nFallbackLevel ) override;
55 virtual void GetFontMetric( ImplFontMetricDataRef&, int nFallbackLevel ) override;
56 virtual const FontCharMapRef GetFontCharMap() const override;
57 virtual bool GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const override;
58 virtual void GetDevFontList( PhysicalFontCollection* ) override;
59 virtual void ClearDevFontCache() override;
60 virtual bool AddTempDevFont( PhysicalFontCollection*, const OUString& rFileURL, const OUString& rFontName ) override;
61 virtual bool CreateFontSubset(
62 const OUString& rToFile,
63 const PhysicalFontFace*,
64 const sal_GlyphId* pGlyphIDs,
65 const sal_uInt8* pEncoding,
66 sal_Int32* pWidths,
67 int nGlyphs,
68 FontSubsetInfo& rInfo) override;
70 virtual const void* GetEmbedFontData(const PhysicalFontFace*, long* pDataLen) override;
71 virtual void FreeEmbedFontData( const void* pData, long nDataLen ) override;
72 virtual void GetGlyphWidths(
73 const PhysicalFontFace*,
74 bool bVertical,
75 std::vector< sal_Int32 >& rWidths,
76 Ucs2UIntMap& rUnicodeEnc ) override;
78 virtual bool GetGlyphBoundRect(const GlyphItem&, tools::Rectangle&) override;
79 virtual bool GetGlyphOutline(const GlyphItem&, basegfx::B2DPolyPolygon&) override;
80 virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ) override;
81 virtual void DrawTextLayout(const CommonSalLayout&) override;
82 #if ENABLE_CAIRO_CANVAS
83 virtual SystemFontData GetSysFontData( int nFallbackLevel ) const override;
84 #endif
87 #endif
89 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */