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

  1. /****************************************************************************
  2. ** $Id:  qt/qfontcodecs_p.h   3.0.0   edited Jul 26 08:56 $
  3. **
  4. ** Font utilities for X11
  5. **
  6. ** Created : 20001101
  7. **
  8. ** Copyright (C) 1992-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 QFONTCODECS_P_H
  39. #define QFONTCODECS_P_H
  40.  
  41. //
  42. //  W A R N I N G
  43. //  -------------
  44. //
  45. // This file is not part of the Qt API.  It exists for the convenience
  46. // of qfontencodings_x11.cpp and qfont_x11.cpp.  This header file may
  47. // change from version to version without notice, or even be removed.
  48. //
  49. // We mean it.
  50. //
  51. //
  52.  
  53. #ifndef QT_H
  54. #include <qglobal.h>
  55. #include <qtextcodec.h>
  56. #endif // QT_H
  57.  
  58.  
  59. #ifndef QT_NO_CODECS
  60. #ifndef QT_NO_BIG_CODECS
  61.  
  62.  
  63. class QJpUnicodeConv;
  64.  
  65.  
  66. class QFontJis0208Codec : public QTextCodec
  67. {
  68. public:
  69.     QFontJis0208Codec();
  70.     ~QFontJis0208Codec();
  71.  
  72.     // Return the official name for the encoding.
  73.     const char* name() const ;
  74.  
  75.     // Return the MIB enum for the encoding if it is listed in the
  76.     // IANA character-sets encoding file.
  77.     int mibEnum() const ;
  78.  
  79.     // Converts len characters from chars to Unicode.
  80.     QString toUnicode(const char* chars, int len) const ;
  81.  
  82.     // Converts lenInOut characters (of type QChar) from the start of
  83.     // the string uc, returning a QCString result, and also returning
  84.     // the length of the result in lenInOut.
  85.     QCString fromUnicode(const QString& uc, int& lenInOut ) const;
  86.  
  87.     int heuristicContentMatch(const char *, int) const;
  88.     bool canEncode( QChar ) const;
  89.  
  90.  
  91. private:
  92.     QJpUnicodeConv *convJP;
  93. };
  94.  
  95.  
  96.  
  97.  
  98. class QFontKsc5601Codec : public QTextCodec
  99. {
  100. public:
  101.     QFontKsc5601Codec();
  102.  
  103.     // Return the official name for the encoding.
  104.     const char* name() const ;
  105.  
  106.     // Return the MIB enum for the encoding if it is listed in the
  107.     // IANA character-sets encoding file.
  108.     int mibEnum() const ;
  109.  
  110.     // Converts len characters from chars to Unicode.
  111.     QString toUnicode(const char* chars, int len) const ;
  112.  
  113.     // Converts lenInOut characters (of type QChar) from the start of
  114.     // the string uc, returning a QCString result, and also returning
  115.     // the length of the result in lenInOut.
  116.     QCString fromUnicode(const QString& uc, int& lenInOut ) const;
  117.  
  118.     int heuristicContentMatch(const char *, int) const;
  119.     bool canEncode( QChar ) const;
  120. };
  121.  
  122.  
  123.  
  124.  
  125. class QFontGB2312Codec : public QTextCodec
  126. {
  127. public:
  128.     QFontGB2312Codec();
  129.  
  130.     // Return the official name for the encoding.
  131.     const char* name() const ;
  132.  
  133.     // Return the MIB enum for the encoding if it is listed in the
  134.     // IANA character-sets encoding file.
  135.     int mibEnum() const ;
  136.  
  137.     // Converts len characters from chars to Unicode.
  138.     QString toUnicode(const char* chars, int len) const ;
  139.  
  140.     // Converts lenInOut characters (of type QChar) from the start of
  141.     // the string uc, returning a QCString result, and also returning
  142.     // the length of the result in lenInOut.
  143.     QCString fromUnicode(const QString& uc, int& lenInOut ) const;
  144.  
  145.     int heuristicContentMatch(const char *, int) const;
  146.     bool canEncode( QChar ) const;
  147. };
  148.  
  149.  
  150.  
  151.  
  152. class QFontBig5Codec : public QTextCodec
  153. {
  154. public:
  155.     QFontBig5Codec();
  156.  
  157.     // Return the official name for the encoding.
  158.     const char* name() const ;
  159.  
  160.     // Return the MIB enum for the encoding if it is listed in the
  161.     // IANA character-sets encoding file.
  162.     int mibEnum() const ;
  163.  
  164.     // Converts len characters from chars to Unicode.
  165.     QString toUnicode(const char* chars, int len) const ;
  166.  
  167.     // Converts lenInOut characters (of type QChar) from the start of
  168.     // the string uc, returning a QCString result, and also returning
  169.     // the length of the result in lenInOut.
  170.     QCString fromUnicode(const QString& uc, int& lenInOut ) const;
  171.  
  172.     int heuristicContentMatch(const char *, int) const;
  173.     bool canEncode( QChar ) const;
  174. };
  175.  
  176.  
  177.  
  178.  
  179. // ------------------------------------------------------------------
  180. // the shaping codec for iso8859-6.8x fonts (see www.langbox.com)
  181.  
  182. class QFontArabic68Codec : public QTextCodec
  183. {
  184. public:
  185.     QFontArabic68Codec();
  186.  
  187.     // Return the official name for the encoding.
  188.     const char* name() const ;
  189.  
  190.     // Return the MIB enum for the encoding if it is listed in the
  191.     // IANA character-sets encoding file.
  192.     int mibEnum() const ;
  193.  
  194.     // Converts len characters from chars to Unicode.
  195.     QString toUnicode(const char* chars, int len) const ;
  196.  
  197.     // Converts lenInOut characters (of type QChar) from the start of
  198.     // the string uc, returning a QCString result, and also returning
  199.     // the length of the result in lenInOut.
  200.     QCString fromUnicode(const QString& uc, int& lenInOut ) const;
  201.  
  202.     int heuristicContentMatch(const char *, int) const;
  203.     QByteArray fromUnicode( const QString &str, int from, int len ) const;
  204.     unsigned short characterFromUnicode(const QString &str, int pos) const;
  205. };
  206.  
  207.  
  208. #endif // QT_NO_BIG_CODECS
  209. #endif // QT_NO_CODECS
  210.  
  211. #endif // QFONTCODECS_P_H
  212.