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