libtdepim

qutf7codecplugin.cpp
1/*
2 qutf7codecplugin.cpp
3
4 A TQTextCodec for UTF-7 (rfc2152).
5 Copyright (c) 2001 Marc Mutz <mutz@kde.org>
6 See file COPYING for details
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License, version 2.0,
10 as published by the Free Software Foundation.
11
12 You should have received a copy of the GNU General Public License
13 along with this program; if not, write to the Free Software
14 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
15 02110-1301, US
16
17 As a special exception, permission is granted to use this plugin
18 with any version of TQt by TrollTech AS, Norway. In this case, the
19 use of this plugin doesn't cause the resulting executable to be
20 covered by the GNU General Public License.
21 This exception does not however invalidate any other reasons why the
22 executable file might be covered by the GNU General Public License.
23*/
24
25#include "qutf7codec.h"
26
27#include <tqtextcodecplugin.h>
28#include <tqstring.h>
29#include <tqstringlist.h>
30#include <tqvaluelist.h>
31
32class TQTextCodec;
33
34// ######### This file isn't compiled currently
35
36class TQUtf7CodecPlugin : public TQTextCodecPlugin {
37public:
38 TQUtf7CodecPlugin() {}
39
40 TQStringList names() const { return TQStringList() << "UTF-7" << "X-QT-UTF-7-STRICT"; }
41 TQValueList<int> mibEnums() const { return TQValueList<int>() << 1012 << -1012; }
42 TQTextCodec * createForMib( int );
43 TQTextCodec * createForName( const TQString & );
44};
45
46TQTextCodec * TQUtf7CodecPlugin::createForMib( int mib ) {
47 if ( mib == 1012 )
48 return new TQUtf7Codec();
49 else if ( mib == -1012 )
50 return new TQStrictUtf7Codec();
51 return 0;
52}
53
54TQTextCodec * TQUtf7CodecPlugin::createForName( const TQString & name ) {
55 if ( name == "UTF-7" )
56 return new TQUtf7Codec();
57 else if ( name == "X-QT-UTF-7-STRICT" )
58 return new TQStrictUtf7Codec();
59 return 0;
60}
61
62TDE_EXPORT_PLUGIN( TQUtf7CodecPlugin );
This is a version of TQUtf7Codec, which should only be used in MIME transfer.
Definition: qutf7codec.h:84
A TQTextCodec for the UTF-7 transformation of Unicode.
Definition: qutf7codec.h:48