supl/locationomasuplprotocolhandler/protocolhandlerver2/src/epos_comasuplcompleteselfrequestor.cpp
changeset 0 667063e416a2
equal deleted inserted replaced
-1:000000000000 0:667063e416a2
       
     1 /*
       
     2 * Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:   Class for doing asynchronous service for relinquish control.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #include "epos_comasuplcompleteselfrequestor.h"
       
    21 
       
    22 // ============================ MEMBER FUNCTIONS ===============================
       
    23 
       
    24 // -----------------------------------------------------------------------------
       
    25 // COMASuplCompleteSelfRequestor::COMASuplCompleteSelfRequestor
       
    26 // C++ constructor can NOT contain any code, that might leave.
       
    27 // -----------------------------------------------------------------------------
       
    28 //
       
    29 COMASuplCompleteSelfRequestor::COMASuplCompleteSelfRequestor(MCompleteSelfRequest& aObserver):
       
    30     				 CActive( EPriorityStandard ),iObserver( aObserver )
       
    31     {
       
    32     }
       
    33 
       
    34 // -----------------------------------------------------------------------------
       
    35 // COMASuplCompleteSelfRequestor::ConstructL
       
    36 // Symbian 2nd phase constructor can leave.
       
    37 // -----------------------------------------------------------------------------
       
    38 //
       
    39 void COMASuplCompleteSelfRequestor::ConstructL()
       
    40     {
       
    41     	CActiveScheduler::Add( this );
       
    42     }
       
    43 
       
    44 // -----------------------------------------------------------------------------
       
    45 // COMASuplCompleteSelfRequestor::NewL
       
    46 // Two-phased constructor.
       
    47 // -----------------------------------------------------------------------------
       
    48 //
       
    49 COMASuplCompleteSelfRequestor* COMASuplCompleteSelfRequestor::NewL(MCompleteSelfRequest& aObserver)
       
    50     {
       
    51 	    COMASuplCompleteSelfRequestor* self =  new ( ELeave ) 
       
    52 	    									   COMASuplCompleteSelfRequestor(aObserver);
       
    53 	    CleanupStack::PushL( self );
       
    54 	    self->ConstructL();
       
    55 	    CleanupStack::Pop(self);
       
    56 	    return self;
       
    57     }
       
    58 
       
    59 // -----------------------------------------------------------------------------
       
    60 // COMASuplCompleteSelfRequestor::~COMASuplCompleteSelfRequestor
       
    61 // -----------------------------------------------------------------------------
       
    62 //
       
    63 COMASuplCompleteSelfRequestor::~COMASuplCompleteSelfRequestor()
       
    64     {
       
    65     	Cancel();
       
    66     }
       
    67 
       
    68 // -----------------------------------------------------------------------------
       
    69 // COMASuplCompleteSelfRequestor::CompleteSelf
       
    70 // -----------------------------------------------------------------------------
       
    71 //
       
    72 void COMASuplCompleteSelfRequestor::CompleteSelf()
       
    73     {
       
    74     		iCompStatus = ESUPL_PACKET_RECEIVE;
       
    75 			TRequestStatus* pStat = &iStatus;
       
    76 			User::RequestComplete(pStat, KErrNone);
       
    77 			SetActive();
       
    78     }
       
    79 // -----------------------------------------------------------------------------
       
    80 // COMASuplCompleteSelfRequestor::CompleteInvalidSession
       
    81 // -----------------------------------------------------------------------------
       
    82 //
       
    83 void COMASuplCompleteSelfRequestor::CompleteInvalidSession()
       
    84     {	
       
    85     		iCompStatus = ESUPL_INVALID_SESSIONID;
       
    86 			TRequestStatus* pStat = &iStatus;
       
    87 			User::RequestComplete(pStat, KErrNone);
       
    88 			SetActive();
       
    89     }
       
    90   
       
    91 // -----------------------------------------------------------------------------
       
    92 // COMASuplCompleteSelfRequestor::CompleteInvalidSession
       
    93 // -----------------------------------------------------------------------------
       
    94 //
       
    95 void COMASuplCompleteSelfRequestor::CompleteInvalidSLPSession()
       
    96 	{
       
    97 	   		iCompStatus = ESUPL_INVALID_SLP_SESSIONID;
       
    98 			TRequestStatus* pStat = &iStatus;
       
    99 			User::RequestComplete(pStat, KErrNone);
       
   100 			SetActive();
       
   101 
       
   102 	}
       
   103 // -----------------------------------------------------------------------------
       
   104 // COMASuplCompleteSelfRequestor::RunL
       
   105 // -----------------------------------------------------------------------------
       
   106 //
       
   107 void COMASuplCompleteSelfRequestor::RunL()
       
   108     {
       
   109     	switch(iCompStatus)
       
   110     	{
       
   111     		case ESUPL_PACKET_RECEIVE:
       
   112     			iObserver.RequestCompletedL();	
       
   113     			break;
       
   114     		case ESUPL_INVALID_SESSIONID:
       
   115     			iObserver.StartInvalidSessionL();
       
   116     			break;
       
   117     		case ESUPL_INVALID_SLP_SESSIONID:
       
   118 				iObserver.HandleInvalidSLPSession();
       
   119 				break;
       
   120     	}
       
   121     	
       
   122     }
       
   123 
       
   124 // -----------------------------------------------------------------------------
       
   125 // COMASuplCompleteSelfRequestor::DoCancel
       
   126 // -----------------------------------------------------------------------------
       
   127 //
       
   128 void COMASuplCompleteSelfRequestor::DoCancel()
       
   129     {    
       
   130     	
       
   131     }
       
   132 
       
   133 //  End of File