Authenticate.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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. TListBox *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 LogViewMeasureItem(TWinControl *Control, int Index, int &Height);
  45. void __fastcall LogViewDrawItem(TWinControl *Control, int Index, TRect &Rect, TOwnerDrawState State);
  46. void __fastcall FormResize(TObject *Sender);
  47. public:
  48. __fastcall TAuthenticateForm(TComponent * Owner);
  49. virtual __fastcall ~TAuthenticateForm();
  50. void __fastcall Init(TTerminal * Terminal);
  51. void __fastcall ShowAsModal();
  52. void __fastcall Log(const UnicodeString Message);
  53. bool __fastcall PromptUser(TPromptKind Kind, UnicodeString Name, UnicodeString Instructions,
  54. TStrings * Prompts, TStrings * Results, bool ForceLog, bool StoredCredentialsTried);
  55. void __fastcall Banner(const UnicodeString & Banner, bool & NeverShowAgain,
  56. int Options);
  57. __property TTerminal * Terminal = { read = FTerminal };
  58. __property TNotifyEvent OnCancel = { read = FOnCancel, write = FOnCancel };
  59. protected:
  60. void __fastcall ClearLog();
  61. void __fastcall AdjustControls();
  62. bool __fastcall Execute(UnicodeString Status, TPanel * Panel,
  63. TWinControl * FocusControl, TButton * DefaultButton, TButton * CancelButton,
  64. bool FixHeight, bool Zoom, bool ForceLog);
  65. virtual void __fastcall CreateParams(TCreateParams & Params);
  66. virtual void __fastcall Dispatch(void * AMessage);
  67. void __fastcall WMNCCreate(TWMNCCreate & Message);
  68. TLabel * __fastcall GenerateLabel(int Current, UnicodeString Caption);
  69. TCustomEdit * __fastcall GenerateEdit(int Current, bool Echo);
  70. TList * __fastcall GeneratePrompt(UnicodeString Instructions, TStrings * Prompts);
  71. void __fastcall DoCancel();
  72. void __fastcall AdjustLogView();
  73. void __fastcall MakeLogItemVisible(int Index);
  74. int __fastcall LogItemHeight(int Index);
  75. void __fastcall RedrawLog();
  76. void __fastcall CMShowingChanged(TMessage & Message);
  77. private:
  78. void * FShowAsModalStorage;
  79. TWinControl * FFocusControl;
  80. TSessionData * FSessionData;
  81. TTerminal * FTerminal;
  82. UnicodeString FStatus;
  83. TWinControl * FPromptParent;
  84. int FPromptLeft;
  85. int FPromptTop;
  86. int FPromptRight;
  87. int FPromptEditGap;
  88. int FPromptsGap;
  89. TNotifyEvent FOnCancel;
  90. TFrameAnimation FFrameAnimation;
  91. bool FAnimationPainted;
  92. int FHorizontalLogPadding;
  93. int FVerticalLogPadding;
  94. TTextFormat FLogTextFormat;
  95. bool FShowNoActivate;
  96. };
  97. //---------------------------------------------------------------------------
  98. #endif