LocationProfiles.h 6.6 KB

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