LCOV - code coverage report
Current view: top level - vcl/inc - PhysicalFontFace.hxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 5 8 62.5 %
Date: 2014-11-03 Functions: 5 9 55.6 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       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/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      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 .
      18             :  */
      19             : 
      20             : #ifndef INCLUDED_VCL_INC_PHYSICALFONTFACE_HXX
      21             : #define INCLUDED_VCL_INC_PHYSICALFONTFACE_HXX
      22             : 
      23             : #include <vcl/dllapi.h>
      24             : 
      25             : #include "outfont.hxx"
      26             : 
      27             : class ImplFontEntry;
      28             : struct FontMatchStatus;
      29             : class FontSelectPattern;
      30             : class PhysicalFontFamily;
      31             : 
      32             : struct FontMatchStatus
      33             : {
      34             : public:
      35             :     int                 mnFaceMatch;
      36             :     int                 mnHeightMatch;
      37             :     int                 mnWidthMatch;
      38             :     const OUString*     mpTargetStyleName;
      39             : };
      40             : 
      41             : // - PhysicalFontFace -
      42             : 
      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
      47             : 
      48             : // abstract base class for physical font faces
      49      875520 : class VCL_PLUGIN_PUBLIC PhysicalFontFace : public ImplDevFontAttributes
      50             : {
      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;
      56             : 
      57        8192 :     virtual int             GetHeight() const           { return mnHeight; }
      58           0 :     virtual int             GetWidth() const            { return mnWidth; }
      59             :     virtual sal_IntPtr      GetFontId() const = 0;
      60           0 :     int                     GetFontMagic() const        { return mnMagic; }
      61     3679586 :     bool                    IsScalable() const          { return (mnHeight == 0); }
      62           0 :     bool                    CheckMagic( int n ) const   { return (n == mnMagic); }
      63     3174386 :     PhysicalFontFace*       GetNextFace() const         { return mpNext; }
      64             :     PhysicalFontFace*       CreateAlias() const         { return Clone(); }
      65             : 
      66             :     bool                    IsBetterMatch( const FontSelectPattern&, FontMatchStatus& ) const;
      67             :     sal_Int32               CompareWithSize( const PhysicalFontFace& ) const;
      68             :     sal_Int32               CompareIgnoreSize( const PhysicalFontFace& ) const;
      69     1034880 :     virtual                ~PhysicalFontFace() {}
      70             :     virtual PhysicalFontFace* Clone() const = 0;
      71             : 
      72             : protected:
      73             :     explicit                PhysicalFontFace( const ImplDevFontAttributes&, int nMagic );
      74             :     void                    SetBitmapSize( int nW, int nH ) { mnWidth=nW; mnHeight=nH; }
      75             : 
      76             :     long                    mnWidth;    // Width (in pixels)
      77             :     long                    mnHeight;   // Height (in pixels)
      78             : 
      79             : private:
      80             : friend class PhysicalFontFamily;
      81             :     const int               mnMagic;    // poor man's RTTI
      82             :     PhysicalFontFace*       mpNext;
      83             : };
      84             : 
      85             : #endif // INCLUDED_VCL_INC_PHYSICALFONTFACE_HXX
      86             : 
      87             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
      88             : 

Generated by: LCOV version 1.10