From 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d Mon Sep 17 00:00:00 2001 From: Jef Date: Tue, 24 Sep 2024 14:54:57 +0200 Subject: Initial community commit --- Src/auth/Loginbox/popupAgreement.h | 48 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 Src/auth/Loginbox/popupAgreement.h (limited to 'Src/auth/Loginbox/popupAgreement.h') diff --git a/Src/auth/Loginbox/popupAgreement.h b/Src/auth/Loginbox/popupAgreement.h new file mode 100644 index 00000000..39f0c964 --- /dev/null +++ b/Src/auth/Loginbox/popupAgreement.h @@ -0,0 +1,48 @@ +#ifndef NULLSOFT_AUTH_LOGINPOPUP_AGREEMENT_HEADER +#define NULLSOFT_AUTH_LOGINPOPUP_AGREEMENT_HEADER + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#pragma once +#endif + +#include "./loginPopup.h" + +class LoginProvider; + +class LoginPopupAgreement : public LoginPopup +{ +protected: + LoginPopupAgreement(HWND hwnd); + ~LoginPopupAgreement(); + +public: + static HWND CreatePopup(HWND hParent, LoginProvider *provider); + +protected: + void UpdateLayout(BOOL fRedraw); + void EndDialog(INT_PTR code); + void UpdateMargins(); + + BOOL CreateProviderLinks(LPCWSTR pszProvider, LPCWSTR pszTos, LPCWSTR pszPrivacy, INT groupId, HWND hwndInsertAfter); + HDWP LayoutProviderLinks(HDWP hdwp, INT groupId, HWND hwndInsertAfter, INT x, INT y, UINT flags, SIZE *size); // pass hdwp = NULL to get ideal size + + + void OnLinkClicked(HWND hLink); + HBRUSH OnGetStaticColor(HDC hdc, HWND hControl); + LRESULT OnNotify(UINT controlId, const NMHDR *pnmh); + void OnParentNotify(UINT eventId, UINT wParam, LPARAM lParam); + BOOL OnUpdateWindowPos(const RECT* clientRect, RECT *rectOut); + BOOL OnInitDialog(HWND hFocus, LPARAM param); + void OnDestroy(); + +protected: + LONG marginLinkLeft; + LONG marginLinkFirst; + LONG marginLinkNext; + +private: + friend static HRESULT CALLBACK LoginPopupAgreement_CreateInstance(HWND hwnd, LPARAM param, LoginPopup **instance); +}; + + +#endif //NULLSOFT_AUTH_LOGINPOPUP_AGREEMENT_HEADER \ No newline at end of file -- cgit