Qt 4.8
main.cpp
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the plugins of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #include <qtextcodecplugin.h>
43 #include <qtextcodec.h>
44 #include <qstringlist.h>
45 
46 #ifndef QT_NO_TEXTCODECPLUGIN
47 
48 #include "qbig5codec.h"
49 
51 
53 {
54 public:
56 
57  QList<QByteArray> names() const;
58  QList<QByteArray> aliases() const;
59  QList<int> mibEnums() const;
60 
63 };
64 
66 {
67  QList<QByteArray> list;
68  list += QBig5Codec::_name();
69  list += QBig5hkscsCodec::_name();
70 #ifdef Q_WS_X11
71  list += QFontBig5Codec::_name();
73 #endif
74  return list;
75 }
76 
78 {
79  QList<QByteArray> list;
80  list += QBig5Codec::_aliases();
81  list += QBig5hkscsCodec::_aliases();
82 #ifdef Q_WS_X11
83  list += QFontBig5Codec::_aliases();
85 #endif
86  return list;
87 }
88 
90 {
91  QList<int> list;
92  list += QBig5Codec::_mibEnum();
93  list += QBig5hkscsCodec::_mibEnum();
94 #ifdef Q_WS_X11
95  list += QFontBig5Codec::_mibEnum();
97 #endif
98  return list;
99 }
100 
102 {
103  if (mib == QBig5Codec::_mibEnum())
104  return new QBig5Codec;
105  if (mib == QBig5hkscsCodec::_mibEnum())
106  return new QBig5hkscsCodec;
107 #ifdef Q_WS_X11
108  if (mib == QFontBig5hkscsCodec::_mibEnum())
109  return new QFontBig5hkscsCodec;
110  if (mib == QFontBig5Codec::_mibEnum())
111  return new QFontBig5Codec;
112 #endif
113  return 0;
114 }
115 
116 
118 {
119  if (name == QBig5Codec::_name() || QBig5Codec::_aliases().contains(name))
120  return new QBig5Codec;
121  if (name == QBig5hkscsCodec::_name() || QBig5hkscsCodec::_aliases().contains(name))
122  return new QBig5hkscsCodec;
123 #ifdef Q_WS_X11
124  if (name == QFontBig5hkscsCodec::_name() || QFontBig5hkscsCodec::_aliases().contains(name))
125  return new QFontBig5hkscsCodec;
126  if (name == QFontBig5Codec::_name() || QFontBig5Codec::_aliases().contains(name))
127  return new QFontBig5Codec;
128 #endif
129  return 0;
130 }
131 
132 
134 Q_EXPORT_PLUGIN2(qtwcodecs, TWTextCodecs);
135 
136 #endif // QT_NO_TEXTCODECPLUGIN
137 
static QByteArray _name()
static QByteArray _name()
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
The QTextCodecPlugin class provides an abstract base for custom QTextCodec plugins.
TWTextCodecs()
Definition: main.cpp:55
static QByteArray _name()
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
static int _mibEnum()
QTextCodec * createForMib(int)
Creates a QTextCodec object for the mib enum mib.
Definition: main.cpp:101
static int _mibEnum()
static QList< QByteArray > _aliases()
Definition: qbig5codec.h:91
Q_EXPORT_PLUGIN2(qjpcodecs, JPTextCodecs)
Q_EXPORT_STATIC_PLUGIN(JPTextCodecs)
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
const char * name
int mib
static int _mibEnum()
Definition: qbig5codec.cpp:60
QTextCodec * createForName(const QByteArray &)
Creates a QTextCodec object for the codec called name.
Definition: main.cpp:117
QList< QByteArray > names() const
Returns the list of MIME names supported by this plugin.
Definition: main.cpp:65
static QList< QByteArray > _aliases()
Definition: qbig5codec.h:73
QList< int > mibEnums() const
Returns the list of mib enums supported by this plugin.
Definition: main.cpp:89
static QList< QByteArray > _aliases()
static int _mibEnum()
The QTextCodec class provides conversions between text encodings.
Definition: qtextcodec.h:62
QList< QByteArray > aliases() const
Returns the list of aliases supported by this plugin.
Definition: main.cpp:77
static QByteArray _name()
Definition: qbig5codec.cpp:65
static QList< QByteArray > _aliases()
Definition: qbig5codec.h:108