1
0

pageCredentials.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #ifndef NULLSOFT_AUTH_LOGIN_PAGE_CREDENTIALS_HEADER
  2. #define NULLSOFT_AUTH_LOGIN_PAGE_CREDENTIALS_HEADER
  3. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  4. #pragma once
  5. #endif
  6. #include "./loginPage.h"
  7. #define NLPCM_FIRST (NLPM_PAGEFIRST + 0)
  8. #define NLPCM_SETACCOUNTRECOVERURL (NLPCM_FIRST + 1) //wParam - not used, lParam = (LPARAM)(LPCWSTR)pszAccountRecoverUrl; Return - no return value.
  9. #define LoginPageCredentials_SetAccountRecoverUrl(/*HWND*/ __hwnd, /*LPCWSTR*/ __url)\
  10. (SNDMSG((__hwnd), NLPCM_SETACCOUNTRECOVERURL, 0, (LPARAM)(__url)))
  11. #define NLPCM_SETACCOUNTCREATEURL (NLPCM_FIRST + 2) //wParam - not used, lParam = (LPARAM)(LPCWSTR)pszAccountCreateUrl; Return - no return value.
  12. #define LoginPageCredentials_SetAccountCreateUrl(/*HWND*/ __hwnd, /*LPCWSTR*/ __url)\
  13. (SNDMSG((__hwnd), NLPCM_SETACCOUNTCREATEURL, 0, (LPARAM)(__url)))
  14. #define NLPCM_SETUSERNAMELABEL (NLPCM_FIRST + 3) //wParam - not used, lParam = (LPARAM)(LPCWSTR)pszUsernameLabel; Return - no return value.
  15. #define LoginPageCredentials_SetUsernameLabel(/*HWND*/ __hwnd, /*LPCWSTR*/ __label)\
  16. (SNDMSG((__hwnd), NLPCM_SETUSERNAMELABEL, 0, (LPARAM)(__label)))
  17. #define NLPCM_SETPASSWORDLABEL (NLPCM_FIRST + 4) //wParam - not used, lParam = (LPARAM)(LPCWSTR)pszPasswordLabel; Return - no return value.
  18. #define LoginPageCredentials_SetPasswordLabel(/*HWND*/ __hwnd, /*LPCWSTR*/ __label)\
  19. (SNDMSG((__hwnd), NLPCM_SETPASSWORDLABEL, 0, (LPARAM)(__label)))
  20. class LoginPageCredentials : public LoginPage
  21. {
  22. protected:
  23. LoginPageCredentials(HWND hwnd, HWND hLoginbox);
  24. ~LoginPageCredentials();
  25. public:
  26. static HWND CreatePage(HWND hLoginbox, HWND hParent);
  27. protected:
  28. void UpdateLayout(BOOL fRedraw);
  29. BOOL OnInitDialog(HWND hFocus, LPARAM param);
  30. BOOL OnNotify(UINT controlId, const NMHDR *pnmh);
  31. BOOL OnGetLoginData(LoginData **ppLoginData);
  32. BOOL OnSetUsername(LPCWSTR pszUsername);
  33. BOOL OnSetPassword(LPCWSTR pszPassword);
  34. HWND OnGetFirstItem();
  35. void OnSetAccountRecoverUrl(LPCWSTR pszUrl);
  36. void OnSetAccountCreateUrl(LPCWSTR pszUrl);
  37. void OnSetUsernameLabel(LPCWSTR pszLabel);
  38. void OnSetPasswordLabel(LPCWSTR pszLabel);
  39. INT_PTR DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam);
  40. private:
  41. friend static HRESULT CALLBACK LoginPageCredentials_CreateInstance(HWND hwnd, HWND hLoginbox, LoginPage **instance);
  42. protected:
  43. LPWSTR accountRecoverUrl;
  44. LPWSTR accountCreateUrl;
  45. };
  46. #endif //NULLSOFT_AUTH_LOGIN_PAGE_CREDENTIALS_HEADER