123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685 |
- //---------------------------------------------------------------------------
- #ifndef WinInterfaceH
- #define WinInterfaceH
- //---------------------------------------------------------------------------
- #include <Classes.hpp>
- #include <Buttons.hpp>
- #include <Interface.h>
- #include <WinConfiguration.h>
- #include <Terminal.h>
- #include <SynchronizeController.h>
- #include <Script.h>
- #include "HistoryComboBox.hpp"
- #ifdef LOCALINTERFACE
- #include <LocalInterface.h>
- #endif
- #define SITE_ICON 1
- #define SITE_FOLDER_ICON 2
- #define WORKSPACE_ICON 3
- class TStoredSessionList;
- class TConfiguration;
- class TTerminal;
- const int mpNeverAskAgainCheck = 0x01;
- const int mpAllowContinueOnError = 0x02;
- #define UPLOAD_IF_ANY_SWITCH L"UploadIfAny"
- #define UPLOAD_SWITCH L"Upload"
- #define SYNCHRONIZE_SWITCH L"Synchronize"
- #define KEEP_UP_TO_DATE_SWITCH L"KeepUpToDate"
- #define JUMPLIST_SWITCH L"JumpList"
- #define DESKTOP_SWITCH L"Desktop"
- #define SEND_TO_HOOK_SWITCH L"SendToHook"
- #define UNSAFE_SWITCH L"Unsafe"
- #define DEFAULTS_SWITCH L"Defaults"
- #define NEWINSTANCE_SWICH L"NewInstance"
- #define KEYGEN_SWITCH L"KeyGen"
- #define KEYGEN_OUTPUT_SWITCH L"Output"
- #define KEYGEN_COMMENT_SWITCH L"Comment"
- #define KEYGEN_CHANGE_PASSPHRASE_SWITCH L"ChangePassphrase"
- #define KEYGEN_CERTIFICATE_SWITCH L"Certificate"
- #define LOG_SWITCH L"Log"
- #define LOGSIZE_SWITCH L"LogSize"
- #define LOGSIZE_SEPARATOR L"*"
- #define INI_SWITCH L"Ini"
- #define RAW_CONFIG_SWITCH L"RawConfig"
- #define FINGERPRINTSCAN_SWITCH L"FingerprintScan"
- #define DUMPCALLSTACK_SWITCH L"DumpCallstack"
- #define INFO_SWITCH L"Info"
- #define COMREGISTRATION_SWITCH L"ComRegistration"
- #define EXPLORE_SWITCH L"Explore"
- #define EXPLORE_OLD_SWITCH L"Browse"
- #define NOINTERACTIVEINPUT_SWITCH L"NoInteractiveInput"
- #define STDOUT_SWITCH L"StdOut"
- #define STDIN_SWITCH L"StdIn"
- #define STDINOUT_BINARY_VALUE L"binary"
- #define STDINOUT_CHUNKED_VALUE L"chunked"
- #define COPYID_SWITCH L"CopyId"
- #define IDENTITY_SWITCH L"Identity"
- #define DUMPCALLSTACK_EVENT L"WinSCPCallstack%d"
- struct TMessageParams
- {
- TMessageParams(unsigned int AParams = 0);
- TMessageParams(const TQueryParams * AParams);
- const TQueryButtonAlias * Aliases;
- unsigned int AliasesCount;
- unsigned int Params;
- unsigned int Timer;
- TQueryParamsTimerEvent TimerEvent;
- UnicodeString TimerMessage;
- unsigned int TimerAnswers;
- TQueryType TimerQueryType;
- unsigned int Timeout;
- unsigned int TimeoutAnswer;
- unsigned int TimeoutResponse;
- UnicodeString NeverAskAgainTitle;
- unsigned int NeverAskAgainAnswer;
- bool NeverAskAgainCheckedInitially;
- bool AllowHelp;
- UnicodeString ImageName;
- UnicodeString MoreMessagesUrl;
- TSize MoreMessagesSize;
- UnicodeString CustomCaption;
- private:
- inline void Reset();
- };
- class TCustomScpExplorerForm;
- TCustomScpExplorerForm * __fastcall CreateScpExplorer();
- UnicodeString GetThemeName(bool Dark);
- void __fastcall ConfigureInterface();
- void __fastcall DoProductLicense();
- extern const UnicodeString AppName;
- void __fastcall SetOnForeground(bool OnForeground);
- void __fastcall FlashOnBackground();
- void __fastcall TerminateApplication();
- void __fastcall ShowExtendedExceptionEx(TTerminal * Terminal, Exception * E);
- void __fastcall FormHelp(TCustomForm * Form);
- void __fastcall SearchHelp(const UnicodeString & Message);
- void __fastcall MessageWithNoHelp(const UnicodeString & Message);
- class TProgramParams;
- bool __fastcall CheckSafe(TProgramParams * Params);
- void __fastcall CheckLogParam(TProgramParams * Params);
- bool __fastcall CheckXmlLogParam(TProgramParams * Params);
- UnicodeString __fastcall GetToolbarKey(const UnicodeString & ToolbarName);
- UnicodeString __fastcall GetToolbarsLayoutStr(TControl * OwnerControl);
- void __fastcall LoadToolbarsLayoutStr(TControl * OwnerControl, UnicodeString LayoutStr);
- namespace Tb2item { class TTBCustomItem; }
- namespace Tbx { class TTBXSeparatorItem; }
- Tbx::TTBXSeparatorItem * __fastcall AddMenuSeparator(Tb2item::TTBCustomItem * Menu);
- void __fastcall AddMenuLabel(Tb2item::TTBCustomItem * Menu, const UnicodeString & Label);
- void __fastcall ClickToolbarItem(Tb2item::TTBCustomItem * Item, bool PositionCursor);
- void InitiateDialogTimeout(TForm * Dialog, unsigned int Timeout, TButton * Button, unsigned int Answer = 0);
- // windows\WinHelp.cpp
- void __fastcall InitializeWinHelp();
- void __fastcall FinalizeWinHelp();
- // windows\WinInterface.cpp
- unsigned int __fastcall MessageDialog(const UnicodeString Msg, TQueryType Type,
- unsigned int Answers, UnicodeString HelpKeyword = HELP_NONE, const TMessageParams * Params = NULL);
- unsigned int __fastcall MessageDialog(int Ident, TQueryType Type,
- unsigned int Answers, UnicodeString HelpKeyword = HELP_NONE, const TMessageParams * Params = NULL);
- unsigned int __fastcall SimpleErrorDialog(const UnicodeString Msg, const UnicodeString MoreMessages = L"");
- unsigned int __fastcall MoreMessageDialog(const UnicodeString Message,
- TStrings * MoreMessages, TQueryType Type, unsigned int Answers,
- UnicodeString HelpKeyword, const TMessageParams * Params = NULL);
- unsigned int __fastcall ExceptionMessageDialog(Exception * E, TQueryType Type,
- const UnicodeString MessageFormat = L"", unsigned int Answers = qaOK,
- UnicodeString HelpKeyword = HELP_NONE, const TMessageParams * Params = NULL);
- unsigned int __fastcall FatalExceptionMessageDialog(
- Exception * E, TQueryType Type, const UnicodeString & MessageFormat, unsigned int Answers,
- const UnicodeString & HelpKeyword, const TMessageParams * Params);
- // forms\Custom.cpp
- TSessionData * __fastcall DoSaveSession(TSessionData * SessionData,
- TSessionData * OriginalSession, bool ForceDialog,
- TStrings * AdditionalFolders);
- void __fastcall SessionNameValidate(const UnicodeString & Text,
- const UnicodeString & OriginalName);
- bool __fastcall DoSaveWorkspaceDialog(UnicodeString & WorkspaceName,
- bool * SavePasswords, bool NotRecommendedSavingPasswords,
- bool & CreateShortcut, bool & EnableAutoSave);
- class TShortCuts;
- bool __fastcall DoShortCutDialog(TShortCut & ShortCut,
- const TShortCuts & ShortCuts, UnicodeString HelpKeyword);
- bool __fastcall DoCustomCommandOptionsDialog(
- const TCustomCommandType * Command, TStrings * CustomCommandOptions, TShortCut * ShortCut, unsigned int Flags,
- TCustomCommand * CustomCommandForOptions, const UnicodeString & Site, const TShortCuts * ShortCuts);
- void __fastcall DoUsageStatisticsDialog();
- void __fastcall DoSiteRawDialog(TSessionData * Data);
- bool DoSshHostCADialog(bool Add, TSshHostCA & SshHostCA);
- bool DoTagDialog(bool Add, TStrings * Tags, UnicodeString & Key, UnicodeString & Value);
- // windows\UserInterface.cpp
- bool __fastcall DoMasterPasswordDialog();
- bool __fastcall DoChangeMasterPasswordDialog(UnicodeString & NewPassword);
- // windows\WinMain.cpp
- int __fastcall Execute();
- void __fastcall GetLoginData(UnicodeString SessionName, TOptions * Options,
- TObjectList * DataList, UnicodeString & DownloadFile, bool NeedSession, TForm * LinkedForm, int Flags = 0);
- int GetCommandLineParseUrlFlags(TProgramParams * Params);
- // forms\InputDlg.cpp
- struct TInputDialogData
- {
- TCustomEdit * Edit;
- };
- typedef void __fastcall (__closure *TInputDialogInitialize)
- (TObject * Sender, TInputDialogData * Data);
- bool __fastcall InputDialog(const UnicodeString ACaption,
- const UnicodeString APrompt, UnicodeString & Value, UnicodeString HelpKeyword = HELP_NONE,
- TStrings * History = NULL, bool PathInput = false,
- TInputDialogInitialize OnInitialize = NULL, bool Echo = true, int Width = 305);
- // forms\About.cpp
- struct TRegistration
- {
- bool Registered;
- UnicodeString Subject;
- int Licenses;
- UnicodeString ProductId;
- bool NeverExpires;
- TDateTime Expiration;
- bool EduLicense;
- TNotifyEvent OnRegistrationLink;
- };
- void __fastcall DoAboutDialog(TConfiguration * Configuration,
- bool AllowLicense, TRegistration * Registration);
- void __fastcall DoAboutDialog(TConfiguration *Configuration);
- // forms\Cleanup.cpp
- bool __fastcall DoCleanupDialog();
- void __fastcall DoCleanupDialogIfAnyDataAndWanted();
- // forms\Console.cpp
- void __fastcall DoConsoleDialog(TTerminal * Terminal,
- const UnicodeString Command = L"", const TStrings * Log = NULL);
- // forms\Copy.cpp
- const int coTemp = 0x001;
- const int coDisableQueue = 0x002;
- const int coDoNotShowAgain = 0x020;
- const int coAllowRemoteTransfer = 0x100;
- const int coShortCutHint = 0x800;
- const int coAllFiles = 0x1000;
- const int coExplore = 0x2000;
- const int cooDoNotShowAgain = 0x01;
- const int cooRemoteTransfer = 0x02;
- const int cooSaveSettings = 0x04;
- const int cooExplore = 0x08;
- bool __fastcall DoCopyDialog(
- bool ToRemote, bool Move, TStrings * FileList, UnicodeString & TargetDirectory,
- TGUICopyParamType * Params, int Options, int CopyParamAttrs,
- TSessionData * SessionData, int * OutputOptions, int AutoSubmit);
- bool CopyDialogValidateLocalDirectory(const UnicodeString & Directory, THistoryComboBox * DirectoryEdit);
- bool CopyDialogValidateFileMask(
- const UnicodeString & FileMask, THistoryComboBox * DirectoryEdit, bool MultipleFiles, bool RemotePaths);
- // forms\CopyLocal.cpp
- const int cloShortCutHint = 0x01;
- const int cloMultipleFiles = 0x02;
- const int clooDoNotShowAgain = 0x01;
- bool DoCopyLocalDialog(bool Move, int Options, UnicodeString & TargetDirectory, UnicodeString & FileMask, int & OutputOptions);
- // forms\CreateDirectory.cpp
- bool __fastcall DoCreateDirectoryDialog(UnicodeString & Directory,
- TRemoteProperties * Properties, int AllowedChanges, bool & SaveSettings);
- // forms\ImportSessions.cpp
- bool __fastcall DoImportSessionsDialog(TList * Imported);
- // forms\License.cpp
- enum TLicense { lcNoLicense = -1, lcWinScp, lcExpat };
- void __fastcall DoLicenseDialog(TLicense License);
- bool __fastcall DoLoginDialog(TList * DataList, TForm * LinkedForm);
- // forms\SiteAdvanced.cpp
- bool __fastcall DoSiteAdvancedDialog(TSessionData * SessionData);
- // forms\OpenDirectory.cpp
- enum TOpenDirectoryMode { odBrowse, odAddBookmark };
- bool __fastcall DoOpenDirectoryDialog(TOpenDirectoryMode Mode, TOperationSide Side,
- UnicodeString & Directory, TStrings * Directories, TTerminal * Terminal,
- bool AllowSwitch);
- // forms\LocatinoProfiles.cpp
- bool __fastcall LocationProfilesDialog(TOpenDirectoryMode Mode,
- TOperationSide Side, UnicodeString & LocalDirectory, UnicodeString & RemoteDirectory,
- TStrings * LocalDirectories, TStrings * RemoteDirectories, TTerminal * Terminal);
- // forms\Preferences.cpp
- enum TPreferencesMode { pmDefault, pmEditor, pmCustomCommands,
- pmQueue, pmLogging, pmUpdates, pmPresets, pmEditors, pmCommander,
- pmEditorInternal, pmFileColors };
- struct TCopyParamRuleData;
- struct TPreferencesDialogData
- {
- TCopyParamRuleData * CopyParamRuleData;
- };
- bool __fastcall DoPreferencesDialog(TPreferencesMode APreferencesMode,
- TPreferencesDialogData * DialogData = NULL);
- // forms\CustomCommand.cpp
- class TCustomCommandList;
- class TCustomCommandType;
- class TShortCuts;
- enum TCustomCommandsMode { ccmAdd, ccmEdit, ccmAdHoc };
- const int ccoDisableRemote = 0x01;
- const int ccoDisableRemoteFiles = 0x02;
- typedef void __fastcall (__closure *TCustomCommandValidate)
- (const TCustomCommandType & Command);
- bool __fastcall DoCustomCommandDialog(TCustomCommandType & Command,
- const TCustomCommandList * CustomCommandList,
- TCustomCommandsMode Mode, int Options, TCustomCommandValidate OnValidate,
- const TShortCuts * ShortCuts);
- // forms\CopyParamPreset.cpp
- class TCopyParamList;
- enum TCopyParamPresetMode { cpmAdd, cpmAddCurrent, cpmEdit, cpmDuplicate };
- bool __fastcall DoCopyParamPresetDialog(TCopyParamList * CopyParamList,
- int & Index, TCopyParamPresetMode Mode, TCopyParamRuleData * CurrentRuleData,
- const TCopyParamType & DefaultCopyParams);
- // forms\CopyParamCsutom.cpp
- bool __fastcall DoCopyParamCustomDialog(TCopyParamType & CopyParam,
- int CopyParamAttrs);
- // forms\Properties.cpp
- class TRemoteProperties;
- class TRemoteTokenList;
- struct TCalculateSizeStats;
- const int cpMode = 0x01;
- const int cpOwner = 0x02;
- const int cpGroup = 0x04;
- const int cpAcl = 0x08;
- const int poUserGroupByID = 0x01;
- const int poTags = 0x02;
- typedef void __fastcall (__closure *TCalculateSizeEvent)
- (TStrings * FileList, __int64 & Size, TCalculateSizeStats & Stats,
- bool & Close);
- typedef void __fastcall (__closure *TCalculatedChecksumCallbackEvent)(
- const UnicodeString & FileName, const UnicodeString & Alg, const UnicodeString & Hash);
- typedef void __fastcall (__closure *TCalculateChecksumEvent)
- (const UnicodeString & Alg, TStrings * FileList,
- TCalculatedChecksumCallbackEvent OnCalculatedChecksum, bool & Close);
- bool __fastcall DoPropertiesDialog(TStrings * FileList,
- const UnicodeString Directory, const TRemoteTokenList * GroupList,
- const TRemoteTokenList * UserList, TStrings * ChecksumAlgs,
- TRemoteProperties * Properties,
- int AllowedChanges, int Options, TCalculateSizeEvent OnCalculateSize,
- TCalculateChecksumEvent OnCalculateChecksum);
- typedef bool (__closure * TDirectoryExistsEvent)(void * Session, const UnicodeString & Directory);
- bool __fastcall DoRemoteMoveDialog(
- bool Multi, UnicodeString & Target, UnicodeString & FileMask, TDirectoryExistsEvent OnDirectoryExists);
- enum TDirectRemoteCopy { drcDisallow, drcAllow, drcConfirmCommandSession, drcConfirmCommandSessionDirs };
- bool __fastcall DoRemoteCopyDialog(
- TStrings * Sessions, TStrings * Directories,
- TDirectRemoteCopy AllowDirectCopy, bool Multi, void *& Session, UnicodeString & Target, UnicodeString & FileMask,
- bool & DirectCopy, void * CurrentSession, TDirectoryExistsEvent OnDirectoryExists,
- bool TargetConfirmed);
- // forms\SelectMask.cpp
- bool __fastcall DoSelectMaskDialog(TControl * Parent, bool Select, TFileFilter & Filter);
- bool __fastcall DoFilterMaskDialog(TControl * Parent, UnicodeString & Mask);
- bool __fastcall DoFileColorDialog(TFileColorData & FileColorData);
- // forms\EditMask.cpp
- bool __fastcall DoEditMaskDialog(TFileMasks & Mask);
- // forms\Synchronize.cpp
- const int soDoNotUsePresets = 0x01;
- const int soNoMinimize = 0x02;
- const int soAllowSelectedOnly = 0x04;
- typedef void __fastcall (__closure *TGetSynchronizeOptionsEvent)
- (int Params, TSynchronizeOptions & Options);
- typedef void __fastcall (__closure *TSynchronizeSessionLog)
- (const UnicodeString & Message);
- typedef void __fastcall (__closure *TFeedSynchronizeError)
- (const UnicodeString & Message, TStrings * MoreMessages, TQueryType Type,
- const UnicodeString & HelpKeyword);
- typedef void __fastcall (__closure *TSynchronizeInNewWindow)
- (const TSynchronizeParamType & Params, const TCopyParamType * CopyParams);
- bool __fastcall DoSynchronizeDialog(TSynchronizeParamType & Params,
- const TCopyParamType * CopyParams, TSynchronizeStartStopEvent OnStartStop,
- bool & SaveSettings, int Options, int CopyParamAttrs,
- TGetSynchronizeOptionsEvent OnGetOptions,
- TSynchronizeSessionLog OnSynchronizeSessionLog,
- TFeedSynchronizeError & OnFeedSynchronizeError,
- TNotifyEvent & OnSynchronizeAbort,
- TSynchronizeInNewWindow OnSynchronizeInNewWindow,
- int AutoSubmit);
- // forms\FullSynchronize.cpp
- struct TUsableCopyParamAttrs;
- enum TSynchronizeMode { smRemote, smLocal, smBoth };
- const int fsoDisableTimestamp = 0x01;
- const int fsoDoNotUsePresets = 0x02;
- const int fsoAllowSelectedOnly = 0x04;
- const int fsoDisableByChecksum = 0x08;
- const int fsoLocalLocal = 0x10;
- typedef void __fastcall (__closure *TFullSynchronizeInNewWindow)
- (TSynchronizeMode Mode, int Params, const UnicodeString & Directory1, const UnicodeString & Directory2,
- const TCopyParamType * CopyParams);
- bool DoFullSynchronizeDialog(
- TSynchronizeMode & Mode, int & Params,
- UnicodeString & Directory1, UnicodeString & Directory2,
- TCopyParamType * CopyParams, bool & SaveSettings, bool & SaveMode,
- int Options, const TUsableCopyParamAttrs & CopyParamAttrs,
- TFullSynchronizeInNewWindow OnFullSynchronizeInNewWindow, int AutoSubmit);
- // forms\SynchronizeChecklist.cpp
- class TSynchronizeChecklist;
- typedef void __fastcall (__closure *TCustomCommandMenuEvent)
- (TAction * Action, TStrings * LocalFileList, TStrings * RemoteFileList);
- typedef void __fastcall (__closure *TFullSynchronizeEvent)(
- void * Token, TProcessedSynchronizationChecklistItem OnProcessedItem,
- TUpdatedSynchronizationChecklistItems OnUpdatedSynchronizationChecklistItems);
- typedef void (__closure *TQueueSynchronizeEvent)(void * Token);
- typedef void __fastcall (__closure *TSynchronizeChecklistCalculateSize)
- (TSynchronizeChecklist * Checklist, const TSynchronizeChecklist::TItemList & Items, void * Token);
- typedef void __fastcall (__closure *TSynchronizeMoveEvent)(
- TOperationSide Side, TStrings * FileList, const UnicodeString & NewFileName, bool TargetIsDirectory, void * Token);
- typedef void __fastcall (__closure *TSynchronizeExploreEvent)(
- TOperationSide Side, TSynchronizeChecklist::TAction Action, const TSynchronizeChecklist::TItem * Item);
- bool DoSynchronizeChecklistDialog(
- TSynchronizeChecklist * Checklist, TSynchronizeMode Mode, int Params,
- const UnicodeString & Directory1, const UnicodeString & Directory2,
- TCustomCommandMenuEvent OnCustomCommandMenu, TFullSynchronizeEvent OnSynchronize,
- TQueueSynchronizeEvent OnQueueSynchronize,
- TSynchronizeChecklistCalculateSize OnSynchronizeChecklistCalculateSize, TSynchronizeMoveEvent OnSynchronizeMove,
- TSynchronizeExploreEvent OnSynchronizeExplore, void * Token);
- // forms\Editor.cpp
- typedef void __fastcall (__closure *TFileClosedEvent)
- (TObject * Sender, bool Forced);
- typedef void __fastcall (__closure *TAnyModifiedEvent)
- (TObject * Sender, bool & Modified);
- TForm * __fastcall ShowEditorForm(const UnicodeString FileName, TForm * ParentForm,
- TNotifyEvent OnFileChanged, TNotifyEvent OnFileReload, TFileClosedEvent OnClose,
- TNotifyEvent OnSaveAll, TAnyModifiedEvent OnAnyModified,
- const UnicodeString Caption, bool StandaloneEditor, TColor Color, int InternalEditorEncodingOverride,
- bool NewFile);
- void __fastcall ReconfigureEditorForm(TForm * Form);
- void __fastcall EditorFormFileUploadComplete(TForm * Form);
- void __fastcall EditorFormFileSave(TForm * Form);
- bool __fastcall IsEditorFormModified(TForm * Form);
- bool __fastcall DoSymlinkDialog(UnicodeString & FileName, UnicodeString & PointTo,
- TOperationSide Side, bool & SymbolicLink, bool Edit, bool AllowSymbolic);
- // forms\FileSystemInfo.cpp
- struct TSpaceAvailable;
- struct TFileSystemInfo;
- struct TSessionInfo;
- typedef void __fastcall (__closure *TGetSpaceAvailable)
- (const UnicodeString Path, TSpaceAvailable & ASpaceAvailable, bool & Close);
- void __fastcall DoFileSystemInfoDialog(
- const TSessionInfo & SessionInfo, const TFileSystemInfo & FileSystemInfo,
- UnicodeString SpaceAvailablePath, TGetSpaceAvailable OnGetSpaceAvailable);
- // forms\MessageDlg.cpp
- TForm * __fastcall CreateMoreMessageDialog(const UnicodeString & Msg,
- TStrings * MoreMessages, TMsgDlgType DlgType, unsigned int Answers,
- const TQueryButtonAlias * Aliases, unsigned int AliasesCount,
- unsigned int TimeoutAnswer, TButton ** TimeoutButton,
- const UnicodeString & ImageName, const UnicodeString & NeverAskAgainCaption,
- const UnicodeString & MoreMessagesUrl, TSize MoreMessagesSize,
- const UnicodeString & CustomCaption);
- TForm * __fastcall CreateMoreMessageDialogEx(const UnicodeString Message, TStrings * MoreMessages,
- TQueryType Type, unsigned int Answers, UnicodeString HelpKeyword, const TMessageParams * Params);
- unsigned int __fastcall ExecuteMessageDialog(TForm * Dialog, unsigned int Answers, const TMessageParams * Params);
- void __fastcall InsertPanelToMessageDialog(TCustomForm * Form, TPanel * Panel);
- int __fastcall GetMessageDialogContentWidth(TCustomForm * Form);
- void __fastcall NavigateMessageDialogToUrl(TCustomForm * Form, const UnicodeString & Url);
- extern const UnicodeString MessagePanelName;
- extern const UnicodeString MainMessageLabelName;
- extern const UnicodeString MessageLabelName;
- extern const UnicodeString YesButtonName;
- extern const UnicodeString OKButtonName;
- // windows\Console.cpp
- enum TConsoleMode
- {
- cmNone, cmScripting, cmHelp, cmBatchSettings, cmKeyGen, cmFingerprintScan, cmDumpCallstack, cmInfo, cmComRegistration,
- cmCopyId,
- };
- int __fastcall Console(TConsoleMode Mode);
- // forms\EditorPreferences.cpp
- enum TEditorPreferencesMode { epmAdd, epmEdit, epmAdHoc };
- struct TEditorData;
- bool __fastcall DoEditorPreferencesDialog(TEditorData * Editor,
- bool & Remember, TEditorPreferencesMode Mode, bool MayRemote);
- // forms\Find.cpp
- typedef void __fastcall (__closure *TFindEvent)
- (TTerminal * Terminal, UnicodeString Directory, const TFileMasks & FileMask,
- TFileFoundEvent OnFileFound, TFindingFileEvent OnFindingFile);
- typedef void __fastcall (__closure *TFocusFileEvent)
- (TTerminal * Terminal, const UnicodeString & Path);
- typedef void __fastcall (__closure *TFileOperationFinishedEvent)
- (TOperationSide Side, const UnicodeString & FileName, bool Success, bool NotCancelled);
- typedef void __fastcall (__closure *TFileListOperationEvent)
- (TTerminal * Terminal, TStrings * FileList, TFileOperationFinishedEvent OnFileOperationFinished);
- void __fastcall ShowFileFindDialog(
- TTerminal * Terminal, UnicodeString Directory, TFindEvent OnFind, TFocusFileEvent OnFocusFile,
- TFileListOperationEvent OnDeleteFiles, TFileListOperationEvent OnDownloadFiles,
- TFileListOperationEvent OnEditFiles);
- void __fastcall HideFileFindDialog();
- // forms\GenerateUrl.cpp
- void __fastcall DoGenerateUrlDialog(TSessionData * Data, TStrings * Paths);
- enum TFilesSelected { fsList, fsAll };
- void __fastcall DoGenerateTransferCodeDialog(
- bool ToRemote, bool Move, int CopyParamAttrs, TSessionData * Data, TFilesSelected FilesSelected,
- TStrings * FileList, const UnicodeString & Path, const TCopyParamType & CopyParam);
- const int cplNone = 0x00;
- const int cplCustomizeDefault = 0x02;
- const int cplSaveSettings = 0x04;
- const int cplGenerateCode = 0x08;
- void __fastcall CopyParamListPopup(TRect R, TPopupMenu * Menu,
- const TCopyParamType & Param, UnicodeString Preset, TNotifyEvent OnClick,
- int Options, int CopyParamAttrs, bool SaveSettings = false);
- int __fastcall CopyParamListPopupClick(TObject * Sender,
- TCopyParamType & Param, UnicodeString & Preset, int CopyParamAttrs,
- bool * SaveSettings = NULL);
- void __fastcall MenuPopup(TPopupMenu * Menu, TRect Rect, TComponent * PopupComponent);
- void __fastcall MenuPopup(TPopupMenu * Menu, TButton * Button);
- void __fastcall MenuPopup(TObject * Sender, const TPoint & MousePos, bool & Handled);
- void __fastcall MenuButton(TButton * Button);
- TComponent * __fastcall GetPopupComponent(TObject * Sender);
- TRect __fastcall CalculatePopupRect(TButton * Button);
- TRect __fastcall CalculatePopupRect(TControl * Control, TPoint MousePos);
- typedef void __fastcall (__closure *TColorChangeEvent)
- (TColor Color);
- TPopupMenu * __fastcall CreateSessionColorPopupMenu(TColor Color,
- TColorChangeEvent OnColorChange);
- void __fastcall CreateSessionColorMenu(TComponent * AOwner, TColor Color,
- TColorChangeEvent OnColorChange);
- void __fastcall CreateEditorBackgroundColorMenu(TComponent * AOwner, TColor Color,
- TColorChangeEvent OnColorChange);
- TPopupMenu * __fastcall CreateColorPopupMenu(TColor Color,
- TColorChangeEvent OnColorChange);
- TColor __fastcall RestoreColor(const UnicodeString & CStr);
- UnicodeString __fastcall StoreColor(TColor Color);
- void __fastcall FixButtonImage(TButton * Button);
- void __fastcall CenterButtonImage(TButton * Button);
- int __fastcall AdjustLocaleFlag(const UnicodeString & S, TLocaleFlagOverride LocaleFlagOverride, bool Recommended, int On, int Off);
- void __fastcall SetGlobalMinimizeHandler(TCustomForm * Form, TNotifyEvent OnMinimize);
- void __fastcall ClearGlobalMinimizeHandler(TNotifyEvent OnMinimize);
- void __fastcall CallGlobalMinimizeHandler(TObject * Sender);
- bool __fastcall IsApplicationMinimized();
- void __fastcall ApplicationMinimize();
- void __fastcall ApplicationRestore();
- bool __fastcall HandleMinimizeSysCommand(TMessage & Message);
- void __fastcall WinInitialize();
- void __fastcall WinFinalize();
- void __fastcall ShowNotification(TTerminal * Terminal, const UnicodeString & Str,
- TQueryType Type);
- void __fastcall InitializeShortCutCombo(TComboBox * ComboBox,
- const TShortCuts & ShortCuts);
- void __fastcall SetShortCutCombo(TComboBox * ComboBox, TShortCut Value);
- TShortCut __fastcall GetShortCutCombo(TComboBox * ComboBox);
- bool __fastcall IsCustomShortCut(TShortCut ShortCut);
- TShortCut __fastcall NormalizeCustomShortCut(TShortCut ShortCut);
- UnicodeString DumpCallstackEventName(int ProcessId);
- UnicodeString DumpCallstackFileName(int ProcessId);
- void CheckConfigurationForceSave();
- void InterfaceStarted();
- void InterfaceStartDontMeasure();
- void AddStartupSequence(const UnicodeString & Tag);
- //---------------------------------------------------------------------------
- #define HIDDEN_WINDOW_NAME L"WinSCPHiddenWindow3"
- //---------------------------------------------------------------------------
- struct TCopyDataMessage
- {
- enum { CommandCanCommandLine, CommandCommandLine, MainWindowCheck, RefreshPanel };
- static const unsigned int Version1 = 1;
- unsigned int Version;
- unsigned int Command;
- union
- {
- wchar_t CommandLine[10240];
- struct
- {
- wchar_t Session[1024];
- wchar_t Path[1024];
- } Refresh;
- } Data;
- TCopyDataMessage()
- {
- Version = TCopyDataMessage::Version1;
- Command = static_cast<unsigned int>(-1);
- }
- };
- //---------------------------------------------------------------------------
- class TWinInteractiveCustomCommand : public TInteractiveCustomCommand
- {
- public:
- TWinInteractiveCustomCommand(
- TCustomCommand * ChildCustomCommand, const UnicodeString CustomCommandName, const UnicodeString HelpKeyword);
- protected:
- virtual void __fastcall Prompt(int Index, const UnicodeString & Prompt,
- UnicodeString & Value);
- virtual void __fastcall Execute(const UnicodeString & Command,
- UnicodeString & Value);
- virtual void __fastcall PatternHint(int Index, const UnicodeString & Pattern);
- private:
- UnicodeString FCustomCommandName;
- std::map<int, size_t> FIndexes;
- TUnicodeStringVector FPrompts;
- TUnicodeStringVector FDefaults;
- TUnicodeStringVector FValues;
- UnicodeString FHelpKeyword;
- };
- //---------------------------------------------------------------------------
- class TTrayIcon
- {
- public:
- __fastcall TTrayIcon(unsigned int Id);
- __fastcall ~TTrayIcon();
- void __fastcall PopupBalloon(UnicodeString Title, const UnicodeString & Str,
- TQueryType QueryType, unsigned int Timeout, TNotifyEvent OnBalloonClick,
- TObject * BalloonUserData);
- void __fastcall CancelBalloon();
- __property bool Visible = { read = FVisible, write = SetVisible };
- __property TNotifyEvent OnClick = { read = FOnClick, write = FOnClick };
- __property UnicodeString Hint = { read = GetHint, write = SetHint };
- protected:
- void __fastcall Update();
- bool __fastcall Notify(unsigned int Message);
- private:
- bool FVisible;
- NOTIFYICONDATA * FTrayIcon;
- TNotifyEvent FOnClick;
- TNotifyEvent FOnBalloonClick;
- TObject * FBalloonUserData;
- UINT FTaskbarCreatedMsg;
- void __fastcall WndProc(TMessage & Message);
- void __fastcall SetVisible(bool value);
- UnicodeString __fastcall GetHint();
- void __fastcall SetHint(UnicodeString value);
- void __fastcall BalloonCancelled();
- };
- //---------------------------------------------------------------------------
- enum TConsoleFlag
- {
- cfLimitedOutput,
- cfLiveOutput,
- cfNoInteractiveInput,
- cfInteractive,
- cfCommandLineOnly,
- cfWantsProgress,
- cfStdOut,
- cfStdIn
- };
- //---------------------------------------------------------------------------
- class TConsole
- {
- public:
- virtual __fastcall ~TConsole() {}
- virtual void __fastcall Print(UnicodeString Str, bool FromBeginning = false, bool Error = false) = 0;
- void __fastcall PrintLine(const UnicodeString & Str = UnicodeString(), bool Error = false);
- virtual bool __fastcall Input(UnicodeString & Str, bool Echo, unsigned int Timer) = 0;
- virtual int __fastcall Choice(
- UnicodeString Options, int Cancel, int Break, int Continue, int Timeouted, bool Timeouting, unsigned int Timer,
- UnicodeString Message) = 0;
- virtual bool __fastcall HasFlag(TConsoleFlag Flag) const = 0;
- virtual bool __fastcall PendingAbort() = 0;
- virtual void __fastcall SetTitle(UnicodeString Title) = 0;
- virtual void __fastcall WaitBeforeExit() = 0;
- virtual void __fastcall Progress(TScriptProgress & Progress) = 0;
- virtual void __fastcall TransferOut(const unsigned char * Data, size_t Len) = 0;
- virtual size_t __fastcall TransferIn(unsigned char * Data, size_t Len) = 0;
- virtual UnicodeString __fastcall FinalLogMessage() = 0;
- };
- //---------------------------------------------------------------------------
- int __fastcall HandleException(TConsole * Console, Exception & E);
- //---------------------------------------------------------------------------
- enum { RESULT_SUCCESS = 0, RESULT_ANY_ERROR = 1 };
- //---------------------------------------------------------------------------
- #endif // WinInterfaceH
|