1 | /****************************************************************************
|
---|
2 | ** $Id: qfontcodecs_p.h 2 2005-11-16 15:49:26Z dmik $
|
---|
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 |
|
---|
63 | class QJpUnicodeConv;
|
---|
64 |
|
---|
65 |
|
---|
66 | class QFontJis0201Codec : public QTextCodec
|
---|
67 | {
|
---|
68 | public:
|
---|
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 | void fromUnicode( const QChar *in, unsigned short *out, int length ) const;
|
---|
80 |
|
---|
81 | unsigned short characterFromUnicode(const QString &str, int pos) const;
|
---|
82 |
|
---|
83 | int heuristicContentMatch(const char *, int) const;
|
---|
84 | int heuristicNameMatch(const char* hint) const;
|
---|
85 |
|
---|
86 | #if !defined(Q_NO_USING_KEYWORD)
|
---|
87 | using QTextCodec::canEncode;
|
---|
88 | #endif
|
---|
89 | bool canEncode( QChar ) const;
|
---|
90 | };
|
---|
91 |
|
---|
92 |
|
---|
93 | class QFontJis0208Codec : public QTextCodec
|
---|
94 | {
|
---|
95 | public:
|
---|
96 | QFontJis0208Codec();
|
---|
97 | ~QFontJis0208Codec();
|
---|
98 |
|
---|
99 | // Return the official name for the encoding.
|
---|
100 | const char* name() const ;
|
---|
101 |
|
---|
102 | // Return the MIB enum for the encoding if it is listed in the
|
---|
103 | // IANA character-sets encoding file.
|
---|
104 | int mibEnum() const ;
|
---|
105 |
|
---|
106 | // Converts len characters from chars to Unicode.
|
---|
107 | QString toUnicode(const char* chars, int len) const ;
|
---|
108 |
|
---|
109 | // Converts lenInOut characters (of type QChar) from the start of
|
---|
110 | // the string uc, returning a QCString result, and also returning
|
---|
111 | // the length of the result in lenInOut.
|
---|
112 | #if !defined(Q_NO_USING_KEYWORD)
|
---|
113 | using QTextCodec::fromUnicode;
|
---|
114 | #endif
|
---|
115 | QCString fromUnicode(const QString& uc, int& lenInOut ) const;
|
---|
116 | void fromUnicode( const QChar *in, unsigned short *out, int length ) const;
|
---|
117 |
|
---|
118 | unsigned short characterFromUnicode(const QString &str, int pos) const;
|
---|
119 |
|
---|
120 | int heuristicContentMatch(const char *, int) const;
|
---|
121 | int heuristicNameMatch(const char* hint) const;
|
---|
122 |
|
---|
123 | #if !defined(Q_NO_USING_KEYWORD)
|
---|
124 | using QTextCodec::canEncode;
|
---|
125 | #endif
|
---|
126 | bool canEncode( QChar ) const;
|
---|
127 |
|
---|
128 | private:
|
---|
129 | QJpUnicodeConv *convJP;
|
---|
130 | };
|
---|
131 |
|
---|
132 |
|
---|
133 |
|
---|
134 |
|
---|
135 | class QFontKsc5601Codec : public QTextCodec
|
---|
136 | {
|
---|
137 | public:
|
---|
138 | QFontKsc5601Codec();
|
---|
139 |
|
---|
140 | // Return the official name for the encoding.
|
---|
141 | const char* name() const ;
|
---|
142 |
|
---|
143 | // Return the MIB enum for the encoding if it is listed in the
|
---|
144 | // IANA character-sets encoding file.
|
---|
145 | int mibEnum() const ;
|
---|
146 |
|
---|
147 | // Converts len characters from chars to Unicode.
|
---|
148 | QString toUnicode(const char* chars, int len) const ;
|
---|
149 |
|
---|
150 | // Converts lenInOut characters (of type QChar) from the start of
|
---|
151 | // the string uc, returning a QCString result, and also returning
|
---|
152 | // the length of the result in lenInOut.
|
---|
153 | #if !defined(Q_NO_USING_KEYWORD)
|
---|
154 | using QTextCodec::fromUnicode;
|
---|
155 | #endif
|
---|
156 | QCString fromUnicode(const QString& uc, int& lenInOut ) const;
|
---|
157 | void fromUnicode( const QChar *in, unsigned short *out, int length ) const;
|
---|
158 |
|
---|
159 | unsigned short characterFromUnicode(const QString &str, int pos) const;
|
---|
160 |
|
---|
161 | int heuristicContentMatch(const char *, int) const;
|
---|
162 | #if !defined(Q_NO_USING_KEYWORD)
|
---|
163 | using QTextCodec::canEncode;
|
---|
164 | #endif
|
---|
165 | bool canEncode( QChar ) const;
|
---|
166 | };
|
---|
167 |
|
---|
168 |
|
---|
169 |
|
---|
170 |
|
---|
171 | class QFontGb2312Codec : public QTextCodec
|
---|
172 | {
|
---|
173 | public:
|
---|
174 | QFontGb2312Codec();
|
---|
175 |
|
---|
176 | // Return the official name for the encoding.
|
---|
177 | const char* name() const ;
|
---|
178 |
|
---|
179 | // Return the MIB enum for the encoding if it is listed in the
|
---|
180 | // IANA character-sets encoding file.
|
---|
181 | int mibEnum() const ;
|
---|
182 |
|
---|
183 | // Converts len characters from chars to Unicode.
|
---|
184 | QString toUnicode(const char* chars, int len) const ;
|
---|
185 |
|
---|
186 | // Converts lenInOut characters (of type QChar) from the start of
|
---|
187 | // the string uc, returning a QCString result, and also returning
|
---|
188 | // the length of the result in lenInOut.
|
---|
189 | #if !defined(Q_NO_USING_KEYWORD)
|
---|
190 | using QTextCodec::fromUnicode;
|
---|
191 | #endif
|
---|
192 | QCString fromUnicode(const QString& uc, int& lenInOut ) const;
|
---|
193 | void fromUnicode( const QChar *in, unsigned short *out, int length ) const;
|
---|
194 |
|
---|
195 | unsigned short characterFromUnicode(const QString &str, int pos) const;
|
---|
196 |
|
---|
197 | int heuristicContentMatch(const char *, int) const;
|
---|
198 |
|
---|
199 | #if !defined(Q_NO_USING_KEYWORD)
|
---|
200 | using QTextCodec::canEncode;
|
---|
201 | #endif
|
---|
202 | bool canEncode( QChar ) const;
|
---|
203 | };
|
---|
204 |
|
---|
205 |
|
---|
206 |
|
---|
207 |
|
---|
208 | class QFontGbkCodec : public QTextCodec
|
---|
209 | {
|
---|
210 | public:
|
---|
211 | QFontGbkCodec();
|
---|
212 |
|
---|
213 | // Return the official name for the encoding.
|
---|
214 | const char* name() const ;
|
---|
215 |
|
---|
216 | // Return the MIB enum for the encoding if it is listed in the
|
---|
217 | // IANA character-sets encoding file.
|
---|
218 | int mibEnum() const ;
|
---|
219 |
|
---|
220 | // Converts len characters from chars to Unicode.
|
---|
221 | QString toUnicode(const char* chars, int len) const ;
|
---|
222 |
|
---|
223 | // Converts lenInOut characters (of type QChar) from the start of
|
---|
224 | // the string uc, returning a QCString result, and also returning
|
---|
225 | // the length of the result in lenInOut.
|
---|
226 | #if !defined(Q_NO_USING_KEYWORD)
|
---|
227 | using QTextCodec::fromUnicode;
|
---|
228 | #endif
|
---|
229 | QCString fromUnicode(const QString& uc, int& lenInOut ) const;
|
---|
230 | void fromUnicode( const QChar *in, unsigned short *out, int length ) const;
|
---|
231 |
|
---|
232 | unsigned short characterFromUnicode(const QString &str, int pos) const;
|
---|
233 |
|
---|
234 | int heuristicContentMatch(const char *, int) const;
|
---|
235 | int heuristicNameMatch(const char* hint) const;
|
---|
236 |
|
---|
237 | #if !defined(Q_NO_USING_KEYWORD)
|
---|
238 | using QTextCodec::canEncode;
|
---|
239 | #endif
|
---|
240 | bool canEncode( QChar ) const;
|
---|
241 | };
|
---|
242 |
|
---|
243 |
|
---|
244 |
|
---|
245 |
|
---|
246 | class QFontGb18030_0Codec : public QTextCodec
|
---|
247 | {
|
---|
248 | public:
|
---|
249 | QFontGb18030_0Codec();
|
---|
250 |
|
---|
251 | // Return the official name for the encoding.
|
---|
252 | const char* name() const ;
|
---|
253 |
|
---|
254 | // Return the MIB enum for the encoding if it is listed in the
|
---|
255 | // IANA character-sets encoding file.
|
---|
256 | int mibEnum() const ;
|
---|
257 |
|
---|
258 | // Converts len characters from chars to Unicode.
|
---|
259 | QString toUnicode(const char* chars, int len) const ;
|
---|
260 |
|
---|
261 | // Converts lenInOut characters (of type QChar) from the start of
|
---|
262 | // the string uc, returning a QCString result, and also returning
|
---|
263 | // the length of the result in lenInOut.
|
---|
264 | #if !defined(Q_NO_USING_KEYWORD)
|
---|
265 | using QTextCodec::fromUnicode;
|
---|
266 | #endif
|
---|
267 | QCString fromUnicode(const QString& uc, int& lenInOut ) const;
|
---|
268 | void fromUnicode( const QChar *in, unsigned short *out, int length ) const;
|
---|
269 |
|
---|
270 | unsigned short characterFromUnicode(const QString &str, int pos) const;
|
---|
271 |
|
---|
272 | int heuristicContentMatch(const char *, int) const;
|
---|
273 | #if !defined(Q_NO_USING_KEYWORD)
|
---|
274 | using QTextCodec::canEncode;
|
---|
275 | #endif
|
---|
276 | bool canEncode( QChar ) const;
|
---|
277 | };
|
---|
278 |
|
---|
279 |
|
---|
280 |
|
---|
281 |
|
---|
282 | class QFontBig5Codec : public QTextCodec
|
---|
283 | {
|
---|
284 | public:
|
---|
285 | QFontBig5Codec();
|
---|
286 |
|
---|
287 | // Return the official name for the encoding.
|
---|
288 | const char* name() const ;
|
---|
289 |
|
---|
290 | // Return the MIB enum for the encoding if it is listed in the
|
---|
291 | // IANA character-sets encoding file.
|
---|
292 | int mibEnum() const ;
|
---|
293 |
|
---|
294 | // Converts len characters from chars to Unicode.
|
---|
295 | QString toUnicode(const char* chars, int len) const ;
|
---|
296 |
|
---|
297 | // Converts lenInOut characters (of type QChar) from the start of
|
---|
298 | // the string uc, returning a QCString result, and also returning
|
---|
299 | // the length of the result in lenInOut.
|
---|
300 | #if !defined(Q_NO_USING_KEYWORD)
|
---|
301 | using QTextCodec::fromUnicode;
|
---|
302 | #endif
|
---|
303 | QCString fromUnicode(const QString& uc, int& lenInOut ) const;
|
---|
304 | void fromUnicode( const QChar *in, unsigned short *out, int length ) const;
|
---|
305 |
|
---|
306 | unsigned short characterFromUnicode(const QString &str, int pos) const;
|
---|
307 |
|
---|
308 | int heuristicContentMatch(const char *, int) const;
|
---|
309 | #if !defined(Q_NO_USING_KEYWORD)
|
---|
310 | using QTextCodec::canEncode;
|
---|
311 | #endif
|
---|
312 | int heuristicNameMatch(const char* hint) const;
|
---|
313 | bool canEncode( QChar ) const;
|
---|
314 | };
|
---|
315 |
|
---|
316 |
|
---|
317 |
|
---|
318 | class QFontBig5hkscsCodec : public QTextCodec
|
---|
319 | {
|
---|
320 | public:
|
---|
321 | QFontBig5hkscsCodec();
|
---|
322 |
|
---|
323 | // Return the official name for the encoding.
|
---|
324 | const char* name() const ;
|
---|
325 |
|
---|
326 | // Return the MIB enum for the encoding if it is listed in the
|
---|
327 | // IANA character-sets encoding file.
|
---|
328 | int mibEnum() const ;
|
---|
329 |
|
---|
330 | // Converts len characters from chars to Unicode.
|
---|
331 | QString toUnicode(const char* chars, int len) const ;
|
---|
332 |
|
---|
333 | // Converts lenInOut characters (of type QChar) from the start of
|
---|
334 | // the string uc, returning a QCString result, and also returning
|
---|
335 | // the length of the result in lenInOut.
|
---|
336 | #if !defined(Q_NO_USING_KEYWORD)
|
---|
337 | using QTextCodec::fromUnicode;
|
---|
338 | #endif
|
---|
339 | QCString fromUnicode(const QString& uc, int& lenInOut ) const;
|
---|
340 | void fromUnicode( const QChar *in, unsigned short *out, int length ) const;
|
---|
341 |
|
---|
342 | unsigned short characterFromUnicode(const QString &str, int pos) const;
|
---|
343 |
|
---|
344 | int heuristicContentMatch(const char *, int) const;
|
---|
345 | int heuristicNameMatch(const char* hint) const;
|
---|
346 | #if !defined(Q_NO_USING_KEYWORD)
|
---|
347 | using QTextCodec::canEncode;
|
---|
348 | #endif
|
---|
349 | bool canEncode( QChar ) const;
|
---|
350 | };
|
---|
351 |
|
---|
352 |
|
---|
353 | class QFontLaoCodec : public QTextCodec
|
---|
354 | {
|
---|
355 | public:
|
---|
356 | QFontLaoCodec();
|
---|
357 |
|
---|
358 | const char *name() const;
|
---|
359 |
|
---|
360 | int mibEnum() const;
|
---|
361 |
|
---|
362 | #if !defined(Q_NO_USING_KEYWORD)
|
---|
363 | using QTextCodec::fromUnicode;
|
---|
364 | #endif
|
---|
365 | QCString fromUnicode(const QString& uc, int& lenInOut ) const;
|
---|
366 | void fromUnicode( const QChar *in, unsigned short *out, int length ) const;
|
---|
367 |
|
---|
368 | unsigned short characterFromUnicode(const QString &str, int pos) const;
|
---|
369 |
|
---|
370 | int heuristicContentMatch(const char *, int) const;
|
---|
371 |
|
---|
372 | #if !defined(Q_NO_USING_KEYWORD)
|
---|
373 | using QTextCodec::canEncode;
|
---|
374 | #endif
|
---|
375 | bool canEncode( QChar ) const;
|
---|
376 | };
|
---|
377 |
|
---|
378 | #endif // QT_NO_BIG_CODECS
|
---|
379 | #endif // QT_NO_CODECS
|
---|
380 |
|
---|
381 | #endif // QFONTCODECS_P_H
|
---|