bump product version to 7.2.5.1
[LibreOffice.git] / vcl / inc / PhysicalFontFace.hxx
blob4ecc751b544537ded4bfb2d72b4f50b0b28ef35d
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_PHYSICALFONTFACE_HXX
21 #define INCLUDED_VCL_INC_PHYSICALFONTFACE_HXX
23 #include <salhelper/simplereferenceobject.hxx>
24 #include <rtl/ref.hxx>
25 #include <tools/long.hxx>
26 #include <vcl/dllapi.h>
27 #include <vcl/fontcharmap.hxx>
29 #include "fontattributes.hxx"
31 class LogicalFontInstance;
32 struct FontMatchStatus;
33 class FontSelectPattern;
34 class PhysicalFontFamily;
36 namespace vcl
38 struct FontCapabilities;
41 struct FontMatchStatus
43 public:
44 int mnFaceMatch;
45 int mnHeightMatch;
46 int mnWidthMatch;
47 const OUString* mpTargetStyleName;
51 // TODO: no more direct access to members
52 // TODO: get rid of height/width for scalable fonts
53 // TODO: make cloning cheaper
55 /**
56 * abstract base class for physical font faces
58 * It acts as a factory for its corresponding LogicalFontInstances and
59 * can be extended to cache device and font instance specific data.
61 class VCL_PLUGIN_PUBLIC PhysicalFontFace : public FontAttributes, public salhelper::SimpleReferenceObject
63 public:
64 virtual rtl::Reference<LogicalFontInstance> CreateFontInstance(const FontSelectPattern&) const = 0;
66 int GetHeight() const { return mnHeight; }
67 int GetWidth() const { return mnWidth; }
68 virtual sal_IntPtr GetFontId() const = 0;
69 virtual FontCharMapRef GetFontCharMap() const = 0;
70 virtual bool GetFontCapabilities(vcl::FontCapabilities&) const = 0;
72 bool IsBetterMatch( const FontSelectPattern&, FontMatchStatus& ) const;
73 sal_Int32 CompareWithSize( const PhysicalFontFace& ) const;
74 sal_Int32 CompareIgnoreSize( const PhysicalFontFace& ) const;
76 protected:
77 explicit PhysicalFontFace(const FontAttributes&);
78 void SetBitmapSize( int nW, int nH ) { mnWidth=nW; mnHeight=nH; }
80 tools::Long mnWidth; // Width (in pixels)
81 tools::Long mnHeight; // Height (in pixels)
84 #endif // INCLUDED_VCL_INC_PHYSICALFONTFACE_HXX
86 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */