//------------------------------------------------------------------------------
// CDisplayServiceLight::PublishContext
//------------------------------------------------------------------------------
//
void CDisplayServiceLight::PublishContext( CHWRMLight::TLightStatus aStatus )
    {
    FUNC_LOG;
    
    INFO_1( "Primary display light status = %d", aStatus );

    if ( aStatus >= 0 &&
         aStatus < KDisplayStatusTypeValueCount &&
         aStatus != iCurrentStatus )
        {
        // Store new status
        iCurrentStatus = aStatus;
        
        // Publish context, ignore error values
        TRAP_IGNORE( iContext->SetValueL(
            TPtrC( KDisplayStatusTypeValues[aStatus] ) ) );
        iCF.PublishContext( *iContext, iThread );
        }
    }
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
void CIpsPlgMessagePartStorerOperation::DoCancel()
    {
    // <qmail>
    TRequestStatus* status = &iObserverRequestStatus;
    if ( status && status->Int() == KRequestPending )
        {
        if (&iFSOperationObserver)
            {
            iFSProgress.iProgressStatus = TFSProgress::EFSStatus_RequestCancelled;
            iFSProgress.iError = KErrCancel;
            iFSProgress.iParam = NULL;

            TRAP_IGNORE( iFSOperationObserver.RequestResponseL( iFSProgress, iFSRequestId ) );
            }
        User::RequestComplete( status, iStatus.Int() );
        }
    // </qmail>
    FUNC_LOG;
    }
Beispiel #3
0
// ---------------------------------------------------------------------------
// CCmSqlMain::ConstructL
// ---------------------------------------------------------------------------
//    
void CCmSqlMain::ConstructL()
    {
    LOG(_L("[SQL Wrapper]\t CCmSqlMain::ConstructL"));
    
    TRAP_IGNORE( BaflUtils::EnsurePathExistsL( iFs, KCmSqlDirC ) );   
    iClause = CCmSqlDbClause::NewL();
    iMaintenance = CCmSqlDbMaintenance::NewL();
    iConnection = CCmSqlConnection::NewL();
    
    if( iMaintenance->InitConnection(*iConnection) )
        {
        iMaintenance->CreateDbFile( *iConnection );
        }
    if( !iConnection->Validate() )
        {
        iMaintenance->CreateDb( *iConnection );
        iMaintenance->CreateIndexes( *iConnection );        
        }        
    }    
/**
Utility method used to generate EContactDbObserverEventTablesOpened event
*/
void CPplContactsFile::GenerateNotificationEventL(TBool aNotify)
	{
	#if defined(__PROFILE_DEBUG__)
		RDebug::Print(_L("[CNTMODEL] MTD: CPplContactsFile::GenerateNotificationEventL"));
	#endif 
	
	// Generate an event - this event is generated if this was an explicit call from the
 	// server to opentables or recover database - ie A call on the contactsDatabase API
 	if (iDbObserver && aNotify)
 		{
 		TContactDbObserverEventV2 event;
		event.iType = EContactDbObserverEventTablesOpened;
		event.iContactId = 0;
 		event.iConnectionId = 0;
 		event.iTypeV2 = EContactDbObserverEventV2Null;
 		event.iAdditionalContactId = 0;
 		TRAP_IGNORE(iDbObserver->HandleDatabaseEventV2L(event));
 		}
	}
// -----------------------------------------------------------------------------
// CUpdateManager::LazyCallBack
//
// 
// -----------------------------------------------------------------------------
//
TBool CUpdateManager::LazyCallBack(TAny* aPtr)
    {
    CUpdateManager* ptr = (CUpdateManager*)aPtr;
    for(TInt i = 0; i < 10; i++)
        {
        if(ptr->iCurrentFeedCount< ptr->iFeedIds.Count())
            {
            TRAP_IGNORE(ptr->AddFeedL(ptr->iFeedIds[ptr->iCurrentFeedCount++]));
            }
        else
            {
            ptr->iCurrentFeedCount = 0;
            ptr->iFeedIds.Reset();
            ptr->StartTimer();
            return EFalse;
            }    
        }
    return ETrue;
    }
void HistoryEntry::storeThumbnail(const CFbsBitmap* thumbnail, const TRect& area)
{
    delete m_thumbnail;
    m_thumbnail = 0;
    if (!m_thumbnailBuf) {
        TRAP_IGNORE(m_thumbnailBuf = CBufFlat::NewL(4096));
    }
    if (m_thumbnailBuf) {
        RBufWriteStream stream(*m_thumbnailBuf);
		CleanupClosePushL(stream);
        TRAPD(err, thumbnail->ExternalizeRectangleL(stream, area));
        stream.Close();
		CleanupStack::PopAndDestroy(); //stream
        if (err) {
            delete m_thumbnailBuf;
            m_thumbnailBuf = 0;
        }
    }
}
// ---------------------------------------------------------------------------
// CFepUiLayoutRootCtrl::OnDeActivate
// Response to layout de activation event
// (other items were commented in a header).
// ---------------------------------------------------------------------------
//     
EXPORT_C void CFepUiLayoutRootCtrl::OnDeActivate()
    {
    if ( iPointerCaptureCtrl )
        {
        if(iPointerCaptureCtrl->PointerDown())
            {
            TRAP_IGNORE(iPointerCaptureCtrl->CancelPointerDownL());
            }
        
        //CFepLayoutMultiLineIcf::CancelPointerDownL may set iPointerCaptureCtrl to be NULL
        if ( iPointerCaptureCtrl )
        	{
        	iPointerCaptureCtrl->CapturePointer(EFalse);
            iPointerCaptureCtrl = NULL;
        	}
        }
    iPointerDownCanceled = EFalse;
    CControlGroup::OnDeActivate();
    }
/**
Close the database.
*/
void CPplContactsFile::Close(TBool aNotify)
{
    // Close the resource which depends on iDatabase before it will be closed.
    for (TInt i = 0; i < iSqlDatabaseObservers.Count(); i++ )
    {
        iSqlDatabaseObservers[i]->OnCloseL();
    }

    iDatabase.Close();
    iFileIsOpen = EFalse;

    REComSession::FinalClose(); // This line is necessary to make sure the plug-in is unloaded properly
    iLocalFs.Close(); //we now use a local File Session

    iIccContactStore.Close();

    TRAP_IGNORE(CloseTablesL(aNotify) ); // CloseTablesL() cannot leave anyway but still
    // trap in case implementation changes later
}
/**
 Loads and sets up the custom command dll
*/
void CCmdCustomCommand::PrepareCustomCmdL()
	{
	TInt err = KErrNone;
	if (!iLoaded)
		{
		// load the dll
		DEBUGPRINT2(_L("Loading library %S..."), &iInfo->FileName());
		err = iLibrary.Load(iInfo->FileName());
		if (err == KErrNone)
			{
			iLoaded = ETrue;
			if(iInfo->Unloading() == ENeverUnload)
				{
				//Record the handle into the file.
				//If it fails to write the handle, ignore it.
				//We don't want to stop the processing of the command due to this failure. 
				TRAP_IGNORE(WriteHandleToFileL(iLibrary.Handle()));
				}
			}
		}

	if (iLoaded)
		{
		err = KErrNotFound;

		// get a pointer to the function
		DEBUGPRINT2A("Looking up ordinal %d...", iInfo->Ordinal());
		TLibraryFunction function = iLibrary.Lookup(iInfo->Ordinal());
		if (function)
			{	
			// cast the pointer to our custom cmd type
			CustomCmdFunctionType customCmdFunction = reinterpret_cast<CustomCmdFunctionType>(function);
			iCustomCommand = (*customCmdFunction)();
			if (iCustomCommand)
				{
				err = KErrNone;
				}
			}
		}

	MoveToNextStateL(err, EInitialiseDll);
	}
void CImMobilityLogger::LogFormat(TInt /*aFilePos*/, VA_LIST& /*aList*/, TRefByValue<const TDesC8> /*aFmt*/)
#endif //__IM_MOBILITY_LOGGING
	{
#ifdef __IM_MOBILITY_LOGGING

	if (iFileList.Count() == 0)
		{
		return;
		}

	if (aFilePos >= iFileList.Count())
		{
		aFilePos = KDefaultLog;
		}

	if ((aFilePos == KDefaultLog) && (iDefaultLogFileInUse == EFalse))
		{
		return;
		}

	if (!iFileList[aFilePos].iLoggingOn)
		{
		return;
		}

	iFile = &iFileList[aFilePos].iFile;

	TPtr8 buf = iLogBuffer->Des();
	buf.Zero();

	TTime date;
	date.UniversalTime();
	TBuf<KDateFormatLength> dateString;
	TRAP_IGNORE(date.FormatL(dateString, KTxtLogDateFormat));
	buf.Copy(dateString);

	buf.AppendFormatList(aFmt, aList, this);
	iFile->Write(buf);
	iFile->Write(KTxtCRLF());

#endif //__IM_MOBILITY_LOGGING
	}
void CPenUiBackgroundWnd::Show(const TRect& aExtend, TBool aGlobalNotes, 
    TBool aInternal, TInt aPriority, TBool aResource)
    {
    //Show the window will cause a focus group change in global notes showing case.
    if (!iBitmap)
        {
        return;    
        }
    TUid curApp = GetCurAppUid();
    TUid focusApp = GetFocusAppUid();
    //dim effect due to global notes will not done by background control
    if(!aInternal || aGlobalNotes)
        return;    
      
//     if (iBitmapCpoy)
        {
//        delete iBitmapCpoy;
//        iBitmapCpoy = NULL;    
        }
    SetRect(aExtend);
    TRAP_IGNORE(ActivateL());
    MakeVisible(ETrue);
    if (!aResource)
        {
        RWsSession &ws = CCoeEnv::Static()->WsSession();
        TInt wgId =ws.GetFocusWindowGroup();    
        TInt priority = ws.GetWindowGroupOrdinalPriority(wgId);
        
        iWndGroup.SetOrdinalPosition( 0, aPriority); 

        Window().SetOrdinalPosition(0,aPriority);      
     
        Window().SetFaded(ETrue,RWindowTreeNode::EFadeWindowOnly);
        }
     else
        {
        Window().SetFaded(ETrue,RWindowTreeNode::EFadeWindowOnly);    
        }
 
    Window().Invalidate();
    DrawNow();
    }
Beispiel #12
0
	void CMsmmServer::DismountUsbDrivesL(TUSBMSDeviceDescription& aDevice)
    {
    OstTraceFunctionEntry0( CMSMMSERVER_DISMOUNTUSBDRIVERSL_ENTRY );
    delete iDismountManager;
    iDismountManager = NULL;
    iDismountManager= CMsmmDismountUsbDrives::NewL();
    
    //Also notify the MSMM plugin of beginning of dismounting     
    iDismountErrData->iError = EHostMsEjectInProgress;
    iDismountErrData->iE32Error = KErrNone;
    iDismountErrData->iManufacturerString = aDevice.iManufacturerString;
    iDismountErrData->iProductString = aDevice.iProductString;
    iDismountErrData->iDriveName = 0x0;
   
    TRAP_IGNORE(iPolicyPlugin->SendErrorNotificationL(*iDismountErrData));

    // Start dismounting
    iDismountManager->DismountUsbDrives(*iPolicyPlugin, aDevice);
	OstTraceFunctionExit0( CMSMMSERVER_DISMOUNTUSBDRIVERSL_EXIT );
    }
Beispiel #13
0
//
//	~CMsgImOutboxSend -- destructor.
//
CMsgImOutboxSend::~CMsgImOutboxSend( )
	{
	Cancel();
	TRAP_IGNORE(CleanUpOnDestructL());

	delete iSession;				//should be dead
	delete iSettings;

	if (iBccRcptArray)
		{
		iBccRcptArray->Reset();
		delete iBccRcptArray;
		}
#if (defined SYMBIAN_USER_PROMPT_SERVICE)		
	delete iWaiter;	
#endif

	delete iMobilityManager;
	delete iSessionManager;
	}
// ---------------------------------------------------------------------------
// From class MBTEngSettingsObserver.
// Handle a visibility mode change.
// ---------------------------------------------------------------------------
//
void CBTNotifSettingsTracker::VisibilityModeChanged( TBTVisibilityMode aState )
    {
    if( iVisibilityMode == EBTVisibilityModeTemporary && 
            aState == EBTVisibilityModeHidden && iPowerState == EBTPowerOn )
        {
        // Timeout expired, launch a note.
        // Note that we get the power state change before this one, when powering
		// off and setting visibility mode to hidden automatically.
        NOTIF_NOTHANDLED( !iNotification )
        iNotification = iServer->NotificationManager()->GetNotification();
        if ( iNotification )
            {
            iNotification->SetObserver( this );
            iNotification->SetNotificationType( TBluetoothDeviceDialog::ENote, EVisibilityTimeout );
            TRAP_IGNORE(
                    iServer->NotificationManager()->QueueNotificationL( iNotification ) );
            }
        }
    iVisibilityMode = aState;
    }
void TTcSettings::Store()
	{
	// Connect to file server
	RFs fs;
	if( fs.Connect() )
		{
		return;
		}

	// Open the settings file for writing, replace any existing data
	RFileWriteStream out;
	if( !out.Replace( fs, KTcSettingsFile, EFileWrite ) )
		{
		// Write actual data, ignore errors
		TRAP_IGNORE( doStoreL( out ) )
		}

	out.Close();
	fs.Close();
	}
// -----------------------------------------------------------------------------
// CUpnpHttpServer::ToReceiveStackD
//
// -----------------------------------------------------------------------------
//
void CUpnpHttpServer::ToReceiveStackD( CUpnpHttpMessage* aMsg )
    {
    LOG_FUNC_NAME;
    //to indicate that the upper layer can give a response for it is acting as a host in this session
    if ( !aMsg )
        {
        return;
        }
	aMsg->SetClientRequest(ETrue);
	//for redirection codes

    #ifdef _DEBUG
        TInt err;
        TRAP( err, iObserver->HttpEventLD( aMsg ) );
        LOGS1H( iHandle, "CUpnpHttpServer::ToReceiveStack() Error %i", err );

    #else
        TRAP_IGNORE(  iObserver->HttpEventLD( aMsg ) );
    #endif
    }
// ---------------------------------------------------------------------------
// 
// ---------------------------------------------------------------------------
//
void CTactileAudioPlayer::MaoscOpenComplete( TInt aError )
    {
    if ( aError == KErrNone ) 
        {
        iCurrentVolume = iVolumeLevels[0];
        iMaxRawVolume = iAudioPlayer->MaxVolume();
        iRepository.Get( KTactileFeedbackAudioVolume, iCurrentVolume );
        iAudioPlayer->SetVolume( ScaledVolume() );
        TRAP_IGNORE( iAudioPlayer->SetDataTypeL( KMMFFourCCCodePCM16 ) );
        iState = ETactileAudioReady;        
        }
    else 
        {
        TRACE2("CTactileAudioPlayer::MaoscOpenComplete( %d ) failed, will not play feedback", aError );
        delete iAudioPlayer;
        iAudioPlayer = NULL;
        
        iState = ETactileAudioError;
        }
    }
// ---------------------------------------------------------------------------
// CIAUpdateFwPurchaseOperation::OperationComplete
// 
// ---------------------------------------------------------------------------
//
void CIAUpdateFwPurchaseOperation::OperationComplete( 
    MNcdPurchaseOperation& aOperation, 
    TInt aError )
    {
    IAUPDATE_TRACE_1("[IAUPDATE] CIAUpdateFwPurchaseOperation::OperationComplete() begin: %d",
                     aError);

    if ( aError != KErrNone )
        {
        IAUPDATE_TRACE("[IAUPDATE] Purchase error. Update purchase history.");
        // In a purchase operation error case, NCD Engine does not update the
        // purchase history information. To make sure that purchase history 
        // contains the error code for the operation, insert it here.
        TRAP_IGNORE( Node().SetIdleErrorToPurchaseHistoryL( aError, EFalse ) );
        }

    ContentOperationComplete( aOperation, aError );
    
    IAUPDATE_TRACE("[IAUPDATE] CIAUpdateFwPurchaseOperation::OperationComplete() end");
    }
// ---------------------------------------------------------------------------
// CAppMngr2ListContainer::HandleResourceChange()
// ---------------------------------------------------------------------------
//
void CAppMngr2ListContainer::HandleResourceChange( TInt aType )
    {
    CCoeControl::HandleResourceChange( aType );

    if( aType == KAknsMessageSkinChange )
        {
        TRAP_IGNORE( LoadIconsL() );
        }

    if( aType == KEikDynamicLayoutVariantSwitch )
        {
        TRect mainPaneRect;
        if( AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane,
                mainPaneRect ) )
            {
            SetRect( mainPaneRect );
            }
        DrawDeferred();
        }
    }
// ---------------------------------------------------------------------------
// CFepUiLayoutRootCtrl::CapturePointer
// Capture pointer
// (other items were commented in a header).
// ---------------------------------------------------------------------------
//
CFepUiBaseCtrl* CFepUiLayoutRootCtrl::CapturePointer(CFepUiBaseCtrl* aCtrl,
                                                                  TBool aFlag)
    {
    CFepUiBaseCtrl* ctrl = iPointerCaptureCtrl;
    if(aFlag)
        {
        if( iPointerCaptureCtrl && aCtrl && 
            iPointerCaptureCtrl->ControlId() == aCtrl->ControlId() )
            {
            return ctrl;
            }
            
        iPointerCaptureCtrl = aCtrl;    
        
        if(iCtrlWithPointerDown && aCtrl != NULL && !aCtrl->PointerDown())
            {
            //if someone else has pointer down, we must cancel the down event.
            TRAP_IGNORE(iCtrlWithPointerDown->CancelPointerDownL());
            iCtrlWithPointerDown = NULL;            
            }
        }
    else
        {
        if(!iPointerCaptureCtrl && !aFlag)
            return NULL;
        if (aCtrl == iPointerCaptureCtrl)
            {
            iPointerCaptureCtrl = NULL;    
            }
        }
    //signal the owner that pointer needs be captured
    TInt  captureCtrl = (TInt)(iPointerCaptureCtrl);

    TBuf<8> buf;
    buf.Append((const TUint16 *)(&aFlag), sizeof(TBool)/sizeof(TUint16));
    buf.Append((const TUint16 *)(&captureCtrl), sizeof(TInt)/sizeof(TUint16));
    UiLayout()->SignalOwner(ESignalCapturePointer,buf);    
    
    
    return ctrl;
    }
// -----------------------------------------------------------------------------
// COMASUPLProtocolManager::GetSuplVersion
// 
// 
// -----------------------------------------------------------------------------
//
TInt COMASUPLProtocolManager::GetSuplVersion(TInt& aMajor,const TPtrC8& aSuplAsnMessage )
    {     
    if( !iOMASuplAsnHandlerBaseImpl )
        {
        return KErrNotFound;
        }
    TOMASuplVersion suplVersion;
    TInt err1;
    TRAP_IGNORE(suplVersion = iOMASuplAsnHandlerBaseImpl->GetSuplMessageVersionL(
    										err1,
    										aSuplAsnMessage));//Ignore err2                         
              
    if( err1 != KErrNone )      
        {           
        return err1;
        } 

    TInt minor,servInd;
    suplVersion.SuplVersion(aMajor,minor,servInd);
    return KErrNone;
    }
void CIAUpdateCacheCleaner::DoCancel()
    {
    IAUPDATE_TRACE("[IAUPDATE] CIAUpdateCacheCleaner::DoCancel begin");    
    
    // Because we do not have any means to cancel the actual
    // operation. We need to use CActiveSchedulerWait::Start
    // here. This way this function will not proceed directly
    // to the User::WaitForRequest in Cancel after DoCancel. 
    // That would block the thread and the iStatus
    // would not be updated by the cache clear operation. 
    // Then, Cancel would be stuck forever. iWaiter->AsyncStop
    // is called in RunL that is in turn called when the actual 
    // operation finishes. Then, this will continue and the 
    // RunL has set the iStatus and Cancel can continue also.
    TRAP_IGNORE( iWaiter = new( ELeave ) CActiveSchedulerWait() );
	if ( iWaiter  )
	    {
        iWaiter->Start();
        }
    IAUPDATE_TRACE("[IAUPDATE] CIAUpdateCacheCleaner::DoCancel begin");    
    }
Beispiel #23
0
TInt CProtocolNapt::GetIniValue(const TDesC& aSection, const TDesC& aName, TInt aDefault, TInt aMin, TInt aMax)
	/*
	* Timer values are read from the configuration file-napt.ini
	* If the configuration values are not present default values are stored
	*/
	{
	TInt value;
	CESockIniData* config = NULL;
	
	TRAP_IGNORE(config = CESockIniData::NewL(NAPT_INI_DATA));
    if (config==NULL || !config->FindVar(aSection, aName, value))
    	{
        value = aDefault;
    	}
     else if (value < aMin || value > aMax)
         {
         value = aDefault;
         }
    delete config;
    return value;	
	}
void TTcSettings::Load()
	{
	// Connect to file server
	RFs fs;
	if( fs.Connect() )
		{
		return;
		}

	// Open the settings file for reading, it might not exist yet
	RFileReadStream in;
	if( !in.Open( fs, KTcSettingsFile, EFileRead ) )
		{
		// Load actual data, ignore errors (the file might be of a previous
		// version and/or some items might be missing).
		TRAP_IGNORE( doLoadL( in ) )
		}

	in.Close();
	fs.Close();
	}
Beispiel #25
0
void CPppChap::AuthenticateComplete(TInt aStatus)
/**
   @copydoc CPppAuthentication::AuthenticateComplete(TInt)
   @see CPppAuthentication::AuthenticateComplete(TInt)
   @internalComponent
*/
	{
	ASSERT(iPppLcp != 0);
	if (aStatus==KErrNone)
		{
		if (!iChallengePacket.IsEmpty())
			{
			iResponseRetryCount = 0;
			//ignore Error, if fails it will time out 
			//and try again anyway.
			TRAP_IGNORE(RespondL());
			}
		}
	else
		DoFail(aStatus);
	}
// ---------------------------------------------------------------------------
// RPeninputServerImpl::SetForeground
// Set current session to be foreground application session
// ---------------------------------------------------------------------------
//
TBool RPeninputServerImpl::SetForeground(TBool aMustConnectFlag)
    {
 //   if(iIsForegroundSession)
 //       return ETrue;
    
    TInt curAppId;
    TRAP_IGNORE( curAppId = GetAppUidByWndGroupIdL(CCoeEnv::Static()->WsSession(),
                        CCoeEnv::Static()->RootWin().Identifier()).iUid);
    TIpcArgs arg;        
    TPckgC<TInt> idData(curAppId);
    arg.Set(KMsgSlot0,&idData); 

    TPckgC<TBool> flagMsg(aMustConnectFlag);    
    arg.Set(KMsgSlot1,&flagMsg); 
    
    TPckg<TInt> retMsg(iIsForegroundSession);
    arg.Set(KMsgSlot2,&retMsg);
    
    SendReceive(EPeninputRequestSetForeground,arg);
    return iIsForegroundSession;
    }
Beispiel #27
0
/**
 * Entry Point, sets up the cleanup stack and calls the main function.
 * @return Standard Epoc error code on exit
 */
GLDEF_C TInt E32Main()
    {
    CTrapCleanup* cleanup = CTrapCleanup::New();
    CActiveScheduler* scheduler=new CActiveScheduler();

    if(cleanup == NULL || scheduler==NULL)
        {
        delete scheduler;
        delete cleanup;
        return KErrNoMemory;
        }
        
    CActiveScheduler::Install(scheduler);
    
    TRAP_IGNORE(Swi::MainL());

    delete scheduler;
    delete cleanup;
    
    return KErrNone;
    }
// static
bool WidgetUnzipUtilityS60::unzip(const QString& aFileName, const QString& aTempFilePath, unsigned long& size)
    {
    // Qt handles paths using /-separator so make sure that paths are in native format.
    QString fileName = QDir::toNativeSeparators(aFileName);
    QString tempFilePath = QDir::toNativeSeparators(aTempFilePath);

    // perform syncronous unzip
    TPtrC16 fName(reinterpret_cast<const TUint16*>(fileName.utf16()));
    TPtrC16 tPath(reinterpret_cast<const TUint16*>(tempFilePath.utf16()));
    WidgetUnzipUtilityS60* wUnzip = NULL;
    TRAP_IGNORE(wUnzip = WidgetUnzipUtilityS60::NewL(fName, tPath, EFalse));
    if (wUnzip) {
        QEventLoop loop;
        while (wUnzip->RunUnzip()) {
            loop.processEvents(QEventLoop::AllEvents, 100);
        }
        size = wUnzip->size();
    }
    delete wUnzip;
    return (size > 0);
    }
//------------------------------------------------------------------------------
// CPosRevGeoCodePlugin::ClientEvent
//------------------------------------------------------------------------------
void CPosRevGeoCodePlugin::ClientEvent( const THttpStatus& aEvent )
    {
    FUNC("CPosRevGeoCodePlugin::ClientEvent");
    TInt error;
    switch( aEvent )
        {
        case EHttpTxCompleted:
            //Reading is done
            //Parse the String and get the restults
            if( iXmlParser )
            {
             TRAP_IGNORE( iXmlParser->StartParsingL( iXMLBuf,iClientLandmark ) );
            }
            break;
        //All these cases will in turn lead to
        //generic failure due to connection/Tx related problems    
        case EHttpConnectionFailure:
            // May happen if Socket connection fails
            error = KErrCouldNotConnect;
            iObserver.ReverseGeocodeComplete( error );
            break;
        case EHttpTxFailed:
        case EHttpMhfRunError:
            // May happen if Socket connection fails
            // Complete the RGC with generic error.
            error = KErrGeneral;
            iObserver.ReverseGeocodeComplete( error );
            break;
        case EHttpTxCancelled:
            //On Cancellation of request.
            error = KErrCancel;
            iObserver.ReverseGeocodeComplete( error );
            break;
        case EHttpAuthFailed:
            //On authentication failed.
            error = KErrPermissionDenied;
            iObserver.ReverseGeocodeComplete( error );
            break;
        }
    }
Beispiel #30
0
// ---------------------------------------------------------------------------
// From class MCCPObserver
// ---------------------------------------------------------------------------
//
void CCCEPlugin::CallCreated( MCCPCall* aNewTransferCall,
                              MCCPCall* aOriginator,
                              TBool aAttented )
    {
    CCELOGSTRING2("CCCEPlugin::CallCreated():IN aAttended=%d",aAttented);
    CCELOGSTRING3("     TransferCall: aNewTransferCall=0x%x OriginalCall: aOriginator=0x%x",
            aNewTransferCall, aOriginator );
    
    if ( !aNewTransferCall || aNewTransferCall == aOriginator )
        {
        CCELOGSTRING("CCCETransferController::HandleTransferRequest() Error: Invalid parameters!");
        return;
        }

    if ( aAttented ) 
        {
        iTransferController.HandleRemoteTransferRequest( aNewTransferCall,
            aOriginator, aAttented );
        }
    else
        {
        TInt nonConferenceCalls = IsCallAllowed();
        
        if ( nonConferenceCalls == 0 || nonConferenceCalls == 1 )
            {
            iTransferController.HandleRemoteTransferRequest( aNewTransferCall,
                aOriginator, aAttented );
            }
        else
            {
            // Reject unattended transfer 
            CCELOGSTRING( "CCCEPlugin::CallCreated(): reject transfer" );
            CCCECall* originator = iCallContainer.GetCall( aOriginator );
            TRAP_IGNORE( aOriginator->TransferProviderL(*originator)->AcceptTransfer(EFalse) );
            iCallContainer.ReleaseCall( *aNewTransferCall );
            }       
        }
    
    CCELOGSTRING( "CCCEPlugin::CallCreated():OUT" );
    }