Documentation  |   Table of Contents   |  < Previous   |  Next >  

122    TextMgr.h

Porting Applications to Palm OS® Cobalt

Exploring Palm OS®

The APIs declared in this file are largely unchanged, except for a number of parameters and return values that were changed from either UInt16 or UInt32 to size_t.

Deleted APIs ^TOP^

Table 122.1  Deleted functions

Deleted API

Use instead

TxtCharWidth()

FntCharWidth()

Modified APIs ^TOP^

Table 122.2  Modified functions 

Modified API

Description of change

int16_t TxtCaselessCompare (const char *, size_t, size_t *, const char *, size_t, size_t *)

The parameters that specify lengths—s1Len, s1MatchLen, s2Len, and s2MatchLen—have changed from UInt16 to size_t.

uint32_t TxtCharAttr (wchar32_t)

This function formerly returned a UInt16.

wchar32_t TxtCharBounds (const char *, size_t, size_t *, size_t *)

The inOffset, outStart, and outEnd parameters changed from UInt32 to size_t.

size_t TxtCharSize (wchar32_t)

This function formerly returned a UInt16.

uint32_t TxtCharXAttr (wchar32_t)

This function formerly returned a UInt16.

int16_t TxtCompare (const char *, size_t, size_t *, const char *, size_t, size_t *)

The parameters that specify lengths—s1Len, s1MatchLen, s2Len, and s2MatchLen—have changed from UInt16 to size_t.

status_t TxtConvertEncoding (Boolean, TxtConvertStateType *, const char *, size_t *, CharEncodingType, char *, size_t *, CharEncodingType, const char *, size_t)

The three parameters that specify buffer lengths—ioSrcBytes, ioDstBytes, and substitutionLen—have changed from UInt16 to size_t. Also note that in Palm OS Garnet the substitution string had to be valid in the destination encoding. In Palm OS Cobalt the substitution string is assumed to be in UTF8 encoding.

Boolean TxtFindString (const char *, const char *, size_t *, size_t *)

The outPos parameter changed from UInt32 to size_t. The outLength parameter changed from UInt16 to size_t.

wchar32_t TxtGetChar (const char *, size_t)

The inOffset parameter changed from UInt32 to size_t.

size_t TxtGetNextChar (const char *, size_t, wchar32_t *)

The inOffset parameter changed from UInt32 to size_t. Also, this function now returns a size_t; formerly it returned a UInt16.

size_t TxtGetPreviousChar (const char *, size_t, wchar32_t *)

The inOffset parameter changed from UInt32 to size_t. Also, this function now returns a size_t; formerly it returned a UInt16.

size_t TxtGetTruncationOffset (const char *, size_t)

The inOffset parameter changed from UInt32 to size_t.

size_t TxtGetWordWrapOffset (const char *, size_t)

The iOffset parameter changed from UInt32 to size_t.

uint16_t TxtReplaceStr (char *, size_t, const char *, uint16_t)

The inMaxLen parameter changed from UInt16 to size_t.

size_t TxtSetNextChar (char *, size_t, wchar32_t)

The inOffset parameter changed from UInt32 to size_t.

status_t TxtTransliterate (const char *, size_t, char *, size_t *, TranslitOpType)

The inSrcLength and ioDstLength parameters have changed from UInt16 to size_t.

Boolean TxtWordBounds (const char *, size_t, size_t, size_t *, size_t *)

The inLength, inOffset, outStart, and outEnd parameters have changed from UInt32 to size_t.

Table 122.3  Modified types

Modified API

Description of change

typedef uint16_t CharEncodingType

Formerly was a UInt8.

Table 122.4  Modified #defines

Modified API

Description of change

#define charEncodingDstBestFitFlag 0x8000

Formerly had a value of 0x80.

#define maxCharBytes 4

Formerly had a value of 3.

Unchanged APIs ^TOP^

Table 122.5  Unchanged functions 

TxtByteAttr()

TxtCharEncoding()

TxtCharIsValid()

TxtEncodingName()

TxtMaxEncoding()

TxtNameToEncoding()

TxtParamString()

TxtStrEncoding()

Table 122.6  Unchanged macros

sizeOf7BitChar()

TxtCharIsAlNum()

TxtCharIsAlpha()

TxtCharIsCntrl()

TxtCharIsDelim()

TxtCharIsDigit()

TxtCharIsGraph()

TxtCharIsHardKey()

TxtCharIsHex()

TxtCharIsLower()

TxtCharIsPrint()

TxtCharIsPunct()

TxtCharIsSpace()

TxtCharIsUpper()

TxtCharIsVirtual()

TxtNextCharSize()

TxtPreviousCharSize()

Table 122.7  Unchanged structures

TxtConvertStateType

Table 122.8  Unchanged types

TranslitOpType

Table 122.9  Unchanged #defines 

byteAttrFirst

byteAttrHighLow

byteAttrLast

byteAttrMiddle

byteAttrSingle

byteAttrSingleLow

charAttrAlNum

charAttrAlpha

charAttr_BB

charAttr_CN

charAttrCntrl

charAttrDelim

charAttr_DI

charAttrGraph

charAttr_LO

charAttrPrint

charAttr_PU

charAttr_SP

charAttrSpace

charAttr_UP

charAttr_XA

charAttr_XD

charAttr_XS

charEncodingHasDoubleByte

charEncodingHasLigatures

charEncodingOnlySingleByte

charEncodingRightToLeft

kTxtConvertStateSize

textSubstitutionEncoding

translitOpCustomBase

translitOpLowerCase

translitOpPreprocess

translitOpReserved2

translitOpReserved3

translitOpStandardBase

translitOpUpperCase

txtErrConvertOverflow

txtErrConvertUnderflow

txtErrMalformedText

txtErrNoCharMapping

txtErrTranslitOverflow

txtErrTranslitOverrun

txtErrTranslitUnderflow

txtErrUknownTranslitOp

txtErrUnknownEncoding

txtErrUnknownEncodingFallbackCopy