// ---------------------------------------------------------------------------
// CMMCScBkupStateArchiveOpJavaData::BackupMidletDataL()
// 
// 
// ---------------------------------------------------------------------------
void CMMCScBkupStateArchiveOpJavaData::BackupMidletDataL()
    {
    CMMCScBkupDataOwnerCollection& dataOwners = Driver().DrvDataOwners();
    CMMCScBkupDataOwnerInfo& owner = dataOwners.Owner( iIndexValueCurrent );
 
    // We only need to request the midlet's passive data if it has a non-zero
    // size.
    if  ( owner.CompletionStatus( EMMCScBkupOwnerDataTypePassiveData ) == EFalse )
        {
        if  ( owner.OperationalSize( EMMCScBkupOwnerDataTypePassiveData ) > 0 )
            {
#ifdef __MMCSCBKUPLOGGING_ENABLED__
			HBufC* hash = MMCScBkupSBEUtils::JavaHashFromGenericLC( owner.Owner().Identifier() );
			__LOG1("CMMCScBkupStateArchiveOpJavaData::BackupMidletDataL() - trying to get midlet data for hash: %S", hash );
			CleanupStack::PopAndDestroy( hash );
#endif

			iBackupTransferObjectMidletData->RequestL( owner, 
                                                       iStatus,
                                                       Driver().DrvParamsBase().DriveAndOperations() );
            SetActive();
            }
        else
            {
            CompleteSelf();
            }
        }
    else
        {
        CompleteSelf();
        }

    iCurrentJavaState = EJavaStateMidletData;
    }
/**
Resumes the operation following a migration.
*/
void CImapCompoundDeleteFolder::ResumeOperationL(TRequestStatus& aStatus, CImapSession& aSession)
	{
	iSession = &aSession;
	__LOG_TEXT(iSession->LogId(), "CImapCompoundDeleteFolder::Resuming");
	__ASSERT_DEBUG(iCurrentStep==ESuspendedForMigrate, TImapServerPanic::ImapPanic(TImapServerPanic::EDeleteCompoundUnexpectedState));
	iStopForMigrate = EFalse;
	
	// Switch on next step - some "next steps" require a SELEECT first...
	switch (iNextStep)
		{
		case ESelectSourceMailboxRW:
		case EDeleteFolder:
			{
			// just return to the main state machine
			CompleteSelf();
			break;
			}

		case EDeleteAllMessages:
		case ECloseFolder:
		case EDeleteLocalFolder:
		case EFinished:
			// not expected
		default:
			{
			__ASSERT_DEBUG(EFalse, TImapServerPanic::ImapPanic(TImapServerPanic::EDeleteCompoundUnexpectedState));
			// abandon the compound operation
			iNextStep=EFinished;
			CompleteSelf();
			break;
			}
		}
	Queue(aStatus);
	}
void CAfDatabaseCleaner::RunL()
{
    if (KErrNone == iStatus.Int()) {
        switch (mCleanupStep) {
            case Initial:
            {
                User::LeaveIfError(mIncrementalInterface.Compact(mDatabase, mStep));
                mCleanupStep = Continuation;
                SetActive();
                CompleteSelf(KErrNone);
                break;
            }
            case Continuation:
            {
                User::LeaveIfError(mIncrementalInterface.Next(mStep));
                if (mStep != 0) {
                    SetActive();
                    CompleteSelf(KErrNone);
                } else {
                    mIncrementalInterface.Close();
                }
                break;
            }
            default:
                User::Leave(KErrArgument);
        }
    }
}
void CTcpClientTestUPnP1::ReceivedL ( const TRuntimeCtxId& /*aSender*/, const TNodeId& /*aRecipient*/, TSignatureBase& aMessage )
	{
	if ( aMessage.IsMessage<TCFFactory::TPeerFoundOrCreated> () )
		{
		const TCFFactory::TPeerFoundOrCreated& msg = message_cast < const TCFFactory::TPeerFoundOrCreated > ( aMessage );
		iClientId = msg.iNodeId;
		CompleteSelf ( KErrNone );
		}
	else if ( aMessage.IsMessage<TUpnpMessage::TResponse > () )
		{
		TUpnpMessage::TResponse& msg = message_cast< TUpnpMessage::TResponse >(aMessage);
		
		RBuf8 responseBodyData;
		responseBodyData.CreateMax ( msg.iBodyData.Length () );
		responseBodyData.FillZ ( msg.iBodyData.Length () );
		msg.iBodyData.CopyOut ( responseBodyData );	
		responseBodyData.Close ();
		msg.iBodyData.Free ();
		
		CompleteSelf(EPass);
		}
	else if ( aMessage.IsMessage<TEBase::TError > () )
		{
		iLogger.WriteFormat(_L("<i>TEBase::TError..... </i>"));
		CompleteSelf(EFail);
		}

	}
void CTcpClientTestUPnP13::ReceivedL ( const TRuntimeCtxId& /*aSender*/, const TNodeId& /*aRecipient*/, TSignatureBase& aMessage )
	{
	if ( aMessage.IsMessage<TCFFactory::TPeerFoundOrCreated> () )
		{
		const TCFFactory::TPeerFoundOrCreated& msg = message_cast < const TCFFactory::TPeerFoundOrCreated > ( aMessage );
		iClientId = msg.iNodeId;
		
		
		iFlow = mcfnode_cast<CSubConnectionFlowBase>(
		reinterpret_cast<Messages::ANode*>(	iClientId.Ptr()));
		
		
		// Perform the binding to the flow below
		iFlowBinder = iFlow->GetBinderControlL();
		iSSP = iFlowBinder->GetControlL(KSockStream, *this);
		iSSPData = iFlowBinder->BindL(*this);
		
		
		CompleteSelf ( KErrNone );
		}
	else if ( aMessage.IsMessage<TUpnpMessage::TResponse > () )
		{
		
		CompleteSelf(EPass);
		}
	else if ( aMessage.IsMessage<TEBase::TError > () )
		{
		iLogger.WriteFormat(_L("<i>TEBase::TError..... </i>"));
		CompleteSelf(EFail);
		}

	}
// ---------------------------------------------------------------------------
// CMMCScBkupStateArchiveOpJavaData::RestoreMidletDataL()
// 
// 
// ---------------------------------------------------------------------------
void CMMCScBkupStateArchiveOpJavaData::RestoreMidletDataL()
    {
    CMMCScBkupIndexBase& indexBase = Driver().DrvArchive().Footer().IndexByType( EMMCScBkupOwnerDataTypeJavaData );
    CMMCScBkupIndexJavaData& index = static_cast< CMMCScBkupIndexJavaData& >( indexBase );

    const TInt count = index.Count();
    __LOG1("CMMCScBkupStateArchiveOpJavaData::RestoreMidletDataL() - START - %d data owners...", count );
    //
    if  ( iIndexValueCurrent < count )
        {
        __LOG2("CMMCScBkupStateArchiveOpJavaData::RestoreMidletDataL() - getting java data index record [%03d/%03d]", iIndexValueCurrent, count);
        const CMMCScBkupIndexJavaDataEntry& entry = index.At( iIndexValueCurrent );

        if  ( entry.HasMidletDataInfo() )
            {
            // Get the associated data owner
            CMMCScBkupDataOwnerCollection& dataOwners = Driver().DrvDataOwners();

            __LOG1("CMMCScBkupStateArchiveOpJavaData::RestoreMidletDataL() - trying to get data owner info for hash: %S", &entry.Hash() );
            CMMCScBkupDataOwnerInfo& owner = dataOwners.OwnerL( entry.Hash() );

            if  ( owner.CompletionStatus( EMMCScBkupOwnerDataTypePassiveData ) == EFalse )
                {
                // Request all the java data (on all supported drives) for this
                // particular data owner
    			__LOG3("CMMCScBkupStateArchiveOpJavaData::RestoreMidletDataL() - trying to restore JAVA MIDLET DATA for hash: %S [offset: %8d, length: %8d]", &entry.Hash(), entry.MidletDataInfo().Offset(), entry.MidletDataInfo().Length() );

                // Build restore entry list (will only contain one entry - the 
                // reader API forces an array interface on us, so let's do ou best
                // to please it...)
                const TMMCScBkupArchiveDriveAndVector driveAndVector( entry.Drive(),  entry.MidletDataInfo() );
                iRestoreEntries.Reset();
                iRestoreEntries.AppendL( driveAndVector );
            
                // Start the asynchronous restore op...
                iRestoreTransferObjectMidletData->RequestL( owner, 
                                                            iStatus,
                                                            iRestoreEntries );
                SetActive();
                }
            else
                {
                CompleteSelf();
                }
            }
        else
            {
            CompleteSelf();
            }
        }
    else
        {
        CompleteSelf();
        }

    iCurrentJavaState = EJavaStateMidletData;
    }
void CTcpSymbianEngine::StartLookupL()
{
   DBG("StartLookupL");
   SetEngineState(ELookingUp);
   // Initiate DNS
   if(KErrNone == 
#if defined NAV2_CLIENT_SERIES60_V3  && !defined __WINS__ && !defined __WINSCW__
      iResolver.Open(iSocketServ, KAfInet,
                     KProtocolInetUdp, iConnection)
#else
      iResolver.Open(iSocketServ, KAfInet, KProtocolInetUdp)
#endif
      ){

      if(KErrNone == iDNSCache.CacheHostLookup(*iHostName, iNameEntry, iPort)){
         DBG("Host found in cache");
         CompleteSelf(KErrNone);
      } else {
         DBG("Host not found in cache, looking up in DNS");
         // DNS request for name resolution
         iResolver.GetByName(*iHostName, iNameEntry, iStatus);
         SetActive();
      }
      // Request time out
      iTimer->After(iTimeOut);
      //signal state
      iConsole.ConnectionNotify(isab::Module::CONNECTING,
                                 isab::Module::REQUESTED);
      DBG("Starting asynchronous name lookup");
   } else {
      WARN("Lookup failed");
      ResetL(ELookUpFailed, isab::Module::LOOKUP_FAILED);
   }
}
void CTcpClientTestUPnP13::NewData(TUint aCount)
	{
	RMBufChain data;
	RBuf8 resData;
	
	iLogger.WriteFormat(_L("<i>NewData..... </i>"));
	iSSP->GetOption(1,KCHMaxLength,resData);
	resData.Create( aCount );
	iSSP->GetOption(KCHOptionLevel,KCHMaxLength,resData);
	TInt len = *(TUint*) resData.Ptr();
	resData.Close();
	
	iSSPData->GetData(data,aCount,0);
	resData.Create( aCount );
	data.CopyOut(resData);
	resData.Close();
	resData.Create( aCount );
	iSSP->GetOption(KCHOptionLevel,KCHLastMessage,resData);
	TBool isLastMsg = *(TUint*) resData.Ptr();
	resData.Close();
	data.Init();
	
	if(isLastMsg)
		{
		iLogger.WriteFormat(_L("<i>NewData.LastMsg.... </i>"));
		CompleteSelf ( KErrNone );
		}
	}
// ---------------------------------------------------------------------------
// CMMCScBkupStateRequestSizeOfBackupData::PerformAsynchronousErrorCleanup()
// 
// 
// ---------------------------------------------------------------------------
TBool CMMCScBkupStateRequestSizeOfBackupData::PerformAsynchronousErrorCleanup( TInt aError )
    {
    (void) aError;
    __LOG1("CMMCScBkupStateRequestSizeOfBackupData::PerformAsynchronousErrorCleanup() - **** - error: %d", aError );
    TBool continueProcessing = ETrue;

    // Cancel requester. Its probably already inactive, but just in case...
    PerformAsynchronousCancellation();

    // Reset state and move to next item. Treat the current (badly behaving) item
    // as completed/processed.
    CMMCScBkupDataOwnerCollection& dataOwners = Driver().DrvDataOwners();
    if  ( iCurrentDataOwnerIndex < dataOwners.Count() )
        {
        CMMCScBkupDataOwnerInfo& owner = dataOwners.Owner( iCurrentDataOwnerIndex );

        (void) owner;
        __LOGFILE2("CMMCScBkupStateRequestSizeOfBackupData::PerformAsynchronousErrorCleanup() - **** - error: %d, SID: 0x%08x - SIZE OF DATA skipped for DO", aError, owner.SecureId().iId );

        // Ensures that asynchronous state step is called again..
        CompleteSelf();
        }
    else
        {
        continueProcessing = EFalse;
        }
    //
    __LOG1("CMMCScBkupStateRequestSizeOfBackupData::PerformAsynchronousErrorCleanup() - END - continueProcessing: %d", continueProcessing );
    return continueProcessing;
    }
// ---------------------------------------------------------------------------
// CAOConnectionImpl::DoCancel
// ---------------------------------------------------------------------------
//
void CAOConnectionImpl::DoCancel()
    {
    LOG_1( _L("CAOConnectionImpl::DoCancel") );
    
    ChangeState( EDisconnected );
    CompleteSelf( iStatus, KErrCancel );
    }
// ---------------------------------------------------------------------------
// CMMCScBkupStateRequestListOfPublicFiles::PerformStateInitL()
// 
// 
// ---------------------------------------------------------------------------
void CMMCScBkupStateRequestListOfPublicFiles::PerformStateInitL()
    {
    // Set to -1 so that the first time RunL is called, we start with
    // the data owner at index 0.
    iCurrentDataOwnerIndex = -1;
    CompleteSelf(KErrNone);
    }
// ---------------------------------------------------------------------------
// CMMCScBkupStateArchiveOpJavaData::PerformAsynchronousStateStepRestoreL()
// 
// 
// ---------------------------------------------------------------------------
void CMMCScBkupStateArchiveOpJavaData::PerformAsynchronousStateStepRestoreL( TBool /*aPartial*/ )
    {
    __LOG1("CMMCScBkupStateArchiveOpJavaData::PerformAsynchronousStateStepRestoreL() - START - iCurrentJavaState: %d", iCurrentJavaState );

    switch( iCurrentJavaState )
        {
    case EJavaStateIdle:
        __LOG("CMMCScBkupStateArchiveOpJavaData::PerformAsynchronousStateStepRestoreL() - EJavaStateIdle");
        RestoreMidletL();
        break;
    case EJavaStateMidlet:
        __LOG("CMMCScBkupStateArchiveOpJavaData::PerformAsynchronousStateStepRestoreL() - EJavaStateMidlet");
        RestoreMidletDataL();
        break;
    case EJavaStateMidletData:
        __LOG("CMMCScBkupStateArchiveOpJavaData::PerformAsynchronousStateStepRestoreL() - EJavaStateMidletData");
        iCurrentJavaState = EJavaStateIdle;
        CompleteSelf();
        break;
    default:
        break;
        }

    __LOG2("CMMCScBkupStateArchiveOpJavaData::PerformAsynchronousStateStepRestoreL() - END - iCurrentJavaState: %d, IsActive: %d", iCurrentJavaState, IsActive() );
    }
// ---------------------------------------------------------------------------
// CMMCScBkupStateRequestSizeOfDataOwner::RunL()
// 
// 
// ---------------------------------------------------------------------------
void CMMCScBkupStateRequestSizeOfDataOwner::RunL()
    {
    __LOG2("CMMCScBkupStateRequestSizeOfDataOwner::RunL() - START - iStatus: %d, sid: 0x%08x", iStatus.Int(), iOwner->SecureId().iId);

    User::LeaveIfError(iStatus.Int());
    //
    TDriveNumber drive = EDriveA;
    const TDriveList& ownerDrives = iOwner->Owner().DriveList();
    const TBool driveAvailable = NextValidDrive(drive, ownerDrives);
    //
    if  (driveAvailable)
        {
        CDataOwnerInfo& owner = iOwner->Owner();
        CSBGenericDataType& identifier = owner.Identifier();

        // Size any active and passive data
        GetActiveAndPassiveDataSizesL( owner, identifier, drive );

        // Size any system package data
        GetSystemDataSizesL( owner, identifier, drive );

        // Size any java data
        GetJavaDataSizesL( owner, identifier, drive );

        // Complete ourself to try the next drive
        CompleteSelf(KErrNone);
        __LOG1("CMMCScBkupStateRequestSizeOfDataOwner::RunL() - END - sid: 0x%08x, checking next drive...", iOwner->SecureId().iId);
        }
    else
        {
        __LOG1("CMMCScBkupStateRequestSizeOfDataOwner::RunL() - END - sid: 0x%08x, last drive scanned => notifying observer", iOwner->SecureId().iId);
        CompleteObserverRequest(KErrNone);
        }
    }
// ---------------------------------------------------------------------------
// CAOConnectionImpl::HandleConnectionCallBackL
// ---------------------------------------------------------------------------
//
void CAOConnectionImpl::HandleConnectionCallBackL()
    {
    LOG_1( _L("CAOConnectionImpl::HandleConnectionCallBackL") );
    
    iConnectionTimer->Cancel();
    CompleteSelf( iStatus, iActivationError );
    }
void CImapCompoundDelete::StartOperation(TRequestStatus& aStatus, CImapSession& aSession)
	{
	iSession = &aSession;
	__LOG_TEXT(iSession->LogId(), "CImapCompoundDelete::StartOperation()");
	iNextStep = ESelectSourceMailboxRW;
	Queue(aStatus);
	CompleteSelf();
	}
void CAfDatabaseCleaner::StartCleanup()
{
    if (!IsActive()) {
        mCleanupStep = Initial;
        SetActive();
        CompleteSelf(KErrNone);
    }
}
//	The socket listener starts listening on the specified port.
void CTestSocketListener::Listen(TUint16 aPort)
	{
	iPort = aPort;

	// Move to the StartListen state and self complete
	iState = EStartListen;
	CompleteSelf();
	}
// ---------------------------------------------------------------------------
// CMMCScBkupStateRequestSpecificPublicFileInfo::RequestL()
// 
// 
// ---------------------------------------------------------------------------
void CMMCScBkupStateRequestSpecificPublicFileInfo::RequestL( CMMCScBkupDataOwnerInfo& aOwner, TRequestStatus& aObserver )
    {
    iOwner = &aOwner;
    CMMCScBkupDriveSpecificRequest::RequestL( aObserver );

    // Start the asynchronous request. 
    CompleteSelf(KErrNone);
    }
// ---------------------------------------------------------------------------
// CMMCScBkupReadDataTransferRequestBase::ProcessChunkOfDataL()
// 
// 
// ---------------------------------------------------------------------------
TBool CMMCScBkupReadDataTransferRequestBase::ProcessChunkOfDataL()
    {
    __ASSERT_ALWAYS( iCurrentIndex >= 0, User::Invariant() );

    TBool callAgain = EFalse;

    // Do we need to move to the next entry?
    TBool entryAvailable = ( iCurrentIndex < iEntries->Count() );
    if  ( entryAvailable )
        {
        // At least one more entry left to process.. but have we finished
        // the current entry? If we've read all the data, then the
        // answer is yes...
        const TMMCScBkupArchiveDriveAndVector& entry = (*iEntries)[ iCurrentIndex ];
        const TInt endOffset = entry.iVector.EndOffset();

#ifdef __MMCSCBKUPLOGGING_ENABLED__
		if ( ElementType() == EMMCScBkupOwnerDataTypeJavaData )
			{
			HBufC* hash = MMCScBkupSBEUtils::JavaHashFromGenericLC( DataOwner().Owner().Identifier() );
			__LOG6("CMMCScBkupReadDataTransferRequestBase::ProcessChunkOfDataL() - START - JavaHash: %S, ElementType: %S, offset: %8d, length: %8d, endOffset: %8d, drive: %c:", hash, &MMCScBkupLogger::DataType( ElementType() ), entry.iVector.Offset(), entry.iVector.Length(), endOffset, entry.iDrive + 'A' );
			CleanupStack::PopAndDestroy( hash );
			}
		else
			{
			__LOG6("CMMCScBkupReadDataTransferRequestBase::ProcessChunkOfDataL() - START - DO: 0x%08x, ElementType: %S, offset: %8d, length: %8d, endOffset: %8d, drive: %c:", DataOwner().SecureId().iId, &MMCScBkupLogger::DataType( ElementType() ), entry.iVector.Offset(), entry.iVector.Length(), endOffset, entry.iDrive + 'A' );
			}
#endif

        // Check bounds
        if  ( CurrentOffset() < 0 || CurrentOffset() > endOffset )
            {
            ASSERT( EFalse );
            User::Leave( KErrCorrupt );
            }
        //
        if  ( iCurrentOffset == endOffset )
            {
            // We're done with this entry - move to the next
            entryAvailable = PrepareForNextEntry();
            }
        }
    //
    if  ( entryAvailable )
        {
        // We need to read more archive data in order to transfer this
        // entry to the SBE
        callAgain = DoProcessChunkOfDataL();
        }
    else
        {
        // No more left to process - we're finished!
        SetState( EFinished );
        CompleteSelf();
        }
    //
    return callAgain;
    }
void CTcpClientTestUPnP10::ReceivedL ( const TRuntimeCtxId& /*aSender*/, const TNodeId& /*aRecipient*/, TSignatureBase& aMessage )
	{
	if ( aMessage.IsMessage<TCFFactory::TPeerFoundOrCreated> () )
		{
		const TCFFactory::TPeerFoundOrCreated& msg = message_cast < const TCFFactory::TPeerFoundOrCreated > ( aMessage );
		iClientId = msg.iNodeId;
		CompleteSelf ( KErrNone );
		}
	else if ( aMessage.IsMessage<TUpnpMessage::TResponse > () )
		{
		CompleteSelf(EPass);
		}
	else if ( aMessage.IsMessage<TEBase::TError > () )
		{
		iLogger.WriteFormat(_L("<i>TEBase::TError..... </i>"));
		CompleteSelf(EFail);
		}
	}
// ---------------------------------------------------------------------------
// CMMCScBkupStateArchiveOpJavaData::PerformAsynchronousErrorCleanupRestore()
// 
// 
// ---------------------------------------------------------------------------
TBool CMMCScBkupStateArchiveOpJavaData::PerformAsynchronousErrorCleanupRestore( TBool /*aPartial*/, TInt aError )
    {
    (void) aError;
    __LOGFILE1("CMMCScBkupStateArchiveOpJavaData::PerformAsynchronousErrorCleanupRestore() - **** - error: %d", aError );

    iCurrentJavaState = EJavaStateIdle;
    CompleteSelf();
    return ETrue;
    }
/**
 * From CActive
 */
void CPositionRequest::DoCancel()
    {
    OstTraceFunctionEntry1( CPOSITIONREQUEST_DOCANCEL_ENTRY, this );
    LBS_RDEBUG_VAR_INT("CPositionRequest::DoCancel() iRequestPhase", iRequestPhase);
    iTimeoutTimer->Cancel();

    switch (iRequestPhase)
        {
        case EPosReqPositionRequest:
            {
            __ASSERT_DEBUG(iPositioner, DebugPanic(EPosServerPanicPositionerNotInitialized));
            DEBUG_TRACE("calling CPositioner::CancelNotifyPositionUpdate()", __LINE__)
            if(iRequestTimedOut)
            	{
            	iPositioner->CancelNotifyPositionUpdate(KErrTimedOut);
            	}
            else
            	{
            	iPositioner->CancelNotifyPositionUpdate();
            	}
            break;
            }
        case EPosWaitForTracking:
            CompleteSelf(KErrCancel);
            break;

        default:
        	DEBUG_TRACE("CPositionRequest::DoCancel() panicing", __LINE__)
            DebugPanic(EPosServerPanicRequestInconsistency);
        }
    
    // Deactive positioning status after cancellation.
    DeActivatePositioningStatusIfNeeded();

    TInt err;
    if (iRequestTimedOut)
        {
        iRequestTimedOut = EFalse;
        CompleteClient(KErrTimedOut);
        TRAP(err, HandleTrackingStateL());
        }
    else
        {
        CompleteClient(KErrCancel);

        // Handle Tracking State
        if (iTrackingState == EPosStopTracking)
            {
            StopTracking();
            }
        }

    iRequestPhase = EPosReqInactive;
    
    OstTraceFunctionExit1( CPOSITIONREQUEST_DOCANCEL_EXIT, this );
    }
void CNwssConnectGuard::SendDisconnectInd(Wap::TWspReason aReason)
	{
	// Specify that need to send S-Disconnect.ind
	iSendDisconnect = ETrue;

	// Store the reason code
	iDisconnectReason = aReason;

	CompleteSelf();
	}
void CConnectionControl::Request()
{
   __ASSERT_ALWAYS(iCritical.IsBlocked(), 
                   User::Panic(KConnPanic, ENoCritical));
   ASSERT_IS_THREAD(iThreadId, EWrongThread);
   ActivateSelf();
   if(iCommands->Count() > 0){
      CompleteSelf(KErrNone);
   }
}
Beispiel #25
0
/**
 Called when the remote contact view is ready to be used. Records the time taken to 
 asynchronously create the remote view.
*/
void CStartUp::HandleContactViewEvent(const CContactViewBase& aView, const TContactViewEvent& aEvent)
	{
	if (aEvent.iEventType == TContactViewEvent::EReady && &aView == iContactRemoteView)
		{
		// Called when the view is ready to use; complete the request status.
		iTimer.StopTimer();
		iTimes[ECreateView] = iTimer.Result();
		iTimer.ResetTimer();
		CompleteSelf();
		}
	}
void CTcpSymbianEngine::OpenLinkLayerAgentL()
{
#ifdef RAGENT
   DBG("OpenLinkLayerAgentL");
   iAgent = new (ELeave) RGenericAgent;
   User::LeaveIfError(iAgent->Open());
   // Series60 release 1 (eg. Nokia 7650/3650)
   //
   TBool isUp=EFalse;
   iAgent->NetworkActive(isUp);
   if (!isUp) {
      // Attempt to open a connection using the selected IAP
      delete iCommsOverrides;
      iCommsOverrides = NULL;
# ifdef NAV2_CLIENT_UIQ
      iCommsOverrides = 
         CStoreableOverrideSettings::NewL(
            CStoreableOverrideSettings::EParamListPartial );
# else //s60v1
      iCommsOverrides = 
         CStoreableOverrideSettings::NewL(
            CStoreableOverrideSettings::EParamListPartial,
            EDatabaseTypeIAP);
# endif
      iPrefs = CCommsDbConnectionPrefTableView::TCommDbIapConnectionPref();
      iPrefs.iRanking = 1;
      iPrefs.iDirection = ECommDbConnectionDirectionOutgoing;
      iPrefs.iBearer.iBearerSet = ECommDbBearerUnknown;
      if(iIAP != -2){
         if (iIAP >= 0) {
            iPrefs.iDialogPref = ECommDbDialogPrefDoNotPrompt;
            iPrefs.iBearer.iIapId = iIAP;
         } else {
            // Use Always ask
            iPrefs.iDialogPref = ECommDbDialogPrefPrompt;
            iPrefs.iBearer.iIapId = 0;
         }
         iCommsOverrides->SetConnectionPreferenceOverride(iPrefs);
         iAgent->StartOutgoing(*iCommsOverrides, iStatus);
         SetActive();
         DBG("Starting async link layer connection");
      } 
   }
   if(!IsActive()){
      //if IsActive returns EFalse the network is either already up or
      //we should use system default (iap = -2), in either case
      //complete immediately
      DBG("Link layer already active, complete immediately. ");
      CompleteSelf(KErrNone);
   }
#else 
   ERR("OpenLinkLayerAgentL");
#endif
}
/**
Resumes the operation following a migration.
*/
void CImapCompoundDelete::ResumeOperationL(TRequestStatus& aStatus, CImapSession& aSession)
	{
	iSession = &aSession;
	__LOG_TEXT(iSession->LogId(), "CImapCompoundDelete::Resuming");
	__ASSERT_DEBUG(iCurrentStep==ESuspendedForMigrate, TImapServerPanic::ImapPanic(TImapServerPanic::EDeleteCompoundUnexpectedState));
	iStopForMigrate = EFalse;
	
	// Switch on next step - some "next steps" require a SELEECT first...
	switch (iNextStep)
		{
		case ESelectSourceMailboxRW:
		case ESelectFolderAfterClose:
			{
			// just return to the main state machine
			CompleteSelf();
			break;
			}
		case EDeleteMessage: 
		case EExpunge:
		case ECloseFolder:
			{
			// re-issue the SELECT before kicking off the DELETE or EXPUNGE command:
			iParentFolder->SelectL(iStatus, *iSession);
			iCurrentStep = ESelectSourceMailboxRW;
			SetActive();
			break;
			}
		case EDeleteLocalMessage:
		case EFinished:
			// not expected
		default:
			{
			__ASSERT_DEBUG(EFalse, TImapServerPanic::ImapPanic(TImapServerPanic::EDeleteCompoundUnexpectedState));
			// abandon the compound operation
			iNextStep=EFinished;
			CompleteSelf();
			break;
			}
		} // end switch (iNextStep)
	Queue(aStatus);
	}
// ---------------------------------------------------------------------------
// CAOSettings::DoCancel
// ---------------------------------------------------------------------------
//
void CAOSettings::DoCancel()
{
    LOG_1( _L("CAOSettings::DoCancel") );

    // We must complete pending request if needed
    // Checking IsActive is not sufficient, we must check also
    // iStatus
    if ( iStatus == KRequestPending && IsActive() )
    {
        CompleteSelf( iStatus, KErrCancel );
    }
}
// ---------------------------------------------------------------------------
// CAOSettings::FetchSettings
// ---------------------------------------------------------------------------
//
void CAOSettings::FetchSettings( TUint32 aId )
{
    LOG_2( _L("CAOSettings::FetchSettings: aId: %d"), aId );

    __ASSERT_DEBUG( !IsActive(), Panic( EAlreadyFetchingSettings ) );

    // Let just scheduler run and get settings when RunL is called
    iSettingsToFetch = aId;
    iStatus = KRequestPending;
    SetActive();
    CompleteSelf( iStatus, KErrNone );
}
void CImapCompoundDeleteFolder::SelectSourceMailboxL()
	{
	iFolder = NULL;
	iRemoteFolderNotDeleted=EFalse;
	
	// Get a temporary folder object for the delete operation, as this
	// can be performed on non-subscribed folders for which the sync manager
	// does not own a folder object. Owned by this class.
	iFolder = iSyncManager.GetFolderL((*iDeleteSel)[0]);
	if (iFolder==NULL)
		{
		IncrementProgress();
		// Try with the next folder in the array, unless this was the last.
		if (iDeleteSel->Count()==0)
			{
			iNextStep=EFinished;
			}
		CompleteSelf();
		}
	else
		{
		SetEntryL(iFolder->MailboxId());
		TMsvEmailEntry entry = iServerEntry.Entry();
		if (entry.Mailbox())
			{
			iFolder->SelectL(iStatus, *iSession);
			iProgressState = TImap4GenericProgress::ESelecting;
			iNextStep=EDeleteAllMessages;
			SetActive();
			}
		else
			{
			// do not attempt to select a folder marked \noselect
			// go straight to the delete folder step.
			iNextStep=EDeleteLocalFolder;
			CompleteSelf();
			}
		}
	}