//
// Copyright © Vector Works, Inc. 2006.
// All Rights Reserved.
// 

#pragma once

#include "IFolderIdentifier.h"
#include "IFileIdentifier.h"

namespace VectorWorks
{
	namespace Filing
	{

#include "FolderSpecifiers.h"

		// ----------------------------------------------------------------------------------------------------
		// {CAFEFEEB-3793-11DB-9C35-00508D5E9851}
		static const VWIID IID_ApplicationFolders = { 0xCAFEFEEB, 0x3793, 0x11DB, { 0x9C, 0x35, 0x00, 0x50, 0x8D, 0x5E, 0x98, 0x51 } };

		class DYNAMIC_ATTRIBUTE IApplicationFolders : public IVWSingletonUnknown
		{
		public:
			virtual VCOMError VCOM_CALLTYPE	ForEachFileInStandardFolder(IFolderContentListener* pVisitor, EFolderSpecifier folderSpec) = 0;
			virtual VCOMError VCOM_CALLTYPE ForEachFolderInStandardFolderClass(IFolderContentListener* pVisitor, EFolderSpecifier folderSpec) = 0;
			virtual VCOMError VCOM_CALLTYPE FindFileInStandardFolder(EFolderSpecifier folderSpec, const TXString& fileName, IFileIdentifier** outFileID) = 0;
			virtual VCOMError VCOM_CALLTYPE FindFileInStandardFolder(EFolderSpecifier folderSpec, const TXString& fileName, const TXString& extension, IFileIdentifier** outFileID) = 0;
			virtual VCOMError VCOM_CALLTYPE GetFileInUserRoot(EFolderSpecifier folderSpec, const TXString& fileName, IFileIdentifier** outFileID) = 0;
			virtual VCOMError VCOM_CALLTYPE GetNumFilesInStandardFolder(EFolderSpecifier folderSpec, size_t& outNumberFiles) = 0;
			virtual VCOMError VCOM_CALLTYPE GetStandardFolderInUserRoot(EFolderSpecifier folderSpec, IFolderIdentifier** outFolderID) = 0;
			virtual VCOMError VCOM_CALLTYPE GetStandardFolderInAppRoot(EFolderSpecifier folderSpec, IFolderIdentifier** outFolderID) = 0;
			virtual VCOMError VCOM_CALLTYPE GetApplicationFolder(IFolderIdentifier** outFolderID) = 0;
			virtual VCOMError VCOM_CALLTYPE GetUserFolder(IFolderIdentifier** outFolderID) = 0;
			virtual VCOMError VCOM_CALLTYPE ClearStandardFolderCache(EFolderSpecifier folderSpec) = 0;

			virtual VCOMError VCOM_CALLTYPE GetWorkgroupFolderCount(size_t & outWorkgroupFolderCount) = 0;
			virtual VCOMError VCOM_CALLTYPE GetWorkgroupFolder(size_t index, IFolderIdentifier** outFolderID) = 0;
			virtual VCOMError VCOM_CALLTYPE AddWorkgroupFolder(IFolderIdentifier* intFolderID) = 0;

			virtual VCOMError VCOM_CALLTYPE SearchRootFoldersForRelativePath(const TXString& partialPath, IFileIdentifier** outFileID) = 0;

		public:
			virtual VCOMError VCOM_CALLTYPE IsInStandardFolder(EFolderSpecifier folderSpec, IFileIdentifier* pFileID, IFolderIdentifier** ppOutPath) = 0;
			virtual VCOMError VCOM_CALLTYPE FindFileInPluginFolder(const TXString& fileName, IFileIdentifier** ppOutFileID) = 0;
			virtual VCOMError VCOM_CALLTYPE GetFilePathInStandardFolder(EFolderSpecifier folderSpec, const TXString& fileName, IFileIdentifier** ppOutFileID) = 0;
			virtual	VCOMError VCOM_CALLTYPE GetFilePathInUserRoot(EFolderSpecifier folderClass, const TXString& fileName, IFileIdentifier** ppOutFileID) = 0;
			virtual VCOMError VCOM_CALLTYPE GetFolder(EFolderSpecifier inWhichFolder, IFolderIdentifier** ppOutPath, bool bCreateIfMissing = false) = 0;
			virtual VCOMError VCOM_CALLTYPE GetNamedSubFolder(IFolderIdentifier* pParentFolderID, const TXString& partialPath, IFolderIdentifier** ppOutPath) = 0;
		};

		// ----------------------------------------------------------------------------------------------------
		typedef VCOMPtr<IApplicationFolders>		IApplicationFoldersPtr;
	}
}