smsprotocols/smsstack/gsmu/src/Gsmuelem.cpp
branchRCL_3
changeset 65 630d2f34d719
parent 14 7ef16719d8cb
child 66 07a122eea281
equal deleted inserted replaced
61:17af172ffa5f 65:630d2f34d719
     1 // Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 1999-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
    17 
    17 
    18 /**
    18 /**
    19  @file
    19  @file
    20 */
    20 */
    21 
    21 
       
    22 
       
    23 #include "OstTraceDefinitions.h"
       
    24 #ifdef OST_TRACE_COMPILER_IN_USE
       
    25 #include "GsmuelemTraces.h"
       
    26 #endif
       
    27 
    22 #include <gsmuelem.h>
    28 #include <gsmuelem.h>
    23 #include <gsmumsg.h>
    29 #include <gsmumsg.h>
    24 #include "Gsmumain.h"
    30 #include "Gsmumain.h"
    25 #include <gsmusar.h>
    31 #include <gsmusar.h>
    26 #include "gsmupriv.h"
    32 #include "gsmupriv.h"
   180 	} // TSmsStatus::TSmsStatus
   186 	} // TSmsStatus::TSmsStatus
   181 
   187 
   182 
   188 
   183 CSmsCommandData* CSmsCommandData::NewL(TSmsFirstOctet& aFirstOctet)
   189 CSmsCommandData* CSmsCommandData::NewL(TSmsFirstOctet& aFirstOctet)
   184 	{
   190 	{
   185 	LOGGSMU1("CSmsCommandData::NewL()");
   191 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSCOMMANDDATA_NEWL_1, "CSmsCommandData::NewL()");
   186 
   192 
   187 	CSmsCommandData* commanddata=new(ELeave) CSmsCommandData(aFirstOctet);
   193 	CSmsCommandData* commanddata=new(ELeave) CSmsCommandData(aFirstOctet);
   188 	CleanupStack::PushL(commanddata);
   194 	CleanupStack::PushL(commanddata);
   189 	TPtrC8 ptr;
   195 	TPtrC8 ptr;
   190 	commanddata->SetDataL(ptr);
   196 	commanddata->SetDataL(ptr);
   205  * 
   211  * 
   206  *  @return  Pointer to the newly created CSmsCommandData object.
   212  *  @return  Pointer to the newly created CSmsCommandData object.
   207  */
   213  */
   208 CSmsCommandData* CSmsCommandData::DuplicateL() const
   214 CSmsCommandData* CSmsCommandData::DuplicateL() const
   209 	{
   215 	{
   210 	LOGGSMU1("CSmsCommandData::DuplicateL()");
   216 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSCOMMANDDATA_DUPLICATEL_1, "CSmsCommandData::DuplicateL()");
   211 
   217 
   212 	CSmsCommandData*  smsCommandData = CSmsCommandData::NewL(iFirstOctet);
   218 	CSmsCommandData*  smsCommandData = CSmsCommandData::NewL(iFirstOctet);
   213 	CleanupStack::PushL(smsCommandData);
   219 	CleanupStack::PushL(smsCommandData);
   214 
   220 
   215 	smsCommandData->SetDataL(Data());
   221 	smsCommandData->SetDataL(Data());
   226 	} // CSmsCommandData::DuplicateL
   232 	} // CSmsCommandData::DuplicateL
   227 
   233 
   228 
   234 
   229 CSmsInformationElement& CSmsCommandData::InformationElement(TInt aIndex) const
   235 CSmsInformationElement& CSmsCommandData::InformationElement(TInt aIndex) const
   230 	{
   236 	{
   231 	LOGGSMU1("CSmsCommandData::InformationElement()");
   237 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSCOMMANDDATA_INFORMATIONELEMENT_1, "CSmsCommandData::InformationElement()");
   232 
   238 
   233 	CSmsInformationElement* ie=iInformationElementArray[aIndex];
   239 	CSmsInformationElement* ie=iInformationElementArray[aIndex];
   234 	return *ie;
   240 	return *ie;
   235 	} // CSmsCommandData::InformationElement
   241 	} // CSmsCommandData::InformationElement
   236 
   242 
   238 CSmsInformationElement*& CSmsCommandData::InformationElementPtr(TInt aIndex)
   244 CSmsInformationElement*& CSmsCommandData::InformationElementPtr(TInt aIndex)
   239     {
   245     {
   240     // Ignore in code coverage - not used in SMS stack and not exported
   246     // Ignore in code coverage - not used in SMS stack and not exported
   241     // but cannot be removed as impacts public header.
   247     // but cannot be removed as impacts public header.
   242     BULLSEYE_OFF    
   248     BULLSEYE_OFF    
   243     LOGGSMU1("CSmsCommandData::InformationElementPtr()");
   249     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSCOMMANDDATA_INFORMATIONELEMENTPTR_1, "CSmsCommandData::InformationElementPtr()");
   244     return iInformationElementArray[aIndex];
   250     return iInformationElementArray[aIndex];
   245     BULLSEYE_RESTORE
   251     BULLSEYE_RESTORE
   246     }
   252     }
   247 
   253 
   248 TBool CSmsCommandData::InformationElementIndex(CSmsInformationElement::TSmsInformationElementIdentifier aIdentifier,
   254 TBool CSmsCommandData::InformationElementIndex(CSmsInformationElement::TSmsInformationElementIdentifier aIdentifier,
   249 		TInt& aIndex) const
   255 		TInt& aIndex) const
   250 	{
   256 	{
   251 	LOGGSMU1("CSmsCommandData::InformationElementIndex()");
   257 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSCOMMANDDATA_INFORMATIONELEMENTINDEX_1, "CSmsCommandData::InformationElementIndex()");
   252 
   258 
   253 	TBool found=EFalse;
   259 	TBool found=EFalse;
   254 	TInt count=NumInformationElements();
   260 	TInt count=NumInformationElements();
   255 	for (TInt i=0; (!found) && (i<count); i++)
   261 	for (TInt i=0; (!found) && (i<count); i++)
   256 		if (InformationElement(i).Identifier()==aIdentifier)
   262 		if (InformationElement(i).Identifier()==aIdentifier)
   262 	} // CSmsCommandData::InformationElementIndex
   268 	} // CSmsCommandData::InformationElementIndex
   263 
   269 
   264 
   270 
   265 void CSmsCommandData::AddInformationElementL(const TSmsId aIdentifier,const TDesC8& aData)
   271 void CSmsCommandData::AddInformationElementL(const TSmsId aIdentifier,const TDesC8& aData)
   266 	{
   272 	{
   267 	LOGGSMU1("CSmsCommandData::AddInformationElementL()");
   273 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSCOMMANDDATA_ADDINFORMATIONELEMENTL_1, "CSmsCommandData::AddInformationElementL()");
   268 
   274 
   269 	//
   275 	//
   270 	// Currently there is no restriction on how many instances of an information element can be
   276 	// Currently there is no restriction on how many instances of an information element can be
   271 	// placed in the collection.
   277 	// placed in the collection.
   272 	// No restriction will be placed on the number of Special SMS Message Indications that can be
   278 	// No restriction will be placed on the number of Special SMS Message Indications that can be
   282 	} // CSmsCommandData::AddInformationElementL
   288 	} // CSmsCommandData::AddInformationElementL
   283 
   289 
   284 
   290 
   285 void CSmsCommandData::RemoveInformationElement(TInt aIndex)
   291 void CSmsCommandData::RemoveInformationElement(TInt aIndex)
   286 	{
   292 	{
   287 	LOGGSMU1("CSmsCommandData::RemoveInformationElement()");
   293 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSCOMMANDDATA_REMOVEINFORMATIONELEMENT_1, "CSmsCommandData::RemoveInformationElement()");
   288 	// Since iInformationElementArray[aIndex] is removed from iInformationElementArray, no double free issue.
   294 	// Since iInformationElementArray[aIndex] is removed from iInformationElementArray, no double free issue.
   289 	// coverity[double_free]
   295 	// coverity[double_free]
   290 	delete iInformationElementArray[aIndex];
   296 	delete iInformationElementArray[aIndex];
   291 	iInformationElementArray[aIndex] = NULL;
   297 	iInformationElementArray[aIndex] = NULL;
   292 	iInformationElementArray.Delete(aIndex);
   298 	iInformationElementArray.Delete(aIndex);
   298 	} // CSmsCommandData::RemoveInformationElement
   304 	} // CSmsCommandData::RemoveInformationElement
   299 
   305 
   300 
   306 
   301 TPtrC8 CSmsCommandData::Data() const
   307 TPtrC8 CSmsCommandData::Data() const
   302 	{
   308 	{
   303 	LOGGSMU1("CSmsCommandData::Data()");
   309 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSCOMMANDDATA_DATA_1, "CSmsCommandData::Data()");
   304 
   310 
   305 	TPtrC8 ptr;
   311 	TPtrC8 ptr;
   306 	ptr.Set(iBuffer->Des());
   312 	ptr.Set(iBuffer->Des());
   307 	return ptr;
   313 	return ptr;
   308 	} // CSmsCommandData::Data
   314 	} // CSmsCommandData::Data
   309 
   315 
   310 
   316 
   311 void CSmsCommandData::SetDataL(const TDesC8& aData)
   317 void CSmsCommandData::SetDataL(const TDesC8& aData)
   312 	{
   318 	{
   313 	LOGGSMU1("CSmsCommandData::SetDataL()");
   319 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSCOMMANDDATA_SETDATAL_1, "CSmsCommandData::SetDataL()");
   314 
   320 
   315 	TInt length=aData.Length();
   321 	TInt length=aData.Length();
   316 	__ASSERT_DEBUG(length<=KSmsMaxDataSize,Panic(KGsmuPanicCommandDataLengthTooLong));
   322 	__ASSERT_DEBUG(length<=KSmsMaxDataSize,Panic(KGsmuPanicCommandDataLengthTooLong));
   317 	HBufC8* buffer=HBufC8::NewL(length);
   323 	HBufC8* buffer=HBufC8::NewL(length);
   318 	delete iBuffer;
   324 	delete iBuffer;
   322 	} // CSmsCommandData::SetDataL
   328 	} // CSmsCommandData::SetDataL
   323 
   329 
   324 
   330 
   325 TUint8* CSmsCommandData::EncodeL(TUint8* aPtr) const
   331 TUint8* CSmsCommandData::EncodeL(TUint8* aPtr) const
   326 	{
   332 	{
   327 	LOGGSMU1("CSmsCommandData::EncodeL()");
   333 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSCOMMANDDATA_ENCODEL_1, "CSmsCommandData::EncodeL()");
   328 
   334 
   329 	__ASSERT_DEBUG(iBuffer->Length()<=MaxDataLength(),Panic(KGsmuPanicCommandDataBufferTooLong));
   335 	__ASSERT_DEBUG(iBuffer->Length()<=MaxDataLength(),Panic(KGsmuPanicCommandDataBufferTooLong));
   330 	TSmsOctet datalength=iBuffer->Length()+TSmsOctet(TotalHeaderLengthInUDLUnits());
   336 	TSmsOctet datalength=iBuffer->Length()+TSmsOctet(TotalHeaderLengthInUDLUnits());
   331 	aPtr=datalength.EncodeL(aPtr);
   337 	aPtr=datalength.EncodeL(aPtr);
   332 	TPtr8 ptr((TUint8*) aPtr,datalength);
   338 	TPtr8 ptr((TUint8*) aPtr,datalength);
   347 	} // CSmsCommandData::EncodeL
   353 	} // CSmsCommandData::EncodeL
   348 
   354 
   349 
   355 
   350 void CSmsCommandData::DecodeL(TGsmuLex8& aPdu)
   356 void CSmsCommandData::DecodeL(TGsmuLex8& aPdu)
   351 	{
   357 	{
   352 	LOGGSMU1("CSmsCommandData::DecodeL()");
   358 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSCOMMANDDATA_DECODEL_1, "CSmsCommandData::DecodeL()");
   353 
   359 
   354 	iInformationElementArray.ResetAndDestroy();
   360 	iInformationElementArray.ResetAndDestroy();
   355 	const TBool headerPresent=HeaderPresent();
   361 	const TBool headerPresent=HeaderPresent();
   356 	TSmsOctet dataLength;
   362 	TSmsOctet dataLength;
   357 	dataLength.DecodeL(aPdu);
   363 	dataLength.DecodeL(aPdu);
   415 	} // CSmsCommandData::CSmsCommandData
   421 	} // CSmsCommandData::CSmsCommandData
   416 
   422 
   417 
   423 
   418 TInt CSmsCommandData::HeaderLength() const
   424 TInt CSmsCommandData::HeaderLength() const
   419 	{
   425 	{
   420 	LOGGSMU1("CSmsCommandData::HeaderLength()");
   426 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSCOMMANDDATA_HEADERLENGTH_1, "CSmsCommandData::HeaderLength()");
   421 
   427 
   422 	TInt headerLength=0;
   428 	TInt headerLength=0;
   423 	for (TInt i=0; i<NumInformationElements(); i++)
   429 	for (TInt i=0; i<NumInformationElements(); i++)
   424 		headerLength+=iInformationElementArray[i]->Length();
   430 		headerLength+=iInformationElementArray[i]->Length();
   425 	return headerLength;
   431 	return headerLength;
   426 	} // CSmsCommandData::HeaderLength
   432 	} // CSmsCommandData::HeaderLength
   427 
   433 
   428 
   434 
   429 TInt CSmsCommandData::TotalHeaderLengthInUDLUnits() const
   435 TInt CSmsCommandData::TotalHeaderLengthInUDLUnits() const
   430 	{
   436 	{
   431 	LOGGSMU1("CSmsCommandData::TotalHeaderLengthInUDLUnits()");
   437 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSCOMMANDDATA_TOTALHEADERLENGTHINUDLUNITS_1, "CSmsCommandData::TotalHeaderLengthInUDLUnits()");
   432 
   438 
   433 	if (iInformationElementArray.Count()==0)
   439 	if (iInformationElementArray.Count()==0)
   434 		return 0;
   440 		return 0;
   435 	else
   441 	else
   436 		return (HeaderLength()+1);   // +1 stands for  UDHL
   442 		return (HeaderLength()+1);   // +1 stands for  UDHL
   437 	} // CSmsCommandData::TotalHeaderLengthInUDLUnits
   443 	} // CSmsCommandData::TotalHeaderLengthInUDLUnits
   438 
   444 
   439 
   445 
   440 TBool CSmsCommandData::HeaderPresent() const
   446 TBool CSmsCommandData::HeaderPresent() const
   441 	{
   447 	{
   442 	LOGGSMU1("CSmsCommandData::HeaderPresent()");
   448 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSCOMMANDDATA_HEADERPRESENT_1, "CSmsCommandData::HeaderPresent()");
   443 
   449 
   444 	return (iFirstOctet&TSmsFirstOctet::ESmsUDHIMask)==TSmsFirstOctet::ESmsUDHIHeaderPresent;
   450 	return (iFirstOctet&TSmsFirstOctet::ESmsUDHIMask)==TSmsFirstOctet::ESmsUDHIHeaderPresent;
   445 	} // CSmsCommandData::HeaderPresent
   451 	} // CSmsCommandData::HeaderPresent
   446 
   452 
   447 
   453 
   448 void CSmsCommandData::SetHeaderPresent(TBool aHeaderPresent)
   454 void CSmsCommandData::SetHeaderPresent(TBool aHeaderPresent)
   449 	{
   455 	{
   450 	LOGGSMU1("CSmsCommandData::SetHeaderPresent()");
   456 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSCOMMANDDATA_SETHEADERPRESENT_1, "CSmsCommandData::SetHeaderPresent()");
   451 
   457 
   452 	iFirstOctet=aHeaderPresent? (iFirstOctet&(~TSmsFirstOctet::ESmsUDHIMask))|TSmsFirstOctet::ESmsUDHIHeaderPresent: (iFirstOctet&(~TSmsFirstOctet::ESmsUDHIMask))|TSmsFirstOctet::ESmsUDHIHeaderNotPresent;
   458 	iFirstOctet=aHeaderPresent? (iFirstOctet&(~TSmsFirstOctet::ESmsUDHIMask))|TSmsFirstOctet::ESmsUDHIHeaderPresent: (iFirstOctet&(~TSmsFirstOctet::ESmsUDHIMask))|TSmsFirstOctet::ESmsUDHIHeaderNotPresent;
   453 	} // CSmsCommandData::SetHeaderPresent
   459 	} // CSmsCommandData::SetHeaderPresent
   454 
   460 
   455 
   461 
   478 	} // TSmsProtocolIdentifier::TSmsTelematicDeviceIndicator
   484 	} // TSmsProtocolIdentifier::TSmsTelematicDeviceIndicator
   479 
   485 
   480 
   486 
   481 void TSmsProtocolIdentifier::SetTelematicDeviceIndicator(TSmsTelematicDeviceIndicator aIndicator)
   487 void TSmsProtocolIdentifier::SetTelematicDeviceIndicator(TSmsTelematicDeviceIndicator aIndicator)
   482 	{
   488 	{
   483 	LOGGSMU1("TSmsProtocolIdentifier::SetTelematicDeviceIndicator()");
   489 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSPROTOCOLIDENTIFIER_SETTELEMATICDEVICEINDICATOR_1, "TSmsProtocolIdentifier::SetTelematicDeviceIndicator()");
   484 
   490 
   485 	__ASSERT_DEBUG(PIDType()==ESmsPIDTelematicInterworking,Panic(KGsmuPanicNoTelematicInterworking));
   491 	__ASSERT_DEBUG(PIDType()==ESmsPIDTelematicInterworking,Panic(KGsmuPanicNoTelematicInterworking));
   486 
   492 
   487 	//iValue=(TUint8) ((iValue&ESmsPIDTypeMask)|aIndicator);
   493 	//iValue=(TUint8) ((iValue&ESmsPIDTypeMask)|aIndicator);
   488 	iValue=(TUint8) ((iValue&(~EPIDTelematicDeviceIndicatorMask))|aIndicator);
   494 	iValue=(TUint8) ((iValue&(~EPIDTelematicDeviceIndicatorMask))|aIndicator);
   496 	} // TSmsProtocolIdentifier::TSmsTelematicDeviceType
   502 	} // TSmsProtocolIdentifier::TSmsTelematicDeviceType
   497 
   503 
   498 
   504 
   499 void TSmsProtocolIdentifier::SetTelematicDeviceType(TSmsTelematicDeviceType aDeviceType)
   505 void TSmsProtocolIdentifier::SetTelematicDeviceType(TSmsTelematicDeviceType aDeviceType)
   500 	{
   506 	{
   501 	LOGGSMU1("TSmsProtocolIdentifier::SetTelematicDeviceType()");
   507 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSPROTOCOLIDENTIFIER_SETTELEMATICDEVICETYPE_1, "TSmsProtocolIdentifier::SetTelematicDeviceType()");
   502 
   508 
   503 	__ASSERT_DEBUG(TelematicDeviceIndicator()==ESmsTelematicDevice,Panic(KGsmuPanicNoTelematicDevice));
   509 	__ASSERT_DEBUG(TelematicDeviceIndicator()==ESmsTelematicDevice,Panic(KGsmuPanicNoTelematicDevice));
   504 	iValue=(TUint8) ((iValue&(~ESmsTelematicDeviceTypeMask))|aDeviceType);
   510 	iValue=(TUint8) ((iValue&(~ESmsTelematicDeviceTypeMask))|aDeviceType);
   505 	} // TSmsProtocolIdentifier::SetTelematicDeviceType
   511 	} // TSmsProtocolIdentifier::SetTelematicDeviceType
   506 
   512 
   508 TInt TSmsProtocolIdentifier::ShortMessageALProtocol() const
   514 TInt TSmsProtocolIdentifier::ShortMessageALProtocol() const
   509     {
   515     {
   510     // Ignore in code coverage - not used in SMS stack and not exported
   516     // Ignore in code coverage - not used in SMS stack and not exported
   511     // but cannot be removed as impacts public header.
   517     // but cannot be removed as impacts public header.
   512     BULLSEYE_OFF    
   518     BULLSEYE_OFF    
   513     LOGGSMU1("TSmsProtocolIdentifier::ShortMessageALProtocol()");
   519     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSPROTOCOLIDENTIFIER_SHORTMESSAGEALPROTOCOL_1, "TSmsProtocolIdentifier::ShortMessageALProtocol()");
   514     
   520     
   515     __ASSERT_DEBUG(TelematicDeviceIndicator()==ESmsNoTelematicDevice,Panic(KGsmuPanicNoTelematicDevice));
   521     __ASSERT_DEBUG(TelematicDeviceIndicator()==ESmsNoTelematicDevice,Panic(KGsmuPanicNoTelematicDevice));
   516     return (TSmsShortMessageALProtocol) (iValue&ESmsShortMessageALProtocolMask);
   522     return (TSmsShortMessageALProtocol) (iValue&ESmsShortMessageALProtocolMask);
   517     BULLSEYE_RESTORE
   523     BULLSEYE_RESTORE
   518     }
   524     }
   520 void TSmsProtocolIdentifier::SetShortMessageALProtocol(TSmsShortMessageALProtocol aProtocol)
   526 void TSmsProtocolIdentifier::SetShortMessageALProtocol(TSmsShortMessageALProtocol aProtocol)
   521     {
   527     {
   522     // Ignore in code coverage - not used in SMS stack and not exported
   528     // Ignore in code coverage - not used in SMS stack and not exported
   523     // but cannot be removed as impacts public header.
   529     // but cannot be removed as impacts public header.
   524     BULLSEYE_OFF    
   530     BULLSEYE_OFF    
   525     LOGGSMU1("TSmsProtocolIdentifier::SetShortMessageALProtocol()");
   531     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSPROTOCOLIDENTIFIER_SETSHORTMESSAGEALPROTOCOL_1, "TSmsProtocolIdentifier::SetShortMessageALProtocol()");
   526     
   532     
   527     __ASSERT_DEBUG(TelematicDeviceIndicator()==ESmsNoTelematicDevice,Panic(KGsmuPanicNoTelematicDevice));
   533     __ASSERT_DEBUG(TelematicDeviceIndicator()==ESmsNoTelematicDevice,Panic(KGsmuPanicNoTelematicDevice));
   528     iValue=(TUint8) ((iValue&(~ESmsShortMessageALProtocolMask))|aProtocol);
   534     iValue=(TUint8) ((iValue&(~ESmsShortMessageALProtocolMask))|aProtocol);
   529     BULLSEYE_RESTORE
   535     BULLSEYE_RESTORE
   530     }
   536     }
   531 
   537 
   532 TInt TSmsProtocolIdentifier::ShortMessageType() const
   538 TInt TSmsProtocolIdentifier::ShortMessageType() const
   533 	{
   539 	{
   534 	LOGGSMU1("TSmsProtocolIdentifier::ShortMessageType()");
   540 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSPROTOCOLIDENTIFIER_SHORTMESSAGETYPE_1, "TSmsProtocolIdentifier::ShortMessageType()");
   535 
   541 
   536 	__ASSERT_DEBUG(PIDType()==ESmsPIDShortMessageType,Panic(KGsmuPanicNoShortMessageType));
   542 	__ASSERT_DEBUG(PIDType()==ESmsPIDShortMessageType,Panic(KGsmuPanicNoShortMessageType));
   537 	return (TSmsShortMessageType) (iValue&ESmsShortMessageTypeMask);
   543 	return (TSmsShortMessageType) (iValue&ESmsShortMessageTypeMask);
   538 	} // TSmsProtocolIdentifier::ShortMessageType
   544 	} // TSmsProtocolIdentifier::ShortMessageType
   539 
   545 
   540 
   546 
   541 void TSmsProtocolIdentifier::SetShortMessageType(TSmsShortMessageType aShortMessageType)
   547 void TSmsProtocolIdentifier::SetShortMessageType(TSmsShortMessageType aShortMessageType)
   542 	{
   548 	{
   543 	LOGGSMU1("TSmsProtocolIdentifier::SetShortMessageType()");
   549 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSPROTOCOLIDENTIFIER_SETSHORTMESSAGETYPE_1, "TSmsProtocolIdentifier::SetShortMessageType()");
   544 
   550 
   545 	__ASSERT_DEBUG(PIDType()==ESmsPIDShortMessageType,Panic(KGsmuPanicNoShortMessageType));
   551 	__ASSERT_DEBUG(PIDType()==ESmsPIDShortMessageType,Panic(KGsmuPanicNoShortMessageType));
   546 	//iValue=(TUint8) ((iValue&(~ESmsPIDTypeMask))|aShortMessageType);
   552 	//iValue=(TUint8) ((iValue&(~ESmsPIDTypeMask))|aShortMessageType);
   547 	iValue=(TUint8) ((iValue&(~ESmsShortMessageTypeMask))|aShortMessageType);
   553 	iValue=(TUint8) ((iValue&(~ESmsShortMessageTypeMask))|aShortMessageType);
   548 	} // TSmsProtocolIdentifier::SetShortMessageType
   554 	} // TSmsProtocolIdentifier::SetShortMessageType
   557 	} // CSmsDeliverReport::DecodeL
   563 	} // CSmsDeliverReport::DecodeL
   558 
   564 
   559 
   565 
   560 TBool TSmsDataCodingScheme::TextCompressed() const
   566 TBool TSmsDataCodingScheme::TextCompressed() const
   561 	{
   567 	{
   562 	LOGGSMU1("TSmsDataCodingScheme::TextCompressed()");
   568 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSDATACODINGSCHEME_TEXTCOMPRESSED_1, "TSmsDataCodingScheme::TextCompressed()");
   563 
   569 
   564 	TInt bits7to4=Bits7To4();
   570 	TInt bits7to4=Bits7To4();
   565 	return (bits7to4==ESmsDCSTextCompressedWithNoClassInfo)    || (bits7to4==ESmsDCSTextCompressedWithClassInfo)      ||
   571 	return (bits7to4==ESmsDCSTextCompressedWithNoClassInfo)    || (bits7to4==ESmsDCSTextCompressedWithClassInfo)      ||
   566            (bits7to4==ESmsDCSAutoDelNoClassInfoCompressedText) || (bits7to4==ESmsDCSAutoDelClassInfoTextCompressedText);
   572            (bits7to4==ESmsDCSAutoDelNoClassInfoCompressedText) || (bits7to4==ESmsDCSAutoDelClassInfoTextCompressedText);
   567 	} // TSmsDataCodingScheme::TextCompressed
   573 	} // TSmsDataCodingScheme::TextCompressed
   568 
   574 
   569 
   575 
   570 void TSmsDataCodingScheme::SetTextCompressed(TBool aCompressed)
   576 void TSmsDataCodingScheme::SetTextCompressed(TBool aCompressed)
   571 	{
   577 	{
   572 	LOGGSMU1("TSmsDataCodingScheme::SetTextCompressed()");
   578 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSDATACODINGSCHEME_SETTEXTCOMPRESSED_1, "TSmsDataCodingScheme::SetTextCompressed()");
   573 
   579 
   574 	TInt bits7to4=Bits7To4();
   580 	TInt bits7to4=Bits7To4();
   575 	if (aCompressed)
   581 	if (aCompressed)
   576 		{
   582 		{
   577 		switch (bits7to4)
   583 		switch (bits7to4)
   645 	} // TSmsDataCodingScheme::SetTextCompressed
   651 	} // TSmsDataCodingScheme::SetTextCompressed
   646 
   652 
   647 
   653 
   648 TSmsDataCodingScheme::TSmsAlphabet TSmsDataCodingScheme::Alphabet() const
   654 TSmsDataCodingScheme::TSmsAlphabet TSmsDataCodingScheme::Alphabet() const
   649 	{
   655 	{
   650 	LOGGSMU1("TSmsDataCodingScheme::TSmsAlphabet()");
   656 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSDATACODINGSCHEME_ALPHABET_1, "TSmsDataCodingScheme::TSmsAlphabet()");
   651 
   657 
   652 	TInt bits7to4=Bits7To4();
   658 	TInt bits7to4=Bits7To4();
   653 	TInt alphabet=ESmsAlphabet7Bit;
   659 	TInt alphabet=ESmsAlphabet7Bit;
   654 	switch (bits7to4)
   660 	switch (bits7to4)
   655 		{
   661 		{
   680 			{
   686 			{
   681 			alphabet=ESmsAlphabetUCS2;
   687 			alphabet=ESmsAlphabetUCS2;
   682 			break;
   688 			break;
   683 			}
   689 			}
   684 		default:
   690 		default:
   685 		    LOGGSMU1("TSmsDataCodingScheme::Alphabet() WARNING! default case has been reached");
   691 		    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSDATACODINGSCHEME_ALPHABET_2, "TSmsDataCodingScheme::Alphabet() WARNING! default case has been reached");
   686             break;
   692             break;
   687  		}
   693  		}
   688 	return (TSmsAlphabet) alphabet;
   694 	return (TSmsAlphabet) alphabet;
   689 	} // TSmsDataCodingScheme::TSmsAlphabet
   695 	} // TSmsDataCodingScheme::TSmsAlphabet
   690 
   696 
   691 void TSmsDataCodingScheme::SetAlphabet(TSmsAlphabet aAlphabet)
   697 void TSmsDataCodingScheme::SetAlphabet(TSmsAlphabet aAlphabet)
   692 	{
   698 	{
   693 	LOGGSMU1("TSmsDataCodingScheme::SetAlphabet()");
   699 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSDATACODINGSCHEME_SETALPHABET_1, "TSmsDataCodingScheme::SetAlphabet()");
   694 
   700 
   695 	TInt bits7to4=Bits7To4();
   701 	TInt bits7to4=Bits7To4();
   696 	switch (bits7to4)
   702 	switch (bits7to4)
   697 		{
   703 		{
   698 		case (ESmsDCSTextUncompressedWithNoClassInfo):
   704 		case (ESmsDCSTextUncompressedWithNoClassInfo):
   717 			}
   723 			}
   718 		case (ESmsDCSMessageWaitingIndicationDiscardMessage):
   724 		case (ESmsDCSMessageWaitingIndicationDiscardMessage):
   719 			{
   725 			{
   720             if (aAlphabet!=ESmsAlphabet7Bit)
   726             if (aAlphabet!=ESmsAlphabet7Bit)
   721                 {
   727                 {
   722                 LOGGSMU3("TSmsDataCodingScheme::SetAlphabet() WARNING! Not Supported With Discard Message  [Bits7To4=%d], [aAlphabet=%d]", bits7to4, aAlphabet);
   728                 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSDATACODINGSCHEME_SETALPHABET_2, "TSmsDataCodingScheme::SetAlphabet() WARNING! Not Supported With Discard Message  [Bits7To4=%d], [aAlphabet=%d]", bits7to4, aAlphabet);
   723                 }
   729                 }
   724 			break;
   730 			break;
   725 			}
   731 			}
   726 		case (ESmsDCSMessageWaitingIndication7Bit):
   732 		case (ESmsDCSMessageWaitingIndication7Bit):
   727 			{
   733 			{
   729  			    {
   735  			    {
   730 				iValue=(TUint8) (ESmsDCSMessageWaitingIndicationUCS2|(iValue&(~ESmsDCSBits7To4Mask)));
   736 				iValue=(TUint8) (ESmsDCSMessageWaitingIndicationUCS2|(iValue&(~ESmsDCSBits7To4Mask)));
   731  			    }
   737  			    }
   732  			else 
   738  			else 
   733                 {
   739                 {
   734         		LOGGSMU3("TSmsDataCodingScheme::SetAlphabet() WARNING! Not Supported With Discard Message  [Bits7To4=%d], [aAlphabet=%d]", bits7to4, aAlphabet);
   740         		OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSDATACODINGSCHEME_SETALPHABET_3, "TSmsDataCodingScheme::SetAlphabet() WARNING! Not Supported With Discard Message  [Bits7To4=%d], [aAlphabet=%d]", bits7to4, aAlphabet);
   735 			    }	     
   741 			    }	     
   736 			break;
   742 			break;
   737 			}
   743 			}
   738 		case (ESmsDCSMessageWaitingIndicationUCS2):
   744 		case (ESmsDCSMessageWaitingIndicationUCS2):
   739 			{
   745 			{
   741 			    {
   747 			    {
   742 				iValue=(TUint8) (ESmsDCSMessageWaitingIndication7Bit|(iValue&(~ESmsDCSBits7To4Mask)));
   748 				iValue=(TUint8) (ESmsDCSMessageWaitingIndication7Bit|(iValue&(~ESmsDCSBits7To4Mask)));
   743 			    }
   749 			    }
   744 			else 
   750 			else 
   745 			    {
   751 			    {
   746 				LOGGSMU3("TSmsDataCodingScheme::SetAlphabet() WARNING! Not Supported With Discard Message  [Bits7To4=%d], [aAlphabet=%d]", bits7to4, aAlphabet);
   752 				OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSDATACODINGSCHEME_SETALPHABET_4, "TSmsDataCodingScheme::SetAlphabet() WARNING! Not Supported With Discard Message  [Bits7To4=%d], [aAlphabet=%d]", bits7to4, aAlphabet);
   747 			    }
   753 			    }
   748 			break;
   754 			break;
   749 			}
   755 			}
   750 		default:
   756 		default:
   751 		    LOGGSMU1("TSmsDataCodingScheme::SetAlphabet() WARNING! default case has been reached");
   757 		    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSDATACODINGSCHEME_SETALPHABET_5, "TSmsDataCodingScheme::SetAlphabet() WARNING! default case has been reached");
   752             break;
   758             break;
   753       		}
   759       		}
   754 	} // TSmsDataCodingScheme::SetAlphabet
   760 	} // TSmsDataCodingScheme::SetAlphabet
   755 
   761 
   756 
   762 
   757 TBool TSmsDataCodingScheme::Class(TSmsClass& aClass) const
   763 TBool TSmsDataCodingScheme::Class(TSmsClass& aClass) const
   758 	{
   764 	{
   759 	LOGGSMU1("TSmsDataCodingScheme::Class()");
   765 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSDATACODINGSCHEME_CLASS_1, "TSmsDataCodingScheme::Class()");
   760 
   766 
   761 	switch (Bits7To4())
   767 	switch (Bits7To4())
   762 		{
   768 		{
   763 		case (ESmsDCSTextUncompressedWithClassInfo):
   769 		case (ESmsDCSTextUncompressedWithClassInfo):
   764 		case (ESmsDCSTextCompressedWithClassInfo):
   770 		case (ESmsDCSTextCompressedWithClassInfo):
   773 	} // TSmsDataCodingScheme::Class
   779 	} // TSmsDataCodingScheme::Class
   774 
   780 
   775 
   781 
   776 void TSmsDataCodingScheme::SetClass(TBool aClassDefined,TSmsDataCodingScheme::TSmsClass aClass)
   782 void TSmsDataCodingScheme::SetClass(TBool aClassDefined,TSmsDataCodingScheme::TSmsClass aClass)
   777 	{
   783 	{
   778 	LOGGSMU1("TSmsDataCodingScheme::SetClass()");
   784 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSDATACODINGSCHEME_SETCLASS_1, "TSmsDataCodingScheme::SetClass()");
   779 
   785 
   780 	TInt bits7to4=Bits7To4();
   786 	TInt bits7to4=Bits7To4();
   781 	if (aClassDefined)
   787 	if (aClassDefined)
   782 		{
   788 		{
   783 		switch (bits7to4)
   789 		switch (bits7to4)
   811 				{
   817 				{
   812 				iValue=(TUint8) (iValue&(~ESmsClassMask)|aClass);
   818 				iValue=(TUint8) (iValue&(~ESmsClassMask)|aClass);
   813 				break;
   819 				break;
   814 				}
   820 				}
   815 			default:
   821 			default:
   816 		        LOGGSMU1("WARNING! default case has been reached");
   822 		        OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSDATACODINGSCHEME_SETCLASS_2, "WARNING! default case has been reached");
   817                 break;
   823                 break;
   818 			}
   824 			}
   819 		}
   825 		}
   820 	else
   826 	else
   821 		{
   827 		{
   861 	} // TSmsDataCodingScheme::SetClass
   867 	} // TSmsDataCodingScheme::SetClass
   862 
   868 
   863 
   869 
   864 TSmsDataCodingScheme::TSmsIndicationState TSmsDataCodingScheme::IndicationState() const
   870 TSmsDataCodingScheme::TSmsIndicationState TSmsDataCodingScheme::IndicationState() const
   865 	{
   871 	{
   866 	LOGGSMU1("TSmsDataCodingScheme::IndicationState()");
   872 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSDATACODINGSCHEME_INDICATIONSTATE_1, "TSmsDataCodingScheme::IndicationState()");
   867 
   873 
   868 	TInt bits7to4=Bits7To4();
   874 	TInt bits7to4=Bits7To4();
   869 	TSmsIndicationState state=ESmsIndicationInactive;
   875 	TSmsIndicationState state=ESmsIndicationInactive;
   870 	switch (bits7to4)
   876 	switch (bits7to4)
   871 		{
   877 		{
   875 			{
   881 			{
   876 			state=(TSmsIndicationState) (iValue&ESmsIndicationStateMask);
   882 			state=(TSmsIndicationState) (iValue&ESmsIndicationStateMask);
   877 			break;
   883 			break;
   878 			}
   884 			}
   879 		default:
   885 		default:
   880 		    LOGGSMU1("WARNING! default case has been reached");
   886 		    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSDATACODINGSCHEME_INDICATIONSTATE_2, "WARNING! default case has been reached");
   881             break;
   887             break;
   882   		}
   888   		}
   883 	return state;
   889 	return state;
   884 	} // TSmsDataCodingScheme::TSmsIndicationState
   890 	} // TSmsDataCodingScheme::TSmsIndicationState
   885 
   891 
   886 
   892 
   887 void TSmsDataCodingScheme::SetIndicationState(TSmsIndicationState aState)
   893 void TSmsDataCodingScheme::SetIndicationState(TSmsIndicationState aState)
   888 	{
   894 	{
   889 	LOGGSMU1("TSmsDataCodingScheme::SetIndicationState()");
   895 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSDATACODINGSCHEME_SETINDICATIONSTATE_1, "TSmsDataCodingScheme::SetIndicationState()");
   890 
   896 
   891 	TInt bits7to4=Bits7To4();
   897 	TInt bits7to4=Bits7To4();
   892 	switch (bits7to4)
   898 	switch (bits7to4)
   893 		{
   899 		{
   894 		case (ESmsDCSMessageWaitingIndicationDiscardMessage):
   900 		case (ESmsDCSMessageWaitingIndicationDiscardMessage):
   897 			{
   903 			{
   898 			iValue=(TUint8) (aState | (iValue&(~ESmsIndicationStateMask)));
   904 			iValue=(TUint8) (aState | (iValue&(~ESmsIndicationStateMask)));
   899 			break;
   905 			break;
   900 			}
   906 			}
   901 		default:
   907 		default:
   902 		    LOGGSMU1("TSmsDataCodingScheme::SetIndicationState() WARNING! default case has been reached");
   908 		    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSDATACODINGSCHEME_SETINDICATIONSTATE_2, "TSmsDataCodingScheme::SetIndicationState() WARNING! default case has been reached");
   903             break;
   909             break;
   904   		}
   910   		}
   905 	} // TSmsDataCodingScheme::SetIndicationState
   911 	} // TSmsDataCodingScheme::SetIndicationState
   906 
   912 
   907 
   913 
   908 TSmsDataCodingScheme::TSmsIndicationType TSmsDataCodingScheme::IndicationType() const
   914 TSmsDataCodingScheme::TSmsIndicationType TSmsDataCodingScheme::IndicationType() const
   909 	{
   915 	{
   910 	LOGGSMU1("TSmsDataCodingScheme::IndicationType()");
   916 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSDATACODINGSCHEME_INDICATIONTYPE_1, "TSmsDataCodingScheme::IndicationType()");
   911 
   917 
   912 	TInt bits7to4=Bits7To4();
   918 	TInt bits7to4=Bits7To4();
   913 	TSmsIndicationType type=ESmsVoicemailMessageWaiting;
   919 	TSmsIndicationType type=ESmsVoicemailMessageWaiting;
   914 	switch (bits7to4)
   920 	switch (bits7to4)
   915 		{
   921 		{
   919 			{
   925 			{
   920 			type=(TSmsIndicationType) (iValue&ESmsIndicationTypeMask);
   926 			type=(TSmsIndicationType) (iValue&ESmsIndicationTypeMask);
   921 			break;
   927 			break;
   922 			}
   928 			}
   923 		default:
   929 		default:
   924 		    LOGGSMU1("TSmsDataCodingScheme::IndicationType() WARNING default case has been reached");
   930 		    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSDATACODINGSCHEME_INDICATIONTYPE_2, "TSmsDataCodingScheme::IndicationType() WARNING default case has been reached");
   925             break;
   931             break;
   926 		}
   932 		}
   927 	return type;
   933 	return type;
   928 	} // TSmsDataCodingScheme::TSmsIndicationType
   934 	} // TSmsDataCodingScheme::TSmsIndicationType
   929 
   935 
   930 
   936 
   931 void TSmsDataCodingScheme::SetIndicationType(TSmsIndicationType aType)
   937 void TSmsDataCodingScheme::SetIndicationType(TSmsIndicationType aType)
   932 	{
   938 	{
   933 	LOGGSMU1("TSmsDataCodingScheme::SetIndicationType()");
   939 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSDATACODINGSCHEME_SETINDICATIONTYPE_1, "TSmsDataCodingScheme::SetIndicationType()");
   934 
   940 
   935 	TInt bits7to4=Bits7To4();
   941 	TInt bits7to4=Bits7To4();
   936 	switch (bits7to4)
   942 	switch (bits7to4)
   937 		{
   943 		{
   938 		case (ESmsDCSMessageWaitingIndicationDiscardMessage):
   944 		case (ESmsDCSMessageWaitingIndicationDiscardMessage):
   941 			{
   947 			{
   942 			iValue=(TUint8) (aType | (iValue&(~ESmsIndicationTypeMask)));
   948 			iValue=(TUint8) (aType | (iValue&(~ESmsIndicationTypeMask)));
   943 			break;
   949 			break;
   944 			}
   950 			}
   945 		default:
   951 		default:
   946 		    LOGGSMU1("TSmsDataCodingScheme::SetIndicationType() WARNING! default case has been reached");
   952 		    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSDATACODINGSCHEME_SETINDICATIONTYPE_2, "TSmsDataCodingScheme::SetIndicationType() WARNING! default case has been reached");
   947             break;
   953             break;
   948  		}
   954  		}
   949 	} // TSmsDataCodingScheme::SetIndicationType
   955 	} // TSmsDataCodingScheme::SetIndicationType
   950 
   956 
   951 
   957 
   960  *  @return New CSmsAlphabetConverter object
   966  *  @return New CSmsAlphabetConverter object
   961  *  @capability None
   967  *  @capability None
   962  */
   968  */
   963 EXPORT_C CSmsAlphabetConverter* CSmsAlphabetConverter::NewLC(CCnvCharacterSetConverter& aCharacterSetConverter,RFs& aFs,TSmsDataCodingScheme::TSmsAlphabet aSmsAlphabet,TBool aIsBinary)
   969 EXPORT_C CSmsAlphabetConverter* CSmsAlphabetConverter::NewLC(CCnvCharacterSetConverter& aCharacterSetConverter,RFs& aFs,TSmsDataCodingScheme::TSmsAlphabet aSmsAlphabet,TBool aIsBinary)
   964 	{
   970 	{
   965 	LOGGSMU1("CSmsAlphabetConverter::NewLC()");
   971 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CSMSALPHABETCONVERTER_NEWLC_1, "CSmsAlphabetConverter::NewLC()");
   966 
   972 
   967 	CSmsAlphabetConverter* converter=new (ELeave)CSmsAlphabetConverter(aCharacterSetConverter,aFs,aSmsAlphabet,aIsBinary);
   973 	CSmsAlphabetConverter* converter=new (ELeave)CSmsAlphabetConverter(aCharacterSetConverter,aFs,aSmsAlphabet,aIsBinary);
   968 	CleanupStack::PushL(converter);
   974 	CleanupStack::PushL(converter);
   969 	converter->ConstructL();
   975 	converter->ConstructL();
   970 	return converter;
   976 	return converter;
  1001 //
  1007 //
  1002 // Ensures this is a supported character set if not binary conversion
  1008 // Ensures this is a supported character set if not binary conversion
  1003 //
  1009 //
  1004 void CSmsAlphabetConverter::ConstructL()
  1010 void CSmsAlphabetConverter::ConstructL()
  1005 	{
  1011 	{
  1006 	LOGGSMU1("CSmsAlphabetConverter::ConstructL()");
  1012 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSALPHABETCONVERTER_CONSTRUCTL_1, "CSmsAlphabetConverter::ConstructL()");
  1007 
  1013 
  1008 
  1014 
  1009 	if (!iIsBinary)
  1015 	if (!iIsBinary)
  1010 		{
  1016 		{
  1011 		switch (iSmsAlphabet)
  1017 		switch (iSmsAlphabet)
  1033 // clients to provided efficient converted length calculation where no
  1039 // clients to provided efficient converted length calculation where no
  1034 // conversion is required.
  1040 // conversion is required.
  1035 //
  1041 //
  1036 void CSmsAlphabetConverter::ConversionPropertiesL(TSmsAlphabetConversionProperties& aConversionProperties) const
  1042 void CSmsAlphabetConverter::ConversionPropertiesL(TSmsAlphabetConversionProperties& aConversionProperties) const
  1037 	{
  1043 	{
  1038 	LOGGSMU1("CSmsAlphabetConverter::ConversionPropertiesL()");
  1044 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSALPHABETCONVERTER_CONVERSIONPROPERTIESL_1, "CSmsAlphabetConverter::ConversionPropertiesL()");
  1039 
  1045 
  1040 
  1046 
  1041 	// Set defaults
  1047 	// Set defaults
  1042 	aConversionProperties.iWidthConversion=ESmsAlphabetWidthConversionFixed;
  1048 	aConversionProperties.iWidthConversion=ESmsAlphabetWidthConversionFixed;
  1043 	aConversionProperties.iUDElementsPerNativeCharacter=1;
  1049 	aConversionProperties.iUDElementsPerNativeCharacter=1;
  1075  *  @return Converted characters
  1081  *  @return Converted characters
  1076  *  @capability None
  1082  *  @capability None
  1077  */
  1083  */
  1078 EXPORT_C TPtrC8 CSmsAlphabetConverter::ConvertFromNativeL(const TDesC& aNativeCharacters)
  1084 EXPORT_C TPtrC8 CSmsAlphabetConverter::ConvertFromNativeL(const TDesC& aNativeCharacters)
  1079 	{
  1085 	{
  1080 	LOGGSMU1("CSmsAlphabetConverter::ConvertFromNativeL()");
  1086 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CSMSALPHABETCONVERTER_CONVERTFROMNATIVEL_1, "CSmsAlphabetConverter::ConvertFromNativeL()");
  1081 
  1087 
  1082 	TInt  numberOfUnconvertibleCharacters, numberOfDowngradedCharacters;
  1088 	TInt  numberOfUnconvertibleCharacters, numberOfDowngradedCharacters;
  1083 
  1089 
  1084 	return ConvertFromNativeL(aNativeCharacters, ESmsEncodingNone,
  1090 	return ConvertFromNativeL(aNativeCharacters, ESmsEncodingNone,
  1085 			                  numberOfUnconvertibleCharacters,
  1091 			                  numberOfUnconvertibleCharacters,
  1105 EXPORT_C TPtrC8 CSmsAlphabetConverter::ConvertFromNativeL(const TDesC& aNativeCharacters,
  1111 EXPORT_C TPtrC8 CSmsAlphabetConverter::ConvertFromNativeL(const TDesC& aNativeCharacters,
  1106                                                           TSmsEncoding aEncoding,
  1112                                                           TSmsEncoding aEncoding,
  1107                                                           TInt& aNumberOfUnconvertibleCharacters,
  1113                                                           TInt& aNumberOfUnconvertibleCharacters,
  1108 			                                              TInt& aNumberOfDowngradedCharacters)
  1114 			                                              TInt& aNumberOfDowngradedCharacters)
  1109 	{
  1115 	{
  1110 	LOGGSMU2("CSmsAlphabetConverter::ConvertFromNativeL(): aEncoding=%d", aEncoding);
  1116 	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CSMSALPHABETCONVERTER_CONVERTFROMNATIVEL1_1, "CSmsAlphabetConverter::ConvertFromNativeL(): aEncoding=%d", aEncoding);
  1111 	
  1117 	
  1112 	aNumberOfUnconvertibleCharacters = 0;
  1118 	aNumberOfUnconvertibleCharacters = 0;
  1113 	aNumberOfDowngradedCharacters    = 0;
  1119 	aNumberOfDowngradedCharacters    = 0;
  1114 
  1120 
  1115 	// Check for some shortcuts
  1121 	// Check for some shortcuts
  1298  * 
  1304  * 
  1299  *  @capability None
  1305  *  @capability None
  1300  */
  1306  */
  1301 EXPORT_C TPtrC CSmsAlphabetConverter::ConvertToNativeL(const TDesC8& aUDElements)
  1307 EXPORT_C TPtrC CSmsAlphabetConverter::ConvertToNativeL(const TDesC8& aUDElements)
  1302 	{
  1308 	{
  1303 	LOGGSMU1("CSmsAlphabetConverter::ConvertToNativeL()");
  1309 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CSMSALPHABETCONVERTER_CONVERTTONATIVEL_1, "CSmsAlphabetConverter::ConvertToNativeL()");
  1304 
  1310 
  1305 	return ConvertToNativeL(aUDElements, ESmsEncodingNone);
  1311 	return ConvertToNativeL(aUDElements, ESmsEncodingNone);
  1306 	} // CSmsAlphabetConverter::ConvertToNativeL
  1312 	} // CSmsAlphabetConverter::ConvertToNativeL
  1307 
  1313 
  1308 
  1314 
  1318  *  @capability None
  1324  *  @capability None
  1319  */
  1325  */
  1320 EXPORT_C TPtrC CSmsAlphabetConverter::ConvertToNativeL(const TDesC8& aUDElements,
  1326 EXPORT_C TPtrC CSmsAlphabetConverter::ConvertToNativeL(const TDesC8& aUDElements,
  1321 													   TSmsEncoding aEncoding)
  1327 													   TSmsEncoding aEncoding)
  1322 	{
  1328 	{
  1323 	LOGGSMU2("CSmsAlphabetConverter::ConvertToNativeL(): aEncoding=%d", aEncoding);
  1329 	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CSMSALPHABETCONVERTER_CONVERTTONATIVEL1_1, "CSmsAlphabetConverter::ConvertToNativeL(): aEncoding=%d", aEncoding);
  1324 
  1330 
  1325 	// Check for some shortcuts
  1331 	// Check for some shortcuts
  1326 	if (iIsBinary ||  iSmsAlphabet == TSmsDataCodingScheme::ESmsAlphabet8Bit)
  1332 	if (iIsBinary ||  iSmsAlphabet == TSmsDataCodingScheme::ESmsAlphabet8Bit)
  1327 		{
  1333 		{
  1328 		// Binary data stored as padded unicode
  1334 		// Binary data stored as padded unicode
  1391 		}
  1397 		}
  1392 	} // CSmsAlphabetConverter::ConvertToNativeL
  1398 	} // CSmsAlphabetConverter::ConvertToNativeL
  1393 
  1399 
  1394 
  1400 
  1395 /**
  1401 /**
  1396  *  Tests if the character is supported by the current character set.
       
  1397  *  This function can be used with 7bit and 8bit alphabets.
       
  1398  * 
       
  1399  *  @param aChar  Character to investigate.
       
  1400  * 
       
  1401  *  @return  ETrue if the character is supported.
       
  1402  * 
       
  1403  *  @note Since the function is based on the old behaviour (pre-PREQ2090)
       
  1404  *        it does not accept a downgraded character or alternative encoding
       
  1405  *        as being supported.
       
  1406  */
       
  1407 TBool CSmsAlphabetConverter::IsSupportedL(TChar aChar)
       
  1408 	{
       
  1409 	LOGGSMU2("[1] CSmsAlphabetConverter::IsSupportedL(aChar=0x%04x)", (TUint) aChar);
       
  1410 
       
  1411 	TBool isDowngrade, isRequiresAlternativeEncoding;
       
  1412 
       
  1413     TBool  supported = IsSupportedL(aChar, ESmsEncodingNone,
       
  1414             isDowngrade, isRequiresAlternativeEncoding);
       
  1415 	
       
  1416 	LOGGSMU2("CSmsAlphabetConverter::IsSupportedL(): supported=%d.", supported);
       
  1417 
       
  1418 	return supported;
       
  1419 	} // CSmsAlphabetConverter::IsSupportedL
       
  1420 
       
  1421 
       
  1422 /**
       
  1423  *  Tests if the descriptor text is supported by the current character set.
  1402  *  Tests if the descriptor text is supported by the current character set.
  1424  *  This function can be used with 7bit and 8bit alphabets.
  1403  *  This function can be used with 7bit and 8bit alphabets.
  1425  * 
  1404  * 
  1426  *  @param aDes                                 Text string to check.
  1405  *  @param aDes                                 Text string to check.
  1427  *  @param aNumberOfUnconvertibleCharacters     Exit param for the number of
  1406  *  @param aNumberOfUnconvertibleCharacters     Exit param for the number of
  1432  *  @return  ETrue if the character is supported.
  1411  *  @return  ETrue if the character is supported.
  1433  */
  1412  */
  1434 TBool CSmsAlphabetConverter::IsSupportedL(const TDesC& aDes, TInt& aNumberOfUnconvertibleCharacters,
  1413 TBool CSmsAlphabetConverter::IsSupportedL(const TDesC& aDes, TInt& aNumberOfUnconvertibleCharacters,
  1435                                           TInt& aIndexOfFirstUnconvertibleCharacter)
  1414                                           TInt& aIndexOfFirstUnconvertibleCharacter)
  1436 	{
  1415 	{
  1437 	LOGGSMU2("[2] CSmsAlphabetConverter::IsSupportedL(aDes=\"%S\")", &aDes);
  1416 	OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSALPHABETCONVERTER_ISSUPPORTEDL_1, "[1] CSmsAlphabetConverter::IsSupportedL(aDes=\"%S\")", aDes);
  1438 
  1417 
  1439 	TInt desLength = aDes.Length();
  1418 	TInt desLength = aDes.Length();
  1440 	//
       
  1441 	// Initialise the exit params...
       
  1442 	//
       
  1443 	aNumberOfUnconvertibleCharacters    = 0;
       
  1444 	aIndexOfFirstUnconvertibleCharacter = desLength;
       
  1445 
  1419 
  1446     //
  1420     //
  1447     // Create buffers for the input converted to 7Bit and a buffer for it once
  1421     // Create buffer for restored text string...
  1448     // converted back again...
       
  1449     //
  1422     //
  1450     HBufC8* encodedBuf       = HBufC8::NewLC(desLength*2); // worse case
       
  1451     HBufC*  backToUnicodeAfterStdBuf = HBufC::NewLC(desLength);
  1423     HBufC*  backToUnicodeAfterStdBuf = HBufC::NewLC(desLength);
  1452     TPtr8  encoded(encodedBuf->Des());
       
  1453     TPtr  backToUnicodeAfterStd(backToUnicodeAfterStdBuf->Des());
  1424     TPtr  backToUnicodeAfterStd(backToUnicodeAfterStdBuf->Des());
  1454 
       
  1455     //
       
  1456     // Convert the input string to standard 7bit (with downgrades if needed)...
       
  1457     // 
       
  1458     PrepareForConversionFromNativeL(ESmsEncodingNone);
       
  1459 
       
  1460     TInt  notConverted = iCharacterSetConverter.ConvertFromUnicode(encoded, aDes);
       
  1461 
       
  1462     if (notConverted > 0)
       
  1463         {
       
  1464         aNumberOfUnconvertibleCharacters += notConverted;
       
  1465         }
       
  1466     else if (notConverted < 0)
       
  1467         {
       
  1468         aNumberOfUnconvertibleCharacters = desLength;
       
  1469         }
       
  1470     
  1425     
  1471     //
  1426     //
  1472     // Convert it back again to the native format...
  1427     // Convert the string...
  1473     //
  1428     //   
  1474     TInt  state       = CCnvCharacterSetConverter::KStateDefault;
  1429 	TInt numberOfDowngradedCharacters;
  1475     TInt  notRestored = iCharacterSetConverter.ConvertToUnicode(backToUnicodeAfterStd, encoded, state);
  1430 	TBool isCountDowngrade = EFalse; // Don't count downgrades
  1476 
  1431 	ConvertWith7BitEncodingL(aDes, backToUnicodeAfterStd, 
  1477     if (notRestored > 0)
  1432             aNumberOfUnconvertibleCharacters, numberOfDowngradedCharacters, 
  1478         {
  1433             aIndexOfFirstUnconvertibleCharacter, isCountDowngrade);
  1479         aNumberOfUnconvertibleCharacters += notRestored;
  1434 	
  1480         }
       
  1481     else if (notRestored < 0)
       
  1482         {
       
  1483         aNumberOfUnconvertibleCharacters = desLength;
       
  1484         }
       
  1485 
       
  1486     //
       
  1487     // Work out if the string is acceptable as it is (e.g. no unconvertible
       
  1488     // and no downgrades). We only need do this if the previous conversions were
       
  1489     // complete with no issues.
       
  1490     //
       
  1491     for (TInt pos = desLength-1;  pos >= 0;  --pos)
       
  1492         {
       
  1493         if (backToUnicodeAfterStd[pos] != aDes[pos])
       
  1494             {
       
  1495             aNumberOfUnconvertibleCharacters++;
       
  1496             aIndexOfFirstUnconvertibleCharacter = pos;
       
  1497             }
       
  1498         }
       
  1499     
       
  1500     CleanupStack::PopAndDestroy(backToUnicodeAfterStdBuf);
  1435     CleanupStack::PopAndDestroy(backToUnicodeAfterStdBuf);
  1501     CleanupStack::PopAndDestroy(encodedBuf);
       
  1502 	
  1436 	
  1503 	//
       
  1504 	// Useful logging...
       
  1505 	//
       
  1506 	TBool  supported = (aNumberOfUnconvertibleCharacters == 0);
  1437 	TBool  supported = (aNumberOfUnconvertibleCharacters == 0);
  1507 
  1438 
  1508 	LOGGSMU2("CSmsAlphabetConverter::IsSupportedL(): aNumberOfUnconvertibleCharacters=%d.", aNumberOfUnconvertibleCharacters);
  1439 	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSALPHABETCONVERTER_ISSUPPORTEDL_2, "CSmsAlphabetConverter::IsSupportedL(): aNumberOfUnconvertibleCharacters=%d.", aNumberOfUnconvertibleCharacters);
  1509 	LOGGSMU2("CSmsAlphabetConverter::IsSupportedL(): aIndexOfFirstUnconvertibleCharacter=%d.", aIndexOfFirstUnconvertibleCharacter);
  1440 	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSALPHABETCONVERTER_ISSUPPORTEDL_3, "CSmsAlphabetConverter::IsSupportedL(): aIndexOfFirstUnconvertibleCharacter=%d.", aIndexOfFirstUnconvertibleCharacter);
  1510 	LOGGSMU2("CSmsAlphabetConverter::IsSupportedL(): supported=%d.", supported);
  1441 	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSALPHABETCONVERTER_ISSUPPORTEDL_4, "CSmsAlphabetConverter::IsSupportedL(): supported=%d.", supported);
  1511 
       
  1512 	return supported;
       
  1513 	} // CSmsAlphabetConverter::IsSupportedL
       
  1514 
       
  1515 
       
  1516 /**
       
  1517  *  Tests if the character is supported by the current character set.
       
  1518  *  This function can be used with 7bit and 8bit alphabets.
       
  1519  * 
       
  1520  *  @param aChar                         Character to investigate.
       
  1521  *  @param aEncoding                     Alternative 7bit encoding (if used).
       
  1522  *  @param aIsDowngrade                  Exit param set to ETrue if the
       
  1523  *                                       character has to be downgraded.
       
  1524  *  @param aRequiresAlternativeEncoding  Exit param set to ETrue if the
       
  1525  *                                       alternative encoding has to be
       
  1526  *                                       used to encode it.
       
  1527  * 
       
  1528  *  @return  ETrue if the character is supported.
       
  1529  */
       
  1530 TBool CSmsAlphabetConverter::IsSupportedL(TChar aChar, TSmsEncoding aEncoding,
       
  1531 		                                  TBool& aIsDowngrade,
       
  1532                                           TBool& aRequiresAlternativeEncoding)
       
  1533 	{
       
  1534 	LOGGSMU2("[3] CSmsAlphabetConverter::IsSupportedL(aChar=0x%04x)", (TUint) aChar);
       
  1535 
       
  1536 	//
       
  1537 	// Convert the character...
       
  1538 	//
       
  1539 	TInt  numberOfUnconvertibleCharacters, numberOfDowngradedCharacters, 
       
  1540             numberRequiringAlternativeEncoding, indexOfFirstUnconvertibleCharacter;
       
  1541 	TBuf<4>   toEncode;
       
  1542 
       
  1543 	toEncode.SetLength(1);
       
  1544 	toEncode[0]=(TText)aChar;
       
  1545 
       
  1546 	TBool supported = IsSupportedL(toEncode, aEncoding, 
       
  1547 	        numberOfUnconvertibleCharacters,
       
  1548 	        numberOfDowngradedCharacters,
       
  1549 	        numberRequiringAlternativeEncoding,
       
  1550 	        indexOfFirstUnconvertibleCharacter);
       
  1551 
       
  1552 	//
       
  1553 	// Calculate the exit params...
       
  1554 	//
       
  1555 	aIsDowngrade                 = (numberOfDowngradedCharacters > 0);
       
  1556 	aRequiresAlternativeEncoding = (numberRequiringAlternativeEncoding > 0);
       
  1557 	    
       
  1558 	//
       
  1559 	// Useful logging...
       
  1560 	//
       
  1561 	LOGGSMU2("CSmsAlphabetConverter::IsSupportedL(): aIsDowngrade=%d.", aIsDowngrade);
       
  1562 	LOGGSMU2("CSmsAlphabetConverter::IsSupportedL(): aRequiresAlternativeEncoding=%d.", aRequiresAlternativeEncoding);
       
  1563 	LOGGSMU2("CSmsAlphabetConverter::IsSupportedL(): supported=%d.", supported);
       
  1564 
  1442 
  1565 	return supported;
  1443 	return supported;
  1566 	} // CSmsAlphabetConverter::IsSupportedL
  1444 	} // CSmsAlphabetConverter::IsSupportedL
  1567 
  1445 
  1568 
  1446 
  1588 										  TInt& aNumberOfUnconvertibleCharacters,
  1466 										  TInt& aNumberOfUnconvertibleCharacters,
  1589                                           TInt& aNumberOfDowngradedCharacters,
  1467                                           TInt& aNumberOfDowngradedCharacters,
  1590                                           TInt& aNumberRequiringAlternativeEncoding,
  1468                                           TInt& aNumberRequiringAlternativeEncoding,
  1591                                           TInt& aIndexOfFirstUnconvertibleCharacter)
  1469                                           TInt& aIndexOfFirstUnconvertibleCharacter)
  1592 	{
  1470 	{
  1593 	LOGGSMU2("[4] CSmsAlphabetConverter::IsSupportedL(aDes=\"%S\")", &aDes);
  1471 	OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSALPHABETCONVERTER_ISSUPPORTEDL1_1, "[2] CSmsAlphabetConverter::IsSupportedL(aDes=\"%S\")", aDes);
  1594 
  1472 
  1595 	TInt desLength = aDes.Length();
  1473 	TInt desLength = aDes.Length();
  1596 	//
  1474 	//
  1597 	// Initialise the exit params...
  1475 	// Initialise the exit param...
  1598 	//
  1476 	//
  1599 	aNumberOfUnconvertibleCharacters    = 0;
       
  1600 	aNumberOfDowngradedCharacters       = 0;
       
  1601 	aNumberRequiringAlternativeEncoding = 0;
  1477 	aNumberRequiringAlternativeEncoding = 0;
  1602 	aIndexOfFirstUnconvertibleCharacter = desLength;
       
  1603 	
  1478 	
  1604 	//
  1479 	//
  1605 	// Create buffers for the input converted to 7Bit and a buffer for it once
  1480 	// Create buffer for restored text string...
  1606 	// converted back again...
       
  1607 	//
  1481 	//
  1608     HBufC8* encodedBuf       = HBufC8::NewLC(desLength*2); // worse case
       
  1609     HBufC*  backToUnicodeAfterStdBuf = HBufC::NewLC(desLength);
  1482     HBufC*  backToUnicodeAfterStdBuf = HBufC::NewLC(desLength);
  1610     TPtr8  encoded(encodedBuf->Des());
       
  1611     TPtr  backToUnicodeAfterStd(backToUnicodeAfterStdBuf->Des());
  1483     TPtr  backToUnicodeAfterStd(backToUnicodeAfterStdBuf->Des());
  1612 
  1484     TBool  isCountDowngrade = ETrue; // Count downgraded chars
  1613     //
       
  1614     // Convert the input string to standard 7bit (with downgrades if needed)...
       
  1615     // 
       
  1616     PrepareForConversionFromNativeL(ESmsEncodingNone);
       
  1617 
       
  1618     TInt  notConverted = iCharacterSetConverter.ConvertFromUnicode(encoded, aDes);
       
  1619 
       
  1620     if (notConverted > 0)
       
  1621         {
       
  1622         aNumberOfUnconvertibleCharacters += notConverted;
       
  1623         }
       
  1624     else if (notConverted < 0)
       
  1625         {
       
  1626         aNumberOfUnconvertibleCharacters = desLength;
       
  1627         }
       
  1628     
  1485     
  1629     //
  1486     //
  1630     // Convert it back again to the native format...
  1487     // Convert the character...
  1631     //
  1488     //   
  1632     TInt  state       = CCnvCharacterSetConverter::KStateDefault;
  1489     ConvertWith7BitEncodingL(aDes, backToUnicodeAfterStd, 
  1633     TInt  notRestored = iCharacterSetConverter.ConvertToUnicode(backToUnicodeAfterStd, encoded, state);
  1490             aNumberOfUnconvertibleCharacters, aNumberOfDowngradedCharacters, 
  1634 
  1491             aIndexOfFirstUnconvertibleCharacter, isCountDowngrade);
  1635     if (notRestored > 0)
  1492     
  1636         {
       
  1637         aNumberOfUnconvertibleCharacters += notRestored;
       
  1638         }
       
  1639     else if (notRestored < 0)
       
  1640         {
       
  1641         aNumberOfUnconvertibleCharacters = desLength;
       
  1642         }
       
  1643 
       
  1644     //
       
  1645     // Work out if the string is acceptable as it is (e.g. no unconvertible
       
  1646     // and no downgrades).
       
  1647     //
       
  1648     for (TInt pos = desLength-1;  pos >= 0;  --pos)
       
  1649         {
       
  1650         if (backToUnicodeAfterStd[pos] != aDes[pos])
       
  1651             {
       
  1652             if (backToUnicodeAfterStd[pos] != KReplacementCharacter)
       
  1653                 {
       
  1654                 aNumberOfDowngradedCharacters++;
       
  1655                 }
       
  1656             else
       
  1657                 {
       
  1658                 aNumberOfUnconvertibleCharacters++;
       
  1659                 aIndexOfFirstUnconvertibleCharacter = pos;
       
  1660                 }
       
  1661             }
       
  1662         }
       
  1663 
       
  1664     TInt  totalCharFaultsSoFar = aNumberOfUnconvertibleCharacters + 
  1493     TInt  totalCharFaultsSoFar = aNumberOfUnconvertibleCharacters + 
  1665                                     aNumberOfDowngradedCharacters;
  1494                                     aNumberOfDowngradedCharacters;
  1666     
  1495     
  1667     //
  1496     //
  1668     // If the total unconvertible plus downgrades is zero, then there is nothing
  1497     // If the total unconvertible plus downgrades is zero, then there is nothing
  1692         // Initialise the params...
  1521         // Initialise the params...
  1693         //
  1522         //
  1694         TInt  tmpDowngradedCharacters        = 0;
  1523         TInt  tmpDowngradedCharacters        = 0;
  1695         TInt  tmpUnconvertibleCharacters     = 0;
  1524         TInt  tmpUnconvertibleCharacters     = 0;
  1696         TInt  tmpIndexOfFirstUnconvertibleCharacter = desLength;
  1525         TInt  tmpIndexOfFirstUnconvertibleCharacter = desLength;
  1697 		
  1526         
  1698         //
  1527         ConvertWithAlternativeEncodingL(aDes, backToUnicodeAfterStd, aEncoding,
  1699         // Convert the input string to the alternative encoding...
  1528                 tmpUnconvertibleCharacters, tmpDowngradedCharacters,
  1700         //
  1529                 aNumberRequiringAlternativeEncoding,
  1701         PrepareForConversionFromNativeL(aEncoding);
  1530                 tmpIndexOfFirstUnconvertibleCharacter);       
  1702 
  1531         
  1703         notConverted = iCharacterSetConverter.ConvertFromUnicode(encoded, aDes);
       
  1704         if (notConverted > 0)
       
  1705             {
       
  1706             tmpUnconvertibleCharacters = notConverted;
       
  1707             }
       
  1708         else if (notConverted < 0)
       
  1709             {
       
  1710             tmpUnconvertibleCharacters = desLength;
       
  1711             }
       
  1712 
       
  1713         //
       
  1714         // Convert it back again to the native format...
       
  1715         //
       
  1716         HBufC*  backToUnicodeAfterAltBuf = HBufC::NewLC(desLength);
       
  1717         TPtr  backToUnicodeAfterAlt(backToUnicodeAfterAltBuf->Des());
       
  1718         TInt  state       = CCnvCharacterSetConverter::KStateDefault;
       
  1719         TInt  notRestored = iCharacterSetConverter.ConvertToUnicode(backToUnicodeAfterAlt, encoded, state);
       
  1720 
       
  1721         if (notRestored > 0)
       
  1722             {
       
  1723             tmpUnconvertibleCharacters += notRestored;
       
  1724             }
       
  1725         else if (notRestored < 0)
       
  1726             {
       
  1727             tmpUnconvertibleCharacters = desLength;
       
  1728             }
       
  1729 
       
  1730         //
       
  1731         // Now work out which characters are downgrades, require alternative encoding
       
  1732         // or are unsupported.
       
  1733         //
       
  1734         for (TInt pos = desLength-1;  pos >= 0;  --pos)
       
  1735             {
       
  1736             if (backToUnicodeAfterStd[pos] != aDes[pos])
       
  1737                 {
       
  1738                 // Not supported by standard encoder...
       
  1739                 if (backToUnicodeAfterAlt[pos] == aDes[pos])
       
  1740                     {
       
  1741                     // Supported by alternative encoder...
       
  1742                     aNumberRequiringAlternativeEncoding++;
       
  1743                     }
       
  1744                 else if (backToUnicodeAfterStd[pos] != KReplacementCharacter)
       
  1745                     {
       
  1746                     // Downgraded by standard encoder...
       
  1747                     tmpDowngradedCharacters++;
       
  1748                     }
       
  1749                 else if (backToUnicodeAfterAlt[pos] != KReplacementCharacter)
       
  1750                     {
       
  1751                     // Downgraded by alternative encoder...
       
  1752                     tmpDowngradedCharacters++;
       
  1753                     aNumberRequiringAlternativeEncoding++;
       
  1754                     }
       
  1755                 else
       
  1756                     {
       
  1757                     // Unconvertible...
       
  1758                     tmpUnconvertibleCharacters++;
       
  1759                     tmpIndexOfFirstUnconvertibleCharacter = pos;
       
  1760                     }
       
  1761                 }
       
  1762             }
       
  1763 
       
  1764         // Is this better?  
  1532         // Is this better?  
  1765         if ( totalCharFaultsSoFar >= (tmpUnconvertibleCharacters + tmpDowngradedCharacters) )
  1533         if ( totalCharFaultsSoFar >= (tmpUnconvertibleCharacters + tmpDowngradedCharacters) )
  1766             {
  1534             {
  1767             // Best conversion is the alternative conversion
  1535             // Best conversion is the alternative conversion
  1768             aNumberOfUnconvertibleCharacters     = tmpUnconvertibleCharacters;
  1536             aNumberOfUnconvertibleCharacters     = tmpUnconvertibleCharacters;
  1772         else
  1540         else
  1773             {
  1541             {
  1774             // Best conversion is the standard conversion
  1542             // Best conversion is the standard conversion
  1775             aNumberRequiringAlternativeEncoding = 0;
  1543             aNumberRequiringAlternativeEncoding = 0;
  1776             }
  1544             }
  1777         
       
  1778         CleanupStack::PopAndDestroy(backToUnicodeAfterAltBuf);
       
  1779         }
  1545         }
  1780     
  1546     
  1781     CleanupStack::PopAndDestroy(backToUnicodeAfterStdBuf);
  1547     CleanupStack::PopAndDestroy(backToUnicodeAfterStdBuf);   
  1782     CleanupStack::PopAndDestroy(encodedBuf);
  1548  
  1783 
       
  1784 	//
  1549 	//
  1785 	// Useful logging...
  1550 	// Useful logging...
  1786 	//
  1551 	//
  1787 	TBool  supported = (aNumberOfUnconvertibleCharacters == 0);
  1552 	TBool  supported = (aNumberOfUnconvertibleCharacters == 0);
  1788 
  1553 
  1789 	LOGGSMU2("CSmsAlphabetConverter::IsSupportedL(): aNumberOfUnconvertibleCharacters=%d.", aNumberOfUnconvertibleCharacters);
  1554 	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSALPHABETCONVERTER_ISSUPPORTEDL1_2, "CSmsAlphabetConverter::IsSupportedL(): aNumberOfUnconvertibleCharacters=%d.", aNumberOfUnconvertibleCharacters);
  1790 	LOGGSMU2("CSmsAlphabetConverter::IsSupportedL(): aNumberOfDowngradedCharacters=%d.", aNumberOfDowngradedCharacters);
  1555 	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSALPHABETCONVERTER_ISSUPPORTEDL1_3, "CSmsAlphabetConverter::IsSupportedL(): aNumberOfDowngradedCharacters=%d.", aNumberOfDowngradedCharacters);
  1791 	LOGGSMU2("CSmsAlphabetConverter::IsSupportedL(): aNumberRequiringAlternativeEncoding=%d.", aNumberRequiringAlternativeEncoding);
  1556 	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSALPHABETCONVERTER_ISSUPPORTEDL1_4, "CSmsAlphabetConverter::IsSupportedL(): aNumberRequiringAlternativeEncoding=%d.", aNumberRequiringAlternativeEncoding);
  1792 	LOGGSMU2("CSmsAlphabetConverter::IsSupportedL(): aIndexOfFirstUnconvertibleCharacter=%d.", aIndexOfFirstUnconvertibleCharacter);
  1557 	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSALPHABETCONVERTER_ISSUPPORTEDL1_5, "CSmsAlphabetConverter::IsSupportedL(): aIndexOfFirstUnconvertibleCharacter=%d.", aIndexOfFirstUnconvertibleCharacter);
  1793 	LOGGSMU2("CSmsAlphabetConverter::IsSupportedL(): supported=%d.", supported);
  1558 	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSALPHABETCONVERTER_ISSUPPORTEDL1_6, "CSmsAlphabetConverter::IsSupportedL(): supported=%d.", supported);
  1794 
  1559 
  1795 	return supported;
  1560 	return supported;
  1796 	} // CSmsAlphabetConverter::IsSupportedL
  1561 	} // CSmsAlphabetConverter::IsSupportedL
  1797 
  1562 
       
  1563 
       
  1564 /**
       
  1565  *  Tests if the descriptor text is supported by the current character set.
       
  1566  * 
       
  1567  *  @param aDes                                 Text string to check.
       
  1568  *  @param aRestoredDes                         Exit restored text string after conversion.
       
  1569  *  @param aNumberOfUnconvertibleCharacters     Exit param for the number of
       
  1570  *                                              characters unconvertible.
       
  1571  *  @param aNumberOfDowngradedCharacters        Exit param for the number of
       
  1572  *                                              downgraded characters.
       
  1573  *  @param aIndexOfFirstUnconvertibleCharacter  Exit param for the first
       
  1574  *                                              unconverted character.
       
  1575  *  @param aIsCountDowngrade                    Flag for counting downgrades.
       
  1576  */
       
  1577 void CSmsAlphabetConverter::ConvertWith7BitEncodingL(const TDesC& aDes, TDes& aRestoredDes,
       
  1578                                           TInt& aNumberOfUnconvertibleCharacters,
       
  1579                                           TInt& aNumberOfDowngradedCharacters,
       
  1580                                           TInt& aIndexOfFirstUnconvertibleCharacter,
       
  1581                                           TBool aIsCountDowngrade)
       
  1582     {
       
  1583  	OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSALPHABETCONVERTER_CONVERTWITH7BITENCODINGL_1, "CSmsAlphabetConverter::ConvertWith7BitEncodingL(aDes=\"%S\")", aDes);
       
  1584 
       
  1585     TInt desLength = aDes.Length();
       
  1586     //
       
  1587     // Initialise the exit params...
       
  1588     //
       
  1589     aNumberOfUnconvertibleCharacters    = 0;
       
  1590     aNumberOfDowngradedCharacters       = 0;
       
  1591     aIndexOfFirstUnconvertibleCharacter = desLength;
       
  1592     
       
  1593     //
       
  1594     // Create buffer for the input converted to 7Bit.
       
  1595     //
       
  1596     HBufC8* encodedBuf       = HBufC8::NewLC(desLength*2); // worse case
       
  1597     TPtr8  encoded(encodedBuf->Des());
       
  1598 
       
  1599     //
       
  1600     // Convert the input string to standard 7bit (with downgrades if needed)...
       
  1601     // 
       
  1602     PrepareForConversionFromNativeL(ESmsEncodingNone);
       
  1603 
       
  1604     TInt  notConverted = iCharacterSetConverter.ConvertFromUnicode(encoded, aDes);
       
  1605 
       
  1606     if (notConverted > 0)
       
  1607         {
       
  1608         aNumberOfUnconvertibleCharacters += notConverted;
       
  1609         }
       
  1610     else if (notConverted < 0)
       
  1611         {
       
  1612         aNumberOfUnconvertibleCharacters = desLength;
       
  1613         }
       
  1614     
       
  1615     //
       
  1616     // Convert it back again to the native format...
       
  1617     //
       
  1618     TInt  state       = CCnvCharacterSetConverter::KStateDefault;
       
  1619     TInt  notRestored = iCharacterSetConverter.ConvertToUnicode(aRestoredDes, encoded, state);
       
  1620 
       
  1621     if (notRestored > 0)
       
  1622         {
       
  1623         aNumberOfUnconvertibleCharacters += notRestored;
       
  1624         }
       
  1625     else if (notRestored < 0)
       
  1626         {
       
  1627         aNumberOfUnconvertibleCharacters = desLength;
       
  1628         }
       
  1629 
       
  1630     //
       
  1631     // Work out if the string is acceptable as it is (e.g. no unconvertible
       
  1632     // and no downgrades).
       
  1633     //
       
  1634     for (TInt pos = desLength-1;  pos >= 0;  --pos)
       
  1635         {
       
  1636         if (aRestoredDes[pos] != aDes[pos])
       
  1637             {
       
  1638             if (aRestoredDes[pos] != KReplacementCharacter
       
  1639                     && aIsCountDowngrade)
       
  1640                 {
       
  1641                 ++aNumberOfDowngradedCharacters;
       
  1642                 }
       
  1643             else
       
  1644                 {
       
  1645                 ++aNumberOfUnconvertibleCharacters;
       
  1646                 aIndexOfFirstUnconvertibleCharacter = pos;
       
  1647                 }
       
  1648             }
       
  1649         }
       
  1650     
       
  1651     CleanupStack::PopAndDestroy(encodedBuf);
       
  1652     
       
  1653 	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSALPHABETCONVERTER_CONVERTWITH7BITENCODINGL_2, "CSmsAlphabetConverter::ConvertWith7BitEncodingL(): aNumberOfUnconvertibleCharacters=%d.", aNumberOfUnconvertibleCharacters);
       
  1654 	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSALPHABETCONVERTER_CONVERTWITH7BITENCODINGL_3, "CSmsAlphabetConverter::ConvertWith7BitEncodingL(): aNumberOfDowngradedCharacters=%d.", aNumberOfDowngradedCharacters);
       
  1655 	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSALPHABETCONVERTER_CONVERTWITH7BITENCODINGL_4, "CSmsAlphabetConverter::ConvertWith7BitEncodingL(): aIndexOfFirstUnconvertibleCharacter=%d.", aIndexOfFirstUnconvertibleCharacter);
       
  1656     } // CSmsAlphabetConverter::ConvertWith7BitEncodingL    
       
  1657 
       
  1658 /**
       
  1659  *  Tests if the descriptor text is supported by given encoding.
       
  1660  *  This function can be used with 7bit and 8bit alphabets.
       
  1661  * 
       
  1662  *  @param aDes                                 Text string to check.
       
  1663  *  @param aRestoredStdDes                      Text string restored from 7bit encoding.
       
  1664  *  @param aEncoding                            Alternative 7bit encoding.
       
  1665  *  @param aNumberOfUnconvertibleCharacters     Exit param for the number of
       
  1666  *                                              characters unconvertible.
       
  1667  *  @param aNumberOfDowngradedCharacters        Exit param for the number of
       
  1668  *                                              downgraded characters.
       
  1669  *  @param aNumberRequiringAlternativeEncoding  Exit param for the number of
       
  1670  *                                              characters requiring use of
       
  1671  *                                              the alternative encoder.
       
  1672  *  @param aIndexOfFirstUnconvertibleCharacter  Exit param for the first
       
  1673  */
       
  1674 void CSmsAlphabetConverter::ConvertWithAlternativeEncodingL(const TDesC& aDes, const TDesC& aRestoredStdDes, 
       
  1675                                           TSmsEncoding aEncoding,
       
  1676                                           TInt& aNumberOfUnconvertibleCharacters,
       
  1677                                           TInt& aNumberOfDowngradedCharacters,
       
  1678                                           TInt& aNumberRequiringAlternativeEncoding,
       
  1679                                           TInt& aIndexOfFirstUnconvertibleCharacter)
       
  1680     {
       
  1681   	OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSALPHABETCONVERTER_CONVERTWITHALTERNATIVEEENCODINGL_1, "CSmsAlphabetConverter::ConvertWithAlternativeEncodingL(aDes=\"%S\")", aDes);
       
  1682   
       
  1683     TInt desLength = aDes.Length();
       
  1684     //
       
  1685     // Initialise the exit params...
       
  1686     //
       
  1687     aNumberOfUnconvertibleCharacters    = 0;
       
  1688     aNumberOfDowngradedCharacters       = 0;
       
  1689     aNumberRequiringAlternativeEncoding = 0;
       
  1690     aIndexOfFirstUnconvertibleCharacter = desLength;
       
  1691         
       
  1692     //
       
  1693     // Create buffer for the input converted to 7Bit.
       
  1694     //
       
  1695     HBufC8* encodedBuf = HBufC8::NewLC(desLength*2); // worse case
       
  1696     TPtr8  encoded(encodedBuf->Des());
       
  1697  
       
  1698     //
       
  1699     // Convert the input string to the alternative encoding...
       
  1700     //
       
  1701     PrepareForConversionFromNativeL(aEncoding);
       
  1702 
       
  1703     TInt notConverted = iCharacterSetConverter.ConvertFromUnicode(encoded, aDes);
       
  1704     if (notConverted > 0)
       
  1705         {
       
  1706         aNumberOfUnconvertibleCharacters = notConverted;
       
  1707         }
       
  1708     else if (notConverted < 0)
       
  1709         {
       
  1710         aNumberOfUnconvertibleCharacters = desLength;
       
  1711         }
       
  1712 
       
  1713     //
       
  1714     // Create buffer for restored text...
       
  1715     //
       
  1716     HBufC*  backToUnicodeBuf = HBufC::NewLC(desLength);
       
  1717     TPtr  backToUnicode(backToUnicodeBuf->Des());
       
  1718 
       
  1719     //
       
  1720     // Convert it back again to the native format...
       
  1721     //
       
  1722     TInt  state       = CCnvCharacterSetConverter::KStateDefault;
       
  1723     TInt  notRestored = iCharacterSetConverter.ConvertToUnicode(backToUnicode, encoded, state);
       
  1724 
       
  1725     if (notRestored > 0)
       
  1726         {
       
  1727         aNumberOfUnconvertibleCharacters += notRestored;
       
  1728         }
       
  1729     else if (notRestored < 0)
       
  1730         {
       
  1731         aNumberOfUnconvertibleCharacters = desLength;
       
  1732         }
       
  1733 
       
  1734     //
       
  1735     // Now work out which characters are downgrades, require alternative encoding
       
  1736     // or are unsupported.
       
  1737     //
       
  1738     for (TInt pos = desLength-1;  pos >= 0;  --pos)
       
  1739         {
       
  1740         if (aRestoredStdDes[pos] != aDes[pos])
       
  1741             {
       
  1742             // Not supported by standard encoder...
       
  1743             if (backToUnicode[pos] == aDes[pos])
       
  1744                 {
       
  1745                 // Supported by alternative encoder...
       
  1746                 ++aNumberRequiringAlternativeEncoding;
       
  1747                 }
       
  1748             else if (aRestoredStdDes[pos] != KReplacementCharacter)
       
  1749                 {
       
  1750                 // Downgraded by standard encoder...
       
  1751                 ++aNumberOfDowngradedCharacters;
       
  1752                 }
       
  1753             else if (backToUnicode[pos] != KReplacementCharacter)
       
  1754                 {
       
  1755                 // Downgraded by alternative encoder...
       
  1756                 ++aNumberOfDowngradedCharacters;
       
  1757                 ++aNumberRequiringAlternativeEncoding;
       
  1758                 }
       
  1759             else
       
  1760                 {
       
  1761                 // Unconvertible...
       
  1762                 ++aNumberOfUnconvertibleCharacters;
       
  1763                 aIndexOfFirstUnconvertibleCharacter = pos;
       
  1764                 }
       
  1765             }
       
  1766         }
       
  1767 
       
  1768     CleanupStack::PopAndDestroy(2, encodedBuf); // backToUnicode, encodedBuf
       
  1769     
       
  1770  	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSALPHABETCONVERTER_CONVERTWITHALTERNATIVEEENCODINGL_2, "CSmsAlphabetConverter::ConvertWithAlternativeEncodingL(): aNumberOfUnconvertibleCharacters=%d.", aNumberOfUnconvertibleCharacters);
       
  1771 	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSALPHABETCONVERTER_CONVERTWITHALTERNATIVEEENCODINGL_3, "CSmsAlphabetConverter::ConvertWithAlternativeEncodingL(): aNumberOfDowngradedCharacters=%d.", aNumberOfDowngradedCharacters);
       
  1772 	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSALPHABETCONVERTER_CONVERTWITHALTERNATIVEEENCODINGL_4, "CSmsAlphabetConverter::ConvertWithAlternativeEncodingL(): aNumberRequiringAlternativeEncoding=%d.", aNumberRequiringAlternativeEncoding);
       
  1773 	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSALPHABETCONVERTER_CONVERTWITHALTERNATIVEEENCODINGL_5, "CSmsAlphabetConverter::ConvertWithAlternativeEncodingL(): aIndexOfFirstUnconvertibleCharacter=%d.", aIndexOfFirstUnconvertibleCharacter);
       
  1774     } // CSmsAlphabetConverter::ConvertWithAlternativeEncodingL    
  1798 
  1775 
  1799 /**
  1776 /**
  1800  *  Given a piece of text and an alternative encoding, this function works out
  1777  *  Given a piece of text and an alternative encoding, this function works out
  1801  *  which encoding is best to use and returns the ID of that converter.
  1778  *  which encoding is best to use and returns the ID of that converter.
  1802  * 
  1779  * 
  1806  *  @return Encoding that should be used.
  1783  *  @return Encoding that should be used.
  1807  */
  1784  */
  1808 TSmsEncoding CSmsAlphabetConverter::FindBestAlternativeEncodingL(const TDesC& aNativeCharacters,
  1785 TSmsEncoding CSmsAlphabetConverter::FindBestAlternativeEncodingL(const TDesC& aNativeCharacters,
  1809 									                     		 TSmsEncoding aSuggestedEncoding)
  1786 									                     		 TSmsEncoding aSuggestedEncoding)
  1810 	{
  1787 	{
  1811 	LOGGSMU2("CSmsAlphabetConverter::FindBestAlternativeEncodingL(): aSuggestedEncoding=%d",
  1788 	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSALPHABETCONVERTER_FINDBESTALTERNATIVEENCODINGL_1, "CSmsAlphabetConverter::FindBestAlternativeEncodingL(): aSuggestedEncoding=%d",aSuggestedEncoding);
  1812 			 aSuggestedEncoding);
       
  1813 
  1789 
  1814 	TSmsEncoding  encodingToUse = ESmsEncodingNone;
  1790 	TSmsEncoding  encodingToUse = ESmsEncodingNone;
  1815 
  1791 
  1816 	//
  1792 	//
  1817 	// If this is not 7bit or the alternative encoding is not set then do
  1793 	// If this is not 7bit or the alternative encoding is not set then do
  1818 	// nothing...
  1794 	// nothing...
  1819 	//
  1795 	//
  1820 	if (aSuggestedEncoding != ESmsEncodingNone  &&
  1796 	if (aSuggestedEncoding != ESmsEncodingNone  &&
  1821 		iSmsAlphabet == TSmsDataCodingScheme::ESmsAlphabet7Bit)
  1797 		iSmsAlphabet == TSmsDataCodingScheme::ESmsAlphabet7Bit)
  1822 		{
  1798 		{
       
  1799         TInt desLength = aNativeCharacters.Length();
  1823 		TInt  numberOfUnconvertibleCharacters, numberOfDowngradedCharacters;
  1800 		TInt  numberOfUnconvertibleCharacters, numberOfDowngradedCharacters;
  1824 		TInt  numberRequiringAlternativeEncoding, indexOfFirstUnconvertibleCharacter;
  1801 		TInt  numberRequiringAlternativeEncoding, indexOfFirstUnconvertibleCharacter;
  1825 		
  1802 		
  1826 		//
  1803 		//
  1827 		// First try the default encoding (but in this case treat downgrades
  1804 		// First try the default encoding (but in this case treat downgrades
  1828 		// as unconverted, since later encoders might do better)...
  1805 		// as unconverted, since later encoders might do better)...
  1829 		//
  1806 		//
  1830 		IsSupportedL(aNativeCharacters, ESmsEncodingNone,
  1807 		HBufC*  backToUnicodeAfterStdBuf = HBufC::NewLC(desLength);
  1831 					 numberOfUnconvertibleCharacters,
  1808 	    TPtr  backToUnicodeAfterStd(backToUnicodeAfterStdBuf->Des());
  1832                      numberOfDowngradedCharacters,
  1809 	    TBool  isCountDowngrade = ETrue; // Count downgraded chars
  1833                      numberRequiringAlternativeEncoding,
  1810 		
  1834                      indexOfFirstUnconvertibleCharacter);
  1811 	    ConvertWith7BitEncodingL(aNativeCharacters, backToUnicodeAfterStd, 
       
  1812 	            numberOfUnconvertibleCharacters, numberOfDowngradedCharacters, 
       
  1813 	            indexOfFirstUnconvertibleCharacter, isCountDowngrade);
       
  1814 		
  1835 
  1815 
  1836 		TInt leastUnconvertibleCharacters = numberOfUnconvertibleCharacters + numberOfDowngradedCharacters;
  1816 		TInt leastUnconvertibleCharacters = numberOfUnconvertibleCharacters + numberOfDowngradedCharacters;
  1837 
  1817 
  1838 		//
  1818 		if (leastUnconvertibleCharacters > 0)
  1839 		// Create a list of alternative encodings to try...
  1819 		    {
  1840 		//
  1820             //
  1841 		TSmsEncoding  encodingList[8];
  1821             // Create a list of alternative encodings to try...
  1842 		TInt          encodingCount = 0;
  1822             //
       
  1823             TSmsEncoding  encodingList[8];
       
  1824             TInt          encodingCount = 0;
       
  1825             
       
  1826             if (aSuggestedEncoding == ESmsEncodingTurkishLockingAndSingleShift)
       
  1827                 {
       
  1828                 encodingList[encodingCount++] = ESmsEncodingTurkishSingleShift;
       
  1829                 encodingList[encodingCount++] = ESmsEncodingTurkishLockingShift;
       
  1830                 }
       
  1831             else if (aSuggestedEncoding == ESmsEncodingPortugueseLockingAndSingleShift)
       
  1832                 {
       
  1833                 encodingList[encodingCount++] = ESmsEncodingPortugueseSingleShift;
       
  1834                 encodingList[encodingCount++] = ESmsEncodingPortugueseLockingShift;
       
  1835                 }
       
  1836             
       
  1837             encodingList[encodingCount++] = aSuggestedEncoding;
       
  1838 
       
  1839             //
       
  1840             // Now try the all the alternatives...
       
  1841             //
       
  1842             for (TInt  encoder = 0;  encoder < encodingCount && leastUnconvertibleCharacters > 0;  ++encoder)
       
  1843                 {
       
  1844                 ConvertWithAlternativeEncodingL(aNativeCharacters, backToUnicodeAfterStd, 
       
  1845                         encodingList[encoder], 
       
  1846                         numberOfUnconvertibleCharacters, 
       
  1847                         numberOfDowngradedCharacters,
       
  1848                         numberRequiringAlternativeEncoding,
       
  1849                         indexOfFirstUnconvertibleCharacter);       
       
  1850 
       
  1851                 if (numberOfUnconvertibleCharacters + numberOfDowngradedCharacters < leastUnconvertibleCharacters)
       
  1852                     {
       
  1853                     encodingToUse = encodingList[encoder];
       
  1854                     leastUnconvertibleCharacters = numberOfUnconvertibleCharacters + numberOfDowngradedCharacters;
       
  1855                     }
       
  1856                 }
       
  1857 		    }
  1843 		
  1858 		
  1844 		if (aSuggestedEncoding == ESmsEncodingTurkishLockingAndSingleShift)
  1859             CleanupStack::PopAndDestroy(backToUnicodeAfterStdBuf);
  1845 			{
       
  1846 			encodingList[encodingCount++] = ESmsEncodingTurkishSingleShift;
       
  1847 			encodingList[encodingCount++] = ESmsEncodingTurkishLockingShift;
       
  1848 			}
       
  1849 		else if (aSuggestedEncoding == ESmsEncodingPortugueseLockingAndSingleShift)
       
  1850 			{
       
  1851 			encodingList[encodingCount++] = ESmsEncodingPortugueseSingleShift;
       
  1852 			encodingList[encodingCount++] = ESmsEncodingPortugueseLockingShift;
       
  1853 			}
       
  1854 
       
  1855 		encodingList[encodingCount++] = aSuggestedEncoding;
       
  1856 		encodingList[encodingCount++] = ESmsEncodingNone;
       
  1857 
       
  1858 		//
       
  1859 		// Now try the all the alternatives...
       
  1860 		//
       
  1861 		for (TInt  encoder = 0;  encoder < encodingCount;  encoder++)
       
  1862 			{
       
  1863 			IsSupportedL(aNativeCharacters, encodingList[encoder],
       
  1864 						 numberOfUnconvertibleCharacters,
       
  1865 	                     numberOfDowngradedCharacters,
       
  1866 	                     numberRequiringAlternativeEncoding,
       
  1867 	                     indexOfFirstUnconvertibleCharacter);
       
  1868 			if (numberOfUnconvertibleCharacters + numberOfDowngradedCharacters < leastUnconvertibleCharacters)
       
  1869 				{
       
  1870 				encodingToUse = encodingList[encoder];
       
  1871 				leastUnconvertibleCharacters = numberOfUnconvertibleCharacters + numberOfDowngradedCharacters;
       
  1872 				}
       
  1873 			}
       
  1874 		}
  1860 		}
  1875 
  1861 
  1876 	LOGGSMU2("CSmsAlphabetConverter::FindBestAlternativeEncodingL(): encodingToUse=%d", encodingToUse);
  1862 	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSALPHABETCONVERTER_FINDBESTALTERNATIVEENCODINGL_2, "CSmsAlphabetConverter::FindBestAlternativeEncodingL(): encodingToUse=%d", encodingToUse);
  1877 
  1863 
  1878 	return encodingToUse;
  1864 	return encodingToUse;
  1879 	} // CSmsAlphabetConverter::FindBestAlternativeEncoding
  1865 	} // CSmsAlphabetConverter::FindBestAlternativeEncoding
  1880 
  1866 
  1881 
  1867 
  1915  * 
  1901  * 
  1916  *  @param aEncoding  Alternative 7bit encoding to use if required.
  1902  *  @param aEncoding  Alternative 7bit encoding to use if required.
  1917  */
  1903  */
  1918 void CSmsAlphabetConverter::PrepareForConversionFromNativeL(TSmsEncoding aEncoding)
  1904 void CSmsAlphabetConverter::PrepareForConversionFromNativeL(TSmsEncoding aEncoding)
  1919 	{
  1905 	{
  1920 	LOGGSMU2("CSmsAlphabetConverter::PrepareForConversionFromNativeL(): aEncoding=%d",
  1906 	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSALPHABETCONVERTER_PREPAREFORCONVERSIONFROMNATIVEL_1, "CSmsAlphabetConverter::PrepareForConversionFromNativeL(): aEncoding=%d",aEncoding);
  1921 			 aEncoding);
       
  1922 
  1907 
  1923 	__ASSERT_DEBUG(iIsBinary==EFalse,Panic(KGsmuPanicUnsupportedAlphabet));
  1908 	__ASSERT_DEBUG(iIsBinary==EFalse,Panic(KGsmuPanicUnsupportedAlphabet));
  1924 	switch (iSmsAlphabet)
  1909 	switch (iSmsAlphabet)
  1925 		{
  1910 		{
  1926 		case TSmsDataCodingScheme::ESmsAlphabet7Bit:
  1911 		case TSmsDataCodingScheme::ESmsAlphabet7Bit:
  1936 				GetAlternativeEncoderIDL(aEncoding, alternativeEncoderID);
  1921 				GetAlternativeEncoderIDL(aEncoding, alternativeEncoderID);
  1937 				if (alternativeEncoderID != 0)
  1922 				if (alternativeEncoderID != 0)
  1938 					{
  1923 					{
  1939 					CCnvCharacterSetConverter::TAvailability  availability;
  1924 					CCnvCharacterSetConverter::TAvailability  availability;
  1940 		
  1925 		
  1941 					LOGGSMU2("CSmsAlphabetConverter::PrepareForConversionFromNativeL(): Converter 0x%08x",
  1926 					OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSALPHABETCONVERTER_PREPAREFORCONVERSIONFROMNATIVEL_2, "CSmsAlphabetConverter::PrepareForConversionFromNativeL(): Converter 0x%08x",alternativeEncoderID);
  1942 							 alternativeEncoderID);
       
  1943 					
  1927 					
  1944 					availability = iCharacterSetConverter.PrepareToConvertToOrFromL(alternativeEncoderID, iFs);
  1928 					availability = iCharacterSetConverter.PrepareToConvertToOrFromL(alternativeEncoderID, iFs);
  1945 					if (availability == CCnvCharacterSetConverter::EAvailable)
  1929 					if (availability == CCnvCharacterSetConverter::EAvailable)
  1946 						{
  1930 						{
  1947 			 			// Force unicode line termination characters to simple line feed
  1931 			 			// Force unicode line termination characters to simple line feed
  2006  * 
  1990  * 
  2007  *  @param aEncoding  Alternative 7bit encoding to use if required.
  1991  *  @param aEncoding  Alternative 7bit encoding to use if required.
  2008  */
  1992  */
  2009 void CSmsAlphabetConverter::PrepareForConversionToNativeL(TSmsEncoding aEncoding)
  1993 void CSmsAlphabetConverter::PrepareForConversionToNativeL(TSmsEncoding aEncoding)
  2010 	{
  1994 	{
  2011 	LOGGSMU2("CSmsAlphabetConverter::PrepareForConversionToNativeL(): aEncoding=%d",
  1995 	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSALPHABETCONVERTER_PREPAREFORCONVERSIONTONATIVEL_1, "CSmsAlphabetConverter::PrepareForConversionToNativeL(): aEncoding=%d",aEncoding);
  2012 			 aEncoding);
       
  2013 
  1996 
  2014 	switch (iSmsAlphabet)
  1997 	switch (iSmsAlphabet)
  2015 		{
  1998 		{
  2016 		case TSmsDataCodingScheme::ESmsAlphabet7Bit:
  1999 		case TSmsDataCodingScheme::ESmsAlphabet7Bit:
  2017 			{
  2000 			{
  2026 				GetAlternativeEncoderIDL(aEncoding, alternativeEncoderID);
  2009 				GetAlternativeEncoderIDL(aEncoding, alternativeEncoderID);
  2027 				if (alternativeEncoderID != 0)
  2010 				if (alternativeEncoderID != 0)
  2028 					{
  2011 					{
  2029 					CCnvCharacterSetConverter::TAvailability  availability;
  2012 					CCnvCharacterSetConverter::TAvailability  availability;
  2030 		
  2013 		
  2031 					LOGGSMU2("CSmsAlphabetConverter::PrepareForConversionFromNativeL(): Converter 0x%08x",
  2014 					OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSALPHABETCONVERTER_PREPAREFORCONVERSIONTONATIVEL_2, "CSmsAlphabetConverter::PrepareForConversionFromNativeL(): Converter 0x%08x",alternativeEncoderID);
  2032 							 alternativeEncoderID);
       
  2033 					
  2015 					
  2034 					availability = iCharacterSetConverter.PrepareToConvertToOrFromL(alternativeEncoderID, iFs);
  2016 					availability = iCharacterSetConverter.PrepareToConvertToOrFromL(alternativeEncoderID, iFs);
  2035 					if (availability == CCnvCharacterSetConverter::EAvailable)
  2017 					if (availability == CCnvCharacterSetConverter::EAvailable)
  2036 						{
  2018 						{
  2037 						// Job done, return
  2019 						// Job done, return
  2082  * 
  2064  * 
  2083  *  @leave KErrArgument if the encoding enum is invalid or
  2065  *  @leave KErrArgument if the encoding enum is invalid or
  2084  */
  2066  */
  2085 void CSmsAlphabetConverter::GetAlternativeEncoderIDL(TSmsEncoding aEncoding, TUint& aEncoderID) const
  2067 void CSmsAlphabetConverter::GetAlternativeEncoderIDL(TSmsEncoding aEncoding, TUint& aEncoderID) const
  2086 	{
  2068 	{
  2087 	LOGGSMU2("CSmsAlphabetConverter::GetAlternativeEncoderIDL(%d)", aEncoding);
  2069 	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSALPHABETCONVERTER_GETALTERNATIVEENCODERIDL_1, "CSmsAlphabetConverter::GetAlternativeEncoderIDL(%d)", aEncoding);
  2088 
  2070 
  2089 	aEncoderID = 0;
  2071 	aEncoderID = 0;
  2090 	
  2072 	
  2091 	//
  2073 	//
  2092 	// Decide on appropriate encoders.
  2074 	// Decide on appropriate encoders.
  2155 //
  2137 //
  2156 // Ensures the allocated 16 bit buffer is at least of the specified length
  2138 // Ensures the allocated 16 bit buffer is at least of the specified length
  2157 //
  2139 //
  2158 TPtr16 CSmsAlphabetConverter::CheckAllocBufferL(HBufC16** aBuffer,TInt aMaxLength,TInt aUsedLength)
  2140 TPtr16 CSmsAlphabetConverter::CheckAllocBufferL(HBufC16** aBuffer,TInt aMaxLength,TInt aUsedLength)
  2159 	{
  2141 	{
  2160 	LOGGSMU1("CSmsAlphabetConverter::CheckAllocBufferL()");
  2142 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSALPHABETCONVERTER_CHECKALLOCBUFFERL_1, "CSmsAlphabetConverter::CheckAllocBufferL()");
  2161 
  2143 
  2162 	if (*aBuffer!=NULL)
  2144 	if (*aBuffer!=NULL)
  2163 		{
  2145 		{
  2164 		if ((*aBuffer)->Length()<aMaxLength)
  2146 		if ((*aBuffer)->Length()<aMaxLength)
  2165 			{
  2147 			{
  2178 //
  2160 //
  2179 // Ensures the allocated 8 bit buffer is at least of the specified length
  2161 // Ensures the allocated 8 bit buffer is at least of the specified length
  2180 //
  2162 //
  2181 TPtr8 CSmsAlphabetConverter::CheckAllocBufferL(HBufC8** aBuffer,TInt aMaxLength,TInt aUsedLength)
  2163 TPtr8 CSmsAlphabetConverter::CheckAllocBufferL(HBufC8** aBuffer,TInt aMaxLength,TInt aUsedLength)
  2182 	{
  2164 	{
  2183 	LOGGSMU1("CSmsAlphabetConverter::CheckAllocBufferL()");
  2165 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSALPHABETCONVERTER_CHECKALLOCBUFFERL1_1, "CSmsAlphabetConverter::CheckAllocBufferL()");
  2184 
  2166 
  2185 	if (*aBuffer!=NULL)
  2167 	if (*aBuffer!=NULL)
  2186 		{
  2168 		{
  2187 		if ((*aBuffer)->Length()<aMaxLength)
  2169 		if ((*aBuffer)->Length()<aMaxLength)
  2188 			{
  2170 			{
  2206  *  @param aType Specifies an indicator type, as defined in the Common PCN Handset Specification
  2188  *  @param aType Specifies an indicator type, as defined in the Common PCN Handset Specification
  2207  *  @return returns ETrue if address is of specified type, EFalse otherwise 
  2189  *  @return returns ETrue if address is of specified type, EFalse otherwise 
  2208  */
  2190  */
  2209 EXPORT_C TBool TGsmSmsTelNumber::IsInstanceOf(TTypeOfIndicator aType)
  2191 EXPORT_C TBool TGsmSmsTelNumber::IsInstanceOf(TTypeOfIndicator aType)
  2210     {
  2192     {
  2211     LOGGSMU1("TGsmSmsTelNumber::IsInstanceOf()");
  2193     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, TGSMSMSTELNUMBER_ISINSTANCEOF_1, "TGsmSmsTelNumber::IsInstanceOf()");
  2212 
  2194 
  2213     TBool rc = EFalse;
  2195     TBool rc = EFalse;
  2214 
  2196 
  2215     (void) aType;
  2197     (void) aType;
  2216 
  2198 
  2229 // CSmsAddress
  2211 // CSmsAddress
  2230 //
  2212 //
  2231 
  2213 
  2232 CSmsAddress* CSmsAddress::NewL(CCnvCharacterSetConverter& aCharacterSetConverter,RFs& aFs)
  2214 CSmsAddress* CSmsAddress::NewL(CCnvCharacterSetConverter& aCharacterSetConverter,RFs& aFs)
  2233 	{
  2215 	{
  2234 	LOGGSMU1("CSmsAddress::NewL()");
  2216 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSADDRESS_NEWL_1, "CSmsAddress::NewL()");
  2235 
  2217 
  2236 	CSmsAddress* address=new(ELeave) CSmsAddress(aCharacterSetConverter,aFs);
  2218 	CSmsAddress* address=new(ELeave) CSmsAddress(aCharacterSetConverter,aFs);
  2237 	CleanupStack::PushL(address);
  2219 	CleanupStack::PushL(address);
  2238 	TPtrC ptr;
  2220 	TPtrC ptr;
  2239 	address->SetAddressL(ptr);
  2221 	address->SetAddressL(ptr);
  2253  * 
  2235  * 
  2254  *  @return  Pointer to the newly created CSmsAddress object.
  2236  *  @return  Pointer to the newly created CSmsAddress object.
  2255  */
  2237  */
  2256 CSmsAddress* CSmsAddress::DuplicateL() const
  2238 CSmsAddress* CSmsAddress::DuplicateL() const
  2257 	{
  2239 	{
  2258 	LOGGSMU1("CSmsAddress::DuplicateL()");
  2240 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSADDRESS_DUPLICATEL_1, "CSmsAddress::DuplicateL()");
  2259 
  2241 
  2260 	CSmsAddress*  address = CSmsAddress::NewL(iCharacterSetConverter, iFs);
  2242 	CSmsAddress*  address = CSmsAddress::NewL(iCharacterSetConverter, iFs);
  2261 	CleanupStack::PushL(address);
  2243 	CleanupStack::PushL(address);
  2262 
  2244 
  2263 	address->SetRawAddressL(iTypeOfAddress, *iBuffer);
  2245 	address->SetRawAddressL(iTypeOfAddress, *iBuffer);
  2268 	} // CSmsAddress::DuplicateL
  2250 	} // CSmsAddress::DuplicateL
  2269 
  2251 
  2270 
  2252 
  2271 TPtrC CSmsAddress::Address() const
  2253 TPtrC CSmsAddress::Address() const
  2272 	{
  2254 	{
  2273 	LOGGSMU1("CSmsAddress::Address()");
  2255 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSADDRESS_ADDRESS_1, "CSmsAddress::Address()");
  2274 
  2256 
  2275 	TPtrC ptr;
  2257 	TPtrC ptr;
  2276 	if (iBuffer)
  2258 	if (iBuffer)
  2277 		ptr.Set(iBuffer->Des());
  2259 		ptr.Set(iBuffer->Des());
  2278 	return ptr;
  2260 	return ptr;
  2279 	} // CSmsAddress::Address
  2261 	} // CSmsAddress::Address
  2280 
  2262 
  2281 
  2263 
  2282 void CSmsAddress::SetRawAddressL(TGsmSmsTypeOfAddress aTypeOfAddress, TPtrC aBufferPtr)
  2264 void CSmsAddress::SetRawAddressL(TGsmSmsTypeOfAddress aTypeOfAddress, TPtrC aBufferPtr)
  2283     {
  2265     {
  2284     LOGGSMU1("CSmsAddress::SetRawAddressL()");
  2266     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSADDRESS_SETRAWADDRESSL_1, "CSmsAddress::SetRawAddressL()");
  2285 
  2267 
  2286     iTypeOfAddress = aTypeOfAddress;
  2268     iTypeOfAddress = aTypeOfAddress;
  2287 
  2269 
  2288     NewBufferL(aBufferPtr.Length());
  2270     NewBufferL(aBufferPtr.Length());
  2289 
  2271 
  2291     } // CSmsAddress::SetRawAddressL
  2273     } // CSmsAddress::SetRawAddressL
  2292 
  2274 
  2293 
  2275 
  2294 TGsmSmsTypeOfAddress& CSmsAddress::TypeOfAddress()
  2276 TGsmSmsTypeOfAddress& CSmsAddress::TypeOfAddress()
  2295     {
  2277     {
  2296     LOGGSMU1("CSmsAddress::TypeOfAddress()");
  2278     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSADDRESS_TYPEOFADDRESS_1, "CSmsAddress::TypeOfAddress()");
  2297 
  2279 
  2298     return iTypeOfAddress;
  2280     return iTypeOfAddress;
  2299     } // CSmsAddress::TypeOfAddress
  2281     } // CSmsAddress::TypeOfAddress
  2300 
  2282 
  2301 
  2283 
  2302 void CSmsAddress::SetAddressL(const TDesC& aAddress)
  2284 void CSmsAddress::SetAddressL(const TDesC& aAddress)
  2303 	{
  2285 	{
  2304 	LOGGSMU1("CSmsAddress::SetAddressL()");
  2286 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSADDRESS_SETADDRESSL_1, "CSmsAddress::SetAddressL()");
  2305 
  2287 
  2306 	TInt length=aAddress.Length();
  2288 	TInt length=aAddress.Length();
  2307 	NewBufferL(length);
  2289 	NewBufferL(length);
  2308 	iBuffer->Des().Copy(aAddress);
  2290 	iBuffer->Des().Copy(aAddress);
  2309 
  2291 
  2359 	}
  2341 	}
  2360 
  2342 
  2361 
  2343 
  2362 void CSmsAddress::SetParsedAddressL(const TGsmSmsTelNumber& aParsedAddress)
  2344 void CSmsAddress::SetParsedAddressL(const TGsmSmsTelNumber& aParsedAddress)
  2363 	{
  2345 	{
  2364 	LOGGSMU1("CSmsAddress::SetParsedAddressL()");
  2346 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSADDRESS_SETPARSEDADDRESSL_1, "CSmsAddress::SetParsedAddressL()");
  2365 
  2347 
  2366 	iTypeOfAddress=aParsedAddress.iTypeOfAddress;
  2348 	iTypeOfAddress=aParsedAddress.iTypeOfAddress;
  2367 	DoSetParsedAddressL(aParsedAddress.iTelNumber);
  2349 	DoSetParsedAddressL(aParsedAddress.iTelNumber);
  2368 	} // CSmsAddress::SetParsedAddressL
  2350 	} // CSmsAddress::SetParsedAddressL
  2369 
  2351 
  2370 
  2352 
  2371 TUint8 CSmsAddress::SizeL()
  2353 TUint8 CSmsAddress::SizeL()
  2372     {
  2354     {
  2373     LOGGSMU1("CSmsAddress::SizeL()");
  2355     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSADDRESS_SIZEL_1, "CSmsAddress::SizeL()");
  2374 
  2356 
  2375     TUint8 size = 0;
  2357     TUint8 size = 0;
  2376 
  2358 
  2377     TBuf8<KSmsAddressMaxAddressLength> testBuffer;
  2359     TBuf8<KSmsAddressMaxAddressLength> testBuffer;
  2378     testBuffer.SetLength(KSmsAddressMaxAddressLength);
  2360     testBuffer.SetLength(KSmsAddressMaxAddressLength);
  2728 	} // CSmsAddress::CSmsAddress
  2710 	} // CSmsAddress::CSmsAddress
  2729 
  2711 
  2730 
  2712 
  2731 void CSmsAddress::NewBufferL(TInt aLength)
  2713 void CSmsAddress::NewBufferL(TInt aLength)
  2732 	{
  2714 	{
  2733 	LOGGSMU1("CSmsAddress::NewBufferL()");
  2715 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSADDRESS_NEWBUFFERL_1, "CSmsAddress::NewBufferL()");
  2734 
  2716 
  2735     HBufC* buffer=HBufC::NewL(aLength);
  2717     HBufC* buffer=HBufC::NewL(aLength);
  2736     delete iBuffer;
  2718     delete iBuffer;
  2737     iBuffer=buffer;
  2719     iBuffer=buffer;
  2738     iBuffer->Des().SetLength(aLength);
  2720     iBuffer->Des().SetLength(aLength);
  2740 	}
  2722 	}
  2741 
  2723 
  2742 
  2724 
  2743 void CSmsAddress::DoSetParsedAddressL(const TDesC& aAddress)
  2725 void CSmsAddress::DoSetParsedAddressL(const TDesC& aAddress)
  2744 	{
  2726 	{
  2745 	LOGGSMU2("CSmsAddress::DoSetParsedAddressL() the length of the Address [Length = %d", aAddress.Length());
  2727 	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSADDRESS_DOSETPARSEDADDRESSL_1, "CSmsAddress::DoSetParsedAddressL() the length of the Address [Length = %d", aAddress.Length());
  2746 
  2728 
  2747 	TInt length=aAddress.Length();
  2729 	TInt length=aAddress.Length();
  2748 	if ((iTypeOfAddress.TON()==EGsmSmsTONInternationalNumber) &&
  2730 	if ((iTypeOfAddress.TON()==EGsmSmsTONInternationalNumber) &&
  2749 	    (length && (aAddress[0]!='+')))
  2731 	    (length && (aAddress[0]!='+')))
  2750 		{
  2732 		{
  2774 	} // TSmsServiceCenterTimeStamp::SetTimeOffset
  2756 	} // TSmsServiceCenterTimeStamp::SetTimeOffset
  2775 
  2757 
  2776 
  2758 
  2777 TUint8* TSmsServiceCenterTimeStamp::EncodeL(TUint8* aPtr) const
  2759 TUint8* TSmsServiceCenterTimeStamp::EncodeL(TUint8* aPtr) const
  2778     {
  2760     {
  2779     LOGGSMU1("TSmsServiceCenterTimeStamp::EncodeL()");
  2761     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSSERVICECENTERTIMESTAMP_ENCODEL_1, "TSmsServiceCenterTimeStamp::EncodeL()");
  2780 
  2762 
  2781     TInt numquarterhours=iTimeZoneNumQuarterHours;
  2763     TInt numquarterhours=iTimeZoneNumQuarterHours;
  2782 
  2764 
  2783     TInt timeZoneOffsetInSeconds = numquarterhours * CSmsMessage::E15MinutesRepresentedInSeconds;
  2765     TInt timeZoneOffsetInSeconds = numquarterhours * CSmsMessage::E15MinutesRepresentedInSeconds;
  2784     TTimeIntervalSeconds offsetFromUTCToLocal(timeZoneOffsetInSeconds);
  2766     TTimeIntervalSeconds offsetFromUTCToLocal(timeZoneOffsetInSeconds);
  2816     } // TSmsServiceCenterTimeStamp::EncodeL
  2798     } // TSmsServiceCenterTimeStamp::EncodeL
  2817 
  2799 
  2818 
  2800 
  2819 void TSmsServiceCenterTimeStamp::DecodeL(TGsmuLex8& aPdu, TInt& aTimeError)
  2801 void TSmsServiceCenterTimeStamp::DecodeL(TGsmuLex8& aPdu, TInt& aTimeError)
  2820 	{
  2802 	{
  2821 	LOGGSMU1("TSmsServiceCenterTimeStamp::DecodeL()");
  2803 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSSERVICECENTERTIMESTAMP_DECODEL_1, "TSmsServiceCenterTimeStamp::DecodeL()");
  2822 
  2804 
  2823 	TSmsOctet octet;
  2805 	TSmsOctet octet;
  2824 	octet.DecodeL(aPdu);
  2806 	octet.DecodeL(aPdu);
  2825 	TInt year=octet.SemiOctetsToNum();
  2807 	TInt year=octet.SemiOctetsToNum();
  2826 	if (year>95)
  2808 	if (year>95)
  2903 	} // TSmsValidityPeriod::TSmsValidityPeriod
  2885 	} // TSmsValidityPeriod::TSmsValidityPeriod
  2904 
  2886 
  2905 
  2887 
  2906 TTime TSmsValidityPeriod::Time() const
  2888 TTime TSmsValidityPeriod::Time() const
  2907 	{
  2889 	{
  2908 	LOGGSMU1("TSmsValidityPeriod::Time()");
  2890 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSVALIDITYPERIOD_TIME_1, "TSmsValidityPeriod::Time()");
  2909 
  2891 
  2910 	TTime time;
  2892 	TTime time;
  2911 	time.UniversalTime();
  2893 	time.UniversalTime();
  2912 	time+=iTimeIntervalMinutes;
  2894 	time+=iTimeIntervalMinutes;
  2913 	return time;
  2895 	return time;
  2914 	} // TSmsValidityPeriod::Time
  2896 	} // TSmsValidityPeriod::Time
  2915 
  2897 
  2916 
  2898 
  2917 TUint8* TSmsValidityPeriod::EncodeL(TUint8* aPtr) const
  2899 TUint8* TSmsValidityPeriod::EncodeL(TUint8* aPtr) const
  2918 	{
  2900 	{
  2919 	LOGGSMU1("TSmsValidityPeriod::EncodeL()");
  2901 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSVALIDITYPERIOD_ENCODEL_1, "TSmsValidityPeriod::EncodeL()");
  2920 
  2902 
  2921 	TInt validityperiodformat=ValidityPeriodFormat();
  2903 	TInt validityperiodformat=ValidityPeriodFormat();
  2922 	switch (validityperiodformat)
  2904 	switch (validityperiodformat)
  2923 		{
  2905 		{
  2924 		case (TSmsFirstOctet::ESmsVPFNone):
  2906 		case (TSmsFirstOctet::ESmsVPFNone):
  2960 	return aPtr;
  2942 	return aPtr;
  2961 	} // TSmsValidityPeriod::EncodeL
  2943 	} // TSmsValidityPeriod::EncodeL
  2962 	
  2944 	
  2963 TUint8* TSmsValidityPeriod::EncodeL(TUint8* aPtr, const TEncodeParams* aEncodeParams) const
  2945 TUint8* TSmsValidityPeriod::EncodeL(TUint8* aPtr, const TEncodeParams* aEncodeParams) const
  2964 	{
  2946 	{
  2965 	LOGGSMU1("TSmsValidityPeriod::EncodeL()");
  2947 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSVALIDITYPERIOD_ENCODEL1_1, "TSmsValidityPeriod::EncodeL()");
  2966 
  2948 
  2967 	TInt validityperiodformat=ValidityPeriodFormat();
  2949 	TInt validityperiodformat=ValidityPeriodFormat();
  2968 	switch (validityperiodformat)
  2950 	switch (validityperiodformat)
  2969 		{
  2951 		{
  2970 		case (TSmsFirstOctet::ESmsVPFNone):
  2952 		case (TSmsFirstOctet::ESmsVPFNone):
  3012 	return aPtr;
  2994 	return aPtr;
  3013 	} // TSmsValidityPeriod::EncodeL	
  2995 	} // TSmsValidityPeriod::EncodeL	
  3014 
  2996 
  3015 void TSmsValidityPeriod::DecodeL(TGsmuLex8& aPdu)
  2997 void TSmsValidityPeriod::DecodeL(TGsmuLex8& aPdu)
  3016 	{
  2998 	{
  3017 	LOGGSMU1("TSmsValidityPeriod::DecodeL()");
  2999 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSVALIDITYPERIOD_DECODEL_1, "TSmsValidityPeriod::DecodeL()");
  3018 
  3000 
  3019 	TInt validityperiodformat=ValidityPeriodFormat();
  3001 	TInt validityperiodformat=ValidityPeriodFormat();
  3020 	switch (validityperiodformat)
  3002 	switch (validityperiodformat)
  3021 		{
  3003 		{
  3022 		case (TSmsFirstOctet::ESmsVPFNone):
  3004 		case (TSmsFirstOctet::ESmsVPFNone):
  3067 	} // TSmsValidityPeriod::ExternalizeL
  3049 	} // TSmsValidityPeriod::ExternalizeL
  3068 
  3050 
  3069 
  3051 
  3070 CSmsInformationElement* CSmsInformationElement::NewL(TSmsInformationElementIdentifier aIdentifier,const TDesC8& aData)
  3052 CSmsInformationElement* CSmsInformationElement::NewL(TSmsInformationElementIdentifier aIdentifier,const TDesC8& aData)
  3071 	{
  3053 	{
  3072 	LOGGSMU1("CSmsInformationElement::NewL()");
  3054 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSINFORMATIONELEMENT_NEWL_1, "CSmsInformationElement::NewL()");
  3073 
  3055 
  3074 	CSmsInformationElement* informationelement=new(ELeave) CSmsInformationElement(aIdentifier);
  3056 	CSmsInformationElement* informationelement=new(ELeave) CSmsInformationElement(aIdentifier);
  3075 	CleanupStack::PushL(informationelement);
  3057 	CleanupStack::PushL(informationelement);
  3076 	informationelement->ConstructL(aData);
  3058 	informationelement->ConstructL(aData);
  3077 	CleanupStack::Pop();
  3059 	CleanupStack::Pop();
  3079 	} // CSmsInformationElement::NewL
  3061 	} // CSmsInformationElement::NewL
  3080 
  3062 
  3081 
  3063 
  3082 CSmsInformationElement* CSmsInformationElement::NewL()
  3064 CSmsInformationElement* CSmsInformationElement::NewL()
  3083 	{
  3065 	{
  3084 	LOGGSMU1("CSmsInformationElement::NewL()");
  3066 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSINFORMATIONELEMENT_NEWL1_1, "CSmsInformationElement::NewL()");
  3085 
  3067 
  3086 	CSmsInformationElement* informationelement=new(ELeave) CSmsInformationElement(ESmsIEIConcatenatedShortMessages8BitReference);
  3068 	CSmsInformationElement* informationelement=new(ELeave) CSmsInformationElement(ESmsIEIConcatenatedShortMessages8BitReference);
  3087 	CleanupStack::PushL(informationelement);
  3069 	CleanupStack::PushL(informationelement);
  3088 	TPtrC8 data;
  3070 	TPtrC8 data;
  3089 	informationelement->ConstructL(data);
  3071 	informationelement->ConstructL(data);
  3107  *  @return Information Element data
  3089  *  @return Information Element data
  3108  *  @capability None
  3090  *  @capability None
  3109  */
  3091  */
  3110 EXPORT_C TPtr8 CSmsInformationElement::Data()
  3092 EXPORT_C TPtr8 CSmsInformationElement::Data()
  3111 	{
  3093 	{
  3112 	LOGGSMU1("CSmsInformationElement::Data()");
  3094 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CSMSINFORMATIONELEMENT_DATA_1, "CSmsInformationElement::Data()");
  3113 
  3095 
  3114 	return iData->Des();
  3096 	return iData->Des();
  3115 	} // CSmsInformationElement::Data
  3097 	} // CSmsInformationElement::Data
  3116 
  3098 
  3117 
  3099 
  3121  *  @return Information Element data
  3103  *  @return Information Element data
  3122  *  @capability None
  3104  *  @capability None
  3123  */
  3105  */
  3124 EXPORT_C const TDesC8& CSmsInformationElement::Data() const
  3106 EXPORT_C const TDesC8& CSmsInformationElement::Data() const
  3125 	{
  3107 	{
  3126 	LOGGSMU1("CSmsInformationElement::Data()");
  3108 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CSMSINFORMATIONELEMENT_DATA1_1, "CSmsInformationElement::Data()");
  3127 
  3109 
  3128 	return *iData;
  3110 	return *iData;
  3129 	} // CSmsInformationElement::Data
  3111 	} // CSmsInformationElement::Data
  3130 
  3112 
  3131 
  3113 
  3141 	} // CSmsInformationElement::TSmsInformationElementIdentifier
  3123 	} // CSmsInformationElement::TSmsInformationElementIdentifier
  3142 
  3124 
  3143 
  3125 
  3144 TUint8* CSmsInformationElement::EncodeL(TUint8* aPtr) const
  3126 TUint8* CSmsInformationElement::EncodeL(TUint8* aPtr) const
  3145 	{
  3127 	{
  3146 	LOGGSMU1("CSmsInformationElement::EncodeL()");
  3128 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSINFORMATIONELEMENT_ENCODEL_1, "CSmsInformationElement::EncodeL()");
  3147 
  3129 
  3148 	TSmsOctet id=iIdentifier;
  3130 	TSmsOctet id=iIdentifier;
  3149 	aPtr=id.EncodeL(aPtr);
  3131 	aPtr=id.EncodeL(aPtr);
  3150 	TSmsOctet informationelementlength=iData->Des().Length();
  3132 	TSmsOctet informationelementlength=iData->Des().Length();
  3151 	aPtr=informationelementlength.EncodeL(aPtr);
  3133 	aPtr=informationelementlength.EncodeL(aPtr);
  3155 	} // CSmsInformationElement::EncodeL
  3137 	} // CSmsInformationElement::EncodeL
  3156 
  3138 
  3157 
  3139 
  3158 void CSmsInformationElement::DecodeL(TGsmuLex8& aPdu)
  3140 void CSmsInformationElement::DecodeL(TGsmuLex8& aPdu)
  3159 	{
  3141 	{
  3160 	LOGGSMU1("CSmsInformationElement::DecodeL()");
  3142 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSINFORMATIONELEMENT_DECODEL_1, "CSmsInformationElement::DecodeL()");
  3161 
  3143 
  3162 	TSmsOctet id;
  3144 	TSmsOctet id;
  3163 	id.DecodeL(aPdu);
  3145 	id.DecodeL(aPdu);
  3164 	iIdentifier=static_cast<TSmsInformationElementIdentifier>((TInt)id);
  3146 	iIdentifier=static_cast<TSmsInformationElementIdentifier>((TInt)id);
  3165 
  3147 
  3262 	} // CSmsInformationElement::ExternalizeL
  3244 	} // CSmsInformationElement::ExternalizeL
  3263 
  3245 
  3264 
  3246 
  3265 void CSmsInformationElement::ConstructL(const TDesC8& aData)
  3247 void CSmsInformationElement::ConstructL(const TDesC8& aData)
  3266 	{
  3248 	{
  3267 	LOGGSMU1("CSmsInformationElement::ConstructL()");
  3249 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSINFORMATIONELEMENT_CONSTRUCTL_1, "CSmsInformationElement::ConstructL()");
  3268 
  3250 
  3269 	NewDataL(aData.Length());
  3251 	NewDataL(aData.Length());
  3270 	iData->Des().Copy(aData);
  3252 	iData->Des().Copy(aData);
  3271 	} // CSmsInformationElement::ConstructL
  3253 	} // CSmsInformationElement::ConstructL
  3272 
  3254 
  3273 
  3255 
  3274 void CSmsInformationElement::NewDataL(TInt aLength)
  3256 void CSmsInformationElement::NewDataL(TInt aLength)
  3275 	{
  3257 	{
  3276 	LOGGSMU1("CSmsInformationElement::NewDataL()");
  3258 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSINFORMATIONELEMENT_NEWDATAL_1, "CSmsInformationElement::NewDataL()");
  3277 
  3259 
  3278 	HBufC8* data=HBufC8::NewL(aLength);
  3260 	HBufC8* data=HBufC8::NewL(aLength);
  3279 	delete iData;
  3261 	delete iData;
  3280 	iData=data;
  3262 	iData=data;
  3281 	iData->Des().SetLength(aLength);
  3263 	iData->Des().SetLength(aLength);
  3282 	} // CSmsInformationElement::NewDataL
  3264 	} // CSmsInformationElement::NewDataL
  3283 
  3265 
  3284 
  3266 
  3285 TUint CSmsInformationElement::Length()const
  3267 TUint CSmsInformationElement::Length()const
  3286 	{
  3268 	{
  3287 	LOGGSMU1("CSmsInformationElement::Length()");
  3269 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSINFORMATIONELEMENT_LENGTH_1, "CSmsInformationElement::Length()");
  3288 
  3270 
  3289 	return 2+iData->Length();  // 2 stands for IEID and IEDL
  3271 	return 2+iData->Length();  // 2 stands for IEID and IEDL
  3290 	} // CSmsInformationElement::Length
  3272 	} // CSmsInformationElement::Length
  3291 
  3273 
  3292 
  3274 
  3303  *  True if the information element can be mapped.
  3285  *  True if the information element can be mapped.
  3304  *  False otherwise.
  3286  *  False otherwise.
  3305  */
  3287  */
  3306 TBool TSmsInformationElementCategories::TranslateCategoryToIndex(TInformationElementId aId, TInt& aIndex)
  3288 TBool TSmsInformationElementCategories::TranslateCategoryToIndex(TInformationElementId aId, TInt& aIndex)
  3307     {
  3289     {
  3308     LOGGSMU1("CSmsMessage::TranslateCategoryToIndex");
  3290     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSINFORMATIONELEMENTCATEGORIES_TRANSLATECATEGORYTOINDEX_1, "CSmsMessage::TranslateCategoryToIndex");
  3309 
  3291 
  3310     TBool rc = ETrue;
  3292     TBool rc = ETrue;
  3311 
  3293 
  3312     if (aId < CSmsInformationElement::ESmsIEMaximum)
  3294     if (aId < CSmsInformationElement::ESmsIEMaximum)
  3313         {
  3295         {
  3382             }
  3364             }
  3383         }
  3365         }
  3384     else
  3366     else
  3385         {
  3367         {
  3386         rc = EFalse;
  3368         rc = EFalse;
  3387         LOGGSMU3("CSmsMessage::TranslateCategoryToIndex id = %d, found = %d", aId, rc);
  3369         OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSINFORMATIONELEMENTCATEGORIES_TRANSLATECATEGORYTOINDEX_2, "CSmsMessage::TranslateCategoryToIndex id = %d, found = %d", aId, rc);
  3388         }
  3370         }
  3389     return rc;
  3371     return rc;
  3390     } // TSmsInformationElementCategories::TranslateCategoryToIndex
  3372     } // TSmsInformationElementCategories::TranslateCategoryToIndex
  3391 
  3373 
  3392 
  3374 
  3403  *  ETrue if successful, EFalse if an information identifier is unknown or cannot
  3385  *  ETrue if successful, EFalse if an information identifier is unknown or cannot
  3404  *  be mapped.
  3386  *  be mapped.
  3405  */
  3387  */
  3406 TBool TSmsInformationElementCategories::GetCategoryDefinition(TInformationElementId aId, TInformationElementCategory& aCategory)
  3388 TBool TSmsInformationElementCategories::GetCategoryDefinition(TInformationElementId aId, TInformationElementCategory& aCategory)
  3407     {
  3389     {
  3408     LOGGSMU1("TSmsInformationElementCategories::GetCategoryDefinition");
  3390     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSINFORMATIONELEMENTCATEGORIES_GETCATEGORYDEFINITION_1, "TSmsInformationElementCategories::GetCategoryDefinition");
  3409     TInt index;
  3391     TInt index;
  3410 
  3392 
  3411     if (TranslateCategoryToIndex(aId,index))
  3393     if (TranslateCategoryToIndex(aId,index))
  3412         {
  3394         {
  3413         aCategory = categories[index];
  3395         aCategory = categories[index];
  3414         }
  3396         }
  3415     else
  3397     else
  3416         {
  3398         {
  3417         LOGGSMU2("TSmsInformationElementCategories::GetCategoryDefinition, Failure, aId = %d", aId);
  3399         OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSINFORMATIONELEMENTCATEGORIES_GETCATEGORYDEFINITION_2, "TSmsInformationElementCategories::GetCategoryDefinition, Failure, aId = %d", aId);
  3418         return EFalse;
  3400         return EFalse;
  3419         }
  3401         }
  3420 
  3402 
  3421     return ETrue;
  3403     return ETrue;
  3422     } // TSmsInformationElementCategories::GetCategoryDefinition
  3404     } // TSmsInformationElementCategories::GetCategoryDefinition
  3434     };
  3416     };
  3435 
  3417 
  3436 
  3418 
  3437 CSmsUserData* CSmsUserData::NewL(CCnvCharacterSetConverter& aCharacterSetConverter,RFs& aFs,TSmsFirstOctet& aFirstOctet,const TSmsDataCodingScheme& aDataCodingScheme)
  3419 CSmsUserData* CSmsUserData::NewL(CCnvCharacterSetConverter& aCharacterSetConverter,RFs& aFs,TSmsFirstOctet& aFirstOctet,const TSmsDataCodingScheme& aDataCodingScheme)
  3438 	{
  3420 	{
  3439 	LOGGSMU1("CSmsUserData::NewL()");
  3421 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSUSERDATA_NEWL_1, "CSmsUserData::NewL()");
  3440 
  3422 
  3441 	CSmsUserData* userdata=new(ELeave) CSmsUserData(aCharacterSetConverter,aFs,aFirstOctet,aDataCodingScheme);
  3423 	CSmsUserData* userdata=new(ELeave) CSmsUserData(aCharacterSetConverter,aFs,aFirstOctet,aDataCodingScheme);
  3442 	CleanupStack::PushL(userdata);
  3424 	CleanupStack::PushL(userdata);
  3443 	userdata->ConstructL();
  3425 	userdata->ConstructL();
  3444 	CleanupStack::Pop();
  3426 	CleanupStack::Pop();
  3463  *  @return Information element
  3445  *  @return Information element
  3464  *  @capability None
  3446  *  @capability None
  3465  */
  3447  */
  3466 EXPORT_C  CSmsInformationElement& CSmsUserData::InformationElement(TInt aIndex) const
  3448 EXPORT_C  CSmsInformationElement& CSmsUserData::InformationElement(TInt aIndex) const
  3467 	{
  3449 	{
  3468 	LOGGSMU1("CSmsUserData::InformationElement()");
  3450 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CSMSUSERDATA_INFORMATIONELEMENT_1, "CSmsUserData::InformationElement()");
  3469 
  3451 
  3470 	return *iInformationElementArray[aIndex];
  3452 	return *iInformationElementArray[aIndex];
  3471 	} // CSmsUserData::InformationElement
  3453 	} // CSmsUserData::InformationElement
  3472 
  3454 
  3473 
  3455 
  3474 CSmsInformationElement*& CSmsUserData::InformationElementPtr(TInt aIndex)
  3456 CSmsInformationElement*& CSmsUserData::InformationElementPtr(TInt aIndex)
  3475     {
  3457     {
  3476     LOGGSMU1("CSmsUserData::InformationElementPtr()");
  3458     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSUSERDATA_INFORMATIONELEMENTPTR_1, "CSmsUserData::InformationElementPtr()");
  3477 
  3459 
  3478     return iInformationElementArray[aIndex];
  3460     return iInformationElementArray[aIndex];
  3479     } // CSmsUserData::InformationElementPtr
  3461     } // CSmsUserData::InformationElementPtr
  3480 
  3462 
  3481 
  3463 
  3491  *  @return True if aIdentifier is found in the User Data
  3473  *  @return True if aIdentifier is found in the User Data
  3492  *  @capability None
  3474  *  @capability None
  3493  */
  3475  */
  3494 EXPORT_C TBool CSmsUserData::InformationElementIndex(CSmsInformationElement::TSmsInformationElementIdentifier aIdentifier,TInt& aIndex) const
  3476 EXPORT_C TBool CSmsUserData::InformationElementIndex(CSmsInformationElement::TSmsInformationElementIdentifier aIdentifier,TInt& aIndex) const
  3495 	{
  3477 	{
  3496 	LOGGSMU1("CSmsUserData::InformationElementIndex()");
  3478 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CSMSUSERDATA_INFORMATIONELEMENTINDEX_1, "CSmsUserData::InformationElementIndex()");
  3497 
  3479 
  3498 	TBool found=EFalse;
  3480 	TBool found=EFalse;
  3499 	TInt count=NumInformationElements();
  3481 	TInt count=NumInformationElements();
  3500 	for (TInt i=0; (!found) && (i<count); i++)
  3482 	for (TInt i=0; (!found) && (i<count); i++)
  3501 		if (InformationElement(i).Identifier()==aIdentifier)
  3483 		if (InformationElement(i).Identifier()==aIdentifier)
  3519  *  @return True if aIdentifier is found in the User Data
  3501  *  @return True if aIdentifier is found in the User Data
  3520  *  @capability None
  3502  *  @capability None
  3521  */
  3503  */
  3522 EXPORT_C TBool CSmsUserData::InformationElementLastIndex(CSmsInformationElement::TSmsInformationElementIdentifier aIdentifier,TInt& aIndex) const
  3504 EXPORT_C TBool CSmsUserData::InformationElementLastIndex(CSmsInformationElement::TSmsInformationElementIdentifier aIdentifier,TInt& aIndex) const
  3523 	{
  3505 	{
  3524 	LOGGSMU1("CSmsUserData::InformationElementLastIndex()");
  3506 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CSMSUSERDATA_INFORMATIONELEMENTLASTINDEX_1, "CSmsUserData::InformationElementLastIndex()");
  3525 
  3507 
  3526 	TBool found=EFalse;
  3508 	TBool found=EFalse;
  3527 	TInt count=NumInformationElements();
  3509 	TInt count=NumInformationElements();
  3528 	for (TInt i=count-1; (!found) && (i>=0); i--)
  3510 	for (TInt i=count-1; (!found) && (i>=0); i--)
  3529 		if (InformationElement(i).Identifier()==aIdentifier)
  3511 		if (InformationElement(i).Identifier()==aIdentifier)
  3546  *  @param aIndices
  3528  *  @param aIndices
  3547  *  A collection containing the location index for each information element of this type.
  3529  *  A collection containing the location index for each information element of this type.
  3548  */
  3530  */
  3549 void CSmsUserData::InformationElementIndicesL(CSmsInformationElement::TSmsInformationElementIdentifier aIdentifier, CArrayFixFlat<TInt>& aIndices) const
  3531 void CSmsUserData::InformationElementIndicesL(CSmsInformationElement::TSmsInformationElementIdentifier aIdentifier, CArrayFixFlat<TInt>& aIndices) const
  3550     {
  3532     {
  3551     LOGGSMU1("CSmsUserData::InformationElementIndicesL()");
  3533     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSUSERDATA_INFORMATIONELEMENTINDICESL_1, "CSmsUserData::InformationElementIndicesL()");
  3552 
  3534 
  3553     aIndices.Reset();
  3535     aIndices.Reset();
  3554     
  3536     
  3555 	TInt count=NumInformationElements();
  3537 	TInt count=NumInformationElements();
  3556 	for (TInt i=0; i<count; i++)
  3538 	for (TInt i=0; i<count; i++)
  3569  *  by the calling function, regardless of the return code.
  3551  *  by the calling function, regardless of the return code.
  3570  *  @param aInformationElement An EMS Information Element
  3552  *  @param aInformationElement An EMS Information Element
  3571  */
  3553  */
  3572 TBool CSmsUserData::EmsInformationElementWillFitL(CEmsInformationElement* aIe,CSmsEMSBufferSegmenter& aSeg,TUint& aCharsAddedToCurrentPDU)
  3554 TBool CSmsUserData::EmsInformationElementWillFitL(CEmsInformationElement* aIe,CSmsEMSBufferSegmenter& aSeg,TUint& aCharsAddedToCurrentPDU)
  3573 	{
  3555 	{
  3574 	LOGGSMU1("CSmsUserData::EmsInformationElementWillFitL()");
  3556 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSUSERDATA_EMSINFORMATIONELEMENTWILLFITL_1, "CSmsUserData::EmsInformationElementWillFitL()");
  3575 
  3557 
  3576 	// Before using an EmsInformationElement polymorphically as an SmsIE,
  3558 	// Before using an EmsInformationElement polymorphically as an SmsIE,
  3577 	// we need to make sure that the IE has been encoded
  3559 	// we need to make sure that the IE has been encoded
  3578 	aIe->EncodeInformationElementL();
  3560 	aIe->EncodeInformationElementL();
  3579 	iInformationElementArray.AppendL(aIe);
  3561 	iInformationElementArray.AppendL(aIe);
  3602  *  @param aInformationElement A pointer to an information Element
  3584  *  @param aInformationElement A pointer to an information Element
  3603  *  @capability None
  3585  *  @capability None
  3604  */
  3586  */
  3605 TBool CSmsUserData::ControlInformationElementWillFitL(CSmsInformationElement* aIe)
  3587 TBool CSmsUserData::ControlInformationElementWillFitL(CSmsInformationElement* aIe)
  3606     {
  3588     {
  3607     LOGGSMU1("CSmsUserData::ControlInformationElementWillFitL()");
  3589     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSUSERDATA_CONTROLINFORMATIONELEMENTWILLFITL_1, "CSmsUserData::ControlInformationElementWillFitL()");
  3608 
  3590 
  3609     if (aIe == NULL)
  3591     if (aIe == NULL)
  3610         {
  3592         {
  3611         User::Leave(KErrGeneral);
  3593         User::Leave(KErrGeneral);
  3612         }
  3594         }
  3665  *  KErrNotSupported if the information element is not supported via this interface.
  3647  *  KErrNotSupported if the information element is not supported via this interface.
  3666  *  @capability None
  3648  *  @capability None
  3667  */
  3649  */
  3668 EXPORT_C void CSmsUserData::AddInformationElementL(TSmsId aIdentifier,const TDesC8& aData)
  3650 EXPORT_C void CSmsUserData::AddInformationElementL(TSmsId aIdentifier,const TDesC8& aData)
  3669     {
  3651     {
  3670     LOGGSMU1("CSmsUserData::AddInformationElementL");
  3652     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CSMSUSERDATA_ADDINFORMATIONELEMENTL_1, "CSmsUserData::AddInformationElementL");
  3671 
  3653 
  3672     if  ((aIdentifier >= 0x21) && (aIdentifier <= 0x23) ||
  3654     if  ((aIdentifier >= 0x21) && (aIdentifier <= 0x23) ||
  3673          (aIdentifier >= 0x26) && (aIdentifier <= 0x6F) ||
  3655          (aIdentifier >= 0x26) && (aIdentifier <= 0x6F) ||
  3674          (aIdentifier >= 0xA0) && (aIdentifier <= 0xBF) ||
  3656          (aIdentifier >= 0xA0) && (aIdentifier <= 0xBF) ||
  3675          (aIdentifier >= 0xE0) && (aIdentifier <= 0xFF))
  3657          (aIdentifier >= 0xE0) && (aIdentifier <= 0xFF))
  3690  *  @param aIdentifier An information element Identifier for aData
  3672  *  @param aIdentifier An information element Identifier for aData
  3691  *  @param aData The information element to add to the User Data
  3673  *  @param aData The information element to add to the User Data
  3692  */
  3674  */
  3693 void CSmsUserData::UpdateInformationElementArrayL(TSmsId aIdentifier,const TDesC8& aData)
  3675 void CSmsUserData::UpdateInformationElementArrayL(TSmsId aIdentifier,const TDesC8& aData)
  3694     {
  3676     {
  3695     LOGGSMU1("CSmsUserData::UpdateInformationElementsL");
  3677     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSUSERDATA_UPDATEINFORMATIONELEMENTARRAYL_1, "CSmsUserData::UpdateInformationElementsL");
  3696 
  3678 
  3697     TInt count=NumInformationElements();
  3679     TInt count=NumInformationElements();
  3698     if(!CEmsFactory::Supported(aIdentifier))
  3680     if(!CEmsFactory::Supported(aIdentifier))
  3699         {
  3681         {
  3700         for (TInt i=0; i<count; i++)
  3682         for (TInt i=0; i<count; i++)
  3712                     {
  3694                     {
  3713                     case TSmsInformationElementCategories::ECtrlMandatoryInEveryPDUMultipleInstancesPerPDU:
  3695                     case TSmsInformationElementCategories::ECtrlMandatoryInEveryPDUMultipleInstancesPerPDU:
  3714                         {
  3696                         {
  3715                         if (InformationElement(i).Identifier() == CSmsInformationElement::ESmsIEISpecialSMSMessageIndication)
  3697                         if (InformationElement(i).Identifier() == CSmsInformationElement::ESmsIEISpecialSMSMessageIndication)
  3716                             {
  3698                             {
  3717                             LOGGSMU3("CSmsUserData::AddInformationElementL1 category = %d, identifier = %d",category,aIdentifier);
  3699                             OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSUSERDATA_UPDATEINFORMATIONELEMENTARRAYL_2, "CSmsUserData::AddInformationElementL1 category = %d, identifier = %d",category,aIdentifier);
  3718 
  3700 
  3719                             //if Msg type is the same, swap with the most recent value
  3701                             //if Msg type is the same, swap with the most recent value
  3720                             if ((InformationElement(i).Data()[0] & ((TUint8) EGsmSmsSpecialMessageIndicationTypeMask)) ==
  3702                             if ((InformationElement(i).Data()[0] & ((TUint8) EGsmSmsSpecialMessageIndicationTypeMask)) ==
  3721                                 (aData[0] & ((TUint8) EGsmSmsSpecialMessageIndicationTypeMask)))
  3703                                 (aData[0] & ((TUint8) EGsmSmsSpecialMessageIndicationTypeMask)))
  3722                                 {
  3704                                 {
  3723                                 User::Leave(KErrAlreadyExists);
  3705                                 User::Leave(KErrAlreadyExists);
  3724                                 }
  3706                                 }
  3725                             }
  3707                             }
  3726                         else
  3708                         else
  3727                             {
  3709                             {
  3728                             LOGGSMU4("CSmsUserData::AddInformationElementL3 category = %d, identifier = %d, data = %S",category,aIdentifier, &aData);
  3710                             OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSUSERDATA_UPDATEINFORMATIONELEMENTARRAYL_3, "CSmsUserData::AddInformationElementL3 category = %d, identifier = %d, data = %s",category,aIdentifier, aData);
  3729                             User::Leave(KErrArgument);
  3711                             User::Leave(KErrArgument);
  3730                             }
  3712                             }
  3731                         break;
  3713                         break;
  3732                         }
  3714                         }
  3733                     case TSmsInformationElementCategories::ECtrlMandatoryInEveryPDUAndWithIdenticalValues:
  3715                     case TSmsInformationElementCategories::ECtrlMandatoryInEveryPDUAndWithIdenticalValues:
  3734                     case TSmsInformationElementCategories::ECtrlMandatoryIn1stPDUOnly:
  3716                     case TSmsInformationElementCategories::ECtrlMandatoryIn1stPDUOnly:
  3735                     case TSmsInformationElementCategories::ECtrlSingleInstanceOnly:
  3717                     case TSmsInformationElementCategories::ECtrlSingleInstanceOnly:
  3736                         {
  3718                         {
  3737                         LOGGSMU3("CSmsUserData::AddInformationElementL4 category = %d, identifier = %d",category,aIdentifier);
  3719                         OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSUSERDATA_UPDATEINFORMATIONELEMENTARRAYL_4, "CSmsUserData::AddInformationElementL4 category = %d, identifier = %d",category,aIdentifier);
  3738                         User::Leave(KErrAlreadyExists);
  3720                         User::Leave(KErrAlreadyExists);
  3739                         break;
  3721                         break;
  3740                         }
  3722                         }
  3741                     case TSmsInformationElementCategories::ECtrlMultipleInstancesAllowed:
  3723                     case TSmsInformationElementCategories::ECtrlMultipleInstancesAllowed:
  3742                         {
  3724                         {
  3743                         LOGGSMU3("CSmsUserData::AddInformationElementL5 category = %d, identifier = %d",category,aIdentifier);
  3725                         OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSUSERDATA_UPDATEINFORMATIONELEMENTARRAYL_5, "CSmsUserData::AddInformationElementL5 category = %d, identifier = %d",category,aIdentifier);
  3744                         break;
  3726                         break;
  3745                         }
  3727                         }
  3746                     case TSmsInformationElementCategories::ECtrlMandatoryInEveryPDUButWithValueSpecificToPDU:
  3728                     case TSmsInformationElementCategories::ECtrlMandatoryInEveryPDUButWithValueSpecificToPDU:
  3747                         {
  3729                         {
  3748                         LOGGSMU3("CSmsUserData::AddInformationElementL6 category = %d, identifier = %d",category,aIdentifier);
  3730                         OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSUSERDATA_UPDATEINFORMATIONELEMENTARRAYL_6, "CSmsUserData::AddInformationElementL6 category = %d, identifier = %d",category,aIdentifier);
  3749                         User::Leave(KErrAlreadyExists);
  3731                         User::Leave(KErrAlreadyExists);
  3750                         // currently the email header is updated in:
  3732                         // currently the email header is updated in:
  3751                         // void CSmsMessage::DecodeBufferL(CArrayPtr<CSmsPDU>& aSmsPDUArray,CSmsBufferBase& aBuffer)
  3733                         // void CSmsMessage::DecodeBufferL(CArrayPtr<CSmsPDU>& aSmsPDUArray,CSmsBufferBase& aBuffer)
  3752                         break;
  3734                         break;
  3753                         }
  3735                         }
  3754                     default:
  3736                     default:
  3755                         {
  3737                         {
  3756                         LOGGSMU3("CSmsUserData::AddInformationElementL8 category = %d, identifier = %d",category,aIdentifier);
  3738                         OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSUSERDATA_UPDATEINFORMATIONELEMENTARRAYL_7, "CSmsUserData::AddInformationElementL8 category = %d, identifier = %d",category,aIdentifier);
  3757                         User::Leave(KErrNotSupported);
  3739                         User::Leave(KErrNotSupported);
  3758                         break;
  3740                         break;
  3759                         }
  3741                         }
  3760                     }
  3742                     }
  3761                 }
  3743                 }
  3770     } // CSmsUserData::UpdateInformationElementArrayL
  3752     } // CSmsUserData::UpdateInformationElementArrayL
  3771 
  3753 
  3772 
  3754 
  3773 void CSmsUserData::AddEmsInformationElementL(CEmsInformationElement* aIe)
  3755 void CSmsUserData::AddEmsInformationElementL(CEmsInformationElement* aIe)
  3774 	{
  3756 	{
  3775 	LOGGSMU1("CSmsUserData::AddEmsInformationElementL()");
  3757 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSUSERDATA_ADDEMSINFORMATIONELEMENTL_1, "CSmsUserData::AddEmsInformationElementL()");
  3776 
  3758 
  3777 	// Before using an EmsInformationElement polymorphically as an SmsIE,
  3759 	// Before using an EmsInformationElement polymorphically as an SmsIE,
  3778 	// we need to make sure that the IE has been encoded
  3760 	// we need to make sure that the IE has been encoded
  3779 	aIe->EncodeInformationElementL();
  3761 	aIe->EncodeInformationElementL();
  3780 	iInformationElementArray.AppendL(aIe);
  3762 	iInformationElementArray.AppendL(aIe);
  3788  *  @param aIndex Information element index
  3770  *  @param aIndex Information element index
  3789  *  @capability None
  3771  *  @capability None
  3790  */
  3772  */
  3791 EXPORT_C void CSmsUserData::RemoveInformationElement(TInt aIndex)
  3773 EXPORT_C void CSmsUserData::RemoveInformationElement(TInt aIndex)
  3792 	{
  3774 	{
  3793 	LOGGSMU1("CSmsUserData::RemoveInformationElement()");
  3775 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CSMSUSERDATA_REMOVEINFORMATIONELEMENT_1, "CSmsUserData::RemoveInformationElement()");
  3794 	// Since iInformationElementArray[aIndex] pointer is removed from iInformationElementArray, there is no double free issue.
  3776 	// Since iInformationElementArray[aIndex] pointer is removed from iInformationElementArray, there is no double free issue.
  3795 	// coverity[double_free]
  3777 	// coverity[double_free]
  3796 	delete iInformationElementArray[aIndex];
  3778 	delete iInformationElementArray[aIndex];
  3797 	iInformationElementArray[aIndex] = NULL;
  3779 	iInformationElementArray[aIndex] = NULL;
  3798 	iInformationElementArray.Delete(aIndex);
  3780 	iInformationElementArray.Delete(aIndex);
  3804 	} // CSmsUserData::RemoveInformationElement
  3786 	} // CSmsUserData::RemoveInformationElement
  3805 
  3787 
  3806 
  3788 
  3807 TInt CSmsUserData::MaxPackedUDUnitsInBodyRemaining() const
  3789 TInt CSmsUserData::MaxPackedUDUnitsInBodyRemaining() const
  3808 	{
  3790 	{
  3809 	LOGGSMU1("CSmsUserData::MaxPackedUDUnitsInBodyRemaining()");
  3791 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSUSERDATA_MAXPACKEDUDUNITSINBODYREMAINING_1, "CSmsUserData::MaxPackedUDUnitsInBodyRemaining()");
  3810 
  3792 
  3811 	TInt totalHeaderLengthInUDLUnits=TotalHeaderLengthInUDLUnits();
  3793 	TInt totalHeaderLengthInUDLUnits=TotalHeaderLengthInUDLUnits();
  3812 	TInt maxPackedUDUnitsInBody=0;
  3794 	TInt maxPackedUDUnitsInBody=0;
  3813 	if (iDataCodingScheme.TextCompressed()||(iDataCodingScheme.Alphabet()!=TSmsDataCodingScheme::ESmsAlphabet7Bit))
  3795 	if (iDataCodingScheme.TextCompressed()||(iDataCodingScheme.Alphabet()!=TSmsDataCodingScheme::ESmsAlphabet7Bit))
  3814 		{
  3796 		{
  3830 	} // CSmsUserData::MaxPackedUDUnitsInBodyRemaining
  3812 	} // CSmsUserData::MaxPackedUDUnitsInBodyRemaining
  3831 
  3813 
  3832 
  3814 
  3833 TInt CSmsUserData::MaxPackedUDUnitsInBodyRemaining(TUint aIELen) const
  3815 TInt CSmsUserData::MaxPackedUDUnitsInBodyRemaining(TUint aIELen) const
  3834 	{
  3816 	{
  3835 	LOGGSMU1("CSmsUserData::MaxPackedUDUnitsInBodyRemaining()");
  3817 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSUSERDATA_MAXPACKEDUDUNITSINBODYREMAINING1_1, "CSmsUserData::MaxPackedUDUnitsInBodyRemaining()");
  3836 
  3818 
  3837 	TInt totalHeaderLengthInUDLUnits=TotalHeaderLengthInUDLUnits(aIELen);
  3819 	TInt totalHeaderLengthInUDLUnits=TotalHeaderLengthInUDLUnits(aIELen);
  3838 	TInt maxPackedUDUnitsInBody=0;
  3820 	TInt maxPackedUDUnitsInBody=0;
  3839 	if (iDataCodingScheme.TextCompressed()||(iDataCodingScheme.Alphabet()!=TSmsDataCodingScheme::ESmsAlphabet7Bit))
  3821 	if (iDataCodingScheme.TextCompressed()||(iDataCodingScheme.Alphabet()!=TSmsDataCodingScheme::ESmsAlphabet7Bit))
  3840 		{
  3822 		{
  3859 /**
  3841 /**
  3860  *  @capability None
  3842  *  @capability None
  3861  */
  3843  */
  3862 EXPORT_C TInt CSmsUserData::MaxBodyLengthInChars() const
  3844 EXPORT_C TInt CSmsUserData::MaxBodyLengthInChars() const
  3863 	{
  3845 	{
  3864 	LOGGSMU1("CSmsUserData::MaxBodyLengthInChars()");
  3846 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CSMSUSERDATA_MAXBODYLENGTHINCHARS_1, "CSmsUserData::MaxBodyLengthInChars()");
  3865 
  3847 
  3866 	TInt totalheaderlengthinudlunits=TotalHeaderLengthInUDLUnits();
  3848 	TInt totalheaderlengthinudlunits=TotalHeaderLengthInUDLUnits();
  3867 	TInt maxbodylengthinchars=0;
  3849 	TInt maxbodylengthinchars=0;
  3868 	if (iDataCodingScheme.TextCompressed())
  3850 	if (iDataCodingScheme.TextCompressed())
  3869 		{
  3851 		{
  3887 				{
  3869 				{
  3888 				maxbodylengthinchars=(KSmsMaxUserDataSize-totalheaderlengthinudlunits)/2;
  3870 				maxbodylengthinchars=(KSmsMaxUserDataSize-totalheaderlengthinudlunits)/2;
  3889 				break;
  3871 				break;
  3890 				}
  3872 				}
  3891 			default:
  3873 			default:
  3892 			    LOGGSMU1("CSmsUserData::MaxBodyLengthInChars() WARNING! default case has been reached");
  3874 			    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CSMSUSERDATA_MAXBODYLENGTHINCHARS_2, "CSmsUserData::MaxBodyLengthInChars() WARNING! default case has been reached");
  3893                 break;
  3875                 break;
  3894  			}
  3876  			}
  3895 		}
  3877 		}
  3896 	return maxbodylengthinchars;
  3878 	return maxbodylengthinchars;
  3897 	} // CSmsUserData::MaxBodyLengthInChars
  3879 	} // CSmsUserData::MaxBodyLengthInChars
  3903  *  @return Unpacked User Data Elements
  3885  *  @return Unpacked User Data Elements
  3904  *  @capability None
  3886  *  @capability None
  3905  */
  3887  */
  3906 EXPORT_C TPtrC8 CSmsUserData::Body() const
  3888 EXPORT_C TPtrC8 CSmsUserData::Body() const
  3907 	{
  3889 	{
  3908 	LOGGSMU1("CSmsUserData::Body()");
  3890 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CSMSUSERDATA_BODY_1, "CSmsUserData::Body()");
  3909 
  3891 
  3910 	return iBody->Des();
  3892 	return iBody->Des();
  3911 	} // CSmsUserData::Body
  3893 	} // CSmsUserData::Body
  3912 
  3894 
  3913 
  3895 
  3917  *  @param aBody Unpacked User Data Elements
  3899  *  @param aBody Unpacked User Data Elements
  3918  *  @capability None
  3900  *  @capability None
  3919  */
  3901  */
  3920 EXPORT_C void CSmsUserData::SetBodyL(const TDesC8& aBody)
  3902 EXPORT_C void CSmsUserData::SetBodyL(const TDesC8& aBody)
  3921 	{
  3903 	{
  3922 	LOGGSMU1("CSmsUserData::SetBodyL()");
  3904 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CSMSUSERDATA_SETBODYL_1, "CSmsUserData::SetBodyL()");
  3923 
  3905 
  3924 	//Some tests fail with this line in, despite it being a valid condition!
  3906 	//Some tests fail with this line in, despite it being a valid condition!
  3925 	//__ASSERT_DEBUG(aBody.Length() <= MaxBodyLengthInChars(), User::Leave(KErrTooBig));
  3907 	//__ASSERT_DEBUG(aBody.Length() <= MaxBodyLengthInChars(), User::Leave(KErrTooBig));
  3926 
  3908 
  3927 	NewBodyL(aBody.Length());
  3909 	NewBodyL(aBody.Length());
  3929 	} // CSmsUserData::SetBodyL
  3911 	} // CSmsUserData::SetBodyL
  3930 
  3912 
  3931 
  3913 
  3932 void CSmsUserData::AppendBodyL(const TDesC8& aBody)
  3914 void CSmsUserData::AppendBodyL(const TDesC8& aBody)
  3933 	{
  3915 	{
  3934 	LOGGSMU1("CSmsUserData::AppendBodyL()");
  3916 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSUSERDATA_APPENDBODYL_1, "CSmsUserData::AppendBodyL()");
  3935 
  3917 
  3936 	if (iBody)
  3918 	if (iBody)
  3937 		{
  3919 		{
  3938 		//Some tests fail with this line in, despite it being a valid condition!
  3920 		//Some tests fail with this line in, despite it being a valid condition!
  3939 		//__ASSERT_DEBUG(aBody.Length() + iBody->Length() <= MaxBodyLengthInChars(), User::Leave(KErrTooBig));
  3921 		//__ASSERT_DEBUG(aBody.Length() + iBody->Length() <= MaxBodyLengthInChars(), User::Leave(KErrTooBig));
  3962  *
  3944  *
  3963  *  @capability None
  3945  *  @capability None
  3964  */
  3946  */
  3965 EXPORT_C TBool CSmsUserData::IsSupportedL(TChar aChar)
  3947 EXPORT_C TBool CSmsUserData::IsSupportedL(TChar aChar)
  3966 	{
  3948 	{
  3967 	LOGGSMU1("CSmsUserData::IsSupportedL()");
  3949 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CSMSUSERDATA_ISSUPPORTEDL_1, "CSmsUserData::IsSupportedL()");
       
  3950 
       
  3951 	TInt  numberOfUnconvertibleCharacters, numberOfDowngradedCharacters, 
       
  3952 	           numberRequiringAlternativeEncoding, indexOfFirstUnconvertibleCharacter;	
       
  3953 	TBuf<4>   toEncode;
       
  3954     toEncode.SetLength(1);
       
  3955     toEncode[0]=(TText)aChar;
  3968 
  3956 
  3969 	CSmsAlphabetConverter* converter=CSmsAlphabetConverter::NewLC(iCharacterSetConverter,iFs,iDataCodingScheme.Alphabet(),IsBinaryData());
  3957 	CSmsAlphabetConverter* converter=CSmsAlphabetConverter::NewLC(iCharacterSetConverter,iFs,iDataCodingScheme.Alphabet(),IsBinaryData());
  3970 	TBool result=converter->IsSupportedL(aChar);
  3958 	TBool result=converter->IsSupportedL(toEncode, ESmsEncodingNone, 
  3971 	CleanupStack::PopAndDestroy();
  3959                                          numberOfUnconvertibleCharacters,
       
  3960                                          numberOfDowngradedCharacters,
       
  3961                                          numberRequiringAlternativeEncoding,
       
  3962                                          indexOfFirstUnconvertibleCharacter);	
       
  3963 	CleanupStack::PopAndDestroy(converter);
  3972 
  3964 
  3973 	return result;
  3965 	return result;
  3974 	} // CSmsUserData::IsSupportedL
  3966 	} // CSmsUserData::IsSupportedL
  3975 
  3967 
  3976 
  3968 
  3989  *  @capability None
  3981  *  @capability None
  3990  */
  3982  */
  3991 EXPORT_C TBool CSmsUserData::IsSupportedL(const TDesC& aDes, TInt& aNumberOfUnconvertibleCharacters,
  3983 EXPORT_C TBool CSmsUserData::IsSupportedL(const TDesC& aDes, TInt& aNumberOfUnconvertibleCharacters,
  3992                                           TInt& aIndexOfFirstUnconvertibleCharacter) const
  3984                                           TInt& aIndexOfFirstUnconvertibleCharacter) const
  3993 	{
  3985 	{
  3994 	LOGGSMU1("[1] CSmsUserData::IsSupportedL()");
  3986 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CSMSUSERDATA_ISSUPPORTEDL1_1, "[1] CSmsUserData::IsSupportedL()");
  3995 
  3987 
  3996 	CSmsAlphabetConverter* converter=CSmsAlphabetConverter::NewLC(iCharacterSetConverter,iFs,iDataCodingScheme.Alphabet(),IsBinaryData());
  3988 	CSmsAlphabetConverter* converter=CSmsAlphabetConverter::NewLC(iCharacterSetConverter,iFs,iDataCodingScheme.Alphabet(),IsBinaryData());
  3997 	TBool result=converter->IsSupportedL(aDes, aNumberOfUnconvertibleCharacters,
  3989 	TBool result=converter->IsSupportedL(aDes, aNumberOfUnconvertibleCharacters,
  3998 			                             aIndexOfFirstUnconvertibleCharacter);
  3990 			                             aIndexOfFirstUnconvertibleCharacter);
  3999 	CleanupStack::PopAndDestroy();
  3991 	CleanupStack::PopAndDestroy();
  4026 										  TInt& aNumberOfUnconvertibleCharacters,
  4018 										  TInt& aNumberOfUnconvertibleCharacters,
  4027                                           TInt& aNumberOfDowngradedCharacters,
  4019                                           TInt& aNumberOfDowngradedCharacters,
  4028                                           TInt& aNumberRequiringAlternativeEncoding,
  4020                                           TInt& aNumberRequiringAlternativeEncoding,
  4029                                           TInt& aIndexOfFirstUnconvertibleCharacter) const
  4021                                           TInt& aIndexOfFirstUnconvertibleCharacter) const
  4030 	{
  4022 	{
  4031 	LOGGSMU1("[2] CSmsUserData::IsSupportedL()");
  4023 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CSMSUSERDATA_ISSUPPORTEDL2_1, "[2] CSmsUserData::IsSupportedL()");
  4032 
  4024 
  4033 	CSmsAlphabetConverter* converter=CSmsAlphabetConverter::NewLC(iCharacterSetConverter,iFs,iDataCodingScheme.Alphabet(),IsBinaryData());
  4025 	CSmsAlphabetConverter* converter=CSmsAlphabetConverter::NewLC(iCharacterSetConverter,iFs,iDataCodingScheme.Alphabet(),IsBinaryData());
  4034 	TBool result=converter->IsSupportedL(aDes, aEncoding,
  4026 	TBool result=converter->IsSupportedL(aDes, aEncoding,
  4035 			                             aNumberOfUnconvertibleCharacters,
  4027 			                             aNumberOfUnconvertibleCharacters,
  4036 			                             aNumberOfDowngradedCharacters,
  4028 			                             aNumberOfDowngradedCharacters,
  4042 	} // CSmsUserData::IsSupportedL
  4034 	} // CSmsUserData::IsSupportedL
  4043 
  4035 
  4044 
  4036 
  4045 TUint8* CSmsUserData::EncodeL(TUint8* aPtr) const
  4037 TUint8* CSmsUserData::EncodeL(TUint8* aPtr) const
  4046 	{
  4038 	{
  4047 	LOGGSMU1("CSmsUserData::EncodeL()");
  4039 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSUSERDATA_ENCODEL_1, "CSmsUserData::EncodeL()");
  4048 
  4040 
  4049 	__ASSERT_DEBUG(0<=MaxPackedUDUnitsInBodyRemaining(),Panic(KGsmuPanicUserDataBodyTooLong));
  4041 	__ASSERT_DEBUG(0<=MaxPackedUDUnitsInBodyRemaining(),Panic(KGsmuPanicUserDataBodyTooLong));
  4050 	// Encode the user data length
  4042 	// Encode the user data length
  4051 	TInt totalHeaderLengthInUDLUnits=TotalHeaderLengthInUDLUnits();
  4043 	TInt totalHeaderLengthInUDLUnits=TotalHeaderLengthInUDLUnits();
  4052 	TSmsOctet userDataLength=totalHeaderLengthInUDLUnits+TSmsOctet(BodyLengthInUDLUnits());
  4044 	TSmsOctet userDataLength=totalHeaderLengthInUDLUnits+TSmsOctet(BodyLengthInUDLUnits());
  4076 	DecodeL(aPdu, EFalse);
  4068 	DecodeL(aPdu, EFalse);
  4077 	}
  4069 	}
  4078 
  4070 
  4079 void CSmsUserData::DecodeL(TGsmuLex8& aPdu, TBool aAcceptTruncation)
  4071 void CSmsUserData::DecodeL(TGsmuLex8& aPdu, TBool aAcceptTruncation)
  4080 	{	
  4072 	{	
  4081 	LOGGSMU1("CSmsUserData::DecodeL()");
  4073 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSUSERDATA_DECODEL1_1, "CSmsUserData::DecodeL()");
  4082 
  4074 
  4083 	// Reset current data
  4075 	// Reset current data
  4084 	iInformationElementArray.ResetAndDestroy();
  4076 	iInformationElementArray.ResetAndDestroy();
  4085 	// Decode the user data
  4077 	// Decode the user data
  4086 	TSmsOctet userDataLength;
  4078 	TSmsOctet userDataLength;
  4180     } // CSmsUserData::CSmsUserData
  4172     } // CSmsUserData::CSmsUserData
  4181 
  4173 
  4182 
  4174 
  4183 void CSmsUserData::ConstructL()
  4175 void CSmsUserData::ConstructL()
  4184 	{
  4176 	{
  4185 	LOGGSMU1("CSmsUserData::ConstructL()");
  4177 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSUSERDATA_CONSTRUCTL_1, "CSmsUserData::ConstructL()");
  4186 
  4178 
  4187 	NewBodyL(0);
  4179 	NewBodyL(0);
  4188 	} // CSmsUserData::ConstructL
  4180 	} // CSmsUserData::ConstructL
  4189 
  4181 
  4190 
  4182 
  4194  *  @return  Pointer to the newly created CSmsUserData object.
  4186  *  @return  Pointer to the newly created CSmsUserData object.
  4195  */
  4187  */
  4196 CSmsUserData* CSmsUserData::DuplicateL(TSmsFirstOctet& aFirstOctet,
  4188 CSmsUserData* CSmsUserData::DuplicateL(TSmsFirstOctet& aFirstOctet,
  4197 									   const TSmsDataCodingScheme& aDataCodingScheme) const
  4189 									   const TSmsDataCodingScheme& aDataCodingScheme) const
  4198 	{
  4190 	{
  4199 	LOGGSMU1("CSmsUserData::DuplicateL()");
  4191 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSUSERDATA_DUPLICATEL_1, "CSmsUserData::DuplicateL()");
  4200 
  4192 
  4201 	CSmsUserData*  userdata = CSmsUserData::NewL(iCharacterSetConverter, iFs,
  4193 	CSmsUserData*  userdata = CSmsUserData::NewL(iCharacterSetConverter, iFs,
  4202 	                                             aFirstOctet, aDataCodingScheme);
  4194 	                                             aFirstOctet, aDataCodingScheme);
  4203 	CleanupStack::PushL(userdata);
  4195 	CleanupStack::PushL(userdata);
  4204 
  4196 
  4228 	} // CSmsUserData::DuplicateL
  4220 	} // CSmsUserData::DuplicateL
  4229 
  4221 
  4230 
  4222 
  4231 TInt CSmsUserData::HeaderLength() const
  4223 TInt CSmsUserData::HeaderLength() const
  4232 	{
  4224 	{
  4233 	LOGGSMU1("CSmsUserData::HeaderLength()");
  4225 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSUSERDATA_HEADERLENGTH_1, "CSmsUserData::HeaderLength()");
  4234 
  4226 
  4235 	TInt numinformationelements=NumInformationElements();
  4227 	TInt numinformationelements=NumInformationElements();
  4236 	TInt headerlength=0;
  4228 	TInt headerlength=0;
  4237 	for (TInt i=0; i<numinformationelements; i++)
  4229 	for (TInt i=0; i<numinformationelements; i++)
  4238 		headerlength+=iInformationElementArray[i]->Length();
  4230 		headerlength+=iInformationElementArray[i]->Length();
  4240 	} // CSmsUserData::HeaderLength
  4232 	} // CSmsUserData::HeaderLength
  4241 
  4233 
  4242 
  4234 
  4243 TInt CSmsUserData::TotalHeaderLengthInUDLUnits() const
  4235 TInt CSmsUserData::TotalHeaderLengthInUDLUnits() const
  4244 	{
  4236 	{
  4245 	LOGGSMU1("CSmsUserData::TotalHeaderLengthInUDLUnits()");
  4237 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSUSERDATA_TOTALHEADERLENGTHINUDLUNITS_1, "CSmsUserData::TotalHeaderLengthInUDLUnits()");
  4246 
  4238 
  4247 	TInt totalheaderlengthinudlunits=0;
  4239 	TInt totalheaderlengthinudlunits=0;
  4248 	if (iInformationElementArray.Count()>0)
  4240 	if (iInformationElementArray.Count()>0)
  4249 		{
  4241 		{
  4250 		TInt totalheaderlength=1+HeaderLength();
  4242 		TInt totalheaderlength=1+HeaderLength();
  4266 					{
  4258 					{
  4267 					totalheaderlengthinudlunits=totalheaderlength;
  4259 					totalheaderlengthinudlunits=totalheaderlength;
  4268 					break;
  4260 					break;
  4269 					}
  4261 					}
  4270 				default:
  4262 				default:
  4271 				    LOGGSMU1("CSmsUserData::TotalHeaderLengthInUDLUnits() WARNING default case has been reached");
  4263 				    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSUSERDATA_TOTALHEADERLENGTHINUDLUNITS_2, "CSmsUserData::TotalHeaderLengthInUDLUnits() WARNING default case has been reached");
  4272                     break;
  4264                     break;
  4273 				}
  4265 				}
  4274 			}
  4266 			}
  4275 		}
  4267 		}
  4276 	return totalheaderlengthinudlunits;
  4268 	return totalheaderlengthinudlunits;
  4277 	} // CSmsUserData::TotalHeaderLengthInUDLUnits
  4269 	} // CSmsUserData::TotalHeaderLengthInUDLUnits
  4278 
  4270 
  4279 
  4271 
  4280 TInt CSmsUserData::TotalHeaderLengthInUDLUnits(TInt aIElen) const
  4272 TInt CSmsUserData::TotalHeaderLengthInUDLUnits(TInt aIElen) const
  4281 	{
  4273 	{
  4282 	LOGGSMU1("CSmsUserData::TotalHeaderLengthInUDLUnits()");
  4274 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSUSERDATA_TOTALHEADERLENGTHINUDLUNITS1_1, "CSmsUserData::TotalHeaderLengthInUDLUnits()");
  4283 
  4275 
  4284 		TInt totalheaderlengthinudlunits=0;
  4276 		TInt totalheaderlengthinudlunits=0;
  4285 		TInt totalheaderlength=aIElen;
  4277 		TInt totalheaderlength=aIElen;
  4286 
  4278 
  4287 		if (iInformationElementArray.Count()>0)
  4279 		if (iInformationElementArray.Count()>0)
  4316 	} // CSmsUserData::TotalHeaderLengthInUDLUnits
  4308 	} // CSmsUserData::TotalHeaderLengthInUDLUnits
  4317 
  4309 
  4318 
  4310 
  4319 TInt CSmsUserData::BodyLengthInUDLUnits() const
  4311 TInt CSmsUserData::BodyLengthInUDLUnits() const
  4320 	{
  4312 	{
  4321 	LOGGSMU1("CSmsUserData::BodyLengthInUDLUnits()");
  4313 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSUSERDATA_BODYLENGTHINUDLUNITS_1, "CSmsUserData::BodyLengthInUDLUnits()");
  4322 
  4314 
  4323 	return iBody->Des().Length();
  4315 	return iBody->Des().Length();
  4324 	} // CSmsUserData::BodyLengthInUDLUnits
  4316 	} // CSmsUserData::BodyLengthInUDLUnits
  4325 
  4317 
  4326 
  4318 
  4327 void CSmsUserData::NewBodyL(TInt aLength)
  4319 void CSmsUserData::NewBodyL(TInt aLength)
  4328 	{
  4320 	{
  4329 	LOGGSMU1("CSmsUserData::NewBodyL()");
  4321 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSUSERDATA_NEWBODYL_1, "CSmsUserData::NewBodyL()");
  4330 
  4322 
  4331 
  4323 
  4332 		HBufC8* body=HBufC8::NewL(aLength);
  4324 		HBufC8* body=HBufC8::NewL(aLength);
  4333 		delete iBody;
  4325 		delete iBody;
  4334 		iBody=body;
  4326 		iBody=body;
  4337 	} // CSmsUserData::NewBodyL
  4329 	} // CSmsUserData::NewBodyL
  4338 
  4330 
  4339 
  4331 
  4340 TBool CSmsUserData::HeaderPresent() const
  4332 TBool CSmsUserData::HeaderPresent() const
  4341 	{
  4333 	{
  4342 	LOGGSMU1("CSmsUserData::HeaderPresent()");
  4334 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSUSERDATA_HEADERPRESENT_1, "CSmsUserData::HeaderPresent()");
  4343 
  4335 
  4344 	return (iFirstOctet&TSmsFirstOctet::ESmsUDHIMask)==TSmsFirstOctet::ESmsUDHIHeaderPresent;
  4336 	return (iFirstOctet&TSmsFirstOctet::ESmsUDHIMask)==TSmsFirstOctet::ESmsUDHIHeaderPresent;
  4345 	} // CSmsUserData::HeaderPresent
  4337 	} // CSmsUserData::HeaderPresent
  4346 
  4338 
  4347 
  4339 
  4348 void CSmsUserData::SetHeaderPresent(TBool aHeaderPresent)
  4340 void CSmsUserData::SetHeaderPresent(TBool aHeaderPresent)
  4349 	{
  4341 	{
  4350 	LOGGSMU1("CSmsUserData::SetHeaderPresent()");
  4342 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSUSERDATA_SETHEADERPRESENT_1, "CSmsUserData::SetHeaderPresent()");
  4351 
  4343 
  4352 	iFirstOctet=aHeaderPresent? (iFirstOctet&(~TSmsFirstOctet::ESmsUDHIMask))|TSmsFirstOctet::ESmsUDHIHeaderPresent: (iFirstOctet&(~TSmsFirstOctet::ESmsUDHIMask))|TSmsFirstOctet::ESmsUDHIHeaderNotPresent;
  4344 	iFirstOctet=aHeaderPresent? (iFirstOctet&(~TSmsFirstOctet::ESmsUDHIMask))|TSmsFirstOctet::ESmsUDHIHeaderPresent: (iFirstOctet&(~TSmsFirstOctet::ESmsUDHIMask))|TSmsFirstOctet::ESmsUDHIHeaderNotPresent;
  4353 	} // CSmsUserData::SetHeaderPresent
  4345 	} // CSmsUserData::SetHeaderPresent
  4354 
  4346 
  4355 
  4347 
  4356 TBool CSmsUserData::IsBinaryData() const
  4348 TBool CSmsUserData::IsBinaryData() const
  4357 	{
  4349 	{
  4358 	LOGGSMU1("CSmsUserData::IsBinaryData()");
  4350 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSUSERDATA_ISBINARYDATA_1, "CSmsUserData::IsBinaryData()");
  4359 
  4351 
  4360 	TInt index=0;
  4352 	TInt index=0;
  4361 	return (iDataCodingScheme.TextCompressed()) ||
  4353 	return (iDataCodingScheme.TextCompressed()) ||
  4362 			((iDataCodingScheme.Alphabet()==TSmsDataCodingScheme::ESmsAlphabet8Bit) &&
  4354 			((iDataCodingScheme.Alphabet()==TSmsDataCodingScheme::ESmsAlphabet8Bit) &&
  4363 			(InformationElementIndex(CSmsInformationElement::ESmsIEIApplicationPortAddressing8Bit,index) ||
  4355 			(InformationElementIndex(CSmsInformationElement::ESmsIEIApplicationPortAddressing8Bit,index) ||
  4375  *  
  4367  *  
  4376  *  @capability None
  4368  *  @capability None
  4377  */
  4369  */
  4378 EXPORT_C void TGsmSmsTypeOfAddress::ConvertToETelMM(NMobilePhone::TMobileTON& aTon,NMobilePhone::TMobileNPI& aNpi) const
  4370 EXPORT_C void TGsmSmsTypeOfAddress::ConvertToETelMM(NMobilePhone::TMobileTON& aTon,NMobilePhone::TMobileNPI& aNpi) const
  4379     {
  4371     {
  4380     LOGGSMU1("TGsmSmsTypeOfAddress::ConvertToETelMM()");
  4372     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, TGSMSMSTYPEOFADDRESS_CONVERTTOETELMM_1, "TGsmSmsTypeOfAddress::ConvertToETelMM()");
  4381 
  4373 
  4382     switch (TON())
  4374     switch (TON())
  4383     {
  4375     {
  4384 		case EGsmSmsTONInternationalNumber:
  4376 		case EGsmSmsTONInternationalNumber:
  4385             {
  4377             {
  4471  *  
  4463  *  
  4472  *  @capability None
  4464  *  @capability None
  4473  */
  4465  */
  4474 EXPORT_C void TGsmSmsTypeOfAddress::SetFromETelMM(NMobilePhone::TMobileTON aTon,NMobilePhone::TMobileNPI aNpi)
  4466 EXPORT_C void TGsmSmsTypeOfAddress::SetFromETelMM(NMobilePhone::TMobileTON aTon,NMobilePhone::TMobileNPI aNpi)
  4475     {
  4467     {
  4476     LOGGSMU1("TGsmSmsTypeOfAddress::SetFromETelMM()");
  4468     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, TGSMSMSTYPEOFADDRESS_SETFROMETELMM_1, "TGsmSmsTypeOfAddress::SetFromETelMM()");
  4477 
  4469 
  4478     switch (aTon)
  4470     switch (aTon)
  4479     {
  4471     {
  4480 		case NMobilePhone::EInternationalNumber:
  4472 		case NMobilePhone::EInternationalNumber:
  4481             {
  4473             {
  4569  *  
  4561  *  
  4570  *  @capability None
  4562  *  @capability None
  4571  */
  4563  */
  4572 EXPORT_C TVoiceMailInfoType CEnhancedVoiceMailBoxInformation::Type() const
  4564 EXPORT_C TVoiceMailInfoType CEnhancedVoiceMailBoxInformation::Type() const
  4573 	{
  4565 	{
  4574 	LOGGSMU1("CEnhancedVoiceMailBoxInformation::Type()");
  4566 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CENHANCEDVOICEMAILBOXINFORMATION_TYPE_1, "CEnhancedVoiceMailBoxInformation::Type()");
  4575 
  4567 
  4576 	return iType;
  4568 	return iType;
  4577 	} // CEnhancedVoiceMailBoxInformation::Type
  4569 	} // CEnhancedVoiceMailBoxInformation::Type
  4578 
  4570 
  4579 
  4571 
  4587  *  
  4579  *  
  4588  *  @capability None
  4580  *  @capability None
  4589  */
  4581  */
  4590 EXPORT_C void CEnhancedVoiceMailBoxInformation::SetProfile(TSmsMessageProfileType aProfile)
  4582 EXPORT_C void CEnhancedVoiceMailBoxInformation::SetProfile(TSmsMessageProfileType aProfile)
  4591 	{
  4583 	{
  4592 	LOGGSMU1("CEnhancedVoiceMailBoxInformation::SetProfile()");
  4584 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CENHANCEDVOICEMAILBOXINFORMATION_SETPROFILE_1, "CEnhancedVoiceMailBoxInformation::SetProfile()");
  4593 
  4585 
  4594 	iProfile = aProfile;
  4586 	iProfile = aProfile;
  4595 	} // CEnhancedVoiceMailBoxInformation::SetProfile
  4587 	} // CEnhancedVoiceMailBoxInformation::SetProfile
  4596 
  4588 
  4597 
  4589 
  4605  *  
  4597  *  
  4606  *  @capability None
  4598  *  @capability None
  4607  */
  4599  */
  4608 EXPORT_C TSmsMessageProfileType CEnhancedVoiceMailBoxInformation::Profile() const
  4600 EXPORT_C TSmsMessageProfileType CEnhancedVoiceMailBoxInformation::Profile() const
  4609 	{
  4601 	{
  4610 	LOGGSMU1("CEnhancedVoiceMailBoxInformation::Profile()");
  4602 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CENHANCEDVOICEMAILBOXINFORMATION_PROFILE_1, "CEnhancedVoiceMailBoxInformation::Profile()");
  4611 
  4603 
  4612 	return iProfile;
  4604 	return iProfile;
  4613 	} // CEnhancedVoiceMailBoxInformation::Profile
  4605 	} // CEnhancedVoiceMailBoxInformation::Profile
  4614 
  4606 
  4615 
  4607 
  4624  *  
  4616  *  
  4625  *  @capability None
  4617  *  @capability None
  4626  */
  4618  */
  4627 EXPORT_C void CEnhancedVoiceMailBoxInformation::SetStorage(TBool aIsStored)
  4619 EXPORT_C void CEnhancedVoiceMailBoxInformation::SetStorage(TBool aIsStored)
  4628 	{
  4620 	{
  4629 	LOGGSMU1("CEnhancedVoiceMailBoxInformation::SetStorage()");
  4621 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CENHANCEDVOICEMAILBOXINFORMATION_SETSTORAGE_1, "CEnhancedVoiceMailBoxInformation::SetStorage()");
  4630 
  4622 
  4631 	iStorage = aIsStored;
  4623 	iStorage = aIsStored;
  4632 	} // CEnhancedVoiceMailBoxInformation::SetStorage
  4624 	} // CEnhancedVoiceMailBoxInformation::SetStorage
  4633 
  4625 
  4634 
  4626 
  4643  *  
  4635  *  
  4644  *  @capability None
  4636  *  @capability None
  4645  */
  4637  */
  4646 EXPORT_C TBool CEnhancedVoiceMailBoxInformation::Store() const
  4638 EXPORT_C TBool CEnhancedVoiceMailBoxInformation::Store() const
  4647 	{
  4639 	{
  4648 	LOGGSMU1("CEnhancedVoiceMailBoxInformation::Store()");
  4640 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CENHANCEDVOICEMAILBOXINFORMATION_STORE_1, "CEnhancedVoiceMailBoxInformation::Store()");
  4649 
  4641 
  4650 	return iStorage;
  4642 	return iStorage;
  4651 	} // CEnhancedVoiceMailBoxInformation::Store
  4643 	} // CEnhancedVoiceMailBoxInformation::Store
  4652 
  4644 
  4653 
  4645 
  4662  *  
  4654  *  
  4663  *  @capability None
  4655  *  @capability None
  4664  */
  4656  */
  4665 EXPORT_C void CEnhancedVoiceMailBoxInformation::SetAlmostMaximumCapacity(TBool aIsAlmostFull)
  4657 EXPORT_C void CEnhancedVoiceMailBoxInformation::SetAlmostMaximumCapacity(TBool aIsAlmostFull)
  4666 	{
  4658 	{
  4667 	LOGGSMU1("CEnhancedVoiceMailBoxInformation::SetAlmostMaximumCapacity()");
  4659 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CENHANCEDVOICEMAILBOXINFORMATION_SETALMOSTMAXIMUMCAPACITY_1, "CEnhancedVoiceMailBoxInformation::SetAlmostMaximumCapacity()");
  4668 
  4660 
  4669 	iAlmostFull = aIsAlmostFull;
  4661 	iAlmostFull = aIsAlmostFull;
  4670 	} // CEnhancedVoiceMailBoxInformation::SetAlmostMaximumCapacity
  4662 	} // CEnhancedVoiceMailBoxInformation::SetAlmostMaximumCapacity
  4671 
  4663 
  4672 
  4664 
  4681  *  
  4673  *  
  4682  *  @capability None
  4674  *  @capability None
  4683  */
  4675  */
  4684 EXPORT_C TBool CEnhancedVoiceMailBoxInformation::AlmostMaximumCapacity() const
  4676 EXPORT_C TBool CEnhancedVoiceMailBoxInformation::AlmostMaximumCapacity() const
  4685 	{
  4677 	{
  4686 	LOGGSMU1("CEnhancedVoiceMailBoxInformation::AlmostMaximumCapacity()");
  4678 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CENHANCEDVOICEMAILBOXINFORMATION_ALMOSTMAXIMUMCAPACITY_1, "CEnhancedVoiceMailBoxInformation::AlmostMaximumCapacity()");
  4687 
  4679 
  4688 	return iAlmostFull;
  4680 	return iAlmostFull;
  4689 	} // CEnhancedVoiceMailBoxInformation::AlmostMaximumCapacity
  4681 	} // CEnhancedVoiceMailBoxInformation::AlmostMaximumCapacity
  4690 
  4682 
  4691 
  4683 
  4700  *  
  4692  *  
  4701  *  @capability None
  4693  *  @capability None
  4702  */
  4694  */
  4703 EXPORT_C void CEnhancedVoiceMailBoxInformation::SetMaximumCapacity(TBool aIsFull)
  4695 EXPORT_C void CEnhancedVoiceMailBoxInformation::SetMaximumCapacity(TBool aIsFull)
  4704 	{
  4696 	{
  4705 	LOGGSMU1("CEnhancedVoiceMailBoxInformation::SetMaximumCapacity()");
  4697 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CENHANCEDVOICEMAILBOXINFORMATION_SETMAXIMUMCAPACITY_1, "CEnhancedVoiceMailBoxInformation::SetMaximumCapacity()");
  4706 
  4698 
  4707 	iFull = aIsFull;
  4699 	iFull = aIsFull;
  4708 	} // CEnhancedVoiceMailBoxInformation::SetMaximumCapacity
  4700 	} // CEnhancedVoiceMailBoxInformation::SetMaximumCapacity
  4709 
  4701 
  4710 
  4702 
  4719  *  
  4711  *  
  4720  *  @capability None
  4712  *  @capability None
  4721  */
  4713  */
  4722 EXPORT_C TBool CEnhancedVoiceMailBoxInformation::MaximumCapacity() const
  4714 EXPORT_C TBool CEnhancedVoiceMailBoxInformation::MaximumCapacity() const
  4723 	{
  4715 	{
  4724 	LOGGSMU1("CEnhancedVoiceMailBoxInformation::MaximumCapacity()");
  4716 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CENHANCEDVOICEMAILBOXINFORMATION_MAXIMUMCAPACITY_1, "CEnhancedVoiceMailBoxInformation::MaximumCapacity()");
  4725 
  4717 
  4726 	return iFull;
  4718 	return iFull;
  4727 	} // CEnhancedVoiceMailBoxInformation::MaximumCapacity
  4719 	} // CEnhancedVoiceMailBoxInformation::MaximumCapacity
  4728 
  4720 
  4729 
  4721 
  4738  *  
  4730  *  
  4739  *  @capability None
  4731  *  @capability None
  4740  */
  4732  */
  4741 EXPORT_C TBool CEnhancedVoiceMailBoxInformation::ExtensionIndicator() const
  4733 EXPORT_C TBool CEnhancedVoiceMailBoxInformation::ExtensionIndicator() const
  4742 	{
  4734 	{
  4743 	LOGGSMU1("CEnhancedVoiceMailBoxInformation::ExtensionIndicator()");
  4735 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CENHANCEDVOICEMAILBOXINFORMATION_EXTENSIONINDICATOR_1, "CEnhancedVoiceMailBoxInformation::ExtensionIndicator()");
  4744 
  4736 
  4745 	return iExtensionIndicator;
  4737 	return iExtensionIndicator;
  4746 	} // CEnhancedVoiceMailBoxInformation::ExtensionIndicator
  4738 	} // CEnhancedVoiceMailBoxInformation::ExtensionIndicator
  4747 
  4739 
  4748 
  4740 
  4749 void CEnhancedVoiceMailBoxInformation::NewBufferL(TInt aLength)
  4741 void CEnhancedVoiceMailBoxInformation::NewBufferL(TInt aLength)
  4750 	{
  4742 	{
  4751 	LOGGSMU2("CEnhancedVoiceMailBoxInformation::NewBufferL, length = %d",aLength);
  4743 	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CENHANCEDVOICEMAILBOXINFORMATION_NEWBUFFERL_1, "CEnhancedVoiceMailBoxInformation::NewBufferL, length = %d",aLength);
  4752 
  4744 
  4753 	HBufC* buffer=HBufC::NewL(aLength);
  4745 	HBufC* buffer=HBufC::NewL(aLength);
  4754 	delete iAccessAddress;
  4746 	delete iAccessAddress;
  4755 	iAccessAddress=buffer;
  4747 	iAccessAddress=buffer;
  4756 	iAccessAddress->Des().SetLength(aLength);
  4748 	iAccessAddress->Des().SetLength(aLength);
  4768  *  
  4760  *  
  4769  *  @capability None
  4761  *  @capability None
  4770  */
  4762  */
  4771 EXPORT_C void  CEnhancedVoiceMailBoxInformation::SetAccessAddressL(const TDesC& aAddress)
  4763 EXPORT_C void  CEnhancedVoiceMailBoxInformation::SetAccessAddressL(const TDesC& aAddress)
  4772 	{
  4764 	{
  4773 	LOGGSMU1("CEnhancedVoiceMailBoxInformation::SetAccessAddressL()");
  4765 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CENHANCEDVOICEMAILBOXINFORMATION_SETACCESSADDRESSL_1, "CEnhancedVoiceMailBoxInformation::SetAccessAddressL()");
  4774 
  4766 
  4775 	TInt length=aAddress.Length();
  4767 	TInt length=aAddress.Length();
  4776 	NewBufferL(length);
  4768 	NewBufferL(length);
  4777 	iAccessAddress->Des().Copy(aAddress);
  4769 	iAccessAddress->Des().Copy(aAddress);
  4778 
  4770 
  4791  *  
  4783  *  
  4792  *  @capability None
  4784  *  @capability None
  4793  */
  4785  */
  4794 EXPORT_C TPtrC CEnhancedVoiceMailBoxInformation::AccessAddress() const
  4786 EXPORT_C TPtrC CEnhancedVoiceMailBoxInformation::AccessAddress() const
  4795 	{
  4787 	{
  4796 	LOGGSMU1("CEnhancedVoiceMailBoxInformation::AccessAddress()");
  4788 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CENHANCEDVOICEMAILBOXINFORMATION_ACCESSADDRESS_1, "CEnhancedVoiceMailBoxInformation::AccessAddress()");
  4797 
  4789 
  4798 	TPtrC ptr;
  4790 	TPtrC ptr;
  4799 	if (iAccessAddress)
  4791 	if (iAccessAddress)
  4800 	    ptr.Set(iAccessAddress->Des());
  4792 	    ptr.Set(iAccessAddress->Des());
  4801 	return ptr;
  4793 	return ptr;
  4812  *  
  4804  *  
  4813  *  @capability None
  4805  *  @capability None
  4814  */
  4806  */
  4815 EXPORT_C void  CEnhancedVoiceMailBoxInformation::SetParsedAccessAddressL(const TGsmSmsTelNumber& aParsedAddress)
  4807 EXPORT_C void  CEnhancedVoiceMailBoxInformation::SetParsedAccessAddressL(const TGsmSmsTelNumber& aParsedAddress)
  4816 	{
  4808 	{
  4817 	LOGGSMU1("CEnhancedVoiceMailBoxInformation::SetParsedAccessAddressL()");
  4809 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CENHANCEDVOICEMAILBOXINFORMATION_SETPARSEDACCESSADDRESSL_1, "CEnhancedVoiceMailBoxInformation::SetParsedAccessAddressL()");
  4818 
  4810 
  4819    	iTypeOfAddress=aParsedAddress.iTypeOfAddress;
  4811    	iTypeOfAddress=aParsedAddress.iTypeOfAddress;
  4820 	DoSetParsedAddressL(aParsedAddress.iTelNumber);
  4812 	DoSetParsedAddressL(aParsedAddress.iTelNumber);
  4821 	} // CEnhancedVoiceMailBoxInformation::SetParsedAccessAddressL
  4813 	} // CEnhancedVoiceMailBoxInformation::SetParsedAccessAddressL
  4822 
  4814 
  4831  *  
  4823  *  
  4832  *  @capability None
  4824  *  @capability None
  4833  */
  4825  */
  4834 EXPORT_C void  CEnhancedVoiceMailBoxInformation::ParsedAccessAddress(TGsmSmsTelNumber& aParsedAddress) const
  4826 EXPORT_C void  CEnhancedVoiceMailBoxInformation::ParsedAccessAddress(TGsmSmsTelNumber& aParsedAddress) const
  4835 	{
  4827 	{
  4836 	LOGGSMU1("CEnhancedVoiceMailBoxInformation::ParsedAccessAddress()");
  4828 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CENHANCEDVOICEMAILBOXINFORMATION_PARSEDACCESSADDRESS_1, "CEnhancedVoiceMailBoxInformation::ParsedAccessAddress()");
  4837 
  4829 
  4838 	aParsedAddress.iTypeOfAddress = iTypeOfAddress;
  4830 	aParsedAddress.iTypeOfAddress = iTypeOfAddress;
  4839 
  4831 
  4840 	TInt maxparsedlength=aParsedAddress.iTelNumber.MaxLength();
  4832 	TInt maxparsedlength=aParsedAddress.iTelNumber.MaxLength();
  4841 
  4833 
  4867 	} // CEnhancedVoiceMailBoxInformation::ParsedAccessAddress
  4859 	} // CEnhancedVoiceMailBoxInformation::ParsedAccessAddress
  4868 
  4860 
  4869 
  4861 
  4870 void CEnhancedVoiceMailBoxInformation::DoSetParsedAddressL(const TDesC& aAddress)
  4862 void CEnhancedVoiceMailBoxInformation::DoSetParsedAddressL(const TDesC& aAddress)
  4871 	{
  4863 	{
  4872 	LOGGSMU1("CEnhancedVoiceMailBoxInformation::DoSetParsedAddressL()");
  4864 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CENHANCEDVOICEMAILBOXINFORMATION_DOSETPARSEDADDRESSL_1, "CEnhancedVoiceMailBoxInformation::DoSetParsedAddressL()");
  4873 
  4865 
  4874 	TInt length=aAddress.Length();
  4866 	TInt length=aAddress.Length();
  4875 	if ((iTypeOfAddress.TON()==EGsmSmsTONInternationalNumber) &&
  4867 	if ((iTypeOfAddress.TON()==EGsmSmsTONInternationalNumber) &&
  4876 	    (length && (aAddress[0]!='+')))
  4868 	    (length && (aAddress[0]!='+')))
  4877 		{
  4869 		{
  4898  *  
  4890  *  
  4899  *  @capability None
  4891  *  @capability None
  4900  */
  4892  */
  4901 EXPORT_C void   CEnhancedVoiceMailBoxInformation::SetNumberOfVoiceMessages(TUint8 aNumber)
  4893 EXPORT_C void   CEnhancedVoiceMailBoxInformation::SetNumberOfVoiceMessages(TUint8 aNumber)
  4902 	{
  4894 	{
  4903 	LOGGSMU1("CEnhancedVoiceMailBoxInformation::SetNumberOfVoiceMessages()");
  4895 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CENHANCEDVOICEMAILBOXINFORMATION_SETNUMBEROFVOICEMESSAGES_1, "CEnhancedVoiceMailBoxInformation::SetNumberOfVoiceMessages()");
  4904 
  4896 
  4905 	iNumberOfVoiceMessages=aNumber;
  4897 	iNumberOfVoiceMessages=aNumber;
  4906 	} // CEnhancedVoiceMailBoxInformation::SetNumberOfVoiceMessages
  4898 	} // CEnhancedVoiceMailBoxInformation::SetNumberOfVoiceMessages
  4907 
  4899 
  4908 
  4900 
  4916  *  
  4908  *  
  4917  *  @capability None
  4909  *  @capability None
  4918  */
  4910  */
  4919 EXPORT_C TUint8 CEnhancedVoiceMailBoxInformation::NumberOfVoiceMessages() const
  4911 EXPORT_C TUint8 CEnhancedVoiceMailBoxInformation::NumberOfVoiceMessages() const
  4920 	{
  4912 	{
  4921 	LOGGSMU1("CEnhancedVoiceMailBoxInformation::NumberOfVoiceMessages()");
  4913 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CENHANCEDVOICEMAILBOXINFORMATION_NUMBEROFVOICEMESSAGES_1, "CEnhancedVoiceMailBoxInformation::NumberOfVoiceMessages()");
  4922 
  4914 
  4923 	return iNumberOfVoiceMessages;
  4915 	return iNumberOfVoiceMessages;
  4924 	} // CEnhancedVoiceMailBoxInformation::NumberOfVoiceMessages
  4916 	} // CEnhancedVoiceMailBoxInformation::NumberOfVoiceMessages
  4925 
  4917 
  4926 
  4918 
  4931 	        ((((TUint8) iStorage)    & EMask1Bit ) << 4) +
  4923 	        ((((TUint8) iStorage)    & EMask1Bit ) << 4) +
  4932 	        ((((TUint8) iAlmostFull) & EMask1Bit ) << 5) +
  4924 	        ((((TUint8) iAlmostFull) & EMask1Bit ) << 5) +
  4933 	        ((((TUint8) iFull)       & EMask1Bit ) << 6) +
  4925 	        ((((TUint8) iFull)       & EMask1Bit ) << 6) +
  4934 	         (((TUint8) iExtensionIndicator      ) << 7);
  4926 	         (((TUint8) iExtensionIndicator      ) << 7);
  4935 
  4927 
  4936 	LOGGSMU2("CEnhancedVoiceMailBoxInformation::EncodeL 1st byte = %d",*aPtr);
  4928 	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CENHANCEDVOICEMAILBOXINFORMATION_ENCODEL_1, "CEnhancedVoiceMailBoxInformation::EncodeL 1st byte = %d",*aPtr);
  4937 	aPtr++;
  4929 	aPtr++;
  4938 
  4930 
  4939 	// Create an address object to encode the mail box access address into the
  4931 	// Create an address object to encode the mail box access address into the
  4940 	// format required by 23.040 v6.5.0 section 9.1.2.5.
  4932 	// format required by 23.040 v6.5.0 section 9.1.2.5.
  4941 	CSmsAddress* address = CSmsAddress::NewL(aCharacterSetConverter,aFs);
  4933 	CSmsAddress* address = CSmsAddress::NewL(aCharacterSetConverter,aFs);
  4965 	iStorage            = (TBool)                   ((Byte1 >> 4) & EMask1Bit);
  4957 	iStorage            = (TBool)                   ((Byte1 >> 4) & EMask1Bit);
  4966 	iAlmostFull         = (TBool)                   ((Byte1 >> 5) & EMask1Bit);
  4958 	iAlmostFull         = (TBool)                   ((Byte1 >> 5) & EMask1Bit);
  4967 	iFull               = (TBool)                   ((Byte1 >> 6) & EMask1Bit);
  4959 	iFull               = (TBool)                   ((Byte1 >> 6) & EMask1Bit);
  4968 	iExtensionIndicator = (TBool)                   ((Byte1 >> 7) & EMask1Bit);
  4960 	iExtensionIndicator = (TBool)                   ((Byte1 >> 7) & EMask1Bit);
  4969 
  4961 
  4970 	LOGGSMU2("CEnhancedVoiceMailBoxInformation::DecodeL 1st byte = %d", Byte1);
  4962 	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CENHANCEDVOICEMAILBOXINFORMATION_DECODEL_1, "CEnhancedVoiceMailBoxInformation::DecodeL 1st byte = %d", Byte1);
  4971 
  4963 
  4972 	// Create an address object to deccode the mail box access address from the
  4964 	// Create an address object to deccode the mail box access address from the
  4973 	// format required by 23.040 v6.5.0 section 9.1.2.5.
  4965 	// format required by 23.040 v6.5.0 section 9.1.2.5.
  4974 	CSmsAddress* decodedAddress = CSmsAddress::NewL(aCharacterSetConverter,aFs);
  4966 	CSmsAddress* decodedAddress = CSmsAddress::NewL(aCharacterSetConverter,aFs);
  4975 	CleanupStack::PushL(decodedAddress);
  4967 	CleanupStack::PushL(decodedAddress);
  5010 	iTypeOfAddress = decodedAddress->TypeOfAddress();
  5002 	iTypeOfAddress = decodedAddress->TypeOfAddress();
  5011 
  5003 
  5012 	CleanupStack::PopAndDestroy(decodedAddress);
  5004 	CleanupStack::PopAndDestroy(decodedAddress);
  5013 
  5005 
  5014 	iNumberOfVoiceMessages = aVoiceMailInfo.GetL();
  5006 	iNumberOfVoiceMessages = aVoiceMailInfo.GetL();
  5015 	LOGGSMU2("CEnhancedVoiceMailBoxInformation::DecodeL iNumberOfVoiceMessages = %d", iNumberOfVoiceMessages);
  5007 	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CENHANCEDVOICEMAILBOXINFORMATION_DECODEL_2, "CEnhancedVoiceMailBoxInformation::DecodeL iNumberOfVoiceMessages = %d", iNumberOfVoiceMessages);
  5016 	} // CEnhancedVoiceMailBoxInformation::DecodeL
  5008 	} // CEnhancedVoiceMailBoxInformation::DecodeL
  5017 
  5009 
  5018 
  5010 
  5019 CEnhancedVoiceMailBoxInformation::CEnhancedVoiceMailBoxInformation()
  5011 CEnhancedVoiceMailBoxInformation::CEnhancedVoiceMailBoxInformation()
  5020 	{
  5012 	{
  5021 	LOGGSMU1("CEnhancedVoiceMailBoxInformation::CEnhancedVoiceMailBoxInformation()");
  5013 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CENHANCEDVOICEMAILBOXINFORMATION_CTOR_1, "CEnhancedVoiceMailBoxInformation::CEnhancedVoiceMailBoxInformation()");
  5022 
  5014 
  5023 	// Consider changing this over to a Panic.
  5015 	// Consider changing this over to a Panic.
  5024 	iType               = EGsmSmsVoiceMailNotification;
  5016 	iType               = EGsmSmsVoiceMailNotification;
  5025 	iOctet1Bit1         = EFalse;
  5017 	iOctet1Bit1         = EFalse;
  5026 	iProfile            = EGsmSmsProfileId1;
  5018 	iProfile            = EGsmSmsProfileId1;
  5032 	} // CEnhancedVoiceMailBoxInformation::CEnhancedVoiceMailBoxInformation
  5024 	} // CEnhancedVoiceMailBoxInformation::CEnhancedVoiceMailBoxInformation
  5033 
  5025 
  5034 
  5026 
  5035 CEnhancedVoiceMailBoxInformation::CEnhancedVoiceMailBoxInformation(TVoiceMailInfoType aTVoiceMailInfoType)
  5027 CEnhancedVoiceMailBoxInformation::CEnhancedVoiceMailBoxInformation(TVoiceMailInfoType aTVoiceMailInfoType)
  5036 	{
  5028 	{
  5037 	LOGGSMU1("CEnhancedVoiceMailBoxInformation::CEnhancedVoiceMailBoxInformation()");
  5029 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CENHANCEDVOICEMAILBOXINFORMATION_CTOR1_1, "CEnhancedVoiceMailBoxInformation::CEnhancedVoiceMailBoxInformation()");
  5038 
  5030 
  5039 	iType               = aTVoiceMailInfoType;
  5031 	iType               = aTVoiceMailInfoType;
  5040 	iOctet1Bit1         = EFalse;
  5032 	iOctet1Bit1         = EFalse;
  5041 	iProfile            = EGsmSmsProfileId1;
  5033 	iProfile            = EGsmSmsProfileId1;
  5042 	iStorage            = EFalse;
  5034 	iStorage            = EFalse;
  5057  */
  5049  */
  5058 CEnhancedVoiceMailBoxInformation::CEnhancedVoiceMailBoxInformation(const CEnhancedVoiceMailBoxInformation&)
  5050 CEnhancedVoiceMailBoxInformation::CEnhancedVoiceMailBoxInformation(const CEnhancedVoiceMailBoxInformation&)
  5059     {
  5051     {
  5060     // Ignore in code coverage - not intended to be used
  5052     // Ignore in code coverage - not intended to be used
  5061     BULLSEYE_OFF    
  5053     BULLSEYE_OFF    
  5062     LOGGSMU1("CEnhancedVoiceMailBoxInformation::CEnhancedVoiceMailBoxInformation");
  5054     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CENHANCEDVOICEMAILBOXINFORMATION_CTOR2_1, "CEnhancedVoiceMailBoxInformation::CEnhancedVoiceMailBoxInformation");
  5063     Panic(KGsmuPanicMethodBodyNotImplemented);
  5055     Panic(KGsmuPanicMethodBodyNotImplemented);
  5064     BULLSEYE_RESTORE
  5056     BULLSEYE_RESTORE
  5065     }
  5057     }
  5066 
  5058 
  5067 /**
  5059 /**
  5074  */
  5066  */
  5075 TBool CEnhancedVoiceMailBoxInformation::operator==(const CEnhancedVoiceMailBoxInformation&)
  5067 TBool CEnhancedVoiceMailBoxInformation::operator==(const CEnhancedVoiceMailBoxInformation&)
  5076     {
  5068     {
  5077     // Ignore in code coverage - not intended to be used
  5069     // Ignore in code coverage - not intended to be used
  5078     BULLSEYE_OFF    
  5070     BULLSEYE_OFF    
  5079     LOGGSMU1("CEnhancedVoiceMailBoxInformation::operator==");
  5071     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CENHANCEDVOICEMAILBOXINFORMATION_OPERATOR_1, "CEnhancedVoiceMailBoxInformation::operator==");
  5080     Panic(KGsmuPanicMethodBodyNotImplemented);
  5072     Panic(KGsmuPanicMethodBodyNotImplemented);
  5081     return EFalse;
  5073     return EFalse;
  5082     BULLSEYE_RESTORE
  5074     BULLSEYE_RESTORE
  5083     }
  5075     }
  5084 
  5076 
  5092  */
  5084  */
  5093 void CEnhancedVoiceMailBoxInformation::operator=(const CEnhancedVoiceMailBoxInformation&)
  5085 void CEnhancedVoiceMailBoxInformation::operator=(const CEnhancedVoiceMailBoxInformation&)
  5094     {
  5086     {
  5095     // Ignore in code coverage - not intended to be used
  5087     // Ignore in code coverage - not intended to be used
  5096     BULLSEYE_OFF    
  5088     BULLSEYE_OFF    
  5097     LOGGSMU1("CEnhancedVoiceMailBoxInformation::operator=");
  5089     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CENHANCEDVOICEMAILBOXINFORMATION_OPERATOR1_1, "CEnhancedVoiceMailBoxInformation::operator=");
  5098     Panic(KGsmuPanicMethodBodyNotImplemented);
  5090     Panic(KGsmuPanicMethodBodyNotImplemented);
  5099     BULLSEYE_RESTORE
  5091     BULLSEYE_RESTORE
  5100     }
  5092     }
  5101 
  5093 
  5102 void CEnhancedVoiceMailBoxInformation::ConstructL()
  5094 void CEnhancedVoiceMailBoxInformation::ConstructL()
  5103 	{
  5095 	{
  5104 	LOGGSMU1("CEnhancedVoiceMailBoxInformation::ConstructL()");
  5096 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CENHANCEDVOICEMAILBOXINFORMATION_CONSTRUCTL_1, "CEnhancedVoiceMailBoxInformation::ConstructL()");
  5105 
  5097 
  5106 	NewBufferL(0);
  5098 	NewBufferL(0);
  5107 	} // CEnhancedVoiceMailBoxInformation::ConstructL
  5099 	} // CEnhancedVoiceMailBoxInformation::ConstructL
  5108 
  5100 
  5109 
  5101 
  5110 CEnhancedVoiceMailBoxInformation::~CEnhancedVoiceMailBoxInformation()
  5102 CEnhancedVoiceMailBoxInformation::~CEnhancedVoiceMailBoxInformation()
  5111 	{
  5103 	{
  5112 	LOGGSMU1("CEnhancedVoiceMailBoxInformation::~CEnhancedVoiceMailBoxInformation");
  5104 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CENHANCEDVOICEMAILBOXINFORMATION_DTOR_1, "CEnhancedVoiceMailBoxInformation::~CEnhancedVoiceMailBoxInformation");
  5113 	delete iAccessAddress;
  5105 	delete iAccessAddress;
  5114 	} // CEnhancedVoiceMailBoxInformation::ConstructL
  5106 	} // CEnhancedVoiceMailBoxInformation::ConstructL
  5115 
  5107 
  5116 
  5108 
  5117 CEnhancedVoiceMailBoxInformation* CEnhancedVoiceMailBoxInformation::NewL()
  5109 CEnhancedVoiceMailBoxInformation* CEnhancedVoiceMailBoxInformation::NewL()
  5118 	{
  5110 	{
  5119 	LOGGSMU1("CEnhancedVoiceMailBoxInformation::NewL()");
  5111 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CENHANCEDVOICEMAILBOXINFORMATION_NEWL_1, "CEnhancedVoiceMailBoxInformation::NewL()");
  5120 
  5112 
  5121 	CEnhancedVoiceMailBoxInformation* aCEnhancedVoiceMailBoxInformation=new(ELeave) CEnhancedVoiceMailBoxInformation();
  5113 	CEnhancedVoiceMailBoxInformation* aCEnhancedVoiceMailBoxInformation=new(ELeave) CEnhancedVoiceMailBoxInformation();
  5122 	CleanupStack::PushL(aCEnhancedVoiceMailBoxInformation);
  5114 	CleanupStack::PushL(aCEnhancedVoiceMailBoxInformation);
  5123 	aCEnhancedVoiceMailBoxInformation->ConstructL();
  5115 	aCEnhancedVoiceMailBoxInformation->ConstructL();
  5124 	CleanupStack::Pop(aCEnhancedVoiceMailBoxInformation);
  5116 	CleanupStack::Pop(aCEnhancedVoiceMailBoxInformation);
  5136  *  
  5128  *  
  5137  *  @capability None
  5129  *  @capability None
  5138  */
  5130  */
  5139 EXPORT_C void CVoiceMailNotification::SetMessageId(TUint16 aMessageId)
  5131 EXPORT_C void CVoiceMailNotification::SetMessageId(TUint16 aMessageId)
  5140 	{
  5132 	{
  5141 	LOGGSMU1("CVoiceMailNotification::SetMessageId()");
  5133 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CVOICEMAILNOTIFICATION_SETMESSAGEID_1, "CVoiceMailNotification::SetMessageId()");
  5142 
  5134 
  5143 	iMessageId = aMessageId;
  5135 	iMessageId = aMessageId;
  5144 	} // CVoiceMailNotification::SetMessageId
  5136 	} // CVoiceMailNotification::SetMessageId
  5145 
  5137 
  5146 
  5138 
  5154  *  
  5146  *  
  5155  *  @capability None
  5147  *  @capability None
  5156  */
  5148  */
  5157 EXPORT_C TUint16 CVoiceMailNotification::MessageId() const
  5149 EXPORT_C TUint16 CVoiceMailNotification::MessageId() const
  5158 	{
  5150 	{
  5159 	LOGGSMU1("CVoiceMailNotification::MessageId()");
  5151 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CVOICEMAILNOTIFICATION_MESSAGEID_1, "CVoiceMailNotification::MessageId()");
  5160 
  5152 
  5161 	return iMessageId;
  5153 	return iMessageId;
  5162 	} // CVoiceMailNotification::MessageId
  5154 	} // CVoiceMailNotification::MessageId
  5163 
  5155 
  5164 
  5156 
  5172  *  
  5164  *  
  5173  *  @capability None
  5165  *  @capability None
  5174  */
  5166  */
  5175 EXPORT_C void CVoiceMailNotification::SetMessageLength(TUint8 aLength)
  5167 EXPORT_C void CVoiceMailNotification::SetMessageLength(TUint8 aLength)
  5176 	{
  5168 	{
  5177 	LOGGSMU1("CVoiceMailNotification::SetMessageLength()");
  5169 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CVOICEMAILNOTIFICATION_SETMESSAGELENGTH_1, "CVoiceMailNotification::SetMessageLength()");
  5178 
  5170 
  5179 	iMessageLength=aLength;
  5171 	iMessageLength=aLength;
  5180 	} // CVoiceMailNotification::SetMessageLength
  5172 	} // CVoiceMailNotification::SetMessageLength
  5181 
  5173 
  5182 
  5174 
  5190  *  
  5182  *  
  5191  *  @capability None
  5183  *  @capability None
  5192  */
  5184  */
  5193 EXPORT_C TUint8 CVoiceMailNotification::MessageLength() const
  5185 EXPORT_C TUint8 CVoiceMailNotification::MessageLength() const
  5194 	{
  5186 	{
  5195 	LOGGSMU1("CVoiceMailNotification::MessageLength()");
  5187 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CVOICEMAILNOTIFICATION_MESSAGELENGTH_1, "CVoiceMailNotification::MessageLength()");
  5196 
  5188 
  5197 	return iMessageLength;
  5189 	return iMessageLength;
  5198 	} // CVoiceMailNotification::MessageLength
  5190 	} // CVoiceMailNotification::MessageLength
  5199 
  5191 
  5200 
  5192 
  5210  *  
  5202  *  
  5211  *  @capability None
  5203  *  @capability None
  5212  */
  5204  */
  5213 EXPORT_C void CVoiceMailNotification::SetRetentionDays(TUint8 aDays)
  5205 EXPORT_C void CVoiceMailNotification::SetRetentionDays(TUint8 aDays)
  5214 	{
  5206 	{
  5215 	LOGGSMU1("CVoiceMailNotification::SetRetentionDays()");
  5207 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CVOICEMAILNOTIFICATION_SETRETENTIONDAYS_1, "CVoiceMailNotification::SetRetentionDays()");
  5216 
  5208 
  5217 	if (aDays > 31)
  5209 	if (aDays > 31)
  5218 	    {
  5210 	    {
  5219 	    iRetentionDays = 31;
  5211 	    iRetentionDays = 31;
  5220 	    }
  5212 	    }
  5235  *  
  5227  *  
  5236  *  @capability None
  5228  *  @capability None
  5237  */
  5229  */
  5238 EXPORT_C TUint8 CVoiceMailNotification::RetentionDays() const
  5230 EXPORT_C TUint8 CVoiceMailNotification::RetentionDays() const
  5239 	{
  5231 	{
  5240 	LOGGSMU1("CVoiceMailNotification::RetentionDays()");
  5232 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CVOICEMAILNOTIFICATION_RETENTIONDAYS_1, "CVoiceMailNotification::RetentionDays()");
  5241 
  5233 
  5242 	return iRetentionDays;
  5234 	return iRetentionDays;
  5243 	} // CVoiceMailNotification::RetentionDays
  5235 	} // CVoiceMailNotification::RetentionDays
  5244 
  5236 
  5245 
  5237 
  5254  *  
  5246  *  
  5255  *  @capability None
  5247  *  @capability None
  5256  */
  5248  */
  5257 EXPORT_C void CVoiceMailNotification::SetPriorityIndication(TBool aPriority)
  5249 EXPORT_C void CVoiceMailNotification::SetPriorityIndication(TBool aPriority)
  5258 	{
  5250 	{
  5259 	LOGGSMU1("CVoiceMailNotification::SetPriorityIndication()");
  5251 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CVOICEMAILNOTIFICATION_SETPRIORITYINDICATION_1, "CVoiceMailNotification::SetPriorityIndication()");
  5260 
  5252 
  5261 	iPriorityIndication=aPriority;
  5253 	iPriorityIndication=aPriority;
  5262 	} // CVoiceMailNotification::SetPriorityIndication
  5254 	} // CVoiceMailNotification::SetPriorityIndication
  5263 
  5255 
  5264 
  5256 
  5273  *  
  5265  *  
  5274  *  @capability None
  5266  *  @capability None
  5275  */
  5267  */
  5276 EXPORT_C TBool CVoiceMailNotification::PriorityIndication() const
  5268 EXPORT_C TBool CVoiceMailNotification::PriorityIndication() const
  5277 	{
  5269 	{
  5278 	LOGGSMU1("CVoiceMailNotification::PriorityIndication()");
  5270 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CVOICEMAILNOTIFICATION_PRIORITYINDICATION_1, "CVoiceMailNotification::PriorityIndication()");
  5279 
  5271 
  5280 	return iPriorityIndication;
  5272 	return iPriorityIndication;
  5281 	} // CVoiceMailNotification::PriorityIndication
  5273 	} // CVoiceMailNotification::PriorityIndication
  5282 
  5274 
  5283 
  5275 
  5292  *  
  5284  *  
  5293  *  @capability None
  5285  *  @capability None
  5294  */
  5286  */
  5295 EXPORT_C TBool CVoiceMailNotification::MessageExtensionIndication() const
  5287 EXPORT_C TBool CVoiceMailNotification::MessageExtensionIndication() const
  5296 	{
  5288 	{
  5297 	LOGGSMU1("CVoiceMailNotification::MessageExtensionIndication()");
  5289 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CVOICEMAILNOTIFICATION_MESSAGEEXTENSIONINDICATION_1, "CVoiceMailNotification::MessageExtensionIndication()");
  5298 
  5290 
  5299 	return iMessageExtensionIndicator;
  5291 	return iMessageExtensionIndicator;
  5300 	} // CVoiceMailNotification::MessageExtensionIndication
  5292 	} // CVoiceMailNotification::MessageExtensionIndication
  5301 
  5293 
  5302 
  5294 
  5303 void CVoiceMailNotification::NewBufferL(TInt aLength)
  5295 void CVoiceMailNotification::NewBufferL(TInt aLength)
  5304 	{
  5296 	{
  5305 	LOGGSMU1("CVoiceMailNotification::NewBufferL()");
  5297 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CVOICEMAILNOTIFICATION_NEWBUFFERL_1, "CVoiceMailNotification::NewBufferL()");
  5306 
  5298 
  5307 	HBufC* buffer=HBufC::NewL(aLength);
  5299 	HBufC* buffer=HBufC::NewL(aLength);
  5308 	delete iCallingLineIdentity;
  5300 	delete iCallingLineIdentity;
  5309 	iCallingLineIdentity=buffer;
  5301 	iCallingLineIdentity=buffer;
  5310 	iCallingLineIdentity->Des().SetLength(aLength);
  5302 	iCallingLineIdentity->Des().SetLength(aLength);
  5321  *  
  5313  *  
  5322  *  @capability None
  5314  *  @capability None
  5323  */
  5315  */
  5324 EXPORT_C void  CVoiceMailNotification::SetCallingLineIdentityL(TDesC& aLineIdentity)
  5316 EXPORT_C void  CVoiceMailNotification::SetCallingLineIdentityL(TDesC& aLineIdentity)
  5325 	{
  5317 	{
  5326 	LOGGSMU1("CVoiceMailNotification::SetCallingLineIdentityL()");
  5318 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CVOICEMAILNOTIFICATION_SETCALLINGLINEIDENTITYL_1, "CVoiceMailNotification::SetCallingLineIdentityL()");
  5327 
  5319 
  5328 	TInt length=aLineIdentity.Length();
  5320 	TInt length=aLineIdentity.Length();
  5329 	NewBufferL(length);
  5321 	NewBufferL(length);
  5330 	iCallingLineIdentity->Des().Copy(aLineIdentity);
  5322 	iCallingLineIdentity->Des().Copy(aLineIdentity);
  5331 
  5323 
  5344  *  
  5336  *  
  5345  *  @capability None
  5337  *  @capability None
  5346  */
  5338  */
  5347 EXPORT_C TPtrC CVoiceMailNotification::CallingLineIdentity() const
  5339 EXPORT_C TPtrC CVoiceMailNotification::CallingLineIdentity() const
  5348 	{
  5340 	{
  5349 	LOGGSMU1("CVoiceMailNotification::CallingLineIdentity()");
  5341 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CVOICEMAILNOTIFICATION_CALLINGLINEIDENTITY_1, "CVoiceMailNotification::CallingLineIdentity()");
  5350 
  5342 
  5351 	TPtrC ptr;
  5343 	TPtrC ptr;
  5352 	if (iCallingLineIdentity)
  5344 	if (iCallingLineIdentity)
  5353 	    ptr.Set(iCallingLineIdentity->Des());
  5345 	    ptr.Set(iCallingLineIdentity->Des());
  5354 	return ptr;
  5346 	return ptr;
  5365  *  
  5357  *  
  5366  *  @capability None
  5358  *  @capability None
  5367  */
  5359  */
  5368 EXPORT_C void CVoiceMailNotification::SetParsedCallingLineIdentityL(TGsmSmsTelNumber& aParsedAddress)
  5360 EXPORT_C void CVoiceMailNotification::SetParsedCallingLineIdentityL(TGsmSmsTelNumber& aParsedAddress)
  5369 	{
  5361 	{
  5370 	LOGGSMU1("CVoiceMailNotification::SetParsedCallingLineIdentityL()");
  5362 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CVOICEMAILNOTIFICATION_SETPARSEDCALLINGLINEIDENTITYL_1, "CVoiceMailNotification::SetParsedCallingLineIdentityL()");
  5371 
  5363 
  5372 	iTypeOfAddress=aParsedAddress.iTypeOfAddress;
  5364 	iTypeOfAddress=aParsedAddress.iTypeOfAddress;
  5373 	DoSetParsedAddressL(aParsedAddress.iTelNumber);
  5365 	DoSetParsedAddressL(aParsedAddress.iTelNumber);
  5374 	} // CVoiceMailNotification::SetParsedCallingLineIdentityL
  5366 	} // CVoiceMailNotification::SetParsedCallingLineIdentityL
  5375 
  5367 
  5384  *  
  5376  *  
  5385  *  @capability None
  5377  *  @capability None
  5386  */
  5378  */
  5387 EXPORT_C void CVoiceMailNotification::ParsedCallingLineIdentity(TGsmSmsTelNumber& aParsedAddress) const
  5379 EXPORT_C void CVoiceMailNotification::ParsedCallingLineIdentity(TGsmSmsTelNumber& aParsedAddress) const
  5388 	{
  5380 	{
  5389 	LOGGSMU1("CVoiceMailNotification::ParsedCallingLineIdentity()");
  5381 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CVOICEMAILNOTIFICATION_PARSEDCALLINGLINEIDENTITY_1, "CVoiceMailNotification::ParsedCallingLineIdentity()");
  5390 
  5382 
  5391 	aParsedAddress.iTypeOfAddress = iTypeOfAddress;
  5383 	aParsedAddress.iTypeOfAddress = iTypeOfAddress;
  5392 
  5384 
  5393 	TInt maxparsedlength=aParsedAddress.iTelNumber.MaxLength();
  5385 	TInt maxparsedlength=aParsedAddress.iTelNumber.MaxLength();
  5394 
  5386 
  5420 	} // CVoiceMailNotification::ParsedCallingLineIdentity
  5412 	} // CVoiceMailNotification::ParsedCallingLineIdentity
  5421 
  5413 
  5422 
  5414 
  5423 void CVoiceMailNotification::NewExtensionL(TInt aLength)
  5415 void CVoiceMailNotification::NewExtensionL(TInt aLength)
  5424 	{
  5416 	{
  5425 	LOGGSMU1("CVoiceMailNotification::NewExtensionL()");
  5417 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CVOICEMAILNOTIFICATION_NEWEXTENSIONL_1, "CVoiceMailNotification::NewExtensionL()");
  5426 
  5418 
  5427 	HBufC* buffer=HBufC::NewL(aLength);
  5419 	HBufC* buffer=HBufC::NewL(aLength);
  5428 	delete iExtension;
  5420 	delete iExtension;
  5429 	iExtension=buffer;
  5421 	iExtension=buffer;
  5430 	iExtension->Des().SetLength(aLength);
  5422 	iExtension->Des().SetLength(aLength);
  5431 	iExtension->Des().FillZ();
  5423 	iExtension->Des().FillZ();
  5432 	} // CVoiceMailNotification::NewExtensionL
  5424 	} // CVoiceMailNotification::NewExtensionL
  5433 
  5425 
  5434 
       
  5435 /*void CVoiceMailNotification::SetExtension(TDesC& aExtension)
       
  5436 	{
       
  5437 	LOGGSMU1("CVoiceMailNotification::SetExtension()");
       
  5438 
       
  5439 	TInt length=aExtension.Length();
       
  5440 	NewExtensionL(length);
       
  5441 	iExtension->Des().Copy(aExtension);
       
  5442 	} // CVoiceMailNotification::SetExtension
       
  5443 
       
  5444 TPtrC CVoiceMailNotification::Extension() const
       
  5445 	{
       
  5446 	LOGGSMU1("CVoiceMailNotification::Extension()");
       
  5447 
       
  5448 	TPtrC ptr;
       
  5449 	if (iExtension)
       
  5450 	    ptr.Set(iExtension->Des());
       
  5451 	return ptr;
       
  5452 	}*/
       
  5453 
       
  5454 
       
  5455 /**
  5426 /**
  5456  *  @internalComponent
  5427  *  @internalComponent
  5457  *  
  5428  *  
  5458  *  Determines the size of the encoded Voice Mail Notification.
  5429  *  Determines the size of the encoded Voice Mail Notification.
  5459  *  
  5430  *  
  5463  *  
  5434  *  
  5464  *  @capability None
  5435  *  @capability None
  5465  */
  5436  */
  5466 TUint8 CVoiceMailNotification::SizeL(CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs)
  5437 TUint8 CVoiceMailNotification::SizeL(CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs)
  5467 	{
  5438 	{
  5468 	LOGGSMU1("CVoiceMailNotification::SizeL()");
  5439 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CVOICEMAILNOTIFICATION_SIZEL_1, "CVoiceMailNotification::SizeL()");
  5469 
  5440 
  5470 	const TUint8 KTotalSizeOfFixedLengthAttributes = 4;
  5441 	const TUint8 KTotalSizeOfFixedLengthAttributes = 4;
  5471 	TUint8 size = KTotalSizeOfFixedLengthAttributes;
  5442 	TUint8 size = KTotalSizeOfFixedLengthAttributes;
  5472 
  5443 
  5473 	// need to find the size of the calling line ID.
  5444 	// need to find the size of the calling line ID.
  5492 TUint8* CVoiceMailNotification::EncodeL(TUint8* aPtr, CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs) const
  5463 TUint8* CVoiceMailNotification::EncodeL(TUint8* aPtr, CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs) const
  5493 	{
  5464 	{
  5494 	// When changes are made to this function that affect the
  5465 	// When changes are made to this function that affect the
  5495 	// number of bytes that are encoded, this should be reflected in
  5466 	// number of bytes that are encoded, this should be reflected in
  5496 	// CVoiceMailNotification::SizeL()
  5467 	// CVoiceMailNotification::SizeL()
  5497 	LOGGSMU1("CVoiceMailNotification::EncodeL");
  5468 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CVOICEMAILNOTIFICATION_ENCODEL_1, "CVoiceMailNotification::EncodeL");
  5498 
  5469 
  5499 
  5470 
  5500 	*aPtr =   (TUint8)  (iMessageId                         >> 8);  // Message Id MSB
  5471 	*aPtr =   (TUint8)  (iMessageId                         >> 8);  // Message Id MSB
  5501 	aPtr++;
  5472 	aPtr++;
  5502 	*aPtr =   (TUint8)   iMessageId;                                // Message Id LSB
  5473 	*aPtr =   (TUint8)   iMessageId;                                // Message Id LSB
  5526 	} // CVoiceMailNotification::EncodeL
  5497 	} // CVoiceMailNotification::EncodeL
  5527 
  5498 
  5528 
  5499 
  5529 void CVoiceMailNotification::DecodeL(TGsmuLex8& aVoiceMailInfo, CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs)
  5500 void CVoiceMailNotification::DecodeL(TGsmuLex8& aVoiceMailInfo, CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs)
  5530 	{
  5501 	{
  5531 	LOGGSMU1("CVoiceMailNotification::DecodeL");
  5502 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CVOICEMAILNOTIFICATION_DECODEL_1, "CVoiceMailNotification::DecodeL");
  5532 
  5503 
  5533 	iMessageId = (((TUint16) aVoiceMailInfo.GetL()) << 8);
  5504 	iMessageId = (((TUint16) aVoiceMailInfo.GetL()) << 8);
  5534 	iMessageId += ((TUint16) aVoiceMailInfo.GetL());
  5505 	iMessageId += ((TUint16) aVoiceMailInfo.GetL());
  5535 
  5506 
  5536 	iMessageLength=aVoiceMailInfo.GetL();
  5507 	iMessageLength=aVoiceMailInfo.GetL();
  5597  */
  5568  */
  5598 CVoiceMailNotification::CVoiceMailNotification(const CVoiceMailNotification&)
  5569 CVoiceMailNotification::CVoiceMailNotification(const CVoiceMailNotification&)
  5599     {
  5570     {
  5600     // Ignore in code coverage - not intended to be used
  5571     // Ignore in code coverage - not intended to be used
  5601     BULLSEYE_OFF    
  5572     BULLSEYE_OFF    
  5602     LOGGSMU1("CVoiceMailNotification::CVoiceMailNotification");
  5573     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CVOICEMAILNOTIFICATION_CTOR_1, "CVoiceMailNotification::CVoiceMailNotification");
  5603     Panic(KGsmuPanicMethodBodyNotImplemented);
  5574     Panic(KGsmuPanicMethodBodyNotImplemented);
  5604     BULLSEYE_RESTORE
  5575     BULLSEYE_RESTORE
  5605     }
  5576     }
  5606 
  5577 
  5607 /**
  5578 /**
  5614  */
  5585  */
  5615 TBool CVoiceMailNotification::operator==(const CVoiceMailNotification&)
  5586 TBool CVoiceMailNotification::operator==(const CVoiceMailNotification&)
  5616     {
  5587     {
  5617     // Ignore in code coverage - not intended to be used
  5588     // Ignore in code coverage - not intended to be used
  5618     BULLSEYE_OFF    
  5589     BULLSEYE_OFF    
  5619     LOGGSMU1("CVoiceMailNotification::operator==");
  5590     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CVOICEMAILNOTIFICATION_OPERATOR_1, "CVoiceMailNotification::operator==");
  5620     Panic(KGsmuPanicMethodBodyNotImplemented);
  5591     Panic(KGsmuPanicMethodBodyNotImplemented);
  5621     return EFalse;
  5592     return EFalse;
  5622     BULLSEYE_RESTORE
  5593     BULLSEYE_RESTORE
  5623     }
  5594     }
  5624 
  5595 
  5632  */
  5603  */
  5633 void CVoiceMailNotification::operator=(const CVoiceMailNotification&)
  5604 void CVoiceMailNotification::operator=(const CVoiceMailNotification&)
  5634     {
  5605     {
  5635     // Ignore in code coverage - not intended to be used
  5606     // Ignore in code coverage - not intended to be used
  5636     BULLSEYE_OFF    
  5607     BULLSEYE_OFF    
  5637     LOGGSMU1("CVoiceMailNotification::operator=");
  5608     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CVOICEMAILNOTIFICATION_OPERATOR1_1, "CVoiceMailNotification::operator=");
  5638     Panic(KGsmuPanicMethodBodyNotImplemented);
  5609     Panic(KGsmuPanicMethodBodyNotImplemented);
  5639     BULLSEYE_RESTORE
  5610     BULLSEYE_RESTORE
  5640     }
  5611     }
  5641 
  5612 
  5642 CVoiceMailNotification::CVoiceMailNotification()
  5613 CVoiceMailNotification::CVoiceMailNotification()
  5643 	{
  5614 	{
  5644 	LOGGSMU1("CVoiceMailNotification::CVoiceMailNotification()");
  5615 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CVOICEMAILNOTIFICATION_CTOR1_1, "CVoiceMailNotification::CVoiceMailNotification()");
  5645 
  5616 
  5646 	iMessageId                 = 0;
  5617 	iMessageId                 = 0;
  5647 	iMessageLength             = 0;
  5618 	iMessageLength             = 0;
  5648 	iRetentionDays             = 0;
  5619 	iRetentionDays             = 0;
  5649 	iOctetN8Bit1               = EFalse;
  5620 	iOctetN8Bit1               = EFalse;
  5660  *  
  5631  *  
  5661  *  @capability None
  5632  *  @capability None
  5662  */
  5633  */
  5663 EXPORT_C CVoiceMailNotification::~CVoiceMailNotification()
  5634 EXPORT_C CVoiceMailNotification::~CVoiceMailNotification()
  5664 	{
  5635 	{
  5665 	LOGGSMU1("CVoiceMailNotification::~CVoiceMailNotification");
  5636 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CVOICEMAILNOTIFICATION_DTOR_1, "CVoiceMailNotification::~CVoiceMailNotification");
  5666 	delete iCallingLineIdentity;
  5637 	delete iCallingLineIdentity;
  5667 	delete iExtension;
  5638 	delete iExtension;
  5668 	} // CVoiceMailNotification::CVoiceMailNotification
  5639 	} // CVoiceMailNotification::CVoiceMailNotification
  5669 
  5640 
  5670 
  5641 
  5671 void CVoiceMailNotification::ConstructL()
  5642 void CVoiceMailNotification::ConstructL()
  5672 	{
  5643 	{
  5673 	LOGGSMU1("CVoiceMailNotification::ConstructL()");
  5644 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CVOICEMAILNOTIFICATION_CONSTRUCTL_1, "CVoiceMailNotification::ConstructL()");
  5674 
  5645 
  5675 	NewBufferL(0);
  5646 	NewBufferL(0);
  5676 	NewExtensionL(0);
  5647 	NewExtensionL(0);
  5677 	} // CVoiceMailNotification::ConstructL
  5648 	} // CVoiceMailNotification::ConstructL
  5678 
  5649 
  5684  *  
  5655  *  
  5685  *  @capability None
  5656  *  @capability None
  5686  */
  5657  */
  5687 EXPORT_C CVoiceMailNotification* CVoiceMailNotification::NewL()
  5658 EXPORT_C CVoiceMailNotification* CVoiceMailNotification::NewL()
  5688 	{
  5659 	{
  5689 	LOGGSMU1("CVoiceMailNotification::NewL()");
  5660 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CVOICEMAILNOTIFICATION_NEWL_1, "CVoiceMailNotification::NewL()");
  5690 
  5661 
  5691 	CVoiceMailNotification* aCVoiceMailNotification=new(ELeave) CVoiceMailNotification();
  5662 	CVoiceMailNotification* aCVoiceMailNotification=new(ELeave) CVoiceMailNotification();
  5692 	CleanupStack::PushL(aCVoiceMailNotification);
  5663 	CleanupStack::PushL(aCVoiceMailNotification);
  5693 	aCVoiceMailNotification->ConstructL();
  5664 	aCVoiceMailNotification->ConstructL();
  5694 	CleanupStack::Pop(aCVoiceMailNotification);
  5665 	CleanupStack::Pop(aCVoiceMailNotification);
  5696 	} // CVoiceMailNotification::NewL
  5667 	} // CVoiceMailNotification::NewL
  5697 
  5668 
  5698 
  5669 
  5699 void CVoiceMailNotification::DoSetParsedAddressL(const TDesC& aAddress)
  5670 void CVoiceMailNotification::DoSetParsedAddressL(const TDesC& aAddress)
  5700 	{
  5671 	{
  5701 	LOGGSMU1("CVoiceMailNotification::DoSetParsedAddressL()");
  5672 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CVOICEMAILNOTIFICATION_DOSETPARSEDADDRESSL_1, "CVoiceMailNotification::DoSetParsedAddressL()");
  5702 
  5673 
  5703 	TInt length=aAddress.Length();
  5674 	TInt length=aAddress.Length();
  5704 	if ((iTypeOfAddress.TON()==EGsmSmsTONInternationalNumber) &&
  5675 	if ((iTypeOfAddress.TON()==EGsmSmsTONInternationalNumber) &&
  5705 	    (length && (aAddress[0]!='+')))
  5676 	    (length && (aAddress[0]!='+')))
  5706 		{
  5677 		{
  5728  *  
  5699  *  
  5729  *  @capability None
  5700  *  @capability None
  5730  */
  5701  */
  5731 EXPORT_C TUint8 CEnhancedVoiceMailNotification::NumberOfVoiceMails()
  5702 EXPORT_C TUint8 CEnhancedVoiceMailNotification::NumberOfVoiceMails()
  5732 	{
  5703 	{
  5733 	LOGGSMU1("CEnhancedVoiceMailNotification::NumberOfVoiceMails()");
  5704 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CENHANCEDVOICEMAILNOTIFICATION_NUMBEROFVOICEMAILS_1, "CEnhancedVoiceMailNotification::NumberOfVoiceMails()");
  5734 
  5705 
  5735 	return (TUint8) iNotifications->Count();
  5706 	return (TUint8) iNotifications->Count();
  5736 	} // CEnhancedVoiceMailNotification::NumberOfVoiceMails
  5707 	} // CEnhancedVoiceMailNotification::NumberOfVoiceMails
  5737 
       
  5738 
       
  5739 /*void CEnhancedVoiceMailNotification::SetExtension(TDesC& aExtension)
       
  5740 	{
       
  5741 	LOGGSMU1("CEnhancedVoiceMailNotification::SetExtension()");
       
  5742 
       
  5743 	TInt length=aExtension.Length();
       
  5744 	NewExtensionL(length);
       
  5745 	iExtension->Des().Copy(aExtension);
       
  5746 	} // CEnhancedVoiceMailNotification::SetExtension
       
  5747 
       
  5748 TPtrC CEnhancedVoiceMailNotification::Extension() const
       
  5749 	{
       
  5750 	LOGGSMU1("CEnhancedVoiceMailNotification::Extension()");
       
  5751 
       
  5752 	TPtrC ptr;
       
  5753 	if (iExtension)
       
  5754 	    ptr.Set(iExtension->Des());
       
  5755 	return ptr;
       
  5756 	}*/
       
  5757 
  5708 
  5758 
  5709 
  5759 /**
  5710 /**
  5760  *  @publishedAll
  5711  *  @publishedAll
  5761  *  
  5712  *  
  5769  *  
  5720  *  
  5770  *  @capability None
  5721  *  @capability None
  5771  */
  5722  */
  5772 EXPORT_C RPointerArray<CVoiceMailNotification>& CEnhancedVoiceMailNotification::GetVoiceMailNotifications()
  5723 EXPORT_C RPointerArray<CVoiceMailNotification>& CEnhancedVoiceMailNotification::GetVoiceMailNotifications()
  5773 	{
  5724 	{
  5774 	LOGGSMU1("CEnhancedVoiceMailNotification::GetVoiceMailNotifications()");
  5725 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CENHANCEDVOICEMAILNOTIFICATION_GETVOICEMAILNOTIFICATIONS_1, "CEnhancedVoiceMailNotification::GetVoiceMailNotifications()");
  5775 
  5726 
  5776 	return *iNotifications;
  5727 	return *iNotifications;
  5777 	} // CEnhancedVoiceMailNotification::GetVoiceMailNotifications
  5728 	} // CEnhancedVoiceMailNotification::GetVoiceMailNotifications
  5778 
  5729 
  5779 
  5730 
  5780 void CEnhancedVoiceMailNotification::NewExtensionL(TInt aLength)
  5731 void CEnhancedVoiceMailNotification::NewExtensionL(TInt aLength)
  5781 	{
  5732 	{
  5782 	LOGGSMU1("CEnhancedVoiceMailNotification::NewExtensionL()");
  5733 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CENHANCEDVOICEMAILNOTIFICATION_NEWEXTENSIONL_1, "CEnhancedVoiceMailNotification::NewExtensionL()");
  5783 
  5734 
  5784 	HBufC* buffer=HBufC::NewL(aLength);
  5735 	HBufC* buffer=HBufC::NewL(aLength);
  5785 	delete iExtension;
  5736 	delete iExtension;
  5786 	iExtension=buffer;
  5737 	iExtension=buffer;
  5787 	iExtension->Des().SetLength(aLength);
  5738 	iExtension->Des().SetLength(aLength);
  5796  *  
  5747  *  
  5797  *  @capability None
  5748  *  @capability None
  5798  */
  5749  */
  5799 EXPORT_C  CEnhancedVoiceMailNotification* CEnhancedVoiceMailNotification::NewL()
  5750 EXPORT_C  CEnhancedVoiceMailNotification* CEnhancedVoiceMailNotification::NewL()
  5800 	{
  5751 	{
  5801 	LOGGSMU1("CEnhancedVoiceMailNotification::NewL()");
  5752 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CENHANCEDVOICEMAILNOTIFICATION_NEWL_1, "CEnhancedVoiceMailNotification::NewL()");
  5802 
  5753 
  5803 	CEnhancedVoiceMailNotification* aCEnhancedVoiceMailNotification=new(ELeave) CEnhancedVoiceMailNotification();
  5754 	CEnhancedVoiceMailNotification* aCEnhancedVoiceMailNotification=new(ELeave) CEnhancedVoiceMailNotification();
  5804 	CleanupStack::PushL(aCEnhancedVoiceMailNotification);
  5755 	CleanupStack::PushL(aCEnhancedVoiceMailNotification);
  5805 	aCEnhancedVoiceMailNotification->CEnhancedVoiceMailBoxInformation::ConstructL();
  5756 	aCEnhancedVoiceMailNotification->CEnhancedVoiceMailBoxInformation::ConstructL();
  5806 	aCEnhancedVoiceMailNotification->ConstructL();
  5757 	aCEnhancedVoiceMailNotification->ConstructL();
  5824  */
  5775  */
  5825 CEnhancedVoiceMailNotification::CEnhancedVoiceMailNotification(const CEnhancedVoiceMailNotification&)
  5776 CEnhancedVoiceMailNotification::CEnhancedVoiceMailNotification(const CEnhancedVoiceMailNotification&)
  5826     {
  5777     {
  5827     // Ignore in code coverage - not intended to be used
  5778     // Ignore in code coverage - not intended to be used
  5828     BULLSEYE_OFF    
  5779     BULLSEYE_OFF    
  5829     LOGGSMU1("CEnhancedVoiceMailNotification::CEnhancedVoiceMailNotification");
  5780     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CENHANCEDVOICEMAILNOTIFICATION_CTOR1_1, "CEnhancedVoiceMailNotification::CEnhancedVoiceMailNotification");
  5830     Panic(KGsmuPanicMethodBodyNotImplemented);
  5781     Panic(KGsmuPanicMethodBodyNotImplemented);
  5831     BULLSEYE_RESTORE
  5782     BULLSEYE_RESTORE
  5832     }
  5783     }
  5833 
  5784 
  5834 /**
  5785 /**
  5841  */
  5792  */
  5842 TBool CEnhancedVoiceMailNotification::operator==(const CEnhancedVoiceMailNotification&)
  5793 TBool CEnhancedVoiceMailNotification::operator==(const CEnhancedVoiceMailNotification&)
  5843     {
  5794     {
  5844     // Ignore in code coverage - not intended to be used
  5795     // Ignore in code coverage - not intended to be used
  5845     BULLSEYE_OFF    
  5796     BULLSEYE_OFF    
  5846     LOGGSMU1("CEnhancedVoiceMailNotification::operator==");
  5797     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CENHANCEDVOICEMAILNOTIFICATION_OPERATOR_1, "CEnhancedVoiceMailNotification::operator==");
  5847     Panic(KGsmuPanicMethodBodyNotImplemented);
  5798     Panic(KGsmuPanicMethodBodyNotImplemented);
  5848     return EFalse;
  5799     return EFalse;
  5849     BULLSEYE_RESTORE
  5800     BULLSEYE_RESTORE
  5850     }
  5801     }
  5851 
  5802 
  5859  */
  5810  */
  5860 void CEnhancedVoiceMailNotification::operator=(const CEnhancedVoiceMailNotification&)
  5811 void CEnhancedVoiceMailNotification::operator=(const CEnhancedVoiceMailNotification&)
  5861     {
  5812     {
  5862     // Ignore in code coverage - not intended to be used
  5813     // Ignore in code coverage - not intended to be used
  5863     BULLSEYE_OFF    
  5814     BULLSEYE_OFF    
  5864     LOGGSMU1("CEnhancedVoiceMailNotification::operator=");
  5815     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CENHANCEDVOICEMAILNOTIFICATION_OPERATOR1_1, "CEnhancedVoiceMailNotification::operator=");
  5865     Panic(KGsmuPanicMethodBodyNotImplemented);
  5816     Panic(KGsmuPanicMethodBodyNotImplemented);
  5866     BULLSEYE_RESTORE
  5817     BULLSEYE_RESTORE
  5867     }
  5818     }
  5868 
  5819 
  5869 /**
  5820 /**
  5873  *  
  5824  *  
  5874  *  @capability None
  5825  *  @capability None
  5875  */
  5826  */
  5876 EXPORT_C  CEnhancedVoiceMailNotification::~CEnhancedVoiceMailNotification()
  5827 EXPORT_C  CEnhancedVoiceMailNotification::~CEnhancedVoiceMailNotification()
  5877 	{
  5828 	{
  5878 	LOGGSMU1("CEnhancedVoiceMailNotification::~CEnhancedVoiceMailNotification");
  5829 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CENHANCEDVOICEMAILNOTIFICATION_DTOR_1, "CEnhancedVoiceMailNotification::~CEnhancedVoiceMailNotification");
  5879 	delete iExtension;
  5830 	delete iExtension;
  5880 	iNotifications->ResetAndDestroy();
  5831 	iNotifications->ResetAndDestroy();
  5881 	iNotifications->Close();
  5832 	iNotifications->Close();
  5882 	delete iNotifications;
  5833 	delete iNotifications;
  5883 	} // CEnhancedVoiceMailNotification::operator
  5834 	} // CEnhancedVoiceMailNotification::operator
  5884 
  5835 
  5885 
  5836 
  5886 void CEnhancedVoiceMailNotification::ConstructL()
  5837 void CEnhancedVoiceMailNotification::ConstructL()
  5887 	{
  5838 	{
  5888 	LOGGSMU1("CEnhancedVoiceMailNotification::ConstructL()");
  5839 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CENHANCEDVOICEMAILNOTIFICATION_CONSTRUCTL_1, "CEnhancedVoiceMailNotification::ConstructL()");
  5889 
  5840 
  5890 	NewExtensionL(0);
  5841 	NewExtensionL(0);
  5891 	iNotifications = new (ELeave) RPointerArray<CVoiceMailNotification>(KMaxNumberOfNotifications);
  5842 	iNotifications = new (ELeave) RPointerArray<CVoiceMailNotification>(KMaxNumberOfNotifications);
  5892 	} // CEnhancedVoiceMailNotification::ConstructL
  5843 	} // CEnhancedVoiceMailNotification::ConstructL
  5893 
  5844 
  5894 
  5845 
  5895 TUint8* CEnhancedVoiceMailNotification::EncodeL(TUint8* aCurrentPtr, CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs) const
  5846 TUint8* CEnhancedVoiceMailNotification::EncodeL(TUint8* aCurrentPtr, CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs) const
  5896 	{
  5847 	{
  5897 	LOGGSMU1("CEnhancedVoiceMailNotification::EncodeL");
  5848 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CENHANCEDVOICEMAILNOTIFICATION_ENCODEL_1, "CEnhancedVoiceMailNotification::EncodeL");
  5898 
  5849 
  5899 	TUint8* startPtr   = aCurrentPtr;
  5850 	TUint8* startPtr   = aCurrentPtr;
  5900 
  5851 
  5901 	aCurrentPtr = CEnhancedVoiceMailBoxInformation::EncodeL(aCurrentPtr, aCharacterSetConverter, aFs);
  5852 	aCurrentPtr = CEnhancedVoiceMailBoxInformation::EncodeL(aCurrentPtr, aCharacterSetConverter, aFs);
  5902 
  5853 
  5928 	} // CEnhancedVoiceMailNotification::EncodeL
  5879 	} // CEnhancedVoiceMailNotification::EncodeL
  5929 
  5880 
  5930 
  5881 
  5931 void CEnhancedVoiceMailNotification::DecodeL(TGsmuLex8& aVoiceMailInfo, CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs)
  5882 void CEnhancedVoiceMailNotification::DecodeL(TGsmuLex8& aVoiceMailInfo, CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs)
  5932 	{
  5883 	{
  5933 	LOGGSMU1("CEnhancedVoiceMailNotification::DecodeL");
  5884 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CENHANCEDVOICEMAILNOTIFICATION_DECODEL_1, "CEnhancedVoiceMailNotification::DecodeL");
  5934 
  5885 
  5935 	CEnhancedVoiceMailBoxInformation::DecodeL(aVoiceMailInfo, aCharacterSetConverter, aFs);
  5886 	CEnhancedVoiceMailBoxInformation::DecodeL(aVoiceMailInfo, aCharacterSetConverter, aFs);
  5936 
  5887 
  5937 	TUint8 numberOfNotifications = (aVoiceMailInfo.GetL() & KSmsNotificationBitMask);
  5888 	TUint8 numberOfNotifications = (aVoiceMailInfo.GetL() & KSmsNotificationBitMask);
  5938 
  5889 
  5965  *  
  5916  *  
  5966  *  @capability None
  5917  *  @capability None
  5967  */
  5918  */
  5968 EXPORT_C void CVoiceMailDeletion::SetMessageId(TUint16 aMessageId)
  5919 EXPORT_C void CVoiceMailDeletion::SetMessageId(TUint16 aMessageId)
  5969 	{
  5920 	{
  5970 	LOGGSMU1("CVoiceMailDeletion::SetMessageId()");
  5921 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CVOICEMAILDELETION_SETMESSAGEID_1, "CVoiceMailDeletion::SetMessageId()");
  5971 
  5922 
  5972 	iMessageId=aMessageId;
  5923 	iMessageId=aMessageId;
  5973 	} // CVoiceMailDeletion::SetMessageId
  5924 	} // CVoiceMailDeletion::SetMessageId
  5974 
  5925 
  5975 
  5926 
  5985  *  
  5936  *  
  5986  *  @capability None
  5937  *  @capability None
  5987  */
  5938  */
  5988 EXPORT_C TUint16 CVoiceMailDeletion::MessageId() const
  5939 EXPORT_C TUint16 CVoiceMailDeletion::MessageId() const
  5989 	{
  5940 	{
  5990 	LOGGSMU1("CVoiceMailDeletion::MessageId()");
  5941 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CVOICEMAILDELETION_MESSAGEID_1, "CVoiceMailDeletion::MessageId()");
  5991 
  5942 
  5992 	return iMessageId;
  5943 	return iMessageId;
  5993 	} // CVoiceMailDeletion::MessageId
  5944 	} // CVoiceMailDeletion::MessageId
  5994 
  5945 
  5995 
  5946 
  6004  *  
  5955  *  
  6005  *  @capability None
  5956  *  @capability None
  6006  */
  5957  */
  6007 EXPORT_C TBool CVoiceMailDeletion::MessageExtensionIndication() const
  5958 EXPORT_C TBool CVoiceMailDeletion::MessageExtensionIndication() const
  6008 	{
  5959 	{
  6009 	LOGGSMU1("CVoiceMailDeletion::MessageExtensionIndication()");
  5960 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CVOICEMAILDELETION_MESSAGEEXTENSIONINDICATION_1, "CVoiceMailDeletion::MessageExtensionIndication()");
  6010 
  5961 
  6011 	return iExtensionIndicator;
  5962 	return iExtensionIndicator;
  6012 	} // CVoiceMailDeletion::MessageExtensionIndication
  5963 	} // CVoiceMailDeletion::MessageExtensionIndication
  6013 
  5964 
  6014 
  5965 
  6015 TUint8 CVoiceMailDeletion::SizeL()
  5966 TUint8 CVoiceMailDeletion::SizeL()
  6016 	{
  5967 	{
  6017 	LOGGSMU1("CVoiceMailDeletion::SizeL()");
  5968 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CVOICEMAILDELETION_SIZEL_1, "CVoiceMailDeletion::SizeL()");
  6018 
  5969 
  6019 	const TUint8 KSizeOfVoiceMailDeletion = 3;
  5970 	const TUint8 KSizeOfVoiceMailDeletion = 3;
  6020 	return KSizeOfVoiceMailDeletion;
  5971 	return KSizeOfVoiceMailDeletion;
  6021 	} // CVoiceMailDeletion::SizeL
  5972 	} // CVoiceMailDeletion::SizeL
  6022 
  5973 
  6024 TUint8* CVoiceMailDeletion::EncodeL(TUint8* aPtr) const
  5975 TUint8* CVoiceMailDeletion::EncodeL(TUint8* aPtr) const
  6025 	{
  5976 	{
  6026 	// When changes are made which affect the
  5977 	// When changes are made which affect the
  6027 	// number of bytes encoded, this should be
  5978 	// number of bytes encoded, this should be
  6028 	// reflected in VoiceMailDeletion::SizeL()
  5979 	// reflected in VoiceMailDeletion::SizeL()
  6029 	LOGGSMU1("CVoiceMailDeletion::EncodeL");
  5980 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CVOICEMAILDELETION_ENCODEL_1, "CVoiceMailDeletion::EncodeL");
  6030 
  5981 
  6031 	*aPtr =  (TUint8) (iMessageId >> 8);
  5982 	*aPtr =  (TUint8) (iMessageId >> 8);
  6032 	aPtr++;
  5983 	aPtr++;
  6033 	*aPtr =  (TUint8) iMessageId;
  5984 	*aPtr =  (TUint8) iMessageId;
  6034 	aPtr++;
  5985 	aPtr++;
  6038 	} // CVoiceMailDeletion::EncodeL
  5989 	} // CVoiceMailDeletion::EncodeL
  6039 
  5990 
  6040 
  5991 
  6041 void CVoiceMailDeletion::DecodeL(TGsmuLex8& aVoiceMailInfo)
  5992 void CVoiceMailDeletion::DecodeL(TGsmuLex8& aVoiceMailInfo)
  6042 	{
  5993 	{
  6043 	LOGGSMU1("CVoiceMailDeletion::DecodeL");
  5994 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CVOICEMAILDELETION_DECODEL_1, "CVoiceMailDeletion::DecodeL");
  6044 
  5995 
  6045 	iMessageId = (((TUint16) aVoiceMailInfo.GetL()) << 8) +
  5996 	iMessageId = (((TUint16) aVoiceMailInfo.GetL()) << 8) +
  6046 	              ((TUint16) aVoiceMailInfo.GetL());
  5997 	              ((TUint16) aVoiceMailInfo.GetL());
  6047 	iExtensionIndicator =    (aVoiceMailInfo.GetL() >> 7);
  5998 	iExtensionIndicator =    (aVoiceMailInfo.GetL() >> 7);
  6048 
  5999 
  6071  */
  6022  */
  6072 CVoiceMailDeletion::CVoiceMailDeletion(const CVoiceMailDeletion&)
  6023 CVoiceMailDeletion::CVoiceMailDeletion(const CVoiceMailDeletion&)
  6073     {
  6024     {
  6074     // Ignore in code coverage - not intended to be used
  6025     // Ignore in code coverage - not intended to be used
  6075     BULLSEYE_OFF    
  6026     BULLSEYE_OFF    
  6076     LOGGSMU1("CVoiceMailDeletion::CVoiceMailDeletion");
  6027     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CVOICEMAILDELETION_CTOR1_1, "CVoiceMailDeletion::CVoiceMailDeletion");
  6077     Panic(KGsmuPanicMethodBodyNotImplemented);
  6028     Panic(KGsmuPanicMethodBodyNotImplemented);
  6078     BULLSEYE_RESTORE
  6029     BULLSEYE_RESTORE
  6079     }
  6030     }
  6080 
  6031 
  6081 /**
  6032 /**
  6088  */
  6039  */
  6089 TBool CVoiceMailDeletion::operator==(const CVoiceMailDeletion&)
  6040 TBool CVoiceMailDeletion::operator==(const CVoiceMailDeletion&)
  6090     {
  6041     {
  6091     // Ignore in code coverage - not intended to be used
  6042     // Ignore in code coverage - not intended to be used
  6092     BULLSEYE_OFF    
  6043     BULLSEYE_OFF    
  6093     LOGGSMU1("CVoiceMailDeletion::operator==");
  6044     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CVOICEMAILDELETION_OPERATOR_1, "CVoiceMailDeletion::operator==");
  6094     Panic(KGsmuPanicMethodBodyNotImplemented);
  6045     Panic(KGsmuPanicMethodBodyNotImplemented);
  6095     return EFalse;
  6046     return EFalse;
  6096     BULLSEYE_RESTORE
  6047     BULLSEYE_RESTORE
  6097     }
  6048     }
  6098 
  6049 
  6106  */
  6057  */
  6107 void CVoiceMailDeletion::operator=(const CVoiceMailDeletion&)
  6058 void CVoiceMailDeletion::operator=(const CVoiceMailDeletion&)
  6108     {
  6059     {
  6109     // Ignore in code coverage - not intended to be used
  6060     // Ignore in code coverage - not intended to be used
  6110     BULLSEYE_OFF    
  6061     BULLSEYE_OFF    
  6111     LOGGSMU1("CVoiceMailDeletion::operator=");
  6062     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CVOICEMAILDELETION_OPERATOR1_1, "CVoiceMailDeletion::operator=");
  6112     Panic(KGsmuPanicMethodBodyNotImplemented);
  6063     Panic(KGsmuPanicMethodBodyNotImplemented);
  6113     BULLSEYE_RESTORE
  6064     BULLSEYE_RESTORE
  6114     }
  6065     }
  6115 
  6066 
  6116 /**
  6067 /**
  6120  *  
  6071  *  
  6121  *  @capability None
  6072  *  @capability None
  6122  */
  6073  */
  6123 EXPORT_C CVoiceMailDeletion::~CVoiceMailDeletion()
  6074 EXPORT_C CVoiceMailDeletion::~CVoiceMailDeletion()
  6124 	{
  6075 	{
  6125 	LOGGSMU1("CVoiceMailDeletion::~CVoiceMailDeletion");
  6076 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CVOICEMAILDELETION_DTOR_1, "CVoiceMailDeletion::~CVoiceMailDeletion");
  6126 
  6077 
  6127 	delete iExtension;
  6078 	delete iExtension;
  6128 	} // CVoiceMailDeletion::operator
  6079 	} // CVoiceMailDeletion::operator
  6129 
  6080 
  6130 
  6081 
  6131 void CVoiceMailDeletion::ConstructL()
  6082 void CVoiceMailDeletion::ConstructL()
  6132 	{
  6083 	{
  6133 	LOGGSMU1("CVoiceMailDeletion::ConstructL()");
  6084 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CVOICEMAILDELETION_CONSTRUCTL_1, "CVoiceMailDeletion::ConstructL()");
  6134 
  6085 
  6135 	NewBufferL(0);
  6086 	NewBufferL(0);
  6136 	} // CVoiceMailDeletion::ConstructL
  6087 	} // CVoiceMailDeletion::ConstructL
  6137 
  6088 
  6138 
  6089 
  6139 void CVoiceMailDeletion::NewBufferL(TInt aLength)
  6090 void CVoiceMailDeletion::NewBufferL(TInt aLength)
  6140 	{
  6091 	{
  6141 	LOGGSMU1("CVoiceMailDeletion::NewBufferL()");
  6092 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CVOICEMAILDELETION_NEWBUFFERL_1, "CVoiceMailDeletion::NewBufferL()");
  6142 
  6093 
  6143 	HBufC* buffer=HBufC::NewL(aLength);
  6094 	HBufC* buffer=HBufC::NewL(aLength);
  6144 	delete iExtension;
  6095 	delete iExtension;
  6145 	iExtension=buffer;
  6096 	iExtension=buffer;
  6146 	iExtension->Des().SetLength(aLength);
  6097 	iExtension->Des().SetLength(aLength);
  6155  *  
  6106  *  
  6156  *  @capability None
  6107  *  @capability None
  6157  */
  6108  */
  6158 EXPORT_C CVoiceMailDeletion* CVoiceMailDeletion::NewL()
  6109 EXPORT_C CVoiceMailDeletion* CVoiceMailDeletion::NewL()
  6159 	{
  6110 	{
  6160 	LOGGSMU1("CVoiceMailDeletion::NewL()");
  6111 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CVOICEMAILDELETION_NEWL_1, "CVoiceMailDeletion::NewL()");
  6161 
  6112 
  6162 	CVoiceMailDeletion* voiceMailDeletion=new(ELeave) CVoiceMailDeletion();
  6113 	CVoiceMailDeletion* voiceMailDeletion=new(ELeave) CVoiceMailDeletion();
  6163 	CleanupStack::PushL(voiceMailDeletion);
  6114 	CleanupStack::PushL(voiceMailDeletion);
  6164 	voiceMailDeletion->ConstructL();
  6115 	voiceMailDeletion->ConstructL();
  6165 	CleanupStack::Pop(voiceMailDeletion);
  6116 	CleanupStack::Pop(voiceMailDeletion);
  6166 	return voiceMailDeletion;
  6117 	return voiceMailDeletion;
  6167 	} // CVoiceMailDeletion::NewL
  6118 	} // CVoiceMailDeletion::NewL
  6168 
  6119 
  6169 
  6120 
  6170 /*
       
  6171 void CVoiceMailDeletion::SetExtension(TDesC& aExtension)
       
  6172 	{
       
  6173 	LOGGSMU1("CVoiceMailDeletion::SetExtension()");
       
  6174 
       
  6175 	TInt length=aExtension.Length();
       
  6176 	NewBufferL(length);
       
  6177 	iExtension->Des().Copy(aExtension);
       
  6178 	} // CVoiceMailDeletion::SetExtension
       
  6179 
       
  6180 
       
  6181 TPtrC CVoiceMailDeletion::Extension() const
       
  6182 	{
       
  6183 	LOGGSMU1("CVoiceMailDeletion::Extension()");
       
  6184 
       
  6185 	TPtrC ptr;
       
  6186 	if (iExtension)
       
  6187 	    ptr.Set(iExtension->Des());
       
  6188 	return ptr;
       
  6189 	}*/
       
  6190 
       
  6191 
       
  6192 void CEnhancedVoiceMailDeleteConfirmations::NewExtensionL(TInt aLength)
  6121 void CEnhancedVoiceMailDeleteConfirmations::NewExtensionL(TInt aLength)
  6193 	{
  6122 	{
  6194 	LOGGSMU1("CEnhancedVoiceMailDeleteConfirmations::NewExtensionL()");
  6123 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CENHANCEDVOICEMAILDELETECONFIRMATIONS_NEWEXTENSIONL_1, "CEnhancedVoiceMailDeleteConfirmations::NewExtensionL()");
  6195 
  6124 
  6196 	HBufC* buffer=HBufC::NewL(aLength);
  6125 	HBufC* buffer=HBufC::NewL(aLength);
  6197 	delete iExtension;
  6126 	delete iExtension;
  6198 	iExtension=buffer;
  6127 	iExtension=buffer;
  6199 	iExtension->Des().SetLength(aLength);
  6128 	iExtension->Des().SetLength(aLength);
  6214  *  
  6143  *  
  6215  *  @capability None
  6144  *  @capability None
  6216  */
  6145  */
  6217 EXPORT_C  CEnhancedVoiceMailDeleteConfirmations::~CEnhancedVoiceMailDeleteConfirmations()
  6146 EXPORT_C  CEnhancedVoiceMailDeleteConfirmations::~CEnhancedVoiceMailDeleteConfirmations()
  6218 	{
  6147 	{
  6219 	LOGGSMU1("CEnhancedVoiceMailDeleteConfirmations::~CEnhancedVoiceMailDeleteConfirmations");
  6148 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CENHANCEDVOICEMAILDELETECONFIRMATIONS_DTOR_1, "CEnhancedVoiceMailDeleteConfirmations::~CEnhancedVoiceMailDeleteConfirmations");
  6220 
  6149 
  6221 	delete iExtension;
  6150 	delete iExtension;
  6222 	iVoiceMailDeletions->ResetAndDestroy();
  6151 	iVoiceMailDeletions->ResetAndDestroy();
  6223 	iVoiceMailDeletions->Close();
  6152 	iVoiceMailDeletions->Close();
  6224 	delete iVoiceMailDeletions;
  6153 	delete iVoiceMailDeletions;
  6235  */
  6164  */
  6236 CEnhancedVoiceMailDeleteConfirmations::CEnhancedVoiceMailDeleteConfirmations(const CEnhancedVoiceMailDeleteConfirmations&)
  6165 CEnhancedVoiceMailDeleteConfirmations::CEnhancedVoiceMailDeleteConfirmations(const CEnhancedVoiceMailDeleteConfirmations&)
  6237     {
  6166     {
  6238     // Ignore in code coverage - not intended to be used
  6167     // Ignore in code coverage - not intended to be used
  6239     BULLSEYE_OFF    
  6168     BULLSEYE_OFF    
  6240     LOGGSMU1("CEnhancedVoiceMailDeleteConfirmations::CEnhancedVoiceMailDeleteConfirmations");
  6169     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CENHANCEDVOICEMAILDELETECONFIRMATIONS_CTOR1_1, "CEnhancedVoiceMailDeleteConfirmations::CEnhancedVoiceMailDeleteConfirmations");
  6241     Panic(KGsmuPanicMethodBodyNotImplemented);
  6170     Panic(KGsmuPanicMethodBodyNotImplemented);
  6242     BULLSEYE_RESTORE
  6171     BULLSEYE_RESTORE
  6243     }
  6172     }
  6244 
  6173 
  6245 /**
  6174 /**
  6252  */
  6181  */
  6253 TBool CEnhancedVoiceMailDeleteConfirmations::operator==(const CEnhancedVoiceMailDeleteConfirmations&)
  6182 TBool CEnhancedVoiceMailDeleteConfirmations::operator==(const CEnhancedVoiceMailDeleteConfirmations&)
  6254     {
  6183     {
  6255     // Ignore in code coverage - not intended to be used
  6184     // Ignore in code coverage - not intended to be used
  6256     BULLSEYE_OFF    
  6185     BULLSEYE_OFF    
  6257     LOGGSMU1("CEnhancedVoiceMailDeleteConfirmations::operator==");
  6186     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CENHANCEDVOICEMAILDELETECONFIRMATIONS_OPERATOR_1, "CEnhancedVoiceMailDeleteConfirmations::operator==");
  6258     Panic(KGsmuPanicMethodBodyNotImplemented);
  6187     Panic(KGsmuPanicMethodBodyNotImplemented);
  6259     return EFalse;
  6188     return EFalse;
  6260     BULLSEYE_RESTORE
  6189     BULLSEYE_RESTORE
  6261     }
  6190     }
  6262 
  6191 
  6270  */
  6199  */
  6271 void CEnhancedVoiceMailDeleteConfirmations::operator=(const CEnhancedVoiceMailDeleteConfirmations&)
  6200 void CEnhancedVoiceMailDeleteConfirmations::operator=(const CEnhancedVoiceMailDeleteConfirmations&)
  6272     {
  6201     {
  6273     // Ignore in code coverage - not intended to be used
  6202     // Ignore in code coverage - not intended to be used
  6274     BULLSEYE_OFF    
  6203     BULLSEYE_OFF    
  6275     LOGGSMU1("CEnhancedVoiceMailDeleteConfirmations::operator=");
  6204     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CENHANCEDVOICEMAILDELETECONFIRMATIONS_OPERATOR1_1, "CEnhancedVoiceMailDeleteConfirmations::operator=");
  6276     Panic(KGsmuPanicMethodBodyNotImplemented);
  6205     Panic(KGsmuPanicMethodBodyNotImplemented);
  6277     BULLSEYE_RESTORE
  6206     BULLSEYE_RESTORE
  6278     }
  6207     }
  6279 
  6208 
  6280 void CEnhancedVoiceMailDeleteConfirmations::ConstructL()
  6209 void CEnhancedVoiceMailDeleteConfirmations::ConstructL()
  6281 	{
  6210 	{
  6282 	LOGGSMU1("CEnhancedVoiceMailDeleteConfirmations::ConstructL()");
  6211 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CENHANCEDVOICEMAILDELETECONFIRMATIONS_CONSTRUCTL_1, "CEnhancedVoiceMailDeleteConfirmations::ConstructL()");
  6283 
  6212 
  6284 	NewExtensionL(0);
  6213 	NewExtensionL(0);
  6285 
  6214 
  6286 	iVoiceMailDeletions = new (ELeave) RPointerArray<CVoiceMailDeletion>(15);
  6215 	iVoiceMailDeletions = new (ELeave) RPointerArray<CVoiceMailDeletion>(15);
  6287 	} // CEnhancedVoiceMailDeleteConfirmations::ConstructL
  6216 	} // CEnhancedVoiceMailDeleteConfirmations::ConstructL
  6294  *  
  6223  *  
  6295  *  @capability None
  6224  *  @capability None
  6296  */
  6225  */
  6297 EXPORT_C  CEnhancedVoiceMailDeleteConfirmations* CEnhancedVoiceMailDeleteConfirmations::NewL()
  6226 EXPORT_C  CEnhancedVoiceMailDeleteConfirmations* CEnhancedVoiceMailDeleteConfirmations::NewL()
  6298 	{
  6227 	{
  6299 	LOGGSMU1("CEnhancedVoiceMailDeleteConfirmations::NewL()");
  6228 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CENHANCEDVOICEMAILDELETECONFIRMATIONS_NEWL_1, "CEnhancedVoiceMailDeleteConfirmations::NewL()");
  6300 
  6229 
  6301 	CEnhancedVoiceMailDeleteConfirmations* aCEnhancedVoiceMailDeleteConfirmations=new(ELeave) CEnhancedVoiceMailDeleteConfirmations();
  6230 	CEnhancedVoiceMailDeleteConfirmations* aCEnhancedVoiceMailDeleteConfirmations=new(ELeave) CEnhancedVoiceMailDeleteConfirmations();
  6302 	CleanupStack::PushL(aCEnhancedVoiceMailDeleteConfirmations);
  6231 	CleanupStack::PushL(aCEnhancedVoiceMailDeleteConfirmations);
  6303 	aCEnhancedVoiceMailDeleteConfirmations->CEnhancedVoiceMailBoxInformation::ConstructL();
  6232 	aCEnhancedVoiceMailDeleteConfirmations->CEnhancedVoiceMailBoxInformation::ConstructL();
  6304 	aCEnhancedVoiceMailDeleteConfirmations->ConstructL();
  6233 	aCEnhancedVoiceMailDeleteConfirmations->ConstructL();
  6317  *  
  6246  *  
  6318  *  @capability None
  6247  *  @capability None
  6319  */
  6248  */
  6320 EXPORT_C TUint8  CEnhancedVoiceMailDeleteConfirmations::NumberOfDeletes()
  6249 EXPORT_C TUint8  CEnhancedVoiceMailDeleteConfirmations::NumberOfDeletes()
  6321 	{
  6250 	{
  6322 	LOGGSMU1("CEnhancedVoiceMailDeleteConfirmations::NumberOfDeletes()");
  6251 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CENHANCEDVOICEMAILDELETECONFIRMATIONS_NUMBEROFDELETES_1, "CEnhancedVoiceMailDeleteConfirmations::NumberOfDeletes()");
  6323 
  6252 
  6324 	return iVoiceMailDeletions->Count();
  6253 	return iVoiceMailDeletions->Count();
  6325 	} // CEnhancedVoiceMailDeleteConfirmations::NumberOfDeletes
  6254 	} // CEnhancedVoiceMailDeleteConfirmations::NumberOfDeletes
  6326 
  6255 
  6327 
  6256 
  6339  *  
  6268  *  
  6340  *  @capability None
  6269  *  @capability None
  6341  */
  6270  */
  6342 EXPORT_C RPointerArray<CVoiceMailDeletion>& CEnhancedVoiceMailDeleteConfirmations::GetVoiceMailDeletions()
  6271 EXPORT_C RPointerArray<CVoiceMailDeletion>& CEnhancedVoiceMailDeleteConfirmations::GetVoiceMailDeletions()
  6343 	{
  6272 	{
  6344 	LOGGSMU1("CEnhancedVoiceMailDeleteConfirmations::GetVoiceMailDeletions()");
  6273 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CENHANCEDVOICEMAILDELETECONFIRMATIONS_GETVOICEMAILDELETIONS_1, "CEnhancedVoiceMailDeleteConfirmations::GetVoiceMailDeletions()");
  6345 
  6274 
  6346 	return *iVoiceMailDeletions;
  6275 	return *iVoiceMailDeletions;
  6347 	} // CEnhancedVoiceMailDeleteConfirmations::GetVoiceMailDeletions
  6276 	} // CEnhancedVoiceMailDeleteConfirmations::GetVoiceMailDeletions
  6348 
  6277 
  6349 
  6278 
  6350 /*
       
  6351 void CEnhancedVoiceMailDeleteConfirmations::SetExtension(TDesC& aExtension)
       
  6352 	{
       
  6353 	LOGGSMU1("CEnhancedVoiceMailDeleteConfirmations::SetExtension()");
       
  6354 
       
  6355 	TInt length=aExtension.Length();
       
  6356 	NewBufferL(length);
       
  6357 	iExtension->Des().Copy(aExtension);
       
  6358 	} // CEnhancedVoiceMailDeleteConfirmations::SetExtension
       
  6359 
       
  6360 
       
  6361 TPtrC CEnhancedVoiceMailDeleteConfirmations::Extension() const
       
  6362 	{
       
  6363 	LOGGSMU1("CEnhancedVoiceMailDeleteConfirmations::Extension()");
       
  6364 
       
  6365 	TPtrC ptr;
       
  6366 	if (iExtension)
       
  6367 		{
       
  6368 		ptr.Set(iExtension->Des());
       
  6369 		}
       
  6370 	return ptr;
       
  6371 	}*/
       
  6372 
       
  6373 
       
  6374 TUint8* CEnhancedVoiceMailDeleteConfirmations::EncodeL(TUint8* aCurrentPtr, CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs) const
  6279 TUint8* CEnhancedVoiceMailDeleteConfirmations::EncodeL(TUint8* aCurrentPtr, CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs) const
  6375 	{
  6280 	{
  6376 	LOGGSMU1("CEnhancedVoiceMailDeleteConfirmations::EncodeL");
  6281 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CENHANCEDVOICEMAILDELETECONFIRMATIONS_ENCODEL_1, "CEnhancedVoiceMailDeleteConfirmations::EncodeL");
  6377 
  6282 
  6378 	TUint8* startPtr   = aCurrentPtr;
  6283 	TUint8* startPtr   = aCurrentPtr;
  6379 
  6284 
  6380 	aCurrentPtr = CEnhancedVoiceMailBoxInformation::EncodeL(aCurrentPtr, aCharacterSetConverter, aFs);
  6285 	aCurrentPtr = CEnhancedVoiceMailBoxInformation::EncodeL(aCurrentPtr, aCharacterSetConverter, aFs);
  6381 
  6286 
  6410 	} // CEnhancedVoiceMailDeleteConfirmations::EncodeL
  6315 	} // CEnhancedVoiceMailDeleteConfirmations::EncodeL
  6411 
  6316 
  6412 
  6317 
  6413 void CEnhancedVoiceMailDeleteConfirmations::DecodeL(TGsmuLex8& aVoiceMailInfo, CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs)
  6318 void CEnhancedVoiceMailDeleteConfirmations::DecodeL(TGsmuLex8& aVoiceMailInfo, CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs)
  6414 	{
  6319 	{
  6415 	LOGGSMU1("CEnhancedVoiceMailDeleteConfirmations::DecodeL");
  6320 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CENHANCEDVOICEMAILDELETECONFIRMATIONS_DECODEL_1, "CEnhancedVoiceMailDeleteConfirmations::DecodeL");
  6416 
  6321 
  6417 	CEnhancedVoiceMailBoxInformation::DecodeL(aVoiceMailInfo, aCharacterSetConverter, aFs);
  6322 	CEnhancedVoiceMailBoxInformation::DecodeL(aVoiceMailInfo, aCharacterSetConverter, aFs);
  6418 
  6323 
  6419 	TUint numberOfVMDeletions = (aVoiceMailInfo.GetL() & KSmsNotificationBitMask);
  6324 	TUint numberOfVMDeletions = (aVoiceMailInfo.GetL() & KSmsNotificationBitMask);
  6420 
  6325