TBool CRefTestAgentManager::IsRecognizedL(RFile& aFile) const
	{
	TBool result = EFalse;
	
	// Get the name of the file
	TFileName fileName;
	aFile.Name(fileName);

	// Check that the file has content only, otherwise it should
	// be put through the supplier API before it can be used
	TPtrC extension(fileName.Right(KRtaExtensionContent().Length()));
	if(extension.CompareF(KRtaExtensionContent) == 0)
		{
		result = ETrue;
		}
	return result;
	}
Пример #2
0
/*
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
*/
TInt CExPolicy_Server::UpdateStatusL(TBool& aValue, TBool aProtect)
{	
	TInt ErrRet(KErrNone);
	
	TRAP(ErrRet,
	DeleteStatusInfoL();

	if(aProtect)
	{
		iProtectStatus = aValue;
	}
	else
	{
		iScreenStatus = aValue;
	}

	TFileName QueryBuffer;
	QueryBuffer.Copy(_L("SELECT * FROM "));
	QueryBuffer.Append(KtxtStatuslist);
	
	iItemsDatabase.Begin();
	
	RDbView Myview;
	Myview.Prepare(iItemsDatabase,TDbQuery(QueryBuffer));
	CleanupClosePushL(Myview);
	
	Myview.EvaluateAll();
	Myview.FirstL();
	
	Myview.InsertL(); 
		
	if(iProtectStatus)
		Myview.SetColL(2,0x100);
	else
		Myview.SetColL(2,0x000);
	
	if(iScreenStatus)
		Myview.SetColL(3,0x100);
	else
		Myview.SetColL(3,0x000);

	Myview.PutL(); 
			
	CleanupStack::PopAndDestroy(1); // Myview
	iItemsDatabase.Commit();
	);
Пример #3
0
// -----------------------------------------------------------------------------
// CDRM_CAF::ConstructL
// Symbian 2nd phase constructor can leave.
// -----------------------------------------------------------------------------
//
void CDRM_CAF::ConstructL()
    {
    //Read logger settings to check whether test case name is to be
    //appended to log file name.
    User::LeaveIfError( iFs.Connect() );
   // CleanupClosePushL( iFs );

    CreateDirL();
    RSettingServer settingServer;
    TInt ret = settingServer.Connect();
    if(ret != KErrNone)
        {
        User::Leave(ret);
        }
    // Struct to StifLogger settigs.
    TLoggerSettings loggerSettings;
    // Parse StifLogger defaults from STIF initialization file.
    ret = settingServer.GetLoggerSettings(loggerSettings);
    if(ret != KErrNone)
        {
        User::Leave(ret);
        }
    // Close Setting server session
    settingServer.Close();

    TFileName logFileName;

    if(loggerSettings.iAddTestCaseTitle)
        {
        TName title;
        TestModuleIf().GetTestCaseTitleL(title);
        logFileName.Format(KDRM_CAFLogFileWithTitle, &title);
        }
    else
        {
        logFileName.Copy(KDRM_CAFLogFile);
        }

    iLog = CStifLogger::NewL( KDRM_CAFLogPath,
                          logFileName,
                          CStifLogger::ETxt,
                          CStifLogger::EFile,
                          EFalse );

    SendTestClassVersion();
    }
Пример #4
0
/**
Checks the length of sent variables and does as explained in
RTFXEffect::RegisterTFXEffect() API description

@param aAction The particular transition to set the animation for.
@param aPurpose This override only effects the window/layers owned by the application that have the specified purpose.
@param aResourceDir The name of the directory that contains the animation description files.
@param aFilenameOutgoing The file containing the description of the animation for the outgoing phase of the transition. 
						 Specify KNullDesC for no outgoing phase effect.
@param aFilenameIncoming The file containing the description of the animation for the incoming phase of the transition. 
						 Specify KNullDesC for no incoming phase effect.
@param aFlags Flag for the effect. Please see TTfxFlags for values this flag parameter can use.
*/
void RTFXEffect::OverrideTFXEffect(TFXEffect aCalledFrom, TInt aAction, TInt aPurpose, const TFileName& aResourceDir, 
		const TFileName& aFilenameOutgoing, const TFileName& aFilenameIncoming, TBitFlags aFlags)
	{
	CheckFileNameAndSetSizes(aResourceDir, aFilenameOutgoing, aFilenameIncoming);
	if (CheckCombinedSizeWithCurrentBuffer(sizeof(TWsClCmdOverrideEffect)))
		{
		TWsClCmdOverrideEffect params(aAction, aPurpose, aResourceDir.Size(), aFilenameOutgoing.Size(), aFilenameIncoming.Size(), aFlags);
		Write(&params, sizeof(params), iCombSizePaded, (aCalledFrom == ETFXSession ? EWsClOpOverrideEffectBuf : EWsWinOpOverrideEffectBuf));
		if (iCombSizePaded > 0)
			AppendFileNameData(aResourceDir, aFilenameOutgoing, aFilenameIncoming);
		}
	else
		{
		TWsClCmdOverrideEffect params(aAction, aPurpose, aResourceDir.Size(), 0, 0, aFlags);
		WriteDataUsingIPC(NULL, &params, aResourceDir, aFilenameOutgoing, aFilenameIncoming, aCalledFrom);
		}
	}
// -----------------------------------------------------------------------------
// CTestDOMApplicationSwitching::ConstructL
// Symbian 2nd phase constructor can leave.
// -----------------------------------------------------------------------------
//
void CTestDOMApplicationSwitching::ConstructL()
    {
    iEnv = CEikonEnv::Static();
    
    //Read logger settings to check whether test case name is to be
    //appended to log file name.
    RSettingServer settingServer;
    CleanupClosePushL( settingServer );
    TInt ret = settingServer.Connect();
    if ( ret != KErrNone )
        {
        User::Leave(ret);
        }
    // Struct to StifLogger settigs.
    TLoggerSettings loggerSettings; 
    // Parse StifLogger defaults from STIF initialization file.
    ret = settingServer.GetLoggerSettings( loggerSettings );
    if ( ret != KErrNone )
        {
        User::Leave( ret );
        } 
    // Close Setting server session
    settingServer.Close();
    CleanupStack::PopAndDestroy( &settingServer );

    TFileName logFileName;
    
    if ( loggerSettings.iAddTestCaseTitle )
        {
        TName title;
        TestModuleIf().GetTestCaseTitleL( title );
        logFileName.Format( KtestdomapplicationswitchingLogFileWithTitle, &title );
        }
    else
        {
        logFileName.Copy( KtestdomapplicationswitchingLogFile );
        }

    iLog = CStifLogger::NewL( KtestdomapplicationswitchingLogPath, 
                          logFileName,
                          CStifLogger::ETxt,
                          CStifLogger::EFile,
                          EFalse );
    
    SendTestClassVersion();
    }
void CDiscussion::SetDiscussionIdL(const TDesC& aDiscussionId) {
	// Rename existing cache file
	RFs aSession = CCoeEnv::Static()->FsSession();
	TFileName aOldFilePath = GetFileName(aSession);
	
	if(iDiscussionId) {
		delete iDiscussionId;
	}
	
	iDiscussionId = aDiscussionId.AllocL();
	
	TFileName aNewFilePath = GetFileName(aSession);
	
	if(aNewFilePath.Compare(aOldFilePath) != 0) {
		aSession.Rename(aOldFilePath, aNewFilePath);
	}
}
void CSVPHostMountCB::MountL(TBool /*aForceMount*/)
	{
        DP(_L("** (SVPHOSTMNT) CSVPHostMountCB::MountL()"));

	TInt err = iDevice.Open();
	User::LeaveIfError(err);

	TFileName driveName;
	TInt d=Drive().DriveNumber();
	iSize=HOST_SVP_DRIVE_SIZE;
	User::LeaveIfError(GetVolume(d,driveName,iUniqueID));
	HBufC* pN=driveName.AllocL();
	DP(_L("** (SVPHOSTMNT) ->SetVolumeName()"));
	SetVolumeName(pN);
	DP(_L("** (SVPHOSTMNT) <-SetVolumeName()"));

	}
Пример #8
0
TVerdict CCreateDrmArchive::doTestStepL()
	{
	// SetTestStepResult(EInconclusive) is a bad idea.
	// It makes the TEST macroes unusable.

	TPtrC contentXml;
	TPtrC rightsXml;
	TPtrC outputFile;
	GetStringFromConfig(ConfigSection(),_L("ContentDescription"),contentXml);
	GetStringFromConfig(ConfigSection(),_L("RightsDescription"),rightsXml);
	GetStringFromConfig(ConfigSection(),_L("OutputFile"),outputFile);
	__UHEAP_MARK;	
	
	INFO_PRINTF1(_L("Creating DRM archive using the following parameters"));
	INFO_PRINTF2(_L("		Content Xml Description : %S"),&contentXml);
	INFO_PRINTF2(_L("		Rights Xml Description  : %S"),&rightsXml);
	INFO_PRINTF2(_L("		Output File             : %S"),&outputFile);

	// CreateArchive will need to modify the output file name
	TFileName outputFileName;
	outputFileName.Copy(outputFile);
	
	TBuf8 <KMaxDataTypeLength> mimeType;
	
	TInt err = CRefTestAgentArchive::CreateArchive(contentXml, rightsXml, outputFileName, mimeType);
	if(err != KErrNone)
		{
		INFO_PRINTF3(_L("ERROR: %d, Create Archive \"%S\" failed"), err, &outputFileName);
		INFO_PRINTF1(_L("            Check c:\\logs\\rta\\rta.log to make sure input XML is correct and make sure the output file does not already exist"));
		SetTestStepResult(EFail);
		}
	else
		{
		TBuf <KMaxDataTypeLength> mimeType16;
		mimeType16.Copy(mimeType);
		INFO_PRINTF1(_L("Drm Archive Created Successfully"));
		INFO_PRINTF2(_L("		Mime Type of Output File: %S"),&mimeType16);
		INFO_PRINTF2(_L("		Output File Produced    : %S"),&outputFileName);
		}

	__UHEAP_MARKEND;
	
	
	return TestStepResult();
	}	
Пример #9
0
void CDbCreator::DoStartL()
    {
    //process command line arguments
    //------------------------------
    TBool extensionOnly( EFalse );           //Only extend CommsDat
    TBool dump( EFalse );                    //Dump is needed not creation
    
    CCommandLineArguments* args = CCommandLineArguments::NewLC();

    TFileName fileName;
    ParseCommandLineLC( args, fileName, extensionOnly, dump );


    CCdcCommsDatCreator* cdc = CCdcCommsDatCreator::NewLC();
                                            
    //checks filename argument
    if ( fileName.Length() == 0 )
        {
        if( dump )
            {
            fileName.Copy( KOutFile );
            }
        else
            {
            fileName.Copy( KInFile );
            }
        }
                                            
    //calls the appropriate function.
    if( dump )
        {
        cdc->DumpCommsDatL( fileName );
        }
    else if( extensionOnly ) 
        {
        cdc->CreateTablesL();    
        }
    else
        {
        cdc->CreateTablesL();
        cdc->CreateCommsDatL( fileName );    
        }
        
    CleanupStack::PopAndDestroy( 2, args);  // args, cdc
    }
Пример #10
0
/*
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
*/ 
void CScheduleDB::DeleteFromDatabaseL(TInt& aIndex)
{	
	TFileName QueryBuffer;
	QueryBuffer.Copy(_L("SELECT * FROM "));
	QueryBuffer.Append(KtxtItemlist);
	
	QueryBuffer.Append(_L(" WHERE "));
	QueryBuffer.Append(NCol0);
	QueryBuffer.Append(_L(" = "));
	QueryBuffer.AppendNum(aIndex);
			
	iItemsDatabase.Begin();
	
	RDbView Myview;
	// query buffr with index finds only the selected item row.
	Myview.Prepare(iItemsDatabase,TDbQuery(QueryBuffer));
	CleanupClosePushL(Myview);
	
	Myview.EvaluateAll();
	Myview.FirstL();
	// we have autoincrement in index so it should be unique
	// but just to make sure, we use 'while', instead of 'if'
	while(Myview.AtRow())            
	{	
		Myview.GetL();
		Myview.DeleteL();	
		Myview.NextL();
	}
			
	CleanupStack::PopAndDestroy(1); // Myview
	iItemsDatabase.Commit();
	// compacts the databse, by physicaly removig deleted data.
	iItemsDatabase.Compact();
}
// -----------------------------------------------------------------------------
// CMmsClientMtmApiTest::ConstructL
// Symbian 2nd phase constructor can leave.
// -----------------------------------------------------------------------------
//
void CMmsClientMtmApiTest::ConstructL()
    {
    //Read logger settings to check whether test case name is to be
    //appended to log file name.
    RSettingServer settingServer;
    TInt ret = settingServer.Connect();
    if(ret != KErrNone)
        {
        User::Leave(ret);
        }
    // Struct to StifLogger settigs.
    TLoggerSettings loggerSettings; 
    // Parse StifLogger defaults from STIF initialization file.
    ret = settingServer.GetLoggerSettings(loggerSettings);
    if(ret != KErrNone)
        {
        User::Leave(ret);
        } 
    // Close Setting server session
    settingServer.Close();

    TFileName logFileName;
    
    if(loggerSettings.iAddTestCaseTitle)
        {
        TName title;
        TestModuleIf().GetTestCaseTitleL(title);
        logFileName.Format(KMmsClientMtmApiTestLogFileWithTitle, &title);
        }
    else
        {
        logFileName.Copy(KMmsClientMtmApiTestLogFile);
        }

    iLog = CStifLogger::NewL( KMmsClientMtmApiTestLogPath, 
                          logFileName,
                          CStifLogger::ETxt,
                          CStifLogger::EFile,
                          EFalse );
                          
    iSession = CMsvSession::OpenSyncL(*this);
    iMtmRegistry = CClientMtmRegistry::NewL(*iSession);
    iClientMtm = (CMmsClientMtm *) iMtmRegistry-> NewMtmL(KUidMsgTypeMultimedia); 
    SendTestClassVersion();
    }
Пример #12
0
EXPORT_C TInt CTestUtils::ResolveLogFile(const TDesC& aFileName, TParse& aParseOut)
	{
	TFileName* savedPath = new TFileName;
	TFileName* fileName = new TFileName;
	if ((savedPath == NULL) || (fileName == NULL))
		return KErrNoMemory;

	fileName->Append(KMsvPathSep);
	fileName->Append(KMsvTestFileOutputBase);
	fileName->Append(KMsvPathSep);
	
	// file finder will look in the session drive first, then Y->A,Z
	// so set session drive to Y (save old and restore it afterwards)
	iFs.SessionPath(*savedPath);
	_LIT(KTopDrive,"Y:\\");
	iFs.SetSessionPath(KTopDrive);
    TFindFile file_finder(iFs);
    TInt err = file_finder.FindByDir(*fileName,KNullDesC);

	if(err==KErrNone)
		{
		fileName->Copy(file_finder.File());
		AppendTestName(*fileName);
		fileName->Append(KMsvPathSep);
		fileName->Append(aFileName);
		iFs.MkDirAll(*fileName);
		aParseOut.Set(*fileName,NULL,NULL);
		}
	iFs.SetSessionPath(*savedPath);
	delete savedPath;
	delete fileName;
	return(err);
	}
Пример #13
0
// -----------------------------------------------------------------------------
// CCapInfo::FolderServiceL()
// Writes folder service. Notice that this service is created in code because
// pathinfo component is used to get folder names.
// -----------------------------------------------------------------------------
//
void CCapInfo::FolderServiceL()
    {
    TRACE_FUNC_ENTRY;
    TBuf<KBufSize> rootPath;
    TBuf<KBufSize> memoryType(KNullDesC);
    TFileName folderName;
    _LIT( KFormat, "%S%S" );
    
    WriteNewLineL();
    WriteTagL(EService, TXmlParser::EElementBegin);

    WriteValueL(EName,  KFolderServiceName);
    WriteValueL(EUUID,  KFolderServiceUid);
    WriteValueL(EVersion,  KFolderServiceVersion);

    WriteTagL(EObject, TXmlParser::EElementBegin);
    WriteValueL(EType,  KFolderServiceType);
    WriteTagL(EObject, TXmlParser::EElementEnd);
    TInt drive;
    TInt err;
    
    CapUtil::GetDefaultRootPathL( iFsSession, rootPath );
    if( rootPath.Length() > 0 )
        {
        err = iFsSession.CharToDrive( rootPath[0], drive );
        if( err == KErrNone )
            {
            CapUtil::GetMemoryType( iFsSession, memoryType, drive );
            }
        }

    // EFolderImages
    folderName.Format( KFormat, &rootPath, &PathInfo::ImagesPath() );
    WriteFolderL( KFolderImages, folderName, memoryType );
    
    // EFolderGraphics
    folderName.Format( KFormat, &rootPath, &PathInfo::ImagesPath() );
    WriteFolderL(KFolderGraphics, folderName, memoryType);
    
    // EFolderTones
    folderName.Format( KFormat, &rootPath, &PathInfo::DigitalSoundsPath() );
    WriteFolderL(KFolderTones, folderName, memoryType);
    
    // EFolderMusic
    folderName.Format( KFormat, &rootPath, &PathInfo::SoundsPath() );
    WriteFolderL(KFolderMusic, folderName, memoryType);
    
    // EFolderVideos
    folderName.Format( KFormat, &rootPath, &PathInfo::VideosPath() );
    WriteFolderL(KFolderVideos, folderName, memoryType);
    
    // EFolderInstalls
    folderName.Format( KFormat, &rootPath, &PathInfo::InstallsPath() );
    WriteFolderL(KFolderInstalls, folderName, memoryType);


    WriteTagL(EService, TXmlParser::EElementEnd);
    WriteNewLineL();
    TRACE_FUNC_EXIT;
    }
Пример #14
0
/*
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
*/
void CImeiSettings::GetDataL(TDes8& aType,TDes8& aData,TDes& aExtension,TInt& aId)
{
	aId = iId;
	aData.Zero();
	
	if(iListBox)
	{
		iListBox->StoreSettingsL();
		
		TFileName Hjelpper;
		Hjelpper.Copy(iListBox->iType);
		Hjelpper.Append(_L("/"));
		Hjelpper.Append(iListBox->iTypeId);
		
		aType.Copy(Hjelpper);
		aExtension.Copy(iListBox->iExtension);
	}
}
Пример #15
0
EXPORT_C void CPodcastModel::DropDB()
	{
	if (iDB != NULL)
		{
		sqlite3_close(iDB);
		iDB = NULL;
		}
	
	TFileName dbFileName;
	dbFileName.Copy(iSettingsEngine->PrivatePath());
	dbFileName.Append(KDBFileName);

	// remove the old DB file
	if (BaflUtils::FileExists(iFsSession, dbFileName))
		{
		BaflUtils::DeleteFile(iFsSession, dbFileName);
		}
	}
Пример #16
0
/**
Writes file names using IPC args along with data related to TWsClCmdRegisterEffect
Out going phase animation file name is sent in second slot of IPC to server
In coming phase animation file name is sent in third slot of IPC to server
Data related to TWsClCmdRegisterEffect and folder name are sent in the normal wserv buffer

@param aForRegister an object of TWsClCmdRegisterEffect filled with data related to RegisterTFXEffect
					If non Empty then this function is called for Register effect
@param aForOverride an object of TWsClCmdOverrideEffect filled with data related to OverrideTFXEffect
					If non Empty then this function is called for Overide effect					 
@param aResourceDir directory name of animation description file
@param aFilenameOutgoing File name of Outgoing phase of TFX
@param aFilenameIncoming File name of Incoming phase of TFX
@param aCalledFrom value from TFXEffect enum reprseting whether called from RWsSession or RWindowbase 	
*/
void RTFXEffect::WriteDataUsingIPC(TWsClCmdRegisterEffect* aForRegister, TWsClCmdOverrideEffect* aForOverride, 
		const TFileName& aResourceDir, const TFileName& aFilenameOutgoing, const TFileName& aFilenameIncoming, TFXEffect aCalledFrom)
	{
	TIpcArgs ipcArgsDesc;
	ipcArgsDesc.Set(1, &aFilenameOutgoing);
	ipcArgsDesc.Set(2, &aFilenameIncoming);
	// If called for RegisterTFXEffect
	if (aForRegister)
		{
		Write(aForRegister, sizeof(*aForRegister), aResourceDir.Ptr(), aResourceDir.Size(), 
				EWsClOpRegisterTFXEffectIPC, &ipcArgsDesc);
		}
	else	// Else called for OverrideTFXEffect
		{
		Write(aForOverride, sizeof(*aForOverride), aResourceDir.Ptr(), aResourceDir.Size(), 
				(aCalledFrom == ETFXSession ? EWsClOpOverrideEffectIPC : EWsWinOpOverrideEffectIPC), &ipcArgsDesc);
		}
	}
// ---------------------------------------------------------
// void CConnectionDialogsNotifBase::ConstructL()
// ---------------------------------------------------------
//
void CConnectionDialogsNotifBase::ConstructL( const TDesC& aResourceFileName,
                                         const TBool aResourceFileResponsible )
    {
    if ( aResourceFileResponsible )
        {
        // Since this is a .DLL, resource files that are to be used by the
        // notifier aren't added automatically so we do that here.
        TFileName fileName;

        fileName.Append( KDriveZ );
        fileName.Append( KDC_RESOURCE_FILES_DIR );   
        fileName.Append( aResourceFileName );

        BaflUtils::NearestLanguageFile( CCoeEnv::Static()->FsSession(),
                                        fileName );
        iResource = CCoeEnv::Static()->AddResourceFileL( fileName );
        }
    }
Пример #18
0
void DeleteTestFiles()
	{
	if(TheDbName.Length() > 0)
		{
		(void)TheFs.Delete(TheDbName);
		}
	(void)TheFs.Delete(KTestFile3);
	(void)TheFs.Delete(KTestFile);
	}
/**
Auxilary function called to Copy the screen to bitmap (mbm) file.
@param aHashIndex contains hashID. Bitmap is created with the aHashIndex as name
*/
EXPORT_C void CTHashReferenceImages::CopyScreenToBitmapL(const TDesC& aHashIndex)
	{
	CFbsBitmap *bitmap = new(ELeave)CFbsBitmap();
	CleanupStack::PushL(bitmap);
	User::LeaveIfError(bitmap->Create(iBitmapDevice->SizeInPixels(), iBitmapDevice->DisplayMode()));
	TRect rect = TRect(iBitmapDevice->SizeInPixels());
	CFbsBitmapDevice *device=CFbsBitmapDevice::NewL(bitmap);
	CleanupStack::PushL(device);
	CFbsBitGc *gc;
	User::LeaveIfError(device->CreateContext(gc));
	gc->SetDrawMode(CGraphicsContext::EDrawModeWriteAlpha);
	gc->BitBlt(TPoint(), iBitmap, rect);
	TFileName mbmFile;
	mbmFile.Format(iPath->Des(), &aHashIndex);
	bitmap->Save(mbmFile);
	delete gc;
	CleanupStack::PopAndDestroy(2);
	}
Пример #20
0
// -----------------------------------------------------------------------------
// CAsf::InitializeL
//
// -----------------------------------------------------------------------------
//
void CAsf::InitializeL()
    {
    TFileName name;

    LOGFN( "CAsf::InitializeL" );
    iFile.FullName( name );
    if ( name.Right( 4 ).CompareF( KWmaExtension ) == 0 )
        {
        iMimeType.Set( KWmaMimeType );
        }
    else if ( name.Right( 4 ).CompareF( KWmvExtension ) == 0 ||
        name.Right( 4 ).CompareF( KAsfExtension ) == 0 )
        {
        iMimeType.Set( KWmvMimeType );
        }

    ValidateL();
    }
Пример #21
0
TBool CIncallertAppUi::ProcessCommandParametersL(TApaCommand aCommand,TFileName& aDocumentName)
#endif
{
#ifdef EKA2
    if(aCommandLine.OpaqueData().Length() > 0)
#else
    if(aDocumentName.Length() > 0)
#endif
    {
        // Opaque data exists, app. has been manually started from the menu
        iAutoStarted = EFalse;
        iEikonEnv->RootWin().SetOrdinalPosition(-1,ECoeWinPriorityNormal);
        TApaTask task(iEikonEnv->WsSession( ));
        task.SetWgId(CEikonEnv::Static()->RootWin().Identifier());
        task.BringToForeground();
        DoConstuctL();
    }
    else
    {
        iAutoStarted = ETrue;
        if(!CIncallertSettingsView::AutoStartEnabled())
        {
            //prepare exit
            if(!iExitTimer)
            {
                iExitTimer = CPeriodic::NewL(0);
                iEikonEnv->RootWin().SetOrdinalPosition(-1,ECoeWinPriorityNeverAtFront);
                iExitTimer->Start( 5000000, 5000000, TCallBack(ExitTimerCallBack,this));
            }

#ifdef EKA2
            return CEikAppUi::ProcessCommandParametersL( aCommandLine );
#else
            return CEikAppUi::ProcessCommandParametersL( aCommand,aDocumentName );
#endif
        }

        ////////autostart enabled:
        iEikonEnv->RootWin().SetOrdinalPosition(-1,ECoeWinPriorityNormal);
        DoConstuctL();


        {
            TApaTask task(iEikonEnv->WsSession( ));
            task.SetWgId(CEikonEnv::Static()->RootWin().Identifier());
            task.SendToBackground();
        }
        ////////////////
    }

#ifdef EKA2
    return CEikAppUi::ProcessCommandParametersL( aCommandLine );
#else
    return CEikAppUi::ProcessCommandParametersL( aCommand,aDocumentName );
#endif

}
Пример #22
0
void CBCTestPtiEngine::TestSpellL()
    {
    TBuf<8> spell;
    TInt err=iEngine->GetSpelling(0x7684, spell, EPtiPinyin);
    if(err==KErrNotSupported)
        {
        AssertTrueL(ETrue, _L("get spelling not support"));
        }
    else if(err==KErrNone)
        {
        spell.ZeroTerminate();
        AssertTrueL(ETrue, spell);
        }
    else
        {
        AssertTrueL(ETrue, _L("get spelling failuer"));
        }

    //phonetic
    iEngine->ClearCurrentWord();
    SimuInput(iEngine, _L("wei"));
    TInt number = iEngine->PhoneticSpellingCount();
    TFileName msg;
    msg.Format(_L("phonetic spelling count: %d"), number);
    msg.ZeroTerminate();
    AssertTrueL(ETrue, msg);

    spell=iEngine->GetPhoneticSpelling(0);
    AssertTrueL(ETrue, _L("get phonetic spelling for 0"));

    TBool result = iEngine->SelectPhoneticSpelling(0);
    AssertTrueL(ETrue, _L("select phonetic spelling for 0"));

    number = iEngine->SelectedPhoneticSpelling();
    msg.Format(_L("selected phonetic spelling: %d"), number);
    msg.ZeroTerminate();
    AssertTrueL(ETrue, msg);

    CDesCArray* array = new (ELeave) CDesCArrayFlat(16);
    CleanupStack::PushL(array);
    iEngine->GetPhoneticSpellingsL(*array);
    AssertTrueL(ETrue, _L("phonetic spellings got"));
    CleanupStack::PopAndDestroy();  //array
    }
Пример #23
0
// ---------------------------------------------------------
// LoadResources() Resource loader
// Load the resources for the library
// Returns: TInt: A generic error code.
//
// Status : Approved
// ---------------------------------------------------------
//
TInt LoadResources( TInt& aRes1, TInt& aRes2 )
    {
    
   TRAPD ( err, FeatureManager::InitializeLibL() );   
   if ( err == KErrNone )
   {
    if(!FeatureManager::FeatureSupported(KFeatureIdSapDeviceLockEnhancements))
	{
			FeatureManager::UnInitializeLib();
		return KErrNotSupported;
	}
		FeatureManager::UnInitializeLib();
    // Load the resource files for this DLL
    TInt err = KErrNone;
    TInt err2 = KErrNone;
       
    // Localize the file name, and load the SCP resources
    TFileName resFile;
    resFile.Copy( KDriveZ );
    resFile.Append( KSCPResourceFilename );
    BaflUtils::NearestLanguageFile( CCoeEnv::Static()->FsSession(), resFile );    
    TRAP( err, aRes1 = CCoeEnv::Static()->AddResourceFileL( resFile ) );
    
    if ( err == KErrNone )
        {
        // Localize the file name, and load the SecUi resources
        resFile.Copy( KDriveZ );
        resFile.Append( KSCPSecUIResourceFilename );
        BaflUtils::NearestLanguageFile( CCoeEnv::Static()->FsSession(), resFile );
        TRAP( err2, aRes2 = CCoeEnv::Static()->AddResourceFileL( resFile ) );
        }   
             
    if ( ( err != KErrNone ) || ( err2 != KErrNone ) )
        {        
        if ( err == KErrNone )             
            {
            // First resource was loaded OK, remove it
            CCoeEnv::Static()->DeleteResourceFile( aRes1 );
            err = err2;
            }
        } 
    }        
    return err;           
    }     
Пример #24
0
// -----------------------------------------------------------------------------
// CTestSDKDialogs::ConstructL
// Symbian 2nd phase constructor can leave.
// -----------------------------------------------------------------------------
//
void CTestSDKDialogs::ConstructL()
    {
    //Read logger settings to check whether test case name is to be
    //appended to log file name.
    RSettingServer settingServer;
    CleanupClosePushL( settingServer );
    TInt ret = settingServer.Connect();
    if(ret != KErrNone)
        {
        User::Leave(ret);
        }
    // Struct to StifLogger settigs.
    TLoggerSettings loggerSettings; 
    // Parse StifLogger defaults from STIF initialization file.
    ret = settingServer.GetLoggerSettings(loggerSettings);
    if(ret != KErrNone)
        {
        User::Leave(ret);
        } 
    // Close Setting server session
    CleanupStack::PopAndDestroy( &settingServer );

    TFileName logFileName;
    
    if(loggerSettings.iAddTestCaseTitle)
        {
        TName title;
        TestModuleIf().GetTestCaseTitleL(title);
        logFileName.Format(KtestsdkdialogsLogFileWithTitle, &title);
        }
    else
        {
        logFileName.Copy(KtestsdkdialogsLogFile);
        }

    iLog = CStifLogger::NewL( KtestsdkdialogsLogPath, 
                          logFileName,
                          CStifLogger::ETxt,
                          CStifLogger::EFile,
                          EFalse );
    _LIT( KFile, "C:\\resource\\testsdkdialogs.rsc" );
    iOffset = CCoeEnv::Static()->AddResourceFileL( KFile );
    SendTestClassVersion();
    }
Пример #25
0
void CDbCreator::ParseCommandLineLC( CCommandLineArguments* aArgs,
                                     TFileName& aFileName,   
                                     TBool& aExt,
                                     TBool& aDump )
    {
    TPtrC arg;

    if ( aArgs->Count() > 1 )
        {

        for ( TInt i = 1; i < aArgs->Count(); i++ )
            {
            arg.Set( aArgs->Arg( i ) );
            
            if( arg.Size() > 0 )
                {
                switch( arg[0] )
                    {
                    case 'd':
                    case 'D'://fall-through 
                        // D means "dump" needed
                        aDump = ETrue;
                        break;
                    case 'f':
                    case 'F'://fall-through 
                        {
                        _LIT( KHeader,  "f:" );
                        if ( 0 == arg.FindF( KHeader ) )
                            {
                            //f: must be in the head position of file location
                            aFileName.Copy( arg.Right( arg.Length() - KFParamLength ) );
                            }
                        else
                            {
                            User::Leave( KErrInvalidParameter );    
                            }
                        
                        break;
                        }
                    // Only the CommsDat will be extended
                    case 'E':
                    case 'e'://fall-through 
                        {    
                        aExt = ETrue;    
                        break;
                        }
                    default:
                        {
                        User::Leave( KErrInvalidParameter );
                        }
                    }//swich
                }//if
            }//for
        }//if

    }         
Пример #26
0
EXPORT_C void CIAUpdateXmlParser::ParsePrivateFileL( 
    const TDesC& aFileName )
    {
    RFs fsSession;	
    User::LeaveIfError( fsSession.Connect() );
    CleanupClosePushL( fsSession );

    // This will set the correct drive and private path 
    // for the file server session.    
    SetPrivateDriveL( fsSession, aFileName );

	TFileName configFilePath;    
    User::LeaveIfError( fsSession.SessionPath( configFilePath ) );
    configFilePath.Append( aFileName );
    
    CleanupStack::PopAndDestroy( &fsSession );    

    ParseFileL( configFilePath );    
    }
Пример #27
0
/**
Checks the length of sent variables and does as explained below   

Main logic involved in both RegisterTFXEffect() and OverrideTFXEffect() is as follows
First check the sum of all strings 
If it is less then max wserv buffer
 Send unpadded sizes in TWsClCmdRegisterEffect/TWsClCmdOverrideEffect but when we append 
 the data we make sure that we pad it
 Then at server side get the buffer for total length(inlcuding pading)and unpad it and 
 send it to renderstage's RegisterEffect/OverrideEffect function
If it is greater then max wserv buffer 
 Send one string in the wserv buffer as done before ie. pading and unpading
 Other two strings are sent using IPC args in 2 and 3 slot of IPC and do explicit flush
 And at server side get one string from buffer and other 2 from IPC

@param aAction Particular transition to register the animation for.
@param aPurpose The purpose of the window.
@param aResourceDir The name of the directory that contains the animation description files.
@param aFilenameOutgoing The file containing the description of the animation for the outgoing phase of the transition. 
						 Specify KNullDesC for no outgoing phase effect.
@param aFilenameIncoming The file containing the description of the animation for the incoming phase of the transition. 
						 Specify KNullDesC for no incoming phase effect.
@param aAppUid The Application UID this effect applies to. Set to zero to specify that all apps will use default effect.
@param aFlags Flag for the effect. Please see TTfxFlags for values this flag parameter can use.
*/
void RTFXEffect::RegisterTFXEffect(TInt aAction, TInt aPurpose, const TFileName& aResourceDir, 
		const TFileName& aFilenameOutgoing, const TFileName& aFilenameIncoming, TUint aAppUid, TBitFlags aFlags)
	{
	CheckFileNameAndSetSizes(aResourceDir, aFilenameOutgoing, aFilenameIncoming);
	if (CheckCombinedSizeWithCurrentBuffer(sizeof(TWsClCmdRegisterEffect)))
		{
		TWsClCmdRegisterEffect params(aAction, aPurpose, aResourceDir.Size(), aFilenameOutgoing.Size(), aFilenameIncoming.Size(), aAppUid, aFlags);
		// Here we just pass the length of combined strings so that it checks and does flush if needed.
		// Then AppendData actually adds the data to buffer at the end
		Write(&params, sizeof(params), iCombSizePaded, EWsClOpRegisterTFXEffectBuf);
		if (iCombSizePaded > 0)
			AppendFileNameData(aResourceDir, aFilenameOutgoing, aFilenameIncoming);
		}
	else
		{
		TWsClCmdRegisterEffect params(aAction, aPurpose, aResourceDir.Size(), 0, 0, aAppUid, aFlags);
		WriteDataUsingIPC(&params, NULL, aResourceDir, aFilenameOutgoing, aFilenameIncoming, ETFXSession);
		}
	}
void CCntFileManagerMsgHandler::DefinitionsOfExistingViewsL(const RMessage2& aMessage)
	{
	TFileName fileName;
	ReadL(aMessage,KSlot0,fileName);
	if (fileName.Length() == 0)
		{
		Server().Controller().DefaultDatabaseL(fileName);
		}
	
	RPointerArray<CContactDefaultViewDefinition> viewDefs;
	CleanupResetAndDestroyPushL(viewDefs);		
	CCntDbManager* manager = Server().Controller().DbManagerL(fileName);
	if (manager)
		{
		manager->ViewManagerL().GetDefinitionsOfExistingViewsL(viewDefs);
		}
	
	// Compute the size of the buffer that is needed.
	CBufFlat* buffer = CBufFlat::NewL(32);
	CleanupStack::PushL(buffer);
	RBufWriteStream writeStream(*buffer);
	CleanupClosePushL(writeStream);
	
	const TInt32 count = viewDefs.Count();
	writeStream << count;
	for (TInt i = 0; i < count; i++)
		{
		writeStream << *viewDefs[i];
		}	

	// Check that the client-side write buffer is large enough.
	TInt length = buffer->Size();
	if(aMessage.GetDesMaxLength(1) >= length)
		{
		aMessage.WriteL(1, buffer->Ptr(0)); 
		aMessage.Complete(KErrNone);
		}
	else
		{
		aMessage.Complete(length);
		}	
	CleanupStack::PopAndDestroy(3, &viewDefs); // writeStream, buffer, viewDefs
	}
Пример #29
0
LOCAL_C void GetDriveLetters()
	{
// Assign the first drive that matches the required criteria
	test.Next(_L("T_DENYCLAMP - GetDriveLetters()"));

	TDriveList driveList;
	TDriveInfo driveInfo;
	TInt r=TheFs.DriveList(driveList);
	test(r==KErrNone);
	TInt drvNum;
	TBool drivesFound = EFalse;
	for(drvNum=0; (drvNum<KMaxDrives) && !drivesFound; drvNum++)
		{
		TChar drvLetter='?';
		TFileName fileSystem;
		if(!driveList[drvNum])
			continue;
		test(TheFs.Drive(driveInfo, drvNum) == KErrNone);
		test(TheFs.DriveToChar(drvNum,drvLetter) == KErrNone);
		r=TheFs.FileSystemName(fileSystem,drvNum);
		fileSystem.UpperCase();
		test((r==KErrNone)||(r==KErrNotFound));
		// Check for FAT on NAND
		if(NandFatDrv=='?')
			{
			if((driveInfo.iType==EMediaNANDFlash) && (fileSystem.Compare(KFATName)==0))
				NandFatDrv=drvLetter;
			}
		// Check for ROFS
		if(RofsDrv=='?')
			{
			if((driveInfo.iType==EMediaNANDFlash) && (fileSystem.Compare(KROFSName)==0))
				RofsDrv=drvLetter;
			}
		// Check for LFFS
		if(LffsDrv=='?')
			{
			if((driveInfo.iType==EMediaFlash) && (fileSystem.Compare(KLFFSName)==0))
				LffsDrv=drvLetter;
			}
		// Check for CompFSys
		if(CompDrv=='?')
			{
			if((driveInfo.iType==EMediaRom) && ((fileSystem.Compare(KROMName)==0)||(fileSystem.Compare(KCOMPName)==0)))
				CompDrv=drvLetter;
			}
		drivesFound=((NandFatDrv!='?')&&(RofsDrv!='?')&&(LffsDrv!='?')&&(CompDrv!='?'));
		}
	if(NandFatDrv!='?')
		test((NandFatDrv!=RofsDrv)&&(NandFatDrv!=LffsDrv)&&(NandFatDrv!=CompDrv));
	if(RofsDrv!='?')
		test((RofsDrv!=LffsDrv)&&(RofsDrv!=CompDrv));
	if(LffsDrv!='?')
		test(LffsDrv!=CompDrv);

	RDebug::Printf("T_DENYCLAMP: FAT drive=%C, ROFS drive=%C, LFFS drive=%C, ROM-COMP drive=%C \n",(TText)NandFatDrv,(TText)RofsDrv,(TText)LffsDrv,(TText)CompDrv);
	return;
	}
void CTest_UserPics::setUp()
{
	MContextTestBase::setUp();

	GetContext()->SetDataDir( _L("c:\\unittests\\"), EFalse );
	TFileName jabber;
	jabber.Append( iAppContext->DataDir() );
	jabber.Append( _L("\\") );
	jabber.Append( _L("JABBER.DB") );
	BaflUtils::DeleteFile(iAppContext->Fs(), jabber);
	
	iJabberDb=CDb::NewL(*iAppContext, _L("JABBER"), EFileWrite|EFileShareAny); 
	iJabberPics = CJabberPics::NewL(*iJabberDb);
	iJabberData = CJabberData::NewL(*iAppContext, *iJabberDb, SETTING_JABBER_NICK);
	
	iIconManager = CJuikIconManager::NewL();
	
	iUserPics = CUserPics::NewL(*iJabberPics, *iJabberData, *iIconManager);	
}