-rw-r--r-- | qmake/include/qtextcodec.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/qmake/include/qtextcodec.h b/qmake/include/qtextcodec.h index 149b5cb..995e434 100644 --- a/qmake/include/qtextcodec.h +++ b/qmake/include/qtextcodec.h | |||
@@ -30,85 +30,99 @@ | |||
30 | ** See http://www.trolltech.com/qpl/ for QPL licensing information. | 30 | ** See http://www.trolltech.com/qpl/ for QPL licensing information. |
31 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 31 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
32 | ** | 32 | ** |
33 | ** Contact info@trolltech.com if any conditions of this licensing are | 33 | ** Contact info@trolltech.com if any conditions of this licensing are |
34 | ** not clear to you. | 34 | ** not clear to you. |
35 | ** | 35 | ** |
36 | **********************************************************************/ | 36 | **********************************************************************/ |
37 | 37 | ||
38 | #ifndef QTEXTCODEC_H | 38 | #ifndef QTEXTCODEC_H |
39 | #define QTEXTCODEC_H | 39 | #define QTEXTCODEC_H |
40 | 40 | ||
41 | #ifndef QT_H | 41 | #ifndef QT_H |
42 | #include "qstring.h" | 42 | #include "qstring.h" |
43 | #endif // QT_H | 43 | #endif // QT_H |
44 | 44 | ||
45 | #ifndef QT_NO_TEXTCODEC | 45 | #ifndef QT_NO_TEXTCODEC |
46 | 46 | ||
47 | class QTextCodec; | 47 | class QTextCodec; |
48 | class QIODevice; | 48 | class QIODevice; |
49 | class QFont; | 49 | class QFont; |
50 | 50 | ||
51 | class Q_EXPORT QTextEncoder { | 51 | class Q_EXPORT QTextEncoder { |
52 | public: | 52 | public: |
53 | virtual ~QTextEncoder(); | 53 | virtual ~QTextEncoder(); |
54 | virtual QCString fromUnicode(const QString& uc, int& lenInOut) = 0; | 54 | virtual QCString fromUnicode(const QString& uc, int& lenInOut) = 0; |
55 | }; | 55 | }; |
56 | 56 | ||
57 | class Q_EXPORT QTextDecoder { | 57 | class Q_EXPORT QTextDecoder { |
58 | public: | 58 | public: |
59 | virtual ~QTextDecoder(); | 59 | virtual ~QTextDecoder(); |
60 | virtual QString toUnicode(const char* chars, int len) = 0; | 60 | virtual QString toUnicode(const char* chars, int len) = 0; |
61 | }; | 61 | }; |
62 | 62 | ||
63 | class Q_EXPORT QTextCodec { | 63 | class Q_EXPORT QTextCodec { |
64 | public: | 64 | public: |
65 | virtual ~QTextCodec(); | 65 | virtual ~QTextCodec(); |
66 | 66 | ||
67 | #ifndef QT_NO_CODECS | 67 | #ifndef QT_NO_CODECS |
68 | static QTextCodec* loadCharmap(QIODevice*); | 68 | static QTextCodec* loadCharmap(QIODevice*); |
69 | static QTextCodec* loadCharmapFile(QString filename); | 69 | static QTextCodec* loadCharmapFile(QString filename); |
70 | #endif //QT_NO_CODECS | 70 | #endif //QT_NO_CODECS |
71 | static QTextCodec* codecForMib(int mib); | 71 | static QTextCodec* codecForMib(int mib); |
72 | static QTextCodec* codecForName(const char* hint, int accuracy=0); | 72 | static QTextCodec* codecForName(const char* hint, int accuracy=0); |
73 | static QTextCodec* codecForContent(const char* chars, int len); | 73 | static QTextCodec* codecForContent(const char* chars, int len); |
74 | static QTextCodec* codecForIndex(int i); | 74 | static QTextCodec* codecForIndex(int i); |
75 | static QTextCodec* codecForLocale(); | 75 | static QTextCodec* codecForLocale(); |
76 | static void setCodecForLocale(QTextCodec *c); | 76 | static void setCodecForLocale(QTextCodec *c); |
77 | 77 | ||
78 | static QTextCodec* codecForTr(); | ||
79 | static void setCodecForTr(QTextCodec *c); | ||
80 | static QTextCodec* codecForCStrings(); | ||
81 | static void setCodecForCStrings(QTextCodec *c); | ||
82 | |||
78 | static void deleteAllCodecs(); | 83 | static void deleteAllCodecs(); |
79 | 84 | ||
80 | static const char* locale(); | 85 | static const char* locale(); |
81 | 86 | ||
82 | virtual const char* name() const = 0; | 87 | virtual const char* name() const = 0; |
83 | virtual const char* mimeName() const; | 88 | virtual const char* mimeName() const; |
84 | virtual int mibEnum() const = 0; | 89 | virtual int mibEnum() const = 0; |
85 | 90 | ||
86 | virtual QTextDecoder* makeDecoder() const; | 91 | virtual QTextDecoder* makeDecoder() const; |
87 | virtual QTextEncoder* makeEncoder() const; | 92 | virtual QTextEncoder* makeEncoder() const; |
88 | 93 | ||
89 | virtual QString toUnicode(const char* chars, int len) const; | 94 | virtual QString toUnicode(const char* chars, int len) const; |
90 | virtual QCString fromUnicode(const QString& uc, int& lenInOut) const; | 95 | virtual QCString fromUnicode(const QString& uc, int& lenInOut) const; |
91 | 96 | ||
92 | QCString fromUnicode(const QString& uc) const; | 97 | QCString fromUnicode(const QString& uc) const; |
93 | QString toUnicode(const QByteArray&, int len) const; | 98 | QString toUnicode(const QByteArray&, int len) const; |
94 | QString toUnicode(const QByteArray&) const; | 99 | QString toUnicode(const QByteArray&) const; |
95 | QString toUnicode(const QCString&, int len) const; | 100 | QString toUnicode(const QCString&, int len) const; |
96 | QString toUnicode(const QCString&) const; | 101 | QString toUnicode(const QCString&) const; |
97 | QString toUnicode(const char* chars) const; | 102 | QString toUnicode(const char* chars) const; |
98 | virtual bool canEncode( QChar ) const; | 103 | virtual bool canEncode( QChar ) const; |
99 | virtual bool canEncode( const QString& ) const; | 104 | virtual bool canEncode( const QString& ) const; |
100 | 105 | ||
101 | virtual int heuristicContentMatch(const char* chars, int len) const = 0; | 106 | virtual int heuristicContentMatch(const char* chars, int len) const = 0; |
102 | virtual int heuristicNameMatch(const char* hint) const; | 107 | virtual int heuristicNameMatch(const char* hint) const; |
103 | 108 | ||
104 | virtual QByteArray fromUnicode(const QString& uc, int from, int len) const; | 109 | virtual QByteArray fromUnicode(const QString& uc, int from, int len) const; |
105 | virtual unsigned short characterFromUnicode(const QString &str, int pos) const; | 110 | virtual unsigned short characterFromUnicode(const QString &str, int pos) const; |
106 | 111 | ||
107 | protected: | 112 | protected: |
108 | QTextCodec(); | 113 | QTextCodec(); |
109 | static int simpleHeuristicNameMatch(const char* name, const char* hint); | 114 | static int simpleHeuristicNameMatch(const char* name, const char* hint); |
110 | 115 | ||
116 | private: | ||
117 | static QTextCodec *cftr; | ||
118 | static QTextCodec *cfcs; | ||
111 | friend class QFont; | 119 | friend class QFont; |
112 | }; | 120 | }; |
121 | |||
122 | inline QTextCodec* QTextCodec::codecForTr() { return cftr; } | ||
123 | inline void QTextCodec::setCodecForTr(QTextCodec *c) { cftr = c; } | ||
124 | inline QTextCodec* QTextCodec::codecForCStrings() { return cfcs; } | ||
125 | inline void QTextCodec::setCodecForCStrings(QTextCodec *c) { cfcs = c; } | ||
126 | |||
113 | #endif // QT_NO_TEXTCODEC | 127 | #endif // QT_NO_TEXTCODEC |
114 | #endif // QTEXTCODEC_H | 128 | #endif // QTEXTCODEC_H |