1
0

Interface.h 3.5 KB

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