kcharsets.h
00001 /* This file is part of the KDE libraries 00002 Copyright (C) 1999 Lars Knoll (knoll@kde.org) 00003 $Id: kcharsets.h,v 1.53 2002/09/28 11:14:45 tjansen Exp $ 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License as published by the Free Software Foundation; either 00008 version 2 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public License 00016 along with this library; see the file COPYING.LIB. If not, write to 00017 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00018 Boston, MA 02111-1307, USA. 00019 */ 00020 #ifndef KCHARSETS_H 00021 #define KCHARSETS_H 00022 00023 #include <qstring.h> 00024 #include <qfont.h> 00025 #include <qstringlist.h> 00026 #include <qlist.h> 00027 00028 class KGlobal; 00029 class KCharsetsPrivate; 00030 00031 class QTextCodec; 00032 00044 class KCharsets 00045 { 00046 friend class KGlobal; 00047 00048 protected: 00052 KCharsets(); 00053 00054 public: 00055 00059 virtual ~KCharsets(); 00060 00067 QTextCodec *codecForName(const QString &name) const; 00068 00076 QTextCodec *codecForName(const QString &n, bool &ok) const; 00077 00084 static QChar fromEntity(const QString &str); 00094 static QChar fromEntity(const QString &str, int &len); 00095 00102 static QString toEntity(const QChar &ch); 00103 00111 static QString resolveEntities( const QString &text ); 00112 00117 QStringList availableEncodingNames(); 00118 00123 QStringList descriptiveEncodingNames(); 00124 00129 QStringList languages(); 00130 00136 QStringList encodingsForLanguage( const QString &language ); 00137 00143 QString languageForEncoding( const QString &encoding ); 00144 00150 QString encodingForName( const QString &descriptiveName ); 00151 00152 private: 00153 KCharsetsPrivate *d; 00154 }; 00155 00156 #endif