// CodeGear C++Builder
// Copyright (c) 1995, 2015 by Embarcadero Technologies, Inc.
// All rights reserved

// (DO NOT EDIT: machine generated header) 'iexWindowsFunctions.pas' rev: 30.00 (Windows)

#ifndef IexwindowsfunctionsHPP
#define IexwindowsfunctionsHPP

#pragma delphiheader begin
#pragma option push
#pragma option -w-      // All warnings off
#pragma option -Vx      // Zero-length empty class member 
#pragma pack(push,8)
#include <System.hpp>
#include <SysInit.hpp>
#include <Winapi.Windows.hpp>
#include <Vcl.Forms.hpp>
#include <Winapi.ActiveX.hpp>
#include <System.Win.ComObj.hpp>
#include <Vcl.Controls.hpp>
#include <System.Classes.hpp>
#include <hyiedefs.hpp>
#include <Winapi.Messages.hpp>

//-- user supplied -----------------------------------------------------------

namespace Iexwindowsfunctions
{
//-- forward type declarations -----------------------------------------------
class DELPHICLASS TIEFileDragDrop;
class DELPHICLASS TIEFolderWatch;
//-- type declarations -------------------------------------------------------
typedef void __fastcall (__closure *TIEFileDropEvent)(System::TObject* Sender, System::Classes::TStrings* ssFiles, int dwEffect);

class PASCALIMPLEMENTATION TIEFileDragDrop : public System::TInterfacedObject
{
	typedef System::TInterfacedObject inherited;
	
private:
	Vcl::Controls::TWinControl* fControl;
	HWND fControlHandle;
	bool fDroppingActive;
	TIEFileDropEvent fOnFileDrop;
	Hyiedefs::TIEFileDragDropActions fDropActions;
	void __fastcall GetFileNames(const _di_IDataObject dataObj, System::Classes::TStrings* Dest);
	_di_IDataObject __fastcall GetDataObject(System::Classes::TStrings* ssFiles);
	int __fastcall GetDragEffect(int KeyState);
	void __fastcall SetDroppingActive(const bool Value);
	HRESULT __stdcall DragEnter(const _di_IDataObject dataObj, int grfKeyState, const System::Types::TPoint pt, int &dwEffect);
	HRESULT __stdcall DragOver(int grfKeyState, const System::Types::TPoint pt, int &dwEffect);
	HRESULT __stdcall DragLeave(void);
	HRESULT __stdcall Drop(const _di_IDataObject dataObj, int grfKeyState, const System::Types::TPoint pt, int &dwEffect);
	HRESULT __stdcall QueryContinueDrag(System::LongBool fEscapePressed, int grfKeyState);
	HRESULT __stdcall GiveFeedback(int dwEffect);
	
public:
	__property bool ActivateDropping = {read=fDroppingActive, write=SetDroppingActive, nodefault};
	__property Hyiedefs::TIEFileDragDropActions DropActions = {read=fDropActions, write=fDropActions, nodefault};
	__fastcall TIEFileDragDrop(Vcl::Controls::TWinControl* Control, TIEFileDropEvent OnFileDrop);
	__fastcall virtual ~TIEFileDragDrop(void);
	void __fastcall InitiateDragging(System::Classes::TStrings* ssFilenames, Hyiedefs::TIEFileDragDropActions DragActions);
private:
	void *__IDropSource;	// IDropSource 
	void *__IDropTarget;	// IDropTarget 
	
public:
	#if defined(MANAGED_INTERFACE_OPERATORS)
	// {00000121-0000-0000-C000-000000000046}
	operator _di_IDropSource()
	{
		_di_IDropSource intf;
		this->GetInterface(intf);
		return intf;
	}
	#else
	operator IDropSource*(void) { return (IDropSource*)&__IDropSource; }
	#endif
	#if defined(MANAGED_INTERFACE_OPERATORS)
	// {00000122-0000-0000-C000-000000000046}
	operator _di_IDropTarget()
	{
		_di_IDropTarget intf;
		this->GetInterface(intf);
		return intf;
	}
	#else
	operator IDropTarget*(void) { return (IDropTarget*)&__IDropTarget; }
	#endif
	
};


enum DECLSPEC_DENUM TWatchOption : unsigned char { woFileName, woFolderName, woAttributes, woSize, woLastWrite, woLastAccess, woCreation, woSecurity };

typedef System::Set<TWatchOption, TWatchOption::woFileName, TWatchOption::woSecurity> TWatchOptions;

enum DECLSPEC_DENUM TWatchAction : unsigned char { waAdded, waRemoved, waModified, waRenamedOld, waRenamedNew };

typedef System::Set<TWatchAction, TWatchAction::waAdded, TWatchAction::waRenamedNew> TWatchActions;

typedef void __fastcall (__closure *TFileChangeNotifyEvent)(System::TObject* const Sender, const TWatchAction Action, const System::UnicodeString FileName);

typedef void __fastcall (__closure *TOnError)(System::TObject* const Sender, const int ErrorCode, const System::UnicodeString ErrorMessage);

class PASCALIMPLEMENTATION TIEFolderWatch : public System::TObject
{
	typedef System::TObject inherited;
	
private:
	TWatchOptions FWatchOptions;
	TWatchActions FWatchActions;
	bool FWatchSubTree;
	System::Classes::TThread* FWatchThread;
	int FBufferSize;
	HWND FWndHandle;
	System::UnicodeString FPath;
	NativeUInt FAbortEvent;
	TOnError FOnError;
	System::Classes::TNotifyEvent FOnChange;
	TFileChangeNotifyEvent FOnNotify;
	void __fastcall WatchWndProc(Winapi::Messages::TMessage &Msg);
	void __fastcall SetPath(const System::UnicodeString Value);
	void __fastcall SetWatchOptions(const TWatchOptions Value);
	void __fastcall SetWatchActions(const TWatchActions Value);
	void __fastcall SetWatchSubTree(const bool Value);
	void __fastcall DeallocateHWnd(HWND Wnd);
	int __fastcall MakeFilter(void);
	
protected:
	virtual void __fastcall Change(void);
	void __fastcall AllocWatchThread(void);
	void __fastcall ReleaseWatchThread(void);
	void __fastcall RestartWatchThread(void);
	virtual void __fastcall Notify(const int Action, const System::UnicodeString FileName);
	
public:
	__fastcall TIEFolderWatch(void);
	__fastcall virtual ~TIEFolderWatch(void);
	void __fastcall Start(void);
	void __fastcall Stop(void);
	bool __fastcall Running(void);
	__property bool WatchSubTree = {read=FWatchSubTree, write=SetWatchSubTree, nodefault};
	__property TWatchOptions WatchOptions = {read=FWatchOptions, write=SetWatchOptions, nodefault};
	__property TWatchActions WatchActions = {read=FWatchActions, write=SetWatchActions, nodefault};
	__property int BufferSize = {read=FBufferSize, write=FBufferSize, nodefault};
	__property System::UnicodeString Path = {read=FPath, write=SetPath};
	__property TFileChangeNotifyEvent OnNotify = {read=FOnNotify, write=FOnNotify};
	__property System::Classes::TNotifyEvent OnChange = {read=FOnChange, write=FOnChange};
	__property TOnError OnError = {read=FOnError, write=FOnError};
};


//-- var, const, procedure ---------------------------------------------------
static const System::Word cShutdownTimeout = System::Word(0xbb8);
static const System::Int8 cFileWaitTimeout = System::Int8(0x0);
extern DELPHI_PACKAGE void __fastcall WindowsLaunchFile(NativeUInt Handle, const System::UnicodeString sFilename);
extern DELPHI_PACKAGE System::UnicodeString __fastcall WindowsProgramFilesFolder(void);
extern DELPHI_PACKAGE System::UnicodeString __fastcall GetWindowsSpecialFolder(const int iCSIDL);
extern DELPHI_PACKAGE void __fastcall WindowsAddToRecentDocs(const System::UnicodeString Filename);
extern DELPHI_PACKAGE bool __fastcall WindowsCopy(HWND Handle, System::UnicodeString sFromFilename, System::UnicodeString sDestFolder, bool bRenameOnCollision, bool bShowConfirmation, bool bShowProgress, bool bVerboseErrors = true)/* overload */;
extern DELPHI_PACKAGE bool __fastcall WindowsCopy(HWND Handle, System::Classes::TStrings* ssFiles, const System::UnicodeString sDestFolder, bool bRenameOnCollision, bool bShowConfirmation, bool bShowProgress, bool bVerboseErrors = true)/* overload */;
extern DELPHI_PACKAGE bool __fastcall WindowsMove(HWND Handle, System::UnicodeString sFromFilename, System::UnicodeString sDestFolder, bool bRenameOnCollision, bool bShowConfirmation, bool bShowProgress, bool bVerboseErrors = true)/* overload */;
extern DELPHI_PACKAGE bool __fastcall WindowsMove(HWND Handle, System::Classes::TStrings* ssFiles, const System::UnicodeString sDestFolder, bool bRenameOnCollision, bool bShowConfirmation, bool bShowProgress, bool bVerboseErrors = true)/* overload */;
extern DELPHI_PACKAGE bool __fastcall WindowsErase(HWND Handle, System::UnicodeString sFilename, bool bSendToRecycleBin, bool bShowConfirmation, bool bShowProgress, bool bVerboseErrors = true)/* overload */;
extern DELPHI_PACKAGE bool __fastcall WindowsErase(HWND Handle, System::Classes::TStrings* ssFiles, bool bSendToRecycleBin, bool bShowConfirmation, bool bShowProgress, bool bVerboseErrors = true)/* overload */;
extern DELPHI_PACKAGE bool __fastcall WindowsRename(HWND Handle, const System::UnicodeString sFilename, const System::UnicodeString sNewName, bool bRenameOnCollision, bool bShowConfirmation, bool bVerboseErrors = true, bool bCheckForOverwrite = true)/* overload */;
extern DELPHI_PACKAGE System::UnicodeString __fastcall WindowsLocalAppDataFolder(void);
extern DELPHI_PACKAGE System::UnicodeString __fastcall WindowsMyDocumentsFolder(void);
extern DELPHI_PACKAGE System::UnicodeString __fastcall WindowsMyPicturesFolder(void);
extern DELPHI_PACKAGE System::UnicodeString __fastcall WindowsMyMusicFolder(void);
extern DELPHI_PACKAGE System::UnicodeString __fastcall WindowsMyVideosFolder(void);
extern DELPHI_PACKAGE System::UnicodeString __fastcall WindowsDesktopFolder(void);
extern DELPHI_PACKAGE bool __fastcall WindowsSelectDirectory(const System::UnicodeString Caption, System::UnicodeString &Directory, Vcl::Controls::TWinControl* Parent = (Vcl::Controls::TWinControl*)(0x0), bool bAllowNewFolder = true);
extern DELPHI_PACKAGE bool __fastcall CutFilesToClipboard(HWND Handle, System::Classes::TStrings* Filenames);
extern DELPHI_PACKAGE bool __fastcall CopyFilesToClipboard(HWND Handle, System::Classes::TStrings* Filenames);
extern DELPHI_PACKAGE bool __fastcall PasteFilesFromClipboard(HWND Handle, System::Classes::TStrings* ssFilenames, /* out */ bool &bMoveFiles);
extern DELPHI_PACKAGE bool __fastcall CanPasteFilesFromClipboard(HWND Handle);
extern DELPHI_PACKAGE void __fastcall PopupSystemMenu(HWND Handle, System::Classes::TStrings* ssFileList, int x, int y);
extern DELPHI_PACKAGE void __fastcall WaitForFileReady(const System::UnicodeString FileName, const unsigned Timeout = (unsigned)(0x0));
}	/* namespace Iexwindowsfunctions */
#if !defined(DELPHIHEADER_NO_IMPLICIT_NAMESPACE_USE) && !defined(NO_USING_NAMESPACE_IEXWINDOWSFUNCTIONS)
using namespace Iexwindowsfunctions;
#endif
#pragma pack(pop)
#pragma option pop

#pragma delphiheader end.
//-- end unit ----------------------------------------------------------------
#endif	// IexwindowsfunctionsHPP
