CustomDirView.hpp 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521
  1. // Borland C++ Builder
  2. // Copyright (c) 1995, 2002 by Borland Software Corporation
  3. // All rights reserved
  4. // (DO NOT EDIT: machine generated header) 'CustomDirView.pas' rev: 6.00
  5. #ifndef CustomDirViewHPP
  6. #define CustomDirViewHPP
  7. #pragma delphiheader begin
  8. #pragma option push -w-
  9. #pragma option push -Vx
  10. #include <NortonLikeListView.hpp> // Pascal unit
  11. #include <SysUtils.hpp> // Pascal unit
  12. #include <CustomPathComboBox.hpp> // Pascal unit
  13. #include <AssociatedStatusBar.hpp> // Pascal unit
  14. #include <PathLabel.hpp> // Pascal unit
  15. #include <IEListView.hpp> // Pascal unit
  16. #include <IEDriveInfo.hpp> // Pascal unit
  17. #include <DragDropFilesEx.hpp> // Pascal unit
  18. #include <DragDrop.hpp> // Pascal unit
  19. #include <BaseUtils.hpp> // Pascal unit
  20. #include <PIDL.hpp> // Pascal unit
  21. #include <Menus.hpp> // Pascal unit
  22. #include <ImgList.hpp> // Pascal unit
  23. #include <ExtCtrls.hpp> // Pascal unit
  24. #include <CommCtrl.hpp> // Pascal unit
  25. #include <ActiveX.hpp> // Pascal unit
  26. #include <Dialogs.hpp> // Pascal unit
  27. #include <ShlObj.hpp> // Pascal unit
  28. #include <ComObj.hpp> // Pascal unit
  29. #include <ShellAPI.hpp> // Pascal unit
  30. #include <ComCtrls.hpp> // Pascal unit
  31. #include <Forms.hpp> // Pascal unit
  32. #include <Controls.hpp> // Pascal unit
  33. #include <Graphics.hpp> // Pascal unit
  34. #include <Classes.hpp> // Pascal unit
  35. #include <Messages.hpp> // Pascal unit
  36. #include <Windows.hpp> // Pascal unit
  37. #include <SysInit.hpp> // Pascal unit
  38. #include <System.hpp> // Pascal unit
  39. //-- user supplied -----------------------------------------------------------
  40. namespace Customdirview
  41. {
  42. //-- type declarations -------------------------------------------------------
  43. #pragma option push -b-
  44. enum TDDError { DDCreateShortCutError, DDPathNotFoundError };
  45. #pragma option pop
  46. typedef void __fastcall (__closure *TDDOnDragEnter)(System::TObject* Sender, _di_IDataObject DataObj, int grfKeyState, const Types::TPoint &Point, int &dwEffect, bool &Accept);
  47. typedef void __fastcall (__closure *TDDOnDragLeave)(System::TObject* Sender);
  48. typedef void __fastcall (__closure *TDDOnDragOver)(System::TObject* Sender, int grfKeyState, const Types::TPoint &Point, int &dwEffect);
  49. typedef void __fastcall (__closure *TDDOnDrop)(System::TObject* Sender, _di_IDataObject DataObj, int grfKeyState, const Types::TPoint &Point, int &dwEffect);
  50. typedef void __fastcall (__closure *TDDOnQueryContinueDrag)(System::TObject* Sender, BOOL FEscapePressed, int grfKeyState, HRESULT &Result);
  51. typedef void __fastcall (__closure *TDDOnGiveFeedback)(System::TObject* Sender, int dwEffect, HRESULT &Result);
  52. typedef void __fastcall (__closure *TDDOnDragDetect)(System::TObject* Sender, int grfKeyState, const Types::TPoint &DetectStart, const Types::TPoint &Point, Dragdrop::TDragDetectStatus DragStatus);
  53. typedef void __fastcall (__closure *TDDOnCreateDragFileList)(System::TObject* Sender, Dragdropfilesex::TFileList* FileList, bool &Created);
  54. typedef void __fastcall (__closure *TDDOnCreateDataObject)(System::TObject* Sender, Dragdrop::TDataObject* &DataObject);
  55. typedef void __fastcall (__closure *TDDOnTargetHasDropHandler)(System::TObject* Sender, Comctrls::TListItem* Item, int &Effect, bool &DropHandler);
  56. typedef void __fastcall (__closure *TOnProcessDropped)(System::TObject* Sender, int grfKeyState, const Types::TPoint &Point, int &dwEffect);
  57. typedef void __fastcall (__closure *TDDErrorEvent)(System::TObject* Sender, TDDError ErrorNo);
  58. typedef void __fastcall (__closure *TDDExecutedEvent)(System::TObject* Sender, int dwEffect);
  59. typedef void __fastcall (__closure *TDDFileOperationEvent)(System::TObject* Sender, int dwEffect, AnsiString SourcePath, AnsiString TargetPath, bool &DoOperation);
  60. typedef void __fastcall (__closure *TDDFileOperationExecutedEvent)(System::TObject* Sender, int dwEffect, AnsiString SourcePath, AnsiString TargetPath);
  61. typedef void __fastcall (__closure *TDirViewExecFileEvent)(System::TObject* Sender, Comctrls::TListItem* Item, bool &AllowExec);
  62. typedef void __fastcall (__closure *TRenameEvent)(System::TObject* Sender, Comctrls::TListItem* Item, AnsiString NewName);
  63. #pragma option push -b-
  64. enum TSelAttr { selDontCare, selYes, selNo };
  65. #pragma option pop
  66. struct TFileFilter
  67. {
  68. AnsiString Masks;
  69. Word IncludeAttr;
  70. Word ExcludeAttr;
  71. bool Directories;
  72. __int64 FileSizeFrom;
  73. __int64 FileSizeTo;
  74. System::TDateTime ModificationFrom;
  75. System::TDateTime ModificationTo;
  76. } ;
  77. #pragma option push -b-
  78. enum THistoryDirection { hdBack, hdForward };
  79. #pragma option pop
  80. class DELPHICLASS TCustomDirView;
  81. typedef void __fastcall (__closure *THistoryChangeEvent)(TCustomDirView* Sender);
  82. typedef void __fastcall (__closure *TDVGetFilterEvent)(TCustomDirView* Sender, bool Select, TFileFilter &Filter);
  83. #pragma option push -b-
  84. enum TCompareCriteria { ccTime, ccSize };
  85. #pragma option pop
  86. typedef Set<TCompareCriteria, ccTime, ccSize> TCompareCriterias;
  87. class DELPHICLASS TCustomizableDragDropFilesEx;
  88. class PASCALIMPLEMENTATION TCustomizableDragDropFilesEx : public Dragdropfilesex::TDragDropFilesEx
  89. {
  90. typedef Dragdropfilesex::TDragDropFilesEx inherited;
  91. public:
  92. HIDESBASE Dragdrop::TDragResult __fastcall Execute(Dragdrop::TDataObject* DataObject);
  93. public:
  94. #pragma option push -w-inl
  95. /* TDragDropFilesEx.Create */ inline __fastcall virtual TCustomizableDragDropFilesEx(Classes::TComponent* AOwner) : Dragdropfilesex::TDragDropFilesEx(AOwner) { }
  96. #pragma option pop
  97. #pragma option push -w-inl
  98. /* TDragDropFilesEx.Destroy */ inline __fastcall virtual ~TCustomizableDragDropFilesEx(void) { }
  99. #pragma option pop
  100. };
  101. class PASCALIMPLEMENTATION TCustomDirView : public Ielistview::TIEListView
  102. {
  103. typedef Ielistview::TIEListView inherited;
  104. private:
  105. bool FAddParentDir;
  106. bool FDimmHiddenFiles;
  107. bool FShowDirectories;
  108. bool FDirsOnTop;
  109. bool FShowSubDirSize;
  110. bool FSortByExtension;
  111. bool FWantUseDragImages;
  112. bool FCanUseDragImages;
  113. TCustomizableDragDropFilesEx* FDragDropFilesEx;
  114. AnsiString FInvalidNameChars;
  115. bool FSingleClickToExec;
  116. bool FUseSystemContextMenu;
  117. TDVGetFilterEvent FOnGetSelectFilter;
  118. Classes::TNotifyEvent FOnStartLoading;
  119. Classes::TNotifyEvent FOnLoaded;
  120. Classes::TNotifyEvent FOnDirUpdated;
  121. _SYSTEMTIME FReloadTime;
  122. char FDragDrive;
  123. bool FExeDrag;
  124. bool FDDLinkOnExeDrag;
  125. TDDOnDragEnter FOnDDDragEnter;
  126. TDDOnDragLeave FOnDDDragLeave;
  127. TDDOnDragOver FOnDDDragOver;
  128. TDDOnDrop FOnDDDrop;
  129. TDDOnQueryContinueDrag FOnDDQueryContinueDrag;
  130. TDDOnGiveFeedback FOnDDGiveFeedback;
  131. TDDOnDragDetect FOnDDDragDetect;
  132. TDDOnCreateDragFileList FOnDDCreateDragFileList;
  133. TOnProcessDropped FOnDDProcessDropped;
  134. TDDErrorEvent FOnDDError;
  135. TDDExecutedEvent FOnDDExecuted;
  136. TDDFileOperationEvent FOnDDFileOperation;
  137. TDDFileOperationExecutedEvent FOnDDFileOperationExecuted;
  138. Classes::TNotifyEvent FOnDDEnd;
  139. TDDOnCreateDataObject FOnDDCreateDataObject;
  140. TDDOnTargetHasDropHandler FOnDDTargetHasDropHandler;
  141. TDirViewExecFileEvent FOnExecFile;
  142. bool FForceRename;
  143. Dragdrop::TDragResult FLastDDResult;
  144. AnsiString FLastRenameName;
  145. _FILETIME FLastVScrollTime;
  146. int FVScrollCount;
  147. bool FContextMenu;
  148. bool FDragEnabled;
  149. #pragma pack(push, 1)
  150. Types::TPoint FDragPos;
  151. #pragma pack(pop)
  152. #pragma pack(push, 1)
  153. Types::TPoint FStartPos;
  154. #pragma pack(pop)
  155. bool FDDOwnerIsSource;
  156. bool FAbortLoading;
  157. Comctrls::TAnimate* FAnimation;
  158. int FBackCount;
  159. Menus::TPopupMenu* FBackMenu;
  160. bool FDontRecordPath;
  161. bool FDragOnDriveIsMove;
  162. bool FNotifyEnabled;
  163. _FILETIME FDragStartTime;
  164. Menus::TPopupMenu* FForwardMenu;
  165. Classes::TStrings* FHistoryPaths;
  166. Controls::TImageList* FImageList16;
  167. Controls::TImageList* FImageList32;
  168. bool FLoadAnimation;
  169. int FMaxHistoryCount;
  170. int FMaxHistoryMenuLen;
  171. int FMaxHistoryMenuWidth;
  172. bool FNeverPainted;
  173. Custompathcombobox::TCustomPathComboBox* FPathComboBox;
  174. Pathlabel::TCustomPathLabel* FPathLabel;
  175. Associatedstatusbar::TAssociatedStatusBar* FStatusBar;
  176. TRenameEvent FOnBeginRename;
  177. TRenameEvent FOnEndRename;
  178. THistoryChangeEvent FOnHistoryChange;
  179. bool FShowHiddenFiles;
  180. bool FSavedSelection;
  181. AnsiString FSavedSelectionFile;
  182. AnsiString FSavedSelectionLastFile;
  183. bool FPendingFocusSomething;
  184. HIDESBASE MESSAGE void __fastcall CNNotify(Messages::TWMNotify &Message);
  185. HIDESBASE MESSAGE void __fastcall WMLButtonDblClk(Messages::TWMMouse &Message);
  186. HIDESBASE MESSAGE void __fastcall WMLButtonUp(Messages::TWMMouse &Message);
  187. HIDESBASE MESSAGE void __fastcall WMContextMenu(Messages::TWMContextMenu &Message);
  188. HIDESBASE MESSAGE void __fastcall WMLButtonDown(Messages::TWMMouse &Message);
  189. HIDESBASE MESSAGE void __fastcall WMRButtonDown(Messages::TWMMouse &Message);
  190. void __fastcall DumbCustomDrawItem(Comctrls::TCustomListView* Sender, Comctrls::TListItem* Item, Comctrls::TCustomDrawState State, bool &DefaultDraw);
  191. void __fastcall DumbCustomDrawSubItem(Comctrls::TCustomListView* Sender, Comctrls::TListItem* Item, int SubItem, Comctrls::TCustomDrawState State, bool &DefaultDraw);
  192. Menus::TPopupMenu* __fastcall GetBackMenu(void);
  193. __int64 __fastcall GetFilesMarkedSize(void);
  194. int __fastcall GetForwardCount(void);
  195. Menus::TPopupMenu* __fastcall GetForwardMenu(void);
  196. AnsiString __fastcall GetHistoryPath(int Index);
  197. bool __fastcall GetTargetPopupMenu(void);
  198. bool __fastcall GetUseDragImages(void);
  199. void __fastcall SetMaxHistoryCount(int Value);
  200. void __fastcall SetMaxHistoryMenuLen(int Value);
  201. void __fastcall SetMaxHistoryMenuWidth(int Value);
  202. void __fastcall SetPathComboBox(Custompathcombobox::TCustomPathComboBox* Value);
  203. void __fastcall SetPathLabel(Pathlabel::TCustomPathLabel* Value);
  204. void __fastcall SetStatusBar(Associatedstatusbar::TAssociatedStatusBar* Value);
  205. void __fastcall SetTargetPopupMenu(bool Value);
  206. HIDESBASE MESSAGE void __fastcall WMPaint(Messages::TWMPaint &Message);
  207. MESSAGE void __fastcall WMUserRename(Messages::TMessage &Message);
  208. protected:
  209. bool FCaseSensitive;
  210. bool FDirty;
  211. __int64 FFilesSize;
  212. __int64 FFilesSelSize;
  213. bool FHasParentDir;
  214. bool FIsRecycleBin;
  215. AnsiString FLastPath;
  216. bool FLoadEnabled;
  217. bool FLoading;
  218. AnsiString FSelectFile;
  219. bool FWatchForChanges;
  220. virtual void __fastcall AddToDragFileList(Dragdropfilesex::TFileList* FileList, Comctrls::TListItem* Item);
  221. DYNAMIC bool __fastcall CanEdit(Comctrls::TListItem* Item);
  222. virtual bool __fastcall CanChangeSelection(Comctrls::TListItem* Item, bool Select);
  223. virtual void __fastcall ClearItems(void);
  224. virtual bool __fastcall GetDirOK(void) = 0 ;
  225. virtual void __fastcall DDDragDetect(int grfKeyState, const Types::TPoint &DetectStart, const Types::TPoint &Point, Dragdrop::TDragDetectStatus DragStatus);
  226. void __fastcall DDDragEnter(_di_IDataObject DataObj, int grfKeyState, const Types::TPoint &Point, int &dwEffect, bool &Accept);
  227. void __fastcall DDDragLeave(void);
  228. void __fastcall DDDragOver(int grfKeyState, const Types::TPoint &Point, int &dwEffect);
  229. virtual void __fastcall DDChooseEffect(int grfKeyState, int &dwEffect) = 0 ;
  230. void __fastcall DDDrop(_di_IDataObject DataObj, int grfKeyState, const Types::TPoint &Point, int &dwEffect);
  231. virtual void __fastcall DDDropHandlerSucceeded(System::TObject* Sender, int grfKeyState, const Types::TPoint &Point, int dwEffect);
  232. virtual void __fastcall DDGiveFeedback(int dwEffect, HRESULT &Result);
  233. virtual void __fastcall DDMenuDone(System::TObject* Sender, HMENU AMenu);
  234. void __fastcall DDProcessDropped(System::TObject* Sender, int grfKeyState, const Types::TPoint &Point, int dwEffect);
  235. virtual void __fastcall DDQueryContinueDrag(BOOL FEscapePressed, int grfKeyState, HRESULT &Result);
  236. virtual void __fastcall DDSpecifyDropTarget(System::TObject* Sender, bool DragDropHandler, const Types::TPoint &Point, Shlobj::PItemIDList &pidlFQ, AnsiString &Filename);
  237. virtual void __fastcall GetDisplayInfo(Comctrls::TListItem* ListItem, tagLVITEMA &DispInfo);
  238. virtual Dragdrop::TDropEffectSet __fastcall GetDragSourceEffects(void);
  239. virtual AnsiString __fastcall GetPathName(void) = 0 ;
  240. virtual int __fastcall GetFilesCount(void);
  241. DYNAMIC void __fastcall ColClick(Comctrls::TListColumn* Column);
  242. virtual void __fastcall CreateWnd(void);
  243. Classes::TStrings* __fastcall CustomCreateFileList(bool Focused, bool OnlyFocused, bool FullPath, Classes::TStrings* FileList = (Classes::TStrings*)(0x0));
  244. virtual bool __fastcall CustomDrawItem(Comctrls::TListItem* Item, Comctrls::TCustomDrawState State, Comctrls::TCustomDrawStage Stage);
  245. virtual bool __fastcall CustomDrawSubItem(Comctrls::TListItem* Item, int SubItem, Comctrls::TCustomDrawState State, Comctrls::TCustomDrawStage Stage);
  246. void __fastcall CustomSortItems(void * SortProc);
  247. DYNAMIC void __fastcall Delete(Comctrls::TListItem* Item);
  248. virtual void __fastcall DisplayContextMenu(const Types::TPoint &Where) = 0 ;
  249. void __fastcall DoAnimation(bool Start);
  250. DYNAMIC void __fastcall DoHistoryChange(void);
  251. virtual bool __fastcall DragCompleteFileList(void);
  252. DYNAMIC void __fastcall Edit(const tagLVITEMA &HItem);
  253. virtual void __fastcall EndSelectionUpdate(void);
  254. virtual void __fastcall Execute(Comctrls::TListItem* Item);
  255. virtual void __fastcall ExecuteFile(Comctrls::TListItem* Item) = 0 ;
  256. virtual void __fastcall FocusSomething(void);
  257. virtual bool __fastcall GetIsRoot(void) = 0 ;
  258. virtual void __fastcall IconsSetImageList(void);
  259. virtual bool __fastcall ItemCanDrag(Comctrls::TListItem* Item);
  260. virtual Graphics::TColor __fastcall ItemColor(Comctrls::TListItem* Item);
  261. virtual AnsiString __fastcall ItemDragFileName(Comctrls::TListItem* Item);
  262. virtual __int64 __fastcall ItemFileSize(Comctrls::TListItem* Item) = 0 ;
  263. virtual int __fastcall ItemImageIndex(Comctrls::TListItem* Item, bool Cache) = 0 ;
  264. virtual System::TDateTime __fastcall ItemFileTime(Comctrls::TListItem* Item) = 0 ;
  265. virtual bool __fastcall ItemIsRecycleBin(Comctrls::TListItem* Item);
  266. DYNAMIC void __fastcall KeyDown(Word &Key, Classes::TShiftState Shift);
  267. DYNAMIC void __fastcall KeyPress(char &Key);
  268. DYNAMIC void __fastcall KeyUp(Word &Key, Classes::TShiftState Shift);
  269. virtual void __fastcall LoadFiles(void) = 0 ;
  270. virtual void __fastcall PerformItemDragDropOperation(Comctrls::TListItem* Item, int Effect) = 0 ;
  271. void __fastcall ProcessChangedFiles(TCustomDirView* DirView, Classes::TStrings* FileList, bool FullPath, bool ExistingOnly, TCompareCriterias Criterias);
  272. void __fastcall ReloadForce(bool CacheIcons);
  273. void __fastcall RetryRename(AnsiString NewName);
  274. void __fastcall SelectFiles(const TFileFilter &Filter, bool Select);
  275. virtual void __fastcall SetAddParentDir(bool Value);
  276. virtual void __fastcall SetDimmHiddenFiles(bool Value);
  277. virtual void __fastcall SetShowDirectories(bool Value);
  278. void __fastcall SetDirsOnTop(bool Value);
  279. virtual void __fastcall SetItemImageIndex(Comctrls::TListItem* Item, int Index) = 0 ;
  280. virtual void __fastcall SetLoadEnabled(bool Enabled);
  281. virtual void __fastcall SetMultiSelect(bool Value);
  282. virtual AnsiString __fastcall GetPath(void) = 0 ;
  283. virtual bool __fastcall GetValid(void);
  284. void __fastcall HistoryItemClick(System::TObject* Sender);
  285. virtual void __fastcall InternalEdit(const tagLVITEMA &HItem) = 0 ;
  286. virtual bool __fastcall ItemIsFile(Comctrls::TListItem* Item) = 0 ;
  287. virtual bool __fastcall ItemMatchesFilter(Comctrls::TListItem* Item, const TFileFilter &Filter) = 0 ;
  288. virtual Word __fastcall ItemOverlayIndexes(Comctrls::TListItem* Item);
  289. void __fastcall LimitHistorySize(void);
  290. virtual AnsiString __fastcall MinimizePath(AnsiString Path, int Len) = 0 ;
  291. virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation);
  292. void __fastcall PathChanged(void);
  293. virtual void __fastcall SetPath(AnsiString Value) = 0 ;
  294. void __fastcall SetSortByExtension(bool Value);
  295. virtual void __fastcall SetShowHiddenFiles(bool Value);
  296. virtual void __fastcall SetShowSubDirSize(bool Value);
  297. virtual void __fastcall SetViewStyle(Comctrls::TViewStyle Value);
  298. virtual void __fastcall SetWatchForChanges(bool Value);
  299. virtual bool __fastcall TargetHasDropHandler(Comctrls::TListItem* Item, int Effect);
  300. void __fastcall UpdateHistoryMenu(THistoryDirection Direction);
  301. DYNAMIC void __fastcall UpdatePathComboBox(void);
  302. DYNAMIC void __fastcall UpdatePathLabel(void);
  303. DYNAMIC void __fastcall UpdateStatusBar(void);
  304. virtual void __fastcall WndProc(Messages::TMessage &Message);
  305. __property Controls::TImageList* ImageList16 = {read=FImageList16};
  306. __property Controls::TImageList* ImageList32 = {read=FImageList32};
  307. public:
  308. bool __fastcall AnyFileSelected(bool OnlyFocused);
  309. __fastcall virtual TCustomDirView(Classes::TComponent* AOwner);
  310. virtual void __fastcall CreateDirectory(AnsiString DirName) = 0 ;
  311. __fastcall virtual ~TCustomDirView(void);
  312. virtual void __fastcall Load(void);
  313. virtual void __fastcall Reload(bool CacheIcons);
  314. Classes::TStrings* __fastcall CreateFocusedFileList(bool FullPath, Classes::TStrings* FileList = (Classes::TStrings*)(0x0));
  315. Classes::TStrings* __fastcall CreateFileList(bool Focused, bool FullPath, Classes::TStrings* FileList = (Classes::TStrings*)(0x0));
  316. virtual bool __fastcall DoSelectByMask(bool Select);
  317. virtual void __fastcall ExecuteHomeDirectory(void) = 0 ;
  318. virtual void __fastcall ExecuteParentDirectory(void) = 0 ;
  319. virtual void __fastcall ExecuteRootDirectory(void) = 0 ;
  320. void __fastcall ExecuteCurrentFile(void);
  321. Comctrls::TListItem* __fastcall FindFileItem(AnsiString FileName);
  322. void __fastcall HistoryGo(int Index);
  323. virtual bool __fastcall ItemIsDirectory(Comctrls::TListItem* Item) = 0 ;
  324. virtual bool __fastcall ItemIsParentDirectory(Comctrls::TListItem* Item) = 0 ;
  325. virtual AnsiString __fastcall ItemFullFileName(Comctrls::TListItem* Item) = 0 ;
  326. virtual AnsiString __fastcall ItemFileName(Comctrls::TListItem* Item) = 0 ;
  327. virtual void __fastcall ReloadDirectory(void) = 0 ;
  328. virtual void __fastcall DisplayPropertiesMenu(void) = 0 ;
  329. Classes::TStrings* __fastcall CreateChangedFileList(TCustomDirView* DirView, bool FullPath, bool ExistingOnly, TCompareCriterias Criterias);
  330. virtual void __fastcall CompareFiles(TCustomDirView* DirView, bool ExistingOnly, TCompareCriterias Criterias);
  331. void __fastcall SaveSelection(void);
  332. void __fastcall RestoreSelection(void);
  333. void __fastcall DiscardSavedSelection(void);
  334. __property bool AddParentDir = {read=FAddParentDir, write=SetAddParentDir, default=0};
  335. __property bool DimmHiddenFiles = {read=FDimmHiddenFiles, write=SetDimmHiddenFiles, default=1};
  336. __property bool ShowDirectories = {read=FShowDirectories, write=SetShowDirectories, default=1};
  337. __property bool DirsOnTop = {read=FDirsOnTop, write=SetDirsOnTop, default=1};
  338. __property TCustomizableDragDropFilesEx* DragDropFilesEx = {read=FDragDropFilesEx};
  339. __property bool ShowSubDirSize = {read=FShowSubDirSize, write=SetShowSubDirSize, default=0};
  340. __property bool SortByExtension = {read=FSortByExtension, write=SetSortByExtension, default=0};
  341. __property bool WantUseDragImages = {read=FWantUseDragImages, write=FWantUseDragImages, default=1};
  342. __property bool UseDragImages = {read=GetUseDragImages, stored=false, nodefault};
  343. __property FullDrag = {default=1};
  344. __property bool TargetPopupMenu = {read=GetTargetPopupMenu, write=SetTargetPopupMenu, default=1};
  345. __property bool DDOwnerIsSource = {read=FDDOwnerIsSource, nodefault};
  346. __property __int64 FilesSize = {read=FFilesSize};
  347. __property __int64 FilesSelSize = {read=FFilesSelSize};
  348. __property int FilesCount = {read=GetFilesCount, nodefault};
  349. __property __int64 FilesMarkedSize = {read=GetFilesMarkedSize};
  350. __property bool HasParentDir = {read=FHasParentDir, nodefault};
  351. __property AnsiString Path = {read=GetPath, write=SetPath};
  352. __property AnsiString PathName = {read=GetPathName};
  353. __property _SYSTEMTIME ReloadTime = {read=FReloadTime};
  354. __property bool SingleClickToExec = {read=FSingleClickToExec, write=FSingleClickToExec, default=0};
  355. __property bool UseSystemContextMenu = {read=FUseSystemContextMenu, write=FUseSystemContextMenu, default=1};
  356. __property bool Loading = {read=FLoading, nodefault};
  357. __property bool AbortLoading = {read=FAbortLoading, write=FAbortLoading, stored=false, nodefault};
  358. __property int BackCount = {read=FBackCount, nodefault};
  359. __property Menus::TPopupMenu* BackMenu = {read=GetBackMenu};
  360. __property bool LoadAnimation = {read=FLoadAnimation, write=FLoadAnimation, default=1};
  361. __property bool LoadEnabled = {read=FLoadEnabled, write=SetLoadEnabled, default=1};
  362. __property bool Dirty = {read=FDirty, nodefault};
  363. __property bool DirOK = {read=GetDirOK, nodefault};
  364. __property AnsiString LastPath = {read=FLastPath};
  365. __property bool IsRecycleBin = {read=FIsRecycleBin, nodefault};
  366. __property bool DDLinkOnExeDrag = {read=FDDLinkOnExeDrag, write=FDDLinkOnExeDrag, default=0};
  367. __property char DragDrive = {read=FDragDrive, nodefault};
  368. __property bool DragOnDriveIsMove = {read=FDragOnDriveIsMove, write=FDragOnDriveIsMove, nodefault};
  369. __property Dragdrop::TDropEffectSet DragSourceEffects = {read=GetDragSourceEffects, nodefault};
  370. __property bool ExeDrag = {read=FExeDrag, nodefault};
  371. __property int ForwardCount = {read=GetForwardCount, nodefault};
  372. __property Menus::TPopupMenu* ForwardMenu = {read=GetForwardMenu};
  373. __property AnsiString HistoryPath[int Index] = {read=GetHistoryPath};
  374. __property bool IsRoot = {read=GetIsRoot, nodefault};
  375. __property Dragdrop::TDragResult LastDDResult = {read=FLastDDResult, nodefault};
  376. __property SmallImages ;
  377. __property LargeImages ;
  378. __property int MaxHistoryCount = {read=FMaxHistoryCount, write=SetMaxHistoryCount, default=200};
  379. __property int MaxHistoryMenuLen = {read=FMaxHistoryMenuLen, write=SetMaxHistoryMenuLen, default=9};
  380. __property int MaxHistoryMenuWidth = {read=FMaxHistoryMenuWidth, write=SetMaxHistoryMenuWidth, default=300};
  381. __property OnContextPopup ;
  382. __property TRenameEvent OnBeginRename = {read=FOnBeginRename, write=FOnBeginRename};
  383. __property TRenameEvent OnEndRename = {read=FOnEndRename, write=FOnEndRename};
  384. __property TDVGetFilterEvent OnGetSelectFilter = {read=FOnGetSelectFilter, write=FOnGetSelectFilter};
  385. __property Classes::TNotifyEvent OnStartLoading = {read=FOnStartLoading, write=FOnStartLoading};
  386. __property Classes::TNotifyEvent OnLoaded = {read=FOnLoaded, write=FOnLoaded};
  387. __property Classes::TNotifyEvent OnDirUpdated = {read=FOnDirUpdated, write=FOnDirUpdated};
  388. __property TDDOnDragEnter OnDDDragEnter = {read=FOnDDDragEnter, write=FOnDDDragEnter};
  389. __property TDDOnDragLeave OnDDDragLeave = {read=FOnDDDragLeave, write=FOnDDDragLeave};
  390. __property TDDOnDragOver OnDDDragOver = {read=FOnDDDragOver, write=FOnDDDragOver};
  391. __property TDDOnDrop OnDDDrop = {read=FOnDDDrop, write=FOnDDDrop};
  392. __property TDDOnQueryContinueDrag OnDDQueryContinueDrag = {read=FOnDDQueryContinueDrag, write=FOnDDQueryContinueDrag};
  393. __property TDDOnGiveFeedback OnDDGiveFeedback = {read=FOnDDGiveFeedback, write=FOnDDGiveFeedback};
  394. __property TDDOnDragDetect OnDDDragDetect = {read=FOnDDDragDetect, write=FOnDDDragDetect};
  395. __property TDDOnCreateDragFileList OnDDCreateDragFileList = {read=FOnDDCreateDragFileList, write=FOnDDCreateDragFileList};
  396. __property Classes::TNotifyEvent OnDDEnd = {read=FOnDDEnd, write=FOnDDEnd};
  397. __property TDDOnCreateDataObject OnDDCreateDataObject = {read=FOnDDCreateDataObject, write=FOnDDCreateDataObject};
  398. __property TDDOnTargetHasDropHandler OnDDTargetHasDropHandler = {read=FOnDDTargetHasDropHandler, write=FOnDDTargetHasDropHandler};
  399. __property TOnProcessDropped OnDDProcessDropped = {read=FOnDDProcessDropped, write=FOnDDProcessDropped};
  400. __property TDDErrorEvent OnDDError = {read=FOnDDError, write=FOnDDError};
  401. __property TDDExecutedEvent OnDDExecuted = {read=FOnDDExecuted, write=FOnDDExecuted};
  402. __property TDDFileOperationEvent OnDDFileOperation = {read=FOnDDFileOperation, write=FOnDDFileOperation};
  403. __property TDDFileOperationExecutedEvent OnDDFileOperationExecuted = {read=FOnDDFileOperationExecuted, write=FOnDDFileOperationExecuted};
  404. __property TDirViewExecFileEvent OnExecFile = {read=FOnExecFile, write=FOnExecFile};
  405. __property THistoryChangeEvent OnHistoryChange = {read=FOnHistoryChange, write=FOnHistoryChange};
  406. __property Custompathcombobox::TCustomPathComboBox* PathComboBox = {read=FPathComboBox, write=SetPathComboBox};
  407. __property Pathlabel::TCustomPathLabel* PathLabel = {read=FPathLabel, write=SetPathLabel};
  408. __property bool ShowHiddenFiles = {read=FShowHiddenFiles, write=SetShowHiddenFiles, default=1};
  409. __property Associatedstatusbar::TAssociatedStatusBar* StatusBar = {read=FStatusBar, write=SetStatusBar};
  410. __property bool WatchForChanges = {read=FWatchForChanges, write=SetWatchForChanges, default=0};
  411. public:
  412. #pragma option push -w-inl
  413. /* TWinControl.CreateParented */ inline __fastcall TCustomDirView(HWND ParentWindow) : Ielistview::TIEListView(ParentWindow) { }
  414. #pragma option pop
  415. };
  416. //-- var, const, procedure ---------------------------------------------------
  417. static const Shortint clDefaultItemColor = 0xffffffe1;
  418. static const Word WM_USER_RENAME = 0x439;
  419. static const Shortint oiNoOverlay = 0x0;
  420. static const Shortint oiDirUp = 0x1;
  421. static const Shortint oiLink = 0x2;
  422. static const Shortint oiBrokenLink = 0x4;
  423. static const Shortint oiShared = 0x8;
  424. static const Word DefaultHistoryMenuWidth = 0x12c;
  425. static const Shortint DefaultHistoryMenuLen = 0x9;
  426. static const Byte DefaultHistoryCount = 0xc8;
  427. static const Shortint DDMaxSlowCount = 0x3;
  428. static const int DDVScrollDelay = 0x1e8480;
  429. static const int DDHScrollDelay = 0x1e8480;
  430. static const int DDDragStartDelay = 0x7a120;
  431. static const Shortint DirAttrMask = 0x16;
  432. extern PACKAGE System::ResourceString _SErrorOpenFile;
  433. #define Customdirview_SErrorOpenFile System::LoadResourceString(&Customdirview::_SErrorOpenFile)
  434. extern PACKAGE System::ResourceString _SErrorRenameFile;
  435. #define Customdirview_SErrorRenameFile System::LoadResourceString(&Customdirview::_SErrorRenameFile)
  436. extern PACKAGE System::ResourceString _SErrorRenameFileExists;
  437. #define Customdirview_SErrorRenameFileExists System::LoadResourceString(&Customdirview::_SErrorRenameFileExists)
  438. extern PACKAGE System::ResourceString _SErrorInvalidName;
  439. #define Customdirview_SErrorInvalidName System::LoadResourceString(&Customdirview::_SErrorInvalidName)
  440. extern PACKAGE System::ResourceString _STextFileExt;
  441. #define Customdirview_STextFileExt System::LoadResourceString(&Customdirview::_STextFileExt)
  442. extern PACKAGE System::ResourceString _STextFiles;
  443. #define Customdirview_STextFiles System::LoadResourceString(&Customdirview::_STextFiles)
  444. extern PACKAGE System::ResourceString _STextDirectories;
  445. #define Customdirview_STextDirectories System::LoadResourceString(&Customdirview::_STextDirectories)
  446. extern PACKAGE System::ResourceString _SParentDir;
  447. #define Customdirview_SParentDir System::LoadResourceString(&Customdirview::_SParentDir)
  448. extern PACKAGE System::ResourceString _SIconUpdateThreadTerminationError;
  449. #define Customdirview_SIconUpdateThreadTerminationError System::LoadResourceString(&Customdirview::_SIconUpdateThreadTerminationError)
  450. extern PACKAGE System::ResourceString _SDragDropError;
  451. #define Customdirview_SDragDropError System::LoadResourceString(&Customdirview::_SDragDropError)
  452. extern PACKAGE System::ResourceString _SDirNotExists;
  453. #define Customdirview_SDirNotExists System::LoadResourceString(&Customdirview::_SDirNotExists)
  454. extern PACKAGE int StdDirIcon;
  455. extern PACKAGE int StdDirSelIcon;
  456. extern PACKAGE System::TObject* DropSourceControl;
  457. extern PACKAGE int UnknownFileIcon;
  458. extern PACKAGE bool HasExtendedCOMCTL32;
  459. extern PACKAGE AnsiString StdDirTypeName;
  460. extern PACKAGE int DefaultExeIcon;
  461. extern PACKAGE AnsiString UserDocumentDirectory;
  462. extern PACKAGE bool __fastcall IsExecutable(AnsiString FileName);
  463. extern PACKAGE AnsiString __fastcall GetNextMask(AnsiString &Mask);
  464. extern PACKAGE bool __fastcall FileNameMatchesMasks(AnsiString FileName, AnsiString Masks);
  465. extern PACKAGE void __fastcall DefaultFileFilter(TFileFilter &Filter);
  466. extern PACKAGE AnsiString __fastcall ResolveFileShortCut(AnsiString SourceFile, bool ShowDialog = false);
  467. extern PACKAGE bool __fastcall CreateFileShortCut(AnsiString SourceFile, AnsiString Target, AnsiString DisplayName, bool UpdateIfExists = false);
  468. extern PACKAGE int __fastcall GetIconIndex(const AnsiString AFile, unsigned Attrs, unsigned Flags);
  469. extern PACKAGE _SHFILEINFOA __fastcall GetshFileInfo(const AnsiString AFile, unsigned Attrs, unsigned Flags);
  470. extern PACKAGE bool __fastcall GetShellDisplayName(const _di_IShellFolder ShellFolder, Shlobj::PItemIDList IDList, unsigned Flags, AnsiString &Name);
  471. } /* namespace Customdirview */
  472. using namespace Customdirview;
  473. #pragma option pop // -w-
  474. #pragma option pop // -Vx
  475. #pragma delphiheader end.
  476. //-- end unit ----------------------------------------------------------------
  477. #endif // CustomDirView