Authenticate.h 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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, int MaxLen);
  65. TList * __fastcall GeneratePrompt(UnicodeString Instructions, TStrings * Prompts,
  66. TStrings * Results);
  67. void __fastcall DoCancel();
  68. void __fastcall AdjustLogView();
  69. private:
  70. void * FShowAsModalStorage;
  71. TWinControl * FFocusControl;
  72. TSessionData * FSessionData;
  73. TTerminal * FTerminal;
  74. UnicodeString FStatus;
  75. TWinControl * FPromptParent;
  76. int FPromptLeft;
  77. int FPromptTop;
  78. int FPromptRight;
  79. int FPromptEditGap;
  80. int FPromptsGap;
  81. TNotifyEvent FOnCancel;
  82. };
  83. //---------------------------------------------------------------------------
  84. #endif