summaryrefslogtreecommitdiff
path: root/vcl/inc/vcl/metric.hxx
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2007-04-11 17:00:57 +0000
committerVladimir Glazounov <vg@openoffice.org>2007-04-11 17:00:57 +0000
commitfd7648c85167ab5fd7406f860760519026791cc0 (patch)
tree654fbb36f3e59e3a09d39b61266b7033bc70623b /vcl/inc/vcl/metric.hxx
parent54770ad395a5d018ac156faa9eb809619faee859 (diff)
INTEGRATION: CWS hedaburemove01 (1.1.2); FILE ADDED
2007/04/04 14:57:22 vg 1.1.2.2: resync to SRC680_m207 2007/02/09 16:10:58 vg 1.1.2.1: #72503# get rid of hedabu procedure: Moving headers to vcl/inc/vcl and correspondent necessary changes
Diffstat (limited to 'vcl/inc/vcl/metric.hxx')
-rw-r--r--vcl/inc/vcl/metric.hxx176
1 files changed, 176 insertions, 0 deletions
diff --git a/vcl/inc/vcl/metric.hxx b/vcl/inc/vcl/metric.hxx
new file mode 100644
index 000000000000..c6fe7f785505
--- /dev/null
+++ b/vcl/inc/vcl/metric.hxx
@@ -0,0 +1,176 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: metric.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: vg $ $Date: 2007-04-11 18:00:57 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _SV_METRIC_HXX
+#define _SV_METRIC_HXX
+
+#ifndef _VCL_DLLAPI_H
+#include <vcl/dllapi.h>
+#endif
+
+#ifndef _SV_FONT_HXX
+#include <vcl/font.hxx>
+#endif
+
+class ImplFontMetric;
+class ImplFontCharMap;
+
+typedef sal_uInt32 sal_UCS4;
+
+// ------------
+// - FontInfo -
+// ------------
+
+class VCL_DLLPUBLIC FontInfo : public Font
+{
+ friend class OutputDevice;
+
+protected:
+ ImplFontMetric* mpImplMetric; // Implementation
+
+public:
+ FontInfo();
+ FontInfo( const FontInfo& );
+ ~FontInfo();
+
+ FontType GetType() const;
+ BOOL IsDeviceFont() const;
+ BOOL SupportsLatin() const;
+ BOOL SupportsCJK() const;
+ BOOL SupportsCTL() const;
+
+ FontInfo& operator=( const FontInfo& );
+ BOOL operator==( const FontInfo& ) const;
+ BOOL operator!=( const FontInfo& rInfo ) const
+ { return !operator==( rInfo ); }
+};
+
+// --------------
+// - FontMetric -
+// --------------
+
+class VCL_DLLPUBLIC FontMetric : public FontInfo
+{
+public:
+ FontMetric() {}
+ FontMetric( const FontMetric& );
+ ~FontMetric() {}
+
+ long GetAscent() const;
+ long GetDescent() const;
+ long GetIntLeading() const;
+ long GetExtLeading() const;
+ long GetLineHeight() const;
+ long GetSlant() const;
+
+ FontMetric& operator=( const FontMetric& rMetric );
+ BOOL operator==( const FontMetric& rMetric ) const;
+ BOOL operator!=( const FontMetric& rMetric ) const
+ { return !operator==( rMetric ); }
+};
+
+// ---------------
+// - FontCharMap -
+// ---------------
+
+class VCL_DLLPUBLIC FontCharMap
+{
+private:
+ ImplFontCharMap* mpImpl;
+
+public:
+ FontCharMap();
+ ~FontCharMap();
+
+ BOOL IsDefaultMap() const;
+ BOOL HasChar( sal_uInt32 ) const;
+ int CountCharsInRange( sal_uInt32 cMin, sal_uInt32 cMax ) const;
+ int GetCharCount() const;
+
+ sal_uInt32 GetFirstChar() const;
+ sal_uInt32 GetLastChar() const;
+
+ sal_uInt32 GetNextChar( sal_uInt32 ) const;
+ sal_uInt32 GetPrevChar( sal_uInt32 ) const;
+
+ int GetIndexFromChar( sal_uInt32 ) const;
+ sal_uInt32 GetCharFromIndex( int ) const;
+
+
+private:
+ friend class OutputDevice;
+ void Reset( ImplFontCharMap* pNewMap = NULL );
+
+ // prevent assignment and copy construction
+ FontCharMap( const FontCharMap& );
+ void operator=( const FontCharMap& );
+};
+
+// ----------------
+// - TextRectInfo -
+// ----------------
+
+class VCL_DLLPUBLIC TextRectInfo
+{
+ friend class OutputDevice;
+
+private:
+ long mnMaxWidth;
+ USHORT mnLineCount;
+ BOOL mbEllipsis;
+
+public:
+ TextRectInfo();
+
+ USHORT GetLineCount() const { return mnLineCount; }
+ long GetMaxLineWidth() const { return mnMaxWidth; }
+ BOOL IsEllipses() const { return mbEllipsis; }
+
+ BOOL operator ==( const TextRectInfo& rInfo ) const
+ { return ((mnMaxWidth == rInfo.mnMaxWidth) &&
+ (mnLineCount == rInfo.mnLineCount) &&
+ (mbEllipsis == rInfo.mbEllipsis)); }
+ BOOL operator !=( const TextRectInfo& rInfo ) const
+ { return !(TextRectInfo::operator==( rInfo )); }
+};
+
+inline TextRectInfo::TextRectInfo()
+{
+ mnMaxWidth = 0;
+ mnLineCount = 0;
+ mbEllipsis = FALSE;
+}
+
+#endif // _SV_METRIC_HXX