CustomDirView.hpp 31 KB

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