qutf7codecplugin.cpp
00001 /* 00002 qutf7codecplugin.cpp 00003 00004 A TQTextCodec for UTF-7 (rfc2152). 00005 Copyright (c) 2001 Marc Mutz <mutz@kde.org> 00006 See file COPYING for details 00007 00008 This program is free software; you can redistribute it and/or modify 00009 it under the terms of the GNU General Public License, version 2.0, 00010 as published by the Free Software Foundation. 00011 00012 You should have received a copy of the GNU General Public License 00013 along with this program; if not, write to the Free Software 00014 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 00015 02110-1301, US 00016 00017 As a special exception, permission is granted to use this plugin 00018 with any version of TQt by TrollTech AS, Norway. In this case, the 00019 use of this plugin doesn't cause the resulting executable to be 00020 covered by the GNU General Public License. 00021 This exception does not however invalidate any other reasons why the 00022 executable file might be covered by the GNU General Public License. 00023 */ 00024 00025 #include "qutf7codec.h" 00026 00027 #include <tqtextcodecplugin.h> 00028 #include <tqstring.h> 00029 #include <tqstringlist.h> 00030 #include <tqvaluelist.h> 00031 00032 class TQTextCodec; 00033 00034 // ######### This file isn't compiled currently 00035 00036 class TQUtf7CodecPlugin : public TQTextCodecPlugin { 00037 public: 00038 TQUtf7CodecPlugin() {} 00039 00040 TQStringList names() const { return TQStringList() << "UTF-7" << "X-QT-UTF-7-STRICT"; } 00041 TQValueList<int> mibEnums() const { return TQValueList<int>() << 1012 << -1012; } 00042 TQTextCodec * createForMib( int ); 00043 TQTextCodec * createForName( const TQString & ); 00044 }; 00045 00046 TQTextCodec * TQUtf7CodecPlugin::createForMib( int mib ) { 00047 if ( mib == 1012 ) 00048 return new TQUtf7Codec(); 00049 else if ( mib == -1012 ) 00050 return new TQStrictUtf7Codec(); 00051 return 0; 00052 } 00053 00054 TQTextCodec * TQUtf7CodecPlugin::createForName( const TQString & name ) { 00055 if ( name == "UTF-7" ) 00056 return new TQUtf7Codec(); 00057 else if ( name == "X-QT-UTF-7-STRICT" ) 00058 return new TQStrictUtf7Codec(); 00059 return 0; 00060 } 00061 00062 KDE_TQ_EXPORT_PLUGIN( TQUtf7CodecPlugin );