CustomDirView.hpp 29 KB

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