Blame qtools/qtextcodec.h

Packit Service 50c9f2
/****************************************************************************
Packit Service 50c9f2
** 
Packit Service 50c9f2
**
Packit Service 50c9f2
** Definition of QTextCodec class
Packit Service 50c9f2
**
Packit Service 50c9f2
** Created : 981015
Packit Service 50c9f2
**
Packit Service 50c9f2
** Copyright (C) 1998-2000 Trolltech AS.  All rights reserved.
Packit Service 50c9f2
**
Packit Service 50c9f2
** This file is part of the tools module of the Qt GUI Toolkit.
Packit Service 50c9f2
**
Packit Service 50c9f2
** This file may be distributed under the terms of the Q Public License
Packit Service 50c9f2
** as defined by Trolltech AS of Norway and appearing in the file
Packit Service 50c9f2
** LICENSE.QPL included in the packaging of this file.
Packit Service 50c9f2
**
Packit Service 50c9f2
** This file may be distributed and/or modified under the terms of the
Packit Service 50c9f2
** GNU General Public License version 2 as published by the Free Software
Packit Service 50c9f2
** Foundation and appearing in the file LICENSE.GPL included in the
Packit Service 50c9f2
** packaging of this file.
Packit Service 50c9f2
**
Packit Service 50c9f2
** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
Packit Service 50c9f2
** licenses may use this file in accordance with the Qt Commercial License
Packit Service 50c9f2
** Agreement provided with the Software.
Packit Service 50c9f2
**
Packit Service 50c9f2
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
Packit Service 50c9f2
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
Packit Service 50c9f2
**
Packit Service 50c9f2
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
Packit Service 50c9f2
**   information about Qt Commercial License Agreements.
Packit Service 50c9f2
** See http://www.trolltech.com/qpl/ for QPL licensing information.
Packit Service 50c9f2
** See http://www.trolltech.com/gpl/ for GPL licensing information.
Packit Service 50c9f2
**
Packit Service 50c9f2
** Contact info@trolltech.com if any conditions of this licensing are
Packit Service 50c9f2
** not clear to you.
Packit Service 50c9f2
**
Packit Service 50c9f2
**********************************************************************/
Packit Service 50c9f2
Packit Service 50c9f2
#ifndef QTEXTCODEC_H
Packit Service 50c9f2
#define QTEXTCODEC_H
Packit Service 50c9f2
Packit Service 50c9f2
#ifndef QT_H
Packit Service 50c9f2
#include "qstring.h"
Packit Service 50c9f2
#endif // QT_H
Packit Service 50c9f2
Packit Service 50c9f2
#ifndef QT_NO_TEXTCODEC
Packit Service 50c9f2
Packit Service 50c9f2
class QTextCodec;
Packit Service 50c9f2
class QIODevice;
Packit Service 50c9f2
Packit Service 50c9f2
class Q_EXPORT QTextEncoder {
Packit Service 50c9f2
public:
Packit Service 50c9f2
    virtual ~QTextEncoder();
Packit Service 50c9f2
    virtual QCString fromUnicode(const QString& uc, int& lenInOut) = 0;
Packit Service 50c9f2
};
Packit Service 50c9f2
Packit Service 50c9f2
class Q_EXPORT QTextDecoder {
Packit Service 50c9f2
public:
Packit Service 50c9f2
    virtual ~QTextDecoder();
Packit Service 50c9f2
    virtual QString toUnicode(const char* chars, int len) = 0;
Packit Service 50c9f2
};
Packit Service 50c9f2
Packit Service 50c9f2
class Q_EXPORT QTextCodec {
Packit Service 50c9f2
public:
Packit Service 50c9f2
    virtual ~QTextCodec();
Packit Service 50c9f2
Packit Service 50c9f2
#ifndef QT_NO_CODECS
Packit Service 50c9f2
    static QTextCodec* loadCharmap(QIODevice*);
Packit Service 50c9f2
    static QTextCodec* loadCharmapFile(QString filename);
Packit Service 50c9f2
#endif
Packit Service 50c9f2
    static QTextCodec* codecForMib(int mib);
Packit Service 50c9f2
    static QTextCodec* codecForName(const char* hint, int accuracy=0);
Packit Service 50c9f2
    static QTextCodec* codecForContent(const char* chars, int len);
Packit Service 50c9f2
    static QTextCodec* codecForIndex(int i);
Packit Service 50c9f2
    static QTextCodec* codecForLocale();
Packit Service 50c9f2
Packit Service 50c9f2
    static void deleteAllCodecs();
Packit Service 50c9f2
Packit Service 50c9f2
    static const char* locale();
Packit Service 50c9f2
Packit Service 50c9f2
    virtual const char* name() const = 0;
Packit Service 50c9f2
    virtual int mibEnum() const = 0;
Packit Service 50c9f2
Packit Service 50c9f2
    virtual QTextDecoder* makeDecoder() const;
Packit Service 50c9f2
    virtual QTextEncoder* makeEncoder() const;
Packit Service 50c9f2
Packit Service 50c9f2
    virtual QString toUnicode(const char* chars, int len) const;
Packit Service 50c9f2
    virtual QCString fromUnicode(const QString& uc, int& lenInOut) const;
Packit Service 50c9f2
Packit Service 50c9f2
    QCString fromUnicode(const QString& uc) const;
Packit Service 50c9f2
    QString toUnicode(const QByteArray&, int len) const;
Packit Service 50c9f2
    QString toUnicode(const QByteArray&) const;
Packit Service 50c9f2
    QString toUnicode(const char* chars) const;
Packit Service 50c9f2
    virtual bool canEncode( QChar ) const;
Packit Service 50c9f2
    virtual bool canEncode( const QString& ) const;
Packit Service 50c9f2
Packit Service 50c9f2
    virtual int heuristicContentMatch(const char* chars, int len) const = 0;
Packit Service 50c9f2
    virtual int heuristicNameMatch(const char* hint) const;
Packit Service 50c9f2
Packit Service 50c9f2
protected:
Packit Service 50c9f2
    QTextCodec();
Packit Service 50c9f2
    static int simpleHeuristicNameMatch(const char* name, const char* hint);
Packit Service 50c9f2
};
Packit Service 50c9f2
#endif // QT_NO_TEXTCODEC
Packit Service 50c9f2
#endif // QTEXTCODEC_H