// EIKFUTIL.H
//
// Copyright (c) 1997-1999 Symbian Ltd.  All rights reserved.
//

#if !defined(__EIKFUTIL_H__)
#define __EIKFUTIL_H__

#if !defined(__E32STD_H__)
#include <e32std.h>
#endif

#if !defined(__F32FILE_H__)
#include <f32file.h>
#endif

#if !defined(__BADESCA_H__)
#include <badesca.h>
#endif

class CFont;
class CEikFileSortTable;
class TResourceReader;

class EikFileUtils
	{ 
public:
	IMPORT_C static TBool PathExists(const TDesC& aPath);
	IMPORT_C static TInt IsFolder(const TDesC& aFullName, TBool& aIsFolder);
	IMPORT_C static TBool FolderExists(const TDesC& aFolderName);
	IMPORT_C static TFileName FolderNameFromFullName(const TDesC& aFullName);
	IMPORT_C static TFileName DriveAndPathFromFullName(const TDesC& aFullName);
	IMPORT_C static TFileName RootFolderPath(const TBuf<1> aDriveLetter);
	IMPORT_C static void AbbreviateFileName(const TFileName& aOriginalFileName, TDes& aAbbreviatedFileName);
	IMPORT_C static TFileName AbbreviatePath(TDesC& aPathName, const CFont& aFont, TInt aMaxWidthInPixels);
	IMPORT_C static TBool UidTypeMatches(const TUidType& aFileUid, const TUidType& aMatchUid);
	IMPORT_C static TInt Parse(const TDesC& aName);
	IMPORT_C static TFileName ValidateFolderNameTypedByUserL(const TDesC& aFolderNameTypedByUser, const TDesC& aCurrentPath);
	IMPORT_C static TInt CopyFile(const TDesC& aSourceFullName, const TDesC& atargetFullName, TUint aSwitch = CFileMan::EOverWrite);
	IMPORT_C static TInt RenameFile(const TDesC& aOldFullName, const TDesC& aNewFullName, TUint aSwitch = CFileMan::EOverWrite);
	IMPORT_C static TInt DeleteFile(const TDesC& aSourceFullName, TUint aSwitch);
	IMPORT_C static TInt CheckWhetherFullNameRefersToFolder(const TDesC& aFullName, TBool& aIsFolder);
	IMPORT_C static TInt MostSignificantPartOfFullName(const TDesC& aFullName, TFileName& aMostSignificantPart);
	IMPORT_C static TInt CheckFolder(const TDesC& aFolderName);
	IMPORT_C static TInt DiskIsReadOnly(const TDesC& aFullName, TBool& aIsReadOnly);
	IMPORT_C static void UpdateDiskListL(const RFs& aFs,CDesCArray& aArray,TBool aIncludeRom,TDriveNumber aDriveNumber);
	IMPORT_C static void RemoveSystemDirectory(CDir& aDir);
	IMPORT_C static TBool IsFirstDriveForSocket(TDriveUnit aDriveUnit);
	IMPORT_C static TInt SortByTable(CDir& aDir,CEikFileSortTable* aTable);
	};

// Added by Bill
class CEikFileSortTable : public CArrayFixFlat<TUid>
	{
public:
	IMPORT_C CEikFileSortTable();
	IMPORT_C void ConstructFromResourceL(TResourceReader& aReader);
private:
	enum {EArrayGranularity=4};
	};

#endif
