source: trunk/plugins/src/codecs/tw/main.cpp

Last change on this file was 204, checked in by rudi, 14 years ago

Added plugin source code

File size: 937 bytes
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
9class TWTextCodecs : public QTextCodecPlugin
10{
11public:
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
20QTextCodec *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
35QTextCodec *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
46Q_EXPORT_PLUGIN( TWTextCodecs );
47
Note: See TracBrowser for help on using the repository browser.