Eneboo - Documentación para desarrolladores
src/qt/include/qfontmetrics.h
Ir a la documentación de este archivo.
00001 /****************************************************************************
00002 ** $Id: qt/qfontmetrics.h   3.3.8   edited Jan 11 14:38 $
00003 **
00004 ** Definition of QFontMetrics class
00005 **
00006 ** Created : 940514
00007 **
00008 ** Copyright (C) 1992-2007 Trolltech ASA.  All rights reserved.
00009 **
00010 ** This file is part of the kernel module of the Qt GUI Toolkit.
00011 **
00012 ** This file may be distributed under the terms of the Q Public License
00013 ** as defined by Trolltech ASA of Norway and appearing in the file
00014 ** LICENSE.QPL included in the packaging of this file.
00015 **
00016 ** This file may be distributed and/or modified under the terms of the
00017 ** GNU General Public License version 2 as published by the Free Software
00018 ** Foundation and appearing in the file LICENSE.GPL included in the
00019 ** packaging of this file.
00020 **
00021 ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
00022 ** licenses may use this file in accordance with the Qt Commercial License
00023 ** Agreement provided with the Software.
00024 **
00025 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00026 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00027 **
00028 ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
00029 **   information about Qt Commercial License Agreements.
00030 ** See http://www.trolltech.com/qpl/ for QPL licensing information.
00031 ** See http://www.trolltech.com/gpl/ for GPL licensing information.
00032 **
00033 ** Contact info@trolltech.com if any conditions of this licensing are
00034 ** not clear to you.
00035 **
00036 **********************************************************************/
00037 
00038 #ifndef QFONTMETRICS_H
00039 #define QFONTMETRICS_H
00040 
00041 #ifndef QT_H
00042 #include "qfont.h"
00043 #include "qrect.h"
00044 #endif // QT_H
00045 
00046 #ifdef Q_WS_QWS
00047 class QFontEngine;
00048 #endif
00049 
00050 class QTextCodec;
00051 class QTextParag;
00052 
00053 class Q_EXPORT QFontMetrics
00054 {
00055 public:
00056     QFontMetrics( const QFont & );
00057     QFontMetrics( const QFont &, QFont::Script );
00058     QFontMetrics( const QFontMetrics & );
00059     ~QFontMetrics();
00060 
00061     QFontMetrics &operator=( const QFontMetrics & );
00062 
00063     int         ascent()        const;
00064     int         descent()       const;
00065     int         height()        const;
00066     int         leading()       const;
00067     int         lineSpacing()   const;
00068     int         minLeftBearing() const;
00069     int         minRightBearing() const;
00070     int         maxWidth()      const;
00071 
00072     bool        inFont(QChar)   const;
00073 
00074     int         leftBearing(QChar) const;
00075     int         rightBearing(QChar) const;
00076     int         width( const QString &, int len = -1 ) const;
00077 
00078     int         width( QChar ) const;
00079 #ifndef QT_NO_COMPAT
00080     int         width( char c ) const { return width( (QChar) c ); }
00081 #endif
00082 
00083     int                 charWidth( const QString &str, int pos ) const;
00084     QRect       boundingRect( const QString &, int len = -1 ) const;
00085     QRect       boundingRect( QChar ) const;
00086     QRect       boundingRect( int x, int y, int w, int h, int flags,
00087                               const QString& str, int len=-1, int tabstops=0,
00088                               int *tabarray=0, QTextParag **intern=0 ) const;
00089     QSize       size( int flags,
00090                       const QString& str, int len=-1, int tabstops=0,
00091                       int *tabarray=0, QTextParag **intern=0 ) const;
00092 
00093     int         underlinePos()  const;
00094     int         overlinePos()   const;
00095     int         strikeOutPos()  const;
00096     int         lineWidth()     const;
00097 
00098 private:
00099     QFontMetrics( const QPainter * );
00100 
00101     friend class QWidget;
00102     friend class QPainter;
00103     friend class QTextFormat;
00104 #if defined( Q_WS_MAC )
00105     friend class QFontPrivate;
00106 #endif
00107 
00108     QFontPrivate  *d;
00109     QPainter      *painter;
00110     int            fscript;
00111 };
00112 
00113 
00114 #endif // QFONTMETRICS_H
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'