1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
 
     2 // All rights reserved.
 
     3 // This component and the accompanying materials are made available
 
     4 // under the terms of "Eclipse Public License v1.0"
 
     5 // which accompanies this distribution, and is available
 
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
 
     8 // Initial Contributors:
 
     9 // Nokia Corporation - initial contribution.
 
    32 #include <dial_consts.h>
 
    38 const TInt KChargeCardRuleSize=32;
 
    43 const TInt KChargeCardAccountNumberSize=32;
 
    48 const TInt KChargeCardPinSize=8;
 
    51 Represents a dialling rule.
 
    54 typedef TBuf<KChargeCardRuleSize> TChargeCardRule ;
 
    56 Represents the charge card account number.
 
    59 typedef TBuf<KChargeCardAccountNumberSize> TChargeCardAccount ;
 
    61 Represents the charge card PIN number.
 
    64 typedef TBuf<KChargeCardPinSize> TChargeCardPin;
 
    67 Contains information about a charge card.  
 
    68 There are functions to get and set this information.
 
    70 @deprecated This class has been deprecated from 9.1 and should no longer be used.
 
    75 	IMPORT_C TChargeCard () ;
 
    77 				const TChargeCardAccount& aNumber,
 
    78 				const TChargeCardPin&  aPin ,
 
    79 				const TChargeCardRule& aLocalRule,
 
    80 				const TChargeCardRule& aNatRule,
 
    81 				const TChargeCardRule& aIntlRule) ;
 
    83 	IMPORT_C void SetNumber(const TDesC&);
 
    84 	IMPORT_C void SetPin(const TDesC&);
 
    85 	IMPORT_C void SetLocalRule (const TDesC&);
 
    86 	IMPORT_C void SetNatRule(const TDesC&);
 
    87 	IMPORT_C void SetIntlRule(const TDesC&);
 
    89 	IMPORT_C TBool ValidateChargeCardInfo() const;
 
    90 	IMPORT_C TPtrC Number() const;
 
    91 	IMPORT_C TPtrC Pin() const;
 
    92 	IMPORT_C TPtrC LocalRule () const;
 
    93 	IMPORT_C TPtrC NatRule() const;
 
    94 	IMPORT_C TPtrC IntlRule() const;
 
    97 	TChargeCardAccount iNumber;
 
    99 	TChargeCardRule iLocalRule;
 
   100 	TChargeCardRule iNatRule;
 
   101 	TChargeCardRule iIntlRule;
 
   105 This can be passed to TelephoneNumber::Parse() to define whether a 
 
   106 telephone number is for dialling or for display.
 
   117 Defines the size of TDialOutLocalCode
 
   120 const TInt KDialOutLocalCodeSize=4;
 
   122 Defines the size of TDialOutLongDistanceCode
 
   125 const TInt KDialOutLongDistanceCodeSize=4;
 
   127 Defines the size of TDisableCallWaitingCode
 
   130 const TInt KDisableCallWaitingCodeSize=8;
 
   132 Defines the size of TPhoneNumber
 
   135 const TInt KPhoneNumberSize=100;
 
   138 Descriptor for the Local Dial-Out Code.
 
   141 typedef	TBuf<KDialOutLocalCodeSize> TDialOutLocalCode ;
 
   143 Descriptor for the Long Distance Dial-Out Code.
 
   146 typedef	TBuf<KDialOutLongDistanceCodeSize> TDialOutLongDistanceCode ;
 
   148 Descriptor for code to disable call waiting
 
   151 typedef	TBuf<KDisableCallWaitingCodeSize> TDisableCallWaitingCode ;
 
   153 Descriptor for the phone number.
 
   156 typedef TBuf<KPhoneNumberSize> TPhoneNumber ;
 
   159 These flags are part of the location information stored by TDialLocation.
 
   163 	KPhoneNumberMobile              =0x00000001, 
 
   164 	KPhoneNumberUsePulseDial        =0x00000002, 
 
   165 	KPhoneNumberPbxUsePulseDial     =0x00000004, 
 
   166 	KPhoneNumberWaitForDialingTone  =0x00000008, 
 
   167 	KPhoneNumberWaitForProceedTone  =0x00000010, 
 
   168     KReturnPhoneNumberWithPlusFormat=0x00000020  
 
   175 const TInt KPhoneNumberDefaultFlags=KPhoneNumberUsePulseDial;
 
   178 Contains information about the current location
 
   179 such as international prefix code, area code etc.
 
   181 There are functions to get and set this information.
 
   183 @deprecated This class has been deprecated from 9.1 and should no longer be used.
 
   188 	IMPORT_C TDialLocation() ;
 
   189 	IMPORT_C TDialLocation(
 
   190 		const TIntlPrefCode & aIntlPrefCode,
 
   191 		const TNatPrefCode& aNatPrefCode,
 
   192 		const TNatCode& aNatCode,
 
   193 		const TAreaCode& aAreaCode,
 
   194 		const TDialOutLocalCode& aDialOutLocalCode,
 
   195 		const TDialOutLongDistanceCode& aDialOutLongDistanceCode,
 
   196 		const TDisableCallWaitingCode& aDisableCallWaitingCode,
 
   198 		TUint aPauseAfterDialout ) ;
 
   200 	IMPORT_C	void SetIntlPrefCode(const TDesC&) ;
 
   201 	IMPORT_C	void SetNatPrefCode(const TDesC&);
 
   202 	IMPORT_C	void SetNatCode(const TDesC&);
 
   203 	IMPORT_C	void SetAreaCode(const TDesC&);
 
   204 	IMPORT_C	void SetDialOutLocalCode(const TDesC&);
 
   205 	IMPORT_C	void SetDialOutLongDistanceCode(const TDesC&);
 
   206 	IMPORT_C	void SetDisableCallWaitingCode(const TDesC&);
 
   207 	IMPORT_C	void SetDialLocationFlags (TUint);
 
   208 	inline  	void ClearDialLocationFlags (TUint);
 
   209 	IMPORT_C	void SetPauseAfterDialout ( TUint);
 
   210 	IMPORT_C TPtrC IntlPrefCode() const ;
 
   211 	IMPORT_C TPtrC NatPrefCode() const;
 
   212 	IMPORT_C TPtrC NatCode() const;
 
   213 	IMPORT_C TPtrC AreaCode() const;
 
   214 	IMPORT_C TPtrC DialOutLocalCode() const;
 
   215 	IMPORT_C TPtrC DialOutLongDistanceCode() const;
 
   216 	IMPORT_C TPtrC DisableCallWaitingCode() const;
 
   217 	IMPORT_C TInt  PauseAfterDialout () const;
 
   218 	IMPORT_C TBool IsMobile () const ;
 
   219     inline   TBool IsReturnPhoneNumberWithPlusFormat() const;
 
   220 	IMPORT_C TBool IsUsePulseDial () const;
 
   221 	IMPORT_C TBool IsPbxUsePulseDial () const ;
 
   222 	IMPORT_C TBool IsWaitForDialingTone () const ;
 
   223 	IMPORT_C TBool IsWaitForProceedTone () const;
 
   224 	IMPORT_C TBool IsDialOutRequired () const;
 
   225 	IMPORT_C TBool IsDisableCallWaitingCode() const;
 
   228 	TIntlPrefCode iIntlPrefCode;
 
   229 	TNatPrefCode iNatPrefCode;
 
   232 	TDialOutLocalCode iDialOutLocalCode;
 
   233 	TDialOutLongDistanceCode iDialOutLongDistanceCode;
 
   234 	TDisableCallWaitingCode iDisableCallWaitingCode;
 
   236 	TUint iPauseAfterDialout;
 
   240 This can be passed to TelephoneNumber::Parse() to define whether the 
 
   241 dial string is in full or in the ‘+’ char format.
 
   245 enum TPlusFormatDialOptions
 
   247 	EPlusFormatDialNotAllow ,
 
   252 This option applies when the phone number being dialled is in the 
 
   253 same location as the dialler: It controls whether the area code 
 
   254 is included in the final dial string. 
 
   258 enum TCityDialOptions
 
   260 	EDialCityStripDuplicateAreaCode,
 
   261 	EDialCityAllowDuplicateAreaCode
 
   265 This can be passed to TelephoneNumber::Parse()  to define the 
 
   266 area code of the dialling and diallers locations.
 
   268 @deprecated This class has been deprecated from 9.1 and should no longer be used.
 
   275 	TNatPrefCode iNatPref;
 
   276 	TIntlPrefCode iIntlPref;
 
   281 A static class that provides functions to resolve telephone numbers.
 
   283 @deprecated This class has been deprecated from 9.1 and should no longer be used.
 
   285 class TelephoneNumber
 
   288 IMPORT_C static TInt Parse( 
 
   289               TDialString& aDialString ,
 
   290 			  const TDialLocation& aDialLocation , 
 
   291 			  const TChargeCard& aChargeCard,
 
   292 			  const TDesC& aPhoneNumber,
 
   293 			  TParseMode aParseMode ) ;
 
   295 IMPORT_C static TInt Parse ( TDialString& aDialString ,
 
   296 								const TDialLocation& aDialLocation, 
 
   297 								const TDesC& aPhoneNumber ); 
 
   299 IMPORT_C static TInt CalculateDialCityPrefix(
 
   300 						TDialString& aDialString ,
 
   301 						const TCityDialCodes& aFrom,
 
   302 						const TCityDialCodes& aTo,
 
   303 						TCityDialOptions aOption,
 
   304 						TChar aCodeSeparator ,
 
   305 						TPlusFormatDialOptions aPlusOption ) ;
 
   307 IMPORT_C static TInt Parse ( TDialString& aDialString ,
 
   308 								const TDialLocation& aDialLocation, 
 
   309 								const TDesC& aPhoneNumber, 
 
   310 								TCityDialOptions aOption) ;