DlgWOLLogon.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /*
  2. ** Command & Conquer Renegade(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /******************************************************************************
  19. *
  20. * FILE
  21. * $Archive: /Commando/Code/Commando/DlgWOLLogon.h $
  22. *
  23. * DESCRIPTION
  24. * Quick match dialog
  25. *
  26. * PROGRAMMER
  27. * Denzil E. Long, Jr.
  28. * $Author: Denzil_l $
  29. *
  30. * VERSION INFO
  31. * $Revision: 14 $
  32. * $Modtime: 1/18/02 11:44p $
  33. *
  34. ******************************************************************************/
  35. #ifndef __DLGWOLLOGON_H__
  36. #define __DLGWOLLOGON_H__
  37. #include "DlgWOLWait.h"
  38. #include <wwui\popupdialog.h>
  39. #include <WWLib\Notify.h>
  40. #include <WWOnline\RefPtr.h>
  41. class DlgWOLLogon;
  42. class DlgWOLLogonEvent :
  43. public TypedEvent<DlgWOLLogonEvent, DlgWOLLogon>
  44. {
  45. public:
  46. enum Event {Cancel = 0, Login};
  47. Event GetEvent(void) const
  48. {return mEvent;}
  49. DlgWOLLogonEvent(Event event, DlgWOLLogon& dialog) :
  50. TypedEvent<DlgWOLLogonEvent, DlgWOLLogon>(dialog),
  51. mEvent(event)
  52. {}
  53. ~DlgWOLLogonEvent()
  54. {}
  55. private:
  56. Event mEvent;
  57. };
  58. class DlgWOLLogon :
  59. public PopupDialogClass,
  60. public Notifier<DlgWOLLogonEvent>
  61. {
  62. public:
  63. static bool DoDialog(const wchar_t* login, Observer<DlgWOLLogonEvent>* observer);
  64. void GetLogin(const wchar_t** login, const wchar_t** password, bool& encrypted);
  65. bool IsRememberLoginChecked(void);
  66. protected:
  67. DlgWOLLogon();
  68. virtual ~DlgWOLLogon();
  69. bool FinalizeCreate(const wchar_t* login);
  70. void On_Init_Dialog(void);
  71. void On_Command(int ctrl, int message, DWORD param);
  72. void UpdatePersonas(void);
  73. void SelectPersona(const wchar_t* name);
  74. void AutoComplete(const wchar_t* name);
  75. // Notifications
  76. void On_ComboBoxCtrl_Sel_Change(ComboBoxCtrlClass* combo, int id, int oldsel, int newsel);
  77. void On_ComboBoxCtrl_Edit_Change(ComboBoxCtrlClass* combo, int id);
  78. void On_EditCtrl_Change(EditCtrlClass* edit, int id);
  79. void On_EditCtrl_Enter_Pressed(EditCtrlClass* edit, int id);
  80. DECLARE_NOTIFIER(DlgWOLLogonEvent)
  81. private:
  82. DlgWOLLogon(const DlgWOLLogon&);
  83. const DlgWOLLogon& operator=(const DlgWOLLogon&);
  84. WideStringClass mLogin;
  85. bool mIsPasswordEncrypted;
  86. };
  87. #endif // __DLGWOLLOGON_H__