void CBulkCommitServerMtm::StartCommandL(CMsvEntrySelection& aSelection, TInt aCommand, const TDesC8& aParameter, TRequestStatus& aStatus) { iProgress().SetCommand(aCommand); const TMsvId id = iServerEntry->Entry().Id(); TRAP(iProgress().iError, DoStartCommandL(aSelection, iProgress().Command(), aParameter, aStatus)); TRequestStatus* bStatus = &aStatus; User::RequestComplete(bStatus, iProgress().iError); iServerEntry->SetEntry(id); }
const TDesC8& CSmsSendMessageOperation::TranslateProgress(const TDesC8& aProgress) { TSmsProgressBuf& progress = (TSmsProgressBuf&) aProgress; // default progress iProgress().iProgressMax = 0; iProgress().iProgress = 0; // convert SMS progress into standard send progress switch (progress().iType) { case TSmsProgress::ESmsProgressTypeSending: case TSmsProgress::ESmsProgressTypeScheduling: iProgress().iProgressMax = progress().iMsgCount; iProgress().iProgress = progress().iMsgDone; iProgress().iState = ESendStateSending; break; default: iProgress().iState = ESendStateWaitingToSend; break; } // get error iProgress().iError = progress().iError; return iProgress; }
void CProgress::RunL() { TInt err = iStatus.Int(); // When progres is complete, do if(err == KErrNone) { iLogger.Log(_L("Iap %d on network %d progress %d completed, error %d"), iPref.IapId(), iPref.NetId(), iProgress().iStage , iProgress().iError); if (iProgress().iStage != KLinkLayerOpen) Progress(); else if(iSavedStatus) { iLogger.Log(_L("Completing Progress object")); User::RequestComplete(iSavedStatus, err); iSavedStatus = NULL; } } }
void CPigeonServerMtm::UpdateProgressL(const CMsvEntrySelection& aSelection) { RFileLogger::WriteFormat(KSchSendLogDir, KPigeonLogFile, EFileLoggingModeAppend, _L("CPigeonServerMtm::UpdateProgressL(aSelection.Count() == %d)"), aSelection.Count()); //Uses Progess to return the time that the task scheduler //reports that the first message in the selection is scheduled for if (aSelection.Count()==0) return; //Make a big load of reference parameters TInt size = 0; RScheduler scheduler; User::LeaveIfError(scheduler.Connect()); CleanupClosePushL(scheduler); CMsvScheduledEntry* entry = ScheduledEntryLC(aSelection[0]); const TInt taskId = entry->iData.iTaskId; const TInt error = scheduler.GetTaskDataSize(taskId, size); if(error == KErrNone) { TTaskInfo info; HBufC* buf = HBufC::NewLC(size); TPtr ptr(buf->Des()); TSchedulerItemRef ref; TTime time; User::LeaveIfError(scheduler.GetTaskInfoL(taskId, info, ptr, ref, time)); iProgress().iTime = time; CleanupStack::PopAndDestroy(buf); } else if (error == KErrNotFound) { iProgress().iTime = entry->ScheduleDate(); } else User::Leave(error); CleanupStack::PopAndDestroy(2); //entry, scheduler }
void CPigeonServerMtm::StartCommandL(CMsvEntrySelection& aSelection, TInt aCommand, const TDesC8& aParameter, TRequestStatus& aStatus) { RestoreSettingsL(); iProgress().SetCommand(aCommand); const TMsvId id = iServerEntry->Entry().Id(); RFileLogger::WriteFormat(KSchSendLogDir, KPigeonLogFile, EFileLoggingModeAppend, _L("CPigeonServerMtm::StartCommandL(aSelection.Count() == %d, aCommand == %d, aParamter.Length() == %d)"), aSelection.Count(), aCommand, aParameter.Length()); TRAP(iProgress().iError, DoStartCommandL(aSelection, iProgress().Command(), aParameter, aStatus)); TRequestStatus* bStatus = &aStatus; User::RequestComplete(bStatus, iProgress().iError); iServerEntry->SetEntry(id); //ignore error }
// ---------------------------------------------------------------------------- // CIpsPlgPop3ConnectOp::ProgressL() // ---------------------------------------------------------------------------- // const TDesC8& CIpsPlgPop3ConnectOp::ProgressL() { FUNC_LOG; if( iError != KErrNone ) { return GetErrorProgressL( iError ); } else if( iSubOperation ) { return iSubOperation->ProgressL(); } iProgress().iErrorCode = KErrNone; return iProgress; }
// ---------------------------------------------------------------------------- // CIpsPlgPop3ConnectOp::GetErrorProgressL // ---------------------------------------------------------------------------- // const TDesC8& CIpsPlgPop3ConnectOp::GetErrorProgressL( TInt aError ) { FUNC_LOG; iError = aError; if ( iSubOperation && iError == KErrNone ) { return iSubOperation->ProgressL(); } TPop3Progress& progress = iProgress(); progress.iPop3Progress = TPop3Progress::EPopConnecting; progress.iTotalMsgs = 0; progress.iMsgsToProcess = 0; progress.iBytesDone = 0; progress.iTotalBytes = 0; progress.iErrorCode = iError; progress.iPop3SubStateProgress = TPop3Progress::EPopConnecting; progress.iServiceId = iService; return iProgress; }
EXPORT_C TInt TMemSpyDeviceWideOperationProgress::Progress() const { return iProgress(); }
// --------------------------------------------------------------------------- // CIAPConnect_v20ProgressNotifier::RunL() // // Handle request completion events // --------------------------------------------------------------------------- // void CIAPConnect_v20ProgressNotifier::RunL() { switch (iProgress().iStage) { // Connection unitialised case KConnectionUninitialised: iState = EIAPConnectStateNotConnected; iObserver->ChangeStateL(KTextConnectionUninitialised); break; // Starting connetion selection case KStartingSelection: iState = EIAPConnectStateConnecting; iObserver->ChangeStateL(KTextStartingSelection); break; // Selection finished case KFinishedSelection: iState = EIAPConnectStateConnecting; iObserver->ChangeStateL(KTextFinishedSelection); break; // Connection failure case KConnectionFailure: iState = EIAPConnectStateNotConnected; iObserver->ChangeStateL(KTextConnectionFailure); break; // Prepearing connection (e.g. dialing) case KPsdStartingConfiguration: case KPsdFinishedConfiguration: case KCsdFinishedDialling: case KCsdScanningScript: case KCsdGettingLoginInfo: case KCsdGotLoginInfo: iState = EIAPConnectStateConnecting; iObserver->ChangeStateL(KTextPreparingConnection); break; // Creating connection (e.g. GPRS activation) case KCsdStartingConnect: case KCsdFinishedConnect: iState = EIAPConnectStateConnecting; iObserver->ChangeStateL(KTextConnecting); break; // Starting log in case KCsdStartingLogIn: iState = EIAPConnectStateConnecting; iObserver->ChangeStateL(KTextCsdStartingLogIn); break; // Finished login case KCsdFinishedLogIn: iState = EIAPConnectStateConnecting; iObserver->ChangeStateL(KTextCsdFinishedLogIn); break; // Connection open case KConnectionOpen: case KLinkLayerOpen: iState = EIAPConnectStateConnected; iObserver->ChangeStateL(KTextConnectionOpen); break; // Connection blocked or suspended case KDataTransferTemporarilyBlocked: iState = EIAPConnectStateConnected; iObserver->ChangeStateL(KTextConnectionSuspended); break; // Hangup or GRPS deactivation case KConnectionStartingClose: iState = EIAPConnectStateDisconnecting; iObserver->ChangeStateL(KTextConnectionStartingClose); break; // Connection closed case KConnectionClosed: case KLinkLayerClosed: iState = EIAPConnectStateNotConnected; iObserver->ChangeStateL(KTextConnectionClosed); break; // Unhandled state default: iState = EIAPConnectStateUnknown; iObserver->ChangeStateL(KUnknownStateText); break; } iConnection.ProgressNotification(iProgress, iStatus); SetActive(); }