Eneboo - Documentación para desarrolladores
|
00001 /**************************************************************************** 00002 ** $Id: qt/qfontdatabase.h 3.3.8 edited Jan 11 14:46 $ 00003 ** 00004 ** Definition of the QFontDatabase class 00005 ** 00006 ** Created : 981126 00007 ** 00008 ** Copyright (C) 1999-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 QFONTDATABASE_H 00039 #define QFONTDATABASE_H 00040 00041 #ifndef QT_H 00042 #include "qwindowdefs.h" 00043 #include "qstring.h" 00044 #include "qstringlist.h" 00045 #include "qfont.h" 00046 #include "qvaluelist.h" 00047 #endif // QT_H 00048 00049 00050 #ifndef QT_NO_FONTDATABASE 00051 00052 class QFontStylePrivate; /* Don't touch! */ 00053 struct QtFontStyle; 00054 struct QtFontFamily; 00055 struct QtFontFoundry; 00056 struct QFontDef; 00057 class QFontEngine; 00058 #ifdef Q_WS_QWS 00059 class QDiskFont; 00060 #endif 00061 00062 class QFontDatabasePrivate; 00063 00064 class Q_EXPORT QFontDatabase 00065 { 00066 public: 00067 static QValueList<int> standardSizes(); 00068 00069 QFontDatabase(); 00070 00071 QStringList families() const; 00072 QStringList families( QFont::Script ) const; 00073 QStringList styles( const QString & ) const; 00074 QValueList<int> pointSizes( const QString &, const QString & = QString::null); 00075 QValueList<int> smoothSizes( const QString &, const QString &); 00076 QString styleString( const QFont &); 00077 00078 QFont font( const QString &, const QString &, int); 00079 00080 bool isBitmapScalable( const QString &, const QString & = QString::null) const; 00081 bool isSmoothlyScalable( const QString &, const QString & = QString::null) const; 00082 bool isScalable( const QString &, const QString & = QString::null) const; 00083 bool isFixedPitch( const QString &, const QString & = QString::null) const; 00084 00085 bool italic( const QString &, const QString &) const; 00086 bool bold( const QString &, const QString &) const; 00087 int weight( const QString &, const QString &) const; 00088 00089 static QString scriptName(QFont::Script); 00090 static QString scriptSample(QFont::Script); 00091 00092 #ifdef Q_WS_QWS 00093 static void qwsAddDiskFont( QDiskFont *qdf ); 00094 #endif 00095 00096 // For source compatibility with < 3.0 00097 #ifndef QT_NO_COMPAT 00098 00099 QStringList families(bool) const; 00100 QStringList styles( const QString &, const QString & ) const; 00101 QValueList<int> pointSizes( const QString &, const QString &, const QString & ); 00102 QValueList<int> smoothSizes( const QString &, const QString &, const QString & ); 00103 00104 QFont font( const QString &, const QString &, int, const QString &); 00105 00106 bool isBitmapScalable( const QString &, const QString &, const QString & ) const; 00107 bool isSmoothlyScalable( const QString &, const QString &, const QString & ) const; 00108 bool isScalable( const QString &, const QString &, const QString & ) const; 00109 bool isFixedPitch( const QString &, const QString &, const QString & ) const; 00110 00111 bool italic( const QString &, const QString &, const QString & ) const; 00112 bool bold( const QString &, const QString &, const QString & ) const; 00113 int weight( const QString &, const QString &, const QString & ) const; 00114 00115 #endif // QT_NO_COMPAT 00116 00117 private: 00118 #if defined(Q_WS_X11) || defined(Q_WS_WIN) 00119 static QFontEngine *findFont( QFont::Script script, const QFontPrivate *fp, 00120 const QFontDef &request, int force_encoding_id = -1 ); 00121 #endif // Q_WS_X11 00122 00123 static void createDatabase(); 00124 00125 static void parseFontName(const QString &name, QString &foundry, QString &family); 00126 00127 friend struct QFontDef; 00128 friend class QFontPrivate; 00129 friend class QFontDialog; 00130 friend class QFontEngineLatinXLFD; 00131 00132 QFontDatabasePrivate *d; 00133 }; 00134 00135 00136 #ifndef QT_NO_COMPAT 00137 00138 inline QStringList QFontDatabase::families( bool ) const 00139 { 00140 return families(); 00141 } 00142 00143 inline QStringList QFontDatabase::styles( const QString &family, 00144 const QString & ) const 00145 { 00146 return styles(family); 00147 } 00148 00149 inline QValueList<int> QFontDatabase::pointSizes( const QString &family, 00150 const QString &style , 00151 const QString & ) 00152 { 00153 return pointSizes(family, style); 00154 } 00155 00156 inline QValueList<int> QFontDatabase::smoothSizes( const QString &family, 00157 const QString &style, 00158 const QString & ) 00159 { 00160 return smoothSizes(family, style); 00161 } 00162 00163 inline QFont QFontDatabase::font( const QString &familyName, 00164 const QString &style, 00165 int pointSize, 00166 const QString &) 00167 { 00168 return font(familyName, style, pointSize); 00169 } 00170 00171 inline bool QFontDatabase::isBitmapScalable( const QString &family, 00172 const QString &style, 00173 const QString & ) const 00174 { 00175 return isBitmapScalable(family, style); 00176 } 00177 00178 inline bool QFontDatabase::isSmoothlyScalable( const QString &family, 00179 const QString &style, 00180 const QString & ) const 00181 { 00182 return isSmoothlyScalable(family, style); 00183 } 00184 00185 inline bool QFontDatabase::isScalable( const QString &family, 00186 const QString &style, 00187 const QString & ) const 00188 { 00189 return isScalable(family, style); 00190 } 00191 00192 inline bool QFontDatabase::isFixedPitch( const QString &family, 00193 const QString &style, 00194 const QString & ) const 00195 { 00196 return isFixedPitch(family, style); 00197 } 00198 00199 inline bool QFontDatabase::italic( const QString &family, 00200 const QString &style, 00201 const QString & ) const 00202 { 00203 return italic(family, style); 00204 } 00205 00206 inline bool QFontDatabase::bold( const QString &family, 00207 const QString &style, 00208 const QString & ) const 00209 { 00210 return bold(family, style); 00211 } 00212 00213 inline int QFontDatabase::weight( const QString &family, 00214 const QString &style, 00215 const QString & ) const 00216 { 00217 return weight(family, style); 00218 } 00219 00220 #endif // QT_NO_COMPAT 00221 00222 #endif // QT_NO_FONTDATABASE 00223 00224 #endif // QFONTDATABASE_H