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

Last change on this file since 187 was 2, checked in by Dmitry A. Kuminov, 16 years ago

Initially imported qt-all-opensource-src-4.5.1 from Trolltech.

File size: 5.1 KB
Line 
1/****************************************************************************
2**
3** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
4** Contact: Qt Software Information ([email protected])
5**
6** This file is part of the plugins of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:LGPL$
9** Commercial Usage
10** Licensees holding valid Qt Commercial licenses may use this file in
11** accordance with the Qt Commercial License Agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and Nokia.
14**
15** GNU Lesser General Public License Usage
16** Alternatively, this file may be used under the terms of the GNU Lesser
17** General Public License version 2.1 as published by the Free Software
18** Foundation and appearing in the file LICENSE.LGPL included in the
19** packaging of this file. Please review the following information to
20** ensure the GNU Lesser General Public License version 2.1 requirements
21** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
22**
23** In addition, as a special exception, Nokia gives you certain
24** additional rights. These rights are described in the Nokia Qt LGPL
25** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
26** 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 are unsure which license is appropriate for your use, please
37** contact the sales department 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.