update emoji autocorrect entries from po-files
[LibreOffice.git] / vcl / inc / PhysicalFontFace.hxx
blobfa275cc84038e9b1aa6de98e3d01b4ae48688979
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 <vcl/dllapi.h>
25 #include "outfont.hxx"
27 class ImplFontEntry;
28 struct FontMatchStatus;
29 class FontSelectPattern;
30 class PhysicalFontFamily;
32 struct FontMatchStatus
34 public:
35 int mnFaceMatch;
36 int mnHeightMatch;
37 int mnWidthMatch;
38 const OUString* mpTargetStyleName;
41 // - PhysicalFontFace -
43 // TODO: no more direct access to members
44 // TODO: add reference counting
45 // TODO: get rid of height/width for scalable fonts
46 // TODO: make cloning cheaper
48 // abstract base class for physical font faces
49 class VCL_PLUGIN_PUBLIC PhysicalFontFace : public ImplDevFontAttributes
51 public:
52 // by using an PhysicalFontFace object as a factory for its corresponding
53 // ImplFontEntry an ImplFontEntry can be extended to cache device and
54 // font instance specific data
55 virtual ImplFontEntry* CreateFontInstance( FontSelectPattern& ) const = 0;
57 int GetHeight() const { return mnHeight; }
58 int GetWidth() const { return mnWidth; }
59 virtual sal_IntPtr GetFontId() const = 0;
60 int GetFontMagic() const { return mnMagic; }
61 bool IsScalable() const { return (mnHeight == 0); }
62 bool CheckMagic( int n ) const { return (n == mnMagic); }
63 PhysicalFontFace* GetNextFace() const { return mpNext; }
64 PhysicalFontFace* CreateAlias() const { return Clone(); }
66 bool IsBetterMatch( const FontSelectPattern&, FontMatchStatus& ) const;
67 sal_Int32 CompareWithSize( const PhysicalFontFace& ) const;
68 sal_Int32 CompareIgnoreSize( const PhysicalFontFace& ) const;
69 virtual ~PhysicalFontFace() {}
70 virtual PhysicalFontFace* Clone() const = 0;
72 protected:
73 explicit PhysicalFontFace( const ImplDevFontAttributes&, int nMagic );
74 void SetBitmapSize( int nW, int nH ) { mnWidth=nW; mnHeight=nH; }
76 long mnWidth; // Width (in pixels)
77 long mnHeight; // Height (in pixels)
79 private:
80 friend class PhysicalFontFamily;
81 const int mnMagic; // poor man's RTTI
82 PhysicalFontFace* mpNext;
85 #endif // INCLUDED_VCL_INC_PHYSICALFONTFACE_HXX
87 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */