238 CSmsInformationElement*& CSmsCommandData::InformationElementPtr(TInt aIndex) |
244 CSmsInformationElement*& CSmsCommandData::InformationElementPtr(TInt aIndex) |
239 { |
245 { |
240 // Ignore in code coverage - not used in SMS stack and not exported |
246 // Ignore in code coverage - not used in SMS stack and not exported |
241 // but cannot be removed as impacts public header. |
247 // but cannot be removed as impacts public header. |
242 BULLSEYE_OFF |
248 BULLSEYE_OFF |
243 LOGGSMU1("CSmsCommandData::InformationElementPtr()"); |
249 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSCOMMANDDATA_INFORMATIONELEMENTPTR_1, "CSmsCommandData::InformationElementPtr()"); |
244 return iInformationElementArray[aIndex]; |
250 return iInformationElementArray[aIndex]; |
245 BULLSEYE_RESTORE |
251 BULLSEYE_RESTORE |
246 } |
252 } |
247 |
253 |
248 TBool CSmsCommandData::InformationElementIndex(CSmsInformationElement::TSmsInformationElementIdentifier aIdentifier, |
254 TBool CSmsCommandData::InformationElementIndex(CSmsInformationElement::TSmsInformationElementIdentifier aIdentifier, |
249 TInt& aIndex) const |
255 TInt& aIndex) const |
250 { |
256 { |
251 LOGGSMU1("CSmsCommandData::InformationElementIndex()"); |
257 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSCOMMANDDATA_INFORMATIONELEMENTINDEX_1, "CSmsCommandData::InformationElementIndex()"); |
252 |
258 |
253 TBool found=EFalse; |
259 TBool found=EFalse; |
254 TInt count=NumInformationElements(); |
260 TInt count=NumInformationElements(); |
255 for (TInt i=0; (!found) && (i<count); i++) |
261 for (TInt i=0; (!found) && (i<count); i++) |
256 if (InformationElement(i).Identifier()==aIdentifier) |
262 if (InformationElement(i).Identifier()==aIdentifier) |
262 } // CSmsCommandData::InformationElementIndex |
268 } // CSmsCommandData::InformationElementIndex |
263 |
269 |
264 |
270 |
265 void CSmsCommandData::AddInformationElementL(const TSmsId aIdentifier,const TDesC8& aData) |
271 void CSmsCommandData::AddInformationElementL(const TSmsId aIdentifier,const TDesC8& aData) |
266 { |
272 { |
267 LOGGSMU1("CSmsCommandData::AddInformationElementL()"); |
273 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSCOMMANDDATA_ADDINFORMATIONELEMENTL_1, "CSmsCommandData::AddInformationElementL()"); |
268 |
274 |
269 // |
275 // |
270 // Currently there is no restriction on how many instances of an information element can be |
276 // Currently there is no restriction on how many instances of an information element can be |
271 // placed in the collection. |
277 // placed in the collection. |
272 // No restriction will be placed on the number of Special SMS Message Indications that can be |
278 // No restriction will be placed on the number of Special SMS Message Indications that can be |
282 } // CSmsCommandData::AddInformationElementL |
288 } // CSmsCommandData::AddInformationElementL |
283 |
289 |
284 |
290 |
285 void CSmsCommandData::RemoveInformationElement(TInt aIndex) |
291 void CSmsCommandData::RemoveInformationElement(TInt aIndex) |
286 { |
292 { |
287 LOGGSMU1("CSmsCommandData::RemoveInformationElement()"); |
293 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSCOMMANDDATA_REMOVEINFORMATIONELEMENT_1, "CSmsCommandData::RemoveInformationElement()"); |
288 // Since iInformationElementArray[aIndex] is removed from iInformationElementArray, no double free issue. |
294 // Since iInformationElementArray[aIndex] is removed from iInformationElementArray, no double free issue. |
289 // coverity[double_free] |
295 // coverity[double_free] |
290 delete iInformationElementArray[aIndex]; |
296 delete iInformationElementArray[aIndex]; |
291 iInformationElementArray[aIndex] = NULL; |
297 iInformationElementArray[aIndex] = NULL; |
292 iInformationElementArray.Delete(aIndex); |
298 iInformationElementArray.Delete(aIndex); |
298 } // CSmsCommandData::RemoveInformationElement |
304 } // CSmsCommandData::RemoveInformationElement |
299 |
305 |
300 |
306 |
301 TPtrC8 CSmsCommandData::Data() const |
307 TPtrC8 CSmsCommandData::Data() const |
302 { |
308 { |
303 LOGGSMU1("CSmsCommandData::Data()"); |
309 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSCOMMANDDATA_DATA_1, "CSmsCommandData::Data()"); |
304 |
310 |
305 TPtrC8 ptr; |
311 TPtrC8 ptr; |
306 ptr.Set(iBuffer->Des()); |
312 ptr.Set(iBuffer->Des()); |
307 return ptr; |
313 return ptr; |
308 } // CSmsCommandData::Data |
314 } // CSmsCommandData::Data |
309 |
315 |
310 |
316 |
311 void CSmsCommandData::SetDataL(const TDesC8& aData) |
317 void CSmsCommandData::SetDataL(const TDesC8& aData) |
312 { |
318 { |
313 LOGGSMU1("CSmsCommandData::SetDataL()"); |
319 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSCOMMANDDATA_SETDATAL_1, "CSmsCommandData::SetDataL()"); |
314 |
320 |
315 TInt length=aData.Length(); |
321 TInt length=aData.Length(); |
316 __ASSERT_DEBUG(length<=KSmsMaxDataSize,Panic(KGsmuPanicCommandDataLengthTooLong)); |
322 __ASSERT_DEBUG(length<=KSmsMaxDataSize,Panic(KGsmuPanicCommandDataLengthTooLong)); |
317 HBufC8* buffer=HBufC8::NewL(length); |
323 HBufC8* buffer=HBufC8::NewL(length); |
318 delete iBuffer; |
324 delete iBuffer; |
322 } // CSmsCommandData::SetDataL |
328 } // CSmsCommandData::SetDataL |
323 |
329 |
324 |
330 |
325 TUint8* CSmsCommandData::EncodeL(TUint8* aPtr) const |
331 TUint8* CSmsCommandData::EncodeL(TUint8* aPtr) const |
326 { |
332 { |
327 LOGGSMU1("CSmsCommandData::EncodeL()"); |
333 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSCOMMANDDATA_ENCODEL_1, "CSmsCommandData::EncodeL()"); |
328 |
334 |
329 __ASSERT_DEBUG(iBuffer->Length()<=MaxDataLength(),Panic(KGsmuPanicCommandDataBufferTooLong)); |
335 __ASSERT_DEBUG(iBuffer->Length()<=MaxDataLength(),Panic(KGsmuPanicCommandDataBufferTooLong)); |
330 TSmsOctet datalength=iBuffer->Length()+TSmsOctet(TotalHeaderLengthInUDLUnits()); |
336 TSmsOctet datalength=iBuffer->Length()+TSmsOctet(TotalHeaderLengthInUDLUnits()); |
331 aPtr=datalength.EncodeL(aPtr); |
337 aPtr=datalength.EncodeL(aPtr); |
332 TPtr8 ptr((TUint8*) aPtr,datalength); |
338 TPtr8 ptr((TUint8*) aPtr,datalength); |
415 } // CSmsCommandData::CSmsCommandData |
421 } // CSmsCommandData::CSmsCommandData |
416 |
422 |
417 |
423 |
418 TInt CSmsCommandData::HeaderLength() const |
424 TInt CSmsCommandData::HeaderLength() const |
419 { |
425 { |
420 LOGGSMU1("CSmsCommandData::HeaderLength()"); |
426 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSCOMMANDDATA_HEADERLENGTH_1, "CSmsCommandData::HeaderLength()"); |
421 |
427 |
422 TInt headerLength=0; |
428 TInt headerLength=0; |
423 for (TInt i=0; i<NumInformationElements(); i++) |
429 for (TInt i=0; i<NumInformationElements(); i++) |
424 headerLength+=iInformationElementArray[i]->Length(); |
430 headerLength+=iInformationElementArray[i]->Length(); |
425 return headerLength; |
431 return headerLength; |
426 } // CSmsCommandData::HeaderLength |
432 } // CSmsCommandData::HeaderLength |
427 |
433 |
428 |
434 |
429 TInt CSmsCommandData::TotalHeaderLengthInUDLUnits() const |
435 TInt CSmsCommandData::TotalHeaderLengthInUDLUnits() const |
430 { |
436 { |
431 LOGGSMU1("CSmsCommandData::TotalHeaderLengthInUDLUnits()"); |
437 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSCOMMANDDATA_TOTALHEADERLENGTHINUDLUNITS_1, "CSmsCommandData::TotalHeaderLengthInUDLUnits()"); |
432 |
438 |
433 if (iInformationElementArray.Count()==0) |
439 if (iInformationElementArray.Count()==0) |
434 return 0; |
440 return 0; |
435 else |
441 else |
436 return (HeaderLength()+1); // +1 stands for UDHL |
442 return (HeaderLength()+1); // +1 stands for UDHL |
437 } // CSmsCommandData::TotalHeaderLengthInUDLUnits |
443 } // CSmsCommandData::TotalHeaderLengthInUDLUnits |
438 |
444 |
439 |
445 |
440 TBool CSmsCommandData::HeaderPresent() const |
446 TBool CSmsCommandData::HeaderPresent() const |
441 { |
447 { |
442 LOGGSMU1("CSmsCommandData::HeaderPresent()"); |
448 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSCOMMANDDATA_HEADERPRESENT_1, "CSmsCommandData::HeaderPresent()"); |
443 |
449 |
444 return (iFirstOctet&TSmsFirstOctet::ESmsUDHIMask)==TSmsFirstOctet::ESmsUDHIHeaderPresent; |
450 return (iFirstOctet&TSmsFirstOctet::ESmsUDHIMask)==TSmsFirstOctet::ESmsUDHIHeaderPresent; |
445 } // CSmsCommandData::HeaderPresent |
451 } // CSmsCommandData::HeaderPresent |
446 |
452 |
447 |
453 |
448 void CSmsCommandData::SetHeaderPresent(TBool aHeaderPresent) |
454 void CSmsCommandData::SetHeaderPresent(TBool aHeaderPresent) |
449 { |
455 { |
450 LOGGSMU1("CSmsCommandData::SetHeaderPresent()"); |
456 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSCOMMANDDATA_SETHEADERPRESENT_1, "CSmsCommandData::SetHeaderPresent()"); |
451 |
457 |
452 iFirstOctet=aHeaderPresent? (iFirstOctet&(~TSmsFirstOctet::ESmsUDHIMask))|TSmsFirstOctet::ESmsUDHIHeaderPresent: (iFirstOctet&(~TSmsFirstOctet::ESmsUDHIMask))|TSmsFirstOctet::ESmsUDHIHeaderNotPresent; |
458 iFirstOctet=aHeaderPresent? (iFirstOctet&(~TSmsFirstOctet::ESmsUDHIMask))|TSmsFirstOctet::ESmsUDHIHeaderPresent: (iFirstOctet&(~TSmsFirstOctet::ESmsUDHIMask))|TSmsFirstOctet::ESmsUDHIHeaderNotPresent; |
453 } // CSmsCommandData::SetHeaderPresent |
459 } // CSmsCommandData::SetHeaderPresent |
454 |
460 |
455 |
461 |
478 } // TSmsProtocolIdentifier::TSmsTelematicDeviceIndicator |
484 } // TSmsProtocolIdentifier::TSmsTelematicDeviceIndicator |
479 |
485 |
480 |
486 |
481 void TSmsProtocolIdentifier::SetTelematicDeviceIndicator(TSmsTelematicDeviceIndicator aIndicator) |
487 void TSmsProtocolIdentifier::SetTelematicDeviceIndicator(TSmsTelematicDeviceIndicator aIndicator) |
482 { |
488 { |
483 LOGGSMU1("TSmsProtocolIdentifier::SetTelematicDeviceIndicator()"); |
489 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSPROTOCOLIDENTIFIER_SETTELEMATICDEVICEINDICATOR_1, "TSmsProtocolIdentifier::SetTelematicDeviceIndicator()"); |
484 |
490 |
485 __ASSERT_DEBUG(PIDType()==ESmsPIDTelematicInterworking,Panic(KGsmuPanicNoTelematicInterworking)); |
491 __ASSERT_DEBUG(PIDType()==ESmsPIDTelematicInterworking,Panic(KGsmuPanicNoTelematicInterworking)); |
486 |
492 |
487 //iValue=(TUint8) ((iValue&ESmsPIDTypeMask)|aIndicator); |
493 //iValue=(TUint8) ((iValue&ESmsPIDTypeMask)|aIndicator); |
488 iValue=(TUint8) ((iValue&(~EPIDTelematicDeviceIndicatorMask))|aIndicator); |
494 iValue=(TUint8) ((iValue&(~EPIDTelematicDeviceIndicatorMask))|aIndicator); |
496 } // TSmsProtocolIdentifier::TSmsTelematicDeviceType |
502 } // TSmsProtocolIdentifier::TSmsTelematicDeviceType |
497 |
503 |
498 |
504 |
499 void TSmsProtocolIdentifier::SetTelematicDeviceType(TSmsTelematicDeviceType aDeviceType) |
505 void TSmsProtocolIdentifier::SetTelematicDeviceType(TSmsTelematicDeviceType aDeviceType) |
500 { |
506 { |
501 LOGGSMU1("TSmsProtocolIdentifier::SetTelematicDeviceType()"); |
507 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSPROTOCOLIDENTIFIER_SETTELEMATICDEVICETYPE_1, "TSmsProtocolIdentifier::SetTelematicDeviceType()"); |
502 |
508 |
503 __ASSERT_DEBUG(TelematicDeviceIndicator()==ESmsTelematicDevice,Panic(KGsmuPanicNoTelematicDevice)); |
509 __ASSERT_DEBUG(TelematicDeviceIndicator()==ESmsTelematicDevice,Panic(KGsmuPanicNoTelematicDevice)); |
504 iValue=(TUint8) ((iValue&(~ESmsTelematicDeviceTypeMask))|aDeviceType); |
510 iValue=(TUint8) ((iValue&(~ESmsTelematicDeviceTypeMask))|aDeviceType); |
505 } // TSmsProtocolIdentifier::SetTelematicDeviceType |
511 } // TSmsProtocolIdentifier::SetTelematicDeviceType |
506 |
512 |
508 TInt TSmsProtocolIdentifier::ShortMessageALProtocol() const |
514 TInt TSmsProtocolIdentifier::ShortMessageALProtocol() const |
509 { |
515 { |
510 // Ignore in code coverage - not used in SMS stack and not exported |
516 // Ignore in code coverage - not used in SMS stack and not exported |
511 // but cannot be removed as impacts public header. |
517 // but cannot be removed as impacts public header. |
512 BULLSEYE_OFF |
518 BULLSEYE_OFF |
513 LOGGSMU1("TSmsProtocolIdentifier::ShortMessageALProtocol()"); |
519 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSPROTOCOLIDENTIFIER_SHORTMESSAGEALPROTOCOL_1, "TSmsProtocolIdentifier::ShortMessageALProtocol()"); |
514 |
520 |
515 __ASSERT_DEBUG(TelematicDeviceIndicator()==ESmsNoTelematicDevice,Panic(KGsmuPanicNoTelematicDevice)); |
521 __ASSERT_DEBUG(TelematicDeviceIndicator()==ESmsNoTelematicDevice,Panic(KGsmuPanicNoTelematicDevice)); |
516 return (TSmsShortMessageALProtocol) (iValue&ESmsShortMessageALProtocolMask); |
522 return (TSmsShortMessageALProtocol) (iValue&ESmsShortMessageALProtocolMask); |
517 BULLSEYE_RESTORE |
523 BULLSEYE_RESTORE |
518 } |
524 } |
520 void TSmsProtocolIdentifier::SetShortMessageALProtocol(TSmsShortMessageALProtocol aProtocol) |
526 void TSmsProtocolIdentifier::SetShortMessageALProtocol(TSmsShortMessageALProtocol aProtocol) |
521 { |
527 { |
522 // Ignore in code coverage - not used in SMS stack and not exported |
528 // Ignore in code coverage - not used in SMS stack and not exported |
523 // but cannot be removed as impacts public header. |
529 // but cannot be removed as impacts public header. |
524 BULLSEYE_OFF |
530 BULLSEYE_OFF |
525 LOGGSMU1("TSmsProtocolIdentifier::SetShortMessageALProtocol()"); |
531 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSPROTOCOLIDENTIFIER_SETSHORTMESSAGEALPROTOCOL_1, "TSmsProtocolIdentifier::SetShortMessageALProtocol()"); |
526 |
532 |
527 __ASSERT_DEBUG(TelematicDeviceIndicator()==ESmsNoTelematicDevice,Panic(KGsmuPanicNoTelematicDevice)); |
533 __ASSERT_DEBUG(TelematicDeviceIndicator()==ESmsNoTelematicDevice,Panic(KGsmuPanicNoTelematicDevice)); |
528 iValue=(TUint8) ((iValue&(~ESmsShortMessageALProtocolMask))|aProtocol); |
534 iValue=(TUint8) ((iValue&(~ESmsShortMessageALProtocolMask))|aProtocol); |
529 BULLSEYE_RESTORE |
535 BULLSEYE_RESTORE |
530 } |
536 } |
531 |
537 |
532 TInt TSmsProtocolIdentifier::ShortMessageType() const |
538 TInt TSmsProtocolIdentifier::ShortMessageType() const |
533 { |
539 { |
534 LOGGSMU1("TSmsProtocolIdentifier::ShortMessageType()"); |
540 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSPROTOCOLIDENTIFIER_SHORTMESSAGETYPE_1, "TSmsProtocolIdentifier::ShortMessageType()"); |
535 |
541 |
536 __ASSERT_DEBUG(PIDType()==ESmsPIDShortMessageType,Panic(KGsmuPanicNoShortMessageType)); |
542 __ASSERT_DEBUG(PIDType()==ESmsPIDShortMessageType,Panic(KGsmuPanicNoShortMessageType)); |
537 return (TSmsShortMessageType) (iValue&ESmsShortMessageTypeMask); |
543 return (TSmsShortMessageType) (iValue&ESmsShortMessageTypeMask); |
538 } // TSmsProtocolIdentifier::ShortMessageType |
544 } // TSmsProtocolIdentifier::ShortMessageType |
539 |
545 |
540 |
546 |
541 void TSmsProtocolIdentifier::SetShortMessageType(TSmsShortMessageType aShortMessageType) |
547 void TSmsProtocolIdentifier::SetShortMessageType(TSmsShortMessageType aShortMessageType) |
542 { |
548 { |
543 LOGGSMU1("TSmsProtocolIdentifier::SetShortMessageType()"); |
549 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSPROTOCOLIDENTIFIER_SETSHORTMESSAGETYPE_1, "TSmsProtocolIdentifier::SetShortMessageType()"); |
544 |
550 |
545 __ASSERT_DEBUG(PIDType()==ESmsPIDShortMessageType,Panic(KGsmuPanicNoShortMessageType)); |
551 __ASSERT_DEBUG(PIDType()==ESmsPIDShortMessageType,Panic(KGsmuPanicNoShortMessageType)); |
546 //iValue=(TUint8) ((iValue&(~ESmsPIDTypeMask))|aShortMessageType); |
552 //iValue=(TUint8) ((iValue&(~ESmsPIDTypeMask))|aShortMessageType); |
547 iValue=(TUint8) ((iValue&(~ESmsShortMessageTypeMask))|aShortMessageType); |
553 iValue=(TUint8) ((iValue&(~ESmsShortMessageTypeMask))|aShortMessageType); |
548 } // TSmsProtocolIdentifier::SetShortMessageType |
554 } // TSmsProtocolIdentifier::SetShortMessageType |
557 } // CSmsDeliverReport::DecodeL |
563 } // CSmsDeliverReport::DecodeL |
558 |
564 |
559 |
565 |
560 TBool TSmsDataCodingScheme::TextCompressed() const |
566 TBool TSmsDataCodingScheme::TextCompressed() const |
561 { |
567 { |
562 LOGGSMU1("TSmsDataCodingScheme::TextCompressed()"); |
568 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSDATACODINGSCHEME_TEXTCOMPRESSED_1, "TSmsDataCodingScheme::TextCompressed()"); |
563 |
569 |
564 TInt bits7to4=Bits7To4(); |
570 TInt bits7to4=Bits7To4(); |
565 return (bits7to4==ESmsDCSTextCompressedWithNoClassInfo) || (bits7to4==ESmsDCSTextCompressedWithClassInfo) || |
571 return (bits7to4==ESmsDCSTextCompressedWithNoClassInfo) || (bits7to4==ESmsDCSTextCompressedWithClassInfo) || |
566 (bits7to4==ESmsDCSAutoDelNoClassInfoCompressedText) || (bits7to4==ESmsDCSAutoDelClassInfoTextCompressedText); |
572 (bits7to4==ESmsDCSAutoDelNoClassInfoCompressedText) || (bits7to4==ESmsDCSAutoDelClassInfoTextCompressedText); |
567 } // TSmsDataCodingScheme::TextCompressed |
573 } // TSmsDataCodingScheme::TextCompressed |
568 |
574 |
569 |
575 |
570 void TSmsDataCodingScheme::SetTextCompressed(TBool aCompressed) |
576 void TSmsDataCodingScheme::SetTextCompressed(TBool aCompressed) |
571 { |
577 { |
572 LOGGSMU1("TSmsDataCodingScheme::SetTextCompressed()"); |
578 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSDATACODINGSCHEME_SETTEXTCOMPRESSED_1, "TSmsDataCodingScheme::SetTextCompressed()"); |
573 |
579 |
574 TInt bits7to4=Bits7To4(); |
580 TInt bits7to4=Bits7To4(); |
575 if (aCompressed) |
581 if (aCompressed) |
576 { |
582 { |
577 switch (bits7to4) |
583 switch (bits7to4) |
680 { |
686 { |
681 alphabet=ESmsAlphabetUCS2; |
687 alphabet=ESmsAlphabetUCS2; |
682 break; |
688 break; |
683 } |
689 } |
684 default: |
690 default: |
685 LOGGSMU1("TSmsDataCodingScheme::Alphabet() WARNING! default case has been reached"); |
691 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSDATACODINGSCHEME_ALPHABET_2, "TSmsDataCodingScheme::Alphabet() WARNING! default case has been reached"); |
686 break; |
692 break; |
687 } |
693 } |
688 return (TSmsAlphabet) alphabet; |
694 return (TSmsAlphabet) alphabet; |
689 } // TSmsDataCodingScheme::TSmsAlphabet |
695 } // TSmsDataCodingScheme::TSmsAlphabet |
690 |
696 |
691 void TSmsDataCodingScheme::SetAlphabet(TSmsAlphabet aAlphabet) |
697 void TSmsDataCodingScheme::SetAlphabet(TSmsAlphabet aAlphabet) |
692 { |
698 { |
693 LOGGSMU1("TSmsDataCodingScheme::SetAlphabet()"); |
699 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSDATACODINGSCHEME_SETALPHABET_1, "TSmsDataCodingScheme::SetAlphabet()"); |
694 |
700 |
695 TInt bits7to4=Bits7To4(); |
701 TInt bits7to4=Bits7To4(); |
696 switch (bits7to4) |
702 switch (bits7to4) |
697 { |
703 { |
698 case (ESmsDCSTextUncompressedWithNoClassInfo): |
704 case (ESmsDCSTextUncompressedWithNoClassInfo): |
741 { |
747 { |
742 iValue=(TUint8) (ESmsDCSMessageWaitingIndication7Bit|(iValue&(~ESmsDCSBits7To4Mask))); |
748 iValue=(TUint8) (ESmsDCSMessageWaitingIndication7Bit|(iValue&(~ESmsDCSBits7To4Mask))); |
743 } |
749 } |
744 else |
750 else |
745 { |
751 { |
746 LOGGSMU3("TSmsDataCodingScheme::SetAlphabet() WARNING! Not Supported With Discard Message [Bits7To4=%d], [aAlphabet=%d]", bits7to4, aAlphabet); |
752 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSDATACODINGSCHEME_SETALPHABET_4, "TSmsDataCodingScheme::SetAlphabet() WARNING! Not Supported With Discard Message [Bits7To4=%d], [aAlphabet=%d]", bits7to4, aAlphabet); |
747 } |
753 } |
748 break; |
754 break; |
749 } |
755 } |
750 default: |
756 default: |
751 LOGGSMU1("TSmsDataCodingScheme::SetAlphabet() WARNING! default case has been reached"); |
757 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSDATACODINGSCHEME_SETALPHABET_5, "TSmsDataCodingScheme::SetAlphabet() WARNING! default case has been reached"); |
752 break; |
758 break; |
753 } |
759 } |
754 } // TSmsDataCodingScheme::SetAlphabet |
760 } // TSmsDataCodingScheme::SetAlphabet |
755 |
761 |
756 |
762 |
757 TBool TSmsDataCodingScheme::Class(TSmsClass& aClass) const |
763 TBool TSmsDataCodingScheme::Class(TSmsClass& aClass) const |
758 { |
764 { |
759 LOGGSMU1("TSmsDataCodingScheme::Class()"); |
765 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSDATACODINGSCHEME_CLASS_1, "TSmsDataCodingScheme::Class()"); |
760 |
766 |
761 switch (Bits7To4()) |
767 switch (Bits7To4()) |
762 { |
768 { |
763 case (ESmsDCSTextUncompressedWithClassInfo): |
769 case (ESmsDCSTextUncompressedWithClassInfo): |
764 case (ESmsDCSTextCompressedWithClassInfo): |
770 case (ESmsDCSTextCompressedWithClassInfo): |
875 { |
881 { |
876 state=(TSmsIndicationState) (iValue&ESmsIndicationStateMask); |
882 state=(TSmsIndicationState) (iValue&ESmsIndicationStateMask); |
877 break; |
883 break; |
878 } |
884 } |
879 default: |
885 default: |
880 LOGGSMU1("WARNING! default case has been reached"); |
886 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSDATACODINGSCHEME_INDICATIONSTATE_2, "WARNING! default case has been reached"); |
881 break; |
887 break; |
882 } |
888 } |
883 return state; |
889 return state; |
884 } // TSmsDataCodingScheme::TSmsIndicationState |
890 } // TSmsDataCodingScheme::TSmsIndicationState |
885 |
891 |
886 |
892 |
887 void TSmsDataCodingScheme::SetIndicationState(TSmsIndicationState aState) |
893 void TSmsDataCodingScheme::SetIndicationState(TSmsIndicationState aState) |
888 { |
894 { |
889 LOGGSMU1("TSmsDataCodingScheme::SetIndicationState()"); |
895 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSDATACODINGSCHEME_SETINDICATIONSTATE_1, "TSmsDataCodingScheme::SetIndicationState()"); |
890 |
896 |
891 TInt bits7to4=Bits7To4(); |
897 TInt bits7to4=Bits7To4(); |
892 switch (bits7to4) |
898 switch (bits7to4) |
893 { |
899 { |
894 case (ESmsDCSMessageWaitingIndicationDiscardMessage): |
900 case (ESmsDCSMessageWaitingIndicationDiscardMessage): |
897 { |
903 { |
898 iValue=(TUint8) (aState | (iValue&(~ESmsIndicationStateMask))); |
904 iValue=(TUint8) (aState | (iValue&(~ESmsIndicationStateMask))); |
899 break; |
905 break; |
900 } |
906 } |
901 default: |
907 default: |
902 LOGGSMU1("TSmsDataCodingScheme::SetIndicationState() WARNING! default case has been reached"); |
908 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSDATACODINGSCHEME_SETINDICATIONSTATE_2, "TSmsDataCodingScheme::SetIndicationState() WARNING! default case has been reached"); |
903 break; |
909 break; |
904 } |
910 } |
905 } // TSmsDataCodingScheme::SetIndicationState |
911 } // TSmsDataCodingScheme::SetIndicationState |
906 |
912 |
907 |
913 |
908 TSmsDataCodingScheme::TSmsIndicationType TSmsDataCodingScheme::IndicationType() const |
914 TSmsDataCodingScheme::TSmsIndicationType TSmsDataCodingScheme::IndicationType() const |
909 { |
915 { |
910 LOGGSMU1("TSmsDataCodingScheme::IndicationType()"); |
916 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSDATACODINGSCHEME_INDICATIONTYPE_1, "TSmsDataCodingScheme::IndicationType()"); |
911 |
917 |
912 TInt bits7to4=Bits7To4(); |
918 TInt bits7to4=Bits7To4(); |
913 TSmsIndicationType type=ESmsVoicemailMessageWaiting; |
919 TSmsIndicationType type=ESmsVoicemailMessageWaiting; |
914 switch (bits7to4) |
920 switch (bits7to4) |
915 { |
921 { |
919 { |
925 { |
920 type=(TSmsIndicationType) (iValue&ESmsIndicationTypeMask); |
926 type=(TSmsIndicationType) (iValue&ESmsIndicationTypeMask); |
921 break; |
927 break; |
922 } |
928 } |
923 default: |
929 default: |
924 LOGGSMU1("TSmsDataCodingScheme::IndicationType() WARNING default case has been reached"); |
930 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSDATACODINGSCHEME_INDICATIONTYPE_2, "TSmsDataCodingScheme::IndicationType() WARNING default case has been reached"); |
925 break; |
931 break; |
926 } |
932 } |
927 return type; |
933 return type; |
928 } // TSmsDataCodingScheme::TSmsIndicationType |
934 } // TSmsDataCodingScheme::TSmsIndicationType |
929 |
935 |
930 |
936 |
931 void TSmsDataCodingScheme::SetIndicationType(TSmsIndicationType aType) |
937 void TSmsDataCodingScheme::SetIndicationType(TSmsIndicationType aType) |
932 { |
938 { |
933 LOGGSMU1("TSmsDataCodingScheme::SetIndicationType()"); |
939 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSDATACODINGSCHEME_SETINDICATIONTYPE_1, "TSmsDataCodingScheme::SetIndicationType()"); |
934 |
940 |
935 TInt bits7to4=Bits7To4(); |
941 TInt bits7to4=Bits7To4(); |
936 switch (bits7to4) |
942 switch (bits7to4) |
937 { |
943 { |
938 case (ESmsDCSMessageWaitingIndicationDiscardMessage): |
944 case (ESmsDCSMessageWaitingIndicationDiscardMessage): |
960 * @return New CSmsAlphabetConverter object |
966 * @return New CSmsAlphabetConverter object |
961 * @capability None |
967 * @capability None |
962 */ |
968 */ |
963 EXPORT_C CSmsAlphabetConverter* CSmsAlphabetConverter::NewLC(CCnvCharacterSetConverter& aCharacterSetConverter,RFs& aFs,TSmsDataCodingScheme::TSmsAlphabet aSmsAlphabet,TBool aIsBinary) |
969 EXPORT_C CSmsAlphabetConverter* CSmsAlphabetConverter::NewLC(CCnvCharacterSetConverter& aCharacterSetConverter,RFs& aFs,TSmsDataCodingScheme::TSmsAlphabet aSmsAlphabet,TBool aIsBinary) |
964 { |
970 { |
965 LOGGSMU1("CSmsAlphabetConverter::NewLC()"); |
971 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CSMSALPHABETCONVERTER_NEWLC_1, "CSmsAlphabetConverter::NewLC()"); |
966 |
972 |
967 CSmsAlphabetConverter* converter=new (ELeave)CSmsAlphabetConverter(aCharacterSetConverter,aFs,aSmsAlphabet,aIsBinary); |
973 CSmsAlphabetConverter* converter=new (ELeave)CSmsAlphabetConverter(aCharacterSetConverter,aFs,aSmsAlphabet,aIsBinary); |
968 CleanupStack::PushL(converter); |
974 CleanupStack::PushL(converter); |
969 converter->ConstructL(); |
975 converter->ConstructL(); |
970 return converter; |
976 return converter; |
1075 * @return Converted characters |
1081 * @return Converted characters |
1076 * @capability None |
1082 * @capability None |
1077 */ |
1083 */ |
1078 EXPORT_C TPtrC8 CSmsAlphabetConverter::ConvertFromNativeL(const TDesC& aNativeCharacters) |
1084 EXPORT_C TPtrC8 CSmsAlphabetConverter::ConvertFromNativeL(const TDesC& aNativeCharacters) |
1079 { |
1085 { |
1080 LOGGSMU1("CSmsAlphabetConverter::ConvertFromNativeL()"); |
1086 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CSMSALPHABETCONVERTER_CONVERTFROMNATIVEL_1, "CSmsAlphabetConverter::ConvertFromNativeL()"); |
1081 |
1087 |
1082 TInt numberOfUnconvertibleCharacters, numberOfDowngradedCharacters; |
1088 TInt numberOfUnconvertibleCharacters, numberOfDowngradedCharacters; |
1083 |
1089 |
1084 return ConvertFromNativeL(aNativeCharacters, ESmsEncodingNone, |
1090 return ConvertFromNativeL(aNativeCharacters, ESmsEncodingNone, |
1085 numberOfUnconvertibleCharacters, |
1091 numberOfUnconvertibleCharacters, |
1105 EXPORT_C TPtrC8 CSmsAlphabetConverter::ConvertFromNativeL(const TDesC& aNativeCharacters, |
1111 EXPORT_C TPtrC8 CSmsAlphabetConverter::ConvertFromNativeL(const TDesC& aNativeCharacters, |
1106 TSmsEncoding aEncoding, |
1112 TSmsEncoding aEncoding, |
1107 TInt& aNumberOfUnconvertibleCharacters, |
1113 TInt& aNumberOfUnconvertibleCharacters, |
1108 TInt& aNumberOfDowngradedCharacters) |
1114 TInt& aNumberOfDowngradedCharacters) |
1109 { |
1115 { |
1110 LOGGSMU2("CSmsAlphabetConverter::ConvertFromNativeL(): aEncoding=%d", aEncoding); |
1116 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CSMSALPHABETCONVERTER_CONVERTFROMNATIVEL1_1, "CSmsAlphabetConverter::ConvertFromNativeL(): aEncoding=%d", aEncoding); |
1111 |
1117 |
1112 aNumberOfUnconvertibleCharacters = 0; |
1118 aNumberOfUnconvertibleCharacters = 0; |
1113 aNumberOfDowngradedCharacters = 0; |
1119 aNumberOfDowngradedCharacters = 0; |
1114 |
1120 |
1115 // Check for some shortcuts |
1121 // Check for some shortcuts |
1404 * it does not accept a downgraded character or alternative encoding |
1410 * it does not accept a downgraded character or alternative encoding |
1405 * as being supported. |
1411 * as being supported. |
1406 */ |
1412 */ |
1407 TBool CSmsAlphabetConverter::IsSupportedL(TChar aChar) |
1413 TBool CSmsAlphabetConverter::IsSupportedL(TChar aChar) |
1408 { |
1414 { |
1409 LOGGSMU2("[1] CSmsAlphabetConverter::IsSupportedL(aChar=0x%04x)", (TUint) aChar); |
1415 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSALPHABETCONVERTER_ISSUPPORTEDL_1, "[1] CSmsAlphabetConverter::IsSupportedL(aChar=0x%04x)", (TUint) aChar); |
1410 |
1416 |
1411 TBool isDowngrade, isRequiresAlternativeEncoding; |
1417 TBool isDowngrade, isRequiresAlternativeEncoding; |
1412 |
1418 |
1413 TBool supported = IsSupportedL(aChar, ESmsEncodingNone, |
1419 TBool supported = IsSupportedL(aChar, ESmsEncodingNone, |
1414 isDowngrade, isRequiresAlternativeEncoding); |
1420 isDowngrade, isRequiresAlternativeEncoding); |
1415 |
1421 |
1416 LOGGSMU2("CSmsAlphabetConverter::IsSupportedL(): supported=%d.", supported); |
1422 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSALPHABETCONVERTER_ISSUPPORTEDL_2, "CSmsAlphabetConverter::IsSupportedL(): supported=%d.", supported); |
1417 |
1423 |
1418 return supported; |
1424 return supported; |
1419 } // CSmsAlphabetConverter::IsSupportedL |
1425 } // CSmsAlphabetConverter::IsSupportedL |
1420 |
1426 |
1421 |
1427 |
1432 * @return ETrue if the character is supported. |
1438 * @return ETrue if the character is supported. |
1433 */ |
1439 */ |
1434 TBool CSmsAlphabetConverter::IsSupportedL(const TDesC& aDes, TInt& aNumberOfUnconvertibleCharacters, |
1440 TBool CSmsAlphabetConverter::IsSupportedL(const TDesC& aDes, TInt& aNumberOfUnconvertibleCharacters, |
1435 TInt& aIndexOfFirstUnconvertibleCharacter) |
1441 TInt& aIndexOfFirstUnconvertibleCharacter) |
1436 { |
1442 { |
1437 LOGGSMU2("[2] CSmsAlphabetConverter::IsSupportedL(aDes=\"%S\")", &aDes); |
1443 OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSALPHABETCONVERTER_ISSUPPORTEDL1_1, "[2] CSmsAlphabetConverter::IsSupportedL(aDes=\"%S\")", aDes); |
1438 |
1444 |
1439 TInt desLength = aDes.Length(); |
1445 TInt desLength = aDes.Length(); |
1440 // |
1446 // |
1441 // Initialise the exit params... |
1447 // Initialise the exit params... |
1442 // |
1448 // |
1503 // |
1509 // |
1504 // Useful logging... |
1510 // Useful logging... |
1505 // |
1511 // |
1506 TBool supported = (aNumberOfUnconvertibleCharacters == 0); |
1512 TBool supported = (aNumberOfUnconvertibleCharacters == 0); |
1507 |
1513 |
1508 LOGGSMU2("CSmsAlphabetConverter::IsSupportedL(): aNumberOfUnconvertibleCharacters=%d.", aNumberOfUnconvertibleCharacters); |
1514 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSALPHABETCONVERTER_ISSUPPORTEDL1_2, "CSmsAlphabetConverter::IsSupportedL(): aNumberOfUnconvertibleCharacters=%d.", aNumberOfUnconvertibleCharacters); |
1509 LOGGSMU2("CSmsAlphabetConverter::IsSupportedL(): aIndexOfFirstUnconvertibleCharacter=%d.", aIndexOfFirstUnconvertibleCharacter); |
1515 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSALPHABETCONVERTER_ISSUPPORTEDL1_3, "CSmsAlphabetConverter::IsSupportedL(): aIndexOfFirstUnconvertibleCharacter=%d.", aIndexOfFirstUnconvertibleCharacter); |
1510 LOGGSMU2("CSmsAlphabetConverter::IsSupportedL(): supported=%d.", supported); |
1516 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSALPHABETCONVERTER_ISSUPPORTEDL1_4, "CSmsAlphabetConverter::IsSupportedL(): supported=%d.", supported); |
1511 |
1517 |
1512 return supported; |
1518 return supported; |
1513 } // CSmsAlphabetConverter::IsSupportedL |
1519 } // CSmsAlphabetConverter::IsSupportedL |
1514 |
1520 |
1515 |
1521 |
1529 */ |
1535 */ |
1530 TBool CSmsAlphabetConverter::IsSupportedL(TChar aChar, TSmsEncoding aEncoding, |
1536 TBool CSmsAlphabetConverter::IsSupportedL(TChar aChar, TSmsEncoding aEncoding, |
1531 TBool& aIsDowngrade, |
1537 TBool& aIsDowngrade, |
1532 TBool& aRequiresAlternativeEncoding) |
1538 TBool& aRequiresAlternativeEncoding) |
1533 { |
1539 { |
1534 LOGGSMU2("[3] CSmsAlphabetConverter::IsSupportedL(aChar=0x%04x)", (TUint) aChar); |
1540 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSALPHABETCONVERTER_ISSUPPORTEDL2_1, "[3] CSmsAlphabetConverter::IsSupportedL(aChar=0x%04x)", (TUint) aChar); |
1535 |
1541 |
1536 // |
1542 // |
1537 // Convert the character... |
1543 // Convert the character... |
1538 // |
1544 // |
1539 TInt numberOfUnconvertibleCharacters, numberOfDowngradedCharacters, |
1545 TInt numberOfUnconvertibleCharacters, numberOfDowngradedCharacters, |
1556 aRequiresAlternativeEncoding = (numberRequiringAlternativeEncoding > 0); |
1562 aRequiresAlternativeEncoding = (numberRequiringAlternativeEncoding > 0); |
1557 |
1563 |
1558 // |
1564 // |
1559 // Useful logging... |
1565 // Useful logging... |
1560 // |
1566 // |
1561 LOGGSMU2("CSmsAlphabetConverter::IsSupportedL(): aIsDowngrade=%d.", aIsDowngrade); |
1567 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSALPHABETCONVERTER_ISSUPPORTEDL2_2, "CSmsAlphabetConverter::IsSupportedL(): aIsDowngrade=%d.", aIsDowngrade); |
1562 LOGGSMU2("CSmsAlphabetConverter::IsSupportedL(): aRequiresAlternativeEncoding=%d.", aRequiresAlternativeEncoding); |
1568 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSALPHABETCONVERTER_ISSUPPORTEDL2_3, "CSmsAlphabetConverter::IsSupportedL(): aRequiresAlternativeEncoding=%d.", aRequiresAlternativeEncoding); |
1563 LOGGSMU2("CSmsAlphabetConverter::IsSupportedL(): supported=%d.", supported); |
1569 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSALPHABETCONVERTER_ISSUPPORTEDL2_4, "CSmsAlphabetConverter::IsSupportedL(): supported=%d.", supported); |
1564 |
1570 |
1565 return supported; |
1571 return supported; |
1566 } // CSmsAlphabetConverter::IsSupportedL |
1572 } // CSmsAlphabetConverter::IsSupportedL |
1567 |
1573 |
1568 |
1574 |
1588 TInt& aNumberOfUnconvertibleCharacters, |
1594 TInt& aNumberOfUnconvertibleCharacters, |
1589 TInt& aNumberOfDowngradedCharacters, |
1595 TInt& aNumberOfDowngradedCharacters, |
1590 TInt& aNumberRequiringAlternativeEncoding, |
1596 TInt& aNumberRequiringAlternativeEncoding, |
1591 TInt& aIndexOfFirstUnconvertibleCharacter) |
1597 TInt& aIndexOfFirstUnconvertibleCharacter) |
1592 { |
1598 { |
1593 LOGGSMU2("[4] CSmsAlphabetConverter::IsSupportedL(aDes=\"%S\")", &aDes); |
1599 OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSALPHABETCONVERTER_ISSUPPORTEDL3_1, "[4] CSmsAlphabetConverter::IsSupportedL(aDes=\"%S\")", aDes); |
1594 |
1600 |
1595 TInt desLength = aDes.Length(); |
1601 TInt desLength = aDes.Length(); |
1596 // |
1602 // |
1597 // Initialise the exit params... |
1603 // Initialise the exit params... |
1598 // |
1604 // |
1784 // |
1790 // |
1785 // Useful logging... |
1791 // Useful logging... |
1786 // |
1792 // |
1787 TBool supported = (aNumberOfUnconvertibleCharacters == 0); |
1793 TBool supported = (aNumberOfUnconvertibleCharacters == 0); |
1788 |
1794 |
1789 LOGGSMU2("CSmsAlphabetConverter::IsSupportedL(): aNumberOfUnconvertibleCharacters=%d.", aNumberOfUnconvertibleCharacters); |
1795 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSALPHABETCONVERTER_ISSUPPORTEDL3_2, "CSmsAlphabetConverter::IsSupportedL(): aNumberOfUnconvertibleCharacters=%d.", aNumberOfUnconvertibleCharacters); |
1790 LOGGSMU2("CSmsAlphabetConverter::IsSupportedL(): aNumberOfDowngradedCharacters=%d.", aNumberOfDowngradedCharacters); |
1796 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSALPHABETCONVERTER_ISSUPPORTEDL3_3, "CSmsAlphabetConverter::IsSupportedL(): aNumberOfDowngradedCharacters=%d.", aNumberOfDowngradedCharacters); |
1791 LOGGSMU2("CSmsAlphabetConverter::IsSupportedL(): aNumberRequiringAlternativeEncoding=%d.", aNumberRequiringAlternativeEncoding); |
1797 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSALPHABETCONVERTER_ISSUPPORTEDL3_4, "CSmsAlphabetConverter::IsSupportedL(): aNumberRequiringAlternativeEncoding=%d.", aNumberRequiringAlternativeEncoding); |
1792 LOGGSMU2("CSmsAlphabetConverter::IsSupportedL(): aIndexOfFirstUnconvertibleCharacter=%d.", aIndexOfFirstUnconvertibleCharacter); |
1798 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSALPHABETCONVERTER_ISSUPPORTEDL3_5, "CSmsAlphabetConverter::IsSupportedL(): aIndexOfFirstUnconvertibleCharacter=%d.", aIndexOfFirstUnconvertibleCharacter); |
1793 LOGGSMU2("CSmsAlphabetConverter::IsSupportedL(): supported=%d.", supported); |
1799 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSALPHABETCONVERTER_ISSUPPORTEDL3_6, "CSmsAlphabetConverter::IsSupportedL(): supported=%d.", supported); |
1794 |
1800 |
1795 return supported; |
1801 return supported; |
1796 } // CSmsAlphabetConverter::IsSupportedL |
1802 } // CSmsAlphabetConverter::IsSupportedL |
1797 |
1803 |
1798 |
1804 |
1806 * @return Encoding that should be used. |
1812 * @return Encoding that should be used. |
1807 */ |
1813 */ |
1808 TSmsEncoding CSmsAlphabetConverter::FindBestAlternativeEncodingL(const TDesC& aNativeCharacters, |
1814 TSmsEncoding CSmsAlphabetConverter::FindBestAlternativeEncodingL(const TDesC& aNativeCharacters, |
1809 TSmsEncoding aSuggestedEncoding) |
1815 TSmsEncoding aSuggestedEncoding) |
1810 { |
1816 { |
1811 LOGGSMU2("CSmsAlphabetConverter::FindBestAlternativeEncodingL(): aSuggestedEncoding=%d", |
1817 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSALPHABETCONVERTER_FINDBESTALTERNATIVEENCODINGL_1, "CSmsAlphabetConverter::FindBestAlternativeEncodingL(): aSuggestedEncoding=%d",aSuggestedEncoding); |
1812 aSuggestedEncoding); |
|
1813 |
1818 |
1814 TSmsEncoding encodingToUse = ESmsEncodingNone; |
1819 TSmsEncoding encodingToUse = ESmsEncodingNone; |
1815 |
1820 |
1816 // |
1821 // |
1817 // If this is not 7bit or the alternative encoding is not set then do |
1822 // If this is not 7bit or the alternative encoding is not set then do |
1915 * |
1920 * |
1916 * @param aEncoding Alternative 7bit encoding to use if required. |
1921 * @param aEncoding Alternative 7bit encoding to use if required. |
1917 */ |
1922 */ |
1918 void CSmsAlphabetConverter::PrepareForConversionFromNativeL(TSmsEncoding aEncoding) |
1923 void CSmsAlphabetConverter::PrepareForConversionFromNativeL(TSmsEncoding aEncoding) |
1919 { |
1924 { |
1920 LOGGSMU2("CSmsAlphabetConverter::PrepareForConversionFromNativeL(): aEncoding=%d", |
1925 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSALPHABETCONVERTER_PREPAREFORCONVERSIONFROMNATIVEL_1, "CSmsAlphabetConverter::PrepareForConversionFromNativeL(): aEncoding=%d",aEncoding); |
1921 aEncoding); |
|
1922 |
1926 |
1923 __ASSERT_DEBUG(iIsBinary==EFalse,Panic(KGsmuPanicUnsupportedAlphabet)); |
1927 __ASSERT_DEBUG(iIsBinary==EFalse,Panic(KGsmuPanicUnsupportedAlphabet)); |
1924 switch (iSmsAlphabet) |
1928 switch (iSmsAlphabet) |
1925 { |
1929 { |
1926 case TSmsDataCodingScheme::ESmsAlphabet7Bit: |
1930 case TSmsDataCodingScheme::ESmsAlphabet7Bit: |
1936 GetAlternativeEncoderIDL(aEncoding, alternativeEncoderID); |
1940 GetAlternativeEncoderIDL(aEncoding, alternativeEncoderID); |
1937 if (alternativeEncoderID != 0) |
1941 if (alternativeEncoderID != 0) |
1938 { |
1942 { |
1939 CCnvCharacterSetConverter::TAvailability availability; |
1943 CCnvCharacterSetConverter::TAvailability availability; |
1940 |
1944 |
1941 LOGGSMU2("CSmsAlphabetConverter::PrepareForConversionFromNativeL(): Converter 0x%08x", |
1945 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSALPHABETCONVERTER_PREPAREFORCONVERSIONFROMNATIVEL_2, "CSmsAlphabetConverter::PrepareForConversionFromNativeL(): Converter 0x%08x",alternativeEncoderID); |
1942 alternativeEncoderID); |
|
1943 |
1946 |
1944 availability = iCharacterSetConverter.PrepareToConvertToOrFromL(alternativeEncoderID, iFs); |
1947 availability = iCharacterSetConverter.PrepareToConvertToOrFromL(alternativeEncoderID, iFs); |
1945 if (availability == CCnvCharacterSetConverter::EAvailable) |
1948 if (availability == CCnvCharacterSetConverter::EAvailable) |
1946 { |
1949 { |
1947 // Force unicode line termination characters to simple line feed |
1950 // Force unicode line termination characters to simple line feed |
2026 GetAlternativeEncoderIDL(aEncoding, alternativeEncoderID); |
2028 GetAlternativeEncoderIDL(aEncoding, alternativeEncoderID); |
2027 if (alternativeEncoderID != 0) |
2029 if (alternativeEncoderID != 0) |
2028 { |
2030 { |
2029 CCnvCharacterSetConverter::TAvailability availability; |
2031 CCnvCharacterSetConverter::TAvailability availability; |
2030 |
2032 |
2031 LOGGSMU2("CSmsAlphabetConverter::PrepareForConversionFromNativeL(): Converter 0x%08x", |
2033 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSALPHABETCONVERTER_PREPAREFORCONVERSIONTONATIVEL_2, "CSmsAlphabetConverter::PrepareForConversionFromNativeL(): Converter 0x%08x",alternativeEncoderID); |
2032 alternativeEncoderID); |
|
2033 |
2034 |
2034 availability = iCharacterSetConverter.PrepareToConvertToOrFromL(alternativeEncoderID, iFs); |
2035 availability = iCharacterSetConverter.PrepareToConvertToOrFromL(alternativeEncoderID, iFs); |
2035 if (availability == CCnvCharacterSetConverter::EAvailable) |
2036 if (availability == CCnvCharacterSetConverter::EAvailable) |
2036 { |
2037 { |
2037 // Job done, return |
2038 // Job done, return |
2268 } // CSmsAddress::DuplicateL |
2269 } // CSmsAddress::DuplicateL |
2269 |
2270 |
2270 |
2271 |
2271 TPtrC CSmsAddress::Address() const |
2272 TPtrC CSmsAddress::Address() const |
2272 { |
2273 { |
2273 LOGGSMU1("CSmsAddress::Address()"); |
2274 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSADDRESS_ADDRESS_1, "CSmsAddress::Address()"); |
2274 |
2275 |
2275 TPtrC ptr; |
2276 TPtrC ptr; |
2276 if (iBuffer) |
2277 if (iBuffer) |
2277 ptr.Set(iBuffer->Des()); |
2278 ptr.Set(iBuffer->Des()); |
2278 return ptr; |
2279 return ptr; |
2279 } // CSmsAddress::Address |
2280 } // CSmsAddress::Address |
2280 |
2281 |
2281 |
2282 |
2282 void CSmsAddress::SetRawAddressL(TGsmSmsTypeOfAddress aTypeOfAddress, TPtrC aBufferPtr) |
2283 void CSmsAddress::SetRawAddressL(TGsmSmsTypeOfAddress aTypeOfAddress, TPtrC aBufferPtr) |
2283 { |
2284 { |
2284 LOGGSMU1("CSmsAddress::SetRawAddressL()"); |
2285 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSADDRESS_SETRAWADDRESSL_1, "CSmsAddress::SetRawAddressL()"); |
2285 |
2286 |
2286 iTypeOfAddress = aTypeOfAddress; |
2287 iTypeOfAddress = aTypeOfAddress; |
2287 |
2288 |
2288 NewBufferL(aBufferPtr.Length()); |
2289 NewBufferL(aBufferPtr.Length()); |
2289 |
2290 |
2291 } // CSmsAddress::SetRawAddressL |
2292 } // CSmsAddress::SetRawAddressL |
2292 |
2293 |
2293 |
2294 |
2294 TGsmSmsTypeOfAddress& CSmsAddress::TypeOfAddress() |
2295 TGsmSmsTypeOfAddress& CSmsAddress::TypeOfAddress() |
2295 { |
2296 { |
2296 LOGGSMU1("CSmsAddress::TypeOfAddress()"); |
2297 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSADDRESS_TYPEOFADDRESS_1, "CSmsAddress::TypeOfAddress()"); |
2297 |
2298 |
2298 return iTypeOfAddress; |
2299 return iTypeOfAddress; |
2299 } // CSmsAddress::TypeOfAddress |
2300 } // CSmsAddress::TypeOfAddress |
2300 |
2301 |
2301 |
2302 |
2302 void CSmsAddress::SetAddressL(const TDesC& aAddress) |
2303 void CSmsAddress::SetAddressL(const TDesC& aAddress) |
2303 { |
2304 { |
2304 LOGGSMU1("CSmsAddress::SetAddressL()"); |
2305 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSADDRESS_SETADDRESSL_1, "CSmsAddress::SetAddressL()"); |
2305 |
2306 |
2306 TInt length=aAddress.Length(); |
2307 TInt length=aAddress.Length(); |
2307 NewBufferL(length); |
2308 NewBufferL(length); |
2308 iBuffer->Des().Copy(aAddress); |
2309 iBuffer->Des().Copy(aAddress); |
2309 |
2310 |
2359 } |
2360 } |
2360 |
2361 |
2361 |
2362 |
2362 void CSmsAddress::SetParsedAddressL(const TGsmSmsTelNumber& aParsedAddress) |
2363 void CSmsAddress::SetParsedAddressL(const TGsmSmsTelNumber& aParsedAddress) |
2363 { |
2364 { |
2364 LOGGSMU1("CSmsAddress::SetParsedAddressL()"); |
2365 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSADDRESS_SETPARSEDADDRESSL_1, "CSmsAddress::SetParsedAddressL()"); |
2365 |
2366 |
2366 iTypeOfAddress=aParsedAddress.iTypeOfAddress; |
2367 iTypeOfAddress=aParsedAddress.iTypeOfAddress; |
2367 DoSetParsedAddressL(aParsedAddress.iTelNumber); |
2368 DoSetParsedAddressL(aParsedAddress.iTelNumber); |
2368 } // CSmsAddress::SetParsedAddressL |
2369 } // CSmsAddress::SetParsedAddressL |
2369 |
2370 |
2370 |
2371 |
2371 TUint8 CSmsAddress::SizeL() |
2372 TUint8 CSmsAddress::SizeL() |
2372 { |
2373 { |
2373 LOGGSMU1("CSmsAddress::SizeL()"); |
2374 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSADDRESS_SIZEL_1, "CSmsAddress::SizeL()"); |
2374 |
2375 |
2375 TUint8 size = 0; |
2376 TUint8 size = 0; |
2376 |
2377 |
2377 TBuf8<KSmsAddressMaxAddressLength> testBuffer; |
2378 TBuf8<KSmsAddressMaxAddressLength> testBuffer; |
2378 testBuffer.SetLength(KSmsAddressMaxAddressLength); |
2379 testBuffer.SetLength(KSmsAddressMaxAddressLength); |
2903 } // TSmsValidityPeriod::TSmsValidityPeriod |
2904 } // TSmsValidityPeriod::TSmsValidityPeriod |
2904 |
2905 |
2905 |
2906 |
2906 TTime TSmsValidityPeriod::Time() const |
2907 TTime TSmsValidityPeriod::Time() const |
2907 { |
2908 { |
2908 LOGGSMU1("TSmsValidityPeriod::Time()"); |
2909 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSVALIDITYPERIOD_TIME_1, "TSmsValidityPeriod::Time()"); |
2909 |
2910 |
2910 TTime time; |
2911 TTime time; |
2911 time.UniversalTime(); |
2912 time.UniversalTime(); |
2912 time+=iTimeIntervalMinutes; |
2913 time+=iTimeIntervalMinutes; |
2913 return time; |
2914 return time; |
2914 } // TSmsValidityPeriod::Time |
2915 } // TSmsValidityPeriod::Time |
2915 |
2916 |
2916 |
2917 |
2917 TUint8* TSmsValidityPeriod::EncodeL(TUint8* aPtr) const |
2918 TUint8* TSmsValidityPeriod::EncodeL(TUint8* aPtr) const |
2918 { |
2919 { |
2919 LOGGSMU1("TSmsValidityPeriod::EncodeL()"); |
2920 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSVALIDITYPERIOD_ENCODEL_1, "TSmsValidityPeriod::EncodeL()"); |
2920 |
2921 |
2921 TInt validityperiodformat=ValidityPeriodFormat(); |
2922 TInt validityperiodformat=ValidityPeriodFormat(); |
2922 switch (validityperiodformat) |
2923 switch (validityperiodformat) |
2923 { |
2924 { |
2924 case (TSmsFirstOctet::ESmsVPFNone): |
2925 case (TSmsFirstOctet::ESmsVPFNone): |
3067 } // TSmsValidityPeriod::ExternalizeL |
3068 } // TSmsValidityPeriod::ExternalizeL |
3068 |
3069 |
3069 |
3070 |
3070 CSmsInformationElement* CSmsInformationElement::NewL(TSmsInformationElementIdentifier aIdentifier,const TDesC8& aData) |
3071 CSmsInformationElement* CSmsInformationElement::NewL(TSmsInformationElementIdentifier aIdentifier,const TDesC8& aData) |
3071 { |
3072 { |
3072 LOGGSMU1("CSmsInformationElement::NewL()"); |
3073 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSINFORMATIONELEMENT_NEWL_1, "CSmsInformationElement::NewL()"); |
3073 |
3074 |
3074 CSmsInformationElement* informationelement=new(ELeave) CSmsInformationElement(aIdentifier); |
3075 CSmsInformationElement* informationelement=new(ELeave) CSmsInformationElement(aIdentifier); |
3075 CleanupStack::PushL(informationelement); |
3076 CleanupStack::PushL(informationelement); |
3076 informationelement->ConstructL(aData); |
3077 informationelement->ConstructL(aData); |
3077 CleanupStack::Pop(); |
3078 CleanupStack::Pop(); |
3262 } // CSmsInformationElement::ExternalizeL |
3263 } // CSmsInformationElement::ExternalizeL |
3263 |
3264 |
3264 |
3265 |
3265 void CSmsInformationElement::ConstructL(const TDesC8& aData) |
3266 void CSmsInformationElement::ConstructL(const TDesC8& aData) |
3266 { |
3267 { |
3267 LOGGSMU1("CSmsInformationElement::ConstructL()"); |
3268 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSINFORMATIONELEMENT_CONSTRUCTL_1, "CSmsInformationElement::ConstructL()"); |
3268 |
3269 |
3269 NewDataL(aData.Length()); |
3270 NewDataL(aData.Length()); |
3270 iData->Des().Copy(aData); |
3271 iData->Des().Copy(aData); |
3271 } // CSmsInformationElement::ConstructL |
3272 } // CSmsInformationElement::ConstructL |
3272 |
3273 |
3273 |
3274 |
3274 void CSmsInformationElement::NewDataL(TInt aLength) |
3275 void CSmsInformationElement::NewDataL(TInt aLength) |
3275 { |
3276 { |
3276 LOGGSMU1("CSmsInformationElement::NewDataL()"); |
3277 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSINFORMATIONELEMENT_NEWDATAL_1, "CSmsInformationElement::NewDataL()"); |
3277 |
3278 |
3278 HBufC8* data=HBufC8::NewL(aLength); |
3279 HBufC8* data=HBufC8::NewL(aLength); |
3279 delete iData; |
3280 delete iData; |
3280 iData=data; |
3281 iData=data; |
3281 iData->Des().SetLength(aLength); |
3282 iData->Des().SetLength(aLength); |
3282 } // CSmsInformationElement::NewDataL |
3283 } // CSmsInformationElement::NewDataL |
3283 |
3284 |
3284 |
3285 |
3285 TUint CSmsInformationElement::Length()const |
3286 TUint CSmsInformationElement::Length()const |
3286 { |
3287 { |
3287 LOGGSMU1("CSmsInformationElement::Length()"); |
3288 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSINFORMATIONELEMENT_LENGTH_1, "CSmsInformationElement::Length()"); |
3288 |
3289 |
3289 return 2+iData->Length(); // 2 stands for IEID and IEDL |
3290 return 2+iData->Length(); // 2 stands for IEID and IEDL |
3290 } // CSmsInformationElement::Length |
3291 } // CSmsInformationElement::Length |
3291 |
3292 |
3292 |
3293 |
3403 * ETrue if successful, EFalse if an information identifier is unknown or cannot |
3404 * ETrue if successful, EFalse if an information identifier is unknown or cannot |
3404 * be mapped. |
3405 * be mapped. |
3405 */ |
3406 */ |
3406 TBool TSmsInformationElementCategories::GetCategoryDefinition(TInformationElementId aId, TInformationElementCategory& aCategory) |
3407 TBool TSmsInformationElementCategories::GetCategoryDefinition(TInformationElementId aId, TInformationElementCategory& aCategory) |
3407 { |
3408 { |
3408 LOGGSMU1("TSmsInformationElementCategories::GetCategoryDefinition"); |
3409 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSINFORMATIONELEMENTCATEGORIES_GETCATEGORYDEFINITION_1, "TSmsInformationElementCategories::GetCategoryDefinition"); |
3409 TInt index; |
3410 TInt index; |
3410 |
3411 |
3411 if (TranslateCategoryToIndex(aId,index)) |
3412 if (TranslateCategoryToIndex(aId,index)) |
3412 { |
3413 { |
3413 aCategory = categories[index]; |
3414 aCategory = categories[index]; |
3414 } |
3415 } |
3415 else |
3416 else |
3416 { |
3417 { |
3417 LOGGSMU2("TSmsInformationElementCategories::GetCategoryDefinition, Failure, aId = %d", aId); |
3418 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TSMSINFORMATIONELEMENTCATEGORIES_GETCATEGORYDEFINITION_2, "TSmsInformationElementCategories::GetCategoryDefinition, Failure, aId = %d", aId); |
3418 return EFalse; |
3419 return EFalse; |
3419 } |
3420 } |
3420 |
3421 |
3421 return ETrue; |
3422 return ETrue; |
3422 } // TSmsInformationElementCategories::GetCategoryDefinition |
3423 } // TSmsInformationElementCategories::GetCategoryDefinition |
3434 }; |
3435 }; |
3435 |
3436 |
3436 |
3437 |
3437 CSmsUserData* CSmsUserData::NewL(CCnvCharacterSetConverter& aCharacterSetConverter,RFs& aFs,TSmsFirstOctet& aFirstOctet,const TSmsDataCodingScheme& aDataCodingScheme) |
3438 CSmsUserData* CSmsUserData::NewL(CCnvCharacterSetConverter& aCharacterSetConverter,RFs& aFs,TSmsFirstOctet& aFirstOctet,const TSmsDataCodingScheme& aDataCodingScheme) |
3438 { |
3439 { |
3439 LOGGSMU1("CSmsUserData::NewL()"); |
3440 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSUSERDATA_NEWL_1, "CSmsUserData::NewL()"); |
3440 |
3441 |
3441 CSmsUserData* userdata=new(ELeave) CSmsUserData(aCharacterSetConverter,aFs,aFirstOctet,aDataCodingScheme); |
3442 CSmsUserData* userdata=new(ELeave) CSmsUserData(aCharacterSetConverter,aFs,aFirstOctet,aDataCodingScheme); |
3442 CleanupStack::PushL(userdata); |
3443 CleanupStack::PushL(userdata); |
3443 userdata->ConstructL(); |
3444 userdata->ConstructL(); |
3444 CleanupStack::Pop(); |
3445 CleanupStack::Pop(); |
3463 * @return Information element |
3464 * @return Information element |
3464 * @capability None |
3465 * @capability None |
3465 */ |
3466 */ |
3466 EXPORT_C CSmsInformationElement& CSmsUserData::InformationElement(TInt aIndex) const |
3467 EXPORT_C CSmsInformationElement& CSmsUserData::InformationElement(TInt aIndex) const |
3467 { |
3468 { |
3468 LOGGSMU1("CSmsUserData::InformationElement()"); |
3469 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CSMSUSERDATA_INFORMATIONELEMENT_1, "CSmsUserData::InformationElement()"); |
3469 |
3470 |
3470 return *iInformationElementArray[aIndex]; |
3471 return *iInformationElementArray[aIndex]; |
3471 } // CSmsUserData::InformationElement |
3472 } // CSmsUserData::InformationElement |
3472 |
3473 |
3473 |
3474 |
3474 CSmsInformationElement*& CSmsUserData::InformationElementPtr(TInt aIndex) |
3475 CSmsInformationElement*& CSmsUserData::InformationElementPtr(TInt aIndex) |
3475 { |
3476 { |
3476 LOGGSMU1("CSmsUserData::InformationElementPtr()"); |
3477 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSUSERDATA_INFORMATIONELEMENTPTR_1, "CSmsUserData::InformationElementPtr()"); |
3477 |
3478 |
3478 return iInformationElementArray[aIndex]; |
3479 return iInformationElementArray[aIndex]; |
3479 } // CSmsUserData::InformationElementPtr |
3480 } // CSmsUserData::InformationElementPtr |
3480 |
3481 |
3481 |
3482 |
3569 * by the calling function, regardless of the return code. |
3570 * by the calling function, regardless of the return code. |
3570 * @param aInformationElement An EMS Information Element |
3571 * @param aInformationElement An EMS Information Element |
3571 */ |
3572 */ |
3572 TBool CSmsUserData::EmsInformationElementWillFitL(CEmsInformationElement* aIe,CSmsEMSBufferSegmenter& aSeg,TUint& aCharsAddedToCurrentPDU) |
3573 TBool CSmsUserData::EmsInformationElementWillFitL(CEmsInformationElement* aIe,CSmsEMSBufferSegmenter& aSeg,TUint& aCharsAddedToCurrentPDU) |
3573 { |
3574 { |
3574 LOGGSMU1("CSmsUserData::EmsInformationElementWillFitL()"); |
3575 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSUSERDATA_EMSINFORMATIONELEMENTWILLFITL_1, "CSmsUserData::EmsInformationElementWillFitL()"); |
3575 |
3576 |
3576 // Before using an EmsInformationElement polymorphically as an SmsIE, |
3577 // Before using an EmsInformationElement polymorphically as an SmsIE, |
3577 // we need to make sure that the IE has been encoded |
3578 // we need to make sure that the IE has been encoded |
3578 aIe->EncodeInformationElementL(); |
3579 aIe->EncodeInformationElementL(); |
3579 iInformationElementArray.AppendL(aIe); |
3580 iInformationElementArray.AppendL(aIe); |
3665 * KErrNotSupported if the information element is not supported via this interface. |
3666 * KErrNotSupported if the information element is not supported via this interface. |
3666 * @capability None |
3667 * @capability None |
3667 */ |
3668 */ |
3668 EXPORT_C void CSmsUserData::AddInformationElementL(TSmsId aIdentifier,const TDesC8& aData) |
3669 EXPORT_C void CSmsUserData::AddInformationElementL(TSmsId aIdentifier,const TDesC8& aData) |
3669 { |
3670 { |
3670 LOGGSMU1("CSmsUserData::AddInformationElementL"); |
3671 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CSMSUSERDATA_ADDINFORMATIONELEMENTL_1, "CSmsUserData::AddInformationElementL"); |
3671 |
3672 |
3672 if ((aIdentifier >= 0x21) && (aIdentifier <= 0x23) || |
3673 if ((aIdentifier >= 0x21) && (aIdentifier <= 0x23) || |
3673 (aIdentifier >= 0x26) && (aIdentifier <= 0x6F) || |
3674 (aIdentifier >= 0x26) && (aIdentifier <= 0x6F) || |
3674 (aIdentifier >= 0xA0) && (aIdentifier <= 0xBF) || |
3675 (aIdentifier >= 0xA0) && (aIdentifier <= 0xBF) || |
3675 (aIdentifier >= 0xE0) && (aIdentifier <= 0xFF)) |
3676 (aIdentifier >= 0xE0) && (aIdentifier <= 0xFF)) |
3690 * @param aIdentifier An information element Identifier for aData |
3691 * @param aIdentifier An information element Identifier for aData |
3691 * @param aData The information element to add to the User Data |
3692 * @param aData The information element to add to the User Data |
3692 */ |
3693 */ |
3693 void CSmsUserData::UpdateInformationElementArrayL(TSmsId aIdentifier,const TDesC8& aData) |
3694 void CSmsUserData::UpdateInformationElementArrayL(TSmsId aIdentifier,const TDesC8& aData) |
3694 { |
3695 { |
3695 LOGGSMU1("CSmsUserData::UpdateInformationElementsL"); |
3696 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSUSERDATA_UPDATEINFORMATIONELEMENTARRAYL_1, "CSmsUserData::UpdateInformationElementsL"); |
3696 |
3697 |
3697 TInt count=NumInformationElements(); |
3698 TInt count=NumInformationElements(); |
3698 if(!CEmsFactory::Supported(aIdentifier)) |
3699 if(!CEmsFactory::Supported(aIdentifier)) |
3699 { |
3700 { |
3700 for (TInt i=0; i<count; i++) |
3701 for (TInt i=0; i<count; i++) |
3712 { |
3713 { |
3713 case TSmsInformationElementCategories::ECtrlMandatoryInEveryPDUMultipleInstancesPerPDU: |
3714 case TSmsInformationElementCategories::ECtrlMandatoryInEveryPDUMultipleInstancesPerPDU: |
3714 { |
3715 { |
3715 if (InformationElement(i).Identifier() == CSmsInformationElement::ESmsIEISpecialSMSMessageIndication) |
3716 if (InformationElement(i).Identifier() == CSmsInformationElement::ESmsIEISpecialSMSMessageIndication) |
3716 { |
3717 { |
3717 LOGGSMU3("CSmsUserData::AddInformationElementL1 category = %d, identifier = %d",category,aIdentifier); |
3718 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSUSERDATA_UPDATEINFORMATIONELEMENTARRAYL_2, "CSmsUserData::AddInformationElementL1 category = %d, identifier = %d",category,aIdentifier); |
3718 |
3719 |
3719 //if Msg type is the same, swap with the most recent value |
3720 //if Msg type is the same, swap with the most recent value |
3720 if ((InformationElement(i).Data()[0] & ((TUint8) EGsmSmsSpecialMessageIndicationTypeMask)) == |
3721 if ((InformationElement(i).Data()[0] & ((TUint8) EGsmSmsSpecialMessageIndicationTypeMask)) == |
3721 (aData[0] & ((TUint8) EGsmSmsSpecialMessageIndicationTypeMask))) |
3722 (aData[0] & ((TUint8) EGsmSmsSpecialMessageIndicationTypeMask))) |
3722 { |
3723 { |
3723 User::Leave(KErrAlreadyExists); |
3724 User::Leave(KErrAlreadyExists); |
3724 } |
3725 } |
3725 } |
3726 } |
3726 else |
3727 else |
3727 { |
3728 { |
3728 LOGGSMU4("CSmsUserData::AddInformationElementL3 category = %d, identifier = %d, data = %S",category,aIdentifier, &aData); |
3729 OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSUSERDATA_UPDATEINFORMATIONELEMENTARRAYL_3, "CSmsUserData::AddInformationElementL3 category = %d, identifier = %d, data = %s",category,aIdentifier, aData); |
3729 User::Leave(KErrArgument); |
3730 User::Leave(KErrArgument); |
3730 } |
3731 } |
3731 break; |
3732 break; |
3732 } |
3733 } |
3733 case TSmsInformationElementCategories::ECtrlMandatoryInEveryPDUAndWithIdenticalValues: |
3734 case TSmsInformationElementCategories::ECtrlMandatoryInEveryPDUAndWithIdenticalValues: |
3734 case TSmsInformationElementCategories::ECtrlMandatoryIn1stPDUOnly: |
3735 case TSmsInformationElementCategories::ECtrlMandatoryIn1stPDUOnly: |
3735 case TSmsInformationElementCategories::ECtrlSingleInstanceOnly: |
3736 case TSmsInformationElementCategories::ECtrlSingleInstanceOnly: |
3736 { |
3737 { |
3737 LOGGSMU3("CSmsUserData::AddInformationElementL4 category = %d, identifier = %d",category,aIdentifier); |
3738 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSUSERDATA_UPDATEINFORMATIONELEMENTARRAYL_4, "CSmsUserData::AddInformationElementL4 category = %d, identifier = %d",category,aIdentifier); |
3738 User::Leave(KErrAlreadyExists); |
3739 User::Leave(KErrAlreadyExists); |
3739 break; |
3740 break; |
3740 } |
3741 } |
3741 case TSmsInformationElementCategories::ECtrlMultipleInstancesAllowed: |
3742 case TSmsInformationElementCategories::ECtrlMultipleInstancesAllowed: |
3742 { |
3743 { |
3743 LOGGSMU3("CSmsUserData::AddInformationElementL5 category = %d, identifier = %d",category,aIdentifier); |
3744 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSUSERDATA_UPDATEINFORMATIONELEMENTARRAYL_5, "CSmsUserData::AddInformationElementL5 category = %d, identifier = %d",category,aIdentifier); |
3744 break; |
3745 break; |
3745 } |
3746 } |
3746 case TSmsInformationElementCategories::ECtrlMandatoryInEveryPDUButWithValueSpecificToPDU: |
3747 case TSmsInformationElementCategories::ECtrlMandatoryInEveryPDUButWithValueSpecificToPDU: |
3747 { |
3748 { |
3748 LOGGSMU3("CSmsUserData::AddInformationElementL6 category = %d, identifier = %d",category,aIdentifier); |
3749 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSUSERDATA_UPDATEINFORMATIONELEMENTARRAYL_6, "CSmsUserData::AddInformationElementL6 category = %d, identifier = %d",category,aIdentifier); |
3749 User::Leave(KErrAlreadyExists); |
3750 User::Leave(KErrAlreadyExists); |
3750 // currently the email header is updated in: |
3751 // currently the email header is updated in: |
3751 // void CSmsMessage::DecodeBufferL(CArrayPtr<CSmsPDU>& aSmsPDUArray,CSmsBufferBase& aBuffer) |
3752 // void CSmsMessage::DecodeBufferL(CArrayPtr<CSmsPDU>& aSmsPDUArray,CSmsBufferBase& aBuffer) |
3752 break; |
3753 break; |
3753 } |
3754 } |
3754 default: |
3755 default: |
3755 { |
3756 { |
3756 LOGGSMU3("CSmsUserData::AddInformationElementL8 category = %d, identifier = %d",category,aIdentifier); |
3757 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSUSERDATA_UPDATEINFORMATIONELEMENTARRAYL_7, "CSmsUserData::AddInformationElementL8 category = %d, identifier = %d",category,aIdentifier); |
3757 User::Leave(KErrNotSupported); |
3758 User::Leave(KErrNotSupported); |
3758 break; |
3759 break; |
3759 } |
3760 } |
3760 } |
3761 } |
3761 } |
3762 } |
3770 } // CSmsUserData::UpdateInformationElementArrayL |
3771 } // CSmsUserData::UpdateInformationElementArrayL |
3771 |
3772 |
3772 |
3773 |
3773 void CSmsUserData::AddEmsInformationElementL(CEmsInformationElement* aIe) |
3774 void CSmsUserData::AddEmsInformationElementL(CEmsInformationElement* aIe) |
3774 { |
3775 { |
3775 LOGGSMU1("CSmsUserData::AddEmsInformationElementL()"); |
3776 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSUSERDATA_ADDEMSINFORMATIONELEMENTL_1, "CSmsUserData::AddEmsInformationElementL()"); |
3776 |
3777 |
3777 // Before using an EmsInformationElement polymorphically as an SmsIE, |
3778 // Before using an EmsInformationElement polymorphically as an SmsIE, |
3778 // we need to make sure that the IE has been encoded |
3779 // we need to make sure that the IE has been encoded |
3779 aIe->EncodeInformationElementL(); |
3780 aIe->EncodeInformationElementL(); |
3780 iInformationElementArray.AppendL(aIe); |
3781 iInformationElementArray.AppendL(aIe); |
3788 * @param aIndex Information element index |
3789 * @param aIndex Information element index |
3789 * @capability None |
3790 * @capability None |
3790 */ |
3791 */ |
3791 EXPORT_C void CSmsUserData::RemoveInformationElement(TInt aIndex) |
3792 EXPORT_C void CSmsUserData::RemoveInformationElement(TInt aIndex) |
3792 { |
3793 { |
3793 LOGGSMU1("CSmsUserData::RemoveInformationElement()"); |
3794 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CSMSUSERDATA_REMOVEINFORMATIONELEMENT_1, "CSmsUserData::RemoveInformationElement()"); |
3794 // Since iInformationElementArray[aIndex] pointer is removed from iInformationElementArray, there is no double free issue. |
3795 // Since iInformationElementArray[aIndex] pointer is removed from iInformationElementArray, there is no double free issue. |
3795 // coverity[double_free] |
3796 // coverity[double_free] |
3796 delete iInformationElementArray[aIndex]; |
3797 delete iInformationElementArray[aIndex]; |
3797 iInformationElementArray[aIndex] = NULL; |
3798 iInformationElementArray[aIndex] = NULL; |
3798 iInformationElementArray.Delete(aIndex); |
3799 iInformationElementArray.Delete(aIndex); |
3989 * @capability None |
3990 * @capability None |
3990 */ |
3991 */ |
3991 EXPORT_C TBool CSmsUserData::IsSupportedL(const TDesC& aDes, TInt& aNumberOfUnconvertibleCharacters, |
3992 EXPORT_C TBool CSmsUserData::IsSupportedL(const TDesC& aDes, TInt& aNumberOfUnconvertibleCharacters, |
3992 TInt& aIndexOfFirstUnconvertibleCharacter) const |
3993 TInt& aIndexOfFirstUnconvertibleCharacter) const |
3993 { |
3994 { |
3994 LOGGSMU1("[1] CSmsUserData::IsSupportedL()"); |
3995 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CSMSUSERDATA_ISSUPPORTEDL1_1, "[1] CSmsUserData::IsSupportedL()"); |
3995 |
3996 |
3996 CSmsAlphabetConverter* converter=CSmsAlphabetConverter::NewLC(iCharacterSetConverter,iFs,iDataCodingScheme.Alphabet(),IsBinaryData()); |
3997 CSmsAlphabetConverter* converter=CSmsAlphabetConverter::NewLC(iCharacterSetConverter,iFs,iDataCodingScheme.Alphabet(),IsBinaryData()); |
3997 TBool result=converter->IsSupportedL(aDes, aNumberOfUnconvertibleCharacters, |
3998 TBool result=converter->IsSupportedL(aDes, aNumberOfUnconvertibleCharacters, |
3998 aIndexOfFirstUnconvertibleCharacter); |
3999 aIndexOfFirstUnconvertibleCharacter); |
3999 CleanupStack::PopAndDestroy(); |
4000 CleanupStack::PopAndDestroy(); |
4026 TInt& aNumberOfUnconvertibleCharacters, |
4027 TInt& aNumberOfUnconvertibleCharacters, |
4027 TInt& aNumberOfDowngradedCharacters, |
4028 TInt& aNumberOfDowngradedCharacters, |
4028 TInt& aNumberRequiringAlternativeEncoding, |
4029 TInt& aNumberRequiringAlternativeEncoding, |
4029 TInt& aIndexOfFirstUnconvertibleCharacter) const |
4030 TInt& aIndexOfFirstUnconvertibleCharacter) const |
4030 { |
4031 { |
4031 LOGGSMU1("[2] CSmsUserData::IsSupportedL()"); |
4032 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CSMSUSERDATA_ISSUPPORTEDL2_1, "[2] CSmsUserData::IsSupportedL()"); |
4032 |
4033 |
4033 CSmsAlphabetConverter* converter=CSmsAlphabetConverter::NewLC(iCharacterSetConverter,iFs,iDataCodingScheme.Alphabet(),IsBinaryData()); |
4034 CSmsAlphabetConverter* converter=CSmsAlphabetConverter::NewLC(iCharacterSetConverter,iFs,iDataCodingScheme.Alphabet(),IsBinaryData()); |
4034 TBool result=converter->IsSupportedL(aDes, aEncoding, |
4035 TBool result=converter->IsSupportedL(aDes, aEncoding, |
4035 aNumberOfUnconvertibleCharacters, |
4036 aNumberOfUnconvertibleCharacters, |
4036 aNumberOfDowngradedCharacters, |
4037 aNumberOfDowngradedCharacters, |
4042 } // CSmsUserData::IsSupportedL |
4043 } // CSmsUserData::IsSupportedL |
4043 |
4044 |
4044 |
4045 |
4045 TUint8* CSmsUserData::EncodeL(TUint8* aPtr) const |
4046 TUint8* CSmsUserData::EncodeL(TUint8* aPtr) const |
4046 { |
4047 { |
4047 LOGGSMU1("CSmsUserData::EncodeL()"); |
4048 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSUSERDATA_ENCODEL_1, "CSmsUserData::EncodeL()"); |
4048 |
4049 |
4049 __ASSERT_DEBUG(0<=MaxPackedUDUnitsInBodyRemaining(),Panic(KGsmuPanicUserDataBodyTooLong)); |
4050 __ASSERT_DEBUG(0<=MaxPackedUDUnitsInBodyRemaining(),Panic(KGsmuPanicUserDataBodyTooLong)); |
4050 // Encode the user data length |
4051 // Encode the user data length |
4051 TInt totalHeaderLengthInUDLUnits=TotalHeaderLengthInUDLUnits(); |
4052 TInt totalHeaderLengthInUDLUnits=TotalHeaderLengthInUDLUnits(); |
4052 TSmsOctet userDataLength=totalHeaderLengthInUDLUnits+TSmsOctet(BodyLengthInUDLUnits()); |
4053 TSmsOctet userDataLength=totalHeaderLengthInUDLUnits+TSmsOctet(BodyLengthInUDLUnits()); |
4194 * @return Pointer to the newly created CSmsUserData object. |
4195 * @return Pointer to the newly created CSmsUserData object. |
4195 */ |
4196 */ |
4196 CSmsUserData* CSmsUserData::DuplicateL(TSmsFirstOctet& aFirstOctet, |
4197 CSmsUserData* CSmsUserData::DuplicateL(TSmsFirstOctet& aFirstOctet, |
4197 const TSmsDataCodingScheme& aDataCodingScheme) const |
4198 const TSmsDataCodingScheme& aDataCodingScheme) const |
4198 { |
4199 { |
4199 LOGGSMU1("CSmsUserData::DuplicateL()"); |
4200 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSUSERDATA_DUPLICATEL_1, "CSmsUserData::DuplicateL()"); |
4200 |
4201 |
4201 CSmsUserData* userdata = CSmsUserData::NewL(iCharacterSetConverter, iFs, |
4202 CSmsUserData* userdata = CSmsUserData::NewL(iCharacterSetConverter, iFs, |
4202 aFirstOctet, aDataCodingScheme); |
4203 aFirstOctet, aDataCodingScheme); |
4203 CleanupStack::PushL(userdata); |
4204 CleanupStack::PushL(userdata); |
4204 |
4205 |
4266 { |
4267 { |
4267 totalheaderlengthinudlunits=totalheaderlength; |
4268 totalheaderlengthinudlunits=totalheaderlength; |
4268 break; |
4269 break; |
4269 } |
4270 } |
4270 default: |
4271 default: |
4271 LOGGSMU1("CSmsUserData::TotalHeaderLengthInUDLUnits() WARNING default case has been reached"); |
4272 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSUSERDATA_TOTALHEADERLENGTHINUDLUNITS_2, "CSmsUserData::TotalHeaderLengthInUDLUnits() WARNING default case has been reached"); |
4272 break; |
4273 break; |
4273 } |
4274 } |
4274 } |
4275 } |
4275 } |
4276 } |
4276 return totalheaderlengthinudlunits; |
4277 return totalheaderlengthinudlunits; |
4277 } // CSmsUserData::TotalHeaderLengthInUDLUnits |
4278 } // CSmsUserData::TotalHeaderLengthInUDLUnits |
4278 |
4279 |
4279 |
4280 |
4280 TInt CSmsUserData::TotalHeaderLengthInUDLUnits(TInt aIElen) const |
4281 TInt CSmsUserData::TotalHeaderLengthInUDLUnits(TInt aIElen) const |
4281 { |
4282 { |
4282 LOGGSMU1("CSmsUserData::TotalHeaderLengthInUDLUnits()"); |
4283 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSUSERDATA_TOTALHEADERLENGTHINUDLUNITS1_1, "CSmsUserData::TotalHeaderLengthInUDLUnits()"); |
4283 |
4284 |
4284 TInt totalheaderlengthinudlunits=0; |
4285 TInt totalheaderlengthinudlunits=0; |
4285 TInt totalheaderlength=aIElen; |
4286 TInt totalheaderlength=aIElen; |
4286 |
4287 |
4287 if (iInformationElementArray.Count()>0) |
4288 if (iInformationElementArray.Count()>0) |
4316 } // CSmsUserData::TotalHeaderLengthInUDLUnits |
4317 } // CSmsUserData::TotalHeaderLengthInUDLUnits |
4317 |
4318 |
4318 |
4319 |
4319 TInt CSmsUserData::BodyLengthInUDLUnits() const |
4320 TInt CSmsUserData::BodyLengthInUDLUnits() const |
4320 { |
4321 { |
4321 LOGGSMU1("CSmsUserData::BodyLengthInUDLUnits()"); |
4322 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSUSERDATA_BODYLENGTHINUDLUNITS_1, "CSmsUserData::BodyLengthInUDLUnits()"); |
4322 |
4323 |
4323 return iBody->Des().Length(); |
4324 return iBody->Des().Length(); |
4324 } // CSmsUserData::BodyLengthInUDLUnits |
4325 } // CSmsUserData::BodyLengthInUDLUnits |
4325 |
4326 |
4326 |
4327 |
4327 void CSmsUserData::NewBodyL(TInt aLength) |
4328 void CSmsUserData::NewBodyL(TInt aLength) |
4328 { |
4329 { |
4329 LOGGSMU1("CSmsUserData::NewBodyL()"); |
4330 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSUSERDATA_NEWBODYL_1, "CSmsUserData::NewBodyL()"); |
4330 |
4331 |
4331 |
4332 |
4332 HBufC8* body=HBufC8::NewL(aLength); |
4333 HBufC8* body=HBufC8::NewL(aLength); |
4333 delete iBody; |
4334 delete iBody; |
4334 iBody=body; |
4335 iBody=body; |
4337 } // CSmsUserData::NewBodyL |
4338 } // CSmsUserData::NewBodyL |
4338 |
4339 |
4339 |
4340 |
4340 TBool CSmsUserData::HeaderPresent() const |
4341 TBool CSmsUserData::HeaderPresent() const |
4341 { |
4342 { |
4342 LOGGSMU1("CSmsUserData::HeaderPresent()"); |
4343 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSUSERDATA_HEADERPRESENT_1, "CSmsUserData::HeaderPresent()"); |
4343 |
4344 |
4344 return (iFirstOctet&TSmsFirstOctet::ESmsUDHIMask)==TSmsFirstOctet::ESmsUDHIHeaderPresent; |
4345 return (iFirstOctet&TSmsFirstOctet::ESmsUDHIMask)==TSmsFirstOctet::ESmsUDHIHeaderPresent; |
4345 } // CSmsUserData::HeaderPresent |
4346 } // CSmsUserData::HeaderPresent |
4346 |
4347 |
4347 |
4348 |
4348 void CSmsUserData::SetHeaderPresent(TBool aHeaderPresent) |
4349 void CSmsUserData::SetHeaderPresent(TBool aHeaderPresent) |
4349 { |
4350 { |
4350 LOGGSMU1("CSmsUserData::SetHeaderPresent()"); |
4351 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSUSERDATA_SETHEADERPRESENT_1, "CSmsUserData::SetHeaderPresent()"); |
4351 |
4352 |
4352 iFirstOctet=aHeaderPresent? (iFirstOctet&(~TSmsFirstOctet::ESmsUDHIMask))|TSmsFirstOctet::ESmsUDHIHeaderPresent: (iFirstOctet&(~TSmsFirstOctet::ESmsUDHIMask))|TSmsFirstOctet::ESmsUDHIHeaderNotPresent; |
4353 iFirstOctet=aHeaderPresent? (iFirstOctet&(~TSmsFirstOctet::ESmsUDHIMask))|TSmsFirstOctet::ESmsUDHIHeaderPresent: (iFirstOctet&(~TSmsFirstOctet::ESmsUDHIMask))|TSmsFirstOctet::ESmsUDHIHeaderNotPresent; |
4353 } // CSmsUserData::SetHeaderPresent |
4354 } // CSmsUserData::SetHeaderPresent |
4354 |
4355 |
4355 |
4356 |
4356 TBool CSmsUserData::IsBinaryData() const |
4357 TBool CSmsUserData::IsBinaryData() const |
4357 { |
4358 { |
4358 LOGGSMU1("CSmsUserData::IsBinaryData()"); |
4359 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSUSERDATA_ISBINARYDATA_1, "CSmsUserData::IsBinaryData()"); |
4359 |
4360 |
4360 TInt index=0; |
4361 TInt index=0; |
4361 return (iDataCodingScheme.TextCompressed()) || |
4362 return (iDataCodingScheme.TextCompressed()) || |
4362 ((iDataCodingScheme.Alphabet()==TSmsDataCodingScheme::ESmsAlphabet8Bit) && |
4363 ((iDataCodingScheme.Alphabet()==TSmsDataCodingScheme::ESmsAlphabet8Bit) && |
4363 (InformationElementIndex(CSmsInformationElement::ESmsIEIApplicationPortAddressing8Bit,index) || |
4364 (InformationElementIndex(CSmsInformationElement::ESmsIEIApplicationPortAddressing8Bit,index) || |
4738 * |
4739 * |
4739 * @capability None |
4740 * @capability None |
4740 */ |
4741 */ |
4741 EXPORT_C TBool CEnhancedVoiceMailBoxInformation::ExtensionIndicator() const |
4742 EXPORT_C TBool CEnhancedVoiceMailBoxInformation::ExtensionIndicator() const |
4742 { |
4743 { |
4743 LOGGSMU1("CEnhancedVoiceMailBoxInformation::ExtensionIndicator()"); |
4744 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CENHANCEDVOICEMAILBOXINFORMATION_EXTENSIONINDICATOR_1, "CEnhancedVoiceMailBoxInformation::ExtensionIndicator()"); |
4744 |
4745 |
4745 return iExtensionIndicator; |
4746 return iExtensionIndicator; |
4746 } // CEnhancedVoiceMailBoxInformation::ExtensionIndicator |
4747 } // CEnhancedVoiceMailBoxInformation::ExtensionIndicator |
4747 |
4748 |
4748 |
4749 |
4749 void CEnhancedVoiceMailBoxInformation::NewBufferL(TInt aLength) |
4750 void CEnhancedVoiceMailBoxInformation::NewBufferL(TInt aLength) |
4750 { |
4751 { |
4751 LOGGSMU2("CEnhancedVoiceMailBoxInformation::NewBufferL, length = %d",aLength); |
4752 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CENHANCEDVOICEMAILBOXINFORMATION_NEWBUFFERL_1, "CEnhancedVoiceMailBoxInformation::NewBufferL, length = %d",aLength); |
4752 |
4753 |
4753 HBufC* buffer=HBufC::NewL(aLength); |
4754 HBufC* buffer=HBufC::NewL(aLength); |
4754 delete iAccessAddress; |
4755 delete iAccessAddress; |
4755 iAccessAddress=buffer; |
4756 iAccessAddress=buffer; |
4756 iAccessAddress->Des().SetLength(aLength); |
4757 iAccessAddress->Des().SetLength(aLength); |
4931 ((((TUint8) iStorage) & EMask1Bit ) << 4) + |
4932 ((((TUint8) iStorage) & EMask1Bit ) << 4) + |
4932 ((((TUint8) iAlmostFull) & EMask1Bit ) << 5) + |
4933 ((((TUint8) iAlmostFull) & EMask1Bit ) << 5) + |
4933 ((((TUint8) iFull) & EMask1Bit ) << 6) + |
4934 ((((TUint8) iFull) & EMask1Bit ) << 6) + |
4934 (((TUint8) iExtensionIndicator ) << 7); |
4935 (((TUint8) iExtensionIndicator ) << 7); |
4935 |
4936 |
4936 LOGGSMU2("CEnhancedVoiceMailBoxInformation::EncodeL 1st byte = %d",*aPtr); |
4937 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CENHANCEDVOICEMAILBOXINFORMATION_ENCODEL_1, "CEnhancedVoiceMailBoxInformation::EncodeL 1st byte = %d",*aPtr); |
4937 aPtr++; |
4938 aPtr++; |
4938 |
4939 |
4939 // Create an address object to encode the mail box access address into the |
4940 // Create an address object to encode the mail box access address into the |
4940 // format required by 23.040 v6.5.0 section 9.1.2.5. |
4941 // format required by 23.040 v6.5.0 section 9.1.2.5. |
4941 CSmsAddress* address = CSmsAddress::NewL(aCharacterSetConverter,aFs); |
4942 CSmsAddress* address = CSmsAddress::NewL(aCharacterSetConverter,aFs); |
4965 iStorage = (TBool) ((Byte1 >> 4) & EMask1Bit); |
4966 iStorage = (TBool) ((Byte1 >> 4) & EMask1Bit); |
4966 iAlmostFull = (TBool) ((Byte1 >> 5) & EMask1Bit); |
4967 iAlmostFull = (TBool) ((Byte1 >> 5) & EMask1Bit); |
4967 iFull = (TBool) ((Byte1 >> 6) & EMask1Bit); |
4968 iFull = (TBool) ((Byte1 >> 6) & EMask1Bit); |
4968 iExtensionIndicator = (TBool) ((Byte1 >> 7) & EMask1Bit); |
4969 iExtensionIndicator = (TBool) ((Byte1 >> 7) & EMask1Bit); |
4969 |
4970 |
4970 LOGGSMU2("CEnhancedVoiceMailBoxInformation::DecodeL 1st byte = %d", Byte1); |
4971 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CENHANCEDVOICEMAILBOXINFORMATION_DECODEL_1, "CEnhancedVoiceMailBoxInformation::DecodeL 1st byte = %d", Byte1); |
4971 |
4972 |
4972 // Create an address object to deccode the mail box access address from the |
4973 // Create an address object to deccode the mail box access address from the |
4973 // format required by 23.040 v6.5.0 section 9.1.2.5. |
4974 // format required by 23.040 v6.5.0 section 9.1.2.5. |
4974 CSmsAddress* decodedAddress = CSmsAddress::NewL(aCharacterSetConverter,aFs); |
4975 CSmsAddress* decodedAddress = CSmsAddress::NewL(aCharacterSetConverter,aFs); |
4975 CleanupStack::PushL(decodedAddress); |
4976 CleanupStack::PushL(decodedAddress); |
5010 iTypeOfAddress = decodedAddress->TypeOfAddress(); |
5011 iTypeOfAddress = decodedAddress->TypeOfAddress(); |
5011 |
5012 |
5012 CleanupStack::PopAndDestroy(decodedAddress); |
5013 CleanupStack::PopAndDestroy(decodedAddress); |
5013 |
5014 |
5014 iNumberOfVoiceMessages = aVoiceMailInfo.GetL(); |
5015 iNumberOfVoiceMessages = aVoiceMailInfo.GetL(); |
5015 LOGGSMU2("CEnhancedVoiceMailBoxInformation::DecodeL iNumberOfVoiceMessages = %d", iNumberOfVoiceMessages); |
5016 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CENHANCEDVOICEMAILBOXINFORMATION_DECODEL_2, "CEnhancedVoiceMailBoxInformation::DecodeL iNumberOfVoiceMessages = %d", iNumberOfVoiceMessages); |
5016 } // CEnhancedVoiceMailBoxInformation::DecodeL |
5017 } // CEnhancedVoiceMailBoxInformation::DecodeL |
5017 |
5018 |
5018 |
5019 |
5019 CEnhancedVoiceMailBoxInformation::CEnhancedVoiceMailBoxInformation() |
5020 CEnhancedVoiceMailBoxInformation::CEnhancedVoiceMailBoxInformation() |
5020 { |
5021 { |
5021 LOGGSMU1("CEnhancedVoiceMailBoxInformation::CEnhancedVoiceMailBoxInformation()"); |
5022 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CENHANCEDVOICEMAILBOXINFORMATION_CTOR_1, "CEnhancedVoiceMailBoxInformation::CEnhancedVoiceMailBoxInformation()"); |
5022 |
5023 |
5023 // Consider changing this over to a Panic. |
5024 // Consider changing this over to a Panic. |
5024 iType = EGsmSmsVoiceMailNotification; |
5025 iType = EGsmSmsVoiceMailNotification; |
5025 iOctet1Bit1 = EFalse; |
5026 iOctet1Bit1 = EFalse; |
5026 iProfile = EGsmSmsProfileId1; |
5027 iProfile = EGsmSmsProfileId1; |
5092 */ |
5093 */ |
5093 void CEnhancedVoiceMailBoxInformation::operator=(const CEnhancedVoiceMailBoxInformation&) |
5094 void CEnhancedVoiceMailBoxInformation::operator=(const CEnhancedVoiceMailBoxInformation&) |
5094 { |
5095 { |
5095 // Ignore in code coverage - not intended to be used |
5096 // Ignore in code coverage - not intended to be used |
5096 BULLSEYE_OFF |
5097 BULLSEYE_OFF |
5097 LOGGSMU1("CEnhancedVoiceMailBoxInformation::operator="); |
5098 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CENHANCEDVOICEMAILBOXINFORMATION_OPERATOR1_1, "CEnhancedVoiceMailBoxInformation::operator="); |
5098 Panic(KGsmuPanicMethodBodyNotImplemented); |
5099 Panic(KGsmuPanicMethodBodyNotImplemented); |
5099 BULLSEYE_RESTORE |
5100 BULLSEYE_RESTORE |
5100 } |
5101 } |
5101 |
5102 |
5102 void CEnhancedVoiceMailBoxInformation::ConstructL() |
5103 void CEnhancedVoiceMailBoxInformation::ConstructL() |
5103 { |
5104 { |
5104 LOGGSMU1("CEnhancedVoiceMailBoxInformation::ConstructL()"); |
5105 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CENHANCEDVOICEMAILBOXINFORMATION_CONSTRUCTL_1, "CEnhancedVoiceMailBoxInformation::ConstructL()"); |
5105 |
5106 |
5106 NewBufferL(0); |
5107 NewBufferL(0); |
5107 } // CEnhancedVoiceMailBoxInformation::ConstructL |
5108 } // CEnhancedVoiceMailBoxInformation::ConstructL |
5108 |
5109 |
5109 |
5110 |
5110 CEnhancedVoiceMailBoxInformation::~CEnhancedVoiceMailBoxInformation() |
5111 CEnhancedVoiceMailBoxInformation::~CEnhancedVoiceMailBoxInformation() |
5111 { |
5112 { |
5112 LOGGSMU1("CEnhancedVoiceMailBoxInformation::~CEnhancedVoiceMailBoxInformation"); |
5113 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CENHANCEDVOICEMAILBOXINFORMATION_DTOR_1, "CEnhancedVoiceMailBoxInformation::~CEnhancedVoiceMailBoxInformation"); |
5113 delete iAccessAddress; |
5114 delete iAccessAddress; |
5114 } // CEnhancedVoiceMailBoxInformation::ConstructL |
5115 } // CEnhancedVoiceMailBoxInformation::ConstructL |
5115 |
5116 |
5116 |
5117 |
5117 CEnhancedVoiceMailBoxInformation* CEnhancedVoiceMailBoxInformation::NewL() |
5118 CEnhancedVoiceMailBoxInformation* CEnhancedVoiceMailBoxInformation::NewL() |
5118 { |
5119 { |
5119 LOGGSMU1("CEnhancedVoiceMailBoxInformation::NewL()"); |
5120 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CENHANCEDVOICEMAILBOXINFORMATION_NEWL_1, "CEnhancedVoiceMailBoxInformation::NewL()"); |
5120 |
5121 |
5121 CEnhancedVoiceMailBoxInformation* aCEnhancedVoiceMailBoxInformation=new(ELeave) CEnhancedVoiceMailBoxInformation(); |
5122 CEnhancedVoiceMailBoxInformation* aCEnhancedVoiceMailBoxInformation=new(ELeave) CEnhancedVoiceMailBoxInformation(); |
5122 CleanupStack::PushL(aCEnhancedVoiceMailBoxInformation); |
5123 CleanupStack::PushL(aCEnhancedVoiceMailBoxInformation); |
5123 aCEnhancedVoiceMailBoxInformation->ConstructL(); |
5124 aCEnhancedVoiceMailBoxInformation->ConstructL(); |
5124 CleanupStack::Pop(aCEnhancedVoiceMailBoxInformation); |
5125 CleanupStack::Pop(aCEnhancedVoiceMailBoxInformation); |
5292 * |
5293 * |
5293 * @capability None |
5294 * @capability None |
5294 */ |
5295 */ |
5295 EXPORT_C TBool CVoiceMailNotification::MessageExtensionIndication() const |
5296 EXPORT_C TBool CVoiceMailNotification::MessageExtensionIndication() const |
5296 { |
5297 { |
5297 LOGGSMU1("CVoiceMailNotification::MessageExtensionIndication()"); |
5298 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CVOICEMAILNOTIFICATION_MESSAGEEXTENSIONINDICATION_1, "CVoiceMailNotification::MessageExtensionIndication()"); |
5298 |
5299 |
5299 return iMessageExtensionIndicator; |
5300 return iMessageExtensionIndicator; |
5300 } // CVoiceMailNotification::MessageExtensionIndication |
5301 } // CVoiceMailNotification::MessageExtensionIndication |
5301 |
5302 |
5302 |
5303 |
5303 void CVoiceMailNotification::NewBufferL(TInt aLength) |
5304 void CVoiceMailNotification::NewBufferL(TInt aLength) |
5304 { |
5305 { |
5305 LOGGSMU1("CVoiceMailNotification::NewBufferL()"); |
5306 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CVOICEMAILNOTIFICATION_NEWBUFFERL_1, "CVoiceMailNotification::NewBufferL()"); |
5306 |
5307 |
5307 HBufC* buffer=HBufC::NewL(aLength); |
5308 HBufC* buffer=HBufC::NewL(aLength); |
5308 delete iCallingLineIdentity; |
5309 delete iCallingLineIdentity; |
5309 iCallingLineIdentity=buffer; |
5310 iCallingLineIdentity=buffer; |
5310 iCallingLineIdentity->Des().SetLength(aLength); |
5311 iCallingLineIdentity->Des().SetLength(aLength); |
5420 } // CVoiceMailNotification::ParsedCallingLineIdentity |
5421 } // CVoiceMailNotification::ParsedCallingLineIdentity |
5421 |
5422 |
5422 |
5423 |
5423 void CVoiceMailNotification::NewExtensionL(TInt aLength) |
5424 void CVoiceMailNotification::NewExtensionL(TInt aLength) |
5424 { |
5425 { |
5425 LOGGSMU1("CVoiceMailNotification::NewExtensionL()"); |
5426 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CVOICEMAILNOTIFICATION_NEWEXTENSIONL_1, "CVoiceMailNotification::NewExtensionL()"); |
5426 |
5427 |
5427 HBufC* buffer=HBufC::NewL(aLength); |
5428 HBufC* buffer=HBufC::NewL(aLength); |
5428 delete iExtension; |
5429 delete iExtension; |
5429 iExtension=buffer; |
5430 iExtension=buffer; |
5430 iExtension->Des().SetLength(aLength); |
5431 iExtension->Des().SetLength(aLength); |
5431 iExtension->Des().FillZ(); |
5432 iExtension->Des().FillZ(); |
5432 } // CVoiceMailNotification::NewExtensionL |
5433 } // CVoiceMailNotification::NewExtensionL |
5433 |
5434 |
5434 |
|
5435 /*void CVoiceMailNotification::SetExtension(TDesC& aExtension) |
|
5436 { |
|
5437 LOGGSMU1("CVoiceMailNotification::SetExtension()"); |
|
5438 |
|
5439 TInt length=aExtension.Length(); |
|
5440 NewExtensionL(length); |
|
5441 iExtension->Des().Copy(aExtension); |
|
5442 } // CVoiceMailNotification::SetExtension |
|
5443 |
|
5444 TPtrC CVoiceMailNotification::Extension() const |
|
5445 { |
|
5446 LOGGSMU1("CVoiceMailNotification::Extension()"); |
|
5447 |
|
5448 TPtrC ptr; |
|
5449 if (iExtension) |
|
5450 ptr.Set(iExtension->Des()); |
|
5451 return ptr; |
|
5452 }*/ |
|
5453 |
|
5454 |
|
5455 /** |
5435 /** |
5456 * @internalComponent |
5436 * @internalComponent |
5457 * |
5437 * |
5458 * Determines the size of the encoded Voice Mail Notification. |
5438 * Determines the size of the encoded Voice Mail Notification. |
5459 * |
5439 * |
5492 TUint8* CVoiceMailNotification::EncodeL(TUint8* aPtr, CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs) const |
5472 TUint8* CVoiceMailNotification::EncodeL(TUint8* aPtr, CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs) const |
5493 { |
5473 { |
5494 // When changes are made to this function that affect the |
5474 // When changes are made to this function that affect the |
5495 // number of bytes that are encoded, this should be reflected in |
5475 // number of bytes that are encoded, this should be reflected in |
5496 // CVoiceMailNotification::SizeL() |
5476 // CVoiceMailNotification::SizeL() |
5497 LOGGSMU1("CVoiceMailNotification::EncodeL"); |
5477 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CVOICEMAILNOTIFICATION_ENCODEL_1, "CVoiceMailNotification::EncodeL"); |
5498 |
5478 |
5499 |
5479 |
5500 *aPtr = (TUint8) (iMessageId >> 8); // Message Id MSB |
5480 *aPtr = (TUint8) (iMessageId >> 8); // Message Id MSB |
5501 aPtr++; |
5481 aPtr++; |
5502 *aPtr = (TUint8) iMessageId; // Message Id LSB |
5482 *aPtr = (TUint8) iMessageId; // Message Id LSB |
5632 */ |
5612 */ |
5633 void CVoiceMailNotification::operator=(const CVoiceMailNotification&) |
5613 void CVoiceMailNotification::operator=(const CVoiceMailNotification&) |
5634 { |
5614 { |
5635 // Ignore in code coverage - not intended to be used |
5615 // Ignore in code coverage - not intended to be used |
5636 BULLSEYE_OFF |
5616 BULLSEYE_OFF |
5637 LOGGSMU1("CVoiceMailNotification::operator="); |
5617 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CVOICEMAILNOTIFICATION_OPERATOR1_1, "CVoiceMailNotification::operator="); |
5638 Panic(KGsmuPanicMethodBodyNotImplemented); |
5618 Panic(KGsmuPanicMethodBodyNotImplemented); |
5639 BULLSEYE_RESTORE |
5619 BULLSEYE_RESTORE |
5640 } |
5620 } |
5641 |
5621 |
5642 CVoiceMailNotification::CVoiceMailNotification() |
5622 CVoiceMailNotification::CVoiceMailNotification() |
5643 { |
5623 { |
5644 LOGGSMU1("CVoiceMailNotification::CVoiceMailNotification()"); |
5624 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CVOICEMAILNOTIFICATION_CTOR1_1, "CVoiceMailNotification::CVoiceMailNotification()"); |
5645 |
5625 |
5646 iMessageId = 0; |
5626 iMessageId = 0; |
5647 iMessageLength = 0; |
5627 iMessageLength = 0; |
5648 iRetentionDays = 0; |
5628 iRetentionDays = 0; |
5649 iOctetN8Bit1 = EFalse; |
5629 iOctetN8Bit1 = EFalse; |
5660 * |
5640 * |
5661 * @capability None |
5641 * @capability None |
5662 */ |
5642 */ |
5663 EXPORT_C CVoiceMailNotification::~CVoiceMailNotification() |
5643 EXPORT_C CVoiceMailNotification::~CVoiceMailNotification() |
5664 { |
5644 { |
5665 LOGGSMU1("CVoiceMailNotification::~CVoiceMailNotification"); |
5645 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CVOICEMAILNOTIFICATION_DTOR_1, "CVoiceMailNotification::~CVoiceMailNotification"); |
5666 delete iCallingLineIdentity; |
5646 delete iCallingLineIdentity; |
5667 delete iExtension; |
5647 delete iExtension; |
5668 } // CVoiceMailNotification::CVoiceMailNotification |
5648 } // CVoiceMailNotification::CVoiceMailNotification |
5669 |
5649 |
5670 |
5650 |
5671 void CVoiceMailNotification::ConstructL() |
5651 void CVoiceMailNotification::ConstructL() |
5672 { |
5652 { |
5673 LOGGSMU1("CVoiceMailNotification::ConstructL()"); |
5653 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CVOICEMAILNOTIFICATION_CONSTRUCTL_1, "CVoiceMailNotification::ConstructL()"); |
5674 |
5654 |
5675 NewBufferL(0); |
5655 NewBufferL(0); |
5676 NewExtensionL(0); |
5656 NewExtensionL(0); |
5677 } // CVoiceMailNotification::ConstructL |
5657 } // CVoiceMailNotification::ConstructL |
5678 |
5658 |
5728 * |
5708 * |
5729 * @capability None |
5709 * @capability None |
5730 */ |
5710 */ |
5731 EXPORT_C TUint8 CEnhancedVoiceMailNotification::NumberOfVoiceMails() |
5711 EXPORT_C TUint8 CEnhancedVoiceMailNotification::NumberOfVoiceMails() |
5732 { |
5712 { |
5733 LOGGSMU1("CEnhancedVoiceMailNotification::NumberOfVoiceMails()"); |
5713 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CENHANCEDVOICEMAILNOTIFICATION_NUMBEROFVOICEMAILS_1, "CEnhancedVoiceMailNotification::NumberOfVoiceMails()"); |
5734 |
5714 |
5735 return (TUint8) iNotifications->Count(); |
5715 return (TUint8) iNotifications->Count(); |
5736 } // CEnhancedVoiceMailNotification::NumberOfVoiceMails |
5716 } // CEnhancedVoiceMailNotification::NumberOfVoiceMails |
5737 |
|
5738 |
|
5739 /*void CEnhancedVoiceMailNotification::SetExtension(TDesC& aExtension) |
|
5740 { |
|
5741 LOGGSMU1("CEnhancedVoiceMailNotification::SetExtension()"); |
|
5742 |
|
5743 TInt length=aExtension.Length(); |
|
5744 NewExtensionL(length); |
|
5745 iExtension->Des().Copy(aExtension); |
|
5746 } // CEnhancedVoiceMailNotification::SetExtension |
|
5747 |
|
5748 TPtrC CEnhancedVoiceMailNotification::Extension() const |
|
5749 { |
|
5750 LOGGSMU1("CEnhancedVoiceMailNotification::Extension()"); |
|
5751 |
|
5752 TPtrC ptr; |
|
5753 if (iExtension) |
|
5754 ptr.Set(iExtension->Des()); |
|
5755 return ptr; |
|
5756 }*/ |
|
5757 |
5717 |
5758 |
5718 |
5759 /** |
5719 /** |
5760 * @publishedAll |
5720 * @publishedAll |
5761 * |
5721 * |
5769 * |
5729 * |
5770 * @capability None |
5730 * @capability None |
5771 */ |
5731 */ |
5772 EXPORT_C RPointerArray<CVoiceMailNotification>& CEnhancedVoiceMailNotification::GetVoiceMailNotifications() |
5732 EXPORT_C RPointerArray<CVoiceMailNotification>& CEnhancedVoiceMailNotification::GetVoiceMailNotifications() |
5773 { |
5733 { |
5774 LOGGSMU1("CEnhancedVoiceMailNotification::GetVoiceMailNotifications()"); |
5734 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CENHANCEDVOICEMAILNOTIFICATION_GETVOICEMAILNOTIFICATIONS_1, "CEnhancedVoiceMailNotification::GetVoiceMailNotifications()"); |
5775 |
5735 |
5776 return *iNotifications; |
5736 return *iNotifications; |
5777 } // CEnhancedVoiceMailNotification::GetVoiceMailNotifications |
5737 } // CEnhancedVoiceMailNotification::GetVoiceMailNotifications |
5778 |
5738 |
5779 |
5739 |
5780 void CEnhancedVoiceMailNotification::NewExtensionL(TInt aLength) |
5740 void CEnhancedVoiceMailNotification::NewExtensionL(TInt aLength) |
5781 { |
5741 { |
5782 LOGGSMU1("CEnhancedVoiceMailNotification::NewExtensionL()"); |
5742 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CENHANCEDVOICEMAILNOTIFICATION_NEWEXTENSIONL_1, "CEnhancedVoiceMailNotification::NewExtensionL()"); |
5783 |
5743 |
5784 HBufC* buffer=HBufC::NewL(aLength); |
5744 HBufC* buffer=HBufC::NewL(aLength); |
5785 delete iExtension; |
5745 delete iExtension; |
5786 iExtension=buffer; |
5746 iExtension=buffer; |
5787 iExtension->Des().SetLength(aLength); |
5747 iExtension->Des().SetLength(aLength); |
5873 * |
5833 * |
5874 * @capability None |
5834 * @capability None |
5875 */ |
5835 */ |
5876 EXPORT_C CEnhancedVoiceMailNotification::~CEnhancedVoiceMailNotification() |
5836 EXPORT_C CEnhancedVoiceMailNotification::~CEnhancedVoiceMailNotification() |
5877 { |
5837 { |
5878 LOGGSMU1("CEnhancedVoiceMailNotification::~CEnhancedVoiceMailNotification"); |
5838 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CENHANCEDVOICEMAILNOTIFICATION_DTOR_1, "CEnhancedVoiceMailNotification::~CEnhancedVoiceMailNotification"); |
5879 delete iExtension; |
5839 delete iExtension; |
5880 iNotifications->ResetAndDestroy(); |
5840 iNotifications->ResetAndDestroy(); |
5881 iNotifications->Close(); |
5841 iNotifications->Close(); |
5882 delete iNotifications; |
5842 delete iNotifications; |
5883 } // CEnhancedVoiceMailNotification::operator |
5843 } // CEnhancedVoiceMailNotification::operator |
5884 |
5844 |
5885 |
5845 |
5886 void CEnhancedVoiceMailNotification::ConstructL() |
5846 void CEnhancedVoiceMailNotification::ConstructL() |
5887 { |
5847 { |
5888 LOGGSMU1("CEnhancedVoiceMailNotification::ConstructL()"); |
5848 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CENHANCEDVOICEMAILNOTIFICATION_CONSTRUCTL_1, "CEnhancedVoiceMailNotification::ConstructL()"); |
5889 |
5849 |
5890 NewExtensionL(0); |
5850 NewExtensionL(0); |
5891 iNotifications = new (ELeave) RPointerArray<CVoiceMailNotification>(KMaxNumberOfNotifications); |
5851 iNotifications = new (ELeave) RPointerArray<CVoiceMailNotification>(KMaxNumberOfNotifications); |
5892 } // CEnhancedVoiceMailNotification::ConstructL |
5852 } // CEnhancedVoiceMailNotification::ConstructL |
5893 |
5853 |
5894 |
5854 |
5895 TUint8* CEnhancedVoiceMailNotification::EncodeL(TUint8* aCurrentPtr, CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs) const |
5855 TUint8* CEnhancedVoiceMailNotification::EncodeL(TUint8* aCurrentPtr, CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs) const |
5896 { |
5856 { |
5897 LOGGSMU1("CEnhancedVoiceMailNotification::EncodeL"); |
5857 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CENHANCEDVOICEMAILNOTIFICATION_ENCODEL_1, "CEnhancedVoiceMailNotification::EncodeL"); |
5898 |
5858 |
5899 TUint8* startPtr = aCurrentPtr; |
5859 TUint8* startPtr = aCurrentPtr; |
5900 |
5860 |
5901 aCurrentPtr = CEnhancedVoiceMailBoxInformation::EncodeL(aCurrentPtr, aCharacterSetConverter, aFs); |
5861 aCurrentPtr = CEnhancedVoiceMailBoxInformation::EncodeL(aCurrentPtr, aCharacterSetConverter, aFs); |
5902 |
5862 |
5928 } // CEnhancedVoiceMailNotification::EncodeL |
5888 } // CEnhancedVoiceMailNotification::EncodeL |
5929 |
5889 |
5930 |
5890 |
5931 void CEnhancedVoiceMailNotification::DecodeL(TGsmuLex8& aVoiceMailInfo, CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs) |
5891 void CEnhancedVoiceMailNotification::DecodeL(TGsmuLex8& aVoiceMailInfo, CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs) |
5932 { |
5892 { |
5933 LOGGSMU1("CEnhancedVoiceMailNotification::DecodeL"); |
5893 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CENHANCEDVOICEMAILNOTIFICATION_DECODEL_1, "CEnhancedVoiceMailNotification::DecodeL"); |
5934 |
5894 |
5935 CEnhancedVoiceMailBoxInformation::DecodeL(aVoiceMailInfo, aCharacterSetConverter, aFs); |
5895 CEnhancedVoiceMailBoxInformation::DecodeL(aVoiceMailInfo, aCharacterSetConverter, aFs); |
5936 |
5896 |
5937 TUint8 numberOfNotifications = (aVoiceMailInfo.GetL() & KSmsNotificationBitMask); |
5897 TUint8 numberOfNotifications = (aVoiceMailInfo.GetL() & KSmsNotificationBitMask); |
5938 |
5898 |
6004 * |
5964 * |
6005 * @capability None |
5965 * @capability None |
6006 */ |
5966 */ |
6007 EXPORT_C TBool CVoiceMailDeletion::MessageExtensionIndication() const |
5967 EXPORT_C TBool CVoiceMailDeletion::MessageExtensionIndication() const |
6008 { |
5968 { |
6009 LOGGSMU1("CVoiceMailDeletion::MessageExtensionIndication()"); |
5969 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CVOICEMAILDELETION_MESSAGEEXTENSIONINDICATION_1, "CVoiceMailDeletion::MessageExtensionIndication()"); |
6010 |
5970 |
6011 return iExtensionIndicator; |
5971 return iExtensionIndicator; |
6012 } // CVoiceMailDeletion::MessageExtensionIndication |
5972 } // CVoiceMailDeletion::MessageExtensionIndication |
6013 |
5973 |
6014 |
5974 |
6015 TUint8 CVoiceMailDeletion::SizeL() |
5975 TUint8 CVoiceMailDeletion::SizeL() |
6016 { |
5976 { |
6017 LOGGSMU1("CVoiceMailDeletion::SizeL()"); |
5977 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CVOICEMAILDELETION_SIZEL_1, "CVoiceMailDeletion::SizeL()"); |
6018 |
5978 |
6019 const TUint8 KSizeOfVoiceMailDeletion = 3; |
5979 const TUint8 KSizeOfVoiceMailDeletion = 3; |
6020 return KSizeOfVoiceMailDeletion; |
5980 return KSizeOfVoiceMailDeletion; |
6021 } // CVoiceMailDeletion::SizeL |
5981 } // CVoiceMailDeletion::SizeL |
6022 |
5982 |
6120 * |
6080 * |
6121 * @capability None |
6081 * @capability None |
6122 */ |
6082 */ |
6123 EXPORT_C CVoiceMailDeletion::~CVoiceMailDeletion() |
6083 EXPORT_C CVoiceMailDeletion::~CVoiceMailDeletion() |
6124 { |
6084 { |
6125 LOGGSMU1("CVoiceMailDeletion::~CVoiceMailDeletion"); |
6085 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CVOICEMAILDELETION_DTOR_1, "CVoiceMailDeletion::~CVoiceMailDeletion"); |
6126 |
6086 |
6127 delete iExtension; |
6087 delete iExtension; |
6128 } // CVoiceMailDeletion::operator |
6088 } // CVoiceMailDeletion::operator |
6129 |
6089 |
6130 |
6090 |
6131 void CVoiceMailDeletion::ConstructL() |
6091 void CVoiceMailDeletion::ConstructL() |
6132 { |
6092 { |
6133 LOGGSMU1("CVoiceMailDeletion::ConstructL()"); |
6093 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CVOICEMAILDELETION_CONSTRUCTL_1, "CVoiceMailDeletion::ConstructL()"); |
6134 |
6094 |
6135 NewBufferL(0); |
6095 NewBufferL(0); |
6136 } // CVoiceMailDeletion::ConstructL |
6096 } // CVoiceMailDeletion::ConstructL |
6137 |
6097 |
6138 |
6098 |
6139 void CVoiceMailDeletion::NewBufferL(TInt aLength) |
6099 void CVoiceMailDeletion::NewBufferL(TInt aLength) |
6140 { |
6100 { |
6141 LOGGSMU1("CVoiceMailDeletion::NewBufferL()"); |
6101 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CVOICEMAILDELETION_NEWBUFFERL_1, "CVoiceMailDeletion::NewBufferL()"); |
6142 |
6102 |
6143 HBufC* buffer=HBufC::NewL(aLength); |
6103 HBufC* buffer=HBufC::NewL(aLength); |
6144 delete iExtension; |
6104 delete iExtension; |
6145 iExtension=buffer; |
6105 iExtension=buffer; |
6146 iExtension->Des().SetLength(aLength); |
6106 iExtension->Des().SetLength(aLength); |
6155 * |
6115 * |
6156 * @capability None |
6116 * @capability None |
6157 */ |
6117 */ |
6158 EXPORT_C CVoiceMailDeletion* CVoiceMailDeletion::NewL() |
6118 EXPORT_C CVoiceMailDeletion* CVoiceMailDeletion::NewL() |
6159 { |
6119 { |
6160 LOGGSMU1("CVoiceMailDeletion::NewL()"); |
6120 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CVOICEMAILDELETION_NEWL_1, "CVoiceMailDeletion::NewL()"); |
6161 |
6121 |
6162 CVoiceMailDeletion* voiceMailDeletion=new(ELeave) CVoiceMailDeletion(); |
6122 CVoiceMailDeletion* voiceMailDeletion=new(ELeave) CVoiceMailDeletion(); |
6163 CleanupStack::PushL(voiceMailDeletion); |
6123 CleanupStack::PushL(voiceMailDeletion); |
6164 voiceMailDeletion->ConstructL(); |
6124 voiceMailDeletion->ConstructL(); |
6165 CleanupStack::Pop(voiceMailDeletion); |
6125 CleanupStack::Pop(voiceMailDeletion); |
6166 return voiceMailDeletion; |
6126 return voiceMailDeletion; |
6167 } // CVoiceMailDeletion::NewL |
6127 } // CVoiceMailDeletion::NewL |
6168 |
6128 |
6169 |
6129 |
6170 /* |
|
6171 void CVoiceMailDeletion::SetExtension(TDesC& aExtension) |
|
6172 { |
|
6173 LOGGSMU1("CVoiceMailDeletion::SetExtension()"); |
|
6174 |
|
6175 TInt length=aExtension.Length(); |
|
6176 NewBufferL(length); |
|
6177 iExtension->Des().Copy(aExtension); |
|
6178 } // CVoiceMailDeletion::SetExtension |
|
6179 |
|
6180 |
|
6181 TPtrC CVoiceMailDeletion::Extension() const |
|
6182 { |
|
6183 LOGGSMU1("CVoiceMailDeletion::Extension()"); |
|
6184 |
|
6185 TPtrC ptr; |
|
6186 if (iExtension) |
|
6187 ptr.Set(iExtension->Des()); |
|
6188 return ptr; |
|
6189 }*/ |
|
6190 |
|
6191 |
|
6192 void CEnhancedVoiceMailDeleteConfirmations::NewExtensionL(TInt aLength) |
6130 void CEnhancedVoiceMailDeleteConfirmations::NewExtensionL(TInt aLength) |
6193 { |
6131 { |
6194 LOGGSMU1("CEnhancedVoiceMailDeleteConfirmations::NewExtensionL()"); |
6132 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CENHANCEDVOICEMAILDELETECONFIRMATIONS_NEWEXTENSIONL_1, "CEnhancedVoiceMailDeleteConfirmations::NewExtensionL()"); |
6195 |
6133 |
6196 HBufC* buffer=HBufC::NewL(aLength); |
6134 HBufC* buffer=HBufC::NewL(aLength); |
6197 delete iExtension; |
6135 delete iExtension; |
6198 iExtension=buffer; |
6136 iExtension=buffer; |
6199 iExtension->Des().SetLength(aLength); |
6137 iExtension->Des().SetLength(aLength); |
6270 */ |
6208 */ |
6271 void CEnhancedVoiceMailDeleteConfirmations::operator=(const CEnhancedVoiceMailDeleteConfirmations&) |
6209 void CEnhancedVoiceMailDeleteConfirmations::operator=(const CEnhancedVoiceMailDeleteConfirmations&) |
6272 { |
6210 { |
6273 // Ignore in code coverage - not intended to be used |
6211 // Ignore in code coverage - not intended to be used |
6274 BULLSEYE_OFF |
6212 BULLSEYE_OFF |
6275 LOGGSMU1("CEnhancedVoiceMailDeleteConfirmations::operator="); |
6213 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CENHANCEDVOICEMAILDELETECONFIRMATIONS_OPERATOR1_1, "CEnhancedVoiceMailDeleteConfirmations::operator="); |
6276 Panic(KGsmuPanicMethodBodyNotImplemented); |
6214 Panic(KGsmuPanicMethodBodyNotImplemented); |
6277 BULLSEYE_RESTORE |
6215 BULLSEYE_RESTORE |
6278 } |
6216 } |
6279 |
6217 |
6280 void CEnhancedVoiceMailDeleteConfirmations::ConstructL() |
6218 void CEnhancedVoiceMailDeleteConfirmations::ConstructL() |
6281 { |
6219 { |
6282 LOGGSMU1("CEnhancedVoiceMailDeleteConfirmations::ConstructL()"); |
6220 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CENHANCEDVOICEMAILDELETECONFIRMATIONS_CONSTRUCTL_1, "CEnhancedVoiceMailDeleteConfirmations::ConstructL()"); |
6283 |
6221 |
6284 NewExtensionL(0); |
6222 NewExtensionL(0); |
6285 |
6223 |
6286 iVoiceMailDeletions = new (ELeave) RPointerArray<CVoiceMailDeletion>(15); |
6224 iVoiceMailDeletions = new (ELeave) RPointerArray<CVoiceMailDeletion>(15); |
6287 } // CEnhancedVoiceMailDeleteConfirmations::ConstructL |
6225 } // CEnhancedVoiceMailDeleteConfirmations::ConstructL |
6339 * |
6277 * |
6340 * @capability None |
6278 * @capability None |
6341 */ |
6279 */ |
6342 EXPORT_C RPointerArray<CVoiceMailDeletion>& CEnhancedVoiceMailDeleteConfirmations::GetVoiceMailDeletions() |
6280 EXPORT_C RPointerArray<CVoiceMailDeletion>& CEnhancedVoiceMailDeleteConfirmations::GetVoiceMailDeletions() |
6343 { |
6281 { |
6344 LOGGSMU1("CEnhancedVoiceMailDeleteConfirmations::GetVoiceMailDeletions()"); |
6282 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CENHANCEDVOICEMAILDELETECONFIRMATIONS_GETVOICEMAILDELETIONS_1, "CEnhancedVoiceMailDeleteConfirmations::GetVoiceMailDeletions()"); |
6345 |
6283 |
6346 return *iVoiceMailDeletions; |
6284 return *iVoiceMailDeletions; |
6347 } // CEnhancedVoiceMailDeleteConfirmations::GetVoiceMailDeletions |
6285 } // CEnhancedVoiceMailDeleteConfirmations::GetVoiceMailDeletions |
6348 |
6286 |
6349 |
6287 |
6350 /* |
|
6351 void CEnhancedVoiceMailDeleteConfirmations::SetExtension(TDesC& aExtension) |
|
6352 { |
|
6353 LOGGSMU1("CEnhancedVoiceMailDeleteConfirmations::SetExtension()"); |
|
6354 |
|
6355 TInt length=aExtension.Length(); |
|
6356 NewBufferL(length); |
|
6357 iExtension->Des().Copy(aExtension); |
|
6358 } // CEnhancedVoiceMailDeleteConfirmations::SetExtension |
|
6359 |
|
6360 |
|
6361 TPtrC CEnhancedVoiceMailDeleteConfirmations::Extension() const |
|
6362 { |
|
6363 LOGGSMU1("CEnhancedVoiceMailDeleteConfirmations::Extension()"); |
|
6364 |
|
6365 TPtrC ptr; |
|
6366 if (iExtension) |
|
6367 { |
|
6368 ptr.Set(iExtension->Des()); |
|
6369 } |
|
6370 return ptr; |
|
6371 }*/ |
|
6372 |
|
6373 |
|
6374 TUint8* CEnhancedVoiceMailDeleteConfirmations::EncodeL(TUint8* aCurrentPtr, CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs) const |
6288 TUint8* CEnhancedVoiceMailDeleteConfirmations::EncodeL(TUint8* aCurrentPtr, CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs) const |
6375 { |
6289 { |
6376 LOGGSMU1("CEnhancedVoiceMailDeleteConfirmations::EncodeL"); |
6290 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CENHANCEDVOICEMAILDELETECONFIRMATIONS_ENCODEL_1, "CEnhancedVoiceMailDeleteConfirmations::EncodeL"); |
6377 |
6291 |
6378 TUint8* startPtr = aCurrentPtr; |
6292 TUint8* startPtr = aCurrentPtr; |
6379 |
6293 |
6380 aCurrentPtr = CEnhancedVoiceMailBoxInformation::EncodeL(aCurrentPtr, aCharacterSetConverter, aFs); |
6294 aCurrentPtr = CEnhancedVoiceMailBoxInformation::EncodeL(aCurrentPtr, aCharacterSetConverter, aFs); |
6381 |
6295 |
6410 } // CEnhancedVoiceMailDeleteConfirmations::EncodeL |
6324 } // CEnhancedVoiceMailDeleteConfirmations::EncodeL |
6411 |
6325 |
6412 |
6326 |
6413 void CEnhancedVoiceMailDeleteConfirmations::DecodeL(TGsmuLex8& aVoiceMailInfo, CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs) |
6327 void CEnhancedVoiceMailDeleteConfirmations::DecodeL(TGsmuLex8& aVoiceMailInfo, CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs) |
6414 { |
6328 { |
6415 LOGGSMU1("CEnhancedVoiceMailDeleteConfirmations::DecodeL"); |
6329 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CENHANCEDVOICEMAILDELETECONFIRMATIONS_DECODEL_1, "CEnhancedVoiceMailDeleteConfirmations::DecodeL"); |
6416 |
6330 |
6417 CEnhancedVoiceMailBoxInformation::DecodeL(aVoiceMailInfo, aCharacterSetConverter, aFs); |
6331 CEnhancedVoiceMailBoxInformation::DecodeL(aVoiceMailInfo, aCharacterSetConverter, aFs); |
6418 |
6332 |
6419 TUint numberOfVMDeletions = (aVoiceMailInfo.GetL() & KSmsNotificationBitMask); |
6333 TUint numberOfVMDeletions = (aVoiceMailInfo.GetL() & KSmsNotificationBitMask); |
6420 |
6334 |