sl@0: /* sl@0: * Copyright (c) 2005-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 "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: * sl@0: */ sl@0: sl@0: sl@0: /** sl@0: @test sl@0: @internalComponent sl@0: sl@0: This contains CT_FsData sl@0: */ sl@0: sl@0: #if (!defined __T_FS_DATA_H__) sl@0: #define __T_FS_DATA_H__ sl@0: sl@0: // User Includes sl@0: #include "DataWrapperBase.h" sl@0: #include "T_DirData.h" sl@0: sl@0: // EPOC includes sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: // User includes sl@0: #include "T_ActiveNotifyChange.h" sl@0: sl@0: const TInt KBufferStringLength = 256; sl@0: sl@0: sl@0: class CT_FsData: public CDataWrapperBase sl@0: { sl@0: public: sl@0: static CT_FsData* NewL(); sl@0: ~CT_FsData(); sl@0: sl@0: /** sl@0: * Process a command read from the ini file sl@0: * sl@0: * @param aCommand requiring command to be processed sl@0: * @param aSection the section in the ini file requiring the command to be processed sl@0: * @param aAsyncErrorIndex the index of asynchronous command error code belongs to. sl@0: * sl@0: * @leave system wide error sl@0: * sl@0: * @return ETrue if the command is processed sl@0: */ sl@0: virtual TBool DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex); sl@0: sl@0: /** sl@0: * Return a pointer to the object that the data wraps sl@0: * sl@0: * @return pointer to the object that the data wraps sl@0: */ sl@0: virtual TAny* GetObject(); sl@0: sl@0: /** sl@0: * Query to see if there are any outstanding requests sl@0: * sl@0: * @return ETrue if there are any outstanding requests sl@0: */ sl@0: sl@0: void RunL(CActive* aActive, TInt aIndex); sl@0: void DoCancel(CActive* aActive, TInt aIndex); sl@0: sl@0: protected: sl@0: CT_FsData(); sl@0: void ConstructL(); sl@0: sl@0: private: sl@0: sl@0: virtual TBool DoCommandDrivesL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex); sl@0: virtual TBool DoCommandFilesL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex); sl@0: virtual TBool DoCommandMountsL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex); sl@0: sl@0: sl@0: void DoCmdNewL(); sl@0: void DoCmdClose(); sl@0: void DoCmdDestructor(); sl@0: sl@0: // Mount commands sl@0: void DoCmdAddFileSystem(const TDesC& aSection); sl@0: void DoCmdMountFileSystem(const TDesC& aSection); sl@0: void DoCmdMountFileSystemAndScan(const TDesC& aSection); sl@0: void DoCmdDismountFileSystem(const TDesC& aSection); sl@0: void DoCmdRemoveFileSystem(const TDesC& aSection); sl@0: void DoCmdFileSystemName(const TDesC& aSection); sl@0: void DoCmdAddExtension(const TDesC& aSection); sl@0: void DoCmdMountExtension(const TDesC& aSection); sl@0: void DoCmdDismountExtension(const TDesC& aSection); sl@0: void DoCmdRemoveExtension(const TDesC& aSection); sl@0: void DoCmdExtensionName(const TDesC& aSection); sl@0: void DoCmdRemountDriveL(const TDesC& aSection); sl@0: void DoCmdNotifyDismountL(const TDesC& aSection, const TInt aAsyncErrorIndex); sl@0: void DoCmdNotifyDismountCancel(const TDesC& aSection); sl@0: void DoCmdAllowDismount(const TDesC& aSection); sl@0: void DoCmdSetStartupConfigurationL(const TDesC& aSection); sl@0: void DoCmdAddCompositeMount(const TDesC& aSection); sl@0: void DoCmdStartupInitCompleteL(TInt aAsyncErrorIndex); sl@0: void DoCmdSetLocalDriveMappingL(const TDesC& aSection); sl@0: void DoCmdSwapFileSystem(const TDesC& aSection); sl@0: void DoCmdFinaliseDrives(); sl@0: void DoCmdFileSystemSubType(const TDesC& aSection); sl@0: sl@0: // Misc commands sl@0: void DoCmdConnect(const TDesC& aSection); sl@0: void DoCmdVersion(const TDesC& aSection); sl@0: void DoCmdNotifyChangeL(const TDesC& aSection, const TInt aAsyncErrorIndex); sl@0: void DoCmdNotifyChangeCancel(const TDesC& aSection); sl@0: void DoCmdNotifyDiskSpaceL(const TDesC& aSection, const TInt aAsyncErrorIndex); sl@0: void DoCmdNotifyDiskSpaceCancel(const TDesC& aSection); sl@0: void DoCmdIsRomAddress(const TDesC& aSection); sl@0: void DoCmdResourceCountMarkStart(); sl@0: void DoCmdResourceCountMarkEnd(); sl@0: void DoCmdResourceCount(const TDesC& aSection); sl@0: void DoCmdGetNotifyUser(const TDesC& aSection); sl@0: void DoCmdSetNotifyUser(const TDesC& aSection); sl@0: void DoCmdLoaderHeapFunctionL(const TDesC& aSection); sl@0: void DoCmdSetNotifyChange(const TDesC& aSection); sl@0: void DoCmdInitialisePropertiesFile(const TDesC& aSection); sl@0: sl@0: // Files commands sl@0: void DoCmdRealName(const TDesC& aSection); sl@0: void DoCmdSessionPath(const TDesC& aSection); sl@0: void DoCmdSetSessionPath(const TDesC& aSection); sl@0: void DoCmdParse(const TDesC& aSection); sl@0: void DoCmdMkDir(const TDesC& aSection); sl@0: void DoCmdMkDirAll(const TDesC& aSection); sl@0: void DoCmdRmDir(const TDesC& aSection); sl@0: void DoCmdGetDir(const TDesC& aSection); sl@0: void DoCmdDelete(const TDesC& aSection); sl@0: void DoCmdRename(const TDesC& aSection); sl@0: void DoCmdReplace(const TDesC& aSection); sl@0: void DoCmdAtt(const TDesC& aSection); sl@0: void DoCmdSetAtt(const TDesC& aSection); sl@0: void DoCmdModified(const TDesC& aSection); sl@0: void DoCmdSetModified(const TDesC& aSection); sl@0: void DoCmdEntryL(const TDesC& aSection); sl@0: void DoCmdSetEntry(const TDesC& aSection); sl@0: void DoCmdReadFileSectionL(const TDesC& aSection); sl@0: void DoCmdIsFileOpen(const TDesC& aSection); sl@0: void DoCmdGetShortName(const TDesC& aSection); sl@0: void DoCmdGetLongName(const TDesC& aSection); sl@0: void DoCmdIsFileInRom(const TDesC& aSection); sl@0: void DoCmdIsValidName(const TDesC& aSection); sl@0: void DoCmdSetSessionToPrivate(const TDesC& aSection); sl@0: void DoCmdPrivatePath(const TDesC& aSection); sl@0: void DoCmdCreatePrivatePath(const TDesC& aSection); sl@0: sl@0: // Drives commands sl@0: void DoCmdDriveList(const TDesC& aSection); sl@0: void DoCmdDriveL(const TDesC& aSection); sl@0: void DoCmdVolumeL(const TDesC& aSection); sl@0: void DoCmdSetVolumeLabel(const TDesC& aSection); sl@0: void DoCmdSubst(const TDesC& aSection); sl@0: void DoCmdSetSubst(const TDesC& aSection); sl@0: void DoCmdGetMediaSerialNumber(const TDesC& aSection); sl@0: void DoCmdIsValidDrive(const TDesC& aSection); sl@0: void DoCmdCharToDrive(const TDesC& aSection); sl@0: void DoCmdDriveToChar(const TDesC& aSection); sl@0: void DoCmdCheckDisk(const TDesC& aSection); sl@0: void DoCmdScanDrive(const TDesC& aSection); sl@0: void DoCmdGetDriveName(const TDesC& aSection); sl@0: void DoCmdSetDriveName(const TDesC& aSection); sl@0: void DoCmdLockDrive(const TDesC& aSection); sl@0: void DoCmdUnlockDrive(const TDesC& aSection); sl@0: void DoCmdClearPassword(const TDesC& aSection); sl@0: void DoCmdErasePassword(const TDesC& aSection); sl@0: void DoCmdReserveDriveSpace(const TDesC& aSection); sl@0: void DoCmdGetReserveAccess(const TDesC& aSection); sl@0: void DoCmdReleaseReserveAccess(const TDesC& aSection); sl@0: void DoCmdGetSystemDrive(const TDesC& aSection); sl@0: void DoCmdSetSystemDrive(const TDesC& aSection); sl@0: void DoCmdGetSystemDriveChar(const TDesC& aSection); sl@0: void DoCmdVolumeIOParam(const TDesC& aSection); sl@0: sl@0: // Helpers sl@0: void DoCleanup(); sl@0: void DoCmdPromptL(const TDesC &aSection); sl@0: inline RFs& CT_FsData::FileServer(){ return iFs2; } sl@0: TBool VerifyTDriveInfoDataFromIniL(const TDesC& aSection, TDriveInfo& aDriveInfo); sl@0: sl@0: sl@0: sl@0: const TDesC& ConvertToStrAttMask(TUint aAttMask); sl@0: TBool ConvertToSortKey(const TDesC& aSortKeyStr, TUint& aSortKey); sl@0: TBool ConvertToNotifyType(const TDesC& aNotifyTypeStr, TNotifyType& aNotifyType); sl@0: TBool ConvertToMediaAtts(const TDesC& aMediaAttStr, TUint& aMediaAtt); sl@0: TBool ConvertToDriveAtts(const TDesC& aMediaAttStr, TUint& aMediaAtt); sl@0: TBool GetDriveNumberFromConfig(const TDesC& aSection, const TDesC& aParameterName, TDriveNumber& aDriveNumber); sl@0: TBool GetMediaTypeFromConfig(const TDesC& aSection, TMediaType& aMediaType); sl@0: TBool GetMediaAttsFromConfig(const TDesC& aSection, TUint& aMediaAtt); sl@0: TBool GetDriveAttsFromConfig(const TDesC& aSection, TUint& aDriveAtt); sl@0: TBool GetBatteryStateFromConfig(const TDesC& aSection, TBatteryState& aBatteryState); sl@0: TBool GetDrvMapOperationFromConfig(const TDesC& aSection, const TDesC& aParameterName, TLocalDriveMappingInfo::TDrvMapOperation& aOperation); sl@0: public: sl@0: TUint64 ThreadId(); sl@0: sl@0: private: sl@0: /** RFs class instance that is tested */ sl@0: RFs* iFs; sl@0: sl@0: /** RFs class instance for additional purpoces */ sl@0: RFs iFs2; sl@0: sl@0: /** The request status for files/dir events */ sl@0: RPointerArray iNotifyChange; sl@0: sl@0: /** The request status for disk space events */ sl@0: RPointerArray iNotifyDiskSpace; sl@0: sl@0: /** The request status for dismounts a file system on a drive */ sl@0: RPointerArray iNotifyDismount; sl@0: sl@0: /** The request status for dismounts a file system on a drive */ sl@0: RPointerArray iStartupInitComplete; sl@0: sl@0: /** The volume label for a drive */ sl@0: TVolumeInfo iVolumeInfo; sl@0: sl@0: /** Optional name of the volume */ sl@0: TFileName iDriveName; sl@0: TFileName iVolumeLabel; sl@0: sl@0: /** Extension name */ sl@0: TFullName iExtensionName; sl@0: sl@0: /** IsFileInRom result */ sl@0: TUint8* iIsFileInRom; sl@0: sl@0: /** FileSystemName retuned value */ sl@0: TFullName iFileSystemName; sl@0: sl@0: /** LockDrive password */ sl@0: TMediaPassword iPassword; sl@0: }; sl@0: sl@0: #define GET_MANDATORY_STRING_PARAMETER(aParamName, aSection, aResult) GetCommandStringParameter(aParamName, aSection, aResult, (TText8*)__FILE__, __LINE__, ETrue) sl@0: #define GET_MANDATORY_INT_PARAMETER(aParamName, aSection, aResult) GetCommandIntParameter(aParamName, aSection, aResult,(TText8*) __FILE__, __LINE__, ETrue) sl@0: #define GET_MANDATORY_INT64_PARAMETER(aParamName, aSection, aResult) GetCommandInt64Parameter(aParamName, aSection, aResult,(TText8*) __FILE__, __LINE__, ETrue) sl@0: #define GET_MANDATORY_BOOL_PARAMETER(aParamName, aSection, aResult) GetCommandBoolParameter(aParamName, aSection, aResult, (TText8*)__FILE__, __LINE__, ETrue) sl@0: sl@0: #define GET_OPTIONAL_STRING_PARAMETER(aParamName, aSection, aResult) GetCommandStringParameter(aParamName, aSection, aResult, (TText8*) __FILE__, __LINE__, EFalse) sl@0: #define GET_OPTIONAL_INT_PARAMETER(aParamName, aSection, aResult) GetCommandIntParameter(aParamName, aSection, aResult,(TText8*) __FILE__, __LINE__, EFalse) sl@0: #define GET_OPTIONAL_INT64_PARAMETER(aParamName, aSection, aResult) GetCommandInt64Parameter(aParamName, aSection, aResult,(TText8*) __FILE__, __LINE__, EFalse) sl@0: #define GET_OPTIONAL_BOOL_PARAMETER(aParamName, aSection, aResult) GetCommandBoolParameter(aParamName, aSection, aResult,(TText8*) __FILE__, __LINE__, EFalse) sl@0: sl@0: #endif /* __T_FS_DATA_H__ */