Eneboo - Documentación para desarrolladores
|
00001 /**************************************************************************** 00002 ** $Id: qt/qgb18030codec.h 3.3.8 edited Jan 11 14:37 $ 00003 ** 00004 ** Definition of QGb18030Codec class 00005 ** 00006 ** Copyright (C) 1992-2007 Trolltech ASA. All rights reserved. 00007 ** 00008 ** This file is part of the tools module of the Qt GUI Toolkit. 00009 ** 00010 ** This file may be distributed under the terms of the Q Public License 00011 ** as defined by Trolltech ASA of Norway and appearing in the file 00012 ** LICENSE.QPL included in the packaging of this file. 00013 ** 00014 ** This file may be distributed and/or modified under the terms of the 00015 ** GNU General Public License version 2 as published by the Free Software 00016 ** Foundation and appearing in the file LICENSE.GPL included in the 00017 ** packaging of this file. 00018 ** 00019 ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition 00020 ** licenses may use this file in accordance with the Qt Commercial License 00021 ** Agreement provided with the Software. 00022 ** 00023 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 00024 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00025 ** 00026 ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 00027 ** information about Qt Commercial License Agreements. 00028 ** See http://www.trolltech.com/qpl/ for QPL licensing information. 00029 ** See http://www.trolltech.com/gpl/ for GPL licensing information. 00030 ** 00031 ** Contact info@trolltech.com if any conditions of this licensing are 00032 ** not clear to you. 00033 ** 00034 **********************************************************************/ 00035 00036 // Contributed by James Su <suzhe@gnuchina.org> 00037 00038 #ifndef QGB18030CODEC_H 00039 #define QGB18030CODEC_H 00040 00041 #ifndef QT_H 00042 #include "qtextcodec.h" 00043 #endif // QT_H 00044 00045 00046 #ifndef QT_NO_BIG_CODECS 00047 00048 #if defined(QT_PLUGIN) 00049 #define Q_EXPORT_CODECS_CN 00050 #else 00051 #define Q_EXPORT_CODECS_CN Q_EXPORT 00052 #endif 00053 00054 class Q_EXPORT_CODECS_CN QGb18030Codec : public QTextCodec { 00055 public: 00056 QGb18030Codec(); 00057 00058 int mibEnum() const; 00059 const char* name() const; 00060 00061 QTextDecoder* makeDecoder() const; 00062 00063 #if !defined(Q_NO_USING_KEYWORD) 00064 using QTextCodec::fromUnicode; 00065 #endif 00066 QCString fromUnicode(const QString& uc, int& lenInOut) const; 00067 QString toUnicode(const char* chars, int len) const; 00068 00069 int heuristicContentMatch(const char* chars, int len) const; 00070 int heuristicNameMatch(const char* hint) const; 00071 }; 00072 00073 class Q_EXPORT_CODECS_CN QGbkCodec : public QGb18030Codec { 00074 public: 00075 QGbkCodec(); 00076 00077 int mibEnum() const; 00078 const char* name() const; 00079 00080 QTextDecoder* makeDecoder() const; 00081 00082 #if !defined(Q_NO_USING_KEYWORD) 00083 using QGb18030Codec::fromUnicode; 00084 #endif 00085 QCString fromUnicode(const QString& uc, int& lenInOut) const; 00086 QString toUnicode(const char* chars, int len) const; 00087 00088 int heuristicContentMatch(const char* chars, int len) const; 00089 int heuristicNameMatch(const char* hint) const; 00090 }; 00091 00092 class Q_EXPORT_CODECS_CN QGb2312Codec : public QGb18030Codec { 00093 public: 00094 QGb2312Codec(); 00095 00096 int mibEnum() const; 00097 const char* name() const; 00098 00099 QTextDecoder* makeDecoder() const; 00100 00101 #if !defined(Q_NO_USING_KEYWORD) 00102 using QGb18030Codec::fromUnicode; 00103 #endif 00104 QCString fromUnicode(const QString& uc, int& lenInOut) const; 00105 QString toUnicode(const char* chars, int len) const; 00106 00107 int heuristicContentMatch(const char* chars, int len) const; 00108 int heuristicNameMatch(const char* hint) const; 00109 }; 00110 00111 #endif 00112 #endif