LocationProfiles.h 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. //----------------------------------------------------------------------------
  2. #ifndef LocationProfilesH
  3. #define LocationProfilesH
  4. //----------------------------------------------------------------------------
  5. #include "HistoryComboBox.hpp"
  6. #include <System.Classes.hpp>
  7. #include <Vcl.ComCtrls.hpp>
  8. #include <Vcl.Controls.hpp>
  9. #include <Vcl.ImgList.hpp>
  10. #include <Vcl.StdCtrls.hpp>
  11. #include <ComCtrls.hpp>
  12. #include <ImgList.hpp>
  13. #include "PngImageList.hpp"
  14. #include <Vcl.ExtCtrls.hpp>
  15. #include <Vcl.Imaging.pngimage.hpp>
  16. #include <Vcl.ExtCtrls.hpp>
  17. #include <FileOperationProgress.h>
  18. #include <Terminal.h>
  19. #include <WinInterface.h>
  20. #include <Bookmarks.h>
  21. #include <PasTools.hpp>
  22. #include <GUITools.h>
  23. #include <System.ImageList.hpp>
  24. //----------------------------------------------------------------------------
  25. class TLocationProfilesDialog : public TForm
  26. {
  27. __published:
  28. TButton *OKBtn;
  29. TButton *CancelBtn;
  30. TPageControl *PageControl;
  31. TTreeView *SessionProfilesView;
  32. TButton *AddSessionBookmarkButton;
  33. TButton *RemoveSessionBookmarkButton;
  34. TButton *DownSessionBookmarkButton;
  35. TButton *UpSessionBookmarkButton;
  36. TLabel *LocalDirectoryLabel;
  37. THistoryComboBox *RemoteDirectoryEdit;
  38. TButton *RenameSessionBookmarkButton;
  39. TLabel *RemoteDirectoryLabel;
  40. TButton *SessionBookmarkMoveToButton;
  41. TPngImageList *BookmarkImageList;
  42. THistoryComboBox *LocalDirectoryEdit;
  43. TButton *LocalDirectoryBrowseButton;
  44. TButton *SwitchButton;
  45. TButton *HelpButton;
  46. TTabSheet *SessionProfilesSheet;
  47. TTabSheet *SharedProfilesSheet;
  48. TTreeView *SharedProfilesView;
  49. TButton *AddSharedBookmarkButton;
  50. TButton *RemoveSharedBookmarkButton;
  51. TButton *RenameSharedBookmarkButton;
  52. TButton *SharedBookmarkMoveToButton;
  53. TButton *UpSharedBookmarkButton;
  54. TButton *DownSharedBookmarkButton;
  55. TButton *ShortCutSharedBookmarkButton;
  56. TImage *Image;
  57. TPngImageList *BookmarkImageList120;
  58. TPngImageList *BookmarkImageList144;
  59. TPngImageList *BookmarkImageList192;
  60. void __fastcall ControlChange(TObject *Sender);
  61. void __fastcall AddBookmarkButtonClick(TObject *Sender);
  62. void __fastcall RemoveBookmarkButtonClick(TObject *Sender);
  63. void __fastcall BookmarkButtonClick(TObject *Sender);
  64. void __fastcall ProfilesViewStartDrag(TObject *Sender,
  65. TDragObject *&DragObject);
  66. void __fastcall ProfilesViewDragOver(TObject *Sender, TObject *Source,
  67. int X, int Y, TDragState State, bool &Accept);
  68. void __fastcall ProfilesViewDragDrop(TObject *Sender, TObject *Source,
  69. int X, int Y);
  70. void __fastcall ProfilesViewDblClick(TObject *Sender);
  71. void __fastcall FormShow(TObject *Sender);
  72. void __fastcall ProfilesViewKeyDown(TObject *Sender, WORD &Key,
  73. TShiftState Shift);
  74. void __fastcall DirectoryEditChange(TObject *Sender);
  75. void __fastcall ProfilesViewChange(TObject *Sender, TTreeNode *Node);
  76. void __fastcall BookmarkMoveToButtonClick(TObject *Sender);
  77. void __fastcall RenameBookmarkButtonClick(TObject *Sender);
  78. void __fastcall ProfilesViewGetImageIndex(TObject *Sender,
  79. TTreeNode *Node);
  80. void __fastcall ProfilesViewGetSelectedIndex(TObject *Sender,
  81. TTreeNode *Node);
  82. void __fastcall LocalDirectoryBrowseButtonClick(TObject *Sender);
  83. void __fastcall SwitchButtonClick(TObject *Sender);
  84. void __fastcall HelpButtonClick(TObject *Sender);
  85. void __fastcall ProfilesViewCollapsed(TObject *Sender, TTreeNode *Node);
  86. void __fastcall ProfilesViewExpanded(TObject *Sender, TTreeNode *Node);
  87. void __fastcall ProfilesViewEdited(TObject * Sender, TTreeNode * Node,
  88. UnicodeString & S);
  89. void __fastcall ProfilesViewEditing(TObject * Sender, TTreeNode * Node,
  90. bool & AllowEdit);
  91. void __fastcall ProfilesViewEndDrag(TObject *Sender, TObject *Target,
  92. int X, int Y);
  93. void __fastcall ShortCutBookmarkButtonClick(TObject *Sender);
  94. public:
  95. __fastcall TLocationProfilesDialog(TComponent* AOwner);
  96. __fastcall ~TLocationProfilesDialog();
  97. bool __fastcall Execute();
  98. __property UnicodeString LocalDirectory = { read = GetLocalDirectory, write = SetLocalDirectory };
  99. __property UnicodeString RemoteDirectory = { read = GetRemoteDirectory, write = SetRemoteDirectory };
  100. __property TTerminal * Terminal = { read = FTerminal, write = FTerminal };
  101. __property TOperationSide OperationSide = { read = FOperationSide, write = FOperationSide };
  102. __property TStrings * RemoteDirectories = { read=GetRemoteDirectories, write=SetRemoteDirectories };
  103. __property TStrings * LocalDirectories = { read=GetLocalDirectories, write=SetLocalDirectories };
  104. __property TOpenDirectoryMode Mode = { read = FMode, write = FMode };
  105. protected:
  106. void __fastcall BookmarkMove(TObject * Sender, TTreeNode * Source, TTreeNode * Dest);
  107. void __fastcall UpdateControls();
  108. bool __fastcall AddAsBookmark(TObject * Sender, bool Initial);
  109. virtual void __fastcall UpdateActions();
  110. private:
  111. TOpenDirectoryMode FMode;
  112. TTerminal * FTerminal;
  113. TOperationSide FOperationSide;
  114. TStringList * FSessionFolders;
  115. TStringList * FSharedFolders;
  116. bool FChanging;
  117. TTreeNode * FBookmarkDragSource;
  118. TBookmarkList * FSessionBookmarkList;
  119. TBookmarkList * FSharedBookmarkList;
  120. UnicodeString FLocalDirectory;
  121. UnicodeString FRemoteDirectory;
  122. TTreeViewScrollOnDragOver * FSessionScrollOnDragOver;
  123. TTreeViewScrollOnDragOver * FSharedScrollOnDragOver;
  124. UnicodeString FSessionKey;
  125. bool FBookmarkSelected;
  126. #ifdef _DEBUG
  127. HWND FSessionProfilesViewHandle;
  128. HWND FSharedProfilesViewHandle;
  129. #endif
  130. void __fastcall SetLocalDirectory(UnicodeString value);
  131. UnicodeString __fastcall GetLocalDirectory();
  132. void __fastcall SetRemoteDirectory(UnicodeString value);
  133. UnicodeString __fastcall GetRemoteDirectory();
  134. void __fastcall SetOperationSide(TOperationSide value);
  135. void __fastcall FindProfile();
  136. void __fastcall SetRemoteDirectories(TStrings * value);
  137. TStrings * __fastcall GetRemoteDirectories();
  138. void __fastcall SetLocalDirectories(TStrings * value);
  139. TStrings * __fastcall GetLocalDirectories();
  140. void __fastcall FindProfile(TTreeView * ProfilesView);
  141. void __fastcall UpdateProfilesControls(
  142. TTreeView * ProfilesView,
  143. TButton * AddBookmarkButton, TButton * RemoveBookmarkButton,
  144. TButton * RenameBookmarkButton, TButton * BookmarkMoveToButton,
  145. TButton * ShortCutBookmarkButton,
  146. TButton * UpBookmarkButton, TButton * DownBookmarkButton);
  147. TBookmarkList * GetBookmarkList(TObject * Sender);
  148. TStringList * GetFolders(TObject * Sender);
  149. TTreeView * GetProfilesView(TObject * Sender);
  150. TTreeViewScrollOnDragOver * GetScrollOnDragOver(TObject * Sender);
  151. void __fastcall RenameBookmark(TObject * Sender);
  152. void __fastcall RemoveBookmark(TObject * Sender);
  153. TTabSheet * GetProfilesSheet();
  154. void __fastcall LoadBookmarks(
  155. TTreeView * ProfilesView, TStringList * Folders, TBookmarkList * BookmarkList,
  156. TBookmarkList * Source);
  157. bool __fastcall ProfileMatch(TTreeNode * Node);
  158. UnicodeString __fastcall BookmarkText(TBookmark * Bookmark);
  159. INTERFACE_HOOK
  160. };
  161. //----------------------------------------------------------------------------
  162. #endif