From dda8474928bd7276e1fad8fb7a601e7c83ff2bc2 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sun, 10 Jul 2011 15:17:53 -0500 Subject: Added TQt4 HEAD --- tqtinterface/qt4/plugins/src/codecs/jp/main.cpp | 56 +++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 tqtinterface/qt4/plugins/src/codecs/jp/main.cpp (limited to 'tqtinterface/qt4/plugins/src/codecs/jp/main.cpp') diff --git a/tqtinterface/qt4/plugins/src/codecs/jp/main.cpp b/tqtinterface/qt4/plugins/src/codecs/jp/main.cpp new file mode 100644 index 0000000..8b0f8f9 --- /dev/null +++ b/tqtinterface/qt4/plugins/src/codecs/jp/main.cpp @@ -0,0 +1,56 @@ +#include +#include +#include + +#include +#include +#include +#include + + +class JPTextCodecs : public TQTextCodecPlugin +{ +public: + JPTextCodecs() {} + + TQStringList names() const { return TQStringList() << "eucJP" << "JIS7" << "SJIS" << "jisx0208.1983-0"; } + TQValueList mibEnums() const { return TQValueList() << 16 << 17 << 18 << 63; } + TQTextCodec *createForMib( int ); + TQTextCodec *createForName( const TQString & ); +}; + +TQTextCodec *JPTextCodecs::createForMib( int mib ) +{ + switch (mib) { + case 16: + return new TQJisCodec; + case 17: + return new TQSjisCodec; + case 18: + return new TQEucJpCodec; + case 63: + return new TQFontJis0208Codec; + default: + ; + } + + return 0; +} + + +TQTextCodec *JPTextCodecs::createForName( const TQString &name ) +{ + if (name == "JIS7") + return new TQJisCodec; + if (name == "SJIS") + return new TQSjisCodec; + if (name == "eucJP") + return new TQEucJpCodec; + if (name == "jisx0208.1983-0") + return new TQFontJis0208Codec; + + return 0; +} + + +TQ_EXPORT_PLUGIN( JPTextCodecs ); -- cgit v1.2.1