LocationProfiles.h 7.1 KB

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