Update contrib.
2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
23 This contains CT_FsData
26 #if (!defined __T_FS_DATA_H__)
27 #define __T_FS_DATA_H__
30 #include "DataWrapperBase.h"
31 #include "T_DirData.h"
39 #include "T_ActiveNotifyChange.h"
41 const TInt KBufferStringLength = 256;
44 class CT_FsData: public CDataWrapperBase
47 static CT_FsData* NewL();
51 * Process a command read from the ini file
53 * @param aCommand requiring command to be processed
54 * @param aSection the section in the ini file requiring the command to be processed
55 * @param aAsyncErrorIndex the index of asynchronous command error code belongs to.
57 * @leave system wide error
59 * @return ETrue if the command is processed
61 virtual TBool DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
64 * Return a pointer to the object that the data wraps
66 * @return pointer to the object that the data wraps
68 virtual TAny* GetObject();
71 * Query to see if there are any outstanding requests
73 * @return ETrue if there are any outstanding requests
76 void RunL(CActive* aActive, TInt aIndex);
77 void DoCancel(CActive* aActive, TInt aIndex);
85 virtual TBool DoCommandDrivesL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
86 virtual TBool DoCommandFilesL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
87 virtual TBool DoCommandMountsL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
92 void DoCmdDestructor();
95 void DoCmdAddFileSystem(const TDesC& aSection);
96 void DoCmdMountFileSystem(const TDesC& aSection);
97 void DoCmdMountFileSystemAndScan(const TDesC& aSection);
98 void DoCmdDismountFileSystem(const TDesC& aSection);
99 void DoCmdRemoveFileSystem(const TDesC& aSection);
100 void DoCmdFileSystemName(const TDesC& aSection);
101 void DoCmdAddExtension(const TDesC& aSection);
102 void DoCmdMountExtension(const TDesC& aSection);
103 void DoCmdDismountExtension(const TDesC& aSection);
104 void DoCmdRemoveExtension(const TDesC& aSection);
105 void DoCmdExtensionName(const TDesC& aSection);
106 void DoCmdRemountDriveL(const TDesC& aSection);
107 void DoCmdNotifyDismountL(const TDesC& aSection, const TInt aAsyncErrorIndex);
108 void DoCmdNotifyDismountCancel(const TDesC& aSection);
109 void DoCmdAllowDismount(const TDesC& aSection);
110 void DoCmdSetStartupConfigurationL(const TDesC& aSection);
111 void DoCmdAddCompositeMount(const TDesC& aSection);
112 void DoCmdStartupInitCompleteL(TInt aAsyncErrorIndex);
113 void DoCmdSetLocalDriveMappingL(const TDesC& aSection);
114 void DoCmdSwapFileSystem(const TDesC& aSection);
115 void DoCmdFinaliseDrives();
116 void DoCmdFileSystemSubType(const TDesC& aSection);
119 void DoCmdConnect(const TDesC& aSection);
120 void DoCmdVersion(const TDesC& aSection);
121 void DoCmdNotifyChangeL(const TDesC& aSection, const TInt aAsyncErrorIndex);
122 void DoCmdNotifyChangeCancel(const TDesC& aSection);
123 void DoCmdNotifyDiskSpaceL(const TDesC& aSection, const TInt aAsyncErrorIndex);
124 void DoCmdNotifyDiskSpaceCancel(const TDesC& aSection);
125 void DoCmdIsRomAddress(const TDesC& aSection);
126 void DoCmdResourceCountMarkStart();
127 void DoCmdResourceCountMarkEnd();
128 void DoCmdResourceCount(const TDesC& aSection);
129 void DoCmdGetNotifyUser(const TDesC& aSection);
130 void DoCmdSetNotifyUser(const TDesC& aSection);
131 void DoCmdLoaderHeapFunctionL(const TDesC& aSection);
132 void DoCmdSetNotifyChange(const TDesC& aSection);
133 void DoCmdInitialisePropertiesFile(const TDesC& aSection);
136 void DoCmdRealName(const TDesC& aSection);
137 void DoCmdSessionPath(const TDesC& aSection);
138 void DoCmdSetSessionPath(const TDesC& aSection);
139 void DoCmdParse(const TDesC& aSection);
140 void DoCmdMkDir(const TDesC& aSection);
141 void DoCmdMkDirAll(const TDesC& aSection);
142 void DoCmdRmDir(const TDesC& aSection);
143 void DoCmdGetDir(const TDesC& aSection);
144 void DoCmdDelete(const TDesC& aSection);
145 void DoCmdRename(const TDesC& aSection);
146 void DoCmdReplace(const TDesC& aSection);
147 void DoCmdAtt(const TDesC& aSection);
148 void DoCmdSetAtt(const TDesC& aSection);
149 void DoCmdModified(const TDesC& aSection);
150 void DoCmdSetModified(const TDesC& aSection);
151 void DoCmdEntryL(const TDesC& aSection);
152 void DoCmdSetEntry(const TDesC& aSection);
153 void DoCmdReadFileSectionL(const TDesC& aSection);
154 void DoCmdIsFileOpen(const TDesC& aSection);
155 void DoCmdGetShortName(const TDesC& aSection);
156 void DoCmdGetLongName(const TDesC& aSection);
157 void DoCmdIsFileInRom(const TDesC& aSection);
158 void DoCmdIsValidName(const TDesC& aSection);
159 void DoCmdSetSessionToPrivate(const TDesC& aSection);
160 void DoCmdPrivatePath(const TDesC& aSection);
161 void DoCmdCreatePrivatePath(const TDesC& aSection);
164 void DoCmdDriveList(const TDesC& aSection);
165 void DoCmdDriveL(const TDesC& aSection);
166 void DoCmdVolumeL(const TDesC& aSection);
167 void DoCmdSetVolumeLabel(const TDesC& aSection);
168 void DoCmdSubst(const TDesC& aSection);
169 void DoCmdSetSubst(const TDesC& aSection);
170 void DoCmdGetMediaSerialNumber(const TDesC& aSection);
171 void DoCmdIsValidDrive(const TDesC& aSection);
172 void DoCmdCharToDrive(const TDesC& aSection);
173 void DoCmdDriveToChar(const TDesC& aSection);
174 void DoCmdCheckDisk(const TDesC& aSection);
175 void DoCmdScanDrive(const TDesC& aSection);
176 void DoCmdGetDriveName(const TDesC& aSection);
177 void DoCmdSetDriveName(const TDesC& aSection);
178 void DoCmdLockDrive(const TDesC& aSection);
179 void DoCmdUnlockDrive(const TDesC& aSection);
180 void DoCmdClearPassword(const TDesC& aSection);
181 void DoCmdErasePassword(const TDesC& aSection);
182 void DoCmdReserveDriveSpace(const TDesC& aSection);
183 void DoCmdGetReserveAccess(const TDesC& aSection);
184 void DoCmdReleaseReserveAccess(const TDesC& aSection);
185 void DoCmdGetSystemDrive(const TDesC& aSection);
186 void DoCmdSetSystemDrive(const TDesC& aSection);
187 void DoCmdGetSystemDriveChar(const TDesC& aSection);
188 void DoCmdVolumeIOParam(const TDesC& aSection);
192 void DoCmdPromptL(const TDesC &aSection);
193 inline RFs& CT_FsData::FileServer(){ return iFs2; }
194 TBool VerifyTDriveInfoDataFromIniL(const TDesC& aSection, TDriveInfo& aDriveInfo);
198 const TDesC& ConvertToStrAttMask(TUint aAttMask);
199 TBool ConvertToSortKey(const TDesC& aSortKeyStr, TUint& aSortKey);
200 TBool ConvertToNotifyType(const TDesC& aNotifyTypeStr, TNotifyType& aNotifyType);
201 TBool ConvertToMediaAtts(const TDesC& aMediaAttStr, TUint& aMediaAtt);
202 TBool ConvertToDriveAtts(const TDesC& aMediaAttStr, TUint& aMediaAtt);
203 TBool GetDriveNumberFromConfig(const TDesC& aSection, const TDesC& aParameterName, TDriveNumber& aDriveNumber);
204 TBool GetMediaTypeFromConfig(const TDesC& aSection, TMediaType& aMediaType);
205 TBool GetMediaAttsFromConfig(const TDesC& aSection, TUint& aMediaAtt);
206 TBool GetDriveAttsFromConfig(const TDesC& aSection, TUint& aDriveAtt);
207 TBool GetBatteryStateFromConfig(const TDesC& aSection, TBatteryState& aBatteryState);
208 TBool GetDrvMapOperationFromConfig(const TDesC& aSection, const TDesC& aParameterName, TLocalDriveMappingInfo::TDrvMapOperation& aOperation);
213 /** RFs class instance that is tested */
216 /** RFs class instance for additional purpoces */
219 /** The request status for files/dir events */
220 RPointerArray<CT_ActiveNotifyChange> iNotifyChange;
222 /** The request status for disk space events */
223 RPointerArray<CActiveCallback> iNotifyDiskSpace;
225 /** The request status for dismounts a file system on a drive */
226 RPointerArray<CActiveCallback> iNotifyDismount;
228 /** The request status for dismounts a file system on a drive */
229 RPointerArray<CActiveCallback> iStartupInitComplete;
231 /** The volume label for a drive */
232 TVolumeInfo iVolumeInfo;
234 /** Optional name of the volume */
235 TFileName iDriveName;
236 TFileName iVolumeLabel;
238 /** Extension name */
239 TFullName iExtensionName;
241 /** IsFileInRom result */
242 TUint8* iIsFileInRom;
244 /** FileSystemName retuned value */
245 TFullName iFileSystemName;
247 /** LockDrive password */
248 TMediaPassword iPassword;
251 #define GET_MANDATORY_STRING_PARAMETER(aParamName, aSection, aResult) GetCommandStringParameter(aParamName, aSection, aResult, (TText8*)__FILE__, __LINE__, ETrue)
252 #define GET_MANDATORY_INT_PARAMETER(aParamName, aSection, aResult) GetCommandIntParameter(aParamName, aSection, aResult,(TText8*) __FILE__, __LINE__, ETrue)
253 #define GET_MANDATORY_INT64_PARAMETER(aParamName, aSection, aResult) GetCommandInt64Parameter(aParamName, aSection, aResult,(TText8*) __FILE__, __LINE__, ETrue)
254 #define GET_MANDATORY_BOOL_PARAMETER(aParamName, aSection, aResult) GetCommandBoolParameter(aParamName, aSection, aResult, (TText8*)__FILE__, __LINE__, ETrue)
256 #define GET_OPTIONAL_STRING_PARAMETER(aParamName, aSection, aResult) GetCommandStringParameter(aParamName, aSection, aResult, (TText8*) __FILE__, __LINE__, EFalse)
257 #define GET_OPTIONAL_INT_PARAMETER(aParamName, aSection, aResult) GetCommandIntParameter(aParamName, aSection, aResult,(TText8*) __FILE__, __LINE__, EFalse)
258 #define GET_OPTIONAL_INT64_PARAMETER(aParamName, aSection, aResult) GetCommandInt64Parameter(aParamName, aSection, aResult,(TText8*) __FILE__, __LINE__, EFalse)
259 #define GET_OPTIONAL_BOOL_PARAMETER(aParamName, aSection, aResult) GetCommandBoolParameter(aParamName, aSection, aResult,(TText8*) __FILE__, __LINE__, EFalse)
261 #endif /* __T_FS_DATA_H__ */