LocationProfiles.h 6.6 KB

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