TMmsGenUtils Class Reference

class TMmsGenUtils
Public Member Functions
TMmsGenUtils()
~TMmsGenUtils()
IMPORT_C voidAddAttributeL(const TDesC &, const TDesC &, CDesCArray &)
IMPORT_C TIntAddressTypeAndRealAddress(const TDesC &, TMmsAddressType &, TDes &, TInt, const TDesC &, const TDesC &)
IMPORT_C TPtrCAlias(const TDesC &, const TDesC &, const TDesC &)
IMPORT_C voidDecodeAndConvertMessageHeaderL(const TDesC8 &, TDes16 &, RFs &)
IMPORT_C voidDeleteAttribute(const TDesC &, CDesCArray &)
IMPORT_C TBoolDiskSpaceBelowCriticalLevelL(RFs *, TInt, TInt)
IMPORT_C TBoolFindAttribute(const TDesC &, const CDesCArray &)
IMPORT_C HBufC *GenerateAddressL(const TDesC &, const TDesC &, const TDesC &, const TDesC &)
IMPORT_C TIntGenerateDetails(const TDesC &, TDes &, TInt, RFs &)
IMPORT_C TIntGetAlias(const TDesC &, TDes &, TInt, RFs &)
IMPORT_C voidGetAliasForAllL(const CDesCArray &, CDesCArray &, TInt, RFs &)
IMPORT_C TPtrCGetAttributeL(const TDesC &, const CDesCArray &)
IMPORT_C voidGetDescriptionL(RFs &, const TDesC &, TInt, TPtrC8, TInt, TDes &)
IMPORT_C voidGetLoggingSettings(TBool &, TBool &)
IMPORT_C TBoolIsValidAddress(const TDesC &, TBool, const TDesC &, const TDesC &)
IMPORT_C TBoolIsValidEmailAddress(const TDesC &, TBool, const TDesC &, const TDesC &)
IMPORT_C TBoolIsValidMMSPhoneAddress(const TDesC &, TBool, const TDesC &, const TDesC &)
IMPORT_C voidLog(TRefByValue< const TDesC >, ...)
IMPORT_C TBoolNetworkOperationsAllowed()
IMPORT_C TPtrCPureAddress(const TDesC &, const TDesC &, const TDesC &)
IMPORT_C voidReplaceCRLFAndTrim(TDes16 &)
IMPORT_C voidReplaceCRLFAndTrim(TDes8 &)
Private Member Functions
TMmsGenUtils(const TMmsGenUtils &)
TInt DigitsToMatch()
voidDoGetAliasL(RFs &, const TDesC &, TDes &, TInt)
voidDoGetAliasL(const TDesC &, TDes &, TInt, CContactMatcher &, TInt)
TInt FindAttributePosition(const TDesC &, const CDesCArray &)
HBufC *GetContactNameInLowerCaseL(const MVPbkContactLink &, CContactMatcher &)
HBufC *GetContactNameL(const MVPbkContactLink &, CContactMatcher &)
TInt GetCurrentStoreIndexL(CVPbkContactLinkArray &)
CContactMatcher *OpenAllStoresL(RFs &)
TBool ShowContactNameL(CVPbkContactLinkArray *, TInt &, CContactMatcher &)
TMmsGenUtils &operator=(const TMmsGenUtils &)

Constructor & Destructor Documentation

TMmsGenUtils()

IMPORT_CTMmsGenUtils()

Constructor.

TMmsGenUtils(const TMmsGenUtils &)

TMmsGenUtils(const TMmsGenUtils &)[private]

Parameters

const TMmsGenUtils &

~TMmsGenUtils()

IMPORT_C~TMmsGenUtils()

Destructor.

Member Functions Documentation

AddAttributeL(const TDesC &, const TDesC &, CDesCArray &)

IMPORT_C voidAddAttributeL(const TDesC &aName,
const TDesC &aValue,
CDesCArray &aAttributeList
)[static]

Add attribute to an attribute array. No duplicates allowed If attribute exists, its value is changed

Parameters

const TDesC & aNameName of the attribute (case sensitive)
const TDesC & aValueValue of the attribute
CDesCArray & aAttributeListArray of attributes Leaves if memory runs out

AddressTypeAndRealAddress(const TDesC &, TMmsAddressType &, TDes &, TInt, const TDesC &, const TDesC &)

IMPORT_C TIntAddressTypeAndRealAddress(const TDesC &aAddress,
TMmsAddressType &aType,
TDes &aRealAddress,
TIntaMaxLength,
const TDesC &aOpen = KSepaOpen,
const TDesC &aClose = KSepaClose
)[static]

Resolve address type and the real address part excluding alias definition. NOTE: Ipv4 and IPv6 not yet supported.

Parameters

const TDesC & aAddressaddress to be resolved. May include alias part.
TMmsAddressType & aTypeaddress type (OUT)
TDes & aRealAddressreal address part (OUT)
TInt aMaxLengthmaximum length of the address.
const TDesC & aOpen = KSepaOpen
const TDesC & aClose = KSepaClose

Alias(const TDesC &, const TDesC &, const TDesC &)

IMPORT_C TPtrCAlias(const TDesC &aAddress,
const TDesC &aOpen = KSepaOpen,
const TDesC &aClose = KSepaClose
)[static]

Alias part from the address.

Parameters

const TDesC & aAddressaddress to be resolved.
const TDesC & aOpen = KSepaOpenreal address part start separator. Optional. Open bracket is default.
const TDesC & aClose = KSepaClosereal address part end separator. Optional. Close bracket is default.

DecodeAndConvertMessageHeaderL(const TDesC8 &, TDes16 &, RFs &)

IMPORT_C voidDecodeAndConvertMessageHeaderL(const TDesC8 &aInput,
TDes16 &aOutput,
RFs &aFs
)[static]

Removes all escapes from standard URIs, and replaces them with chars. The user is reponsible for allocating the aOutput object prior to calling the method. (e.g. <space> character coding is changed from "%20" to " ".)

Parameters

const TDesC8 & aInput'base64' or 'quoted-printable' encoded string (IN).
TDes16 & aOutput16 bit unicode descriptor containing the resulting string.
RFs & aFsopen file system handle

DeleteAttribute(const TDesC &, CDesCArray &)

IMPORT_C voidDeleteAttribute(const TDesC &aName,
CDesCArray &aAttributeList
)[static]

Delete named attribute from list

Parameters

const TDesC & aNameName of the attribute (case sensitive)
CDesCArray & aAttributeListArray of attributes

DigitsToMatch()

TInt DigitsToMatch()[private, static]

Get number of digits to be used when matching phone numbers

DiskSpaceBelowCriticalLevelL(RFs *, TInt, TInt)

IMPORT_C TBoolDiskSpaceBelowCriticalLevelL(RFs *aFs,
TIntaBytesToWrite,
TIntaDrive
)[static]

Generic method to check if free drive storage space is or will fall below Critical Level (CL). The CL per drive is defined by this module.

Parameters

RFs * aFsFile server session. Must be given if available in the caller. If NULL this method will create a temporary session for a check, but then the check is more expensive.
TInt aBytesToWritenumber of bytes the caller is about to add FFS.The value 0 checks if the current space is already below the CL.
TInt aDrivenumber of the drive to be checked. (see TDriveNumber of f32file.h)

DoGetAliasL(RFs &, const TDesC &, TDes &, TInt)

voidDoGetAliasL(RFs &aFs,
const TDesC &aAddress,
TDes &aAlias,
TIntaMaxLength
)[private, static]

Generate alias from ContactDb based on given address.

Parameters

RFs & aFsfile system
const TDesC & aAddressreal address
TDes & aAliasgenerated alias name (OUT)
TInt aMaxLengthmaximum length of the alias

DoGetAliasL(const TDesC &, TDes &, TInt, CContactMatcher &, TInt)

voidDoGetAliasL(const TDesC &aAddress,
TDes &aAlias,
TIntaMaxLength,
CContactMatcher &aContactMatcher,
TIntaDigitsToMatch
)[private, static]

Generate aliases from ContactDb based on given address. This is optimized version of the previous DoGetAliasL because the contact db is opened before calling this function. Opening the db is quite an time consuming operation.

Parameters

const TDesC & aAddressreal address
TDes & aAliasgenerated alias name (OUT)
TInt aMaxLengthmaximum length of the alias
CContactMatcher & aContactMatcherpointer to contact matcher
TInt aDigitsToMatchnumber of digits to match

FindAttribute(const TDesC &, const CDesCArray &)

IMPORT_C TBoolFindAttribute(const TDesC &aName,
const CDesCArray &aAttributeList
)[static]

Check if attribute is present

Parameters

const TDesC & aNameName of the attribute (case sensitive)
const CDesCArray & aAttributeListArray of attributes

FindAttributePosition(const TDesC &, const CDesCArray &)

TInt FindAttributePosition(const TDesC &aName,
const CDesCArray &aAttributeList
)[private, static]

Find position of attribute

Parameters

const TDesC & aNameName of the attribute (case sensitive)
const CDesCArray & aAttributeListArray of attributes

GenerateAddressL(const TDesC &, const TDesC &, const TDesC &, const TDesC &)

IMPORT_C HBufC *GenerateAddressL(const TDesC &aRealAddress,
const TDesC &aAlias,
const TDesC &aOpen = KSepaOpen,
const TDesC &aClose = KSepaClose
)[static]

Generate address from given address and alias

Parameters

const TDesC & aRealAddressreal address
const TDesC & aAliasalias part
const TDesC & aOpen = KSepaOpenreal address part start separator. Optional. Open bracket is default.
const TDesC & aClose = KSepaClosereal address part end separator. Optional. Close bracket is default.

GenerateDetails(const TDesC &, TDes &, TInt, RFs &)

IMPORT_C TIntGenerateDetails(const TDesC &aAddress,
TDes &aAlias,
TIntaMaxLength,
RFs &aFs
)[static]

Generate message details (alias) from ContactDb based on given address. Only default separators <> are allowed (compatibility with email)

Since
3.1

Parameters

const TDesC & aAddressaddress. May include alias part, which will be the result.
TDes & aAliasgenerated alias name (OUT). If no match in contact db then this is a real address part of aAddress.
TInt aMaxLengthmaximum length of the alias
RFs & aFsfile system

GetAlias(const TDesC &, TDes &, TInt, RFs &)

IMPORT_C TIntGetAlias(const TDesC &aAddress,
TDes &aAlias,
TIntaMaxLength,
RFs &aFs
)[static]

Get alias from ContactDb based on given address.

Since
3.1

Parameters

const TDesC & aAddressaddress (pure real address).
TDes & aAliasgenerated alias name (OUT).
TInt aMaxLengthmaximum length of the alias
RFs & aFsfile system

GetAliasForAllL(const CDesCArray &, CDesCArray &, TInt, RFs &)

IMPORT_C voidGetAliasForAllL(const CDesCArray &aAddress,
CDesCArray &aAlias,
TIntaMaxLength,
RFs &aFs
)[static]

Get alias from ContactDb based on given address.

Since
3.1

Parameters

const CDesCArray & aAddressArray of addresses (pure real address).
CDesCArray & aAliasArray of generated alias names (OUT).
TInt aMaxLengthmaximum length of the alias
RFs & aFsfile system Leaves in case of error

GetAttributeL(const TDesC &, const CDesCArray &)

IMPORT_C TPtrCGetAttributeL(const TDesC &aName,
const CDesCArray &aAttributeList
)[static]

Get value for an attribute.

Parameters

const TDesC & aNameName of the attribute (case sensitive)
const CDesCArray & aAttributeListArray of attributes

GetContactNameInLowerCaseL(const MVPbkContactLink &, CContactMatcher &)

HBufC *GetContactNameInLowerCaseL(const MVPbkContactLink &aContactLink,
CContactMatcher &aContactMatcher
)[private, static]

extracts contact name and converts to lower case chars. Caller must delete the name buffer returned

Parameters

const MVPbkContactLink & aContactLink- contact link
CContactMatcher & aContactMatcher- contact matcher

GetContactNameL(const MVPbkContactLink &, CContactMatcher &)

HBufC *GetContactNameL(const MVPbkContactLink &aContactLink,
CContactMatcher &aContactMatcher
)[private, static]

extracts contact name out of the contact link passed Caller must delete the name buffer returned

Parameters

const MVPbkContactLink & aContactLink- contact link
CContactMatcher & aContactMatcher- contact matcher

GetCurrentStoreIndexL(CVPbkContactLinkArray &)

TInt GetCurrentStoreIndexL(CVPbkContactLinkArray &aLinkArray)[private, static]

Gets the index of contact match in current store. If multiple matches are found in current store, then the link Array is modified to include only current store contact matches for further name mapping. else, link array can be used as is for further name mapping

Parameters

CVPbkContactLinkArray & aLinkArray

GetDescriptionL(RFs &, const TDesC &, TInt, TPtrC8, TInt, TDes &)

IMPORT_C voidGetDescriptionL(RFs &aFs,
const TDesC &aPath,
TIntaFileSize,
TPtrC8aMimetype,
TIntaCharSet,
TDes &aDescription
)[static]

Get message's description.

Parameters

RFs & aFs
const TDesC & aPathfull path of the attachment binary file
TInt aFileSizeattachment size
TPtrC8 aMimetype
TInt aCharSetattachment character set MIBEnum value.
TDes & aDescriptionmessage entry's description (OUT). Truncated as necessary to fit into return value.

GetLoggingSettings(TBool &, TBool &)

IMPORT_C voidGetLoggingSettings(TBool &aDecodeLoggingOn,
TBool &aDumpOn
)[static]
Read decode logging and dump settings from central repository
Since
3.2

Parameters

TBool & aDecodeLoggingOntells if detailed logging is needed
TBool & aDumpOntells if binary dump of message is needed

IsValidAddress(const TDesC &, TBool, const TDesC &, const TDesC &)

IMPORT_C TBoolIsValidAddress(const TDesC &aAddress,
TBoolaReal = ETrue,
const TDesC &aOpen = KSepaOpen,
const TDesC &aClose = KSepaClose
)[static]

Validate the address. The address must be EMail address or MMS global phone number address.

Parameters

const TDesC & aAddressaddress to be resolved.
TBool aReal = ETrueis true if address is real address excluding alias definition.
const TDesC & aOpen = KSepaOpenreal address part start separator. Optional. Open bracket is default.
const TDesC & aClose = KSepaClosereal address part end separator. Optional. Close bracket is default.

IsValidEmailAddress(const TDesC &, TBool, const TDesC &, const TDesC &)

IMPORT_C TBoolIsValidEmailAddress(const TDesC &aAddress,
TBoolaReal = ETrue,
const TDesC &aOpen = KSepaOpen,
const TDesC &aClose = KSepaClose
)[static]

Validate that the address contains valid EMail address.

Parameters

const TDesC & aAddressaddress to be resolved.
TBool aReal = ETrueis true if address is real address excluding alias definition.
const TDesC & aOpen = KSepaOpenreal address part start separator. Optional. Open bracket is default.
const TDesC & aClose = KSepaClosereal address part end separator. Optional. Close bracket is default.

IsValidMMSPhoneAddress(const TDesC &, TBool, const TDesC &, const TDesC &)

IMPORT_C TBoolIsValidMMSPhoneAddress(const TDesC &aAddress,
TBoolaReal = ETrue,
const TDesC &aOpen = KSepaOpen,
const TDesC &aClose = KSepaClose
)[static]

Validate that the address contains valid MMS global phone number address. You do not need to strip off the alias before this method.

Parameters

const TDesC & aAddressaddress to be resolved.
TBool aReal = ETrueis true if address is real address without alias definition.
const TDesC & aOpen = KSepaOpenreal address part start separator. Optional. Open bracket is default.
const TDesC & aClose = KSepaClosereal address part end separator. Optional. Close bracket is default.

Log(TRefByValue< const TDesC >, ...)

IMPORT_C voidLog(TRefByValue< const TDesC >aFmt,
...
)[static]

Write message to MMS client log

Parameters

TRefByValue< const TDesC > aFmtlike sprintf params in C++.
...

NetworkOperationsAllowed()

IMPORT_C TBoolNetworkOperationsAllowed()[static]

Check if network operations are allowed

OpenAllStoresL(RFs &)

CContactMatcher *OpenAllStoresL(RFs &aFs)[private, static]

Create contact match wrapper and open all stores Caller must close stores and delete contact matcher when no longer needed

Parameters

RFs & aFsfile system

PureAddress(const TDesC &, const TDesC &, const TDesC &)

IMPORT_C TPtrCPureAddress(const TDesC &aAddress,
const TDesC &aOpen = KSepaOpen,
const TDesC &aClose = KSepaClose
)[static]

Real address excluding alias part.

Parameters

const TDesC & aAddressaddress to be resolved.
const TDesC & aOpen = KSepaOpenreal address part start separator. Optional. Open bracket is default.
const TDesC & aClose = KSepaClosereal address part end separator. Optional. Close bracket is default.

ReplaceCRLFAndTrim(TDes16 &)

IMPORT_C voidReplaceCRLFAndTrim(TDes16 &aDes)[static]

Replaces CRs + LFs with spaces and trims all white spaces.

Parameters

TDes16 & aDesstring where to replace CRs + LFs (IN/OUT)

ReplaceCRLFAndTrim(TDes8 &)

IMPORT_C voidReplaceCRLFAndTrim(TDes8 &aDes)[static]

Replaces CRs + LFs with spaces and trims all white spaces.

Parameters

TDes8 & aDesstring where to replace CRs + LFs (IN/OUT)

ShowContactNameL(CVPbkContactLinkArray *, TInt &, CContactMatcher &)

TBool ShowContactNameL(CVPbkContactLinkArray *aLinkArray,
TInt &aNameIndex,
CContactMatcher &aContactMatcher
)[private, static]

checks if contact names in the linkArray are identical. Can be used t Caller must delete the name buffer returned

Parameters

CVPbkContactLinkArray * aLinkArray
TInt & aNameIndex- index of the name to be finally shown(output param)
CContactMatcher & aContactMatcher- contact matcher

operator=(const TMmsGenUtils &)

TMmsGenUtils &operator=(const TMmsGenUtils &)[private]

Parameters

const TMmsGenUtils &