Authenticate.h 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. //---------------------------------------------------------------------------
  2. #ifndef AuthenticateH
  3. #define AuthenticateH
  4. //---------------------------------------------------------------------------
  5. #include <Classes.hpp>
  6. #include <Controls.hpp>
  7. #include <StdCtrls.hpp>
  8. #include <Forms.hpp>
  9. #include <ComCtrls.hpp>
  10. #include <ExtCtrls.hpp>
  11. #include "PasswordEdit.hpp"
  12. #include "WinInterface.h"
  13. //---------------------------------------------------------------------------
  14. class TAuthenticateForm : public TForm
  15. {
  16. __published:
  17. TListView *LogView;
  18. TPanel *PasswordPanel;
  19. TPanel *PromptEditPanel;
  20. TLabel *PromptLabel1;
  21. TPasswordEdit *PromptEdit1;
  22. TPanel *BannerPanel;
  23. TMemo *BannerMemo;
  24. TCheckBox *NeverShowAgainCheck;
  25. TButton *BannerCloseButton;
  26. TButton *BannerHelpButton;
  27. TPanel *SavePasswordPanel;
  28. TCheckBox *SavePasswordCheck;
  29. TPanel *ButtonsPanel;
  30. TButton *PasswordOKButton;
  31. TButton *PasswordCancelButton;
  32. TButton *PasswordHelpButton;
  33. TLabel *InstructionsLabel;
  34. TLabel *PromptLabel2;
  35. TPasswordEdit *PromptEdit2;
  36. void __fastcall FormShow(TObject *Sender);
  37. void __fastcall HelpButtonClick(TObject *Sender);
  38. public:
  39. __fastcall TAuthenticateForm(TComponent * Owner);
  40. virtual __fastcall ~TAuthenticateForm();
  41. void __fastcall Init(TTerminal * Terminal);
  42. void __fastcall ShowAsModal();
  43. void __fastcall HideAsModal();
  44. void __fastcall Log(const UnicodeString Message);
  45. bool __fastcall PromptUser(TPromptKind Kind, UnicodeString Name, UnicodeString Instructions,
  46. TStrings * Prompts, TStrings * Results, bool ForceLog, bool StoredCredentialsTried);
  47. void __fastcall Banner(const UnicodeString & Banner, bool & NeverShowAgain,
  48. int Options);
  49. __property TTerminal * Terminal = { read = FTerminal };
  50. __property TNotifyEvent OnCancel = { read = FOnCancel, write = FOnCancel };
  51. protected:
  52. void __fastcall ClearLog();
  53. void __fastcall AdjustControls();
  54. bool __fastcall Execute(UnicodeString Status, TPanel * Panel,
  55. TWinControl * FocusControl, TButton * DefaultButton, TButton * CancelButton,
  56. bool FixHeight, bool Zoom, bool ForceLog);
  57. virtual void __fastcall CreateParams(TCreateParams & Params);
  58. virtual void __fastcall Dispatch(void * AMessage);
  59. void __fastcall WMNCCreate(TWMNCCreate & Message);
  60. TLabel * __fastcall GenerateLabel(int Current, UnicodeString Caption);
  61. TCustomEdit * __fastcall GenerateEdit(int Current, bool Echo, int MaxLen);
  62. TList * __fastcall GeneratePrompt(UnicodeString Instructions, TStrings * Prompts,
  63. TStrings * Results);
  64. void __fastcall DoCancel();
  65. private:
  66. void * FShowAsModalStorage;
  67. TWinControl * FFocusControl;
  68. TSessionData * FSessionData;
  69. TTerminal * FTerminal;
  70. UnicodeString FStatus;
  71. TWinControl * FPromptParent;
  72. int FPromptLeft;
  73. int FPromptTop;
  74. int FPromptRight;
  75. int FPromptEditGap;
  76. int FPromptsGap;
  77. TNotifyEvent FOnCancel;
  78. };
  79. //---------------------------------------------------------------------------
  80. #endif