home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / qt3_emx.zip / include / qfontdatabase.h < prev    next >
C/C++ Source or Header  |  2001-10-11  |  7KB  |  223 lines

  1. /****************************************************************************
  2. ** $Id:  qt/qfontdatabase.h   3.0.0   edited Sep 5 07:42 $
  3. **
  4. ** Definition of the QFontDatabase class
  5. **
  6. ** Created : 981126
  7. **
  8. ** Copyright (C) 1999-2000 Trolltech AS.  All rights reserved.
  9. **
  10. ** This file is part of the kernel module of the Qt GUI Toolkit.
  11. **
  12. ** This file may be distributed under the terms of the Q Public License
  13. ** as defined by Trolltech AS of Norway and appearing in the file
  14. ** LICENSE.QPL included in the packaging of this file.
  15. **
  16. ** This file may be distributed and/or modified under the terms of the
  17. ** GNU General Public License version 2 as published by the Free Software
  18. ** Foundation and appearing in the file LICENSE.GPL included in the
  19. ** packaging of this file.
  20. **
  21. ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
  22. ** licenses may use this file in accordance with the Qt Commercial License
  23. ** Agreement provided with the Software.
  24. **
  25. ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
  26. ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  27. **
  28. ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
  29. **   information about Qt Commercial License Agreements.
  30. ** See http://www.trolltech.com/qpl/ for QPL licensing information.
  31. ** See http://www.trolltech.com/gpl/ for GPL licensing information.
  32. **
  33. ** Contact info@trolltech.com if any conditions of this licensing are
  34. ** not clear to you.
  35. **
  36. **********************************************************************/
  37.  
  38. #ifndef QFONTDATABASE_H
  39. #define QFONTDATABASE_H
  40.  
  41. #ifndef QT_H
  42. #include "qwindowdefs.h"
  43. #include "qstring.h"
  44. #include "qstringlist.h"
  45. #include "qfont.h"
  46. #include "qvaluelist.h"
  47. #endif // QT_H
  48.  
  49.  
  50. #ifndef QT_NO_FONTDATABASE
  51.  
  52. class QFontStylePrivate; /* Don't touch! */
  53. class QtFontStyle;
  54. class QtFontFamily;
  55. class QtFontFoundry;
  56. #ifdef Q_WS_QWS
  57. class QDiskFont;
  58. #endif
  59.  
  60. class QFontDatabasePrivate;
  61.  
  62. class Q_EXPORT QFontDatabase
  63. {
  64. public:
  65.     static QValueList<int> standardSizes();
  66.  
  67.     QFontDatabase();
  68.  
  69.     QStringList families() const;
  70.     QStringList styles( const QString & ) const;
  71.     QValueList<int> pointSizes( const QString &, const QString & = QString::null);
  72.     QValueList<int> smoothSizes( const QString &, const QString &);
  73.     QString styleString( const QFont &);
  74.  
  75.     QFont font( const QString &, const QString &, int);
  76.  
  77.     bool isBitmapScalable( const QString &, const QString & = QString::null) const;
  78.     bool isSmoothlyScalable( const QString &, const QString & = QString::null) const;
  79.     bool isScalable( const QString &, const QString & = QString::null) const;
  80.     bool isFixedPitch( const QString &, const QString & = QString::null) const;
  81.  
  82.     bool italic( const QString &, const QString &) const;
  83.     bool bold( const QString &, const QString &) const;
  84.     int weight( const QString &, const QString &) const;
  85.  
  86.     static QString scriptName(QFont::Script);
  87.     static QString scriptSample(QFont::Script);
  88.  
  89. #ifdef Q_WS_QWS
  90.     static void qwsAddDiskFont( QDiskFont *qdf );
  91. #endif
  92.  
  93.     // For source compatibility with < 3.0
  94. #ifndef QT_NO_COMPAT
  95.  
  96.     QStringList families(bool) const;
  97.     QStringList styles( const QString &, const QString & ) const;
  98.     QValueList<int> pointSizes( const QString &, const QString &, const QString & );
  99.     QValueList<int> smoothSizes( const QString &, const QString &, const QString & );
  100.  
  101.     QFont font( const QString &, const QString &, int, const QString &);
  102.  
  103.     bool isBitmapScalable( const QString &, const QString &, const QString & ) const;
  104.     bool isSmoothlyScalable( const QString &, const QString &, const QString & ) const;
  105.     bool isScalable( const QString &, const QString &, const QString & ) const;
  106.     bool isFixedPitch( const QString &, const QString &, const QString & ) const;
  107.  
  108.     bool italic( const QString &, const QString &, const QString & ) const;
  109.     bool bold( const QString &, const QString &, const QString & ) const;
  110.     int weight( const QString &, const QString &, const QString & ) const;
  111.  
  112. #endif // QT_NO_COMPAT
  113.  
  114.  
  115. private:
  116.     static void createDatabase();
  117.  
  118.     static void parseFontName(const QString &, QString &, QString &);
  119.  
  120.     friend class QtFontStyle;
  121.     friend class QtFontFamily;
  122.     friend class QtFontFoundry;
  123.     friend class QFontDatabasePrivate;
  124.     
  125.     // for parseFontName
  126.     friend class QFontPrivate;
  127.     friend class QFontDialog;
  128.     friend QString qt_makePSFontName( const QFont &f, int *listpos = 0, int *ftype = 0 );
  129.  
  130.     QFontDatabasePrivate *d;
  131. };
  132.  
  133.  
  134. #ifndef QT_NO_COMPAT
  135.  
  136. inline QStringList QFontDatabase::families( bool ) const
  137. {
  138.     return families();
  139. }
  140.  
  141. inline QStringList QFontDatabase::styles( const QString &family,
  142.                       const QString & ) const
  143. {
  144.     return styles(family);
  145. }
  146.  
  147. inline QValueList<int> QFontDatabase::pointSizes( const QString &family,
  148.                           const QString &style ,
  149.                           const QString & )
  150. {
  151.     return pointSizes(family, style);
  152. }
  153.  
  154. inline QValueList<int> QFontDatabase::smoothSizes( const QString &family,
  155.                            const QString &style,
  156.                            const QString & )
  157. {
  158.     return smoothSizes(family, style);
  159. }
  160.  
  161. inline QFont QFontDatabase::font( const QString &familyName,
  162.                   const QString &style,
  163.                   int pointSize,
  164.                   const QString &)
  165. {
  166.     return font(familyName, style, pointSize);
  167. }
  168.  
  169. inline bool QFontDatabase::isBitmapScalable( const QString &family,
  170.                          const QString &style,
  171.                          const QString & ) const
  172. {
  173.     return isBitmapScalable(family, style);
  174. }
  175.  
  176. inline bool QFontDatabase::isSmoothlyScalable( const QString &family,
  177.                            const QString &style,
  178.                            const QString & ) const
  179. {
  180.     return isSmoothlyScalable(family, style);
  181. }
  182.  
  183. inline bool QFontDatabase::isScalable( const QString &family,
  184.                        const QString &style,
  185.                        const QString & ) const
  186. {
  187.     return isScalable(family, style);
  188. }
  189.  
  190. inline bool QFontDatabase::isFixedPitch( const QString &family,
  191.                      const QString &style,
  192.                      const QString & ) const
  193. {
  194.     return isFixedPitch(family, style);
  195. }
  196.  
  197. inline bool QFontDatabase::italic( const QString &family,
  198.                    const QString &style,
  199.                    const QString & ) const
  200. {
  201.     return italic(family, style);
  202. }
  203.  
  204. inline bool QFontDatabase::bold( const QString &family,
  205.                  const QString &style,
  206.                  const QString & ) const
  207. {
  208.     return bold(family, style);
  209. }
  210.  
  211. inline int QFontDatabase::weight( const QString &family,
  212.                   const QString &style,
  213.                   const QString & ) const
  214. {
  215.     return weight(family, style);
  216. }
  217.  
  218. #endif // QT_NO_COMPAT
  219.  
  220. #endif // QT_NO_FONTDATABASE
  221.  
  222. #endif // QFONTDATABASE_H
  223.