summaryrefslogtreecommitdiffstats
path: root/libkdepim/qutf7codecplugin.cpp
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit460c52653ab0dcca6f19a4f492ed2c5e4e963ab0 (patch)
tree67208f7c145782a7e90b123b982ca78d88cc2c87 /libkdepim/qutf7codecplugin.cpp
downloadtdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.tar.gz
tdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libkdepim/qutf7codecplugin.cpp')
-rw-r--r--libkdepim/qutf7codecplugin.cpp62
1 files changed, 62 insertions, 0 deletions
diff --git a/libkdepim/qutf7codecplugin.cpp b/libkdepim/qutf7codecplugin.cpp
new file mode 100644
index 00000000..54fb68c5
--- /dev/null
+++ b/libkdepim/qutf7codecplugin.cpp
@@ -0,0 +1,62 @@
+/*
+ qutf7codecplugin.cpp
+
+ A QTextCodec for UTF-7 (rfc2152).
+ Copyright (c) 2001 Marc Mutz <mutz@kde.org>
+ See file COPYING for details
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, US
+
+ As a special exception, permission is granted to use this plugin
+ with any version of Qt by TrollTech AS, Norway. In this case, the
+ use of this plugin doesn't cause the resulting executable to be
+ covered by the GNU General Public License.
+ This exception does not however invalidate any other reasons why the
+ executable file might be covered by the GNU General Public License.
+*/
+
+#include "qutf7codec.h"
+
+#include <qtextcodecplugin.h>
+#include <qstring.h>
+#include <qstringlist.h>
+#include <qvaluelist.h>
+
+class QTextCodec;
+
+// ######### This file isn't compiled currently
+
+class QUtf7CodecPlugin : public QTextCodecPlugin {
+public:
+ QUtf7CodecPlugin() {}
+
+ QStringList names() const { return QStringList() << "UTF-7" << "X-QT-UTF-7-STRICT"; }
+ QValueList<int> mibEnums() const { return QValueList<int>() << 1012 << -1012; }
+ QTextCodec * createForMib( int );
+ QTextCodec * createForName( const QString & );
+};
+
+QTextCodec * QUtf7CodecPlugin::createForMib( int mib ) {
+ if ( mib == 1012 )
+ return new QUtf7Codec();
+ else if ( mib == -1012 )
+ return new QStrictUtf7Codec();
+ return 0;
+}
+
+QTextCodec * QUtf7CodecPlugin::createForName( const QString & name ) {
+ if ( name == "UTF-7" )
+ return new QUtf7Codec();
+ else if ( name == "X-QT-UTF-7-STRICT" )
+ return new QStrictUtf7Codec();
+ return 0;
+}
+
+KDE_Q_EXPORT_PLUGIN( QUtf7CodecPlugin );