Line | |
---|
1 | #include <qtextcodecplugin.h>
|
---|
2 | #include <qtextcodec.h>
|
---|
3 | #include <qptrlist.h>
|
---|
4 |
|
---|
5 | #include <qbig5codec.h>
|
---|
6 | #include <private/qfontcodecs_p.h>
|
---|
7 |
|
---|
8 |
|
---|
9 | class TWTextCodecs : public QTextCodecPlugin
|
---|
10 | {
|
---|
11 | public:
|
---|
12 | TWTextCodecs() {}
|
---|
13 |
|
---|
14 | QStringList names() const { return QStringList() << "Big5" << "big5*-0"; }
|
---|
15 | QValueList<int> mibEnums() const { return QValueList<int>() << 2026 << -2026; }
|
---|
16 | QTextCodec *createForMib( int );
|
---|
17 | QTextCodec *createForName( const QString & );
|
---|
18 | };
|
---|
19 |
|
---|
20 | QTextCodec *TWTextCodecs::createForMib( int mib )
|
---|
21 | {
|
---|
22 | switch (mib) {
|
---|
23 | case -2026:
|
---|
24 | return new QFontBig5Codec;
|
---|
25 | case 2026:
|
---|
26 | return new QBig5Codec;
|
---|
27 | default:
|
---|
28 | ;
|
---|
29 | }
|
---|
30 |
|
---|
31 | return 0;
|
---|
32 | }
|
---|
33 |
|
---|
34 |
|
---|
35 | QTextCodec *TWTextCodecs::createForName( const QString &name )
|
---|
36 | {
|
---|
37 | if (name == "Big5")
|
---|
38 | return new QBig5Codec;
|
---|
39 | if (name == "big5*-0")
|
---|
40 | return new QFontBig5Codec;
|
---|
41 |
|
---|
42 | return 0;
|
---|
43 | }
|
---|
44 |
|
---|
45 |
|
---|
46 | Q_EXPORT_PLUGIN( TWTextCodecs );
|
---|
47 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.