• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdecore
 

tdecore

Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends | List of all members
KCharsets Class Reference

#include <kcharsets.h>

Public Member Functions

virtual ~KCharsets ()
 
TQTextCodec * codecForName (const TQString &name) const
 
TQTextCodec * codecForName (const TQString &n, bool &ok) const
 
TQStringList availableEncodingNames ()
 
TQStringList descriptiveEncodingNames ()
 
TQString languageForEncoding (const TQString &encoding)
 
TQString encodingForName (const TQString &descriptiveName)
 
TQString descriptiveNameForEncoding (const TQString &encodingName)
 

Static Public Member Functions

static TQChar fromEntity (const TQString &str)
 
static TQChar fromEntity (const TQString &str, int &len)
 
static TQString toEntity (const TQChar &ch)
 
static TQString resolveEntities (const TQString &text)
 

Protected Member Functions

 KCharsets ()
 

Friends

class TDEGlobal
 

Detailed Description

Charset font and encoder/decoder handling.

This is needed, because Qt's font matching algorithm gives the font family a higher priority than the charset. For many applications this is not acceptable, since it can totally obscure the output, in languages which use non iso-8859-1 charsets.

Author
Lars Knoll knoll.nosp@m.@kde.nosp@m..org

Definition at line 43 of file kcharsets.h.

Constructor & Destructor Documentation

◆ KCharsets()

KCharsets::KCharsets ( )
protected

Protected constructor.

If you need the kcharsets object, use TDEGlobal::charsets() instead.

Definition at line 360 of file kcharsets.cpp.

◆ ~KCharsets()

KCharsets::~KCharsets ( )
virtual

Destructor.

Definition at line 365 of file kcharsets.cpp.

Member Function Documentation

◆ availableEncodingNames()

TQStringList KCharsets::availableEncodingNames ( )

Lists all available encodings as names.

Returns
the list of all encodings

Definition at line 475 of file kcharsets.cpp.

◆ codecForName() [1/2]

TQTextCodec * KCharsets::codecForName ( const TQString &  n,
bool &  ok 
) const

Tries to find a TQTextCodec to convert the given encoding from and to Unicode.

If no codec could be found the latin1 codec will be returned an ok will be set to false.

Returns
the TQTextCodec. If the desired codec could not be found, it returns a default (Latin-1) codec

Definition at line 539 of file kcharsets.cpp.

◆ codecForName() [2/2]

TQTextCodec * KCharsets::codecForName ( const TQString &  name) const

Provided for compatibility.

Parameters
namethe name of the codec
Returns
the TQTextCodec. If the desired codec could not be found, it returns a default (Latin-1) codec

Definition at line 533 of file kcharsets.cpp.

◆ descriptiveEncodingNames()

TQStringList KCharsets::descriptiveEncodingNames ( )

Lists the available encoding names together with a more descriptive language.

Returns
the list of descriptive encoding names

Definition at line 520 of file kcharsets.cpp.

◆ descriptiveNameForEncoding()

TQString KCharsets::descriptiveNameForEncoding ( const TQString &  encodingName)

Returns the descriptive encoding name for an encoding name.

Parameters
encodingNamethe name of the encoding
Returns
the descriptive name for the encoding

Definition at line 509 of file kcharsets.cpp.

◆ encodingForName()

TQString KCharsets::encodingForName ( const TQString &  descriptiveName)

Returns the encoding for a string obtained with descriptiveEncodingNames().

Parameters
descriptiveNamethe descriptive name for the encoding
Returns
the name of the encoding

Definition at line 492 of file kcharsets.cpp.

◆ fromEntity() [1/2]

TQChar KCharsets::fromEntity ( const TQString &  str)
static

Converts an entity to a character.

The string must contain only the entity without the trailing ';'.

Parameters
strthe entity
Returns
TQChar::null if the entity could not be decoded.

Definition at line 370 of file kcharsets.cpp.

◆ fromEntity() [2/2]

TQChar KCharsets::fromEntity ( const TQString &  str,
int &  len 
)
static

Overloaded member function.

Tries to find an entity in the TQString str.

Parameters
strthe string containing entified
lenis a return value, that gives the length of the decoded entity.
Returns
a decoded entity if one could be found, TQChar::null otherwise

Definition at line 406 of file kcharsets.cpp.

◆ languageForEncoding()

TQString KCharsets::languageForEncoding ( const TQString &  encoding)

Returns the language the encoding is used for.

Parameters
encodingthe encoding for the language
Returns
the language of the encoding

Definition at line 485 of file kcharsets.cpp.

◆ resolveEntities()

TQString KCharsets::resolveEntities ( const TQString &  text)
static

Scans the given string for entities (like &amp;) and resolves them using fromEntity.

Parameters
textthe string containing the entities
Returns
the clean string
Since
3.1

Definition at line 429 of file kcharsets.cpp.

◆ toEntity()

TQString KCharsets::toEntity ( const TQChar &  ch)
static

Converts a TQChar to an entity.

The returned string does already contain the leading '&' and the trailing ';'.

Parameters
chthe char to convert
Returns
the entity

Definition at line 422 of file kcharsets.cpp.

Friends And Related Function Documentation

◆ TDEGlobal

friend class TDEGlobal
friend

Definition at line 45 of file kcharsets.h.


The documentation for this class was generated from the following files:
  • kcharsets.h
  • kcharsets.cpp

tdecore

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

tdecore

Skip menu "tdecore"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdecore by doxygen 1.9.4
This website is maintained by Timothy Pearson.