~neon/pykde4/master

« back to all changes in this revision

Viewing changes to sip/kdecore/kencodingdetector.sip

  • Committer: Simon Edwards
  • Date: 2007-09-02 19:43:19 UTC
  • Revision ID: git-v1:6b8df0c7009f6b218f54589a9bc313cd8c4f82b9

Initial drop of PyKDE4 - Python bindings for the KDE API. See the README file
for more info about the current state of PyKDE4.


svn path=/trunk/KDE/kdebindings/python/pykde4/; revision=707731

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//
 
2
//     Copyright 2007 Jim Bublitz <jbublitz@nwinternet.com>
 
3
//     Earlier copyrights 1998 - 2006 Jim Bublitz also apply
 
4
 
 
5
 
 
6
//                 Generated by preSip
 
7
//            PyKDE4 module kdecore  version KDE 3.92.0
 
8
 
 
9
 
 
10
// This file is part of PyKDE4.
 
11
 
 
12
// PyKDE4 is free software; you can redistribute it and/or modify
 
13
// it under the terms of the GNU Lesser General Public License as
 
14
// published by the Free Software Foundation; either version 2.1 of
 
15
// the License, or (at your option) any later version.
 
16
 
 
17
// PyKDE4 is distributed in the hope that it will be useful,
 
18
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
19
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
20
// GNU General Public License for more details.
 
21
 
 
22
// You should have received a copy of the GNU General Public License
 
23
// along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
24
 
 
25
 
 
26
class KEncodingDetector
 
27
{
 
28
%TypeHeaderCode
 
29
#include <kencodingdetector.h>
 
30
%End
 
31
 
 
32
 
 
33
public:
 
34
 
 
35
    enum EncodingChoiceSource
 
36
    {
 
37
        DefaultEncoding, 
 
38
        AutoDetectedEncoding, 
 
39
        BOM, 
 
40
        EncodingFromXMLHeader, 
 
41
        EncodingFromMetaTag, 
 
42
        EncodingFromHTTPHeader, 
 
43
        UserChosenEncoding
 
44
    };
 
45
 
 
46
 
 
47
    enum AutoDetectScript
 
48
    {
 
49
        None, 
 
50
        SemiautomaticDetection, 
 
51
        Arabic, 
 
52
        Baltic, 
 
53
        CentralEuropean, 
 
54
        ChineseSimplified, 
 
55
        ChineseTraditional, 
 
56
        Cyrillic, 
 
57
        Greek, 
 
58
        Hebrew, 
 
59
        Japanese, 
 
60
        Korean, 
 
61
        NorthernSaami, 
 
62
        SouthEasternEurope, 
 
63
        Thai, 
 
64
        Turkish, 
 
65
        Unicode, 
 
66
        WesternEuropean
 
67
    };
 
68
 
 
69
                         KEncodingDetector ();
 
70
                         KEncodingDetector (QTextCodec*, KEncodingDetector::EncodingChoiceSource, KEncodingDetector::AutoDetectScript = KEncodingDetector::None );
 
71
    bool                 setEncoding (const char*, KEncodingDetector::EncodingChoiceSource);
 
72
    const char*          encoding () const;
 
73
    bool                 visuallyOrdered () const;
 
74
    void                 setAutoDetectLanguage (KEncodingDetector::AutoDetectScript);
 
75
    KEncodingDetector::AutoDetectScript autoDetectLanguage () const;
 
76
    KEncodingDetector::EncodingChoiceSource encodingChoiceSource () const;
 
77
    QString              decode (const char*, int);
 
78
    QString              decode (const QByteArray&);
 
79
    QString              decodeWithBuffering (const char*, int);
 
80
    QString              flush ();
 
81
    static KEncodingDetector::AutoDetectScript scriptForName (const QString&);
 
82
    static QString       nameForScript (KEncodingDetector::AutoDetectScript);
 
83
    static bool          hasAutoDetectionForScript (KEncodingDetector::AutoDetectScript);
 
84
 
 
85
protected:
 
86
    bool                 processNull (char*, int);
 
87
    bool                 errorsIfUtf8 (const char*, int);
 
88
    bool                 analyze (const char*, int);
 
89
    QTextDecoder*        decoder ();
 
90
 
 
91
};  // class KEncodingDetector
 
92