decoder.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef KHTMLDECODER_H
00024 #define KHTMLDECODER_H
00025
00026 #include <qstring.h>
00027 class QTextCodec;
00028 class QTextDecoder;
00029
00030 namespace khtml {
00034 class Decoder
00035 {
00036 public:
00037 Decoder();
00038 ~Decoder();
00039
00040 void setEncoding(const char *encoding, bool force = false);
00041 const char *encoding() const;
00042
00043 QString decode(const char *data, int len);
00044
00045 bool visuallyOrdered() const { return visualRTL; }
00046
00047 const QTextCodec *codec() const { return m_codec; }
00048
00049 QString flush() const;
00050
00051 enum AutomaticDetectinonLanguage {
00052 SemiautomaticDetection,
00053 Arabic,
00054 Baltic,
00055 CentralEuropean,
00056 Chinese,
00057 Greek,
00058 Hebrew,
00059 Japanese,
00060 Korean,
00061 Russian,
00062 Thai,
00063 Turkish,
00064 Ukrainian,
00065 Unicode,
00066 WesternEuropean
00067 };
00068
00069 void setAutomaticDetectionLanguage( AutomaticDetectinonLanguage _language ) { m_automaticDetectionLanguage = _language; }
00070 AutomaticDetectinonLanguage automaticDetectionLanguage() { return m_automaticDetectionLanguage; }
00071
00072
00073 protected:
00074 QCString automaticDetectionForArabic( const char* str );
00075 QCString automaticDetectionForBaltic( const char* str );
00076 QCString automaticDetectionForCentralEuropean( const char* str );
00077 QCString automaticDetectionForCyrillic( const char* str, AutomaticDetectinonLanguage _language );
00078 QCString automaticDetectionForGreek( const char* str );
00079 QCString automaticDetectionForHebrew( const char* str );
00080 QCString automaticDetectionForTurkish( const char* str );
00081 QCString automaticDetectionForWesternEuropean( const char* str );
00082
00083
00084
00085 QTextCodec *m_codec;
00086 QTextDecoder *m_decoder;
00087 QCString enc;
00088
00089 QCString buffer;
00090
00091 bool body;
00092 bool beginning;
00093 bool visualRTL;
00094 bool haveEncoding;
00095
00096 AutomaticDetectinonLanguage m_automaticDetectionLanguage;
00097 };
00098
00099 }
00100 #endif
This file is part of the documentation for kdelibs Version 3.1.5.