/** Starts two concurrent client sessions in different directories */ LOCAL_C void DoTest2(TThreadFunction aFunction) { gKillMe = EFalse; TBuf<20> buf = _L("Speedy"); buf.AppendNum(ThreadCount++); gT1 = ThreadCount; TInt r = gSpeedy.Create(buf, aFunction, KDefaultStackSize, KHeapSize, KHeapSize, NULL); FailIfError(r); buf = _L("Speedy"); buf.AppendNum(ThreadCount++); gT2 = ThreadCount; r = gSpeedyII.Create(buf, DeleteEntryAccess2, KDefaultStackSize, KHeapSize, KHeapSize, NULL); FailIfError(r); gSpeedy.SetPriority(EPriorityLess); gSpeedyII.SetPriority(EPriorityLess); gSpeedy.Resume(); gSpeedyII.Resume(); client.Wait(); client.Wait(); }
// ----------------------------------------------------------------------------- // COMASuplFallBackHandler::PrintSLPList() // ----------------------------------------------------------------------------- // void COMASuplFallBackHandler::PrintSLPList() { //This function can be put under debug flag... TBuf<256> hslpAddress; TBuf<100> accessPoint; TInt64 slpid; TBool Psk,Tls,HomeUsage; TBuf<256> buffer; TInt cnt = iSLPList->Count(); buffer.Copy(_L("Number of Entries : ")); buffer.AppendNum(cnt); iTrace->Trace(buffer,KTraceFileName, __LINE__); for(TInt Counter = 0; Counter < cnt; Counter++) { slpid = (*iSLPList)[Counter].iSLPId; hslpAddress.Copy((*iSLPList)[Counter].iHSLPAddress); accessPoint.Copy((*iSLPList)[Counter].iIapName); Tls = (*iSLPList)[Counter].iTls; Psk = (*iSLPList)[Counter].iPskTls; HomeUsage = (*iSLPList)[Counter].iHomeNetworkUsage; buffer.Copy(_L("===================================")); iTrace->Trace(buffer,KTraceFileName, __LINE__); buffer.Copy(_L("SLP id : ")); buffer.AppendNum(slpid); iTrace->Trace(buffer,KTraceFileName, __LINE__); buffer.Copy(_L("Server Name: ")); buffer.Append(hslpAddress); iTrace->Trace(buffer,KTraceFileName, __LINE__); buffer.Copy(_L("Access Point: ")); buffer.Append(accessPoint); iTrace->Trace(buffer,KTraceFileName, __LINE__); buffer.Copy(_L("TLS : ")); buffer.AppendNum(Tls); iTrace->Trace(buffer,KTraceFileName, __LINE__); buffer.Copy(_L("PSK TLS : ")); buffer.AppendNum(Psk); iTrace->Trace(buffer,KTraceFileName, __LINE__); buffer.Copy(_L("Home Usage : ")); buffer.AppendNum(HomeUsage); iTrace->Trace(buffer,KTraceFileName, __LINE__); } if(cnt > 0) { buffer.Copy(_L("===================================")); iTrace->Trace(buffer,KTraceFileName, __LINE__); } }
void WRITE_VALUES(const void* lhs, const void* rhs) { TBuf<20> b; b.AppendNum((TInt)lhs); output->Write(b); output->Write(_L(" ")); b.Zero(); b.AppendNum((TInt)rhs); output->Write(b); }
void WRITE_VALUES<int>(const int& lhs, const int& rhs) { TBuf<15> b; b.AppendNum(lhs); output->Write(b); output->Write(_L(" ")); b.Zero(); b.AppendNum(rhs); output->Write(b); }
HBufC* GetPlatformVersionL() { VersionInfo::TPlatformVersion platformVersion; User::LeaveIfError(VersionInfo::GetVersion(platformVersion)); TBuf<KBufferSize> version; version.AppendNum(platformVersion.iMajorVersion); version.Append('.'); version.AppendNum(platformVersion.iMinorVersion); return version.AllocL(); }
// ----------------------------------------------------------------------------- // CTestPosLandmarkDatabase::RemoveLandmarks // // // ----------------------------------------------------------------------------- // TInt CTestPosLandmarkDatabase::RemoveLandmarksL( CStifItemParser& /*aItem*/ ) { // Open Database CPosLandmarkDatabase* lmkDatabase = CPosLandmarkDatabase::OpenL( KDBUri ); CleanupStack::PushL( lmkDatabase ); // Initialize database ExecuteAndDeleteLD( lmkDatabase->InitializeL() ); // Add 3 test landmarks, which will be removed by RemoveLandmarksL() TPosLmItemId id; RArray<TPosLmItemId> idArray; CPosLandmark* landmark = CPosLandmark::NewL(); CleanupStack::PushL( landmark ); _LIT( KName, "A Test Landmark " ); TBuf<25> nameBuffer; for(TInt i=1;i<4;i++) { nameBuffer.Copy( KName ); nameBuffer.AppendNum( i ); landmark->SetLandmarkNameL( nameBuffer ); id = lmkDatabase->AddLandmarkL( *landmark ); idArray.AppendL( id ); } // Create iterator and get number of landmarks CPosLmItemIterator* iterator = lmkDatabase->LandmarkIteratorL(); CleanupStack::PushL( iterator ); TInt totalLmkBeforeRemove = iterator->NumOfItemsL(); nameBuffer.Copy( KName ); nameBuffer.AppendNum( totalLmkBeforeRemove ); iLog->Log(nameBuffer); CleanupStack::PopAndDestroy( iterator ); // Remove landmarks (3 landmarks) ExecuteAndDeleteLD( lmkDatabase->RemoveLandmarksL( idArray ) ); // Get number of landmarks after remove iterator = lmkDatabase->LandmarkIteratorL(); CleanupStack::PushL( iterator ); TInt totalLmkAfterRemove = iterator->NumOfItemsL(); nameBuffer.Copy( KName ); nameBuffer.AppendNum( totalLmkAfterRemove ); iLog->Log(nameBuffer); // Check if( totalLmkAfterRemove != (totalLmkBeforeRemove - 3) ) { iLog->Log(_L("RemoveLandmarks fails")); User::Leave( KErrGeneral ); } iLog->Log(_L("RemoveLandmarks succeeds")); CleanupStack::PopAndDestroy( 3, lmkDatabase ); ReleaseLandmarkResources(); return KErrNone; }
// ----------------------------------------------------------------------------- // CTestPosLandmarkDatabase::AddLandmarksToTestDb // // // ----------------------------------------------------------------------------- // TInt CTestPosLandmarkDatabase::AddLandmarksToTestDbL( CPosLandmarkDatabase* aDatabase ) { _LIT( KLmkName, "A Test Landmark " ); // Create a landmark, has to be trapped CPosLandmark* landmark = NULL; TRAPD( error, landmark = CPosLandmark::NewL() ); if( KErrNone != error ) { return error; } CleanupStack::PushL( landmark ); // Add 5 landmarks to DB TBuf<20> nameBuffer; for(TInt i = 1; i < 6; i++ ) { // Set name nameBuffer.Copy( KLmkName ); nameBuffer.AppendNum( i ); TRAP( error, landmark->SetLandmarkNameL( nameBuffer ) ); if( KErrNone != error ) { CleanupStack::PopAndDestroy( landmark ); return error; } // Add TRAP( error, aDatabase->AddLandmarkL( *landmark ) ); if( KErrNone != error ) { CleanupStack::PopAndDestroy( landmark ); return error; } }// Add loop CleanupStack::PopAndDestroy( landmark ); return KErrNone; }
// Note: Symbian XML framework error codes are listed in XmlFrameworkErrors.h void CSenXmlReader::OnError(TInt aErrorCode) { #ifdef _SENDEBUG // Symbian XML framework signals about some error: SENDEBUG_L("CSenXmlReader::OnError"); SENDEBUG_L(" -Symbian XML framework signalled an error: "); TBuf<32> buf; buf.AppendNum(aErrorCode); SENDEBUG((buf)); #endif if(!iContentHandler) { SENDEBUG_L("OnError: KErrSenXmlContentHandlerNotSet"); // Cannot report any signalled error to content handler, // since it has not been set. Force ParseL to leave by // setting spesific error code (KErrSenXmlContentHandlerNotSet) iEnabledFeature = KErrSenXmlContentHandlerNotSet; return; } TInt retVal(iContentHandler->Error(aErrorCode)); #ifdef _SENDEBUG // Symbian XML framework signals about some error: SENDEBUG_L(" -Error() callback to content handler returned an error:"); TBuf<32> buf2; buf2.AppendNum(retVal); SENDEBUG((buf2)); #endif retVal = 0; // not used in release builds // In 3.0, iEnabledFeature member was used to indicate ParseL // that it should leave(!). iEnabledFeature = aErrorCode; }
// ----------------------------------------------------------------------------- // CCapInfo::MemoryInfoL(TMemoryInfo& aInfo) // Create memory info for all drives (RAM excluded). // ----------------------------------------------------------------------------- // void CCapInfo::WriteMemoryInfoL(TMemoryInfo& aInfo) { TRACE_FUNC_ENTRY; TBuf<KBufSize> buf; WriteTagL(EMemory, TXmlParser::EElementBegin); if( aInfo.iDriveStatus & DriveInfo::EDriveInternal ) { buf = KMediaFlash; } else { buf = KMediaMMC; // memory card (MMC) } if( aInfo.iMemNr > 1 ) { // append memory number DEV2, MMC2.. buf.AppendNum( aInfo.iMemNr ); } WriteValueL(EMemType, buf); WriteValueL(ELocation, aInfo.iLocation); WriteValueL(EFree, aInfo.iFree); WriteValueL(EUsed, aInfo.iUsed); WriteValueL(EFileNLen, aInfo.iFileNameSize); WriteTagL(EMemory, TXmlParser::EElementEnd); TRACE_FUNC_EXIT; }
// --------------------------------------------------------------------------- // CheckForBootCompletion // Check boot is completed... if its then do initilization of settings // --------------------------------------------------------------------------- // void COMASuplIMSIObserver::CheckForBootCompletionL() { User::LeaveIfError( iStartupObserver.Attach( KPSUidStartup, KPSGlobalSystemState, EOwnerThread ) ); TInt bootCompleteStatus = 0; User::LeaveIfError( iStartupObserver.Get( bootCompleteStatus ) ); TBuf<64> buff; buff.Copy(_L("CheckForBootCompletionL : ")); buff.AppendNum(bootCompleteStatus); Trace(buff, KImsiObserver, __LINE__ ); if(! ((bootCompleteStatus == ESwStateNormalRfOn ) || (bootCompleteStatus == ESwStateNormalRfOff ) || (bootCompleteStatus == ESwStateNormalBTSap ) ) ) { iStartupObserver.Subscribe( iStatus ); iState = COMASuplSmsListenerBase::ESubscriptionActive; SetActive(); } else { InitializeSettings(); } }
void CPackagerAppUi::RunTestStepL(TInt aNumStep) { TKeyEvent theKeyEvent; Mem::FillZ(&theKeyEvent, sizeof(TKeyEvent)); TBuf<128> buf; //only for debug #ifdef FORCE_AUTO User::After(TTimeIntervalMicroSeconds32(1000000)); #endif switch(aNumStep) { case 1: { RDebug::Print(_L("\nGet the language")); buf.Copy(_L("\nGet the language")); SetFromString(buf, ((TText8*)__FILE__), __LINE__); TLanguage appLang = ApplicationLanguageL(); buf.Copy(_L("\nLanguage is ")); buf.AppendNum(appLang); SetFromString(buf, ((TText8*)__FILE__), __LINE__); if(appLang != ELangFrench) { buf.Format(_L("\nLanguage is %d but should be enum for ELangFrench"), appLang); SetErrorFromString(buf, ((TText8*)__FILE__), __LINE__, 1); AutoTestManager().FinishAllTestCases(CAutoTestManager::EFailed); } else { AutoTestManager().FinishAllTestCases(CAutoTestManager::EPass); } break; } } }
void CSyncEngineWrap::ConstructL() { //create suspended thread _LIT(KThreadName, "SyncThreadEntryPoint"); TBuf<30> threadName; threadName.Append(KThreadName); TTime time; time.HomeTime(); TInt64 aSeed = time.Int64(); TInt randNum = Math::Rand(aSeed) % 1000; threadName.AppendNum(randNum); //KMinHeapSize, 256*KMinHeapSize //TInt res = thread.Create(threadName, SyncThreadEntryPoint, 20000, 0x100000, 0x3D4000, this); TInt res = thread.Create(threadName, SyncThreadEntryPoint, 20000, 0x5000, 0x600000, this); if (res != KErrNone) Panic(ERhodesSyncEngineInit); thread.SetPriority(EPriorityNormal); }
// ========================================================================== // FUNCTION: GotoL // ========================================================================== void CMsgStoreSortResultRowSet::GotoL( TContainerId aMessageId ) { //check if the aMessageId is right on the cursor TBool found = EFalse; if ( iDbView.AtRow() ) { iDbView.GetL(); if ( iDbView.ColUint32( iMessageIdColNum ) == aMessageId ) { found = ETrue; } } if ( !found ) { //have to search it from the begining TBuf<KQuerrySize> query; query.Copy( KSortingTableMessageIdCol ); query.Append( KEqual ); query.AppendNum( aMessageId ); iDbView.FirstL(); TInt rc = iDbView.FindL( RDbRowSet::EForwards, query ); if ( rc < 0 ) { User::Leave( rc ); } } }
void CAiPlayerPluginEngine::ConstructL(TPlayerType playerType) { //MPX_DEBUG1("CAiPlayerPluginEngine::ConstructL"); // Get the playback utility instance from engine. //iPlaybackUtility = MMPXPlaybackUtility::NewL( KPbModeActivePlayer, this ); if (playerType==EVideoPlayer){ iPlaybackUtility = MMPXPlaybackUtility::NewL( EMPXCategoryVideo, KPbModeActivePlayer,this); } else if (playerType==EMusicPlayer){ iPlaybackUtility = MMPXPlaybackUtility::NewL( KMusicPlayerAppUid, this); } else{ qDebug()<<"You should pass EMusicPlayer or EVideoPlayer as second parameter"; Q_ASSERT(0); } //iAlbumArtUtil = CMPXAlbumArtUtil::NewL(); if (iPlaybackUtility->StateL() == EPbStatePlaying) { TRAPD(err,RequestMediaL()); if (err) { TBuf<255> txt; txt.Copy(_L("Req Media: ")); txt.AppendNum(err); User::InfoPrint(txt); } } }
TInt CMainControlEngine::SaveNetTrafficInfo() { TBuf<100> nContent; nContent.Zero (); nContent.Append (iCurrentMonth); nContent.Append (_L("*#")); nContent.AppendNum(iMonthTraffic_Rev); nContent.Append (_L("*#")); nContent.AppendNum(iMonthTraffic_Send); return iDBEngine->SetSystemParmWithSQL(KTRAFFICINFO,nContent); }
TInt CTimesliceTestThread::Construct(TUint32 aId, TInt aCpu, TInt aSlice, CircBuf* aBuf) { iId = aId; iCpu = aCpu; iSlice = aSlice; iBuf = aBuf; TInt r = HAL::Get(HAL::EFastCounterFrequency, (TInt&)iFreq); if (r!=KErrNone) return r; iThresh = iFreq / 3000; if (iThresh < 10) iThresh = 10; iThresh2 = iFreq; TBuf<16> name = _L("TSThrd"); name.AppendNum(iId); r = iThread.Create(name, &ThreadFunc, 0x1000, NULL, this); if (r!=KErrNone) return r; iThread.Logon(iExitStatus); if (iExitStatus != KRequestPending) { iThread.Kill(0); iThread.Close(); iThread.SetHandle(0); return iExitStatus.Int(); } return KErrNone; }
////////////////////////////////////////////////////////////////////////// //From MHandleEventObserver ////////////////////////////////////////////////////////////////////////// void CSearchLocalResultView::HandleResponseEvent(TInt aEvent,TInt aType) { if(aEvent==EHttpNoError) { this->iSearchList->SetEdwinVisible(ETrue); iSearchList->InitListBox(); RemoveAndDeleteControl(iDialog); if(iLocalSearch->GetCount()==0) { this->InitDialog(iMainEngine.GetDesById(ETurkeyTextRes_ListNull)); } else { iSearchList->SetEdwinVisible(EFalse); for(TInt i=0;i<iLocalSearch->GetCount();i++) { const CFbsBitmap* icon = NULL; const CFbsBitmap* iconMask = NULL; icon = iMainEngine.GetBitmapFactory().GetFileTypeIcon(GetCurType()); iconMask = iMainEngine.GetBitmapFactory().GetFileTypeIconMask(GetCurType()); iSearchList->AppendListItem(iLocalSearch->GetOneItemName(i),icon,iconMask); } TBuf<50> titleBuf; titleBuf.Zero(); titleBuf.Append(*iTitle); titleBuf.Append(_L("[")); titleBuf.AppendNum(iLocalSearch->GetCount()); titleBuf.Append(_L("]")); iTitleBar->SetTextL(titleBuf); iSearchList->ListBoxDraw(); } } }
void WRITE_VALUES<TTupleName>(const TTupleName& lhs, const TTupleName& rhs) { TBuf<200> b; b.AppendNum((TInt)lhs.iModule.iUid); b.Append(_L(" ")); b.AppendNum(lhs.iId); b.Append(_L(" ")); output->Write(b); output->Write(_L(" ")); b.Zero(); b.AppendNum((TInt)rhs.iModule.iUid); b.Append(_L(" ")); b.AppendNum(rhs.iId); b.Append(_L(" ")); output->Write(b); }
void CNcdRequestBase::SetRequestIdL(TInt aId) { TBuf<32> buf; buf.AppendNum(aId); TXmlEngString id; id.SetL(buf); iId = id; }
void CSliderForDialog::HandlePointerEventL(const TPointerEvent& aEvent) { TInt offset=0; _LOG(_L("PointerEvent")); if (aEvent.iType==aEvent.EButton1Down) { _LOG(_L("PointerEventDown")); iPenDownPos=aEvent.iPosition; } else if (aEvent.iType==aEvent.EDrag) { _LOG(_L("PointerEventMove")); iDragged=ETrue; } else if (aEvent.iType==aEvent.EButton1Up) { _LOG(_L("PointerEventUp")); } TReal percent=(TReal)aEvent.iPosition.iX/((TReal)(Size().iWidth-40)); TReal r_new_val=percent*(iMaxVal-iMinVal); TReal rval; Math::Round(rval,r_new_val,0); TInt i_new_val=(TInt)rval; offset=i_new_val-iValue; TBuf<255> a; TRealFormat rf; a.Num(percent,rf); a.Append(_L(", ")); a.AppendNum(r_new_val,rf); a.Append(_L(", ")); a.AppendNum(offset); _LOGDATA(_L("percent,r_newval,offset %S"),&a); if (iDragged) { iValue+=offset; if(iValue>iMaxVal){iValue =iMaxVal;} if(iValue<iMinVal){iValue = iMinVal;} DrawNow(); iPenDownPos=aEvent.iPosition; } iDragged=EFalse; CCoeControl::HandlePointerEventL(aEvent); }
// --------------------------------------------------------------------------- // Sets value of property. // --------------------------------------------------------------------------- // EXPORT_C TInt CCenRepDatabaseProperty::SetValue( TInt aValue ) { TBuf<KMaxIntLen> val; val.AppendNum( aValue ); iPropertyValue.Close(); TInt ret = iPropertyValue.Create( val ); return ret; }
// ----------------------------------------------------------------------------- // CNSPTestConsoleApp::GetTUint32FromConsole // ----------------------------------------------------------------------------- // TKeyCode CNSPTestConsoleApp::GetTUint32FromConsoleL( TUint32& aTUint32 ) { TBuf<255> buffer; buffer.AppendNum( aTUint32, EDecimal ); TKeyCode input = GetStringFromConsoleL( buffer ); TLex lex( buffer ); User::LeaveIfError( lex.Val( aTUint32, EDecimal ) ); return input; }
// ----------------------------------------------------------------------------- // CCapInfo::WriteSyncSolutionsServiceL() // Writes SyncSolutionsService data to capability object. // ----------------------------------------------------------------------------- // void CCapInfo::WriteSyncSolutionsServiceL( const TSConSolutionInfo& aCalendar, const TSConSolutionInfo& aContact, const TSConSolutionInfo& aSms, const TSConSolutionInfo& aBookmark) { TRACE_FUNC_ENTRY; WriteTagL( EService, TXmlParser::EElementBegin ); WriteValueL( EName, KSyncSolutionsServiceName ); WriteValueL( EVersion, KSyncSolutionsServiceVersion ); if ( aCalendar.iUid != 0 ) { WriteSolutionTagL( KSyncCalendar, aCalendar ); } if ( aContact.iUid != 0 ) { WriteSolutionTagL( KSyncContacts, aContact ); } if ( aSms.iUid != 0 ) { WriteSolutionTagL( KSyncSms, aSms ); } if ( aBookmark.iUid != 0 ) { WriteSolutionTagL( KSyncBookmark, aBookmark ); } /* * <Ext> * <XNam>DesktopSync</XNam> * <XVal></XVal> * </Ext> * */ if ( !iSconInfo->iDesktopSyncError ) { WriteTagL( EExt, TXmlParser::EElementBegin ); WriteValueL( EXNam, KDesktopSync ); TBuf<KBufSize> buffer; buffer.AppendNum( iSconInfo->iDesktopSync ); WriteValueL( EXVal, buffer ); WriteTagL( EExt, TXmlParser::EElementEnd ); } WriteTagL( EService, TXmlParser::EElementEnd ); TRACE_FUNC_EXIT; }
// ----------------------------------------------------------------------------- // CLandmarksEditDialog::ConfigureFieldsL // // (other items were commented in a header). // ----------------------------------------------------------------------------- // void CLandmarksEditDialog::ConfigureFieldsL() { TPtrC textFieldValue; // Configure landmark name textFieldValue.Set(KNullDesC); iLandmark->GetLandmarkName(textFieldValue); ConfigureTextFieldL(ELandmarkNameField, textFieldValue); // Configure description textFieldValue.Set(KNullDesC); iLandmark->GetLandmarkDescription(textFieldValue); ConfigureTextFieldL(ELandmarkDescField, textFieldValue); // Configure street; textFieldValue.Set(KNullDesC); iLandmark->GetPositionField(EPositionFieldStreet, textFieldValue); ConfigureTextFieldL(ELandmarkStreetField, textFieldValue); // Configure postalCode; textFieldValue.Set(KNullDesC); iLandmark->GetPositionField(EPositionFieldPostalCode, textFieldValue); ConfigureTextFieldL(ELandmarkPostalField, textFieldValue); // Configure city; textFieldValue.Set(KNullDesC); iLandmark->GetPositionField(EPositionFieldCity, textFieldValue); ConfigureTextFieldL(ELandmarkCityField, textFieldValue); // Configure country textFieldValue.Set(KNullDesC); iLandmark->GetPositionField(EPositionFieldCountry, textFieldValue); ConfigureTextFieldL(ELandmarkCountryField, textFieldValue); // Configure location fields TLocality location; iLandmark->GetPosition(location); ConfigureLocationFieldsL(location); // Configure coverage Radius TReal32 coverageRadius; TBuf<KPosLmMaxTextFieldLength> radiusBuf; TInt res = iLandmark->GetCoverageRadius(coverageRadius); if (res != KErrNotFound) { radiusBuf.AppendNum(coverageRadius, iRealFormat); } ConfigureTextFieldL(ELandmarkRadiusField, radiusBuf); }
TInt CMainControlEngine::SetIapNum(TInt aIapNum) { //联网方式只有下次启动才发生作用 TBuf<10> nInfo; nInfo.Zero(); nInfo.AppendNum(aIapNum); return iDBEngine->SetSystemParmWithSQL(KIAPNUM,nInfo); }
TBool CMonitorControl::OfferEventL(const THuiEvent& aEvent) { TBool handled = EFalse; if (aEvent.IsCustomEvent() && aEvent.iParam == EUpdateFrameRate ) { UpdateFrameRateTextL( CHuiStatic::FrameRate() ); THuiCustomEventCommand command( EUpdateFrameRate, static_cast<MHuiEventHandler*>(this) ); Env().Send( command, iServerSession.iFpsUpdatePeriod ); handled = ETrue; } else if ( aEvent.IsCustomEvent() && aEvent.iParam == EUpdateServerHeap ) { CHuiTextVisual* textVisual = static_cast<CHuiTextVisual*>(FindTag( KHeapTag ) ); User::Heap().Compress(); TInt totalSize = 0; TInt usedSize = User::AllocSize( totalSize ); TBuf<32> buffer; buffer.AppendNum( usedSize ); buffer.Append( _L(" cells\n") ); buffer.AppendNum( totalSize ); buffer.Append( _L("B") ); textVisual->SetTextL( buffer ); THuiCustomEventCommand command( EUpdateServerHeap, static_cast<MHuiEventHandler*>(this) ); Env().Send( command, iServerSession.iServerHeapUpdatePeriod ); // make sure we are on top if ( Env().DisplayCount() ) { CHuiDisplay& display = Env().PrimaryDisplay(); display.Roster().ShowL( *ControlGroup() ); } handled = ETrue; } return handled; }
TInt CContainerButton::Tick(TAny* aObj) { TBuf<255> txt; TRawEvent lEvent; lEvent.Set(TRawEvent::EKeyRepeat, 180); TInt err=UserSvr::AddEvent(lEvent); txt.Copy(_L("Repeat ")); txt.AppendNum(err); CEikonEnv::Static()->InfoMsg(txt); }
TInt CMainControlEngine::SetLoginType(TInt aLoginType) { //登录方式只有在下次登录时才发生作用 TBuf<10> nInfo; nInfo.Zero(); nInfo.AppendNum(aLoginType); return iDBEngine->SetSystemParmWithSQL(KLOGINTYPE,nInfo); }
//-------------------------------------------------------------------------------- //This passes the files to server //-------------------------------------------------------------------------------- TInt RFileDesTransferSession::TransferFilesToServer() { TBuf<256> fname; const CFileTable& ftable = Backend()->FileTable(); CFileDescBase* fdesc = NULL; int count = ftable.GetFileCount(); TInt j; for (int i = count-1; i >=3; --i) { if (ftable.At(i, fdesc) == KErrNone) { j=fdesc->Type(); if((j==CFileDescBase::EFileDesc)||(j==CFileDescBase::EFileTempDesc)) { CFileDesc* fp = (CFileDesc*)(fdesc); if (fp) { TUint attr = fp->Attributes(); if (!(attr & KCloseonExec) && !(attr & KSpawnCloseInChild)) { fp->FileHandle().FullName(fname); TParsePtr pars(fname); if (pars.Path().FindC(_L("\\PRIVATE\\")) != 0) { (Backend()->iFs).ShareProtected(); fp->DoSync(); #if defined(SYMBIAN_OE_LARGE_FILE_SUPPORT) && !defined(SYMBIAN_OE_NO_LFS) //The integer width is bigger for 64 bit sizes TBuf<140> params; #else TBuf<60> params; #endif /* SYMBIAN_OE_LARGE_FILE_SUPPORT && !SYMBIAN_OE_NO_LFS */ params.AppendNum(fp->Offset()); params.Append(' '); params.AppendNum(fp->Extent()); params.Append(' '); params.AppendNum(fp->FcntlFlag()); params.Append(' '); params.AppendNum(fp->Attributes()); params.Append(' '); params.AppendNum(fp->Pos()); params.Append(' '); params.AppendNum(fp->Ext()); params.Append(' '); params.AppendNum(fp->Size()); TIpcArgs args(i,¶ms); if((fp->FileHandle()).TransferToServer(args, 2,3) == KErrNone) SendReceive(ETransferFile, args); (Backend()->iFs).ShareAuto(); } } } } } } //for return KErrNone; }
void RTestProcess::Create(TTestProcessFunctions aFunction,TInt aArg1,TInt aArg2) { if(aArg1==-1) aArg1 = RProcess().Id(); TBuf<512> commandLine; commandLine.Num((TInt)aFunction); commandLine.Append(_L(" ")); commandLine.AppendNum(aArg1); commandLine.Append(_L(" ")); commandLine.AppendNum(aArg2); #ifdef __FIXED__ //fixed process creating a moving process TFileName filename(RProcess().FileName()); TInt pos=filename.LocateReverse(TChar('\\')); filename.SetLength(pos+1); filename+=_L("T_SHAREDIO.EXE"); TInt r = RProcess::Create(filename,commandLine); #else #ifdef __SECOND_FIXED__ //fixed process creating another fixed process TFileName filename(RProcess().FileName()); TInt pos=filename.LocateReverse(TChar('\\')); filename.SetLength(pos+1); filename+=_L("T_SHAREDIO2.EXE"); TInt r = RProcess::Create(filename,commandLine); #else #ifdef __MOVING_FIXED__ //moving process creating a fixed process TFileName filename(RProcess().FileName()); TInt pos=filename.LocateReverse(TChar('\\')); filename.SetLength(pos+1); filename+=_L("T_SHAREDIO2.EXE"); TInt r = RProcess::Create(filename,commandLine); #else //moving process creating a moving process TInt r = RProcess::Create(RProcess().FileName(),commandLine); #endif #endif #endif test(r==KErrNone); SetJustInTime(EFalse); }