1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/security/cryptomgmtlibs/securitytestfw/test/testutil/client/testutilclient.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,123 @@
1.4 +/*
1.5 +* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of the License "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description:
1.18 +* TestUtil - client interface
1.19 +*
1.20 +*/
1.21 +
1.22 +
1.23 +/**
1.24 + @file
1.25 + @test
1.26 + @internalComponent
1.27 +*/
1.28 +
1.29 +#ifndef __TESTUTILCLIENT_H__
1.30 +#define __TESTUTILCLIENT_H__
1.31 +
1.32 +#include <e32std.h>
1.33 +#include <f32file.h>
1.34 +
1.35 +class RTestUtilSession : public RSessionBase
1.36 + {
1.37 +public:
1.38 + IMPORT_C TInt Connect();
1.39 + IMPORT_C TInt Copy(const TDesC& aSourceFile, const TDesC& aDestinationFile);
1.40 + IMPORT_C TInt Move(const TDesC& aSourceFile, const TDesC& aDestinationFile);
1.41 + IMPORT_C TInt Delete(const TDesC& aFileName);
1.42 + IMPORT_C TInt MkDirAll(const TDesC& aFileName);
1.43 + IMPORT_C TInt RmDir(const TDesC& aFileName);
1.44 + IMPORT_C TBool FileExistsL(const TDesC& aFileName);
1.45 + IMPORT_C TBool FileExistsL(const TDesC& aFileName, TInt aMsecTimeout);
1.46 +
1.47 + /**
1.48 + * Format the specified drive
1.49 + *
1.50 + * If the drive is NOT mounted the format will fail with error -18 KErrNotReady
1.51 + *
1.52 + * nb. Formating a drive looks like an MMC insertion to the SWI
1.53 + * daemon (it does NOT look like a remove followed by an insert).
1.54 + */
1.55 + IMPORT_C TInt FormatDrive(TInt aDrive, TBool aFormatFatTableOnly = EFalse);
1.56 + /**
1.57 + * Mount the specified drive
1.58 + *
1.59 + * Mounting an already mounted drive fails with error -21 KErrAccessDenied
1.60 + *
1.61 + * Mounting an unmounted drive looks exactly like a MMC card
1.62 + * insertion to the SWI daemon.
1.63 + *
1.64 + * [The SWI daemon detects MMC insertion by registering with the
1.65 + * FS server using NotifyChange(ENotifyEntry,,) for a non-existent
1.66 + * file on the drive being watched. It then checks if it can read
1.67 + * the Volume info to decide if media has been inserted or
1.68 + * removed.]
1.69 + */
1.70 + IMPORT_C TInt MountDrive(TInt aDrive);
1.71 + /**
1.72 + * UnMount the specified drive
1.73 + *
1.74 + * Un-mounting an already un-mounted drive fails with error -18 KErrNotReady
1.75 + *
1.76 + * Unmounting an mounted drive looks exactly like a MMC card
1.77 + * removal to the SWI daemon.
1.78 + *
1.79 + * Will fail if there are any open file descriptors on the drive.
1.80 + */
1.81 + IMPORT_C TInt UnMountDrive(TInt aDrive);
1.82 +
1.83 + IMPORT_C TInt Lock(const TDesC& aFileName);
1.84 + IMPORT_C TInt Unlock(const TDesC& aFileName);
1.85 +
1.86 + /**
1.87 + * Set or clear the read only attribute for the specified file.
1.88 + * Set the attribut if aSetReadOnly is non-zero, clear otherwise.
1.89 + */
1.90 + IMPORT_C TInt SetReadOnly(const TDesC& aFileName, TInt aSetReadOnly = 1);
1.91 +
1.92 + /**
1.93 + * Get a file handle opened for reading for the specified filename - used
1.94 + * to access files in private directories.
1.95 + */
1.96 + IMPORT_C TInt GetFileHandle(const TDesC& aFileName, RFile &aRFile);
1.97 +
1.98 + /**
1.99 + *
1.100 + * Proxy file change notify request (RFS::NotifyChange needs AllFiles)
1.101 + *
1.102 + */
1.103 + IMPORT_C void WatchFile(const TDesC& aFileName, TRequestStatus& aStatus);
1.104 +
1.105 + /**
1.106 + *
1.107 + * Cancel outstanding file watch request.
1.108 + *
1.109 + */
1.110 + IMPORT_C void WatchFileCancelL();
1.111 +
1.112 + IMPORT_C TInt GetNumFilesL(const TDesC& aDirName);
1.113 +
1.114 + /**
1.115 + *
1.116 + * Set the Secure clock time.This call requires
1.117 + * TCB and WriteDeviceData Capability.
1.118 + *
1.119 + * @param aTimeOffset The secure clock time is
1.120 + * incremented by this value.
1.121 + *
1.122 + */
1.123 + IMPORT_C TInt SetSecureClock (TInt aTimeOffset);
1.124 + };
1.125 +
1.126 +#endif