ManaPlus
logindialog.h
Go to the documentation of this file.
1 /*
2  * The ManaPlus Client
3  * Copyright (C) 2004-2009 The Mana World Development Team
4  * Copyright (C) 2009-2010 The Mana Developers
5  * Copyright (C) 2011-2019 The ManaPlus Developers
6  * Copyright (C) 2019-2021 Andrei Karas
7  *
8  * This file is part of The ManaPlus Client.
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program. If not, see <http://www.gnu.org/licenses/>.
22  */
23 
24 #ifndef GUI_WINDOWS_LOGINDIALOG_H
25 #define GUI_WINDOWS_LOGINDIALOG_H
26 
27 #include "gui/widgets/window.h"
28 
30 #include "listeners/keylistener.h"
31 
32 class Button;
33 class CheckBox;
34 class DropDown;
35 class Label;
36 class LoginData;
37 class ServerInfo;
38 class TextField;
39 class UpdateListModel;
40 class UpdateTypeModel;
41 
47 class LoginDialog final : public Window,
48  public ActionListener,
49  public KeyListener
50 {
51  public:
58  ServerInfo *const server,
59  std::string *const updateHost) A_NONNULL(3, 4);
60 
62 
63  ~LoginDialog() override final;
64 
65  void postInit() override final;
66 
70  void action(const ActionEvent &event) override final;
71 
75  void keyPressed(KeyEvent &event) override final;
76 
77  void close() override final;
78 
79  static std::string savedPasswordKey;
80  static std::string savedPassword;
81 
82  private:
87  bool canSubmit() const;
88 
89  void prepareUpdate();
90 
91  void mergeUpdateHosts();
92 
95 
109 
110  std::string *mUpdateHost;
111  std::string mServerName;
112 };
113 
114 #endif // GUI_WINDOWS_LOGINDIALOG_H
Definition: button.h:102
Definition: label.h:91
Button * mLoginButton
Definition: logindialog.h:103
TextField * mPassField
Definition: logindialog.h:97
void keyPressed(KeyEvent &event)
UpdateListModel * mUpdateListModel
Definition: logindialog.h:107
static std::string savedPasswordKey
Definition: logindialog.h:79
static std::string savedPassword
Definition: logindialog.h:80
ServerInfo * mServer
Definition: logindialog.h:94
std::string * mUpdateHost
Definition: logindialog.h:110
Button * mServerButton
Definition: logindialog.h:102
TextField * mUserField
Definition: logindialog.h:96
LoginData * mLoginData
Definition: logindialog.h:93
bool canSubmit() const
void postInit()
LoginDialog(LoginData &data, ServerInfo *const server, std::string *const updateHost)
Definition: logindialog.cpp:66
void mergeUpdateHosts()
std::string mServerName
Definition: logindialog.h:111
CheckBox * mCustomUpdateHost
Definition: logindialog.h:105
TextField * mUpdateHostText
Definition: logindialog.h:106
CheckBox * mKeepCheck
Definition: logindialog.h:98
Label * mUpdateTypeLabel
Definition: logindialog.h:99
void prepareUpdate()
Button * mRegisterButton
Definition: logindialog.h:104
UpdateTypeModel * mUpdateTypeModel
Definition: logindialog.h:100
DropDown * mUpdateHostDropDown
Definition: logindialog.h:108
DropDown * mUpdateTypeDropDown
Definition: logindialog.h:101
void action(const ActionEvent &event)
Definition: window.h:102
#define A_NONNULL(...)
Definition: localconsts.h:168
#define A_NONNULLPOINTER
Definition: localconsts.h:266
#define final
Definition: localconsts.h:46
#define A_DELETE_COPY(func)
Definition: localconsts.h:53
uint32_t data