sl@0: /* sl@0: * Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of the License "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * TestUtil - client interface sl@0: * sl@0: */ sl@0: sl@0: sl@0: /** sl@0: @file sl@0: @test sl@0: @internalComponent sl@0: */ sl@0: sl@0: #ifndef __TESTUTILCLIENT_H__ sl@0: #define __TESTUTILCLIENT_H__ sl@0: sl@0: #include sl@0: #include sl@0: sl@0: class RTestUtilSession : public RSessionBase sl@0: { sl@0: public: sl@0: IMPORT_C TInt Connect(); sl@0: IMPORT_C TInt Copy(const TDesC& aSourceFile, const TDesC& aDestinationFile); sl@0: IMPORT_C TInt Move(const TDesC& aSourceFile, const TDesC& aDestinationFile); sl@0: IMPORT_C TInt Delete(const TDesC& aFileName); sl@0: IMPORT_C TInt MkDirAll(const TDesC& aFileName); sl@0: IMPORT_C TInt RmDir(const TDesC& aFileName); sl@0: IMPORT_C TBool FileExistsL(const TDesC& aFileName); sl@0: IMPORT_C TBool FileExistsL(const TDesC& aFileName, TInt aMsecTimeout); sl@0: sl@0: /** sl@0: * Format the specified drive sl@0: * sl@0: * If the drive is NOT mounted the format will fail with error -18 KErrNotReady sl@0: * sl@0: * nb. Formating a drive looks like an MMC insertion to the SWI sl@0: * daemon (it does NOT look like a remove followed by an insert). sl@0: */ sl@0: IMPORT_C TInt FormatDrive(TInt aDrive, TBool aFormatFatTableOnly = EFalse); sl@0: /** sl@0: * Mount the specified drive sl@0: * sl@0: * Mounting an already mounted drive fails with error -21 KErrAccessDenied sl@0: * sl@0: * Mounting an unmounted drive looks exactly like a MMC card sl@0: * insertion to the SWI daemon. sl@0: * sl@0: * [The SWI daemon detects MMC insertion by registering with the sl@0: * FS server using NotifyChange(ENotifyEntry,,) for a non-existent sl@0: * file on the drive being watched. It then checks if it can read sl@0: * the Volume info to decide if media has been inserted or sl@0: * removed.] sl@0: */ sl@0: IMPORT_C TInt MountDrive(TInt aDrive); sl@0: /** sl@0: * UnMount the specified drive sl@0: * sl@0: * Un-mounting an already un-mounted drive fails with error -18 KErrNotReady sl@0: * sl@0: * Unmounting an mounted drive looks exactly like a MMC card sl@0: * removal to the SWI daemon. sl@0: * sl@0: * Will fail if there are any open file descriptors on the drive. sl@0: */ sl@0: IMPORT_C TInt UnMountDrive(TInt aDrive); sl@0: sl@0: IMPORT_C TInt Lock(const TDesC& aFileName); sl@0: IMPORT_C TInt Unlock(const TDesC& aFileName); sl@0: sl@0: /** sl@0: * Set or clear the read only attribute for the specified file. sl@0: * Set the attribut if aSetReadOnly is non-zero, clear otherwise. sl@0: */ sl@0: IMPORT_C TInt SetReadOnly(const TDesC& aFileName, TInt aSetReadOnly = 1); sl@0: sl@0: /** sl@0: * Get a file handle opened for reading for the specified filename - used sl@0: * to access files in private directories. sl@0: */ sl@0: IMPORT_C TInt GetFileHandle(const TDesC& aFileName, RFile &aRFile); sl@0: sl@0: /** sl@0: * sl@0: * Proxy file change notify request (RFS::NotifyChange needs AllFiles) sl@0: * sl@0: */ sl@0: IMPORT_C void WatchFile(const TDesC& aFileName, TRequestStatus& aStatus); sl@0: sl@0: /** sl@0: * sl@0: * Cancel outstanding file watch request. sl@0: * sl@0: */ sl@0: IMPORT_C void WatchFileCancelL(); sl@0: sl@0: IMPORT_C TInt GetNumFilesL(const TDesC& aDirName); sl@0: sl@0: /** sl@0: * sl@0: * Set the Secure clock time.This call requires sl@0: * TCB and WriteDeviceData Capability. sl@0: * sl@0: * @param aTimeOffset The secure clock time is sl@0: * incremented by this value. sl@0: * sl@0: */ sl@0: IMPORT_C TInt SetSecureClock (TInt aTimeOffset); sl@0: }; sl@0: sl@0: #endif