Symbian
 Developer Library

DEVELOPER LIBRARY

[Index] [Glossary] [Previous] [Next]



Location: dial.h
Link against: dial.lib

Class TelephoneNumber

class TelephoneNumber;

Description

A static class that provides parsing functions for telephone numbers.

Defined in TelephoneNumber:
CalculateDialCityPrefix(), Parse(), Parse(), Parse()


Member functions


Parse()

static TInt Parse(TDialString& aDialString, const TDialLocation& aDialLocation, const TChargeCard& aChargeCard, const TDesC& aPhoneNumber, TParseMode aParseMode);

Description

Parses the specified telephone number after applying the rules contained in aChargeCard and places the result in aDialString.

The phone number (aPhoneNumber) must be specified using the following format:

+<International code>(<area code>)<subscriber number>

or

+<International code> <area code> <subscriber number>

For example, +44(207)563231.

Note that by default if the international and area codes of a specified number are the same as the current location, the returned parsed number will only contain the subscriber number. To force the international and area codes, use the next overloaded version of Parse() below.

Parameters

TDialString& aDialString

On return, contains the results of the parsed phone number.

const TDialLocation& aDialLocation

The current location information of the telephone equipment.

const TChargeCard& aChargeCard

Rules for international, national and local calls.

const TDesC& aPhoneNumber

The telephone number to dial.

TParseMode aParseMode

Specify if the parsed telephone number is for display or to be dialled.

Return value

TInt

KErrNone on success, otherwise, KErrOverflow.


Parse()

static TInt Parse(TDialString& aDialString, const TDialLocation& aDialLocation, const TDesC& aPhoneNumber, TCityDialOptions aOption);

Description

Parses the specified telephone number and places the result in aDialString.

Whether the international and area codes are included in the parsed output depends on how aOption is set.

The phone number (aPhoneNumber) must be specified using the following format:

+<International code>(<area code>)<subscriber number>

or

+<International code> <area code> <subscriber number>

For example, +44(207)563231.

Parameters

TDialString& aDialString

On return, contains the results of the parsed phone number.

const TDialLocation& aDialLocation

The current location information of the telephone equipment.

const TDesC& aPhoneNumber

The telephone number to dial.

TCityDialOptions aOption

Specify if the international and area codes should be included in the parsed output if they are the same as the current location.

Return value

TInt

KErrNone on success, otherwise, KErrOverflow.


Parse()

static TInt Parse(TDialString& aDialString, const TDialLocation& aDialLocation, const TDesC& aPhoneNumber);

Description

Parses the specified telephone number and places the result in aDialString.

If the international and area codes of a specified number are the same as the current location, the returned parsed number will only contain the subscriber number. To force the international and area codes, use the previous overloaded version of Parse() above.

The phone number (aPhoneNumber) must be specified using the following format:

+<International code>(<area code>)<subscriber number>

or

+<International code> <area code> <subscriber number>

For example, +44(207)563231.

Parameters

TDialString& aDialString

On return, contains the results of the parsed phone number.

const TDialLocation& aDialLocation

The current location information of the telephone equipment.

const TDesC& aPhoneNumber

The telephone number to dial.

Return value

TInt

KErrNone on success, otherwise, KErrOverflow.


CalculateDialCityPrefix()

static TInt CalculateDialCityPrefix(TDialString& aDialString, const TCityDialCodes& aFrom, const TCityDialCodes& aTo, TCityDialOptions aOption, TChar aCodeSeparator, TPlusFormatDialOptions aPlusOption);

Description

Formats a city dial code and places the result in aDialString.

This function compares two TCityDialCodes; if the two differ, then the difference is formatted and the result placed in aDialString.

For example, if aFrom.iNatPrefCode and aFrom.iAreaCode equalled '44' and '207' and aTo.iNatPrefCode and aTo.iAreaCodewas equaled '31' and '55' then the formatted result would be '0031-55' (assuming that TDialLocation::IntlPrefCode() = '00' and aCodeSeparator = '-').

Parameters

TDialString& aDialString

On return, contains the results of the formatted city dial code.

const TCityDialCodes& aFrom

The international and area codes of the specified source location.

const TCityDialCodes& aTo

The international and area codes of the specified destination location.

TCityDialOptions aOption

Specify if the international and area codes should be included in the parsed output if they are the same as the source location. This should always be EDialCityAllowDuplicateAreaCode.

TChar aCodeSeparator

The character to use to separate the international part of the result from the area code.

TPlusFormatDialOptions aPlusOption

Specify if the '+' character should be used rather than TDialLocation::IntlPrefCode() to prefix the country code.

Return value

TInt

KErrNone on success, otherwise, KErrOverflow.