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