source: trunk/src/plugins/codecs/cn/qgb18030codec.h@ 1168

Last change on this file since 1168 was 846, checked in by Dmitry A. Kuminov, 14 years ago

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

File size: 5.1 KB
Line 
1/****************************************************************************
2**
3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
4** All rights reserved.
5** Contact: Nokia Corporation ([email protected])
6**
7** This file is part of the plugins of the Qt Toolkit.
8**
9** $QT_BEGIN_LICENSE:LGPL$
10** Commercial Usage
11** Licensees holding valid Qt Commercial licenses may use this file in
12** accordance with the Qt Commercial License Agreement provided with the
13** Software or, alternatively, in accordance with the terms contained in
14** a written agreement between you and Nokia.
15**
16** GNU Lesser General Public License Usage
17** Alternatively, this file may be used under the terms of the GNU Lesser
18** General Public License version 2.1 as published by the Free Software
19** Foundation and appearing in the file LICENSE.LGPL included in the
20** packaging of this file. Please review the following information to
21** ensure the GNU Lesser General Public License version 2.1 requirements
22** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
23**
24** In addition, as a special exception, Nokia gives you certain additional
25** rights. These rights are described in the Nokia Qt LGPL Exception
26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
27**
28** GNU General Public License Usage
29** Alternatively, this file may be used under the terms of the GNU
30** General Public License version 3.0 as published by the Free Software
31** Foundation and appearing in the file LICENSE.GPL included in the
32** packaging of this file. Please review the following information to
33** ensure the GNU General Public License version 3.0 requirements will be
34** met: http://www.gnu.org/copyleft/gpl.html.
35**
36** If you have questions regarding the use of this file, please contact
37** Nokia at [email protected].
38** $QT_END_LICENSE$
39**
40****************************************************************************/
41
42// Contributed by James Su <[email protected]>
43
44#ifndef QGB18030CODEC_H
45#define QGB18030CODEC_H
46
47#include <QtCore/qtextcodec.h>
48#include <QtCore/qlist.h>
49
50QT_BEGIN_NAMESPACE
51
52#ifndef QT_NO_TEXTCODEC
53
54class QGb18030Codec : public QTextCodec {
55public:
56 QGb18030Codec();
57
58 static QByteArray _name() { return "GB18030"; }
59 static QList<QByteArray> _aliases() { return QList<QByteArray>(); }
60 static int _mibEnum() { return 114; }
61
62 QByteArray name() const { return _name(); }
63 QList<QByteArray> aliases() const { return _aliases(); }
64 int mibEnum() const { return _mibEnum(); }
65
66 QString convertToUnicode(const char *, int, ConverterState *) const;
67 QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const;
68};
69
70class QGbkCodec : public QGb18030Codec {
71public:
72 QGbkCodec();
73
74 static QByteArray _name();
75 static QList<QByteArray> _aliases();
76 static int _mibEnum();
77
78 QByteArray name() const { return _name(); }
79 QList<QByteArray> aliases() const { return _aliases(); }
80 int mibEnum() const { return _mibEnum(); }
81
82 QString convertToUnicode(const char *, int, ConverterState *) const;
83 QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const;
84};
85
86class QGb2312Codec : public QGb18030Codec {
87public:
88 QGb2312Codec();
89
90 static QByteArray _name();
91 static QList<QByteArray> _aliases() { return QList<QByteArray>(); }
92 static int _mibEnum();
93
94 QByteArray name() const { return _name(); }
95 int mibEnum() const { return _mibEnum(); }
96
97 QString convertToUnicode(const char *, int, ConverterState *) const;
98 QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const;
99};
100
101#ifdef Q_WS_X11
102
103class QFontGb2312Codec : public QTextCodec
104{
105public:
106 QFontGb2312Codec();
107
108 static QByteArray _name();
109 static QList<QByteArray> _aliases() { return QList<QByteArray>(); }
110 static int _mibEnum();
111
112 QByteArray name() const { return _name(); }
113 int mibEnum() const { return _mibEnum(); }
114
115 QString convertToUnicode(const char *, int, ConverterState *) const;
116 QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const;
117};
118
119
120class QFontGbkCodec : public QTextCodec
121{
122public:
123 QFontGbkCodec();
124
125 static QByteArray _name();
126 static QList<QByteArray> _aliases() { return QList<QByteArray>(); }
127 static int _mibEnum();
128
129 QByteArray name() const { return _name(); }
130 QList<QByteArray> aliases() const { return _aliases(); }
131 int mibEnum() const { return _mibEnum(); }
132
133 QString convertToUnicode(const char *, int, ConverterState *) const;
134 QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const;
135};
136
137class QFontGb18030_0Codec : public QTextCodec
138{
139public:
140 QFontGb18030_0Codec();
141
142 static QByteArray _name();
143 static QList<QByteArray> _aliases() { return QList<QByteArray>(); }
144 static int _mibEnum();
145
146 QByteArray name() const { return _name(); }
147 QList<QByteArray> aliases() const { return _aliases(); }
148 int mibEnum() const { return _mibEnum(); }
149
150 QString convertToUnicode(const char *, int, ConverterState *) const;
151 QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const;
152};
153#endif // Q_WS_X11
154
155#endif // QT_NO_TEXTCODEC
156
157QT_END_NAMESPACE
158
159#endif // QGB18030CODEC_H
Note: See TracBrowser for help on using the repository browser.