summaryrefslogtreecommitdiff
path: root/qmake/include/private/qfontcodecs_p.h
Unidiff
Diffstat (limited to 'qmake/include/private/qfontcodecs_p.h') (more/less context) (ignore whitespace changes)
-rw-r--r--qmake/include/private/qfontcodecs_p.h368
1 files changed, 368 insertions, 0 deletions
diff --git a/qmake/include/private/qfontcodecs_p.h b/qmake/include/private/qfontcodecs_p.h
new file mode 100644
index 0000000..8222f98
--- a/dev/null
+++ b/qmake/include/private/qfontcodecs_p.h
@@ -0,0 +1,368 @@
1/****************************************************************************
2** $Id$
3**
4** Font utilities for X11
5**
6** Created : 20001101
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#ifndef QFONTCODECS_P_H
39#define QFONTCODECS_P_H
40
41//
42// W A R N I N G
43// -------------
44//
45// This file is not part of the Qt API. It exists for the convenience
46// of qfontencodings_x11.cpp and qfont_x11.cpp. This header file may
47// change from version to version without notice, or even be removed.
48//
49// We mean it.
50//
51//
52
53#ifndef QT_H
54#include <qglobal.h>
55#include <qtextcodec.h>
56#endif // QT_H
57
58
59#ifndef QT_NO_CODECS
60#ifndef QT_NO_BIG_CODECS
61
62
63class QJpUnicodeConv;
64
65
66class QFontJis0201Codec : public QTextCodec
67{
68public:
69 QFontJis0201Codec();
70
71 const char *name() const;
72
73 int mibEnum() const;
74
75#if !defined(Q_NO_USING_KEYWORD)
76 using QTextCodec::fromUnicode;
77#endif
78 QCString fromUnicode(const QString& uc, int& lenInOut ) const;
79
80 int heuristicContentMatch(const char *, int) const;
81 int heuristicNameMatch(const char* hint) const;
82
83#if !defined(Q_NO_USING_KEYWORD)
84 using QTextCodec::canEncode;
85#endif
86 bool canEncode( QChar ) const;
87};
88
89
90class QFontJis0208Codec : public QTextCodec
91{
92public:
93 QFontJis0208Codec();
94 ~QFontJis0208Codec();
95
96 // Return the official name for the encoding.
97 const char* name() const ;
98
99 // Return the MIB enum for the encoding if it is listed in the
100 // IANA character-sets encoding file.
101 int mibEnum() const ;
102
103 // Converts len characters from chars to Unicode.
104 QString toUnicode(const char* chars, int len) const ;
105
106 // Converts lenInOut characters (of type QChar) from the start of
107 // the string uc, returning a QCString result, and also returning
108 // the length of the result in lenInOut.
109#if !defined(Q_NO_USING_KEYWORD)
110 using QTextCodec::fromUnicode;
111#endif
112 QCString fromUnicode(const QString& uc, int& lenInOut ) const;
113
114 int heuristicContentMatch(const char *, int) const;
115 int heuristicNameMatch(const char* hint) const;
116
117#if !defined(Q_NO_USING_KEYWORD)
118 using QTextCodec::canEncode;
119#endif
120 bool canEncode( QChar ) const;
121
122private:
123 QJpUnicodeConv *convJP;
124};
125
126
127
128
129class QFontKsc5601Codec : public QTextCodec
130{
131public:
132 QFontKsc5601Codec();
133
134 // Return the official name for the encoding.
135 const char* name() const ;
136
137 // Return the MIB enum for the encoding if it is listed in the
138 // IANA character-sets encoding file.
139 int mibEnum() const ;
140
141 // Converts len characters from chars to Unicode.
142 QString toUnicode(const char* chars, int len) const ;
143
144 // Converts lenInOut characters (of type QChar) from the start of
145 // the string uc, returning a QCString result, and also returning
146 // the length of the result in lenInOut.
147#if !defined(Q_NO_USING_KEYWORD)
148 using QTextCodec::fromUnicode;
149#endif
150 QCString fromUnicode(const QString& uc, int& lenInOut ) const;
151
152 int heuristicContentMatch(const char *, int) const;
153#if !defined(Q_NO_USING_KEYWORD)
154 using QTextCodec::canEncode;
155#endif
156 bool canEncode( QChar ) const;
157};
158
159
160
161
162class QFontGb2312Codec : public QTextCodec
163{
164public:
165 QFontGb2312Codec();
166
167 // Return the official name for the encoding.
168 const char* name() const ;
169
170 // Return the MIB enum for the encoding if it is listed in the
171 // IANA character-sets encoding file.
172 int mibEnum() const ;
173
174 // Converts len characters from chars to Unicode.
175 QString toUnicode(const char* chars, int len) const ;
176
177 // Converts lenInOut characters (of type QChar) from the start of
178 // the string uc, returning a QCString result, and also returning
179 // the length of the result in lenInOut.
180 QCString fromUnicode(const QString& uc, int& lenInOut ) const;
181
182 int heuristicContentMatch(const char *, int) const;
183 bool canEncode( QChar ) const;
184};
185
186
187
188
189class QFontGbkCodec : public QTextCodec
190{
191public:
192 QFontGbkCodec();
193
194 // Return the official name for the encoding.
195 const char* name() const ;
196
197 // Return the MIB enum for the encoding if it is listed in the
198 // IANA character-sets encoding file.
199 int mibEnum() const ;
200
201 // Converts len characters from chars to Unicode.
202 QString toUnicode(const char* chars, int len) const ;
203
204 // Converts lenInOut characters (of type QChar) from the start of
205 // the string uc, returning a QCString result, and also returning
206 // the length of the result in lenInOut.
207 QCString fromUnicode(const QString& uc, int& lenInOut ) const;
208
209 int heuristicContentMatch(const char *, int) const;
210 int heuristicNameMatch(const char* hint) const;
211 bool canEncode( QChar ) const;
212};
213
214
215
216
217class QFontGb18030_0Codec : public QTextCodec
218{
219public:
220 QFontGb18030_0Codec();
221
222 // Return the official name for the encoding.
223 const char* name() const ;
224
225 // Return the MIB enum for the encoding if it is listed in the
226 // IANA character-sets encoding file.
227 int mibEnum() const ;
228
229 // Converts len characters from chars to Unicode.
230 QString toUnicode(const char* chars, int len) const ;
231
232 // Converts lenInOut characters (of type QChar) from the start of
233 // the string uc, returning a QCString result, and also returning
234 // the length of the result in lenInOut.
235#if !defined(Q_NO_USING_KEYWORD)
236 using QTextCodec::fromUnicode;
237#endif
238 QCString fromUnicode(const QString& uc, int& lenInOut ) const;
239
240 int heuristicContentMatch(const char *, int) const;
241#if !defined(Q_NO_USING_KEYWORD)
242 using QTextCodec::canEncode;
243#endif
244 bool canEncode( QChar ) const;
245};
246
247
248
249
250class QFontBig5Codec : public QTextCodec
251{
252public:
253 QFontBig5Codec();
254
255 // Return the official name for the encoding.
256 const char* name() const ;
257
258 // Return the MIB enum for the encoding if it is listed in the
259 // IANA character-sets encoding file.
260 int mibEnum() const ;
261
262 // Converts len characters from chars to Unicode.
263 QString toUnicode(const char* chars, int len) const ;
264
265 // Converts lenInOut characters (of type QChar) from the start of
266 // the string uc, returning a QCString result, and also returning
267 // the length of the result in lenInOut.
268#if !defined(Q_NO_USING_KEYWORD)
269 using QTextCodec::fromUnicode;
270#endif
271 QCString fromUnicode(const QString& uc, int& lenInOut ) const;
272
273 int heuristicContentMatch(const char *, int) const;
274#if !defined(Q_NO_USING_KEYWORD)
275 using QTextCodec::canEncode;
276#endif
277 int heuristicNameMatch(const char* hint) const;
278 bool canEncode( QChar ) const;
279};
280
281
282
283class QFontBig5hkscsCodec : public QTextCodec
284{
285public:
286 QFontBig5hkscsCodec();
287
288 // Return the official name for the encoding.
289 const char* name() const ;
290
291 // Return the MIB enum for the encoding if it is listed in the
292 // IANA character-sets encoding file.
293 int mibEnum() const ;
294
295 // Converts len characters from chars to Unicode.
296 QString toUnicode(const char* chars, int len) const ;
297
298 // Converts lenInOut characters (of type QChar) from the start of
299 // the string uc, returning a QCString result, and also returning
300 // the length of the result in lenInOut.
301 QCString fromUnicode(const QString& uc, int& lenInOut ) const;
302
303 int heuristicContentMatch(const char *, int) const;
304 int heuristicNameMatch(const char* hint) const;
305#if !defined(Q_NO_USING_KEYWORD)
306 using QTextCodec::canEncode;
307#endif
308 bool canEncode( QChar ) const;
309};
310
311
312
313
314// ------------------------------------------------------------------
315// the shaping codec for iso8859-6.8x fonts (see www.langbox.com)
316
317class QFontArabic68Codec : public QTextCodec
318{
319public:
320 QFontArabic68Codec();
321
322 // Return the official name for the encoding.
323 const char* name() const ;
324
325 // Return the MIB enum for the encoding if it is listed in the
326 // IANA character-sets encoding file.
327 int mibEnum() const ;
328
329 // Converts len characters from chars to Unicode.
330 QString toUnicode(const char* chars, int len) const ;
331
332 // Converts lenInOut characters (of type QChar) from the start of
333 // the string uc, returning a QCString result, and also returning
334 // the length of the result in lenInOut.
335 QCString fromUnicode(const QString& uc, int& lenInOut ) const;
336
337 int heuristicContentMatch(const char *, int) const;
338 QByteArray fromUnicode( const QString &str, int from, int len ) const;
339 unsigned short characterFromUnicode(const QString &str, int pos) const;
340};
341
342
343class QFontLaoCodec : public QTextCodec
344{
345public:
346 QFontLaoCodec();
347
348 const char *name() const;
349
350 int mibEnum() const;
351
352#if !defined(Q_NO_USING_KEYWORD)
353 using QTextCodec::fromUnicode;
354#endif
355 QCString fromUnicode(const QString& uc, int& lenInOut ) const;
356
357 int heuristicContentMatch(const char *, int) const;
358
359#if !defined(Q_NO_USING_KEYWORD)
360 using QTextCodec::canEncode;
361#endif
362 bool canEncode( QChar ) const;
363};
364
365#endif // QT_NO_BIG_CODECS
366#endif // QT_NO_CODECS
367
368#endif // QFONTCODECS_P_H