source: trunk/include/qjiscodec.h@ 138

Last change on this file since 138 was 2, checked in by dmik, 20 years ago

Imported xplatform parts of the official release 3.3.1 from Trolltech

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