Authenticate.h 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. #include "GUITools.h"
  14. //---------------------------------------------------------------------------
  15. class TAuthenticateForm : public TForm
  16. {
  17. __published:
  18. TListView *LogView;
  19. TPanel *PasswordPanel;
  20. TPanel *PromptEditPanel;
  21. TLabel *PromptLabel1;
  22. TPasswordEdit *PromptEdit1;
  23. TPanel *BannerPanel;
  24. TMemo *BannerMemo;
  25. TCheckBox *NeverShowAgainCheck;
  26. TButton *BannerCloseButton;
  27. TButton *BannerHelpButton;
  28. TPanel *SavePasswordPanel;
  29. TCheckBox *SavePasswordCheck;
  30. TPanel *ButtonsPanel;
  31. TButton *PasswordOKButton;
  32. TButton *PasswordCancelButton;
  33. TButton *PasswordHelpButton;
  34. TLabel *InstructionsLabel;
  35. TLabel *PromptLabel2;
  36. TPasswordEdit *PromptEdit2;
  37. TPanel *SessionRememberPasswordPanel;
  38. TCheckBox *SessionRememberPasswordCheck;
  39. TPanel *TopPanel;
  40. TPanel *LeftPanel;
  41. TPaintBox *AnimationPaintBox;
  42. void __fastcall FormShow(TObject *Sender);
  43. void __fastcall HelpButtonClick(TObject *Sender);
  44. void __fastcall FormResize(TObject *Sender);
  45. public:
  46. __fastcall TAuthenticateForm(TComponent * Owner);
  47. virtual __fastcall ~TAuthenticateForm();
  48. void __fastcall Init(TTerminal * Terminal);
  49. void __fastcall ShowAsModal();
  50. void __fastcall HideAsModal();
  51. void __fastcall Log(const UnicodeString Message);
  52. bool __fastcall PromptUser(TPromptKind Kind, UnicodeString Name, UnicodeString Instructions,
  53. TStrings * Prompts, TStrings * Results, bool ForceLog, bool StoredCredentialsTried);
  54. void __fastcall Banner(const UnicodeString & Banner, bool & NeverShowAgain,
  55. int Options);
  56. __property TTerminal * Terminal = { read = FTerminal };
  57. __property TNotifyEvent OnCancel = { read = FOnCancel, write = FOnCancel };
  58. protected:
  59. void __fastcall ClearLog();
  60. void __fastcall AdjustControls();
  61. bool __fastcall Execute(UnicodeString Status, TPanel * Panel,
  62. TWinControl * FocusControl, TButton * DefaultButton, TButton * CancelButton,
  63. bool FixHeight, bool Zoom, bool ForceLog);
  64. virtual void __fastcall CreateParams(TCreateParams & Params);
  65. virtual void __fastcall Dispatch(void * AMessage);
  66. void __fastcall WMNCCreate(TWMNCCreate & Message);
  67. TLabel * __fastcall GenerateLabel(int Current, UnicodeString Caption);
  68. TCustomEdit * __fastcall GenerateEdit(int Current, bool Echo);
  69. TList * __fastcall GeneratePrompt(UnicodeString Instructions, TStrings * Prompts);
  70. void __fastcall DoCancel();
  71. void __fastcall AdjustLogView();
  72. private:
  73. void * FShowAsModalStorage;
  74. TWinControl * FFocusControl;
  75. TSessionData * FSessionData;
  76. TTerminal * FTerminal;
  77. UnicodeString FStatus;
  78. TWinControl * FPromptParent;
  79. int FPromptLeft;
  80. int FPromptTop;
  81. int FPromptRight;
  82. int FPromptEditGap;
  83. int FPromptsGap;
  84. TNotifyEvent FOnCancel;
  85. TFrameAnimation FFrameAnimation;
  86. bool FAnimationPainted;
  87. };
  88. //---------------------------------------------------------------------------
  89. #endif