1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 _SV_METRIC_HXX
21 #define _SV_METRIC_HXX
23 #include <vcl/dllapi.h>
24 #include <vcl/font.hxx>
27 class ImplFontCharMap
;
29 typedef sal_uInt32 sal_UCS4
;
35 class VCL_DLLPUBLIC FontInfo
: public Font
37 friend class OutputDevice
;
40 ImplFontMetric
* mpImplMetric
; // Implementation
44 FontInfo( const FontInfo
& );
47 FontType
GetType() const;
49 FontInfo
& operator=( const FontInfo
& );
50 sal_Bool
operator==( const FontInfo
& ) const;
51 sal_Bool
operator!=( const FontInfo
& rInfo
) const
52 { return !operator==( rInfo
); }
59 class VCL_DLLPUBLIC FontMetric
: public FontInfo
63 FontMetric( const FontMetric
& );
66 long GetAscent() const;
67 long GetDescent() const;
68 long GetIntLeading() const;
69 long GetExtLeading() const;
70 long GetLineHeight() const;
71 long GetSlant() const;
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
); }
83 class VCL_DLLPUBLIC FontCharMap
86 const ImplFontCharMap
* mpImpl
;
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;
97 sal_uInt32
GetFirstChar() const;
99 sal_uInt32
GetNextChar( sal_uInt32
) const;
100 sal_uInt32
GetPrevChar( sal_uInt32
) const;
102 int GetIndexFromChar( sal_uInt32
) const;
103 sal_uInt32
GetCharFromIndex( int ) const;
107 friend class OutputDevice
;
108 void Reset( const ImplFontCharMap
* pNewMap
= NULL
);
110 // prevent assignment and copy construction
111 FontCharMap( const FontCharMap
& );
112 void operator=( const FontCharMap
& );
119 class VCL_DLLPUBLIC TextRectInfo
121 friend class OutputDevice
;
125 sal_uInt16 mnLineCount
;
131 sal_uInt16
GetLineCount() const { return mnLineCount
; }
132 long GetMaxLineWidth() const { return mnMaxWidth
; }
133 sal_Bool
IsEllipses() const { return mbEllipsis
; }
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
)); }
143 inline TextRectInfo::TextRectInfo()
147 mbEllipsis
= sal_False
;
150 #endif // _SV_METRIC_HXX
152 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */