1
0

Interface.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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 GetRegistryKey();
  12. void __fastcall Busy(bool Start);
  13. UnicodeString __fastcall AppNameString();
  14. UnicodeString __fastcall SshVersionString();
  15. void __fastcall CopyToClipboard(UnicodeString Text);
  16. int __fastcall StartThread(void * SecurityAttributes, unsigned StackSize,
  17. TThreadFunc ThreadFunc, void * Parameter, unsigned CreationFlags,
  18. TThreadID & ThreadId);
  19. // Order of the values also define order of the buttons/answers on the prompts
  20. // MessageDlg relies on these to be <= 0x0000FFFF
  21. const unsigned int qaYes = 0x00000001;
  22. // MessageDlg relies that answer do not conflict with mrCancel (=0x2)
  23. const unsigned int qaNo = 0x00000004;
  24. const unsigned int qaOK = 0x00000008;
  25. const unsigned int qaCancel = 0x00000010;
  26. const unsigned int qaYesToAll = 0x00000020;
  27. const unsigned int qaNoToAll = 0x00000040;
  28. const unsigned int qaAbort = 0x00000080;
  29. const unsigned int qaRetry = 0x00000100;
  30. const unsigned int qaIgnore = 0x00000200;
  31. const unsigned int qaSkip = 0x00000400;
  32. const unsigned int qaAll = 0x00000800;
  33. const unsigned int qaHelp = 0x00001000;
  34. const unsigned int qaReport = 0x00002000;
  35. const unsigned int qaFirst = qaYes;
  36. const unsigned int qaLast = qaReport;
  37. const unsigned int qaNeverAskAgain = 0x00010000;
  38. const int qpFatalAbort = 0x01;
  39. const int qpNeverAskAgainCheck = 0x02;
  40. const int qpAllowContinueOnError = 0x04;
  41. const int qpIgnoreAbort = 0x08;
  42. struct TQueryButtonAlias
  43. {
  44. TQueryButtonAlias();
  45. unsigned int Button;
  46. UnicodeString Alias;
  47. TNotifyEvent OnClick;
  48. int GroupWith;
  49. TShiftState GrouppedShiftState;
  50. };
  51. typedef void __fastcall (__closure *TQueryParamsTimerEvent)(unsigned int & Result);
  52. struct TQueryParams
  53. {
  54. TQueryParams(unsigned int AParams = 0, UnicodeString AHelpKeyword = HELP_NONE);
  55. TQueryParams(const TQueryParams & Source);
  56. void Assign(const TQueryParams & Source);
  57. const TQueryButtonAlias * Aliases;
  58. unsigned int AliasesCount;
  59. unsigned int Params;
  60. unsigned int Timer;
  61. TQueryParamsTimerEvent TimerEvent;
  62. UnicodeString TimerMessage;
  63. unsigned int TimerAnswers;
  64. unsigned int Timeout;
  65. unsigned int TimeoutAnswer;
  66. unsigned int NoBatchAnswers;
  67. UnicodeString HelpKeyword;
  68. };
  69. enum TQueryType { qtConfirmation, qtWarning, qtError, qtInformation };
  70. enum TPromptKind
  71. {
  72. pkPrompt,
  73. pkFileName,
  74. pkUserName,
  75. pkPassphrase,
  76. pkTIS,
  77. pkCryptoCard,
  78. pkKeybInteractive,
  79. pkPassword,
  80. pkNewPassword
  81. };
  82. enum TPromptUserParam { pupEcho = 0x01, pupRemember = 0x02 };
  83. bool __fastcall IsAuthenticationPrompt(TPromptKind Kind);
  84. //---------------------------------------------------------------------------
  85. typedef void __fastcall (__closure *TFileFoundEvent)
  86. (TTerminal * Terminal, const UnicodeString FileName, const TRemoteFile * File,
  87. bool & Cancel);
  88. typedef void __fastcall (__closure *TFindingFileEvent)
  89. (TTerminal * Terminal, const UnicodeString Directory, bool & Cancel);
  90. //---------------------------------------------------------------------------
  91. #endif