• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KDECore

  • kdecore
  • localization
kencodingprober.h
Go to the documentation of this file.
1/*
2 This file is part of the KDE libraries
3
4 Copyright (C) 2008 Wang Hoi (zealot.hoi@gmail.com)
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
15
16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA.
20
21*/
22#ifndef KENCODINGPROBER_H
23#define KENCODINGPROBER_H
24
25// enable debug of private probers
26// #define DEBUG_PROBE
27
28#include <kdecore_export.h>
29#ifdef DEBUG_PROBE
30#include <kdebug.h>
31#endif
32#include <QtCore/QString>
33
34class KEncodingProberPrivate;
35
67class KDECORE_EXPORT KEncodingProber
68{
69public:
70
71 enum ProberState {
72 FoundIt,
73 NotMe,
74 Probing
75 };
76
77 enum ProberType {
78 None,
79 Universal,
80 Arabic,
81 Baltic,
82 CentralEuropean,
83 ChineseSimplified,
84 ChineseTraditional,
85 Cyrillic,
86 Greek,
87 Hebrew,
88 Japanese,
89 Korean,
90 NorthernSaami,
91 Other,
92 SouthEasternEurope,
93 Thai,
94 Turkish,
95 Unicode,
96 WesternEuropean
97 };
98
102 KEncodingProber(ProberType proberType=Universal);
103
104 ~KEncodingProber();
105
109 void reset();
110
118 ProberState feed(const QByteArray &data);
119 ProberState feed(const char* data, int len);
120
125 ProberState state() const;
126
132#ifndef KDE_NO_DEPRECATED
133 KDE_DEPRECATED const char* encodingName() const;
134#endif
135
140 QByteArray encoding() const;
141
145 float confidence() const;
146
147 ProberType proberType() const;
148
152 void setProberType(ProberType proberType);
153
157 static ProberType proberTypeForName(const QString& lang);
158
162 static QString nameForProberType(ProberType proberType);
163
164private:
165 KEncodingProberPrivate* const d;
166};
167
168#endif
KEncodingProber
Provides encoding detection(probe) capabilities.
Definition: kencodingprober.h:68
KEncodingProber::ProberState
ProberState
Definition: kencodingprober.h:71
KEncodingProber::NotMe
@ NotMe
Sure not included in current ProberType's all supported encodings
Definition: kencodingprober.h:73
KEncodingProber::FoundIt
@ FoundIt
Sure find the encoding.
Definition: kencodingprober.h:72
KEncodingProber::ProberType
ProberType
Definition: kencodingprober.h:77
KEncodingProber::None
@ None
Definition: kencodingprober.h:78
KEncodingProber::Arabic
@ Arabic
Definition: kencodingprober.h:80
KEncodingProber::Cyrillic
@ Cyrillic
Definition: kencodingprober.h:85
KEncodingProber::Turkish
@ Turkish
Definition: kencodingprober.h:94
KEncodingProber::ChineseSimplified
@ ChineseSimplified
Definition: kencodingprober.h:83
KEncodingProber::Unicode
@ Unicode
Definition: kencodingprober.h:95
KEncodingProber::Universal
@ Universal
Definition: kencodingprober.h:79
KEncodingProber::Korean
@ Korean
Definition: kencodingprober.h:89
KEncodingProber::Greek
@ Greek
Definition: kencodingprober.h:86
KEncodingProber::Thai
@ Thai
Definition: kencodingprober.h:93
KEncodingProber::Hebrew
@ Hebrew
Definition: kencodingprober.h:87
KEncodingProber::ChineseTraditional
@ ChineseTraditional
Definition: kencodingprober.h:84
KEncodingProber::CentralEuropean
@ CentralEuropean
Definition: kencodingprober.h:82
KEncodingProber::Japanese
@ Japanese
Definition: kencodingprober.h:88
KEncodingProber::Other
@ Other
Definition: kencodingprober.h:91
KEncodingProber::SouthEasternEurope
@ SouthEasternEurope
Definition: kencodingprober.h:92
KEncodingProber::Baltic
@ Baltic
Definition: kencodingprober.h:81
KEncodingProber::NorthernSaami
@ NorthernSaami
Definition: kencodingprober.h:90
QString
kdebug.h
kdecore_export.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDECore

Skip menu "KDECore"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal