Authenticate.h 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. TPanel *SessionRememberPasswordPanel;
  37. TCheckBox *SessionRememberPasswordCheck;
  38. void __fastcall FormShow(TObject *Sender);
  39. void __fastcall HelpButtonClick(TObject *Sender);
  40. void __fastcall FormResize(TObject *Sender);
  41. public:
  42. __fastcall TAuthenticateForm(TComponent * Owner);
  43. virtual __fastcall ~TAuthenticateForm();
  44. void __fastcall Init(TTerminal * Terminal);
  45. void __fastcall ShowAsModal();
  46. void __fastcall HideAsModal();
  47. void __fastcall Log(const UnicodeString Message);
  48. bool __fastcall PromptUser(TPromptKind Kind, UnicodeString Name, UnicodeString Instructions,
  49. TStrings * Prompts, TStrings * Results, bool ForceLog, bool StoredCredentialsTried);
  50. void __fastcall Banner(const UnicodeString & Banner, bool & NeverShowAgain,
  51. int Options);
  52. __property TTerminal * Terminal = { read = FTerminal };
  53. __property TNotifyEvent OnCancel = { read = FOnCancel, write = FOnCancel };
  54. protected:
  55. void __fastcall ClearLog();
  56. void __fastcall AdjustControls();
  57. bool __fastcall Execute(UnicodeString Status, TPanel * Panel,
  58. TWinControl * FocusControl, TButton * DefaultButton, TButton * CancelButton,
  59. bool FixHeight, bool Zoom, bool ForceLog);
  60. virtual void __fastcall CreateParams(TCreateParams & Params);
  61. virtual void __fastcall Dispatch(void * AMessage);
  62. void __fastcall WMNCCreate(TWMNCCreate & Message);
  63. TLabel * __fastcall GenerateLabel(int Current, UnicodeString Caption);
  64. TCustomEdit * __fastcall GenerateEdit(int Current, bool Echo);
  65. TList * __fastcall GeneratePrompt(UnicodeString Instructions, TStrings * Prompts);
  66. void __fastcall DoCancel();
  67. void __fastcall AdjustLogView();
  68. private:
  69. void * FShowAsModalStorage;
  70. TWinControl * FFocusControl;
  71. TSessionData * FSessionData;
  72. TTerminal * FTerminal;
  73. UnicodeString FStatus;
  74. TWinControl * FPromptParent;
  75. int FPromptLeft;
  76. int FPromptTop;
  77. int FPromptRight;
  78. int FPromptEditGap;
  79. int FPromptsGap;
  80. TNotifyEvent FOnCancel;
  81. };
  82. //---------------------------------------------------------------------------
  83. #endif