fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / include / vcl / metric.hxx
blob27108d756d2f860a21a3e4f8157a1fd90281588b
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 _SV_METRIC_HXX
21 #define _SV_METRIC_HXX
23 #include <vcl/dllapi.h>
24 #include <vcl/font.hxx>
26 class ImplFontMetric;
27 class ImplFontCharMap;
29 typedef sal_uInt32 sal_UCS4;
31 // ------------
32 // - FontInfo -
33 // ------------
35 class VCL_DLLPUBLIC FontInfo : public Font
37 friend class OutputDevice;
39 protected:
40 ImplFontMetric* mpImplMetric; // Implementation
42 public:
43 FontInfo();
44 FontInfo( const FontInfo& );
45 ~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 ); }
55 // --------------
56 // - FontMetric -
57 // --------------
59 class VCL_DLLPUBLIC FontMetric : public FontInfo
61 public:
62 FontMetric() {}
63 FontMetric( const FontMetric& );
64 ~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 ); }
79 // ---------------
80 // - FontCharMap -
81 // ---------------
83 class VCL_DLLPUBLIC FontCharMap
85 private:
86 const ImplFontCharMap* mpImpl;
88 public:
89 FontCharMap();
90 ~FontCharMap();
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;
106 private:
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& );
115 // ----------------
116 // - TextRectInfo -
117 // ----------------
119 class VCL_DLLPUBLIC TextRectInfo
121 friend class OutputDevice;
123 private:
124 long mnMaxWidth;
125 sal_uInt16 mnLineCount;
126 sal_Bool mbEllipsis;
128 public:
129 TextRectInfo();
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()
145 mnMaxWidth = 0;
146 mnLineCount = 0;
147 mbEllipsis = sal_False;
150 #endif // _SV_METRIC_HXX
152 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */