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

KDECore

kencodingprober.h

Go to the documentation of this file.
00001 /*
00002     This file is part of the KDE libraries
00003 
00004     Copyright (C) 2008 Wang Hoi (zealot.hoi@gmail.com)
00005 
00006     This library is free software; you can redistribute it and/or
00007     modify it under the terms of the GNU Library General Public
00008     License as published by the Free Software Foundation; either
00009     version 2 of the License, or (at your option) any later version.
00010 
00011     This library is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014     Library General Public License for more details.
00015 
00016     You should have received a copy of the GNU Library General Public License
00017     along with this library; see the file COPYING.LIB.  If not, write to
00018     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019     Boston, MA 02110-1301, USA.
00020 
00021 */
00022 #ifndef KENCODINGPROBER_H
00023 #define KENCODINGPROBER_H
00024 
00025 // enable debug of private probers
00026 // #define DEBUG_PROBE
00027 
00028 #include <kdecore_export.h>
00029 #ifdef DEBUG_PROBE
00030 #include <kdebug.h>
00031 #endif
00032 #include <QtCore/QString>
00033 
00034 class KEncodingProberPrivate;
00035 
00067 class KDECORE_EXPORT KEncodingProber
00068 {
00069 public:
00070 
00071     enum ProberState {
00072         FoundIt,  
00073         NotMe,    
00074         Probing   
00075     };
00076 
00077     enum ProberType {
00078         None,
00079         Universal,
00080         Arabic,
00081         Baltic,
00082         CentralEuropean,
00083         ChineseSimplified,
00084         ChineseTraditional,
00085         Cyrillic,
00086         Greek,
00087         Hebrew,
00088         Japanese,
00089         Korean,
00090         NorthernSaami,
00091         Other,
00092         SouthEasternEurope,
00093         Thai,
00094         Turkish,
00095         Unicode,
00096         WesternEuropean
00097     };
00098     
00102     KEncodingProber(ProberType proberType=Universal);
00103 
00104     ~KEncodingProber();
00105 
00109     void reset();
00110 
00118     ProberState feed(const QByteArray &data);
00119     ProberState feed(const char* data, int len);
00120 
00125     ProberState state() const;
00126 
00130     const char* encodingName() const;
00131 
00135     float confidence() const;
00136     
00137     ProberType proberType() const;
00138 
00142     void setProberType(ProberType proberType);
00143 
00147     static ProberType proberTypeForName(const QString& lang);
00148     
00152     static QString nameForProberType(ProberType proberType);
00153     
00154 private:
00155     KEncodingProberPrivate* const d;
00156 };
00157 
00158 #endif

KDECore

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.7
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal