smsprotocols/smsstack/smsprot/Src/smspdel.cpp
branchRCL_3
changeset 65 630d2f34d719
parent 0 3553901f7fa8
child 66 07a122eea281
equal deleted inserted replaced
61:17af172ffa5f 65:630d2f34d719
     1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 1997-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
    11 // Contributors:
    11 // Contributors:
    12 //
    12 //
    13 // Description:
    13 // Description:
    14 //
    14 //
    15 
    15 
       
    16 
       
    17 #include "OstTraceDefinitions.h"
       
    18 #ifdef OST_TRACE_COMPILER_IN_USE
       
    19 #include "smspdelTraces.h"
       
    20 #endif
       
    21 
    16 #include "smspdel.h"
    22 #include "smspdel.h"
    17 #include "smspmain.h"
    23 #include "smspmain.h"
    18 
    24 
    19 #include "smsuset.h"
    25 #include "smsuset.h"
    20 
    26 
    32  */
    38  */
    33 CSmsPDUDelete* CSmsPDUDelete::NewL(const TSmsSettings& aSmsSettings,
    39 CSmsPDUDelete* CSmsPDUDelete::NewL(const TSmsSettings& aSmsSettings,
    34 								   RMobileSmsMessaging& aSmsMessaging
    40 								   RMobileSmsMessaging& aSmsMessaging
    35 								   )
    41 								   )
    36 	{
    42 	{
    37 	LOGSMSPROT1("CSmsPDUDelete::NewL()");
    43 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPDUDELETE_NEWL_1, "CSmsPDUDelete::NewL()");
    38 
    44 
    39 	CSmsPDUDelete* smsPduDelete =
    45 	CSmsPDUDelete* smsPduDelete =
    40 		new(ELeave) CSmsPDUDelete(aSmsSettings,aSmsMessaging);
    46 		new(ELeave) CSmsPDUDelete(aSmsSettings,aSmsMessaging);
    41 	CleanupStack::PushL(smsPduDelete);
    47 	CleanupStack::PushL(smsPduDelete);
    42 	smsPduDelete->ConstructL();
    48 	smsPduDelete->ConstructL();
    66 /**
    72 /**
    67  *  Creates instance to the class CSmsuTimeout
    73  *  Creates instance to the class CSmsuTimeout
    68  */
    74  */
    69 void CSmsPDUDelete::ConstructL()
    75 void CSmsPDUDelete::ConstructL()
    70 	{
    76 	{
    71 	LOGSMSPROT1("CSmsPDUDelete::ConstructL()");
    77 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPDUDELETE_CONSTRUCTL_1, "CSmsPDUDelete::ConstructL()");
    72 
    78 
    73 	ConstructTimeoutL();
    79 	ConstructTimeoutL();
    74 	} // CSmsPDUDelete::ConstructL
    80 	} // CSmsPDUDelete::ConstructL
    75 
    81 
    76 
    82 
    81  *  @param aStatus     Reguest status
    87  *  @param aStatus     Reguest status
    82  *  @param aStoreIndex Index to the store to be read
    88  *  @param aStoreIndex Index to the store to be read
    83  */
    89  */
    84 void CSmsPDUDelete::Start(CArrayFix<TGsmSmsSlotEntry>& aLocationArray, TRequestStatus& aStatus)
    90 void CSmsPDUDelete::Start(CArrayFix<TGsmSmsSlotEntry>& aLocationArray, TRequestStatus& aStatus)
    85 	{
    91 	{
    86 	LOGSMSPROT1("CSmsPDUDelete::Start()");
    92 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPDUDELETE_START_1, "CSmsPDUDelete::Start()");
    87 
    93 
    88 	__ASSERT_DEBUG(iState==ESmsPDUDeleteIdle,SmspPanic(KSmspPanicUnexpectedState));
    94 	__ASSERT_DEBUG(iState==ESmsPDUDeleteIdle,SmspPanic(KSmspPanicUnexpectedState));
    89 
    95 
    90 	Queue(aStatus);
    96 	Queue(aStatus);
    91 
    97 
   100  *  
   106  *  
   101  *  Deletes slots giving in array. Opens new store if store change
   107  *  Deletes slots giving in array. Opens new store if store change
   102  */
   108  */
   103 void CSmsPDUDelete::DoRunL()
   109 void CSmsPDUDelete::DoRunL()
   104 	{
   110 	{
   105     LOGSMSPROT2("CSmsPDUDelete::RunL [iStatus=%d]", iStatus.Int());
   111     OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPDUDELETE_DORUNL_1, "CSmsPDUDelete::RunL [iStatus=%d]", iStatus.Int());
   106 
   112 
   107 	switch (iState)
   113 	switch (iState)
   108 		{
   114 		{
   109 		case ESmsPDUDeleteOpeningStore:
   115 		case ESmsPDUDeleteOpeningStore:
   110 			{
   116 			{
   171 /**
   177 /**
   172  *  private method for opening the store where slot is saved
   178  *  private method for opening the store where slot is saved
   173  */
   179  */
   174 void CSmsPDUDelete::OpenStore()
   180 void CSmsPDUDelete::OpenStore()
   175 	{
   181 	{
   176 	LOGSMSPROT1("CSmsPDUDelete::OpenStore()");
   182 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPDUDELETE_OPENSTORE_1, "CSmsPDUDelete::OpenStore()");
   177 
   183 
   178 	//
   184 	//
   179 	// Open the SMS Store for the first PDU...
   185 	// Open the SMS Store for the first PDU...
   180 	//
   186 	//
   181 	if (iLocationArray->Count() > 0)
   187 	if (iLocationArray->Count() > 0)
   210 /**
   216 /**
   211  *  private method for deleting slot from the store
   217  *  private method for deleting slot from the store
   212  */
   218  */
   213 void CSmsPDUDelete::DeletePDU()
   219 void CSmsPDUDelete::DeletePDU()
   214 	{
   220 	{
   215 	LOGSMSPROT1("CSmsPDUDelete::DeletePDU()");
   221 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPDUDELETE_DELETEPDU_1, "CSmsPDUDelete::DeletePDU()");
   216 
   222 
   217 	//
   223 	//
   218 	// Delete the first entry in the list...
   224 	// Delete the first entry in the list...
   219 	//
   225 	//
   220 	if (iLocationArray->Count() > 0)
   226 	if (iLocationArray->Count() > 0)
   231 /**
   237 /**
   232  *  Called by Active Scheduler
   238  *  Called by Active Scheduler
   233  */
   239  */
   234 void CSmsPDUDelete::DoCancel()
   240 void CSmsPDUDelete::DoCancel()
   235 	{
   241 	{
   236 	LOGSMSPROT1("CSmsPDUDelete::DoCancel()");
   242 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPDUDELETE_DOCANCEL_1, "CSmsPDUDelete::DoCancel()");
   237 
   243 
   238 	TimedSetActiveCancel();
   244 	TimedSetActiveCancel();
   239 
   245 
   240 	switch (iState)
   246 	switch (iState)
   241 		{
   247 		{
   277 /**
   283 /**
   278  *  Completes this object
   284  *  Completes this object
   279  */
   285  */
   280 void CSmsPDUDelete::Complete(TInt aStatus)
   286 void CSmsPDUDelete::Complete(TInt aStatus)
   281 	{
   287 	{
   282 	LOGSMSPROT1("CSmsPDUDelete::Complete()");
   288 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPDUDELETE_COMPLETE_1, "CSmsPDUDelete::Complete()");
   283 
   289 
   284 	//
   290 	//
   285 	// Only close the SMS Storage if the object is not active (and it may be
   291 	// Only close the SMS Storage if the object is not active (and it may be
   286 	// if the operation was cancelled). Otherwise it will be closed on
   292 	// if the operation was cancelled). Otherwise it will be closed on
   287 	// destruction.
   293 	// destruction.