MWAWFontConverterInternal::State Class Reference

the default font converter More...

Classes

struct  UnicodeCache
 small structure to speedup unicode More...

Public Member Functions

 State ()
 the constructor
int getUnusedId ()
 returns an unused id
int getId (std::string const &name, std::string family="")
 
returns the identificator for a name,

if not set creates one

std::string getName (int macId)
 returns the name corresponding to an id or return std::string("")
int unicode (int macId, unsigned char c)
int unicode (int macId, unsigned char c, MWAWInputStreamPtr &input)
int unicode (int macId, unsigned char c, unsigned char const *(&str), int len)
 converts a character in unicode, if needed can read the next input caracter in str
void getOdtInfo (int macId, std::string &nm, int &deltaSize)
 
final font name and a delta which can be used to change the size

if no name is found, return "Times New Roman"

void setCorrespondance (int macId, std::string const &name, std::string family="")
 fixes the name corresponding to an id

Protected Member Functions

void initMaps ()
 initializes the map
bool updateCache (int macId)
 try to update the cache

Protected Attributes

MWAWFontConverterInternal::Data::KnownConversion m_knownConversion
 the basic conversion map
std::map< int, std::string > m_idNameMap
 map sysid -> font name
std::map< std::string, int > m_nameIdMap
 map font name -> sysid
long m_nameIdCounter
 Internal: a counter modified when a new correspondance name<->id is found.
int m_uniqueId
 a int used to create new id for a name
shared_ptr< MWAWFontSJISConverterm_sjisConverter
 a SJIS convertor to convert Shit-JIS font
struct
MWAWFontConverterInternal::State::UnicodeCache 
m_unicodeCache

Detailed Description

the default font converter

Constructor & Destructor Documentation

MWAWFontConverterInternal::State::State ( )
inline

the constructor

Member Function Documentation

int MWAWFontConverterInternal::State::getId ( std::string const &  name,
std::string  family = "" 
)
inline

returns the identificator for a name,

if not set creates one

std::string MWAWFontConverterInternal::State::getName ( int  macId)
inline

returns the name corresponding to an id or return std::string("")

Referenced by getOdtInfo(), and updateCache().

void MWAWFontConverterInternal::State::getOdtInfo ( int  macId,
std::string &  nm,
int &  deltaSize 
)

final font name and a delta which can be used to change the size

if no name is found, return "Times New Roman"

int MWAWFontConverterInternal::State::getUnusedId ( )
inline

returns an unused id

Referenced by getId().

void MWAWFontConverterInternal::State::initMaps ( )
protected

initializes the map

Referenced by State().

void MWAWFontConverterInternal::State::setCorrespondance ( int  macId,
std::string const &  name,
std::string  family = "" 
)
inline

fixes the name corresponding to an id

Referenced by getId().

int MWAWFontConverterInternal::State::unicode ( int  macId,
unsigned char  c 
)
int MWAWFontConverterInternal::State::unicode ( int  macId,
unsigned char  c,
MWAWInputStreamPtr input 
)
int MWAWFontConverterInternal::State::unicode ( int  macId,
unsigned char  c,
unsigned char const *&  str,
int  len 
)

converts a character in unicode, if needed can read the next input caracter in str

Returns
-1 if the character is not transformed
bool MWAWFontConverterInternal::State::updateCache ( int  macId)
protected

try to update the cache

Referenced by unicode().

Member Data Documentation

std::map<int, std::string> MWAWFontConverterInternal::State::m_idNameMap
protected

map sysid -> font name

Referenced by getName(), getUnusedId(), initMaps(), and setCorrespondance().

MWAWFontConverterInternal::Data::KnownConversion MWAWFontConverterInternal::State::m_knownConversion
protected

the basic conversion map

Referenced by getOdtInfo(), setCorrespondance(), and updateCache().

long MWAWFontConverterInternal::State::m_nameIdCounter
protected

Internal: a counter modified when a new correspondance name<->id is found.

Referenced by setCorrespondance(), and updateCache().

std::map<std::string, int> MWAWFontConverterInternal::State::m_nameIdMap
protected

map font name -> sysid

Referenced by getId(), initMaps(), and setCorrespondance().

shared_ptr<MWAWFontSJISConverter> MWAWFontConverterInternal::State::m_sjisConverter
protected

a SJIS convertor to convert Shit-JIS font

Referenced by unicode().

struct MWAWFontConverterInternal::State::UnicodeCache MWAWFontConverterInternal::State::m_unicodeCache
protected

Referenced by unicode(), and updateCache().

int MWAWFontConverterInternal::State::m_uniqueId
protected

a int used to create new id for a name

Referenced by getUnusedId().


The documentation for this class was generated from the following file:

Generated on Wed May 22 2013 18:12:48 for libmwaw by doxygen 1.8.1.2