~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to src/plugins/codecs/cn/qgb18030codec.h

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-08-24 04:09:09 UTC
  • Revision ID: james.westby@ubuntu.com-20050824040909-xmxe9jfr4a0w5671
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/****************************************************************************
 
2
**
 
3
** Copyright (C) 1992-2005 Trolltech AS. All rights reserved.
 
4
**
 
5
** This file is part of the internationalization module of the Qt Toolkit.
 
6
**
 
7
** This file may be distributed under the terms of the Q Public License
 
8
** as defined by Trolltech AS of Norway and appearing in the file
 
9
** LICENSE.QPL included in the packaging of this file.
 
10
**
 
11
** This file may be distributed and/or modified under the terms of the
 
12
** GNU General Public License version 2 as published by the Free Software
 
13
** Foundation and appearing in the file LICENSE.GPL included in the
 
14
** packaging of this file.
 
15
**
 
16
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
 
17
**   information about Qt Commercial License Agreements.
 
18
** See http://www.trolltech.com/qpl/ for QPL licensing information.
 
19
** See http://www.trolltech.com/gpl/ for GPL licensing information.
 
20
**
 
21
** Contact info@trolltech.com if any conditions of this licensing are
 
22
** not clear to you.
 
23
**
 
24
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
 
25
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 
26
**
 
27
****************************************************************************/
 
28
 
 
29
// Contributed by James Su <suzhe@gnuchina.org>
 
30
 
 
31
#ifndef QGB18030CODEC_H
 
32
#define QGB18030CODEC_H
 
33
 
 
34
#include "qtextcodec.h"
 
35
#include "qlist.h"
 
36
 
 
37
class QGb18030Codec : public QTextCodec {
 
38
public:
 
39
    QGb18030Codec();
 
40
 
 
41
    static QByteArray _name() { return "GB18030"; }
 
42
    static QList<QByteArray> _aliases() { return QList<QByteArray>(); }
 
43
    static int _mibEnum() { return 114; }
 
44
 
 
45
    QByteArray name() const { return _name(); }
 
46
    QList<QByteArray> aliases() const { return _aliases(); }
 
47
    int mibEnum() const { return _mibEnum(); }
 
48
 
 
49
    QString convertToUnicode(const char *, int, ConverterState *) const;
 
50
    QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const;
 
51
};
 
52
 
 
53
class QGbkCodec : public QGb18030Codec {
 
54
public:
 
55
    QGbkCodec();
 
56
 
 
57
    static QByteArray _name();
 
58
    static QList<QByteArray> _aliases();
 
59
    static int _mibEnum();
 
60
 
 
61
    QByteArray name() const { return _name(); }
 
62
    QList<QByteArray> aliases() const { return _aliases(); }
 
63
    int mibEnum() const { return _mibEnum(); }
 
64
 
 
65
    QString convertToUnicode(const char *, int, ConverterState *) const;
 
66
    QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const;
 
67
};
 
68
 
 
69
class QGb2312Codec : public QGb18030Codec {
 
70
public:
 
71
    QGb2312Codec();
 
72
 
 
73
    static QByteArray _name();
 
74
    static QList<QByteArray> _aliases() { return QList<QByteArray>(); }
 
75
    static int _mibEnum();
 
76
 
 
77
    QByteArray name() const { return _name(); }
 
78
    int mibEnum() const { return _mibEnum(); }
 
79
 
 
80
    QString convertToUnicode(const char *, int, ConverterState *) const;
 
81
    QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const;
 
82
};
 
83
 
 
84
#ifdef Q_WS_X11
 
85
 
 
86
class QFontGb2312Codec : public QTextCodec
 
87
{
 
88
public:
 
89
    QFontGb2312Codec();
 
90
 
 
91
    static QByteArray _name();
 
92
    static QList<QByteArray> _aliases() { return QList<QByteArray>(); }
 
93
    static int _mibEnum();
 
94
 
 
95
    QByteArray name() const { return _name(); }
 
96
    int mibEnum() const { return _mibEnum(); }
 
97
 
 
98
    QString convertToUnicode(const char *, int, ConverterState *) const;
 
99
    QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const;
 
100
};
 
101
 
 
102
 
 
103
class QFontGbkCodec : public QTextCodec
 
104
{
 
105
public:
 
106
    QFontGbkCodec();
 
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
    QList<QByteArray> aliases() const { return _aliases(); }
 
114
    int mibEnum() const { return _mibEnum(); }
 
115
 
 
116
    QString convertToUnicode(const char *, int, ConverterState *) const;
 
117
    QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const;
 
118
};
 
119
 
 
120
class QFontGb18030_0Codec : public QTextCodec
 
121
{
 
122
public:
 
123
    QFontGb18030_0Codec();
 
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
 
 
137
#endif // Q_WS_X11
 
138
 
 
139
#endif // QGB18030CODEC_H