Interface.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. //---------------------------------------------------------------------------
  2. #ifndef InterfaceH
  3. #define InterfaceH
  4. //---------------------------------------------------------------------------
  5. #include "Configuration.h"
  6. #include "SessionData.h"
  7. #define HELP_NONE ""
  8. //---------------------------------------------------------------------------
  9. TConfiguration * __fastcall CreateConfiguration();
  10. void __fastcall ShowExtendedException(Exception * E);
  11. UnicodeString __fastcall GetCompanyRegistryKey();
  12. UnicodeString __fastcall GetRegistryKey();
  13. void * __fastcall BusyStart();
  14. void __fastcall BusyEnd(void * Token);
  15. UnicodeString __fastcall AppNameString();
  16. UnicodeString __fastcall SshVersionString();
  17. void __fastcall CopyToClipboard(UnicodeString Text);
  18. int __fastcall StartThread(void * SecurityAttributes, unsigned StackSize,
  19. TThreadFunc ThreadFunc, void * Parameter, unsigned CreationFlags,
  20. TThreadID & ThreadId);
  21. // Order of the values also define order of the buttons/answers on the prompts
  22. // MessageDlg relies on these to be <= 0x0000FFFF
  23. const unsigned int qaYes = 0x00000001;
  24. // MessageDlg relies that answer do not conflict with mrCancel (=0x2)
  25. const unsigned int qaNo = 0x00000004;
  26. const unsigned int qaOK = 0x00000008;
  27. const unsigned int qaCancel = 0x00000010;
  28. const unsigned int qaYesToAll = 0x00000020;
  29. const unsigned int qaNoToAll = 0x00000040;
  30. const unsigned int qaAbort = 0x00000080;
  31. const unsigned int qaRetry = 0x00000100;
  32. const unsigned int qaIgnore = 0x00000200;
  33. const unsigned int qaSkip = 0x00000400;
  34. const unsigned int qaAll = 0x00000800;
  35. const unsigned int qaHelp = 0x00001000;
  36. const unsigned int qaReport = 0x00002000;
  37. const unsigned int qaFirst = qaYes;
  38. const unsigned int qaLast = qaReport;
  39. const unsigned int qaNeverAskAgain = 0x00010000;
  40. const int qpFatalAbort = 0x01;
  41. const int qpNeverAskAgainCheck = 0x02;
  42. const int qpAllowContinueOnError = 0x04;
  43. const int qpIgnoreAbort = 0x08;
  44. struct TQueryButtonAlias
  45. {
  46. TQueryButtonAlias();
  47. unsigned int Button;
  48. UnicodeString Alias;
  49. TNotifyEvent OnClick;
  50. int GroupWith;
  51. TShiftState GrouppedShiftState;
  52. };
  53. typedef void __fastcall (__closure *TQueryParamsTimerEvent)(unsigned int & Result);
  54. enum TQueryType { qtConfirmation, qtWarning, qtError, qtInformation };
  55. struct TQueryParams
  56. {
  57. TQueryParams(unsigned int AParams = 0, UnicodeString AHelpKeyword = HELP_NONE);
  58. TQueryParams(const TQueryParams & Source);
  59. void Assign(const TQueryParams & Source);
  60. const TQueryButtonAlias * Aliases;
  61. unsigned int AliasesCount;
  62. unsigned int Params;
  63. unsigned int Timer;
  64. TQueryParamsTimerEvent TimerEvent;
  65. UnicodeString TimerMessage;
  66. unsigned int TimerAnswers;
  67. TQueryType TimerQueryType;
  68. unsigned int Timeout;
  69. unsigned int TimeoutAnswer;
  70. unsigned int NoBatchAnswers;
  71. UnicodeString HelpKeyword;
  72. };
  73. enum TPromptKind
  74. {
  75. pkPrompt,
  76. pkFileName,
  77. pkUserName,
  78. pkPassphrase,
  79. pkTIS,
  80. pkCryptoCard,
  81. pkKeybInteractive,
  82. pkPassword,
  83. pkNewPassword
  84. };
  85. enum TPromptUserParam { pupEcho = 0x01, pupRemember = 0x02 };
  86. bool __fastcall IsAuthenticationPrompt(TPromptKind Kind);
  87. bool __fastcall IsPasswordPrompt(TPromptKind Kind, TStrings * Prompts);
  88. //---------------------------------------------------------------------------
  89. typedef void __fastcall (__closure *TFileFoundEvent)
  90. (TTerminal * Terminal, const UnicodeString FileName, const TRemoteFile * File,
  91. bool & Cancel);
  92. typedef void __fastcall (__closure *TFindingFileEvent)
  93. (TTerminal * Terminal, const UnicodeString Directory, bool & Cancel);
  94. //---------------------------------------------------------------------------
  95. class TOperationVisualizer
  96. {
  97. public:
  98. __fastcall TOperationVisualizer(bool UseBusyCursor = true);
  99. __fastcall ~TOperationVisualizer();
  100. private:
  101. bool FUseBusyCursor;
  102. void * FToken;
  103. };
  104. //---------------------------------------------------------------------------
  105. class TInstantOperationVisualizer : public TOperationVisualizer
  106. {
  107. public:
  108. __fastcall TInstantOperationVisualizer();
  109. __fastcall ~TInstantOperationVisualizer();
  110. private:
  111. TDateTime FStart;
  112. };
  113. //---------------------------------------------------------------------------
  114. #endif