LCOV - code coverage report
Current view: top level - libreoffice/solver/unxlngi6.pro/inc/vcl - metric.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 2 10 20.0 %
Date: 2012-12-27 Functions: 2 6 33.3 %
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 _SV_METRIC_HXX
      21             : #define _SV_METRIC_HXX
      22             : 
      23             : #include <vcl/dllapi.h>
      24             : #include <vcl/font.hxx>
      25             : 
      26             : class ImplFontMetric;
      27             : class ImplFontCharMap;
      28             : 
      29             : typedef sal_uInt32 sal_UCS4;
      30             : 
      31             : // ------------
      32             : // - FontInfo -
      33             : // ------------
      34             : 
      35             : class VCL_DLLPUBLIC FontInfo : public Font
      36             : {
      37             :     friend class OutputDevice;
      38             : 
      39             : protected:
      40             :     ImplFontMetric*     mpImplMetric;    // Implementation
      41             : 
      42             : public:
      43             :                         FontInfo();
      44             :                         FontInfo( const FontInfo& );
      45             :                         ~FontInfo();
      46             : 
      47             :     FontType            GetType() const;
      48             : 
      49             :     FontInfo&           operator=( const FontInfo& );
      50             :     sal_Bool                operator==( const FontInfo& ) const;
      51             :     sal_Bool                operator!=( const FontInfo& rInfo ) const
      52             :                             { return !operator==( rInfo ); }
      53             : };
      54             : 
      55             : // --------------
      56             : // - FontMetric -
      57             : // --------------
      58             : 
      59             : class VCL_DLLPUBLIC FontMetric : public FontInfo
      60             : {
      61             : public:
      62       44757 :                         FontMetric() {}
      63             :                         FontMetric( const FontMetric& );
      64       44757 :                         ~FontMetric() {}
      65             : 
      66             :     long                GetAscent() const;
      67             :     long                GetDescent() const;
      68             :     long                GetIntLeading() const;
      69             :     long                GetExtLeading() const;
      70             :     long                GetLineHeight() const;
      71             :     long                GetSlant() const;
      72             : 
      73             :     FontMetric&         operator=( const FontMetric& rMetric );
      74             :     sal_Bool                operator==( const FontMetric& rMetric ) const;
      75             :     sal_Bool                operator!=( const FontMetric& rMetric ) const
      76             :                             { return !operator==( rMetric ); }
      77             : };
      78             : 
      79             : // ---------------
      80             : // - FontCharMap -
      81             : // ---------------
      82             : 
      83             : class VCL_DLLPUBLIC FontCharMap
      84             : {
      85             : private:
      86             :     const ImplFontCharMap* mpImpl;
      87             : 
      88             : public:
      89             :                         FontCharMap();
      90             :                         ~FontCharMap();
      91             : 
      92             :     sal_Bool                IsDefaultMap() const;
      93             :     sal_Bool                HasChar( sal_uInt32 ) const;
      94             :     int                 CountCharsInRange( sal_uInt32 cMin, sal_uInt32 cMax ) const;
      95             :     int                 GetCharCount() const;
      96             : 
      97             :     sal_uInt32          GetFirstChar() const;
      98             : 
      99             :     sal_uInt32          GetNextChar( sal_uInt32 ) const;
     100             :     sal_uInt32          GetPrevChar( sal_uInt32 ) const;
     101             : 
     102             :     int                 GetIndexFromChar( sal_uInt32 ) const;
     103             :     sal_uInt32          GetCharFromIndex( int ) const;
     104             : 
     105             : 
     106             : private:
     107             :     friend class OutputDevice;
     108             :     void                Reset( const ImplFontCharMap* pNewMap = NULL );
     109             : 
     110             :     // prevent assignment and copy construction
     111             :                         FontCharMap( const FontCharMap& );
     112             :     void                operator=( const FontCharMap& );
     113             : };
     114             : 
     115             : // ----------------
     116             : // - TextRectInfo -
     117             : // ----------------
     118             : 
     119             : class VCL_DLLPUBLIC TextRectInfo
     120             : {
     121             :     friend class OutputDevice;
     122             : 
     123             : private:
     124             :     long            mnMaxWidth;
     125             :     sal_uInt16          mnLineCount;
     126             :     sal_Bool            mbEllipsis;
     127             : 
     128             : public:
     129             :                     TextRectInfo();
     130             : 
     131           0 :     sal_uInt16          GetLineCount() const { return mnLineCount; }
     132           0 :     long            GetMaxLineWidth() const { return mnMaxWidth; }
     133           0 :     sal_Bool            IsEllipses() const { return mbEllipsis; }
     134             : 
     135             :     sal_Bool            operator ==( const TextRectInfo& rInfo ) const
     136             :                         { return ((mnMaxWidth   == rInfo.mnMaxWidth)    &&
     137             :                                   (mnLineCount  == rInfo.mnLineCount)   &&
     138             :                                   (mbEllipsis   == rInfo.mbEllipsis)); }
     139             :     sal_Bool            operator !=( const TextRectInfo& rInfo ) const
     140             :                         { return !(TextRectInfo::operator==( rInfo )); }
     141             : };
     142             : 
     143           0 : inline TextRectInfo::TextRectInfo()
     144             : {
     145           0 :     mnMaxWidth      = 0;
     146           0 :     mnLineCount     = 0;
     147           0 :     mbEllipsis      = sal_False;
     148           0 : }
     149             : 
     150             : #endif // _SV_METRIC_HXX
     151             : 
     152             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10