1 | /****************************************************************************
|
---|
2 | ** $Id: qgb18030codec.h 2 2005-11-16 15:49:26Z dmik $
|
---|
3 | **
|
---|
4 | ** Definition of QGb18030Codec class
|
---|
5 | **
|
---|
6 | ** Copyright (C) 1992-2002 Trolltech AS. All rights reserved.
|
---|
7 | **
|
---|
8 | ** This file is part of the tools module of the Qt GUI Toolkit.
|
---|
9 | **
|
---|
10 | ** This file may be distributed under the terms of the Q Public License
|
---|
11 | ** as defined by Trolltech AS of Norway and appearing in the file
|
---|
12 | ** LICENSE.QPL included in the packaging of this file.
|
---|
13 | **
|
---|
14 | ** This file may be distributed and/or modified under the terms of the
|
---|
15 | ** GNU General Public License version 2 as published by the Free Software
|
---|
16 | ** Foundation and appearing in the file LICENSE.GPL included in the
|
---|
17 | ** packaging of this file.
|
---|
18 | **
|
---|
19 | ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
|
---|
20 | ** licenses may use this file in accordance with the Qt Commercial License
|
---|
21 | ** Agreement provided with the Software.
|
---|
22 | **
|
---|
23 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
---|
24 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
---|
25 | **
|
---|
26 | ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
|
---|
27 | ** information about Qt Commercial License Agreements.
|
---|
28 | ** See http://www.trolltech.com/qpl/ for QPL licensing information.
|
---|
29 | ** See http://www.trolltech.com/gpl/ for GPL licensing information.
|
---|
30 | **
|
---|
31 | ** Contact info@trolltech.com if any conditions of this licensing are
|
---|
32 | ** not clear to you.
|
---|
33 | **
|
---|
34 | **********************************************************************/
|
---|
35 |
|
---|
36 | // Contributed by James Su <suzhe@gnuchina.org>
|
---|
37 |
|
---|
38 | #ifndef QGB18030CODEC_H
|
---|
39 | #define QGB18030CODEC_H
|
---|
40 |
|
---|
41 | #ifndef QT_H
|
---|
42 | #include "qtextcodec.h"
|
---|
43 | #endif // QT_H
|
---|
44 |
|
---|
45 |
|
---|
46 | #ifndef QT_NO_BIG_CODECS
|
---|
47 |
|
---|
48 | #if defined(QT_PLUGIN)
|
---|
49 | #define Q_EXPORT_CODECS_CN
|
---|
50 | #else
|
---|
51 | #define Q_EXPORT_CODECS_CN Q_EXPORT
|
---|
52 | #endif
|
---|
53 |
|
---|
54 | class Q_EXPORT_CODECS_CN QGb18030Codec : public QTextCodec {
|
---|
55 | public:
|
---|
56 | QGb18030Codec();
|
---|
57 |
|
---|
58 | int mibEnum() const;
|
---|
59 | const char* name() const;
|
---|
60 |
|
---|
61 | QTextDecoder* makeDecoder() const;
|
---|
62 |
|
---|
63 | #if !defined(Q_NO_USING_KEYWORD)
|
---|
64 | using QTextCodec::fromUnicode;
|
---|
65 | #endif
|
---|
66 | QCString fromUnicode(const QString& uc, int& lenInOut) const;
|
---|
67 | QString toUnicode(const char* chars, int len) const;
|
---|
68 |
|
---|
69 | int heuristicContentMatch(const char* chars, int len) const;
|
---|
70 | int heuristicNameMatch(const char* hint) const;
|
---|
71 | };
|
---|
72 |
|
---|
73 | class Q_EXPORT_CODECS_CN QGbkCodec : public QGb18030Codec {
|
---|
74 | public:
|
---|
75 | QGbkCodec();
|
---|
76 |
|
---|
77 | int mibEnum() const;
|
---|
78 | const char* name() const;
|
---|
79 |
|
---|
80 | QTextDecoder* makeDecoder() const;
|
---|
81 |
|
---|
82 | #if !defined(Q_NO_USING_KEYWORD)
|
---|
83 | using QGb18030Codec::fromUnicode;
|
---|
84 | #endif
|
---|
85 | QCString fromUnicode(const QString& uc, int& lenInOut) const;
|
---|
86 | QString toUnicode(const char* chars, int len) const;
|
---|
87 |
|
---|
88 | int heuristicContentMatch(const char* chars, int len) const;
|
---|
89 | int heuristicNameMatch(const char* hint) const;
|
---|
90 | };
|
---|
91 |
|
---|
92 | class Q_EXPORT_CODECS_CN QGb2312Codec : public QGb18030Codec {
|
---|
93 | public:
|
---|
94 | QGb2312Codec();
|
---|
95 |
|
---|
96 | int mibEnum() const;
|
---|
97 | const char* name() const;
|
---|
98 |
|
---|
99 | QTextDecoder* makeDecoder() const;
|
---|
100 |
|
---|
101 | #if !defined(Q_NO_USING_KEYWORD)
|
---|
102 | using QGb18030Codec::fromUnicode;
|
---|
103 | #endif
|
---|
104 | QCString fromUnicode(const QString& uc, int& lenInOut) const;
|
---|
105 | QString toUnicode(const char* chars, int len) const;
|
---|
106 |
|
---|
107 | int heuristicContentMatch(const char* chars, int len) const;
|
---|
108 | int heuristicNameMatch(const char* hint) const;
|
---|
109 | };
|
---|
110 |
|
---|
111 | #endif
|
---|
112 | #endif
|
---|