Authenticate.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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(TSessionData * SessionData);
  42. void __fastcall ShowAsModal();
  43. void __fastcall HideAsModal();
  44. void __fastcall Log(const AnsiString Message);
  45. bool __fastcall PromptUser(TPromptKind Kind, AnsiString Name, AnsiString Instructions,
  46. TStrings * Prompts, TStrings * Results, bool ForceLog, bool StoredCredentialsTried);
  47. void __fastcall Banner(const AnsiString & Banner, bool & NeverShowAgain,
  48. int Options);
  49. protected:
  50. void __fastcall ClearLog();
  51. void __fastcall AdjustControls();
  52. bool __fastcall Execute(AnsiString Status, TPanel * Panel,
  53. TWinControl * FocusControl, TButton * DefaultButton, TButton * CancelButton,
  54. bool FixHeight, bool Zoom, bool ForceLog);
  55. virtual void __fastcall CreateParams(TCreateParams & Params);
  56. virtual void __fastcall Dispatch(void * AMessage);
  57. void __fastcall WMNCCreate(TWMNCCreate & Message);
  58. TLabel * __fastcall GenerateLabel(int Current, AnsiString Caption);
  59. TCustomEdit * __fastcall GenerateEdit(int Current, bool Echo, int MaxLen);
  60. TList * __fastcall GeneratePrompt(AnsiString Instructions, TStrings * Prompts,
  61. TStrings * Results);
  62. private:
  63. void * FShowAsModalStorage;
  64. TWinControl * FFocusControl;
  65. TSessionData * FSessionData;
  66. AnsiString FStatus;
  67. TWinControl * FPromptParent;
  68. int FPromptLeft;
  69. int FPromptTop;
  70. int FPromptRight;
  71. int FPromptEditGap;
  72. int FPromptsGap;
  73. };
  74. //---------------------------------------------------------------------------
  75. #endif