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

KDECore

  • sources
  • kde-4.12
  • kdelibs
  • 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 
34 class KEncodingProberPrivate;
35 
67 class KDECORE_EXPORT KEncodingProber
68 {
69 public:
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 
164 private:
165  KEncodingProberPrivate* const d;
166 };
167 
168 #endif
KEncodingProber::Korean
Definition: kencodingprober.h:89
KEncodingProber::Cyrillic
Definition: kencodingprober.h:85
KEncodingProber::Baltic
Definition: kencodingprober.h:81
KEncodingProber::ChineseTraditional
Definition: kencodingprober.h:84
KEncodingProber::Unicode
Definition: kencodingprober.h:95
kdebug.h
kdecore_export.h
KEncodingProber::CentralEuropean
Definition: kencodingprober.h:82
KEncodingProber::NotMe
Sure not included in current ProberType's all supported encodings.
Definition: kencodingprober.h:73
QString
KEncodingProber::Greek
Definition: kencodingprober.h:86
KEncodingProber::ChineseSimplified
Definition: kencodingprober.h:83
KEncodingProber::Hebrew
Definition: kencodingprober.h:87
KEncodingProber
Provides encoding detection(probe) capabilities.
Definition: kencodingprober.h:67
KEncodingProber::Japanese
Definition: kencodingprober.h:88
KEncodingProber::Other
Definition: kencodingprober.h:91
KEncodingProber::Thai
Definition: kencodingprober.h:93
KEncodingProber::Turkish
Definition: kencodingprober.h:94
KEncodingProber::ProberType
ProberType
Definition: kencodingprober.h:77
KEncodingProber::FoundIt
Sure find the encoding.
Definition: kencodingprober.h:72
KEncodingProber::ProberState
ProberState
Definition: kencodingprober.h:71
KEncodingProber::None
Definition: kencodingprober.h:78
KEncodingProber::SouthEasternEurope
Definition: kencodingprober.h:92
KEncodingProber::NorthernSaami
Definition: kencodingprober.h:90
KEncodingProber::Arabic
Definition: kencodingprober.h:80
KEncodingProber::Universal
Definition: kencodingprober.h:79
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:47:08 by doxygen 1.8.7 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 API Reference

Skip menu "kdelibs 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
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



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