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

KDECore

  • kdecore
  • localization
kcharsets.h
Go to the documentation of this file.
1/* This file is part of the KDE libraries
2 Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
18*/
19#ifndef KCHARSETS_H
20#define KCHARSETS_H
21
22#include <kdemacros.h>
23#include <kdecore_export.h>
24#include <QtCore/QList>
25
26class KCharsets;
27class KCharsetsPrivate;
28
29class QChar;
30class QString;
31class QStringList;
32class QTextCodec;
33
34namespace KGlobal
35{
36 KDECORE_EXPORT KCharsets *charsets();
37}
38
46class KDECORE_EXPORT KCharsets
47{
48 friend KCharsets *KGlobal::charsets();
49
50protected:
54 KCharsets();
55
56public:
57
61 virtual ~KCharsets();
62
69 QTextCodec *codecForName(const QString &name) const;
70
83 QTextCodec *codecForName(const QString &n, bool &ok) const;
84
93 static QChar fromEntity(const QString &str);
94
104 static QChar fromEntity(const QString &str, int &len);
105
112 static QString toEntity(const QChar &ch);
113
120 static QString resolveEntities( const QString &text );
121
126 QStringList availableEncodingNames() const;
127
132 QStringList descriptiveEncodingNames() const;
133
138 QList<QStringList> encodingsByScript() const;
139
147#ifndef KDE_NO_DEPRECATED
148 KDE_DEPRECATED QString languageForEncoding( const QString &encoding ) const;
149#endif
150
156 QString descriptionForEncoding( const QString& encoding ) const;
157
163 QString encodingForName( const QString &descriptiveName ) const;
164
165private:
166 KCharsetsPrivate* const d;
167
178 QTextCodec *codecForNameOrNull( const QByteArray& n ) const;
179};
180
181#endif
KCharsets
Charset font and encoder/decoder handling.
Definition kcharsets.h:47
KCharsets::descriptiveEncodingNames
QStringList descriptiveEncodingNames() const
Lists the available encoding names together with a more descriptive language.
Definition kcharsets.cpp:659
KCharsets::encodingsByScript
QList< QStringList > encodingsByScript() const
Lists the available encoding names grouped by script (or language that uses them).
Definition kcharsets.cpp:672
KCharsets::languageForEncoding
QString languageForEncoding(const QString &encoding) const
Returns the language the encoding is used for.
Definition kcharsets.cpp:618
KCharsets::encodingForName
QString encodingForName(const QString &descriptiveName) const
Returns the encoding for a string obtained with descriptiveEncodingNames().
Definition kcharsets.cpp:642
KCharsets::KCharsets
KCharsets()
Protected constructor.
Definition kcharsets.cpp:486
KCharsets::codecForName
QTextCodec * codecForName(const QString &name) const
Provided for compatibility.
Definition kcharsets.cpp:696
KCharsets::availableEncodingNames
QStringList availableEncodingNames() const
Lists all available encodings as names.
Definition kcharsets.cpp:608
KCharsets::descriptionForEncoding
QString descriptionForEncoding(const QString &encoding) const
Returns a long description for an encoding name.
Definition kcharsets.cpp:630
KCharsets::resolveEntities
static QString resolveEntities(const QString &text)
Scans the given string for entities (like &amp;) and resolves them using fromEntity.
Definition kcharsets.cpp:562
KCharsets::toEntity
static QString toEntity(const QChar &ch)
Converts a QChar to an entity.
Definition kcharsets.cpp:555
KCharsets::fromEntity
static QChar fromEntity(const QString &str)
Converts an entity to a character.
Definition kcharsets.cpp:496
QList
Definition kaboutdata.h:33
QStringList
QString
kdecore_export.h
KGlobal
Access to the KDE global objects.
Definition kglobal.h:334
KGlobal::charsets
KCharsets * charsets()
The global charset manager.
Definition kglobal.cpp:214
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Tue Mar 25 2025 00:00:00 by doxygen 1.14.0 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
  • 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