smsprotocols/smsstack/gsmu/src/gsmumsgadditionattributes.cpp
branchRCL_3
changeset 66 07a122eea281
parent 65 630d2f34d719
equal deleted inserted replaced
65:630d2f34d719 66:07a122eea281
     1 // Copyright (c) 1999-2010 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
    13 // Description:
    13 // Description:
    14 // GsmuMsgAdditionalAttributes.cpp
    14 // GsmuMsgAdditionalAttributes.cpp
    15 // 
    15 // 
    16 //
    16 //
    17 
    17 
    18 
       
    19 #include "OstTraceDefinitions.h"
       
    20 #ifdef OST_TRACE_COMPILER_IN_USE
       
    21 #include "gsmumsgadditionattributesTraces.h"
       
    22 #endif
       
    23 
       
    24 #include "gsmumsgadditionalattributes.h"
    18 #include "gsmumsgadditionalattributes.h"
    25 #include "smsstacklog.h"
    19 #include "smsstacklog.h"
    26 
    20 
    27 
    21 
    28 CSmsMessageAdditionalAttributes* CSmsMessageAdditionalAttributes::NewL()
    22 CSmsMessageAdditionalAttributes* CSmsMessageAdditionalAttributes::NewL()
    29     {
    23     {
    30 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSMESSAGEADDITIONALATTRIBUTES_NEWL_1, "CSmsMessageAdditionalAttributes::NewL()");
    24 	LOGGSMU1("CSmsMessageAdditionalAttributes::NewL()");
    31 
    25 
    32 	CSmsMessageAdditionalAttributes* additionalAttributes=new(ELeave) CSmsMessageAdditionalAttributes();
    26 	CSmsMessageAdditionalAttributes* additionalAttributes=new(ELeave) CSmsMessageAdditionalAttributes();
    33 	CleanupStack::PushL(additionalAttributes);
    27 	CleanupStack::PushL(additionalAttributes);
    34 	additionalAttributes->ConstructL();
    28 	additionalAttributes->ConstructL();
    35 	CleanupStack::Pop();
    29 	CleanupStack::Pop();
    43     } // CSmsMessageAdditionalAttributes::CSmsMessageAdditionalAttributes
    37     } // CSmsMessageAdditionalAttributes::CSmsMessageAdditionalAttributes
    44 
    38 
    45 
    39 
    46 CSmsMessageAdditionalAttributes::~CSmsMessageAdditionalAttributes()
    40 CSmsMessageAdditionalAttributes::~CSmsMessageAdditionalAttributes()
    47     {
    41     {
    48 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSMESSAGEADDITIONALATTRIBUTES_DTOR_1, "CSmsMessageAdditionalAttributes::~CSmsMessageAdditionalAttributes()");
    42 	LOGGSMU1("CSmsMessageAdditionalAttributes::~CSmsMessageAdditionalAttributes()");
    49 
    43 
    50 	iSmsPDUArray.ResetAndDestroy();
    44 	iSmsPDUArray.ResetAndDestroy();
    51 
    45 
    52     for (TInt category = 0; category < TSmsInformationElementCategories::ENumberOfCategories; category++)
    46     for (TInt category = 0; category < TSmsInformationElementCategories::ENumberOfCategories; category++)
    53         {
    47         {
    70     } // CSmsMessageAdditionalAttributes::CSmsMessageAdditionalAttributes
    64     } // CSmsMessageAdditionalAttributes::CSmsMessageAdditionalAttributes
    71 
    65 
    72 
    66 
    73 void CSmsMessageAdditionalAttributes::ConstructL()
    67 void CSmsMessageAdditionalAttributes::ConstructL()
    74     {
    68     {
    75 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSMESSAGEADDITIONALATTRIBUTES_CONSTRUCTL_1, "CSmsMessageAdditionalAttributes::ConstructL()");
    69 	LOGGSMU1("CSmsMessageAdditionalAttributes::ConstructL()");
    76 
    70 
    77     iStatusReportScheme = new (ELeave) CSmsMessageAdditionalAttributes::CDefaultScheme();
    71     iStatusReportScheme = new (ELeave) CSmsMessageAdditionalAttributes::CDefaultScheme();
    78     
    72     
    79     for (TInt category = 0; category < TSmsInformationElementCategories::ENumberOfCategories; category++)
    73     for (TInt category = 0; category < TSmsInformationElementCategories::ENumberOfCategories; category++)
    80         {
    74         {
    83     } // CSmsMessageAdditionalAttributes::ConstructL
    77     } // CSmsMessageAdditionalAttributes::ConstructL
    84 
    78 
    85 
    79 
    86 void CSmsMessageAdditionalAttributes::AddControlInformationElementL(CSmsInformationElement* aIE)
    80 void CSmsMessageAdditionalAttributes::AddControlInformationElementL(CSmsInformationElement* aIE)
    87     {
    81     {
    88     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSMESSAGEADDITIONALATTRIBUTES_ADDCONTROLINFORMATIONELEMENTL_1, "CSmsMessageAdditionalAttributes::AddControlInformationElementL()");
    82     LOGGSMU1("CSmsMessageAdditionalAttributes::AddControlInformationElementL()");
    89 
    83 
    90     TSmsInformationElementCategories::TInformationElementCategory category;
    84     TSmsInformationElementCategories::TInformationElementCategory category;
    91     if (aIE != NULL)
    85     if (aIE != NULL)
    92         {
    86         {
    93         if (TSmsInformationElementCategories::GetCategoryDefinition(aIE->Identifier(), category))
    87         if (TSmsInformationElementCategories::GetCategoryDefinition(aIE->Identifier(), category))
    94         	{
    88         	{
    95         	AddControlInformationElementL(category,aIE);
    89         	AddControlInformationElementL(category,aIE);
    96         	}
    90         	}
    97         else
    91         else
    98             {
    92             {
    99             OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSMESSAGEADDITIONALATTRIBUTES_ADDCONTROLINFORMATIONELEMENTL_2, "CSmsMessageAdditionalAttributes::AddControlInformationElementL, aIE->Identifier() is invalid");
    93             LOGGSMU1("CSmsMessageAdditionalAttributes::AddControlInformationElementL, aIE->Identifier() is invalid");
   100             User::Leave(KErrArgument);
    94             User::Leave(KErrArgument);
   101             }
    95             }
   102         }
    96         }
   103     else
    97     else
   104         {
    98         {
   105         OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSMESSAGEADDITIONALATTRIBUTES_ADDCONTROLINFORMATIONELEMENTL_3, "CSmsMessageAdditionalAttributes::AddControlInformationElementL, aIE == NULL");
    99         LOGGSMU1("CSmsMessageAdditionalAttributes::AddControlInformationElementL, aIE == NULL");
   106         User::Leave(KErrArgument);
   100         User::Leave(KErrArgument);
   107         }
   101         }
   108     } // CSmsMessageAdditionalAttributes::AddControlInformationElementL
   102     } // CSmsMessageAdditionalAttributes::AddControlInformationElementL
   109 
   103 
   110 
   104 
   111 TBool CSmsMessageAdditionalAttributes::Find1stInstanceOfControlInformationElement(TInformationElementId aId, TUint& aIndex) const
   105 TBool CSmsMessageAdditionalAttributes::Find1stInstanceOfControlInformationElement(TInformationElementId aId, TUint& aIndex) const
   112     {
   106     {
   113     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSMESSAGEADDITIONALATTRIBUTES_FIND1STINSTANCEOFCONTROLINFORMATIONELEMENT_1, "CSmsMessageAdditionalAttributes::Find1stInstanceOfControlInformationElement()");
   107     LOGGSMU1("CSmsMessageAdditionalAttributes::Find1stInstanceOfControlInformationElement()");
   114     
   108     
   115     TBool rc = EFalse;
   109     TBool rc = EFalse;
   116     TSmsInformationElementCategories::TInformationElementCategory category;
   110     TSmsInformationElementCategories::TInformationElementCategory category;
   117     
   111     
   118     if (TSmsInformationElementCategories::GetCategoryDefinition(aId, category))
   112     if (TSmsInformationElementCategories::GetCategoryDefinition(aId, category))
   132     } // CSmsMessageAdditionalAttributes::Find1stInstanceOfControlInformationElement
   126     } // CSmsMessageAdditionalAttributes::Find1stInstanceOfControlInformationElement
   133 
   127 
   134 
   128 
   135 TBool CSmsMessageAdditionalAttributes::FindNextInstanceOfControlInformationElement(TInformationElementId aId, TUint aStartIndex, TUint& aIndex) const
   129 TBool CSmsMessageAdditionalAttributes::FindNextInstanceOfControlInformationElement(TInformationElementId aId, TUint aStartIndex, TUint& aIndex) const
   136     {
   130     {
   137     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSMESSAGEADDITIONALATTRIBUTES_FINDNEXTINSTANCEOFCONTROLINFORMATIONELEMENT_1, "CSmsMessageAdditionalAttributes::FindNextInstanceOfControlInformationElement()");
   131     LOGGSMU1("CSmsMessageAdditionalAttributes::FindNextInstanceOfControlInformationElement()");
   138     
   132     
   139     TBool rc = EFalse;
   133     TBool rc = EFalse;
   140     TSmsInformationElementCategories::TInformationElementCategory category;
   134     TSmsInformationElementCategories::TInformationElementCategory category;
   141 
   135 
   142 	if (TSmsInformationElementCategories::GetCategoryDefinition(aId, category))
   136 	if (TSmsInformationElementCategories::GetCategoryDefinition(aId, category))
   157     } // CSmsMessageAdditionalAttributes::FindNextInstanceOfControlInformationElement
   151     } // CSmsMessageAdditionalAttributes::FindNextInstanceOfControlInformationElement
   158 
   152 
   159 
   153 
   160 CSmsInformationElement& CSmsMessageAdditionalAttributes::GetControlInformationElementL(TInformationElementId aId, TUint aIndex) const
   154 CSmsInformationElement& CSmsMessageAdditionalAttributes::GetControlInformationElementL(TInformationElementId aId, TUint aIndex) const
   161     {
   155     {
   162     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSMESSAGEADDITIONALATTRIBUTES_GETCONTROLINFORMATIONELEMENTL_1, "CSmsMessageAdditionalAttributes::GetControlInformationElementL()");
   156     LOGGSMU1("CSmsMessageAdditionalAttributes::GetControlInformationElementL()");
   163     
   157     
   164 
   158 
   165     TSmsInformationElementCategories::TInformationElementCategory category;
   159     TSmsInformationElementCategories::TInformationElementCategory category;
   166 
   160 
   167     if (TSmsInformationElementCategories::GetCategoryDefinition(aId, category) == EFalse)
   161     if (TSmsInformationElementCategories::GetCategoryDefinition(aId, category) == EFalse)
   169     	User::Leave(KErrArgument);
   163     	User::Leave(KErrArgument);
   170     	}
   164     	}
   171 
   165 
   172     if (aIndex >= iCollectionOfPointersToIEArrays[category]->Count())
   166     if (aIndex >= iCollectionOfPointersToIEArrays[category]->Count())
   173         {
   167         {
   174         OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSMESSAGEADDITIONALATTRIBUTES_GETCONTROLINFORMATIONELEMENTL_2, "CSmsMessageAdditionalAttributes::GetControlInformationElementL  aId = %d , aIndex = %d", aId, aIndex);
   168         LOGGSMU3("CSmsMessageAdditionalAttributes::GetControlInformationElementL  aId = %d , aIndex = %d", aId, aIndex);
   175         OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSMESSAGEADDITIONALATTRIBUTES_GETCONTROLINFORMATIONELEMENTL_3, "CSmsMessageAdditionalAttributes::GetControlInformationElementL  Count = %d", iCollectionOfPointersToIEArrays[category]->Count());
   169         LOGGSMU2("CSmsMessageAdditionalAttributes::GetControlInformationElementL  Count = %d", iCollectionOfPointersToIEArrays[category]->Count());
   176         User::Leave(KErrArgument);
   170         User::Leave(KErrArgument);
   177         }
   171         }
   178 
   172 
   179     if (iCollectionOfPointersToIEArrays[category]->operator[](aIndex) == NULL)
   173     if (iCollectionOfPointersToIEArrays[category]->operator[](aIndex) == NULL)
   180         {
   174         {
   181         OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSMESSAGEADDITIONALATTRIBUTES_GETCONTROLINFORMATIONELEMENTL_4, "CSmsMessageAdditionalAttributes::GetControlInformationElementL  aId = %d , aIndex = %d", aId, aIndex);
   175         LOGGSMU3("CSmsMessageAdditionalAttributes::GetControlInformationElementL  aId = %d , aIndex = %d", aId, aIndex);
   182         User::Leave(KErrArgument);
   176         User::Leave(KErrArgument);
   183         }
   177         }
   184 
   178 
   185     if (iCollectionOfPointersToIEArrays[category]->operator[](aIndex)->Identifier()!=aId)
   179     if (iCollectionOfPointersToIEArrays[category]->operator[](aIndex)->Identifier()!=aId)
   186         {
   180         {
   187         OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSMESSAGEADDITIONALATTRIBUTES_GETCONTROLINFORMATIONELEMENTL_5, "CSmsMessageAdditionalAttributes::GetControlInformationElementL aId = %d, aIndex = %d", aId, aIndex);
   181         LOGGSMU3("CSmsMessageAdditionalAttributes::GetControlInformationElementL aId = %d, aIndex = %d", aId, aIndex);
   188         OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSMESSAGEADDITIONALATTRIBUTES_GETCONTROLINFORMATIONELEMENTL_6, "CSmsMessageAdditionalAttributes::GetControlInformationElementL  id = %d", iCollectionOfPointersToIEArrays[category]->operator[](aIndex)->Identifier());
   182         LOGGSMU2("CSmsMessageAdditionalAttributes::GetControlInformationElementL  id = %d", iCollectionOfPointersToIEArrays[category]->operator[](aIndex)->Identifier());
   189         User::Leave(KErrArgument);
   183         User::Leave(KErrArgument);
   190         }
   184         }
   191 
   185 
   192     CSmsInformationElement* ie = iCollectionOfPointersToIEArrays[category]->operator[](aIndex);
   186     CSmsInformationElement* ie = iCollectionOfPointersToIEArrays[category]->operator[](aIndex);
   193     return *ie;
   187     return *ie;
   194     } // CSmsMessageAdditionalAttributes::GetControlInformationElementL
   188     } // CSmsMessageAdditionalAttributes::GetControlInformationElementL
   195 
   189 
   196 
   190 
   197 TBool CSmsMessageAdditionalAttributes::RemoveControlInformationElement(TInformationElementId aId, TUint aIndex, CSmsInformationElementPtr& aIE)
   191 TBool CSmsMessageAdditionalAttributes::RemoveControlInformationElement(TInformationElementId aId, TUint aIndex, CSmsInformationElementPtr& aIE)
   198     {
   192     {
   199     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSMESSAGEADDITIONALATTRIBUTES_REMOVECONTROLINFORMATIONELEMENT_1, "CSmsMessageAdditionalAttributes::RemoveControlInformationElement()");
   193     LOGGSMU1("CSmsMessageAdditionalAttributes::RemoveControlInformationElement()");
   200     
   194     
   201     TBool rc = EFalse;
   195     TBool rc = EFalse;
   202     TSmsInformationElementCategories::TInformationElementCategory category;
   196     TSmsInformationElementCategories::TInformationElementCategory category;
   203 
   197 
   204 	if (TSmsInformationElementCategories::GetCategoryDefinition(aId, category))
   198 	if (TSmsInformationElementCategories::GetCategoryDefinition(aId, category))
   216     } // CSmsMessageAdditionalAttributes::RemoveControlInformationElement
   210     } // CSmsMessageAdditionalAttributes::RemoveControlInformationElement
   217 
   211 
   218 
   212 
   219 void CSmsMessageAdditionalAttributes::AddControlInformationElementL(TCategory aCategory, CSmsInformationElementPtr aIE)
   213 void CSmsMessageAdditionalAttributes::AddControlInformationElementL(TCategory aCategory, CSmsInformationElementPtr aIE)
   220     {
   214     {
   221     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSMESSAGEADDITIONALATTRIBUTES_ADDCONTROLINFORMATIONELEMENTL1_1, "CSmsMessageAdditionalAttributes::AddControlInformationElementL()");
   215     LOGGSMU1("CSmsMessageAdditionalAttributes::AddControlInformationElementL()");
   222     
   216     
   223     if ((aIE != NULL) &&
   217     if ((aIE != NULL) &&
   224         (aCategory < TSmsInformationElementCategories::ENumberOfCategories))
   218         (aCategory < TSmsInformationElementCategories::ENumberOfCategories))
   225         {
   219         {
   226         iCollectionOfPointersToIEArrays[aCategory]->AppendL(aIE);
   220         iCollectionOfPointersToIEArrays[aCategory]->AppendL(aIE);
   232     } // CSmsMessageAdditionalAttributes::AddControlInformationElementL
   226     } // CSmsMessageAdditionalAttributes::AddControlInformationElementL
   233 
   227 
   234 
   228 
   235 TBool CSmsMessageAdditionalAttributes::RemoveNextControlInformationElement(TCategory aCategory, CSmsInformationElementPtr& aIEPtr)
   229 TBool CSmsMessageAdditionalAttributes::RemoveNextControlInformationElement(TCategory aCategory, CSmsInformationElementPtr& aIEPtr)
   236     {
   230     {
   237     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSMESSAGEADDITIONALATTRIBUTES_REMOVENEXTCONTROLINFORMATIONELEMENT_1, "CSmsMessageAdditionalAttributes::RemoveNextControlInformationElement()");
   231     LOGGSMU1("CSmsMessageAdditionalAttributes::RemoveNextControlInformationElement()");
   238 
   232 
   239     TBool rc = EFalse;
   233     TBool rc = EFalse;
   240     if (aCategory < TSmsInformationElementCategories::ENumberOfCategories)
   234     if (aCategory < TSmsInformationElementCategories::ENumberOfCategories)
   241         {
   235         {
   242         TInt tailIndex;
   236         TInt tailIndex;
   251     } // CSmsMessageAdditionalAttributes::RemoveNextControlInformationElement
   245     } // CSmsMessageAdditionalAttributes::RemoveNextControlInformationElement
   252 
   246 
   253 
   247 
   254 CSmsInformationElement& CSmsMessageAdditionalAttributes::GetControlInformationElementL(TCategory aCategory, TUint aIndex) const
   248 CSmsInformationElement& CSmsMessageAdditionalAttributes::GetControlInformationElementL(TCategory aCategory, TUint aIndex) const
   255     {
   249     {
   256     OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSMESSAGEADDITIONALATTRIBUTES_GETCONTROLINFORMATIONELEMENTL1_1, "CSmsMessageAdditionalAttributes::GetControlInformationElementL(): aCategory=%d, aIndex=%d",aCategory, aIndex);
   250     LOGGSMU3("CSmsMessageAdditionalAttributes::GetControlInformationElementL(): aCategory=%d, aIndex=%d",
       
   251     		 aCategory, aIndex);
   257 
   252 
   258     if ((aCategory >= TSmsInformationElementCategories::ENumberOfCategories) ||
   253     if ((aCategory >= TSmsInformationElementCategories::ENumberOfCategories) ||
   259         (aIndex    >= iCollectionOfPointersToIEArrays[aCategory]->Count()))
   254         (aIndex    >= iCollectionOfPointersToIEArrays[aCategory]->Count()))
   260         {
   255         {
   261         OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSMESSAGEADDITIONALATTRIBUTES_GETCONTROLINFORMATIONELEMENTL1_2, "CSmsMessageAdditionalAttributes::GetControlInformationElementL: KErrArgument");
   256         LOGGSMU1("CSmsMessageAdditionalAttributes::GetControlInformationElementL: KErrArgument");
   262         User::Leave(KErrArgument);
   257         User::Leave(KErrArgument);
   263         }
   258         }
   264 
   259 
   265     if  ((iCollectionOfPointersToIEArrays[aCategory])->operator[](aIndex) == NULL)
   260     if  ((iCollectionOfPointersToIEArrays[aCategory])->operator[](aIndex) == NULL)
   266         {
   261         {
   267         OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSMESSAGEADDITIONALATTRIBUTES_GETCONTROLINFORMATIONELEMENTL1_3, "CSmsMessageAdditionalAttributes::GetControlInformationElementL: KErrCorrupt");
   262         LOGGSMU1("CSmsMessageAdditionalAttributes::GetControlInformationElementL: KErrCorrupt");
   268         User::Leave(KErrCorrupt);
   263         User::Leave(KErrCorrupt);
   269         }
   264         }
   270 
   265 
   271     return *(iCollectionOfPointersToIEArrays[aCategory]->operator[](aIndex));
   266     return *(iCollectionOfPointersToIEArrays[aCategory]->operator[](aIndex));
   272     } // CSmsMessageAdditionalAttributes::GetControlInformationElementL
   267     } // CSmsMessageAdditionalAttributes::GetControlInformationElementL
   273 
   268 
   274 
   269 
   275 void CSmsMessageAdditionalAttributes::DeleteControlInformationElement(TCategory aCategory, TUint8 aIndex)
   270 void CSmsMessageAdditionalAttributes::DeleteControlInformationElement(TCategory aCategory, TUint8 aIndex)
   276     {
   271     {
   277     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSMESSAGEADDITIONALATTRIBUTES_DELETECONTROLINFORMATIONELEMENT_1, "CSmsMessageAdditionalAttributes::DeleteControlInformationElement()");
   272     LOGGSMU1("CSmsMessageAdditionalAttributes::DeleteControlInformationElement()");
   278     
   273     
   279     if (aCategory < TSmsInformationElementCategories::ENumberOfCategories)
   274     if (aCategory < TSmsInformationElementCategories::ENumberOfCategories)
   280         {
   275         {
   281         TInt count = iCollectionOfPointersToIEArrays[aCategory]->Count();
   276         TInt count = iCollectionOfPointersToIEArrays[aCategory]->Count();
   282         if (aIndex < count)
   277         if (aIndex < count)
   291     } // CSmsMessageAdditionalAttributes::DeleteControlInformationElement
   286     } // CSmsMessageAdditionalAttributes::DeleteControlInformationElement
   292 
   287 
   293 
   288 
   294 TUint CSmsMessageAdditionalAttributes::NumberOfControlInformationElements(TCategory aCategory) const
   289 TUint CSmsMessageAdditionalAttributes::NumberOfControlInformationElements(TCategory aCategory) const
   295     {
   290     {
   296     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSMESSAGEADDITIONALATTRIBUTES_NUMBEROFCONTROLINFORMATIONELEMENTS_1, "CSmsMessageAdditionalAttributes::NumberOfControlInformationElements1()");
   291     LOGGSMU1("CSmsMessageAdditionalAttributes::NumberOfControlInformationElements1()");
   297 
   292 
   298     TUint count = 0;
   293     TUint count = 0;
   299 
   294 
   300     if (aCategory < TSmsInformationElementCategories::ENumberOfCategories)
   295     if (aCategory < TSmsInformationElementCategories::ENumberOfCategories)
   301     {
   296     {
   306     } // CSmsMessageAdditionalAttributes::NumberOfControlInformationElements
   301     } // CSmsMessageAdditionalAttributes::NumberOfControlInformationElements
   307 
   302 
   308 
   303 
   309 void CSmsMessageAdditionalAttributes::ExternalizeL(RWriteStream& aStream, TInt aVersion) const
   304 void CSmsMessageAdditionalAttributes::ExternalizeL(RWriteStream& aStream, TInt aVersion) const
   310     {
   305     {
   311     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSMESSAGEADDITIONALATTRIBUTES_EXTERNALIZEL_1, "CSmsMessageAdditionalAttributes::ExternalizeL()");
   306     LOGGSMU1("CSmsMessageAdditionalAttributes::ExternalizeL()");
   312 
   307 
   313 	if(aVersion == CSmsMessage::ESmsIncompleteClass0MessageV)
   308 	if(aVersion == CSmsMessage::ESmsIncompleteClass0MessageV)
   314 		{
   309 		{
   315 		iIncompleteClass0MessageInfo->ExternalizeL(aStream);
   310 		iIncompleteClass0MessageInfo->ExternalizeL(aStream);
   316 		return;
   311 		return;
   370 		}
   365 		}
   371 	}
   366 	}
   372 
   367 
   373 void CSmsMessageAdditionalAttributes::InternalizeL(RReadStream& aStream, TInt aVersion)
   368 void CSmsMessageAdditionalAttributes::InternalizeL(RReadStream& aStream, TInt aVersion)
   374     {
   369     {
   375     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSMESSAGEADDITIONALATTRIBUTES_INTERNALIZEL_1, "CSmsMessageAdditionalAttributes::InternalizeL()");
   370     LOGGSMU1("CSmsMessageAdditionalAttributes::InternalizeL()");
   376 
   371 
   377 	if(aVersion == CSmsMessage::ESmsIncompleteClass0MessageV)
   372 	if(aVersion == CSmsMessage::ESmsIncompleteClass0MessageV)
   378 		{
   373 		{
   379 		iIncompleteClass0MessageInfo->InternalizeL(aStream);
   374 		iIncompleteClass0MessageInfo->InternalizeL(aStream);
   380 		return;
   375 		return;
   450     } // CSmsMessageAdditionalAttributes::InternalizeL
   445     } // CSmsMessageAdditionalAttributes::InternalizeL
   451 
   446 
   452 
   447 
   453 void CSmsMessageAdditionalAttributes::ResetAttributesL()
   448 void CSmsMessageAdditionalAttributes::ResetAttributesL()
   454     {
   449     {
   455     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSMESSAGEADDITIONALATTRIBUTES_RESETATTRIBUTESL_1, "CSmsMessageAdditionalAttributes::ResetAttributesL()");
   450     LOGGSMU1("CSmsMessageAdditionalAttributes::ResetAttributesL()");
   456     
   451     
   457     for (TInt category = 0; category < TSmsInformationElementCategories::ENumberOfCategories; category++)
   452     for (TInt category = 0; category < TSmsInformationElementCategories::ENumberOfCategories; category++)
   458         {
   453         {
   459         iCollectionOfPointersToIEArrays[category]->ResetAndDestroy();
   454         iCollectionOfPointersToIEArrays[category]->ResetAndDestroy();
   460         }
   455         }
   471     } // CSmsMessageAdditionalAttributes::ResetAttributesL
   466     } // CSmsMessageAdditionalAttributes::ResetAttributesL
   472 
   467 
   473 
   468 
   474 CSmsIEOperation& CSmsMessageAdditionalAttributes::GetIEOperationL(TInformationElementId aId) const
   469 CSmsIEOperation& CSmsMessageAdditionalAttributes::GetIEOperationL(TInformationElementId aId) const
   475     {
   470     {
   476     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSMESSAGEADDITIONALATTRIBUTES_GETIEOPERATIONL_1, "CSmsMessageAdditionalAttributes::GetIEOperation()");
   471     LOGGSMU1("CSmsMessageAdditionalAttributes::GetIEOperation()");
   477 
   472 
   478     CSmsIEOperation* operation = NULL;
   473     CSmsIEOperation* operation = NULL;
   479 
   474 
   480     switch(aId)
   475     switch(aId)
   481         {
   476         {
   510  *  
   505  *  
   511  *  @param aId The Identifier for the operation.
   506  *  @param aId The Identifier for the operation.
   512  */
   507  */
   513 CSmsNonIEOperation& CSmsMessageAdditionalAttributes::GetNonIEOperationL(TSmsNonIEIdentifier aId) const
   508 CSmsNonIEOperation& CSmsMessageAdditionalAttributes::GetNonIEOperationL(TSmsNonIEIdentifier aId) const
   514 	{
   509 	{
   515 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSMESSAGEADDITIONALATTRIBUTES_GETNONIEOPERATIONL_1, "CSmsMessageAdditionalAttributes::GetNonIEOperationL");
   510 	LOGGSMU1("CSmsMessageAdditionalAttributes::GetNonIEOperationL");
   516     
   511     
   517     CSmsNonIEOperation* operation = NULL;
   512     CSmsNonIEOperation* operation = NULL;
   518     
   513     
   519     if(aId == ESmsTPSRRParameter)
   514     if(aId == ESmsTPSRRParameter)
   520     	{
   515     	{
   533     } // CSmsMessageAdditionalAttributes::GetIEOperationL
   528     } // CSmsMessageAdditionalAttributes::GetIEOperationL
   534 
   529 
   535 
   530 
   536 void CSmsMessageAdditionalAttributes::SetIEOperationL(CSmsIEOperation* aOperation)
   531 void CSmsMessageAdditionalAttributes::SetIEOperationL(CSmsIEOperation* aOperation)
   537 	{
   532 	{
   538 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSMESSAGEADDITIONALATTRIBUTES_SETIEOPERATIONL_1, "CSmsMessageAdditionalAttributes::SetIEOperationL()");
   533 	LOGGSMU1("CSmsMessageAdditionalAttributes::SetIEOperationL()");
   539 
   534 
   540     if (aOperation == NULL)
   535     if (aOperation == NULL)
   541         {
   536         {
   542         User::Leave(KErrArgument);
   537         User::Leave(KErrArgument);
   543         }
   538         }
   544 
   539 
   545     OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSMESSAGEADDITIONALATTRIBUTES_SETIEOPERATIONL_2, "CSmsMessageAdditionalAttributes::AddIEOperation, operation=%d", aOperation->Id());
   540     LOGGSMU2("CSmsMessageAdditionalAttributes::AddIEOperation, operation=%d", aOperation->Id());
   546 
   541 
   547     switch(aOperation->Id())
   542     switch(aOperation->Id())
   548         {
   543         {
   549         case CSmsInformationElement::ESmsHyperLinkFormat:
   544         case CSmsInformationElement::ESmsHyperLinkFormat:
   550             iHyperLinkOperations = (CSmsHyperLinkOperations*) aOperation;
   545             iHyperLinkOperations = (CSmsHyperLinkOperations*) aOperation;
   579     if (aOperation == NULL)
   574     if (aOperation == NULL)
   580         {
   575         {
   581         User::Leave(KErrArgument);        
   576         User::Leave(KErrArgument);        
   582         }
   577         }
   583     
   578     
   584     OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSMESSAGEADDITIONALATTRIBUTES_SETNONIEOPERATIONL_1, "CSmsMessageAdditionalAttributes::SetNonIEOperationL, operation = %d", aOperation->Id());
   579     LOGGSMU2("CSmsMessageAdditionalAttributes::SetNonIEOperationL, operation = %d", aOperation->Id());
   585     
   580     
   586     if (aOperation->Id() == ESmsTPSRRParameter)
   581     if (aOperation->Id() == ESmsTPSRRParameter)
   587         {
   582         {
   588         iTPSRROperations = (CSmsTPSRROperations*) aOperation;
   583         iTPSRROperations = (CSmsTPSRROperations*) aOperation;
   589         }
   584         }