| 1 | /****************************************************************************
|
|---|
| 2 | ** $Id: qtsciicodec.h 2 2005-11-16 15:49:26Z dmik $
|
|---|
| 3 | **
|
|---|
| 4 | ** Definition of QTsciiCodec class
|
|---|
| 5 | **
|
|---|
| 6 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
|
|---|
| 7 | **
|
|---|
| 8 | ** This file is part of the tools module of the Qt GUI Toolkit.
|
|---|
| 9 | **
|
|---|
| 10 | ** This file may be distributed under the terms of the Q Public License
|
|---|
| 11 | ** as defined by Trolltech AS of Norway and appearing in the file
|
|---|
| 12 | ** LICENSE.QPL included in the packaging of this file.
|
|---|
| 13 | **
|
|---|
| 14 | ** This file may be distributed and/or modified under the terms of the
|
|---|
| 15 | ** GNU General Public License version 2 as published by the Free Software
|
|---|
| 16 | ** Foundation and appearing in the file LICENSE.GPL included in the
|
|---|
| 17 | ** packaging of this file.
|
|---|
| 18 | **
|
|---|
| 19 | ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
|
|---|
| 20 | ** licenses may use this file in accordance with the Qt Commercial License
|
|---|
| 21 | ** Agreement provided with the Software.
|
|---|
| 22 | **
|
|---|
| 23 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|---|
| 24 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|---|
| 25 | **
|
|---|
| 26 | ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
|
|---|
| 27 | ** information about Qt Commercial License Agreements.
|
|---|
| 28 | ** See http://www.trolltech.com/qpl/ for QPL licensing information.
|
|---|
| 29 | ** See http://www.trolltech.com/gpl/ for GPL licensing information.
|
|---|
| 30 | **
|
|---|
| 31 | ** Contact info@trolltech.com if any conditions of this licensing are
|
|---|
| 32 | ** not clear to you.
|
|---|
| 33 | **
|
|---|
| 34 | **********************************************************************/
|
|---|
| 35 |
|
|---|
| 36 | // Most of the code here was originally written by Hans Petter Bieker,
|
|---|
| 37 | // and is included in Qt with the author's permission, and the grateful
|
|---|
| 38 | // thanks of the Trolltech team.
|
|---|
| 39 |
|
|---|
| 40 | /*
|
|---|
| 41 | * Copyright (C) 2000 Hans Petter Bieker. All rights reserved.
|
|---|
| 42 | *
|
|---|
| 43 | * Redistribution and use in source and binary forms, with or without
|
|---|
| 44 | * modification, are permitted provided that the following conditions
|
|---|
| 45 | * are met:
|
|---|
| 46 | * 1. Redistributions of source code must retain the above copyright
|
|---|
| 47 | * notice, this list of conditions and the following disclaimer.
|
|---|
| 48 | * 2. Redistributions in binary form must reproduce the above copyright
|
|---|
| 49 | * notice, this list of conditions and the following disclaimer in the
|
|---|
| 50 | * documentation and/or other materials provided with the distribution.
|
|---|
| 51 | *
|
|---|
| 52 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|---|
| 53 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|---|
| 54 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|---|
| 55 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|---|
| 56 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|---|
| 57 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|---|
| 58 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|---|
| 59 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|---|
| 60 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|---|
| 61 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|---|
| 62 | * SUCH DAMAGE.
|
|---|
| 63 | */
|
|---|
| 64 |
|
|---|
| 65 | #ifndef QTSCIICODEC_H
|
|---|
| 66 | #define QTSCIICODEC_H
|
|---|
| 67 |
|
|---|
| 68 | #ifndef QT_H
|
|---|
| 69 | #include "qtextcodec.h"
|
|---|
| 70 | #endif // QT_H
|
|---|
| 71 |
|
|---|
| 72 | #ifndef QT_NO_CODECS
|
|---|
| 73 |
|
|---|
| 74 | class Q_EXPORT QTsciiCodec : public QTextCodec {
|
|---|
| 75 | public:
|
|---|
| 76 | virtual int mibEnum() const;
|
|---|
| 77 | const char* name() const;
|
|---|
| 78 |
|
|---|
| 79 | #if !defined(Q_NO_USING_KEYWORD)
|
|---|
| 80 | using QTextCodec::fromUnicode;
|
|---|
| 81 | #endif
|
|---|
| 82 | QCString fromUnicode(const QString& uc, int& lenInOut) const;
|
|---|
| 83 | QString toUnicode(const char* chars, int len) const;
|
|---|
| 84 |
|
|---|
| 85 | int heuristicContentMatch(const char* chars, int len) const;
|
|---|
| 86 | int heuristicNameMatch(const char* hint) const;
|
|---|
| 87 | };
|
|---|
| 88 |
|
|---|
| 89 | #endif
|
|---|
| 90 |
|
|---|
| 91 | #endif
|
|---|